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 |
|---|---|---|---|---|---|---|
A representative can add a shopkeeper to itself. | async function addShopkeeper(req, res) {
if (req.user.user == 'representative') {
const shopkeeper = new ShopkeeperModel(req.body);
shopkeeper.representative_id = req.user._id;
const doc = await shopkeeper.save();
return res.status(200).json({ doc, message: "Shopkeeper Successfully A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add( name, parent, service ) {\n\t\t\t\n\t\t\t// parent is optional, and therefore might actually be the service object\n\t\t\tif( $.isPlainObject( parent ) ) {\n\t\t\t\tservice = parent;\n\t\t\t\tparent = false;\n\t\t\t} \n\t\t\t\n\t\t\t// Parent needs to be the name of a service that exists\n\t\t\tif( $... | [
"0.5786281",
"0.5381864",
"0.52687687",
"0.5216422",
"0.51955664",
"0.5107022",
"0.510273",
"0.5065375",
"0.5059439",
"0.5059216",
"0.5034523",
"0.50229543",
"0.49899042",
"0.49881312",
"0.4936958",
"0.49367186",
"0.49303344",
"0.4913289",
"0.48962858",
"0.48846617",
"0.48739... | 0.651173 | 0 |
A representative can add his visits for a day. | async function visitLog(req, res) {
try {
if (req.user.user == 'representative') {
const representative = await RepresentativeModel.findById(req.user._id);
representative.visits.push({
date: new Date(req.body.date).getDate(),
location: req.body.locatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async addVisit(log, data) {\n const result = await this.request(`visits/${log}`, data, 'post');\n return result;\n }",
"function createToday(){\n\t\tvar dag = YCAFE.Dashboard.db.ref(\"dailyVisitors/\" + YCAFE.Dashboard.today + \"/visitors\").push();\n\t\tdag.set(YCAFE.staffMember);\n\t}",
"functi... | [
"0.5892695",
"0.5740098",
"0.56974614",
"0.56825525",
"0.5561605",
"0.5456508",
"0.5370474",
"0.5333724",
"0.5323336",
"0.5295373",
"0.5234714",
"0.5204357",
"0.5173056",
"0.5157845",
"0.51549375",
"0.5139708",
"0.51244926",
"0.51157016",
"0.51021785",
"0.51003313",
"0.508495... | 0.64639014 | 0 |
Groups a list of complex properties into a hierarchy that is fit for display in a fancy table. See also: buildTableHeaders below | function groupProperties(complexProps) {
var groupedProps = new OrderedMap();
function groupProp(complexProp, map) {
var props = complexProp.split(":");
if (props.length === 1){
map.setIfAbsent(complexProp,new OrderedMap());
return;
}
var innerMap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildTableHeaders(groupedProps) {\n var rows = [];\n function forcePush(idx, val) {\n rows[idx] = rows[idx] || [];\n rows[idx].push(val);\n }\n function header(value, columnspan) {\n return node(\"th\",value,{colspan:columnspan});\n }\n function padTo(idx,amt) {\n ... | [
"0.68713063",
"0.5818254",
"0.58087474",
"0.5808601",
"0.57988155",
"0.5735269",
"0.56648266",
"0.559713",
"0.5594276",
"0.55832165",
"0.55338645",
"0.5512115",
"0.54836285",
"0.54291785",
"0.53963816",
"0.53679967",
"0.5361164",
"0.5343274",
"0.52268595",
"0.5226107",
"0.520... | 0.72852844 | 0 |
Given some grouped properties, returns a thead element with one or more rows to form the header for a fancy table. | function buildTableHeaders(groupedProps) {
var rows = [];
function forcePush(idx, val) {
rows[idx] = rows[idx] || [];
rows[idx].push(val);
}
function header(value, columnspan) {
return node("th",value,{colspan:columnspan});
}
function padTo(idx,amt) {
rows[idx] = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_tbodies_headings(group){\n // escape invalid characters for jquery selectors\n if (_.contains(_.range(10), parseInt(group.slice(0,1)))){\n temp_group = \"id\" + group;\n } else {\n temp_group = group;\n }\n // add app... | [
"0.7012493",
"0.6845081",
"0.6705582",
"0.6510074",
"0.646701",
"0.64261043",
"0.64256066",
"0.64129484",
"0.6334252",
"0.63280183",
"0.630585",
"0.6270576",
"0.62594223",
"0.6251625",
"0.62132233",
"0.6202095",
"0.6186601",
"0.6167623",
"0.6141432",
"0.6141432",
"0.6136186",... | 0.81809556 | 0 |
Returns the best html representation of `value` it can. If the given item is associated with a freebase topic, it's linked to. If it's an array, then an html tree will be returned, though it will be wrapped up so that only a few items are visible initially, with the ability to expand the list out. | function displayValue(value) {
if ($.isArray(value)){
if (value.length === 1)
return displayValue(value[0]);
return wrapForOverflow($.map(value, displayValue));
}
if (value == undefined || value == null)
return "";
if (value.displayValue)
return value.displayV... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatValue(value, valueToHtml, maxDepth) {\n if ((0, _vegaUtil.isArray)(value)) {\n return `[${value.map(v => valueToHtml((0, _vegaUtil.isString)(v) ? v : stringify(v, maxDepth))).join(', ')}]`;\n }\n\n if ((0, _vegaUtil.isObject)(value)) {\n let content = '';\n\n const _a = value,\n ... | [
"0.64012986",
"0.63740045",
"0.63546485",
"0.56347924",
"0.5571839",
"0.54948515",
"0.54139614",
"0.53477836",
"0.5331655",
"0.5294834",
"0.5273475",
"0.5239872",
"0.5187848",
"0.51683056",
"0.5141088",
"0.5134764",
"0.5126093",
"0.5126093",
"0.5105418",
"0.51031035",
"0.5079... | 0.6437101 | 0 |
The Task and Tag Service | function taskService(Task, Tag, store, $filter) {
var allTasks = [],
allTags = {},
service = {
userTasks: [],
userTags: [],
filter: {
text: ''
},
defaultTag: {},
activeTag:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"runTasks() {\n this.janus.on('tasks:complete', this.createRelease.bind(this) );\n this.janus.emit('tasks:start'); \n }",
"constructor() {\n this.getTasks();\n\n }",
"async taskList(id) {\n return await this.client\n .TaskList({\n filters: `{\"service\": {\"${id}\": true}}`\n })\n... | [
"0.6075732",
"0.5809539",
"0.5697367",
"0.5673596",
"0.56226677",
"0.56104034",
"0.5595781",
"0.55652696",
"0.555129",
"0.553653",
"0.5536351",
"0.54921204",
"0.5486365",
"0.5480787",
"0.5477381",
"0.5451556",
"0.5439033",
"0.5437818",
"0.5429464",
"0.5415697",
"0.5406851",
... | 0.6974934 | 0 |
set access token header to send with every request | setAccessToken(accessToken) {
this.client.defaults.headers.common['X-Access-Token'] = accessToken;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setToken(access_token){\n\t\tthis.access_token = access_token;\n\n\t\tthis.requestOptions = {\n\t\t\tmethod: 'GET',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Authorization': `Bearer ${access_token}`\n\t\t\t}\n\t\t};\n\t}",
"updateClientAccessT... | [
"0.7842831",
"0.77193606",
"0.7406663",
"0.7393856",
"0.73364687",
"0.70241606",
"0.69947946",
"0.6951838",
"0.69458354",
"0.69119346",
"0.6895967",
"0.68770427",
"0.681766",
"0.678785",
"0.6775393",
"0.67700547",
"0.6762838",
"0.6755599",
"0.6748171",
"0.67363673",
"0.672246... | 0.8144059 | 0 |
do not send xaccesstoken header | removeAccessToken() {
this.client.defaults.headers.common['X-Access-Token'] = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function discardToken() {\n delete oauth.access_token;\n tokenStore.forceOAuth = JSON.stringify(oauth);\n }",
"function applyXSRFCheckFix(xhr) {\n //xhr.setRequestHeader(\"User-Agent\", \"epoqcreatejiraissue; (Totally not Thunderbird, don't XSRF check me, bro. Also why does X-Atlassian-Token: no-... | [
"0.62257314",
"0.6139978",
"0.5953425",
"0.5800388",
"0.5748261",
"0.5697491",
"0.5689437",
"0.5688058",
"0.5682944",
"0.5660643",
"0.5585947",
"0.5528632",
"0.55237794",
"0.551198",
"0.5506823",
"0.5496475",
"0.54856753",
"0.5480843",
"0.54750645",
"0.54681134",
"0.5456357",... | 0.66124123 | 0 |
changes text for question number | function updateQuestionNumText(questionNumber) {
$('#questionNumber').text(questionNumber);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeQuestionNumber () {\n questionNumber ++;\n $('.js-showQuestionNumber').text(questionNumber+1);\n}",
"function changeQuestionNumber(){\n\t\tquestionNumber ++;\n\n\t$('.questionNumber').text(questionNumber+1);\n}",
"function changeQuestionNum(){\n questionNum ++;\n $('.questionNumber').t... | [
"0.7309043",
"0.71559644",
"0.7088684",
"0.7072908",
"0.6993706",
"0.69741905",
"0.6949535",
"0.6939042",
"0.692147",
"0.69094086",
"0.6873082",
"0.6856504",
"0.6837693",
"0.6803926",
"0.6749088",
"0.6740168",
"0.6686811",
"0.6678176",
"0.666652",
"0.66302437",
"0.6625146",
... | 0.78904223 | 0 |
changes text for score number | function updateScoreNumText(score) {
$('#totalScore').text(score);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateScoreText(){\n scoreText.setText(\"Score: \" + score);\n }",
"function setScore(num) {\r\n var currentScore = score.text();\r\n score.html(parseInt(currentScore) + parseInt(num));\r\n }",
"function setCounterText() {\n scoreEl.textContent = score;\n}",
"function editYourSco... | [
"0.82002825",
"0.81151444",
"0.8094769",
"0.78318965",
"0.7800969",
"0.76941824",
"0.7687228",
"0.76624006",
"0.76223147",
"0.75594807",
"0.75435895",
"0.7527678",
"0.7507717",
"0.74813366",
"0.7459838",
"0.74563986",
"0.7455572",
"0.744128",
"0.74382687",
"0.7428505",
"0.739... | 0.8357476 | 0 |
Update A Submission In An Environment | function update(params, cb){
var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id", params);
var method = "PUT";
var data = params.submission;
params.resourcePath = resourcePath;
params.method = method;
params.data = data;
mbaasRequest.admin(params, cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"editPost(requestData) { //Upload (put) the Post in Kinvey\n if (requestData.title.length < 7) {\n showPopup('error', \"Post title must consist of at least 7 symbols.\");\n return;\n }\n\n if (requestData.content.length < 10) {\n showPopup('error', \"Post conten... | [
"0.61391276",
"0.6138129",
"0.6128492",
"0.6091166",
"0.5959306",
"0.59555143",
"0.5935332",
"0.59070075",
"0.5891343",
"0.586948",
"0.5862983",
"0.58193964",
"0.58085394",
"0.5802613",
"0.58014035",
"0.57843566",
"0.5765473",
"0.57430923",
"0.5723196",
"0.56936157",
"0.56843... | 0.6924425 | 0 |
Creating A New Submission. | function create(params, cb){
params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions", params);
params.method = "POST";
params.data = params.submission;
mbaasRequest.admin(params, cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitCallback() {\n createPost();\n }",
"async createQuestion() {}",
"function submitButtonPressed() {\n\n console.log(\"submit pressed\");\n\n var name = document.getElementById(\"name\").value;\n var question = document.getElementById(\"question\").value;\n\n ... | [
"0.6662151",
"0.6551579",
"0.6337748",
"0.6329026",
"0.6264202",
"0.62191683",
"0.6219012",
"0.6185591",
"0.608918",
"0.6051097",
"0.6043032",
"0.6038873",
"0.6017536",
"0.6007837",
"0.5956271",
"0.59459174",
"0.59379625",
"0.5920431",
"0.59077257",
"0.58819187",
"0.5862201",... | 0.74477583 | 0 |
Update A File For A Submission | function updateFile(params, cb){
var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/fields/:fieldId/files/:fileId", params);
var method = "PUT";
var data = params.fileDetails;
params.resourcePath = resourcePath;
params.method = method;
params.data = data;
params.fileReq... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateFileAndReturn() {\n request(fileUrl, function (error, response, body) {\n fs.writeFileSync(filePath, body);\n returnFile();\n });\n }",
"function fileUpdate() {statusMsg('Updating file properties');\n FILEname=editFILEname.value;\n COLnote=encodeLines(docum... | [
"0.6915639",
"0.67537814",
"0.6571796",
"0.65399975",
"0.6492028",
"0.64330405",
"0.6413634",
"0.63104117",
"0.63101995",
"0.630083",
"0.6241757",
"0.6215804",
"0.6204324",
"0.6198052",
"0.6155957",
"0.6116861",
"0.60453075",
"0.60418344",
"0.60280037",
"0.600248",
"0.5992901... | 0.72554165 | 0 |
Search For Submission In An Environment | function search(params, cb){
var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/search", params);
var method = "POST";
var data = params.queryParams;
params.resourcePath = resourcePath;
params.method = method;
params.data = data;
mbaasRequest.admin(params, cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findSubmissionByName(array, name) {\n console.log(objectOf(submissions.find(name)));\n}",
"function searchByEnvironmentName(searchTerm) {\n knexInstance\n .select('environment_name', 'environment_url')\n .from('environments_list')\n .where('environment_name', 'ILIKE', `%${searchTerm}%`)\n ... | [
"0.56339526",
"0.5571011",
"0.5475883",
"0.5428236",
"0.5270262",
"0.5252604",
"0.5242864",
"0.519732",
"0.51485074",
"0.5139636",
"0.5124866",
"0.5114259",
"0.51001745",
"0.5089508",
"0.507328",
"0.5070608",
"0.5053169",
"0.50506926",
"0.5048894",
"0.50447756",
"0.5032153",
... | 0.571507 | 0 |
Filtering Submissions From An Environment Mbaas. Forms Can Be Filtered By form ID or Project ID | function filterSubmissions(params, cb){
params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/filter", params);
params.method = "POST";
params.data = params.filterParams;
mbaasRequest.admin(params, cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function form_submit() {\n\tvar f1 = document.getElementById(\"filter1\").value;\n\tvar f2 = document.getElementById(\"filter2\").value;\n\tvar f3 = document.getElementById(\"filter3\").value;\n\tif (f1 == \"\") {\n\t\tdelete filtersObject[\"make\"];\n\t} else {\n\t\tfiltersObject[\"make\"] = f1;\n\t}\n\tif (f2 ==... | [
"0.6130881",
"0.60526127",
"0.5654286",
"0.56490844",
"0.5587143",
"0.5566358",
"0.5527057",
"0.54565305",
"0.5398047",
"0.5353372",
"0.5339973",
"0.5327567",
"0.53196305",
"0.53096193",
"0.5288138",
"0.52664626",
"0.5236544",
"0.51665217",
"0.51579845",
"0.5157447",
"0.51441... | 0.72765064 | 0 |
Export Submissions As A Zip File Containing CSVs. | function exportSubmissions(params, cb){
var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/export", params);
var method = "POST";
var data = params.queryParams;
params.resourcePath = resourcePath;
params.method = method;
params.data = data;
//Export is a zip file response..... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function downloadCSVFiles(Lt,TWoodcsvDataString,EWoodcsvDataString,LWoodcsvDataString)\n {\n var zip = new JSZip();\n if(Lt.measurementOptions.subAnnual)\n {\n zip.file((Lt.meta.assetName + '_LW_csv.csv'), LWoodcsvDataString);\n zip.file((Lt.meta.assetName + '_EW_csv.csv'), EWoodcsvDataString);\n ... | [
"0.65685797",
"0.62325233",
"0.61936307",
"0.61698776",
"0.6160883",
"0.61156535",
"0.5976965",
"0.59185016",
"0.58931404",
"0.58790475",
"0.5845353",
"0.5820707",
"0.5749236",
"0.5739453",
"0.5732953",
"0.57184815",
"0.5698798",
"0.5696505",
"0.56819266",
"0.563954",
"0.5623... | 0.6804646 | 0 |
Get A File Contained In A Submission For An Environment | function getSubmissionFile(params, cb){
var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/files/:fileId", params);
var method = "GET";
var data = {};
params.resourcePath = resourcePath;
params.method = method;
params.data = data;
params.fileRequest = true;
mbaasRequ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFile() {\n const qParams = queryParams()\n const options = configureGetOptions()\n console.log('options', apiToken)\n return fetch(`${url}/files?q=${qParams}&spaces=appDataFolder`, options)\n .then(parseAndHandleErrors)\n .then((body) => {\n console.log(body)\n ... | [
"0.6534647",
"0.6033737",
"0.5996355",
"0.58869064",
"0.58291256",
"0.5761677",
"0.575804",
"0.5698912",
"0.5614479",
"0.5613033",
"0.5612368",
"0.56018114",
"0.55788004",
"0.5562498",
"0.5552415",
"0.55487454",
"0.55377316",
"0.5531557",
"0.5524666",
"0.54941773",
"0.5479921... | 0.6573178 | 0 |
Getting A PDF Of A Submission | function getSubmissionPDF(params, cb){
var resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + "/submissions/:id/exportpdf", params);
var method = "GET";
var data = {};
params.resourcePath = resourcePath;
params.method = method;
params.data = data;
params.fileRequest = true;
mbaasRequest.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _downloadInvoicePDF() {\n\t\tvar $this = $(this),\n\t\t\t\tinvoice = $this.data('invoice'),\n\t\t\t\tiframe = $('#tmpIFrame'),\n\t\t\t\t$form = _createPdfForm(invoice);\n\t\t\t\t\n\t\tif ( iframe.length === 0 ) {\n\t\t\tiframe = $('<iframe id=\"tmpIframe\" name=\"tmpIframe\" style=\"display: none\"/>').ap... | [
"0.64767164",
"0.6389808",
"0.6243555",
"0.6188234",
"0.6165795",
"0.610048",
"0.6088435",
"0.606631",
"0.6064174",
"0.6061804",
"0.60521394",
"0.6022842",
"0.5984675",
"0.5955982",
"0.5943587",
"0.59316593",
"0.5928126",
"0.5914424",
"0.59072137",
"0.5896567",
"0.58676124",
... | 0.7781556 | 0 |
Se anidan las dos llamadas a "findOne" dentro de una nueva funcion "tots", y se le aplica el async. | async function tots(users) {
console.log('findOne success');
// Se aplica el await a cada una de las fórmulas "findOne", hacendo que se separe su proceso deejecución y que la siguiente no empiece a ejecutarse hasta que la primera sea resuelta.
await findOne(users, { key: 'name', value: 'Carlos' })
.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getPartie()\r\n{\r\n const PartieTotal = await Partie.find()\r\n return PartieTotal\r\n}",
"async function CalculosPrestamo(){\r\n let infoPrestamo = new Object;\r\n let monto_original = 0;\r\n let monto_total = 0;\r\n\r\n return new Promise(resolve => {\r\n Prestamo.find().exec((err,... | [
"0.60825205",
"0.60751545",
"0.60156226",
"0.59649444",
"0.5792824",
"0.57728237",
"0.5734302",
"0.5727876",
"0.5710303",
"0.57083637",
"0.5707266",
"0.5682617",
"0.56787205",
"0.5675721",
"0.5617285",
"0.56058943",
"0.56005216",
"0.558468",
"0.5582007",
"0.558069",
"0.555558... | 0.6545946 | 0 |
Delete the passed calendar from the database. | async deleteCalendar(calendar) {
let stmts = [];
calendar = calendar.wrappedJSObject;
if (this.statements.mDeleteEventExtras) {
for (let stmt of this.statements.mDeleteEventExtras) {
stmts.push(this.prepareStatement(stmt));
}
}
if (this.statements.mDeleteTodoExtras) {
for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteCalenderID(){\n\tdb.transaction(function(tx) {\n\t\ttx.executeSql(\"DELETE FROM calendar WHERE ID = \"+theid,\n\t\t\t[],\n\t\t\tfunction(trans, result) {\n\t\t\t\talert(\"Schedule: has been deleted\");\n\t\t\t},\n\t\t\tfunction(trans, error) {\n\t\t\t\t// handle the error\n\t\t\t}\n\t\t)\n\t});\n}/... | [
"0.7338414",
"0.70300686",
"0.6956261",
"0.6479818",
"0.63342834",
"0.6299967",
"0.6161836",
"0.6071958",
"0.5955399",
"0.59148127",
"0.58468336",
"0.5804264",
"0.579119",
"0.57852584",
"0.57609594",
"0.57500196",
"0.55982184",
"0.5588196",
"0.5578436",
"0.5558484",
"0.552369... | 0.7257421 | 1 |
Build up recurring event and todo cache with its offline flags. | async assureRecurringItemCaches() {
let events = [];
let itemsMap = new Map();
this.prepareStatement(this.statements.mSelectEventsWithRecurrence);
await this.executeAsync(this.statements.mSelectEventsWithRecurrence, async row => {
events.push(row);
});
for (let row of events) {
let i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function prepareCache() {\n const c = await caches.open(CACHE);\n await c.addAll(CACHEABLE);\n console.log('Cache prepared.');\n}",
"function setAllReminders(){\n\n // Getting localEventInfo and localReminderInfo\n eventsReminderInfoArray = JSON.parse(localStorage.getItem(\"localEventInfo\"));\n remi... | [
"0.5318886",
"0.52843547",
"0.5251512",
"0.52444476",
"0.5196786",
"0.5151834",
"0.5128299",
"0.5103103",
"0.5085198",
"0.5070103",
"0.5054788",
"0.50523263",
"0.50449336",
"0.50206214",
"0.49777812",
"0.4972133",
"0.4954674",
"0.49350536",
"0.4932603",
"0.49060476",
"0.48969... | 0.6658991 | 0 |
The prepare functions prepare the database bits to write the given item type. They're to return any bits they want or'd into flags, which will be prepared for writing by prepareEvent/prepareTodo. | prepareItem(stmts, item, olditem) {
let flags = 0;
flags |= this.prepareAttendees(stmts, item, olditem);
flags |= this.prepareRecurrence(stmts, item, olditem);
flags |= this.prepareProperties(stmts, item, olditem);
flags |= this.prepareAttachments(stmts, item, olditem);
flags |= this.prepareRel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"prepare() { }",
"prepare() { }",
"prepare() {}",
"prepare() {}",
"prepare() {}",
"prepare() {}",
"prepare() {}",
"modifyItem(type, obj_parameter){\n \tswitch(type){\n \t\tcase \"Book\":\n \t\t\tvar sql= \"UPDATE Book SET Title= obj_parameter.Title, Author= obj_parameter.Author, Format= obj_parameter.... | [
"0.56632465",
"0.56632465",
"0.5625768",
"0.5625768",
"0.5625768",
"0.5625768",
"0.5625768",
"0.55348086",
"0.53665984",
"0.5284062",
"0.525904",
"0.51174706",
"0.48198962",
"0.4743358",
"0.473335",
"0.46969125",
"0.463847",
"0.45873934",
"0.45415774",
"0.4539702",
"0.4485128... | 0.6289424 | 0 |
Deletes meta data for an item using its id. | deleteMetaDataById(id) {
this.executeSyncItemStatement(this.statements.mDeleteMetaData, "item_id", id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteItem(id) {\n const oz = this._appContext.oz, url = oz.getItemURI(this.name, id);\n return oz.request(url, {\n method: 'DELETE',\n });\n }",
"function _delete(id) {\n return fetchWrapper.delete(`http://localhost:8000/deleteMetaData/${id}`);\n}",
"function deleteItem()... | [
"0.6874145",
"0.6780649",
"0.6397072",
"0.632691",
"0.63249975",
"0.63118535",
"0.628971",
"0.62239",
"0.618278",
"0.61619985",
"0.61404574",
"0.61377174",
"0.61323977",
"0.6115616",
"0.61153144",
"0.609068",
"0.60757476",
"0.6050468",
"0.60459983",
"0.60308665",
"0.60173047"... | 0.769703 | 0 |
Calls the finalize method on the CalStorageStatements object. | finalize() {
this.statements.finalize();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"finalize() {\n }",
"finalize() {\n }",
"finalize() {\n //override as necessary\n }",
"async finalizeAll() {\n const promisedFinalizes = Array.from(\n this.cache.values(),\n (cachedStatement) => {\n return finalizeStatement(cachedStatement);\n },\n );\n return Promis... | [
"0.6081695",
"0.6081695",
"0.6056832",
"0.596399",
"0.5942818",
"0.5851274",
"0.571679",
"0.57071716",
"0.56375194",
"0.56235754",
"0.56079954",
"0.5604874",
"0.5598421",
"0.5580487",
"0.5545792",
"0.5536391",
"0.5534825",
"0.55186576",
"0.55100435",
"0.542296",
"0.53781694",... | 0.73820126 | 0 |
Requests the currently selected image. | requestSelectedImage() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"selectProfileImage() {}",
"function _selectImage () {\n if ($current_image) {\n editor.selection.clear();\n var range = editor.doc.createRange();\n range.selectNode($current_image.get(0));\n var selection = editor.selection.get();\n selection.addRange... | [
"0.687209",
"0.6837893",
"0.67523944",
"0.65251565",
"0.6454702",
"0.6380497",
"0.6302367",
"0.619514",
"0.6120094",
"0.60660803",
"0.6050351",
"0.5971229",
"0.5961",
"0.59334314",
"0.588745",
"0.58594245",
"0.58399",
"0.58039236",
"0.5790398",
"0.57608116",
"0.57581437",
"... | 0.84688455 | 0 |
Shortcut for running a callback and registering a watch task for this callback if WATCHING is enabled, which is enabled by running gulp watch, so e.g.: gulp watch compile | function runAndWatch(paths, callback) {
callback();
if(WATCHING) {
gulp.$.watch(paths, callback);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function watchTask() {\n gulp.watch(config.watchers.static, copyStaticFiles);\n gulp.watch(config.watchers.css, gulp.series(lintCSS, compileSass));\n gulp.watch(config.watchers.js, gulp.series(lintJS, concatJS, copyJS));\n gulp.watch(config.watchers.drizzle, drizzleTask);\n}",
"function browserSyncWa... | [
"0.6933429",
"0.67221713",
"0.6635599",
"0.65780044",
"0.6464522",
"0.637773",
"0.63443613",
"0.6322844",
"0.6322832",
"0.6294711",
"0.62749326",
"0.622397",
"0.6218173",
"0.62092525",
"0.6169633",
"0.6125167",
"0.61219615",
"0.6096465",
"0.6089256",
"0.60753614",
"0.60647595... | 0.700526 | 1 |
Runs an ionic command. If you need more ionic arguments, just pass them, they'll be picked up, e.g.: runIonic('emulate', 'ios', 'l'). Unfortunately, ionic has made a pure CLI, not an API with a CLI on top of it. | function runIonic(command) {
var argIndex = 2;
var argBack = process.argv;
// If it's a cordova argument, add it, rename command to cordova
if(_.contains(['emulate'], command)) {
process.argv[argIndex++] = command;
command = 'cordova';
}
// Set other optional arguments
_.each(_.tail(arguments), ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callIonic() {\n // Ionic requires the Cordova CLI in the path\t\t\n return buildUtilities.cacheModule({\n projectPath: workingDirectory,\n nodePackageName: \"cordova\",\n moduleVersion: process.env[\"INPUT_CORDOVAVERSION\"]\n }).then(function (cordovaModule) {\n consol... | [
"0.69744295",
"0.5860971",
"0.57428974",
"0.56336325",
"0.5571205",
"0.55417365",
"0.5505095",
"0.54715043",
"0.5404627",
"0.5367294",
"0.5338215",
"0.53360283",
"0.524996",
"0.52298826",
"0.5222145",
"0.5210874",
"0.51998603",
"0.51880175",
"0.5168181",
"0.51438755",
"0.5137... | 0.81721437 | 0 |
LOADS CONVERSATION WITH HASH | function load_conversation(hash) {
var div = document.getElementById("chat_box");
hr.open("POST", "/main/load_conversation/"+hash, true);
hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
hr.onreadystatechange = function() {
if(hr.readyState == 4) {
if(hr.status == 200) {
div.inn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initLoaders() {\n this.stream = this.CucControllerHelper.request.getHashLoader({\n loaderFunction: () =>\n this.LogsStreamsService.getStream(this.serviceName, this.streamId),\n });\n }",
"static load_all() {\n server.log(\"Loading conversations...\", 2);\n\n server.modules.fs.readdirSync... | [
"0.5465614",
"0.54027164",
"0.53200144",
"0.52228653",
"0.52090716",
"0.5121956",
"0.5053501",
"0.502671",
"0.49848866",
"0.49403113",
"0.49336824",
"0.4903708",
"0.48893672",
"0.48720878",
"0.48600394",
"0.48505434",
"0.48152503",
"0.48143274",
"0.4746113",
"0.4743803",
"0.4... | 0.5645878 | 0 |
Removes observers from active element | function removeObservers(element) {
for (let i = 0; i < active.length; i += 1) {
if (element === active[i][0]) {
active[i][1].disconnect();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"disconnect() {\n this.target = null;\n const index = observers.indexOf(this);\n\n if (index >= 0) {\n observers.splice(index, 1);\n }\n }",
"stopObserving() {\n this.observable.removeObserver(this);\n }",
"willRemove() {\n this.unobserve();... | [
"0.75100774",
"0.70583445",
"0.7051991",
"0.7042207",
"0.7042207",
"0.7042207",
"0.7042207",
"0.7042207",
"0.69949317",
"0.69559115",
"0.6952179",
"0.69452584",
"0.69411844",
"0.69360256",
"0.69360256",
"0.69360256",
"0.69360256",
"0.68921745",
"0.68921745",
"0.68921745",
"0.... | 0.7788665 | 0 |
jec 170724 conversion begin updates the inspection and assigns to a new user requires the inspection id and the user name | function assignInspection(iNumber, iName){
try{
iObjResult = aa.inspection.getInspection(capId, iNumber);
if (!iObjResult.getSuccess()) {
logDebug("**ERROR retrieving inspection " + iNumber + " : " + iObjResult.getErrorMessage());
return false;
}
iObj = iObjResult.getOutput();
iNameResult =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateUser() {\n // fetch or create the mongo expertise for the user\n UserExpertise.findOne({ user_id, team_id }, function (err, user) {\n // create the user if we get an error or if the\n // fetched user is null (i.e. doesn't exists)\n if (err || user === null) {\n ... | [
"0.66843635",
"0.5892314",
"0.56707525",
"0.5667099",
"0.5658538",
"0.56216717",
"0.55443925",
"0.5538305",
"0.5498922",
"0.5491256",
"0.5480341",
"0.54755354",
"0.54699844",
"0.5464381",
"0.5463028",
"0.546099",
"0.54412144",
"0.54326475",
"0.5420038",
"0.54071033",
"0.54065... | 0.610032 | 1 |
Function : print_r() Arguments: The data array,hash(associative array),object The level OPTIONAL Returns : The textual representation of the array. This function was inspired by the print_r function of PHP. This will accept some data as the argument and return a text that will be a more readable version of the array/ha... | function print_r(arr,level) {
var dumped_text = "";
if(!level) level = 0;
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += " ";
if(typeof(arr) == 'object') { //Array/Hashes/Objects
for(var item in arr) {
var value = arr[item];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function print_r(theObj){\r\n\tvar result = \"\";\r\n\t\r\n\tif (theObj.constructor == Array || theObj.constructor == Object) {\t\t\r\n\t\tfor (var p in theObj) {\r\n\t\t\tif (theObj[p] != null) {\r\n\t\t\t\tif (theObj[p].constructor == Array || theObj[p].constructor == Object) {\r\n\t\t\t\t\tresult += \"[\"+p+\"]... | [
"0.75985205",
"0.71838206",
"0.7136694",
"0.7136694",
"0.7115869",
"0.7115869",
"0.7078543",
"0.70564955",
"0.6974061",
"0.6790161",
"0.66974896",
"0.66913426",
"0.6384051",
"0.6315279",
"0.6307337",
"0.628493",
"0.62773293",
"0.62491906",
"0.6135825",
"0.6109242",
"0.6099300... | 0.76037735 | 0 |
Create class Food; use 'new Food(id, name ...)' instead of 'createFood(id, name ...)' Intention: Create a typed model object (which may contain logic) instead of a generic JSON structure. TODO: Step 3 Use ES2015 module syntax: Export class Food | function createFood(id, name, amount, amountPerDelivery, isMeet) {
return {
id,
name: name || 'unknown',
amount: amount || 0,
amountPerDelivery: amountPerDelivery || 1,
isMeet: Boolean(isMeet),
isOrderPending: false,
toJSON() {
return {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Food(name, price, cook) {\n // Add properties Product like to Food\n Product.call(this, name, price, cook);\n this.category = 'food';\n}",
"function Food(name , price) {\n this.name = name;\n this.price = price;\n}",
"function Food(cal, fat, protien) {\n this.cal = cal;\n thi... | [
"0.6492712",
"0.64296633",
"0.62359613",
"0.5847454",
"0.58301973",
"0.57850194",
"0.5781214",
"0.576722",
"0.5617579",
"0.5617579",
"0.55840135",
"0.55645895",
"0.54625595",
"0.5439248",
"0.534443",
"0.53383166",
"0.53372025",
"0.5322963",
"0.5306596",
"0.5305593",
"0.528587... | 0.6774968 | 0 |
end of aimgDecode() / convert CRLF or CRCRLF to LF, return array of converted buf. Currently, this function only have effect on Windows OS | function convertCRLFToLF(context, requiredCrCount, buf) {
if (!requiredCrCount) { //lucky! no CR prepended, so need not convert.
return [buf];
}
var bufAry = [], startPos = 0, crCount = 0;
/*
* Resolve orphan [CR,CR] or [CR] which are produced by previous call of this function.
* If it is followed by ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function line_endings(txt) {\n\tif (LINE_ENDING === 'unix') {\n\t\treturn txt.replace(/\\r\\n/g, '\\n');\n\t}\n\tif (LINE_ENDING === 'windows') {\n\t\treturn txt.replace(/\\r\\n/g, '\\n').replace(/\\n/g, '\\r\\n'); // if you convert to unix first we won't aggregate extra \\r's\n\t}\n\treturn txt;\n}",
"function ... | [
"0.57888675",
"0.5515265",
"0.5427306",
"0.5411521",
"0.531366",
"0.52630585",
"0.52630585",
"0.52070785",
"0.5149267",
"0.51445836",
"0.511845",
"0.5004188",
"0.49126703",
"0.48997307",
"0.4899478",
"0.4884713",
"0.48843592",
"0.48654914",
"0.48152086",
"0.4802481",
"0.48022... | 0.69821185 | 0 |
`isShown` is a boolean that tracks if the overlay is currently open or not | get isShown() {
return !!this._isShown;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"show() {\n this.buildOverlay()\n this.mountOverlay()\n this.shown = true\n }",
"show(){\r\n if(!this.isForceHide){\r\n this.overlay.css('display', 'block');\r\n }\r\n }",
"isOpen() {\n return this._overlayRef ? this._overlayRef.hasAttached() : false;\n... | [
"0.7137011",
"0.69787765",
"0.688908",
"0.6826762",
"0.6678836",
"0.663089",
"0.66149557",
"0.65686554",
"0.6560504",
"0.6531201",
"0.64493936",
"0.64427096",
"0.6385738",
"0.6352765",
"0.6352677",
"0.6331292",
"0.6323749",
"0.62834144",
"0.62760127",
"0.6242897",
"0.6242897"... | 0.75144386 | 0 |
console.log(getCyclesFromVertex(edges, 12, [0,0,0,0,0,0,0,0,0,0,0,0,0], 12, 0)/2) console.log(countCycles(edges)) console.log(getCyclesFromVertex(edges2, 0, [0,0,0,0], 0, 0, [0,1,0,0], 0)/2) console.log(maxCycle + 1); console.log(minCycle + 1); console.log(generateAdjMatrix(edges)); | countCycles(G) {
let visited2 = new Array(G.length).fill(0);
let cycles = 0;
for(let i = 0; i < G.length; ++i) {
cycles += getCyclesFromVertex(G, i, new Array(G.length).fill(0), i, 0, visited2) / 2;
visited2[i] = 1;
}
return cycles;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findCycle() {\n this.calculationCheck = false;\n if(!this.adjacencyMatrix.length) return;\n\n //new and more efficient idea: every node must have 2 connections for the area graph, so one or more cycles are guaranteed\n for (var i = 0; i < this.adjacencyMatrix.length; i++) {\n ... | [
"0.7076312",
"0.6780168",
"0.655611",
"0.625485",
"0.6226284",
"0.6225719",
"0.6157154",
"0.6145502",
"0.61005694",
"0.6100264",
"0.60236794",
"0.5953388",
"0.5894512",
"0.5893496",
"0.5877024",
"0.5874267",
"0.58124053",
"0.5775423",
"0.5760373",
"0.5751117",
"0.572794",
"... | 0.7042343 | 1 |
getWinner will return a win in the form of a string denoting the winning player and winning squares, e.g. 'X048' if no win, return null | function getWinner() {
if (winnerIs('X')) {
return 'X' + winnerIs('X');
}
else if (winnerIs('O')) {
return 'O' + winnerIs('O');
}
else
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getGameWinner() {\n if (!playerOneMoveOneType || !playerOneMoveOneValue || !playerOneMoveTwoType || !playerOneMoveThreeType || !playerOneMoveThreeValue || !playerTwoMoveOneType || !playerTwoMoveOneValue || !playerTwoeMoveTwoType || !playerTwoMoveTwoValue || !playerTwoMoveThreeType || !playerTwoMoveThreeV... | [
"0.8029334",
"0.8023037",
"0.79964614",
"0.76957196",
"0.7658357",
"0.7558106",
"0.72761023",
"0.7268821",
"0.72542447",
"0.72350675",
"0.71933746",
"0.71797436",
"0.71616995",
"0.7139937",
"0.71315277",
"0.71256673",
"0.71109533",
"0.7092614",
"0.7083202",
"0.70701057",
"0.7... | 0.80493367 | 0 |
FUNCTION THAT ASK THE CUSTOMER IF HE/SHE/THEY WANT TO CONTINUE SHOPPING WITH BAMAZOM | function morePurchase() {
inquirer.prompt(
{
name: "continue",
type: "confirm",
question: "Would you like to continue shopping?"
}
)
.then(function (inquirerResponse) {
if (inquirerResponse.continue === true) {
customerRequest()
} else {
console.log("THANK ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keepGoing() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"shopping\",\n message: \"Would you like to continue shopping?\",\n choices: [\"Yes\", \"No\"]\n }\n\n // If the user chooses 'Yes', then resets shopping experience with promptC... | [
"0.59631526",
"0.5952265",
"0.595081",
"0.59295344",
"0.59288335",
"0.5884605",
"0.5883445",
"0.58612657",
"0.5858598",
"0.5853863",
"0.580651",
"0.5800429",
"0.5765847",
"0.5742699",
"0.5728846",
"0.57269883",
"0.57249844",
"0.56997037",
"0.5677031",
"0.5673753",
"0.56700397... | 0.6071784 | 0 |
number of tables in the database | function tableCount() {
var count = 0;
for(var table in db.tables) {
if( db.tables.hasOwnProperty(table) ) {
count++;
}
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_tableCount() {\r\n var count = 0;\r\n for (var table in this.db.tables) {\r\n if (this.db.tables.hasOwnProperty(table)) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }",
"function _getDBSizes() {\n\tlet tables = ['plugincontributors', 'pluginmaintainers', 'catego... | [
"0.83378446",
"0.74998075",
"0.72695017",
"0.7219534",
"0.6916134",
"0.68956107",
"0.68956107",
"0.68605095",
"0.65795296",
"0.6519999",
"0.6455176",
"0.6402459",
"0.63820106",
"0.63486785",
"0.6348402",
"0.6177539",
"0.6175034",
"0.6101266",
"0.60011965",
"0.59988284",
"0.59... | 0.86722434 | 1 |
select rows, given a list of IDs of rows in a table | function select(table_name, ids) {
var ID = null, results = [], row = null;
for(var i=0; i<ids.length; i++) {
ID = ids[i];
row = db.data[table_name][ID];
results.push( clone(row) );
}
return results;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_select(table_name, ids, start, limit, sort, distinct) {\r\n var ID = null,\r\n results = [],\r\n row = null;\r\n\r\n for (var i = 0; i < ids.length; i++) {\r\n ID = ids[i];\r\n row = this.db.data[table_name][ID];\r\n results.push(this._clone(row));\r\n }\r\n\r\n ... | [
"0.6265223",
"0.59663725",
"0.5930758",
"0.5780203",
"0.57132334",
"0.56673694",
"0.56029546",
"0.56029546",
"0.5589089",
"0.55411655",
"0.55411655",
"0.5520446",
"0.55102104",
"0.5498317",
"0.5497389",
"0.54788333",
"0.5470055",
"0.5438807",
"0.5423663",
"0.5421143",
"0.5421... | 0.691508 | 1 |
select rows in a table by fieldvalue pairs, returns the IDs of matches | function queryByValues(table_name, data, limit) {
var result_ids = [],
exists = false,
row = null;
// loop through all the records in the table, looking for matches
for(var ID in db.data[table_name]) {
if( !db.data[table_name].hasOwnProperty(ID) ) {
continue;
}
row = db.data[table_name][ID];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_queryByValues(table_name, data) {\r\n var result_ids = [],\r\n exists = false,\r\n row = null;\r\n\r\n // loop through all the records in the table, looking for matches\r\n for (var ID in this.db.data[table_name]) {\r\n if (!this.db.data[table_name].hasOwnProperty(ID)) {\r\n ... | [
"0.6504224",
"0.5666673",
"0.55329525",
"0.54176843",
"0.533437",
"0.5295967",
"0.5291594",
"0.5155665",
"0.5116198",
"0.5045389",
"0.5031911",
"0.5031911",
"0.4993819",
"0.49695078",
"0.49652186",
"0.49652186",
"0.49625343",
"0.48915926",
"0.48905003",
"0.48647943",
"0.48278... | 0.63837427 | 1 |
select rows in a table by a function, returns the IDs of matches | function queryByFunction(table_name, query_function, limit) {
var result_ids = [],
exists = false,
row = null;
// loop through all the records in the table, looking for matches
for(var ID in db.data[table_name]) {
if( !db.data[table_name].hasOwnProperty(ID) ) {
continue;
}
row = db.data[table... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_queryByFunction(table_name, query_function) {\r\n var result_ids = [],\r\n row = null;\r\n\r\n // loop through all the records in the table, looking for matches\r\n for (var ID in this.db.data[table_name]) {\r\n if (!this.db.data[table_name].hasOwnProperty(ID)) {\r\n continue... | [
"0.70444876",
"0.5369249",
"0.5369249",
"0.5307659",
"0.5286879",
"0.52736235",
"0.51719844",
"0.5106538",
"0.5081267",
"0.5081267",
"0.50694084",
"0.5001199",
"0.49953362",
"0.49427226",
"0.49196038",
"0.49062204",
"0.49054003",
"0.48733208",
"0.4830239",
"0.48251238",
"0.47... | 0.6777523 | 1 |
return all the IDs in a table | function getIDs(table_name, limit) {
var result_ids = [];
for(var ID in db.data[table_name]) {
if( db.data[table_name].hasOwnProperty(ID) ) {
result_ids.push(ID);
if(result_ids.length == limit) {
break;
}
}
}
return result_ids;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getIDs(table_name) {\r\n var result_ids = [];\r\n\r\n for (var ID in this.db.data[table_name]) {\r\n if (this.db.data[table_name].hasOwnProperty(ID)) {\r\n result_ids.push(ID);\r\n }\r\n }\r\n return result_ids;\r\n }",
"function ids(row){return row[0].toString();}"... | [
"0.76502544",
"0.71590835",
"0.65208805",
"0.6410505",
"0.6353232",
"0.6313463",
"0.61919767",
"0.61868936",
"0.6183224",
"0.61341923",
"0.61095136",
"0.60731846",
"0.60731846",
"0.6071442",
"0.5973349",
"0.5961802",
"0.59383726",
"0.5895921",
"0.58482987",
"0.58424723",
"0.5... | 0.7513938 | 1 |
delete rows, given a list of their IDs in a table | function deleteRows(table_name, ids) {
for(var i=0; i<ids.length; i++) {
if( db.data[table_name].hasOwnProperty(ids[i]) ) {
delete db.data[table_name][ ids[i] ];
}
}
return ids.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_deleteRows(table_name, ids) {\r\n for (var i = 0; i < ids.length; i++) {\r\n if (this.db.data[table_name].hasOwnProperty(ids[i])) {\r\n // remove indexes\r\n let del_data = this.db.data[table_name][ids[i]]\r\n for (var ifield in this._indexes(table_name)) {\r\n th... | [
"0.7115577",
"0.6786345",
"0.6720173",
"0.669663",
"0.6687864",
"0.65984356",
"0.65940714",
"0.6557254",
"0.64357847",
"0.6363682",
"0.62543017",
"0.62167895",
"0.61596364",
"0.6116646",
"0.6107882",
"0.60984236",
"0.60745084",
"0.60312253",
"0.6025778",
"0.6008711",
"0.59940... | 0.7106423 | 1 |
commit the database to localStorage | function commit() {
storage[db_id] = JSON.stringify(db);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_commit() {\r\n try {\r\n switch (this.engine) {\r\n case 'localStorage':\r\n localStorage.setItem(this.db_id, JSON.stringify(this.db));\r\n break;\r\n case 'sessionStorage':\r\n sessionStorage.setItem(this.db_id, JSON.stringify(this.db));\r\n ... | [
"0.7283319",
"0.7194477",
"0.71396863",
"0.698207",
"0.6969177",
"0.6950716",
"0.69330513",
"0.68678457",
"0.6850955",
"0.68430376",
"0.68131816",
"0.6811838",
"0.6784277",
"0.6774028",
"0.67659074",
"0.67659074",
"0.6731758",
"0.67228603",
"0.6711399",
"0.67052925",
"0.66783... | 0.7929967 | 1 |
______________________ private methods _________ database functions drop the database | function drop() {
delete storage[db_id];
db = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dropDB() {\n heading('Dropping database Tasks...')\n request(new Options(undefined, 'DELETE'), undefined, createDB)\n}",
"function delDB()\n\t{\n\t}",
"exitDropDatabase(ctx) {\n\t}",
"dropDatabase() {\n return __awaiter(this, void 0, void 0, function* () {\n const queryRunner... | [
"0.79161566",
"0.77977836",
"0.76500535",
"0.7615936",
"0.76094335",
"0.75249267",
"0.74390066",
"0.7408953",
"0.73853093",
"0.7320786",
"0.7316988",
"0.72813684",
"0.72681797",
"0.72681797",
"0.72681797",
"0.72681797",
"0.72681797",
"0.7249424",
"0.72463036",
"0.724322",
"0.... | 0.7837756 | 1 |
number of tables in the database | function tableCount() {
var count = 0;
for(var table in db.tables) {
if( db.tables.hasOwnProperty(table) ) {
count++;
}
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_tableCount() {\r\n var count = 0;\r\n for (var table in this.db.tables) {\r\n if (this.db.tables.hasOwnProperty(table)) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }",
"function _getDBSizes() {\n\tlet tables = ['plugincontributors', 'pluginmaintainers', 'catego... | [
"0.83378446",
"0.74998075",
"0.72695017",
"0.7219534",
"0.6916134",
"0.68956107",
"0.68956107",
"0.68605095",
"0.65795296",
"0.6519999",
"0.6455176",
"0.6402459",
"0.63820106",
"0.63486785",
"0.6348402",
"0.6177539",
"0.6175034",
"0.6101266",
"0.60011965",
"0.59988284",
"0.59... | 0.86722434 | 0 |
select rows, given a list of IDs of rows in a table | function select(table_name, ids) {
var ID = null, results = [], row = null;
for(var i=0; i<ids.length; i++) {
ID = ids[i];
row = db.data[table_name][ID];
results.push( clone(row) );
}
return results;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_select(table_name, ids, start, limit, sort, distinct) {\r\n var ID = null,\r\n results = [],\r\n row = null;\r\n\r\n for (var i = 0; i < ids.length; i++) {\r\n ID = ids[i];\r\n row = this.db.data[table_name][ID];\r\n results.push(this._clone(row));\r\n }\r\n\r\n ... | [
"0.6265403",
"0.5966379",
"0.5929007",
"0.57797617",
"0.5713348",
"0.56657577",
"0.5603224",
"0.5603224",
"0.5589608",
"0.5542774",
"0.5542774",
"0.5520895",
"0.5508376",
"0.5497506",
"0.54973394",
"0.5478228",
"0.5469596",
"0.5439273",
"0.542396",
"0.54226565",
"0.54226565",... | 0.6914037 | 0 |
commit the database to localStorage | function commit() {
storage[db_id] = JSON.stringify(db);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_commit() {\r\n try {\r\n switch (this.engine) {\r\n case 'localStorage':\r\n localStorage.setItem(this.db_id, JSON.stringify(this.db));\r\n break;\r\n case 'sessionStorage':\r\n sessionStorage.setItem(this.db_id, JSON.stringify(this.db));\r\n ... | [
"0.7283319",
"0.7194477",
"0.71396863",
"0.698207",
"0.6969177",
"0.6950716",
"0.69330513",
"0.68678457",
"0.6850955",
"0.68430376",
"0.68131816",
"0.6811838",
"0.6784277",
"0.6774028",
"0.67659074",
"0.67659074",
"0.6731758",
"0.67228603",
"0.6711399",
"0.67052925",
"0.66783... | 0.7929967 | 0 |
given a data list, only retain valid fields in a table | function validFields(table_name, data) {
var field = '', new_data = {};
for(var i=0; i<db.tables[table_name].fields.length; i++) {
field = db.tables[table_name].fields[i];
if(data[field]) {
new_data[field] = data[field];
}
}
return new_data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tableValidator(data, validFields) {\n // returns an array of fields that are invalid\n const fieldsNotValid = [];\n\n if (!data.table_name || data.table_name.length < 2) {\n fieldsNotValid.push(\"table_name\");\n }\n if (data.capacity < 1 || typeof data.capacity !== \"number\") {\n fieldsNotVal... | [
"0.70431036",
"0.6839189",
"0.6589458",
"0.65855205",
"0.65855205",
"0.61347264",
"0.59776914",
"0.58793956",
"0.5786936",
"0.568507",
"0.5671686",
"0.5566396",
"0.5502897",
"0.5490181",
"0.54553246",
"0.5435483",
"0.5355889",
"0.5280054",
"0.5224341",
"0.5221072",
"0.5208295... | 0.6916696 | 1 |
parseISOString:Takes ISO Date formatted string yyyyMMddThh:mm:ssZ or yyyyMMdd converts to a json date object | function parseISOString(s) {
var b = s.split(/\D+/);
console.log('parseISOString from to ', s, b);
if (b.length = 3)
return new Date(Date.UTC(b[0], --b[1], b[2]));
else
return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], b[5], b[6]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function iso8601Decoder(isoStr) {\n return Date.parse(isoStr);\n }",
"function jsonStringToDate(string) {\n var match\n if (match = string.match(R_ISO8601_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n ... | [
"0.7415052",
"0.7342486",
"0.7332663",
"0.73086137",
"0.72872794",
"0.72805077",
"0.7279439",
"0.7279439",
"0.7279439",
"0.7279439",
"0.7279439",
"0.727307",
"0.7269519",
"0.7269519",
"0.7269519",
"0.7269519",
"0.7269519",
"0.7259135",
"0.7256887",
"0.7256887",
"0.7256887",
... | 0.7584586 | 0 |
used to get the list of nearest libraries from a key value pair object | function getNearestLibrary(obj, input) {
var result = "";
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (key.toLowerCase() == input.toLowerCase()) {
result = obj[key];
}
}
}
console.log("getNearestLibraryResult: " + result);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calc_nearest() {\n var lat = lc._marker._latlng.lat;\n var lon = lc._marker._latlng.lng;\n var dist_arr_lu = []\n var dist_arr_lanta = []\n //replace with combined stops array\n $.each(stops.lehigh, function() { //LOOP: interates through each route for Lehigh\n var b_lat = par... | [
"0.5654448",
"0.55011886",
"0.5416748",
"0.53235686",
"0.5240263",
"0.52220535",
"0.5191183",
"0.5169438",
"0.5134053",
"0.5121591",
"0.51018995",
"0.50850314",
"0.5059995",
"0.5047836",
"0.50386304",
"0.5022432",
"0.5002547",
"0.4993236",
"0.49772698",
"0.49697596",
"0.49587... | 0.6347766 | 0 |
used to Authenticate ourselves witht he Sierra servers | async function connectToSierra() {
const options = {
method: 'POST',
uri: 'https://test.elgar.govt.nz:443/iii/sierra-api/v5/token',
headers: {
'Authorization': 'Basic ' + APIKey
},
body: {
'grant_type': 'client_credentials'
},
json: true // Automatically parses the JSON string in the response,
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async authentication() {\n const data = await this.consume();\n if (data[0] !== 0x05) {\n this.logger.error('Unsupported SOCKS version: %d', data[0]);\n this.socket.end();\n return true;\n }\n\n // o X'00' NO AUTHENTICATION REQUIRED\n // o X'01' GSSAPI\n // o X'02' USERNAME/PASS... | [
"0.59520996",
"0.58661187",
"0.5856747",
"0.5713959",
"0.5710138",
"0.5594223",
"0.5567339",
"0.5451606",
"0.5428531",
"0.5350155",
"0.5318502",
"0.5317398",
"0.53152126",
"0.530097",
"0.5280454",
"0.5248734",
"0.5234942",
"0.5234942",
"0.5234942",
"0.5234942",
"0.5234942",
... | 0.61090857 | 0 |
Looks at the character that is passed on from the level constructor and creates the lava accordingly. | static create(pos, ch) {
switch (ch) {
case "=":
return new Lava(pos, new Vec(2, 0));
case "|":
return new Lava(pos, new Vec(0, 2));
case "v":
return new Lava(pos, new Vec(0, 3), pos);
default:
return ch;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static create(position, character) {\n // static method to create the lava blocks\n if (character == \"=\") {\n // different blocks are created based on the characters defined in the levels\n return new RedBlock(position, new Vector(RedBlockSpeed, 0)); // moving redblock (vertical)\n } else if (... | [
"0.65543634",
"0.63809645",
"0.6054771",
"0.60538995",
"0.5963865",
"0.5868579",
"0.5794759",
"0.57321066",
"0.5630937",
"0.55943197",
"0.5587234",
"0.55726695",
"0.555734",
"0.5554842",
"0.5528833",
"0.55121803",
"0.55061865",
"0.5485872",
"0.5485872",
"0.5485872",
"0.547244... | 0.65643007 | 0 |
This function checks whether the caretaker and student has the same mobile no and will return false if so | function ValidateParentChildPhoneNo() {
var isValidate = true;
var studentMobileNo = $("#txtMobileNo").val().trim();
var guradianNobileNo = $("#txtGuradianContactNo").val().trim();
if (studentMobileNo == guradianNobileNo) {
bootbox.alert("Student MobileNo and CareGiver Cont... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateMobileNumber(mobileNumber) {\n var mob = /^(016|019|011|017|018|015)[0-9]{8}$/;\n \n if (mob.test(mobileNumber) == false) {\n return false;\n }\n return true;\n }",
"function checkPatient (dni, numss) {\r\n return (dni === localStorage.getItem(\"dni\") && numss === localStorag... | [
"0.61859787",
"0.6091299",
"0.6071043",
"0.59782994",
"0.59619683",
"0.5959342",
"0.5794302",
"0.578414",
"0.57594097",
"0.57567215",
"0.5731901",
"0.57236254",
"0.57189554",
"0.56952566",
"0.56795007",
"0.5665353",
"0.56381536",
"0.56331164",
"0.56328905",
"0.5621351",
"0.56... | 0.6727939 | 0 |
Function to update Dashboard based on patient selection | function switchDashboard() {
//Grab input value
const input = select.property("value");
//Grab the index value for the desired patient
const index = names.findIndex(name => name == input);
//Reset trace values for Bar plot
let barx = samples[index].sample_values.reverse()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function optionChanged(selectedPatientID) {\r\n console.log(selectedPatientID);\r\n buildCharts(selectedPatientID);\r\n populateDemographicInfo(selectedPatientID);\r\n}",
"function optionChanged(patientId) {\n console.log(`Current Patient is ${patientId}`);\n // console.log('replot');\n barGrap... | [
"0.6835719",
"0.64894646",
"0.60962385",
"0.58898413",
"0.58329695",
"0.5831099",
"0.5801744",
"0.57941335",
"0.5689956",
"0.56863576",
"0.5675207",
"0.556649",
"0.5563011",
"0.5539631",
"0.55341357",
"0.547371",
"0.5457296",
"0.54469216",
"0.5406468",
"0.5390312",
"0.5383456... | 0.7003677 | 0 |
functions to define user preference with displaying temperature | function setTemperatureMeasurement() {
let preference = getPreference();
document.getElementById(preference).setAttribute('checked', true);
if (preference === "celsius") {
unit = "metric";
return unit;
} else {
unit = "imperial";
return unit;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateTemperatureInfo(tempC) {\n if (celcius)\n $(\"#temperature\").html(tempC + \" °C\");\n\n else {\n tempC = convertToFahr(tempC);\n $(\"#temperature\").html(tempC + \" °F\");\n }\n}",
"handleTempChoise() {\n const cInput = document.getElementById('celsius')\n const fInput... | [
"0.6635594",
"0.6420323",
"0.6390983",
"0.63711226",
"0.6360405",
"0.63562953",
"0.6243042",
"0.62378323",
"0.62370867",
"0.6218047",
"0.6208025",
"0.6206933",
"0.6189321",
"0.6176994",
"0.6164668",
"0.6142501",
"0.6102097",
"0.6083757",
"0.6082924",
"0.60821664",
"0.6080711"... | 0.7359322 | 0 |
function to create the day div and display the time for the forecast | function displayForecast(forecast) {
let currentDay = forecast.list[0].dt_txt.split(" ")[0];
let dayNumber = 1;
let day = document.createElement('div');
day.setAttribute('id', 'day' + dayNumber);
day.innerHTML = '<p class="dateFormat">Day: ' + forecast.list[0].dt_txt.split(" ")[0] + '</p>';
days... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayForecast(data) {\n var forecastHTML = '<div id=\"forecasts\">'\n $.each(data.list,function(i,day) {\n forecastHTML += '<div class=\"forecast\"><p>'+ dateConverter(day.dt) + '</p><p>High: '+day.temp.max+'</p><p>Low: '+ day.temp.min+'</p></div>'\n }); // end each\n forecast... | [
"0.7169278",
"0.7165742",
"0.71586865",
"0.71389407",
"0.7128638",
"0.7086421",
"0.70696163",
"0.7060353",
"0.7051901",
"0.70164",
"0.70114034",
"0.6986644",
"0.6958433",
"0.68907535",
"0.684549",
"0.68452936",
"0.6841564",
"0.6835398",
"0.6821094",
"0.68070996",
"0.67920333"... | 0.73159873 | 0 |
JavaScript specific to pages with a header on mobile devices | function pagesWithHeaderMobile() {
// Show page information/instructions on icon click
if ($(".info-drop-down").length > 0) {
// $(".header-page-icon").on("click", toggleOverlays);
$(".close-drop-down").on("click", function() {
$(".info-drop-down").removeClass("pull-down");
$(".will-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mobileNavigation(){\r\n if( $(window).width() < 979 ){\r\n //$(\".main-navigation.navigation-top-header\").remove();\r\n $(\".main-navigation.navigation-top-header\").css(\"display\",\"none\");\r\n $(\".toggle-navigation\").css(\"display\",\"inline-block\");\r\n $(\".main-na... | [
"0.6611816",
"0.6492517",
"0.64777756",
"0.6219122",
"0.61765754",
"0.60985106",
"0.6037147",
"0.6026844",
"0.60042846",
"0.59410495",
"0.59279156",
"0.5926048",
"0.5916106",
"0.5902263",
"0.58976775",
"0.5895105",
"0.58651304",
"0.58604807",
"0.5828749",
"0.58123404",
"0.578... | 0.75066406 | 0 |
Generate email verification code. | generateEmailVerificationCode() {
return crypto.randomBytes(64).toString('hex');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateVerificationCode() {\n return Math.random().toString(36).substr(2, 10).toUpperCase(); // remove `0.`\n }",
"generateCodeVerifier() {\n const charArr = [];\n const maxNumber = 256 - 256 % CharSet.CV_CHARSET.length;\n\n while (charArr.length <= RANDOM_OCTET_SIZE) {\n ... | [
"0.73834014",
"0.6706827",
"0.6673273",
"0.6644426",
"0.6644426",
"0.6553308",
"0.65038544",
"0.6503695",
"0.6458269",
"0.64522475",
"0.64517665",
"0.64065385",
"0.6383085",
"0.63009685",
"0.6251664",
"0.6221336",
"0.61987615",
"0.6195114",
"0.61484414",
"0.61210364",
"0.6114... | 0.8165731 | 0 |
Check if Git is installed | checkGit() {
if (this.skipChecks || this.skipClient) return;
this.gitInstalled = this.isGitInstalled();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async gitRepoExists() {\n const gitRepoExistsOutput = await execa.stdout('git', [ 'rev-parse', '--git-dir' ]);\n if (gitRepoExistsOutput.includes('Not a git repository')) {\n throw new Error(`No git repository found.`);\n }\n return true;\n }",
"function isInGitRepositor... | [
"0.730212",
"0.6674237",
"0.6623764",
"0.6600975",
"0.6513686",
"0.6302389",
"0.621026",
"0.60387695",
"0.59759",
"0.596116",
"0.5896575",
"0.57814944",
"0.56688315",
"0.5653483",
"0.5647093",
"0.5640456",
"0.5629249",
"0.5624073",
"0.5609421",
"0.5533736",
"0.5459262",
"0.... | 0.8365899 | 0 |
Get the port to run the server on, detecting if the intended port is available first and prompting the user if not. | function getServerPort(args, intendedPort, cb) {
(0, _detectPort2.default)(intendedPort, (err, suggestedPort) => {
if (err) return cb(err);
// No need to prompt if the intended port is available
if (suggestedPort === intendedPort) return cb(null, suggestedPort);
// Support use of --force to avoid inte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPort () {\n if (!argv.p) {\n portfinder.basePort = 3000;\n portfinder.getPort(function (err, port) {\n if (err) throw err;\n server.port = port;\n console.log(server);\n start(app, server);\n });\n } else {\n server.port = argv.p;\n start(app, server);\n }\n}",
"... | [
"0.7001814",
"0.6959002",
"0.6857002",
"0.6467694",
"0.6446057",
"0.6444672",
"0.63748944",
"0.62519795",
"0.62394255",
"0.61921227",
"0.6177748",
"0.6177748",
"0.6162781",
"0.6162781",
"0.6160004",
"0.6152047",
"0.61509264",
"0.61494726",
"0.61416227",
"0.6138125",
"0.613380... | 0.74289525 | 0 |
Start a development server with Webpack using a given build configuration. | function webpackServer(args, buildConfig, cb) {
// Default environment to development - we also run the dev server while
// testing to check that HMR works.
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'development';
}
if (typeof buildConfig == 'function') {
buildConfig = buildConfig(args);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function installWebpackDevServer() {\n\n // Step 1: Create & configure a webpack compiler\n var webpack = require('webpack');\n var webpackConfig = require(process.env.WEBPACK_CONFIG ? process.env.WEBPACK_CONFIG : './webpack.config');\n var compiler = webpack(webpackConfig);\n\n // Step 2: Attach the dev midd... | [
"0.7377386",
"0.71758825",
"0.66685736",
"0.65808624",
"0.65560305",
"0.6459047",
"0.6451157",
"0.63428015",
"0.63182145",
"0.6263991",
"0.62582374",
"0.6248456",
"0.6167717",
"0.60914207",
"0.6071283",
"0.60711455",
"0.6067948",
"0.6058828",
"0.60453606",
"0.6017137",
"0.599... | 0.7518276 | 0 |
Checks whether a property name is a writeable attribute. | function shouldSetAttribute(name, value) {
if (isReservedProp(name)) {
return false;
}
if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
return false;
}
if (value === null) {
return true;
}
switch (typ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isStandardAttribute(name) {\n return /^(get|set|value|writable|enumerable|configurable)$/.test(name);\n}",
"function isProperty(name) {\n return [\"checked\", \"multiple\", \"muted\", \"selected\", \"value\"].includes(name);\n}",
"function shouldSetAttribute(name, value) {\n if (isReservedProp(name... | [
"0.6525762",
"0.6220431",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6212546",
"0.6188551",
"... | 0.6282402 | 1 |
shouldIgnoreValue() is currently duplicated in DOMMarkupOperations. TODO: Find a better place for this. | function shouldIgnoreValue(propertyInfo, value) {
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shouldIgnoreValue(propertyInfo, value) {\n\t return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;\n\t}",
"function shouldIgnoreVal... | [
"0.7113597",
"0.7113597",
"0.7113597",
"0.7086677",
"0.7086677",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"0.70182824",
"... | 0.71230716 | 1 |
Return if A is an ancestor of B. | function isAncestor(instA, instB) {
while (instB) {
if (instA === instB || instA === instB.alternate) {
return true;
}
instB = getParent(instB);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isAncestor(instA, instB) {\n while (instB) {\n if (instA === instB || instA === instB.alternate) {\n return true;\n }\n instB = getParent(instB);\n }\n return false;\n}",
"function isAncestor(instA, instB) {\n while (instB) {\n if (instA === instB || instA === instB.alternate) {\n ... | [
"0.7910443",
"0.7910443",
"0.7910443",
"0.7910443",
"0.7910443",
"0.7910443",
"0.76587915",
"0.76587915",
"0.7651243",
"0.7651243",
"0.7619279",
"0.7619279",
"0.7565",
"0.75575995",
"0.7540808",
"0.75398135",
"0.75398135",
"0.75398135",
"0.75398135",
"0.75398135",
"0.75398135... | 0.7986894 | 0 |
Responder System: A global, solitary "interaction lock" on a view. If a node becomes the responder, it should convey visual feedback immediately to indicate so, either by highlighting or moving accordingly. To be the responder means, that touches are exclusively important to that responder view, and no other view. Whil... | function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === 'topSelectionChange' ? eventTypes.selectionCha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"create(config) {\n var interactionState = {\n handle: null\n };\n var gestureState = {\n // Useful for debugging\n stateID: Math.random(),\n x: 0,\n y: 0,\n initialX: 0,\n initialY: 0,\n deltaX: 0,\n deltaY: 0,\n velocityX: 0,\n velocityY: 0,\n n... | [
"0.5801461",
"0.52991086",
"0.5011917",
"0.49721572",
"0.49721572",
"0.49721572",
"0.49721572",
"0.48722115",
"0.47226918",
"0.47226918",
"0.47226918",
"0.4698405",
"0.46781904",
"0.46637928",
"0.46558517",
"0.4597005",
"0.45966113",
"0.4587997",
"0.45775983",
"0.4565138",
"0... | 0.6097997 | 0 |
Returns size of icon. Priority order: style prop, size prop, spacing.iconSize. | function getIconSize(props, context) {
var spacing = context.uiTheme.spacing;
var icon = props.style.icon;
if (icon && icon.width) {
return icon.width;
}
if (props.size) {
return props.size;
}
return spacing.iconSize;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"iconSize() {\r\n switch (this.size) {\r\n case 'is-small': return this.size\r\n case 'is-medium': return\r\n case 'is-large': return this.newIconPack === 'fa'\r\n ? ''\r\n : 'is-medium'\r\n }\r\n }",
"... | [
"0.7583822",
"0.68833303",
"0.64942247",
"0.64863217",
"0.6175509",
"0.6142164",
"0.6133852",
"0.6106813",
"0.6106813",
"0.604507",
"0.5995729",
"0.5951145",
"0.5925871",
"0.58425987",
"0.58084726",
"0.57635576",
"0.5723699",
"0.5722753",
"0.57182974",
"0.5689262",
"0.5662717... | 0.8024758 | 0 |
Configures the min length to calculate the shorten part of url | setShortenMinLength(minLength) {
this._shortenMinLength = minLength;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shortenUrl(url){\n var res = request('GET', 'https://api-ssl.bitly.com/v3/shorten?access_token=' + process.env.BITLY_OAUTH + '&longUrl=' + encodeURI(url));\n var data = JSON.parse(res.getBody('utf8'));\n return data.data.url;\n}",
"function shortenLink(longUrl) {\n // With Bitly\n ... | [
"0.6125888",
"0.6030925",
"0.6019047",
"0.59985346",
"0.5959217",
"0.59492314",
"0.5940548",
"0.59366876",
"0.59366876",
"0.59366876",
"0.59366876",
"0.5884989",
"0.58197653",
"0.5810573",
"0.57477975",
"0.5737094",
"0.5720211",
"0.5690361",
"0.5682351",
"0.56797785",
"0.5677... | 0.70306194 | 0 |
If valid, generates the service URL | _generateServiceUrl(serviceUrl) {
const URLValidation = new URLValidator(serviceUrl);
if (!URLValidation.isValid()) {
throw new Error(URLValidation.getErrors().toString());
}
return new URL(serviceUrl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getServiceURL(options) {\n \n}",
"function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}",
"function buildUrl() {\n if (!_.get(ADK, 'ResourceService.buildUrl')) {\n _.set(ADK, 'ResourceService.buildUrl', _.noop);\n }\n... | [
"0.7251564",
"0.7179682",
"0.6958056",
"0.6849949",
"0.6768652",
"0.6657037",
"0.6657037",
"0.6657037",
"0.6641017",
"0.664027",
"0.65557927",
"0.6548594",
"0.6511167",
"0.6508912",
"0.6451405",
"0.642937",
"0.636444",
"0.6328667",
"0.6304476",
"0.6299369",
"0.62050223",
"0... | 0.7869327 | 0 |
The idea is to pass to the custom `filter` the fullPath and stats args; not only the file name | function withCustomFilter(f) {
var fullPath = path.join(filename, f);
if (f && filter) {
return filter(fullPath, fs.lstatSync(fullPath));
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stats() {\n\t\n\tvar files = _.flatten(arguments);\n\tvar stats = _.map(files, stat);\n\treturn Rx.Observable.concat(stats);\n}",
"async process() {\n const allStats = await glob(this.sourcePatterns, {\n cwd: this.baseDir,\n dot: this.dotFiles,\n stats: true\n })\n\n /**\n * ... | [
"0.53986496",
"0.5359645",
"0.5306385",
"0.51423097",
"0.5097346",
"0.5078702",
"0.5017698",
"0.50090766",
"0.50038975",
"0.4990269",
"0.49384722",
"0.49378982",
"0.49342394",
"0.49076915",
"0.4905283",
"0.49003115",
"0.48995304",
"0.48954952",
"0.48490077",
"0.48464265",
"0.... | 0.60498816 | 0 |
Sets up the EasyScore instance to be used by the overall component. One EasyScore instance is used for vfstave and its children so that the clef and time can be set by the stave and don't have to be provided as attributes on the children or set on the children. | _setupScore() {
this.score = this._vf.EasyScore();
// Defaults to treble clef, 4/4 time if not specified
this.score.set({
clef: this.clef || 'treble',
time: this.timeSig || '4/4'
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createScore() {\n this.score = new Score(this.canvas, this.ctx);\n }",
"function Score() {\n\tthis.init();\n\tthis.timer = 0;\n}",
"init () {\n super.init();\n\n this.highScoreDisplay = this.container.querySelector('.high-score-display');\n this.highLevelDisplay = this.container.querySelector('.hi... | [
"0.6487948",
"0.6171862",
"0.5984559",
"0.5965236",
"0.590066",
"0.5882357",
"0.5759274",
"0.56905746",
"0.5690097",
"0.5673306",
"0.56677383",
"0.56670934",
"0.5660026",
"0.5653546",
"0.5653028",
"0.55548066",
"0.55420303",
"0.55156523",
"0.5481023",
"0.5474175",
"0.5467432"... | 0.7418473 | 0 |
This sample demonstrates how to Creates or updates the specified application gateway. | async function createApplicationGateway() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const applicationGatewayName = "appgw";
const parameters = {
backendAddressPools: [
{
name: "appgwpool... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initApiGateway() {\n // start by copying `ctrl.apiGateway` so it does not change the parent component's copy\n ctrl.apiGateway = angular.copy(ctrl.apiGateway);\n\n lodash.defaultsDeep(ctrl.apiGateway, {\n spec: {\n name: '',\n ... | [
"0.56689435",
"0.54320997",
"0.5427377",
"0.541977",
"0.5375147",
"0.5369228",
"0.5231684",
"0.5171873",
"0.5151436",
"0.5148973",
"0.5143702",
"0.5138201",
"0.5112734",
"0.5103599",
"0.5086749",
"0.50574785",
"0.5015459",
"0.50081986",
"0.49971396",
"0.49798074",
"0.49788535... | 0.6760017 | 0 |
clear right box items | function clearItems(box) {
const images = $('.right_side-box').find('img');
for (let i = 0; i < images.length; i++) {
//generate selector
$(`.${box}_forms`).append(images[i])
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearAll () {\n\t\tif(method == 1){\n\t\t\t// move the left items over to the right side\n\t\t\t$(\"#left-sortable\").children().each(function(index){\n\t\t\t\tif($(this).children().size() > 0){\n\t\t\t\t\tvar tier = 1;\n\t\t\t\t\t$(this).children().each(function(index){\n\t\t\t\t\t\tvar temp = $(\"#right... | [
"0.7354549",
"0.7059866",
"0.70489746",
"0.6804753",
"0.66495967",
"0.6611494",
"0.65095884",
"0.6481719",
"0.64540154",
"0.6423768",
"0.64117223",
"0.63953125",
"0.6384722",
"0.6358834",
"0.6357288",
"0.6349727",
"0.6324917",
"0.6323587",
"0.6320998",
"0.6299371",
"0.6288944... | 0.7462006 | 0 |
initial position of libra. | function initPosition() {
libra.css({
transform: 'translate(392.943px, 391.46px) rotate(16deg)',
transition: 'all 0.5s ease'
});
libraLeft.css({
transform: 'translate(323px, 472.116px)',
transition: 'all 0.5s ease'
});
libraRight.css({
transform: 'translate(57... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"__init() {this.position = 0;}",
"__init5() {this.pos = 0}",
"__init3() {this.pos = 0;}",
"function initialize(){\n moveAbsolute(initialPos);\n}",
"__init8() {this.offsetRotation = 0;}",
"_ensureCorrectInitialPosition() {\n this._ensureCorrectPositionOnNextRun();\n this._ensureCorrectPositionOnWi... | [
"0.66489667",
"0.64175344",
"0.638724",
"0.6326939",
"0.60320616",
"0.5960752",
"0.59057397",
"0.58914244",
"0.5885822",
"0.5850179",
"0.58498913",
"0.58127266",
"0.5776129",
"0.5773623",
"0.5768815",
"0.5746648",
"0.57210743",
"0.57198745",
"0.57180965",
"0.5717427",
"0.5696... | 0.69701433 | 0 |
opens up a lightbox for use as a message box that will look the same on all browsers | function showMessage(msg) {
if(!lightbox_css_added) {
$jq(document).find("head").append("\t<link rel=\"stylesheet\" href=\"/css/lightbox.css\" />");
lightbox_css_added = true;
}
$jq(document.body).prepend("<div class=\"lightbox-bg\"></div><div class=\"lightbox-msg\">"+msg+"<br /><button class=\"lightbox-msg-ok\"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMessage(msg) {\n\tif(!lightbox_css_added) {\n\t\t$jq(document).find(\"head\").append(\"\\t<link rel=\\\"stylesheet\\\" href=\\\"/css/lightbox.css\\\" />\");\n\t\tlightbox_css_added = true;\n\t}\n\t$jq(document.body).prepend(\"<div class=\\\"lightbox-bg\\\"></div><div class=\\\"lightbox-msg\\\">\"+msg+... | [
"0.761135",
"0.693571",
"0.6921438",
"0.691246",
"0.69008577",
"0.6895866",
"0.6867371",
"0.6867371",
"0.6864769",
"0.6815489",
"0.6811932",
"0.67641985",
"0.6737849",
"0.6735056",
"0.671224",
"0.66456354",
"0.6638485",
"0.66360253",
"0.66160685",
"0.66156",
"0.66046673",
"... | 0.7769493 | 0 |
Append new line at the end of the string | function appendNewLine(str) {
var newString = str.substr(0, str.length - 1);
return newString + "\n";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"writeNextLine(line) {\n this.string += line + '\\n';\n }",
"function addNewLine(txt){\n if(txt.length > 0) {\n return String(txt) + \"\\n\";\n }\n }",
"function newLine(contents) {\n const lastChar = contents && contents.slice(-1) === '\\n' ? '' : '\\n';\n return content... | [
"0.7290216",
"0.72681516",
"0.69764495",
"0.69378334",
"0.6906572",
"0.6700542",
"0.6660738",
"0.6504401",
"0.64950144",
"0.64244235",
"0.6407796",
"0.626005",
"0.6166469",
"0.6149213",
"0.6103276",
"0.6042356",
"0.6014889",
"0.59409744",
"0.5879735",
"0.58346856",
"0.5833804... | 0.78031266 | 0 |
string passed in as an argument. The ASCII string value is the sum of the ASCII values of every character in the string. (You may use String.prototype.charCodeAt()to determine the ASCII value of a character.) Example: asciiValue('Four score'); // 984 asciiValue('Launch School'); // 1251 asciiValue('a'); // 97 asciiValu... | function asciiValue(string) {
let sum = 0;
for (let index = 0; index < string.length; index += 1) {
sum += string.charCodeAt(index);
}
return sum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function asciiValue(string) {\nvar result = 0;\n for (var i = 0; i < string.length; i++) {\n result += string.charCodeAt(i);\n }\n\n return result;\n}",
"function asciiValue(string) {\n let total = 0;\n\n string.split(\"\").forEach(char => {\n total += char.charCodeAt();\n });\n return total;\n}",
... | [
"0.8371126",
"0.82820934",
"0.81718653",
"0.8152057",
"0.8027223",
"0.71994734",
"0.7092298",
"0.6831898",
"0.6403248",
"0.6358036",
"0.63197356",
"0.61488175",
"0.60862213",
"0.60238385",
"0.59430885",
"0.58261627",
"0.58183074",
"0.57837945",
"0.5782467",
"0.5762532",
"0.57... | 0.8382467 | 0 |
returns the next node for the given answer and current node | function nextNode(node, answer) {
if (typeof answer === 'undefined')
return g.getNode(node.route('always'));
console.log('here');
return g.getNode(node.route(answer))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getNextQuestionForTreeType(currentQuestion) {\n let flag = false;\n let nextQstn;\n let isLastQuestion;\n let result;\n currentQuestion.answers.forEach(q => {\n if (q.description == currentQuestion.userAnswers[0] && !q.isLastQuestion) {\n flag = true;\n ... | [
"0.67353195",
"0.61163205",
"0.60834694",
"0.60720176",
"0.60656047",
"0.60532427",
"0.59979403",
"0.5922725",
"0.5870569",
"0.5849481",
"0.58289313",
"0.5800615",
"0.57872015",
"0.5768762",
"0.57541823",
"0.5744384",
"0.572067",
"0.56996614",
"0.5691611",
"0.5658847",
"0.565... | 0.810189 | 0 |
calculate radius for an oda bubble for a single year | getRadius(year) {
const type = 'singlePayments';
const windowWidth = $(window).width();
let rangeValues = [20, 120];
if (windowWidth > 768 ) {
rangeValues = [25, 150];
}
const range = this.getRange(rangeValues);
const value = this._getDataValueForYear(type, year);
if (!value) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function radius(o){return o*17+17;}",
"function getMovieCircleData(d, i) {\n if (d.Year <= startYear) {\n return arc.centroid(d)[i] * 1.0;\n }\n else if (d.Year > endYear) {\n return arc.centroid(d)[i] * 1.080;\n }\n else {\n return arc.centroid(d)[i] * (0.138 + 0.0123 * (d.Year - b... | [
"0.6913167",
"0.67800194",
"0.65187174",
"0.628624",
"0.6271365",
"0.61455566",
"0.6070662",
"0.6042198",
"0.604076",
"0.604076",
"0.60022485",
"0.5997915",
"0.59786266",
"0.59668815",
"0.596415",
"0.59619933",
"0.5960382",
"0.5958208",
"0.59519976",
"0.5951997",
"0.59506524"... | 0.76649857 | 0 |
Fonction pour envoyer le nombre de vues dans la BD | function envoiNbrVues(evt){
var liens = evt.currentTarget;
var comment = liens.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
var vues = comment.previousSibling.previousSibling.previousSibling.firstChild.nextSibling;
var attriLien... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"aumentarVelocidad(){\n this.velocidad += 1;\n }",
"function addCoussin() {\n nbrCoussin++;\n $('#listCoussins').html(\"<div><img id=\" + nbrCoussin + \" src='img/\"+ nbrCoussin +\".png' alt='Coussin numéro\"+ nbrCoussin +\"'></div>\");\n $('#cpt').html(\"<p>\"+ nbrCoussin +\"</p>\"... | [
"0.6125975",
"0.601126",
"0.5997431",
"0.59641784",
"0.5932265",
"0.59053946",
"0.5802835",
"0.5801121",
"0.57998437",
"0.5793888",
"0.5792695",
"0.5753482",
"0.57404554",
"0.5717175",
"0.5711514",
"0.56868106",
"0.56728655",
"0.56667405",
"0.56421936",
"0.5623798",
"0.561685... | 0.62210494 | 0 |
Function to handle Open OBJ file | function openFile(e){
var reader = new FileReader();
reader.addEventListener("load", function(event) {
OBJobject.loadModel(event.target.result);
});
reader.readAsText(e.target.files[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse); // Parse the file\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file ... | [
"0.7165914",
"0.71473235",
"0.68056923",
"0.6796326",
"0.6479092",
"0.6439324",
"0.6416759",
"0.6372176",
"0.60776645",
"0.6057631",
"0.6002745",
"0.6002745",
"0.6002745",
"0.6002745",
"0.597189",
"0.59535813",
"0.5936395",
"0.5927257",
"0.5907842",
"0.5907842",
"0.59019715",... | 0.82805485 | 0 |
Function to handle Open Texture file | function openTexture(e){
var reader = new FileReader();
reader.addEventListener("load", function(event) {
console.log('aja');
imageTexture.src = event.target.result;
}, false);
reader.readAsDataURL(e.target.files[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initTexture(path){\n //var index = this.texture.length;\n this.texture = this.gl.createTexture();\n this.texture.image = new Image();\n var self = this;\n this.texture.image.onload = function(){\n self.handleLoadedTexture(self.texture);\n }\n this.texture... | [
"0.6583946",
"0.6583946",
"0.63821894",
"0.6293275",
"0.6235922",
"0.61990523",
"0.6198381",
"0.618618",
"0.61410195",
"0.6096094",
"0.6092594",
"0.5983477",
"0.5895709",
"0.5891097",
"0.58275545",
"0.5816122",
"0.5811974",
"0.5800459",
"0.57962924",
"0.579301",
"0.5755275",
... | 0.75789356 | 0 |
Register the receive functions, and restore the calibration from local storage, or from the server. | start() {
super.start();
// load previous calibration on start.
this.load();
// done when actually loaded
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function YSensor_loadCalibrationPoints(rawValues,refValues)\n {\n var ii; // iterator\n rawValues.length = 0;\n refValues.length = 0;\n \n // Load function parameters if not yet loaded\n if (this._scale == 0) {\n if (this.load(YAPI.defaultCacheValidity) != YA... | [
"0.53688395",
"0.51108444",
"0.50341827",
"0.50308746",
"0.5029467",
"0.49012592",
"0.48152137",
"0.46805456",
"0.4611191",
"0.4586912",
"0.4572715",
"0.45586246",
"0.4545576",
"0.45448315",
"0.45411882",
"0.45189783",
"0.44850102",
"0.44779283",
"0.44775477",
"0.44536617",
"... | 0.5505508 | 0 |
Save calibration locally, and on the server. | save() {
this.calibration.save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function saveCalibration() {\n document.querySelector('#newCalibrationBtn').style.display = 'initial';\n document.querySelector('#newCalibrationDiv').style.display = 'none';\n\n pixelToDistanceRatio();\n pdRatio = document.getElementById(\"pdRatio\").value;\n\n name = document.getElementById(\... | [
"0.6001029",
"0.56134486",
"0.5512907",
"0.546832",
"0.5422435",
"0.5410712",
"0.5395857",
"0.5392085",
"0.53662366",
"0.53590065",
"0.5331729",
"0.5313989",
"0.5308517",
"0.5308035",
"0.5276425",
"0.5268683",
"0.52610606",
"0.5238527",
"0.521916",
"0.51471037",
"0.51351553",... | 0.67284256 | 0 |
a mission has been proposed and voted in favor of. Start the mission | function startMission() {
//hide the modal, update game info, and emit updateGame signal
$(".modal").modal('hide');
gameInfo.numRejectedMissionsIAR = 0;//reset this
gameInfo.currentlyVoting = true;//set game state to voting
socket.emit("updateGame", gameInfo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function start(mode, type, selection) {\n\tqm.sendNext(\"Talk to Hiver in Ludibrium Village.\");\n\tqm.forceStartQuest();\n\tqm.dispose();\n}",
"function start(mode, type, selection) {\n\tif (qm.canHold(4032455,1)) {\n\t\tqm.sendNext(\"Go deliver this to Chief Stan of Henesys.\");\n\t\tqm.gainItem(4032455,1);\n\... | [
"0.602939",
"0.6003735",
"0.5926832",
"0.58745337",
"0.5841724",
"0.5733189",
"0.57272935",
"0.56717205",
"0.5667295",
"0.5591485",
"0.5574583",
"0.5572704",
"0.55466133",
"0.55291486",
"0.55213207",
"0.5519309",
"0.55039775",
"0.54970074",
"0.5478586",
"0.5465833",
"0.545953... | 0.6124885 | 0 |
a mission has been proposed and voted against. Skip the mission | function skipMission() {
//hide the modal, update the game, and start next round
$(".modal").modal('hide');
gameInfo.numRejectedMissionsIAR += 1;//increment this
gameInfo.currentLeaderIndex = (gameInfo.currentLeaderIndex + 1) % gameInfo.players.length
gameInfo.missionMembers = [];
gameInfo.start... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkVotePhaseStatus(m) {\n\tvar votingDone = true;\n\tfor (var i in room.votes) {\n\t\tif (room.votes[i] === null) votingDone = false;\n\t}\n\tif (votingDone) {\n\t\taddVotesToVotingPhase(room.votes); // add the votes to the view\n\t\troom.timer.active = false; // disable the timer\n\t\tdrawCountdown(tru... | [
"0.57852113",
"0.5742347",
"0.57409126",
"0.5683356",
"0.54627204",
"0.54578143",
"0.5413349",
"0.53813124",
"0.5375912",
"0.53330076",
"0.52748936",
"0.52535796",
"0.52518046",
"0.52404135",
"0.52350885",
"0.5216517",
"0.52129173",
"0.5192849",
"0.517082",
"0.51500654",
"0.5... | 0.58765084 | 0 |
send a vote to fail the mission | function voteMissionFail() {
//hide the modal, send vote
$(".modal").modal('hide');
var vote = {username: username, vote: "fail", gameID: gameInfo.gameID}
socket.emit("vote", vote);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendNegativeVote() {\n sendVote(false);\n}",
"function checkFail(){\n\tif (Lives==0){\n\t\talertify.alert(\"No More Lives Left! Do some more Revision!\");\n\t\tLives=0;\n\t\tload_review();\n\t}\n}",
"downVote() {\n this.castVote_(false);\n }",
"async function should_fail_commitvote(_from_accoun... | [
"0.686659",
"0.590891",
"0.5907333",
"0.5893783",
"0.582321",
"0.5786455",
"0.57676506",
"0.5669372",
"0.56550115",
"0.5638485",
"0.56328785",
"0.56233376",
"0.5559918",
"0.55477506",
"0.55021274",
"0.5501685",
"0.5473586",
"0.54734623",
"0.5460272",
"0.5459176",
"0.54585844"... | 0.6838179 | 1 |
this method asynchronously loads list of acceptable places based on user's query input frpm the API call | async loadPlaces(inputValue) {
var country = this.state.country;
var locale = this.state.locale;
var currency = this.state.currency;
const response = await fetch(`https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/autosuggest/v1.0/${country}/${currency}/${locale}/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getPlaces(q,type){\n\n console.log(\"----- getPlaces\");\n\n console.log(\"Query:\"+q);\n console.log(\"Type:\"+type);\n\n\n // Generate and fill Place text search API url\n let gm_place_api_url_base = 'https://maps.googleapis.com/maps/api/place/textsearch/json?';\n\n let gm_place_api_url = g... | [
"0.7113788",
"0.7066922",
"0.7030983",
"0.6863431",
"0.6718844",
"0.66387945",
"0.6592313",
"0.6568029",
"0.6478358",
"0.64449483",
"0.64391637",
"0.63958776",
"0.6393759",
"0.63779384",
"0.63755816",
"0.6353272",
"0.6349677",
"0.6349056",
"0.63383496",
"0.6330818",
"0.632125... | 0.76503456 | 0 |
cleans the json info to only necessary information after API GET Browse Quotes. Used within getFlightInfo(); | cleanFlightInfo(json) {
/**Dealing with JSON
* Carriers: {CarrierId, Name}
* Places: {Name, Type, PlaceId, ...}
* Quotes:
* Each quote objecct has
* Direct - bool
* MinPrice - price
* (InboundLeg)/Outb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeUnnecessaryFieldsFromJSON(object) {\n if (object.hasOwnProperty('rawExtensions')) {\n delete object['rawExtensions'];\n }\n if (object.hasOwnProperty('application')) {\n ... | [
"0.5790861",
"0.57435924",
"0.5724166",
"0.55116385",
"0.5509312",
"0.547218",
"0.5441432",
"0.54372245",
"0.5362749",
"0.5339569",
"0.5308754",
"0.5302735",
"0.52873605",
"0.52849126",
"0.5264079",
"0.5246388",
"0.5223651",
"0.52096236",
"0.5201781",
"0.519802",
"0.5194879",... | 0.6088791 | 0 |
Problem: function called 'Language' is not handled correctly in onclick handler. Function must be at global scope. | function Language(x) { alert( "It works OK now." ); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function menuLang(language) {\n \"use strict\";\n switch (language) {\n case \"french\":\n //document.getElementById(\"lang\").innerHTML = '<a href=\"#\" onClick=\"changeLang(\\'french\\');\"> FR </a>';\n break;\n case \"english\":\n // document.getElementById(\"lang\").innerHTML = ... | [
"0.7474886",
"0.7409127",
"0.7290614",
"0.7274494",
"0.70187736",
"0.67312694",
"0.6616276",
"0.6577257",
"0.6562788",
"0.6558953",
"0.65273845",
"0.6507665",
"0.6505182",
"0.6477418",
"0.6472462",
"0.6449156",
"0.64411825",
"0.6429162",
"0.64287406",
"0.6416676",
"0.63907003... | 0.7615116 | 0 |
Example The maximum height candles are units high. There are of them, so return . Function Description Complete the function birthdayCakeCandles in the editor below. birthdayCakeCandles has the following parameter(s): int candles[n]: the candle heights Returns int: the number of candles that are tallest Input Format Th... | function birthdayCakeCandles(candles) {
// Write your code here
const tallest = Math.max(...candles);
let tallestCount = 0;
candles.forEach(candle => {
if (candle === tallest) tallestCount++;
})
return tallestCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function birthdayCakeCandles(candles) {\n let max = 0;\n let counter = 0;\n let sortedCandles = candles.sort();\n for (let num of sortedCandles) {\n if (num > max) {\n counter = 1;\n max = num;\n } else if (num === max) {\n counter += 1;\n }\n }\n return counter;\n}",
"function birt... | [
"0.7322386",
"0.68373436",
"0.63891435",
"0.630572",
"0.61082673",
"0.6066713",
"0.6022159",
"0.5906732",
"0.57379866",
"0.5346731",
"0.52491635",
"0.5224863",
"0.5186141",
"0.5168023",
"0.5166541",
"0.5126734",
"0.5092815",
"0.5084716",
"0.5045068",
"0.4959177",
"0.49340406"... | 0.71744263 | 1 |
Sets the right settings and calls loopMenusmethod. Settings are taken from the optionsvariable and the rest from defaultsvariable | function init(options) {
settings = $.extend({}, defaults, options)
loopMenus()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loopMenus() {\n $(settings.elements).each(function (index, item) {\n loopCheckboxs(item)\n setSelectAll(item)\n bindOpen(item)\n })\n }",
"function handleSettingsMenuClicks() {\n if (isScaledMouseOverBox(1,108,370,400)) { // if fullscreen is clicked\n ... | [
"0.6999718",
"0.62607867",
"0.6143481",
"0.60958856",
"0.59737724",
"0.58969396",
"0.58754516",
"0.5860849",
"0.58359426",
"0.5834376",
"0.58015907",
"0.57769537",
"0.5739128",
"0.57027966",
"0.5700931",
"0.56943834",
"0.5688459",
"0.5616012",
"0.56122726",
"0.5611484",
"0.56... | 0.7839042 | 0 |
Goes through the menus given in settings, calls loopCheckboxs, setSelectAll and bindOpen for all menus | function loopMenus() {
$(settings.elements).each(function (index, item) {
loopCheckboxs(item)
setSelectAll(item)
bindOpen(item)
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init(options) {\n settings = $.extend({}, defaults, options)\n loopMenus()\n }",
"function setSettings(items) {\n\tif (typeof items[\"usabilitySettings\"] !==\"undefined\") {\n\t\textSettings.usability = items[\"usabilitySettings\"];\n\t\t$('#view_mode #' + extSettings.usability.view_mo... | [
"0.5895131",
"0.56988186",
"0.5633588",
"0.56294006",
"0.56257296",
"0.5614891",
"0.55712575",
"0.5556001",
"0.5475822",
"0.5458881",
"0.544305",
"0.5431247",
"0.5429311",
"0.5428759",
"0.54069775",
"0.53940296",
"0.537451",
"0.5354717",
"0.53378785",
"0.533386",
"0.5332146",... | 0.8357657 | 0 |
If a menu has a select_all type checkboxes, goes through the checkboxes and sets fields as chosen or not chosen according to them. Sets left click to select_all field which calls selectUnAll | function setSelectAll(menu) {
var select_all = $(menu).find("#select_all")
if (select_all.length > 0) {
var all_checked = true
$(findCheckboxs()).each(function (index, checkbox) {
if (!$(checkbox).is(":checked")) {
all_checked = false
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectUnAll(menu) {\n check_state = $(menu).find(\"#select_all\").is(\":checked\")\n findCheckboxs(menu).each(function (index, checkbox) {\n $(checkbox).attr(\"checked\", check_state)\n })\n }",
"function selectAll()\r\n\t\t{\r\n\t\t\t$(\":checkbox:visible:not(:checked... | [
"0.72892004",
"0.72173554",
"0.71571004",
"0.7028684",
"0.6973875",
"0.6896564",
"0.6818372",
"0.66084975",
"0.65797484",
"0.65775883",
"0.6564816",
"0.6531524",
"0.6505203",
"0.64921397",
"0.6485507",
"0.64833623",
"0.6471046",
"0.6443277",
"0.6426729",
"0.6399746",
"0.63951... | 0.7338211 | 0 |
Calls setCookie with the state of a given checkbox given as a parameter | function setcookie(e) {
SetCookie($(e).attr("name"), ($(e).is(":checked") ? "1" : "0"))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cookieset(choice) {\r\n if (choice == 'done') {\r\n setCookie(\"cookieconsent\", choice, 180);\r\n }\r\n}",
"function saveThemeToCookies() {\r\n\tif($('#stc:checked').length) document.cookie = \"stc=true; expires=Thu, 18 Dec 9999 12:00:00 UTC\";\r\n\telse {\r\n\t\tdocument.cookie = \"stc=;... | [
"0.6918209",
"0.68542063",
"0.6550744",
"0.6544243",
"0.6467712",
"0.6453804",
"0.63844764",
"0.6357347",
"0.63517",
"0.6271436",
"0.6254965",
"0.62214196",
"0.6201843",
"0.6191517",
"0.61824745",
"0.61801875",
"0.6178798",
"0.6138284",
"0.6067708",
"0.60334903",
"0.60308766"... | 0.7999273 | 0 |
Adds 1 to the counter when user hits plus button | function handlePlus(counter){
document.querySelector('#plus').addEventListener('click', () => {
counter.textContent = parseInt((counter.textContent), 10) + 1
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CounterPlus() {\n\tsessionStorage.clickcountC = Number(sessionStorage.clickcountC)+1;\n\tAll();\n}",
"function plusOne() {\n\tlocalStorage.setItem(\"count\", Number(localStorage.getItem(\"count\")) + 1)\n\tupdate()\n}",
"function plusOne() {\n\tlocalStorage.setItem(\"count\",Number(localStorage.getIte... | [
"0.80514205",
"0.78233546",
"0.77326334",
"0.76428884",
"0.763952",
"0.75452673",
"0.7527789",
"0.74460554",
"0.7428742",
"0.7409758",
"0.74018097",
"0.7393825",
"0.736238",
"0.7295759",
"0.7276755",
"0.7245665",
"0.72298366",
"0.7194584",
"0.718724",
"0.71819717",
"0.716479"... | 0.8252735 | 0 |
Subtracts 1 from counter when user hits minus button | function handleMinus(counter){
document.querySelector('#minus').addEventListener('click', () => {
counter.textContent = parseInt((counter.textContent), 10) - 1
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decrementCounter() {\n if (counterValue > 0) {\n counterValue--;\n }\n }",
"function clickCounterChange() { //changes the variable clickCounter between positive and negative\n clickCounter *= -1;\n }",
"function handleClickDecrement() {\n if (counter === 0) {\n checkCounter();\... | [
"0.7615796",
"0.7424551",
"0.73962814",
"0.7338271",
"0.72923654",
"0.7265389",
"0.7224563",
"0.7213657",
"0.72094136",
"0.7197017",
"0.71745515",
"0.7085521",
"0.707177",
"0.7052109",
"0.7043082",
"0.7030774",
"0.70037585",
"0.695993",
"0.69414204",
"0.6876383",
"0.687466",
... | 0.83272225 | 0 |
Enables the buttons when user hits resume | function handleResume(){
document.getElementById('minus').disabled = false
document.getElementById('plus').disabled = false
document.getElementById('heart').disabled = false
document.getElementById('submit').disabled = false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function issueStarted() {\n resumePauseButton.disabled = true;\n }",
"function resume() {\n debug('PAUSE TOUCHED. RESUME THE GAME. ONLY ** PAUSE ** BUTTON.');\n myGlobal.isPaused = false;\n pauseButton.text = '|| ';\n currentButtons = [pauseButton];\n // clear out any \"res... | [
"0.75479233",
"0.7005886",
"0.68257356",
"0.68043995",
"0.6711784",
"0.6689498",
"0.6669907",
"0.66665363",
"0.66033065",
"0.6544721",
"0.6540302",
"0.64830446",
"0.64723957",
"0.646052",
"0.64135575",
"0.6413489",
"0.64125055",
"0.64018357",
"0.6381843",
"0.6371833",
"0.6371... | 0.72451526 | 1 |
Cache a object in the given room (if given), at the model name and the given uniqueidentifier | cacheModel(modelinstance, modelName, uniqueIdentifier) {
this.redisConnection.set(this.keyForObject(modelName, uniqueIdentifier), JSON.stringify(modelinstance), 'EX', this.options.ttl);
this.log(undefined, JSON.stringify({
type: 'db-cache-info',
content: 'DB-CACHE: Object stored ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CacheWithUUID() {\n this.cache_ = Object.create(null);\n}",
"async function cacheInformation() {\n // Fetch Last Vehicle ID\n const vehicleData = await db.fetchLastId('Vehicle');\n if (!vehicleData) {\n setVehicleID(0);\n } else {\n setVehicleID(vehicleData.id);\n }\n\n ... | [
"0.5920249",
"0.55650985",
"0.5496297",
"0.5317338",
"0.52465636",
"0.5182612",
"0.51809204",
"0.51807827",
"0.51220155",
"0.50886166",
"0.50886166",
"0.5050288",
"0.50409126",
"0.50394",
"0.5018246",
"0.5018246",
"0.5009354",
"0.49703357",
"0.4948634",
"0.49413577",
"0.49214... | 0.7504764 | 0 |
lexical environment of function c is now inside function a ie. not available at global level | function c() {
// a is the outer environment of c
console.log(myVar); // 2
// aVar does not exist in c, or a but exists at global level
// JS looks up the scope chain up to global level
console.log(aVar); // a
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fn22() {\r\n // Env: fn22\r\n // Parent: Global\r\n\r\n // [[Env: fn22]]\r\n function fn33() {\r\n // Env: fn33\r\n // Parent: fn22\r\n console.log(aa);\r\n }\r\n\r\n // Env: fn22\r\n // Parent: Global\r\n // fn33: func\r\n\r\n fn33();\r\n}",
"function c(){}",
"function c(){}",
"fu... | [
"0.66307914",
"0.66173714",
"0.66173714",
"0.66173714",
"0.66173714",
"0.65128446",
"0.64960635",
"0.64741296",
"0.64652383",
"0.64652383",
"0.6435385",
"0.6414935",
"0.6382976",
"0.63807124",
"0.6358194",
"0.6358194",
"0.6347083",
"0.62633383",
"0.6254846",
"0.6211717",
"0.6... | 0.69534343 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.