query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Checks all the parents when a leaf node is selected/unselected | checkAllParentsSelection(node) {
let parent = this.getParentNode(node);
while (parent) {
this.checkRootNodeSelection(parent);
parent = this.getParentNode(parent);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkRootNodeSelection(node) {\n const nodeSelected = this.checklistSelection.isSelected(node);\n const descendants = this.treeControl.getDescendants(node);\n const descAllSelected = descendants.every(child => this.checklistSelection.isSelected(child));\n if (nodeSelected && !descAllSel... | [
"0.6600876",
"0.6600876",
"0.65822506",
"0.6438192",
"0.6271956",
"0.6208307",
"0.61847895",
"0.61847895",
"0.6161806",
"0.61209315",
"0.6075338",
"0.606729",
"0.606729",
"0.606729",
"0.606729",
"0.6059916",
"0.6027099",
"0.59841514",
"0.5966708",
"0.59657496",
"0.59594274",
... | 0.74460244 | 0 |
Toggle a leaf todo item selection. Check all the parents to see if they changed | todoLeafItemSelectionToggle(node) {
this.checklistSelection.toggle(node);
if (this.checklistSelection.isSelected(node)) {
this.checklistfoncs.push(node);
}
else if (this.checklistfoncs.some(x => x === node)) {
node.readOnly = 0;
this.checklistfoncs.spl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"todoLeafItemSelectionToggle(node) {\n this.checklistSelection.toggle(node);\n this.checkAllParentsSelection(node);\n }",
"todoItemSelectionToggle(node, $event) {\n this.checklistSelection.toggle(node);\n const descendants = this.treeControl.getDescendants(node);\n if (this.c... | [
"0.82744414",
"0.7778667",
"0.68385834",
"0.6404974",
"0.6360769",
"0.6360107",
"0.62139004",
"0.61485547",
"0.6099188",
"0.60350025",
"0.5968064",
"0.5962206",
"0.5917906",
"0.5893287",
"0.5882285",
"0.58803934",
"0.5867031",
"0.5854487",
"0.5819629",
"0.5810784",
"0.5809441... | 0.7815568 | 1 |
Checks all the parents when a leaf node is selected/unselected | checkAllParentsSelection(node) {
let parent = this.getParentNode(node);
while (parent) {
this.checkRootNodeSelection(parent);
parent = this.getParentNode(parent);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkRootNodeSelection(node) {\n const nodeSelected = this.checklistSelection.isSelected(node);\n const descendants = this.treeControl.getDescendants(node);\n const descAllSelected = descendants.every(child => this.checklistSelection.isSelected(child));\n if (nodeSelected && !descAllSel... | [
"0.6600876",
"0.6600876",
"0.65822506",
"0.6438192",
"0.6271956",
"0.6208307",
"0.61847895",
"0.61847895",
"0.6161806",
"0.61209315",
"0.6075338",
"0.606729",
"0.606729",
"0.606729",
"0.606729",
"0.6059916",
"0.6027099",
"0.59841514",
"0.5966708",
"0.59657496",
"0.59594274",
... | 0.74460244 | 1 |
Whether part of the descendants are selected | descendantsPartiallySelected(node) {
const descendants = this.treeControl.getDescendants(node);
const result = descendants.some(child => this.checklistSelection.isSelected(child));
return result && !this.descendantsAllSelected(node);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"areSelectedNodesContiguous() {\n\t\treturn this.objectModel.areSelectedNodesContiguous();\n\t}",
"function isEntirelySelected(doc, node, start, end) {\r\n let { isEntirelySelected } = getRangeInfo(doc, node, start, end);\r\n return isEntirelySelected\r\n}",
"_hasActiveChildren(){}",
"someChildrenChecked() ... | [
"0.6607179",
"0.6468989",
"0.6444397",
"0.6314062",
"0.63003737",
"0.6254681",
"0.62113243",
"0.62113243",
"0.62113243",
"0.62041336",
"0.6193836",
"0.61893284",
"0.61670804",
"0.6119668",
"0.61040574",
"0.608939",
"0.60731757",
"0.60731757",
"0.60731757",
"0.60647714",
"0.60... | 0.7485112 | 0 |
Alt attribute for CMS Images | function funSetAttriAlt(clasnam) {
var cms_img_elem = document.getElementsByClassName(clasnam);
for(var i=0; i<cms_img_elem.length;i++) {
var src = document.getElementsByClassName(clasnam)[i].getAttribute("src");
var spltd = src.split("/");
var img_altname = spltd[spltd.length - 1].split(".")[0];
docume... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initializeImgAltTags_() {\n toArray(this.element.querySelectorAll('amp-img')).forEach((ampImgNode) => {\n if (!ampImgNode.getAttribute('alt')) {\n ampImgNode.setAttribute('alt', '');\n // If the child img element is in the dom, propogate the attribute to it.\n const childImgNode = ampI... | [
"0.7351679",
"0.7019366",
"0.70029813",
"0.69386417",
"0.6798242",
"0.6784461",
"0.6690668",
"0.6690668",
"0.6687046",
"0.6687046",
"0.66275954",
"0.65961736",
"0.64696336",
"0.6395306",
"0.6369018",
"0.6289506",
"0.62571573",
"0.62012005",
"0.61941683",
"0.60618556",
"0.6055... | 0.7174104 | 1 |
Load the user account and open the export modal | function openExportModal() {
id = $(this).val();
// get the user object for his/her name on the pdf
$.ajax({
url: REST + '/users/' + id,
method: 'GET',
headers: {
Authorization: localStorage.getItem('token')
},
statusCode: {
200: function (dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ManagedUserImportOverlay() {\n var title = loadTimeData.getString('managedUserImportTitle');\n OptionsPage.call(this, 'managedUserImport',\n title, 'managed-user-import');\n }",
"async auth () {\n await app.fetchUser()\n this.walletForm.setAsset(app.assets[DCR_ID])\n ... | [
"0.6307814",
"0.61406004",
"0.6072499",
"0.6012324",
"0.594641",
"0.5940134",
"0.5926566",
"0.58790493",
"0.5868501",
"0.585962",
"0.57331955",
"0.57258934",
"0.56636333",
"0.56476474",
"0.5621376",
"0.5603781",
"0.55958426",
"0.5582375",
"0.55679023",
"0.5556914",
"0.5556432... | 0.70531934 | 0 |
Enable or disable the export button | function enableExportButton(boolean) {
if (boolean) {
$('#export').removeAttr('disabled');
} else {
$('#export').attr('disabled', 'disabled');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function disablePreviewButtons(enabled) {\n $(\"#export\").prop(\"disabled\", enabled);\n $(\"#icon-close\").prop(\"disabled\", enabled);\n $(\"#btn-close\").prop(\"disabled\", enabled);\n}",
"static enableBtnDownload() {\n $('#download-csv-wrapper').tooltip({\n title: 'Use this button to downlo... | [
"0.75136435",
"0.7137672",
"0.6903175",
"0.68326795",
"0.65731716",
"0.65354574",
"0.64610094",
"0.6459099",
"0.6438672",
"0.6405058",
"0.6386545",
"0.63073844",
"0.63069713",
"0.62882406",
"0.62874377",
"0.62604856",
"0.62256277",
"0.622377",
"0.6191012",
"0.6170805",
"0.616... | 0.8493847 | 0 |
Set an error message of the selected export option | function setErrorMessage(msg) {
$('#' + selectedExportOption).find('.date-error').html("<div class='alert-danger'>" + msg + "</div>");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function defaultError() {\n setErrorMessage('Er is iets misgegaan. Probeer het later nog eens.');\n enableExportButton(true);\n}",
"function setErrorMessageInvalidOption(xmlpath, attribute, value) { // setting the error console\n setErrorMessage(\"'\" + value + \"' is not an option for '\" + xmlpath + \... | [
"0.71530867",
"0.62671983",
"0.61553323",
"0.61454695",
"0.59881884",
"0.58547384",
"0.58456045",
"0.57063705",
"0.5652274",
"0.55445516",
"0.5508907",
"0.5490184",
"0.5432338",
"0.54165286",
"0.5402353",
"0.539464",
"0.539464",
"0.5389555",
"0.53807604",
"0.53632724",
"0.534... | 0.6804723 | 1 |
Sets a default error message and enables the export button | function defaultError() {
setErrorMessage('Er is iets misgegaan. Probeer het later nog eens.');
enableExportButton(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function seterror(object,show_default_message) {\n\tif ((show_default_message != undefined) && (show_default_message == true)) {\n\t\terrormessage(object,jslang[language_code]['errortipmessage']);\n\t}\n\t$(object).addClass(\"seterror\");\n}",
"setError() {\n\n this.displayCalc = \"Error\";\n\n }",
"... | [
"0.63230056",
"0.6143324",
"0.608282",
"0.60016847",
"0.59463453",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59374666",
"0.59068644",
"0.58985823",
"0.58985823",
... | 0.8500314 | 0 |
Function: mapping va filter NewItem Component: HomePage | showNewItem(anime, filter) {
let result = [];
if (anime.length > 0) {
// Nhan gia tri va filter anime item neu co thi filter con khong thi bo qua
if (filter !== undefined && filter.length > 0) {
anime = anime.filter(item => item.genres.indexOf(filter) !== -1);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"itemsView(items) {\n return items.map(item => (\n <Menu.Item key={item.slug}>\n <Link to={item.url || `/topics/${item.slug}/?page=1&sortby=date`}>\n <div>\n <span>{siderItemsIcons[item.icon]}</span>\n <span className=\"nav-text text-capi... | [
"0.5785797",
"0.5770146",
"0.57520074",
"0.5648272",
"0.56409085",
"0.56255907",
"0.55908597",
"0.5560953",
"0.55603725",
"0.5520719",
"0.55100393",
"0.54991204",
"0.5444576",
"0.5442718",
"0.5415889",
"0.53987706",
"0.53723335",
"0.5358777",
"0.53309464",
"0.53254247",
"0.53... | 0.6331533 | 0 |
Function: mapping va filter LiveItem Component: HomePage | showLiveItem(anime, filter) {
let result = [];
if (anime.length > 0) {
// Nhan gia tri va filter live item neu co thi filter con khong thi bo qua
if (filter !== undefined && filter.length > 0) {
anime = anime.filter(item => item.genres.indexOf(filter) !== -1);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filterForFrontend() {}",
"itemsView(items) {\n return items.map(item => (\n <Menu.Item key={item.slug}>\n <Link to={item.url || `/topics/${item.slug}/?page=1&sortby=date`}>\n <div>\n <span>{siderItemsIcons[item.icon]}</span>\n <span cl... | [
"0.5913599",
"0.5852075",
"0.5769845",
"0.57204294",
"0.56872237",
"0.568722",
"0.56810987",
"0.5616335",
"0.5589608",
"0.55803573",
"0.5502302",
"0.54814625",
"0.5480003",
"0.5477227",
"0.5475284",
"0.5468841",
"0.5462528",
"0.5442047",
"0.54340297",
"0.54257804",
"0.541611"... | 0.6320661 | 0 |
Function: mapping SideBarChartItem Component: HomePage | showSideBarChartItem(anime) {
let result = [];
if (anime.length > 0) {
let newArr = [...anime].sort((a, b) => {
if (a.views.total > b.views.total) {
return -1;
}
if (a.views.total < b.views.total) {
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"itemsView(items) {\n return items.map(item => (\n <Menu.Item key={item.slug}>\n <Link to={item.url || `/topics/${item.slug}/?page=1&sortby=date`}>\n <div>\n <span>{siderItemsIcons[item.icon]}</span>\n <span className=\"nav-text text-capi... | [
"0.58436143",
"0.58137655",
"0.57669705",
"0.57492244",
"0.57400805",
"0.5543904",
"0.5524209",
"0.5505008",
"0.5486051",
"0.54596525",
"0.5438305",
"0.53450024",
"0.53133315",
"0.5301377",
"0.5295887",
"0.52884287",
"0.5248483",
"0.52310944",
"0.5229617",
"0.52270555",
"0.52... | 0.58637017 | 0 |
Function: + mapping SideBarRecommendItem + Random post moi lan refresh Component: HomePage | showSideBarRecommendItem(anime) {
let result = [];
if (anime.length > 0) {
//Ham random cho ra mot so ngau nhien phai lon hon 5 vi moi lan lay ra 5 item
let rand = Math.floor(Math.random() * (anime.length - 5)) + 5;
// lap ra 5 item tu so ngau nhien
for (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function navFavStories(){\n hidePageComponents();\n putFavStoriesOnPage();\n}",
"function loadRecommendedItems() {\n var memes = document.querySelector('#memes');\n var explorePage = document.querySelector('#explore-page');\n var profileContainer = document.querySelector(\"#profileContainer\");\n v... | [
"0.6012359",
"0.57835567",
"0.57789683",
"0.5710063",
"0.56609315",
"0.5635565",
"0.56076497",
"0.55542445",
"0.55177057",
"0.54813516",
"0.5476307",
"0.54760194",
"0.5465693",
"0.5465693",
"0.54643065",
"0.5463471",
"0.5460726",
"0.5430452",
"0.5412625",
"0.5402134",
"0.5400... | 0.7036014 | 0 |
Function to update donor profile information using fetch API | function updateProfile(e) {
e.preventDefault();
const fetchInit = {
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
},
method: 'POST',
credentials: "same-origin",
body: new FormData(updateProfileForm)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function patchProfile() {\n fetch(BASE_URL + '/user', {\n method: 'PATCH',\n headers: {\n Authorization: `token ${API_TOKEN}`\n },\n body: JSON.stringify({\n name: name.value,\n bio: bio.value\n })\n })\n .then((res) => { return res.json() })\n .then(json =... | [
"0.7017979",
"0.66367644",
"0.638654",
"0.63440394",
"0.63174385",
"0.62863487",
"0.6249345",
"0.6209801",
"0.6148487",
"0.61339027",
"0.6124684",
"0.6121262",
"0.61182845",
"0.607744",
"0.60635626",
"0.6052728",
"0.6031308",
"0.60085845",
"0.5998186",
"0.5993588",
"0.5978732... | 0.67480344 | 1 |
Function to update donor password using fetch API | function updatePassword(e) {
e.preventDefault();
const fetchInit = {
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
},
method: 'POST',
credentials: "same-origin",
body: new FormData(updatePassForm)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updatepassword (credentials) {\n return Api().put('passwordreset', credentials)\n }",
"async submitChangePW () {\n const page = this.page\n Doc.hide(page.repwErr)\n if (!page.repwAppPw.value) {\n page.repwErr.textContent = 'app password cannot be empty'\n Doc.show(page.repwErr)\n retu... | [
"0.6943723",
"0.69022185",
"0.6730712",
"0.67306244",
"0.6523859",
"0.651679",
"0.6435607",
"0.6396583",
"0.635833",
"0.6355169",
"0.6353733",
"0.6300808",
"0.62958354",
"0.6290074",
"0.6283989",
"0.6277338",
"0.6250592",
"0.62443876",
"0.62428284",
"0.6160932",
"0.6123758",
... | 0.7226904 | 0 |
Function to prompt the user for deactivation confirmation | function deactivateDonorAccPrompt() {
const alertifyConfigs = {
'transition': 'zoom',
'movable': false,
'modal': true,
'labels': {
ok: 'Confirm',
cancel: "Cancel"
}
};
alertify.confirm("Confirm to deacti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function confirmPropertyDeactivation() {\n return confirm(translate.TEXT_PROPERTY_DEACTIVATION_CONFIRM);\n}",
"deactivateUser (callback) {\n\t\tthis.deactivatedUser = this.users[2].user;\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'delete',\n\t\t\t\tpath: '/users/' + this.deactivatedUser.id,\n\t\t\t\tto... | [
"0.72510177",
"0.64273405",
"0.6279056",
"0.6161207",
"0.6107648",
"0.6104754",
"0.6067899",
"0.6029021",
"0.6024196",
"0.59856457",
"0.59532857",
"0.5940348",
"0.59367794",
"0.585285",
"0.585097",
"0.58404887",
"0.5834094",
"0.5828546",
"0.5828546",
"0.58270097",
"0.58167094... | 0.7669237 | 0 |
Function to convert blood type value to string | function getBloodTypeString(bloodType) {
let bloodTypeString = '';
switch (parseInt(bloodType)) {
case 1:
bloodTypeString = "A Positive";
break;
case 2:
bloodTypeString = "A Negative";
break;
case 3:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function aTypetoAString(num) {\n if(num == 0) return \"Student\";\n if(num == 1) return \"Tutor\";\n if(num == 2) return \"Teacher\";\n if(num == 3) return \"Admin\";\n}",
"function toString(value) {\n\treturn value.type.handle().toString(value);\n}",
"function getArmourTypeStr(val){\n\treturn {1:\"Helmet\... | [
"0.654771",
"0.6522196",
"0.6462323",
"0.6446572",
"0.6327829",
"0.62580085",
"0.6241306",
"0.6185802",
"0.6119536",
"0.6093598",
"0.60128665",
"0.5996021",
"0.59506106",
"0.59341776",
"0.59268665",
"0.58982784",
"0.58929926",
"0.5892209",
"0.5892209",
"0.5885086",
"0.5885086... | 0.75925183 | 0 |
Randomly stop on a list item from the movies array | function stopShuffle(){
var numberOfMovies = movies.length;
var randMinMov = 1;
var randMaxMov = numberOfMovies;
var randNoMov = Math.floor(Math.random() * (+randMaxMov - +randMinMov)) + +randMinMov;
elem.innerHTML = movies[randNoMov];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"returnARandomMovie() {\n\n let ranIndex = Math.floor(Math.random() * this.rentedMovies.length);\n this.availableMovies.push(this.rentedMovies[ranIndex]);\n this.rentedMovies.splice(ranIndex, 1);\n this.availableMovies.sort();\n this.rentedMovies.sort();\n\n console.log(thi... | [
"0.66207194",
"0.65000886",
"0.6381987",
"0.6327348",
"0.6054836",
"0.60542625",
"0.59850997",
"0.59572726",
"0.59447944",
"0.59205395",
"0.58991086",
"0.5866714",
"0.58106613",
"0.57943904",
"0.5780977",
"0.5779024",
"0.5739694",
"0.5737031",
"0.56826675",
"0.5642722",
"0.56... | 0.748397 | 0 |
Spreads `count` values equally between `min` and `max`. | function linspace(min, max, count) {
var range = (max - min) / (count - 1);
var res = [];
for (var i = 0; i < count; i++) {
res.push(min + range * i);
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function computeValueAxisMinMax(min, max, tickCount) {\n var minMax = new Array();\n if (min == max) {\n return [min - 1.0, max + 1.0];\n }\n\n maxTickCount = Math.max(4, tickCount);\n\n var range = Math.abs(max - min);\n var unroundedTickSize = range / maxTickCount;\n var x = Math.ceil... | [
"0.58002913",
"0.5650913",
"0.5623276",
"0.5623276",
"0.55801886",
"0.54845774",
"0.54302365",
"0.5396552",
"0.53857166",
"0.53736323",
"0.53540385",
"0.53540385",
"0.532247",
"0.532247",
"0.5313924",
"0.53070706",
"0.52885413",
"0.52714115",
"0.5267136",
"0.52563053",
"0.524... | 0.642292 | 0 |
Returns generated sharer url. | createSharingUrl (network) {
const ua = navigator.userAgent.toLowerCase();
/**
* On IOS, SMS sharing link need a special formating
* Source: https://weblog.west-wind.com/posts/2013/Oct/09/Prefilling-an-SMS-on-Mobile-Devices-with-the-sms-Uri-Scheme#Body-only
*/
if (network === 's... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createAuthUrl() {\n // genera uno stato per verificare la chiamata di callback\n var state = Math.random().toString(36).slice(2);\n // salvo lo stato in memoria\n MemoryFactory.save(stateKey, state);\n // restituisco l'url al login con lo stato genera... | [
"0.6131302",
"0.6006858",
"0.5944308",
"0.588944",
"0.58836085",
"0.58479816",
"0.58444977",
"0.582259",
"0.57438755",
"0.56818223",
"0.56322885",
"0.5615507",
"0.5609508",
"0.55321777",
"0.5526777",
"0.5468489",
"0.54598665",
"0.5449603",
"0.54485774",
"0.5424395",
"0.541802... | 0.65388143 | 0 |
Encode hashtags for the specified social network. | generateHashtags (network, hashtags) {
if (network === 'facebook' && hashtags.length > 0) {
return '%23' + hashtags.split(',')[0];
}
return hashtags;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHashtags() {\n $('.tweet_message').html(function () {\n return $(this).text().replace(/(#(\\w+))/g, \"<a href= 'localhost/Tweeter/hashtag.php?toto=$2'>$1</a>\");\n });\n }",
"function loadHashtags(i) {\n //Build the string with the information form the tweet and the nec... | [
"0.6561132",
"0.6283152",
"0.5853184",
"0.58131707",
"0.57798386",
"0.5753766",
"0.5727721",
"0.56765866",
"0.5581863",
"0.54570985",
"0.5445366",
"0.53958976",
"0.53939617",
"0.53750724",
"0.53617465",
"0.533372",
"0.5226847",
"0.51939815",
"0.51739293",
"0.5161412",
"0.5148... | 0.74862945 | 0 |
Shares URL in specified network. | share (network) {
this.openSharer(network, this.createSharingUrl(network));
this.$root.$emit('social_shares_open', network, this.url);
this.$emit('open', network, this.url);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"touch (network) {\n window.open(this.createSharingUrl(network), '_self');\n\n this.$root.$emit('social_shares_open', network, this.url);\n this.$emit('open', network, this.url);\n }",
"createSharingUrl (network) {\n const ua = navigator.userAgent.toLowerCase();\n\n /**\n * On IO... | [
"0.6236073",
"0.62082744",
"0.6181176",
"0.59855247",
"0.5719062",
"0.5579762",
"0.54974055",
"0.54896533",
"0.5419549",
"0.5413954",
"0.54028016",
"0.539104",
"0.53885597",
"0.5365805",
"0.5332555",
"0.528381",
"0.5279956",
"0.5255252",
"0.52507085",
"0.52452284",
"0.5199383... | 0.7207274 | 0 |
/ function return a check button | function checkBtn() {
let check_i = $('<i>', {
class: 'far fa-check-circle'
}),
btn = $('<button>', {
class: "check"
});
btn.append(check_i)
return btn
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function button(ele){\n app.check(ele);\n app.preventClick();\n}",
"function CheckButton() {\n this._init.apply(this, arguments);\n}",
"function showButton() {\n var buttonStatus = false;\n if (selectedItems.length > 0){\n buttonStatus = true;\n };\n return buttonStatus; // t... | [
"0.6923095",
"0.67280805",
"0.6578284",
"0.6555738",
"0.6527784",
"0.651753",
"0.6510248",
"0.6502003",
"0.6489115",
"0.6488426",
"0.64093375",
"0.6392493",
"0.63915634",
"0.6307267",
"0.63013804",
"0.6281594",
"0.62757796",
"0.626384",
"0.62589985",
"0.62527454",
"0.6231343"... | 0.68775254 | 1 |
Use $inject to manually identify your dependencies for Angular components. This technique mirrors the technique used by ngannotate, for automating the creation of minification safe dependencies. If ngannotate detects injection has already been made, it will not duplicate it. shapesConfig.$inject = ['']; | function shapeConfig() {
var service = this;
const NODE_ID = 0;
const SQUARE_ID = 1;
const RECTANGLE_ID = 2;
var shapes = [
{
"id" : NODE_ID,
"name" : "NODE",
"value" : "Node",
"src" : "content/images/ico... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function config($injector) {\n\n // get all providers from app instance.\n let providers = self.basap.providers($injector);\n\n // set any mappings that are required.\n if(self.routerName === 'ngNewRouter'){\n self._mappings.forEach((m) => {\n ... | [
"0.5621496",
"0.5219289",
"0.5195544",
"0.49360296",
"0.49305838",
"0.48534355",
"0.4758226",
"0.47545618",
"0.47409546",
"0.4716284",
"0.47101337",
"0.46968096",
"0.46902326",
"0.46806246",
"0.4664634",
"0.46496215",
"0.46396637",
"0.46326983",
"0.46326983",
"0.46060896",
"0... | 0.58429533 | 0 |
Create RegExp for matching className | function createClassRegExp(className) {
return new RegExp('(?:^|\\s)(' + className + ')(?:$|\\s)');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function classReg( className ) { \n return new RegExp(\"(^|\\\\s+)\" + className + \"(\\\\s+|$)\");\n}",
"function classReg( className ) {\r\n return new RegExp(\"(^|\\\\s+)\" + className + \"(\\\\s+|$)\");\r\n }",
"function classReg( className ) {\r\n return new RegExp(\"(^|\\\\s+)\" + className + \"(\\... | [
"0.8325787",
"0.83176315",
"0.83027375",
"0.83027375",
"0.83027375",
"0.82982415",
"0.8297957",
"0.82814074",
"0.82796156",
"0.82796156",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
"0.82727355",
... | 0.83763105 | 0 |
Find the index of an item in a collection | function indexOf(collection, item) {
for (var i=0, l=collection.length; i<l; i++) {
if (collection[i] === item) {
return i;
}
}
return -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findIndex(todoItems, item) {\n for (let i = 0; i < todoItems.length; i++) {\n if (todoItems[i].id === item.id) {\n return i;\n }\n }\n }",
"function findIndex(item){\n var res = -1;\n \n // iterate trough the array, returning the index once its found\n for(var i = 0; i < items... | [
"0.74705076",
"0.7229392",
"0.7082315",
"0.7045631",
"0.69687337",
"0.69429004",
"0.6868922",
"0.68468595",
"0.6846629",
"0.6845737",
"0.68197536",
"0.6785504",
"0.67774606",
"0.6695163",
"0.66726017",
"0.66694117",
"0.6659337",
"0.6631406",
"0.66307664",
"0.66110456",
"0.659... | 0.8164299 | 0 |
Determine if CSS transitions are supported | function supportsTransitions() {
var style = document.createElement('div').style;
return 'transition' in style ||
'WebkitTransition' in style ||
'MozTransition' in style ||
'msTransition' in style ||
'OTransition' in style;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function supportsTransitions() {\n\t\tvar b = document.body || document.documentElement,\n\t\t\ts = b.style,\n\t\t\tp = 'transition';\n\t\t\n\t\tif(typeof s[p] == 'string') {return true; }\n\n\t\tv = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],\n\t\tp = p.charAt(0).toUpperCase() + p.substr(1);\n\t\tfor(var i=0; i<v.leng... | [
"0.83341414",
"0.821935",
"0.807215",
"0.76441044",
"0.7563248",
"0.72717226",
"0.72717226",
"0.7210027",
"0.68512654",
"0.67475456",
"0.66636014",
"0.6630981",
"0.6602514",
"0.6595447",
"0.65376574",
"0.6501303",
"0.6474588",
"0.6474588",
"0.6474588",
"0.6458496",
"0.6432659... | 0.8718591 | 0 |
Determine if document is currently in full screen mode | function isFullScreen() {
return document.fullscreenElement ||
document.webkitFullscreenElement ||
document.webkitCurrentFullScreenElement ||
document.mozFullScreenElement ||
document.msFullscreenElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get fullscreen() {\n return Engine.client === exports.Client.Electron && GameWindow.browserWindow.isFullScreen();\n }",
"isFullscreen() {\n return !(!document['fullscreenElement'] &&\n !document['msFullscreenElement'] &&\n !document['mozFullSc... | [
"0.7709307",
"0.7700619",
"0.7652383",
"0.7592098",
"0.7589992",
"0.7535638",
"0.7501621",
"0.7465965",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.73917156",
"0.7... | 0.77557635 | 0 |
Exit full screen mode | function exitFullScreen() {
if (isFunction(document.exitFullscreen)) {
document.exitFullscreen();
} else if (isFunction(document.webkitExitFullscreen)) {
document.webkitExitFullscreen();
} else if (isFunction(document.webkitCancelFullScreen)) {
document.webkit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exitFullScreen()\n{\n\t//Tries to disable full screen mode:\n\tCB_Screen.setFullScreen(false); //Uses the Fullscreen API and fallbacks to other methods internally, including NW.js, Electron ones, when not available.\n}",
"function exitHandler() {\n if (!document.webkitIsFullScreen && !document.mozFul... | [
"0.8550413",
"0.80010986",
"0.791807",
"0.7898942",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"0.7761958",
"... | 0.8041251 | 1 |
Get vendor prefixed fullscreenchange event | function getFullScreenChange() {
var el = document.createElement('div'),
event;
if (isFunction(el.requestFullscreen)) {
event = 'fullscreenchange';
} else if (isFunction(el.webkitRequestFullscreen)) {
event = 'webkitfullscreenchange';
} else if (isFun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onFullscreenChange() {\n if(!document.webkitFullscreenElement && !document.mozFullScreenElement) {\n vrMode = false;\n }\n resize();\n }",
"function FullScreenEvent(fullScreen) {\n}",
"function changeFullScreenHandler(event) {\n if ($container.data(\"isFullScree... | [
"0.72182494",
"0.7201925",
"0.71912426",
"0.6966772",
"0.6911974",
"0.6740907",
"0.6626903",
"0.659577",
"0.65720534",
"0.65225524",
"0.6504431",
"0.6491145",
"0.6355293",
"0.6327104",
"0.6247867",
"0.62412333",
"0.6185664",
"0.613502",
"0.6125069",
"0.6071874",
"0.6047688",
... | 0.810547 | 0 |
Removes all .json files in ./locales | function cleanLocales () {
var files = fs.readdirSync(__dirname + '/locales');
files = files.filter(f => f.search(/\.json$/) !== -1);
files = files.map(f => __dirname + '/locales/' + f);
files.forEach(fs.unlinkSync);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sync(from = 'en') {\n from = from.replace(/\\.json$/, '.json').toLowerCase();\n const stats = fs_1.statSync(this.options.directory);\n const files = fs_1.readdirSync(this.options.directory, 'utf-8');\n const fromLocale = this.readLocale(from);\n let ctr = 0;\n files.forEac... | [
"0.62932223",
"0.6164363",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5947101",
"0.5865916",
"0.57585216",
"0.57585216",
"0.5754369",
"0.56982934",
"0.5665263",
"0.5652299",
"0.5637825",... | 0.8941146 | 0 |
Returns a list of commands which are not in `UNTRANSLATED` or `ACCEPTABLE_MISSING`. | function removeNotNeeded (commands) {
return commands.filter(cmd =>
UNTRANSLATED.indexOf(cmd) === -1 &&
ACCEPTABLE_MISSING.indexOf(cmd) === -1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get notInstalled() {\n\t\treturn Array.from(this.required).filter(name => !this.installed.has(name))\n\t}",
"removeCommands(commandsToRemove) {\n if (commandsToRemove === undefined) {\n this.commandsList = [];\n return;\n }\n commandsToRemove = Array.isArray(commandsToR... | [
"0.5923681",
"0.55615026",
"0.5553255",
"0.55065614",
"0.5399871",
"0.5360744",
"0.53511935",
"0.52968276",
"0.5260362",
"0.5251237",
"0.5204893",
"0.51738286",
"0.5167986",
"0.51383376",
"0.51352626",
"0.5084059",
"0.50836396",
"0.5071985",
"0.5059409",
"0.50217164",
"0.4974... | 0.79177266 | 0 |
r arg = removeClass a arg = addClass | function toggleClasses(r, a) {
const cArray = el.className.split(' ')
if (a && cArray.indexOf(a) === -1) cArray.push(a)
const rItem = cArray.indexOf(r)
if (rItem !== -1) cArray.splice(rItem, 1)
el.className = cArray.join(' ')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addClass(el,name){if(el.classList!==undefined){var classes=splitWords(name);for(var i=0,len=classes.length;i<len;i++){el.classList.add(classes[i]);}}else if(!hasClass(el,name)){var className=getClass(el);setClass(el,(className?className+' ':'')+name);}}// @function removeClass(el: HTMLElement, name: Strin... | [
"0.7383394",
"0.7024554",
"0.7023562",
"0.69805825",
"0.6934689",
"0.6928408",
"0.6907215",
"0.6845696",
"0.6822795",
"0.68221194",
"0.6801843",
"0.67801636",
"0.67801636",
"0.67801636",
"0.67801636",
"0.67797",
"0.6772786",
"0.6765501",
"0.6733872",
"0.6698544",
"0.6674293",... | 0.7226366 | 1 |
DBTableHandler() constructor IMMEDIATE Create a DBTableHandler for a table and a mapping. The TableMetadata may not be null. If the TableMapping is null, default mapping behavior will be used. Default mapping behavior is to: select all columns when reading use default converters for all data types perform no remapping ... | function DBTableHandler(dbtable, tablemapping, ctor) {
udebug.log('DBTableHandler<ctor> ', dbtable.database, ':', dbtable.name);
assert(arguments.length === 3);
var i, // an iterator
f, // a FieldMapping
c, // a ColumnMetadata
n, // a field... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DBIndexHandler(parent, dbIndex) {\n udebug.log(\"DBIndexHandler constructor\");\n stats.incr(\"DBIndexHandler\",\"created\");\n var i, colNo;\n\n this.tableHandler = parent;\n this.dbIndex = dbIndex;\n this.fieldNumberToColumnMap = [];\n this.fieldNumberToFieldMap = [];\n \n for(i = 0 ; i < dbIn... | [
"0.5525039",
"0.532679",
"0.53105277",
"0.47516254",
"0.46740705",
"0.46179",
"0.4517254",
"0.4488333",
"0.44837248",
"0.44817966",
"0.4479683",
"0.4478321",
"0.44720346",
"0.44600016",
"0.44600016",
"0.44435236",
"0.44300565",
"0.44257885",
"0.4386004",
"0.4381092",
"0.43810... | 0.77906567 | 0 |
IndexMetadata chooseIndex(dbTableHandler, keys) Returns the index number to use as an access path. From API Context.find(): The parameter "keys" may be of any type. Keys must uniquely identify a single row in the database. If keys is a simple type (number or string), then the parameter type must be the same type as or ... | function chooseIndex(self, keys, uniqueOnly) {
udebug.log("chooseIndex");
var idxs = self.dbTable.indexes;
var keyFieldNames, firstIdxFieldName;
var i, j, f, n, index, nmatches, x;
udebug.log_detail("chooseIndex for:", JSON.stringify(keys));
if(typeof keys === 'number' || typeof keys === 'string') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function indexMap(keys) {\n var result = {};\n var len = keys.length;\n for (var i = 0; i < len; i++) {\n result[keys[i]] = i;\n }\n return result;\n }",
"function testKeyOfIndex_SingleKey() {\n var ds = lf.schema.create('ki', 1);\n ds.createTable('DummyTable').... | [
"0.532656",
"0.5153674",
"0.51468575",
"0.5128205",
"0.5112481",
"0.503727",
"0.49472275",
"0.4946785",
"0.49068516",
"0.48526102",
"0.48292318",
"0.48205003",
"0.48205003",
"0.48125085",
"0.479075",
"0.47832304",
"0.47830483",
"0.47362804",
"0.47261453",
"0.4682593",
"0.4674... | 0.7606478 | 0 |
DBIndexHandler constructor and prototype | function DBIndexHandler(parent, dbIndex) {
udebug.log("DBIndexHandler constructor");
stats.incr("DBIndexHandler","created");
var i, colNo;
this.tableHandler = parent;
this.dbIndex = dbIndex;
this.fieldNumberToColumnMap = [];
this.fieldNumberToFieldMap = [];
for(i = 0 ; i < dbIndex.columnNumbers.len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(dbname, tbname = \"\", rwmode = false, version = 1) {\n this.dbopen =\n version === 1\n ? indexedDB.open(dbname)\n : indexedDB.open(dbname, version);\n this.RWmode = rwmode ? \"readwrite\" : \"readonly\";\n this.tbnam... | [
"0.6891947",
"0.67815715",
"0.65468615",
"0.6362757",
"0.6350577",
"0.6345294",
"0.62887394",
"0.62472266",
"0.62449783",
"0.6206296",
"0.6164948",
"0.6143789",
"0.60915834",
"0.6033736",
"0.5947694",
"0.59468216",
"0.5940362",
"0.5936243",
"0.5936243",
"0.5936243",
"0.593624... | 0.80814046 | 0 |
Convert diamond status string old value into numeric value | function Convert_Into_Old_Diamond_Status_Value(temp_old_diamond_status)
{
if(temp_old_diamond_status == "Confirmed")
{
temp_old_diamond_status = 1;
return temp_old_diamond_status ;
}
else if(temp_old_diamond_status == "Requested-pending")
{
temp_old_diamond_status = 2;
return temp_old_diamond_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Convert_Into_New_Diamond_Status_Value(temp_new_diamond_status)\n{\n if(temp_new_diamond_status == \"Confirmed\")\n {\n temp_new_diamond_status = 1;\n return temp_new_diamond_status ;\n }\n else if(temp_new_diamond_status == \"Requested-pending\")\n {\n temp_new_diamond_status = 2;\n retur... | [
"0.6647291",
"0.58066314",
"0.5741689",
"0.5669841",
"0.56478924",
"0.56342876",
"0.5554192",
"0.55204093",
"0.55178326",
"0.5483329",
"0.5479522",
"0.5474565",
"0.5417096",
"0.541414",
"0.5413874",
"0.5381425",
"0.5352843",
"0.5352843",
"0.535281",
"0.5347947",
"0.5347947",
... | 0.67627573 | 0 |
Convert diamond status string new value into numeric value | function Convert_Into_New_Diamond_Status_Value(temp_new_diamond_status)
{
if(temp_new_diamond_status == "Confirmed")
{
temp_new_diamond_status = 1;
return temp_new_diamond_status ;
}
else if(temp_new_diamond_status == "Requested-pending")
{
temp_new_diamond_status = 2;
return temp_new_diamond_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Convert_Into_Old_Diamond_Status_Value(temp_old_diamond_status)\n{\n if(temp_old_diamond_status == \"Confirmed\")\n {\n temp_old_diamond_status = 1;\n return temp_old_diamond_status ;\n }\n else if(temp_old_diamond_status == \"Requested-pending\")\n {\n temp_old_diamond_status = 2;\n retur... | [
"0.67398745",
"0.56247103",
"0.5515988",
"0.5466757",
"0.5420723",
"0.5337821",
"0.5239232",
"0.5230828",
"0.52292013",
"0.52292013",
"0.52119875",
"0.517825",
"0.5177993",
"0.51722085",
"0.5164361",
"0.5163181",
"0.51631105",
"0.5159319",
"0.51541555",
"0.51444227",
"0.51376... | 0.67801124 | 0 |
number of lookups currently in progress Recursive lookup of nodes: lookup the first alpha number of closest known contacts, retrieve the closest contacts they know, merge retrieved contacts and order them by distance repeat lookup until there are no unconsulted contacts left in the first alpha number of contacts | function lookup () {
// see if the first alpha number of closest nodes contains unconsulted
// nodes and if so, lookup these nodes
contacts
.slice(0, constants.ALPHA)
.filter(function (contact) {
return (!(contact.id in consulted));
})
.forEach(funct... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookup () {\n // see if the first alpha number of closest nodes contains unconsulted\n // nodes and if so, lookup these nodes\n contacts\n .slice(0, constants.ALPHA)\n .filter(function (contact) {\n return (!(contact.id in consulted));\n })\n .... | [
"0.7250529",
"0.5591808",
"0.555592",
"0.5536561",
"0.5444414",
"0.54026616",
"0.53964424",
"0.5353508",
"0.53285843",
"0.5320259",
"0.5311962",
"0.5297124",
"0.528768",
"0.525399",
"0.5227301",
"0.521066",
"0.51957536",
"0.5195682",
"0.5193551",
"0.51915795",
"0.51914954",
... | 0.79846156 | 0 |
Recursive lookup of nodes: lookup the first alpha number of closest known contacts, retrieve the closest contacts they know, merge retrieved contacts and order them by distance repeat lookup until there are no unconsulted contacts left in the first alpha number of contacts | function lookup () {
// see if the first alpha number of closest nodes contains unconsulted
// nodes and if so, lookup these nodes
contacts
.slice(0, constants.ALPHA)
.filter(function (contact) {
return (!(contact.id in consulted));
})
.forEach(funct... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookup () {\n // see if the first alpha number of closest nodes contains unconsulted\n // nodes and if so, lookup these nodes\n contacts\n .slice(0, constants.ALPHA)\n .filter(function (contact) {\n return (!(contact.id in consulted));\n })\n .... | [
"0.7778252",
"0.58104515",
"0.5680964",
"0.549047",
"0.53774804",
"0.53465384",
"0.53142756",
"0.5218329",
"0.5216145",
"0.5208448",
"0.5204374",
"0.5170169",
"0.5151235",
"0.5144042",
"0.5136127",
"0.5129634",
"0.50880206",
"0.5072047",
"0.5056201",
"0.504646",
"0.50336725",... | 0.7164283 | 1 |
Check and remove orphaned starred prospects records | function removeListingOrphans() {
var starListing, prospect;
starListing = shl.Listing.find({
all: true,
order: 'id DESC'
});
if (starListing.length > 0) {
for (id in starListing) {
Ti.API.info('Listing = ' + JSON.stringify(starListing[id]));
if (starListing[id].id != n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maybeReportOrphan(entry) {\n return entry.parents.size === 0 && typeof entry.reportOrphan === \"function\" && entry.reportOrphan() === true;\n} // Removes all children from this entry and returns an array of the",
"function maybeReportOrphan(entry) {\r\n\t return entry.parents.size === 0 &&\r\n\t ... | [
"0.5695258",
"0.5635996",
"0.5568412",
"0.5568412",
"0.5568412",
"0.5568412",
"0.5466284",
"0.5432326",
"0.5357969",
"0.53421104",
"0.5318262",
"0.5288021",
"0.5255778",
"0.5206447",
"0.51979387",
"0.51601166",
"0.51554304",
"0.5124501",
"0.510901",
"0.51083875",
"0.5100896",... | 0.67398727 | 0 |
================ implement a min stack | function MinStack(capacity) {
this._capacity = capacity;
this._storage = {};
this._count = 0;
this._min = new Stack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StackMin() {\n this.stack = []\n this.minStack = []\n}",
"function MinStack(capacity) {\n this._capacity = capacity;\n this._storage = {};\n this._count = 0;\n this._min = new Stack();\n}",
"function Stack() {\r\n\tthis.minNode = null;\r\n\tthis.root = null;\r\n\r\n\tthis.push = function... | [
"0.8480613",
"0.7703728",
"0.76026195",
"0.7251093",
"0.72157776",
"0.71420205",
"0.71420205",
"0.71420205",
"0.7093361",
"0.6953428",
"0.68209386",
"0.6732815",
"0.6472487",
"0.64122593",
"0.63140446",
"0.6313016",
"0.62202805",
"0.62059844",
"0.61996484",
"0.6190645",
"0.61... | 0.7713279 | 1 |
Make a line between pointA and pointB with n total points. | function makeLine(pointA, pointB, n) {
const line = [];
for (let t = 0; t < 1; t += 1 / n) {
line.push(lerpPoints(pointA, pointB, t));
}
return line;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLineFromPoints(a, b) {\n const aLL = getCoords(a);\n const bLL = getCoords(b);\n \n let stepPerc = Number((1 / _stepsBetweenPoints).toFixed(4)); //The progress. It is given in percentage, between 0 and 1.\n let stepIter = stepPerc;\n \n let line = [aLL];... | [
"0.74235994",
"0.71746564",
"0.71420264",
"0.6970905",
"0.664247",
"0.6581383",
"0.6504679",
"0.64750266",
"0.64521194",
"0.6447906",
"0.6435716",
"0.6433147",
"0.6388498",
"0.6363886",
"0.6351691",
"0.63475144",
"0.633824",
"0.63136286",
"0.62851113",
"0.6261789",
"0.6247830... | 0.835154 | 0 |
Lerp between `pointA` and `pointB` at parameter `t`. Each is an [x, y] point. | function lerpPoints(pointA, pointB, t) {
return [
lerp(pointA[0], pointB[0], t),
lerp(pointA[1], pointB[1], t)
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pointLerp(a, b, t){\n\treturn {\n\t\tx : a.x + (b.x - a.x) * t,\n\t\ty : a.y + (b.y - a.y) * t,\n\t}\n}",
"function lerp(a,b,t) {\n\t\tif(t > 1){\n\t\t\tt = 1;\n\t\t}\n\t\tvar xDiff = b.x-a.x;\n\t\tvar yDiff = b.y-a.y;\n\t\treturn {x: a.x + xDiff*t, y: a.y + yDiff*t};\n\t}",
"function lerp(t, a, b) {\... | [
"0.8135602",
"0.8111019",
"0.8039804",
"0.79961985",
"0.7778684",
"0.7749364",
"0.7627627",
"0.75164175",
"0.7446052",
"0.7347903",
"0.73284394",
"0.73051256",
"0.7290432",
"0.7288186",
"0.7284811",
"0.7284811",
"0.7254886",
"0.72370195",
"0.72301024",
"0.7169336",
"0.7080491... | 0.86276084 | 0 |
Lerp between `curveA` and `curveB` at parameter `t`. Each is a list of [x, y] points. | function lerpCurves(curveA, curveB, t) {
return curveA.map((pointA, i) => {
const pointB = curveB[i];
return lerpPoints(pointA, pointB, t);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lerpPoints(pointA, pointB, t) {\n return [\n lerp(pointA[0], pointB[0], t),\n lerp(pointA[1], pointB[1], t)\n ];\n}",
"function lerp(a, b, t) { return a + t * (b - a); }",
"function lerp(t, a, b) {\n return a + t * (b - a);\n}",
"function lerp(a,b,t) {\n\t\tif(t > 1){\n\t\t\tt = 1;\n\t\t}... | [
"0.7850132",
"0.736361",
"0.7361684",
"0.7345444",
"0.7177798",
"0.71196645",
"0.7056025",
"0.7023121",
"0.69778365",
"0.6943865",
"0.68335694",
"0.6788574",
"0.6768331",
"0.6768331",
"0.6766884",
"0.67489916",
"0.67197835",
"0.6698707",
"0.66029376",
"0.646933",
"0.6416455",... | 0.87516314 | 0 |
Draw a curve to the canvas defined by the set of [x, y] points in `points`. | function drawCurve(points) {
beginShape();
curveVertex(...points[0]);
for (const point of points) {
curveVertex(...point);
}
curveVertex(...points[points.length - 1]);
endShape();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawPoints(ctx, points) {\n ctx.lineWidth = 20;\n ctx.lineCap = 'round';\n ctx.strokeStyle = color;\n\n if (points.length < 6) {\n var b = points[0];\n ctx.beginPath(), ctx.arc(b.x, b.y, ctx.lineWidth / 2, 0, Math.PI * 2, !0), ctx.closePath(), ctx.fill();\... | [
"0.8039009",
"0.7581282",
"0.67408514",
"0.673933",
"0.6736297",
"0.67358613",
"0.6714449",
"0.67115736",
"0.66148067",
"0.65975505",
"0.6556338",
"0.65440637",
"0.65266216",
"0.6502555",
"0.6486828",
"0.64731073",
"0.64392793",
"0.64392793",
"0.64392793",
"0.6402922",
"0.635... | 0.83394384 | 0 |
Repel points in the given set of lines that are close to the mouse. | function messWithLines(lines) {
const newLines = [];
// Maximum distance from the mouse that we'll check a control point.
const checkThresh = 50;
for (const line of lines) {
const newLine = [];
for (const point of line) {
const d = dist(...point, mouseX, mouseY);
if (d < checkThresh + 50) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"repelPoints(verts, center) {\n for (var i = 0; i < verts.length; ++i) {\n var vert = this.points.geometry.vertices[verts[i]];\n var diff = new THREE.Vector3().subVectors(vert, center);\n vert.add(diff.multiplyScalar(this.forceSpeed));\n }\n this.points.geometry.verticesNeedUpdate = true;\n ... | [
"0.6010347",
"0.5875683",
"0.57999474",
"0.5795634",
"0.57628876",
"0.56579727",
"0.5598597",
"0.5580594",
"0.5570755",
"0.54564977",
"0.5453609",
"0.5451948",
"0.5394083",
"0.53774714",
"0.53470325",
"0.53222334",
"0.5318455",
"0.53085047",
"0.53022635",
"0.5266355",
"0.5254... | 0.6455655 | 0 |
Checks to see if there is game data for the day & if it is due to API down | function isGameDay(gameData){
if (gameData === null){
console.log('no games today');
main.gameTime = false;
main.apiError = false;
} else if(gameData === 404){
console.log('API fukt');
main.gameTime = false;
main.apiError = true;
} else {
console.log('ga... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkForOpenGame() {\r\n\tgetFromServer(\"/schedule\", function(data) {\r\n\t\tvar now = new Date();\r\n\t\t$.each(data, function(index, value) {\r\n\t\t\tvar date = value.date.split(\".\");\r\n\t\t\tvar time = value.time.split(\":\");\r\n\t\t\tvar gametime = new Date(parseInt(date[2]), parseInt(date[1])-... | [
"0.6778761",
"0.64329076",
"0.63288075",
"0.61779493",
"0.617711",
"0.61420494",
"0.61293155",
"0.6094279",
"0.60646856",
"0.60382825",
"0.60368276",
"0.60257447",
"0.5980199",
"0.5970736",
"0.5967165",
"0.59669375",
"0.5930993",
"0.5879982",
"0.5877661",
"0.58630055",
"0.585... | 0.7530952 | 0 |
Sets the style and team logo based on team name data | function setTeam(TeamName){
switch(TeamName)
{
case "Portland Trail Blazers":
return {style:"blazers", logo:"images/pl.png"};
break;
case "Los Angeles Clippers":
return {style:"clippers", logo:"images/clp.png"};
break;
case "Charlotte Hornets":
return {style:"hornets... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayLogo(team) {\r\n var teamLogo = document.createElement('img');\r\n teamLogo.src = logoDict[team];\r\n document.getElementById('team-logo').src = logoDict[team];\r\n}",
"function checkLogo(obj) {\n if (obj.strTeamLogo) {\n return obj.strTeamLogo\n }\n\n var sport = obj.strSport;\n ... | [
"0.69740975",
"0.6792482",
"0.6550276",
"0.6370617",
"0.6255325",
"0.6160186",
"0.61171806",
"0.61013895",
"0.5846577",
"0.5759255",
"0.56745774",
"0.5641475",
"0.5615465",
"0.56123275",
"0.5609562",
"0.5550802",
"0.55505127",
"0.5540667",
"0.5540516",
"0.55291647",
"0.551167... | 0.74068576 | 0 |
JSONFormatter json>HTML prototype straight from Firefox JSONView For reference: | function JSONFormatter() {
// No magic required.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function JSONFormatter() {\n\t\t\t// No magic required.\n\t\t}",
"function json2html(json, options) {\n var html = '';\n\n if (typeof json === 'string') {\n // Escape tags\n var tmp = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\n\n if (isUrl(tmp)) {\n html += \"<a hre... | [
"0.7075619",
"0.6750986",
"0.6699171",
"0.65407854",
"0.6496984",
"0.6492176",
"0.6309487",
"0.6253077",
"0.62436336",
"0.6151985",
"0.60084236",
"0.5975905",
"0.5975905",
"0.5934229",
"0.5911633",
"0.5878278",
"0.5855481",
"0.58391196",
"0.58333427",
"0.58010674",
"0.5767498... | 0.73370355 | 0 |
Open the root list. | function open(key, node) {
if(this.suppressRoot !== true) {
this.item(node);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openDynamicList()\n {\n \tCONTENTS.openDynamicList();\t\n \n }",
"function openitup() {\n li.locked = true;\n\n li.style.listStyleImage = \"url('ajax-loader.gif')\";\n getDirJSON(subdir, function (json) {\n var nul = drawDir(subdir,... | [
"0.6027039",
"0.5909836",
"0.565983",
"0.55773246",
"0.5479406",
"0.54761565",
"0.5468612",
"0.53748935",
"0.53251696",
"0.53173983",
"0.5316301",
"0.5313335",
"0.5154399",
"0.51336586",
"0.51184165",
"0.5100596",
"0.50926083",
"0.50720567",
"0.5023316",
"0.50144625",
"0.4984... | 0.60933256 | 0 |
Private methods Hide remaining content from assistive technology | function hideNonDialogContentFromAssistiveTechnology() {
const overlayContainer = this.props.__overlayContainer.getContainer();
// Ensure that the overlay container is attached to the DOM.
if (overlayContainer.parentElement) {
const siblings = overlayContainer.parentElement.children;
for (let i = siblin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this._overlayContainer.getContainerElement();\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children... | [
"0.72581625",
"0.6746755",
"0.65965",
"0.6581794",
"0.6428163",
"0.6420631",
"0.6356735",
"0.6356735",
"0.6331632",
"0.62973356",
"0.6247747",
"0.62466407",
"0.6246084",
"0.61656034",
"0.61572236",
"0.6146514",
"0.6136166",
"0.6131681",
"0.6128602",
"0.611941",
"0.611613",
... | 0.7011922 | 1 |
Add dialog ref to the root instance | function addDialogRef({ id, dialog }) {
/**
* If there is a parent dialog manager, then add
* the dialog to this guy recursively.
*/
if (_.get(this.props.__dialogManager.id)) {
addDialogRef.call(this.props.__dialogManager, { id, dialog });
// Once complete, early return.
return;
}
/**
*... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_widget(){\n create_root_node('dialog-add-link', 'Add a link ?');\n dialogs['dialog-add-link'].dialog(\"open\");\n}",
"openDialog() {\n this.$.dialog.open();\n document.body.appendChild(this);\n }",
"onButtonClick() {\n this.refs.dialog.show();\n }",
"function Dialog$$1(par... | [
"0.67020726",
"0.65214133",
"0.6252682",
"0.61197114",
"0.6101002",
"0.60257506",
"0.5952578",
"0.5917519",
"0.5917358",
"0.5903466",
"0.5892955",
"0.5765115",
"0.5736222",
"0.5673426",
"0.56681186",
"0.56649846",
"0.56350005",
"0.5632531",
"0.56193143",
"0.5561321",
"0.55499... | 0.69737786 | 0 |
Remove dialog ref. Follows the same logic as addDialogRef | function removeDialogRef(id) {
if (_.get(this.props.__dialogManager.id)) {
removeDialogRef.call(this.props.__dialogManager, id);
// Once complete, early return.
return;
}
/**
* If there is no parent dialog manager, then remove the reference.
*/
this.setState((state) => {
const openDialogs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRemove(scope, element, options) { // 5181\n angular.element($document[0].body).removeClass('md-dialog-is-showing'); // 5182\n ... | [
"0.6500869",
"0.6480845",
"0.64546144",
"0.6447404",
"0.6445796",
"0.64028484",
"0.6387598",
"0.6354583",
"0.6317186",
"0.6317186",
"0.6301982",
"0.6283143",
"0.6270014",
"0.6270014",
"0.6270014",
"0.6267492",
"0.6260064",
"0.6229674",
"0.60991347",
"0.6078099",
"0.6049039",
... | 0.7223478 | 0 |
Match a request url with either a string or a regular expression. If the matcher is falsy then always return true. This allows a evaluator to match all requests. | function urlMatches(matcher, url) {
if(!matcher) return true;
if(matcher instanceof String || typeof matcher === 'string') {
return url.indexOf(matcher) === 0;
} else if(matcher instanceof RegExp) {
return !!url.match(matcher);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testUrlForPatterns(url) {\n\t if (parsers[url]) {\n\t return parsers[url];\n\t }\n\n\t var match = config.filter(function (parser) {\n\t return new RegExp(parser.pattern, 'g').test(url);\n\t })[0] || null;\n\n\t parsers[url] = match;\n\n\t return match;\n\t }",
"regex_(expre... | [
"0.6022629",
"0.5983836",
"0.5910309",
"0.5866474",
"0.5866474",
"0.5866474",
"0.5866474",
"0.5866474",
"0.5866474",
"0.5866474",
"0.57115865",
"0.56978613",
"0.5619118",
"0.5616778",
"0.56105536",
"0.5591488",
"0.558195",
"0.5552652",
"0.5538593",
"0.5538129",
"0.5529878",
... | 0.7502128 | 0 |
Execute a given evaluator from a configuration object | function executeEvaluator(evaluatorConfig, event) {
var cacheEventFound = false;
Object.keys(serviceComposer.types).forEach(function(key) {
if(serviceComposer.types[key] === evaluatorConfig.type) {
if(typeof evaluatorConfig.evaluator === 'function') {
// Use a custom evaluator method
evaluat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function equationEval(evaluate){\n return eval(evaluate);\n}",
"function CustomEvaluator(root, options) {\n options = options || {};\n Evaluator.call(this, root, options);\n}",
"function evaluate(expr, binding) {\n\tif (typeof expr === 'string') {\n\t\tif (expr.startsWith('?')) {\n\t\t\tlet name = expr.subs... | [
"0.57868457",
"0.5686943",
"0.5648395",
"0.5648395",
"0.56126255",
"0.56053525",
"0.5600127",
"0.55295396",
"0.54742754",
"0.54009986",
"0.5300258",
"0.5248006",
"0.5247362",
"0.5247362",
"0.5247362",
"0.52089053",
"0.51967126",
"0.5195719",
"0.51531446",
"0.5143033",
"0.5139... | 0.70027226 | 0 |
====================== Function to generate Rovers | function Rover(direction, x, y) {
this.direction = direction;
this.x = x;
this.y = y;
this.travelLog = ["(" + this.x + "," + this.y + ")"];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Rover( name, startX, startY, startAngle ) {\n\tthis.name = name;\n\tthis.x = startX;\n\tthis.y = startY;\n\tthis.angle = startAngle;\n\tthis.curDirection = ''\n\n\t$('.rover').css('top', CONST_Y_CENTER - (this.y * CONST_STEP));\n\t$('.rover').css('left', CONST_X_CENTER + (this.x * CONST_STEP));\n\tthis.ro... | [
"0.6475545",
"0.640308",
"0.6377101",
"0.6163332",
"0.60829365",
"0.5933892",
"0.58142877",
"0.5697567",
"0.5666256",
"0.56025904",
"0.5576629",
"0.5567318",
"0.5551322",
"0.54979914",
"0.5496851",
"0.54941535",
"0.5436126",
"0.5348131",
"0.53444517",
"0.53387105",
"0.5328607... | 0.6475063 | 1 |
Validates position by checking whether the rover is within the grid and there are no obstacles or other rovers | function isValidPosition (x, y) {
if (x < 0 || x > 9 || y < 0 || y > 9 ) {
console.log("Can't move. Rover off-grid.");
return false;
}
if (roverGrid[x][y] == 'O') {
console.log("Can't move. Obstacle found.");
return false;
}
if (roverGrid[x][y] != null) {
console.log("Can't move. Another r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkObstacles (rover,grid){\n var y = rover.position[0];\n var x = rover.position[1];\n if (grid[y][x] === 2 || grid[y][x] === 1) {\n console.log(\"Hay un obstaculo, no puedo moverme mas...\");\n return true;\n }else {\n return false;\n }\n }",
"function checkLimits(pRov... | [
"0.7095222",
"0.705871",
"0.69991434",
"0.6964983",
"0.6931445",
"0.6786",
"0.6721092",
"0.669811",
"0.66638064",
"0.6648002",
"0.6647424",
"0.66097546",
"0.6608658",
"0.6592166",
"0.65750486",
"0.6547809",
"0.6537101",
"0.65238315",
"0.65175056",
"0.64936703",
"0.64926934",
... | 0.8097784 | 0 |
Utils Populate the form with example data | function fillExampleData(){
$("#name").val('Albert Wang');
$("#company").val('Test Company');
$("#street1").val('440 Davis Ct');
$("#street2").val('Apartment 919');
$("#city").val('San Francisco');
$("#state").val('California');
$("#zip").val('94111');
$("#country").val('US');
$("#phone").val('617-575... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fillFormElements (data) {\n this.$form.inputParent.value = data.parent;\n this.$form.hiddenSpan.value = data.span;\n }",
"fillForm(data){\n this.idInput.value = data.id;\n this.name.value = data.name;\n this.title.value = data.title; \n this.body.value ... | [
"0.65673125",
"0.656582",
"0.65400106",
"0.64815325",
"0.6349962",
"0.63123494",
"0.6288154",
"0.62152416",
"0.6208547",
"0.61545455",
"0.61459804",
"0.61269015",
"0.6126309",
"0.6104913",
"0.6099262",
"0.6066576",
"0.606604",
"0.60475075",
"0.6037458",
"0.6037458",
"0.603404... | 0.673635 | 0 |
Brick Calculator for a Building | function brickCalculator(buildingFloor) {
var firstTenFloor = 15;
var elevenToTwenty = 12;
var twentyOneAbove = 10;
if (buildingFloor < 0 || buildingFloor == 0) {
console.log("Building Floor cannot be negative or zero");
} else if (buildingFloor <= 10) {
var totalBricks = buildingFloor * 1000;
} els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function brickCalculator(buildingNum) {\n if (buildingNum == 0) {\n return 0;\n } else if (buildingNum < 0) {\n return \"Building Number cannot be less than Zero\";\n } else if (buildingNum <= 10 && buildingNum >= 1) {\n let brickNum = buildingNum * 15000;\n return brickNum;\n ... | [
"0.7093086",
"0.7042641",
"0.6981969",
"0.68948984",
"0.6816553",
"0.6644349",
"0.6596443",
"0.6568481",
"0.6538409",
"0.6517943",
"0.64305687",
"0.6350738",
"0.61669374",
"0.61181116",
"0.60710245",
"0.6062862",
"0.6043304",
"0.6038374",
"0.60323113",
"0.59830505",
"0.586195... | 0.73783654 | 0 |
Function for detecting the word underneath the mouse pointer Source | function _getWordUnderCursor(event) {
var range, textNode, offset;
if (document.body.createTextRange) { // Internet Explorer
try {
range = document.body.createTextRange();
range.moveToPoint(event.clientX, event.clientY);
range.select();
range = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleMouseEvent(ev) {\n let handled = false;\n var blocks = this.svgText.getIntersectingBlocks({\n x: ev.clientX,\n y: ev.clientY\n }, this.scroller.scrollState);\n\n // The mouse is not over the text\n if (!blocks.length) {\n svgHelpers.eraseOutline(this.context, 'text-suggestion');... | [
"0.65874696",
"0.61047983",
"0.604898",
"0.60272104",
"0.60099167",
"0.59826475",
"0.5955343",
"0.5955333",
"0.59155333",
"0.5873159",
"0.58109385",
"0.5802028",
"0.57954067",
"0.57908887",
"0.57538944",
"0.57323486",
"0.57163227",
"0.56736296",
"0.566507",
"0.56618816",
"0.5... | 0.6808936 | 0 |
determines a class for rank | function determineClassColor(rank) {
if (rank <= 10) {
return 'legendary';
}
if (rank <= 100) {
return 'epic';
}
if (rank <= 250) {
return 'rare';
}
if (rank == '-') {
return 'default'
}
return 'uncom... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_max_class(reply) {\r\n let predictions = [reply.SVM, reply.RNN, reply.BERT]\r\n let occ = predictions.reduce((acc, curr) => (acc[curr] = (acc[curr] || 0) + 1, acc), {})\r\n if (!occ[0]) {\r\n return 1\r\n } else if (!occ[1]) {\r\n return 0\r\n } else {\r\n return (o... | [
"0.6309572",
"0.6241324",
"0.6173898",
"0.606887",
"0.6008817",
"0.5954602",
"0.58764213",
"0.5836368",
"0.574585",
"0.5732517",
"0.5678689",
"0.5659809",
"0.56469226",
"0.5642499",
"0.56327456",
"0.56056285",
"0.5586849",
"0.5582227",
"0.5581068",
"0.5560919",
"0.5528883",
... | 0.7371166 | 0 |
Creates the column objects | createColumns() {
let columns = [];
for (let i = 0; i < MAX_COLUMNS; ++i) {
let col = (i + 1) + "";
columns.push(Column.create({
col: col,
controller: this
}));
}
this.set('columns', columns);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Grid_Columns_Create(obj) {\r\n var column = Array();\r\n var field = obj._field;\r\n var length = field.length;\r\n element = null;\r\n for (var i = 0; i < length; i++) {\r\n var tmp = new Object({\r\n id:field[i],\r\n dataIndex:field[i],\r\n header:f... | [
"0.6802126",
"0.67682105",
"0.6690868",
"0.6679895",
"0.66377646",
"0.6528756",
"0.65007097",
"0.64392513",
"0.64064133",
"0.6401621",
"0.63671845",
"0.6318267",
"0.6271742",
"0.6247848",
"0.62474304",
"0.62455714",
"0.6224409",
"0.6214821",
"0.62143505",
"0.6201441",
"0.6138... | 0.7700025 | 0 |
shuffle the letters in a word | function shuffleWord(word) {
// create array
var newWord = word.split('');
shuffleArray(newWord);
return newWord;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shuffle() {\n for (var i = 0; i < words.length; i++) {\n var temp = words[i];\n var randomNumber = Math.floor(Math.random() * words.length);\n words[i] = words[randomNumber];\n words[randomNumber] = temp;\n };\n }",
"function shuffle() {\n pw... | [
"0.7523167",
"0.7395751",
"0.71849436",
"0.7065718",
"0.70141256",
"0.68221617",
"0.67879903",
"0.67532676",
"0.6740878",
"0.67141193",
"0.67107755",
"0.6678979",
"0.6677938",
"0.6677938",
"0.6649256",
"0.6616954",
"0.6559485",
"0.6558696",
"0.6531936",
"0.65039676",
"0.65032... | 0.7885334 | 0 |
Deletes all records from 'purchase_has_product' for given purchase's id | static deleteContents(purchaseId) {
return this.findPurchaseHasProducts(purchaseId).then(hasProducts => {
let promises = [];
// Store all decrements in array
let productDecrements = [];
for (let hasProduct of hasProducts) {
// Add decrement to array
let productDecrementedP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteById(id) {\n for (var i in products) {\n if (products[i].Id == id) {\n products.splice(i, 1);\n }\n }\n showProductToTable();\n saveCart();\n}",
"[types.DELETE_PRODUCT](state, id) {\n state.products = state.products.filter(product => product.id !== id)\n... | [
"0.66596854",
"0.64317936",
"0.63893956",
"0.62480783",
"0.6084159",
"0.6019014",
"0.59289455",
"0.591737",
"0.5898904",
"0.58454615",
"0.5836858",
"0.5788654",
"0.57819074",
"0.5765322",
"0.5733976",
"0.57335025",
"0.5731998",
"0.57250214",
"0.56996256",
"0.56815594",
"0.564... | 0.65857697 | 1 |
Retrieves the last cost, before given date and the first sale price with after or equal date | static retrieveLastCostAndPrice(purchaseContents, provider, date) {
let promises = [];
for (let i = 0; i < purchaseContents.length; i++) {
let hasProduct = purchaseContents[i];
// Retrieve last purchase price
let purchasePricePromise = PurchasePrice.findOne({
where: {
produ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectBestPrice(valueDate) {\n\n}",
"function findDateSellHigh(stockData, dateArr, percentIncrease, buyPrice) {\n console.log(\"activeTradingDates percent = \" + parseInt(percentIncrease));\n console.log('findBuyDateLow running');\n // const dateArr = dateArr;\n ... | [
"0.60457325",
"0.59640354",
"0.5912531",
"0.5891891",
"0.57471645",
"0.56585044",
"0.5648754",
"0.54513747",
"0.54423755",
"0.54423755",
"0.5431186",
"0.54078215",
"0.54078215",
"0.53560066",
"0.534893",
"0.53315806",
"0.5313112",
"0.5313112",
"0.5308383",
"0.5299947",
"0.521... | 0.5997243 | 1 |
Update attributes of existing object. | updateAttributes(mainObject, object) {
_.forOwn(mainObject, (value, key) => {
mainObject[key] = object[key];
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async directUpdate (data) {\n this.assign(data);\n data = this.filterAttrs();\n await this.findSelf().update(data);\n this.assignOldAttrs();\n }",
"async updateObjectToAlgolia() {\n const object = pick(this.toJSON(), attributesToIndex);\n await index.saveObject({ ...objec... | [
"0.67390776",
"0.66973245",
"0.6593402",
"0.6593402",
"0.6349591",
"0.63491744",
"0.6323718",
"0.62809473",
"0.62809473",
"0.62809473",
"0.62647307",
"0.6196125",
"0.61205983",
"0.60865015",
"0.60410166",
"0.5999153",
"0.59875894",
"0.59875894",
"0.5985649",
"0.5947695",
"0.5... | 0.7136888 | 0 |
Copy attributes of existing object to new object | copyAttributes(copyFromObject, copyToObject) {
_.forOwn(copyFromObject, (value, key) => {
copyToObject[key] = copyFromObject[key];
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"#copyAttributes( dest, src ){\n for( const att of src.attributes ){\n dest.setAttribute( att.name , att.value ) ;\n }\n }",
"function copyin(to, from) { for (var attrname in from) { to[attrname] = from[attrname]; } }",
"function copyProps(src,dst){for(var key in src){dst[key]=src[k... | [
"0.7014716",
"0.69989336",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6852924",
"0.6657271",
"0.66359097",
"0.66291773",
"0.66262335",
"0.66207737",
"0.66207737",
"0.6619168",
"0.6596855",
"0.6586897",
"0.6586897... | 0.74836147 | 0 |
Function + watch: vigiar e observar todos arquivos: html, php, sass e js e chama o + browserSync: refresh do browser + gulp.task: criar tarefa gulp para function superviseFile | function superviseFile () {
gulp.watch('src/scss/**/*.scss', compileSASS);
gulp.watch('src/js/**/*.js', compileJS);
gulp.watch('src/plugins/**/*.js', compilePlugins);
gulp.watch('src/**/*.html', compileHTML).on('change', browserSync.reload);
gulp.watch('public/**/*.html').on('change', browserSync.reload);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function watchTask() {\n\n //browser-sync for a live preview function\n browserSync.init({\n injectChanges: false,\n server: {\n baseDir: './pub'\n }\n });\n \n watch([files.htmlPath, files.jsPath, files.imgPath], \n parallel(htmlTask, babelTask, jsTask, imgTask... | [
"0.7654544",
"0.7587338",
"0.75797725",
"0.75626856",
"0.7488686",
"0.74665594",
"0.7461709",
"0.7440077",
"0.7418475",
"0.74160224",
"0.7369291",
"0.7337857",
"0.7320205",
"0.7312321",
"0.7258384",
"0.7245898",
"0.7239985",
"0.7209469",
"0.7187763",
"0.7180219",
"0.71799207"... | 0.8324109 | 0 |
isInternal : String > Boolean Returns whether the beginning of the link is the same as the origin | function isInternal( origin, href ){
const r = new RegExp( '^'+origin );
return r.test( href );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isUrlStart() {\n\t\tif (code[i-1] && /\\w/.test(code[i-1]))\n\t\t\treturn false\n\t\treturn matchNext(\"http://\") || matchNext(\"https://\") || matchNext(\"sbs:\")\n\t}",
"function is_url_internal(url){\r\n var re = /^www\\./,\r\n cur_host = loc.hostname.replace(re, ''),\r\n ... | [
"0.6167578",
"0.6157049",
"0.61212194",
"0.5929356",
"0.58718264",
"0.5786526",
"0.57433075",
"0.56585616",
"0.5624537",
"0.55891484",
"0.55837",
"0.55805254",
"0.5548386",
"0.55224675",
"0.54344934",
"0.5406867",
"0.5377016",
"0.5362967",
"0.5353515",
"0.53282064",
"0.532689... | 0.7266176 | 0 |
baseUrl : urlObj > urlObj Removes query params, anchor links | function baseUrl( urlObj ){
const options = {
auth : false,
search : false,
fragment: false,
unicode : true
};
return url.format( urlObj, options );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function baseUrl() {\n\tlocation.href = location.href.split('?')[0];\n}",
"function buildUrl (obj) {\n\t\treturn (obj.protocol || 'http') + '://' +\n\t\t\t (obj.host ||\n\t\t\t\tobj.hostname + (obj.port ? ':' + obj.port : '')) +\n\t\t\t (obj.pathname || '') +\n\t\t\t (obj.search ? '?' + formatQS(obj.search... | [
"0.6915314",
"0.68380815",
"0.65355927",
"0.6430886",
"0.6379111",
"0.63451594",
"0.6303136",
"0.62565225",
"0.62248707",
"0.61934847",
"0.616644",
"0.6074006",
"0.6064388",
"0.6050198",
"0.60379064",
"0.6003753",
"0.59392405",
"0.59392405",
"0.59343225",
"0.5928438",
"0.5928... | 0.7864875 | 0 |
creacion de un objeto tecnologia | function crearTecnologia(i) {
return {
id: i,
nombre: obtenerValor(nombres),
descripcion: obtenerValor(descripciones),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(nombre,precio,año){\n //variables que siempre tendra un objeto al ser creado \n this.nombre = nombre;\n this.precio = precio;\n this.año = año;\n }",
"function inicializar() {\n }",
"function tarefa(){\n let abastecer = new Object();\n abastecer.nome = \"Abas... | [
"0.6880185",
"0.6672688",
"0.653577",
"0.63596267",
"0.6312479",
"0.627745",
"0.62431514",
"0.6221074",
"0.6218971",
"0.62051845",
"0.61927545",
"0.6192013",
"0.6172642",
"0.6149271",
"0.6137608",
"0.6121824",
"0.6121251",
"0.6120579",
"0.61104506",
"0.6086715",
"0.6072253",
... | 0.67882305 | 1 |
Detector that checks if VLC is installed | function VlcDetector() {
EventEmitter.call(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openVlc(engine, data) {\n return new Promise((resolve, reject) => {\n let dirName = process.env.torrentsPath + '/' + engine.torrent.name + '/';\n //checking vlc installation\n regedit.list('HKLM\\\\SOFTWARE\\\\VideoLAN\\\\VLC', (err, result) =>{\n if(!result){\n ... | [
"0.5877779",
"0.5868633",
"0.5772892",
"0.5701092",
"0.5623543",
"0.55847466",
"0.55421",
"0.55062217",
"0.54819864",
"0.53829604",
"0.53350747",
"0.5306163",
"0.52991354",
"0.52932817",
"0.52634025",
"0.5231149",
"0.52290446",
"0.5220894",
"0.5218788",
"0.5210985",
"0.520964... | 0.6191299 | 0 |
function to clear out the Text in the window | function clearText(){
areaText.innerHTML ="";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearText() {\n\ttext.value = '';\n\ttetx.value = '';\n}",
"function clear_text(txt_out='' , txt_res='') {\n output.value = txt_out;\n result.value = txt_res;\n fill_0();\n}",
"function clearBox(){\n output.innerHTML = '';\n }",
"function clear() {\n terminal.text(\"\");\n $('.def... | [
"0.8140951",
"0.7925177",
"0.7678062",
"0.767629",
"0.76010835",
"0.7599867",
"0.7599867",
"0.75572443",
"0.75092405",
"0.75036955",
"0.7494152",
"0.7470976",
"0.74447346",
"0.7405031",
"0.7392372",
"0.7374514",
"0.73662424",
"0.73438627",
"0.73201334",
"0.73035824",
"0.72775... | 0.80407715 | 1 |
the allimportant heater object heater gathers data relevant to a heatmap, puts data in form necessary for Google elevation API, and displays heatmap layer on the map | function heater(map) {
var currBounds = map.getBounds();
this.top = currBounds.getNorthEast().lat();
this.bottom = currBounds.getSouthWest().lat();
this.left = currBounds.getSouthWest().lng();
this.right = currBounds.getNorthEast().lng();
// create margin beyond view window to avoid edge distorton
var extra = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function heatInit() {\n\n heatLayer = new HeatmapLayer({\n config: {\n \"useLocalMaximum\": true,\n \"radius\": 20,\n \"gradient\": {\n 0.45: \"rgb(000,000,255)\",\n 0.55: ... | [
"0.7018284",
"0.68880177",
"0.6781306",
"0.67805874",
"0.66979885",
"0.6568276",
"0.6439328",
"0.64337856",
"0.6432563",
"0.6367944",
"0.63553506",
"0.6339527",
"0.6327068",
"0.6311251",
"0.6306325",
"0.62964773",
"0.62856096",
"0.62448657",
"0.62428325",
"0.62181616",
"0.619... | 0.7098421 | 0 |
Helper Methods : fillTheDetailsInSelectionBoxss | function fillTheDetailsInSelectionBox(userDetailRecords, selectionBoxId, additionalBoxField_Id) {
// For all the User Details of corresponding UserType
for (var i = 0; i < userDetailRecords.length-1; i++) {
responseSingleObject = JSON.parse(userDetailRecords[i]);
var selectio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillTechnicianBox() \n{\n RMPApplication.debug(\"begin fillTechnicianBox\");\n c_debug(debug.box, \"=> begin fillTechnicianBox\");\n\n var id_technicianRequest = $(\"#id_technicianRequest\");\n var defaultValue = \"yes\";\n var yesNoList = JSON.parse(id_yesno_cl.getList()).list;\n for (i... | [
"0.6439379",
"0.62711585",
"0.6016004",
"0.5971007",
"0.5944586",
"0.5943252",
"0.5939989",
"0.59195536",
"0.59163934",
"0.58494794",
"0.5816459",
"0.57762116",
"0.5753095",
"0.5743947",
"0.5732653",
"0.5730639",
"0.5726096",
"0.57215744",
"0.5719145",
"0.5717654",
"0.5699786... | 0.7252265 | 0 |
Helper Methods : fillTheDynamicFieldsBasedOnChangedInput | function fillTheDynamicFieldsBasedOnChangedInput(userDetailRecords, selectionBoxIdArray, changedSellerInputValue) {
for (var i = 0; i < selectionBoxIdArray.length; i++) {
document.getElementById(selectionBoxIdArray[i]).innerHTML = null;
}
// For all the User Details of correspondi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"#prepareFields(fields) {\n let result = [];\n for (const fieldHash of fields) {\n // convert hash into field\n let field = Field.fromHash(fieldHash);\n\n // dynamic input fields will change the form field name depending on the\n // selected option, so we ne... | [
"0.661813",
"0.6372893",
"0.6355446",
"0.63219005",
"0.6285008",
"0.6279553",
"0.62190485",
"0.61976475",
"0.61464196",
"0.61184776",
"0.6084354",
"0.60779244",
"0.6053243",
"0.6011837",
"0.5961953",
"0.59439874",
"0.5933682",
"0.5893565",
"0.5885655",
"0.5885174",
"0.5882764... | 0.71351373 | 0 |
Helper Methods : addOptionToSelectionBox | function addOptionToSelectionBox(selectionBox, currentOptionValue) {
if (currentOptionValue == null || currentOptionValue == undefined) {
return;
}
var regExpr = /%20/gi;
currentOptionValue = currentOptionValue.replace(regExpr, " ");
// Add Option with input Optio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addOption(selectbox, value, text) {\n var optn = document.createElement(\"OPTION\");\n optn.value = value;\n optn.text = text;\n selectbox.append(optn);\n}",
"function addOption(obj,text,value,selected) {\r\n\tif (obj!=null && obj.options!=null) {\r\n\t\tobj.options[obj.options.length] = new... | [
"0.67228526",
"0.6666242",
"0.666217",
"0.66552866",
"0.65498996",
"0.6492401",
"0.6400441",
"0.63687474",
"0.63467324",
"0.6344782",
"0.6333393",
"0.63314354",
"0.6318631",
"0.6317653",
"0.62602925",
"0.62458676",
"0.62458503",
"0.6182964",
"0.61741704",
"0.6173185",
"0.6165... | 0.69890356 | 0 |
get the favorites list from chrome storage, format it, and return it | async function getFavorites()
{
return new Promise((resolve, reject) => {
chrome.storage.sync.get(['favorites'], resolve);
})
.then(result => {
return formatFavorites(result.favorites);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllFromfavourites() {\n return JSON.parse(localStorage.getItem(\"favourites\"));\n}",
"function getFavs(){\n let favsFromStorage = localStorage.getItem('movie-app-favs');\n if(favsFromStorage === null){\n favsFromStorage = [];\n }else{\n favsFromStorage = JSON.parse(favsFrom... | [
"0.7728155",
"0.75250185",
"0.74851197",
"0.7346956",
"0.73034555",
"0.7226736",
"0.720587",
"0.7153887",
"0.7081401",
"0.7033813",
"0.70171905",
"0.7015779",
"0.6951355",
"0.6939402",
"0.69313085",
"0.6921359",
"0.6824957",
"0.6808936",
"0.6767191",
"0.6764308",
"0.67505914"... | 0.81574994 | 0 |
format favorites list to an array example format: "[\"dashboardsLink\",\"dataExplorerLink\"]" | function formatFavorites(data) {
let output = '[\"';
for (i = 0; i < data.length - 1; i++) {
output = output + data[i] + '\",\"';
}
output = output + data[data.length - 1] + '\"]';
return output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listOfFavorites(){\n let favorites = [];\n $(\"#favorites li h4\").each(function() {favorites.push($(this).text())});\n return favorites.join(\", \");\n}",
"getList() {\n const favouriteBeersIds = this.localStorageService.getItem(this.localstorageId);\n\n if (typeof favouriteBeersIds !== ... | [
"0.70592135",
"0.66177523",
"0.6616097",
"0.64835685",
"0.62736005",
"0.6187967",
"0.6174356",
"0.6069657",
"0.6032838",
"0.60249716",
"0.600124",
"0.59784025",
"0.59465086",
"0.5901455",
"0.58970743",
"0.5859009",
"0.5843462",
"0.5807924",
"0.5787176",
"0.5761204",
"0.573121... | 0.7719841 | 0 |
get the groups list from chrome storage, format it, and return it | async function getGroups()
{
return new Promise((resolve, reject) => {
chrome.storage.sync.get(['groups'], resolve);
})
.then(result => {
return formatFavorites(result.groups);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getGroups() {\n var groups = JSON.parse(sessionStorage.getItem(\"groups\"));\n $.each(groups.reverse(), function(i, group) {\n $(\".groupDivider\").after(\"<li class='deleteGroupsForReset'><a onclick=\\\"getGroupDetails(\"+group.gid+\")\\\" href=\\\"#\\\"><h3>\"+group.gname+\"</h3></a></li>\"... | [
"0.69365364",
"0.68822014",
"0.6811529",
"0.6671613",
"0.65474904",
"0.6446313",
"0.6428929",
"0.63878125",
"0.6375702",
"0.6316965",
"0.62847346",
"0.6258046",
"0.6258046",
"0.6242105",
"0.6208217",
"0.6171779",
"0.61141247",
"0.61002165",
"0.6098582",
"0.60795116",
"0.60654... | 0.7965147 | 0 |
Gets all the features from the provider sources (not cache). It returns these features and will also update the providers to have the latest features cached. | async getFeaturesAsync(overrideInMemoryFeatures = false) {
/**
* If there's already a fetching promise, there's no need to call it again.
* We return that as result.
*/
if (this.fetchPromise != null) {
await this.fetchPromise;
return this.feature... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProviders() {\n return _providers.slice();\n}",
"function getProviders() {\n providerFactory.getProviders()\n .then(function (response) {\n $scope.provider = response.data;\n }, function (error) {\n $scope.statu... | [
"0.6437524",
"0.58211476",
"0.56174654",
"0.5540003",
"0.54295087",
"0.535572",
"0.5308372",
"0.52811867",
"0.5249031",
"0.523081",
"0.5216028",
"0.5184014",
"0.5181427",
"0.5177564",
"0.51583916",
"0.5138877",
"0.512535",
"0.50734925",
"0.50734925",
"0.50734925",
"0.50734925... | 0.6497109 | 0 |
Returns a value indicating whether the given flight is enabled. It uses the values currently on cache. | async isCachedFlightEnabled(flight) {
await this.loadCachePromise;
this.featuresConsumed = true;
this.PostEventToTelemetry(flight);
return this.features.features.includes(flight);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async isFlightEnabledAsync(flight) {\r\n const features = await this.getFeaturesAsync(true);\r\n this.featuresConsumed = true;\r\n this.PostEventToTelemetry(flight);\r\n return features.features.includes(flight);\r\n }",
"isFlightEnabled(flight) {\r\n this.featuresConsumed =... | [
"0.70258266",
"0.6930969",
"0.61724335",
"0.60583425",
"0.60321766",
"0.60321766",
"0.59896314",
"0.5943223",
"0.5919063",
"0.58211786",
"0.57652813",
"0.57643664",
"0.5731887",
"0.5694468",
"0.5687397",
"0.5607455",
"0.55872667",
"0.55872667",
"0.5543469",
"0.55057317",
"0.5... | 0.73460394 | 0 |
Returns a value indicating whether the given flight is enabled. It refetches values from the server. | async isFlightEnabledAsync(flight) {
const features = await this.getFeaturesAsync(true);
this.featuresConsumed = true;
this.PostEventToTelemetry(flight);
return features.features.includes(flight);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isFlightEnabled(flight) {\r\n this.featuresConsumed = true;\r\n this.PostEventToTelemetry(flight);\r\n return this.features.features.includes(flight);\r\n }",
"async isCachedFlightEnabled(flight) {\r\n await this.loadCachePromise;\r\n this.featuresConsumed = true;\r\n ... | [
"0.69544303",
"0.6583486",
"0.64470583",
"0.62934554",
"0.62934554",
"0.61231875",
"0.60636497",
"0.606149",
"0.6011456",
"0.60024905",
"0.5975498",
"0.5828254",
"0.57867837",
"0.57584774",
"0.5751805",
"0.5751641",
"0.57472044",
"0.57117337",
"0.569924",
"0.5661509",
"0.5657... | 0.72567195 | 0 |
Returns the value of the treatment variable, or undefined if not found. It uses the values currently in memory, so the experimentation service must be initialized before calling. | getTreatmentVariable(configId, name) {
var _a;
this.featuresConsumed = true;
this.PostEventToTelemetry(`${configId}.${name}`);
const config = this.features.configs.find(c => c.Id === configId);
return (_a = config) === null || _a === void 0 ? void 0 : _a.Parameters[name];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getTreatmentVariableAsync(configId, name) {\r\n await this.getFeaturesAsync(true);\r\n return this.getTreatmentVariable(configId, name);\r\n }",
"static getValue(storyVar) {\n\t\t\tconst varData = Wikifier.parseStoryVariable(storyVar);\n\t\t\tlet retVal;\n\n\t\t\tif (varData !== null) {\n\... | [
"0.57957745",
"0.5635797",
"0.541381",
"0.5302254",
"0.52787954",
"0.51499945",
"0.51499945",
"0.514033",
"0.503746",
"0.5030938",
"0.49945742",
"0.4833755",
"0.47875914",
"0.4779902",
"0.47593182",
"0.4750628",
"0.47306746",
"0.4727851",
"0.47239694",
"0.46596378",
"0.465936... | 0.58910614 | 0 |
Returns the value of the treatment variable, or undefined if not found. It refetches values from the server. | async getTreatmentVariableAsync(configId, name) {
await this.getFeaturesAsync(true);
return this.getTreatmentVariable(configId, name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRTValue( variableName, format ) {\n var index = -1;\n var request = '';\n var variableAddr = '';\n var variableType = '';\n var variableFormat = '';\n var values = new Array();\n \n if ( typeof(availableVariables) != \"undefined\" )\n index = getVariableIndex( availableVa... | [
"0.57628286",
"0.57281464",
"0.54719806",
"0.52695554",
"0.51894987",
"0.51848745",
"0.5168349",
"0.5168349",
"0.5168349",
"0.51375073",
"0.51219016",
"0.50949585",
"0.5061634",
"0.50589025",
"0.5049303",
"0.50302243",
"0.5020541",
"0.5011475",
"0.50054777",
"0.49732643",
"0.... | 0.57560986 | 1 |
calculates the distance from the middle of one rect to middle of other rect | function rectDistance(rect1, rect2) {
return pointDistance(Qt.point(rect1.x + rect1.width / 2, rect1.y + rect1.height / 2),
Qt.point(rect2.x + rect2.width / 2, rect2.y + rect2.height / 2))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function D(a,b){return{left:a.left-b.left,top:a.top-b.top}}",
"function dist(a, b) {\n return Math.sqrt(Math.pow(a.pos[0] - b.pos[0], 2) + Math.pow(a.pos[1] - b.pos[1], 2)) - a.r - b.r;\n }",
"function rectDistance(centerx, centery, width, height, px, py) {\n var dx = Math.max(Math.abs(px - centerx)... | [
"0.6864525",
"0.6572157",
"0.6559024",
"0.6440068",
"0.63597125",
"0.6323315",
"0.62876815",
"0.6230606",
"0.6155411",
"0.6154661",
"0.6107329",
"0.6096714",
"0.60874856",
"0.6054778",
"0.60430574",
"0.6027996",
"0.60144144",
"0.5998711",
"0.5994604",
"0.59937584",
"0.5992079... | 0.7691692 | 0 |
Draw the rounded arc | function roundedRectArc(ctx,x,y,w,h,r){
var a = x + w/2;
var b = y + h/2;
var c = x - w/2;
var d = y - h/2;
var rsqr=Math.SQRT2*r;
var move=rsqr/2;
var ytop=b-(Math.sqrt(Math.pow(w,2)+Math.pow(h,2)))/2;
var xright= a+(Math.sqrt(Math.pow(w,2)+Math.pow(h,2)))/2;
var xleft= ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawArc(style,x,y,radius,startAngle,endAngle){\r\n ctx.beginPath();\r\n ctx.arc(x,y,radius,startAngle,endAngle);\r\n if(style==\"stroke\"){\r\n ctx.stroke();\r\n }else if(style==\"fill\"){\r\n ctx.fill();\r\n }\r\n ctx.closePath();\r\n }",
"function drawArc(arc, radius, fill... | [
"0.744576",
"0.73968744",
"0.73309994",
"0.7242965",
"0.7240088",
"0.7124387",
"0.69839066",
"0.69649273",
"0.6953504",
"0.69371265",
"0.6914155",
"0.69064593",
"0.6891378",
"0.6889894",
"0.6889894",
"0.6889894",
"0.6862456",
"0.68601",
"0.6792579",
"0.67913455",
"0.67878443"... | 0.7515671 | 0 |
Full arc got seperated in the below ctx.arc(a, ydownrsqr,r,1/4Math.PI,2/4Math.PI+1/4Math.PIcurrentArc); | function Arc4(currentArc,FractionArc){
var Ra4= FractionArc*(r*Math.PI/4)/ArcLengthProportion;
ctx.moveTo(a+move,ydown-move);
ctx.arc(a, ydown-rsqr,r,1/4*Math.PI,1/4*Math.PI+(Ra4/r)*currentArc);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arc(r,a,b){\n ctx.moveTo(3.5*U,3.5*U);\n ctx.beginPath();\n ctx.arc(3.5*U,3.5*U,r,toRad(a),toRad(b),false);\n ctx.stroke();\n }",
"function linecapLessRecArc(ctx,x,y,w,h,r){\r\n y-=15;h+=30;x-=15;w+=30;r+=21.21-4;//r+=sqrt(15^2+15^2)\r\n var a = x + w/2;\r\n var b... | [
"0.7710819",
"0.7379755",
"0.7331553",
"0.71503794",
"0.7133541",
"0.70940375",
"0.70696855",
"0.70457387",
"0.696675",
"0.6910376",
"0.6850731",
"0.68476665",
"0.6844757",
"0.6799147",
"0.6795913",
"0.6775479",
"0.6716793",
"0.66911095",
"0.66657984",
"0.6664213",
"0.6659221... | 0.7483484 | 1 |
Draw the quart lines | function LineQuarter(currentQuart,FractionLine){
var Ral1= FractionLine*Math.sqrt(Math.pow(movestopxf-movestopxs,2)+Math.pow(movestopyf-movestopyc,2))/LineLengthProportion;
ctx.moveTo(a+move, ytop+move);
//ctx.lineTo(xright-move,b-move);
if(Math.sqrt(Math.pow(((a+move)*(1-cur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tickLine(currentQuart,LineType,frac){\r\n\r\n currentQuart += PlusCurrentLine;\r\n currentQuartTemp=currentQuart;\r\n\r\n switch(LineType)\r\n {\r\n case 1:\r\n LineQuarter(currentQuart,frac);\r\n break;\r\n case 2:\r\n Lin... | [
"0.61348957",
"0.6077356",
"0.6076427",
"0.602443",
"0.5953162",
"0.5899887",
"0.5887498",
"0.579833",
"0.5775973",
"0.57675385",
"0.576529",
"0.5754584",
"0.5687911",
"0.5668059",
"0.56398237",
"0.56350064",
"0.56298393",
"0.56124663",
"0.55843985",
"0.5578024",
"0.5578024",... | 0.66058445 | 0 |
returns if number is a number and is in range of start to stop, else returns false otherwise | function isValidNumber(number, start, stop) {
return number < start || number > stop || isNaN(number);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"inRange(number, start, end) {\n if (end == undefined) {\n end = start;\n start = 0;\n }\n if (start > end) {\n const temp = end;\n end = start;\n start = temp;\n }\n const isInRange = start <= number && number < end;\n ... | [
"0.82458633",
"0.81658435",
"0.8072289",
"0.8063226",
"0.8001555",
"0.78475946",
"0.7533776",
"0.7516008",
"0.74394107",
"0.7323786",
"0.7316702",
"0.7288387",
"0.7271583",
"0.72618085",
"0.72352105",
"0.720747",
"0.71907854",
"0.71321803",
"0.71321803",
"0.7057217",
"0.68737... | 0.84682643 | 0 |
Tree traversal methods Returns the vampire object with that name, or null if no vampire exists with that name | vampireWithName(name) {
// Check name of current vampire
if (this.name === name) {
return this;
}
for (const offspring of this.offspring) {
const result = offspring.vampireWithName(name);
// Only return if name has been found;
if (result) {
return result;
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"vampireWithName(name) {\n if (this.name === name) {\n return this;\n }\n for (const vampire of this.offspring) {\n const nameLookUp = vampire.vampireWithName(name);\n if (nameLookUp) {\n return nameLookUp;\n }\n }\n return null;\n }",
"vampireWithName(name) {\n if (t... | [
"0.69924116",
"0.6799464",
"0.6641354",
"0.6119832",
"0.60844773",
"0.6048896",
"0.6020249",
"0.5942785",
"0.592657",
"0.5801061",
"0.56057847",
"0.5581225",
"0.55649966",
"0.55546796",
"0.55546796",
"0.5467062",
"0.54537064",
"0.54344773",
"0.542258",
"0.5398295",
"0.5289638... | 0.71699303 | 0 |
Stretch Returns the closest common ancestor of two vampires. The closest common anscestor should be the more senior vampire if a direct ancestor is used. For example: when comparing Ansel and Sarah, Ansel is the closest common anscestor. when comparing Ansel and Andrew, Ansel is the closest common anscestor. | closestCommonAncestor(vampire) {
let currentVampire1 = this;
let currentVampire2 = vampire;
while (currentVampire1) {
while (currentVampire2) {
if (currentVampire1 === currentVampire2) {
return currentVampire1;
}
currentVampire2 = currentVampire2.creator;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closestCommonAncestor(vampire) {\n\n }",
"closestCommonAncestor(vampire) {\n\n }",
"closestCommonAncestor(vampire) {\n\n }",
"closestCommonAncestor(vampire) {\n if (this.creator === vampire | vampire.creator === null | vampire === this) {\n return vampire;\n }\n if (this.creator === null | v... | [
"0.67132986",
"0.67132986",
"0.67132986",
"0.645995",
"0.6302776",
"0.6302776",
"0.6302776",
"0.62673026",
"0.62658393",
"0.6251185",
"0.6251185",
"0.6251185",
"0.6251185",
"0.6251185",
"0.624989",
"0.62214977",
"0.617353",
"0.617353",
"0.6172872",
"0.6172872",
"0.6172872",
... | 0.6872282 | 0 |
Calculo la cantidad de noticias por portal. | function calcularCantNoticias(sitio)
{
//alert(sitio.news.length);
return sitio.news.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cantidadComentariosTotal() {\r\n return ListaComentarios.length;\r\n}",
"function cantidadItemsCarrito() {\n var cantidad = 0;\n\n for (let i = 0; i < articulosPrecargados.articles.length; i++) {\n let art = articulosPrecargados.articles[i];\n cantidad += parseInt(art.count);\n ... | [
"0.65238297",
"0.62431055",
"0.62128204",
"0.6154336",
"0.60612965",
"0.57718164",
"0.57614994",
"0.5680849",
"0.5672914",
"0.5635548",
"0.563363",
"0.55889225",
"0.55828714",
"0.55210334",
"0.5485494",
"0.5485394",
"0.547451",
"0.5473972",
"0.5464968",
"0.5460086",
"0.545330... | 0.6834557 | 0 |
Sort from lowest to highest number | function sortLowHigh(input){
for (let i = 0; i < input.length; i++) {
input[i].sort( (a,b) => {
return a-b;
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortHighLow(input){\n for (let i = 0; i < input.length; i++) {\n input[i].sort( (a,b) => {\n return a-b;\n });\n input[i].reverse();\n }\n}",
"function sortNumber(a,b) {return a - b; }",
"function sortNumber(a, b) { \n return b - a; \n }",
"function sort_numbers() {\r\n this_Dice.... | [
"0.7356225",
"0.7340086",
"0.72397655",
"0.7164207",
"0.7155082",
"0.7152249",
"0.71377593",
"0.7127403",
"0.70813596",
"0.7066788",
"0.70617145",
"0.70613074",
"0.70471936",
"0.70352215",
"0.70341027",
"0.7027262",
"0.70265657",
"0.7024054",
"0.70015955",
"0.6992727",
"0.699... | 0.7447968 | 0 |
Sort from highest to lowest number | function sortHighLow(input){
for (let i = 0; i < input.length; i++) {
input[i].sort( (a,b) => {
return a-b;
});
input[i].reverse();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortLowHigh(input){\n for (let i = 0; i < input.length; i++) {\n input[i].sort( (a,b) => {\n return a-b;\n });\n }\n}",
"function sortNumber(a,b) {return a - b; }",
"function sortNumber(a, b) { \n return b - a; \n }",
"function sortNumber(a,b) {\n return a - b;\n }... | [
"0.74368036",
"0.73256177",
"0.72462255",
"0.71492755",
"0.7141702",
"0.7132146",
"0.7116412",
"0.71136415",
"0.7074943",
"0.7046697",
"0.7041008",
"0.7017099",
"0.7015588",
"0.70154494",
"0.7013996",
"0.7011028",
"0.6984783",
"0.6978814",
"0.6977988",
"0.6977988",
"0.6972320... | 0.7376358 | 1 |
build list in a Criteria Tree | listToTree(list) {
const map = [];
const roots = [];
let i;
let node = {};
for (i = 0; i < list.length; i += 1) {
map[list[i].id] = i; // initialize the map
list[i].children = []; // initialize the children
}
for (let x = 0; x < list.length... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async calculateLeafTree(list, options, project) {\n listCriteria = list;\n options.forEach((element) => {\n element.value = null;\n element.median = false;\n });\n\n listCriteria.forEach((element) => {\n element.options = JSON.parse(JSON.stringify(option... | [
"0.6186895",
"0.5770018",
"0.56077194",
"0.556965",
"0.55287445",
"0.5474",
"0.54397225",
"0.5418637",
"0.53778476",
"0.5349661",
"0.5288428",
"0.5282372",
"0.52812237",
"0.5279674",
"0.5272279",
"0.52719223",
"0.5270088",
"0.5253076",
"0.52478",
"0.5224586",
"0.5175944",
"... | 0.6356782 | 0 |
calculate negative values for Options | async setNegativeValues(position_criterion, position_option, steps) {
let i = 0;
while (i !== position_option) {
if (i === 0) {
listCriteria[position_criterion].options[i].value = 0 - (steps) * (listCriteria.length - position_criterion);
} else {
l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get value() {\n return -this.amount;\n }",
"get value() {\n return -this.amount;\n }",
"function abs(parms){ return Math.abs(parms) }",
"filterNegativeValues() {\n const curve = this.days;\n let resultCurve = [];\n resultCurve = curve.map((day) => {\n let resultDay = {... | [
"0.62807846",
"0.62807846",
"0.6008555",
"0.59015065",
"0.5874583",
"0.5838899",
"0.58036464",
"0.5779012",
"0.56953305",
"0.5641651",
"0.5609667",
"0.5607273",
"0.5603167",
"0.55706185",
"0.55190945",
"0.5510699",
"0.549171",
"0.5448619",
"0.5440107",
"0.5412356",
"0.5401303... | 0.64246756 | 0 |
build Chart Bar for Main Criteria | buildBarChart(mainCriteria, performanceMedia, performanceMin, performanceMax) {
const barChart = [[], []];
for (let index = 0; index < mainCriteria.length; index += 1) {
const mult = ((mainCriteria[index].performanceMedia + Math.abs(mainCriteria[index].performanceMin)) / (Math.abs(mainCrite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createMainChart(cobj) {\n return new BarChart(mainContainer,\n mapChartConfig(cobj, barConfigLarge, 'large'));\n }",
"function compare_initBarChart() {\n compare_makeBarGroup(1, dataset_length);\n compare_makeBarGroup(2, dataset_length);\n compare_makeBarGroup(3, dataset_length);\n}",
... | [
"0.6763835",
"0.6757084",
"0.6723118",
"0.6694653",
"0.6673081",
"0.66537166",
"0.6619124",
"0.6587111",
"0.6579972",
"0.65681636",
"0.654415",
"0.65313935",
"0.6491213",
"0.64803076",
"0.6471078",
"0.6459891",
"0.643914",
"0.6424847",
"0.6422769",
"0.6416434",
"0.6398502",
... | 0.7471796 | 0 |
Create a thumbnail size canvas, copy the or into it cropping the edges as needed to make it fit, and then extract the thumbnail image as a blob and pass it to the callback. This utility function is used by both the image and video metadata parsers | function createThumbnailFromElement(elt, video, rotation, callback) {
// Create a thumbnail image
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
canvas.width = THUMBNAIL_WIDTH;
canvas.height = THUMBNAIL_HEIGHT;
var eltwidth = video ? elt.videoWidth : elt.wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawThumbnail(blur) {\r\n context\r\n .drawImage(thumbnail, 0, 0, thumbnail.naturalWidth,\r\n thumbnail.naturalHeight, 0, 0, canvas.width, canvas.height);\r\n StackBlur.canvasRGBA(canvas, 0, 0, canvas.width, canvas.height, blur);\r\n }",
"trimThumbnail(thumbnail) {\n... | [
"0.6489668",
"0.64273024",
"0.6296928",
"0.62670773",
"0.616219",
"0.6135001",
"0.6104042",
"0.60909575",
"0.6053745",
"0.5983156",
"0.5936938",
"0.5894421",
"0.5839777",
"0.5763761",
"0.5755373",
"0.5728213",
"0.57256526",
"0.57234",
"0.57233614",
"0.57158333",
"0.5708111",
... | 0.6659684 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.