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 |
|---|---|---|---|---|---|---|
Print: Prints each value in the queue starting from the front | print() {
var runner = this.front; // Start at the front
while(runner !== null) { // While we're not at the end
console.log(runner.val); // Print value at current node
runner = runner.next; // Move to next node
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"print() {\n if (this.queue.tail == null) {\n process.stdout.write('[]\\n');\n }\n else {\n let iterator = this.queue.head;\n for (let i = 0; i < this.top; i++) {\n for (let j = 0+i; j < this.top - i; j++) {\n if (iterator.next ... | [
"0.84485644",
"0.7797358",
"0.7592471",
"0.7559985",
"0.7407726",
"0.7402966",
"0.7286091",
"0.72148",
"0.7036248",
"0.70289576",
"0.69677097",
"0.69500506",
"0.6901488",
"0.68668455",
"0.6845549",
"0.6835507",
"0.6833216",
"0.6823097",
"0.6770041",
"0.6753974",
"0.6707773",
... | 0.8017665 | 1 |
Enqueue: Put the given node at the back of the queue | enqueue(node) {
if (!this.front) { // Edge case: no nodes in the queue, so this node is the front AND back
this.front = node;
} else { // At least one node already in queue, so put it in the back
this.back.next = node; // Put new node in the back, so link the queue to the new nod... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Enqueue(element){\n let N = new Node(element,null)\n if(Queue.back === null){\n Queue.front = N\n Queue.back = N\n }else{\n Queue.back.next = N\n Queue.back = Queue.back.next\n }\n}",
"enqueue(val) { \n let node = new Node(val); \n // adding element to th... | [
"0.7740631",
"0.76865566",
"0.7530939",
"0.7430634",
"0.73182625",
"0.7197669",
"0.71093976",
"0.69794947",
"0.6973039",
"0.6962935",
"0.6898027",
"0.679731",
"0.6739776",
"0.67385",
"0.6717747",
"0.66990715",
"0.6598164",
"0.6563517",
"0.6533155",
"0.6531192",
"0.6498345",
... | 0.7690985 | 1 |
Dequeue: Remove & return the node at the front of the queue | dequeue() {
if (!this.front) { // If no nodes to remove, exit
return null;
}
var removedNode = this.front; // Oldest node is at the front
this.front = removedNode.next; // Move front to next oldest node (or null if that's the only node)
if (!this.front) { // If there ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dequeue() {\n\n // if theres is nothing in the queue, we have nothing to remove or return\n if (this.first === null) {\n return;\n }\n //the last node will be removed so set the first node as now being the next node\n const node = this.first;\n this.first = node... | [
"0.84865254",
"0.8434395",
"0.83957464",
"0.8358455",
"0.8336857",
"0.8151996",
"0.8123283",
"0.8061353",
"0.8051627",
"0.80113083",
"0.80063796",
"0.7941031",
"0.7884398",
"0.7874436",
"0.7863512",
"0.78537005",
"0.7839217",
"0.7824931",
"0.7821307",
"0.78072363",
"0.7798027... | 0.8642734 | 0 |
Front value: Return the value at the front of the queue, but do NOT remove the node | frontValue() { // Can't call it front() since we have a property called front in the constructor
if (this.front) { // If there is at least one node...
return this.front.val; // ...return its value
} else { // But if there are no nodes in the queue...
return null; // Return this a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"peekFront() {\n return this.head ? this.head.value : null;\n }",
"dequeue(){ \n const node = this.front;\n this.front = this.front.next;\n \n return node.val;\n }",
"front () {\n\n\t\t// get the result, which might be undefined.\n\t\tconst result = this.data[0]\n\n\t\t// filter out the poss... | [
"0.79706925",
"0.79085445",
"0.7852552",
"0.7838239",
"0.75933695",
"0.7569603",
"0.7566246",
"0.7539547",
"0.7507145",
"0.75029033",
"0.7481289",
"0.74400204",
"0.73990595",
"0.7366703",
"0.7356722",
"0.7350648",
"0.7308396",
"0.7287364",
"0.72840184",
"0.7227799",
"0.718933... | 0.8100394 | 0 |
Contains: Look for the given value in the queue and return true if found, false if not | contains(val) {
var runner = this.front; // Start at the front (oldest value)
while (runner) {
// console.log("Current value:",runner.val);
if (runner.val === val) { // If value found, return runner
return true;
}
runner = runner.next; // M... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"inQueue(item) {\n let i = 0;\n let isFound = false;\n while (i < this.q.length && !isFound) {\n if (this.q[i] === item) {\n isFound = true;\n } else\n i++;\n }\n return (isFound);\n }",
"contains(val) {\n if(this.isE... | [
"0.81088954",
"0.7667236",
"0.73910165",
"0.7306667",
"0.7287106",
"0.72414327",
"0.7231105",
"0.7196174",
"0.7177503",
"0.71658826",
"0.7138714",
"0.7118157",
"0.7102784",
"0.7065316",
"0.70037335",
"0.68847185",
"0.67892647",
"0.6783726",
"0.6710874",
"0.6700316",
"0.669896... | 0.80549383 | 1 |
Size: Return the number of nodes (values) in the queue | size() {
var runner = this.front; // Start at the front (oldest value)
var numNodes = 0; // Number of nodes so far
while (runner) {
numNodes++;
// console.log("Current value:",runner.val);
// console.log("Number of nodes so far:",numNodes);
runner ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"size() {\n var runner = this.top; // Start at top of stack\n var numNodes = 0; // Number of nodes found\n while (runner) { // While there are nodes to look at\n numNodes++; // Increment count\n // console.log(\"Current value in stack:\", runner.val);\n // conso... | [
"0.75629187",
"0.753566",
"0.75088924",
"0.75088924",
"0.74940985",
"0.7421826",
"0.73943853",
"0.73708326",
"0.7351436",
"0.7267362",
"0.7166647",
"0.7163854",
"0.7161806",
"0.7157369",
"0.71526253",
"0.71524936",
"0.71478486",
"0.7139731",
"0.7139731",
"0.7139731",
"0.71397... | 0.81898814 | 0 |
Stop monitoring the compass | function stopWatchCompass() {
if (watchID) {
navigator.compass.clearWatch(watchID);
watchID = null;
console.log('Stop Watch');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopWatch() {\n \n \t//EJERCICIO 1 (4)\n if (watchID) {\n navigator.compass.clearWatch(watchID);\n watchID = null;\n }\n }",
"function stopWatch() {\n if (watchID) {\n navigator.compass.clearWatch(watchID);\n watchID = null;\n }\n}",
"fu... | [
"0.7398759",
"0.7200616",
"0.7200616",
"0.70675117",
"0.7008365",
"0.6980093",
"0.69704986",
"0.68523675",
"0.67482406",
"0.6687386",
"0.66338384",
"0.66218567",
"0.65952754",
"0.6576846",
"0.65360314",
"0.65340865",
"0.65339804",
"0.6529628",
"0.651859",
"0.6503618",
"0.6480... | 0.75663656 | 0 |
Function to clean up after CANCEL is hit for the ADD TASK MODAL | function cancelAdd(e) {
$('#taskModal').modal('hide');
$('#taskName').val('');
$('#taskDate').val('');
$('#taskTime').val('');
$('#taskDeadlineCheck').prop("checked", false);
$('#taskDeadlineFields').hide();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancel_edit_of_task() {\n \ttoggle_form_view(\"ADD\");\n}",
"function saveButtonClicked(event){\n if(taskNameEvent && assigneeEvent && descriptionEvent && statusEvent){\n taskManager.addTask(taskName.value, description.value, assignee.value, statusSelect.value, taskDate.value);\n displa... | [
"0.7016051",
"0.65928435",
"0.6446917",
"0.64220935",
"0.6405958",
"0.6330976",
"0.6315522",
"0.6313247",
"0.6222154",
"0.6206617",
"0.61828804",
"0.61403376",
"0.61026055",
"0.60938966",
"0.6089773",
"0.6086587",
"0.6084464",
"0.60789615",
"0.60789615",
"0.6030421",
"0.60287... | 0.7233717 | 0 |
Function to FINISH the task; using the injected taskID, the modal locates the task that launched it to remove it from the list and to increment the user's points by the appropriate amount of points. | function doneTask(e) {
e.preventDefault();
var taskID = $('#editModal').find('#edit').attr('class');
var task = $('#' + taskID);
var points = Number($('#pointContainer').text().substr(" POINTS: ".length));
points = points + 10;
$('#pointContainer').html(' POINTS: ' + p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function finishTask(p1, task){\n\ttask.kill();\n\tthis.peopleHelped++;\n}",
"function deleteTask(){\n id = event.srcElement.parentElement.getAttribute('id');\n let task = list.find(i => i.id === +id);\n task.active === true ? activeTasksCounter-- : activeTasksCounter;\n list.splice(list.indexOf(task)... | [
"0.6175338",
"0.6110771",
"0.6073524",
"0.6054712",
"0.6042612",
"0.6038069",
"0.6020248",
"0.595806",
"0.5943562",
"0.59419215",
"0.59408057",
"0.59124285",
"0.59025466",
"0.5899618",
"0.5898401",
"0.58876705",
"0.58799994",
"0.58767945",
"0.58574",
"0.58505255",
"0.5846836"... | 0.69530517 | 0 |
Function to clean up the EDIT MODAL after CANCEL is hit | function cancelEdit(e) {
var taskID = $('#editModal').find('#edit').attr('class');
$('#editModal').find('#edit').removeClass(taskID);
$('#editModal').modal('hide');
$('#editName').val('');
$('#editDate').val('');
$('#editTime').val('');
$('#editDeadlineCheck').prop("checked", false);
$('... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_cancelEdit(){\n this._$modal.modal('hide');\n this._resolve({action:'cancel'});\n }",
"function cancelEdit() {\n $scope.isEnabled = false;\n $modalInstance.dismiss();\n }",
"function cancelEdit() {\n var currentCheckListItem = $(this).data(\"checkListItem\");\n ... | [
"0.7268075",
"0.71395266",
"0.7076389",
"0.7058407",
"0.69433784",
"0.69245666",
"0.6906554",
"0.6897148",
"0.68764186",
"0.6853159",
"0.6813425",
"0.68070084",
"0.6770376",
"0.67660505",
"0.67241377",
"0.6722086",
"0.6716598",
"0.6677042",
"0.667621",
"0.6671611",
"0.6654556... | 0.7188211 | 1 |
This function will remove the selection elements for cropping (those borders that you select) | function removeSelection(){
$('.imgareaselect-outer, .imgareaselect-selection, .imgareaselect-border1, .imgareaselect-border2').remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeAllSelections() {\n selections = [];\n for (var i = 0; i < selectionObjects.length; i++) {\n drawBorder(selectionObjects[i], true);\n }\n selectionObjects = [];\n}",
"function deselect() {\n console.log(\"Beginning deselect\");\n // remove border or something?\n if (sel... | [
"0.7557148",
"0.7188784",
"0.7188784",
"0.71037996",
"0.70137316",
"0.68701077",
"0.68591815",
"0.67752206",
"0.66983736",
"0.6652797",
"0.65780836",
"0.6572379",
"0.6479012",
"0.640925",
"0.6400351",
"0.639",
"0.63766885",
"0.63717294",
"0.6363172",
"0.6355658",
"0.6315405",... | 0.77963483 | 0 |
Exporter en format csv (TDB) | exportTableTdb() {
/* Encodage a format csv */
const content = [columnsTdb.map(col => wrapCsvValue(col.label))].concat(
rowsTdb.map(rowsTdb => columnsTdb.map(col => wrapCsvValue(
typeof col.field === 'function' ?
col.fie... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function export_table(f, t) {\n const data = table_to_string(t);\n const filename = f;\n const blob = new Blob([data], {type: 'text/csv'});\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveBlob(blob, filename);\n } else {\n const elem = document.createElement('a') \n elem.hre... | [
"0.7148364",
"0.70334667",
"0.69733024",
"0.6866473",
"0.68030167",
"0.67994636",
"0.67757875",
"0.6752944",
"0.67330694",
"0.67248636",
"0.66579527",
"0.66315293",
"0.65822184",
"0.6574754",
"0.65520954",
"0.65495616",
"0.65400827",
"0.6527725",
"0.65196127",
"0.6513448",
"0... | 0.79017663 | 0 |
Exporter en format csv (CLIENTS) | exportTableClient() {
/* Encodage a format csv */
const content = [columnsClient.map(col => wrapCsvValue(col.label))].concat(
rowsClient.map(rowsClient => columnsClient.map(col => wrapCsvValue(
typeof col.field === 'function' ?
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exportCSV() {\r\n return gridOptions.api.getDataAsCsv();\r\n}",
"function exportToCsv(){\n var lineArray = [];\n groups.forEach(function (infoArray, index) {\n var line = infoArray.join(\",\");\n lineArray.push(index == 0 ? \"data:text/csv;charset=utf-8,\" + line : line);\n });\n... | [
"0.6714138",
"0.6701772",
"0.6690525",
"0.6661739",
"0.6594543",
"0.6544398",
"0.65441567",
"0.65266323",
"0.64885587",
"0.6437833",
"0.6408622",
"0.6394327",
"0.6372965",
"0.6297675",
"0.62792975",
"0.62733567",
"0.6255082",
"0.6214518",
"0.62100744",
"0.6205515",
"0.6202251... | 0.78739953 | 0 |
... for IE8 Default bromo Component. | function BromoComponent(src) {
this.src = src;
if (src) {
this.src.bromo = this;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get BC7() {}",
"function hb() { }",
"function BaseElement$$module$src$base_element() {}",
"function BbsService(){}",
"function CVBaseElement() {\n}",
"function CVBaseElement() {\n}",
"function hb(){}",
"function hb(){}",
"get BC5() {}",
"function boroStyle(feature) {\n\treturn {\n\t\tcolor: '#218... | [
"0.5630729",
"0.53327006",
"0.5259609",
"0.52485764",
"0.519669",
"0.519669",
"0.5175355",
"0.5175355",
"0.5164012",
"0.5123697",
"0.51148134",
"0.5073475",
"0.5057635",
"0.50544405",
"0.5047221",
"0.50045276",
"0.5000836",
"0.5000836",
"0.49810702",
"0.49781254",
"0.4974032"... | 0.60384876 | 0 |
prepare contact object's HTML | function contactHtmlFromObject(key, contact){
return '<div class="card contact" style="width: 18rem;" id="'+key+'">'
+ '<div class="card-body">'
+ '<h5 class="card-title">'+contact.name+'</h5>'
+ '<h6 class="card-subtitle mb-2 text-muted">'+contact.email+'</h6>'
+ '<p class="card-text"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function contactHtmlFromObject(contact) {\n console.log(contact);\n var html = '';\n html += '<li class=\"list-group-item contact\">';\n html += '<div>';\n if (contact.name != '') {\n html += '<p class=\"lead\">' + contact.name + '</p>';\n }\n html += '<p><a href=\"' + contact.email + '... | [
"0.73231244",
"0.6573335",
"0.6302675",
"0.6172258",
"0.5957363",
"0.5891677",
"0.5831413",
"0.5794172",
"0.57938886",
"0.5786499",
"0.5740598",
"0.57339966",
"0.57327515",
"0.57069707",
"0.5674733",
"0.5667692",
"0.56163424",
"0.5592921",
"0.55845857",
"0.5583713",
"0.558238... | 0.7058913 | 1 |
compute empirical probabilities for given to_rank,to_file, from_rank,from_file, and data source. | function probability(trank,tfile,frank,ffile,thedata){
var count = 0;
var total = 0;
for (i = 0; i < thedata.length; i++){
if((thedata[i].from_rank == frank) && (thedata[i].from_file == ffile)){
total += 1
if((thedata[i].to_rank == trank) && (thedata[i].to_file == tfile)){
count += 1
}
}
}
if (tot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"evaluate(leaderboard) {\n let totalprog = 0;\n let fitness = [this.population.length];\n\n // get total progress\n for(let i = 0; i < this.population.length; i++) {\n let name = leaderboard[i].car.name;\n let progress = leaderboard[i].progress;\n \n ... | [
"0.4910688",
"0.4808402",
"0.469027",
"0.46324778",
"0.4552764",
"0.45070064",
"0.44854948",
"0.44666493",
"0.43967846",
"0.43933454",
"0.4353583",
"0.43358356",
"0.4329746",
"0.43224862",
"0.43186393",
"0.43153244",
"0.42865774",
"0.42603838",
"0.4256009",
"0.42374694",
"0.4... | 0.6219241 | 0 |
funzione per restituire la bandierina della lingua, se disponibile | function bandiera_lingua(lingua) {
var bandiere_disponibili = ['en', 'it'];
if (bandiere_disponibili.includes(lingua)) {
return '<img src="flags/' + lingua + '.png" alt"'+ lingua + '">';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genera_bandiere(lingua) {\n // Inizializzo la var flag come stringa vuota\n var flag = '';\n // Assegno l'img della bandiera corrispondente nei casi di lingua italiano, inglese, spagnolo e francese;\n // negli altri casi assegno il la stringa restituitami dall'api\n switch(lingua) {\n case 'it':\n... | [
"0.62401825",
"0.59197646",
"0.5704646",
"0.5686481",
"0.5600166",
"0.55910194",
"0.5565851",
"0.55111384",
"0.548401",
"0.54403675",
"0.54354405",
"0.5431514",
"0.53898954",
"0.53433657",
"0.53429955",
"0.53274244",
"0.532446",
"0.53219366",
"0.53106743",
"0.53049964",
"0.52... | 0.60862327 | 1 |
funzione per trasformare il voto in numero intero da 1 a 5 | function normalizza_voto(voto) {
var voto5 = voto / 2;
return Math.ceil(voto5);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function voto(voto) {\r\n var voto5 = voto / 2;\r\n return Math.ceil(voto5);\r\n }",
"stellePiene(voto){\n return parseInt(voto/2);\n }",
"function genera_stelle(voto) {\n // Trasformo il voto in un umero compreso tra 0 e 5\n var voto_arrotondato = Math.ceil((voto / 2));\n console.l... | [
"0.7034893",
"0.6786774",
"0.64600015",
"0.6293397",
"0.6228168",
"0.6098577",
"0.60182786",
"0.6014509",
"0.6009555",
"0.5982569",
"0.59616655",
"0.59425974",
"0.5925589",
"0.5906602",
"0.5904234",
"0.5871385",
"0.58633864",
"0.5831844",
"0.58224887",
"0.5809832",
"0.5792394... | 0.68730485 | 1 |
Set radio button value. | function setRadioValue(name, value){
var objRadioEl = document.getElementsByName(name);
if (objRadioEl) {
for (var i = 0; i < objRadioEl.length; i++) {
var optionEl = objRadioEl[i];
if (optionEl.value == value) {
optionEl.checked = true;
break;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRadioButtonSelected(name, value) {\n let radios = $('input[name=\"' + name + '\"]');\n radios.each(function () {\n if ($(this).prop('value') === value) {\n $(this).click();\n }\n });\n}",
"function set(radio){\n var val_ = $(radio).val();\n var td = $(radio).at... | [
"0.69998753",
"0.692692",
"0.6913834",
"0.6913834",
"0.6913834",
"0.67796314",
"0.65680057",
"0.64814556",
"0.64744043",
"0.6447753",
"0.6432973",
"0.6332698",
"0.63156796",
"0.6290896",
"0.6239447",
"0.62132204",
"0.6149466",
"0.6128545",
"0.604669",
"0.5968126",
"0.5961709"... | 0.71000814 | 0 |
Obtain the start date of the current calendar year. | function getCalendarYearStartDate(){
var sDate = new Date();
sDate.setDate(1);
sDate.setMonth(0);
return sDate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FirstdayOfCurrentYear() {\n return formatDate(new Date(new Date().getFullYear(), 0, 1));\n }",
"function getStartDate() {\n const now = new Date();\n const startDate = new Date();\n startDate.setDate(now.getDate() - 365);\n return startDate;\n }",
"static getFilterStartDate(year... | [
"0.76685846",
"0.71715176",
"0.7094523",
"0.6879924",
"0.6875848",
"0.6867883",
"0.68379545",
"0.6759404",
"0.6711115",
"0.6708919",
"0.6708919",
"0.66412324",
"0.66315615",
"0.66315615",
"0.66315615",
"0.66315615",
"0.66315615",
"0.66315615",
"0.66315615",
"0.6603183",
"0.65... | 0.8050179 | 0 |
Obtain the start date of the current fiscal year. | function getFiscalYearStartDate(){
var fiscalDateFull = new Date();
var currentDate = new Date();
var fiscalYearDay = 1;
var fiscalYearMonth = 1;
var params = {
tableName: 'afm_scmpref',
fieldNames: toJSON(['afm_scmpref.fiscalyear_startday', 'afm_scmpref.fiscalyear_startmonth', 'afm_scmpref.afm_scmpref']),
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FirstdayOfCurrentYear() {\n return formatDate(new Date(new Date().getFullYear(), 0, 1));\n }",
"function getCalendarYearStartDate(){\n\tvar sDate = new Date();\n\tsDate.setDate(1);\n\tsDate.setMonth(0);\n\treturn sDate;\n}",
"function thisyear()// returns the fiscal year \r\n{\r\n\tvar today... | [
"0.73428863",
"0.72351485",
"0.71956915",
"0.71450835",
"0.7107374",
"0.69122475",
"0.6683341",
"0.6375907",
"0.63720316",
"0.63720316",
"0.63720316",
"0.63720316",
"0.63720316",
"0.63720316",
"0.63720316",
"0.63575876",
"0.6350867",
"0.6333465",
"0.6333465",
"0.6333465",
"0.... | 0.78951335 | 0 |
Pushing updates Push cached achievements updates | static async pushAchievementsUpdate () {
const currentPushRequest = store.getters.getPushUpdateRequest
if(!currentPushRequest.achievements) return
if(!UpdateManager.isConnected()) {return}
const pseudo = store.getters.getPseudo
const achievements = store.getters.getAchievements
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newAchievement(update) {\n achievedList.push(update);\n}",
"function update(player) {\n // If we check only achievements that are visible we save A LOT of work\n let visible = ct.visibleAchievements(player);\n let shortList = {};\n for(let key of visible){\n shortList[key] = ... | [
"0.72252536",
"0.62933636",
"0.62933636",
"0.629221",
"0.6016244",
"0.59953576",
"0.5976503",
"0.5950321",
"0.5642665",
"0.56358767",
"0.5621171",
"0.5538027",
"0.5479258",
"0.54128236",
"0.5376172",
"0.5367172",
"0.5359121",
"0.53590816",
"0.5331169",
"0.530965",
"0.5293348"... | 0.82794946 | 0 |
Push cached games updates | static pushGamesUpdate () {
const currentPushRequest = store.getters.getPushUpdateRequest
if(!currentPushRequest.games) return
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCachedGameList() {\n // TODO: We need to somehow track players that just cut the connection!\n gameList = {};\n for (var gameKey in games) {\n let game = games[gameKey];\n let state = game.state;\n\n // Get active player avatars\n let avatars = [];\n if (state != undefined)\n ... | [
"0.6732418",
"0.6324547",
"0.6299602",
"0.6294973",
"0.62194306",
"0.61190796",
"0.6116668",
"0.6085215",
"0.6079012",
"0.6034128",
"0.59901035",
"0.5988887",
"0.59638894",
"0.5929586",
"0.57241666",
"0.57181394",
"0.5688817",
"0.5664617",
"0.5618236",
"0.56047934",
"0.557097... | 0.7391687 | 0 |
Pulling updates Pull all firebase updates | static pullUpdate () {
this.pullLeaderboardUpdate()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pull() {\n if (!updateToggle)\n return;\n $.get(api, function(list) {\n list.forEach(function(data) {\n if (updateAt < +(data.updateAt || 1)) {\n addItem(data);\n updateAt = +data.updateAt;\n }\n });\n });\n }",
"pullUpdates(... | [
"0.66442114",
"0.6401032",
"0.6127191",
"0.6091925",
"0.5969626",
"0.5955686",
"0.58875704",
"0.58403414",
"0.58395165",
"0.5834552",
"0.58208865",
"0.5785393",
"0.57278526",
"0.5722031",
"0.5721474",
"0.56988245",
"0.56225884",
"0.56188345",
"0.5613924",
"0.55846214",
"0.555... | 0.6449403 | 1 |
A Feed of things (henceforth 'items'). It's a Readable. And will read out any additions to the feed (whether by realtime updates or fetching of 'more') You can request that more be added to the feed. .fetchMore() along a cursor | function Feed(items) {
var maxId = 0;
Collection.call(this, items, {
model: function (props) {
props = Object.create(props);
props.id = props.id || maxId++;
return props;
}
});
Writable.call(this, { objectMode: true });
// pipe a model stream into here
this.more = new More({
ob... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FeedItem() {\n this._init.apply(this, arguments);\n}",
"async getFeed() {\n let [status,feed] = await apiRequest(\"GET\", \"/users/\"+this.id+\"/feed\");\n let ret = [];\n for (let post of feed.posts){\n ret.push(new Post(post));\n }\n return ret;\n }",
"async function getAllIt... | [
"0.655097",
"0.64558256",
"0.639384",
"0.63050777",
"0.613187",
"0.613129",
"0.612582",
"0.61004883",
"0.6096372",
"0.6095697",
"0.6065872",
"0.5993985",
"0.588389",
"0.5876696",
"0.586048",
"0.58422804",
"0.58135533",
"0.5809817",
"0.57758456",
"0.57746965",
"0.5769887",
"... | 0.77426815 | 0 |
Instantiates a new effect Layer and references it in the scene. | function EffectLayer(
/** The Friendly of the effect in the scene */
name, scene) {
this._vertexBuffers = {};
this._maxSize = 0;
this._mainTextureDesiredSize = { width: 0, height: 0 };
this._shouldRender = true;
this._postProcesses = [];
this._textures = [];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createLayer() {}",
"_initializeLayers() {\n let background = new Layer('background');\n background.enableSmooth();\n let objects = new Layer('objects');\n objects.enableSmooth();\n let foreground = new Layer('foreground');\n foreground.enableSmooth();\n this.layers = {\n backgr... | [
"0.62836546",
"0.61722606",
"0.61628765",
"0.6065537",
"0.6061322",
"0.59522223",
"0.59047586",
"0.59010047",
"0.58618337",
"0.5827564",
"0.5821577",
"0.58212227",
"0.5692509",
"0.56876737",
"0.5652096",
"0.56301457",
"0.5599911",
"0.55977803",
"0.5572691",
"0.5572691",
"0.55... | 0.73603964 | 0 |
This function compares the guess to a selected random number, and outputs different results depending on if it is equal or not. | function playGame () {
// This grabs the input guess as an integer.
guess = document.getElementById('input').value
guess = parseInt(guess)
// This console log is for backend purposes to ensure that the values are working properly.
console.log(randomNumber)
console.log(guess)
console.log('---')
// This... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkGuess () {\r\n // using let for variables because guessing numbers are Math.floor random numbers\r\n let myGuess = guess.value\r\n // 3 choices for guessing numbers, and alerts for each choice\r\n if (myGuess === randomNumber) {\r\n alert(\"You got it right!\");\r\n } else if (m... | [
"0.728481",
"0.7254171",
"0.71688724",
"0.7159928",
"0.71445787",
"0.7002737",
"0.68780714",
"0.68554693",
"0.6824032",
"0.6822083",
"0.68175066",
"0.68116784",
"0.67983115",
"0.6760686",
"0.67591494",
"0.6750191",
"0.6742296",
"0.6740877",
"0.6719945",
"0.6719332",
"0.667440... | 0.73398 | 0 |
Change color for chose tab | function selectTab(tab) {
filterAll.style.color = "#9f9a91";
filterUndone.style.color = "#9f9a91";
filterDone.style.color = "#9f9a91";
tab.style.color = "#333333";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function change_given_blue()\n {\n document.getElementById(\"out_given\").style.color=\"#4867ae\";\n document.getElementById(\"Given_tab\").style.borderBottom=\"3px solid #4867ae\";\n }",
"changeColor(i) {\n this.selectedIndex = i;\n }",
"function highlightTab(new_tab) {\r\n // res... | [
"0.6681841",
"0.6569609",
"0.6457379",
"0.637205",
"0.6369727",
"0.63476485",
"0.6343117",
"0.6343117",
"0.6343117",
"0.6343117",
"0.6343117",
"0.63344526",
"0.63122255",
"0.62957853",
"0.62957853",
"0.62886095",
"0.62719953",
"0.6271873",
"0.62162197",
"0.6202112",
"0.618271... | 0.7651846 | 0 |
elements that arr a contains that are also contained in arrB OR elements that are in arrA that are parents of elements in arrB | function smartInter(arrA, arrB) {
var inter = [];
for(var i = 0; i < arrA.length; i++) {
for(var j = 0; j < arrB.length; j++) {
if(arrA[i] == arrB[j] || $.contains(arrA[i], arrB[j])) {
if(inter.indexOf(arrA[i]) < 0) {
inter.push(arrA[i]);
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function commonEleinArr3(a1,a2){\nreturn a1.some(element=>a2.includes(element));\n}",
"function aContainsB(arr, b){\n\tfor(var i=0; i<arr.length; i++){\n\t\tif(arraysEqual(arr[i].points, b.points))\n\t\t\treturn true;\n\t}\n\treturn false;\n}",
"function arrayDiff(a, b) {\n let arr = [];\n if(a.length==0)... | [
"0.650272",
"0.63276464",
"0.6305869",
"0.6253185",
"0.62261236",
"0.61842656",
"0.615778",
"0.6156786",
"0.6155137",
"0.61485356",
"0.6105735",
"0.6102494",
"0.6097016",
"0.60889494",
"0.60632336",
"0.6060715",
"0.6044518",
"0.6037479",
"0.6014454",
"0.60047346",
"0.5996555"... | 0.6971585 | 0 |
onComplete will be executed once per capability after all tests have finished, but the webdriver instance has not yet been shut down. | onComplete() {
var browserName, browserVersion;
var capsPromise = browser.getCapabilities();
capsPromise.then(function(caps) {
browserName = caps.get('browserName');
browserVersion = caps.get('version');
testConfig = {
reportTitle: 'Protractor e2eTest Execution Report',
o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onComplete () {\n if (!this.sauceConnectProcess) {\n return\n }\n\n return this.sauceConnectProcess.close()\n }",
"onTestEnd (test) {\n this.testnameStructure.pop();\n\n if(config.usingAllure) {\n if (browser.capabilities.deviceType) {\n allureReporter.addArgu... | [
"0.6346839",
"0.61642975",
"0.6047407",
"0.5918459",
"0.5670631",
"0.5667683",
"0.5634032",
"0.56018096",
"0.54684603",
"0.5459096",
"0.5455898",
"0.5454198",
"0.5402022",
"0.5378889",
"0.53612953",
"0.5339532",
"0.53133744",
"0.53102744",
"0.5309688",
"0.52861136",
"0.526491... | 0.7402039 | 0 |
will be executed only once before program exits; after all capabilities are finished(after all onCleanup) | afterLaunch() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cleanup() {\n // Emit a beforeExit event. e.g. used by Encoda's Puppeteer interface to\n // destroy any browser instance. Note that:\n // \"The 'beforeExit' event is not emitted for conditions causing\n // explicit termination, such as calling process.exit() or uncaught\n // exceptions.\"\n pr... | [
"0.6851153",
"0.6557335",
"0.6557335",
"0.6415366",
"0.6274181",
"0.6221513",
"0.6216904",
"0.62142986",
"0.6104975",
"0.61035764",
"0.6060846",
"0.60605484",
"0.6057311",
"0.6056413",
"0.6021622",
"0.5994825",
"0.5985918",
"0.5971642",
"0.59604084",
"0.5959981",
"0.5919584",... | 0.6887544 | 0 |
The Fetch Standard treats this as if "total bytes" is a property on the body. For us, we have to explicitly get it with a function. ref: | function getTotalBytes(instance) {
const body = instance.body;
// istanbul ignore if: included for completion
if (body === null) {
// body is null
return 0;
} else if (isBlob(body)) {
return body.size;
} else if (Buffer.isBuffer(body)) {
// body is buffer
return body.length;
} else if (body && typeof ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTotalBytes(instance) {\n\tconst body = instance.body;\n\n\t// istanbul ignore if: included for completion\n\n\tif (body === null) {\n\t\t// body is null\n\t\treturn 0;\n\t} else if (typeof body === 'string') {\n\t\t// body is string\n\t\treturn Buffer.byteLength(body);\n\t} else if (isURLSearchParams(b... | [
"0.6642224",
"0.66187394",
"0.66187394",
"0.656447",
"0.6550913",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
"0.6505509",
... | 0.66366524 | 1 |
add the Temperatures/Wind Speeds to our tempState | function renderTempState() {
// Set the State for Current & run conversion function to get those values in Metric
state.tempState.usUnits.current.temp = state.search.results.data.currently.apparentTemperature;
state.tempState.usUnits.current.windSpeed = state.search.results.data.currently.windSpeed;
st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function currentTemperture(weather) {\n var temp = document.getElementById(\"temp\");\n var humidity = document.getElementById(\"humidity\");\n var wind = document.getElementById(\"wind\");\n var pressure = document.getElementById(\"pressure\");\n\n temp.textContent = weather.main.temp + \"F\";\n ... | [
"0.5989646",
"0.58758914",
"0.58658665",
"0.5848296",
"0.58353204",
"0.58352244",
"0.5811539",
"0.5772866",
"0.5754335",
"0.5681343",
"0.56735194",
"0.5589483",
"0.5586042",
"0.5551825",
"0.5530955",
"0.5495053",
"0.5483936",
"0.5470752",
"0.54669577",
"0.54531515",
"0.544379... | 0.70199287 | 0 |
Collects some useful data from trials, such as unique sources, total number of trials and so on | function collectTrialsInfo(trials) {
let result = {
completedTrials: 0,
reportedTrials: 0,
delayedCompletedTrials: 0,
mostDelayed: {date: today, days: 0, id: ''},
leastDelayed: {date: moment('1900-01-01', timeFormat), days: 0, id: ''},
averageDelay: 0,
participants: {
completedRecrui... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n this.count = 0; //a counter to keep track of how many trials were dispalyed\n this.trialData = []; //initializes a vector to collect data\n this.allTrials = setupTrials(); //calls the function defined in items.js, which creates 12 trials\n }",
"generateTotalPassNumbers() {\n const ... | [
"0.6514371",
"0.62543714",
"0.5816472",
"0.5608082",
"0.55256355",
"0.54802907",
"0.5476609",
"0.5404539",
"0.5373209",
"0.5372348",
"0.5357281",
"0.53106135",
"0.52791643",
"0.52527875",
"0.5223199",
"0.52115285",
"0.5204398",
"0.5153549",
"0.5152291",
"0.5150159",
"0.514295... | 0.74711126 | 0 |
Parse model schema. Mainly expanding shortcuts and check syntax. | function schemaParser(schema) {
// Expand attribute definition
// attribute_name: Object –> attribute_name: { type: Object }
const attrKeys = Object.keys(schema.attributes)
const typeKeys = Object.keys(C.Type)
attrKeys.forEach(attr => {
const def = schema.attributes[attr]
if (def === String || def ===... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static retreiveParsedSchema() {\n if (!this.constructor.parsedSchema) { // if parsed schema is not defined, define it for the constructor\n // 1. retreive the parsed schema\n const customTypes = {}; // object to build into\n if (this.dependencies) this.dependencies.forEach((dep) => { customTypes[... | [
"0.53671384",
"0.5278166",
"0.5278166",
"0.5278166",
"0.5278166",
"0.5254732",
"0.5230818",
"0.52145314",
"0.5173721",
"0.5131315",
"0.50952655",
"0.5084177",
"0.50447565",
"0.5012984",
"0.49848786",
"0.4928156",
"0.49024457",
"0.4894311",
"0.48732293",
"0.48613402",
"0.48508... | 0.6852163 | 0 |
Take in column index, returns the bottom row that is still gray | function checkBottom(colIndex){
var colorReport = reportColor(5, colIndex);
for (var row=5; row > -1; row--){
colorReport = reportColor(row, colIndex);
if (colorReport === 'rgb(128, 128, 128)'){
return row
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkBottom(colIndex){\r\n for(var row=5;row>-1;row--){\r\n if(returnColor(row,colIndex)==='rgb(128, 128, 128)'){\r\n return row;\r\n }\r\n }\r\n}",
"function checkBottom(colIndex) {\r\n var colorReport = returnColor(5, colIndex);\r\n for (var row = 5; row > -1; row--) {\r\n colorRepor... | [
"0.8126625",
"0.8090572",
"0.80146414",
"0.79381174",
"0.785725",
"0.776241",
"0.67564625",
"0.67409945",
"0.6740793",
"0.67269886",
"0.6678136",
"0.6662925",
"0.6608704",
"0.64659506",
"0.639666",
"0.63565373",
"0.6355495",
"0.6244569",
"0.6218393",
"0.6209225",
"0.6161515",... | 0.8110476 | 1 |
Check to see if 4 inputs are the same color | function colorMatchCheck(one, two, three ,four){
return (one===two && one === three && one === four && one !== 'rgb(128, 128, 128)' && one !== undefined);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkMatchColor(one,two,three,four) {\n if (one === current_color &&\n two === current_color &&\n three === current_color &&\n four === current_color) {\n return true;\n }\n else {\n return false;\n }\n\n}",
"function colorMatchCheck(one,two,three,four) {\r\n return (one===two ... | [
"0.76469886",
"0.7644377",
"0.7636446",
"0.76342285",
"0.75902826",
"0.75691307",
"0.7557963",
"0.7539126",
"0.7428378",
"0.7308032",
"0.7175466",
"0.7166987",
"0.71427625",
"0.6860077",
"0.68490005",
"0.6781994",
"0.67680705",
"0.66021657",
"0.65963614",
"0.646881",
"0.64686... | 0.7682226 | 0 |
change mask descriptor based on how much symbols there are in each group | function adjustMaskDescriptor(valueGroups){
var valueGroupsLength = valueGroups.length,
groupLength,
groupMaxLength;
// first group descriptor
groupLength = valueGroups[0].length;
groupMaxLength = maskSymbolsLength[maskDescriptorFormat[0]];
if (groupLengt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SS_mask_from_flags(descriptor_high4bytes) {\n if (descriptor_high4bytes & (1 << 22))\n return -1;\n else\n return 0xffff;\n }",
"function getMaskComponents() {\n\t\t\t\t\t return maskPlaceholder.replace(/[_]+/g, '_').replace(/([^_]+)([a-zA-Z0-9])([^_])/g, '$1... | [
"0.58970296",
"0.57240814",
"0.57109874",
"0.5678541",
"0.5653615",
"0.5651306",
"0.5651306",
"0.5483691",
"0.54582435",
"0.54534835",
"0.5445215",
"0.5418829",
"0.54029346",
"0.54021734",
"0.5387707",
"0.5384261",
"0.5372119",
"0.5323173",
"0.52941525",
"0.5284121",
"0.52807... | 0.6876464 | 0 |
hide the all listing options in a select item parameter: name of select list | function hideListing(listName){
var list = listName.options;
list.selectedIndex = 0;
for(var i = 1; i < list.length; i++){
list[i].hide();
list[i].disabled = true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hideSelect()\n {\n $(this.el).hide();\n $(this.el).attr('multiple', true);\n }",
"function hideSelects(b)\n{\n var allelems = document.all.tags('SELECT');\n if (allelems != null)\n {\n var i;\n for (i = 0; i < allelems.length; i++)\n ... | [
"0.7154215",
"0.70795405",
"0.70034856",
"0.6576243",
"0.6468338",
"0.6447209",
"0.62881744",
"0.6283192",
"0.6251846",
"0.62373763",
"0.62342274",
"0.61526483",
"0.61526483",
"0.61526483",
"0.6142954",
"0.6109083",
"0.6101419",
"0.6086703",
"0.6043328",
"0.60406345",
"0.5976... | 0.7882831 | 0 |
Get suggestions from metacpan.org | function getSuggestions(text){
var query = cpan_url + '/search/autocomplete?q=' + text;
var xhr = new XMLHttpRequest();
xhr.open("GET", query, false);
xhr.send();
var json = JSON.parse(xhr.responseText);
console.log(json); // for debug
suggestions[text] = [];
$(json).each(function(){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"autosuggest() {}",
"async getSuggestions(query) {\n let search = query.search || \"\"\n let format = query.format || \"\"\n let results = await this.searchConcept(search, query.voc)\n if (format.toLowerCase() == \"jskos\") {\n // Return in JSKOS format\n return results.slice(query.offset, q... | [
"0.6578788",
"0.6178487",
"0.6145883",
"0.60594887",
"0.5919422",
"0.5878295",
"0.5854799",
"0.5803446",
"0.57884705",
"0.5787235",
"0.57681537",
"0.5725455",
"0.5702697",
"0.56752855",
"0.564147",
"0.5641094",
"0.5602264",
"0.5598078",
"0.5596129",
"0.5526821",
"0.54877913",... | 0.6802686 | 0 |
Parses and returns info about the call stack at the given index. | function getStackInfo(stackIndex) {
// get call stack, and analyze it
// get all file, method, and line numbers
const stacklist = new Error().stack.split('\n').slice(3);
// stack trace format:
// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
// do not remove the regex expresses to outside of thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callerInfo(n) {\n /* a terrible rex that basically searches for file.js:nnn:nnn several times*/\n const inStack = /([^:\\s]+:\\d+(?::\\d+)?)\\W*(\\n|$)/g;\n return (new Error().stack.match(inStack)[n+1] || '')\n .replace(/[^/\\w]*/, '').replace(/\\D*$/,'');\n}",
"function callsite() {\n ... | [
"0.6647339",
"0.61722755",
"0.5995306",
"0.59583586",
"0.5955383",
"0.5852143",
"0.5815877",
"0.5789587",
"0.57695717",
"0.56636846",
"0.564482",
"0.55978996",
"0.5505416",
"0.5493474",
"0.5493474",
"0.54909164",
"0.5487023",
"0.54798216",
"0.5449041",
"0.5448076",
"0.5447951... | 0.7676831 | 0 |
This is not relevant yet, when updating the program to have different versions (kids, teen, standard) this function sets the DB name according to the version | function setDBNameAccordingToVersion(){
switch(APP_VERSION) {
case 'Kids':
DB_NAME = DB_NAME_PRE + 'kids';
DB_DISPLAY_NAME = DB_DISPLAY_NAME + 'Kids';
break;
case 'Teens':
DB_NAME = DB_NAME_PRE + 'teens';
DB_DISPLAY_NAME = DB_DISPLAY_NAME + 'Teens';
break;
case 'Standard':
DB_NAME = DB_NAME_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get currentDbVersion() { return 1 }",
"function setDbVersion (version) {\n db.run(`PRAGMA user_version=${version}`)\n}",
"static set defaultDb(db) {\n FireModel_1.FireModel.defaultDb = db;\n }",
"static get localDbName() { return \"LandslideSurvey\" }",
"setDb(newdb) {\n db = newdb... | [
"0.6293608",
"0.6218932",
"0.6209348",
"0.6193777",
"0.61924237",
"0.6181696",
"0.6117198",
"0.60736334",
"0.60309905",
"0.60222924",
"0.598718",
"0.5975793",
"0.59123003",
"0.58815885",
"0.58411825",
"0.5778758",
"0.5721253",
"0.5720265",
"0.570519",
"0.5697874",
"0.56624806... | 0.86102366 | 0 |
Function to check if table exists | function tableExists(tx, tablename, callback){
tx.executeSql('SELECT * FROM '+tablename, [], function(tx, resultSet) {
if (resultSet.rows.length <= 0){
callback(false);
}
else {
callback(true);
}
}, function(err){
callback(false);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_tableExists(table_name) {\r\n return this.db.tables[table_name] ? true : false;\r\n }",
"function tableExists(table_name) {\n\t\treturn db.tables[table_name] ? true : false;\n\t}",
"function tableExists(table_name) {\n\t\treturn db.tables[table_name] ? true : false;\n\t}",
"tableExists(table_name) {... | [
"0.8472963",
"0.8310561",
"0.8310561",
"0.8215093",
"0.7986818",
"0.79790366",
"0.7709292",
"0.75226885",
"0.7354408",
"0.72270304",
"0.72201294",
"0.7191237",
"0.7148298",
"0.68407583",
"0.68407583",
"0.6839803",
"0.68271804",
"0.6784626",
"0.67790735",
"0.6660996",
"0.66355... | 0.8409583 | 1 |
Callback for Successful Insert | function querySuccessInsert(tx, results) {
successLog(results);
// this will be empty since no rows were inserted.
if (DEBUG_MODE) console.log("Insert ID = " + results.insertId);
ListDBValues();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function querySuccessUserLessonInsert(tx, results) {\t\n successLog(results);\n // this will be empty since no rows were inserted.\n if (DEBUG_MODE) console.log(\"Insert ID = \" + results.insertId);\n}",
"function querySuccessInsertResult(tx, results) {\t\n successLog(results);\n // this will be e... | [
"0.7221992",
"0.7214929",
"0.7176557",
"0.69585764",
"0.6882107",
"0.68346786",
"0.6799729",
"0.6711831",
"0.65818375",
"0.6562069",
"0.6558593",
"0.6551133",
"0.65381545",
"0.6514996",
"0.650825",
"0.6479833",
"0.64672244",
"0.64672244",
"0.64672244",
"0.6455494",
"0.6453793... | 0.74030066 | 0 |
Callback for Successful Insert | function querySuccessUserLessonInsert(tx, results) {
successLog(results);
// this will be empty since no rows were inserted.
if (DEBUG_MODE) console.log("Insert ID = " + results.insertId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function querySuccessInsert(tx, results) {\t\n successLog(results);\n // this will be empty since no rows were inserted.\n if (DEBUG_MODE) console.log(\"Insert ID = \" + results.insertId);\n \n ListDBValues();\n}",
"function querySuccessInsertResult(tx, results) {\t\n successLog(results);\n ... | [
"0.74030066",
"0.7214929",
"0.7176557",
"0.69585764",
"0.6882107",
"0.68346786",
"0.6799729",
"0.6711831",
"0.65818375",
"0.6562069",
"0.6558593",
"0.6551133",
"0.65381545",
"0.6514996",
"0.650825",
"0.6479833",
"0.64672244",
"0.64672244",
"0.64672244",
"0.6455494",
"0.645379... | 0.7221992 | 1 |
Callback for Successful Result Insert | function querySuccessInsertResult(tx, results) {
successLog(results);
// this will be empty since no rows were inserted.
if (DEBUG_MODE) console.log("Insert ID = " + results.insertId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function querySuccessInsert(tx, results) {\t\n successLog(results);\n // this will be empty since no rows were inserted.\n if (DEBUG_MODE) console.log(\"Insert ID = \" + results.insertId);\n \n ListDBValues();\n}",
"function querySuccessUserLessonInsert(tx, results) {\t\n successLog(results);\n... | [
"0.78025377",
"0.7620543",
"0.71617836",
"0.7099538",
"0.67713785",
"0.6733318",
"0.6703843",
"0.6622788",
"0.65782994",
"0.65399295",
"0.65010834",
"0.6492612",
"0.64885354",
"0.6447986",
"0.6442873",
"0.63887084",
"0.6376597",
"0.6327752",
"0.63112164",
"0.6310115",
"0.6300... | 0.7763313 | 1 |
Callback for Successful Update of results | function querySuccessUpdateResult(tx, results) {
successLog(results);
if (PATHNAME.indexOf('longterm.html') != -1) {
ListDBValues();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function querySuccessUpdate(tx, results) {\t\n successLog(results);\n \n if (PATHNAME.indexOf('userSettings.html') != -1) {\n \talert('Benutzerdaten wurden erfolgreich geändert.');\n }\n \n ListDBValues();\n}",
"function callback(){\n console.info(\"Record updated successfully\");\n ... | [
"0.68525195",
"0.67385024",
"0.6527965",
"0.65031606",
"0.64317006",
"0.6397256",
"0.6378526",
"0.6368641",
"0.6359138",
"0.63339716",
"0.6318108",
"0.63113093",
"0.6287562",
"0.6267674",
"0.6215403",
"0.62036616",
"0.61940616",
"0.6190307",
"0.6174782",
"0.61614966",
"0.6151... | 0.7540251 | 0 |
because rocket exists only in the rocketName function | function rocketName() {
var rocket = "Flacon9";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRover(name) {\n let rover = {\n rovername: name,\n direction: \"N\",\n x: 0,\n y: 0,\n travelLog: \"\",\n }\n if (grid[rover.x][rover.y] !== \"r\") {\n rovers.push(rover);\n grid[rover.x][rover.y] = \"r\";\n console.log(`The next round is the rover ${rovers[round].rovernam... | [
"0.59835863",
"0.5478541",
"0.5426788",
"0.5354121",
"0.53428054",
"0.53209084",
"0.5313119",
"0.52340144",
"0.52182114",
"0.520884",
"0.5196357",
"0.5191206",
"0.5160402",
"0.51447254",
"0.51261234",
"0.5121641",
"0.51205385",
"0.51052237",
"0.5092861",
"0.5081033",
"0.50728... | 0.7152365 | 0 |
close_conference is used to close the current conference gracefully, when the window is closed (& when users are done with the conference) close_conference uses the api object | function close_conference() {
// params is the jitsi api object
if (api != null && api != undefined) {
console.log(api);
alert("on close!");
api.dispose();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function f_api_close() {\n f_broadcast_send({ ok: true, callback: 'api.f_close' });\n}",
"function closePopup()\n {\n var win = document.querySelector(\".window--modal\");\n if (win) {\n var api = win.data_api;\n if(api) api.close();\n }\n }",
"close() {\n this.stopSlideVideo(thi... | [
"0.6789882",
"0.56786376",
"0.5631043",
"0.5462637",
"0.5437918",
"0.5419467",
"0.5408773",
"0.5387327",
"0.53439784",
"0.53183764",
"0.5309512",
"0.52894795",
"0.52535594",
"0.5228194",
"0.5219383",
"0.5209838",
"0.5205946",
"0.52024233",
"0.5196612",
"0.5187663",
"0.5185602... | 0.8278911 | 0 |
Define the Auditor object | function Auditor() {
this.musicians = new Map(); // active musicians
/**
* Add a musician to the active list
* - stop if the sound doesn't exists
* - update the musician if already in list
* - or add the new musician
*/
Auditor.prototype.addMusician = (uuid, sound) => {
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n super();\n this.ledgerDocAsset = new LedgerDocAsset(this);\n }",
"constructor() { \n \n MozuCoreApiContractsAuditInfo.initialize(this);\n }",
"async audit(actor, origin, action, label, object, description, metadata) {\n if (this.config.audit && this.co... | [
"0.626272",
"0.61304504",
"0.59985423",
"0.5882232",
"0.56612986",
"0.5548981",
"0.5531099",
"0.5521427",
"0.5443944",
"0.5382728",
"0.538235",
"0.53728604",
"0.5365616",
"0.5306901",
"0.5301008",
"0.52999043",
"0.528235",
"0.5254263",
"0.52519715",
"0.52369916",
"0.52190846"... | 0.66220033 | 0 |
flipToWhite receives: div refrence, div refrence returns: nothing description: used to take a match off the table. | function flipToWhite(cardObject, secondCardObject, substring) {
activeCard = cardObject;
otherActiveCard = secondCardObject;
activeCard.style.backgroundImage = "url('clear.png')";
otherActiveCard.style.backgroundImage = "url('clear.png')";
addEventListeners();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function flip(cell)\r\n{\r\n\tif (x >= l/2 || cell.innerHTML == \" \") \r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar span = cell.firstChild;\r\n\t\r\n\tspan.style.visibility = \"visible\";\r\n\tx++; \r\n\t\r\n\tif (x >= l/2)\r\n\t{\r\n\t\talert (\"You have got the limit, please pick a guess...\");\r\n\t\tver... | [
"0.6147165",
"0.6103458",
"0.5810705",
"0.5801049",
"0.5686355",
"0.5619058",
"0.5580878",
"0.55495286",
"0.55495286",
"0.5520679",
"0.5498952",
"0.54690623",
"0.5443857",
"0.5406919",
"0.5376693",
"0.5357029",
"0.53543586",
"0.5348122",
"0.53441745",
"0.5327346",
"0.5315223"... | 0.65784466 | 0 |
create produced electricity data for displaying in overview table (results tab) | createTableData(ElectricityProduction) {
// Electricity production => array of arrays suitable for graphs returns array
// of arrays [Title, data,..., total]
let totalProducedElectricity = 0;
let tableData = ['Produced [MWh]'];
for (let i of ElectricityProduction) {
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createData() {\n var template = _.template(document.querySelector('.template-row').innerHTML),\n categories = _.uniq(_.pluck(metricConfig, 'category'));\n\n _.each(categories, function(dim) {\n var theTable = $(\".table-\" + dim.toLowerCase().replace(/\\s+/g, \"-\") + \" tbody\");\n ... | [
"0.6307358",
"0.6305117",
"0.62480754",
"0.60866725",
"0.59834594",
"0.5973586",
"0.5966838",
"0.59584343",
"0.5955093",
"0.5950691",
"0.5949708",
"0.5930793",
"0.5924614",
"0.5921912",
"0.5879929",
"0.5868108",
"0.58360547",
"0.583572",
"0.58097047",
"0.57913554",
"0.5784162... | 0.6690436 | 0 |
Functions Get all masters request hendling | async function getAllMasters (req, res) {
try {
const result = await Master.findAll({
include: { model: City, paranoid: false }
})
res.status(200).send(result)
} catch (error) {
// console.log(error)
res.sendStatus(500)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMastersFn() {\n var obj = {\n \"sort\": \"sortingSequence ASC\",\n \"isOnlyParents\": true\n };\n\n vm.masters = [];\n vm.active_masters = [];\n vm.child_masters = [];\n vm.sortedSeq = [];\n\n vm.... | [
"0.7343721",
"0.68664026",
"0.58900785",
"0.5884282",
"0.58364886",
"0.58311754",
"0.5754687",
"0.5708609",
"0.5613482",
"0.55996907",
"0.5589949",
"0.5587349",
"0.5582334",
"0.55794924",
"0.55747694",
"0.55480987",
"0.55447483",
"0.5542636",
"0.54358226",
"0.54353684",
"0.54... | 0.69171643 | 1 |
Create new master request hendling | async function createNewMaster (req, res) {
try {
const result = await Master.build({
masterName: req.body.masterName,
cityId: req.body.cityId,
masterRating: req.body.masterRating
}).save()
// if successfully saved send status 201
res.status(201).send(result)
} catch (err) {
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_master(id, name, window) {\n DB.push({\n type: \"master\",\n id: id,\n window: window,\n name: name,\n base_path: BASE_PATH,\n port1: \"\",\n port2: \"\",\n port3: \"\",\n });\n}",
"function createRequest(){\n}",
"async create ({ request, response }) {\n\t\tlet [err, d... | [
"0.6608828",
"0.6393132",
"0.60932577",
"0.6031213",
"0.58787304",
"0.5878616",
"0.58523774",
"0.5851475",
"0.5803174",
"0.5794161",
"0.578186",
"0.57303214",
"0.5637643",
"0.5611436",
"0.56033295",
"0.5597298",
"0.55918396",
"0.5537613",
"0.54987365",
"0.54802763",
"0.548027... | 0.6884698 | 0 |
Delete master request handling | async function deleteMaster (req, res) {
try {
await Master.destroy({ where: { ID: req.params.id } })
res.status(204).send([])
} catch (err) {
res.sendStatus(500)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleRequestDelete() {\n // console.log(this);\n console.log($(this).attr(\"data\"));\n var deleteThisRequestId = $(this).attr(\"data\");\n \n deleteRequest(deleteThisRequestId);\n }",
"delete(req, res) {\n const data = {\n nature: {\n type: this.dataType,\n qualit... | [
"0.6712617",
"0.6641893",
"0.64126843",
"0.64126843",
"0.6400766",
"0.6368861",
"0.631062",
"0.62990224",
"0.6263813",
"0.6255431",
"0.62484825",
"0.6235727",
"0.6230131",
"0.6225538",
"0.61956125",
"0.61913115",
"0.6186795",
"0.61201113",
"0.6104639",
"0.6100547",
"0.6098028... | 0.74253565 | 0 |
Return the product by its url | getByUrl(url, cb) {
return this.dataProvider.send({type: 'product.details', url: url}).then(cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getProductLink(productId){\r\n const link = this.links.find(link => link.id == 'productDetail');\r\n return link.url + `?id=${productId}`;\r\n }",
"get url() { return \"product-details\"; }",
"function recommendProduct(current_url) {\n return products[0];\n}",
"function productURL(args,... | [
"0.72662014",
"0.6908828",
"0.6906894",
"0.6786533",
"0.6480405",
"0.64591277",
"0.639357",
"0.6379326",
"0.6332634",
"0.6240524",
"0.62135655",
"0.6171257",
"0.61262894",
"0.6104965",
"0.60913926",
"0.6090994",
"0.60617894",
"0.6048269",
"0.6036267",
"0.6035101",
"0.60272205... | 0.7363049 | 0 |
crossorigin iframe elements throw errors when being logged to the console. This function removes them from the context before logging them to the console. | function filterCrossOrigin(elements) {
// convert elements to an array if it's not already
if (!Array.isArray(elements)) elements = [elements]
elements = elements.map(function(el) {
if (el
&& el.nodeName
&& el.nodeName.toLowerCase() == "iframe"
&& isCrossOrigin(el.src)
)
return "(c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cleanIFrames(){\n var frames = document.getElementsByTagName('iframe');\n\n if(frames){\n for(var i=frames.length-1; i>=0; i--){\n if(options.bDontYoutube && frames[i].src){\n // don't remove youtube-clips\n // if it's not youtube-clip then remove it\n... | [
"0.64749336",
"0.5802761",
"0.5712038",
"0.57009655",
"0.56393534",
"0.5635327",
"0.5468559",
"0.5392235",
"0.53688097",
"0.53091925",
"0.53051025",
"0.5291078",
"0.5291078",
"0.5291078",
"0.5253303",
"0.51986897",
"0.51411873",
"0.51360404",
"0.51332587",
"0.51128393",
"0.51... | 0.67640907 | 0 |
Constructs a new SwitchboardAcceptControl. | constructor() {
EventSubSchema.initialize(this);SwitchboardAcceptControlAllOf.initialize(this);
SwitchboardAcceptControl.initialize(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Switch() {\n this._init.apply(this, arguments);\n}",
"configureAcceptButton(config) {\n if (config.needsReboot(this.trs80.getConfig())) {\n this.acceptButton.classList.add(gRebootButtonCssClass);\n this.acceptButton.innerText = \"Reboot\";\n }\n else {\n ... | [
"0.49999464",
"0.48250207",
"0.4725688",
"0.4711826",
"0.4711826",
"0.46883172",
"0.46647766",
"0.44828686",
"0.4474586",
"0.44466808",
"0.4409226",
"0.44020396",
"0.44015986",
"0.43997484",
"0.43673566",
"0.4343987",
"0.4333899",
"0.43214774",
"0.43085152",
"0.42785594",
"0.... | 0.48664913 | 1 |
url: picture.jpg movie: name director: [nameA, nameB, ...] actor: [nameA, nameB, ...] type: [action, adventure, love, ...] | function insertInformation(url, movie, director, actor, type) {
$('#movie-img').attr('src', url);
$('#movie-name').html(movie);
for (var i = 0; i < director.length; ++i) {
var div1 = $('<div></div>').addClass('item');
var div2 = $('<div></div>').addClass('content').html(director[i]);
div1.append(div2);
$('#d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async fetchActorInfo(actor) {\n const url1 = APIService._constructUrl(`/person/${actor}`)\n const response1 = await fetch(url1)\n const data1 = await response1.json()\n\n const url2 = APIService._constructUrl(`/person/${actor}/movie_credits`)\n const response2 = await fetch(url2)\n const d... | [
"0.601672",
"0.5885705",
"0.58385193",
"0.5801107",
"0.570417",
"0.56888986",
"0.55952954",
"0.55783176",
"0.5544426",
"0.55047435",
"0.550226",
"0.5481217",
"0.54621035",
"0.5439493",
"0.5405469",
"0.54024315",
"0.53911525",
"0.53716886",
"0.53660864",
"0.53627306",
"0.53548... | 0.6864118 | 0 |
used to create a nav button on the navBar for each section | function makeNavButton(section) {
const newNavButton = document.createElement("li");
newNavButton.classList.add("menu__link");
newNavButton.textContent = section.dataset.nav;
newNavButton.setAttribute("data-id", section.id);
newNavButton.id = `nav-${section.id}`;
if (activeNav == null) {
newNavButton.cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildNavBar() {\n for (let i = 0; i < sections.length; i++) {\n const newLinkItem = document.createElement('a'); // create a brand new anchor element\n newLinkItem.textContent = sections[i].dataset.nav; // Modify the content to be the name of the section.\n // newLinkItem.setAttrib... | [
"0.6996976",
"0.6942046",
"0.69416237",
"0.68671376",
"0.6863996",
"0.6839629",
"0.6835989",
"0.6827866",
"0.6801548",
"0.67942584",
"0.67914826",
"0.6786847",
"0.6780512",
"0.67674756",
"0.6759701",
"0.6699878",
"0.66602737",
"0.6646403",
"0.6638482",
"0.6634245",
"0.6624605... | 0.7449573 | 0 |
1. Find even number for given limit. Solution: 1. Get number (limit) value from user while running the code. 2. Logic for finding even number > Number % 2 => 0 3. Repeat this logic till n number | function print_even_numbers(){
var value = prompt("Enter you number Limit for finding Even count");
var limit = parseInt(value);
for(var count = 1; count <= limit; count++){
if(count % 2 == 0){
console.log('The even number is ', count)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showNumbers(limit){\n\n console.log(0, \"Even\");\n for (let i=1; i<=limit ; i++){\n if(i%2 === 0) console.log(i, \"Even\");\n else console.log(i, \"Odd\");\n }\n\n}",
"function again(param){\n let newNum = param/2;\n if(newNum > 2){\n return ag... | [
"0.7516856",
"0.6911337",
"0.6893759",
"0.688951",
"0.6784377",
"0.67706317",
"0.67643255",
"0.6713313",
"0.67115325",
"0.6695363",
"0.6633375",
"0.66198766",
"0.66093093",
"0.6590419",
"0.65313774",
"0.65235114",
"0.65106297",
"0.65103793",
"0.6500806",
"0.6486802",
"0.64829... | 0.7807645 | 0 |
An `Object` with an address as key and an Array of wallets as value. NOTE: regular wallets and contacts should not be duplicated, but, currently, Ledger wallets could be, so, the same address could belong to 1 wallet on the `wallet` store and 1 wallet on the `ledger` store | get allWalletsByAddress () {
return groupBy(this.allWallets, 'address') || []
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function combineWallets(arr) {\r\n var newWallet = {};\r\n for (i = 0; i < arr.length; i++) {\r\n for (var key in arr[i]) {\r\n if (newWallet[key] == undefined) {\r\n newWallet[key] = arr[i][key];\r\n } else {\r\n newWallet[key] = newWallet[key] + arr[i][key];\r\n };\r\n };\r\n... | [
"0.5616682",
"0.5570418",
"0.5570418",
"0.5570418",
"0.5570418",
"0.5570418",
"0.5570418",
"0.5570418",
"0.5570418",
"0.5570418",
"0.557013",
"0.557013",
"0.557013",
"0.557013",
"0.557013",
"0.55393237",
"0.551718",
"0.54479903",
"0.5369719",
"0.52886266",
"0.5270118",
"0.5... | 0.63622975 | 0 |
Returns a random theme | function randomTheme() {
return THEMES[Math.floor(Math.random()*THEMES.length)]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomThemeSelector() {\r\n var randomNumber = Math.round(Math.random() * 4);\r\n var themesArray = [\"themeDark1\", \"themeDark2\", \"themeLight1\", \"themeLight2\", \"themeLight3\"];\r\n var randomThemeSelected = themesArray[randomNumber];\r\n return randomThemeSelected;\r\n}",
"function generateT... | [
"0.82681406",
"0.820535",
"0.76356137",
"0.67155325",
"0.65375143",
"0.64985794",
"0.64883196",
"0.6463897",
"0.6427995",
"0.6408648",
"0.63710946",
"0.6369424",
"0.63466376",
"0.6333708",
"0.6303036",
"0.6301326",
"0.6283612",
"0.6271465",
"0.6271465",
"0.6271465",
"0.626824... | 0.89483666 | 0 |
Activates one segment in the display | activateOne(index) {
return this.children('.seg-'+index).addClass('active')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function viewSegmentation() {\n\n\tvar\tsegBtn = $('#btn_1');\n\n\tif( segDisplayOn ) {\n\t\t// Currently displaying segmentation, hide it\n\t\tsegBtn.val(\"Show Segmentation\");\n\t\t$('.overlaySvg').css('visibility', 'hidden');\n\t\tsegDisplayOn = false;\n\t} else {\n\t\t// Segmentation not currently displayed, ... | [
"0.64311343",
"0.6238307",
"0.61641955",
"0.59902596",
"0.59831685",
"0.59698856",
"0.59460163",
"0.58945155",
"0.58820826",
"0.5881276",
"0.5874913",
"0.5862024",
"0.577667",
"0.5715871",
"0.5700499",
"0.5689207",
"0.5684476",
"0.5648947",
"0.5630886",
"0.55817044",
"0.55694... | 0.7066248 | 0 |
Projects a number on the 2display timedisplay | timeDisplayNum(num) {
this.children('.display-0').number(Math.floor(num / 10));
this.children('.display-1').number(Math.floor(num % 10));
return this
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayCurrentTime()\n{\n\t//get a new date object that's 950ms in the future\n\t//so the time we show will be correct by the /end/ of the number-change transitions, \n\t//rather than at the beginning as it otherwise would be\n\tvar now = new Date(new Date().getTime() + 950);\n\t\n\t//get the basic time v... | [
"0.7050379",
"0.68414295",
"0.6788284",
"0.67698526",
"0.6754396",
"0.6733396",
"0.66971856",
"0.6573421",
"0.6523348",
"0.6521309",
"0.6521309",
"0.6503963",
"0.6474983",
"0.64731055",
"0.64330184",
"0.6432464",
"0.6416539",
"0.64154863",
"0.6400174",
"0.6397936",
"0.6397729... | 0.7615055 | 0 |
Now generate the HTML for the new analysis TODO: Add "key level snapshots"? e.g. level 10/15/20/... stats TODO: How to handle this for existing characters that may be past some key levels? Helper function that returns the number of spare skill points per level until the associated attr is leveled to max. Return value i... | function sparePerLevel(spare, maxAtLevel) {
// Number of levels this attr will be raised
var numLevels = maxAtLevel - ocp.input.levelMin;
// If this attr cannot be leveled, there is no spare
if (numLevels <= 0) {
return '0';
}
//... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function determineExp(name, length, level, maxDiff){\n\tvar returnText = \"\" + name + \" Report: \\n\\n\";\n\tfor\t(i = 0; i <= maxDiff; i++){\n\t\treturnText += \"expected xp for diff of \" + i + \" is \" + (1.25 * level * (15 + length) / (1 + i)) + \"\\n\";\n\t}\n\treturn returnText;\n}",
"function getPerLeve... | [
"0.64062905",
"0.6343067",
"0.59391564",
"0.5850716",
"0.58104706",
"0.5798151",
"0.5793803",
"0.5719131",
"0.56837523",
"0.5638865",
"0.56105524",
"0.5583848",
"0.5568804",
"0.55669075",
"0.5566248",
"0.55502105",
"0.5518589",
"0.54950875",
"0.5472601",
"0.54406583",
"0.5426... | 0.63851297 | 1 |
Data structure for collecting user face data (landmarks and/or emotions) | function viewerFaceDataStruct(frame = null, l = null, x = null) {
this.frame = frame;
this.landmarks = null;
this.neutral = null;
this.happy = null;
this.sad = null;
this.angry = null;
this.fearful = null;
this.disgusted = null;
this.surprised = null;
if (l) {
this.landmarks = new Array();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function l(){const{faceDescriptions:t,faceVertexOffsets:e,uvScales:r}=x,n=4*t.length,o=new Float64Array(3*n),s=new Float32Array(3*n),a=new Float32Array(2*n),i=new Uint32Array(2*t.length*3);let l=0,c=0,f=0,u=0;for(let h=0;h<t.length;h++){const n=t[h],m=l/3;for(const t of e)i[u++]=m+t;const p=n.corners;for(let t=0;t... | [
"0.57243603",
"0.5541824",
"0.5534279",
"0.55304044",
"0.5519926",
"0.55028576",
"0.54260033",
"0.5307204",
"0.52757734",
"0.52609473",
"0.5198779",
"0.51901084",
"0.51581484",
"0.51496553",
"0.5133291",
"0.512992",
"0.5087515",
"0.5083922",
"0.50469154",
"0.50411916",
"0.498... | 0.6282542 | 0 |
Deserialize the inputs from binary. | function deserializeInputs(readStream) {
const numInputs = readStream.readUInt16("inputs.numInputs");
const inputs = [];
for (let i = 0; i < numInputs; i++) {
inputs.push(deserializeInput(readStream));
}
return inputs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function BinaryParser() { }",
"function BinaryParser() { }",
"function BinaryParser() {}",
"function deserializeInput(readStream) {\r\n if (!readStream.hasRemaining(exports.MIN_INPUT_LENGTH)) {\r\n throw new Error(`Input data is ${readStream.length()} in length which is less than the minimimum size... | [
"0.5991789",
"0.5991789",
"0.5975605",
"0.5916927",
"0.5745145",
"0.5745145",
"0.5437011",
"0.5257242",
"0.5032442",
"0.5030585",
"0.49912316",
"0.49843794",
"0.49631855",
"0.4886943",
"0.4878315",
"0.4878315",
"0.4878315",
"0.4878315",
"0.48324388",
"0.4826091",
"0.47621346"... | 0.66663736 | 0 |
Serialize the inputs to binary. | function serializeInputs(writeStream, objects) {
if (objects.length < exports.MIN_INPUT_COUNT) {
throw new Error(`The minimum number of inputs is ${exports.MIN_INPUT_COUNT}, you have provided ${objects.length}`);
}
if (objects.length > exports.MAX_INPUT_COUNT) {
throw new Error(`The max... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toBinary() {\n const publicKeyLength = this.publicKey.length;\n const payloadLength = this.payload.length;\n const signatureLength = this.signature.length;\n const binary = new Uint8Array(1 + 1 + 8 + 2 + publicKeyLength + payloadLength + signatureLength + 2);\n ... | [
"0.6191077",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",
"0.57561624",... | 0.6321161 | 0 |
Deserialize the utxo input from binary. | function deserializeUTXOInput(readStream) {
if (!readStream.hasRemaining(exports.MIN_UTXO_INPUT_LENGTH)) {
throw new Error(`UTXO Input data is ${readStream.length()} in length which is less than the minimimum size required of ${exports.MIN_UTXO_INPUT_LENGTH}`);
}
const type = readStream.readByte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fromString(utxoid) {\n const utxoidbuff = bintools.b58ToBuffer(utxoid);\n if (utxoidbuff.length === 40 && bintools.validateChecksum(utxoidbuff)) {\n const newbuff = bintools.copyFrom(utxoidbuff, 0, utxoidbuff.length - 4);\n if (newbuff.length === 36) {\n this.byte... | [
"0.60155964",
"0.59240186",
"0.56090784",
"0.5590634",
"0.5590634",
"0.54846346",
"0.5465385",
"0.54583645",
"0.5445329",
"0.5369948",
"0.5369948",
"0.52780604",
"0.5129535",
"0.5110822",
"0.50747263",
"0.5063737",
"0.50520706",
"0.5023231",
"0.49516523",
"0.49483445",
"0.494... | 0.70191854 | 0 |
Serialize the utxo input to binary. | function serializeUTXOInput(writeStream, object) {
writeStream.writeByte("utxoInput.type", object.type);
writeStream.writeFixedHex("utxoInput.transactionId", common_1.TRANSACTION_ID_LENGTH, object.transactionId);
writeStream.writeUInt16("utxoInput.transactionOutputIndex", object.transactionOutputIndex);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toBinary() {\n const publicKeyLength = this.publicKey.length;\n const payloadLength = this.payload.length;\n const signatureLength = this.signature.length;\n const binary = new Uint8Array(1 + 1 + 8 + 2 + publicKeyLength + payloadLength + signatureLength + 2);\n ... | [
"0.5743779",
"0.57148194",
"0.5594281",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
"0.5562703",
... | 0.71342754 | 0 |
Deserialize the treasury input from binary. | function deserializeTreasuryInput(readStream) {
if (!readStream.hasRemaining(exports.MIN_TREASURY_INPUT_LENGTH)) {
throw new Error(`Treasury Input data is ${readStream.length()} in length which is less than the minimimum size required of ${exports.MIN_TREASURY_INPUT_LENGTH}`);
}
const type = rea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static deserialize() {}",
"static deserialize() {}",
"function BinaryParser() { }",
"function BinaryParser() { }",
"function decodeLedgerData(binary) {\n assert(typeof binary === \"string\", \"binary must be a hex string\");\n var parser = new binary_parser_1.BinaryParser(binary);\n return {\n ... | [
"0.5801553",
"0.5801553",
"0.57492006",
"0.57492006",
"0.5746702",
"0.5728184",
"0.5543076",
"0.551957",
"0.5491771",
"0.5459908",
"0.5428421",
"0.54267573",
"0.5409006",
"0.54077065",
"0.5407552",
"0.53854364",
"0.5382654",
"0.52510184",
"0.5240615",
"0.5240615",
"0.5240615"... | 0.68551165 | 0 |
Serialize the treasury input to binary. | function serializeTreasuryInput(writeStream, object) {
writeStream.writeByte("treasuryInput.type", object.type);
writeStream.writeFixedHex("treasuryInput.milestoneId", common_1.TRANSACTION_ID_LENGTH, object.milestoneId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toBinary() {\n const publicKeyLength = this.publicKey.length;\n const payloadLength = this.payload.length;\n const signatureLength = this.signature.length;\n const binary = new Uint8Array(1 + 1 + 8 + 2 + publicKeyLength + payloadLength + signatureLength + 2);\n ... | [
"0.5718896",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",
"0.56956935",... | 0.6679389 | 0 |
Reports the event to Google Analytics. | function _reportGA(hitType, url, title) {
try {
const request = new XMLHttpRequest();
request.open("POST", "https://www.google-analytics.com/collect", true);
const params = {
v: 1,
t: hitType,
tid: GA_TRACKING_ID,
cid: _clientId(),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trackAnalytics(action, label) {\n\t\tif (typeof ga === 'function') {\n\t\t\t//console.log('sending ' + action + ': ' + label + ' to google analytics');\n\t\t\tga('send', 'event', '12 Step Meeting List', action, label);\n\t\t}\n\t}",
"function sendGa(name, value, label) {\n if (label) {\n _gaq.... | [
"0.6671596",
"0.66692597",
"0.6641133",
"0.6309745",
"0.6136225",
"0.6121026",
"0.6111634",
"0.61041945",
"0.60931385",
"0.6060502",
"0.6034048",
"0.5995136",
"0.59794027",
"0.5962907",
"0.59503216",
"0.59436923",
"0.59391695",
"0.59391695",
"0.59391695",
"0.593213",
"0.59180... | 0.6688341 | 0 |
The simplest possible plugin just returns a ModelJS model. | function SimplestPlugin(){
return Model();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SimplePlugin(){\n return Model({\n publicProperties: [\"message\"]\n });\n}",
"get Model () {\n return Model\n }",
"wrapModel(model) {\n return model;\n }",
"getModel() {\n }",
"function SimplePluginWithDefaults(){\n return Model({\n publicProperties: [\"x\", \"y\"],\n x: 5,... | [
"0.7258217",
"0.6941527",
"0.6833687",
"0.6830188",
"0.6782497",
"0.6670274",
"0.6530692",
"0.64996606",
"0.6456791",
"0.6456791",
"0.64550227",
"0.6430277",
"0.6426432",
"0.6426432",
"0.6404841",
"0.6377573",
"0.63344413",
"0.6295219",
"0.6294121",
"0.6281656",
"0.626858",
... | 0.8452909 | 0 |
Hides and shows play and pause | function hidePlay () {
cp.hide(getElement("Play", "id"));
cp.show(getElement("Pause", "id"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hidePlay(){\n // hide play \n cp.hide(getElement(\"Play\", \"id\"));\n // show pause\n cp.show(getElement(\"Pause\", \"id\")); \n }",
"function hidePause () {\n cp.show(getElement(\"Play\", \"id\"));\n cp.... | [
"0.84835184",
"0.8114571",
"0.78716004",
"0.77548003",
"0.760302",
"0.75947106",
"0.7593257",
"0.7579502",
"0.7418095",
"0.7328031",
"0.7310581",
"0.7287547",
"0.7284171",
"0.72772217",
"0.7269143",
"0.7266392",
"0.7257608",
"0.72126514",
"0.7205632",
"0.7188946",
"0.71602154... | 0.8379545 | 1 |
Hide mute shows unmute | function hideMute () {
cp.show(getElement("Unmute", "id"));
cp.hide(getElement("Mute", "id"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideUnmute () {\n cp.show(getElement(\"Mute\", \"id\"));\n cp.hide(getElement(\"Unmute\", \"id\"));\n }",
"un_mute() {\n\t\tthis.fade_in(this.vol);\n\t\twindow.mute = false;\n\t}",
"toggleMute() {\n this.muted = !this.muted;\n }",
"function mute() {\n va... | [
"0.89985484",
"0.80991703",
"0.80603737",
"0.80470604",
"0.7838678",
"0.775998",
"0.76888394",
"0.762344",
"0.7620859",
"0.7593948",
"0.7593069",
"0.7565188",
"0.7536775",
"0.7507117",
"0.74887663",
"0.7441581",
"0.7441337",
"0.742074",
"0.74184334",
"0.7409574",
"0.73865134"... | 0.87832373 | 1 |
Hide unmute shows mute | function hideUnmute () {
cp.show(getElement("Mute", "id"));
cp.hide(getElement("Unmute", "id"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideMute () {\n cp.show(getElement(\"Unmute\", \"id\"));\n cp.hide(getElement(\"Mute\", \"id\"));\n }",
"toggleMute() {\n this.muted = !this.muted;\n }",
"function mute() {\n var mute = document.getElementById(\"mute\");\n if (musique.muted) {\n ... | [
"0.86424744",
"0.81698126",
"0.8138395",
"0.8084493",
"0.7879277",
"0.7848177",
"0.7762487",
"0.7728067",
"0.7712246",
"0.7702279",
"0.7646279",
"0.7622017",
"0.76067746",
"0.7587693",
"0.7577668",
"0.7570762",
"0.7562643",
"0.75057685",
"0.7457806",
"0.73999584",
"0.73992246... | 0.8921785 | 0 |
Rests UI controls when entering new slide | function slideRest() {
cpCmndTOCVisible = 0;
hidePlay();
stayMute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bindControls() {\n /* Next Button */\n this.controls.nextEl.addEventListener('click', (e) => {\n e.preventDefault();\n this.counter++;\n /* this.counter = (this.slidesToScroll > 1) ?\n this.counter + this.slidesToScroll :\n this.counter++; */\n\n this.gotoSlide(this.counte... | [
"0.6320924",
"0.6264092",
"0.62159085",
"0.6213143",
"0.6202543",
"0.6175489",
"0.617356",
"0.61543",
"0.611353",
"0.61129767",
"0.608061",
"0.605104",
"0.60356176",
"0.6032192",
"0.6011809",
"0.60063344",
"0.59933645",
"0.5979774",
"0.59539664",
"0.5944975",
"0.59379035",
... | 0.6294943 | 1 |
walk and distance distance should return an array of false values [false,false,false] with the length of a given parameter walk should go through the returned array of distance and change it to true tour should return the result of walk | function tour(walk, distance){
return distance.map(walk);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function distance(steps){\n return new Array(steps).fill(false);\n}",
"function isValidWalk(walk) {\n //insert brilliant code here\n let x = 0;\n let y = 0;\n walk.forEach(el => {\n if(el === 'n'){\n y++;\n }else if(el === 's'){\n y--;\n }else if(el === 'e'){\n x++;\n }else if(el ... | [
"0.6000833",
"0.5849938",
"0.583268",
"0.57420146",
"0.56412214",
"0.5557228",
"0.5539202",
"0.55204934",
"0.5508937",
"0.5503669",
"0.5428232",
"0.5385393",
"0.5358904",
"0.5351868",
"0.533749",
"0.5298152",
"0.52966833",
"0.52708",
"0.5205886",
"0.5199327",
"0.51941854",
... | 0.711912 | 0 |
change production line for an order | function changeLine(theobject){
InteractionWithDatabase1('ganttZone', 'action=changeline&lineno=' + $('ganttZone').getAttribute('crntLine') + '&orderkey=' + theobject.parentNode.getAttribute('id1') + '&newlineno=' + theobject.getAttribute('id1'));
window.status = "order '" + theobject.parentNode.getAttribut... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"recalculateLineTotal() {\n this.line_total = (this.quantity * Number(this.price)).toFixed(2).toString();\n }",
"function changeLine() {\n addNewContent('')\n }",
"function changeWorkingLine(action) {\n switch (action) {\n case 'increase':\n gCurrLine++;\n if ... | [
"0.6023332",
"0.58419365",
"0.56493896",
"0.5648343",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.5597097",
"0.557675",
"0.557675",
"0.557675",
"0... | 0.591355 | 1 |
Return true if given rule is an instance of Kindergarten.Rule class | isRule(rule) {
let res = false;
try {
res = (rule instanceof Rule);
} catch (ignore) {
// ignore
}
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isRule(thing) {\r\n return getIriAll(thing, rdf$2.type).includes(acp.Rule);\r\n }",
"function isRule(thing) {\n return getIriAll(thing, rdf.type).includes(acp.Rule);\n}",
"check(rule) {\n if (rule.selector.includes(this.name)) {\n return !!rule.selector.match(this.regexp())\n }\n\n... | [
"0.7139684",
"0.70815724",
"0.6870376",
"0.6870376",
"0.632981",
"0.62277985",
"0.61571735",
"0.60843486",
"0.60843486",
"0.58980083",
"0.57744586",
"0.5640581",
"0.5546256",
"0.5528154",
"0.55082923",
"0.5486427",
"0.5422349",
"0.5386044",
"0.53242636",
"0.52993584",
"0.5297... | 0.8248164 | 0 |
Perform some stuff unguarded | unguarded(callback, context) {
context = context || null;
if (isFunction(callback)) {
const before = this.unguarded;
this.unguarded = true;
callback.apply(context);
this.unguarded = before;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"awaitAndPrematurelyCall(ops){this.awaiting++;ops.map(Y.utils.copyOperation).forEach(this.onevent);}",
"awaitAndPrematurelyCall (ops) {\n this.awaiting++\n ops.map(Y.utils.copyOperation).forEach(this.onevent)\n }",
"onUnrestrict() {}",
"function doNothing() {}",
"function doNothing() {}",
"fu... | [
"0.6125418",
"0.5836956",
"0.56368005",
"0.562356",
"0.562356",
"0.562356",
"0.562356",
"0.562356",
"0.562356",
"0.56067914",
"0.5595773",
"0.5525475",
"0.5481668",
"0.5425911",
"0.5425911",
"0.5425911",
"0.5425911",
"0.5425911",
"0.5425911",
"0.5425911",
"0.5425911",
"0.53... | 0.5838352 | 1 |
def numberPush arr, num arr << num end | function numberPush(arr,num){
arr.push(num)
return arr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pushValues(numToPush, amount, arr, rem){\n for (var i = 0; i < amount; i++){\n arr.push(numToPush);\n \n }\n if (rem !== 0){\n arr.push(rem);\n }\n \n console.log(arr);\n }",
"push(num){\n this.arr.unshift(num);\n this.size +=1;\n this... | [
"0.8020754",
"0.7738946",
"0.7378012",
"0.7370286",
"0.71742237",
"0.7150162",
"0.7021585",
"0.6993726",
"0.6969927",
"0.690761",
"0.68982095",
"0.68917596",
"0.68917596",
"0.68917596",
"0.687793",
"0.68214595",
"0.6711889",
"0.67066056",
"0.6702418",
"0.66935897",
"0.6687417... | 0.89597034 | 0 |
Shows the bootstrap cards using the values from the parameter of the function | showCards(values) {
let obj = "";
for (let i = 0; i < values.length; i++) {
obj += `<div class="card">
<img class="card-img-top" src="https://www.themoviedb.org/t/p/w600_and_h900_bestv2/${values[i].poster_path}"
alt="Card image cap"></img>
<div class="card-body">
<h5 class=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cardDisplay() {\n\n\t\t// commute array holding an object for each commute time frame(daily, weekly, monthly, yearly)\n\t\tlet commute = [{\t\n\t\t\ttimeFrame: 'Daily', \n\t\t\tcommuteTime: `Time: ${dailyCommuteTime}`, \n\t\t\tcommuteDistance: `Distance: ${dailyDistance} miles`, \n\t\t\tcost: `Cost: $${co... | [
"0.73882246",
"0.7156881",
"0.71427584",
"0.69668025",
"0.69387263",
"0.6887044",
"0.6868548",
"0.67510754",
"0.67475855",
"0.67203325",
"0.6674461",
"0.6668243",
"0.6639946",
"0.663192",
"0.66257226",
"0.6623983",
"0.6622304",
"0.66025037",
"0.66009045",
"0.6588532",
"0.6576... | 0.7270179 | 1 |
searches for the string written in the searchbox and shows all the cards whose title contains the string | searchFilm() {
let value = document.getElementById("search").value;
let res = [];
for (let i = 0; i < this.list.length; i++) {
let str = this.list[i].title.toUpperCase();
if (str.search(value.toUpperCase()) >= 0) {
res.push(this.list[i]);
}
}
this.showCards(res);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchButton(e) {\n const searchValue = searchSpace.value.toUpperCase();\n const div = document.querySelectorAll('.card');\n div.forEach(person => {\n let a = person.querySelector('h3');\n if (a.innerHTML.toUpperCase().indexOf(searchValue) > -1) {\n a.parentElement.parent... | [
"0.76609486",
"0.75024337",
"0.7393305",
"0.73003393",
"0.7230408",
"0.7154777",
"0.7034132",
"0.69753945",
"0.6941419",
"0.6939001",
"0.6936642",
"0.69312024",
"0.6888712",
"0.6821985",
"0.6810431",
"0.6803838",
"0.6801677",
"0.68008155",
"0.67915636",
"0.67559344",
"0.67400... | 0.8028912 | 0 |
Match users kinks to see if they are into the same thing. | function matchedDesires(userKinks, partnerKinks) {
if (userKinks.indexOf('any') !== -1 || partnerKinks.indexOf('any') !== -1) {
return true;
}
if (similiarKinks(userKinks, partnerKinks, 1)) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function similiarKinks(userKinks, partnerKinks, similarities) {\n var similar = 0;\n\n for (var i = 0; i < userKinks.length; i++) {\n if (partnerKinks.indexOf(userKinks[i]) !== -1) {\n similar++;\n }\n\n if (similar >= similarities) {\n return true;\n }\n }\n return false;\n}",
"functio... | [
"0.697965",
"0.60844165",
"0.58661586",
"0.58580357",
"0.5854037",
"0.56990945",
"0.5697918",
"0.5663573",
"0.5591732",
"0.55771506",
"0.55715716",
"0.5551958",
"0.5537985",
"0.55186373",
"0.550008",
"0.5499597",
"0.54754657",
"0.5455206",
"0.5442774",
"0.540829",
"0.5400345"... | 0.7386298 | 0 |
Checks if the user and partner share a number of similar kinks. | function similiarKinks(userKinks, partnerKinks, similarities) {
var similar = 0;
for (var i = 0; i < userKinks.length; i++) {
if (partnerKinks.indexOf(userKinks[i]) !== -1) {
similar++;
}
if (similar >= similarities) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchedDesires(userKinks, partnerKinks) {\n if (userKinks.indexOf('any') !== -1 || partnerKinks.indexOf('any') !== -1) {\n return true;\n }\n\n if (similiarKinks(userKinks, partnerKinks, 1)) {\n return true;\n }\n\n return false;\n}",
"function matchedPreferences(user, partner) {\n var match... | [
"0.6875884",
"0.590417",
"0.5729991",
"0.5646493",
"0.5458877",
"0.53810984",
"0.53712577",
"0.53556937",
"0.5346313",
"0.5342485",
"0.53274316",
"0.5325006",
"0.5302186",
"0.52999073",
"0.52984726",
"0.52974725",
"0.52961355",
"0.5287314",
"0.5280501",
"0.5280274",
"0.523346... | 0.80011296 | 0 |
capture image from dashcam and return as Image when ready | async function getLiveImage() {
let url = getDashcamUrl();
console.log(`get live image via ${url}`);
let r = new Request(url);
let image = await r.loadImage();
console.log(`got ${image ? "a valid" : "an invalid"} live image`);
return image;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function captureImage() {\n // Launch device camera application, \n // allowing user to capture up to 2 images\n //console.log('captureImage - start');\n //navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 1});\n //console.log('captureImage - end');\n getImage(); \n}"... | [
"0.7191845",
"0.70159477",
"0.6988576",
"0.69754076",
"0.6963028",
"0.69338965",
"0.6932673",
"0.6924651",
"0.6893807",
"0.68786645",
"0.6790985",
"0.6787083",
"0.6771007",
"0.67686456",
"0.6765136",
"0.6753962",
"0.67455274",
"0.67379755",
"0.67109525",
"0.67109525",
"0.6704... | 0.70784295 | 1 |
get image from iCloud drive for debug | async function getDebugImage(){
let fm = FileManager.iCloud();
// let filePath = fm.joinPath(fm.documentsDirectory(), "DDPai/A_20180810222450.JPG");
// let filePath = fm.joinPath(fm.documentsDirectory(), "DDPai/A_20180922125012.JPG");
// let filePath = fm.joinPath(fm.documentsDirectory(), "DDPai/N_MCfa_20180902... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getImg(image) {\n let folderName = \"Conversable\";\n\n let fm = FileManager.iCloud();\n let dir = fm.documentsDirectory();\n let path = fm.joinPath(dir + \"/\" + folderName, image);\n let download = await fm.downloadFileFromiCloud(path);\n let isDownloaded = await fm.isFileDownloaded(path);\n... | [
"0.70733905",
"0.6651585",
"0.6324762",
"0.6273736",
"0.6040641",
"0.6007735",
"0.593875",
"0.591066",
"0.58827436",
"0.58824515",
"0.5862454",
"0.5827958",
"0.5755267",
"0.57438934",
"0.5733167",
"0.5725956",
"0.57123286",
"0.5676728",
"0.56494594",
"0.5637647",
"0.56182617"... | 0.756643 | 0 |
resize image by the given area factor | function resizeImage(image, factor) {
let perAxisRatio = Math.sqrt(factor);
const w = IMAGE_WIDTH/perAxisRatio;
const h = (IMAGE_HEIGHT-TOP_CROP-BOTTOM_CROP)/perAxisRatio;
let dc = new DrawContext();
dc.opaque = true;
dc.size = new Size(w,h);
// dc.beginDrawing()
dc.drawImageInRect(image, new Rect(0, 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resizeImage() {\n\n\n\n }",
"function scaleSize(img) {\n\t\tif (img.width < MAX_WIDTH && img.height < MAX_HEIGHT) return img;\n\n\t\tif (img.width > MAX_WIDTH) {\n\t\t\timg.height *= MAX_WIDTH / img.width;\n\t\t\timg.width = MAX_WIDTH;\n\t\t}\n\t\tif (img.height > MAX_HEIGHT) {\n\t\t\timg.width *= MA... | [
"0.6826409",
"0.65191275",
"0.6441788",
"0.6401113",
"0.6357282",
"0.62801003",
"0.6217449",
"0.61820745",
"0.61705095",
"0.61406106",
"0.6139284",
"0.60875356",
"0.60813904",
"0.60766715",
"0.60582244",
"0.6050518",
"0.60504913",
"0.60395",
"0.60350096",
"0.6029633",
"0.5975... | 0.67304724 | 1 |
crop image according to the region containg the car. location should be supplied as type Rect (x, y, width, height). factor should match the factor used for scaling the image | function cropImage(image, location, factor) {
let perAxisRatio = Math.sqrt(factor);
let l = new Rect(
Math.round(location.x * perAxisRatio),
Math.round(location.y * perAxisRatio),
Math.round(location.width * perAxisRatio),
Math.round(location.height * perAxisRatio)
);
let dc = new DrawContext();... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cropImage(img,rect) {\n \n let draw = new DrawContext()\n draw.size = new Size(rect.width, rect.height)\n \n draw.drawImageAtPoint(img,new Point(-rect.x, -rect.y)) \n return draw.getImage()\n}",
"initCrop() {\n return this.cropper.crop();\n }",
"function cropImage(image) {\n ... | [
"0.59840053",
"0.5857581",
"0.5834786",
"0.58284515",
"0.5810272",
"0.5693004",
"0.5652219",
"0.5571673",
"0.54430765",
"0.5388519",
"0.5388145",
"0.5380032",
"0.5349013",
"0.5308567",
"0.530496",
"0.5275944",
"0.5248963",
"0.52228963",
"0.5204091",
"0.5197228",
"0.5187418",
... | 0.8060489 | 0 |
startPoint3D Vector3D k number index number radius number solutionFlag number | function getVerticalShiftPosition(startPoint3D, k, index, radius, solutionFlag) {
var x1,y1,b,r;
x1 = startPoint3D.x;
y1 = startPoint3D.y;
b = y1-x1*k;
var calIndex = Math.floor((index+1)/2);
r = (calIndex-1)*2*radius+radius;
if(r===0)
return startPoint3D;
var A,B,C;
A = 1+k... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCylinderPosition(startPoint3D,endPoint3D,index,radius)\n{\n var startPoint = new Vector3D();\n startPoint.x = startPoint3D.x;\n startPoint.y = startPoint3D.y;\n radius*=1;\n var endPoint = new Vector3D();\n endPoint.x = endPoint3D.x;\n endPoint.y = endPoint3D.y;\n\n var x1,y1,x2... | [
"0.6219041",
"0.5894951",
"0.5729624",
"0.5724031",
"0.55079186",
"0.54757154",
"0.5473726",
"0.5469456",
"0.5468041",
"0.5461281",
"0.53578854",
"0.52628124",
"0.52525204",
"0.524207",
"0.52369523",
"0.5197394",
"0.5177741",
"0.5163465",
"0.51500887",
"0.5146653",
"0.5124385... | 0.65487605 | 0 |
startPointVector Vector3D endPointVector Vector3D index number radius number | function getCylinderPosition(startPoint3D,endPoint3D,index,radius)
{
var startPoint = new Vector3D();
startPoint.x = startPoint3D.x;
startPoint.y = startPoint3D.y;
radius*=1;
var endPoint = new Vector3D();
endPoint.x = endPoint3D.x;
endPoint.y = endPoint3D.y;
var x1,y1,x2,y2,k,b,r;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calcRadius() {\n return Math.sqrt( Math.pow(this.start[0] - this.center[0], 2) + Math.pow(this.start[1], 2) );\n }",
"function calculateTargetCoords(totalPoints, iStart, radius) {\n\n var pointArray = [];\n\n for (var i = iStart; i < totalPoints; i++) {\n\n var coord = getPoint(radius, i, totalP... | [
"0.69197834",
"0.618674",
"0.6141579",
"0.6064011",
"0.59268296",
"0.5780872",
"0.5771084",
"0.5752232",
"0.573252",
"0.5716643",
"0.56922203",
"0.5677696",
"0.5657016",
"0.5657016",
"0.56199753",
"0.56136894",
"0.55923045",
"0.558126",
"0.55656856",
"0.55536544",
"0.5552434"... | 0.6454552 | 1 |
this is my new empty array for my animal friends list. i chose it so that we could push the result of our random mathy thing into it | function getRandom(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
friends.push(animals[( Math.floor(Math.random() * (max - min + 1)) + min)].name);
//animals[( Math.floor(Math.random() * (max - min + 1)) + min)].friends = friends;
//i was trying to be all cool here and add the friend to a random ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mutateArray() {\n var size= 5+Math.ceil(Math.random()*20);\n myArray= [];\n for (i=0; i<size; i++) {\n myArray.push(Math.ceil(Math.random()*100));\n }\n showArray();\n}",
"function hody(){\nreturn [(Math.floor(Math.random()*6)),(Math.floor(Math.random()*6))];\n}",
"function addFr... | [
"0.64773124",
"0.6443648",
"0.64366686",
"0.6258506",
"0.61315006",
"0.61186",
"0.60917276",
"0.6073087",
"0.6065739",
"0.60154194",
"0.6014977",
"0.60110015",
"0.6004631",
"0.59914595",
"0.598446",
"0.5982999",
"0.5976265",
"0.5971646",
"0.5943579",
"0.5941559",
"0.59412736"... | 0.67921144 | 0 |
displays the player as a green square | function drawPlayer() {
fill(fillRed, fillGreen, fillBlue);
noStroke();
rect(posX, posY, 60, 60);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayPlayer() {\n push();\n noStroke();\n fill(player.color);\n ellipse(player.x, player.y, player.size);\n pop();\n}",
"function renderPlayer() {\r\n screenCtx.beginPath();\r\n screenCtx.arc(player.x * 64 + 32, player.y * 64 + 32, 30, 0, Math.PI * 2);\r\n screenCtx.fill();\r\n }",
"f... | [
"0.8030264",
"0.737087",
"0.737087",
"0.7334245",
"0.7331381",
"0.7326687",
"0.7297299",
"0.7269223",
"0.7143289",
"0.7125103",
"0.7079644",
"0.70450324",
"0.6971361",
"0.69525933",
"0.69514126",
"0.692883",
"0.69187284",
"0.6909094",
"0.6883136",
"0.6862124",
"0.6859131",
... | 0.74930745 | 1 |
Capturando o microtime atual | function microtime (get_as_float) {
var now = new Date().getTime() / 1000;
var s = parseInt(now, 10);
return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function microtime(){\r\n return new Date().getTime();\r\n}",
"function microtime(get_as_float){\n var unixtime_ms = new Date().getTime();\n var sec = parseInt(unixtime_ms / 1000);\n return get_as_float ? (unixtime_ms/1000) : (unixtime_ms - (sec * 1000))/1000 + ' ' + sec;\n}",
"function microSecond... | [
"0.79684716",
"0.7353353",
"0.68320554",
"0.67786413",
"0.6769053",
"0.66646266",
"0.65824646",
"0.6573983",
"0.65280646",
"0.6520725",
"0.6505997",
"0.649381",
"0.64868337",
"0.64831007",
"0.64770997",
"0.6435703",
"0.63842875",
"0.6364207",
"0.6345734",
"0.633545",
"0.62900... | 0.76870966 | 1 |
This theme uses a fixed header. This code prevents a target from disappearing behind the header if activated by an anchor. Check any href for an anchor. If exists, and in document, scroll to it. If href argument omitted, assumes context (this) is HTML Element, which will be the case when invoked by jQuery after an even... | function scroll_if_anchor(href) {
href = typeof (href) === "string" ? href : jQuery(this).attr("href");
// If href missing, ignore
if (!href) return;
// get the height of the header including borders, padding and margin.
var fromTop = jQuery("header").outerHeight(true) + 20;
var $target = jQuery(href);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scroll_if_anchor(href) {\n href = typeof(href) == \"string\" ? href : $(this).attr(\"href\");\n\n // You could easily calculate this dynamically if you prefer\n var fromTop = 0;\n\n // If our Href points to a valid, non-empty anchor, and is on the same page (e.g. #foo)\n ... | [
"0.72499347",
"0.7199782",
"0.7073276",
"0.6880594",
"0.6791117",
"0.6762036",
"0.6668028",
"0.66561306",
"0.6621443",
"0.6557518",
"0.64650595",
"0.64633197",
"0.64633197",
"0.64620036",
"0.6460672",
"0.6447519",
"0.64436334",
"0.6439671",
"0.64123046",
"0.6389684",
"0.63805... | 0.7427111 | 0 |
changes tabs to accordion (jQuery UI tabs to Bootstrap accordion) inspired by | function tabsToAccordions() {
jQuery("#tabs").each(function () {
var e = jQuery('<div id="accordion" class="panel-group">');
var t = new Array;
jQuery(this).find(">ul>li").each(function (index) {
jQuery("a", this).attr({
"data-toggle": "collapse",
"data-parent": "#accordion",
"data-target"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function accordionIt(a) {\n var current = $(\".active\", a).html();\n if (!$(a).is('.-single')) {\n a.prepend(\"<button class='accordion-wrap-trigger'>\" + current);\n }\n $(\".accordion-wrap-trigger\", a).click(function (e) {\n e.preventDefault();\n $('.tabs', a).toggleClass(\"ope... | [
"0.70754856",
"0.6774468",
"0.6645846",
"0.6567216",
"0.65581405",
"0.6536697",
"0.6527674",
"0.65204304",
"0.6486598",
"0.64593625",
"0.64153564",
"0.6372526",
"0.6346164",
"0.633541",
"0.63179576",
"0.63170284",
"0.63010454",
"0.6291078",
"0.6269889",
"0.6241042",
"0.623010... | 0.75389016 | 0 |
The Loq Function is alternative to console.log so that it remain in sync with readLineInterface | function log () {
// let current = readLineInterface;
// if (readLineInterface) {
// readLineInterface.clearLine();
// readLineInterface.close();
// global.readLineInterface = undefined;
// }
for (let i = 0, len = arguments.length; i < len; i++) {
console.log(arguments[i]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"readLine(test){\n this.emit(this.eventsDic.initStart);\n let rl;\n \n // check if test mode\n if(!test){\n rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n }\n\n // start tip... | [
"0.6172402",
"0.5950806",
"0.57328755",
"0.5723639",
"0.5723639",
"0.5604811",
"0.5602609",
"0.55774766",
"0.5519782",
"0.55025035",
"0.5475121",
"0.5471108",
"0.5464537",
"0.5435656",
"0.54310554",
"0.5430078",
"0.5404231",
"0.54007155",
"0.53624046",
"0.5357056",
"0.5348183... | 0.7405187 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.