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 |
|---|---|---|---|---|---|---|
Return the API URL for the item. This is the same as the ``editURL`` attribute, and is used to perform HTTP DELETE requests. Returns: string: The URL to perform API operations on. | url() {
return this.get('editURL');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"url() {\n\t\treturn this._url;\n\t}",
"get url() {\n return this._data.url;\n }",
"getUrl() {\n throw new Error(\"You must either override getUrl() and supply a base URL value, or \" +\n \"provide your own implementation for find(), findAll() and all crud \" +\n \"operati... | [
"0.6135413",
"0.6053263",
"0.6009262",
"0.59790313",
"0.59790313",
"0.59790313",
"0.59790313",
"0.59790313",
"0.5944678",
"0.59242547",
"0.59242547",
"0.59242547",
"0.59242547",
"0.59242547",
"0.5876868",
"0.58591044",
"0.58591044",
"0.58591044",
"0.58591044",
"0.5798389",
"0... | 0.69676083 | 0 |
Return the attributes for this item from a provided payload. Args: data (object): The data for this item provided when constructing the integrations page. Returns: object: The new attribute data from the item. | parse(data) {
return {
editURL: data.editURL,
id: data.id,
integrationID: data.integrationID,
itemState: data.enabled ? 'enabled' : 'disabled',
name: data.name,
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getData() {\n const data = super.getData();\n data.labels = this.item.labels;\n \n // Include CONFIG values\n data.config = CONFIG.SFRPG;\n \n // Item Type, Status, and Details\n data.itemType = data.item.type.titleCase();\n data.itemStatus = this._getItemStatus(data.item);\n ... | [
"0.60343313",
"0.5635325",
"0.55653507",
"0.5480387",
"0.545774",
"0.5456252",
"0.53960437",
"0.5393252",
"0.53735435",
"0.53735435",
"0.53735435",
"0.53735435",
"0.53735435",
"0.53735435",
"0.53735435",
"0.53735435",
"0.53517485",
"0.53425074",
"0.5318739",
"0.5303293",
"0.5... | 0.56778944 | 1 |
Initialize the view. Args: options (object): Options for the view. Option Args: configs (Array): An array of data on the configurations, in display order. integrationIDs (Array): An array of integration IDs, in display order. integrationsMap (object): A mapping of integration ID to information. | initialize(options) {
this._integrationIDs = options.integrationIDs;
this._integrationsMap = options.integrationsMap;
this.list = new Djblets.Config.List(
{},
{
collection: new this.listItemsCollectionType(
options.configs,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init(options) {\n console.log('Transport init');\n new TransportView(options).render();\n}",
"function setupIntegrations(options) {\n var integrations = {};\n getIntegrationsToSetup(options).forEach(function (integration) {\n integrations[integration.name] = integration;\n setu... | [
"0.5748202",
"0.5323672",
"0.5238156",
"0.52365345",
"0.5225042",
"0.5111084",
"0.5098618",
"0.503658",
"0.4944593",
"0.49407625",
"0.4908392",
"0.48862165",
"0.48743397",
"0.48743397",
"0.48631924",
"0.48613504",
"0.48569405",
"0.48523617",
"0.48111862",
"0.47947496",
"0.479... | 0.6595937 | 0 |
Render the view. Returns: Djblets.IntegrationConfigListView: This view, for chaining. | render() {
this.listView = new this.listViewType({
ItemView: this.listItemViewType,
el: this.$('.djblets-c-config-forms-list'),
model: this.list,
});
this.listView.render().$el
.removeAttr('aria-busy');
this._$listContainer = this.listView... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n this.$el.data('djblets-list-edit-view', this);\n\n this._$list = this.$el.children(\n '.djblets-c-list-edit-widget__entries');\n this._numItems =\n this._$list.find('.djblets-c-list-edit-widget__entry').length;\n $(`input[name=\"${this._fieldName}_num_... | [
"0.57021487",
"0.5687757",
"0.56282777",
"0.54450834",
"0.52555436",
"0.5195213",
"0.5144073",
"0.5093265",
"0.5020418",
"0.49644104",
"0.49576354",
"0.4950811",
"0.49454576",
"0.49445742",
"0.49260718",
"0.49088416",
"0.47975463",
"0.47938365",
"0.4776664",
"0.4775282",
"0.4... | 0.68818146 | 0 |
Show or hide the list of configurations. This will show the list's container if there's at least one item to show, or hide it if the list is empty. | _showOrHideConfigsList() {
if (this.list.collection.length > 0) {
this._$listContainer.show();
} else {
this._$listContainer.hide();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleListDisplay(list) {\n if (list.childElementCount === 0) {\n list.parentElement.classList.add('hide');\n } else {\n list.parentElement.classList.remove('hide')\n }\n}",
"function show( showItems ) {\n showItems.map( function( item ) {\n clayConfig.getItemByMessageKey( item ).show()... | [
"0.6284665",
"0.584429",
"0.5803236",
"0.5786356",
"0.5767092",
"0.56854206",
"0.565398",
"0.5619571",
"0.56061494",
"0.5602848",
"0.5594866",
"0.55851066",
"0.55746585",
"0.5563102",
"0.55626625",
"0.55181956",
"0.55164367",
"0.54884684",
"0.54884684",
"0.5472473",
"0.547227... | 0.84342 | 0 |
Handler for the Add Integration button. This will show the integrations list popup, allowing the user to choose an integration to add. The logic for showing the popup will align the popup with the lefthand side of the Add Integration button, and set the width to the maximum amount that will cleanly fit a row of tiles w... | _onAddIntegrationClicked(e) {
e.preventDefault();
e.stopPropagation();
if (!this._popup) {
const integrationIDs = this._integrationIDs;
const integrationsMap = this._integrationsMap;
const integrations = [];
for (let i = 0; i < integrationIDs.len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showIntegrationPopup(obj) {\n\tif ($('.integrationPopup').length > 0) {\n\t\treturn;\n\t}\n\n\tvar DOWNLOAD_POPUP_TOP = $('.listContainer').offset().top;\n\tif ($('#integrationPopupContainer').is(':visible')) {\n\t\tvar w = parseInt($(obj).css('width'));\n\t\tvar l = parseInt($(obj).css('left'));\n\t\tvar... | [
"0.57718587",
"0.53474355",
"0.52677476",
"0.5245279",
"0.5195316",
"0.5122215",
"0.5116535",
"0.50764996",
"0.5054002",
"0.501193",
"0.49554786",
"0.4938573",
"0.49381322",
"0.4923014",
"0.49107125",
"0.49086857",
"0.49049217",
"0.48975977",
"0.48692223",
"0.4858923",
"0.485... | 0.743721 | 0 |
set weights for recommended insurances | function setWeightsForRecommendedInsurance(){
weighted_recommendedInsurance.essential = [];
weighted_recommendedInsurance.additional = [];
let seventyfiveAboveScores =[] , fiftyScores = [], twentyFiveScores=[], fiftyScoreslength = 0, seventyfiveAboveScoresLength =0;
for(var index in $sco... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set weight(value) {}",
"setWeights(weights) {\n this.model.setWeights(weights);\n }",
"setWeights(newWeights) {\r\n\r\n let index = (this.inputSize + 1) * this.hiddenSize;\r\n let index2 = index + (this.hiddenSize * this.outputSize);\r\n\r\n this.w1 = nj.array(newWeights.slice(0,... | [
"0.7291728",
"0.7153173",
"0.69998306",
"0.68034554",
"0.6779377",
"0.6773707",
"0.6537865",
"0.6431763",
"0.6382895",
"0.63671273",
"0.63435036",
"0.6340256",
"0.63039243",
"0.6251588",
"0.6176677",
"0.6116554",
"0.6101095",
"0.6096028",
"0.6089703",
"0.6054497",
"0.60071605... | 0.78213495 | 0 |
Map Preselected Insurance Types | function mapPreselectedInsuranceTypes() {
let preselected;
if(typeof $stateParams.preselected === 'string'){
preselected = new Set()
preselected.add($stateParams.preselected)
} else {
preselected = new Set($stateParams.preselected)
}
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fromIntTypeToTypeDetail (type) {\n switch (type) {\n case 1076:\n return {'icon': 'fa fa-play-circle fa-4x', 'typeName': 'Camcorder'}\n\n case 1056:\n return {'icon': 'fa fa-play-circle fa-4x', 'typeName': 'Car Audio'}\n\n case 1032:\n return {'icon': 'fa fa-play-circle fa-4x... | [
"0.56210417",
"0.5378343",
"0.53434324",
"0.53250915",
"0.5311386",
"0.52650106",
"0.52605295",
"0.5249004",
"0.5244064",
"0.52407265",
"0.52296317",
"0.52147746",
"0.5195689",
"0.5190583",
"0.51825047",
"0.5154187",
"0.5153327",
"0.5100748",
"0.5090316",
"0.50792044",
"0.506... | 0.76065093 | 0 |
fetch data from Wikipedia to populate info window | getWikipediaInfo(marker) {
let self = this;
let pageId = marker.pageId;
let url = 'https://cors-anywhere.herokuapp.com/https://pl.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&pageids=' + pageId;
// ew. explaintext=&
fetch(url)
.then(function(response){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWikipediaInfo(searchStr){\n var wikipediaURL = \"https://en.wikipedia.org/w/api.php?action=opensearch&search=\" + searchStr + \"&format=json&callback=wikiCallback\";\n $.ajax(wikipediaURL, {\n dataType: \"jsonp\",\n success: function(response) {\n var entryList = response... | [
"0.7789058",
"0.77367395",
"0.7691964",
"0.7519929",
"0.7519226",
"0.75180584",
"0.74565494",
"0.7438952",
"0.7361632",
"0.73293066",
"0.7310115",
"0.72553897",
"0.71741444",
"0.7157121",
"0.7121974",
"0.6966142",
"0.6913549",
"0.68907636",
"0.6884147",
"0.68033963",
"0.67969... | 0.81643003 | 0 |
src\Circle2.svelte generated by Svelte v3.19.2 | function add_css$1() {
var style = element("style");
style.id = "svelte-92ktqf-style";
style.textContent = ".circle.svelte-92ktqf{width:var(--size);height:var(--size);box-sizing:border-box;position:relative;border:3px solid transparent;border-top-color:var(--colorOuter);border-radius:50%;animation:svelte-92ktqf-circ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_css$k() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1z105v1-style\";\n\tstyle.textContent = \".wrapper.svelte-1z105v1{height:var(--size);width:var(--size);border-radius:100%;animation:svelte-1z105v1-moonStretchDelay var(--duration) 0s infinite linear;animation-fill-mode:forwards;positi... | [
"0.6336298",
"0.6254454",
"0.6246065",
"0.60667986",
"0.60367924",
"0.60343593",
"0.6033246",
"0.59600884",
"0.5953099",
"0.59088355",
"0.5904094",
"0.5781411",
"0.57443094",
"0.5712321",
"0.57032156",
"0.5666893",
"0.5664392",
"0.5659814",
"0.5639415",
"0.5623826",
"0.562360... | 0.62821877 | 1 |
src\SpinLine.svelte generated by Svelte v3.19.2 | function add_css$6() {
var style = element("style");
style.id = "svelte-1viuzhq-style";
style.textContent = ".wrapper.svelte-1viuzhq{width:var(--size);height:var(--stroke);transform:scale(calc(var(--floatSize) / 75));display:flex;justify-content:center;align-items:center}.line.svelte-1viuzhq{width:var(--size);height... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Spinner() {\n\treturn (\n\t\t<div style={{}}>\n\t\t<div className=\"lds-css ng-scope\">\n\t\t<div style={{width:\"100%\",height:\"100%\"}} className=\"lds-dual-ring\">\n\t\t<div>\n\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t</div>\n\t);\n}",
"function spining() {\n const opts = {\n lines: 11, // The... | [
"0.59137017",
"0.57970506",
"0.56476253",
"0.56298953",
"0.554106",
"0.54883224",
"0.5423422",
"0.5382011",
"0.5357651",
"0.52930254",
"0.5292813",
"0.5284946",
"0.5268776",
"0.52526647",
"0.52416945",
"0.5238278",
"0.52292013",
"0.5221538",
"0.5206029",
"0.5180115",
"0.51732... | 0.6181478 | 0 |
src\Stretch.svelte generated by Svelte v3.19.2 | function add_css$7() {
var style = element("style");
style.id = "svelte-w0x6cj-style";
style.textContent = ".wrapper.svelte-w0x6cj{height:var(--size);width:var(--size);display:inline-block;text-align:center;font-size:10px}.rect.svelte-w0x6cj{height:100%;width:10%;display:inline-block;margin-right:4px;background-colo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get legStretch() {}",
"set armStretch(value) {}",
"get armStretch() {}",
"function add_css$5() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-hf9ydw-style\";\n\tstyle.textContent = \".wrapper.svelte-hf9ydw{width:var(--size);height:var(--size)}.circle.svelte-hf9ydw{width:var(--size);height:var(--... | [
"0.5853283",
"0.5779462",
"0.5639934",
"0.5612752",
"0.5593799",
"0.5589732",
"0.5589274",
"0.55684716",
"0.55582505",
"0.55529326",
"0.5545031",
"0.55377823",
"0.55177057",
"0.54347736",
"0.5400901",
"0.5349583",
"0.5340077",
"0.5305045",
"0.52617747",
"0.52407813",
"0.52342... | 0.5982596 | 0 |
src\Shadow.svelte generated by Svelte v3.19.2 | function add_css$i() {
var style = element("style");
style.id = "svelte-vhggjq-style";
style.textContent = ".wrapper.svelte-vhggjq{position:relative;display:flex;justify-content:center;align-items:center;width:var(--size);height:var(--size)}.shadow.svelte-vhggjq{color:var(--color);font-size:var(--size);overflow:hidd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function About_svelte_create_fragment(ctx) {\n\tlet p0;\n\tlet p1;\n\tlet t3;\n\tlet p2;\n\tlet p3;\n\tlet t12;\n\tlet p4;\n\n\treturn {\n\t\tc() {\n\t\t\tp0 = (0,internal/* element */.bG)(\"p\");\n\n\t\t\tp0.innerHTML = `Thank you for using this open source solution for diy pedals. <br/>\r\n This is not to be ... | [
"0.62981373",
"0.57158095",
"0.5702639",
"0.5611885",
"0.56042063",
"0.5555337",
"0.55241716",
"0.5503307",
"0.54983056",
"0.5472368",
"0.54489785",
"0.5427028",
"0.53867793",
"0.5378142",
"0.53694487",
"0.53658754",
"0.5363743",
"0.53074455",
"0.5280413",
"0.5256896",
"0.523... | 0.61497384 | 1 |
Sends and email and retries after a random amount of time if it fails due to sending rate being exceeded. | function sendEmailRetries(to, from, subject, htmlBody, textBody, retries, callback) {
ses.sendEmail({
Destination: {
ToAddresses: [to]
},
Source: from,
Message: {
Subject: {
Data: subject
},
Body: {
Html:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendTestMessage(email, callback) {\n // var time = Math.random() * 10 * 60 * 1000;\n // console.log(time);\n // setTimeout(sendEmailRetries, time, email, 'pickthebetterone@gmail.com', 'Testing', 'Just trying to send an email here, don\\'t worry about me.', 'Just trying to send an email here, don\... | [
"0.71577084",
"0.6711204",
"0.66731507",
"0.66731507",
"0.66731507",
"0.63980263",
"0.6359006",
"0.60490316",
"0.58585006",
"0.5845052",
"0.58344",
"0.5772107",
"0.5724693",
"0.57065713",
"0.57065713",
"0.5642533",
"0.5642533",
"0.5633596",
"0.56276387",
"0.56276387",
"0.5624... | 0.7459532 | 0 |
Sends an email to verify an account's email address. Generates the verification token and updates the database. dbClient is a pg(postgres) object | function sendVerifyMessage(email, userId, dbClient, callback) {
var token = crypto.randomBytes(36).toString("base64").replace(/[=+/]/g, function(c){return {'\+': '-', '/': '_', '=': ''}[c];});
dbClient.query('UPDATE users SET email_verification_token = $1, email_verification_send_time = now(), email_verificat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendVerification(uid, email, errCallback) {\n return new Promise((resolve, reject) => {\n // Create verification hash\n const verHash = create128HashString();\n // Add to database with user ID\n client.query(`INSERT INTO ${TABLE.VERIFICATION} VALUES ('${verHash}', '${uid}', now())`).then(() =... | [
"0.7353033",
"0.71433604",
"0.7074341",
"0.7032656",
"0.68304545",
"0.68202496",
"0.68108016",
"0.6798067",
"0.6733356",
"0.6710709",
"0.67019475",
"0.6680493",
"0.666667",
"0.6654603",
"0.6654603",
"0.6654603",
"0.6654603",
"0.6654603",
"0.6654603",
"0.6644006",
"0.66100997"... | 0.782271 | 0 |
Sends an email to reset a user's password. Generates the token and updates the database. dbClient is a pg(postgres) object | function sendResetMessage(dbClient, recipient, username, callback) {
var token = crypto.randomBytes(36).toString("base64").replace(/[=+/]/g, function(c){return {'\+': '-', '/': '_', '=': ''}[c];});
dbClient.query("UPDATE users SET reset_token = $1, reset_request_time = NOW() WHERE username = $2", [token, usern... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function postForgetPassword(req, res) {\n if (req.body.email) {\n let email = req.body.email;\n var user = await User.findOne({\n email: email\n });\n if (user) {\n let token = generateToken();\n let link = req.protocol + \"://\" + req.get(\"host\") + \"/user/reset/password/\" + t... | [
"0.7417676",
"0.72865355",
"0.69951946",
"0.6980224",
"0.6901015",
"0.6889773",
"0.6815255",
"0.68021166",
"0.67305136",
"0.6714056",
"0.67025197",
"0.66963077",
"0.66590035",
"0.66129136",
"0.65797764",
"0.6564094",
"0.6523792",
"0.6507187",
"0.6496195",
"0.6489408",
"0.6481... | 0.7496934 | 0 |
Function returns the content as a CSV string See Parameter content: [ . [header1, header2], . [data1, data2] . ... . ] NB Does not support Date items | makeCSV(content) {
let csv = "";
content.forEach((value) => {
value.forEach((item, i) => {
let innerValue = item === null ? "" : item.toString();
let result = innerValue.replace(/"/g, '""');
if (result.search(/("|,|\n)/g) >= 0) {
result = '"' + result + '"';
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createCsvContent() {\n let content = \"data:text/csv;charset=utf-8,\";\n\n allEstimates.forEach(function (item) {\n content += `'${item.id}','${item.plaintext}','${item.sum}'` + \"\\r\\n\";\n });\n\n return encodeURI(content);\n}",
"csv() {\r\n var buffer = \"\";\r\n //P... | [
"0.75611794",
"0.7083",
"0.69395864",
"0.6926806",
"0.67200613",
"0.66960853",
"0.6647447",
"0.6502985",
"0.63379794",
"0.6273162",
"0.6247224",
"0.62076885",
"0.61585224",
"0.6136766",
"0.61138546",
"0.6110586",
"0.6110586",
"0.6105457",
"0.60992515",
"0.6087153",
"0.6078762... | 0.8144356 | 0 |
Here we add a flag if the transaction is unknown and convert btc to Satoshi | function processTransactionBeforeInsert(transaction) {
transaction.unknownTransaction = transaction.address in knownAddressMap ? false : true;
transaction.amount = sb.toSatoshi(transaction.amount);
return transaction;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static hexlifyTransaction(transaction, allowExtra) {\n // Check only allowed properties are given\n const allowed = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__ethersproject_properties__[\"c\" /* shallowCopy */])(allowedTransactionKeys);\n if (allowExtra) {\n for (const key i... | [
"0.571983",
"0.5665143",
"0.5658696",
"0.55980843",
"0.559503",
"0.5560948",
"0.5560948",
"0.55165845",
"0.5462213",
"0.53502613",
"0.52860963",
"0.52658933",
"0.5208422",
"0.5183512",
"0.5158267",
"0.5150893",
"0.5149562",
"0.51414764",
"0.51363885",
"0.51335627",
"0.5126129... | 0.64430064 | 0 |
Helper method to calculate how many pieces this corner is part of. | _getPartOfCount() {
// 8-neighborhood around
const n = [
Point.val(this.x - 1, this.y - 1),
Point.val(this.x - 1, this.y),
Point.val(this.x - 1, this.y + 1),
Point.val(this.x, this.y - 1),
Point.val(this.x, this.y +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countCoordinate (val){\n return (val * side ) + (side / 2);\n}",
"function numberOfRectangles(m, n) {\n return (m * m + m) * (n * n + n) / 4; //Math it!\n }",
"countNeighbours() {\n\t\tlet c = 0;\n\t\tfor(let x =- 1; x <= 1; x++) {\n\t\t\tfor(let y =- 1; y <= 1; y++) {\n\t\t\t\tlet neighbour = {... | [
"0.65142626",
"0.6324285",
"0.62147915",
"0.6089171",
"0.60297644",
"0.5987668",
"0.5928697",
"0.58905303",
"0.58708054",
"0.584955",
"0.58315367",
"0.5816508",
"0.5811689",
"0.5808404",
"0.5808186",
"0.58009297",
"0.5775165",
"0.5761822",
"0.57554454",
"0.57488775",
"0.57487... | 0.7090412 | 0 |
Mark this point as 'used' once by decrementing its `partOf` counter. | use() {
if (this.partOf === 0) {
throw new RangeError(`${this} can't be used anymore!`);
}
this.partOf--;
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearUsed()\n\t{\n\t\tthis.isUsed = 0;\n\t}",
"set partOf(partOf) {\n\t\tthis._partOf = new Reference(partOf);\n\t}",
"removePoint() {\n this.points -= 1;\n this.updateScore();\n }",
"function restartUsed(){\n arrUsedBefore.splice(1,questlength);\n }",
"decrementAvailability() {\n t... | [
"0.5358644",
"0.5337941",
"0.52001196",
"0.51737",
"0.4922169",
"0.48747757",
"0.4869885",
"0.47624272",
"0.47355235",
"0.47121078",
"0.46886784",
"0.45709",
"0.4482417",
"0.44676352",
"0.44482517",
"0.44467172",
"0.44466245",
"0.44324294",
"0.4414909",
"0.43783757",
"0.43495... | 0.6195207 | 0 |
change the name of the file to read (with underscore) step 2 of querying, when the list of repos is already created readRepoStructureFile(dir+reposDir+"zybbyzaa_NodejsBlog.json"); get the list of repos produced by repos_crawler and call getDirectoryForRepo for each of them | function getReposList() {
fs.readFile(dir+filteredResults, function(err,data) {
if (err) {
return console.log(err);
}
var repos = JSON.parse(data);
console.log("File "+(dir+filteredResults)+" has "+repos.length+" elements");
var index = 0;
while (index < r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readRepoStructureFile(filename) {\n\n var file = filename.split('/')[3];\n var owner = file.split('_')[0];\n var repoName = file.split('_')[1];\n repoName = repoName.substring(0, repoName.length-5);\n console.log(\"Owner: \"+owner);\n console.log(\"RepoName: \"+repoName);\n fs.readFil... | [
"0.66497535",
"0.6033905",
"0.60138834",
"0.5792151",
"0.573715",
"0.5722574",
"0.55360734",
"0.5534961",
"0.5464088",
"0.54329187",
"0.5409688",
"0.53923035",
"0.5354984",
"0.53514665",
"0.5347488",
"0.5319859",
"0.5295172",
"0.52941334",
"0.5248291",
"0.5228561",
"0.5223632... | 0.6169483 | 1 |
takes a JSON object from the list of filtered repos gets a reference for a repo branch (sha) gets a directory tree for that branch saves the directory tree into a file if the directory tree is not empty calls the check for Jade/Pug/EJS/Angular files in the tree | function getDirectoryForRepo(repo) {
console.log("Repo: "+repo.full_name);
console.log(JSON.stringify(repo));
///repos/:owner/:repo/git/refs
github.gitdata.getReferences({owner:repo.owner, repo:repo.name}, function (err,res){
//console.log("Here are the branches");
//console.log(JSON.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getJadeFiles(items, owner, repoName) {\n console.log(\"Owner \"+owner);\n var jadeFiles = [];\n var count = 0;\n var countJade = 0;\n var fileSaved = false;\n var jadeFilesFound = false;\n console.log(\"array size \"+items.length);\n items.forEach(function(element, index, arr) {\n ... | [
"0.62396646",
"0.6050109",
"0.5862164",
"0.5733377",
"0.5629824",
"0.5572451",
"0.5556513",
"0.5476878",
"0.5476878",
"0.54283524",
"0.53973883",
"0.5378706",
"0.53151643",
"0.5300114",
"0.5288796",
"0.5279041",
"0.5279041",
"0.5253714",
"0.5244948",
"0.5224304",
"0.5222534",... | 0.6944323 | 0 |
reads the repository structure from the file that was saved in getDirectoryForRepo the filename is provided as a parameter | function readRepoStructureFile(filename) {
var file = filename.split('/')[3];
var owner = file.split('_')[0];
var repoName = file.split('_')[1];
repoName = repoName.substring(0, repoName.length-5);
console.log("Owner: "+owner);
console.log("RepoName: "+repoName);
fs.readFile(filename, funct... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDirectoryForRepo(repo) {\n console.log(\"Repo: \"+repo.full_name);\n console.log(JSON.stringify(repo));\n\n ///repos/:owner/:repo/git/refs\n github.gitdata.getReferences({owner:repo.owner, repo:repo.name}, function (err,res){\n //console.log(\"Here are the branches\");\n //con... | [
"0.6490361",
"0.6329059",
"0.610868",
"0.61068237",
"0.5870392",
"0.58253753",
"0.5810792",
"0.5752045",
"0.5732694",
"0.5693503",
"0.54323334",
"0.54225844",
"0.5418767",
"0.54164743",
"0.53049636",
"0.5299003",
"0.52983147",
"0.5296541",
"0.5237814",
"0.5225593",
"0.5215771... | 0.80028474 | 0 |
checks if the repo structure has any Jade files if it has, downloads the content of each file in Base64 format and saves it into one file per repository | function getJadeFiles(items, owner, repoName) {
console.log("Owner "+owner);
var jadeFiles = [];
var count = 0;
var countJade = 0;
var fileSaved = false;
var jadeFilesFound = false;
console.log("array size "+items.length);
items.forEach(function(element, index, arr) {
if (element... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEJSFiles(items, owner, repoName) {\n console.log(\"Owner \"+owner);\n var ejsFiles = [];\n var count = 0;\n var countEjs = 0;\n var fileSaved = false;\n var ejsFilesFound = false;\n console.log(\"array size \"+items.length);\n items.forEach(function(element, index, arr) {\n ... | [
"0.6412668",
"0.6303625",
"0.62712055",
"0.5974233",
"0.5851734",
"0.57993305",
"0.5760625",
"0.57335854",
"0.56937325",
"0.566094",
"0.5601193",
"0.556505",
"0.5534318",
"0.55260885",
"0.55110836",
"0.5505999",
"0.54982895",
"0.54315853",
"0.5429684",
"0.5398979",
"0.5387932... | 0.71929514 | 0 |
checks if the repo structure has any EJS files if it has, downloads the content of each file in Base64 format and saves it into one file per repository | function getEJSFiles(items, owner, repoName) {
console.log("Owner "+owner);
var ejsFiles = [];
var count = 0;
var countEjs = 0;
var fileSaved = false;
var ejsFilesFound = false;
console.log("array size "+items.length);
items.forEach(function(element, index, arr) {
if (element.typ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getJadeFiles(items, owner, repoName) {\n console.log(\"Owner \"+owner);\n var jadeFiles = [];\n var count = 0;\n var countJade = 0;\n var fileSaved = false;\n var jadeFilesFound = false;\n console.log(\"array size \"+items.length);\n items.forEach(function(element, index, arr) {\n ... | [
"0.64650685",
"0.6324147",
"0.6200076",
"0.5862572",
"0.5793958",
"0.57405144",
"0.57275254",
"0.5726256",
"0.5721687",
"0.5701302",
"0.56271607",
"0.5613169",
"0.56103855",
"0.55494237",
"0.5539524",
"0.5523744",
"0.5489366",
"0.5486433",
"0.54844755",
"0.5474779",
"0.545353... | 0.7287178 | 0 |
checks if the repo structure has any Angular files (JavaScript) downloads the content of each file in Base64 format and saves it into one file per repository | function getAngularFiles(items, owner, repoName) {
console.log("Owner "+owner);
var jsFiles = [];
var count = 0;
var countJS = 0;
var fileSaved = false;
var jsFilesFound = false;
console.log("array size "+items.length);
items.forEach(function(element, index, arr) {
if (element.ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEJSFiles(items, owner, repoName) {\n console.log(\"Owner \"+owner);\n var ejsFiles = [];\n var count = 0;\n var countEjs = 0;\n var fileSaved = false;\n var ejsFilesFound = false;\n console.log(\"array size \"+items.length);\n items.forEach(function(element, index, arr) {\n ... | [
"0.6335302",
"0.60498303",
"0.6014388",
"0.5904526",
"0.56553584",
"0.553494",
"0.5517121",
"0.55086625",
"0.54613566",
"0.5459992",
"0.5453519",
"0.54026127",
"0.53625524",
"0.53441465",
"0.53272647",
"0.5324288",
"0.5319872",
"0.5295715",
"0.52707875",
"0.5245843",
"0.52090... | 0.7440199 | 0 |
validateScreenTimeGoalSubmission() This method checks the required form fields to ensure they are all filled out and displays errors when they are not Parameters: None Returns: TRUE if all form fields valid, FALSE otherwise Exceptions: None | function validateScreenTimeGoalSubmission()
{
//get all form fields
var stGoal = document.getElementById("screenTimeGoal").value; //screen time goal
//flag to ensure all data accurate
var isValid = true;
//ensure screen time goal is submitted
if(stGoal === "" || isNaN(stGoal) |... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"check_submission() {\n if(this.state.ActivityName.length < 1) {\n Alert.alert(\"Must enter activity name\");\n } else if(this.state.dateText == 'Click to select date') {\n Alert.alert(\"Must enter a date\");\n } else if (this.state.startText == 'Click to select start time' || this.state.startTex... | [
"0.6597579",
"0.6583355",
"0.6516856",
"0.6411025",
"0.634977",
"0.6280563",
"0.62455845",
"0.6238148",
"0.6220318",
"0.61458474",
"0.61356294",
"0.61299264",
"0.612422",
"0.6123848",
"0.6120326",
"0.61078197",
"0.6061121",
"0.6023993",
"0.6020665",
"0.60175395",
"0.6008781",... | 0.82277113 | 0 |
add walk circle function | function addWalkCircle() {
walkCircle.center = place.geometry.location
walkCircle.setMap(map)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function walkingCircle() {\n addCircle(150, \"green\");\n addCircle(300, \"blue\");\n addCircle(600, \"purple\");\n addCircle(searchRadius, \"black\");\n}",
"function circle() {\n\n}",
"move(){\n console.log('circle move')\n }",
"circle() {\n const context = GameState.current;\n\n Helper.... | [
"0.77103823",
"0.6659637",
"0.6652277",
"0.6371107",
"0.62909055",
"0.6288392",
"0.6229389",
"0.62078136",
"0.61766917",
"0.61252254",
"0.61090976",
"0.6073798",
"0.6073798",
"0.60652053",
"0.60553014",
"0.6010386",
"0.59971017",
"0.5985463",
"0.5985463",
"0.5985463",
"0.5969... | 0.75121534 | 1 |
reset search bar pin info window walk circle | function resetSearch() {
addressinfowindow.close();
marker.setVisible(false);
walkCircle.setMap(null);
map.setCenter({ lat: 44.478081, lng: -73.215 });
map.setZoom(15)
startCondition()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetSearch() {\n $(\".resetButton\").on(\"click\", function(){\n $('body').animate({\n 'background-position-y': \"0\"}, \"slow\"\n );\n $(\".selectionMenu\").slideDown();\n $(\"#map\").addClass(\"hidden\");\n $(\".sectionOne, .centered, .bookSuggest, .coffeeStoreResults, .resetPage... | [
"0.6820782",
"0.6612716",
"0.6472957",
"0.6458743",
"0.64171356",
"0.6386491",
"0.6349841",
"0.63234806",
"0.62769896",
"0.6256923",
"0.62033266",
"0.6203307",
"0.618419",
"0.6178023",
"0.6123124",
"0.6071963",
"0.60674995",
"0.60595137",
"0.6039273",
"0.6025022",
"0.59919834... | 0.7739883 | 0 |
fizzBuzz //////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// i: function called fizzBuzz which takes start and end params 0: each , but sometimes replaced by another word, as stated below create a function called fizzBuzz Se... | function fizzBuzz(start, end) {
for (var i = start; i <= end; i++) {
if (i % 15 == 0) {
console.log("fizzbuzz");
} else if (i % 5 == 0) {
console.log("buzz");
} else if (i % 3 == 0) {
console.log("fizz");
} else {
console.log(i);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fizzbuzz(start, end){\n // var num = 50;\n for (var i = start; i <= end; i++){\n if (i % 3 == 0 && i % 5 == 0){\n console.log('fizzbuzz');\n }\n else if (i % 3 == 0){\n console.log('fizz');\n }\n else if (i % 5 == 0){\n console.log(... | [
"0.88059115",
"0.87905824",
"0.8777244",
"0.87513256",
"0.85092676",
"0.8461488",
"0.8450905",
"0.84495574",
"0.8414875",
"0.8347191",
"0.8334392",
"0.8327596",
"0.8291195",
"0.82526755",
"0.82450557",
"0.82431006",
"0.8242436",
"0.8226881",
"0.82239693",
"0.8221522",
"0.8194... | 0.89835626 | 0 |
drawChessboard ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// create a variable "output" to store our string in will have to create a loop withing a loop to access 2 dimensions in the inner loop, create if loops start the eve... | function drawChessboard(num) {
var output = '';
for (let x = 1; x <= num; x++){ // all the lines
for (let y = 1; y <= num; y++) { // a single line
if (x % 2 == 0 && y % 2 == 1) {
output += '#';
} else if (y % 2 == 0 && x % 2 != 0) {
output += '#';
} else {
output += ' ';
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawChessboard(number) {\n let chessArrayOuter = [];\n for(let i = 0; i < number; i++){\n if(i%2 === 0){\n let chessArrayInner = [];\n for(let j = 0; j < number; j++ ){\n \n \n if(j%2 === 0){\n chessArrayInner.push(' ');\n }else{\n chessArrayInn... | [
"0.83856976",
"0.8153605",
"0.8051429",
"0.7237014",
"0.72251475",
"0.7197996",
"0.7071462",
"0.6998972",
"0.692682",
"0.6896265",
"0.689607",
"0.6890434",
"0.68777776",
"0.6863561",
"0.68610865",
"0.6847151",
"0.68106115",
"0.68008006",
"0.6757753",
"0.6751905",
"0.6737202",... | 0.843043 | 0 |
translate application alias to address | function findAddressforApplication(cmd) {
// (async () => {
//if param was passed then use that as address
if (cmd.parameter) {
return cmd.parameter
}
//otherwise look up the app by name
// await localbus_pub.hget(CHANNEL_APP, cmd.name, function (err, obj) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatAddress(acc) {\n return T_Address.canonicalize(acc); // TODO: typing\n }",
"function addressToAensPointee (address) {\n const key = {\n ak: 'AENS.AccountPt',\n ct: 'AENS.ContractPt',\n ok: 'AENS.OraclePt',\n ... | [
"0.6051738",
"0.6045104",
"0.5964499",
"0.5926187",
"0.5926187",
"0.5926187",
"0.5926187",
"0.5792513",
"0.5766349",
"0.5700648",
"0.5658885",
"0.56523436",
"0.56028485",
"0.55748075",
"0.55748075",
"0.55748075",
"0.55748075",
"0.55634624",
"0.5557835",
"0.5504978",
"0.549428... | 0.6402322 | 0 |
make a standard bitquery query basically it will add any missing attributes to make it a standard query | function makeBitquery(query) {
let fullquery = query
if (!query.hasOwnProperty("q")) {
//assume that query is just the q attribute, fill in the rest
fullquery = {
"v": 3,
"q": query
}
}
return JSON.stringify(fullquery)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LQuery(){}",
"function CustomQuery() {\n\n}",
"function TQuery(){}",
"function TQuery() {}",
"function TQuery() {}",
"function TQuery() {}",
"function LQuery() {}",
"function LQuery() {}",
"function LQuery() {}",
"getFixedQuery() {}",
"function TQueries(){}",
"function LQuery() { }",... | [
"0.62446034",
"0.6218838",
"0.6207883",
"0.6088699",
"0.6088699",
"0.6088699",
"0.59689295",
"0.59689295",
"0.59689295",
"0.59010756",
"0.58642364",
"0.5862179",
"0.5862179",
"0.584902",
"0.58434236",
"0.58398175",
"0.58398175",
"0.5764539",
"0.5764539",
"0.5760417",
"0.57580... | 0.69287264 | 0 |
write the message to bitcoin by creating a transaction | function shovelToBitcoin(message) {
//TODO: for now assume ascii text, later need to distinguish from hex string
//console.log(`shoveling to bitcoin >${message}<`);
let split = utils.splitString(message)
console.log(split)
if (!DEBUG) {
datapay.send({
data: split,
pay: { key: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function createTransaction() {\n // Get a fee estimate from Smart Fee:\n const smartFeeResponse = await request({\n url: `https://api.smartfee.live/latest`,\n headers: {\n 'X-API-KEY': smartFeeApiKey\n }\n })\n const smartFeeResponseObject = JSON.parse(smartFeeResp... | [
"0.6957043",
"0.63577527",
"0.6324684",
"0.6279842",
"0.6239485",
"0.621873",
"0.62073255",
"0.6194921",
"0.6185664",
"0.6140391",
"0.6129523",
"0.6114427",
"0.6097061",
"0.60307455",
"0.6021054",
"0.6014715",
"0.60100615",
"0.60047776",
"0.59742963",
"0.59369165",
"0.5932399... | 0.6695355 | 1 |
For an array of paths, this function returns a set of package names. | function getPackageNamesSetAndPackagePaths(paths, quiet) {
// this will be a set of package names (from the package.json files)
const packageNames = new Set();
// this will contain a Map packageName->path
const packagePathsMap = new Map();
paths.forEach((packagePath) => {
const packageJson = JSON.parse(fs.readFi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllPackages(packages, testPath) {\n let result = [];\n\n packages.forEach(package => {\n\n if (package) {\n let files = glob.sync(package);\n result.push(...files);\n }\n\n });\n\n return result;\n}",
"function getAllPackageNames() {\n return new Pro... | [
"0.62298274",
"0.5903493",
"0.58577555",
"0.5815337",
"0.57852805",
"0.5653405",
"0.56444675",
"0.5626823",
"0.56174076",
"0.54981023",
"0.5472752",
"0.5466032",
"0.54558045",
"0.54200304",
"0.53701085",
"0.5337384",
"0.53297454",
"0.53093016",
"0.52847975",
"0.5265035",
"0.5... | 0.716997 | 0 |
spawn asset at random vertex (adds to scene) and adds to the global list of assets | spawnAsset(asset) {
var vertices = this.worldVertices();
var faces = this.worldFaces();
// get vertex from idx stored in face
var faceIdx = Math.max(0,
Math.min(Math.floor(Math.random() * faces.length), faces.length - 1));
var vIdx = Math.max(0,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addAsset(asset, position) {\n this.assets.push(asset);\n asset.setPosition(position);\n }",
"function AddRandom() {\n\n\n var location = [];\n\n for (var j = 0; j < 5; j++) {\n for (var i = 0; i < 5; i++) {\n\n if (grid[j][i].name == \"empty\") {\n\n locati... | [
"0.66131335",
"0.61914957",
"0.6071388",
"0.60536015",
"0.6053013",
"0.60209596",
"0.59534",
"0.5895018",
"0.58814603",
"0.5878621",
"0.5858314",
"0.5857417",
"0.58191454",
"0.5795487",
"0.5784091",
"0.5780188",
"0.57650673",
"0.57087725",
"0.5708542",
"0.57014245",
"0.564396... | 0.81379527 | 0 |
endregion ReportFundingHistory region ReportFundingHistorySelction | function multiselectModalReportFundingHistorySelection() {
multiselectModal("reportFundingHistorySelection", $('#FFSReports_FundingDateIDs > option').length, 'Select Dates', bootstrapFindSize() == 'lg' ? $(window).height() - (240) : $(window).height() - (260));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showBankSelection() {\n gTrans.showBankSelection = true;\n navController.pushToView(\"corp/transfer/domestic/trans-dti-list-bank\", true);\n document.addEventListener(\"evtSelectedBranch\", handleInputBankBranch, false);\n}",
"showSelectedData() {\n const findRanking = (dateString) =... | [
"0.5359598",
"0.53238815",
"0.52167183",
"0.51930046",
"0.5183803",
"0.5166825",
"0.5122612",
"0.51011086",
"0.5067143",
"0.50066185",
"0.50066066",
"0.49578354",
"0.4903124",
"0.4880956",
"0.48754075",
"0.4866507",
"0.48492184",
"0.48358434",
"0.48314822",
"0.48264548",
"0.4... | 0.55077195 | 0 |
draws button if the level hasn't been picked | function drawButtons() {
if (!levelPicked) {
easyButton.make();
mediumButton.make();
hardButton.make();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mediumClick() {\n if (mediumButton.isUnderMouse(mouseX, mouseY)) {\n isUnder = true;\n mediumLevel();\n levelPicked = true;\n }\n}",
"function hardClick() {\n if (hardButton.isUnderMouse(mouseX, mouseY)) {\n isUnder = true;\n hardLevel();\n levelPicked ... | [
"0.70340544",
"0.6751499",
"0.6672018",
"0.66021574",
"0.6582668",
"0.6491074",
"0.64702743",
"0.64476043",
"0.6422531",
"0.6413625",
"0.6355112",
"0.6327087",
"0.6297564",
"0.6260182",
"0.6237002",
"0.62046355",
"0.6182887",
"0.6152848",
"0.613737",
"0.6129054",
"0.6100085",... | 0.7840882 | 0 |
changes the level on button click and starts game | function changeLevel() {
easyClick();
mediumClick();
hardClick();
if (isUnder) {
startButton();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"trigger() {\n if(level === 1) {\n // set the level to world2\n setScene(WORLD2);\n drawGameboard();\n resetGame();\n level = 2;\n } else if(level === 2) {\n // set the level to world3\n setScene(WORLD3);\n drawGam... | [
"0.77531666",
"0.75665116",
"0.7552151",
"0.7467485",
"0.73167837",
"0.72841716",
"0.72777414",
"0.7265198",
"0.7168273",
"0.71078295",
"0.7067691",
"0.70477694",
"0.70471764",
"0.70180064",
"0.70104426",
"0.7006535",
"0.70055264",
"0.69482255",
"0.6941752",
"0.6928416",
"0.6... | 0.77067655 | 1 |
Search for the latest standing, equal to or before measurementDate | getLatestElectionStanding(electionId, measurementDate = new Date()) {
let measurementTime = measurementDate.getTime();
let candidatesPromise = this.getCandidates(electionId);
let partiesPromise = this.getParties(electionId);
let standingPromise = this.db.electionStandings
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterByDate(sighting) {\n return sighting.datetime === inputDate;\n }",
"function searchAfterEvent(table) {\n let minimalTime = 99999999999999;\n let currentEvent = 0;\n table.forEach(element => {\n if (minimalTime > element.miliseconds && today_mili < element.milise... | [
"0.59079844",
"0.5650722",
"0.53705084",
"0.5290219",
"0.5282521",
"0.5270641",
"0.5238797",
"0.52268326",
"0.5203372",
"0.5098077",
"0.50238067",
"0.50077564",
"0.5007146",
"0.49895492",
"0.4981095",
"0.49509558",
"0.4920005",
"0.49173447",
"0.484288",
"0.48331174",
"0.48272... | 0.6255217 | 0 |
capture dog information to edit | function captureDogInputs(e) {
let dogId = parseInt(e.currentTarget.dataset.editId);
let name = document.querySelector(`[data-name-id="${dogId}"]`).innerText;
let breed = document.querySelector(`[data-breed-id="${dogId}"]`).innerText;
let sex = document.querySelector(`[data-sex-id="${dogId}"]`).innerText;
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDescription(dog) {\n console.log(dog.description);\n\n}",
"function editDog (event) {\n let dogId = parseInt(event.target.dataset.id); //grabs the dg's id from the dataset\n getDogs(dogId).then(data => { //fetch request was made for all the dogs\n let dog = data.find( dog => {return dog.id ==... | [
"0.6426138",
"0.6170367",
"0.5904284",
"0.5714459",
"0.5615465",
"0.55814904",
"0.5570296",
"0.5570296",
"0.5562372",
"0.5537765",
"0.5535338",
"0.5530693",
"0.5500438",
"0.5496712",
"0.5478566",
"0.5443998",
"0.54374653",
"0.54237574",
"0.5391999",
"0.5387833",
"0.53731984",... | 0.6920018 | 0 |
rerender all the dogs with the updated list | function renderUpdatedDogs() {
let dogTable = document.querySelector('#table-body');
dogTable.innerHTML = '';
getAllDogs();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateAnimals(){\n\tfor(let i=0; i<animals.length; i++){\n\t\tanimals[i].drawAnimal();\n\t}\n}",
"updateBullets() {\n for (var i = 0; i < this.bullets.length; i++) {\n var bullet = this.bullets[i];\n\n // Update the bullet\n bullet.update();\n\n // Deleting the bullet\n if (b... | [
"0.6616194",
"0.60488534",
"0.5989261",
"0.59881896",
"0.5897345",
"0.58520883",
"0.5790109",
"0.5783321",
"0.57430214",
"0.57105136",
"0.5707886",
"0.56473243",
"0.55936825",
"0.55734736",
"0.5557163",
"0.55384505",
"0.5523856",
"0.5500685",
"0.5492075",
"0.54916257",
"0.548... | 0.65085113 | 1 |
for Edit technician validation | function validate_techEdit(){
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(document.frmTech.TechFirstName.value == ''){
document.getElementById('lblTechFirstName').innerHTML = 'This field is required';
document.frmTech.TechFirstName.focus();
return false;
}else{
document.getElement... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adminEditExam(){\n // Validate the data in the modal\n}",
"static vRquired(formdata,valid) {\n for (let fm of fieldsModel) {\n for (let id in formdata) {\n if (fm.nombre == id) {\n if (fm.isRequired && !formdata[id] && id !=\"id\") {\n ... | [
"0.58664834",
"0.57446975",
"0.5738158",
"0.57201785",
"0.56938314",
"0.5685382",
"0.5669092",
"0.5662039",
"0.561804",
"0.56172734",
"0.55865407",
"0.55501986",
"0.55361384",
"0.552428",
"0.55239207",
"0.5516527",
"0.5509474",
"0.5500299",
"0.54804844",
"0.54784894",
"0.5472... | 0.6259055 | 0 |
function for Jobtype validation | function validate_Jobtype(){
if(document.frmJobtype.ProfileJobtypeName.value == ''){
document.getElementById('lblProfileJobtypeName').innerHTML = 'This field is required';
document.frmJobtype.ProfileJobtypeName.focus();
return false;
}else{
document.getElementById('lblProfileJobtypeName').innerHTML = '';
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sjb_is_valid_input(event, input_type, input_class) {\n var jobpost_form_inputs = $(\".\" + input_class).serializeArray();\n var error_free = true;\n\n for (var i in jobpost_form_inputs) {\n var element = $(\"#\" + jobpost_form_inputs[i]['name']);\n ... | [
"0.60611725",
"0.5871101",
"0.5861261",
"0.5854718",
"0.5827331",
"0.5819159",
"0.58084893",
"0.57085925",
"0.56564814",
"0.5647048",
"0.5639658",
"0.56128794",
"0.5610621",
"0.55816466",
"0.5572313",
"0.5567231",
"0.55347013",
"0.5526064",
"0.5503712",
"0.5499136",
"0.549417... | 0.7437921 | 0 |
function for validate assigned Technician | function validate_techAssign(){
if(document.frmtechAssign.SrchTechnician.value == ''){
document.getElementById('lblSrchTechnician').innerHTML = 'This field is required';
document.frmtechAssign.SrchTechnician.focus();
return false;
}else{
document.getElementById('lblSrchTechnician').innerHTML = '';
}
/*if(do... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StatutoryValidation() {\n var Lo_Obj = [\"ChkIsShopYes\", \"ChkIsShopNo\", \"txtRegShop\", \"ChkRegUnderSSIYes\", \"ChkRegUnderSSINo\", \"txtRegUnderSSI\", \"ChkDrugLicenceYes\", ];\n var Ls_Msg = [\"Facilites Type\", \"Current Year\", \"First Year\", \"Second Year\", \"Next Year\"];\n\n if (!Che... | [
"0.6189943",
"0.6050501",
"0.5994314",
"0.5957937",
"0.5943828",
"0.59364253",
"0.58888626",
"0.5884952",
"0.58608556",
"0.5827643",
"0.58247024",
"0.5819488",
"0.5779709",
"0.57728344",
"0.5772124",
"0.574556",
"0.5723942",
"0.5705548",
"0.5678587",
"0.5658498",
"0.56414247"... | 0.6722766 | 0 |
function for validate Technician Job Status | function validate_techStatus(){
if(document.frmTechStatus.cmbStatus.value == ''){
document.getElementById('lblcmbStatus').innerHTML = 'This field is required';
document.frmTechStatus.cmbStatus.focus();
return false;
}else{
document.getElementById('lblcmbStatus').innerHTML = '';
}
if(document.frmTech... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"validate() {\n let status = true;\n\n status = !this._validateLocalId() ? false : status;\n status = !this._validateUniqueWorkerId() ? false : status;\n status = !this._validateChangeUniqueWorkerId() ? false : status;\n status = !this._validateDisplayId() ? false : status;\n status = !this._valid... | [
"0.69316655",
"0.6210824",
"0.6140405",
"0.6125489",
"0.61049265",
"0.6047455",
"0.60474426",
"0.6039178",
"0.6034603",
"0.60020137",
"0.59935945",
"0.59881425",
"0.5964118",
"0.59323514",
"0.59212565",
"0.58975327",
"0.5886279",
"0.5880144",
"0.586536",
"0.586491",
"0.584794... | 0.66318065 | 1 |
validate waiting form function for validate Technician Job Status | function validate_WaitingParts(){
if(document.frmWaitingParts.waiting_parts_comments.value == ''){
document.getElementById('waiting_parts_commentslabel').innerHTML = 'This field is required';
document.frmWaitingParts.waiting_parts_comments.focus();
return false;
}else{
document.getElementById('waiting_parts_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_techStatus(){\n\t\tif(document.frmTechStatus.cmbStatus.value == ''){\n\t\t\tdocument.getElementById('lblcmbStatus').innerHTML = 'This field is required';\n\t\t\tdocument.frmTechStatus.cmbStatus.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblcmbStatus').innerHTML = ''... | [
"0.634906",
"0.6324075",
"0.6319893",
"0.62253934",
"0.61698544",
"0.61361384",
"0.60987675",
"0.6086299",
"0.60498124",
"0.60417235",
"0.6034776",
"0.60045105",
"0.59538746",
"0.593618",
"0.5920979",
"0.59150994",
"0.59029764",
"0.58855766",
"0.5882698",
"0.5881004",
"0.5876... | 0.65580857 | 0 |
for service price client validation | function validate_service_price_client(){
if(document.frmPrice.ServiceName.value == ''){
document.getElementById('lblServiceName').innerHTML = 'This field is required';
document.frmPrice.ServiceName.focus();
return false;
}else{
document.getElementById('lblServiceName').innerHTML = '';
}
if(document.frmPric... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isPriceFormValid(){\r\n return(ImcField_Client.isValid() && ImcField_Com.isValid() && PuplicField_Comp.isValid() && InternationalField.isValid() && PuplicField_Client.isValid() && ValidFromField.isValid());\r\n }",
"hasValidPrice (options) {\n return options.propertyInfo !== undefined &&\n typ... | [
"0.71391064",
"0.6693189",
"0.6629237",
"0.6562642",
"0.6470012",
"0.6407351",
"0.6352597",
"0.6305911",
"0.6285397",
"0.6258462",
"0.6257283",
"0.61828786",
"0.61442107",
"0.6118114",
"0.6104579",
"0.60863537",
"0.6067939",
"0.60473436",
"0.5994848",
"0.5991354",
"0.59649086... | 0.67675877 | 1 |
...................................................................................................// Validates and alerts the user if any of the changes in the child GV are not submitted yet to the server. | function ValidateChangesSubmitted(gvClientID)
{
var strDeletedRows = document.getElementById(gvClientID+'_hdnRowsToDelete').value;
// var areAllDataRows = EnsureDataInRows(gvClientID, strDeletedRows);
if(strDeletedRows.trim() != "")//Also make sure that deleted rows do not consist of blank rows.
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateFields() {\n var selected = $('#select-child').val();\n\n if (selected.length == 0) {\n $('#error-message').removeClass(\"hide\");\n $('#error-message').addClass(\"error\");\n $('#error-message').text('Please select at least 1 child.');\n return false;\n }\n ... | [
"0.58934635",
"0.5876713",
"0.5751803",
"0.56586444",
"0.5643241",
"0.56344354",
"0.55940455",
"0.5515496",
"0.55129385",
"0.5506224",
"0.5488418",
"0.5483886",
"0.548053",
"0.5463482",
"0.54609966",
"0.54609966",
"0.54609966",
"0.54609966",
"0.54609966",
"0.54609966",
"0.542... | 0.695602 | 0 |
...................................................................................................// Makes sure that atleast and atmost one record is selected in the gridview | function ValidateForSingleSelection(objGridView)
{
var selectionCntr = 0;
for( var i = 1; i < objGridView.rows.length; i++)
{
var checkBoxContainer = GetFirstChild(objGridView.rows[i].cells[0]);
if(checkBoxContainer.type && checkBoxContainer.type == "checkbox" && checkBoxContainer.checked ==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onRowSelection () {\n this.grid.selectedRows = this.$refs.grid.gridOptions.api.getSelectedRows();\n if (this.grid.selectedRows && this.grid.selectedRows.length) {\n this.grid.hasSelectedRows = true;\n }\n }",
"function isFieldDepsAndPageEntitlementsAfter_sel... | [
"0.62548584",
"0.6186659",
"0.6052561",
"0.6049298",
"0.600301",
"0.59221536",
"0.5911058",
"0.5873825",
"0.58659893",
"0.57462704",
"0.57334125",
"0.56976086",
"0.56835145",
"0.56410986",
"0.5624453",
"0.5596824",
"0.55793494",
"0.55775815",
"0.5574593",
"0.55578154",
"0.555... | 0.72272635 | 0 |
...................................................................................................// Toggles the checkbox selection in the specified grid view. | function ToggleSelection(gvClientID, sender)
{
if(sender.getAttribute("disabled") == 'disabled')
{
return;
}
var objGridView = document.getElementById(gvClientID);
for( var i = 1; i < objGridView.rows.length; i++)
{
var checkBoxContainer = GetFirstChild(objGridView.rows[i].cells... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleCheck(is_checked) {\n\t$('.tList td input:checkbox:enabled').each(function() {\n\t\tthis.checked = is_checked;\n\t});\n}",
"function GridViewCheck(objRef) {\n //Get the Row based on checkbox\n var row = objRef.parentNode.parentNode;\n\n if (objRef.checked) {\n row.style.backgroundC... | [
"0.63168675",
"0.6158865",
"0.61516505",
"0.61363626",
"0.60213006",
"0.58767176",
"0.5870096",
"0.5866175",
"0.58391094",
"0.582224",
"0.58108",
"0.5810168",
"0.57838094",
"0.57838094",
"0.57836694",
"0.5740248",
"0.57229596",
"0.57017565",
"0.57017565",
"0.56971306",
"0.568... | 0.7382475 | 0 |
...................................................................................................// Returns the sum of values in a specified column in the grid view. Note : trim function is defination is defined in common.js | function ColumnSum(gvClientID,colIndex)
{
var ucId=gvClientID.replace('_grdVwBranch','');
//Format of hdnAmounts: TotalAmt1-AmtColIndex1~TotalAmt2-AmtColIndex2~...........
var hdnCurrAction=$get('ctl00_cphPageContents_BtnsUC_hdnCurrAction');
var sumValue=0;
var parsedText=0;
if((IsPaging... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ColumnSumPositiveNegative(gvClientID,colIndex)\n{\n var objGridView = document.getElementById(gvClientID);\n var sumPositiveValue=0;\n var sumNegativeValue=0;\n var sumCorrected=0;\n var parsedText=0;\n var bothvalues=new Array();\n for( var i = 1; i < objGridView.rows.length; i++)\n... | [
"0.7331097",
"0.6952927",
"0.6382831",
"0.6299053",
"0.62657636",
"0.62293506",
"0.62177765",
"0.61897707",
"0.6107032",
"0.5898972",
"0.5879775",
"0.5829697",
"0.57882106",
"0.5726876",
"0.5701235",
"0.5698362",
"0.56509256",
"0.5639861",
"0.56227225",
"0.55786115",
"0.55015... | 0.70758 | 1 |
...................................................................................................// Returns the sum of values in a specified column in the grid view. Note : trim function is defination is defined in common.js | function ColumnSumPositiveNegative(gvClientID,colIndex)
{
var objGridView = document.getElementById(gvClientID);
var sumPositiveValue=0;
var sumNegativeValue=0;
var sumCorrected=0;
var parsedText=0;
var bothvalues=new Array();
for( var i = 1; i < objGridView.rows.length; i++)
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ColumnSum(gvClientID,colIndex)\n{\n \n var ucId=gvClientID.replace('_grdVwBranch','');\n //Format of hdnAmounts: TotalAmt1-AmtColIndex1~TotalAmt2-AmtColIndex2~...........\n var hdnCurrAction=$get('ctl00_cphPageContents_BtnsUC_hdnCurrAction');\n var sumValue=0;\n var parsedText=0; \n ... | [
"0.7075464",
"0.69523644",
"0.63832706",
"0.62986034",
"0.62655306",
"0.62292916",
"0.6216744",
"0.6189486",
"0.6105813",
"0.59000754",
"0.58800125",
"0.58282155",
"0.5789473",
"0.5726538",
"0.57010144",
"0.569882",
"0.5651181",
"0.5638255",
"0.56219256",
"0.5578202",
"0.5499... | 0.7330306 | 0 |
...................................................................................................// Set tab focus on next row | function SetFocusNextRow(e,sender)
{
var keyCode = e.keyCode||e.which;
if (keyCode==9) {
var idSplit=sender.id.split('_');
var rowIndex=parseInt(idSplit[4].replace('GVRow',''))+1;
var gridId=idSplit[0]+'_'+idSplit[1]+'_'+idSplit[2]+'_'+idSplit[3];
var rowSelector="#"+gridId+" t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"nextTab(focus) {\n const currentIndex = mathMax(this.currentTab, -1)\n const $tab = this.tabs.slice(currentIndex + 1).find(notDisabled)\n if (this.activateTab($tab) && focus) {\n this.focusButton($tab)\n this.emitTabClick($tab, focus)\n }\n }",
"function EztableLstTab(tbl, id... | [
"0.7261554",
"0.70269483",
"0.6868123",
"0.68461853",
"0.6837511",
"0.68334556",
"0.6764084",
"0.6728332",
"0.66869384",
"0.6657017",
"0.6624747",
"0.66180104",
"0.65927416",
"0.65647876",
"0.65496135",
"0.6526375",
"0.6472993",
"0.6470784",
"0.643189",
"0.6430569",
"0.641442... | 0.71323824 | 1 |
...................................................................................................// Reset COA Attribute for Job/Division when TextBox is empty Add on 271109 | function ReSetCOA(TBoxId)
{
//Account/Line TextBoxId
var curr = jQuery("#"+TBoxId);
//Get job/Division textbox id
curr = curr.parent('td').prev().children('input');
//Check Job/Division textbox length
if(curr.val().length=="0")
{
if(curr.attr('COA').length > 0)
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clairtxtBoxAmEdi(){\n document.getElementById(\"txtedNomEditeur\").value = \"\";\n // document.getElementById(\"cboxedPays\").value = 0;\n document.getElementById(\"cboxedVill\").value = 0;\n} // end clairtxtBoxAmEdi()",
"function clearChangeQA()\r\n{\r\n\t\t$('#cmbChangeQues1').val(\"\");\r\n\t\t$('#... | [
"0.6179228",
"0.608989",
"0.60106057",
"0.6002263",
"0.59775925",
"0.5976528",
"0.59753245",
"0.59597796",
"0.5939152",
"0.5930145",
"0.5927104",
"0.5920158",
"0.59105235",
"0.59018046",
"0.5893563",
"0.58848405",
"0.5862079",
"0.58580315",
"0.58528125",
"0.5852482",
"0.58495... | 0.799543 | 0 |
iboxTools Directive for iBox tools elements in right corner of ibox | function iboxTools($timeout) {
return {
restrict: 'A',
scope: true,
templateUrl: omsBasicHost+'biz/common/ibox_tools.html',
controller: function($scope, $element) {
// Function for collapse ibox
$scope.showhide = function() {
var ib... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function iboxTools($timeout) {\r\n return {\r\n restrict: 'A',\r\n scope: true,\r\n templateUrl: 'views/common/ibox_tools.html',\r\n controller: function ($scope, $element) {\r\n // Function for collapse ibox\r\n $scope.showhide = function () {\r\n ... | [
"0.60356724",
"0.6022593",
"0.60196716",
"0.5681711",
"0.55860466",
"0.5533115",
"0.54765195",
"0.5462512",
"0.5395474",
"0.53393775",
"0.53375614",
"0.53319967",
"0.5285139",
"0.52838373",
"0.52543837",
"0.5234492",
"0.52127385",
"0.5191392",
"0.5159738",
"0.5151646",
"0.514... | 0.60639495 | 0 |
iboxTools with full screen Directive for iBox tools elements in right corner of ibox with full screen option | function iboxToolsFullScreen($timeout) {
return {
restrict: 'A',
scope: true,
templateUrl: omsBasicHost+'biz/common/ibox_tools_full_screen.html',
controller: function($scope, $element) {
// Function for collapse ibox
$scope.showhide = function() {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function iboxToolsFullScreen($timeout) {\n return {\n restrict: 'A',\n scope: true,\n templateUrl: 'views/common/ibox_tools_full_screen.html',\n controller: function ($scope, $element) {\n // Function for collapse ibox\n $scope.showhide = function () {\n ... | [
"0.69853294",
"0.5873917",
"0.587275",
"0.5866349",
"0.58635914",
"0.5668782",
"0.56122744",
"0.56061894",
"0.5578556",
"0.5546695",
"0.5546695",
"0.5546695",
"0.5541238",
"0.55344397",
"0.5496331",
"0.54760116",
"0.54559153",
"0.5440345",
"0.5425683",
"0.541334",
"0.5393337"... | 0.6980389 | 1 |
end testing sample recipe goes through all the preference checks eliminates bad recipe matches then sorts good matches in order that they match preferences | function finalRecommendations(recipes) {
for (var r of recipes) {
dietCheck();
}
matchCheck();
cuisineCheck();
timeCheck();
for (var r of recipes) {
quickSort();
}
return recipes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sort (suggestions) {\n return suggestions.slice().sort((suggestion1, suggestion2) => {\n if (suggestion1.matchQuality !== suggestion2.matchQuality) {\n return suggestion2.matchQuality - suggestion1.matchQuality\n } else {\n return categoryPriority(suggestion1.category) - categoryPriority(... | [
"0.6011167",
"0.5672001",
"0.5601675",
"0.55817664",
"0.5548089",
"0.54217947",
"0.5417178",
"0.5399844",
"0.5396737",
"0.5384165",
"0.53608453",
"0.53542876",
"0.53370637",
"0.5322062",
"0.5316063",
"0.53089875",
"0.52919996",
"0.5287195",
"0.52763134",
"0.527166",
"0.525475... | 0.63974977 | 0 |
checks to see if each recipe recommended avoids diet restrictions | function dietCheck() {
for (var i = 0; i < recipes.length(); i++) {
var dietMatchCheck = ingredientsCompare(recipes[i].ingredients.toUpperCase(), restrictions.toUpperCase());
if (dietMatchCheck == false) {
recipes.push[recipes[i]];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isAcceptableRecipe(recipe, userDietaryRestrictions){\n return userDietaryRestrictions.every(function(userRestriction) {\n return recipe.dietaryRestrictions.includes(userRestriction);\n });\n }",
"function matchCheck(recipes, availableIngredients) {\n for (var i = 0; i < recipes.length(); i++) {\n ... | [
"0.7285876",
"0.6035103",
"0.6028673",
"0.5953655",
"0.59262675",
"0.5876729",
"0.5828407",
"0.5792183",
"0.57268286",
"0.5714373",
"0.5674794",
"0.56524277",
"0.56496274",
"0.55840826",
"0.55445504",
"0.5535968",
"0.55337113",
"0.5518371",
"0.5512972",
"0.54941946",
"0.54817... | 0.71003586 | 1 |
helper method to dietCheck() compares ingredients with restrictions to ensure nothing prohibitive is included in recipe recommendations | function ingredientsCompare(ingredients, dietRestrictions) {
for (var i = 0; i < ingredients.length(); i++) {
for (var j = 0; j < ingredients.length(); j++) {
if (ingredients[i] == dietRestrictions[j]) {
return false;
}
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dietCheck() {\n for (var i = 0; i < recipes.length(); i++) {\n var dietMatchCheck = ingredientsCompare(recipes[i].ingredients.toUpperCase(), restrictions.toUpperCase());\n if (dietMatchCheck == false) {\n recipes.push[recipes[i]];\n }\n }\n}",
"isAcceptableRecipe(recipe, userDietaryRestr... | [
"0.7750602",
"0.7348325",
"0.7061334",
"0.65396965",
"0.6392309",
"0.63471675",
"0.6265859",
"0.61097956",
"0.6020033",
"0.60053355",
"0.5957079",
"0.5878591",
"0.5878578",
"0.58717406",
"0.5863069",
"0.5855825",
"0.5839809",
"0.579568",
"0.5754501",
"0.5731015",
"0.571502",
... | 0.73957586 | 1 |
helper method to matchCheck() compares ingredients of recipe and ingredients available to ensure a satisfactory amount is already in stock | function matchCompare(matchRequirement, ingredients, availableIngredients) {
var matches;
var matchPercent = 100 * (matches / ingredients.length());
for (var i = 0; i < ingredients.length(); i++) {
for (var j = 0; j < availableIngredients.length(); j++) {
if (ingredients[i] == availableIngredients[j]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchCheck(recipes, availableIngredients) {\n for (var i = 0; i < recipes.length(); i++) {\n var matchCheck = matchCompare(matchRequirement, recipes[i].ingredients.toUpperCase(), availableIngredients.toUpperCase());\n if (matchCheck == false) {\n recipes.push[recipes[i]];\n }\n }\n}",
"f... | [
"0.7728356",
"0.6662216",
"0.62888116",
"0.60748625",
"0.6047387",
"0.6007554",
"0.5936991",
"0.59184647",
"0.5881742",
"0.58785754",
"0.5854766",
"0.5832204",
"0.57937443",
"0.57917756",
"0.57382727",
"0.5732223",
"0.5697586",
"0.56735575",
"0.5660741",
"0.5648495",
"0.56314... | 0.74346995 | 1 |
compares cuisine of recipe and cuisine preferred | function cuisineCheck(cuisineDish, cuisineDesired) {
for (var i = 0; i < cuisineDesired.length(); i++) {
for (var j = 0; j < cuisineDish.length(); j++) {
if (cuisineDesired[i] == cuisineDish) {
return true;
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasRecipe(clist,c) {\n if (!clist)\n return -1;\n var c2 = c.match(/(^[^+]*)\\+(.*$)/);\n if (c2) {\n c2 = c2[2] +' + '+c2[1];\n c2 = c2.replace(/\\+[\\s]*$/,'').replace(/ /g,' ').replace(/ *$/,'').replace(/^ */,'');\n }\n for (var i=0;i<clist.length;i++) {\n if... | [
"0.56011367",
"0.5578821",
"0.54597276",
"0.54163957",
"0.5391159",
"0.5338547",
"0.53006405",
"0.52887034",
"0.526698",
"0.52439076",
"0.52439076",
"0.5242465",
"0.5213648",
"0.5177113",
"0.5166541",
"0.5129817",
"0.51028967",
"0.507709",
"0.50372183",
"0.5012546",
"0.500630... | 0.55852467 | 1 |
compares desired time to complete and actual time recipes with prep time exceeding user range are eliminated | function timeCheck(recipes, timeHighCuisine, timeHighUser) {
for (var i = 0; i < recipes.length(); i++) {
if (timeHighCompare(recipes[i].timeHighCuisine, timeHighUser) == false) {
recipes.push(recipes[i]);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compareTimes(dest, grace)\n{\n var t1, t2, hr, min;\n var t1diff, t2diff, total, limit;\n\n t1 = document.getElementById('maincarpickuptime' + dest).value;\n t2 = document.getElementById('maincardropofftime' + dest).value;\n\n t1diff = new Number();\n t2diff = new Number();\n\n total ... | [
"0.6160996",
"0.60889655",
"0.6068671",
"0.57721037",
"0.5757274",
"0.57488745",
"0.57265633",
"0.5724029",
"0.5723747",
"0.5715147",
"0.5692808",
"0.5683844",
"0.5683844",
"0.5683006",
"0.56706476",
"0.566085",
"0.5660124",
"0.56403875",
"0.56368464",
"0.5634932",
"0.5634807... | 0.6621244 | 0 |
rearrange recipes from slowest to fastest sort method: selection sort | function quickSort(recipes) {
for (var i = 0; i < recipes.length(); i++) {
for (var j = i + 1; j < recipes.length(); j++) {
if(recipes[i].lowTime < recipes[j].lowTime) {
var x = recipes[i] ;
recipes[i] == recipes[j];
recipes[j] == x;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reorderResults(){\n ids=[];\n $('.resultholder .starblock').each(function(){\n ids.push($(this).prop('id'));\n });\n ids.sort();\n $rh = $('.resultholder');\n ids.forEach(function(id){\n $('#'+id).appendTo($rh);\n });\n }",
"function rearrange (d, i) {\n\t\t// reset all t... | [
"0.6228551",
"0.6221674",
"0.6212288",
"0.61138535",
"0.60418785",
"0.6018221",
"0.5983905",
"0.59835327",
"0.5982509",
"0.5979173",
"0.59050643",
"0.5901435",
"0.58999944",
"0.58820885",
"0.5879126",
"0.58579326",
"0.5857792",
"0.5850206",
"0.58468735",
"0.58448315",
"0.5838... | 0.6759646 | 0 |
Reset timerbar to 100% | function resetTimerBar() {
timerBar.style.transitionDuration = '0s';
timerBar.style.width = '100%';
timerBar.style.backgroundColor = '#71EC3F';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function healthBarReset() {\r\n oldHealth = maxHealth;\r\n healthDif = 0;\r\n if (intervalVar !== undefined) {\r\n clearInterval(intervalVar);\r\n }\r\n}",
"function healthBarReset() {\n oldHealth = maxHealth;\n healthDif = 0;\n if (intervalVar !== undefined) {\n clearInterval(... | [
"0.75178653",
"0.74925876",
"0.74848527",
"0.7369404",
"0.7189652",
"0.70869553",
"0.7023568",
"0.699338",
"0.6974514",
"0.6961518",
"0.6924944",
"0.6771355",
"0.67335993",
"0.67168707",
"0.6715339",
"0.6680629",
"0.66397035",
"0.66099906",
"0.65811396",
"0.65793186",
"0.6576... | 0.7770846 | 0 |
segment A little JavaScript class (without dependencies) to draw and animate SVG path strokes | function Segment(i,e,t,n){this.path=i,this.length=i.getTotalLength(),this.path.style.strokeDashoffset=2*this.length,this.begin="undefined"!=typeof e?this.valueOf(e):0,this.end="undefined"!=typeof t?this.valueOf(t):this.length,this.circular="undefined"!==n?n:!1,this.timer=null,this.animationTimer=null,this.draw(this.beg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"start() {\n var path =\n 'M1 1C1 1 62.1562 56.1927 101.659 72.1468C141.162 88.1009 207 95 207 95'; // an SVG path\n\n\n // path.setAttribute('transform', 'translate(50,50)');\n var pathAnimator;\n var startFromPercent = 0; // start from 10% of the path\n var stopAtPercent = 90; // stop at 9 0% ... | [
"0.70884824",
"0.68448687",
"0.6814961",
"0.6761685",
"0.67421246",
"0.6659847",
"0.6651559",
"0.6545309",
"0.6538295",
"0.6524304",
"0.646345",
"0.6430404",
"0.6429865",
"0.6425768",
"0.6401896",
"0.632261",
"0.6315743",
"0.6294898",
"0.6248134",
"0.62324685",
"0.6204171",
... | 0.7032753 | 1 |
Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. | function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1));
} finally {
outstandingRequestCount--;
if (outstandingRequestCount === 0) {
while (outstandingRequestCallbacks.length) {
try {
outstandingRequestCallbacks.pop()();
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while(outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();... | [
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7159645",
"0.7126252",
"0.7126252",
"0.7088254",
"0.69648546",
"0.69648546",
"0.6795259",
"0.6785734",
"0.6785734",
"0.5357326",
"0.52063054",
"0.51221895",... | 0.7173945 | 0 |
Get the data of India | function getIndia (month,year){
var arrLen = getMonthLabel(month, year);
var results = Array(arrLen).fill(0);
var index = 0;
for (var d in globaldata) {
var date = new Date(globaldata[d].date);
if ((date.getMonth() + 1) == month && date.getFullYear() == year){
index = date.ge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getData() {\n let covidApiEndpoint = 'https://disease.sh/v3/covid-19/countries/?q=yesterday';\n\n httpRequest(covidApiEndpoint, storeData);\n}",
"function GetAvalibleDistricts(){\n var url = config.api.url + \"wijk?ex={'k':'beschikbaar', 'v':'true'}\";\n $http({\n url: url... | [
"0.65766704",
"0.6239542",
"0.6145949",
"0.60664135",
"0.605281",
"0.6026169",
"0.6003964",
"0.5947349",
"0.591736",
"0.5911145",
"0.59078586",
"0.5907041",
"0.590328",
"0.58987534",
"0.5895541",
"0.58893156",
"0.5885151",
"0.58782816",
"0.58712685",
"0.5840941",
"0.58212733"... | 0.6580198 | 0 |
Get the data of Oscar | function getOscar (month,year){
var arrLen = getMonthLabel(month, year);
var results = Array(arrLen).fill(0);
var index = 0;
for (var d in globaldata) {
var date = new Date(globaldata[d].date);
if ((date.getMonth() + 1) == month && date.getFullYear() == year){
index = date.ge... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getStock() {\n const response = await fetch(\n `https://www.alphavantage.co/query?function=${this.timeFrame}&symbol=${\n this.symbol\n }&interval=${this.interval}&apikey=${this.apiKey}`\n );\n\n const responseData = await response.json();\n return responseData;\n }",
"function... | [
"0.59378606",
"0.57786024",
"0.567946",
"0.56649834",
"0.55911267",
"0.55713344",
"0.55713344",
"0.5545123",
"0.5533737",
"0.5518221",
"0.5497563",
"0.54925203",
"0.54900515",
"0.54829514",
"0.546656",
"0.5429643",
"0.54249465",
"0.54249465",
"0.5419358",
"0.54179865",
"0.541... | 0.6609357 | 0 |
combined Calcuating correlation and regression as one method as i couldnt figure two different method for displaying two values at the same time for react. | calcCorrelationRegression(){
// otherwise it keeps old constructor.
var aCalculator = new Calculator();
aCalculator.calculateRequirements(this.numbers);
if (this.submitStatus != true){
alert("Please submit two files first.");
} else {
aCalculator.calcCorrelation();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCrime(category) {\n\n //reinitialise empty array for chart points\n chartdata = [];\n\n //initialise empty arrays for holding regression data\n regdata = [];\n catArray = [];\n incArray = [];\n \n console.log(category);\n\n for(var i = 0; i < data.length; i++) {\n //loca... | [
"0.6270241",
"0.58906513",
"0.5760374",
"0.55766857",
"0.54958767",
"0.5486392",
"0.5433419",
"0.5427367",
"0.54106444",
"0.5391257",
"0.5385626",
"0.5377547",
"0.5299716",
"0.52397484",
"0.52247965",
"0.522065",
"0.5174577",
"0.51694226",
"0.5165501",
"0.5155045",
"0.5152101... | 0.5996439 | 1 |
Runs the browsersync proxy to a IIS server | function browserSyncProxy(url, done) {
const cfg = browserSyncProxyConf();
cfg.proxy.target = url;
cfg.port = config.browsersync.port;
cfg.open = config.browsersync.openBrowser;
imports.browserSync.init(cfg);
if(done) {
done();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function browsersyncServe(cb) {\n browsersync.init({\n proxy: \"http://127.0.0.1:5500/\", // put your local website link here\n });\n cb();\n}",
"async function serve() {\n\treturn browserSync.init({\n\t\t// proxy: \"mysite.com\",\n\t\tport: 1234,\n\t\ttunnel: false,\n\t\tonline: true,\n\t\tbrowser: \"goog... | [
"0.74851996",
"0.64154565",
"0.63002527",
"0.6218847",
"0.61599743",
"0.61538607",
"0.595153",
"0.5942794",
"0.5903654",
"0.5868937",
"0.5862483",
"0.5788547",
"0.56533426",
"0.55602896",
"0.5474921",
"0.54706246",
"0.5460553",
"0.54384995",
"0.5434243",
"0.53933585",
"0.5369... | 0.6741551 | 1 |
override ajaxSearch() in the .js file | function ajaxSearch(){
if(keyword.length > 0){
var query = keyword + create_filter_query();
}
else{
var query = 'lom.solr:all' + create_filter_query();
}
if(is_page_valid(page) == false){
page = 1;
}
createUrlHash();
//window.location.hash = "test";);
$.ajax({
url: '/blocks/openscout/proxy-sear... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchEngineAjax()\n{\n\t// Prepare Values\n\tvar siteURL = \"http://search.unifaction.com\";\n\tvar query = document.getElementById(\"searchInputID\").value;\n\t\n\t// Change the behavior if the first character is different\n\tif(query.charAt(0) == \"#\")\n\t{\n\t\tsiteURL = \"http://hashtag.unifaction.c... | [
"0.70211184",
"0.6969814",
"0.6968878",
"0.6957572",
"0.69573504",
"0.6862542",
"0.6845892",
"0.67986447",
"0.6788199",
"0.67879546",
"0.6735309",
"0.6718794",
"0.67039025",
"0.6681106",
"0.6656099",
"0.6581972",
"0.6574492",
"0.6569317",
"0.6565258",
"0.65567124",
"0.6551886... | 0.7376654 | 0 |
override ajaxSearchBeforeSend() in the .js file | function ajaxSearchBeforeSend(xhr){
$('#results').html('<h2><img src="images/ajax-loader-bar.gif" alt="ajax loader" /></h2>');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ajaxSearch(){\n\n\tif(keyword.length > 0){\n\t\t var query = keyword + create_filter_query();\n\t}\n\telse{\n\t\tvar query = 'lom.solr:all' + create_filter_query();\n\t}\n\t\n\tif(is_page_valid(page) == false){\n\t\tpage = 1;\n\t}\n\t\n\tcreateUrlHash();\n\t//window.location.hash = \"test\";);\n\t\n\t$.aj... | [
"0.7043237",
"0.65640223",
"0.6533195",
"0.6525866",
"0.6491157",
"0.6333612",
"0.6298439",
"0.6288198",
"0.62482417",
"0.6221706",
"0.62126815",
"0.61838984",
"0.6150723",
"0.6150658",
"0.60616565",
"0.6055998",
"0.6047938",
"0.60310614",
"0.6016843",
"0.6016843",
"0.6013125... | 0.69763064 | 1 |
override ajaxGetPage() in the .js file | function ajaxGetPage(cpage){
if(keyword.length > 0){
var query = keyword + create_filter_query();
}
else{
var query = 'lom.solr:all' + create_filter_query();
}
page = cpage;
$('#results').html('<h2 class="title"><img src="images/ajax-loader-bar.gif" alt="ajax loader" /></h2>');
$.ajax({
url: '/blocks/ope... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ajax_gopage(page, obj)\r\n{\r\n\tobj.pageNo.value=page;\r\n\tloadData();\r\n}",
"function getPages() {\n jQuery.ajax({\n type: 'POST',\n dataType: \"json\",\n url: 'helpers/getPages.php',\n data: { domain: options.domain },\n beforeSend: func... | [
"0.64981586",
"0.64546466",
"0.6372139",
"0.6371429",
"0.6371429",
"0.62748486",
"0.62605214",
"0.6242617",
"0.621577",
"0.6177129",
"0.6177129",
"0.61513513",
"0.6100089",
"0.6077251",
"0.6075724",
"0.6049436",
"0.6039037",
"0.60254693",
"0.6024396",
"0.5989246",
"0.5966344"... | 0.6919883 | 0 |
override shorten() in the .js file | function shorten(x)
{
return(x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"minify() {\n\n }",
"function minifyJs() {\n return Elixir.Plugins.uglify(\n Elixir.config.js.uglify.options\n );\n}",
"function updateShortcode(obj){\r\n var cu = jQuery(obj).parents('.code-util')\r\n if(cu.length>0){\r\n var txt = jQuery(cu).find('.sCodeTXT')\r\n ... | [
"0.61031085",
"0.5822267",
"0.57885706",
"0.5740522",
"0.5704829",
"0.5554284",
"0.5514616",
"0.5500144",
"0.54576814",
"0.54108816",
"0.5355656",
"0.5339028",
"0.5325245",
"0.5304281",
"0.52763516",
"0.5273325",
"0.5256469",
"0.52356684",
"0.52242106",
"0.5206531",
"0.520036... | 0.65680903 | 0 |
STATE FUNCTIONS Functions for changing or getting the player choosing state | function setChoosingStateOn() {
playerIsChoosing = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PendingPlayerState() { }",
"function getState() {\r\n return playerState_;\r\n }",
"stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }",
... | [
"0.72459966",
"0.7070983",
"0.6995006",
"0.68938357",
"0.6720926",
"0.66978097",
"0.6674918",
"0.66292405",
"0.6622211",
"0.66115177",
"0.6608109",
"0.65985584",
"0.65497404",
"0.654495",
"0.652984",
"0.6516438",
"0.6510905",
"0.6489642",
"0.64850825",
"0.64629066",
"0.645013... | 0.7641154 | 0 |
MOVEMENT FUNCTIONS Function to move the player sprite to the cursor | function moveToCursor(cursorVect, startPlayerVect, hoverAnimation) {
// Target vector is a vector from the player to the cursor to which it will move
var targetVect = vectorMath.subtract(cursorVect, startPlayerVect);
var targetNorm = vectorMath.normalize(targetVect);
var targetMagnitude = vectorMath.magnitude(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function movePlayer() {\n screenWarping(\"player\");\n playerX += playerVX;\n playerY += playerVY;\n}",
"changeCursor() {\n if (Dotf.game.input.activePointer.isDown) this.sprite.cursor.sprite.loadTexture('bulleta_cursor2');\n else this.sprite.cursor.sprite.loadTexture('bulleta_cursor1');\n }"... | [
"0.67762613",
"0.6665994",
"0.66238755",
"0.6605333",
"0.65918756",
"0.65828085",
"0.656739",
"0.655694",
"0.6521479",
"0.6485218",
"0.64706963",
"0.6469357",
"0.6458123",
"0.64508075",
"0.6441036",
"0.6429909",
"0.64225525",
"0.64187783",
"0.6382309",
"0.6375684",
"0.6351005... | 0.672938 | 1 |
Add or remove movement options | function setMovementOptions(stage) {
if (playerIsChoosing) {
addMovementOptions(stage);
}
else {
removeMovementOptions();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMovementOptions(stage) {\n\t\tvar rollValue = dice.getDiceValue();\n\t\t// Set origin at which to start drawing movement options\n\t\tvar originX = playerContainer.x - rollValue * 32;\n\t\tvar originY = playerContainer.y - rollValue * 16;\n\t\t// Draw as map is drawn (see setMap function)\n\t\tvar offS... | [
"0.7154553",
"0.58834714",
"0.5848286",
"0.5784143",
"0.56019497",
"0.5535143",
"0.5508562",
"0.55076975",
"0.54588634",
"0.5445741",
"0.5433614",
"0.5430068",
"0.5351221",
"0.5340088",
"0.5274496",
"0.5251205",
"0.52164644",
"0.52060395",
"0.52059007",
"0.5201711",
"0.519684... | 0.66646564 | 1 |
RENDER Set the player to the stage | function setPlayer(stage) {
var offSet = playerIndexY%2 == 0 ? 0 : 32;
playerContainer.x = offSet + playerIndexX * 64;
playerContainer.y = playerIndexY * 16;
stage.addChild(playerContainer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render() {\n gameScreen.clearScreen();\n player.render(gameScreen.context);\n}",
"function render() {\n \n //Update camera\n ctx.save();\n const camerax = (canvas.width/2)-(player.x);\n const cameray = (canvas.height/2)-(player.y);\n ctx.clearRect(-canvas.width,-canvas.height,canva... | [
"0.75889707",
"0.7003866",
"0.6876372",
"0.68597615",
"0.6809545",
"0.67920727",
"0.67920727",
"0.67905784",
"0.67742735",
"0.676925",
"0.6755843",
"0.6711709",
"0.6708069",
"0.670163",
"0.6694866",
"0.6680268",
"0.66777426",
"0.66777426",
"0.6668799",
"0.6659487",
"0.6650839... | 0.7069013 | 1 |
POST subscribe an email to a list. | function subscribe(req, res) {
const io = req.app.get('socketio');
mc.lists.subscribe({ id: process.env.LIST_ID, email: { email: req.body.email } }, data => {
io.emit('error', 'Successfully subscribed! Stay tuned for updates and get excited!');
console.log('successful subscription');
res.send('done');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function subscribe(email, page, list, fname, lname) {\n if(checkemail(email)){\n successMessage = 'Thank you for your registration. Please check your email to confirm.';\n data = \"email=\"+email.replace(\"@\",\"%40\")+\"&htmlemail=1&makeconfirmed=1&list%5B\"+list+\"%5D=signup&subscribe=subscribe&attribute5=\"... | [
"0.69371945",
"0.64469683",
"0.64159155",
"0.5653708",
"0.5594504",
"0.55547553",
"0.55234337",
"0.54903454",
"0.5474949",
"0.5416069",
"0.5341937",
"0.528634",
"0.52832127",
"0.5271274",
"0.5268793",
"0.52684385",
"0.52555597",
"0.52414745",
"0.52209616",
"0.5216104",
"0.521... | 0.66321397 | 1 |
Linear interpolation Precise method, which guarantees v = v1 when t = 1. | function lerp(v0, v1, t) {
return (1 - t) * v0 + t * v1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function interpolate(p0, p1, t) {\n return new Vector(\n p0.x * (1 - t) + p1.x * t,\n p0.y * (1 - t) + p1.y * t);\n }",
"function lerp(x, x1, x2, v1, v2) {\n return ((x2 - x) / (x2 - x1)) * v1 + ((x - x1) / (x2 - x1)) * v2;\n}",
"function _interpolate(a, b, t) {\n\t return ((1 - t) ... | [
"0.7422632",
"0.66146874",
"0.6598878",
"0.6539092",
"0.65368706",
"0.65043545",
"0.65043545",
"0.6445794",
"0.6374172",
"0.63003767",
"0.6234117",
"0.61980736",
"0.6173934",
"0.6173934",
"0.61388457",
"0.6137577",
"0.61214316",
"0.61083126",
"0.60960543",
"0.60772693",
"0.60... | 0.7189193 | 1 |
An enhanced version of `typeof` that handles arrays and dates as well. | function type(value){
return (
Array.isArray(value) ? "array" :
value instanceof Date ? "date" :
typeof value
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AsYouType_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { AsYouType_typeof = function _typeof(obj) { return typeof obj; }; } else { AsYouType_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== ... | [
"0.6959048",
"0.6737822",
"0.67288154",
"0.6682263",
"0.66400415",
"0.66400415",
"0.66386527",
"0.6633646",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",
"0.6583566",... | 0.69010687 | 1 |
Constructs a template function with `parameters` property. | function Template(fn, parameters){
fn.parameters = parameters;
return fn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function evalTemplate(s, params) {\n return Function(...Object.keys(params), \"return \" + s)\n (...Object.values(params));\n}",
"function to_template_wikitext(parameters, options) {\r\n\t\tvar keys = Object.keys(parameters), template_name, is_continue = true;\r\n\t\tif (options) {\r\n\t\t\tif (typeof opti... | [
"0.5599958",
"0.55074227",
"0.54068196",
"0.53964376",
"0.5368548",
"0.53259563",
"0.53169066",
"0.5250823",
"0.5239922",
"0.51319593",
"0.51284117",
"0.5082324",
"0.5037428",
"0.50051576",
"0.4990279",
"0.49777937",
"0.49010056",
"0.48865488",
"0.48615426",
"0.48564783",
"0.... | 0.79506993 | 0 |
Limpa o array de taxas que foram alteradas (para salvar). | function limparTaxasParaSalvar() {
$scope.taxasAdministrativas.forEach((taxaAdm) => {
taxaAdm.listaSalvar = [];
});
$scope.taxasAdministrativasSalvar = []
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applyTaxToItems(user){\n const {cart} = user;\n const taxRate = 1.3;\n const updatedCart = cart.map(item => {\n return {}\n })\n}",
"limparArray() {\n this.erros.forEach((value, indice) => {\n this.erros.splice(indice);\n });\n }",
"function applyTaxToIte... | [
"0.60726035",
"0.6047785",
"0.599548",
"0.5771025",
"0.5753496",
"0.5698338",
"0.56969815",
"0.56715494",
"0.56656265",
"0.5657609",
"0.56347245",
"0.5609127",
"0.5542671",
"0.54882103",
"0.5442085",
"0.5420506",
"0.5412552",
"0.54068094",
"0.53876054",
"0.5378105",
"0.534500... | 0.70684046 | 0 |
A function called right after createElement returns with el, but before the fully rendered element is returned to the render caller. Run any first render hooks here. The load and unload hooks are added at this stage. Do not attempt to rerender in beforerender as the component may not be in the DOM yet. | beforerender (el) {
console.log('Component is about to be rendered for the first time')
// this is where you can register other lifecycle events:
// on.resize()
// on.ready()
// on.intersect()
// on.idle()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mount(el) {\n if (el.firstElementChild) {\n el.firstElementChild.remove();\n }\n this.preRendered = this.render();\n if (this.preRendered) {\n el.appendChild(this.preRendered.render());\n }\n }",
"postRender() {\n // Take component render method and apply UUID\n const comp... | [
"0.73379797",
"0.63437593",
"0.63149744",
"0.60904026",
"0.6028989",
"0.6015587",
"0.59754974",
"0.59754974",
"0.59423393",
"0.5926956",
"0.59069663",
"0.59008586",
"0.5894653",
"0.5893827",
"0.58906955",
"0.58482474",
"0.58444774",
"0.58388525",
"0.5806639",
"0.58000934",
"0... | 0.70183337 | 1 |
Called when the component is mounted on the DOM. Uses onload under the hood. | load (el) {
console.log('Component was mounted on the DOM')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onload() {\n this.init();\n }",
"componentDidMount() {\n this.onLoad();\n }",
"function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }",
"createdCallback() {\n\t // component will mount only if part of the active document\n\t ... | [
"0.71687746",
"0.7103692",
"0.70617354",
"0.6972162",
"0.69652283",
"0.6919445",
"0.69076437",
"0.6840064",
"0.6813858",
"0.67429495",
"0.67311186",
"0.67311186",
"0.67311186",
"0.660775",
"0.6510005",
"0.65083784",
"0.650525",
"0.64949846",
"0.649117",
"0.6475369",
"0.647536... | 0.7346671 | 0 |
Called after a component is reordered. This method is rarely needed, but is handy when you have a component that is sensitive to temorary removals from the DOM, such as externally controlled iframes or embeds (e.g. embedded tweets) | afterreorder (el) {
console.log('Component moved in the DOM')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"postRender() {\n // Take component render method and apply UUID\n const componentElement = this.render();\n\n componentElement.setAttribute('data-component', this.uuid);\n\n this._element = componentElement;\n this.postUpdate();\n }",
"internalComponentsUpdated() {\n ... | [
"0.6204875",
"0.6132997",
"0.59411204",
"0.58414394",
"0.58120126",
"0.58112925",
"0.58112925",
"0.5793167",
"0.5780015",
"0.5776717",
"0.5775724",
"0.57683045",
"0.5739231",
"0.5738563",
"0.5727885",
"0.5683946",
"0.5628952",
"0.56200427",
"0.56200427",
"0.5617972",
"0.56061... | 0.78782177 | 0 |
Exposes the S3.putBucketPolicy API method | function PutBucketPolicy(event, context) {
base.Handler.call(this, event, context);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setBucketPolicy(bucketName, policy, cb) {\n // Validate arguments.\n if (!isValidBucketName(bucketName)) {\n throw new errors.InvalidBucketNameError(`Invalid bucket name: ${bucketName}`)\n }\n if (!isString(policy)) {\n throw new errors.InvalidBucketPolicyError(`Invalid bucket policy: ${polic... | [
"0.76175004",
"0.7209913",
"0.68527037",
"0.6648963",
"0.6252604",
"0.62280905",
"0.61279315",
"0.61083794",
"0.60765517",
"0.59801584",
"0.59599113",
"0.5924629",
"0.5924369",
"0.57619023",
"0.57619023",
"0.5736447",
"0.57278824",
"0.57174814",
"0.56549174",
"0.5591243",
"0.... | 0.76836467 | 0 |
Get an existing Network resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, state, opts) {
return new Network(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get(name, id, state, opts) {\n return new NetworkInterface(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"getStateInternal(id) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n return currentStateValue... | [
"0.576996",
"0.55448127",
"0.5391334",
"0.5391334",
"0.51933515",
"0.5048811",
"0.49461094",
"0.49395797",
"0.49048814",
"0.48276857",
"0.47923467",
"0.47656694",
"0.47656304",
"0.47039282",
"0.4662327",
"0.4661764",
"0.46548873",
"0.46515694",
"0.46478587",
"0.45928022",
"0.... | 0.60816354 | 0 |
Returns true if the given object is an instance of Network. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process. | static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Network.__pulumiType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === NetworkInterface.__pulumiType;\n }",
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n ... | [
"0.6707617",
"0.6510022",
"0.6510022",
"0.62397385",
"0.6074057",
"0.5899349",
"0.58013386",
"0.5780062",
"0.5763021",
"0.57558554",
"0.572364",
"0.5715475",
"0.5710118",
"0.5597991",
"0.5545431",
"0.5528089",
"0.5512986",
"0.5480619",
"0.5448466",
"0.5441587",
"0.54157937",
... | 0.6957737 | 0 |
sets the gold total to the of villagers times the amount of gold each one generates per second | function addGold(){
user.gold += user.villagerCount * villager.goldPerSec;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateGoldNewTurn() {\n gold += getGoldPerTurn();\n }",
"function refreshGold(gAdd=0){\n if (gAdd+gold >=0){\n gold+=gAdd;\n }\n if (gold==0){\n goldElement.textContent = `Gold: *nothing*`;\n }\n goldElement.textContent = `Gold: ${Mat... | [
"0.7351294",
"0.71605974",
"0.69972587",
"0.66826004",
"0.6677749",
"0.6578444",
"0.6413126",
"0.63135225",
"0.63054496",
"0.6260667",
"0.626038",
"0.6236967",
"0.619274",
"0.6189179",
"0.61444175",
"0.61379546",
"0.6079576",
"0.6076622",
"0.6047212",
"0.5962868",
"0.595265",... | 0.7754284 | 0 |
Buy Fisherman adds a fisherman if the user has enough gold to purchase. Then it increases the cost of a fisherman and updates the appropriate displays | function buyFisherman() {
var addFisherman = user.addFisherman();
if(addFisherman){
fisherman.increaseFishermanCost();
updateGold();
updateFisherman();
}
else{ //handles error and error message
document.getElementById("error").innerHTML = "You cannot buy a fisherman!";
document.getElementByI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buyEggStock() {\r\n\tdemand += 0.001;\r\n\teggs++;\r\n\tgold -= currentEggPrice;\r\n\r\n\tcheckAllPrices();\r\n\taddEggs();\r\n\taddGold();\r\n}",
"function buyFrig() {\r\n if(player.gold.num >= player.frigate.price && player.influence >= player.frigate.infMin) {\r\n player.frigate.num++;\r\n ... | [
"0.6759926",
"0.6673913",
"0.6643921",
"0.6561372",
"0.6499979",
"0.6488153",
"0.647841",
"0.647796",
"0.64704525",
"0.64350957",
"0.6379263",
"0.63402337",
"0.6324583",
"0.63041717",
"0.6302638",
"0.6271887",
"0.6260482",
"0.6250997",
"0.6232059",
"0.62034464",
"0.6195239",
... | 0.7978986 | 0 |
Buy Villager adds a villager if the user has enough fish to purchase. Then it increases the cost of a villager and updates the appropriate displays | function buyVillager() {
var addVillager = user.addVillager();
if(addVillager){
villager.increaseVillagerCost();
updateFish();
updateVillagers();
}
else{ //handles error and error messages
document.getElementById("error").innerHTML = "You cannot buy a villager!";
document.getElementById("err... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function purchaseUpgrade() {\n var val = $(this).attr(\"id\");\n switch (val) {\n case \"squareUpgrade\": // square\n val = squares;\n break;\n case \"circleUpgrade\": // circle\n val = circles;\n break;\n ca... | [
"0.68565583",
"0.68265253",
"0.68015784",
"0.6785056",
"0.6737525",
"0.672826",
"0.6716739",
"0.6715913",
"0.6657523",
"0.66462696",
"0.66329014",
"0.6616769",
"0.65264225",
"0.6525073",
"0.6504972",
"0.6478851",
"0.64069784",
"0.64061874",
"0.6398784",
"0.6397639",
"0.639443... | 0.7731488 | 0 |
Cambiara los id de los dataStreams al cargarlos del indice semanticos | function cambiarIdsDataSreams()
{
var contDataStream = 0;
//Cambiara todos los id de los tags obtenidos
while(true){
if(document.getElementById("dataStream00")){
//cambia el id de el contenedor de la informacion del dataStream
elemento = document.getElementById("dataStream0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function id(dataset) {\n return dataset.id;\n }",
"function idData(incomingData) {\n //Reference to the html Demographic Info box\n let ul = d3.select('#sample-metadata')\n //Clears out data so new id can fillin\n ul.html('')\n //Gets the demographic data for the id selected, appends inf... | [
"0.5760864",
"0.5734013",
"0.55965257",
"0.5585349",
"0.5494102",
"0.54419875",
"0.54412574",
"0.54164505",
"0.5352923",
"0.5307302",
"0.530431",
"0.52867115",
"0.52559394",
"0.5251033",
"0.52359885",
"0.52359885",
"0.52083576",
"0.5186407",
"0.5186407",
"0.51667225",
"0.5163... | 0.652508 | 0 |
agrega un tag dinamicamente al dataStream seleccionado | function agregarTagDataStream(comp)
{
// obtiene el id del dataStream actual
var id = comp.id;
id=id.replace(/ |buttonAgregarTagDataStream/g, "");
var dataStreamActual=id;
// obtiene los valores de los tags del dataStream seleccionado
var tagsDataStreamEspanol=document.getElementById(("inputTag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eliminarTagDataStream(comp){\n //obtiene el id del tag seleccionado\n var id = comp.id;\n id=id.replace(/ |button/g, \"\");\n var node = document.getElementById(id);\n // se elimina el tag del dataStrean\n node.parentNode.removeChild(node);\n var ids=id.split(\"DataStream\"); \n //... | [
"0.638342",
"0.56833977",
"0.56610996",
"0.5648998",
"0.5648998",
"0.5648998",
"0.5648998",
"0.55597824",
"0.5536334",
"0.5508268",
"0.54297423",
"0.53537995",
"0.53523076",
"0.53231657",
"0.52962935",
"0.5242367",
"0.52390134",
"0.52103645",
"0.52103645",
"0.52103645",
"0.52... | 0.67399126 | 0 |
console.time('Long loop'); doImportantThing(); console.timeEnd('Long loop'); | function timeMe(functionToTime) {
console.time('Long loop');
console.log(functionToTime);
functionToTime();
console.timeEnd('Long loop');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doStuff() {\n\t// do stuff that takes longer than 100ms to execute\n}",
"function mainLoop()\r\n{\r\n\tvar startTime = performance.now();\r\n}",
"function testTime(num){\n let start = Date.now();\n console.time(\"execTime\");\n function a(){\n console.timeEnd(\"execTime\");\n co... | [
"0.7974604",
"0.7216162",
"0.66171503",
"0.6549429",
"0.6488361",
"0.63228667",
"0.62335235",
"0.62129086",
"0.6137154",
"0.609925",
"0.60798156",
"0.60330695",
"0.5986399",
"0.59613514",
"0.5942879",
"0.5920836",
"0.5905725",
"0.5888725",
"0.587861",
"0.5875728",
"0.58754367... | 0.7718157 | 1 |
Segunda generar teclas para el juego | function generarTeclas(niveles){
//.fill(valor) nos sirve para rellenar el array de valores que luego el .map reemplazará
return new Array(niveles).fill(0).map(generarTeclaAleatoria)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTeclas(){\n\tvar teclas = getData('teclas', teclado, 'default');\n\tfor(var t in teclas) teclado[t] = teclas[t];\n\treturn teclado;\n}",
"function generarCola(usuario,permiso) {\n\tconsole.log(\"generamos cola\");\n\tlet tabla = {\n\t\t\"datos\":[\n\t\t\t{\n\t\t\t\t\"Estado\":\"Genera permiso\",\n\t\... | [
"0.6824796",
"0.603876",
"0.6018405",
"0.59835476",
"0.5948991",
"0.5946559",
"0.59181005",
"0.58814675",
"0.5867453",
"0.58638453",
"0.58389294",
"0.58253264",
"0.5822948",
"0.57809055",
"0.57595325",
"0.5753423",
"0.5746862",
"0.5707413",
"0.56764233",
"0.56764233",
"0.5659... | 0.626915 | 1 |
Check to see if this board does have a form for it | static check_board(){
let page = proboards.data("page");
if(page && page.board && page.board.id){
let board_id = parseInt(page.board.id, 10);
let form = this.settings.fetch_form(board_id);
if(form && this.form_can_be_used(form.apply_to)){
let form_data = this.settings.fetch_all_form_data(form);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInForm(elem) {\n var parent = elem.parentNode;\n while (parent) {\n if (parent.nodeName.toLowerCase() === \"form\") {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n }",
"hasValidForm() {\n return this.formConfig !== false;\n }",
"h... | [
"0.64475316",
"0.62453556",
"0.6160447",
"0.61480695",
"0.6146838",
"0.60323954",
"0.6006778",
"0.6003342",
"0.59984624",
"0.59928817",
"0.59660834",
"0.5937618",
"0.5932808",
"0.5923652",
"0.588318",
"0.5846043",
"0.58453596",
"0.5843937",
"0.58427835",
"0.58427167",
"0.5833... | 0.7286757 | 0 |
addToggledCards allows us to chose the clickTarget and add it to the toggledCards array | function addToggledCards(clickTarget){
toggledCards.push(clickTarget);
console.log(toggledCards);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToggleCard(clickTarget) {\n toggledCards.push(clickTarget);\n}",
"function addToggleCard(clickTarget) {\n\ttoggledCards.push(clickTarget);\n}",
"function addToggleCard(clickTarget) {\n\ttoggledCards.push(clickTarget);\n}",
"function addToggleCard(clickedCard) {\n flipCards.push(clickedCard);\... | [
"0.857822",
"0.83015186",
"0.83015186",
"0.782622",
"0.7534566",
"0.75296193",
"0.7474514",
"0.7219827",
"0.7186088",
"0.7103145",
"0.70708054",
"0.6876299",
"0.68679494",
"0.68666637",
"0.6750133",
"0.6667578",
"0.66575235",
"0.65930486",
"0.6584544",
"0.65436345",
"0.647575... | 0.8691971 | 0 |
arr[] > Input Array data[] > Temporary array to store current combination start & end > Staring and Ending indexes in arr[] index > Current index in data[] r > Size of a combination to be printed | function combinationUtil(arr, data, start,
end, index, r)
{
// Current combination is ready to be printed, print it
if (index == r)
{
var sum = 0;
for (var j=0; j<r; j++)
{
sum += parseInt(data[j]);
console.log(data[j]+" ");
console.log("");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateCombinations (arr) {\n const combinations = []\n const result = []\n\n const n = arr.length\n // keep track index in each of the n arrays\n const indices = new Array(n).fill(0)\n\n while (true) {\n let tmp = []\n\n // store current combination\n for (var i = 0; i < n; i++) { \n ... | [
"0.65934837",
"0.6191769",
"0.57146037",
"0.5673352",
"0.5662959",
"0.56468713",
"0.56468713",
"0.558398",
"0.558398",
"0.55436283",
"0.5492174",
"0.54596955",
"0.54388386",
"0.540166",
"0.5398057",
"0.53667843",
"0.53424007",
"0.5327962",
"0.5284527",
"0.5282935",
"0.5277744... | 0.72921026 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.