query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Funciones calculos triangulo Perimetro triangulo | function perimetroTriangulo(ladoTriangulo){
return ladoTriangulo * 3;
} | [
"function perimetroTriangulo(lado1, lado2, base){\n return lado1 + lado2 + base\n}",
"function perimetroTriangulo(lado1, lado2, base){\n return lado1 + lado2 + base;\n}",
"function perimetroTriangulo (lado1, lado2, base) {\n return lado1 + lado2 + base;\n}",
"function perimetroTriangulo(lado1, lado2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create Shopping table in shopListDB | componentDidMount() {
db.transaction(tx => {
tx.executeSql('create table if not exists shopList(id integer primary key not null, itemName text, amount text);');
});
this.updateList();
} | [
"_createTables() {\n const createShopsTablesSql = `\n CREATE TABLE shops(\n shop_id UUID NOT NULL PRIMARY KEY, \n shop_name TEXT UNIQUE NOT NULL, \n api_token UUID NOT NULL UNIQUE,\n phone TEXT NOT NULL, \n address TEXT NOT NULL\n );`;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We can also yield promises using co: | function yielding_promises() {
function asyncPromise(value) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(value);
}, 500);
});
}
function *yieldPromise() {
var result = yield asyncPromise('foo');
return result; // Note that you can return from genera... | [
"function co(routine) {\n return new Promise(function(resolve, reject) {\n //Start our iteration and get our first value\n var gen = routine();\n try {\n next(gen.next());\n } catch(e) {\n reject(e);\n }\n \n //When we've fulfilled a promise,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks patient as Positive | static markPatientAsPositive(patient){
return new Promise((resolve, reject) => {
httpApi.put(this.baseUrl + "/positive", patient)
.then(response => {
DefaultHandler(response);
resolve();
})
.catch(err => {
DefaultErrorHandler(err);
reject(err);
})
})... | [
"static markPatientAsNegative(patient){\n return new Promise((resolve, reject) => {\n httpApi.put(this.baseUrl + \"/negative\", patient)\n .then(response => {\n DefaultHandler(response);\n resolve();\n })\n .catch(err => {\n DefaultErrorHandler(err);\n reject(err);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the Sort inputs to manage the [+] and [] buttons | function checkSorts() {
if (numberOfSorts == 0) {
$("#removeSortButton").hide("fast");
}
if (numberOfSorts == 7) {
$("#addSortButton").prop("disabled", "true");
}
else {
$("#addSortButton").removeProp("disabled");
}
} | [
"function sort() {\n\tvar sortAlg = document.getElementById(\"sortalg\").value\n\tvar sortSpeed = 1000-(20*document.getElementById(\"sortspeed\").value)\n\tif (sortAlg==\"merge\") {\n\t\tmergeSrt()\n\t} else if (sortAlg==\"bubble\") {\n\t\tbubbleSort()\n\t} else if (sortAlg==\"quick\") {\n\t\t\n\t} else if (sortAlg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the number of the last row of data from a specific column, return the first empty row REQUIRED: sheetNum = the sheet number to start search. col = the column to find the last row in. | function findLastRowByCol(sheetName, col) {
//var ss = SpreadsheetApp.getActiveSpreadsheet();
//var sheet = SpreadsheetApp.setActiveSheet(ss.getSheets()[sheetNum]);
var doc = SpreadsheetApp.getActiveSpreadsheet();
var sheet = doc.getSheetByName(sheetName);
var rowNum = sheet.getLastRow();
//create an arr... | [
"function getLastRowCol(sheet,col){\n var lastRow = sheet.getMaxRows();\n var search = col+\":\"+col// + String(lastRow)\n var values = sheet.getRange(search).getValues();\n for (; values[lastRow - 1] == \"\" && lastRow > 0; lastRow--) {}\n return lastRow\n}",
"function GetLastNonEmptyRow(sheet, col)\n{\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A short description for the subgroup. | get subGroupDisplay() {
return this.__subGroupDisplay;
} | [
"get replicationGroupDescription() {\n return this.getStringAttribute('replication_group_description');\n }",
"function GroupDescription(props) {\n return(\n <p>\n {props.groupDescription}\n </p>\n )\n}",
"get subGroupDisplay () {\n\t\treturn this._subGroupDisplay;\n\t}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_ESAbstract.CreateDataPropertyOrThrow / global CreateDataProperty 7.3.6. CreateDataPropertyOrThrow ( O, P, V ) | function CreateDataPropertyOrThrow(O, P, V) { // eslint-disable-line no-unused-vars
// 1. Assert: Type(O) is Object.
// 2. Assert: IsPropertyKey(P) is true.
// 3. Let success be ? CreateDataProperty(O, P, V).
var success = CreateDataProperty(O, P, V);
// 4. If success is false, t... | [
"function CreateDataPropertyOrThrow(O, P, V) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(O) is Object.\n\t\t// 2. Assert: IsPropertyKey(P) is true.\n\t\t// 3. Let success be ? CreateDataProperty(O, P, V).\n\t\tvar success = CreateDataProperty(O, P, V);\n\t\t// 4. If success is false, throw a Typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a State is a rule at a position from a given starting point in the input stream (reference) | function State(rule,dot,reference,wantedBy){this.rule=rule;this.dot=dot;this.reference=reference;this.data=[];this.wantedBy=wantedBy;this.isComplete=this.dot===rule.symbols.length;} | [
"function State(rule, expect, reference) {\n this.rule = rule;\n this.expect = expect;\n this.reference = reference;\n this.data = [];\n}",
"function State(rule, dot, reference, wantedBy) {\n this.rule = rule;\n this.dot = dot;\n this.reference = reference;\n this.data = [];\n this.want... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that `part` is not a path (i.e., does not contain `p.sep`). | function assertPart(part, name) {
if (part && part.indexOf(p.sep) > -1) {
throw new Error(
'`' + name + '` cannot be a path: did not expect `' + p.sep + '`'
)
}
} | [
"function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n }",
"function assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error('`' + name + '` ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the page to the canvas of the given print service, and returns the suggested dimensions of the output page. | function renderPage(
activeServiceOnEntry,
pdfDocument,
pageNumber,
size,
printResolution,
optionalContentConfigPromise
) {
const scratchCanvas = activeService.scratchCanvas;
// The size of the canvas in pixels for printing.
const PRINT_UNITS = printResolution ... | [
"function cvjs_printCanvasPaperSize(){\n\n\t// case where cvjs_objectIsZoomedExtents = true;\n\n\tvar svgString;\n\tvar is_explorer = (navigator.userAgent.indexOf('MSIE') > -1) || (navigator.userAgent.indexOf('Trident') > -1);\n\tvar is_firefox = navigator.userAgent.indexOf('Firefox') > -1;\n\n\tsvgString = cvjs_rP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cargar el arbol de departamento | function obtenerArbolDepartamentos(s, d, e) {
if(s) {
$('form[name=frmGestionPerfil] .arbolDepartamento').append(procesarArbolDep(d));
$('form[name=frmGestionPerfil] .arbolDepartamento').genTreed(); // Añade clases y imagenes a la lista html para hacerla interactiva
$('form[name=frmGestionP... | [
"cargarDepartamento(provincia){\n\t\tlet index = this.devolerIndex(provincia);\n\t\tthis.VaciarCombo(\"departamentos\");\n\t\tthis.CargarCombo(\"cargando\",\"departamentos\");\n\n\t\tif(!this.provincias[index].hasOwnProperty('departamentos')){\n\t\t\tfetch(\"https://apis.datos.gob.ar/georef/api/departamentos?provin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creating fields in HTML Getting the value of a radio button with JS Creating a dropdown menu Getting a dropdown menu selection Using the onclick HTML event/attribute Add text as needed | function boilerplateFunction() {
/* Function to take in user selections and display the necessary text
The purpose of this function is to utilize the selections that the user made based on dropdowns/radio buttons
and display corresponding/necessary text as a result.
Args: N/A
Retruns: Returns/dis... | [
"function radioChoice()\n{\n\tdocument.querySelector(\"#checkButtons\").style.display = \"block\";\n\tlet yes = document.querySelector(\"#yes\").checked;\n\t\tif (yes)\n\t\t{\n\t\t\tdocument.querySelector(\"#dropdownBox\").style.display = \"block\";\n\t\t\tgetDropdown();\n\t\t}\n}",
"function simpleRadioOrCheckbo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restoring console.warn from context | function restoreWarnings (t) {
console.warn = t.context.warn
} | [
"warn() {}",
"function console_warn(message) {\n C.warn(message);\n}",
"function warn(context, kind, error)\n{\n\tconsole.error('warn: %s', error.message);\n\tif (context !== null)\n\t\tconsole.error(' at ' + context.label());\n}",
"static warn() {\n var str;\n str = Util.toStrArgs('Warning:',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
closes the drawer when it is in float mode | close() {
this.isOpen = false;
if (this.__isFloating) {
const drawer = this.shadowRoot.getElementById('drawer');
const { width } = drawer.getBoundingClientRect();
if (this.isReverse) {
// drawer.style.transform = "translate3d("+ width +"px, 0, 0)";
drawer.style.right = `${-widt... | [
"closeDrawer() {\n\t\tif (this.drawerExists()) {\n\t\t\tthis.drawer.closeDrawer();\n\t\t}\n\t}",
"function _closeDrawer() {\n\t\tconst drawerPanel = document.querySelector('#paperDrawerPanel');\n\t\tif (drawerPanel.narrow) {\n\t\t\tdrawerPanel.closeDrawer();\n\t\t}\n\t}",
"floatDrawer() {\n this.__isFloating... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts the given node into the Template, optionally before the given refNode. In addition to inserting the node into the Template, the Template part indices are updated to match the mutated Template DOM. | function insertNodeIntoTemplate(template, node, refNode = null) {
const { element: { content }, parts } = template;
// If there's no refNode, then put node at end of template.
// No part indices need to be shifted in this case.
if (refNode === null || refNode === undefined) {
content.a... | [
"function insertNodeIntoTemplate(template, node, refNode = null) {\n const { element: { content }, parts } = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
geolocation functionality : end pick point A for map: begin//updated 03/08/2021 | function pickPlace(){
bPickPlace = !bPickPlace;
if(bPickPlace){
map.setOptions({draggableCursor:'crosshair'});
document.getElementById("pick-point-a").style.filter = "grayscale(1)";
map.addListener("click", (mapsMouseEvent) => {
infoByGeocode(mapsMouseEvent.latLng.lat(), mapsMouseEve... | [
"function geocodeStartAndEndPts()\n{\n document.getElementById(\"statustxt\").innerHTML = \"\";\n\tupdateStatus(\"Geocoding addresses\");\t\n\tstartAddy = $('#start').attr('value');\n\tendAddy = $('#end').attr('value');\n thegeocoder.getLatLng(startAddy+\",San Francisco, CA\", onGeoCodeStart);\n thegeocoder.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a copy of this car | copy() {
return new Car(this.brain);
} | [
"copy() {\n return new PacMan(this.brain);\n }",
"copy () { return new Circle( this.pos.copy(), this.radius ); }",
"clone() {\n const clone = new this.constructor()\n clone.copyFrom(this)\n return clone\n }",
"clone() {\n return new this.constructor(this.attributes);\n }",
"clone () ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bind hammer to the color picker | _bindHammer() {
this.drag = {};
this.pinch = {};
this.hammer = new Hammer(this.colorPickerCanvas);
this.hammer.get('pinch').set({enable: true});
hammerUtil.onTouch(this.hammer, (event) => {this._moveSelector(event)});
this.hammer.on('tap', (event) => {this._moveSelector(event)});
this... | [
"_bindHammer() {\n this.drag = {};\n this.pinch = {};\n this.hammer = new Hammer(this.colorPickerCanvas);\n this.hammer.get(\"pinch\").set({ enable: true });\n\n this.hammer.on(\"hammer.input\", (event) => {\n if (event.isFirst) {\n this._moveSelector(event);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Basic component that just creates a h1 tag with the campaign title but you never know... maybe you could make it more exciting. ToDo: Think about the what to do if there isn't even a title... | function CampaignName(props) {
return (
<h1 className="campaign-title">
{props.title}
</h1>
)
} | [
"function renderTitleBlock() {\n createDiv('title');\n append('title', '<h1>My Weather Portal</h1>');\n}",
"function Title1(data) {\n return `\n <div class=\"flex-container fadeIn\">\n <h1>${data.title1}</h1>\n </div>\n `\n}",
"function mainTitleTemplate({\n name\n}) {\n return `<h1 align... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IBM Marker Function I have declared an insertIBMMarker function, which then consists of multiple data inputs | function insertIBMMarker(map) {
// IBM Location
var IBMLocation = new google.maps.LatLng(41.1264849, -73.7140195);
var IBMLocationMarker = new google.maps.Marker({
position: IBMLocation,
icon: {
url: "http://maps.google.com/mapfiles/ms/icons/blue-dot.png"
}
});
I... | [
"function addMarkerRegionToMI() {\n\t\t\tconsole.log(\"addMarkerRegionToMI()\");\n\n\t\t\tif (\n vm.markerRegionSearch == null\n || vm.markerRegionSearch.refsKey == null\n || vm.markerRegionSearch.refsKey == \"\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add onclick eventlisteners for dot of index i | function makeEvents(i){
var dotElement = document.getElementById('h5p-image-gallery-dot-'+i);
dotElement.onclick = function(){
showContentDot(i);
}
} | [
"function add_event_to_dots() {\n for (let i = 0; i < dots.length; i++) {\n dots[i].addEventListener(\"click\", dot_event)\n }\n}",
"dotClick(index) {\r\n this.index = index;\r\n }",
"function addClickListenersToElements(nodes, functionToExectute) {\n for (var i = 0; i < no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays next few events. Usually five unless there is less than five events left. In which case, it displays that amount. | function displayNextFewEvents(initial_counter, page_size, events, callback){
console.log('initial_counter: ' + initial_counter);
// If there are less than five events, display those events. Not five.
if (page_size-initial_counter<5){
var maximum_display_counter = page_size - initial_counter;
}
else{
var ma... | [
"function addMoreEvents() {\n\n // When the addEventsButton is clicked, increase the number of results displayed with 10\n numberOfResultsDisplayed = numberOfResultsDisplayed + 10\n displayEvents()\n\n // If we reach the end of the event array, hide the button\n if (numberOfResultsDisplayed >= upcomi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value from the event's target, with special cases for "null" etc. | function getTargetValue(event) {
var target = event.target, val = target.value;
switch (target.tagName) {
case "SELECT":
// React treats <… someAttr={null|true|false|option} …>
// specially. So working around that.
if (val == 'null') {
val = null;
... | [
"function getTarget(e){\n\tvar value;\n\tif (checkBrowser() == \"ie\"){\n\t\tvalue = window.event.srcElement;\n\t}\n\telse{\n\t\tvalue = e.target;\n\t}\n\treturn value;\n}",
"getTargetValue() {\n if (this.target) {\n if ([\"TEXTAREA\", \"INPUT\"].includes(this.target.tagName)) {\n return this.targe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
possibleMove function checking possible step for selected item | function possibleMove(itemIndex) {
if (itemIndex + 1 <= boardLength && puzzleData[itemIndex + 1].value == null) {
return itemIndex + 1;
}
if (itemIndex - 1 >= 0 && puzzleData[itemIndex - 1].value == null) {
return itemIndex - 1;
}
if (itemIndex - colSize... | [
"function possibleMovements() {\n // this is the cells id that was clicked\n var id = this.id;\n \n // if there are already items in posMoveArr\n if(posMoveArr.length > 0){\n for(cell of posMoveArr){\n // unhighlight and remove handler\n unHighligh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method: getStorageInfo Get the storage information of a given user address. Parameters: | function getStorageInfo(userAddress) {
/*
- validate userAddres
- fetch host-meta
- parse host-meta
- (optionally) fetch lrdd
- (optionally) parse lrdd
- extract links
*/
return util.getPromise(function(promise) {
try {
var hostnam... | [
"function getStorageInfo(userAddress, options) {\n\n /*\n\n - validate userAddres\n - fetch host-meta\n - parse host-meta\n - (optionally) fetch lrdd\n - (optionally) parse lrdd\n - extract links\n\n */\n\n var hostname = extractHostname(userAddress)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenient wrapper to throw an error that has an HTTP status code. These errors are publicfriendly, meaning their message can be displayed on the API. | function httpError(code = 500, message = http.STATUS_CODES[code]) {
const err = new Error();
err.statusCode = code;
err.message = message;
if (typeof message === "object") {
err.message = JSON.stringify(message);
err.data = message;
}
return err;
} | [
"function getStatusCodeError(code) {\n\treturn new Error(http.STATUS_CODES[code] || 'Unknown HTTP Status Code');\n}",
"function ApiError(status) {\n var msg = http.STATUS_CODES[status] || '';\n ApiError.super_.call(this, msg);\n this.status = status;\n}",
"raiseForStatus() {\n if (this.authError) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a MessagePort |port| where the other end is owned by a Remote (see above) turn each incoming MessageEvent into a call on |handler| and post the result back to the calling thread. | function forwardRemoteCalls(port,
// tslint:disable-next-line no-any
handler) {
port.onmessage = (msg) => {
const method = msg.data.method;
const id = msg.data.responseId;
const args = msg.data.args || [];
if (method === undefined || id === undefined) {
throw new... | [
"function forwardRemoteCalls(port, \n// tslint:disable-next-line no-any\nhandler) {\n port.onmessage = (msg) => {\n const method = msg.data.method;\n const id = msg.data.responseId;\n const args = msg.data.args || [];\n if (method === undefined || id === undefined) {\n thro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a grid and gridSize, create and draw internal maze | function createMaze(grid, gridSize)
{
// set up maze
for (var c = 1; c <= NOBOXES; c++)
{
i = AB.randomIntAtoB(1, gridsize - 2); // inner squares are 1 to gridsize-2
j = AB.randomIntAtoB(1, gridsize - 2);
grid[i][j] = new Spot(i, j, GRID_MAZE);
shape = new THREE.BoxGeometry... | [
"function drawGrid() {\n let cell = {\n x: 0,\n y: 0\n };\n\n for(let i = 0; i < MAZE_WIDTH; i++) {\n for(let j = 0; j < MAZE_HEIGHT; j++) {\n cell.x = i;\n cell.y = j;\n drawCell(cell);\n }\n }\n}",
"function draw_grid() \n {\n var hLines = new Path();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compute checksum of the buffer splitting by chunk of lengths bits | static checksumBuffer(buf, length) {
let checksum = '';
let checksum_hex = '';
for (let i = 0; i < (buf.length / length); i++) {
checksum_hex = this.read64LE(buf, i);
checksum = this.sumHex64bits(checksum, checksum_hex).substr(-16);
}
return checksum;
... | [
"function checksumBuffer(buf, length) {\n let checksum = 0\n let checksum_hex = 0\n for (let i = 0; i < (buf.length / length); i++) {\n checksum_hex = read64LE(buf, i)\n checksum = sumHex64bits(checksum.toString(), checksum_hex).substr(-16)\n }\n return checksum\n}",
"function calcFro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::CodeDeploy::DeploymentGroup.AutoRollbackConfiguration` resource | function cfnDeploymentGroupAutoRollbackConfigurationPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnDeploymentGroup_AutoRollbackConfigurationPropertyValidator(properties).assertSuccess();
return {
Enabled: cdk.booleanToCloudFormation(prop... | [
"function cfnStackSetAutoDeploymentPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnStackSet_AutoDeploymentPropertyValidator(properties).assertSuccess();\n return {\n Enabled: cdk.booleanToCloudFormation(properties.enabled),\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetches the document whose url is passed as extension | function getDocument(extension) {
var templateXHR = new XMLHttpRequest();
var url = baseURL + extension;
var loadingDoc = loadingTemplate(); // this function is a stand-alone page
templateXHR.responseType = "document";
templateXHR.open("GET", url, true);
if(extension == "backend/templates/h... | [
"fetchDocument(url) {\n // Cancel previous pending request\n if (this.documentFetchSubscription) {\n this.documentFetchSubscription.unsubscribe();\n }\n this.documentFetchSubscription = this._http.get(url, { responseType: 'text' }).subscribe((document) => this.updateDocument(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will return the 64 bit value as returned in an array from rsint64 / ruint64 to a value as close as it can. Note that Javascript stores all numbers as a double and the mantissa only has 52 bits. Thus this version may approximate the value. valAn array of two 32bit integers | function toApprox64(val)
{
if (val === undefined)
throw (new Error('missing required arg: value'));
if (!Array.isArray(val))
throw (new Error('value must be an array'));
if (val.length != 2)
throw (new Error('value must be an array of length 2'));
return (Math.pow(2, 32) * val[0] + val[1]);
} | [
"function toApprox64(val)\n {\n \tif (val === undefined)\n \t\tthrow (new Error('missing required arg: value'));\n \n \tif (!Array.isArray(val))\n \t\tthrow (new Error('value must be an array'));\n \n \tif (val.length != 2)\n \t\tthrow (new Error('value must be an array of length 2'));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set user to storage | setUser(user = null) {
this.user = user;
AsyncStorage.setItem('@tabvn_camera:user', user ? JSON.stringify(user) : "");
} | [
"function setUser(user) {\n localStorage.setItem('user', JSON.stringify(user));\n }",
"function storageUser(data) {\n localStorage.setItem('user', JSON.stringify(data));\n }",
"function setLocalStorage(user) {\n localStorage.setItem('locallyStoredUser', JSON.stringify(user));\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function from d3, reset brush offset if user presses "space" key while brushing a new area, to ensure foreground's size unchanged while position changing. | function d3_svg_brushKeydown(e) {
if (e.keyCode === 32 && d3_svg_brushTarget && !d3_svg_brushDrag) {
d3_svg_brushCenter = null;
d3_svg_brushOffset[0] -= d3_svg_brushExtent[1][0];
d3_svg_brushOffset[1] -= d3_svg_brushExtent[1][1];
d3_svg_brushDrag = 2;
e.stopPropagation();
}
} | [
"function d3_svg_brushKeydown(e) {\n if (e.keyCode === 32 && d3_svg_brushTarget && !d3_svg_brushDrag) {\n d3_svg_brushCenter = null;\n d3_svg_brushOffset[0] -= d3_svg_brushExtent[1][0];\n d3_svg_brushOffset[1] -= d3_svg_brushExtent[1][1];\n d3_svg_brushDrag = 2;\n e.stopPropaga... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Graphs a line graph based on time. Takes in graphName: name you are assigning the graph managerID: search manager or post process manager this graph is going to be pulling the data from divToHang: DOM element you want this graph to be shown in (either identified by an id, class, or element) yTitle: Title of the y axis | function graphOverTime(graphName, managerID, divToHang, yTitle) {
//Graphs the server's CPU as a time graph from the serverCPU post search
var serverGroupLine = new ChartView({
id: graphName,
managerid: managerID,
type: "line",
el: $(divToHang)
}).... | [
"function createGraph(id, athName, athId) {\n var POLL_INTERVAL = 5000;\n var MIN_Y_VAL = -3;\n var containerLabel = id;\n var ajaxUrl = '/getAthleteTimeseries';\n\n //assume these variables exist\n //proxies for now\n //in actuality make a function to get the athleteId and athleteName\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts the emulator with the given ROM file | function run(file) {
var dead = document.getElementById('loader');
dead.value = '';
var load = document.getElementById('select');
load.textContent = 'Loading...';
load.removeAttribute('onclick');
var pause = document.getE... | [
"function getFileAndLaunch(file) {\n if (file) {\n const startSimulatorCommand = `start ${file} && exit`;\n console.log(`Launching ${file}`);\n runCommand(startSimulatorCommand);\n return;\n }\n dialog.showOpenDialog(\n {\n properties: ['openFile'],\n filters: [{ name: 'Simulators', exte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encodes a message using PKCS1 v1.5 padding. | function _encodePkcs1_v1_5(m, key, bt) {
var eb = forge.util.createBuffer();
// get the length of the modulus in bytes
var k = Math.ceil(key.n.bitLength() / 8);
/* use PKCS#1 v1.5 padding */
if(m.length > (k - 11)) {
var error = new Error('Message is too long for PKCS#1 v1.5 padding.');
error... | [
"function _encodePkcs1_v1_5(m,key,bt){var eb=forge.util.createBuffer();// get the length of the modulus in bytes\nvar k=Math.ceil(key.n.bitLength()/8);/* use PKCS#1 v1.5 padding */if(m.length>k-11){var error=new Error('Message is too long for PKCS#1 v1.5 padding.');error.length=m.length;error.max=k-11;throw error;}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ToolTip functionality Creates a qtip2 tooltip on the passed in element | function buildToolTip(cssElement, title, html_list)
{
// jQuery(function()
// {
var $element = jQuery(cssElement);
$element.qtip(
{
show: 'click',
hide: 'click',
content:
{
text: html_list,
title: title,
... | [
"function set_tip(element_id,tip_title,tip_text){\r\n\t$(\"#\"+element_id).mouseover(function () { \r\n\t\tif(tip_title==\"\") Tip(\"\"+tip_text+\"\",BGCOLOR,\"#9CD9F7\",BALLOON,true,ABOVE,true,LEFT,true,BALLOONSTEMOFFSET,-48,OFFSETX,-40);\r\n\t\telse Tip(\"\"+tip_text+\"\",BGCOLOR,\"#E6E6E6\",TITLE,\"\"+tip_title+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abstraction for the SDK's simpleprefs API | function TestPrefs() {
} | [
"get _prefs() {\n delete this._prefs;\n return this._prefs = new this.Preferences(\"extensions.personas.\");\n }",
"updateSettings() {\r\n function getPrefByType(prefName, aDefault, aType) {\r\n let PrefFn = {0: \"\", 32: \"CharPref\", 64: \"IntPref\", 128: \"BoolPref\"};\r\n let fn = PrefFn[S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Xpath for Back button | get backButton() {return browser.element("//android.view.ViewGroup/android.view.ViewGroup/android.widget.Button");} | [
"get backButton() {return browser.element(\"//android.widget.Button/android.view.ViewGroup/android.widget.ImageView\");}",
"get VideoHub_BackButton() { return browser.element(\"//XCUIElementTypeButton[@name='header-back']\");}",
"get VideoHub_BackButton() { return browser.element('//XCUIElementTypeButton[@name=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Company class. Extends CompanyContainer | function Company(id, name, earnings, parentId) {
CompanyContainer.call(this);
this._id = id;
this._name = name;
this._earnings = earnings;
this._parentId = parentId;
} | [
"function Company(code,company){\r\n this.code = code;\r\n this.company = company;\r\n}",
"function Company() {\n this.companyName = \"\";\n this.info = \"\";\n this.companyPositions = []; //Names (only name, not object) of all company positions\n this.perks ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allocate new static memory. Return name of placeholder addr | allocateStatic(allowDirty = true) {
if (allowDirty && this.dirtyMemory.length > 0) {
let addr = this.dirtyMemory.shift();
return addr.split(" ");
}
//Create placeholder address
let addr = "S" + this.staticLength.toString().padStart(3, "0");
this.staticLeng... | [
"function createMemory() {\n const zeroMemory = List(Array(Constants.MEMORY_SIZE)).map(() => 0);\n\n // The OS memory is sparse, and is not stored as a normal LC3Program;\n // instead, it's an Object representing a partial function\n // from memory addresses to values.\n // We'll merge those in manua... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Damage the player. Required parameters: tempHealth. | function playerDamage(tempHealth) {
if (!playerInvulnerability){
playerInvulnerability = true;
player.alpha = 0.3;
setTimeout(playerInvulnerabilityStop, playerInvulnerabilityWait);
currentHealth -= tempHealth;
parseHealthBarAnimate();
if (currentHealth <= 0) {
... | [
"function playerHeal(tempHealth){\n currentHealth += tempHealth;\n if (currentHealth > maxHealth){\n currentHealth = maxHealth;\n }\n parseHealthBarAnimate();\n}",
"function attackPlayer(health) {\n return health - randomDamage();\n}",
"enemyDamage(tempProjectile,tempEnemy) {\n tempPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for shadow DOM components and the root element itself for light DOM) without having to go into snabbdom. Especially useful when the reset is a consequence of an error, in which case the children VNodes might not be representing the current state of the DOM. | function resetComponentRoot(vm) {
const {
children,
renderer
} = vm;
const rootNode = getRenderRoot(vm);
for (let i = 0, len = children.length; i < len; i++) {
const child = children[i];
if (!isNull(child) && !isUndefined$3(child.elm)) {
renderer.remove(child.elm, rootN... | [
"function resetShadowRoot(vm) {\n vm.children = EmptyArray;\n ShadowRootInnerHTMLSetter.call(vm.cmpRoot, ''); // disconnecting any known custom element inside the shadow of the this vm\n\n runShadowChildNodesDisconnectedCallback(vm);\n }",
"function resetComponentRoot(vm) {\n const {\n children,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trimTabsInEditor remove trailing tabs on text lines in editor. Also removes empty lines. | function trimTabsInEditor(text) {
if (!text) {
text = getTextFromEditor();
}
if (!text) {
console.log("No content to convert to Humdrum");
return;
}
var newtext = trimTabs(text);
setTextInEditor(newtext);
} | [
"function parseEditor() {\n var linesClean = []\n var lines = editor.getValue().split('\\n');\n for (var i = 0; i < lines.length; i++) {\n linesClean.push(lines[i].trim());\n }\n ASSEMBLY = linesClean;\n return linesClean;\n}",
"function trimTabs(data) {\n\tvar lines = data.split(/\\r?\\n/);\n\tvar outpu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Play a random local song | function playRandomLocalMedia() {
playLocalMedia(audioElement, Global.SOUNDS[Helper.getRandomInt(0, Global.SOUNDS.length)]);
} | [
"function playRandomSong() {\n\tvar randomsong_index = randomInt(all_tracks.length);\n\tif (current_song_index != undefined) {\n\t\tlast_tracks.push(current_song_index); // save the last song\n\t}\n\tplaySongAtIndex(randomsong_index);\n}",
"playRandom()\n\t{\n\t\tif(this.currentPlaylist)\n\t\t\tthis.play(this.cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get index of image that is showed. | function getCurrentImgID() {
for (imgIndex = 0; imgIndex < imgList.length; imgIndex++) {
var element = imgList[imgIndex];
if (img.src === element.src) {
return imgIndex;
}
}
} | [
"function whatIsMyIndex(){\n // select the current image\n currMain = document.querySelector('#modal #display img');\n //console.log(currMain);\n\n // get the filename of the current img\n imagename = getFilename(currMain);\n\n\n //imagename = currMain.substring(currMain.las... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ajax request to change an active parameter of a map(on the table page) | function gmapsl_change_active(sec_string, gmapsl_div_id, gmapsl_map_id) {
var gmapsl_div = jQuery('#gmapsl-div-' + gmapsl_div_id);
//alert(gmapsl_div.attr('data-toajax'));
if (gmapsl_div.attr('data-toajax') == 0) {
gmapsl_div.attr('data-toajax', '1');
} else {
gmapsl_div.attr('data-toaja... | [
"function setMapList(printMethode) {\n sendAjax(null, \"map\", \"readAll\", function(){\n if (this.readyState === 4 && this.status === 200) {\n let response = JSON.parse(this.responseText);\n if (response.success === true) {\n mapList = response.payLoad;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A public method to log out an app user clears all user fields from client | function logoutAppUser() {
this.setLoggedInUser(null);
this.setToken(null);
} | [
"_logoutUser() {\n // trace/journal user logout?\n // this.log(\"_setLoggedOutUser\", \"Logout User request received.\");\n this.session.clearUserInfo();\n this.getAppService().resetUser();\n }",
"function logoutUser() {\n logout();\n }",
"function logOut() {\n toDoUserOffline();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Append GA campaign variable to the tracked variables Following URL variables are used : utm_source utm_campaign utm_medium | function addCampaignVars() {
// GA variables to be fetched from URI
var urlParams = ['utm_source', 'utm_campaign', 'utm_medium', 'utm_term'];
for (var paramNameIndex in urlParams) {
var paramName = urlParams[paramNameIndex];
var paramValue = getQueryStringParameterByNam... | [
"trackCampaign() {\n // get URL params\n const query = {};\n const q = window.location.search.substring(1);\n const iterable = q.split('&');\n for (let i = 0; i < iterable.length; i += 1) {\n const chunk = iterable[i];\n const pair = chunk.split('=');\n query[decodeURIComponent(pair[0]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion MIRROR region AVATAR Save and change the avatar to Avi | function saveAvatarAndChangeToAvi() {
AvatarBookmarks.addBookmark(CONFIG.STRING_BOOKMARK_NAME);
changeAvatarToAvi();
} | [
"function changeAvatarToAvi() {\n // Set avatar to Avi.fst\n MyAvatar.useFullAvatarURL(AVATAR_URL);\n MyAvatar.setAttachmentsVariant([]);\n dynamicData.state.isAviEnabled = true;\n }",
"function save_avatar(user) {\n PrivateHistory.avatars[user.attributes.name] = user.attribute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load a stylesheet in the content tab | function _load_content_stylesheets_in_tab( stylesheets, tab ){
if(!stylesheets) return;
//coerce tab to tabId
if(typeof tab === 'object') tab = tab.id;
if(typeof(stylesheets) != 'object') stylesheets = [stylesheets];
stylesheets.forEach( ssheet => {
chrome.tabs.inse... | [
"function load_css(document) {\n // taken from https://stackoverflow.com/questions/574944/how-to-load-up-css-files-using-javascript\n var cssId = \"psono-css\"; // you could encode the css path itself to generate id..\n if (!document.getElementById(cssId)) {\n var head = document.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply the mixin to the given base class to return a new class. The mixin can either be a function that returns the modified class, or a plain object whose members will be copied to the new class' prototype. | function composeClass(base, mixin) {
if (typeof mixin === 'function') {
// Mixin function
return mixin(base);
} else {
// Mixin object
var Subclass = function (_base2) {
_inherits(Subclass, _base2);
function Subclass() {
_classCallCheck(this, Subclass);
return _possibl... | [
"function _compose(base, mixin) {\n\n // See if the *mixin* has a base class/prototype of its own.\n var mixinIsClass = isClass(mixin);\n var mixinBase = mixinIsClass ? Object.getPrototypeOf(mixin.prototype).constructor : Object.getPrototypeOf(mixin);\n if (mixinBase && mixinBase !== Function && mixinBase !== O... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete an entity by id | function deleteEntityById(id) {
delete entities[id];
} | [
"delete(id) {\n assert.ok(id)\n return this.collection.findOneAndDelete({ id })\n }",
"function deleteEntity(entityId, headers = {}) {\n return request({\n url: BASE_PATH + '/entities/' + entityId,\n method: 'DELETE',\n headers,\n json: true\n });\n}",
"async function _delete (id) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return average adventures expected from consuming an item If item is not a consumable, will just return "0". | function getAverageAdventures(item) {
return getAverage(item.adventures);
} | [
"function averageItemPrices(items){\n\treturn items.map(function(item){\n\t\t\t\treturn item.price;\n\t\t\t}).reduce(function(first, second){\n\t\t\t\treturn first + second;\n\t\t\t}) / item.length\n}",
"function getAverageSpentPerItem(obj) {\n var totalPrice = 0;\n var totalItems = 0;\n for(var i=0;i<obj.item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Download a module from a url This is called by install | function downloadUrl(fromUrl,toPath,cli,next) {
// Split module / version
var url = fromUrl, path = require('path');
if(url) {
var u = require('url'), fs = require('fs');
var parts = u.parse(url);
var tmpName = path.basename(parts.pathname);
if(tmpName && tmpName.match(/.zip$/)) {
... | [
"function downloadModule(options, cli, next) {\n var toPath = calipso.app.path() + \"/modules/downloaded/\";\n var fromUrl = options[1];\n download('module', fromUrl, toPath, cli, function (err, moduleName, path) {\n if (err) {\n next(err);\n } else {\n installViaNpm(moduleName, path, next);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: fillOutResults This function takes a starting row number and fills out the results table with up to five results starting with the given row number. It fills out the table like: number title score description release add | function fillOutResults(row_num) {
var row = row_num;
var col = 0;
var currentResult = qResults.results[row];
$("#resultsTable").find("td").each(function() {
if(row < qResults.results.length){
if(col === 0){
$(this).html((row+1) + "");
col+=1;
}
else if(col === 1) {
$(this).h... | [
"function populateResults() {\n\tvar $table = $(\"table\");\n\tObject.keys(timings).forEach(function(key) {\n\t\tvar $row = $(\"<tr></tr>\").appendTo($table);\n\t\t$row.append(\"<td>\" + key + \"</td>\");\n\t\tObject.keys(timings[key]).forEach(function(cycle) {\n\t\t\tvar nums = timings[key][cycle],\n\t\t\t\tavg = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
increase the value of x's key to new value k | increaseKey(S, x, k) {} | [
"changekey(i, h, k) {\n\t\tthis.#key[i] = k - this.#offset[h];\n\t\tthis.refresh(i);\n\t}",
"set (key,value){\n if (!this.map.has(key))\n this.map.set(key, {\n 'currentVersion': 0\n });\n let cv = this.map.get(key)['currentVersion'];\n this.map.get(key)[cv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
curry4 :: ((a, b, c, d) > e) > (a > b > c > d > e) | function curry4(f) {
function curried(a, b, c, d) {
// eslint-disable-line complexity
switch (arguments.length) {
case 0:
return curried;
case 1:
return curry3(function (b, c, d) {
return f(a, b, c, d);
});
case 2:
return curry2(function (c, d) {
... | [
"function curry4 (f) {\n function curried (a, b, c, d) { // eslint-disable-line complexity\n switch (arguments.length) {\n case 0: return curried\n case 1: return curry3(function (b, c, d) { return f(a, b, c, d); })\n case 2: return curry2(function (c, d) { return f(a, b, c, d); })\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====================== Event Listeners ====================== onVideoEvent | function onVideoEvent(e) {
// NOTES: typical html5 video playback event sequence is as follows...
//if (e.type != "timeupdate") console.log("onVideoEvent: " + e.type);
/*
== iOS - iPad ==
play
waiting
loadedmetadata
timeupdate
progress [progress... | [
"listenVideoEvent() \n\t{\n\t\tlet stateNames = {\n\t '-1': 'unstarted',\n\t '0': 'ended',\n\t '1': 'playing',\n\t '2': 'paused',\n\t '3': 'buffering',\n\t '5': 'video cued'\n \t};\n \t\n \tif (this.youtubeIframe != undefined) {\n \t\t\n \t\tthis.youtubeIfram... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Just a helper function to animate slide effect on selected module | function _slideToElement() {
var module_name = this.getAttribute('data-module');
$('html, body').animate({
scrollTop: $('#' + module_name).offset().top
}, 500);
} | [
"function appModuleAnimation() {\r\n return slideFromBottom();\r\n}",
"function slide(options) {\n if (options.switchTimeout) {\n clearTimeout(options.switchTimeout);\n }\n\n options.panel.panel.className = 'urs-panel animate';\n\n move(options);\n\n options.switchTimeout = setTimeout(funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
define function to do next 1000 iterations | function metropolis1000Iterations(){
for (var ii=0; ii<1000; ii++) metropolisJump();
redraw();
} | [
"function metropolis100Iterations(){\n \tfor (var ii=0; ii<100; ii++) metropolisJump();\n \tredraw();\n }",
"function simulatedNextFunc() {}",
"function nextTenResults(value){\n adjustPageCounter(value)\n showPagination()\n fetchImgs()\n}",
"function intGoNext(){\n goNext(0);\n }",
"function ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
JSONSocketConnection Options socketUrl attemptReconnectionAfterMS wait until attempting reconnection. Default 1000. Events 'open' 'closed' 'reconnecting' 'closed successfully' 'json' 'nonjson' 'message' | function JSONSocketConnection ( options ) {
this.socketUrl = options.socketUrl;
this._connectionDesired = false;
this.attemptReconnectionAfterMS = (typeof attemptReconnectionAfterMS !== 'undefined') ? options.attemptReconnectionAfterMS : 1000;
} | [
"reconnect() {\n const self = this;\n const { retryConnectionDelay } = self;\n switch (typeof retryConnectionDelay) {\n case 'boolean':\n if (retryConnectionDelay) {\n setTimeout(self.connect, 1000);\n } else {\n self.connect();\n }\n break;\n case 'n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Condition builder for number inequality | numNe(key, value) {
debug('Number property inequality condition');
debug('key - %s, value - %s', key, value);
return new BoolQuery().mustNot(new TermQuery(key, value));
} | [
"function lessOrEqual(num) {\n\n if (num <= 0) console.log(true);\n else console.log(false);\n}",
"function lessOrEqual(num) {\n if (num > 5) {\n return \"True\";\n }\n return \"False\";\n}",
"lte(other) { return this.cmp(other) <= 0; }",
"function checkwithTernaryOP(a,b){\n return a<... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
uses built in mouseClicked function to send the data to the pubnub server | function mouseClicked() {
sendChannel1();
} | [
"function mouseClicked() {\n \n // Send Data to the server to draw it in all other canvases\n dataServer.publish(\n {\n channel: channelName,\n message: \n { //set the message objects property name and value combos \n x: mouseX,\n y: mouseY \n }\n });\n\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Array color to hex color | function convertArrayToHexColor(arrayColor){
// array -> rgb -> hex
var rgb = arrayToRGB(arrayColor);
var hex = rgbToHex(rgb);
return hex;
} | [
"function rgb2hex(colorArray) {\n var color = [];\n for (var i = 0; i < colorArray.length; i++) {\n var hex = colorArray[i].toString(16);\n if (hex.length < 2) { hex = \"0\" + hex; }\n color.push(hex);\n }\n return \"#\" + color.join(\"\");\n }",
"rgbToHex (array) {\n var hexChars =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update one file, returns whether updated. | async updateFile(uri, item) {
if (!this.hasIgnored(uri)) {
if (!item.updatePromise) {
item.updatePromise = this.createUpdatePromise(uri, item);
this.updatePromises.push(item.updatePromise);
await item.updatePromise;
item.updatePromise =... | [
"function updateFileAndReturn() {\n request(fileUrl, function (error, response, body) {\n fs.writeFileSync(filePath, body);\n returnFile();\n });\n }",
"async updateFile(filePath, expectedContents) {\n const fileName = chalk_1.default.bold(path_1.default.basename(file... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is called by the UI to check if the LoginShield realm is configured or needs setup NOTE: in production, only authorized administrators should have access to this API | async function httpGetAdminLoginShield(req, res) {
try {
const { LOGINSHIELD_REALM_ID, LOGINSHIELD_ENDPOINT_URL, ENDPOINT_URL } = process.env;
try {
if (LOGINSHIELD_REALM_ID) {
console.log('httpGetAdminLoginShield: trying with realm id');
const loginshiel... | [
"isLoginProvided() {\n return this.#login === true;\n }",
"function isAuthValid() {\r\n //Here we check whether the user credentials have been authorized against the OmniIndex Platform.\r\n //If they have then the authorized property will have been set to true.\r\n var properties = PropertiesService.getScr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of locations, append each with a forecast object queried from openweathermap | function retrieveForecast(locations, callback) {
for (let loc of locations) {
getTemp(forecastURL, loc.id, appID, (temp) => {
try {
let obj = JSON.parse(temp);
loc.forecast = obj;
callback();
} catch(error) {
console.log(error);
}
});
}
} | [
"function retrieveWeather(locations) {\n for (let loc of locations) {\n getTemp(currentURL, loc.id, appID, (temp) => {\n try {\n let obj = JSON.parse(temp);\n loc.weather = obj;\n updateMarker(loc.weather.main.temp, loc.weather.weather[0].main, loc.id);\n } catch(error) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create equipment type list | function addEquipmentTypes() {
let select = document.getElementById('equipmentTypeSelector');
for (let i = 0; i < equipmentTypeArray.length; i++) {
let option = document.createElement('option');
option.text = equipmentTypeArray[i];
option.value = i;
select.add(option);
}
} | [
"function itemList(armor_type) {\n armor_type = armor_type.toUpperCase();\n\n return [\n `${tier}_ARMOR_${armor_type}_SET1`,\n `${tier}_ARMOR_${armor_type}_SET2`,\n `${tier}_ARMOR_${armor_type}_SET3`,\n `${tier}_HEAD_${armor_type}_SET1`,\n `${tier}_HEAD_${armor_type}_SET2`,\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the document as HTML. | getHTML() {
return getHTMLFromFragment(this.state.doc.content, this.schema);
} | [
"getHTML() {\r\n return getHTMLFromFragment(this.state.doc.content, this.schema);\r\n }",
"getHTML() {\n return getHTMLFromFragment(this.state.doc, this.schema);\n }",
"function getDocumentContent() {\n var doc = DocumentApp.openById(this.pdfToDoc());\n \n this.textFormattingToHtml(doc.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read XML response, extract IDs and values, refresh states with new values | function refreshValues(xml) {
const regex = /<ID>(?<ID>v\d{5})<\/ID>\s*?<VA>(?<VALUE>.*?)<\/VA>/gm;
var elements = xml.matchAll(regex);
for (let element of elements) {
let { ID, VALUE } = element.groups;
let NAME = datapoint_names[ID];
// Only refresh values that we have names for
if (NAME != un... | [
"function parseStateResponseXML(xmlResponse){\r\n\trootNode = xmlResponse.documentElement;\r\n\tif (rootNode == null)\r\n\t\talert(\"Could not retrieve States\");\r\n\telse{\r\n\t objSelectState = document.DODSForm.selState;\r\n\t\tStateNodes = rootNode.getElementsByTagName('State');\r\n\t\tif( StateNodes.lengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a JavaScript value and a GraphQL type, determine if the value will be accepted for that type. This is primarily useful for validating the runtime values of query variables. Copyright (c) 2015, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in ... | function isValidJSValue(value, type) {
// A value must be provided if the type is non-null.
if (type instanceof _definition.GraphQLNonNull) {
if ((0, _isNullish2.default)(value)) {
return ['Expected "' + String(type) + '", found null.'];
}
return isValidJSValue(value, type.ofType);
}
if ((0, ... | [
"function isValidJSValue(value, type) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if ((0, _isNullish2.default)(value)) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidJSValue(value, type.ofType);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copies given array of Badge objects to new organization object | async function cloneBadges(badges, organization) {
console.log(
`cloning ${badges.length} badgees to org id ${organization.id}`
);
// map each badge to a function that will clone it
let badgeSaveArray = badges.map(async badge => {
const result = await copyBadgeToOrg(badge, organization);
//console.log(result.... | [
"async function cloneBadges(badges) {\n let newBadgesArray = [];\n let intermediateBadgesArray = [];\n for (var i = 0; i < badges.length; i++) {\n var newBadge = badges[i].clone();\n newBadge.set(\"organizationID\", organization.id);\n newBadge.set(\"organizationName\", organization.get(\"na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A property which resolves the ComponentPresentation instance for the current component. | get $presentation() {
if (this._presentation === void 0) {
this._presentation = ComponentPresentation.forTag(this.tagName, this);
}
return this._presentation;
} | [
"get $presentation() {\n if (this._presentation === null) {\n this._presentation = this.container.get(ComponentPresentation.keyFrom(this.tagName));\n }\n\n return this._presentation;\n }",
"get $presentation() {\n if (this._presentation === null) {\n this._presentation = this.cont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pop / if first is empty return null else set first to pe the next proprtoy | pop(value){
if(!this.first) return null;
var removed;
if(this.length===1){
removed = this.first;
this.first= null;
this.last = null
}
else {
removed = this.first;
this.first= this.first.next;
}
this.length--;
return removed;
} | [
"pop() {\n if (!this.first) return null;\n\n let removed = this.first;\n\n if (this.first === this.last) {\n this.last = null;\n // why not set this.first = null?\n }\n\n // It's possible that removed.next === null\n // Therefore the first line in put will return null\n // So there's ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[_handleOutsideClick Function to hide open filter list when click is done anywhere else] | _handleOutsideClick(e){
if(!this.filterIconNode.contains(e.target)){
this._hideFilter();
}
} | [
"function clickOutside(e) {\n if (!IsOrContains(searchField, e.target) && !IsOrContains(resultsEl, e.target)) {\n HideResults(searchField);\n }\n }",
"function hideOnClickOutside(e) {\n if (!$(e.target).closest('.nav-group__item').length) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether `id1` in `env1` and `id2` in `id2` is the same identifier | async identifierEquals(id1, env1, id2, env2) {
if (!isIdentifier(id1) || !isIdentifier(id2)) return false;
const l = await this.expand(id1, env1);
const r = await this.expand(id2, env2);
return l === r;
} | [
"function sameEnvDimension(dim1, dim2) {\n return [core_1.TokenComparison.SAME, core_1.TokenComparison.BOTH_UNRESOLVED].includes(core_1.Token.compareStrings(dim1, dim2));\n}",
"function environmentEquals(left, right) {\n return left.account === right.account && left.region === right.region;\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
close other sections when user click on section who is close for open it mission section tab | function closeTab1() {
// close rocket section
descriptionRocketEarth.classList.remove('displayYes')
descriptionRocketEarth.classList.add('displayNone')
imgChevronRockEarth.src = 'images/earthChevron.png'
//close datas sections
descriptionDatasEarth.classList.remove('disp... | [
"function closeSection(){\n $('.section-up-link').click(function(){\n event.preventDefault();\n $(this).siblings('.section-content').hide('slow');\n $(this).siblings('.section-down-link').removeClass('not-active');\n $(this).removeClass('active');\n });\n}",
"function uncollapse(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load an image as a texture | function loadTexture() {
var image = new Image();
// create a texture object
lennaTxt.textureObject0 = gl.createTexture();
image.onload = function () {
initTexture(image, lennaTxt.textureObject0);
// make sure there is a redraw after the loading of the texture
draw();
};
// setting the src will ... | [
"function loadTexture() {\n\n console.log(\"loading Texture\");\n\n var image = new Image();\n\n // create a texture object\n lennaTxt.textureObj = gl.createTexture();\n\n image.onload = function () {\n\n initTexture(image, lennaTxt.textureObj);\n\n // make sure there is a redraw after ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mutation for selling shrimp | 'SELL_STOCK' (state, {shrimpId, quantity, shrimpPrice}) {
// Checks to see which items are already in the array
const record = state.shrimpInventoryData.find(element => element.id == shrimpId);
// Detracts from quantity
if (record.quantity > quantity) {
... | [
"'ADD_QUANTITY' (state, {shrimpId, quantity}) {\n \n // Retrieves the available shrimps in the market\n const record = state.shrimpMarketData.find(element => element.id == shrimpId);\n \n // Subtracts the market quantity from purchase quantity\n record.quantity += quantity;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the size for the dots adapted to the data length | getDotSize(data) {
var container = $(`#${this.container_id}`);
var diameter = Math.floor(container.width() / data.length);
return {
diameter: diameter,
unit_height: Math.floor((container.height()-diameter) / (Math.max.apply(null, data)))
};
} | [
"_computeDataSize(data) {\n return `${Math.round(JSON.stringify(data).length / 1000).toLocaleString('en-us')} kb, `;\n }",
"function getSizeLabelX(data){\n \n var sizeLabelX = 16;\n \n // length : 30 --> 16\n // length : 40 --> 15\n // length : 50 --> 14\n if(data.length > 30 && data.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Release an individual item of text/content from the gate | releaseItem(item_id, cb) {
this.session.put({ url: this.url + '/api/filter/gated/' + item_id }, cb);
} | [
"function _releaseBead ( bead )\n\t{\n\t\tvar data;\n\n\t\tif ( bead.active )\n\t\t{\n\t\t\tif ( PS.release )\n\t\t\t{\n\t\t\t\tdata = _getData( bead );\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tPS.release( bead.x, bead.y, data, _EMPTY );\n\t\t\t\t\t_gridDraw();\n\t\t\t\t}\n\t\t\t\tcatch ( err )\n\t\t\t\t{\n\t\t\t\t\tretu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mount a raw CEP sequence based on argument | function mountRawSequence ( value ) {
var out = '';
var isCep = validCepFormat( value );
if ( isCep ) out = value.replace('-', '');
return out;
} | [
"function sendcom(num, arg){\nvar ev = new EventEmitter();\n var spawn = require('child_process').spawn;\n var sendcomand = \n// 本番\n spawn('/home/coder/coder-dist/coder-base/sudo_scripts/sendcom',[num,'-e',arg]); \n// for test\n// spawn('cat',['file-'+arg]); \n\tsendcomand.stdout.on('data', function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Figure out all the sectors, create sector table | findSectors(companies) {
let splitIndex = null;
let includesSectors = [];
let excludesSectors = [];
for (let company of companies) {
let sector = company['sector'];
if (!includesSectors.includes(sector)) {
includesSectors.push(sector);
... | [
"function createSectors() {\r\n var job, i, j, jCount, k, sectorTiles, allExpandedTiles;\r\n\r\n job = this;\r\n\r\n // Create the sectors\r\n for (i = 0; i < 6; i += 1) {\r\n job.sectors[i] = new window.hg.Sector(job.grid, job.baseTile, i,\r\n config.expandedDisplacementTileCount);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Close the current session (signout). Callback is invoked with an error message if the operation was not successful. | function closeSession(callback) {
authClient.session.close().then(callback).fail(function () {
callback('There was a problem closing the session');
});
} | [
"function closeSession(callback) {\n authClient.closeSession().then(callback)\n .fail(function () {\n callback('There was a problem closing the session');\n });\n }",
"function closeSession(callback) {\n authClient.session.close().then(callback).fail(function () {\n callback('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getSharedBookMessages that filters messages between users that share a book id. | async getSharedBookMessages(userID, senderID, bookID) {
const db = new orm('mylibrary');
let sharedBookMessages = await db.innerJoinSorted(
'users',
'messages',
'users.id',
'messages.recipient_id',
'date_added',
);
sharedBookMes... | [
"async getSharedMessages(userID, senderID) {\n const db = new orm('mylibrary');\n let sharedMessages = await db.innerJoinSorted(\n 'users',\n 'messages',\n 'users.id',\n 'messages.recipient_id',\n 'date_added',\n );\n sharedMessages ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[ open GM_config ] | function showConfig() {
GM_config.open();
} | [
"function GM_configStruct(){if(arguments.length){GM_configInit(this,arguments);this.onInit()}}",
"load() {\n var data = fs.readFileSync(this.configPath, {\n encoding: 'utf-8'\n });\n this.config = ini.parse(data);\n }",
"_open_settings() {\n\t\ttry {\n\t\t\tUtil.trySpawnComman... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logic requered find oldest overdue topic | function requeryMostOverdueTopic() {
store
.dispatch('fetchFromStorage', 'topics')
.then(() => {
const topics = store.getters.topics;
const overdueTopics = topics.filter(topic => {
let isOverdue = false; // default to not overedue
if (topic.custom.enabled) {
... | [
"compareTop(a, b) {\n if (a.published_date + a.title > b.published_date + b.title) {\n return -1;\n } else if (a.published_date + a.title < b.published_date + b.title) {\n return 1;\n } else {\n return 0;\n }\n }",
"function getOlderPosts( group ){\n var before = ( buffers[g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
values are also equal when compared with a recursive call to deepEqual... okay cool, his idea is way better of course, and it doesn't use this string trick... fix it tomorrow night | function deepEqual(a, b){
if (typeof(a) != typeof(b)){
console.log("types don't match!");
return false;
}
if ((typeof(a) == "object" && typeof(a) != null) && (typeof(b) == "object" && typeof(b) != null)){
var countA = 0;
var countB = 0;
var stringA = "";
... | [
"function deepEquals (t, a, b) {\n let strA = stringify(a)\n let strB = stringify(b)\n if (strA !== strB) {\n console.log(strA)\n console.log(strB)\n process.exit(1)\n }\n t.equals(strA, strB)\n}",
"function deepEqual(value1, value2) {\n \n //set up initial if statement in if-else chain\n \n //t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the workshop info | function SetAppWorkshopInfo( appid, hashParams )
{
AppsAjaxRequest( g_szBaseURL + '/apps/setworkshopinfo/' + appid, hashParams,
function( results )
{
// now reflect results
CommonSetHandler( results );
},
"POST"
);
} | [
"function addWorkshopDataToEditWorkshopButton(titleWorkshop, coachWorkshop){\n\n const editWorkshop = document.getElementById(\"edit-workshop\")\n\n editWorkshop.setAttribute(\"data-title\", titleWorkshop)\n editWorkshop.setAttribute(\"data-coach\", coachWorkshop)\n}",
"function saveNewShop(shop_info, ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create and initialize obects related to Expenses class. | constructor() {
this.expenses = []
this.items = []
this.expensesAdapter = new ExpensesAdapter()
this.itemsAdapter = new ItemsAdapter()
this.expenseBindingsAndEventListeners()
this.fetchAndLoadExpenses()
} | [
"function Expenses(tax, utilities, repairs, landscaping, management, leasing, growth) {\n this.tax = tax;\n this.utilities = utilities;\n this.repairs = repairs;\n this.landscaping = landscaping;\n this.management = management;\n this.leasing = leasing;\n this.growth = growth;\n}",
"construct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send Transition The purpose of this method is to send the transition type to the client. The T is the indication to the client that it is a transition message. The transition type is then appended to it. | function sendTransition(transitionType)
{
socketSend('T' + transitionType);
} | [
"setTransitionType(value) {\n console.log(\"set transition type\", value);\n const data = new Buffer(4);\n data.fill(0);\n data[0] = 1;\n data[2] = value;\n this.mixer.sendCommand(new Atem.Command('CTTp', data));\n }",
"createTransition(transitionType) {\n\t\tif (trans... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inserisce gli attributi ad uno span appena creato | function setSpanAttributes(label, tipo, ora, mail, user, flag, name) {
var escapeLabel = label.replace(/(['"&])/g, "\\$1"); // Replace di virgolette singole, doppie e caratteri speciali con un escape
var codice;
if (flag) {
codice = numeroAnnotazioni;
} else {
codice = numeroAnnEsterne;... | [
"function setAttributes(){\n // supercalifragilisticexpialidocious supercalifragilisticexpialidocious supercalifragilisticexpialidocious supercalifragilisticexpialidocious supercalifragilisticexpialidocious font-size:48px;color:red; supercalifragilisticexpialidocious supercalifragilisticexpialidocious\n const s =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an expression with the given type and attributes | function expression(expr, attr) {
var expression = { expression: expr };
if (attr) for (var a in attr) {
expression[a] = attr[a];
}return expression;
} | [
"function expression(expr, attr) {\n const expression = { expression: expr };\n if (attr)\n for (let a in attr)\n expression[a] = attr[a];\n return expression;\n }",
"function expression(expr, attr) {\n var expression = { expression: expr };\n if (attr)\n for (var a in attr)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CreateChildEnvironment Hook Create an environment object that will inherit everything from its parent environment until written over with a local variable. | function createChildEnv(parent) {
var env = Object.create(parent);
env.helpers = Object.create(parent.helpers);
return env;
} | [
"function createChildEnvironment(childLogger, environment){\n if(!environment){\n return null;\n }\n\n var childEnvironment = {};\n\n if(environment.vistaClient){\n childEnvironment.vistaClient = environment.vistaClient.childInstance(childLogger);\n }\n\n if(environment.jds){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The number of bone types that are required by Mecanim for any human model. | static get RequiredBoneCount() {} | [
"static set RequiredBoneCount(value) {}",
"getBonesCount() {\nif (this.bones) {\nreturn this.bones.length;\n} else {\nreturn 0;\n}\n}",
"function _minNumberOfBottles(){\n quotient = Math.floor(input / 845);\n while (count < quotient){\n for (i in types){\n types[i] += 1;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load aspect method for container | async loadAspect() {
// for aop implementation
const aspectModules = (0, decorator_1.listModule)(decorator_1.ASPECT_KEY);
// sort for aspect target
let aspectDataList = [];
for (const module of aspectModules) {
const data = (0, decorator_1.getClassMetadata)(decorator_... | [
"_load() {\n if (this._dirty) {\n this._advicesRegistry.byPointcut = {};\n this._advicesRegistry.byTarget = {};\n }\n if (!this._aspectsToLoad.size) {\n return;\n }\n [...this._aspectsToLoad]\n .sort((a1, a2) => {\n var _a, _b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select function / Activation card | function select (Ucardid,activateCard,status)
{
var activenum= activateCard;
var cardId= Ucardid;
if ( status=="active")
{
swal ( "Congratulation!", "Card is already Activated")
}
else if ( status=="locked")
{
swal ( "OOPS!", "Your Card is Locked")
}
else if(status==... | [
"function selectCard(evt) {\n console.log(\"select card\", evt);\n // retrieve .card element\n var card = $(evt.target);\n if(card.hasClass(\"symbol\")) {\n card = card.parent(\".card\");\n }\n // toggle selected state\n card.toggleClass(\"selected\");\n // if 3 selected cards: stop s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |