query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
global Image, Blob, URL, createImageBitmap, location / Loads images asynchronously image.crossOrigin can be set via opts.crossOrigin, default to 'anonymous' returns a promise tracking the load | function loadImage(url, opts) {
url = pathPrefix ? pathPrefix + url : url;
if (typeof Image === 'undefined') {
// In a web worker
// XMLHttpRequest throws invalid URL error if using relative path
// resolve url relative to original base
url = new URL(url, location.pathname).href;
return (0, _br... | [
"load() {\n return new Promise((function(resolve, reject) {\n let img = null;\n /* Determine the image to use */\n if (this.emote) {\n /* Effect wants an emote used */\n img = this._host.twitchEmote(this.emote);\n } else if (this.imageUrl) {\n /* Effect gave a URL */\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send shuffled card order to server | function sendOrder(order)
{
$.ajax({
url: "/shuffle",
type: "POST",
traditional: true, /*- make the array send as an array -*/
data: {order: order},
success:function(resp) {
if (resp.gameID != -1){
$('#game'... | [
"function updateDeck() {\n\tshuffledCardsArray = shuffle(cards); // Calls shuffle function\n\tcreateDeck(shuffledCardsArray); // Calls createDeck function (that takes shuffled array as an argument)\n}",
"function shuffle(deck) {\n\t// Shuffle\n\tfor (let i=0; i<1000; i++) {\n\t // Swap two randomly selected ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the editor is already destroyed. | get isDestroyed() {
var _a;
// @ts-ignore
return !((_a = this.view) === null || _a === void 0 ? void 0 : _a.docView);
} | [
"detectDestroy() {\n if(this.parent === null) {\n this.destroy();\n return true;\n }\n return false;\n }",
"static isDetached() {\n return !this.isAttached();\n }",
"isDetached() {\n return !this.isAttached();\n }",
"isEditor(value) {\n if (!isPlainObject(value)) r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dump to the js console (xulrunner jsconsole) | function jsdump(str)
{
Components.classes['@mozilla.org/consoleservice;1']
.getService(Components.interfaces.nsIConsoleService)
.logStringMessage(str);
} | [
"dump() {\n\t\tconsole.log(`\\n\"${this.constructor.name}\": ${JSON.stringify(this, null, 4)}`);\n\t}",
"function dumpHTMLContent()\n{\n\t// the functional code is in the page dump.html\n\twindow.open(PATH_Lib + \"/Common/Test/Lib/dump.html\",\"sourceWindow\",\"resizable=yes scrollbars=no menubar=no\");\n\treturn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
!md addmedia Add a CODEC to the SDP object. | addmedia( sdp, codec )
{
switch( codec )
{
case "pcmu":
{
sdp.m[ 0 ].payloads.push( 0 );
sdp.m[ 0 ].rtpmap[ "0" ] = { encoding: "PCMU", clock: "8000" };
break;
}
case "pcma":
{
sdp.m[ 0 ].payloads.push( 8 );
sdp.m[ 0 ].rtpmap[ "8" ] = { enc... | [
"addMedia() {\n\n this.mediaFrame.open();\n }",
"addMedia(mediaType, uid, url, options) {\n console.log(`add media ${mediaType} ${uid} ${url}`);\n let media = this.data.media || [];\n\n if (mediaType === 0) {\n //pusher\n media.splice(0, 0, {\n key: options.key,\n type: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the markup for items in the cart. | function renderCart() {
// Get variables.
var cartEl = document.querySelector('#cart .cart__content'),
cartItem = '',
items = '';
cart.items.forEach(function (item) {
// Use template literal to create our cart item content.
cartItem = `<div id="item${item.id}" class="cart__row cart-item text-... | [
"render() {\n\t\tif (orinoco.cart.products.length !== 0) {\n\t\t\tthis.domTarget.innerHTML = this.templateCartList();\n\t\t\tnew Form({ name: \"form\" }, document.querySelector(\"#order-form\"));\n\t\t}\n\t\telse this.domTarget.innerHTML = this.templateEmptyCart();\n\t}",
"function showCart() {\n console.log(c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the distance from the point (x, y) to the furthest corner of a rectangle. | function distanceToFurthestCorner(x, y, rect) {
const distX = Math.max(Math.abs(x - rect.left), Math.abs(x - rect.right));
const distY = Math.max(Math.abs(y - rect.top), Math.abs(y - rect.bottom));
return Math.sqrt(distX * distX + distY * distY);
} | [
"function findBestCorner() {\n\t\t\n\t}",
"function findCorner() {\n\t\tvar availTiles = emptyTiles(board);\n\t\t\n\t\tvar corner = availTiles.filter(tile => tile == 0 || tile == 2 || tile == 6 || tile == 8);\n\n\t\treturn corner;\n\t}",
"function furthestDistance(arr){\n let m = 0;\n for (var [x1,y1] of arr)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
will highlight all items with color | function highlightItems(color, items){
items.style({"stroke":color, "opacity": "1"});
} | [
"function highlightFromList(index) {\n\t\t$('.' + column + '-result-li').css({ 'background':'#fff' });\n\t\t$('.' + column + '-result-li').eq(index).css({ 'background': '#eee'});\n\t}",
"function theClickedItem(item) {\n setHighlightItem(item);\n }",
"function setColorHighlight( color ){\n \n if(color... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Quick check that indicates the platform may be Cordova | function _isLikelyCordova() {
return _isAndroidOrIosCordovaScheme() && typeof document !== 'undefined';
} | [
"function chkMobile() {\r\n\treturn /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);\r\n}",
"function IsPC() {\n var userAgentInfo = navigator.userAgent\n var Agents = [\"Android\", \"iPhone\", \"SymbianOS\", \"Windows Phone\", \"iPad\", \"iPod\"]\n var devType = 'PC'\n for (var v = 0; v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the basket object from a cookie. | function getBasket() {
var str = getCookie(cookieName);
return str ? JSON.parse(str) : {};
} | [
"function saveBasket(objBasket) {\n var str = JSON.stringify(objBasket);\n setCookie(cookieName, str);\n }",
"async getOrCreateBasket() {\n const customerBaskets = await api.shopperCustomers.getCustomerBaskets({\n parameters: {customerId: customer?.customerId}\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete meeting with id from this user's meeting list | deleteMeeting(id){
this.meetings = this.meetings.filter(
(meeting) => {
return meeting.id !== id;
}
)
} | [
"async deleteAppointment(id) {\n return Appointment.destroy({where:{id}})\n }",
"function delUserForMeeting( data, callback ) {\n\t\t\tvar url = '/meetingdelusers';\n\n\t\t\tnew IO({\n\t\t\t\turl: url,\n\t\t\t\ttype: 'post',\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\tcallback(data);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the copy for the user to the copydata of the element when clicked | function copyToClipboard() {
const el = document.createElement('textarea');
el.value = event.target.getAttribute('copy-data');
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.... | [
"function copyBattleToClipboard () {\n $('.copy-button').on('click', function() {\n var copy_link = $(this).closest('.copy-modal').find('.copy-link');\n copy_link.focus();\n copy_link.select();\n document.execCommand('copy');\n });\n}",
"function CopySongData() {\n document.querySelector('#songDa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the array of RSSI samples | function updateRssiArray(sample) {
for(var receiverTemp in $scope.receivers) {
var updated = false;
var seconds = $scope.rssiSeconds;
// Try to update the rssi corresponding to the receiver.
for(var cRadio = 0;
cRadio < sample[$scope.transmitterId].radio... | [
"function updateRssiSamples(sample) {\n for(var transmitterTemp in $scope.transmitters) {\n if(!(transmitterTemp in $scope.rssiSamples)) {\n $scope.rssiSamples[transmitterTemp];\n $scope.rssiSamples[transmitterTemp] = [];\n }\n if(sample[transmitterTemp]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Description for Creates the artifacts for web site, or a deployment slot. | async function deploysWorkflowArtifactsSlot() {
const subscriptionId =
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345";
const resourceGroupName = process.env["APPSERVICE_RESOURCE_GROUP"] || "testrg123";
const name = "testsite2";
const slot = "testsSlot";
const workflowA... | [
"createSiteScript(title, description, content) {\n return SiteScriptsCloneFactory(this, `CreateSiteScript(Title=@title,Description=@desc)?@title='${encodePath(title)}'&@desc='${encodePath(description)}'`)\n .run(content);\n }",
"function createDeployment_() {\r\n progress = c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that checks if all questions are answered | function allAreAnswered(questions){
if(questions.status===1){
return true
}
} | [
"function isAnswersCountValidOnSubmit() {\n var countValues = 0;\n for( var i=0; i < $scope.form.masterAnswers.length; i++ ) {\n if ($scope.form.masterAnswers[i].checked == true) {\n countValues++;\n }\n }\n if (countValues < 2) {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads light properties from the light to the shader Transforms light position according to provided matrix or according to the identity matrix if no matrix is provided. Light properties are expected to appear on same object as light locations | function setLight(light, matrix)
{
var mv;
if (arguments.length == 1) mv = mat4();
else mv = matrix;
gl.uniform3fv(light.diffuseLoc, light.diffuse);
gl.uniform3fv(light.ambientLoc, light.ambient);
gl.uniform3fv(light.specularLoc, light.specular);
gl.uniform4fv(light.positionLoc, mult(mv,light.posi... | [
"uploadNormalMatrixToShader() {\r\n mat3.fromMat4(this.nMatrix,this.mvMatrix);\r\n mat3.transpose(this.nMatrix,this.nMatrix);\r\n mat3.invert(this.nMatrix,this.nMatrix);\r\n gl.uniformMatrix3fv(shaderProgram.nMatrixUniform, false, this.nMatrix);\r\n }",
"function setMaterial(mat)\n{\n gl.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[Function name]f_ProcessJSONData_Main [Description]function to analyse input frame data in order to execute the appropriate processing [inputs]frame : frame to be processed [jQuery]NO | function f_ProcessJSONData_Main(frame){
// log AppID received
//f_RADOME_log(frame.AppID);
//Check AppID and do what fit with that
var id = parseInt(frame.AppID);
switch(id) // inspect id found to dispatch the appropriate processing
{
case APP_ID.LIST:
// load JSON data (into 'frame') to update and fill ... | [
"function f_ProcessJSONData_CAN(frame_can){\n\t//Check AppID and do what fit with that\n\tvar id = parseInt(frame_can.AppID);\n\n\tswitch(id)\n\t{\n\t\tcase APP_ID.CAN1:\n\t\t\t//Update GUI for the 'gauge' element\n\t\t\tgauge.setValue(frame_can.DataValue);\n\t\t\tgauge.draw();\t\n\t\t\tgRADOME_Conf.GUI_BarGraph[0]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return an Array of form elements that are children of the DIV element with id = the given divId string. | function getDetailFormElements(divId) {
var detailElements = new Array();
var detailDiv = getObject(divId);
//to be canceled
var allFormElements = detailDiv.document.forms[0].elements;
var detailIdx = 0;
for (var i = 0; i < allFormElements.length; i++) {
if (isNodeChildOfId(allFor... | [
"function formToFieldList(formID) {\n let form = document.getElementById(formID).elements;\n let formValues = [];\n\n for (let i = 0; i < form.length; i++) {\n if (form[i].type === 'text') {\n formValues.push(form[i].value)\n }\n if (form[i].type === 'checkbox') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get transaction action creator | function getTransactionActionCreator(data) {
return {
type: GETTRANS,
payload: {transactions: data}
}
} | [
"function actionCreator(action){\n return action\n}",
"function getAction() {\r\n\r\n return( action );\r\n\r\n }",
"function createAction(type) {\n function actionCreator(payload) {\n return {\n type: type,\n payload: payload\n };\n }\n\n actionCreator.toString = f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: docEdits.mergeCodeBlocks DESCRIPTION: Looks at the last 2 elements of the new srcArray that's being built. Let's call them block1 and block2. Preconditions: block1 and block2 are both enclosed by openDelim and closeDelim block1 and block2 may be safely merged into one block Merges block1 and block2, and stuff... | function docEdits_mergeCodeBlocks(srcArray, openDelim, closeDelim)
{
var pattern, myRe, match, whiteSpace, innerWhiteSpace, retval = "";
var eolCount = 0, i;
var block2 = srcArray.pop();
var block1 = srcArray.pop();
var before = "";
var block1New = "";
pattern = "(\\s*)" + dwscripts.escRegExpChars(closeD... | [
"function docEdits_deleteCodeBlock(srcArray, docEditNode)\n{\n var pattern, myRe, pos;\n\n var whiteSpace = \" \\f\\n\\r\\t\\v\";\n\n var bPutCloseDelim = false;\n var bPutOpenDelim = false;\n\n var bPutStartingEOL = true\n var bPutEndingEOL = true;\n\n var node = docEditNode.priorNode;\n var thisNode = dws... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkShipToAddress update ship to address checkbox UI to checked state | function checkShipToAddress() {
updateSelectedCheckboxView($.ship_to_address_checkbox);
} | [
"function checkShipToStore() {\n updateSelectedCheckboxView($.ship_to_current_store_checkbox);\n}",
"toggleCheckbox() {\n this.setState({\n saveShippingInfo: !this.state.saveShippingInfo\n });\n }",
"function changeStateCheckBox() {\n checkedElements = [];\n // add items which are checked\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current logged in LoL user's summoner name | static getCurrentSummonerName() {
return new Promise(async (accept, reject) => {
const [err, data] = await to(this.getCurrentSummoner());
if (err) {
log.debug('Failed to get current summoner name: %s', err);
reject(err);
}
// data.displayName is summonername with caps and spa... | [
"function getCurrentOnCallUsername() {\n\tlet user = \"\"\n\t// Get the rotation that has an onCall user.\n\tfor (let i in this.raw.schedule) {\n\t\tlet sched = this.raw.schedule[i]\n\t\tif (sched.onCall) {\n\t\t\tuser = sched.onCall\n\t\t}\n\t}\n\n\t// Return Error if no user is on call.\n\tif (!user) {\n\t\tretur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if this HED tag has the 'unitClass' attribute. | get hasUnitClass() {
return this._memoize('hasUnitClass', () => {
if (!this.schema.entries.definitions.has('unitClasses')) {
return false
}
if (this.takesValueTag === null) {
return false
}
return this.takesValueTag.hasUnitClasses
})
} | [
"function is_valid_ucum_unit(unit) {\n if (unitValidityCache[unit] != null) {\n return unitValidityCache[unit];\n } else {\n try {\n ucum.parse(ucum_unit(unit));\n unitValidityCache[unit] = true;\n return true;\n } catch (error) {\n unitValidityCache[unit] = false;\n return false... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A list of programyear objectives, sorted by position. | get sortedProgramYearObjectives() {
return this._programYearObjectives?.slice().sort(sortableByPosition);
} | [
"function sortYear() {\r\n document.querySelector('#yearH').addEventListener('click', function (e) {\r\n const year = paintings.sort((a, b) => {\r\n return a.YearOfWork < b.YearOfWork ? -1 : 1;\r\n })\r\n displayPaint(year);\r\n })\r\n }",
"iYearToJ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changes data to the chart if new 'paystationID' otherwise add new dataset | function changeChartData(plotData,payStationId, hover) {
if (hover) {
title = 'Pay Station' + payStationId;
} else {
title = 'Pay Station Hover';
}
var dataArray=[];
dataArray[0]=title;
dataArray.push.apply(dataArray, plotData);
console.log(dataArray);
chart.load({
... | [
"function addDataToCharts(data)\n{\n\t// Probably a better way to do this\n\tif (data.length != 0) {\n\tif (data[data.length-1].timekey.substring(11,16) == totalChart.datasets[0].points[totalChart.datasets[0].points.length-1].label)\n\t{\n\t\t/*console.log(\"den siste labelen er : \" + totalChart.datasets[0].points... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper for getting ISO image value | function iso_image_value(mod) {
var cdimage_chooser = $('#id_iso-image');
if (cdimage_chooser.length) {
var cdimage2_chooser = $('#id_iso2-image');
var cdimage_once = $('#id_iso-image-once').prop('checked');
var iso = cdimage_chooser.val();
var ret = [iso, cdimage_once, null];
// Save last cho... | [
"function get_img(i,f){var b,a=__CONF__.img_url+\"/img_new/{0}--{1}-{2}-1\",g=__CONF__.img_url+\"/img_src/{0}\",c=\"d96a3fdeaf68d3e8db170ad5\",d=\"43e2e6f41e3b3ebe22aa6560\",k=\"726a17bd880cff1fb375718c\",j=\"6ea1ff46aab3a42c975dd7ab\";i=i||\"0\";f=f||{};ObjectH.mix(f,{type:\"head\",w:30,h:30,sex:1});if(i!=\"0\"){i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function, `deepDup(arr)`, that will perform a "deep" duplication of the array and any interior arrays. A deep duplication means that the array itself, as well as any nested arrays (no matter how deeply nested) are duped and are completely different objects in memory than those in the original array. | function deepDup(arr) {
let duped = [];
for (let i = 0; i < arr.length; i++) {
let ele = arr[i];
if (Array.isArray(ele)) {
duped.push(deepDup(ele));
} else {
duped.push(ele);
}
}
return duped;
} | [
"function deepClone(array) {\n return JSON.parse(JSON.stringify(array));\n}",
"function duplicate(arr){\n arr.forEach(item => arr.push(item))\n return arr;\n}",
"function duplicates(arr) {\n \n // our hash table to store each element\n // in the array as we pass through it\n var hashTable = [];\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to check if cllick position is inside a card in the play area | function isInside(x, y, card) {
let w = card.image.width
let h = card.image.height
let cx = card.x
let cy = card.y
if ( x > cx && x < ( cx + w ) && y > cy && y < ( cy + h )
&& card.state == 'table') {
return {w: w, h: h, cx: cx, cy: cy}
} els... | [
"function checkColision(cactus){\n const dinoY = dino.style.bottom.split('px')[0]\n const cactusX = cactus.offsetLeft;\n \n if(cactusX <= divSize && cactusX >= -divSize && dinoY<= divSize){\n //log(true)\n inGame = false;\n }else{\n //log(false);\n }\n}",
"function isOpenPos(x, y) {\n\tif (x < 0 &&... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trims a timeline so that objects only exist within a specified time period. | trimTimeline(timeline, trim) {
// The new resolved objects.
let newObjects = {};
// Iterate through resolved objects.
Object.keys(timeline.objects).forEach((objId) => {
const obj = timeline.objects[objId];
const resultingInstances = [];
obj.resolved.in... | [
"function validateTimeline(timeline, strict) {\n var uniqueIds = {};\n _.each(timeline, function (obj) {\n validateObject0(obj, strict, uniqueIds);\n });\n}",
"checkStartTimes() {\n if (Object.keys(this.startTimes).length > 0) { // Are there any startTimes to check?\n let thisDate = new Da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear the value back to the default. | clear() {
this.set(this.DEFAULT_VALUE);
} | [
"reset() {\r\n\t\tthis.changeState(this.initial);\r\n\t}",
"_clearDate() {\n this.value = undefined;\n this.display = '';\n }",
"clearDisplay() {\n\t\tconst {displayValue} = this.state\n\t\tthis.setState({\n\t\t\tdisplayValue: '0'\n\t\t})\n\t}",
"function inputClear(){\n display.value = \"\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task 6 Find max product of triplets | function findMaxProduct(array) {
} | [
"function MaximumProductOfThree(arr) {\n let maxArr = [];\n for (let i = 0; i < arr.length; i++) {\n let maxNum = Math.max(...arr);\n maxArr.push(maxNum);\n if (maxArr.length === 3) {\n return maxArr[0] * maxArr[1] * maxArr[2];\n }\n }\n return \"error\";\n}",
"function bruteForceMaxSubarray(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recompute this DepItem, calling the callback given in the constructor. | recompute() {
this._priority = 0;
this._callback.call(this._context);
} | [
"itemsChanged() {\n this._processItems();\n }",
"_refresh(){\n this._refreshSize();\n this._refreshPosition();\n }",
"_invalidateSortCache() {\n this._sorted = {};\n }",
"function onRecalculationPhase() {\n if (p.recalcQueued) {\n p.recalcPhase = 0;\n recalculateDimen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return if A is an ancestor of B. | function isAncestor(instA, instB) {
while (instB) {
if (instA === instB || instA === instB.alternate) {
return true;
}
instB = getParent(instB);
}
return false;
} | [
"function hasNodeAsAncestor(self, candidate) {\n\t\t\t\twhile ((self.parent != null) && (self.parent != candidate)) {\n\t\t\t\t\tself = self.parent;\n\t\t\t\t}\n\t\t\t\treturn ((self.parent == candidate) && (candidate != null));\n\t\t\t}",
"function is_ancestor(node, target)\r\n{\r\n while (target.parentNode) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the toast manager state, finds the toast that matches the id and return its position and index | function findToast(toasts, id) {
var position = getToastPosition(toasts, id);
var index = position ? toasts[position].findIndex(toast => toast.id === id) : -1;
return {
position,
index
};
} | [
"function getValidIndex () {\n return $toasts.get().findIndex(toast => toast.key === toastId)\n }",
"posById(id){\n let slot = this._index[id];\n return slot ? slot[1] : -1\n }",
"modifyToast(index)\n {\n this.setState({toasts:this.state.toasts.slice(0,index+1)});\n }",
"function get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abstract method changing Result | updateResult() {
} | [
"set result(newResult) {\n this._result = newResult;\n setValue(`cmi.interactions.${this.index}.result`, newResult);\n }",
"setResult(result) {\n console.log('result: ', result);\n if (null != this.config.getCacheHook()) {\n this.data = this.config.getCacheHook().put(result);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MARK SVG path specification functions flatFlowPathMaker(f): Returns an SVG path drawing a parallelogram between 2 nodes. Used for the "d" attribute on a "path" element when curvature = 0 OR when there is no curve to usefully draw (i.e. the flow is ~horizontal). | function flatFlowPathMaker(f) {
const sx = f.source.x + f.source.dx, // source's trailing edge
tx = f.target.x, // target's leading edge
syTop = f.source.y + f.sy, // source flow top
tyBot = f.target.y + f.ty + f.dy; // target flow bottom
f.renderAs = 'flat'; // Render this p... | [
"function curvedFlowPathFunction(curvature) {\n return (f) => {\n const syC = f.source.y + f.sy + f.dy / 2, // source flow's y center\n tyC = f.target.y + f.ty + f.dy / 2, // target flow's y center\n sEnd = f.source.x + f.source.dx, // source's trailing edge\n tStart = f.target.x; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bring login status from local storage (PC) | function loginStatusToStorage() {
localStorage.loggedIn = loggedIn;
localStorage.loggedInID = loggedInID;
} | [
"function loginStatusToVars() {\n\tloggedIn = localStorage.loggedIn;\n\tloggedInID = localStorage.loggedInID;\n}",
"onLoginStart () {\n this.loggingIn = true\n this.loggedIn = false\n }",
"function loadLoginData () {\n let savedUsername = config.get('username')\n let savedPassword... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if text exceeds the 17 character limit | function limitText(){
var str = primaryOutput.innerHTML;
var textLimit = 17;
str.split("");
//If text exceeds limit and is less than 4 extra, reduce font size
//If text exceeds limit between 5 and 9 characters reduce font size more
//If text exceeds limit by more than 9 characters print message to screen... | [
"static validateShortTextExceedsLength(pageClientAPI, dict) {\n\n //New short text length must be <= global maximum\n let max = libCom.getAppParam(pageClientAPI, 'MEASURINGPOINT', 'ShortTextLength');\n\n if (libThis.evalShortTextLengthWithinLimit(dict, max)) {\n return Promise.resolv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Spawn an seperate process to kill the parent and the mongod instance to ensure "mongod" gets stopped in any case | _launchKiller(parentPid, childPid) {
this.debug(`_launchKiller: Launching Killer Process (parent: ${parentPid}, child: ${childPid})`);
// spawn process which kills itself and mongo process if current process is dead
const killer = (0, child_process_1.fork)(path.resolve(__dirname, '../../scripts/... | [
"function killMongorestore( collectionName, callback ) {\n var\n cmdKILL = 'kill ',\n exec = require( 'child_process' ).exec;\n\n mongorestoreCheck( collectionName, function( err, pid ) {\n if( err ) {\n return callback( err );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the HTML input element for the csrfToken which is used by the Crawlspace server to validate the user | function createValidationToken() {
const token = document.createElement('input')
// Hide the input element within the form
token.type = 'hidden'
// Assign the value of the csrfToken based on the global variable generated and loaded inline script in the crawl.html
token.value = csrfToken
token.na... | [
"static async getCsrfToken() {\n return new Promise((resolve, reject) => {\n if (typeof window === 'undefined') {\n return reject(Error('This method should only be called on the client'))\n }\n\n let xhr = new XMLHttpRequest()\n xhr.open('GET', '/auth/csrf', true)\n xhr.onreadysta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save interval therapy info | function handleSaveIntervalTherapyInfo(agent) {
const descrizione = agent.parameters.descrizione;
const farmaco = agent.parameters.farmaco;
const giorni = agent.parameters.giorni;
const orario = agent.parameters.orario;
// Test ok
const senderID = getSenderID();
... | [
"function doInterval() {\n getAddress();\n getAmountEth();\n getAmountToken();\n}",
"function handleSaveDailyTherapyInfo(agent) {\n const descrizione = agent.parameters.descrizione;\n const farmaco = agent.parameters.farmaco;\n const orario = agent.parameters.orario;\n\n // Test... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region max end computation | function computeMaxEnd(node) {
var maxEnd = node.end;
if (node.left !== SENTINEL) {
var leftMaxEnd = node.left.maxEnd;
if (leftMaxEnd > maxEnd) {
maxEnd = leftMaxEnd;
}
}
if (node.right !== SENTINEL) {
var rightMaxEnd = node.right.maxEnd + node.delta;
... | [
"function max_subarray(A){\n let max_ending_here = A[0]\n let max_so_far = A[0]\n\n for (let i = 1; i < A.length; i++){\n max_ending_here = Math.max(A[i], max_ending_here + A[i])\n // console.log(max_ending_here)\n max_so_far = Math.max(max_so_far, max_ending_here)\n // console.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 231 Create a function that takes a sentence and turns every "i" into "wi" and "e" into "we", and add "owo" at the end. | function owofied(sentence) {
const a = sentence.replace(/i/g, "wi");
const b = a.replace(/e/g, "we");
return b + " owo";
} | [
"function encodeConsonantWord(word) {\n\n \n word = word.toLowerCase();\n let firstletter = word[0];\n let cons_phrase = \"-\";\n \n\n while\n (firstletter !== \"a\" || \n firstletter !== \"e\" || \n firstletter !== \"i\" || \n firstletter !== \"o\" || \n firstletter !== \"u\")\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A lookup table for atob(), which converts an ASCII character to the corresponding sixbit number. | function atobLookup(chr) {
if (/[A-Z]/.test(chr)) {
return chr.charCodeAt(0) - "A".charCodeAt(0);
}
if (/[a-z]/.test(chr)) {
return chr.charCodeAt(0) - "a".charCodeAt(0) + 26;
}
if (/[0-9]/.test(chr)) {
return chr.charCodeAt(0) - "0".charCodeAt(0) + 52;
}
if (chr === "+") {
return 62;
}
... | [
"hashFuncUnicodeKeyType(key){\n let hashValue = 0;\n const keyValueString = `${key}${typeof key}`;\n for ( let index = 0; index < keyValueString.length; index++){\n const keyCodeChar = keyValueString.charCodeAt(index);\n hashValue += keyCodeChar << (index * 8);\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `TransitionProperty` | function CfnBucket_TransitionPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' ... | [
"function checkProperty(previous, property) {\n console.log(\"[EVT] Checking if property \" + property.key + \" changed to \" + property.value + \" \" + JSON.stringify(previous));\n\n if (previous[property.key]) {\n console.log(\"[EVT] Property present\");\n if (previous[property.key] === proper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Do we need to repeat the image on the Xaxis? Most likely you'll want to set this to false / Helper function which normalizes the coords so that tiles can repeat across the Xaxis (horizontally) like the standard Google map tiles. | function getNormalizedCoord(coord, zoom) {
if (!repeatOnXAxis) return coord;
var y = coord.y;
var x = coord.x;
// tile range in one direction range is dependent on zoom level
// 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
var tileRange = 1 << zoom;
// don't repeat across... | [
"rescaleTiles() {}",
"wrapx()\n\t{\n\t\t//if the right hand edge of the sprite is less than the left edge of screen\n\t\t//then position its left edge to the right hand side of the screen\n\t\tif (this.right < 0)\n\t\t\tthis.pos.x += this.screensize.width + this.size.width;\n\t\t//if the left hadn edge is off the... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function handles the error of the call that informs installation has been selected for the installable product | handleUpdateInstallationError(error) {
this.$refs.spinner.hideSpinner();
this.$emit('add-installation-error');
} | [
"function onSetupError () {\n\n popup\n .showConfirm('Something went wrong while loading the video, try again?')\n .then(function (result) {\n if (true === result) {\n $state.reload();\n }\n });\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a detailed view of a specific dog walking client's info | function renderDogOwnerDetails(dogOwner) {
$('main').html(`
<div id="dogOwner-details" dogOwner-id-data="${dogOwner.id}">
<ul class="client-details">
<li class="dogOwner-card-header"><h3>${dogOwner.firstName} ${dogOwner.lastName}</h3></li>
<li class="dogOwner-card-dogName">Dog(s): ${dogOwner... | [
"function renderDogOwnersList(dogOwners) {\n $('#client-info-list').html(dogOwners.map(dogOwnerToHtml));\n\n // Takes each individual dog owner and displays the requested info\n function dogOwnerToHtml(dogOwner) {\n let notesShorten = dogOwner.notes;\n if (notesShorten.length > 120) {\n notesShorten =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Next we define the setState function where we will set the value to something different and force rerendering of our component in our reimplementation of the useState Hook. For actual Hooks this would have been dealt with internally | function setState(nextValue) {
values[hookIndex] = nextValue;
// value = nextValue;
ReactDOM.render(<App />, document.getElementById('root'))
} | [
"safeSetState(newState) {\n if (this.mounted) {\n this.setState(newState);\n } else {\n Object.assign(this.state, newState);\n }\n }",
"handleSetStatesToDefault() {\n this.setState({\n gridData: {},\n gridLoadToggle: false,\n noError: true,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resize the video embed. | resizeEmbed() {
Object.keys(this.videoEmbeds).forEach((key) => {
const embed = this.videoEmbeds[key];
fastdom.measure(() => {
const newWidth = embed.floated ?
embed.parent.offsetWidth :
this.element.offsetWidth;
fastdom.mutate(() => {
embed.iframe.setAttrib... | [
"setupEmbed() {\n Object.keys(this.videoEmbeds).forEach((key) => {\n const embed = this.videoEmbeds[key];\n\n embed.iframe.setAttribute(\n 'data-aspect-ratio',\n `${embed.iframe.height / embed.iframe.width}`\n );\n embed.iframe.removeAttribute('height');\n embed.iframe.remo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::AppMesh::VirtualService.VirtualServiceSpec` resource | function cfnVirtualServiceVirtualServiceSpecPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnVirtualService_VirtualServiceSpecPropertyValidator(properties).assertSuccess();
return {
Provider: cfnVirtualServiceVirtualServiceProviderProperty... | [
"function cfnVirtualServiceVirtualServiceProviderPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnVirtualService_VirtualServiceProviderPropertyValidator(properties).assertSuccess();\n return {\n VirtualNode: cfnVirtualServiceVirtualN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I need to reference all the elements that are "inDistance" To determine if they have block or player class, if they do movement is not possible | function isInDistance (player, block) {
const firstCondition = (Math.abs(block.dataset['x'] - player.position.x) <= 3)
&& (block.dataset['y'] === player.position.y);
const secondCondition = (Math.abs(block.dataset['y'] - player.position.y) <= 3)
&& (block.dataset['x'] === player.position.x);
return... | [
"function getEnemy(x, y, distance) {\n const enemyUnits = enemies1.getChildren().concat(enemies2.getChildren());\n for (let i = 0; i < enemyUnits.length; i++) {\n if (enemyUnits[i].active && Phaser.Math.Distance.Between(x, y, enemyUnits[i].x, enemyUnits[i].y) <= distance) {\n return enemyUni... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
7.2 Find the name of the account with the largest balance | function top_balance() {
var largest_balance = 0;
for (var i in accounts) {
if (accounts[i].amount > largest_balance) {
largest_balance = accounts[i].amount;
richest = accounts[i].name;
}
}
console.log("Holder of biggest balance: " + richest);
} | [
"function top_personal_balance() {\n var largest_balance = 0;\n for (var i in accounts) {\n if (accounts[i].type === \"personal\") {\n if (accounts[i].amount > largest_balance) {\n largest_balance = accounts[i].amount;\n richest = accounts[i].name;\n }\n }\n }\n console.log(\"Holde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function in charge to execute the handler function if it was not fired | function requestHandle() {
if (!isHandled) {
isHandled = true;
vueInst.$nextTick(() => {
isHandled = false;
handler();
});
}
} | [
"handleNoChangeEvent() {\n \n }",
"handleLoaded(itemName) {\n this.toLoad = this.toLoad.filter(item => item !== itemName);\n\n if (this.toLoad.length === 0) {\n this.callbacks.onLoaded();\n }\n }",
"function runLoadHandlers() {\n while (loadHandlers.length) {\n loadHan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a valid github repository url and parses it, returning an object of type `ParsedGithubUrl` | function parseGithubUrl(urlStr) {
let match;
for (const pattern of githubPatterns) {
match = urlStr.match(pattern);
if (match) {
break;
}
}
if (!match) throw new Error(invalidGithubUrlMessage(urlStr));
let [, auth, username, reponame, treeish = `master`] = match;
treeish = treeish.repla... | [
"function cleanRepoGitHubUrl(url) {\n return url.replace('https://api.github.com/repos', 'https://github.com');\n}",
"function cleanGitHubUrl(url) {\n return url.replace('https://api.github.com', 'https://github.com');\n}",
"function isGithubUrl(url) {\n return url ? githubPatterns.some(pattern => !!url.matc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update tarefa details. PUT or PATCH tarefas/:id | async update ({ params, request, response }) {
const tarefa = await Tarefa.findOrFail(params.id);
const dados = request.only(["descricao", "titulo", "status"]);
tarefa.fill({
id : tarefa.id,
...dados
});
await tarefa.save();
} | [
"updateById(id, data) {\n return this.post('/' + id + '/edit', data);\n }",
"static async edit(id, titulo, descripcion, avatar, color) {\n // comprobar que ese elemento exista en la BD\n const trackTemp = await this.findById(id);\n if (!trackTemp) throw new Error(\"El track solicitado no existe!\");\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the following are useful functions for making it easy to display an applet | function drawApplet(id, archive, mainClass, params, width, height) {
var str='';
str+='<!--[if !IE]>--><object id="' + id + '" classid="java:' + mainClass + '.class"';
str+=' type="application\/x-java-applet"';
str+=' archive="' + archive + '"';
str+=' height="' + height... | [
"function showConfig() {\n\ttheApplet.showConfiguration();\n}",
"function invokejava(img)\n{\n var par = img.parentNode;\n var p = document.createElement('div');\n p.innerHTML = '<applet code=\"' + img.alt\n + '\" width=\"' + img.width + '\" height=\"' + img.height + '\"></applet>';\n par.replaceChild(p,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply vat on existing paragraphs | function vat_on_paragraphs () {
$('p.vat:not(:has(.vat-disclaimer))').each(function(){
startingPrice = parseFloat($(this).attr('data-price'));
if(! isNaN(startingPrice)) {
text = $(this).text();
match = text.match(/([0-9]{1,3}[,.])+[0-9]+/g);
... | [
"function generateParagraph() {\n // Clear the current text\n $('#content').text('');\n // Generate ten sentences for our paragraph\n // (Output is an array)\n let sentenceArray = markov.generateSentences(20);\n // Turn the array into a single string by joining with spaces\n let sentenceText = sentenceArray.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set app container width and height on landing size | function setLandingSize() {
appContainer_Ls.css({
'width' : appContainerWidth_Ls,
'height' : appContainerHeight_Ls,
'margin-top': appContainer_marginTop_Ls
});
} | [
"function setFullSize() {\r\n\tappContainer_Fs.css({\r\n\t\t'width' : appContainerWidth_Fs,\r\n\t\t'height' : appContainerHeight_Fs,\r\n\t\t'margin-top': appContainer_marginTop_Fs\r\n\t});\r\n\tappContent.css({\r\n\t\t'width' : appContentWidth,\r\n\t\t'height' : appContentHeight,\r\n\t});\t\r\n}",
"function Resiz... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Depends on Khronos Debug support module being imported via "luma.gl/debug" Helper to get shared context data | function getContextData(gl) {
gl.luma = gl.luma || {};
return gl.luma;
} // Enable or disable debug checks in debug contexts | [
"function createGLContext() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n opts = Object.assign({}, contextDefaults, opts);\n var _opts = opts,\n canvas = _opts.canvas,\n width = _opts.width,\n height = _opts.height,\n throwOnError = _opts.throwOnErro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
! MIT License KeySpline use bezier curve for transition easing function | function KeySpline (mX1, mY1, mX2, mY2) {
this.get = function(aX) {
if (mX1 === mY1 && mX2 === mY2) { return aX; } // linear
return CalcBezier(GetTForX(aX), mY1, mY2);
};
function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
function C(aA... | [
"function bezier(p1x, p1y, p2x, p2y) {\n var bezier = new unitbezier(p1x, p1y, p2x, p2y);\n return function (t) {\n return bezier.solve(t);\n };\n }",
"get curve() {}",
"function bezierCurve(u, q){\n\tvar B = bern3;\n\tvar n = 4;\n\n\tvar p = vec3(0,0,0);\n\n\tfor(var i=0; i<n; i++){\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================= RATING AND TRACK INFO END ========================== DEFINE CLASS ButtonUI for RATING | function ButtonUI_R() {
this.y = 10;
this.x = 10;
this.width = imgw;
this.height = imgh;
this.setx = function(x){
this.x = x;
}
this.Paint = function(gr, button_n, y) {
this.y = y;
var rating_to_draw = (rating_hover_id!==false?rating_hover_id:g_infos.rating);
this.img = ((rating_to_draw - button_n) >=... | [
"styleButtons () {\n // Check if it was rated\n if (this.props.wasPositive !== null) {\n // Previous rating positive\n if (this.props.wasPositive) {\n // Is this a positive rating button\n return (this.props.isPositive) ? 'green' : 'grey'\n } else {\n // Previous rating was... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: extGroup.getParticipantNames DESCRIPTION: Gets a list of participant names for an extGroup. If a searchLocation is given, only returns participant names that use that location. ARGUMENTS: groupName ext dat group file name insertLocation (optional) ext data participant location RETURNS: array of Participant na... | function extGroup_getParticipantNames(groupName, insertLocation)
{
var partNames = dw.getExtDataArray(groupName, "groupParticipants");
var retPartNames = new Array();
for (var i=0; i < partNames.length; i++)
{
if (!insertLocation || extPart.getLocation(partNames[i]).indexOf(insertLocation) == 0)
{
... | [
"function extGroup_getSelectParticipant(groupName)\n{\n return dw.getExtDataValue(groupName, \"groupParticipants\", \"selectParticipant\");\n}",
"function extGroup_getInsertStrings(groupName, paramObj, insertLocation)\n{\n var retVal = new Array();\n var partNames = extGroup.getParticipantNames(groupName);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createAuthHandler returns a route middleware to be used by restify. It executes auth.checkSession which another module needs to provide. auth.checkSession needs to determine whether a user has access to a route, based on the users sessionId and authentication info stored for the route. | function createAuthHandler(authRouteInfo) {
return function(req, res, next) {
var sessionId = req.headers['session-id'];
if (!sessionId) {
return res.send(403, 'Not logged in.');
}
return virgilio.execute(
'auth.checkSession... | [
"configureRoute(app) {\n const storeIssuer = (req, res, next) => {\n const host = req.headers['x-forwarded-host'] || req.headers.host;\n res.locals.issuer = `${req.protocol}://${host}/auth/${this.loginName}`;\n next();\n };\n // configure username/password route\n var v = this.verify.bind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wikipedia.js wikipedia.org API used to augment the Marvel API search by querying wikipedia.org for content Note: it provides two apis, one for a general query for when the query is generalized and not specific page is in mind. The second is a direct search to an exact known page. Source: performWikiSearch(topic) uses t... | function performWikiTopicSearch(topic) {
// First of two required ajaz calls to get the topics matching our topic search
$.ajax({
type: "GET",
url: "https://en.wikipedia.org/w/api.php?action=opensearch&search=" + topic + "&callback=?",
contentType: "application/json; charset=utf-8... | [
"function searchWikipedia (term) {\n\t$results.empty();\n\treturn $.ajax({\n\t url: 'http://en.wikipedia.org/w/api.php',\n\t dataType: 'jsonp',\n\t data: {\n\t\taction: 'opensearch',\n\t\tformat: 'json',\n\t\tsearch: global.encodeURI(term)\n\t }\n\t}).promise();\n }",
"function WikipediaAPI() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sustained_clock_speed computed: true, optional: false, required: false | get sustainedClockSpeed() {
return this.getNumberAttribute('sustained_clock_speed');
} | [
"updateSpeedPhysics() {\n let speedChange = 0;\n const differenceBetweenPresentAndTargetSpeeds = this.speed - this.target.speed;\n\n if (differenceBetweenPresentAndTargetSpeeds === 0) {\n return;\n }\n\n if (this.speed > this.target.speed) {\n speedChange = -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Solitary Tap events are simple Responses: RRR TTT TapDowns are part of Responses. RRRRRRR DDD TTT TapCancels are part of Responses, which seems strange. They always go with scrolls, so they'll probably be merged with scroll Responses. TapCancels can take a significant amount of time and account for a significant amount... | function handleTapResponseEvents(modelHelper, sortedInputEvents) {
var protoExpectations = [];
var currentPE = undefined;
forEventTypesIn(sortedInputEvents, TAP_TYPE_NAMES, function(event) {
switch (event.typeName) {
case INPUT_TYPE.TAP_DOWN:
currentPE = new ProtoExpectation(
... | [
"function CLC_SR_SpeakFocus_EventAnnouncer(event){ \r\n if (!CLC_SR_Query_SpeakEvents()){\r\n return true;\r\n }\r\n //Announce the URL bar when focused\r\n if (event.target.id==\"urlbar\"){\r\n CLC_SR_SpeakEventBuffer = event.target.value;\r\n CLC_SR_SpeakEventBuffer = CLC_SR_MSG0010 + CL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
player turn that do addTroops, attack and move | function turn (player_id){
var num_troops = player_id.count_territory()/3;
for (var i=0;i<num_troops;i++){
addTroops( player_id, territory);
}
attack (player_id, from, to);
move(player_id, from, to, number);
} | [
"pursueDo() {\n // always try to face\n this.facePlayer();\n this.noAttack();\n // if not close enough to attack, also pursue\n if (!this.alivePlayerInRange(this.getParams().attackRange)) {\n this.moveForward();\n }\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches markers from the backend and adds them to the map. | function fetchMarkers() {
fetch('/markers').then(response => response.json()).then((markers) => {
markers.forEach(
(marker) => {
createMarkerForDisplay(marker.lat, marker.lng, marker.content)});
});
} | [
"function fetchMarkers(){\n fetch('/markers')\n .then((response) => response.json())\n .then((markers) => {\n markers.forEach((marker,i) => {\n addDisplayMarker(marker.lat, marker.lng, marker.content, marker.landmark, marker.ratings);\n });\n });\n}",
"function addMarkers(map) {\n // create AJAX re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the full type for %%name%%. | encodeType(name) {
const result = this.#fullTypes.get(name);
(0, index_js_4.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name);
return result;
} | [
"function getTypeIdentifier(Repr) {\n\t return Repr[$$type] || Repr.name || 'Anonymous';\n\t }",
"createOrReplaceType(name) {\n\t\treturn this.declareType(name);\n\t}",
"function getTypeName(type) {\n // property is other type or Kite Module, pass the original type to this filter function\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Watch and update style.css for debugging | function watchCSS() {
fs.watch(path.join(paths.client, "/style.css"), updateCSS);
} | [
"function update_style() {\n\tvar style = get_style();\n\tif (style !== null) {\n\t\tvar cssName = \"chroma_\" + style + \".css\";\n\t\tvar cssPath = \"inc/css/\" + cssName;\n\t\tvar elem = document.getElementById(\"chroma_style\");\n\t\telem.href = cssPath;\n\t}\n}",
"function watchFiles() {\n watch(\n ['sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getting degree value of transform property | function getDegreeValue() {
var transformValue = ballStyle.transform;
var values = transformValue.split('(')[1].split(')')[0].split(',');
var a = values[0];
var b = values[1];
var c = values[2];
var d = values[3];
var scale = Math.sqrt(a * a + b * b);
var sin = ... | [
"degrees() {\n return (this._radians * 180.0) / Math.PI;\n }",
"calculateRotation() {\n const extentFeature = this._extentFeature;\n const coords = extentFeature.getGeometry().getCoordinates()[0];\n const p1 = coords[0];\n const p2 = coords[3];\n const rotation = Math.atan2(p2[1] - p1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keep incrementing the current day until it is no longer a hidden day. If the initial value of `date` is not a hidden day, don't do anything. Pass `isExclusive` as `true` if you are dealing with an end date. `inc` defaults to `1` (increment one day forward each time) | function skipHiddenDays(date, inc, isExclusive) {
inc = inc || 1;
while (
isHiddenDayHash[ ( date.getDay() + (isExclusive ? inc : 0) + 7 ) % 7 ]
) {
addDays(date, inc);
}
} | [
"function advanceDate(date, length, WFLAG=0) {\n date = new Date(date);\n if(WFLAG) length *= 7;\n new_date = new Date(date.getFullYear(), date.getMonth(), date.getDate() + length);\n\n return new_date;\n}",
"function updateModalDate() {\n\tvar date = document.getElementById('date');\n\tdate.value = t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method starts the game looping if media files are loaded in | function startGame()
{
if(mediaCount.image == 0 && mediaCount.audio==0 && canStart==1)
{
//Initiate the game
gameRestart();//initiate the game
//Start the game
gameLoop();//this sets automatically the game looping
//var interval = setInterval(gameLoop, 30); //runs gameLoop ciclicly
}
else
... | [
"static loadBeginning()\n {\n var path = game.load.path;\n\n game.load.path = 'assets/audio/music/';\n game.load.audio('beginning', 'beginning.mp3');\n\n game.load.path = path;\n }",
"function playEventHandler() {\n if ($rootScope.playing === false) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function GetWindowHeight return the client browser height modified by : Manish Sharma modified on : 10032009 | function GetWindowHeight() {
//return window.innerHeight||
//document.documentElement&&document.documentElement.clientHeight||
//document.body.clientHeight||0;
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
... | [
"getGameHeight() {\n return this.scene.sys.game.config.height;\n }",
"function windowDimensions(){\n\tvar win = window;\n\twin.height = $(window).height();\n\twin.width = $(window).width();\n\treturn win;\n}",
"_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create FindAndReplaceTransformer object toreplace: a string to be replaced by newtext newtext: a string that replaces the found text timesToReplace: (optional) number of occurrences of toreplace to search for. If not provided, replace all occurences | constructor(toreplace, newtext, timesToReplace) {
this.toreplace = toreplace;
this.newtext = newtext;
this.alreadyProcessed = 0;
this.unenqueuedPos = 0;
this.prevUnenqueuedText = "";
if (timesToReplace === 0) {
//nothing to do. Exit early
this.done = true;
... | [
"function SUBSTITUTE(text, old_text, new_text, occurrence) {\n if (!text || !old_text || !new_text) {\n return text;\n } else if (occurrence === undefined) {\n return text.replace(new RegExp(old_text, 'g'), new_text);\n } else {\n var index = 0;\n var i = 0;\n while (text.indexOf(old_text, index) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get list of tenant microservices in current topology. | function getTenantTopology(axios$$1) {
return restAuthGet(axios$$1, 'instance/topology/tenant');
} | [
"static getAllTenants() {\n return HttpClient.get(`${IDENTITY_GATEWAY_ENDPOINT}tenants/all`).map(toTenantModel);\n }",
"ListOfSubaccounts() {\n let url = `/me/subAccount`;\n return this.client.request('GET', url);\n }",
"function commandListSubaccounts() {\n\treturn getActiveInstance()\n\t.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete class, including all assignments, interactions, and enrollments of class | function deleteClassAssignments(classID) {
let classDoc = db.collection('classes').doc(classID);
let assignRef = classDoc.collection('assignments');
let enrollRef = db.collection('class-enrollment');
return assignRef.get().then(snapshot => {
snapshot.forEach(assignSnap => {
let assignDoc = assignRef.d... | [
"function removeModelClasses() {\n modelClasses = null;\n}",
"delete () {\n\t\t// This is to call the parent class's delete method\n\t\tsuper.delete();\n\n\t\t// Remove all remaining chain links\n\t\twhile (this.chains.length > 0) this.removeLastChain();\n\n\t\t// Clear the class's hook instance.\n\t\tHook.hookE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function check the all comments are closed if yes borrower allow to submit for approval | function checkAdminAllCommentsClosed(){
var no_of_comments = $(".commentClass:not(#comment_status_XXX)").length;
var no_of_checked_comments = $(".commentClass:not(#comment_status_XXX):checked").length;
//~ alert("no_of_comments:"+no_of_comments+" | no_of_checked_comments:"+no_of_checked_comments);
if(no_of_commen... | [
"function commentsAvailable2 () {\n var m = document.getElementsByClassName(\"YxbmAc\");\n if(m.length > 0){\n console.log('erasure: %s comments are available.', m.length);\n return true;\n }\n return false;\n}",
"function requireCom() {\n return this.feedbackType === 'comment';\n}",
"function CheckU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cancel the word edit and revert back to original state | function cancel() {
//i've pressed cancel so don't save changes and tell all clients its open
$(document).on('click', '.word-cancel', function () {
var id = $(this).data('link_id');
socket.emit('cancelword', id);
uiObj.alertsOpen();
});
//response to cancelling the edit
socket.on('cancelword', func... | [
"revert() {\n this.innerHTML = this.__canceledEdits;\n }",
"function cancelEdit() {\n\t\n\tdebug('cancelEdit::Start:editing=:'+editState.editing);\n\t\n\t//careful. removing the tag may trigger the onBlur handler..\n\t\n\tvar aSpan;\n\tvar tmpStart, tmpEnd;\n\tvar parentElem;\n\t\n\tif ((tmpStart = getEd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collectable items render and check functions Function to draw collectable objects. | function drawCollectable(t_collectable)
{
// Draw collectable items
fill('#5398BA');
triangle(t_collectable.x_pos, t_collectable.y_pos, t_collectable.x_pos-24, t_collectable.y_pos-30, t_collectable.x_pos+24, t_collectable.y_pos-30);
triangle(t_collectable.x_pos, t_collectable.y_pos-40, t_collectable.x_pos-14, t... | [
"function drawEditionElements() {\n if (editionCheckbox.checked) {\n // Draw points\n for (var ptIndex = 0; ptIndex < customPoints.length; ptIndex++) {\n ctx.fillStyle = \"#f00\";\n ctx.fillRect(customPoints[ptIndex].x - (pointWidth / 2), customPoints[ptIndex].y - (pointHeight / 2), pointWidth, poi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RUTG[] Round Up To Grid 0x7C | function RUTG(state) {
if (exports.DEBUG) { console.log(state.step, 'RUTG[]'); }
state.round = roundUpToGrid;
} | [
"function roundToGrid(numb) {\n\treturn Math.round(numb/10) * 10;\n}",
"function rgbToSix(r) {\n return r / 51;\n}",
"moveUp() {\r\n let tempGrid = [];\r\n for (let i = 0; i < this.gridSize; i++) {\r\n let tempIx = 0;\r\n let tempList = [];\r\n for (let j = 0; j <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: showStatusMsg Parameters: msg: String containing message to show Returns: None. | function showStatusMsg(msg) {
Ext.get('status-msg').update(msg);
//Ext.get('status-msg').slideIn();
} | [
"function status(msg) {\n if (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__[\"isMacintosh\"]) {\n alert(msg); // VoiceOver does not seem to support status role\n }\n else {\n insertMessage(statusContainer, msg);\n }\n}",
"function BAStatusMsg() {\n\t/** element node not needed.\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
offer recieved get pc1 stuff handle offer | function handleofferFromPC1(){
var x = document.getElementById('pc1LocalOffer').value;
var offerDesc = new RTCSessionDescription(JSON.parse(x))
pc2.setRemoteDescription(offerDesc)
pc2.createAnswer(function (answerDesc) {
console.log('Created local answer: ', answerDesc)
pc2.setLocalDescription(... | [
"receiveOffer(pair, desc) {\n var e, offer, sdp;\n try {\n offer = JSON.parse(desc);\n dbg('Received:\\n\\n' + offer.sdp + '\\n');\n sdp = new RTCSessionDescription(offer);\n if (pair.receiveWebRTCOffer(sdp)) {\n this.sendAnswer(pair);\n return true;\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the graph data to the map | function load_graph_to_map(results){
load_markers(results.locations);
//draw_lines(results);
draw_spanning_tree(results);
} | [
"function loadMapData()\r\n{\r\n\t//First clear the old shapes from the editor\r\n\t//This is important in the event that we're either\r\n\t//loading a new layer or a completely new image map\r\n\tclearEditor();\r\n\tloadLayers();\r\n\t//Load the shapes onto the layer\r\n\tvar mapLayer = getLayerById( imageMap, cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
on strip move event preload visible images if that option selected | function onThumbsChange(event){
//preload visible images
if(g_options.gallery_images_preload_type == "visible" && g_temp.isAllItemsPreloaded == false){
preloadBigImages();
}
} | [
"function switch_search_images()\r\n{\r\n search_images = !search_images;\r\n drawControl();\r\n}",
"function setThumbnailStrip(pos){\r\n\tbeg = getThumbnailStripBegPos(pos-1);\r\n\tinitThumbnailStrip(beg);\r\n}",
"function preload()\r\n{\r\n // Spiderman Mask Filter asset\r\n imgSpidermanMask = loadIma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter > queries queries > heading, query query > event template, result type, time range | function Query (_name, _event_template, _result_type, _time_range, _max_events, _layout) {
this._init (_name, _event_template, _result_type, _time_range, _max_events, _layout);
} | [
"function analyze(args){\n let passData = {};\n passData.date = new Date();\n \n if(args.hasArg('date')){\n passData.date = new Date(args.getArg('date'));\n }\n \n if(args.hasArg('groupby')){\n passData.groupby = args.getArg('groupby');\n if(args.hasArg('and')){\n passData... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disconnect and ReConnect Pusher | function reconnect() {
if (!socket) {
console.debug('[Pusher] Unable to reconnect since Pusher instance does not yet exist.');
return;
}
console.debug('[Pusher] Reconnecting to Pusher');
socket.disconnect();
socket.connect();
} | [
"function wsCloseConnection(){\n\twebSocket.close();\n}",
"_cleanUp() {\n this.connected = false;\n if (this.pinger) {\n Stomp.clearInterval(this.pinger);\n }\n if (this.ponger) {\n return Stomp.clearInterval(this.ponger);\n }\n }",
"disconnect() {\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if agent is tracking dna. If not, will try to send a FailureResult back to IPC Returns _ipcHasTrack() result | _hasTrackOrFail (agentId, dnaAddress, requestId) {
// Check if receiver is known
if (this._ipcHasTrack(agentId, dnaAddress)) {
log.t(' oooo HasTrack() CHECK OK for (agent) "' + agentId + '" -> (DNA) "' + dnaAddress + '"')
return true
}
// Send FailureResult back to IPC
log.e(' #### HasTr... | [
"hasTrack(aTrack){\r\n //const track = this.getTracks().find((tr) => tr.getName() === aTrack.getName());\r\n return this.tracks.includes(aTrack);//track !== undefined;\r\n }",
"hasAudioTrack(trackId) {\r\n return this.soundMeta.has(trackId) && this.soundMeta.get(trackId).length > 0;\r\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CREATE THE BIDIMENSIONAL ARRAY FOR THE LAYOUT | function create_grid(){
// Create new Array the size of the number of pages
LAYOUT_GRID = new Array(_PAGES);
for(i=0; i<_PAGES; i++){
LAYOUT_GRID[i] = new Array(NUM_OF_LI_PER_ROW[i]);
}
} | [
"initialize2dArray(numCols){\n let arr = [];\n for(let i = 0; i < numCols; i++){\n arr.push(new Array(8));\n }\n return arr;\n }",
"function bidimensionale(myArray){\r\n var n = Math.sqrt(myArray.length);\r\n var resarray = [];\r\n var row = [];\r\n for (var i = 0; i < myArray.length... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HashRegistryValue hashes the given registry value | function HashRegistryValue(registryValue) {
return HashAll(registryValue.tweak, encodeString(registryValue.data), encodeUint8(registryValue.revision));
} | [
"static hash(domain, types, value) {\n return (0, index_js_2.keccak256)(TypedDataEncoder.encode(domain, types, value));\n }",
"static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\n }",
"function hashValues(map) {\n\t\tvar vals = [];\n\t\tfor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
perform the eye dropper for the surrounding art | function surroundingEyeDropper(evt) {
// only do this if the eye dropper is the selected tool
if (document.getElementById("eyeDropper").checked) {
// figure out which canvas you're in and get its context
var myCanvas = evt.target;
var myContext = myCanvas.getContext("2d");
// get click coordinates in this can... | [
"function moveEye(target){\n\t\tvar referencePt1;\n\t\tvar referencePt2;\n\t\tvar cos = Math.cos(angle);\n\t\tvar sin = Math.sin(angle);\n\t\tvar xDist;\n\t\tvar yDist;\n\n\t\tif (target == \"guide\"){ //if not on the eye itself them moves to the guide object\n\t referencePt1 = (pupilGuide.offsetLeft * cos -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: saveListLinksToCookie() Description: Save list shortent Link to cookies Parameter: None Return: None | function saveListLinksToCookie() {
var linkListJson = getShortenLinkListJson();
if(linkListJson != "") {
setCookie("ResultsList", linkListJson, 30);
}
} | [
"function loadListLinksFromCookie() {\n var linkListJson = getCookie(\"ResultsList\");\n var linkListArr = JSON.parse(linkListJson);\n for(let i = linkListArr.length - 1; i >= 0; i--) {\n addResult(linkListArr[i].id, linkListArr[i].original, linkListArr[i].shorten);\n }\n}",
"function saveStoredThings(){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set value to collection | function setValue(collection, key, value, collectionType) {
switch (collectionType) {
case detector_1.typeArguments:
case detector_1.typeArray:
case detector_1.typeObject:
collection[key] = value;
break;
case detector_1.typeMap:
collection.set(key,... | [
"[createFunctionName('set', collection, false)](object) {\n return setObjectToArray(object, self[collection], findField)\n }",
"setCollection(coll) {\n\t\t\tthis.collection = coll;\n\t\t\tthis.ids = Object.keys(coll.getAll());\n\t\t}",
"setValueToId (item, key, id) {\n debug('setValueToId(%... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This routine scrolls the tabs to the left id the tabset id return none Compatibility: IE,NS6 | function i2uiScrollTabsLeft(id)
{
if (document.layers)
return;
var obj = document.getElementById(id);
if (obj != null)
{
var tablen = obj.rows[0].cells.length;
var showid = 0;
// show last invisible tab from right
for (var i=tablen-3; i>4; i--)
{
if (obj.rows[0].cells... | [
"function setScrollers(container) { \n\t\tvar header = $('>div.tabs-header', container); \n\t\tvar tabsWidth = 0; \n\t\t$('ul.tabs li', header).each(function(){ \n\t\t\ttabsWidth += $(this).outerWidth(true); \n\t\t}); \n\t\t \n\t\tif (tabsWidth > header.width()) { \n\t\t\t$('.tabs-scroller-left', header).css('displ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
global context config:configuration repository: sparxEA current repository eaElement: sparxEA selected element eaPackage: sparxEA package of selected element | function Context(config, repository, pckg, element) {
var config = config;
var repository = repository;
var pckg = pckg;
var element = element;
this.getConfig = function () { return config;};
this.getRepository = function () { return repository;};
this.getPackage = function () { return pckg;};
this.get... | [
"function insertProjectComponentInDOM() {\n var oldvalue = \"<b><u>Composant :</u></b> \";\n document.getElementById(\"componentName\").innerHTML = oldvalue + getSelectedComponentsName();\n}",
"function eCSearch( dev_obj ){\n /*\n key points\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of nodes, remove any member that is contained by another. | function removeSubsets(nodes) {
var idx = nodes.length;
/*
* Check if each node (or one of its ancestors) is already contained in the
* array.
*/
while (--idx >= 0) {
var node = nodes[idx];
/*
* Remove the node if it is not unique.
* We are going through the ... | [
"function arrayRemoveIntersect(a, b){\n var i, j, k, dup = arrayIntersect(a, b);\n for(i = 0, j = dup.length; i < j; i++){\n if ((k = a.indexOf(dup[i])) === -1) continue;\n a.splice(k, 1);\n }\n}",
"function excludeInvalidNodes(allNodes, invalidNodes) {\n\tvar toReturn = null;\n\tif(allNodes != null) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load schedule pks that belong to selected date for copying week. | function copyWeekSchedulePks() {
$prev_day_clicked = $(".fc-day-clicked"); // Check if a date has been clicked
if ($prev_day_clicked.length) {
copyBtnActive = 'week';
var date = $addScheduleDate.val();
// Get start and end of week given selected date
var selectedDate = moment(dat... | [
"function copyDaySchedulePks() {\r\n $prev_day_clicked = $(\".fc-day-clicked\"); // Check if a date has been clicked\r\n if ($prev_day_clicked.length) {\r\n copyBtnActive = 'day';\r\n var date = $addScheduleDate.val();\r\n\r\n // Style copy buttons and tooltips\r\n $(\".copy-active\").remo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the Meridiem for the hour | _convert_12_hour_method(hour) {
// This methods converts the 24 hour method to 12 hour method and meridiem
let convertedHour = hour%12 !== 0 ? hour%12 : 12; // Converts 24 hour method to 12 hour method
let meridiem = this._getMeridiem(hour);
return [convertedHour, meridiem];
} | [
"function getHoursFromTemplate() {\n var hours = parseInt(scope.hours, 10);\n var valid = ( scope.showMeridian ) ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if (!valid) {\n return undefined;\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Dependency Tracking build status for an organization | getArchitectDependencytrackingBuild() {
return this.apiClient.callApi(
'/api/v2/architect/dependencytracking/build',
'GET',
{ },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
} | [
"function getAutoHostBuildStatus(autoHostLink) {\r\n return new Promise((resolve, reject) => {\r\n dashboardModel.getAutoHostBuildStatus(autoHostLink).then((data) => {\r\n resolve({ code: code.OK, message: '', data: data })\r\n }).catch((err) => {\r\n if (err.message === message.INTERNAL_SERVER_ERR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |