query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
_processDataToSend gets the fields&values from a tab | function _processDataToSend(tabName, fields) {
var retorno = [];
for (var i = 0; i < _tabs.length; i++) {
if (_tabs[i].tabName === tabName) {
var item = {};
item['tabName'] = _tabs[i].tabName.toLowerCase();
for (var key in fields) {
for (var f = 0; f < _tabs[i].fields.l... | [
"function getPostData( e )\n{\n getCurrentTab( tab => {\n\n if( e.method == 'POST' )\n postData[tab.id] = e.requestBody.formData;\n\n else\n postData[tab.id] = '';\n });\n}",
"function ClickToPrepareData(dataMemory,dataTemp) {\n sendRequestOrder = document.getElementBy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the first value with data in the defined temporal range | get temporalRangeMin() {
return this.temporalRange[0];
} | [
"function getValueFromSeries(series, t) {\n function inBetween(p,q) {\n return p == q ? p : linear(p[1],q[1], (t - p[0]) / (q[0] -p[0]))\n }\n\n var i = 0\n\n while( i < series.data.length && series.data[i][0] <= t){\n i++;\n }\n\n var p = series.data[i-1]\n var q = series.data[Ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make every button count the reps | function repsButtonCounter(exercise) {
if (!this.value){
this.value = exercise.maxReps;
} else if(this.value == 1) {
this.value = null;
} else {
this.value --;
}
//save the counter inside the object..so you can save it afterwards
exercise.reps = this.value;
} | [
"function addToCount() {\n totalButtonsPressed++;\n recentButtonsPressed++;\n}",
"function PushButtonRepeat(repeat) { bind.PushButtonRepeat(repeat); }",
"function createRepsButton(exercise, exerciseDiv) {\n const repsButton = document.createElement('input');\n repsButton.setAttribute('readonly', 'readon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populates the skill tree | function populateSkillTree() {
// Get the skill tree DOM element and clear it
var skillTree = document.getElementById("skill-tree");
skillTree.innerHTML = "";
// Initially unlock the apple and the wheat
if (!window.game.player.unlockedItems.includes(ITEM_APPLE) && !window.game.player.unlockedItems.... | [
"function populateTree(data) {\n for (let n=0;n<data.children.length;n++) {\n populateTree(data.children[n]);\n }\n console.log(\"adding node:'\"+ data.name + \"' id:\"+data.id);\n nodeListByName[data.name]=data.id;\n}",
"function setABS(){\n // Create a blank version of the skillList\n let n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if the mediaelement is active | function isMediaElementActive(){
return(typeof mejs != "undefined");
} | [
"function isPlaying() {\n return (videoEl.currentTime > 0 && !videoEl.paused && !videoEl.ended && videoEl.readyState > 2);\n }",
"load(){\n console.debug(\"Loading\", this.id);\n for (let i = 0; i < this.mediaSourceListeners.length; i++) {\n if(typeof this.mediaSourceListeners[i].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4.5 Calls AJAX to save map settings to the database | function dml_Save_Settings_Panel() {
var myApiCode = jQuery("#dmlMapApiCode").val();
var myMapHeight = jQuery("#dmlMapHeight").val();
var myMapType = dmlmyArr[0].dml_fill_color;
var dmlMapCustomCode;
if (myMapType == 0) {
dmlMapCustomCode = jQuery("#dmlCustomStyleCode").val();
} else {
dmlMapCustomCode = '.';... | [
"function initializeOpenMapSubmit() {\n $(\"form.open-map\").submit(function () {\n var parameters = $(this).serialize();\n $.ajax({\n data: parameters,\n url: this.action,\n timeout: 2000,\n error: function () {\n console.log(\"AJAX Error\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change whether a task/event is completed and push to google | function toggleComplete(taskName) {
var task = TaskListNamespace.taskList.tasks[taskName];
var calendar = TaskListNamespace.cal;
var p = new promise.Promise();
task.completed = !task.completed;
var req = {
'calendarId': calendar.id,
'eventId': task.id
},
ev = {
... | [
"function api_putTaskCompleted(token, task){\n\tvar delURL = \"https://www.googleapis.com/\";\n\tdelURL += \"tasks/v1/lists/@default/tasks/\";\n\tdelURL += task.id;\n\n\tvar xhr = new XMLHttpRequest();\n\txhr.responseType = 'json';\n\txhr.open('PUT', delURL);\n\txhr.setRequestHeader('Authorization', 'Bearer ' + tok... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks at an item, displaying its description text. | function lookAtItem(itemTarget)
{
printText(roomArray[currentRoom].items[itemTarget].descText);
} | [
"function lookAtOwnItem(itemTarget)\n{\n\tprintText(inventory[itemTarget].descText);\n}",
"function showItems() {\n\t\tvar itemlist = [];\n\t\n\t\tfor (var i = 0; i < room.items.length; i++) {\n\t\t\tif (room.items[i].specialdesc) {\n\t\t\t\toutput.before(room.items[i].specialdesc + \"<br />\");\n\t\t\t}\n\t\t\te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch list of doctors from API and add them to select element | function getDoctorsListAndAddToSelect() {
const xhr = new XMLHttpRequest();
xhr.responseType = "json";
xhr.addEventListener('load', function () {
if (this.status === 200) {
const response = xhr.response;
// Check if response is not empty
let selectDoctor = documen... | [
"async function getComputers() {\n try{\n const response = await fetch('https://noroff-komputer-store-api.herokuapp.com/computers')\n json = await response.json()\n\n for(let i = 0; i < json.length; i++) {\n let opt = document.createElement('option');\n opt.name = json[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searches for a given view element inside the available dialogs in current page if found, the dialog is displayed, the dialog id is returned. | showAncestorDialog(viewName) {
let dialogId;
$('app-root [dialogtype]')
.each(function () {
const dialog = $(this);
if ($(dialog.html()).find('[name="' + viewName + '"]').length) {
dialogId = dialog.attr('name');
return false;
... | [
"getById(id) {\n return this._openDialogs.find(ref => ref.id === id);\n }",
"function popupFindItem(ui) {\n\n v_global.event.type = ui.type;\n v_global.event.object = ui.object;\n v_global.event.row = ui.row;\n v_global.event.element = ui.element;\n\n switch (ui.element) {\n case \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FINE "pulizia" pagina di wiki// funzione richiesta wikiCATEGORY | function req_wiki_category (string) {
var url =
"https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:"+string+"&cmlimit=100&cmsort=sortkey&format=json&callback=?";
$.ajax({
url: url,
... | [
"function loadCategoriesAndNews(){\r\n\t$.ajax({\r\n\t type: \"GET\",\r\n\t url: wp_service_route_categories + \"?limit=\" + category_no_limit,\r\n\t dataType: \"json\",\r\n\t success: function (data) {\t \t\r\n\t \t$.each(data,function(i,category){\r\n\t \t\t$(\".top_nav\").append($(\"<li/>\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert doctrine tags to hydrolysis tag format | function _tagsToHydroTags(tags) {
if (!tags)
return null;
return tags.map( function(tag) {
if (tag.title in CUSTOM_TAGS) {
return CUSTOM_TAGS[tag.title](tag);
}
else {
return {
tag: tag.title,
type: tag.type ? doctrine.type.stringify(tag.type) : null,
name: tag.n... | [
"_formatTag() {\n this.originalTag = this.originalTag.replace('\\n', ' ')\n let hedTagString = this.canonicalTag.trim()\n if (hedTagString.startsWith('\"')) {\n hedTagString = hedTagString.slice(1)\n }\n if (hedTagString.endsWith('\"')) {\n hedTagString = hedTagString.slice(0, -1)\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates a tour date in the "tours" db and references the venue associated with the date | function update(tour_date, venue_id, band_id, date_id) {
return db.one(`UPDATE tours SET tour_date=$1, venue_id=$2 WHERE band_id=$3 AND id=$4 RETURNING *`, [tour_date, venue_id, band_id, date_id]);
} | [
"function addVisitedRestaurant(name, date, cuisine, city) {\n // add to front of array so keep in date order\n // for (var i = 0; i < visitedRestaurants.length; i++) {\n // console.log(\"Before \" + i + \" \" + JSON.stringify(visitedRestaurants[i]));\n // }\n visitedRestaurants.unshift({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
in ES6 const loss = (pred, label) => pred.sub(label).square().mean(); | function loss(pred, label) {
return pred.sub(label).square().mean();
} | [
"function loss(predictions, ys) {\n return predictions.sub(ys).square().mean();\n}",
"function lossFunction(sets, overlaps) {\n\t var output = 0;\n\n\t function getCircles(indices) {\n\t return indices.map(function (i) {\n\t return sets[i];\n\t });\n\t }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reveal the song panel. | static revealSongPanel() {
let self = Settings.current;
if (!self.songMenuLocked) {
document.getElementById("songmenusidebar").toggleAttribute("open", true);
var _a = function () {
if (!self.songMenuLocked) {
document.getElementById("songmenusi... | [
"function SlideshowToggle(){\r\n if( G.VOM.playSlideshow ) {\r\n window.clearTimeout(G.VOM.playSlideshowTimerID);\r\n G.VOM.playSlideshow=false;\r\n G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPlay);\r\n }\r\n else {\r\n G.VOM.playSlideshow=true;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: mapLocation() This function was taken directly from the Google Maps API sample and adapted to insert a marker on the map for the specified entity and then store the marker instance within the entity (Team, Event, or other) for later control | function mapLocation(entity, frcInfo) {
var entityType = entity.getType();
var geo_location = frcInfo.geo_locations[entity.key];
var resultsMap = frcInfo.map;
resultsMap.setCenter(geo_location);
var icon = getMarkerIcon(entity, frcInfo);
var marker = new google.maps.Marker({
... | [
"function placeMarker(mapElement) {\n // check whether we've made the maker yet. If not, make it.\n var latLng = new google.maps.LatLng(mapElement.location.latitude, mapElement.location.longitude);\n if (!(latLng in latLngDict)) {\n var marker = new google.maps.Marker({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert a character: a . or 09 | function insertChar(charCode) {
var state = getState();
removeExtraStuff(state);
var myChar = String.fromCharCode(charCode);
if (state.selection.start !== state.selection.end) {
state.value = clearRange(state.value, state.selection.start, state.selection.end);
}
dotPos = state.value.indexO... | [
"function insert_a(text, script) {\r\n const a = (script == Script.CYRL) ? '\\u0430' : 'a'; // roman a or cyrl a\r\n text = text.replace(new RegExp(`([ක-ෆ])([^\\u0DCF-\\u0DDF\\u0DCA${a}])`, 'g'), `$1${a}$2`);\r\n text = text.replace(new RegExp(`([ක-ෆ])([^\\u0DCF-\\u0DDF\\u0DCA${a}])`, 'g'), `$1${a}$2`);\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for getV3ProjectsIdDeploymentsDeploymentId | getV3ProjectsIdDeploymentsDeploymentId(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKe... | [
"getV3ProjectsIdDeployments(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the metadata of a news | static updateMetadata(news) {
return RestService.put('api/news/update', news);
} | [
"static updateNews(id, news) {\n\t\treturn RestService.put('api/news/store', news);\n\t}",
"updatePersistedMetadata() {\n this.addon.sourceURI = this.sourceURI.spec;\n\n if (this.releaseNotesURI) {\n this.addon.releaseNotesURI = this.releaseNotesURI.spec;\n }\n\n if (this.installTelemetryInfo) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
De functie mouseDown geeft weer wat er moet gebeuren nadat je op de muis klikt. Eerst wordt de default verwijdert zodat je hier geen last van hebt in de browsers. Daarna wordt er gekeken of het event property gelijk is aan de rechter muisklik code. In het geval dit zo is wordt de image die meeggeven is verwijdert en ee... | function mouseDown(e, image) {
deleteDefault(e);
if (e.which === RIGHT_CLICK) {
var container = removeDivFromContainer(image);
setWidthDivs(container);
}
else if(e.which === LEFT_CLICK){
zoomIn(image);
}
} | [
"mDown(e){\n this.xMouseStart=e.offsetX;\n this.yMouseStart=e.offsetY;\n if(this.insideButton){\n Button.shape=this.name;\n }\n }",
"function showImage(event) {\n\tresetClassNames(); // Klasu \"selected\" treba da ima onaj link cija je slika trenutno prikazana u \"mainIm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the pallet for drawing, adds fill icon | function createPallet(){
for(let i = 0; i < numColor; i++){
swatches.push(new ColorSwatch( ((i*colorSwatchRadius)+colorSwatchRadius/2),
colorSwatchRadius/2,
colorSwatchRadius/2,
colorArray[i]));
}
fillIcon = new FillIcon(canvasWidth-frameThickness*.75, canvasW... | [
"function renderPallet(){\n\tfor(let i = 0; i < numColor; i++){\n\t\tswatches[i].display();\n\t}\n\tfillIcon.display();\n}",
"drawIcon() {\n return `<i class=\"fab fa-sketch\"></i>`\n }",
"function createToolIcon(toolImage,pinToDiv,toolKey){\n button = document.createElement(\"button\");\n button.cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate window position and scroll tracking variables | function calcScrollValues() {
windowHeight = $(window).height();
windowScrollPosTop = $(window).scrollTop();
windowScrollPosBottom = windowHeight + windowScrollPosTop;
} // end calcScrollValues | [
"function icinga_get_scroll_position() {\n\n\tvar scroll_pos;\n\n\t//most browsers\n\tif (typeof window.pageYOffset != 'undefined') {\n\t\tscroll_pos = window.pageYOffset;\n\t}\n\t//IE6\n\telse if (typeof document.documentElement.scrollTop != 'undefined') {\n\t\tscroll_pos = document.documentElement.scrollTop;\n\t}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for mouse over a tiddler | function onMouseOverTiddler(e)
{
var tiddler;
if(this.id.substr(0,7) == "tiddler")
tiddler = this.id.substr(7);
if(tiddler)
selectTiddler(tiddler);
} | [
"function onMouseOutTiddler(e)\n{\n\tvar tiddler;\n\tif(this.id.substr(0,7) == \"tiddler\")\n\t\ttiddler = this.id.substr(7);\n\tif(tiddler)\n\t\tdeselectTiddler(tiddler);\n}",
"function HotArea1::OnMouseOver(){ hEvent_HotArea_MouseOver( HotArea1 ); }",
"function mouseoverhandler(event) {\n mouseIn = event.t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mutations Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array. For example, ["hello", "Hello"], should return true because all of the letters in the second string are present in the first, ignoring case. The arguments ["hello", "hey"] ... | function mutation(arr) {
var first = arr[0].toLowerCase();
var second = arr[1].toLowerCase();
for(var i = 0; i < second.length; i++){
if(first.indexOf(second.charAt(i)) == -1){
return false;
}
}
return true;
} | [
"function mutation([first, second]) {\n return second.toLowerCase()\n .split('')\n .every(letter => first.toLowerCase()\n .indexOf(letter) !== -1)\n}",
"function arraySubstring(words, str) {\n const result = [];\n for( let i = 0; i < words.length; i++) {\n if (words[i].inc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function that creates a sorted list of employee pks | function _createEmployeeSortedIdList(employees) {
employeeSortedIdList = employees.map(function(e) { return e.id; })
} | [
"function generateEmployeesByPage(employees, pageNo) {\n // I assumed showing 10 employees per page\n const perPage = 10;\n if (employees.length) {\n // Filter 10 employees by page number\n return employees.filter((employee, i) => {\n return i >= perPage*(pageNo-1) && i < perPage*p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter of the friends attribute. | get friends() {
this._logService.debug("gsDiggEvent.friends[get]");
return this._friends;
} | [
"function getDirectFriendsArray() {\n var selectedPersonId = getPersonIndex();\n\n friends = data[selectedPersonId - 1].friends;\n\n return friends;\n }",
"function getFriends(callback) {\n Friendship.scan().loadAll().exec((err, data) => {\n if (err) {\n callback(null, err.message... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a UUID for a new Collection row's index | function getNewCollectionIndex() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
return uuid;
} | [
"static generateId() {\n return cuid_1.default();\n }",
"function uuid() {\n // get sixteen unsigned 8 bit random values\n const u = crypto.getRandomValues(new Uint8Array(16))\n\n // set the version bit to v4\n u[6] = (u[6] & 0x0f) | 0x40\n\n // set the variant bit to \"don't care\" (yes, the RFC\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the saved diagram referenced in the URL hash. | function loadSavedDiagram() {
if (!window.location.hash || window.location.hash.length <= 2) {
showModalDialog('Missing saved diagram details',
false, undefined,
'OK', Data.IsComparing ? undefined : backOrHome);
return false;
}
// Trim '#*' and '/compare'
if (Data.IsComparing) {
Data.F... | [
"function getDiagram() {\n\n $.ajax({\n type: 'post',\n url: urlDiagram,\n data: {\n 'getDiagram': 'true'\n },\n success: function (xml) {\n openDiagram(xml)\n }\n });\n}",
"function load() {\n var $b = $('.background-edit');\n pW = $b.width(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parasitic Combination Inheritance constructor stealing to inherit properties hybrid prototype chaining to copy superType prototype and assign to subType prototype to allow inheritance of prototype methods and properties | function inheritPrototype(subType, superType) {
var prototype = object(superType.prototype); //this is a function defined eariler in this document
//or use the following:
//var prototype = Object.create(superType.prototype); //ECMAScript 5
prototype.constructor = subType;
subType.prototype = prototype;
} | [
"function inheritFrom(parentConstructor, prototypeProps, constructorProps) {\n // Get or create a child constructor\n var childConstructor\n if (prototypeProps && object.hasOwn(prototypeProps, 'constructor')) {\n childConstructor = prototypeProps.constructor\n }\n else {\n childConstructor = function() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To submit Order when Payment Type changed Control goes to SubmitOrderPayTypeChanged() method in Default page | function SubmitOrderPayTypeChanged(paymentModeId, opdid) {
//var orderId = $jQuery("[id$=txtOrderId]").val();
var orderId = $jQuery("[id$=hdnOrderID]").val();
var selectedPaymentModeId = paymentModeId; // TO DO INTERGATION
var ordPaymentDetailId = opdid; // TO DO INTERGATION
var url = window.locati... | [
"function SubmitRushOrder() {\n var orderId = $jQuery(\"[id$=lblOrderNumber]\").text();\n var deptPrgPackageSubscriptionId = $jQuery(\"[id$=hdnDeptPrgPackageSubscriptionId]\").val();\n var selectedPaymentModeId = $find($jQuery(\"[id$=cmbPaymentOptions]\")[0].id).get_value();\n var isBillingInfoSameAsAcc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Help function to set the background color based on Element's name in a document object | function setBGColorByElementsName(docObj, tagName, bgColor) {
if (bgColor == "") {
bgColor = "TRANSPARENT";
}
if (docObj.getElementsByName) {
var objs2Hilite = docObj.getElementsByName(tagName);
for (var objIndex = 0; objIndex < objs2Hilite.length; ++objIndex) {
if (objs2Hilite[objIndex... | [
"function setNormalColor(oElement)\n{\n oElement.style.background = BG_DEF_CLR;\n oElement.style.color = FG_DEF_CLR;\n}",
"function setBGColorByHash(docObj, bgColor) { \n if (docObj.location) {\n var tagName = docObj.location.hash;\n // Use the stored hash value if it exists because the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add callback that adds categories CSS classes | function addCategoryClass (postClass, post) {
var classArray = _.map(Posts.getCategories(post), function (category){return "category-"+category.slug;});
return postClass + " " + classArray.join(' ');
} | [
"function setCategoryActive(cat) {\n\t$(\".nav-category\").each(function(i, obj) {\n\t\tif(cat.toLowerCase() === $(obj).text().toLowerCase()) {\n\t\t\t$(obj).parent().addClass('active');\n\t\t} else {\n\t\t\t$(obj).parent().removeClass('active');\n\t\t}\n\t});\n}",
"addClass (className, addClass, callbacks) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and returns an Object Object with the same keys as the MongoLog Object except with the db removed | getObj() {
const obj = {};
Object.keys(this).forEach(key => {
if (key === 'db') return;
obj[key] = this[key];
})
return obj;
} | [
"constructor(db, log, level) {\n\n if (typeof log === 'object') {\n Object.keys(log).forEach(key => {\n if (key === 'db' || key === 'level') {\n throw new TypeError(`Invalid key: ${key}`);\n }\n this[key] = log[key];\n })\n } else {\n this.message = log;\n }\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the unit classes for this HED tag. | get unitClasses() {
return this._memoize('unitClasses', () => {
if (this.hasUnitClass) {
return this.takesValueTag.unitClasses
} else {
return []
}
})
} | [
"get hasUnitClass() {\n return this._memoize('hasUnitClass', () => {\n if (!this.schema.entries.definitions.has('unitClasses')) {\n return false\n }\n if (this.takesValueTag === null) {\n return false\n }\n return this.takesValueTag.hasUnitClasses\n })\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that creates dt array from data | createDtArray() {
this.dtArray = this.priceArray.map(function(d){return d.Date;});
} | [
"function parseAllDayData(raw_data) {\n\n var table_data = [],\n date, avrg, min, max, billing_95th;\n\n for(var i = 0; i < raw_data.length; i++) {\n date = raw_data[i]['date_type'];\n avrg = transSpeed(raw_data[i]['ifIn_avrg']) + ' / ' + transSpeed(raw_data[i]['ifOut_avrg']);\n mi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transforms deprecated vue slot syntax (slot="test") into the updated Vue slot shorthand syntax (test). | function transformOldSlotSyntax(node) {
if (!node.children) {
return;
}
node.children.forEach((child) => {
if (_.has(child.attribs, 'slot')) {
const vslotShorthandName = `#${child.attribs.slot}`;
child.attribs[vslotShorthandName] = '';
delete child.attribs.slot;
}
});
} | [
"slot$(name,ctx){\n\t\tvar slots_;\n\t\tif (name == '__' && !this.render) {\n\t\t\treturn this;\n\t\t}\t\t\n\t\treturn (slots_ = this.__slots)[name] || (slots_[name] = imba$1.createLiveFragment(0,null,this));\n\t}",
"function shiftSlotNodeDeeper(node) {\n if (!node.children) {\n return;\n }\n\n node.childre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default Disconnected Callback just calls removeBindings(); | disconnectedCallback() {
this.removeBindings();
} | [
"disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('incoming-custom-event', this.handleIncoming)\n }",
"connectedCallback() {\n this.applyBindings();\n }",
"onChromeVoxDisconnect_() {\n this.port_ = null;\n this.log_('onChromeVoxDisconnect', chrome.ru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does any extra processing that is required when handling the hints. | _processHints() {
this._validateHints();
this._syncDescribedByIds();
} | [
"setHints(hints){this.hints=hints;this.reader.setHints(this.hints);}",
"function useHint() {\n currHint = wordObj.hints.pop();\n hint--;\n }",
"_setLatencyHint(hint) {\n let lookAheadValue = 0;\n this._latencyHint = hint;\n\n if ((0, _TypeCheck.isString)(hint)) {\n switch (hint) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
append a story to the sidebar OR update one that's already there | function appendStory(story){
var id = 'list-'+story.ticket_no;
var li = document.getElementById(id);
var $spSpan; //will be the jquery element for the story point span, created now or fetched
if (li == undefined){
//contain the text we click
var textDiv = document.createElement('div');
textDiv.className = "t... | [
"function generateNewStory(newStory) {\n var ownStoryStatus = \"\";\n if(LOGGED_IN){\n ownStoryStatus = checkOwnStory(newStory);\n }\n const result = generateStoryHTML(newStory, ownStoryStatus);\n\n $allStoriesList.append(result);\n }",
"function updateSidebar() {\n var currentScrollY = do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
International Instruments Section Expand all international instrument tables. | function expandAllIntl() {
$(".intltablebody").show();
} | [
"function intlInstruAddRow() {\n var tables = document.getElementsByClassName(\"interinstruments\");\n var noOfTables = tables.length;\n var arrayIndex = noOfTables;\n var indexOfLastTable = arrayIndex - 1;\n var idOfLastTable = \"intltable\" + indexOfLastTable;\n var row = \"\";\n\n // If ther... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calls to newsAPI for top articles related to the search | function newsRequest(tickerSearch) {
var apiKey = "44ec6ee2a9c74c3dbe590b43546a857c";
var queryURL = "https://newsapi.org/v2/everything?q=" + tickerSearch + "&apiKey=" + apiKey;
$.ajax({
url: queryURL,
method: "GET"
}).then(function (response) {
var articlesArray = [];
... | [
"function getNews(crypto_currency, no_articles, callback) {\n var options = { method: 'GET',\n url: 'https://api.cognitive.microsoft.com/bing/v5.0/news/search',\n qs: { q: crypto_currency },\n headers: { 'ocp-apim-subscription-key': '86984344e78141338f75c3af1d558485' }};\n\n request(options, function (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to add new peer details to the UI when connected | function addNewPeer (connectedPeer) {
$('#VisHive-connected-Peers').append('<div id="VisHive-connected-Peers-' + connectedPeer + '">' + connectedPeer + '</div>');
} | [
"addPeer() {\n\t}",
"addPeer(peer) {\n\t\t// Create or update the node\n\t\tthis.peers.set(peer.id, peer);\n\n\t\tif(! peer[hasSeen]) {\n\t\t\t// Handle node updates for this peer\n\t\t\tpeer.on('nodes', data => this.handleNodes(peer, data));\n\n\t\t\t// Handle messages via the peer, either reroute them or emit t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the given document (or all, if not specified) from the query engine cache, such that fresh results are obtained the next time. | async clearCache(document) {
await this._engine.invalidateHttpCache(document);
} | [
"static async deleteOne(doc) {\n try {\n const modelName = this.name.toLowerCase();\n return db\n .collection(modelName)\n .doc(doc[\".key\"])\n .remove();\n } catch (error) {\n console.log(\"Error occured while performing operation\", error);\n }\n }",
"removeEntry(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The SVG transform origin defaults are different to CSS and is less intuitive, so we use the measured dimensions of the SVG to reconcile these. | function calcSVGTransformOrigin(dimensions, originX, originY) {
var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
return pxOriginX + " " + pxOriginY;
} | [
"function resizeSvg() {\n let scale = 1;\n\n switch (Settings.Zoom) {\n case 'Fit':\n scale = Math.min(\n window.innerWidth / Data.Svg.NativeWidth,\n window.innerHeight / Data.Svg.NativeHeight);\n break;\n\n case 'Fit Width':\n scale = window.innerWidth / Data.Svg.NativeWidth;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a request to the blockchain to create a new project | async function createProject(name, goalInETH, durationInHours) {
// Transforming the parameters to the "contract-friendly" format
const goalInWei = goalInETH * ethWei;
const durationInSeconds = durationInHours * 3600;
// Asking the user to confirm his donation.
if (!confirm(`Opravdu chcete založit projekt jm... | [
"function create_new_project() {\n\tvar project_node = generate_empty_project();\n\n\t// And finally append the project to the actual page\n\tvar project_node_jquery = $(project_node);\n\tproject_node_jquery.insertBefore( $(\"div#new-project\") );\n\n\t// Give focus to the Heading input\n\tproject_node_jquery.find(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current session's datastore ID | function getSessionDatastoreID() {
var sessionToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
if (!sessionToken) {
sessionToken = getSessionToken();
}
var session = jsontokens.decodeToken(sessionToken).payload;
return session.app_user_id;
} | [
"function getSessionDeviceID() {\n var sessionToken = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n\n if (!sessionToken) {\n sessionToken = getSessionToken();\n }\n\n var session = jsontokens.decodeToken(sessionToken).payload;\n return session.device_id;\n}",
"static... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
baynote_getCommentedValue(name, node) Recursively spelunk the DOM to find a comment that holds the name:value and return value. Parameters name:The name of the comment node:the DOM node to search level:The depth of the search Return String that is the value paired with name or the empty string if it is not found. | function baynote_getCommentedValue(name, node) {
// If we are called without a starting point return the empty string
if (!node) {return "";}
var nodeName = node.nodeName;
// Look for this to be a comment
if (nodeName && (nodeName == "#comment")) {
var nodeValue = node.nodeValue;
if (nodeValue) {
// Check ... | [
"function baynote_getCommentTagValue(tagId) {\n\tvar tagBn = document.getElementById(tagId);\n\tif (!tagBn) {return \"\";}\n\t\n\tvar value = tagBn.attributes.getNamedItem(\"value\").value;\n\treturn value;\n}",
"function getParsedComment(node, sourceFile) {\n var rawComment = getRawComment(node, sourceFile);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: handle the button: add to portfolio for company at the right | function onClickPortfolio2(){
if(compnameComparison[1] === undefined){
notification['warning']({
message: 'Function Error',
description:
'There is no company selected.',
});
}else{
notification['success']({
message: 'Operation Success',
description:
`$... | [
"function onClickPortfolio1(){\n if(compnameComparison[0] === undefined){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operation Success',\n descript... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a zip file from a directory and stream it to a client | function streamArchive(req, res, zipPath) {
var archive;
fs.stat(zipPath, function (err, stats) {
if (err) {
log.error(err);
} else if (stats.isDirectory()) {
res.statusCode = 200;
res.setHeader("Content-Type", mime.lookup("zip"));
res.setHeader("C... | [
"function toZip( location ){\n\t\n\tvar myWorker;\n\t\n\tif( os.isWindows ){\n\t\t\t\t/* Windows platform */\n\t\t\t\t\n\t\tvar zipItLoaction = studio.extension.getFolder().path + \"resources/zipit\";\n\t\tzipItLoaction = zipItLoaction.replace( /\\//g, \"\\\\\" );\n\t\tlocation = location.replace( /\\//g, \"\\\\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserparameterModifier. | enterParameterModifier(ctx) {
} | [
"enterTypeParameterModifier(ctx) {\n\t}",
"visitCompiler_parameters_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitParameter_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitTypedargslist(ctx) {\r\n console.log(\"visitTypedargslist\");\r\n // TODO: support *args, **... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Created searchMeal func to create cards for initializing or searching | searchMeal() {
// Using fuse.js and defining searching key
const options = {
includeScore: true,
keys: ['fields.strMeal']
}
const fuse = new Fuse(this.foodsArray, options)
// Called createCards func for first initializing
this.createCards(this.food... | [
"searchedCards(result) {\n let cardListDOM = document.querySelector(\".card-list\")\n // Cleaning cardList's innerHTML for every calling\n cardListDOM.innerHTML = \"\"\n // Creating cards for searched meals\n result.forEach((food) => {cardListDOM.innerHTML += `\n <div i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reduce function func(accumulator, currentValue,currentIndex,sourceArray) | function func(accumulator, currentValue, currentIndex, sourceArray) {
return accumulator + currentValue;
} | [
"static reduce(array, reducer, initialValue) {\n\t\tif (typeof reducer !== 'function') {\n\t\t\tthrow new Error('Second arg must be a reducer function')\n\t\t}\n\n\t\tconst numItems = array.length\n\n\t\treturn new P((resolve, reject) => {\n\t\t\tfunction processItem({ accum, index }) {\n\t\t\t\tconst item = array[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Need to add mechanism for recovering from false input. Some cases to consider: Mismatched parenthesis Domain of factorial function multiple occurances of addops or multops (, ++, /, etc.) / CREATED: Henry Karagory 03/12/2018 Description: Parsing function corresponding to the expr nonterminal symbol. parameters: t... | function calculateExpression(tokenQueue, trigMode="rad"){
var exprValue = calculateExpressionRecursive(tokenQueue, trigMode);
if(tokenQueue.length != 0){
return "ERR: SYNTAX";
}
return exprValue;
} | [
"function calculateExpressionRecursive(tokenQueue, trigMode){\n var exprValue = calculateTerm(tokenQueue, trigMode);\n\n // If a string is returned then it is an error message, return the message.\n if(typeof exprValue == \"string\"){\n return exprValue;\n }\n\n while(tokenQueue[0] == \"+\" ||... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads all the trips belonging to a particular user, and returns them in an array would be more efficient to write them into a provided stream but I'm not sure if that will be compatible with the eventual DB backed storage so I am doing it the simple way. if the user has no trips file yet, returns an empty array | async function readTrips(user) {
console.log(`reading trips for ${user}`);
let filePath = getTripsFilePath(user);
let trips = await readTripsOrExpenditures(filePath);
return trips;
} | [
"static async getUserTrips(username) {\n\n /** Gets user's trips */\n const tripResult = await db.query(\n `SELECT user_trips.trip_id AS \"tripId\",\n trip_name AS \"tripName\",\n distance,\n trip_rating AS \"tripRating\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================================== Style code blocks with highlight and numbered lines ========================================================================== | function codestyling() {
$('pre code').each(function(i, e) {
hljs.highlightBlock(e);
var code = $(this);
var lines = code.html().split(/\n/).length;
var numbers = [];
for (i = 1; i < lines; i++) {
numbers += '<span class="line">' + i + '</span>';
}
code.parent().append('<div class="lines">' +... | [
"setComponentClasses() {\n this._codeblockRender.setAttribute(\"class\", this.codePrismLanguage());\n this._codeblockRenderOuterPreTag.setAttribute(\"class\", this.appliedCssClasss());\n if (this.codeLineNumberStart !== 1) {\n this._codeblockRenderOuterPreTag.style.counterReset = \"linenumber \" + (th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reduce the expert info into projectSpecificExperts before patch/update Remove all attributes of experts list except expertId Attribute to be moved: statusInProject experience addedBy notes history country partnerRef Reduce the consultation info into just ids before patch/update | function reduceData () {
// reduce expert info
var reduceExperts = [];
for (var i = 0; i < $scope.project.experts.length; i++) {
var id = $scope.project.experts[i].objectId;
reduceExperts.push(id);
var index = mapExperts(id);
if( index > -1) {
if($scope.projec... | [
"updateProjectiles() {\r\n //remvoe projectiles\r\n for (let [index, projectile] of this.projectileList.entries()) {\r\n if (projectile.toDelete) this.projectileList.splice(index, 1);\r\n }\r\n\r\n //update projectiles\r\n for (let projectile of this.projectileList) {\r\n projectile.update(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read Typed data from the buffer | function decodeTyped(){
let res;
let type = readByte();
switch(type){ // Read Type
case 0:
res = readInt16();
break;
case 1:
res = readAscii();
break;
case 2:
res = readByte();
break;
case 3:
... | [
"async readGPUBufferRangeTyped(src, { srcByteOffset = 0, method = 'copy', type, typedLength }) {\n assert(\n srcByteOffset % type.BYTES_PER_ELEMENT === 0,\n 'srcByteOffset must be a multiple of BYTES_PER_ELEMENT'\n );\n\n const byteLength = typedLength * type.BYTES_PER_ELEMENT;\n let mappable;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the number of toppings selected at point of order submission | function getNumberOfToppingsSelected() {
var selections = document.getElementsByClassName("form-check-input")
var count = 0;
for (var i = 0; i < selections.length; i++) {
if (selections[i].type === "checkbox" && selections[i].checked === true) {
count++;
}
}
return count;
} | [
"function toppingsValidator() {\n resetError();\n document.getElementById('submitOrderButton').disabled = false;\n var toppingsSelector = document.getElementsByClassName('form-check-input');\n var numberOfToppings = 0;\n var allowedToppings = itemData[0].fields.numberOfToppings;\n for (var i = 0; i < toppings... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Any command that implemented registryrelated feature should support `r` / `registry` option | async getRegistry (scope) {
const cacheKey = scope || ''
if (this._registries[cacheKey]) {
return this._registries[cacheKey]
}
const args = minimist(process.argv, {
alias: {
r: 'registry'
}
})
let registry
if (args.registry) {
registry = args.registry
} ... | [
"registerCommand() {\n this._commander\n .command(this.command)\n .description(this.description)\n .action((args, options) => this.action(args, options));\n }",
"function registerCommands() {\r\n return [\r\n vscode_1.commands.registerCommand('rls.update', () => { var _a; return (_a =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
determine if session should be touched | function shouldTouch(req) {
// cannot set cookie without a session ID
if (typeof req.sessionID !== 'string') {
debug('session ignored because of bogus req.sessionID %o', req.sessionID);
return false;
}
return cookieId === req.sessionID && !shouldSave(req);
} | [
"function shouldSave(req) {\r\n\t\t\t// cannot set cookie without a session ID\r\n\t\t\tif (typeof req.sessionID !== 'string') {\r\n\t\t\t\tdebug(\r\n\t\t\t\t\t'session ignored because of bogus req.sessionID %o',\r\n\t\t\t\t\treq.sessionID\r\n\t\t\t\t);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn !saveU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================================================== File Tree Collapse/Expand All | function fileTree() {
var ft_expand = $('.file-tree .ft-expand-all'),
ft_collapse = $('.file-tree .ft-collapse-all'),
content = $('#content');
ft_expand.on('click', function(e) {
$('.file-tree .collapse').collapse('show');
$('.file-tree .collapsed').removeClass('collapsed');
});
ft_collapse.on('click',... | [
"function tree_collapse() {\n let $allPanels = $('.nested').hide();\n let $elements = $('.treeview-animated-element');\n\n $('.closed').click(function () {\n \n $this = $(this);\n $target = $this.siblings('.nested');\n $pointer = $this.children('.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Angular 2 and other Vendor imports | function vendors() {
return [
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/compiler',
'@angular/router',
'@angular/forms',
'@angular/common',
'@angular/core',
'@angular/http',
];
} | [
"function vendor() {\n return merge(vendors.map(function (vendor) {\n return src('node_modules/' + vendor + '/**/*')\n .pipe(dest('assets/vendor/' + vendor));\n // .pipe(dest('assets/vendor/' + vendor.replace(/\\/.*/, '')));\n }));\n}",
"injectDependencies() {\n this.injectHtmlTemplate();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is only used for reactnative. reactnative freezes object that have already been sent over the js bridge. We need this function in order to check if the object is frozen. So it's ok that objectFrozen returns false if Object.isFrozen is not supported because it's not relevant for other "platforms". See rela... | function objectFrozen(obj) {
if (!Object.isFrozen) {
return false;
}
return Object.isFrozen(obj);
} | [
"function deepFreeze(object) {\n Object.keys(object).forEach(function freezeNestedObjects(name){\n const value = object[name];\n if(typeof value === \"object\") {\n deepFreeze(value);\n }\n });\n return Object.freeze(object);\n}",
"freeze() {}",
"function toggleFreeze() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a Promise that will solve to the configured release. If no release is specified, it uses Sentry CLI to propose a version. The release string is always trimmed. Returns undefined if proposeVersion failed. | getReleasePromise() {
return (this.options.release
? Promise.resolve(this.options.release)
: this.cli.releases.proposeVersion()
)
.then(version => `${version}`.trim())
.catch(() => undefined);
} | [
"getStringifiedRelease(version) {\n const release = this.getRelease(version);\n if (!release) {\n throw new Error(`Specified release version does not exist: '${version}'`);\n }\n const releaseChanges = this.getReleaseChanges(version);\n return stringifyRelease(version, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the path to the iOS default keychain | function getDefaultKeychainPath() {
return __awaiter(this, void 0, void 0, function* () {
let defaultKeychainPath;
let getKeychainCmd = tl.tool(tl.which('security', true));
getKeychainCmd.arg('default-keychain');
getKeychainCmd.on('stdout', function (data) {
if (data) {
... | [
"function makeKVSpath() {\n\tvar temp = helper.makeEnrollmentOptions(0);\n\treturn path.join(os.homedir(), '.hfc-key-store/', temp.uuid);\n}",
"function KeychainAccess() {\n\n}",
"static get defaultLocation() {\n return Toxen.updatePlatform == \"win\" ? process.env.APPDATA + \"\\\\ToxenData\\\\data\\\\se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Zip the entire song folder and save it as a `txs`. if `location` is defined, no prompt for selecting location will appear, and will just export to the set location | export(location = null) {
let txs = this.createTxs();
let ans = typeof location === "string" ? location : dialog.showSaveDialogSync(browserWindow, {
"title": "Save Toxen Song File",
"buttonLabel": "Save Song",
"defaultPath": this.path + ".txs"
});
if (... | [
"static exportAllSongs(location = null, songList = null) {\n return __awaiter(this, void 0, void 0, function* () {\n let songs = Array.isArray(songList) ? songList : SongManager.songList;\n let ans = typeof location === \"string\" ? location : dialog.showSaveDialogSync(browserWindow, {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to hide answer alert box | function hideAnswerAlertBox()
{
$("#answerAlert").hide();
} | [
"function hideQuestions() {\n $(\"#question\").hide();\n $(\"#answers\").hide();\n $(\"#timer\").hide();\n $(\"#playAgain\").hide();\n }",
"function dismissPrompt() {\n $('#powerPrompt').hide();\n $('#faded').hide();\n}",
"function confirmHide() {\n document.getElementByI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find courses that are not available on a particular college | static async allRemainingCourses(collegeCode){
const result=await pool.query('SELECT course.coursecode,coursename,coursetag,coursedescription FROM course WHERE course.coursecode NOT IN (SELECT coursecode FROM has WHERE collegecode=?);',collegeCode);
return result;
} | [
"static async findAvailableCourses(collegeCode){\n const result=await pool.query('SELECT course.coursecode,coursename,coursetag,coursedescription,has.available FROM has,course WHERE has.collegecode=? AND has.coursecode=course.coursecode',collegeCode);\n return result;\n }",
"function filterOUs(co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if an event should be shown. | function shouldShowEvent(event) {
// Hack to remove canceled Office 365 events.
if (event.title.startsWith("Canceled:")) {
return false
}
// If it's an all-day event, only show if the setting is active.
if (event.isAllDay) {
return showAllDay
}
// Otherwise, return the event if it's in the futu... | [
"isElementShowing(e) {\n return this.props.time >= e.start_time &&\n this.props.time <= e.end_time;\n }",
"function isVisible(e) {\n\tif (e == null) return false;\n\tif (e == undefined) return false;\n\treturn !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate a PARRY command | function validateParry (data, command) {
// no additional validation necessary
return true;
} | [
"function validateRun (data, command) {\n // no additional validation necessary\n return true;\n }",
"_validateAndParseCommandArguments() {\n const validationErrors = this._validateCommandArguments();\n\n if (validationErrors.length > 0) {\n _forEach(validationErrors, (error) => {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drop the pin to the location that is centred in the screen. | function pinDrop()
{
currentRoute.routeMarker.setPosition(currentRoute.map.getCenter());
} | [
"function South() {\n props.setMoveLocation(true);\n props.setLocation((latMove -= 0.002), longMove);\n }",
"positionDrop() {\n const drop = this.drop;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n let dropWidth = drop.drop.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map color to building program | function mapcolor(c) {
if (c === '#eb565c') {
return 'retail';
}
else if (c === '#e7cd77') {
return 'residential';
}
else if (c === '#98eaa6') {
return 'office';
}
else if (c === 'black') {
return 'void';
}
} | [
"function setupColorMap() {\n var c3=colorbrewer.Dark2[8];\n var c1=colorbrewer.Set1[8];\n var c2=colorbrewer.Paired[8];\n colorMap.push('#1347AE'); // the default blue\n for( var i=0; i<8; i++) {\n colorMap.push(c1[i]);\n }\n for( var i=0; i<8; i++) {\n colorMap.push(c2[i]);\n }\n for( var i=0; i<8;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a LookupTable (present in of GPOS, GSUB, GDEF, BASE, JSTF tables). | function parseLookupTable(data, start) {
var p = new parse.Parser(data, start);
var table, lookupType, lookupFlag, useMarkFilteringSet, subTableCount, subTableOffsets, subtables, i;
lookupType = p.parseUShort();
lookupFlag = p.parseUShort();
useMarkFilteringSet = lookupFlag & 0x10;
subTableCount... | [
"function parseLookup(lookup) {\n //var debug = console.warn;\n var debug = function() {};\n \n var bits = [];\n debug(\"\\n*** \"+lookup+\" ***\")\n\n bits = [];\n var bit = \"\";\n var states = [null];\n var escaped = false;\n var ch = null;\n for (var i=0; i < lookup.length; ++i) {\n var escaped = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end function ===============End footnote placer========================= /Developer: Augustine. K Date: 02Jun2017 Functionality: This will write a txt file with statement passsed as parameter as file name in the log folder | function writeTxtFile(logStmt){
var statusLogFilePath = layerTemplateScript.replace(/scripts/, 'log') + "\\" + scriptName + "." + logStmt;
var statusLogFile = new File(statusLogFilePath);
statusLogFile.encoding = "UTF-8";
statusLogFile.open("w");
statusLogFile.close();
} | [
"function logFileOutput(dataToLog) {\n\n file.appendFile(\"./log.txt\", dataToLog, function (err) {\n\n if (err) {\n console.log(err);\n }\n\n });\n\n}",
"function FileWriter() {\n}",
"function logtxt(data) {\n fs.appendFile(\"log.txt\", data, function(error) {\n if (error) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extent, k is the least number of points in one line you want to see on the main chart view | function setZoomExtent(k) {
var numOfPoints = currSeries[0].data.length;
//choose the max among all the series
for (var i = 1; i < currSeries.length; i++) {
if (numOfPoints < currSeries[i].data.length) {
numOfPoints = currSeries... | [
"function createChartConfigOfEChartsMap() {\n\n\treturn {\n\n\t\tname: 'echart-line',\n\n\t\trenderer: 'ECharts',\n\n\t\toption: {\n\n\t\t\t// title: {\n\t\t\t// \t//text: '折线图',\n\t\t\t// \tleft: 'center',\n\t\t\t// },\n\t\t\tlegend: {\n\t\t\t\tshow: true,\n\t\t\t\tselectedMode: 'single',\n\t\t\t\t//right: 5,\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a deep copy of this circle | getCopy() {
var copyCenter = copyPoints([this.center])[0];
return new Circle(copyCenter, this.radius);
} | [
"clone() {\n return new Point(this.data);\n }",
"copy ()\n {\n return new Rectangle(this.position.copy(), this.width, this.height);\n }",
"copy() {\n return new Vector(this.x, this.y);\n }",
"copy() {\n return new Cell(this.x, this.y);\n }",
"clone () {\n\n var newBoa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add transforms to and from EPSG:4326 and EPSG:3857. This function is called by when this module is executed and should only need to be called again after `clearAllProjections()` is called (e.g. in tests). | function addCommon() {
// Add transformations that don't alter coordinates to convert within set of
// projections with equal meaning.
addEquivalentProjections(_proj_epsg3857_js__WEBPACK_IMPORTED_MODULE_8__.PROJECTIONS);
addEquivalentProjections(_proj_epsg4326_js__WEBPACK_IMPORTED_MODULE_9__.PROJECTIONS... | [
"toDefaultProjection(lat, long) {\n return ol.proj.transform([long, lat], 'EPSG:4326', 'EPSG:3857');\n }",
"addTransform(transform, selection, ids) {\n for (let i = 0; i < transform.steps.length; i++) {\n let step = transform.steps[i].invert(transform.docs[i])\n this.items.push(new StepItem(trans... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to check if a move exists | function MoveExists(move) {
GenerateMoves();
var index;
var moveFound = NOMOVE;
// For loop to loop thorugh each move in the move list
for(index = Board.moveListStart[Board.ply]; index < Board.moveListStart[Board.ply + 1]; ++index) {
moveFound = Board.moveList[index];
// Check if the move is legal i... | [
"function isValidMoveName(id) {\n if (typeof id === 'undefined' || id == null) {\n return false;\n };\n if (typeof MOVE_DATA[id.toLowerCase()] === 'undefined') {\n return false;\n } else {\n return true;\n };\n}",
"hasReachedDestination() {\r\n\t\tvar destinationTiles = this.levelGrid.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a token of the organization This API allows to delete a token of the organization. organizationId String The organizationid represents an organization that is included in the SigninToday application, also know as slug and it is used as a path parameter to restrict the asked functionality to the specified organiz... | static delete_token({ organizationId, tokenId }) {
return new Promise(
async (resolve) => {
try {
resolve(Service.successResponse(''));
} catch (e) {
resolve(Service.rejectResponse(
e.message || 'Invalid input',
e.status || 405,
));
... | [
"function delete_token(token) {\n // Remove the id from the saved list\n var token_data = $.data(token.get(0), \"tokeninput\");\n var callback = settings.onDelete;\n\n var index = token.prevAll().length;\n if (index > selected_token_index) index--;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
protection middleware. If the user isn't logged in, redirect. If the user IS logged in proceed tot the next route/middleware | function protect(req,res, next) {
if(req.session.currentUser) next();
else res.redirect("/user/login");
} | [
"function prevent(req, res, next) {\n if(!req.isAuthenticated()){\n return next();\n }\n console.log(\"Athenticated user\");\n res.redirect(\"/userDashboard\");\n}",
"requireAuth(req, res, next) {\n if (!req.session.userId) {\n return res.redirect('/signin');\n }\n next();\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the name of the content from Netflix page. | function getContentName() {
var name = $('#netflix-player .playback-longpause-container .content h2').text();
return name;
} | [
"extractTitle() {\r\n return this._page.getElementById(\"firstHeading\").innerHTML;\r\n }",
"parseName() {\n return ionMarkDown_1.Imd.MarkDownToHTML(this.details.artist) + \" - \" + ionMarkDown_1.Imd.MarkDownToHTML(this.details.title);\n }",
"async getTitle() {\n const titleEl = await... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When mobile changes, adjust the active state only when there has been a previous value | isMobile(val, prev) {
!val && this.isActive && !this.temporary && this.removeOverlay();
if (prev == null || !this.reactsToResize || !this.reactsToMobile) return;
this.isActive = !val;
} | [
"if (nextProps.appFocusedCount !== this.state.appFocusedCount) {\n this.setState({\n appFocusedCount: nextProps.appFocusedCount,\n })\n this.props.getFuseStatus()\n }",
"function setPrevItemActive() {\n var items = getItems();\n\n var activeItem = document.getElementsByClassName(\"activ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs an XrpOfferCreate from an OfferCreate protocol buffer. | static from(offerCreate) {
var _a, _b, _c, _d;
// takerGets and takerPays are required fields
const takerGetsCurrencyAmount = (_a = offerCreate.getTakerGets()) === null || _a === void 0 ? void 0 : _a.getValue();
if (!takerGetsCurrencyAmount) {
throw new __1.XrpError(__1.XrpEr... | [
"function create(req, res) {\n Offer\n .create(req.body)\n .then(offer => res.status(201).json(offer))\n .catch(err => {\n if (err.name === 'ValidationError') {\n res.status(422).json(err)\n } else {\n res.status(500).json(err)\n }\n })\n}",
"create() {\n const uuid = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generator Function to Stream | function generator2stream(g){
return stream.Readable({
objectMode:true,
read: function(size){
let rs = g.next()
if(rs.done) return this.push(null);
if(rs.value instanceof Promise){
rs.value.then((data)=>{
this.push(data);
},(err)=>{
this.push(err);
})
}
else {
this.push(rs.... | [
"async function readStreamFromAsyncIterator() {\n const stream = Readable.from(generate());\n let chunk;\n for await (chunk of stream) {\n console.log(chunk);\n }\n}",
"_next() {\n if (!this._current) {\n if (!this._streams.length) {\n this._enabled = false;\n return this.end();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add buttons to the map screen | function addButtons(optionList) {
// Add button to pan to current location
const locationButton = document.createElement("button");
// Insert the my_location google icon
locationButton.innerHTML = '<i class="material-icons">my_location</i>';
locationButton.classList.add("custom-map-control-button", "custom-ma... | [
"function drawMapButton() \n{\n fill(0);\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\n fill(255);\n text('Click here to change mappings', buttonX + 7, buttonY + 20);\n}",
"function addControls() {\n // Add home button\n L.easyButton(\n \"fa-home\",\n function (btn, map) {\n map.setView([... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a message to a specific user identified by their name | function sendToUser(name, packetID, msg){
var user = getUserByName(name);
var id = 0;
if(user != null){
id = user.id;
if(id != 0){
io.to(id).emit(packetID, msg);
}else{
console.log("Tried to send packet to offline user.");
}
}
} | [
"function sendPrivateMessage(user, name, text) {\n var target;\n var message = text.split(' ');\n message.splice(0, 2);\n message = message.join(' ');\n\n target = User.getUserByName(name);\n if(target) {\n target.sendPrivateMessage(user, message);\n } else {\n user.notify('Sorry,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The mousespecific nav handler | function handleNavClick(e) {
handleNav(e.target.id);
} | [
"function mouseoverHandler() {\n $('.node').mouseover(function(e) { // mouseover event handler\n toggleSidebar();\n var info = this.id.split('|');\n var title = info[0];\n var code = info[1];\n pageTitle.html(title);\n if (code in queryInfo) {\n pageImage.html... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send email to HR | function sendEmailToHR(){
var sheet = SpreadsheetApp.getActiveSpreadsheet();
callSheetConfig();
var emailAddress = datainit[1][2];
var message = dataconfig[1][1] + "\n" + sheet.getUrl()
var subject = dataconfig[1][0];
MailApp.sendEmail(emailAddress, subject, message);
} | [
"function _sendEmail() {\n\t\t\t}",
"function sendemail(){\t\n\t\n\t\t// make ajax request to post data to server; get the promise object for this API\n\t\tvar request = WmsPost.newAjaxRequest('/wms/x-services/email/producer', formToJSON());\n\t\n\t\t// register a function to get called when the data is resolved\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if user is under 21, this navigates to a kids friendly page | function toKidsPage() {
$("#age-verification-page").hide();
$("#kids-page").show();
} | [
"function showCorrectLogonPage() {\n if(initializeRewards.urlContainsFlowID()){\n changePageFn('#urlogon');\n } else if (isCustomerUsingToken(ccoTokenKey)) {\n changePageFn('#cco');\n }else if (isCustomerUsingToken(bbTokenKey)) {\n changePageFn('#bb');\n }\n }",
"rerouteIfPossible() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
relative > width | height | function relative(){var type=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'width';return function(target,prop,descriptor){if(descriptor.set){var setter=descriptor.set;descriptor.__relative=true;descriptor.set=function(val){if(typeof val==='string'){val=val.trim();if(val.slice(-1)==='%'){var parent=this.sub... | [
"function matchWidth()\n {\n obj.height(Math.round( obj.outerHeight( ) * \n obj.parent().width()/obj.outerWidth( ) - \n (obj.outerHeight( ) - obj.height()) ));\n obj.width(Math.round( obj.parent().width() - \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
appends visit _id to patient record | function addVisitId(db, p_id, v_id, v_date) {
return new Promise((resolve, reject) => {
return db.get(p_id)
.then(function(doc) {
if (!doc.visit_ids){doc.visit_ids = []} //needed for old record compatability
patient = new pmodel.Patient(doc)
patient.visit_ids.push(v_id);
pati... | [
"function add_medication(db, p_id, med) {\n return new Promise((resolve, reject) => {\n return db.get(p_id)\n .then((doc) => {\n patient = new pmodel.Patient(doc)\n patient.medications.push(med);\n return db.put(patient)\n .then(result => {\n resolve(console.log(result)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to display only img styling options | function showImgStyle(){
viewStyling("none");
var styleBlocks = document.getElementsByClassName("imgStyle");
for (var i = styleBlocks.length - 1; i >= 0; i--) {
styleBlocks[i].style.display = "inline";
};
} | [
"function html_applyDefaultStyleToImg(target)\n{\n target.style.border = html_getDefaultBorderStyle();\n target.style.zIndex = html_default_zIndex ;\n target.wasClicked = false ;\n}",
"function showOriginal() {\n const showOriginalBtn = document.querySelector('#show-origi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
class to contain segment info | function SegmentInfo(SegmentId, routeName, segmentName, oneWay, Color, tracks, dash, routeType, trackUsage )
{
this.type = "SegmentInfo";
this.line = null;
var grayLine = null;
webViewBridge.debug("segment " + SegmentId + " usage: " + trackUsage);
var icons = [
[{
icon: lineSymbol, //... | [
"segment(addr) {\n return {\n offset: addr & (this.blockSize - 1),\n idx: (addr >> this.offsetLen) & (this.setNum - 1),\n tag: addr >> (this.offsetLen + this.idxLen)\n }\n }",
"function Segment(char, value, binary, widths)\n{\n this.char = char;\n this.val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether a given view is in creation mode | function isCreationMode(view) {
if (view === void 0) { view = lView; }
return (view[FLAGS] & 1 /* CreationMode */) === 1 /* CreationMode */;
} | [
"isCreated() {\n return (millis() - this.createdAt) / 1000 >= controller.createDuration\n }",
"visitCreate_view(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitCreate_materialized_view(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"_createView(type) {\n\t\tlet self = this;\n\t\tAssertU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn the given optional output directory into a fixed output directory | function determineOutputDirectory(outdir) {
return outdir ?? fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), 'cdk.out'));
} | [
"getOutput() {\n // Assuming it is production\n const output = {\n // Here we create a directory inside the user provided outputPath\n // The name of the directory is the sluggified verion of `name`\n // of this configuration object.\n // Also here we assume, user has passed in the correct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new experience from its label and stores it in memory. | addOrGetExperience( label) {
if (!this.EXPERIENCES[label])
this.EXPERIENCES[label] = this.createExperience(label);
return this.EXPERIENCES[label];
} | [
"create_experience(x, y, th, delta_time_s) {\n if (this.experiences.length === 0) {\n var new_exp = {\n id: 0,\n x_m: 0,\n y_m: 0,\n th_rad: 0,\n x_pc: x,\n y_pc: y,\n th_pc: th,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The AccessRequestItemsCtrl handles listing/searching access request items and selecting items. / jshint maxparams: 15 | function AccessRequestItemsCtrl(accessRequestItemsService, accessRequestDataService,
SearchData, configService, $q, $timeout, AccessRequestItem,
accessRequestFilterService, accessRequestAccountSelectionService,
... | [
"function handleRequest() {\r\n var dateForm = getDateForm();\r\n var paramForm = getParamForm();\r\n if (dateForm !== null && paramForm !== null) {\r\n requestItemInfoAndWait(dateForm, paramForm);\r\n }\r\n}",
"async getItem(...selects) {\n const q = this.listItemAllFields;\n const d = await... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Go to previous page of table pagination | function prevTablePage(table){
// Get table pagination
let pagination = $(table).parent().siblings('.pagination');
// Find current page number and go to next page
let currentPage = $(pagination).find('button.active').prevAll('button').length - 1;
setTablePagination(table, current... | [
"function GetRecordsPrevious(){\n CleanTable('available_records_table');\n GetRecords(records.previous_page);\n}",
"previousPage(currentPage) {\n if (currentPage > 1) {\n this.getArticles(currentPage-1);\n }\n }",
"prev() {\n\t\t\tif (this.currPage > 1) {\n\t\t\t\tthis.currPage--;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DataStore is not a behavior, it standalone object, which represents collection of data. Call provideAPI to map data API | function DataStore() {
this.name = "DataStore";
exports.extend(this, EventSystem);
this.setDriver("json"); //default data source is an
this.pull = {}; //hash of IDs
this.order = toArray(); //order of IDs
this._marks = {};
} | [
"transformStores (app) {\n const stores = app.config.database.stores\n const jsdata = {}\n Object.keys(stores).forEach(key => {\n const connection = lib.Adapters.loadConnection(stores[key])\n let store = new JSData.DS({\n cacheResponse: stores[key].cacheResponse || false,\n bypassCa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset matched card array | function resetMatchedCards() {
matchedCards = [];
} | [
"function resetCards() {\n openCards = [];\n}",
"function resetOpenCards(){\n\topenCards = [];\n}",
"resetWildCards() {\n for (let i=0; i<this.wilds.length; i++) {\n this.wilds[i].rank = -1;\n this.wilds[i].wildValue = this.wilds[i].value;\n }\n }",
"function clearOpenCardList() {\n\topenCar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |