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 |
|---|---|---|---|---|---|---|
Create a global variable foo function and foo.count are both different. because foo function used this, it doesn't mean it can use count | function foo(num) {
console.log("foo: " + num);
this.count++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function foo2(num) {\n console.log(\"foo: \" + num);\n\n data.count++;\n}",
"function foo(num) {\r\n console.log(\"foo: \" + num);\r\n // keep track of how many times called...\r\n this.count++;\r\n}",
"function counters(){\n counters.count++;\n}",
"count() {}",
"function counter () {\n let coun... | [
"0.7209815",
"0.69253105",
"0.6673526",
"0.66255176",
"0.65381503",
"0.6536314",
"0.638025",
"0.63748866",
"0.63711876",
"0.6312427",
"0.6265321",
"0.62269276",
"0.62151974",
"0.6209553",
"0.6182857",
"0.6173074",
"0.6128157",
"0.6118511",
"0.6099301",
"0.6099152",
"0.6082883... | 0.7209225 | 1 |
This function adds a 'TSFormBot' menu to the active form when opened | function onOpen() {
FormApp.getUi().createMenu('TSFormBot')
.addItem('🕜 Enable Bot', 'TSFormBot.enableBot')
.addToUi();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onOpen(){\n var ui=SpreadsheetApp.getUi();\n var menu = ui.createMenu(\"FMV Tracker\");\n \n var labSubMenu = ui.createMenu(\"Labelers\");\n labSubMenu.addItem(\"Attempt\", \"showFormAttempt\");\n labSubMenu.addItem(\"R0\", \"showFormR0\");\n labSubMenu.addItem(\"R1\", \"showFormR1\");\n labSubMen... | [
"0.688603",
"0.6826206",
"0.6644354",
"0.6348365",
"0.63074505",
"0.62964267",
"0.6269782",
"0.61344486",
"0.6123484",
"0.61175895",
"0.60970336",
"0.6071256",
"0.606346",
"0.6052755",
"0.60308784",
"0.60160714",
"0.6011081",
"0.6002301",
"0.600046",
"0.5992505",
"0.5991312",... | 0.78380376 | 0 |
This function will return a random card index based on the availableCards passed in. | function getRandomCard(availableCards) {
// Get the number of total cards
const totalCards = getAvailableCardSize(availableCards);
if (totalCards === 0) {
return;
}
const randomCardNumber = Math.floor(Math.random() * totalCards);
let temp = 0; let
drawedCard;
for (const key in availableCards) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static generateRandomCardIndex() {\n return Math.floor(Math.random() * Math.floor(maxCard));\n }",
"function selectRandom(cards){\n // we need an integer in [0,cards.length]\n index=Math.floor(Math.random()*cards.length); // multiply by cards.length and floor\n return cards[index]; // return card at... | [
"0.8194946",
"0.7451728",
"0.74063927",
"0.73665017",
"0.73511213",
"0.732853",
"0.72268426",
"0.7147854",
"0.7091851",
"0.6928539",
"0.69249386",
"0.68359774",
"0.67911774",
"0.6787987",
"0.67405164",
"0.66964334",
"0.6690443",
"0.66854167",
"0.66692513",
"0.6635883",
"0.658... | 0.75428 | 1 |
Test submitting with no file attached to the request. | function testSubmitNoFile() {
file = null;
onSubmit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testSubmitBadFile() {\n let f_req = new XMLHttpRequest();\n f_req.responseType = 'arraybuffer';\n\n\tf_req.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n file = new File([this.response], 'btest.txt');\n onSubmit();\n }\n ... | [
"0.67906487",
"0.6690106",
"0.6644165",
"0.62134",
"0.6173579",
"0.6142644",
"0.6116272",
"0.6116272",
"0.6115174",
"0.6048795",
"0.5929491",
"0.5914126",
"0.5884154",
"0.586702",
"0.5837116",
"0.5836293",
"0.58360887",
"0.57796687",
"0.5775557",
"0.5763285",
"0.57621723",
... | 0.7918087 | 0 |
Test submitting with an example file attached. | function testSubmitFile() {
testAddFile();
onSubmit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testSubmitBadFile() {\n let f_req = new XMLHttpRequest();\n f_req.responseType = 'arraybuffer';\n\n\tf_req.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n file = new File([this.response], 'btest.txt');\n onSubmit();\n }\n ... | [
"0.6090914",
"0.6003825",
"0.5668676",
"0.5650947",
"0.546431",
"0.5450274",
"0.5449536",
"0.54199004",
"0.5402574",
"0.5385095",
"0.5367473",
"0.5363152",
"0.5319987",
"0.53063637",
"0.52920115",
"0.5271527",
"0.5253591",
"0.52477527",
"0.52476996",
"0.5242859",
"0.5235503",... | 0.7181472 | 0 |
Adds listener for 'other' elements at the end of answer list | function addOtherListener(question, element)
{
var newIndex = Number(element.attr('id').split('-')[1]);
var otherCount = newIndex + 1;
var newId = 'other-'+ newIndex;
var lastId = 'other-'+ otherCount;
var questionId = question.attr('id').split('-')[1];
var questionType = question.attr('type');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function endOfQuestions() {\n $('body').on('click', '#next', (event) => {\n STORE.currentQuestion === STORE.questions.length ? showResults() :\n displayQuestion();\n });\n}",
"function addListeners(){\n var allQuestions = document.getElementsByClassName(\"question-info\");\n var lastQuest... | [
"0.5857716",
"0.5844726",
"0.54804546",
"0.5430506",
"0.5384551",
"0.53748953",
"0.53668374",
"0.5321726",
"0.53100806",
"0.52839553",
"0.5279989",
"0.5258411",
"0.5246104",
"0.5244061",
"0.5207397",
"0.51836497",
"0.5174058",
"0.51611155",
"0.5152825",
"0.5149343",
"0.512789... | 0.7077548 | 0 |
Adds listener on the given element associated to the given question | function addElementListener(question, element, checked)
{
var questionId = question.attr('id').split('-')[1];
if (question.attr('type') == 1)
addCheckboxListener(question, element, questionId);
else
addRadioListener(question, element, questionId);
element.prop('checked', checked);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addOtherListener(question, element)\n{\n var newIndex = Number(element.attr('id').split('-')[1]);\n var otherCount = newIndex + 1;\n var newId = 'other-'+ newIndex;\n var lastId = 'other-'+ otherCount;\n var questionId = question.attr('id').split('-')[1];\n var questionType = question.at... | [
"0.69291633",
"0.6748337",
"0.66519785",
"0.64200926",
"0.5976917",
"0.589985",
"0.5849146",
"0.58309674",
"0.57500654",
"0.5735311",
"0.56972384",
"0.56419814",
"0.5614279",
"0.5607673",
"0.5603005",
"0.5600617",
"0.5590852",
"0.55890894",
"0.5547039",
"0.5519915",
"0.551615... | 0.82280403 | 0 |
Adds listener for the given checkbox | function addCheckboxListener(question, checkbox, questionId)
{
checkbox.on('change', function() {
//console.log('Checkbox changed for question '+questionId);
var valid = $('[answersto='+ questionId +']').prop('checked');
setField(question, valid);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCheckBoxListener(){\n\n $(\"input:checkbox\").on('click', function() {\n\n var $box = $(this);\n if ($box.is(\":checked\") ) {\n\n var group = \"input:checkbox[name='\" + $box.attr(\"name\") + \"']\";\n\n if($box.attr(\"name\") != 'topping'){\n ... | [
"0.70734096",
"0.6978266",
"0.6959221",
"0.694262",
"0.6913922",
"0.6892068",
"0.68602407",
"0.68317527",
"0.68168974",
"0.6810232",
"0.67369854",
"0.6580512",
"0.6537934",
"0.64948946",
"0.6476426",
"0.6437384",
"0.6323542",
"0.6278822",
"0.6260141",
"0.6260141",
"0.6189839"... | 0.7535163 | 0 |
Verifies form validity and apply it | function verifyForm()
{
valid = true;
validFields.forEach(function(element) { valid &= element });
changeFormState(valid);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formValidate(form) {\n function camelCase(string) {\n string = string||'';\n string = string.replace(/\\(|\\)/,'').split(/-|\\s/);\n var out = [];\n for (var i = 0;i<string.length;i++) {\n if (i<1) {\n out.push(string[i].toLowerCase());\n } else {\n out.push(string[i][... | [
"0.67679244",
"0.6712909",
"0.6547254",
"0.65023357",
"0.6498144",
"0.6438087",
"0.6435993",
"0.64266145",
"0.6413119",
"0.64031756",
"0.639827",
"0.63952",
"0.63901997",
"0.6327702",
"0.63232833",
"0.6263159",
"0.62532115",
"0.62530065",
"0.6237791",
"0.6236344",
"0.6230585"... | 0.7109816 | 0 |
function used to set a new selection. it upadates the img in the top left, set slider day filter to 0 and logs selected img info | function NewSelection(newmainphotonbr, movecarousel){
if (newmainphotonbr != undefined) {
//set slider to all days
var SliderValue = 0;
document.getElementById('slider-start').value = SliderValue;
//filterBy(SliderValue);
//copie varibles from previously selected phototo new... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selected(d){\n\tcount = d;\n\tupdateImage();\n\tdots();\n}",
"function start()\n{\n\tselected = filter;\n\tx_elem = x_pos - selected.offsetLeft;\n\ty_elem = y_pos - selected.offsetTop;\n}",
"function settingImage()\r\n\t{\r\n\t\t\r\n\t\t\t$('.control-section').html(g_search_info_level2.currentsection)... | [
"0.6760909",
"0.66123015",
"0.6503174",
"0.64521956",
"0.63947123",
"0.63579255",
"0.630244",
"0.62663615",
"0.6232982",
"0.6202957",
"0.6165114",
"0.61255723",
"0.61255693",
"0.60773534",
"0.606187",
"0.6059226",
"0.60341305",
"0.60319066",
"0.60228693",
"0.6020905",
"0.6014... | 0.7099979 | 0 |
function used to log the selected foto info to the consol | function writephotovars(){
console.log("selected photo info:");
console.log(selectedphoto);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getImageInfo() {\n\n}",
"function mycallback() {\n // either call the ImageInfo.getAllFields([file]) function which returns an object holding all the info\n alert(\n \"All info about this file: \" + ImageInfo.getAllFields(file)\n );\n // or call ImageInfo.getField([file], [field]) to get a... | [
"0.57164836",
"0.5597549",
"0.55346245",
"0.54898614",
"0.5422363",
"0.5313708",
"0.5284506",
"0.52724665",
"0.527112",
"0.52697307",
"0.5245874",
"0.52410334",
"0.5239612",
"0.5223863",
"0.5218342",
"0.5206482",
"0.51996505",
"0.51880294",
"0.5173734",
"0.5158916",
"0.514112... | 0.63470316 | 0 |
function to add event listener to HTML range slider to be used as a day selector | function SliderListener() {
document.getElementById('slider-start').addEventListener('input', function(e) {
//code to be executed when event listener is triggerd
var SliderValue = "" + parseInt(e.target.value, 10) + "" //create vare with range slider value
filterBy(SliderValue); //trigger F... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_rangeChanged() {\n this.dispatchEvent(new CustomEvent(\"range-changed\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this\n }));\n }",
"function onDatePick() {\n calRadioGroupSelectItem(\"view-field\", \"custom-range\");\n refre... | [
"0.6517169",
"0.6510765",
"0.64697367",
"0.6335789",
"0.6288793",
"0.628109",
"0.6193067",
"0.6132467",
"0.6128424",
"0.61112",
"0.6054015",
"0.6003844",
"0.5968527",
"0.596699",
"0.5965967",
"0.5949143",
"0.5919394",
"0.59058887",
"0.5846236",
"0.5809824",
"0.5786173",
"0.... | 0.69621515 | 0 |
Loading geojson sources for layers to display them | function LoadGEOJsonSources() {
map.addSource('Scotland-Foto', {
"type": "geojson",
"data": "https://daanvr.github.io/Schotland/geojson/Scotrip-FotoDataFile-RichOnly-Live.geojson"
});
map.addSource('Scotland-Routes', {
"type": "geojson",
"data": "https://daanvr.github.io/Scho... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17... | [
"0.71111524",
"0.70338726",
"0.69734037",
"0.6918469",
"0.6864646",
"0.6861692",
"0.68416965",
"0.6829035",
"0.6797226",
"0.6788697",
"0.6743446",
"0.66926366",
"0.66370815",
"0.65825295",
"0.65619636",
"0.6546633",
"0.6544286",
"0.65013444",
"0.64961153",
"0.6490668",
"0.648... | 0.83940125 | 0 |
Displaying geojson data from the previously laoded sources | function DisplayGEOJsonLayers(){
map.addLayer({
//photos layer
"id": "photos",
"type": "symbol",
"source": "Scotland-Foto",
"layout": {
"icon-image": "CustomPhoto",
"icon-size": 1,
"icon-offset": [0, -17],
"icon-padding": 0,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayGeojson(dataIn) {\n var routeLayer = new google.maps.Data();\n //routeLayer.setMap(null);\n var geojsonURL1 = 'http://localhost:9000/routeserver/';\n var geojsonURL2 = 'TMRoutes?=format%3Djson&format=json&rte=';\n var geojsonRteURL = dataIn;\n routeLayer.loadGeoJson(geojsonURL1 + geojsonURL2 ... | [
"0.7182297",
"0.70886886",
"0.7084978",
"0.7049942",
"0.70362926",
"0.6945233",
"0.69304454",
"0.6920923",
"0.69122696",
"0.6897173",
"0.68864733",
"0.68489987",
"0.68464124",
"0.68120265",
"0.6753069",
"0.67353475",
"0.66924405",
"0.665695",
"0.6641088",
"0.66364545",
"0.663... | 0.72917837 | 0 |
making "clickble" layers on the map change the mouse cursor. This helps the user see an map item is clickble. | function ClickbleMapItemCursor(){
//changes cursor style when hovering "clickable" layer.
map.on("mousemove", "photos", function(e) {map.getCanvas().style.cursor = 'pointer';});
map.on('mouseleave', "photos", function() {map.getCanvas().style.cursor = '';});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeCursor (evt) {\n\t\t\t\tif (evt.dragging) { return;}\n\t\t\t\tvar pixel = GlobalMap.getEventPixel(evt.originalEvent);\n\t\t\t\tvar hit = GlobalMap.hasFeatureAtPixel(pixel, {layerFilter: function(layer){\n\t\t\t\t\treturn isEditLayerPopupOnInfo || layer.get('name') !== 'EditLayer';\n\t\t\t\t}});\n\t\... | [
"0.70169",
"0.67457",
"0.6710764",
"0.662335",
"0.65457916",
"0.6516092",
"0.6450354",
"0.64119655",
"0.6380536",
"0.62834054",
"0.6245037",
"0.6236321",
"0.6235623",
"0.6235623",
"0.6214655",
"0.61990565",
"0.6189546",
"0.6173861",
"0.6138929",
"0.6136339",
"0.612475",
"0.... | 0.8396477 | 0 |
This function returns a random word from the list in `src/dictionary.js`. You do not need to update or edit this function. Instead, you only need to call it from the `run()` function. | function getRandomWord() {
const index = Math.floor(Math.random() * dictionary.length);
return dictionary[index];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RandomWord() {\n var wordRandom = Math.floor(Math.random() * (wordList.length));\n return wordList[parseInt(wordRandom)];\n}",
"function getRandomWord() {\n return words[Math.floor(Math.random() * words.length)];\n}",
"function getRandomWord() {\n return words[Math.floor(Math.random() * words.... | [
"0.8611322",
"0.8522228",
"0.8522228",
"0.85207313",
"0.849178",
"0.84494317",
"0.844368",
"0.843871",
"0.8438667",
"0.84156936",
"0.8408839",
"0.8405642",
"0.83204824",
"0.82992166",
"0.82971257",
"0.82683986",
"0.82513213",
"0.824313",
"0.8213436",
"0.8207201",
"0.8177485",... | 0.881708 | 0 |
Complement chart data by adding empty data point and then sort it | complementData(chartData, hasCountMonth) {
var zeroCountMonth = [];
var minDate = cloudberry.parameters.timeInterval.start;
var maxDate = cloudberry.parameters.timeInterval.end;
// add empty data point
for (var m = new Date(minDate.getFullYear(), minDate.getMonth()); m <= new Da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortChart () {\n // Ascending or descending data\n if (this.dataset.status >= 0) {\n this.dataset.status = -1\n data.sort(function (a, b) {\n return a.value - b.value\n })\n } else {\n this.dataset.status = 1\n data.sort(function (a, b) {\n return b.value - ... | [
"0.66654384",
"0.6657458",
"0.6416064",
"0.6325152",
"0.6267905",
"0.6210943",
"0.61877245",
"0.60800016",
"0.59345865",
"0.5905456",
"0.58818567",
"0.5853525",
"0.5842422",
"0.58415085",
"0.58349603",
"0.5814631",
"0.5787785",
"0.57873005",
"0.57787985",
"0.5755616",
"0.5741... | 0.70569164 | 0 |
Preprocess query result to chart data could be used by chart.js The `queryResult` is group by month, after prepocess it is still group by month. | preProcessByMonthResult(queryResult) {
var chartData = [];
var hasCountMonth = [];
for (var i = 0; i < queryResult.length; i++) {
var thisMonth = new Date(queryResult[i].month.split(("-"))[0], queryResult[i].month.split(("-"))[1] - 1);
hasCountMonth.push(thisMonth);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"preProcessByDayResult(queryResult, groupBy) {\n switch (groupBy) {\n case \"day\":\n queryResult = this.fillEmptyDayPoints(queryResult);\n // replace key name \"day\" with \"x\" and value name \"count\" with \"y\"\n let resultByDay = [];\n queryResult.for... | [
"0.7747476",
"0.62816435",
"0.6000886",
"0.5994257",
"0.5787331",
"0.57033056",
"0.5675022",
"0.5515476",
"0.55126053",
"0.5350205",
"0.53459036",
"0.52803093",
"0.5264343",
"0.5240021",
"0.5193603",
"0.5182218",
"0.51202995",
"0.5113089",
"0.5112149",
"0.50918525",
"0.508880... | 0.8707334 | 0 |
Preprocess query result to chart data could be used by chart.js The `queryResult` is group by day, preprocess it into given groupBy result. | preProcessByDayResult(queryResult, groupBy) {
switch (groupBy) {
case "day":
queryResult = this.fillEmptyDayPoints(queryResult);
// replace key name "day" with "x" and value name "count" with "y"
let resultByDay = [];
queryResult.forEach(function (elemen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"preProcessByMonthResult(queryResult) {\n var chartData = [];\n var hasCountMonth = [];\n for (var i = 0; i < queryResult.length; i++) {\n var thisMonth = new Date(queryResult[i].month.split((\"-\"))[0], queryResult[i].month.split((\"-\"))[1] - 1);\n hasCountMonth.push(thisMon... | [
"0.7136245",
"0.58385026",
"0.5785842",
"0.5620259",
"0.5530199",
"0.5423375",
"0.53291833",
"0.5286947",
"0.51817214",
"0.51814926",
"0.51220673",
"0.5074586",
"0.5056232",
"0.4994732",
"0.49599773",
"0.49496776",
"0.49095833",
"0.48823005",
"0.48563096",
"0.4854445",
"0.485... | 0.8002823 | 0 |
filter out chartData that before given start, to reduce the long prefix of 0's in trend chart | filterChartData(chartData, start) {
var result = [];
for (var i = 0; i < chartData.length; i ++) {
if (chartData[i].x > start) {
result.push(chartData[i]);
}
}
result.sort(function (previousVal, currentVal) {
return previousVal.x - currentVal.x;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeZeros(data) {\n $.each(data.datasets, function (i, dataset) {\n arraylength = dataset.data.length;\n $.each(dataset.data, function (i, number) {\n if (number > 0)\n valueindex = (i + 1);\n if (i == (arraylength - 1))\n lastvalueind... | [
"0.61291915",
"0.5973228",
"0.5973228",
"0.5923025",
"0.57462186",
"0.55943626",
"0.55726486",
"0.54467463",
"0.5406697",
"0.5395582",
"0.5299355",
"0.5297506",
"0.5269366",
"0.5247021",
"0.52460986",
"0.51767004",
"0.51569897",
"0.5150738",
"0.51359206",
"0.51082754",
"0.506... | 0.6982571 | 0 |
Configure the multiline chart: whether show the lable/grid or not in chart. | multiLineChartConfig(chartData, chartDataColors, displayLable, yLabel, displayGrid, groupBy) {
var datasets = [];
for (var i = 0; i < chartData.length; i ++) {
datasets.push({
lineTension: 0,
data: chartData[i],
borderColor: chartDataColors[i],
b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lineOptions(labels = []) {\n return{\n responsive: true,\n maintainAspectRatio: true,\n animation: {\n duration: 0,\n },\n legend: {\n // display: false\n labels: {\n filter: (item, chart) => {\n if (item.text) return !item.text.includes('none');\n ret... | [
"0.62310797",
"0.5940063",
"0.5887723",
"0.5840429",
"0.5812388",
"0.58008844",
"0.57805777",
"0.5769296",
"0.5758775",
"0.5659643",
"0.5652583",
"0.56285745",
"0.5628468",
"0.5628176",
"0.5619529",
"0.5619529",
"0.5595299",
"0.5563546",
"0.5515872",
"0.5494614",
"0.54807514"... | 0.65499187 | 0 |
Retrieves a list of all sites in the CM sytem. | function getSites(force, callback)
{
if(force) _cache.sites = null;
if(_cache.sites != null && _cache.sites != 'undefined')
{
callback(this, $.merge([], _cache.sites));
return;
}
$.PercServiceUtils.makeJsonRequest(
$.perc_paths.SITES_ALL +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getComscoreSites(cb) {\n //get all sites /sites\n let self = this;\n this.getGlobalConfig((err) => {\n if (err) cb(err);\n let sites = [];\n self.services.forEach((row) => {\n sites.push('/sites/' + row.site);\n });\n cb(nul... | [
"0.70524687",
"0.67187005",
"0.6639812",
"0.64956397",
"0.641623",
"0.6270276",
"0.6051968",
"0.595807",
"0.5943886",
"0.5825867",
"0.58140975",
"0.5770887",
"0.5762734",
"0.5721752",
"0.5670159",
"0.5568286",
"0.5553776",
"0.5552357",
"0.5544498",
"0.54564506",
"0.54334927",... | 0.69400305 | 1 |
Based on a template id in the current site, return all assigned sites. | function getAssignedSitesByTemplate(templateid)
{
var temp = _getAssignedTemplateById(templateid);
if(temp == null) return [];
var sites = temp.getAssignedSites();
if(sites == null || sites == 'undefined') return [];
return sites;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSites () {\n $.getJSON(\"../monitoring/getSites\", (sites) => {\n sites.forEach((x) => { sites_list[x.site_code] = x.site_id; });\n });\n}",
"function getOwnSites(userID) {\n commonService\n .getUserSites(userID)\n .then(function (response) {\n ... | [
"0.5743201",
"0.52384007",
"0.52267843",
"0.50596136",
"0.5029002",
"0.49672574",
"0.49657327",
"0.49210998",
"0.48465315",
"0.48336175",
"0.48311618",
"0.4822633",
"0.4817128",
"0.48170003",
"0.48139498",
"0.47621343",
"0.4754831",
"0.47033414",
"0.46985438",
"0.46978596",
"... | 0.8045391 | 0 |
Will indicate if the current ui is dirty (i.e. changes were made and not persisted). | function isDirty()
{
return getTemplates("dirty").length > 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkIsDirty() {\r\n if( this.state.isDirty ){\r\n this.setState({showDialog: true});\r\n } else {\r\n this.cancelCreate();\r\n }\r\n }",
"isDirty() {\r\n\r\n // resume\r\n return false;\r\n }",
"get dirty() {\n return !this.pristine;\n }",
... | [
"0.67378986",
"0.67046636",
"0.66754866",
"0.66754866",
"0.66754866",
"0.66754866",
"0.66754866",
"0.66754866",
"0.66754866",
"0.6655791",
"0.6655791",
"0.6655791",
"0.6655791",
"0.6655791",
"0.6655791",
"0.6525282",
"0.6517662",
"0.65083843",
"0.6474704",
"0.6413738",
"0.633... | 0.7197742 | 0 |
Rename a template in the current site. | function renameTemplate(templateId, name)
{
if(name == "" || name == null)
{
var defMsg = "Template names can not be blank.";
$.perc_utils.alert_dialog(
{
title: 'Error',
content: defMsg
});
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"rename(oldPath, newPath) {\n return this.services.contents.rename(oldPath, newPath);\n }",
"function writeFile(file, containerName, templateFilePath, newFilesPath) {\n let filename = file;\n if (file === 'VIEW_NAME.tsx') {\n filename = `${containerName}.tsx`;\n }\n const contents = f... | [
"0.53696126",
"0.52784556",
"0.52562004",
"0.5218435",
"0.51978475",
"0.518812",
"0.51462483",
"0.50887144",
"0.50504977",
"0.5045255",
"0.5033289",
"0.5033289",
"0.5012965",
"0.50100905",
"0.49866363",
"0.4977331",
"0.49711534",
"0.4967396",
"0.49539185",
"0.49480912",
"0.49... | 0.7396416 | 0 |
Creates a new template from a URL for the site selected invoking the corresponding service. | function createTemplateFromUrl(url, postCreationCallback)
{
// Get the current selected site form the PercNavigationManager
var currentSiteName = $.PercNavigationManager.getSiteName();
// Holds the information needed to redirect the user to the template editor, the object
// will be ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createTemplateFromUrl(url, sitename, callback)\n {\n var serviceParam = {\n \"SiteTemplates\": {\n \"importTemplate\": [{\n \"url\": url,\n \"siteIds\": [sitename]\n }]\n }\n };\n\n // Redefin... | [
"0.7487738",
"0.6711764",
"0.62059134",
"0.5981819",
"0.57237685",
"0.5699564",
"0.5610253",
"0.557654",
"0.5572469",
"0.54947954",
"0.5494376",
"0.54918545",
"0.54099965",
"0.5381211",
"0.53767395",
"0.5353298",
"0.53496176",
"0.5339184",
"0.53367555",
"0.53367555",
"0.53367... | 0.71862805 | 1 |
Retrieves the pageId for the recently created page. We need it for a memento object that will open the template editor using the corresponding page | function getPagetIdFromTemplate(XHRstatus, percPageServiceData)
{
var querystring = $.deparam.querystring();
// Add the last element needed in the memento and redirect
memento.pageId = percPageServiceData.firstItemId;
$.PercNavigationManager.goToLocation(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getPageID() {\n if (!window.pageJson) return 0;\n return window.pageJson.campaignPageId;\n }",
"function getContentID() {\n if (!currentContentID) updateContentID(); // Ensure contentID is populated, even if late.\n return currentContentID;\n}",
"get page() {\n\t\treturn this.content[this.i];\n\t}",
... | [
"0.6631231",
"0.5615521",
"0.5561314",
"0.5523795",
"0.5475805",
"0.5447852",
"0.54138494",
"0.535516",
"0.535516",
"0.5317735",
"0.5317735",
"0.5317735",
"0.52985746",
"0.5278479",
"0.52757305",
"0.5229003",
"0.5223254",
"0.5213974",
"0.52062327",
"0.520326",
"0.5197655",
... | 0.66636175 | 0 |
This implementation of popAt allows for "interior" stacks to be maintained at less than full capacity. Keeping the interior stacks full at all times would require significantly more logic | popAt(index) {
if (this.stacks[index] === undefined) return new Error;
this.stacks[index].pop();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"popAt(stackIndex) {\n if(this.stackSet[stackIndex] === \"undefined\"){\n return undefined;\n }\n if(stackIndex === this.stackSet.length - 1){\n if(this.stackSet[stackIndex].data.length === 0){\n return undefined;\n }else{\n let poppedElementLast = this.stackSet[s... | [
"0.731822",
"0.705728",
"0.6931264",
"0.6919106",
"0.68829",
"0.6809059",
"0.6781807",
"0.6777046",
"0.6705292",
"0.6633653",
"0.6606055",
"0.659332",
"0.65666705",
"0.65437746",
"0.6505708",
"0.64941573",
"0.63809305",
"0.63809305",
"0.63747823",
"0.6364662",
"0.6334342",
... | 0.7361732 | 0 |
Function to initialize Screen for the NewGame Only character to be chosen are visible | function initializeScreen() {
var vHP;
hideElements('#idDefender');
hideElements('#idEnimiesAvailable');
$("#idEnemiesHeader").hide();
$("#idDefenderHeader").hide();
$("#idFightSection").hide();
$('#idYourCharacter').children().each( function(index){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startGame()\n{\n startScreen.style.display='none'\n characterCreate.style.display='block'\n \n}",
"startGame() {\n document.getElementById('homemenu-interface').style.display = 'none';\n document.getElementById('character-selection-interface').style.display = 'block';\n this.int... | [
"0.7201596",
"0.7006156",
"0.6800477",
"0.67515355",
"0.6640649",
"0.66257757",
"0.66157484",
"0.66035604",
"0.6580058",
"0.6576339",
"0.65312696",
"0.6464301",
"0.64582914",
"0.644172",
"0.6428659",
"0.6424585",
"0.64183885",
"0.6379133",
"0.6377578",
"0.637484",
"0.6362385"... | 0.7089757 | 1 |
Display a random product | function displayRandomProduct() {
//Display a random product
outputEl.innerHTML = "<h2>Display A Random Product</h2>";
let randomProduct = Math.randomElement(groceryData);
outputEl.innerHTML += productString(randomProduct);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayRandomProduct() {\n return (getRandomIntInclusive(1, Product.allProducts.length) - 1);\n}",
"getRandomProduct() {\n var products = [{title: \"Super Nintendo\", image: \"http://hatemalimam.com/uploads/fundinator/product1.png\"}, {title: \"ATARI 2600\", image: \"http://hatemalimam.com/uploa... | [
"0.84057295",
"0.75370884",
"0.75188863",
"0.744821",
"0.7395284",
"0.7328469",
"0.7302292",
"0.7234486",
"0.7065905",
"0.7065905",
"0.7050907",
"0.7043646",
"0.7034679",
"0.7006418",
"0.69968957",
"0.69906443",
"0.68187857",
"0.68048567",
"0.67889524",
"0.6773757",
"0.676531... | 0.81460756 | 1 |
Display the inflation for each products | function productInflation() {
//Increase each products price by 7%
outputEl.innerHTML = "<h2>Display Inflation</h2>";
outputStr = "<ul>";
for (let i = 0; i < groceryData.length; i++) {
let charge = groceryData[i];
let outputStr = charge.name + " $" + Math.round(charge.price * 1.07)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processProducts() {\n for (var i=0; i < 4; i++) {\n labels[i].innerHTML=products[i]; \n }\n}",
"function displayProducts(products) {\n let html = \"\";\n products.forEach((product) => {\n html += renderProduct(product, \"cart\");\n });\n document.querySelector(\"#products\").innerHTML ... | [
"0.63238144",
"0.6134257",
"0.59509",
"0.5927988",
"0.58792704",
"0.5822194",
"0.5817234",
"0.5772373",
"0.5724478",
"0.57016003",
"0.5683527",
"0.56650907",
"0.56387985",
"0.5633364",
"0.5614214",
"0.5605679",
"0.5596236",
"0.558441",
"0.5580849",
"0.5569673",
"0.5558061",
... | 0.6260743 | 1 |
When connected, hook up listeners and setup the translation. | connectedCallback () {
this.translate = document.querySelector("an-translate-controller");
this._setTranslation();
// Listen for changed in the translation language
document.addEventListener(AnTranslateController.translationChangedEventName, this._setTranslation.bind(this));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupTranslationsReadyListener () {\n\t\tIBM.common.util.queue.push(function(){\n\t\t\treturn translations.v18.ready;\n\t\t}, function(){\n\t\t\t// Merge all the translations into our local single data object \"me.data\" (public).\n\t\t\t// Keep any existing ones (merge in first) in case some other main m... | [
"0.7043724",
"0.6922421",
"0.66634417",
"0.65824866",
"0.63697416",
"0.6223866",
"0.5992684",
"0.59538746",
"0.58304465",
"0.5829863",
"0.57724303",
"0.5753719",
"0.5751596",
"0.573241",
"0.573241",
"0.5723549",
"0.56888855",
"0.56519365",
"0.56505376",
"0.56505376",
"0.56505... | 0.8013316 | 0 |
Set the translation each time the attributes value has changed. | changedCallback () {
if (this.oldValue === this.value) return;
this._setTranslation();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setTranslation () {\n\n\t\t// Find the parts of the translation\n\t\tconst atoms = this.value.split(/:(.*)/);\n\t\tconst key = atoms.length > 0 ? atoms[0] : null;\n\t\tconst obj = atoms.length > 1 ? JSON.parse(atoms[1]) : null;\n\n\t\tconst translation = this.translate.get(key, obj);\n\t\tthis.ownerElement.innerH... | [
"0.72046995",
"0.6062825",
"0.60111827",
"0.59932214",
"0.59449625",
"0.59449625",
"0.5941161",
"0.5920657",
"0.5920657",
"0.5906041",
"0.57924974",
"0.57711834",
"0.5749753",
"0.5749132",
"0.5724499",
"0.57162935",
"0.5706813",
"0.5706813",
"0.5697711",
"0.5694995",
"0.56949... | 0.63553077 | 1 |
Sets the translation based on the value of the attribute. | _setTranslation () {
// Find the parts of the translation
const atoms = this.value.split(/:(.*)/);
const key = atoms.length > 0 ? atoms[0] : null;
const obj = atoms.length > 1 ? JSON.parse(atoms[1]) : null;
const translation = this.translate.get(key, obj);
this.ownerElement.innerHTML = translation || `${t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setTranslatedValue(props) {\n let { label, params } = props || this.props;\n\n return translate(label, params || null)\n .then(text => {\n this.setState({ text });\n });\n }",
"setTranslation(x, y) {\n this.c = x\n this.f = y\n ... | [
"0.6084613",
"0.60331166",
"0.5845972",
"0.5506793",
"0.549835",
"0.5466666",
"0.5466666",
"0.54650295",
"0.54650295",
"0.54358506",
"0.54358506",
"0.5350868",
"0.5342128",
"0.531575",
"0.53156024",
"0.53137887",
"0.5253562",
"0.5253562",
"0.5233603",
"0.5216478",
"0.5202654"... | 0.733866 | 0 |
removing all of the classes from the pupils | function clearPupils(){
pupils.forEach( (pupil) => {
pupil.classList.remove('look_left');
pupil.classList.remove('look_right');
pupil.classList.remove('scared');
pupil.classList.remove('neuralizer');
pupil.classList.remove('angry');
pupil.classList.remove('concentration');
pupil.classList.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _cleanupClasses(target) {\n\t for (var i = 0; i < this._dirtyClasses.length; i++) target.classList.remove(this._dirtyClasses[i]);\n\t this._dirtyClasses = [];\n\t }",
"function _cleanupClasses(target) {\n for (var i = 0; i < this._dirtyClasses.length; i++) target.classList.remove... | [
"0.7292039",
"0.7175269",
"0.7124274",
"0.70210093",
"0.7008166",
"0.6959514",
"0.6890289",
"0.67646646",
"0.673496",
"0.6709894",
"0.66722876",
"0.6632129",
"0.661238",
"0.6575779",
"0.656712",
"0.655597",
"0.6499023",
"0.64934444",
"0.64899814",
"0.6480093",
"0.64530706",
... | 0.72053325 | 1 |
Utility function to validate numeric URL params | function validateNumericParam(paramName, valueStr, min, max) {
if (valueStr) {
var valueNum = Number(valueStr);
if (typeof valueNum === 'number' && !isNaN(valueNum)) {
if (valueNum < min || valueNum > max) {
return 'GET error: "' + paramName + '" must be greater than or equal to ' + min +
' or less o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkNumeric(req, res, next)\r\n{\r\n //RegEx explanation:\r\n // ^: From the start of the line\r\n // [0-9]: there must be a character that is a digit 0-9\r\n // +: repeated one or more times\r\n // $: until the end of the line\r\n if(req.params.id.match(/^[0-9]+$/))\r\n {\r\n ... | [
"0.6391529",
"0.6367995",
"0.61326635",
"0.60756654",
"0.5988374",
"0.5987628",
"0.597898",
"0.5974361",
"0.59669685",
"0.5956023",
"0.59517837",
"0.5946379",
"0.59432656",
"0.58306026",
"0.5785824",
"0.5776346",
"0.5776266",
"0.5773746",
"0.57719135",
"0.5768134",
"0.5760650... | 0.6920877 | 0 |
Clears and unmarshalls all existing content. | function clearContent()
{
// empty the content
utils.empty( elContent );
// empty the header
elHeader.classesToRemove.forEach( sC => elHeader.classList.remove( sC ));
elHeader.classesToRemove = [];
utils.empty( elHeader );
// empty the footer
elFooter.classesToRemove.forEach( sC => e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map<string, any>} */ (this._prelimContent).clear()\n }\n }",
"function ... | [
"0.62782204",
"0.60291135",
"0.5869016",
"0.58060056",
"0.5654553",
"0.5622108",
"0.56065077",
"0.5604309",
"0.5583787",
"0.5576873",
"0.5572303",
"0.55619454",
"0.55594695",
"0.5528459",
"0.54914993",
"0.5449596",
"0.5449171",
"0.54461086",
"0.54345846",
"0.54301417",
"0.542... | 0.61495423 | 1 |
eitherToFirst : Either b a > First a eitherToFirst : (a > Either c b) > a > First b | function eitherToFirst(either) {
if(isFunction(either)) {
return function(x) {
var m = either(x)
if(!isSameType(Either, m)) {
throw new TypeError('eitherToFirst: Either returing function required')
}
return applyTransform(m)
}
}
if(isSameType(Either, either)) {
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function firstToMaybe(first) {\n if(isFunction(first)) {\n return function(x) {\n var m = first(x)\n\n if(!isSameType(First, m)) {\n throw new TypeError('firstToMaybe: First returing function required')\n }\n\n return applyTransform(m)\n }\n }\n\n if(isSameType(First, first)) {\... | [
"0.695152",
"0.62201715",
"0.60503095",
"0.58839595",
"0.5850819",
"0.5675963",
"0.5675963",
"0.5538084",
"0.5530978",
"0.5518656",
"0.54387873",
"0.5392697",
"0.5390757",
"0.5354418",
"0.53542864",
"0.53467894",
"0.53348804",
"0.53312355",
"0.53214395",
"0.5309285",
"0.52931... | 0.8321325 | 0 |
from GAS tutorials setRowsData fills in one row of data per object defined in the objects Array. For every Column, it checks if data objects define a value for it. Arguments: sheet: the Sheet Object where the data will be written objects: an Array of Objects, each of which contains data for a row options: object with o... | function setRows(sheet, objects, options) {
var opt = options || {};
var headersRange = opt.HeadersRange || sheet.getRange(1, 1, 1, sheet.getMaxColumns());
var firstDataRowIndex = opt.FirstDataRowIndex || headersRange.getRowIndex() + 1;
var normalize = opt.NormalizeKeys || false;
var headers = normalize ? nor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setSheetData(sheet, rows) {\n // The size of the range must match the size of the data.\n var numRows = rows.length;\n var numColumns = rows[0].length;\n var range = sheet.getRange(1, 1, numRows, numColumns);\n range.setValues(rows);\n}",
"function readRows() {\nvar sheet = SpreadsheetApp.getActiveSprea... | [
"0.6579974",
"0.6209192",
"0.60202765",
"0.59001017",
"0.57662266",
"0.57191336",
"0.571621",
"0.5704078",
"0.56762666",
"0.56001097",
"0.55857927",
"0.55386645",
"0.54983616",
"0.5450171",
"0.54089075",
"0.5349906",
"0.53421766",
"0.5331148",
"0.53275365",
"0.5298357",
"0.52... | 0.73789924 | 0 |
Returns true if the cell where cellData was read from is empty. Arguments: cellData: string | function isCellEmpty(cellData) {
return typeof(cellData) == "string" && cellData.trim() == ""; // added trim to avoid empty with space
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isCellEmpty(cellData) {\n return typeof(cellData) == \"string\" && cellData == \"\";\n}",
"function isCellEmpty(cellData) {\n return typeof(cellData) == \"string\" && cellData == \"\";\n}",
"function isCellEmpty(cellData) {\n return typeof(cellData) == \"string\" && cellData == \"\";\n}",
"functi... | [
"0.8498016",
"0.8498016",
"0.8498016",
"0.8498016",
"0.8498016",
"0.8498016",
"0.84383345",
"0.84167415",
"0.84167415",
"0.83397573",
"0.6884671",
"0.6768725",
"0.6711431",
"0.63226664",
"0.61398166",
"0.6096959",
"0.60900813",
"0.60886943",
"0.60642624",
"0.60642624",
"0.606... | 0.860249 | 0 |
spy for user.loggedIn method | function setUserLoggedInStatus(isLoggedIn) {
spyOn(user, 'isLoggedIn').and.callFake(function () {
return isLoggedIn;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkLoggedIn() {\n this.isLoggedIn(null);\n }",
"isLoggedIn() {\r\n return this.authenticated;\r\n }",
"get isLoggedIn() {\n return this.use().isLoggedIn;\n }",
"SET_LOGGED_IN(state, value) {\n state.user.loggedIn = value;\n }",
"SET_LOGGED_IN(state, value) {\n state.u... | [
"0.69172454",
"0.6505321",
"0.64985883",
"0.647893",
"0.647893",
"0.64763814",
"0.64456284",
"0.63751113",
"0.63689625",
"0.63689625",
"0.6365542",
"0.6360283",
"0.6342572",
"0.6329864",
"0.6321999",
"0.6315447",
"0.6315447",
"0.6306753",
"0.62633574",
"0.6255064",
"0.6207288... | 0.7309434 | 0 |
valida que se ingresen multiplos de 100 | function billetes100(monto){
if( monto%100 == 0){
return true;
} else {
alert("El cajero solo entrega billetes de 100");
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}",
"function multipliedBy100(num) {\n console.log(num * 100);\n}",
"function multiploDeMil(vlRecarga){\n\tvar residuo = (vlRecarga/1000) % 1;\n\treturn !(residuo === 0); \n}",
"function multiplier(x){var parts=x.toString().spl... | [
"0.63473445",
"0.6337374",
"0.6274129",
"0.6239466",
"0.62282693",
"0.62253034",
"0.61871094",
"0.61594975",
"0.6121075",
"0.6111049",
"0.61046076",
"0.6090215",
"0.6084015",
"0.6063749",
"0.6008607",
"0.6008607",
"0.6008607",
"0.6008607",
"0.6005586",
"0.5990108",
"0.5988428... | 0.63795805 | 0 |
verifica que haya saldo disponible | function saldoDisponible(monto){
if(monto < saldoCuenta){
return true;
}else{
alert("No hay suficiente dinero");
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function haySaldoDisponible(dinero) {\n if (dinero <= saldoCuenta)\n return true;\n else\n return false;\n}",
"isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n ... | [
"0.7070088",
"0.6791482",
"0.6744843",
"0.6488035",
"0.6434351",
"0.6403224",
"0.63846797",
"0.6217141",
"0.6148995",
"0.61062056",
"0.60741216",
"0.5977593",
"0.5949009",
"0.59178174",
"0.59131974",
"0.5844287",
"0.58400726",
"0.5838915",
"0.58376926",
"0.5817771",
"0.579941... | 0.7363285 | 0 |
verifica que el monto no supere al limite | function limiteDisponible(monto){
if(monto <= limiteExtraccion){
return true;
}else{
alert("El monto a extraer supera el limite diario");
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cambiarLimiteDeExtraccion() {\n var monto = prompt(\"Ingrese el nuevo limite de extraccion\");\n if(validaValoresNumericos(monto) && numeroNegativo(monto) && billetes100(monto)){\n cambiarLimite(monto);\n actualizarLimiteEnPantalla();\n}\n}",
"async checkFreeAccountReques... | [
"0.65531963",
"0.6460782",
"0.63765436",
"0.6331384",
"0.6237474",
"0.62128824",
"0.6115984",
"0.60466236",
"0.5967904",
"0.5940325",
"0.5888898",
"0.5872134",
"0.58370674",
"0.5831358",
"0.5823021",
"0.5813956",
"0.5795891",
"0.579249",
"0.578674",
"0.5765531",
"0.57615024",... | 0.77988476 | 0 |
function called when forgot password? is pressed brings up alert message (don't need to implement further) | forgotPass()
{
Alert.alert(
'Go To Site',
'Pressing this button would help you restore your password (external source)',
[
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{cancelable: false},
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkforgotpassword()\r\n\t{\r\n\t\tif(document.forgot.email.value==\"\")\r\n\t\t{\r\n\t\t\talert(lng_plsenteremailadd);\r\n\t\t\tdocument.forgot.email.focus();\r\n\t\t\tdocument.forgot.email.select();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!validate_email_forgot(document.forgot.... | [
"0.7285081",
"0.71732795",
"0.7166854",
"0.70692664",
"0.7018059",
"0.68834007",
"0.6867683",
"0.6841461",
"0.67818195",
"0.67796695",
"0.67717993",
"0.6768307",
"0.6754068",
"0.67529625",
"0.6742802",
"0.6721254",
"0.67025006",
"0.6693576",
"0.66891295",
"0.6677404",
"0.6675... | 0.7962867 | 0 |
Constructs a new BlockRelations. | constructor() {
BlockRelations.initialize(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() { \n \n ItemRelations.initialize(this);\n }",
"constructor() { \n \n GenreRelations.initialize(this);\n }",
"constructor() { \n \n BroadcastRelations.initialize(this);\n }",
"function Blockchain() {\n this.chain = [];\n this.pendingTransa... | [
"0.6032455",
"0.59663266",
"0.5895505",
"0.55873",
"0.5556003",
"0.54839647",
"0.5441418",
"0.5437671",
"0.54042697",
"0.5386112",
"0.5356073",
"0.52801436",
"0.5272275",
"0.52534634",
"0.5247668",
"0.5229992",
"0.5184818",
"0.51584476",
"0.5154493",
"0.51141006",
"0.5111242"... | 0.797007 | 0 |
Suggested methods Implement only if rowspecific temporal is supported | setTemporal(values) {
let temporal = this.temporal();
if (temporal) {
let start = temporal.start,
end = temporal.stop;
if (values.hasOwnProperty('recurring')) {
temporal.isRecurring(values.recurring);
}
if (values.hasOwnProperty('startDate')) {
start.date(values... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"detect(dt, t) {}",
"resolveRowRecord(elementOrEvent, xy) {\n const me = this,\n { scheduler } = me,\n event = elementOrEvent instanceof Event ? elementOrEvent : null,\n element = event ? event.target : elementOrEvent,\n coords = event ? [event.offsetX, event.offsetY] : xy,\n // Fix fo... | [
"0.5568246",
"0.5417042",
"0.5332738",
"0.5297681",
"0.510464",
"0.50703347",
"0.50320435",
"0.48865584",
"0.48577645",
"0.4855557",
"0.4831014",
"0.48293668",
"0.48093528",
"0.4784379",
"0.47755218",
"0.47679478",
"0.47456035",
"0.47276437",
"0.47250003",
"0.47085226",
"0.46... | 0.56049466 | 0 |
returns an object keys are the ids of products the values are the products themselves | function generateProductsMap(products){
var allProducts = products.reduce(function(all, current) {
all[current['id']] = current;
return all;
}, {})
return allProducts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createProductMap(products) {\n var productArr = [];\n var productMap = {};\n vm.products = [];\n for(i = 0; i < products.length; i++) {\n if(productMap[products[i].name]) {\n productMap[products[i].name] = productMap[products[i... | [
"0.71251965",
"0.7096298",
"0.70092916",
"0.6947574",
"0.671494",
"0.6613154",
"0.66042864",
"0.6556533",
"0.6556533",
"0.6549653",
"0.6534902",
"0.6518197",
"0.64929926",
"0.6482676",
"0.6468406",
"0.6434239",
"0.6414502",
"0.63433796",
"0.62852454",
"0.6277971",
"0.62627256... | 0.8002336 | 0 |
returns an object keys are the ids of products value is the total revenue for that product | function salesByProduct(products, lineItems){
var allProducts = generateProductsMap(products);
var salesProducts = lineItems.reduce(function(sales, current) {
currentPrice = allProducts[current['productId']]['price'];
if (current['productId'] in sales) {
sales[current['productId']] +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function totalSales(products, lineItems){\n var allProducts = generateProductsMap(products);\n var totalSales = lineItems.reduce(function(total, current) {\n currentPrice = allProducts[current['productId']]['price'];\n total += current['quantity'] * currentPrice;\n return total;\n }, ... | [
"0.66125196",
"0.6390333",
"0.6335271",
"0.633385",
"0.6261229",
"0.6153035",
"0.6143611",
"0.6120271",
"0.6107252",
"0.6095402",
"0.6067936",
"0.6058445",
"0.60176754",
"0.6005347",
"0.59618217",
"0.59493643",
"0.5947399",
"0.59432876",
"0.5879971",
"0.58539784",
"0.58478606... | 0.67349136 | 0 |
return the product responsible for the most revenue | function topSellerByRevenue(products, lineItems){
var salesProducts = salesByProduct(products, lineItems);
var salesIDs = Object.keys(salesProducts);
console.log(salesIDs)
highestID = salesIDs.reduce(function(highest, current) {
if (salesProducts[current] > salesProducts[highest]) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mostSpentOnItem(value){\n //takes in the shopping cart as input\n //returns the object associated with the item that has the highest price*quantity\n var expense = {\n \"price\": 0,\n \"quantity\": 0\n };\n for (let i = 0; i < value.items.length; i++) {\n //var initialP... | [
"0.6698823",
"0.66261697",
"0.6508424",
"0.64938396",
"0.64748657",
"0.6244142",
"0.61571586",
"0.6141968",
"0.613578",
"0.59627366",
"0.5961775",
"0.5953367",
"0.5861667",
"0.5860516",
"0.58579963",
"0.58570176",
"0.58095366",
"0.57584333",
"0.57385725",
"0.57291985",
"0.571... | 0.6843921 | 0 |
get devices belonging to a site | async getDevices(siteId, token) {
const devices = await connectionHelpers.getDevices({siteId, token})
console.log(devices)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function devices() {\n return SystemDeviceTypeService.index().then(function(data) {\n return _.filter(data, function(device) {\n return _.includes(device.tags, 'UC-One')\n })\n })\n }",
"function listDevices(api, query) {\n return api_1.GET(api, `/devices`, { query })\n}",
"function ... | [
"0.67956316",
"0.65263003",
"0.6517492",
"0.64660615",
"0.6431234",
"0.63853765",
"0.633715",
"0.63087267",
"0.6209627",
"0.62007123",
"0.6135876",
"0.60046583",
"0.5998325",
"0.59880424",
"0.5983902",
"0.5953624",
"0.59465617",
"0.5910268",
"0.59009534",
"0.58851457",
"0.586... | 0.7629544 | 0 |
render the currently selected site view | setActiveSite(site){
this.activeSite = site
this.renderSites(this)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render() {\r\n let content = '';\r\n if (STORE.view === 'home') {\r\n $('main').html(welcomePage());\r\n }\r\n else if (STORE.view === 'question') {\r\n content = questionAsked();\r\n content += generateAnswers();\r\n content += questionAndScoreStanding();\r\n $('main').html(`<form>${co... | [
"0.6347986",
"0.6200691",
"0.6200669",
"0.6109673",
"0.6083237",
"0.60404664",
"0.60263634",
"0.5996107",
"0.59751236",
"0.5972905",
"0.5941583",
"0.59201586",
"0.5904957",
"0.58798355",
"0.58042514",
"0.5783422",
"0.577723",
"0.5771904",
"0.5757629",
"0.5743822",
"0.5738523"... | 0.6584637 | 0 |
Returns an array of error messages for every file with error: | function dump_file_error() {
var aug = this;
var files_with_errors =
aug.match(
'/augeas/files/*/*[error]'
).map(function(s){
return s.substr(13); // cutoff /augeas/files: 13 = strlen(/augeas/files)
});
var res =
files_with_errors.map(function(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findFileErrors ( activeDoc ) {\n var layerStatusLocked = [];\n var layerStatusVisible = [];\n var fileErrorString = \"\"; \n var fileTxtOutput;\n var array_errorList = [];\n \n var findNonNative = \"[NonNativeItem ]\";\n var findRasterImage =\"[RasterItem ]\";\n var isNonNati... | [
"0.65039426",
"0.6457594",
"0.6186782",
"0.6019198",
"0.57601523",
"0.57166195",
"0.5701636",
"0.564027",
"0.55995065",
"0.5595948",
"0.5570619",
"0.5549519",
"0.5536429",
"0.5510633",
"0.5503325",
"0.5502083",
"0.5478393",
"0.5465154",
"0.546075",
"0.54601806",
"0.54549456",... | 0.79458785 | 0 |
Read excel files to database | function xlsxDirToDB(){
var excelDir = __dirname + '/../excel';
fs.readdir( excelDir, function( err, files ) {
if( err ) {
console.error( "Could not list the directory.", err );
process.exit( 1 );
}
files.forEach( function( file, index ) {
// Mak... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function importExcelData2MySQL(filePath){\n\n var sql='DELETE FROM student';\n db.query(sql, function (err, data, fields) {\n if (err) {\n console.log(err);\n }\n });\n\n var deferred = q.defer();\n\treadXlsxFile(filePath).then((rows) => {\n\t\t// `rows` is an array of rows\n\t\t// each ro... | [
"0.65109295",
"0.6300724",
"0.61159915",
"0.6049804",
"0.5936093",
"0.5895526",
"0.58766377",
"0.5639982",
"0.56067497",
"0.55674946",
"0.5523842",
"0.5522901",
"0.5504023",
"0.54668516",
"0.5445416",
"0.54394686",
"0.54104066",
"0.5381771",
"0.5347395",
"0.53234667",
"0.5313... | 0.67585975 | 0 |
============================================================= Converts radius in miles to approx zoom | function radiusToZoom(radius)
{
return Math.round(14-Math.log(radius)/Math.LN2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function radiusToZoom(radius){\n radius *= 0.00035;\n return Math.round(14-Math.log(radius)/Math.LN2) - 1;\n}",
"function updateRadius(){\n var zoom = mymap.getZoom();\n \n switch(zoom) {\n case 13 : return 8;\n case 14 : return 10;\n case 15 : return 1... | [
"0.7633561",
"0.6954308",
"0.67073655",
"0.66053754",
"0.6525338",
"0.64340246",
"0.6309187",
"0.62965524",
"0.612808",
"0.6114311",
"0.60550934",
"0.6021668",
"0.59650946",
"0.5953689",
"0.59446764",
"0.59427166",
"0.5906377",
"0.5901055",
"0.5897496",
"0.589038",
"0.5862580... | 0.7647686 | 0 |
======================================================================= ========================================================================== ========================= TEST FUNCTIONS BELOW THIS LINE ================= ========================================================================= ========================... | function testSorts()
{
console.log("============= original googleResults =============");
console.log(googleResults);
console.log("==== before sort array element index name rating ====");
googleResults.forEach(function(element,index)
{
console.log(index + ": name: " + element.name + " rating: " + element.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByRating(list) {\n // your code here..\n \n}",
"sortDataByRating(data) {\r\n data.sort((a,b) => {\r\n if (a.rating > b.rating) return -1;\r\n if (a.rating < b.rating) return 1;\r\n return 0;\r\n });\r\n return data;\r\n }",
"function sortByRating(){\n ... | [
"0.70403713",
"0.68206614",
"0.6467531",
"0.6450803",
"0.6434844",
"0.63250065",
"0.628108",
"0.62470657",
"0.6188974",
"0.6180943",
"0.6067661",
"0.60242134",
"0.6018389",
"0.599506",
"0.5993639",
"0.5990212",
"0.59789413",
"0.59627706",
"0.5958778",
"0.5909401",
"0.5892588"... | 0.71141356 | 0 |
context dryRun logger encoding | constructor(options) {
this.context = options.context;
this.dryRun = options.dryRun;
this.logger = options.logger;
this.encoding = options.encoding || 'utf-8';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Stark(){}",
"interceptLogs() {\n const context = {};\n context.console = console;\n\n context.console.log = this._log.bind(this, 'log');\n context.console.warn = this._log.bind(this, 'warn');\n context.console.error = this._log.bind(this, 'error');\n context.console.info = this._log.bi... | [
"0.51982987",
"0.5037812",
"0.5008586",
"0.5005296",
"0.49911478",
"0.49832392",
"0.4977165",
"0.49568573",
"0.49467933",
"0.4904461",
"0.4897949",
"0.48964587",
"0.48519146",
"0.4849029",
"0.48209926",
"0.48164794",
"0.47805467",
"0.47462556",
"0.47150335",
"0.4704103",
"0.4... | 0.544265 | 0 |
A Readable stream wrapping socket.io Socket object | function SocketReadStream(socket, eventName){
Readable.call(this);
this.socket=socket;
this.eventName=eventName;
var self=this;
this.socket.once(eventName,function(token){
self.token=token;
self.socket.emit("socket-ready-"+token);
self.socket.on("socket-data-"+token,function(d){
});
self.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Stream() {\n EventEmitter.call(this);\n}",
"function Stream() {\n EventEmitter.call(this);\n}",
"function Stream() {\n EventEmitter.call(this);\n }",
"function SocketWriteStream(socket, eventName){\n Writable.call(this);\n this.socket=socket;\n this.eventName=eventName;\n}",
"function emi... | [
"0.64021707",
"0.64021707",
"0.635973",
"0.6302114",
"0.6289289",
"0.62641245",
"0.62613803",
"0.62613803",
"0.62613803",
"0.62613803",
"0.62613803",
"0.6247768",
"0.6247106",
"0.6223775",
"0.6213586",
"0.6213586",
"0.6159231",
"0.6150425",
"0.6058121",
"0.60372436",
"0.60372... | 0.7300702 | 0 |
to define function for biggestInt | function biggestInt(array){
let max = array[0];
for (var i=0; i<array.length; i++){
if (max < array[i]) max = array[i];
}
return max;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function largestNumber(numbers) {\n\n }",
"function largestNumber(n) {\r\n let x=\"\"\r\n for(i=0;i<n;i++){\r\n x+=\"9\";\r\n }\r\n return parseInt(x);\r\n }",
"function largest(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n var maxNum = 0;\... | [
"0.7168658",
"0.7051711",
"0.690959",
"0.68715817",
"0.6869899",
"0.6818409",
"0.67177683",
"0.67025214",
"0.67019546",
"0.6688729",
"0.6672755",
"0.6662886",
"0.66480637",
"0.66073436",
"0.65988606",
"0.6587616",
"0.65858704",
"0.6578972",
"0.6568476",
"0.6567467",
"0.656706... | 0.7527582 | 0 |
applies a regex to a string. Each match, function f is given the matching portion, and expected to return an object containing before and after, strings which will be appended before and after, respectively. | function adorn(str, regex, f) {
return str.replace(regex, function repl(match) {
var fr = f(match);
return fr.before + match + fr.after;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replaceFunc(f) {\n return (...args) => { // args are [match, group1, group2, ..., offset, whole string, (some browsers:) named groups obj]\n const info = { // replace function will be called with this object\n match: args[0], // full matching string\n groups: [args[0]], // matched groups ... | [
"0.65003335",
"0.5695372",
"0.5494093",
"0.54554516",
"0.541105",
"0.5398869",
"0.5398869",
"0.53289855",
"0.52957153",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0.52948195",
"0... | 0.7050247 | 0 |
show annotator panel by button "btnsuccess" deprecated buttonshowright | function annotationPanelClick(){
if($('.btn-success').val()=="hide") {
$('#splitter').jqxSplitter({
showSplitBar:false,
width: $(window).width(),
height: $(window).height(),
orientation: 'horizontal',
panels: [{size: '80%', ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showButton() {\n let treeviz = _panelWindow.document.getElementById('treeVisualization');\n _panelWindow.document.getElementById('treeContainer').insertBefore(timeTravelButton, treeviz);\n }",
"function showPreviewButtonLabel() {\n addClass(\"preview-button-label\",\" label... | [
"0.63748574",
"0.5957519",
"0.5858118",
"0.5803361",
"0.5783203",
"0.57750446",
"0.5771103",
"0.5721947",
"0.57080966",
"0.5695051",
"0.56805354",
"0.5629888",
"0.56226087",
"0.55992335",
"0.5595793",
"0.5590283",
"0.5590002",
"0.5573659",
"0.5566115",
"0.5561602",
"0.5546756... | 0.6344789 | 1 |
return promise of toppings | getToppings () {
console.log('je suis la ')
if (this.toppings.length !== 0) {
return this.$q.resolve(this.toppings)
}
return this.$http.get(API_URL)
.then(response => response.data)
.then(toppings => {
this.toppings = toppings
return t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getToppings () {\n \tif (this.toppings.length!==0) {\n \t\treturn this.$q.resolve(this.toppings)\n \t}\n\n \treturn this.$http.get(API_URL)\n \t.then(response => response.data)\n \t.then(toppings => {\n \t\tthis.toppings = toppings\n \t\treturn toppings\n \t})\n }",
"function makePi... | [
"0.7065616",
"0.6467041",
"0.5723349",
"0.5649099",
"0.5637571",
"0.55682516",
"0.555865",
"0.5546321",
"0.5470955",
"0.54544294",
"0.5368182",
"0.534539",
"0.5329527",
"0.53180283",
"0.5295434",
"0.5293809",
"0.52618414",
"0.52609396",
"0.5254071",
"0.5252827",
"0.5247858",
... | 0.70458376 | 1 |
Add tag to parameters for existing exports | async function addTags(ssm, parameters, keyName) {
await Promise.all(parameters.map(async (name) => {
try {
return await ssm.addTagsToResource({
ResourceId: name,
ResourceType: 'Parameter',
Tags: [{
Key: keyName,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addParams(name, command, key, tag, emphasis) {\n var thisCssNo = buttons.length + 1;\n return buttons.push({name:name, cls:thisCssNo, command:command, key:key, tag:tag, emphasis:emphasis});\n }",
"function addTag(id, tag){\n\t\... | [
"0.5879933",
"0.5735416",
"0.5676549",
"0.55505943",
"0.55505943",
"0.55505943",
"0.55505943",
"0.5520839",
"0.5446999",
"0.5415209",
"0.5412403",
"0.53729033",
"0.5315405",
"0.5272549",
"0.5272549",
"0.5252597",
"0.52331626",
"0.52161574",
"0.5165718",
"0.5130169",
"0.512262... | 0.6005043 | 0 |
Return only the items from source that do not exist in the filter | function except(source, filter) {
return source.filter(key => !filter.includes(key));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pickupNonElements(source, target){\n var nonexisting = [];\n for each (elm in source){\n //logger.warn(\"elm:\"+elm);\n if(!include(target,elm) && typeof(elm)==\"string\" ){\n nonexisting.push(elm);\n }\n }\n return nonexisting;\n}",
"removeAllFilters() {}",
... | [
"0.6072992",
"0.5971501",
"0.5950478",
"0.59075296",
"0.59075296",
"0.59075296",
"0.59075296",
"0.5884717",
"0.58745533",
"0.581572",
"0.57964426",
"0.57848644",
"0.5701346",
"0.5678308",
"0.5678308",
"0.56644285",
"0.56516397",
"0.5567477",
"0.5560678",
"0.5555721",
"0.55448... | 0.71845514 | 0 |
add a new chat to the log | addChat(newMessage) {
this.log.push(newMessage);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addChat(message) {\n\t\tthis.chat_backlog.addChat(message);\n\t}",
"function pushLog(text) {\r\n\tchatLog.push(text);\r\n\tconsole.log(text);\r\n}",
"function addChatMessage(chatMessage, type = 'markdown'){\n if (chatMessage){\n console.info('>>> chatMessageSent', '\\ntype:', type, '\\nmessage:', cha... | [
"0.7787509",
"0.72299105",
"0.71346885",
"0.69851494",
"0.690467",
"0.67051506",
"0.66892505",
"0.6642972",
"0.66243625",
"0.66156656",
"0.6612852",
"0.6543816",
"0.6540349",
"0.6522954",
"0.6521437",
"0.6519838",
"0.65167975",
"0.6503705",
"0.64950645",
"0.6485173",
"0.64835... | 0.8442529 | 0 |
getLog() returns the contents of ChatLog | getLog() {
return this.log;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLog() {\n var procGitLog = cp.spawn(\n 'git',\n ['--no-pager', 'log', '--color=never', '--pretty=format:commit:%H', '-U0', 'origin/lkgr', 'chrome/VERSION'],\n {cwd: 'src', stdio: ['ignore', 'pipe', process.stderr]}\n );\n var log = '';\n procGitLog.stdout.setEncoding('u... | [
"0.62674624",
"0.61606556",
"0.6143087",
"0.6037677",
"0.5893673",
"0.58739644",
"0.5861323",
"0.58352286",
"0.5762078",
"0.57200843",
"0.5685353",
"0.56756735",
"0.563448",
"0.5602365",
"0.5584829",
"0.55633557",
"0.5546408",
"0.55440825",
"0.5530518",
"0.5515962",
"0.549732... | 0.6761126 | 0 |
getMessages returns the chat backlog and deletes the backlog | getMessages() {
const newMessages = this.chat_backlog.getLog();
this.chat_backlog.clearLog();
return newMessages;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getMessages() {\n const data = await sendRequest('getMessages', {});\n updateMessages(data.messages);\n}",
"async function getMessagesOnOpen(){\n if(messages.length==0){\n return;\n }\n // r for reconnecting\n let rhasMore = true;\n let rnext=nul... | [
"0.69168526",
"0.65745926",
"0.6535363",
"0.6482535",
"0.6418249",
"0.6418249",
"0.6366362",
"0.635477",
"0.6344319",
"0.6329098",
"0.6283837",
"0.62821925",
"0.6277235",
"0.6277235",
"0.62770474",
"0.6254914",
"0.6246325",
"0.6223205",
"0.6213765",
"0.6134598",
"0.61319304",... | 0.7706535 | 0 |
add a chat message to the backlog | addChat(message) {
this.chat_backlog.addChat(message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addChat(newMessage) {\n\t\tthis.log.push(newMessage);\n\t}",
"function addNewMessage(data){\n\t\t$chat.append(createMessage(data));\n\t\t$chat.scrollTop($chat[0].scrollHeight);\n\t}",
"function addChat(name, message, whisper) {\n let today = new Date(); // Get the current time\n let hour = today.getHours();\... | [
"0.77677023",
"0.7362288",
"0.7346152",
"0.7123245",
"0.70120496",
"0.70085233",
"0.69953465",
"0.6993976",
"0.69072366",
"0.687116",
"0.68233734",
"0.6805022",
"0.6771453",
"0.6762652",
"0.67537355",
"0.6726096",
"0.6713794",
"0.6694935",
"0.6682976",
"0.66783094",
"0.667213... | 0.8804349 | 0 |
generateUserID generates random numeric ID (0999) for a user | generateUserID() {
return (Math.random() * 999).toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserID() {\n userID = Math.floor(Math.random()*1000000000)\n }",
"function generateUserID() {\n console.log('generating id...');\n let newID;\n do {\n newID = Math.floor(Math.random() * 900000000);\n } while (getIndexOfConnection(newID) !== -1);\n ... | [
"0.85956097",
"0.8409687",
"0.83504516",
"0.817639",
"0.80263585",
"0.7927518",
"0.7776726",
"0.7729199",
"0.77103275",
"0.7706088",
"0.7685935",
"0.7682307",
"0.76794165",
"0.7671131",
"0.7662982",
"0.76554716",
"0.7652636",
"0.76466143",
"0.7589098",
"0.7575568",
"0.7572821... | 0.8998576 | 0 |
add user adds a user it adds a userid to the users array it returns the UID | addUser() {
//create a UID, then make sure it's unique
let uid = generateUserID();
//generate new ID if UID is already in use
while( uid in this.users) {
uid = generateUserID();
}
//add a new User with an id of uid into the users array
this.users[uid] = new User(uid);
//return UID
return uid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addUser(user) {\n return db('username_password')\n .insert(user, 'id')\n .then(ids => {\n console.log(ids);\n return getUserByID(ids[0]);\n });\n}",
"addUser(id){\n return this.auth.post(`/user/add/${id}`, {}).then(({data})=>data);\n }",
"addUser(user) {\r\n if (th... | [
"0.7257116",
"0.7193392",
"0.7132754",
"0.7061573",
"0.701158",
"0.70020115",
"0.70000494",
"0.69986564",
"0.69008094",
"0.68854165",
"0.6876474",
"0.6828572",
"0.6820017",
"0.6818949",
"0.68046016",
"0.6781627",
"0.67426133",
"0.6742232",
"0.67379487",
"0.67161334",
"0.67059... | 0.8211049 | 0 |
removes user by UID returns true if successful, false otherwise | removeUser(userID) {
if(userID in this.users) {
delete this.users[userID];
return true;
}
else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delUser(userID) {\n\t\tif (confirm('Вы подтверждаете удаление?')) {\n\t\t\t$.post('/admin/acluser/del.php', 'delusrid=' + userID, function(data) {\n\t\t\t\tif (!data.error) {\n\t\t\t\t\t$('#user-row-' + userID).animate({\n\t\t\t\t\t\topacity: 'hide',\n\t\t\t\t\t\theight: 'hide'\n\t\t\t\t\t}, 'slow');\n\t\... | [
"0.70677704",
"0.70503134",
"0.6946844",
"0.6894374",
"0.68711334",
"0.6788887",
"0.6597265",
"0.6590798",
"0.654058",
"0.6504828",
"0.64765215",
"0.6462393",
"0.6460985",
"0.6454768",
"0.6450791",
"0.6421819",
"0.63842183",
"0.6351294",
"0.63256925",
"0.63243896",
"0.6283814... | 0.7479088 | 0 |
generateGroupID generates random numeric ID (0999) for a group | generateGroupID() {
return (Math.random() * 999).toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gid() {\n return '_' + Math.random().toString(36).substr(2, 9);\n }",
"addGroup() {\n\t\t//make a random group id\n\t\tlet gid = generateGroupID();\n\n\t\t//keep trying till a unique one is made\n\t\twhile(gid in this.groups) {\n\t\t\tgid = generateGroupID();\n\t\t}\n\n\t\tthis.groups[gid] = ne... | [
"0.77245635",
"0.7275136",
"0.7206034",
"0.71610916",
"0.71303326",
"0.7129221",
"0.712727",
"0.70657045",
"0.7055859",
"0.69975746",
"0.6980385",
"0.6913556",
"0.6886036",
"0.6883408",
"0.68798345",
"0.6848821",
"0.6832526",
"0.6829368",
"0.68287504",
"0.68206286",
"0.681467... | 0.890112 | 0 |
removes group by GID returns true if successful, false otherwise | removeGroup(groupID) {
if(groupID in this.group) {
delete this.group[groupID];
return true;
}
else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove_group(id) {\n $(''+id).remove();\n return true;\n} // remove_group()",
"function removeFromGroup(groupID, user) {\n console.log(\"rem callled - for group=\" + groupID + \" user=\"+user);\n for(var i=0; i < clients.length; i++) {\n if (clients[i][\"user\"] == user) {\n ... | [
"0.7130297",
"0.6808531",
"0.66707665",
"0.63616174",
"0.6306607",
"0.610341",
"0.610107",
"0.6099346",
"0.60845685",
"0.6021291",
"0.5962456",
"0.5889155",
"0.583113",
"0.58247113",
"0.58073115",
"0.5799863",
"0.5796883",
"0.5777658",
"0.5734291",
"0.57338697",
"0.5733836",
... | 0.6948233 | 1 |
Green check mark replaces student avatar on checkin | function checkedIn(imgSrc, stuID) {
var avatar = document.createElement('img');
avatar.setAttribute("src", imgSrc);
avatar.setAttribute("alt", "Student Avatar");
avatar.setAttribute("class", "img-circle");
var checkMark = document.createElement('img');
checkMark.setAttribute("src", "/Content/Ava... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function avatar(ava) //selects the avatar of the user\n{\n if(ava==='ronan')\n {\n\tavatarPic=\"ronan\";\n }\n else if(ava==='john')\n {\n\tavatarPic=\"john\";\n }\n else if(ava==='carter')\n {\n\tavatarPic=\"carter\";\n }\n else if(ava==='mckay')\n {\n\tavatarPic=\"mckay\";\n }\n \n}",
"function sa... | [
"0.6316756",
"0.602471",
"0.6012076",
"0.59823793",
"0.5913451",
"0.587599",
"0.5869863",
"0.57617253",
"0.5760109",
"0.573907",
"0.57076466",
"0.5640917",
"0.5629472",
"0.56211513",
"0.559949",
"0.5579814",
"0.55628103",
"0.5560834",
"0.5530068",
"0.54930854",
"0.54710084",
... | 0.65889955 | 0 |
Validate if the university contains the selected program | function containsProgram(selectedProgram, uniPrograms) {
let program;
for(let i = 0; i < uniPrograms.length; i++) {
program = uniPrograms[i].textContent || uniPrograms[i].innerText;
if (program.localeCompare(selectedProgram) === 0) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"validateDegreeReqs() {\n let program = this.props.program\n let terms = program.terms\n for (let term of terms) {\n let courses = this.props.courses\n for (let course of program[term].courses) {\n if (course == \"MSCI 261\" || courses[course].replaces == \"MSCI 261\") {\n return ... | [
"0.6146856",
"0.5973021",
"0.5708545",
"0.56463754",
"0.5621816",
"0.5606983",
"0.5542474",
"0.5521322",
"0.54972816",
"0.54678804",
"0.5463612",
"0.5450755",
"0.5399629",
"0.5379707",
"0.5316884",
"0.53102905",
"0.53063273",
"0.5296281",
"0.5281629",
"0.52782756",
"0.5273219... | 0.68899745 | 0 |
Jedi object params: initName The name string that represent the Jedi initImage The image string that represents the Jedi initStartHp The inital hp of the Jedi initAttack The inital attack of the Jedi initCounterAtk The inital counter attack of the Jedi return: return a reference to this object | function jedi(initName, initImage, initStartHp, initAttack, initCounterAtk)
{
this.name = initName;
this.image = initImage
this.startHp = initStartHp;
this.hp = initStartHp;
this.baseAtk = initAttack;
this.currentAtk = initAttack;
this.counterAtk = initCounter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createJedi(name)\n {\n // this methodology isnt really relevent for this project since there is only 1 object type were making\n // I should also look into how the 'new' keyword really works and object.create but this works for now\n switch(name)\n {\n case \"Obi-... | [
"0.5894843",
"0.58261585",
"0.57853734",
"0.5659849",
"0.55651754",
"0.5554715",
"0.5525536",
"0.552229",
"0.5496624",
"0.54658616",
"0.5462884",
"0.53916717",
"0.5377551",
"0.53409475",
"0.53207344",
"0.527888",
"0.5252119",
"0.520231",
"0.518739",
"0.51768374",
"0.5142612",... | 0.80105644 | 0 |
Object Factory for the jedis calls the correct constructor for the jedi objects params: name name of the jedi to create return: reference to the created jedi or an error string | function createJedi(name)
{
// this methodology isnt really relevent for this project since there is only 1 object type were making
// I should also look into how the 'new' keyword really works and object.create but this works for now
switch(name)
{
case "Obi-Wan Kenobi":... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function factory() {}",
"function factory() {}",
"function Factory (name) {\n\tthis.name = name\n}",
"function Factory(){}",
"function factory(name){\n return {\n name:name\n };\n}",
"function ReaderFactory() {}",
"function DUPairFactory() {\n}",
"function jfactory(name, factoryFn) {\n ... | [
"0.5894831",
"0.5894831",
"0.5845049",
"0.57846916",
"0.57382697",
"0.57340795",
"0.5457639",
"0.54297364",
"0.54277617",
"0.54167",
"0.5396018",
"0.53782123",
"0.52780676",
"0.52780676",
"0.52237004",
"0.5197404",
"0.51951134",
"0.51939964",
"0.5185177",
"0.5181944",
"0.5147... | 0.70490235 | 0 |
Populates the given map with jedi objects params: mapToPop reference to a map object to add jedi into | function populateMap(mapToPop)
{
//key is the jedi's name and value is a reference to the jedi object
mapToPop.set("Obi-Wan Kenobi", createJedi("Obi-Wan Kenobi"));
mapToPop.set("Luke Skywalker", createJedi("Luke Skywalker"));
mapToPop.set("Darth Vader", createJedi("Darth Vader"));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initMap() {\n map = new ExploreMap();\n}",
"function ImmyMap(initMap) {\n if (initMap) {\n this.map = initMap;\n } else {\n this.map = null;\n }\n\n this.patchSource = null;\n this.patch = null;\n this.root = {};\n}",
"addToJSMap(ctx, map) {\n for (const {\n so... | [
"0.55823493",
"0.5302986",
"0.5120751",
"0.51102835",
"0.5108924",
"0.5108924",
"0.5093332",
"0.5077257",
"0.5077257",
"0.49980432",
"0.49406803",
"0.49141547",
"0.49026957",
"0.49015522",
"0.48980933",
"0.4868011",
"0.48667106",
"0.4845068",
"0.48425615",
"0.4771857",
"0.476... | 0.79277456 | 0 |
Select a jedi out of the map and return a reference to the object params: jediPicked string of the name of the jedi that was picked mapIn the map that the jedi object should be extracted from return: reference to the extracted jedi | function pickJedi(jediPicked, mapIn)
{
var temp = mapIn.get(jediPicked);
mapIn.delete(jediPicked);
return temp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"simpleSelect(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n condition: \"click\"\n }, json);\n let selector = new ol_interaction_Select_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]();\n self.maps[options.map].object.addInteraction(selector);\n ... | [
"0.56026703",
"0.53696406",
"0.5301609",
"0.51656586",
"0.5068938",
"0.4981288",
"0.49790832",
"0.4922903",
"0.4869149",
"0.48607436",
"0.48143092",
"0.4752943",
"0.47486722",
"0.4707921",
"0.46910855",
"0.46699163",
"0.46563318",
"0.4605818",
"0.46014553",
"0.45945084",
"0.4... | 0.7455408 | 0 |
function that handles the initial load populates the jedi list and initializes sets initial gamestate | function load()
{
populateMap(gameInfo.jediList);
init();
gameInfo.gameState = "pickChar";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init()\n {\n for(let i of gameInfo.jediList)\n {\n gameInfo.pickableJedi.set(i[0], i[1]);\n }\n \n }",
"function initGame() {\n first_item_timestamp = Math.round((new Date().getTime()) / 100) / 10;\n initializeSetsOfChoices();\n adjustSlider(se... | [
"0.72275823",
"0.68055654",
"0.66943395",
"0.6626638",
"0.6617467",
"0.6611247",
"0.6541303",
"0.6539019",
"0.65241987",
"0.6514365",
"0.64716625",
"0.642351",
"0.6414575",
"0.63982743",
"0.63648176",
"0.635503",
"0.6342596",
"0.63358575",
"0.63325185",
"0.63147545",
"0.63131... | 0.7734907 | 0 |
Determine the current server based on `isDeuce` and the `scoreTotal`. Runs whenever either property has changed and modifies the observable `server` property | _determineServer() {
let nextServer;
if (this.isDeuce) {
nextServer = (this.scoreTotal % 2 === 0)
? this.playerOne.id : this.playerTwo.id;
} else if (this.scoreTotal === 0) {
nextServer = this.playerOne.id;
} else if (this.scoreTotal % 2 === 0) {
nextServer = this._getOpposi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getServer() {\n return this.server;\n }",
"get server() {\n\t\treturn this._server;\n\t}",
"update_server(){\n return this.get_value()!=this.properties.value\n }",
"get isServer() {\n\t\treturn this._isServer;\n\t}",
"getServer() {\n\n return this.server;\n }",
"get serverInfo () ... | [
"0.580458",
"0.5787388",
"0.5742201",
"0.5625234",
"0.54849786",
"0.53704774",
"0.5253333",
"0.52230453",
"0.5217856",
"0.52113396",
"0.5109322",
"0.50865495",
"0.5057483",
"0.50565237",
"0.5043757",
"0.5040215",
"0.49933398",
"0.4961064",
"0.49377808",
"0.49352953",
"0.49202... | 0.7086006 | 0 |
Creates a temporary stickynote on the screen | function createStickynote(bOpensEditor, sColour){
//const sRandomStickyColour = chooseRandomStickyColour(); !!!
sNewStickyColour = sColour;
const stickyFormat = '<div class="sticky_data sticky_div new_sticky"><div class="stickynote clickable">' +
'<img class="sticky_img sticky_elem" src="./Images/stick... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNote() {\n return '<div class=\"note\"> </div> \\n';\n}",
"function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !=... | [
"0.6270703",
"0.6114539",
"0.6065691",
"0.6063417",
"0.5987783",
"0.59499264",
"0.59318304",
"0.59225535",
"0.5900435",
"0.5847466",
"0.57818174",
"0.5742615",
"0.5682173",
"0.56709534",
"0.5618799",
"0.5603968",
"0.559079",
"0.555414",
"0.5549055",
"0.5531975",
"0.551362",
... | 0.6609479 | 0 |
updates the display of stickynote at index i (based upon its data in the array) call this after updating the data of a sticky in the array | function updateStickynote(i){
//update the title
$( ".sticky_div p:eq(" + (i+1) + ")" ).text(tStickies[i].title);
//update the colour
$(".sticky_div .sticky_img:eq(" + (i+1) + ")").attr("src","./Images/stickynote_"+ tStickies[i].colour + ".png");
//DO NOT CALL sortStickies() IN HERE AS sortStickies() CALLS TH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteStickynote(i){\r\n\tconsole.log(\"Sticky \" + tStickies[i].title + \"(\" + i + \") has been deleted...\")\r\n\ttStickies[i] = tStickies[tStickies.length-1]; //put the last element in its place (so we don't fck up the onclicklisteners)\r\n\ttStickies.pop(); //delete the data from the array\r\n\t$('.s... | [
"0.6526648",
"0.63961005",
"0.63303477",
"0.61246634",
"0.598676",
"0.59474534",
"0.59265864",
"0.5912481",
"0.58915126",
"0.5887454",
"0.58469653",
"0.58371",
"0.5818241",
"0.58003575",
"0.5799048",
"0.578857",
"0.5786137",
"0.57732826",
"0.5759775",
"0.5739751",
"0.57224685... | 0.77686983 | 0 |
deletes the stickynote at index i; | function deleteStickynote(i){
console.log("Sticky " + tStickies[i].title + "(" + i + ") has been deleted...")
tStickies[i] = tStickies[tStickies.length-1]; //put the last element in its place (so we don't fck up the onclicklisteners)
tStickies.pop(); //delete the data from the array
$('.stickyNotesGrid div').re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearStickies(){\r\n\t//delete backwards\r\n\tfor (i=tStickies.length-1; i>=0; i--){\r\n\t\tdeleteStickynote(i);\r\n\t}\r\n}",
"function note_delete(_noteindex){\r\n\tif(_noteindex>=0 & _noteindex<notes.length) {\r\n\t\tnotes.splice(_noteindex,1);\r\n\t\tnumnote--;\r\n\t}\r\n}",
"function deleteNote(i... | [
"0.7105816",
"0.67765623",
"0.6745478",
"0.6736984",
"0.6702701",
"0.6670928",
"0.6670928",
"0.66700137",
"0.6662645",
"0.6657075",
"0.6624107",
"0.6622698",
"0.66205376",
"0.66157675",
"0.66121745",
"0.66071075",
"0.6602014",
"0.65862936",
"0.6576375",
"0.6576077",
"0.657065... | 0.6966206 | 1 |
gets rid of all stickies on the screen. I.e. it DELETES them | function clearStickies(){
//delete backwards
for (i=tStickies.length-1; i>=0; i--){
deleteStickynote(i);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sparkle_destroy() {\n\n let elem;\n while (tiny.length) {\n elem = tiny.pop();\n if (elem) {\n document.body.removeChild(elem);\n }\n }\n\n while (star.length) {\n elem = star.pop();\n if (elem) {\n document.body.removeChild(elem);\n ... | [
"0.7132357",
"0.70822775",
"0.68242866",
"0.6819664",
"0.6809401",
"0.67465687",
"0.6734113",
"0.6730698",
"0.67163616",
"0.6714244",
"0.6616025",
"0.66004145",
"0.65770304",
"0.6556765",
"0.65479505",
"0.6518706",
"0.6499473",
"0.6492112",
"0.6490916",
"0.64807343",
"0.64757... | 0.7798492 | 0 |
returns the user's index if the given usernamepassword combination are valid, returns 1 otherwise | function getValidLogin(sUsername, sPassword){
for (i=0; i<tUsers.length; i++){
//console.log(tUsers[i].user_username + ", " + tUsers[i].user_password);
if (tUsers[i].user_username === sUsername && tUsers[i].user_password === sPassword){
console.log('VALID');
return i;
}
}
return -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_username(username){\n update_all_user_list();\n let invalid_username = 1;\n let good_index = 0; // this will store which index in array contains the user that matches the username\n // check through database which is currently an array (phase1)\n for (let i = 0; i < all_accounts.length; i++)... | [
"0.7351248",
"0.72506887",
"0.6924054",
"0.6879874",
"0.6688643",
"0.66118956",
"0.6563476",
"0.65225637",
"0.6518466",
"0.64269626",
"0.63466096",
"0.6240493",
"0.6233257",
"0.6232594",
"0.62000763",
"0.6194418",
"0.61928403",
"0.61702585",
"0.61506313",
"0.6148828",
"0.6131... | 0.7748345 | 0 |
retrieves and places the user's stickies on the screen | function retrieveUserStickies(sUsername){
const sUser = "user_" + sUsername;
for (i=0; i<tUserData[sUser].length; i++){
let pSticky = tUserData[sUser][i];
//prevent duplicate data
if (!isStickyLoadedInTable(tStickies, pSticky)){
createStickynote(false, pSticky.colour);
//this actually places a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showStickers(data){\n stickers.empty();\n\n data.forEach(item =>{\n createSticker(item);\n });\n}",
"function stick(my) {\n entities.forEach(function(element) {\n if (element.poisoned && element.type == 'tank') {\n let loc = returnRandomRingPoint(element.size * 2.2... | [
"0.60034096",
"0.57320786",
"0.5679248",
"0.56540686",
"0.54555917",
"0.54371214",
"0.5412336",
"0.5371494",
"0.53464496",
"0.5307091",
"0.527285",
"0.52705073",
"0.52605784",
"0.5230215",
"0.52113545",
"0.5177586",
"0.51698095",
"0.516867",
"0.5143408",
"0.5107488",
"0.51071... | 0.6215628 | 0 |
checks if a given sticky is already loaded into a given table (to prevent duplicates) | function isStickyLoadedInTable(tTable, pSticky){
for (j=0; j<tTable.length; j++){ //can't use i as an iterator here because other functions call this function in an iterator with i #justjavascriptthings
if (tTable[j] === pSticky){
console.log('already loaded: ' + pSticky.title);
//return true if another st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkStickyStates() {\n const stickyCheckReducer = (acc, d) => {\n return acc || d.hasStickyChanged();\n };\n // Note that the check needs to occur for every definition since it notifies the definition\n // that it can reset its dirty state. Using another operator like `some... | [
"0.6111386",
"0.5857324",
"0.5813583",
"0.5734871",
"0.5526899",
"0.551876",
"0.5472352",
"0.542135",
"0.53764415",
"0.5365885",
"0.5365885",
"0.5319385",
"0.5230787",
"0.5168339",
"0.5140971",
"0.51388276",
"0.51020545",
"0.5053707",
"0.5009298",
"0.50017494",
"0.4976947",
... | 0.80683637 | 0 |
when logging in, save all the user's stickies to the tUserData the objects will be stored there, and the elements in tStickies will be updated to contain pointers to that data | function onLogin(){
$('#id_dropdown_login').stop().slideUp();
bIsLoggedIn = true;
//Update the text to state 'Logged in'
$('#id_login_button').text('LOGGED IN (' + tUsers[iCurrentUser].user_name + ')');
//Greeting to the user
$('#id_greeting_user').text('Hi ' + tUsers[iCurrentUser].user_name + '!');
//... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveUserData() {\n\tupdateSnakeStorage();\n\tsetLocalStorageItem(\"Snake\", SNAKE_STORAGE);\n}",
"function storeUserData () {\n\t\tvar key,\n\t\tstorageData = {};\n\n\t\t// Loop thru user object and encode each name/value.\n\t\tfor (key in user) {\n\t\t\tif (user.hasOwnProperty(key)) {\n\t\t\t\tstorageD... | [
"0.7105751",
"0.6365986",
"0.6349561",
"0.63057816",
"0.6252801",
"0.62435645",
"0.61902666",
"0.6093366",
"0.601495",
"0.5998859",
"0.5963335",
"0.5954182",
"0.5930747",
"0.59213483",
"0.59213483",
"0.5831947",
"0.583165",
"0.5827222",
"0.5817134",
"0.58151126",
"0.5808096",... | 0.6713425 | 1 |
Complete the timeInWords function below. | function timeInWords(h, m) {
const numberToWord = new Map([[1, 'one'], [2, 'two'], [3, 'three'], [4, 'four'], [5, 'five'], [6, 'six'], [7, 'seven'], [8, 'eight'], [9, 'nine'], [10, 'ten'],
[11, 'eleven'], [12, 'twelve'], [13, 'thirteen'], [14, 'fourteen'], [15, 'quarter'], [16, 'sixteen'], [17, 'seventeen'], [1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllWordsTimestamps(){\n for(var i = 0; i < allSpans.length;i++){\n if(allSpans[i].innerHTML[0] === ' '){\n getWordObject(allSpans[i].innerHTML)\n }\n }\n\n }",
"function doTimer(words, clickTimes, divWords, prevTime, divInstr) {\n\t// set the timer\n var cur... | [
"0.6898739",
"0.6285396",
"0.60613304",
"0.59707266",
"0.59454596",
"0.5888219",
"0.5836474",
"0.582802",
"0.5782248",
"0.5749298",
"0.5739595",
"0.57370913",
"0.5708411",
"0.57013494",
"0.5685262",
"0.5685262",
"0.5685262",
"0.5685262",
"0.5646422",
"0.5643831",
"0.5642383",... | 0.6393495 | 1 |
When a new city is selected, change the ride types dropdown with the ride types available for that city. | function citySelected(option) {
vm.selectedCity = option.city;
vm.rideTypes = option.rideTypes;
vm.selectedRideType = vm.rideTypes[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rideTypeSelected(option) {\n\t\t\tvm.selectedRideType = option;\n\t\t}",
"function newJerseyAtlantic(){\r\n\t//clear all previous options if the exist\r\n\tdijit.byId('townSelect').removeOption(dijit.byId('townSelect').getOptions());\r\n\r\n\tvar atlanticTowns = [\r\n\t{\r\n\t\tlabel:'Select A Town',\r\... | [
"0.65375847",
"0.6087875",
"0.6060413",
"0.60556287",
"0.6038156",
"0.5981275",
"0.58636165",
"0.57951915",
"0.57654685",
"0.5623253",
"0.5614171",
"0.5611394",
"0.55483234",
"0.55436176",
"0.55379224",
"0.55213493",
"0.55091393",
"0.54224706",
"0.5413534",
"0.5404306",
"0.53... | 0.64396846 | 1 |
When a new ride type is selected, change the selected ride type. | function rideTypeSelected(option) {
vm.selectedRideType = option;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setTypeDraw(typeSelected) {\r\n typeSelect = typeSelected;\r\n map.removeInteraction(draw);\r\n addInteraction();\r\n}",
"function onSelectType(type){\n\t/*\n\t * if selected type is structure or land and selected group by option is property\n\t * we must reset group by option to ctry\n\t */\n\... | [
"0.63846755",
"0.6372125",
"0.6276897",
"0.6259278",
"0.6218978",
"0.60479933",
"0.60167265",
"0.5930195",
"0.59234864",
"0.59025896",
"0.5875387",
"0.58381057",
"0.5833145",
"0.58200645",
"0.5775703",
"0.5745081",
"0.57255304",
"0.57170874",
"0.5700821",
"0.56767434",
"0.566... | 0.813228 | 0 |
Get city data from list of cities. | function getCityData(city) {
for (var i = 0; i < cities.data.length; i++) {
if (cities.data[i].name === city) {
return cities.data[i];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCityData(cityName) { // e.g. cityName == 'Washington, DC'\n for (var i = 0; i < cities.length; i += 1) {\n if (cities[i].name === cityName)\n return cities[i];\n }\n console.log('Error: city not found.');\n return null;\n}",
"function getCitiesList() {\n var self = this... | [
"0.71413714",
"0.68710864",
"0.6844857",
"0.68007857",
"0.6733431",
"0.66185176",
"0.65217924",
"0.6514755",
"0.64689124",
"0.64449614",
"0.64283174",
"0.6352017",
"0.6328172",
"0.6321841",
"0.6296563",
"0.6292045",
"0.6260564",
"0.62220633",
"0.62187135",
"0.6216482",
"0.619... | 0.75156355 | 0 |
show the current frame of video on the canvas[screenShot] | function currentFrameCanvas(){
let video = document.getElementById("video_id");
canvas = document.getElementById('screenShot');
canvas.width = width;
canvas.height = height;
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawFrameOnCanvas(frame) {\n\t\n\t\tvar reset = frame.reset;\n\t\n canvas.height = video.videoHeight;\n canvas.width = video.videoWidth;\n\t\t// retrieve context for drawing\n\t\tvar context = canvas.getContext(\"2d\");\n\t\t\t\t\n\t\t// Start by clearing the canvas\n\t\tcontext.clearRect(0,... | [
"0.73607457",
"0.72314173",
"0.7192135",
"0.71690285",
"0.7106946",
"0.71002585",
"0.7093658",
"0.70567733",
"0.69749844",
"0.6850794",
"0.6830944",
"0.6821561",
"0.68094677",
"0.6793582",
"0.6697223",
"0.6680956",
"0.6674495",
"0.6663376",
"0.66392213",
"0.6631781",
"0.65786... | 0.796463 | 0 |
cut the selected object with point(x1,y1) and point(x2,y2) | function cutObj(x1,y1,x2,y2){
currentFrameCanvas();
let ctx = canvas.getContext('2d');
ctx.strokeStyle="#0000ff";
ctx.lineWidth = 3;
ctx.rect(x1,y1,x2-x1,y2-y1);
ctx.stroke();
let cut = document.getElementById("canvasCut");
cut.width = Math.abs(x2-x1);
cut.height = Math.abs(y2-y1);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cutPoint(x11,y11,x12,y12, x21,y21,x22,y22)\n{\n//handle special case -- same line\nvar x, res = -1;\n\nif ((x11==x21)&&(y11==y21))\n\t{\n\tx = x11;\n\tres = y11;\n\t}\nif ((x12==x22)&&(y12==y22)&&(y22>y11))\n\t{\n\tx = x12;\n\tres = y22;\n\t}\nif (res >=0)\n\treturn new Point(x, res);\n\t\n//calculate lin... | [
"0.6985227",
"0.6229441",
"0.6140436",
"0.60988885",
"0.599127",
"0.5817493",
"0.57911754",
"0.57752603",
"0.5749612",
"0.5699297",
"0.5626694",
"0.5622316",
"0.5622316",
"0.5622316",
"0.5622316",
"0.5622316",
"0.5604395",
"0.5536617",
"0.55364436",
"0.55303234",
"0.55228245"... | 0.70365304 | 0 |
function that gets called when we amove the mouse change the instance variables sending the mousePos to the gunPos | changeGunPos(mousePos){
this.gun.changeGunPos(mousePos);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function positionGun(){\n\tif (Math.abs(mouseX * .005) < 1.45){\n\t\tgunMesh.rotation.z = (mouseX * .005);\n\t}\n\t\n\tif(Math.abs(-mouseY * .005) + 1.2 < 2.2){\n\t\tgunMesh.rotation.x = (-mouseY * .005) + 1.2;\n\t}\n\tgunMesh.updateMatrix();\n}",
"mouseMoveHandler(evt){\n let mousePos = this.calculateMousePo... | [
"0.69371855",
"0.6801955",
"0.6717327",
"0.6689837",
"0.6669764",
"0.6664436",
"0.66583043",
"0.6634412",
"0.6532053",
"0.6515048",
"0.64777094",
"0.64742553",
"0.6470658",
"0.6434863",
"0.64276123",
"0.6426115",
"0.6425506",
"0.6421663",
"0.64106697",
"0.64071006",
"0.635256... | 0.8275005 | 0 |
Generates a new location value and sends to output based on parameters set | function update_location () {
var j = getParameter('MaxVariance');
var alter = getRandomArbitrary(j/2, j);
var neg = getRandomInt(1, 3);
if (neg == 1) {
alter *= -1;
}
// Choose which axis to change on this iteration
var whichone = getRandomInt(0, 3);
if (whichone == 0) {
// ALTER X
var n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function goTo(location){\n\tcurrentLocation = location; //set the current location\n\tdocument.getElementById('descriptionDiv').innerHTML = currentLocation.description; //display the description of the new location\n\tdocument.getElementById('outputDiv').innerHTML = '';\n}",
"function getRandomLocation() {\n\n}"... | [
"0.61887044",
"0.61162853",
"0.6076232",
"0.59105957",
"0.58632284",
"0.58320713",
"0.5824339",
"0.5781474",
"0.5753122",
"0.5742971",
"0.5728507",
"0.5686444",
"0.5672287",
"0.5662767",
"0.56533766",
"0.5637179",
"0.5634158",
"0.5631838",
"0.56169206",
"0.5609864",
"0.560188... | 0.62927836 | 0 |
LOGIC TO DELETE COURSE | function deleteCourse() {
let courseId = $(this).attr('data-id');
coursesService.deleteCourse(courseId)
.then(() => {
showInfo('Course deleted.');
loadMyCourses();
// showView('Catalog');
}).catch(handleError);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteCourse(course) {\r\n return this.context\r\n .execute(`\r\n DELETE FROM Courses\r\n WHERE id = ?\r\n `,\r\n course.id\r\n )\r\n }",
"deletehsCourse(hscourse){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = th... | [
"0.7612827",
"0.720874",
"0.7102067",
"0.70527494",
"0.7007595",
"0.6942941",
"0.69341123",
"0.6932173",
"0.69289815",
"0.6913503",
"0.687369",
"0.6790397",
"0.6757411",
"0.67394614",
"0.6695486",
"0.66452014",
"0.6596948",
"0.65370643",
"0.6535309",
"0.6493348",
"0.6488327",... | 0.75572973 | 1 |
triggerPoint = vertical scroll value where the callbacks are executed callbackBelowTrigger = callback to execute when window.scrollY turns to less than (=) the trigger point | function scrollTrigger(triggerPoint, callbackBelowTrigger, callbackOverTrigger) {
var isPastTriggerPoint;
if (isOver()) {
callbackOverTrigger();
isPastTriggerPoint = true;
} else {
callbackBelowTrigger();
isPastTriggerPoint = false;
}
function isBelow() {
return wind... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onPageScroll() {\r\n\tvar trigger = \"scroll\";\r\n}",
"function actualScrollHandler () {\n\t\t_direction = latestKnownScroll.top < _prevTop? \"up\" : \"down\";\n\t\t_prevTop = latestKnownScroll.top;\n\n\t\t$(window).trigger({\n\t\t\ttype: \"Katoen:ScrollEvent\",\n\t\t\tlatestKnownScroll: latestKnownScr... | [
"0.61027074",
"0.6011135",
"0.5864956",
"0.5842413",
"0.5759875",
"0.5746709",
"0.57229215",
"0.5673188",
"0.56695974",
"0.5666676",
"0.56593657",
"0.56320614",
"0.56250846",
"0.560875",
"0.55219114",
"0.5510005",
"0.54933",
"0.54908437",
"0.544093",
"0.5426675",
"0.54153204"... | 0.8139176 | 0 |
create tHead helper function Takes header rows from tables and puts them in tHead element Uses rows at beginning of table containing only THs Stops at row with TDs or row with "firstrow" class | function createTHead(table) {
var thead = table.tHead;
if (thead) return thead;
thead = document.createElement("thead");
var tbody = table.tBodies[0];
table.insertBefore(thead, tbody);
for (var i = 0; i < tbody.rows.length; i++) {
var tbodyrow = tbody.rows[0];
if (tbodyrow.queryS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeTableHead() {\n var headParent = createElement('thead', 'id', 'table-head', 'Hours', tableEl);\n for (var iHead = 0; iHead < hoursOpen.length; iHead++) {\n createElement('th', 'class', 'time-indicator', hoursOpen[iHead], headParent);\n }\n createElement('th', 'id', 'totals', 'Total', headParent... | [
"0.7765515",
"0.77302265",
"0.77043074",
"0.73742753",
"0.72175074",
"0.71871144",
"0.716373",
"0.71489394",
"0.7118727",
"0.7063739",
"0.7046727",
"0.7038671",
"0.6983867",
"0.6982871",
"0.6955534",
"0.69542766",
"0.69501597",
"0.69501597",
"0.6937738",
"0.69375074",
"0.6937... | 0.7768978 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.