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 |
|---|---|---|---|---|---|---|
Load articles of type favourite | loadFavourites(replace) {
this.loadArticles({
type: 'favourites',
from: replace ? 0 : this.articles.length,
num: this.defaultNewArticlesNum
}, replace);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadFavoriteItems() {\n\t\tactiveBtn('fav-btn');\n\n\t\t// request parameters\n\t\tvar url = './history';\n\t\tvar params = 'user_id=' + user_id;\n\t\tvar req = JSON.stringify({});\n\n\t\t// display loading message\n\t\tshowLoadingMessage('Loading favorite items...');\n\n\t\t// make AJAX call\n\t\tajax('G... | [
"0.66578555",
"0.6549462",
"0.65462977",
"0.63526505",
"0.62984836",
"0.62524253",
"0.61898017",
"0.6144492",
"0.61304104",
"0.61288637",
"0.6107666",
"0.6100079",
"0.6094508",
"0.6093692",
"0.60864735",
"0.6078458",
"0.6074656",
"0.60489136",
"0.5976427",
"0.59531564",
"0.59... | 0.74361503 | 0 |
Load articles of type read later | loadReadLater(replace) {
this.loadArticles({
type: 'read-later',
from: replace ? 0 : this.articles.length,
num: this.defaultNewArticlesNum
}, replace);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}",
"function findArticles() {}",
"function reloadParts(){\n var checked = [];\n u('.category input:che... | [
"0.743352",
"0.6373932",
"0.6339349",
"0.6295299",
"0.6088901",
"0.6069141",
"0.6065706",
"0.5960842",
"0.59041226",
"0.5884253",
"0.5876766",
"0.5829167",
"0.5768138",
"0.57546765",
"0.57164234",
"0.5702241",
"0.568633",
"0.5674254",
"0.5629633",
"0.56135935",
"0.5612656",
... | 0.65323853 | 1 |
Load articles of type tag associated to a specified tag | loadTag(replace, tag) {
this.loadArticles({
type: 'tag',
tag: tag,
from: replace ? 0 : this.articles.length,
num: this.defaultNewArticlesNum
}, replace);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadThisTagsPosts(theTag) {\n\n theTag = theTag.replace(/_/g, ' ');\n var thisTagPosts = [];\n $.get(\"posts/posts.xml\", function(posts) {\n $(posts).find('post').each(function(i) {\n var this_post = $(this);\n // if post has tag being loaded\n this_post.find('tags').find('tag').each... | [
"0.66204786",
"0.65865725",
"0.62822497",
"0.60475194",
"0.6039406",
"0.58915097",
"0.5819981",
"0.5809969",
"0.57895774",
"0.5680183",
"0.5627681",
"0.55842155",
"0.5549381",
"0.5540034",
"0.5444445",
"0.539743",
"0.5365283",
"0.53642344",
"0.53533834",
"0.5254539",
"0.52525... | 0.772881 | 0 |
Load articles of type keyword associated to a specified keyword | loadKeyword(replace, keyword) {
this.loadArticles({
type: 'keyword',
keyword: keyword,
from: replace ? 0 : this.articles.length,
num: this.defaultNewArticlesNum
}, replace);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findArticles() {}",
"function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}",
"function findArticleFromAll(articleUrl) {\n for (let keyword of... | [
"0.6174788",
"0.5870984",
"0.5859352",
"0.57948303",
"0.55625975",
"0.55123824",
"0.5488834",
"0.542454",
"0.5310924",
"0.5269868",
"0.5249951",
"0.52495605",
"0.5238567",
"0.5229129",
"0.5186989",
"0.5142568",
"0.51413715",
"0.5129011",
"0.5090034",
"0.5087222",
"0.50776786"... | 0.7665863 | 0 |
Shows an error banner inside the articles container. | showError() {
showError($('#articles').children('#articles-big-list'), 'Error downloading articles');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showError(msg) {\n showError($(`#${this.idDOM}`).children('.article-big-content'), msg)\n }",
"showError(msg) {\n showError($('#articles-small-list'), msg)\n }",
"function showErrorInfo({containerSelector, errorMsg}) {\n const container = document.querySelector(containerSelector);\n conta... | [
"0.69659054",
"0.6827676",
"0.6795161",
"0.6728601",
"0.65720785",
"0.65711474",
"0.65711474",
"0.65083534",
"0.6503401",
"0.6500013",
"0.6492649",
"0.64831656",
"0.6445773",
"0.6440468",
"0.64118636",
"0.63991046",
"0.6396757",
"0.6372166",
"0.636809",
"0.636809",
"0.636809"... | 0.73457557 | 0 |
Dynamically creates a new article big inside the $parent container. | create($parent) {
let $self = $(`<article id="${this.idDOM}" class="article-big"></article>`).appendTo($parent);
$(`<div class="article-big-header">` +
`<div class="article-big-image" style="background-image: url('/Vuvuzela/img/articles/${this.config['img']}');"></div>` +
`<h6 c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"create($parent) {\n $(`<article id=${this.idDOM} class=\"article-small\">\n <div class=\"article-small-article\">\n <h6 class=\"article-small-category\">${this.config['category']}</h6>\n <h5 class=\"article-small-title\">${this.config['title']}</h5>\n ... | [
"0.7684706",
"0.60140884",
"0.60112476",
"0.6002557",
"0.5963253",
"0.5916231",
"0.5825195",
"0.5754509",
"0.57222164",
"0.5697358",
"0.56784153",
"0.566316",
"0.566316",
"0.56597096",
"0.5644896",
"0.56399804",
"0.5635744",
"0.56323606",
"0.56323606",
"0.5632124",
"0.5573355... | 0.7469884 | 1 |
Creates a new comments section for this article | showComments() {
let $self = $(`#${this.idDOM}`);
let $content = $self.children('.article-big-content');
this.commentSection = new CommentSection(this.config.id);
this.commentSection.create($content);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_comment(comment){\n const section = createElement('section', null);\n let author_date = createElement('div', null, {class: 'author-date-container'});\n section.appendChild(author_date);\n author_date.appendChild(createElement('h3', comment.author));\n const date = new Date(parseFloat(c... | [
"0.6644876",
"0.6598547",
"0.6485696",
"0.64446914",
"0.6390367",
"0.6376105",
"0.6337655",
"0.6305535",
"0.6197741",
"0.6195756",
"0.61825806",
"0.6151399",
"0.6112911",
"0.60607105",
"0.6042572",
"0.6036708",
"0.60340834",
"0.59884256",
"0.5970175",
"0.5969943",
"0.59228975... | 0.75237316 | 0 |
Animation: smoothly scrolls to the title position. | scrollToTitle() {
let $self = $(`#${this.idDOM}`);
$('html, body').animate({
scrollTop: $self.find('.article-big-category').offset().top
}, 1000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ScrollTitle(title, i, max)\n{\n title.scrollLeft(i);\n //console.log(i);\n if (i < max) {\n gSTATE.TIMER = setTimeout(function(){\n ScrollTitle(title, ++i, max);\n }, 40);\n }\n}",
"function titleAnimation() {\n\t$('#header .title_wrapper .image_timos').animate({righ... | [
"0.73052335",
"0.69537157",
"0.66955274",
"0.6518617",
"0.6449885",
"0.6276763",
"0.62308013",
"0.62225926",
"0.61190534",
"0.60515463",
"0.60515463",
"0.59839684",
"0.59719616",
"0.59597903",
"0.5956294",
"0.5950852",
"0.59463274",
"0.59387815",
"0.59341526",
"0.59300774",
"... | 0.77258563 | 0 |
Shows an error message inside the article text container. | showError(msg) {
showError($(`#${this.idDOM}`).children('.article-big-content'), msg)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function errorText() {\n\t\tclearText();\n\t\tslides.innerHTML = '<li class=\"slide active error\">×</li>';\n\t}",
"showError() {\n showError($('#articles').children('#articles-big-list'), 'Error downloading articles');\n }",
"showError(msg) {\n showError($('#articles-small-list'), msg)\... | [
"0.72349644",
"0.7147822",
"0.7106428",
"0.70439464",
"0.7036943",
"0.7027627",
"0.69741917",
"0.69712836",
"0.6860927",
"0.6848642",
"0.68409556",
"0.68391633",
"0.6784742",
"0.6771989",
"0.67666245",
"0.6754357",
"0.6746478",
"0.6741177",
"0.67348355",
"0.6719761",
"0.67195... | 0.7354857 | 0 |
Creates the button inside the $parent container. | create($parent) {
$(`<button id="${this.idDOM}" class="${this.cssClass}" type="button">${this.active ? this.activeText : this.inactiveText}</button>`)
.appendTo($parent)
.click(() => this.onClick());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateMainButton(Parent) {\n // search the page for already created button\n var btn = $(\"#fm2_\" + MenuName + \"_mobile_button\");\n if (btn.length > 0) {\n btn.attr('href', '#').removeAttr('style');\n MenuButton = btn[0];\n } els... | [
"0.6773521",
"0.67619735",
"0.64944255",
"0.6390816",
"0.63233393",
"0.63211197",
"0.6316916",
"0.62249446",
"0.62128145",
"0.6165054",
"0.61614436",
"0.6149345",
"0.6149102",
"0.6096322",
"0.609088",
"0.60903996",
"0.608725",
"0.6044639",
"0.60423326",
"0.60423326",
"0.60108... | 0.84198904 | 0 |
Adds new comments to the displayed ones. | addContent(comments) {
let $self = $(`#${this.idDOM}`);
let $container = $self.children('.article-big-comments-list');
if(comments.length === 0) return;
this.lastCommentID = comments[comments.length - 1].id;
let commentsObj = comments.map(comment => new Comment(comment, false))... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCommentsToView(comments) {\n for (var i = 0; i < comments.length; i++) {\n var parentCommentID = comments[i].ParentCommentID;\n var target = $(\"#\" + parentCommentID + \">.commentChildren\");\n if (target != null) {\n var html = commentTemplate([comments[i]]); // Com... | [
"0.734022",
"0.6991892",
"0.6917503",
"0.6795106",
"0.6791435",
"0.6776754",
"0.67564684",
"0.67026734",
"0.6701865",
"0.66480625",
"0.66418815",
"0.6639182",
"0.6610762",
"0.66034037",
"0.6575981",
"0.6547661",
"0.65341115",
"0.652773",
"0.6520396",
"0.64748156",
"0.64678985... | 0.7228631 | 1 |
Shows a comment with a specified stylemodifier. | showComment(comment, modifier) {
let $self = $(`#${this.idDOM}`);
let $container = $self.children('.article-big-comments-list');
let commentObj = new Comment(comment, modifier);
commentObj.create($container);
if(this.comments.length === 0) this.lastCommentID = comment['id'];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt(fws), ccontent)),\n opt(fws),\n literal(')')\n )());\n }",
"function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt... | [
"0.53808314",
"0.53808314",
"0.53808314",
"0.53808314",
"0.51270896",
"0.50381035",
"0.49633512",
"0.49474084",
"0.49445602",
"0.491621",
"0.49093032",
"0.48845157",
"0.4883828",
"0.48699555",
"0.48423487",
"0.4826825",
"0.48084974",
"0.47735322",
"0.47661778",
"0.47128907",
... | 0.6048683 | 0 |
Deletes the Comments section by deleting first all the displayed comments. | delete() {
this.comments.forEach(comment => comment.delete());
this.comments = [];
$(`#${this.idDOM}`).remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function deleteComments() {\n await requestCommentDeletion()\n .then(loadComments)\n .then(renderComments);\n}",
"clearComments()\n {\n let diff = this.comments.size - this.config.commentsHistoryLimit;\n\n for (let [id, comment] of this.comments) {\n\n if(diff <= 0) {\n ... | [
"0.6874513",
"0.6595996",
"0.6589873",
"0.652471",
"0.644108",
"0.63916016",
"0.63542956",
"0.63019115",
"0.6285405",
"0.6285134",
"0.62389046",
"0.6205044",
"0.6115881",
"0.6087297",
"0.6062889",
"0.6053698",
"0.602197",
"0.60074824",
"0.59777504",
"0.5945261",
"0.5904087",
... | 0.7270875 | 0 |
Creates a comment inside the $parent container. | create($parent) {
let html =
`<div id="comment-${this.config['id']}" class="comment ${this.modifier ? `comment-${this.modifier}` : ''}">` +
`<div class="comment-header">` +
`<span class="comment-author">${this.config['author']}</span>` +
`<span... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertComment(node, commentContent, parent, user) {\n\n\t// sanitize comment content to get rid of unwanted HTML markup\n\tvar cleanComment = sanitizeHtml(commentContent);\n\n\t// push JSON comment object to our structure in the appropriate location\n\tnode.children.push({ \n\t\tauthor : user, \n\t\tpoint... | [
"0.6913947",
"0.65834963",
"0.65740466",
"0.6566827",
"0.6278737",
"0.62758845",
"0.6207402",
"0.6170244",
"0.6145921",
"0.6136603",
"0.6136603",
"0.6136603",
"0.6136603",
"0.6117133",
"0.6113858",
"0.6113858",
"0.6104692",
"0.6104692",
"0.6102466",
"0.6067155",
"0.60655236",... | 0.821013 | 0 |
Creates the article small inside the $parent container. | create($parent) {
$(`<article id=${this.idDOM} class="article-small">
<div class="article-small-article">
<h6 class="article-small-category">${this.config['category']}</h6>
<h5 class="article-small-title">${this.config['title']}</h5>
<h6 cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"create($parent) {\n let $self = $(`<article id=\"${this.idDOM}\" class=\"article-big\"></article>`).appendTo($parent);\n\n $(`<div class=\"article-big-header\">` +\n `<div class=\"article-big-image\" style=\"background-image: url('/Vuvuzela/img/articles/${this.config['img']}');\"></div>` +... | [
"0.7318472",
"0.5799103",
"0.5782991",
"0.56493264",
"0.5473905",
"0.544909",
"0.5382459",
"0.537991",
"0.5378372",
"0.53269535",
"0.5302213",
"0.5297682",
"0.5292483",
"0.5289134",
"0.5287688",
"0.5277446",
"0.5271563",
"0.52677035",
"0.5250208",
"0.52394664",
"0.5222697",
... | 0.7746448 | 0 |
Creates a tag in the $parent container on the associate config object. | function createTag($parent, config) {
$(`<span id="tag-${config['tag_name']}" class="tag">${config['tag_name']}</span>`)
.appendTo($parent)
.click(() => { articlesBigContainer.loadTag(true, config['tag_name'] )});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static define(parent) {\n if (parent === null || parent === void 0 ? void 0 : parent.base)\n throw new Error(\"Can not derive from a modified tag\");\n let tag = new Tag([], null, []);\n tag.set.push(tag);\n if (parent)\n for (let t of parent.set)\n ... | [
"0.5954471",
"0.56764036",
"0.5632268",
"0.53907275",
"0.53877413",
"0.53864384",
"0.5377894",
"0.5352931",
"0.53301054",
"0.5305578",
"0.52873397",
"0.52671164",
"0.5253855",
"0.52533966",
"0.52533966",
"0.52533966",
"0.5239999",
"0.52114993",
"0.52114993",
"0.5206348",
"0.5... | 0.7352284 | 0 |
Uploads the editor image to the server by calling the editor_info service. | function uploadEditorImg() {
let formData = new FormData(); // FormData() helps to compile a request module.
formData.append('type', 'set');
formData.append('img', $('#editor-img-input')[0].files[0]);
$.ajax({
url: '/Vuvuzela/services/editor/editor_info.php',
type: 'POST',
data: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendFile(file, editor, welEditable) {\n data = new FormData();\n data.append(\"file\", file);\n $.ajax({\n data: data,\n type: \"POST\",\n url: root_url + \"/product/uploadimage\",\n cache: false,\n contentType: false,\n ... | [
"0.62426984",
"0.6066161",
"0.5853876",
"0.575914",
"0.5719991",
"0.5689207",
"0.5676449",
"0.5667957",
"0.5590095",
"0.5561028",
"0.5554014",
"0.55061483",
"0.5505245",
"0.5502277",
"0.5463412",
"0.54626846",
"0.5453974",
"0.5416013",
"0.54080564",
"0.5406338",
"0.53897876",... | 0.68130904 | 0 |
Determine whether the given properties match those of a `CfnAccountAliasProps` | function CfnAccountAliasPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matches(aProperty){\n if(aProperty.name == this.name){\n return true;\n } else {\n for(let i = 0; i < this.aliases.length; i++){\n let myAlias = this.aliases[i];\n if(aProperty.hasAlias(myAlias)){\n return true;\n }... | [
"0.6366935",
"0.6265525",
"0.60207564",
"0.58919275",
"0.5785381",
"0.57584053",
"0.55436677",
"0.5413581",
"0.5410421",
"0.5386508",
"0.5365578",
"0.53424907",
"0.5309008",
"0.52819496",
"0.52781403",
"0.52705944",
"0.52705944",
"0.52705944",
"0.52705944",
"0.52705944",
"0.5... | 0.753175 | 0 |
Renders the AWS CloudFormation properties of an `AWS::SupportApp::AccountAlias` resource | function cfnAccountAliasPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnAccountAliasPropsValidator(properties).assertSuccess();
return {
AccountAlias: cdk.stringToCloudFormation(properties.accountAlias),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get accountAlias() {\n return this.getStringAttribute('account_alias');\n }",
"function aliasResourcePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n AliasResourcePropsValidator(properties).assertSuccess();\n retu... | [
"0.6331086",
"0.5686504",
"0.55010474",
"0.53528607",
"0.53362757",
"0.5274628",
"0.5216138",
"0.5195963",
"0.50552845",
"0.49368533",
"0.48556873",
"0.48478213",
"0.48464182",
"0.47629637",
"0.47489893",
"0.47486296",
"0.47043702",
"0.46767104",
"0.4661705",
"0.4655314",
"0.... | 0.66733724 | 0 |
Determine whether the given properties match those of a `CfnSlackChannelConfigurationProps` | function CfnSlackChannelConfigurationPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but receive... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CfnSlackWorkspaceConfigurationPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object... | [
"0.6583413",
"0.64626324",
"0.6230314",
"0.6166444",
"0.6141151",
"0.5978488",
"0.5967683",
"0.5865793",
"0.5787693",
"0.57682955",
"0.57572085",
"0.57004535",
"0.5634147",
"0.5600606",
"0.55755466",
"0.5551344",
"0.55327445",
"0.55250585",
"0.5517961",
"0.54092884",
"0.53999... | 0.7105852 | 0 |
Renders the AWS CloudFormation properties of an `AWS::SupportApp::SlackChannelConfiguration` resource | function cfnSlackChannelConfigurationPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnSlackChannelConfigurationPropsValidator(properties).assertSuccess();
return {
ChannelId: cdk.stringToCloudFormation(properties.channelId),
ChannelRo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnSlackWorkspaceConfigurationPropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnSlackWorkspaceConfigurationPropsValidator(properties).assertSuccess();\n return {\n TeamId: cdk.stringToCloudFormation(properties.teamId),\n ... | [
"0.5998949",
"0.53566384",
"0.5325092",
"0.53171825",
"0.5144605",
"0.5099329",
"0.50723034",
"0.50240165",
"0.490304",
"0.48874035",
"0.48620668",
"0.48590225",
"0.48305073",
"0.47763386",
"0.47584295",
"0.4737811",
"0.46755326",
"0.46509427",
"0.4641341",
"0.4624143",
"0.46... | 0.65830636 | 0 |
Create a new `AWS::SupportApp::SlackChannelConfiguration`. | constructor(scope, id, props) {
super(scope, id, { type: CfnSlackChannelConfiguration.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_supportapp_CfnSlackChannelConfigurationProps(props);
}
catch (error) {
if (process.env... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnSlackChannelConfigurationPropsFromCloudFormation(resourcePropert... | [
"0.61660266",
"0.59350085",
"0.59119034",
"0.57876396",
"0.5750296",
"0.56979215",
"0.5670647",
"0.56632257",
"0.5573362",
"0.54387987",
"0.5417175",
"0.5350428",
"0.5329671",
"0.53260463",
"0.53105855",
"0.52269024",
"0.52222425",
"0.5152997",
"0.5093755",
"0.5014448",
"0.50... | 0.61238545 | 1 |
Determine whether the given properties match those of a `CfnSlackWorkspaceConfigurationProps` | function CfnSlackWorkspaceConfigurationPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but recei... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CfnSlackChannelConfigurationPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, ... | [
"0.6439574",
"0.6174334",
"0.57564825",
"0.57097715",
"0.5665652",
"0.5640941",
"0.5636547",
"0.56327003",
"0.56157744",
"0.5552452",
"0.5529708",
"0.5490969",
"0.5398379",
"0.5388878",
"0.5323919",
"0.532292",
"0.53054917",
"0.5254179",
"0.5243087",
"0.52301085",
"0.52253085... | 0.71290094 | 0 |
Renders the AWS CloudFormation properties of an `AWS::SupportApp::SlackWorkspaceConfiguration` resource | function cfnSlackWorkspaceConfigurationPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnSlackWorkspaceConfigurationPropsValidator(properties).assertSuccess();
return {
TeamId: cdk.stringToCloudFormation(properties.teamId),
VersionId: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cfnSlackChannelConfigurationPropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnSlackChannelConfigurationPropsValidator(properties).assertSuccess();\n return {\n ChannelId: cdk.stringToCloudFormation(properties.channelId),\n ... | [
"0.5551185",
"0.52877456",
"0.5240278",
"0.50557065",
"0.49617243",
"0.49602482",
"0.4943764",
"0.4916294",
"0.4800156",
"0.475396",
"0.4730696",
"0.46345758",
"0.461461",
"0.46087217",
"0.46053562",
"0.46031648",
"0.4601038",
"0.45779732",
"0.45703843",
"0.4566824",
"0.45632... | 0.6495446 | 0 |
Create a new `AWS::SupportApp::SlackWorkspaceConfiguration`. | constructor(scope, id, props) {
super(scope, id, { type: CfnSlackWorkspaceConfiguration.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_supportapp_CfnSlackWorkspaceConfigurationProps(props);
}
catch (error) {
if (process... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static _fromCloudFormation(scope, id, resourceAttributes, options) {\n resourceAttributes = resourceAttributes || {};\n const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);\n const propsResult = CfnSlackWorkspaceConfigurationPropsFromCloudFormation(resourcePrope... | [
"0.6024763",
"0.54591036",
"0.5438551",
"0.54193467",
"0.5417774",
"0.5403108",
"0.5402783",
"0.5331141",
"0.5314941",
"0.5194451",
"0.5072858",
"0.5060499",
"0.5006706",
"0.48842463",
"0.488403",
"0.4831745",
"0.47973543",
"0.47848094",
"0.47841167",
"0.4777689",
"0.47237527... | 0.56021506 | 1 |
| recalculation func to recalc every forumals | function Recalculate()
{
for (var i = 1; i <= _rows; i++)
{
for (var j = 1; j <= _columns; j++)
{
// checks if the _tblArray has "=sum" if yes than invokes the calculatecell func
if (_tblArray[i][j].toUpperCase().includes("=SUM"))
CalculateCell(i, j); ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculationLoop() {\n\n function updateTime() {\n updateTimeInToolbar();\n setTimeout(updateTime, 1000);\n }\n setTimeout(updateTime, 1000);\n \t\t\n\t\tfunction calc() {\n\t\t\tcalculate(false);\n\t\t\tsetTimeout(calc, AGSETTINGS.getRefreshTimerInterval()... | [
"0.64977276",
"0.6439327",
"0.6304298",
"0.625796",
"0.61104095",
"0.60782737",
"0.60597044",
"0.5988653",
"0.5977938",
"0.5974169",
"0.594533",
"0.59356284",
"0.5909223",
"0.58576894",
"0.58314645",
"0.58230066",
"0.57783866",
"0.57080597",
"0.5692849",
"0.5681762",
"0.56795... | 0.6506171 | 0 |
| clickCell function gets the id when a user clicks on a cell | function ClickCell(ref)
{
_rcArray = ref.id.split('_');
_currentCell = ref.id;
ref.style.borderColor = "#000";
document.getElementById("txtFilter").value = _tblArray[_rcArray[0]][_rcArray[1]];
document.getElementById("span").innerHTML = "Current Cell: " + String.fromCharCode(64 + parseInt(_rcArray[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleHTMLCellClick(e) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget\n let idArray = e.currentTarget.id.split(\"-\");\n let row = Number(idArray[1]);\n let col = Number(idArray[2]);\n\n chess.handleCellSelected(row, col);\n}",
"function cellClicked(event){\n ... | [
"0.78258073",
"0.72804475",
"0.7144686",
"0.7088423",
"0.70578444",
"0.6937026",
"0.6931278",
"0.6929908",
"0.6910096",
"0.6835192",
"0.6814507",
"0.6758028",
"0.67522794",
"0.6742204",
"0.673023",
"0.67231685",
"0.66849434",
"0.66650957",
"0.6653339",
"0.66454357",
"0.662757... | 0.7541031 | 1 |
on button click add initial expense to total | function addExpenseToTotal()
{
const expenseItem = {};
//read value from input
const textAmount = inputElement.value;
//read the desc from inputDesc
const textDesc = inputDescE1.value;
//convert it to no
const expense = parseInt(textAmount , 10 );
//put it in object
if (textD... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateExpense(amount) {\n currentExpense = currentExpense - amount;\n expense.innerHTML = `-$ ${currentExpense}`;\n}",
"function addTotalExpenses() {\n var arrayOfNumbers = totalExpenses.map(Number);\n var sumOfNumbers = arrayOfNumbers.reduce((a, b) => a + b, 0);\n totalSum = sumOfNumbers... | [
"0.72244877",
"0.71313167",
"0.7041141",
"0.7018785",
"0.70166314",
"0.69741195",
"0.6931574",
"0.68995166",
"0.68930036",
"0.68726665",
"0.6854527",
"0.68399894",
"0.67915076",
"0.6778423",
"0.6764794",
"0.67509466",
"0.6727215",
"0.67083144",
"0.67047715",
"0.6680565",
"0.6... | 0.7225538 | 0 |
for displaying Paid? Yes or No in table | function formatPaid(paid) {
if (paid === 1) {
return "Yes";
}
return "No";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function yesKurt() { // Yes Button for Kurt is displayed in the check dialogue \n document.getElementById(\"yes_kurt\").style.display = \"block\"; \n document.getElementById(\"yes_luke\").style.display = \"none\";\n document.getElementById(\"yes_emma\").style.display = \"none\";\n}",
"function getViewBo... | [
"0.58607614",
"0.5758521",
"0.5663127",
"0.564498",
"0.5630693",
"0.5562463",
"0.55378324",
"0.54064626",
"0.5385886",
"0.5332594",
"0.5284528",
"0.5281072",
"0.52803534",
"0.5272318",
"0.5272161",
"0.5255562",
"0.5240653",
"0.5238813",
"0.5210026",
"0.52075547",
"0.52025294"... | 0.66696894 | 0 |
convert input date from DatePicker DD/MM/YYYY into database suitable date | function datePickerDateConverter(date){
dateF = date.trim();
let d = dateF.substring(0, 2);
let m = dateF.substring(3,5);
let y = dateF.substring(6,10);
return(y +"-"+m+"-"+d);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeFieldDateToJavascriptDate(dateValue) {\n return jq.datepicker.formatDate('mm/dd/yy', jq.datepicker.parseDate('yy-mm-dd', dateValue));\n}",
"dateConverter(tempdate) {\n var converted = parseInt((tempdate.replace(\"/Date(\", \"\").replace(\")/\", \"\")));\n var temp = new Date(conve... | [
"0.68923974",
"0.6645411",
"0.66160935",
"0.65704155",
"0.6467164",
"0.63670367",
"0.6360883",
"0.634354",
"0.62894076",
"0.6284301",
"0.62507915",
"0.62329453",
"0.62033993",
"0.6197378",
"0.6186952",
"0.6152527",
"0.61306804",
"0.6088718",
"0.60601234",
"0.6058008",
"0.6051... | 0.7155007 | 0 |
convert british format to ISOformat | function convertBritishToISO(date) {
dateF = date.trim();
let d = dateF.substring(0, 2);
let m = dateF.substring(3,5);
let y = dateF.substring(6,10);
return(y +"/"+m+"/"+d);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ISO_2022() {}",
"function ISO_2022() {}",
"function datetoisostring() { // @return String:\r\n return uudate(this).ISO();\r\n}",
"toISOString() {\n return this.toIsoString();\n }",
"function formatDateToISODateString(input) {\n var output;\n if (input) {\... | [
"0.6847949",
"0.6847949",
"0.64038664",
"0.60329413",
"0.5963499",
"0.5958293",
"0.58523804",
"0.58279246",
"0.58279246",
"0.58279246",
"0.58279246",
"0.5817074",
"0.57984716",
"0.5733562",
"0.5642627",
"0.56384104",
"0.56364167",
"0.56364167",
"0.56364167",
"0.56364167",
"0.... | 0.7316147 | 0 |
Creates and returns a unique new member object for the population | function createNewPopulationMember(curPopulation){
var isUnique = true;
switch(getRandomInt(0,1)){
case 0:
var newMember = { width: getRandomInt(MIN,MAX),
height: getRandomInt(MIN, MAX),
length: getRandom... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MemberFactory (){\n this.createMember = function(name, type){\n let member;\n\n // create object with type\n if (type === 'simple'){\n member = new SimpleMembership(name);\n } else if(type === 'standard'){\n member = new StandardMembership(name);\n ... | [
"0.69339764",
"0.690696",
"0.6900639",
"0.68067497",
"0.6772398",
"0.6770871",
"0.6711647",
"0.6673858",
"0.64678264",
"0.63925046",
"0.6319201",
"0.62291074",
"0.6162488",
"0.6159758",
"0.61432236",
"0.6141411",
"0.6130947",
"0.6096297",
"0.59812003",
"0.59765846",
"0.596981... | 0.750446 | 0 |
Get page url from iteration number. | function getPageURL(i, resource) {
var drupal_base_path = Drupal.settings.basePath;
var DKAN_API = drupal_base_path + 'api/action/datastore/search.json';
var url = window.location.origin + DKAN_API + '?resource_id=' + resource.resource_id;
var offset = i * pageSize;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNextPage(song){\n var url = '';\n //Global var nextPageCount - increments when user gets to next page\n for (var i = 0; i < listOfSongs.length; i++){\n console.log('Inside of getNextPage: ' + song);\n if(listOfSongs[i].answers.includes(song)){\n if(i !== listOfSongs.length - 1){\n ... | [
"0.6206482",
"0.6145067",
"0.60882306",
"0.595826",
"0.5837988",
"0.57936543",
"0.57555854",
"0.57498044",
"0.5731873",
"0.5681631",
"0.5674951",
"0.56606096",
"0.5617618",
"0.560674",
"0.55936974",
"0.5524227",
"0.55195266",
"0.55096495",
"0.5500198",
"0.54816264",
"0.547639... | 0.61942774 | 1 |
Renders progress request info. | function showProgressInfo(){
if (currReq === 0) {
progressInfo.show();
}
currReq++;
if (currReq === numReq) {
progressInfo.hide();
}
progressInfo.html('Downloading ' + currReq + ' of ' + numReq );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function emitProgressInfo() {\n if (!isEnded) {\n var realElapsedTime = new time.Date() - realFromDate;\n eventEmitter.emit(\n 'progress-info',\n {\n updatesProcessed: updatesProcessed,\n updatesRequested: updatesRequested,\n delayedUpdateRequests: delayedUpdateRequests,\n ... | [
"0.6687592",
"0.6529963",
"0.636051",
"0.6358563",
"0.6219749",
"0.6126445",
"0.60365456",
"0.60365456",
"0.6033526",
"0.6027891",
"0.6027891",
"0.5985312",
"0.59835345",
"0.5908933",
"0.5856668",
"0.58543795",
"0.5826748",
"0.5817053",
"0.58114785",
"0.58114785",
"0.5810374"... | 0.7351274 | 0 |
set playing class for all active test blocks | function setDisplay() {
var oldItems = document.querySelectorAll(`.${display[currentSong - 1]}`);
console.log(oldItems);
for (var i = 0; i < oldItems.length; i++) {
oldItems[i].classList.remove("playing");
}
var items = document.querySelectorAll(`.${display[currentSong]}`);
console.log(it... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reveal_play_children() {\n reveal_by_class(\"play\", \"block\");\n}",
"beforePlay () {\n document.getElementById(\"customize\").classList.add(\"dontShow\");\n let aux = Array();\n aux.push( batman );\n aux.push( joker );\n aux.push( dolarJoker );\n aux.push( ... | [
"0.62331235",
"0.6108427",
"0.60291064",
"0.5986525",
"0.58125544",
"0.5702177",
"0.56955147",
"0.56818664",
"0.56548166",
"0.5648682",
"0.56081295",
"0.55124277",
"0.5502636",
"0.54979503",
"0.5490649",
"0.5487381",
"0.5485351",
"0.5479844",
"0.545633",
"0.5451257",
"0.54041... | 0.6204676 | 1 |
update text for song now playing | function displaySong() {
let content = `${songs[currentSong].decade}'s: ${
songs[currentSong].song
} // ${songs[currentSong].artist}`;
nowPlayingText.innerHTML = content;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateNowPlaying() {\n\n nowPlaying.innerHTML = media[currentVideo].description;\n }",
"function updateNowPlaying(){\n\tvar parsedInfo = parseInfo($(\"title\").text());\n\tartist = parsedInfo['artist']; \t\t//global\n\ttrack = parsedInfo['track'];\t\t\t//global\n\tduration = parsedInfo['d... | [
"0.7641736",
"0.7016679",
"0.69758624",
"0.68993217",
"0.68247914",
"0.6806356",
"0.67887664",
"0.6783498",
"0.6749545",
"0.6738962",
"0.6732792",
"0.67268884",
"0.6685901",
"0.66535336",
"0.6622848",
"0.65974253",
"0.6575814",
"0.65619093",
"0.6544354",
"0.6505437",
"0.64843... | 0.7367614 | 1 |
fn open file upload popup | function openUploadFile() {
$('#profile-file').click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"openUploadImageWindow(){\n // click on inputFileElement in application template (browse window can only be called from application template)\n document.getElementById('inputFileElement').click();\n }",
"function openUploader() {\n\t$(\"#diaUpload\").dialog(\"open\");\n}",
"function triggerFileUplo... | [
"0.80698735",
"0.7533723",
"0.7447962",
"0.74202603",
"0.74021494",
"0.73891366",
"0.72996217",
"0.72753626",
"0.72537076",
"0.7197272",
"0.7196609",
"0.7175778",
"0.71530616",
"0.7097212",
"0.7076877",
"0.7066942",
"0.7011259",
"0.69989645",
"0.6962508",
"0.69065255",
"0.689... | 0.7882228 | 1 |
Destroys the barcode finder. | destroy() {
this._pipeline._onFrameUpdateInternal.unbind(this._frameUpdate);
this._found = [];
this._lastDetected = [];
this._z.barcode_finder_destroy(this._impl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy () {\n\t\tthis.disposables.dispose()\n\t\tthis.classRanges.clear()\n\t\tthis.methodRanges.clear()\n\t\tthis.classMapping.clear()\n\t\tthis.methodMapping.clear()\n\t}",
"function destroy(){\n\t\t// TODO\n\t}",
"destroy() {\n super.destroy();\n this.destroyDependentModules();\n if (!... | [
"0.65607166",
"0.63187474",
"0.63162136",
"0.62681997",
"0.6248488",
"0.62477076",
"0.6215059",
"0.6171116",
"0.6166762",
"0.6093352",
"0.6079086",
"0.6076555",
"0.60743827",
"0.60220504",
"0.6011218",
"0.6011218",
"0.6002318",
"0.5998293",
"0.59906614",
"0.59881985",
"0.5978... | 0.766442 | 0 |
Gets/sets the enabled state of the barcode finder. Disable when not in use to save computational resources during frame processing. | get enabled() {
return this._z.barcode_finder_enabled(this._impl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get enabled() { return this._enabled; }",
"get enabled() { return this._enabled; }",
"get enabled() { return this._enabled; }",
"get enabled() { return this._enabled; }",
"get enabled() { return this._enabled; }",
"get enabled() { return this._enabled; }",
"get enabled() { return this._enabled; }",
"... | [
"0.6492244",
"0.6492244",
"0.6492244",
"0.6492244",
"0.6492244",
"0.6492244",
"0.6492244",
"0.6453501",
"0.6453501",
"0.6383593",
"0.6383593",
"0.6383593",
"0.6383593",
"0.6313116",
"0.6313116",
"0.6313116",
"0.6313116",
"0.627258",
"0.62518066",
"0.62515086",
"0.6250353",
... | 0.7882514 | 0 |
Gets/sets the barcode formats to scan for. | get formats() {
return this._formats;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getFormats(props) {\n const { blockConfig = {} } = props\n if (typeof blockConfig.registerFormats === 'function') {\n return blockConfig.registerFormats(Quill)\n }\n\n // FYI: undefined or null will enable all formats by default\n return blockConfig.formats\n }",
"function getFormat() {\n ... | [
"0.5572673",
"0.54952735",
"0.54801077",
"0.5443631",
"0.53583276",
"0.5046547",
"0.49822664",
"0.47393042",
"0.47151974",
"0.47011402",
"0.46967354",
"0.46696928",
"0.46587938",
"0.46474877",
"0.46174455",
"0.45335275",
"0.44696137",
"0.4449533",
"0.44389486",
"0.44267726",
... | 0.61818504 | 0 |
prototype error so we can have custom msg | function myError(msg) {
this.msg = msg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CustomError() {}",
"function CustomError(type,message){\n\t\t\tthis.type=type;\n\t\t\tthis.message=message;\n\t\t}",
"constructor(message, errorCode) { \n super(message); // Super to call Error, then add a \"message\" property\n this.code = errorCode; // Adds a \"code\" property\n }",
"funct... | [
"0.7726716",
"0.71443987",
"0.7040324",
"0.6977693",
"0.69090354",
"0.6866186",
"0.6845382",
"0.68146354",
"0.68046004",
"0.68046004",
"0.67741024",
"0.67727315",
"0.67601055",
"0.6747344",
"0.6730382",
"0.67060345",
"0.6692394",
"0.66106117",
"0.6605016",
"0.6604375",
"0.659... | 0.7293567 | 1 |
retun a promise that fulfills with "Hello world!" | async function helloWorld(){
console.log("Were going to say something, but you have to wait 1.5 seconds")
await wait(1500);
return(
console.log("Hello world!"),
console.log("Congrats on waiting for the promise to fulfill, that took 1.5 seconds")
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function greet() {\n return 'HELLO!!!'\n}",
"async function helloAgain() {\n return await Promise.resolve(\"Oh Hello\");\n}",
"function myFn() {\n return Promise.resolve(\"Hello\");\n}",
"function greet(name) {\r\n return new Promise(function(resolve, reject) {\r\n setTimeout(function(... | [
"0.6930061",
"0.6713555",
"0.63781387",
"0.6314025",
"0.62961334",
"0.61697274",
"0.60500467",
"0.60273206",
"0.6011923",
"0.5928317",
"0.58739394",
"0.5851559",
"0.5839508",
"0.5837262",
"0.58234984",
"0.58109623",
"0.58096325",
"0.5804216",
"0.5788824",
"0.57871807",
"0.575... | 0.6971719 | 0 |
Starts when mouse is down on the window's toolbar. Changes the zindex and opacity for the window. Starts the Moveclass and sends with the object win and the event. | function initMove(event) {
Move.init(current.win, event);
current.win.style.zIndex = Math.floor(new Date().getTime()/1000);
current.win.style.opacity = 0.8;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"StartMouseover() {\n window.addEventListener(\"mousemove\", this.MouseoverMove);\n }",
"function win(options) {\n // close\n this.close=function() {\n if(this.onclose)\n this.onclose();\n\n this.win.parentNode.removeChild(this.win);\n delete windows[this.id];\n }\n\n // set_title\n this.se... | [
"0.6251411",
"0.5951073",
"0.57679445",
"0.57433003",
"0.5739999",
"0.5716833",
"0.5703658",
"0.5691866",
"0.5688951",
"0.56836987",
"0.565585",
"0.56497747",
"0.5640413",
"0.56384665",
"0.563436",
"0.55955946",
"0.5582555",
"0.55726284",
"0.55681545",
"0.55625665",
"0.555318... | 0.6248655 | 1 |
This function will check if the endpoint is in the list of endpoints to cache | static isEndpointInRoutesToCache(endpoint) {
return this.routesToCache.find((route) => endpoint.includes(route.path));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isCached(provider, endpoint, params) {\n\t const uri = mergeQuery(endpoint, params);\n\t return (this._cache[provider] !== void 0 &&\n\t this._cache[provider][uri] !== void 0);\n\t }",
"inCache(url) {\n if ((Date.now() - this.cache[this.hashValue(url)]) > (this.cacheTimeout... | [
"0.71133506",
"0.6171534",
"0.60473806",
"0.6019866",
"0.5979651",
"0.5979651",
"0.5959791",
"0.59453285",
"0.593293",
"0.58827233",
"0.58271617",
"0.5731677",
"0.57139605",
"0.5708622",
"0.5671639",
"0.56626225",
"0.5648899",
"0.5628985",
"0.56269705",
"0.5616725",
"0.560602... | 0.83687943 | 0 |
getKey(key) Gets keycode. If 'x' is pressed then it hides the lightbox. | function getKey(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
keycode = e.which;
}
key = String.fromCharCode(keycode).toLowerCase();
if(key == 'x'){
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getKey(e){\n if (e == null) { // ie\n keycode = event.keyCode;\n } else { // mozilla\n keycode = e.which;\n }\n key = String.fromCharCode(keycode).toLowerCase();\n\n if(key == 'x'){ hideContentModal(); }\n}",
"function easyPlay (key) {\n $numberDisplay.removeClass('hidden... | [
"0.75403273",
"0.61646426",
"0.6079204",
"0.6020887",
"0.5906374",
"0.58500654",
"0.5826522",
"0.58073545",
"0.57982075",
"0.57968974",
"0.57950103",
"0.5753394",
"0.5736748",
"0.5728019",
"0.56995934",
"0.5618726",
"0.5618342",
"0.56072295",
"0.5570712",
"0.55251366",
"0.549... | 0.6541192 | 1 |
current label based on toggled state | get currentLabel() {
return this._regOrToggled(this.label, this.toggledLabel, this.isToggled);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get currentLabel() {\n return this._regOrToggled(this.label, this.toggledLabel, this.isToggled);\n }",
"_computeToggleActionLabel(opened) {\n return opened ? 'Hide' : 'Show';\n }",
"function getCurrentLabel () {\n return status.currentLabel;\n }",
"function toggleLabel() {\n var ... | [
"0.8247309",
"0.7288507",
"0.70766646",
"0.66833663",
"0.6681303",
"0.6667062",
"0.6464164",
"0.6421014",
"0.6419915",
"0.6391361",
"0.632493",
"0.63245195",
"0.6324361",
"0.6321431",
"0.6312354",
"0.6273637",
"0.62652266",
"0.620204",
"0.617648",
"0.61683315",
"0.61422247",
... | 0.8202626 | 1 |
current icon based on toggled state | get currentIcon() {
return this._regOrToggled(this.icon, this.toggledIcon, this.isToggled);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get currentIcon() {\n return this._regOrToggled(this.icon, this.toggledIcon, this.isToggled);\n }",
"__toggleIcon(state) { \n switch (state) {\n case 1:\n return 'notification:sync';\n case 2:\n return 'notification:sync-problem';\n default:\n return 'notification:... | [
"0.8240965",
"0.7560184",
"0.7376298",
"0.71749264",
"0.71123385",
"0.6905213",
"0.68246794",
"0.67909443",
"0.67709047",
"0.67449003",
"0.67332274",
"0.6693706",
"0.6677334",
"0.66626",
"0.66620284",
"0.65847176",
"0.65688634",
"0.6519872",
"0.6500821",
"0.64824486",
"0.6464... | 0.8205611 | 1 |
gets valid commands list | get validCommands() {
return ["backColor", "bold", "createLink", "copy", "cut", "defaultParagraphSeparator", "delete", "fontName", "fontSize", "foreColor", "formatBlock", "forwardDelete", "insertHorizontalRule", "insertHTML", "insertImage", "insertLineBreak", "insertOrderedList", "insertParagraph", "insertText"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get validCommands() {\n return [\n \"backColor\",\n \"bold\",\n \"createLink\",\n \"copy\",\n \"cut\",\n \"defaultParagraphSeparator\",\n \"delete\",\n \"fontName\",\n \"fontSize\",\n \"foreColor\",\n \"formatBlock\",\n \"forw... | [
"0.7467263",
"0.6815179",
"0.6732698",
"0.6681245",
"0.6653708",
"0.6556789",
"0.65420216",
"0.6531044",
"0.6520324",
"0.6388242",
"0.633185",
"0.62944186",
"0.62746114",
"0.62483776",
"0.6231258",
"0.6158457",
"0.61540353",
"0.61205083",
"0.60883987",
"0.6047907",
"0.6046201... | 0.7415203 | 1 |
executes button command on current range | execCommand() {
if (this.range) {
document.execCommand(this.operationCommand, false, this.operationCommandVal);
this.dispatchEvent(new CustomEvent(this.operationCommand + "-button", {
bubbles: true,
cancelable: true,
composed: true,
detail: thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onButtonClick(rangeInputElmt, listener) {\n rangeInputElmt.addEventListener(\"click\", function (evt) {\n listener(evt.target.value);\n });\n }",
"get codeButton() {\n return {\n command: \"wrapRange\",\n commandVal: \"CODE\",\n toggl... | [
"0.62836105",
"0.6141922",
"0.5954352",
"0.5922745",
"0.58525246",
"0.5848682",
"0.5843637",
"0.58337414",
"0.5792807",
"0.57813156",
"0.57615227",
"0.5745094",
"0.571676",
"0.57106596",
"0.57106596",
"0.56748086",
"0.5667917",
"0.5646191",
"0.5623087",
"0.56038696",
"0.55974... | 0.6762215 | 0 |
expands range to selection's parent block | setRange() {
/* if command is formatBlock expand selection to entire block */
let block = this._getSelectedBlock();
if (block) this.__selection.selectNode(block);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setRange() {\n /* if command is formatBlock expand selection to entire block */\n let block = this.rangeQuery();\n if (block) this.selectNode(block);\n }",
"function expandRangeToSurround(range) {\n if (range.canSurroundContents()) return;\n\n var common = range.commonAncestorContaine... | [
"0.6940698",
"0.61333007",
"0.61333007",
"0.61026067",
"0.6098727",
"0.60579515",
"0.6025126",
"0.598634",
"0.5954181",
"0.5954181",
"0.5937532",
"0.5828854",
"0.5817198",
"0.5809419",
"0.5809419",
"0.5809419",
"0.5809419",
"0.5809419",
"0.5809419",
"0.5809419",
"0.57689166",... | 0.66488105 | 1 |
fires when command value changes | _commandValChanged() {
this.dispatchEvent(new CustomEvent("command-val-changed", {
bubbles: true,
cancelable: true,
composed: true,
detail: this
}));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_commandsChanged(newValue){this.addCommands(newValue)}",
"_toggledCommandValChanged() {\n this.dispatchEvent(new CustomEvent(\"toggled-command-val-changed\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this\n }));\n }",
"change() {\n... | [
"0.7658241",
"0.7457193",
"0.6889445",
"0.6403537",
"0.6383594",
"0.6271003",
"0.6270365",
"0.62450343",
"0.62305355",
"0.6221724",
"0.6208452",
"0.6207019",
"0.6191725",
"0.6187614",
"0.6187614",
"0.6170782",
"0.6137493",
"0.60789853",
"0.60758936",
"0.60753644",
"0.6073297"... | 0.8242131 | 0 |
fires when toggled command value changes | _toggledCommandValChanged() {
this.dispatchEvent(new CustomEvent("toggled-command-val-changed", {
bubbles: true,
cancelable: true,
composed: true,
detail: this
}));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onToggle() {}",
"onToggle() {\r\n this.toggle = !this.toggle;\r\n }",
"toggle(){this.off=!this.off}",
"onToggleClick() {\n if (this.disabled) {\n return;\n }\n const newChecked = this.isSingleSelector ? true : !this._checked;\n if (newChecked !== this._checked... | [
"0.72722113",
"0.720198",
"0.6820743",
"0.6740271",
"0.67241025",
"0.66730094",
"0.65426105",
"0.648766",
"0.6481172",
"0.64304924",
"0.6426489",
"0.6396943",
"0.63391674",
"0.6338547",
"0.62927085",
"0.628433",
"0.62610984",
"0.6246581",
"0.6225954",
"0.6188175",
"0.61721784... | 0.7685232 | 0 |
recording block is used to display the extra 4 samples | function RecordingBlock(x, y, w, h, id) {
this.x = x;
this.y = y;
this.width = w;
this.height = h;
this.id = id;
this.on = false;
this.fillColour = '#C8C8C8';
this.display = function() {
fill(this.fillColour);
stroke(0);
rect(x, y, w, h);
noStroke();
fill(0);
text("" + this.i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"play(numsamples) {\n this.write(numsamples);\n }",
"function loopRecordedSample(name) {\n }",
"function RecordingStudio(x, y, w, h) {\n\n this.x = x;\n this.y = y;\n this.width = w;\n this.height = h;\n\n this.display = function() {\n fill(255);\n rect(this.x, this.y, this.width, th... | [
"0.6498074",
"0.64834684",
"0.6332778",
"0.6290578",
"0.6242053",
"0.6059518",
"0.6029884",
"0.60010076",
"0.5976581",
"0.59532636",
"0.5911126",
"0.58880514",
"0.5877709",
"0.5816905",
"0.57874507",
"0.578379",
"0.5773736",
"0.57627165",
"0.5758681",
"0.5726036",
"0.57218564... | 0.64974713 | 1 |
Renders Modal to create a new podcast (using Bulma) | render() {
return (
<div className="createBtnDiv">
<button onClick={this.toggle}>Create Podcast</button>
<div className={this.props.active}>
<div className="modal-background"></div>
<div className="modal-card">
<header className="modal-card-head">
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"newBlog(){\n\t fetch(`${this.url}Controllermodal/newblogmodal`)\n\t .then(dataModal=>{\n\t dataModal.json().then(modal=>{\n\t document.getElementById('parentmodalInsertBlog').style.display=\"block\";\n\t document.getElementById(\"modalNewBlog\").innerHTML=modal;\n\t })\n\t })\n\t}",... | [
"0.63188",
"0.6225229",
"0.61014766",
"0.593382",
"0.5878182",
"0.5803111",
"0.57694143",
"0.5758273",
"0.5754604",
"0.5739191",
"0.5715211",
"0.57060766",
"0.5704383",
"0.5696349",
"0.5693423",
"0.5670662",
"0.5647648",
"0.5638893",
"0.56249374",
"0.55821246",
"0.5574869",
... | 0.657582 | 0 |
This adds magic item spells to a world, | async updateWorldItems() {
const itemSpells = await this.updateFolderItems("itemSpells");
// scan the inventory for each item with spells and copy the imported data over
this.result.inventory.forEach((item) => {
if (item.flags.magicitems.spells) {
for (let [i, spell] of Object.entries(item.fla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToWorld(){ \n fillnameToSpell();\n //add 5 numbers \n var i=0;\n while (i < 7){\n var thisNumber = Math.floor(Math.random() * 10); \n if ( objectsInWorld.includes(numBody[thisNumber])) {i--;\n }else {\n objectsInWorld.push(numBody[thisNumber]);\... | [
"0.6150099",
"0.5802835",
"0.56375194",
"0.5556645",
"0.55331165",
"0.5497877",
"0.54139787",
"0.5406691",
"0.53792053",
"0.5363586",
"0.53600615",
"0.53529304",
"0.534524",
"0.5304297",
"0.52784026",
"0.5274047",
"0.5258064",
"0.5230966",
"0.5218941",
"0.52084833",
"0.519463... | 0.70794785 | 0 |
Returns the enabledForDomain checkbox element. | function getEnabledForDomainCheckbox() {
return document.getElementById('enabledForDomain');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get suggestionsEnabled() {\n var checkbox = this.getElement({type: \"suggest\"});\n\n return checkbox.getNode().checked;\n }",
"isEnabled() {\n return this._node.__execute(() => this.element.isEnabled());\n }",
"getIsEnabled() {\n return this.isEnabled();\n }",
"function sample2_3_... | [
"0.586666",
"0.5813764",
"0.53979826",
"0.5215743",
"0.51831985",
"0.51579183",
"0.51579183",
"0.51579183",
"0.51579183",
"0.5151931",
"0.5151931",
"0.5137866",
"0.5137866",
"0.5105134",
"0.5090039",
"0.5050083",
"0.5045302",
"0.5045302",
"0.50293386",
"0.50225896",
"0.501845... | 0.8325723 | 0 |
Returns the status div element. | function getStatusDiv() {
return document.getElementById('status');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"statusDivHtml(status) {\n 'use strict';\n\n return `<div class=\"${$.otp.workflows.statusToClassName(status)}\"></div>`;\n }",
"parsedStatus(){\n const { context } = this.props;\n if (!context || !context.status) return <div/>;\n\n return (\n <div className=\"indicator-item... | [
"0.7835275",
"0.69145465",
"0.69055194",
"0.6831069",
"0.67207754",
"0.6591547",
"0.65869755",
"0.6494059",
"0.6439689",
"0.64307314",
"0.63917226",
"0.63540864",
"0.63485056",
"0.63103914",
"0.6304352",
"0.6278389",
"0.62403965",
"0.6234629",
"0.6224598",
"0.62049085",
"0.61... | 0.8199442 | 0 |
Update the checkbox value with the given domain, by loading the settings and determining if the domain is blacklisted or not. | function updatePageWithDomain(domain) {
Settings.loadFromStorage(function(settings) {
var isCurrentDomainBlacklisted = false;
for (var i = 0; i < settings.blacklistedDomains.length; ++i) {
var blacklistedDomain = settings.blacklistedDomains[i];
if (blacklistedDomain == domain... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleEnabledForDomain(domain) {\n Settings.loadFromStorage(function(settings) {\n var isCurrentDomainBlacklisted = getEnabledForDomainCheckbox().checked;\n\n if (isCurrentDomainBlacklisted) {\n var index = settings.blacklistedDomains.indexOf(domain);\n settings.blac... | [
"0.77973086",
"0.69820595",
"0.68346",
"0.6375624",
"0.6339828",
"0.6157685",
"0.6106988",
"0.6100407",
"0.59991634",
"0.596387",
"0.5829974",
"0.5829974",
"0.58104324",
"0.5714923",
"0.5693849",
"0.5692808",
"0.5644546",
"0.5636051",
"0.5621653",
"0.5571457",
"0.5557431",
... | 0.8187831 | 0 |
Toggle the domain's blacklist status, by either adding or removing the domain from the blacklist. | function toggleEnabledForDomain(domain) {
Settings.loadFromStorage(function(settings) {
var isCurrentDomainBlacklisted = getEnabledForDomainCheckbox().checked;
if (isCurrentDomainBlacklisted) {
var index = settings.blacklistedDomains.indexOf(domain);
settings.blacklistedDoma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleBlacklistDomains()\r\n{\r\n var objBlacklistDomains = document.getElementById(\"ext-etheraddresslookup-blacklist_domains\");\r\n var intBlacklistDomains = objBlacklistDomains.checked ? 1 : 0;\r\n localStorage.setItem(\"ext-etheraddresslookup-blacklist_domains\", intBlacklistDomains);\r\n\r\... | [
"0.72802216",
"0.6768306",
"0.6611304",
"0.62934655",
"0.6202561",
"0.6112639",
"0.6085196",
"0.6010724",
"0.58882964",
"0.5865929",
"0.58109033",
"0.577272",
"0.564579",
"0.56250745",
"0.5576849",
"0.5561555",
"0.5490185",
"0.5358544",
"0.5342904",
"0.5307378",
"0.526942",
... | 0.7555479 | 0 |
Toggle the blacklisted status of the active tab's domain. | function toggleEnabledForCurrentDomain() {
var isCurrentDomainBlacklisted = !getEnabledForDomainCheckbox().checked;
chrome.tabs.query({
'active': true,
'currentWindow': true
}, function (tabs) {
var tab = tabs[0];
var domain = domainFromURL(tab.url);
toggleEnabledFor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleEnabledForDomain(domain) {\n Settings.loadFromStorage(function(settings) {\n var isCurrentDomainBlacklisted = getEnabledForDomainCheckbox().checked;\n\n if (isCurrentDomainBlacklisted) {\n var index = settings.blacklistedDomains.indexOf(domain);\n settings.blac... | [
"0.7169355",
"0.67895365",
"0.64333785",
"0.62019366",
"0.61991364",
"0.60605955",
"0.5931315",
"0.5826456",
"0.5703769",
"0.5666476",
"0.56592983",
"0.55980104",
"0.54956895",
"0.5488562",
"0.5466174",
"0.5450224",
"0.54316247",
"0.5403722",
"0.53960496",
"0.53533494",
"0.53... | 0.7751154 | 0 |
The "getNodeType()" method for a Comment Node returns the constant value 8. Retrieve the nodes from the document and check for a comment node and invoke the "getNodeType()" method. This should return 8. | function hc_nodecommentnodetype() {
var success;
var doc;
var testList;
var commentNode;
var commentNodeName;
var nodeType;
doc = load("hc_staff");
testList = doc.childNodes;
for(var indexN65600 = 0;indexN65600 < testList.length; indexN65600++) {
commentNode = tes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function comment__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 8);\n}",
"function document__TYPE__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\n return (nodeType === 10);\n}",
"function document__NODE_ques_(nodeType) /* (nodeType : nodeType) -> bool */ {\... | [
"0.6614938",
"0.55756855",
"0.54625493",
"0.542769",
"0.5407115",
"0.539758",
"0.53679496",
"0.5347982",
"0.5347982",
"0.53098375",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.52992886",
"0.5... | 0.78339446 | 0 |
Basicly GetRandomImage is a function that use the above function that I expliend above. They are supused to read the dir (where the images) and list them and finaly return a Random image path. | function GetRandomImage() {
var files = imgAccess.GetImage();
var filePath = util.ExtractFilePath(files);
return (filePath);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomimage(){\n var image_array = [\n '/homepage_images/img1.png',\n '/homepage_images/img2.png',\n '/homepage_images/img3.png',\n '/homepage_images/img4.png',\n '/homepage_images/img5.png',\n '/homepage_images/img6.png',\n '/homepage_images/img7.png',\n '/homepage_images/img8.pn... | [
"0.7465664",
"0.7190371",
"0.70990705",
"0.70828325",
"0.7061574",
"0.69507605",
"0.6927887",
"0.68971425",
"0.68125206",
"0.6737781",
"0.67329586",
"0.67107",
"0.6704824",
"0.6649116",
"0.66464704",
"0.662116",
"0.6592229",
"0.65718704",
"0.6543779",
"0.65410715",
"0.6512436... | 0.8236472 | 0 |
| | Materialize Sass | | | This task will handle all preprocessing of the MDL sass. | We also allow the user to include a variables file so | that he's able to override the default MDL styles. | function materializeSass() {
new _CssTask2.default('sass', getPaths(constructImportsFile(), _laravelElixir2.default.config.publicPath + '/css/materialize.css'));
/**
* Creates the main sass file for importing mdl.
*
* @return {string}
*/
function constructImportsFile() {
var importsFilePath = './... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scssTask(){\n return src('src/*.scss')\n // .pipe(sass({ }))\n .pipe(postcss([\n require('postcss-bem')({\n style: 'bem',\n // separators: { descendent: '__' }\n }),\n // require('postcss-bem-linter')({\n \n ... | [
"0.63949627",
"0.62498075",
"0.6243957",
"0.6021032",
"0.5939675",
"0.5917591",
"0.58970374",
"0.5881473",
"0.58403903",
"0.58358717",
"0.5822018",
"0.58171433",
"0.58119553",
"0.58109003",
"0.58040744",
"0.57839584",
"0.57804424",
"0.57788634",
"0.57736915",
"0.5766577",
"0.... | 0.7155261 | 0 |
Clears the cached secret and clearing timeout. | _clearCachedSecret(secret) {
if (!!secret && secret === this._cachedSecret) return;
this._cachedSecret = null;
clearTimeout(this._clearCachedSecretRef);
this._clearCachedSecretRef = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ClearCache() {\n this.authClient.ClearCache();\n }",
"ClearCache() {\n this.authClient.ClearCache();\n }",
"function clear() {\n timeoutID = undefined;\n }",
"function clear() {\n timeoutID = undefined;\n }",
"function clear() {\n timeoutID = undefined;\n }",
"function cle... | [
"0.648215",
"0.648215",
"0.62810856",
"0.62810856",
"0.62810856",
"0.62810856",
"0.62810856",
"0.62810856",
"0.62810856",
"0.62810856",
"0.625547",
"0.625547",
"0.625547",
"0.625547",
"0.62322813",
"0.6217573",
"0.6204371",
"0.6204371",
"0.61750317",
"0.61750317",
"0.6148254"... | 0.7849731 | 0 |
installed. When a `File` respresents a directory, its `.contents` property is an object containing the names of the files (or directories) that it contains. When a `File` represents a module, its `.contents` property is a function that can be invoked with the appropriate `(require, exports, module)` arguments to evalua... | function File(moduleId, parent) {
var file = this; // Link to the parent file.
file.parent = parent = parent || null; // The module object for this File, which will eventually boast an
// .exports property when/if the file is evaluated.
file.module = new Module(moduleId);
filesByModuleId... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function File(contents, /*optional:*/ parent, name) {\n var file = this;\n\n // Link to the parent file.\n file.p = parent = parent || null;\n\n // The module object for this File, which will eventually boast an\n // .exports property when/if the file is evaluated.\n file.m = {\n // If this ... | [
"0.6356437",
"0.5295537",
"0.5285948",
"0.5213272",
"0.5193576",
"0.51506555",
"0.5058961",
"0.50320864",
"0.50029606",
"0.49105114",
"0.48645118",
"0.48574433",
"0.48384652",
"0.47112215",
"0.47102678",
"0.47036222",
"0.46703398",
"0.4664567",
"0.46550077",
"0.46541622",
"0.... | 0.5419286 | 1 |
Shorthand for module.watch(require(id), setters) that accepts just a string module identifier `id` rather than the exports object for the required module. In the future, this API will replace module.watch, and will allow for creating Entry objects before module evaluation, which will solve some problems with import cyc... | function moduleLink(id, setters, key) {
return moduleWatch.call(this, this.require(id), setters, key);
} // If key is provided, it will be used to identify the given setters so | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moduleWatch(exported, setters, key) {\n utils.setESModule(this.exports);\n Entry.getOrCreate(this.exports, this);\n\n if (utils.isObject(setters)) {\n Entry.getOrCreate(exported).addSetters(this, setters, key);\n ... | [
"0.6623795",
"0.60972935",
"0.6079947",
"0.5971041",
"0.56741124",
"0.55044127",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
"0.54789436",
... | 0.70863724 | 0 |
that they can be replaced if module.watch is called again with the same key. This avoids potential memory leaks from import declarations inside loops. The compiler generates these keys automatically (and deterministically) when compiling nested import declarations. | function moduleWatch(exported, setters, key) {
utils.setESModule(this.exports);
Entry.getOrCreate(this.exports, this);
if (utils.isObject(setters)) {
Entry.getOrCreate(exported).addSetters(this, setters, key);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"watch (directory) {\n logger.debug(`Hotloading enabled, watching for code changes...`)\n\n let modules = {}\n\n chokidar.watch('./lib', {alwaysStat: true}).on('all', (event, path, stats) => {\n if (event === 'add') modules[path] = {size: stats.size}\n if (event === 'change') {\n if (modul... | [
"0.60501176",
"0.5747784",
"0.5747784",
"0.5747784",
"0.5747784",
"0.57442796",
"0.5696421",
"0.5602737",
"0.5592116",
"0.5592116",
"0.5355194",
"0.52714485",
"0.5200902",
"0.51537734",
"0.5146323",
"0.51253945",
"0.5121924",
"0.5121924",
"0.5121924",
"0.5121924",
"0.5112073"... | 0.64094627 | 0 |
module.watch or module.link. If name is an identifier, calling the function will set the export of that name to the given value. If the name is "", all properties of the value object will be exported by name, except for "default" (use "+" instead of "" to include it). Discussion of why the "default" property is skipped... | function moduleExportAs(name) {
var entry = this;
var includeDefault = name === "*+";
return function (value) {
if (name === "*" || name === "*+") {
Object.keys(value).forEach(function (key) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moduleExportAs(name) {\n var entry = this;\n var includeDefault = name === \"*+\";\n return function (value) {\n if (name === \"*\" || name === \"*+\") {\n Object.keys(value).forEach(fu... | [
"0.73896796",
"0.7112129",
"0.65004325",
"0.6147868",
"0.6100674",
"0.6100019",
"0.6100019",
"0.60714257",
"0.5876412",
"0.58302486",
"0.58153427",
"0.5606756",
"0.5582812",
"0.5512184",
"0.5508363",
"0.5410385",
"0.534277",
"0.53293693",
"0.5293917",
"0.5293917",
"0.5293917"... | 0.7338826 | 1 |
the module system is about to return module.exports from require. This might happen more than once per module, in case of dependency cycles, so we want Module.prototype.runSetters to run each time. | function runSetters(valueToPassThrough) {
var entry = Entry.get(this.exports);
if (entry !== null) {
entry.runSetters();
}
if (this.loaded) {
// If this module has finished loading, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runSetters(valueToPassThrough) {\n Entry.getOrCreate(this.id, this).runSetters();\n\n // Assignments to exported local variables get wrapped with calls to\n // module.runSetters, so module.runSetters returns the\n ... | [
"0.6358724",
"0.6046122",
"0.59367746",
"0.5598932",
"0.5544246",
"0.5506961",
"0.5433698",
"0.5427633",
"0.53954",
"0.53954",
"0.53954",
"0.5324461",
"0.52900267",
"0.5284424",
"0.5284424",
"0.5284424",
"0.5284424",
"0.5284424",
"0.5284424",
"0.528015",
"0.52741736",
"0.52... | 0.688598 | 0 |
Prefetch in chunks to reduce overhead. If we call module.prefetch(id) multiple times in the same tick of the event loop, all those modules will be fetched in one HTTP POST request. | function prefetchInChunks(modules, amount) {
Promise.all(modules.splice(0, amount).map(function (id) {
return _module4.prefetch(id);
})).then(function () {
if (modules.length > 0) {
setTimeout(function () {
pre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prefetchInChunks(modules, amount) {\n Promise.all(\n modules.splice(0, amount).map(function (id) {\n return _module5.prefetch(id);\n })\n ).then(function () {\n if (modules.length > 0) {\n ... | [
"0.7519013",
"0.75124496",
"0.6155037",
"0.6115207",
"0.6115207",
"0.61143357",
"0.58181745",
"0.57977945",
"0.57977945",
"0.5781515",
"0.57375294",
"0.57375294",
"0.5725035",
"0.56554395",
"0.55962265",
"0.55929464",
"0.55929464",
"0.55929464",
"0.54704934",
"0.5452745",
"0.... | 0.75480753 | 0 |
block if we are running on the server. On the client, returns the original function (since `Meteor._noYieldsAllowed` is a noop). This has the benefit of not adding an unnecessary stack frame on the client. | function withNoYieldsAllowed(f) {
if (typeof Meteor === 'undefined' || Meteor.isClient) {
return f;
} else {
return function () {
var args = arguments;
Meteor._noYieldsAllowed(function () {
f.apply(null,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function withNoYieldsAllowed(f) {\n if (typeof Meteor === \"undefined\" || Meteor.isClient) {\n return f;\n } else {\n return function () {\n var args = arguments;\n\n Meteor._noYieldsAllowed(function () {\n ... | [
"0.7414352",
"0.5511632",
"0.539363",
"0.53082347",
"0.5233575",
"0.50888604",
"0.49667642",
"0.49043217",
"0.48650885",
"0.4808935",
"0.4808828",
"0.47939986",
"0.4759564",
"0.4759564",
"0.47531134",
"0.47505018",
"0.47016704",
"0.46825963",
"0.4678288",
"0.46674904",
"0.465... | 0.7390544 | 1 |
selector). Returns a function mapping document>result object. matcher is the Matcher object we are compiling. If this is the root document selector (ie, not wrapped in $and or the like), then isRoot is true. (This is used by $near.) | function compileDocumentSelector(docSelector, matcher) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var docMatchers = Object.keys(docSelector).map(function (key) {
var subSelector = docSelector[key];
if (key.substr(0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"query(root, selector) {\n if (!root) {\n return null;\n }\n return `${root.value}` === selector;\n }",
"queryAll(root, selector) {\n if (!root) {\n return null;\n }\n return `${root.value}` === selector;\n }",
"function _getMatcher(matchMap) {\n return functio... | [
"0.5950333",
"0.5567334",
"0.5282602",
"0.5280513",
"0.5206869",
"0.5203149",
"0.5182763",
"0.5125043",
"0.5085048",
"0.5023391",
"0.5023391",
"0.49957126",
"0.498739",
"0.49837133",
"0.49600014",
"0.49600014",
"0.49600014",
"0.49600014",
"0.49600014",
"0.48996785",
"0.489606... | 0.7605644 | 0 |
Note that this implicitly "deMorganizes" the wrapped function. ie, it means that ALL branch values need to fail to match innerBranchedMatcher. | function invertBranchedMatcher(branchedMatcher) {
return function (branchValues) {
// We explicitly choose to strip arrayIndices here: it doesn't make sense to
// say "update the array element that does not match something", at least
// in mongo-land.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertElementMatcherToBranchedMatcher(elementMatcher) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function (branches) {\n var expanded = options.dontExpandLeafArrays ? branches : expandArraysInBranches(branche... | [
"0.51894087",
"0.5089207",
"0.49156493",
"0.48924786",
"0.48780945",
"0.4859351",
"0.48417777",
"0.4779507",
"0.4779507",
"0.4779507",
"0.4779507",
"0.4779507",
"0.4779507",
"0.47723925",
"0.4771354",
"0.47544244",
"0.4701389",
"0.46493566",
"0.4625486",
"0.46001047",
"0.4594... | 0.619374 | 0 |
newLeafFn Function: of form function(path) should return a scalar value to put into list created for that path conflictFn Function: of form function(node, path, fullPath) is called when building a tree path for 'fullPath' node on 'path' was already a leaf with a value. Must return a conflict resolution. initial tree Op... | function pathsToTree(paths, newLeafFn, conflictFn) {
var root = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
paths.forEach(function (path) {
var pathArray = path.split('.');
var tree = root; // use .every just for iteration with brea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Leaf() {}",
"function createLeaves(inters, originPath, leafShape){\r\n\r\n\tvar calcLine = new Path();\r\n\tif(inters[0] === undefined){\r\n\t\t//leaf can not be calculated here\r\n\t\treturn null;\r\n\t}\r\n\r\n\tcalcLine.add(inters[0].point);\r\n\tcalcLine.add(inters[inters.length-1].point);\r\n\tvar ... | [
"0.54932636",
"0.52247924",
"0.5131723",
"0.4979225",
"0.4979225",
"0.49618623",
"0.49104056",
"0.485612",
"0.485612",
"0.48130348",
"0.48049802",
"0.4800756",
"0.4775889",
"0.4775889",
"0.47702998",
"0.4738436",
"0.47323903",
"0.4677117",
"0.4677117",
"0.4677117",
"0.4677117... | 0.6496071 | 0 |
checks if all field names in an object are valid | function assertHasValidFieldNames(doc) {
if (doc && (0, _typeof2.default)(doc) === 'object') {
JSON.stringify(doc, function (key, value) {
assertIsValidFieldName(key);
return value;
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function valid_fields( fields, obj) {\n\n var valid = true;\n\n fields.every(function(value) {\n return valid = obj.hasOwnProperty( value );\n });\n\n return valid;\n}",
"validateFieldOptions() {\n this.options.fields.forEach((f) => {\n let name = f;\n if (typeof f === 'object') {... | [
"0.7615856",
"0.6715689",
"0.66482216",
"0.65716785",
"0.6540035",
"0.65151733",
"0.6492508",
"0.64398336",
"0.64242226",
"0.6375309",
"0.63231885",
"0.63231885",
"0.63231885",
"0.63117355",
"0.63113654",
"0.6221535",
"0.6198327",
"0.61811566",
"0.61760867",
"0.61660016",
"0.... | 0.6923802 | 1 |
and then you would operate on the 'e' property of the returned object. if options.noCreate is falsey, creates intermediate levels of structure as necessary, like mkdir p (and raises an exception if that would mean giving a nonnumeric property to an array.) if options.noCreate is true, return undefined instead. may modi... | function findModTarget(doc, keyparts) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var usedArrayIndex = false;
for (var i = 0; i < keyparts.length; i++) {
var last = i === keyparts.length - 1;
var keypa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findModTarget(doc, keyparts, options = {}) {\n let usedArrayIndex = false;\n\n for (let i = 0; i < keyparts.length; i++) {\n const last = i === keyparts.length - 1;\n let keypart = keyparts[i];\n\n if (!isIndexable(doc)) {\n if (options.noCreate) {\n return undefined;\n }\n\n ... | [
"0.56271064",
"0.56101376",
"0.5608875",
"0.5572532",
"0.5337522",
"0.5171305",
"0.5131878",
"0.50522393",
"0.4987799",
"0.49507535",
"0.4939083",
"0.49256593",
"0.49088255",
"0.48764786",
"0.48655188",
"0.4843628",
"0.48285994",
"0.4819997",
"0.48188207",
"0.4814207",
"0.481... | 0.56131566 | 1 |
Given an array of comparators (functions (a,b)>(negative or positive or zero)), returns a single comparator which uses each comparator in order and returns the first nonzero value. | function composeComparators(comparatorArray) {
return function (a, b) {
for (var i = 0; i < comparatorArray.length; ++i) {
var compare = comparatorArray[i](a, b);
if (compare !== 0) {
return compare;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function defaultComparator(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}",
"function defaultComparator(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}",
"function min(comparer) {\n var min = (typeof comparer === 'function')\n ? function (x, y) { return comparer(x, y) < 0 ? x : y; }\n :... | [
"0.58647317",
"0.58647317",
"0.5836159",
"0.5508941",
"0.5507027",
"0.5424864",
"0.53567344",
"0.5309935",
"0.5273331",
"0.52699447",
"0.5262021",
"0.5262021",
"0.5262021",
"0.5161577",
"0.5151237",
"0.5057969",
"0.5029553",
"0.5029553",
"0.5029553",
"0.5029296",
"0.5011169",... | 0.7850782 | 0 |
Determine if we are in a DDP method simulation | function alreadyInSimulation() {
var CurrentInvocation = DDP._CurrentMethodInvocation || // For backwards compatibility, as explained in this issue:
// https://github.com/meteor/meteor/issues/8947
DDP._CurrentInvocation;
var enclosing = CurrentInvocation.get();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasDecisionDecided() {\n return this.node.hasDecisionDecided();\n }",
"function $EiDS$var$simulations() {\n var bool = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n $EiDS$var$canSimulate = !!bool;\n} // use this on dom nodes to 'simulate' pseudoclasses",
"function isCo... | [
"0.5682476",
"0.55713135",
"0.5444585",
"0.5388006",
"0.5388006",
"0.5388006",
"0.5388006",
"0.5388006",
"0.5388006",
"0.5388006",
"0.536593",
"0.53397197",
"0.51945007",
"0.513751",
"0.5088865",
"0.5070433",
"0.5059129",
"0.5016874",
"0.49953708",
"0.4993959",
"0.49553317",
... | 0.6815659 | 0 |
isArray returns true for arrays of these types: standard arrays: instanceof Array === true, _.isArray(arr) === true vm generated arrays: instanceOf Array === false, _.isArray(arr) === true subclassed arrays: instanceof Array === true, _.isArray(arr) === false see specific tests | function isArray(arr) {
return arr instanceof Array || _.isArray(arr);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isArray(arr) {\n\t\t\treturn arr instanceof Array;\n\t\t}",
"function isArray(arr) {\n\t\t\treturn arr instanceof Array;\n\t\t}",
"function isArray(arr) {\n\t\treturn Object.prototype.toString.call(arr) === \"[object Array]\";\n\t}",
"function isArray(arr) {\n retu... | [
"0.80751777",
"0.80751777",
"0.80524737",
"0.80251074",
"0.80251074",
"0.79653144",
"0.79595584",
"0.7951146",
"0.7951146",
"0.7951146",
"0.7951146",
"0.7951146",
"0.7951146",
"0.79436046",
"0.7942018",
"0.79202104",
"0.79202104",
"0.79039246",
"0.7892135",
"0.78713745",
"0.7... | 0.8303578 | 0 |
function to return from which side,whole snake is out of canvas | function outOfSight(){
if(snakeArr[0].x>99&¤tMove=='r'){
return 'rightExcede';
}
else if(snakeArr[0].x<0&¤tMove=='l'){
return 'leftExcede';
}
else if(snakeArr[0].y>45.5&¤tMove=='b'){
return 'bottomExcede';
}
else if(snakeArr[0].y<0&¤tMove=='t'){
return 'topExcede';
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wallHit() {\n if ((snake[0].x+10) >= cw) {\n // snake[0].x = cw\n return true\n }\n if (snake[0].x <= 0) {\n // snake[0].x = 0\n return true\n }\n if ((snake[0].y +10) >= ch) {\n // snake[0].y = ch\n return true\n }\n if (snake[0].y <= 0) {\n ... | [
"0.69859457",
"0.68439895",
"0.67818314",
"0.6738863",
"0.67081296",
"0.6606266",
"0.65499264",
"0.65410835",
"0.6537801",
"0.6516873",
"0.6515914",
"0.65015024",
"0.6495831",
"0.6488102",
"0.64529866",
"0.6428712",
"0.63951343",
"0.6392649",
"0.63219684",
"0.62780285",
"0.62... | 0.7092403 | 0 |
Recursively populate the tree of blocks with the given block Returns true when done | function populateTree (state, getBlock, hash) {
return Promise.resolve(getBlock(hash))
.then(function (block) {
const { previousHash } = block
// Mark the root if current block was already populated
if (state.tree[hash]) {
state.tree[hash].root = true
state.completed = true
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"recursiveLayout(current, first, parentTagName) {\n\n if (!current) {\n return;\n }\n let locationInLayout = current.locationInLayout;\n\n // Ignore html, head, body\n const blockTypesToIgnore = {\n 'html': true,\n 'head': true,\n 'body'... | [
"0.6291451",
"0.6275914",
"0.59897965",
"0.5985855",
"0.5984983",
"0.59627664",
"0.5917327",
"0.59034944",
"0.58567685",
"0.58530957",
"0.58530957",
"0.5808396",
"0.58083683",
"0.58083683",
"0.58083683",
"0.58083683",
"0.57970685",
"0.5769724",
"0.5769724",
"0.5768817",
"0.57... | 0.7305063 | 0 |
Create a tree of blocks from hashes A and B to their common parent block Returns the populated tree | function generateTree (getBlock, hashA, hashB) {
const state = { tree: {} }
const populateBranchA = hashA && populateTree(state, getBlock, hashA)
const populateBranchB = populateTree(state, getBlock, hashB)
return Promise.all([populateBranchA, populateBranchB])
.then(() => state.tree)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateTree (state, getBlock, hash) {\n return Promise.resolve(getBlock(hash))\n .then(function (block) {\n const { previousHash } = block\n\n // Mark the root if current block was already populated\n if (state.tree[hash]) {\n state.tree[hash].root = true\n state.complete... | [
"0.6148835",
"0.5961142",
"0.569752",
"0.56864023",
"0.56298524",
"0.5465727",
"0.54567605",
"0.5400955",
"0.5400955",
"0.5400955",
"0.5400955",
"0.5400955",
"0.5400955",
"0.5376774",
"0.5374616",
"0.5355283",
"0.5343864",
"0.53180176",
"0.52852875",
"0.5227396",
"0.52270764"... | 0.72599024 | 0 |
Given a tree of blocks, find how to go from the given hash to the root Returns the path of hashes | function findPath (tree, hash, keepRoot) {
const list = [ hash ]
let current = hash
while (!tree[current].root) {
const previousHash = tree[current].previousHash
list.push(previousHash)
current = previousHash
}
if (!keepRoot) {
list.pop()
}
return list
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateTree (state, getBlock, hash) {\n return Promise.resolve(getBlock(hash))\n .then(function (block) {\n const { previousHash } = block\n\n // Mark the root if current block was already populated\n if (state.tree[hash]) {\n state.tree[hash].root = true\n state.complete... | [
"0.5922203",
"0.58700854",
"0.5850657",
"0.57953614",
"0.5793568",
"0.57120156",
"0.565481",
"0.56233674",
"0.56152725",
"0.55880934",
"0.55196714",
"0.54977214",
"0.54940444",
"0.5444309",
"0.54228574",
"0.54052985",
"0.54002154",
"0.53671765",
"0.5366453",
"0.5331729",
"0.5... | 0.7107428 | 0 |
Adds a header that describes the user's permissions | function addPermissions (req, res, next) {
const { acl, session } = req
if (!acl) return next()
// Turn permissions for the public and the user into a header
const resource = utils.getFullUri(req)
Promise.all([
getPermissionsFor(acl, null, resource),
getPermissionsFor(acl, session.userId, resource)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnSetHeaderPrivileges() {\n var hopNeeded = \"\", accomp = \"\", categoryCheck = \"\", sfcValid = \"\";\n var hopArr = new Array();\n\n var accompArr = new Array();\n var categoryArr = new Array();\n\n // geting privilege value.\n hopNeeded = fnGetPrivilegeValue(\"DCR_INTERMEDIATE_PLACES... | [
"0.5972259",
"0.58809894",
"0.5853847",
"0.5770787",
"0.56674236",
"0.5509935",
"0.5454165",
"0.5449811",
"0.5400128",
"0.5387097",
"0.5375883",
"0.5358038",
"0.5357689",
"0.5324826",
"0.5323428",
"0.5313879",
"0.53130776",
"0.52994967",
"0.5246024",
"0.52343416",
"0.5209057"... | 0.62706274 | 0 |
Gets the permissions string for the given user and resource | function getPermissionsFor (acl, user, resource) {
return Promise.all(MODES.map(mode => acl.can(user, mode).catch(e => false)))
.then(allowed => PERMISSIONS.filter((_, i) => allowed[i]).join(' '))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toString() {\n const permissions = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n ... | [
"0.6578143",
"0.6131145",
"0.6131145",
"0.6105203",
"0.6105203",
"0.6016942",
"0.5574835",
"0.5574835",
"0.5546807",
"0.52701145",
"0.5206999",
"0.516265",
"0.5146802",
"0.5106629",
"0.51036495",
"0.5090329",
"0.507005",
"0.5066828",
"0.5066828",
"0.49902943",
"0.49763328",
... | 0.7256688 | 0 |
creating a function to see if the basket is at max items. | function isFull(){
if(basket < maxItems){
return false;
} else {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFull(){\n for ( let i = 0; i < basket.length; i++){\n if (basket[i] <= maxItems) {\n return true;\n } else {\n return false;\n }\n}\n}",
"function checkLimit() {\n return global.maxItems && global.detailsEnqueued >= global.maxItems;\n}",
"function isFull(items) {\n for (let i = 0... | [
"0.7892439",
"0.6956753",
"0.68189067",
"0.6798482",
"0.6736833",
"0.6636737",
"0.6583895",
"0.65203136",
"0.631785",
"0.6247061",
"0.6186253",
"0.6142566",
"0.61296153",
"0.61281925",
"0.61134624",
"0.6095846",
"0.60829693",
"0.6038967",
"0.6017423",
"0.60072654",
"0.6003769... | 0.7904353 | 0 |
CONFERENCE MEALS for 20 hours or less 1 meal | function oneMealConference(perDiemRate)
{
return mealsPerDay(perDiemRate)*0.75;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function totalOneMealConference(perDiemRate)\n{\n\treturn oneMealConference(perDiemRate) + 5;\n}",
"function calculateHealthPlan() {\n var actualCalories = getTotalCalories();\n var idealCalories = getIdealCalories();\n if (actualCalories < idealCalories) {\n return 'Time for seconds!';\n }\n ... | [
"0.594288",
"0.5792493",
"0.5747437",
"0.57063305",
"0.566212",
"0.56596017",
"0.56389236",
"0.56174403",
"0.5601114",
"0.5560591",
"0.5556612",
"0.55537367",
"0.55390036",
"0.55315",
"0.5530792",
"0.5512157",
"0.54906803",
"0.5466684",
"0.5451297",
"0.54154164",
"0.54152685"... | 0.61206144 | 0 |
Creates a new NotFoundRdfView | function NotFoundRdfView(settings) {
if (!(this instanceof NotFoundRdfView))
return new NotFoundRdfView(settings);
RdfView.call(this, 'NotFound', settings);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function notFound(req,h){\n return h.view('404',{},{layout: 'error-layout'}).code(404)\n}",
"function notFound(req, res) {\n res.status(404).render('404.ejs')\n}",
"function response404(res)\n{\n res.render(\"response404\");\n}",
"function NotFoundController(options) {\n if (!(this instanceof NotFo... | [
"0.56509924",
"0.55331695",
"0.54248124",
"0.54182935",
"0.5355125",
"0.52008706",
"0.51169306",
"0.51140916",
"0.5058735",
"0.50518185",
"0.5048548",
"0.5048429",
"0.5043447",
"0.5008643",
"0.49954292",
"0.49673086",
"0.4955357",
"0.49510008",
"0.49133006",
"0.49055997",
"0.... | 0.82174766 | 0 |
This function returns the day on which the 1st of the month of new_date falls so that the calendar can be formatted properly | function first_day (new_date) {
var day_of_week = new_date.getDay();
var day_in_month = new_date.getDate();
if (day_in_month > 1) {
day_in_month -= 1;
day_in_month = day_in_month % 7;
while (day_in_month > 0) {
if (day_of_week === 0) {
day_of_week = 6;
} else {
day_of_week --;
}
day_in_mon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static calcFirstDayOfMonth(date) {\n const dateCopy = date;\n dateCopy.setDate(1);\n return dateCopy.getDay();\n }",
"function get1stDayOfMonth(date){\r\n\t\t\treturn new Date(date).getDay();\r\n\t\t}",
"function getdayone(curdate) {\n var nd = new Date(curdate);\n var mon = nd.getMonth() + 1;\... | [
"0.66136956",
"0.65895164",
"0.6560334",
"0.63815707",
"0.6301719",
"0.62261647",
"0.61418015",
"0.61060494",
"0.6013121",
"0.5983382",
"0.5982343",
"0.5952676",
"0.59423757",
"0.59311515",
"0.59134305",
"0.5908682",
"0.5874643",
"0.5824167",
"0.5822251",
"0.5815949",
"0.5811... | 0.729399 | 0 |
insertRecursively(val): insert a new node into the BST with value val. Returns the tree. Uses recursion. | insertRecursively(val, currentNode=this.root) {
if(this.root === null){
// create a new node
this.root = new Node(val);
// return the tree (which is what this is referring to)
return this;
}
if(currentNode.val < val){
if(currentNode.right===null){
currentNode.right = ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"insertRecursively(val, current = this.root) {\n // If the tree is empty insert at the root.\n if (this.root === null) {\n this.root = new Node(val);\n return this;\n }\n\n // If not we find the right spot for the new val\n // recursively\n\n if(val < current.val){\n if(current.left... | [
"0.796867",
"0.79355025",
"0.76018316",
"0.75834024",
"0.7552285",
"0.72735137",
"0.7272771",
"0.7219261",
"0.7155094",
"0.7105628",
"0.707626",
"0.7065651",
"0.704588",
"0.7022286",
"0.7020189",
"0.6970803",
"0.69620365",
"0.68606526",
"0.6756264",
"0.6733835",
"0.67023444",... | 0.81572044 | 0 |
bfs(): Traverse the array using BFS. Return an array of visited nodes. | bfs() {
// need to use a queue when we are doing breadth first searching
let currentNode = this.root;
let queue = [];
let visitedNodes = [];
// push our current value into our queue array
queue.push(currentNode);
// while there are still elements in our queue array
while (queue.length)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bfs() {\n const visitedNodes = [];\n const nodeQueue = [this.root];\n\n while(nodeQueue.length){\n const currentNode = nodeQueue.shift();\n visitedNodes.push(currentNode.val);\n if(currentNode.left) nodeQueue.push(currentNode.left);\n if(currentNode.right) nodeQueue.push(currentNode.ri... | [
"0.76545894",
"0.75066197",
"0.7495272",
"0.7367205",
"0.73015946",
"0.72890043",
"0.71078074",
"0.69050807",
"0.6876471",
"0.6846442",
"0.6836668",
"0.68170756",
"0.67890155",
"0.6747038",
"0.6740479",
"0.6736113",
"0.6726703",
"0.6703307",
"0.67026013",
"0.66955626",
"0.668... | 0.75395465 | 1 |
Advanced scroll locking for iOS devices. | function advancedLock(targetElement) {
// add a scroll listener to the body
document.addEventListener('touchmove', preventDefault, { passive: false });
if (!targetElement) return;
/* eslint-disable no-param-reassign */
// add inline listeners to the target, for easier removal later.
targetElement.ontouchsta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableScrollLock() {\n if (!isScrollLocked) {\n // Get scroll position\n var scrollPosition = getElementScroll(); // Reset scroll position\n\n window.scrollTo(scrollPosition.left, 0);\n var htmlTag = document.documentElement;\n htmlTag.classList.add(className);\n htmlTag.style.marginTop... | [
"0.68709403",
"0.67730075",
"0.6771013",
"0.67461276",
"0.66420865",
"0.6578581",
"0.6575763",
"0.6517875",
"0.64520216",
"0.64475745",
"0.64183086",
"0.6385056",
"0.63681954",
"0.63647527",
"0.6362265",
"0.6307396",
"0.6287704",
"0.62660915",
"0.6254331",
"0.62193066",
"0.62... | 0.68678707 | 1 |
finds the closest point to the mouse click | function closestPointChecker(mousePosition) {
// get data from window
dataList = window.data;
// determine the closest datapoint to mouse
var i;
var bestI = 0;
var bestDiff = 100;
for (i = 0; i < dataList[0].length; i++) {
newDiff = Math.abs(dataList[0][i] - mousePosition['x']);
if (newDiff < bes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getClickPoint() {\n var mousePos = kineticCanvas.getPointerPosition();\n var x = mousePos.x;\n var y = mousePos.y;\n var kineticPoint = getKineticPoint(x, y);\n return kineticPoint\n}",
"findClosestEdge(ev) {\n const x = ev.pageX - this.DOM.el.offsetLeft;\n const y =... | [
"0.70500016",
"0.6988056",
"0.68088436",
"0.6669608",
"0.6603799",
"0.6603117",
"0.6464879",
"0.6457428",
"0.6412832",
"0.635713",
"0.63306004",
"0.62936723",
"0.6278752",
"0.6249128",
"0.6200448",
"0.61996377",
"0.61996377",
"0.61858994",
"0.6163856",
"0.6155875",
"0.6152017... | 0.7212552 | 0 |
Se ejecuta ANTES de eliminar el componente (componentWillUnmount) | componentWillUnmount() {
console.log(
"Apunto de eliminar el componente Message (componentWillUnmount)"
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentWillUnmount() {\n console.log('component is being removed')\n }",
"componentWillUnmount() {\n // Ex: remove event listener\n // (In general, teardown or cleanup your code before your component disapears)\n }",
"componentWillUnmount(){\n console.log('componentWillUnmount()')... | [
"0.8362922",
"0.8219099",
"0.8200382",
"0.8169252",
"0.8108948",
"0.8080964",
"0.8080964",
"0.8080964",
"0.8080964",
"0.8080964",
"0.8080964",
"0.8080964",
"0.8080964",
"0.8009921",
"0.7996718",
"0.7938112",
"0.79345214",
"0.79281265",
"0.7924375",
"0.7922989",
"0.790461",
... | 0.8610921 | 0 |
return the underlying buffer length | get length() {
return this.buf.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcLength () {\n return buffers.reduce(function (a, b) {\n return a + b.length\n }, 0)\n }",
"function calcLength () {\n return buffers.reduce(function (a, b) {\n return a + b.length\n }, 0)\n }",
"function calcLength () {\n return buffers.reduce(function (a, b) {\n re... | [
"0.768531",
"0.768531",
"0.768531",
"0.768531",
"0.76797473",
"0.73172",
"0.7288535",
"0.72289646",
"0.702249",
"0.69077235",
"0.690666",
"0.69024706",
"0.69024706",
"0.68775094",
"0.68594503",
"0.6777496",
"0.6777496",
"0.67633337",
"0.6715762",
"0.67031175",
"0.66851443",
... | 0.79098284 | 0 |
This creates a set of transactions and writes to database in smaller chunks. After inserting to db, this calls the handler for returning recurring functions API and returns the recurring transactions for all users for whom transactions are created here. | function transaction_create(req, res) {
let req_arr = req.body;
let bulk_updates = [];
_.forEach(req_arr, function (doc, callback) {
doc['company'] = getCompany(doc.name);
bulk_updates.push({
"updateOne": {
"filter": {
"trans_id": doc.trans_id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function submitPendingTransactions() {\n // See what transactions in the db are still pending\n var pendingTransactions = connection.query(\"SELECT * FROM stellartransactions WHERE state = ?\", [\"pending\"]);\n \n\n if (pendingTransactions.length > 0) {\n var tx = pendingTransactions.pop(... | [
"0.62909126",
"0.621296",
"0.61727434",
"0.5917098",
"0.57560563",
"0.5628595",
"0.56015146",
"0.55621535",
"0.5557698",
"0.5506905",
"0.54525965",
"0.5425804",
"0.54244125",
"0.53879833",
"0.5383078",
"0.5367271",
"0.534522",
"0.5329826",
"0.5315738",
"0.5302725",
"0.5288547... | 0.73360944 | 0 |
FUNCTIONS BELOW /recursively runs forever The animation function redraws the potmeter box based on SCOM input | function animation(poll1, text) {
var canvas = document.getElementById("myCanvas");
var content = canvas.getContext("2d");
// clear canvas
content.clearRect(0, 0, 460, 540);
content.fillStyle = 'black';
content.textAlign = 'center';
content.font = '20pt Calibri';
// make th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animate_mine() { \n clk2 = 800;\n clk = 200;\n if (clk3 > 98){\n up = 1;\n }\n if (clk3 < 2){\n up = 0;\n }\n if (up == 0){\n clk3 ++;\n }\n if (up == 1){\n clk3 --;\n }\n if (clk5 > 498){\n ri = 1;\n }\n if (clk5 < 2){\n ri ... | [
"0.65430266",
"0.6403421",
"0.6341732",
"0.62611085",
"0.624095",
"0.6197471",
"0.61799085",
"0.6135268",
"0.61334217",
"0.6120815",
"0.6116082",
"0.6106408",
"0.60894024",
"0.60735965",
"0.6064189",
"0.6057717",
"0.60565156",
"0.60503674",
"0.60191005",
"0.60177916",
"0.6017... | 0.6485975 | 1 |
Runs the editor window | runEditor(opts) {
if (this.__win) {
return;
}
opts = opts || {};
const parent = BrowserWindow.fromId(this.senderId);
const win = new BrowserWindow({
parent: parent,
backgroundColor: '#00A2DF',
webPreferences: {
partition: 'persist:arc-window',
nativeWindowOpen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runEditor(UI, Console) {\n setMainValue(UI.geteditor());\n runCurrent(Console)\n }",
"function runEditor(UI, Console) {\n setMainValue(UI.geteditor());\n runCurrent(Console);\n }",
"function runEditor(UI, Console) {\n setMainValue(UI.geteditor());\n runC... | [
"0.7220223",
"0.71429485",
"0.71429485",
"0.71236634",
"0.7064376",
"0.698102",
"0.68273026",
"0.68273026",
"0.659866",
"0.65830517",
"0.6559806",
"0.6461638",
"0.6449114",
"0.6431851",
"0.6430982",
"0.64289665",
"0.6400067",
"0.63924015",
"0.63361555",
"0.6333474",
"0.632481... | 0.742575 | 0 |
var numeroUno = 4 var numeroDos = 4 var resultado = numeroUno + numeroDos console.log(resultado) Programa suma con HTML | function pedroHazLaFactura() { // delcaracion de funcion
// pedir valores del HTML
var numeroUno = document.getElementById("valor1").value;
var numeroDos = document.getElementById("pepe").value;
var resultado = parseInt(numeroUno) + parseInt(numeroDos);
// console log del html
alert(resultado);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sumar()\n{\t\n\tvar NumeroUno = document.getElementById('numeroUno').value;\n var NumeroDos = document.getElementById('numeroDos').value;\n\t//Defino variables y tomo datos por id\n\n var NumeroUno = parseInt(NumeroUno);\n var NumeroDos = parseInt(NumeroDos);\n\t\n\tvar Resultado = NumeroUno + Nu... | [
"0.7943784",
"0.77638984",
"0.7703492",
"0.7690833",
"0.7645113",
"0.7562235",
"0.74609244",
"0.7373433",
"0.7305676",
"0.7257887",
"0.7231179",
"0.71736604",
"0.7161284",
"0.7144007",
"0.71203303",
"0.71102583",
"0.7053263",
"0.70522547",
"0.7033893",
"0.7022914",
"0.7007022... | 0.81346565 | 0 |
evaluate an event that directly relates to a piece, i.e. the piece dies | evaluatePieceEvent(event, activatingPiece, pieceEventParams){
this.log.info('Eval piece event %s activating piece: %j', event, activatingPiece);
let evalActions = [];
let {targetPieceId, position, pivotPosition, chooseCardTemplateId} = pieceEventParams || {};
if(event === 'death'){
this.cleanupT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"evaluatePlayerEvent(event, playerId){\n this.log.info('Eval player event %s player: %s', event, playerId);\n\n let evalActions = [];\n\n //special handling of turn start and end for timers\n if(event === 'turnStart'){\n evalActions = evalActions.concat(this.updateTimers(true));\n }\n if(even... | [
"0.6310035",
"0.60846937",
"0.57014084",
"0.56468886",
"0.5578876",
"0.55440795",
"0.5540078",
"0.55113333",
"0.5497354",
"0.5483716",
"0.54559815",
"0.54405564",
"0.5434913",
"0.5411149",
"0.536386",
"0.53503495",
"0.5309745",
"0.5296841",
"0.5283968",
"0.52667177",
"0.52428... | 0.692762 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.