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 |
|---|---|---|---|---|---|---|
resets all virus values that are displayed in the popup to zero | function resetVirusValues(){
bayern_virus_value = 0;
baden_virus_value = 0;
nrw_virus_value = 0;
hessen_virus_value = 0;
niedersachsen_virus_value = 0;
schleswigholst_virus_value = 0;
mecklvorp_virus_value = 0;
saarland_virus_value = 0;
rheinlandpfalz_virus_value = 0;
thuering... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetValues () {\n Preferences.set('visualCascade', false);\n Preferences.set('browsers', Preferences.defaults.browsers);\n\n init();\n }",
"function resetVillain() {\n villainSelected = false;\n villainName = \"\";\n villainTeam = \"\";\n villainImg = \"\";\n ... | [
"0.686453",
"0.65350837",
"0.6491157",
"0.64574975",
"0.6318023",
"0.63014114",
"0.628412",
"0.6243112",
"0.62402713",
"0.62368137",
"0.62130475",
"0.6211041",
"0.61714864",
"0.617039",
"0.6168847",
"0.61606985",
"0.6158199",
"0.6157492",
"0.6143497",
"0.6123751",
"0.6114786"... | 0.78296435 | 0 |
scales all virus icons to zero | function scale_to_zero() {
scaleIcon(bayern_virus, 0);
scaleIcon(baden_virus, 0);
scaleIcon(nrw_virus, 0);
scaleIcon(hessen_virus, 0);
scaleIcon(niedersachsen_virus, 0);
scaleIcon(schleswigholst_virus, 0);
scaleIcon(mecklvorp_virus, 0);
scaleIcon(saarland_virus, 0);
scaleIcon(thueringen_virus, 0);
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_virusicons(week_text) {\n setVirusIconScaleByCases(week_text, \"Bayern\", bayern_virus);\n setVirusIconScaleByCases(week_text, \"Baden-Wurttemberg\", baden_virus);\n setVirusIconScaleByCases(week_text, \"Nordrhein-Westfalen\", nrw_virus);\n setVirusIconScaleByCases(week_text, \"Hessen\", he... | [
"0.6994738",
"0.59813935",
"0.5719007",
"0.52056473",
"0.5192977",
"0.5192977",
"0.5191975",
"0.51834905",
"0.51770747",
"0.516201",
"0.5127838",
"0.5085058",
"0.5073357",
"0.5071485",
"0.5044244",
"0.50312895",
"0.5000759",
"0.49908537",
"0.49768057",
"0.49636626",
"0.495374... | 0.8079422 | 0 |
Functions for interact with modalreview window. | function openModal() {
if (reviewModal)
closeModal();
map.behaviors.disable(['drag', 'scrollZoom', 'dblClickZoom']);
reviewModal = reviewModalTemplate.cloneNode(true);
mapSection.appendChild(reviewModal);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showActivateSpecReviewModal() {\n\n // show spec review popup\n $('#TB_overlay').show();\n $('#TB_window_custom').show();\n $('.TB_overlayBG').css('height', document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight);\n $('#TB_window_cu... | [
"0.7223154",
"0.65934634",
"0.6516721",
"0.64174056",
"0.6285849",
"0.62280947",
"0.6215664",
"0.6215664",
"0.61831945",
"0.61378187",
"0.6096868",
"0.6077406",
"0.6064065",
"0.60277474",
"0.59293264",
"0.59086365",
"0.59086365",
"0.5874111",
"0.58628637",
"0.58617294",
"0.58... | 0.6629942 | 1 |
Example for handle a get request at '/:roomName' endpoint. | function getRoom(request, response) {
let roomName = request.params.roomName;
// Chatroom.find({chatroom_name: roomName}, function (err, docs) {
// if (err) {
// console.log(err);
// } else {
// let roomId;
// // If a chatroom with that name exists get it, else create one
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getRoom(req, res, next) {\n try {\n const room = await models.room.findById(req.params.roomId, {\n include: [models.instrument],\n });\n res.send(room);\n } catch (e) {\n next(e);\n }\n}",
"getRoom() {\n var query = location.search && location.search.split(\"?\")[1];\n\n ... | [
"0.6675338",
"0.62353766",
"0.61835134",
"0.617235",
"0.61693233",
"0.6019861",
"0.60157657",
"0.6009634",
"0.60090774",
"0.590591",
"0.58870375",
"0.5879693",
"0.58560514",
"0.58069646",
"0.5805209",
"0.5797241",
"0.5775696",
"0.57735586",
"0.5766746",
"0.5747818",
"0.574402... | 0.67399806 | 0 |
Returns the list of values between min, max using step | function range(min, max, step) {
var r = [];
for (var i = min; i <= max; i += step) { r.push(i); }
return r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function range(min, max, step = 1) {\n const arr = [];\n for (let i = min; i < max; i += step) {\n arr.push(i);\n }\n return arr;\n}",
"function range(start, end, step=1) {\n let values = [];\n\n if (end > start) {\n for(let i = start; i < end; i += step) {\n values.push(i);\n }\n ... | [
"0.77789974",
"0.76436985",
"0.7487905",
"0.7467674",
"0.7430191",
"0.7296622",
"0.724788",
"0.7191913",
"0.7187716",
"0.718503",
"0.7156208",
"0.7140406",
"0.71394694",
"0.7112173",
"0.710863",
"0.7106758",
"0.71064544",
"0.7102177",
"0.709935",
"0.7074036",
"0.70472294",
... | 0.79136723 | 0 |
Membuat function hitung() sebagai Penghitungan Waktu | function hitung() {
/** setTimout(hitung, 1000) digunakan untuk
* mengulang atau merefresh halaman selama 1000 (1 detik)
*/
setTimeout(hitung,1000);
/** Jika waktu kurang dari 10 menit maka Timer akan berubah menjadi warna merah */
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.a... | [
"0.63722265",
"0.63599545",
"0.62933934",
"0.6284002",
"0.6263414",
"0.62552226",
"0.6238274",
"0.61882013",
"0.6185444",
"0.6181841",
"0.6159617",
"0.6155339",
"0.6147416",
"0.61467505",
"0.6137457",
"0.6131859",
"0.6111205",
"0.6110639",
"0.60880256",
"0.60754806",
"0.60639... | 0.6576618 | 0 |
Parse a statistic, returning the type of metric that was used | function parseStatistic(stat) {
const lowerStat = stat.toLowerCase();
// Simple statistics
const statMap = {
average: stats_1.Stats.AVERAGE,
avg: stats_1.Stats.AVERAGE,
minimum: stats_1.Stats.MINIMUM,
min: stats_1.Stats.MINIMUM,
maximum: stats_1.Stats.MAXIMUM,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseMeasure2(m) {\n var s = utils.isString(m) ? m : '';\n var match = /(sq|)([a-z]+)(2|)$/i.exec(s); // units rxp\n var o = {};\n if (utils.isNumber(m)) {\n o.value = m;\n } else if (s === '') {\n o.value = NaN;\n } else if (match) {\n o.units = UNITS_LOOKUP[match[2].toLo... | [
"0.5459445",
"0.5340902",
"0.5277614",
"0.5245887",
"0.52123195",
"0.5179921",
"0.5150749",
"0.5111629",
"0.50208205",
"0.50081176",
"0.48927528",
"0.4882453",
"0.48177984",
"0.4816099",
"0.48101774",
"0.4809066",
"0.48005572",
"0.47812557",
"0.47541767",
"0.47443262",
"0.473... | 0.71888834 | 0 |
UPDATING WORD WAITINF FOR HTML IN DRAW updating word loop, running every 1000ms | function updateWord() {
// check the array of the word
for(var i=0;i<18;i++){
var id= "#i"+i;
//console.log(aux2);
//console.log(aux3);
if($(id).children().length > 0){
var url = $(id).children().css('background-image');
url = url.match(/url\(["']?([^"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function textBuilding() {\n if (i < textFull.length) {\n i = i + 1;\n //Building the text on each itteration\n textBuild += (textFull.charAt(i));\n //Posting the current build into the page\n postMessage(textBuild);\n } else {\n w.terminate();\n w = undefined;... | [
"0.6564195",
"0.62888217",
"0.6202708",
"0.6144315",
"0.6083038",
"0.60308605",
"0.6026495",
"0.595171",
"0.59500027",
"0.5947731",
"0.5942917",
"0.5905136",
"0.58588415",
"0.5854006",
"0.57757246",
"0.57704335",
"0.5770044",
"0.5768922",
"0.573299",
"0.57009304",
"0.56999564... | 0.6828372 | 0 |
watch dog's job per interval | function job(){
// console.log('Watch dog job start');
WatchDog.isWorking = true;
Zeus.getMonitWorkers(function (err ,workers){
if (err) {
console.log(err);
}
mAsync.eachSeries(workers, function (worker, next){
var memor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"run() {\n this.fillSportListAndTick();\n this.timerID = setInterval(() => {\n this.tick();\n console.log(\"ctr = \"+this.ctr);\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\n this.ctr = this.ctr + 1;\n } else {\n this.ctr = 1;\n }\n }, LIVE_TICK_INTERVAL);... | [
"0.64298654",
"0.63346136",
"0.6293119",
"0.6284584",
"0.6070756",
"0.6008171",
"0.5989891",
"0.5986374",
"0.5933012",
"0.5932278",
"0.5913882",
"0.5877991",
"0.5846978",
"0.58260953",
"0.58072925",
"0.5799475",
"0.5781107",
"0.5778186",
"0.57466185",
"0.5741847",
"0.57381433... | 0.68297076 | 0 |
this function extract information from data and call function for showing this information in table | function infoFromData(data) {
createRowforwatherInfoTable(tableBodyId,data.name,data.weather[0].description);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dataFunc(data) {\n console.log(data.getData());\n console.log(data.getColumns());\n }",
"function infoTable(tableData2) {\n tableData2.map(data => {\n var row = tbody.append(\"tr\");\n // Append each row with data\n row.append(\"td\").text(data.datet... | [
"0.6837139",
"0.663237",
"0.6523384",
"0.6509703",
"0.6497724",
"0.6492705",
"0.64651096",
"0.6429244",
"0.6417552",
"0.6417552",
"0.6413938",
"0.6408794",
"0.6371448",
"0.6360831",
"0.63518536",
"0.6302932",
"0.6302209",
"0.6295384",
"0.6285155",
"0.6264657",
"0.62574637",
... | 0.68896496 | 0 |
for given root its create checkbox | function createCheckBox(rootNode) {
var x = document.createElement("INPUT");
x.setAttribute("type", "checkbox");
rootNode.appendChild(x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function autoCheckbox(obj, root, check) {\r\n\tif (obj.selectedIndex>0) {\r\n\t\t$(root+':'+check).checked=true;\r\n\t\t$(root+':'+check+'Val').value='Yes';\r\n\t}\r\n\telse {\r\n\t\t$(root+':'+check).checked=false;\r\n\t\t$(root+':'+check+'Val').value='No';\r\n\t}\r\n}",
"function sohyperTree(checkParent, treeU... | [
"0.6621326",
"0.6481996",
"0.64666563",
"0.61547595",
"0.6153438",
"0.6136121",
"0.605651",
"0.60242754",
"0.6023447",
"0.6003729",
"0.59923345",
"0.59743077",
"0.59731954",
"0.5957832",
"0.59526765",
"0.5917541",
"0.5910804",
"0.5910804",
"0.59049195",
"0.5875425",
"0.584255... | 0.76398814 | 0 |
on delete button this will called if all selected then it will call deleteAllRow else it will call deleteRow | function deleteForTableFunction() {
if(tableBodyId.rows.length == selectedRows.length)//Check, is all row is selected??
{
deleteAllRow(tableBodyId);
selectedRows = [];
selectAll.checked = false;
}else
{
selectedRows.sort(); //required because row index dynami... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete_rc(evt){\n var checkedValue = document.querySelectorAll('.delete:checked');\n \n if(checkedValue.length<1)\n alert(\"Select atleast one row or column\");\n else if(checkedValue.length>1)\n alert(\"Select only one row or one column\");\n else{\n \n if(parse... | [
"0.7136459",
"0.71321446",
"0.68969727",
"0.682442",
"0.6679912",
"0.6678392",
"0.6622233",
"0.6588309",
"0.6587244",
"0.6536552",
"0.6530831",
"0.6525978",
"0.6515847",
"0.6515847",
"0.651414",
"0.6505812",
"0.64975536",
"0.64786446",
"0.6460741",
"0.6436134",
"0.64103425",
... | 0.7869035 | 0 |
The SearchFrom, AvengerLinks and Gallery components are rendered to the page. | render() {
return (
<div className="container">
<SearchForm onSearch={this.performSearch}/>
<AvengerLinks onClick={this.performSearch}/>
<Gallery data={this.state.images} title={this.state.title}/>
</div>
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onShowSearchResultPanel() {\n mediator.getView('searchResult');\n }",
"render($$) {\n const header = $$('div')\n .addClass(styles.header)\n .append([\n $$('div')\n .addClass(styles.logoWrapper)\n .append([\n $$('a').addClass(styles.logo),\n ... | [
"0.62417567",
"0.62189907",
"0.5913964",
"0.5803602",
"0.5756407",
"0.57003343",
"0.5692604",
"0.5688365",
"0.56735134",
"0.56622106",
"0.56575066",
"0.56419104",
"0.5635237",
"0.5579139",
"0.5578837",
"0.5572039",
"0.55699915",
"0.55657965",
"0.5563225",
"0.5561217",
"0.5559... | 0.6458235 | 0 |
write function to loop through shape arrays and move the rain | function moveRain() {
for (i = 0; i < coordinateX.length; i++) {
var rainX = coordinateX[i];
var rainY = coordinateY[i];
//update arrays
coordinateX[i] += directionX[i];
coordinateY[i] += directionY[i];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n//below function makes rain go down by one pixel per loop, then reset once it reaches the bottom//\nlet dotBlue = color( 0, 100, 0, 100);\nlet dotGreen = color( 0, 0, 100, 100);\nlet dotRed = color( 100, 0, 0, 100);\n let rainArray = [dotBlue, dotGreen, dotRed];\n rain.y = rain.y + 1;\n rain.... | [
"0.6516745",
"0.6400863",
"0.6172015",
"0.61331356",
"0.6084532",
"0.6045533",
"0.60188144",
"0.59727407",
"0.5937172",
"0.5905106",
"0.58805174",
"0.5861338",
"0.5859854",
"0.58137673",
"0.57605666",
"0.57250774",
"0.57119966",
"0.5707908",
"0.5706558",
"0.5673113",
"0.56615... | 0.7516763 | 0 |
write a function to draw the rain at rX, rY with size= rSize and color= rColor | function drawRaindrop(rX, rY, rSize, rColor) {
ellipseMode(CORNER);
noStroke();
fill(rColor);
rect(rX, rY, rSize / 2, rSize * 2.5);
//draws required number of clouds in a row
for (i = 0; i < ROW_CLOUDS; i++) {
//sets the color of the cloud depending on if the index number i is an odd or even number
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rainBox(size, color) {\n const x = midX - size / 2;\n const y = midY - size / 2;\n ctx.fillStyle = color;\n ctx.fillRect(x, y, size, size);\n}",
"function draw() {\n//below function makes rain go down by one pixel per loop, then reset once it reaches the bottom//\nlet dotBlue = color( 0, 100, 0, 100... | [
"0.76584274",
"0.72004175",
"0.6448425",
"0.641861",
"0.6371175",
"0.62583303",
"0.62432647",
"0.6218504",
"0.620418",
"0.6186288",
"0.6137999",
"0.6132848",
"0.61098814",
"0.60831547",
"0.6009509",
"0.59508795",
"0.5938709",
"0.5937739",
"0.5925878",
"0.58968157",
"0.5865312... | 0.73617387 | 1 |
Counts trackers per domain | function countTrackers(trackers) {
var ret = {};
trackers.forEach(function (t) {
if (!ret[t.id]) {
ret[t.id] = {
name: t.name,
count: 0
}
}
ret[t.id].count++;
});
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"countTracked() {\n return(Object.keys(tTracked).length)\n }",
"function saveDomainCounters() {\n console.log(\"Writing domain counters to file\");\n var domainfile = fs.openSync('domains.csv', 'w');\n for (var domain in domains) {\n if (!domains.hasOwnProperty(domain)) {\n //Th... | [
"0.6445213",
"0.56952214",
"0.56924343",
"0.56008756",
"0.55618674",
"0.5529254",
"0.5502129",
"0.5487445",
"0.54763055",
"0.5440774",
"0.5404984",
"0.53550607",
"0.5334454",
"0.5289505",
"0.5277521",
"0.5272876",
"0.52634877",
"0.52486145",
"0.5227179",
"0.5218465",
"0.52149... | 0.71037793 | 0 |
Test that feed name is defined and that the name is not empty. | function test_name(feedID) {
it('Feed ' + allFeeds[feedID].name + ' has a name that is defined', function() {
expect(allFeeds[feedID].name).toBeDefined();
expect(allFeeds[feedID].name.length).not.toBe(0);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testNameinFeed(feed, nr) {\n it('the feed at position '+nr+' has a empty name', function() {\n expect(feed.name).toBeDefined();\n expect(feed.name.length).not.toBe(0);\n });\n }",
"function nameDefined(feeds) {\n it('URLs are defined'... | [
"0.80027056",
"0.7981407",
"0.7687154",
"0.7650961",
"0.7327485",
"0.68404007",
"0.66946155",
"0.663647",
"0.6488617",
"0.64813155",
"0.6413951",
"0.6400353",
"0.63782823",
"0.63690394",
"0.6321064",
"0.6144189",
"0.60160977",
"0.588943",
"0.588943",
"0.588943",
"0.588943",
... | 0.8009507 | 0 |
~~~ MIDDLEWARE ~~~ // validate project id | function validateProjId(req, res, next) {
projectModel.get(req.params.id)
.then(project => {
if (project) {
req.project = project;
next();
} else {
res.status(400).json({ errorMessage: "Invalid project ID" })
}
})
.catch(err => {
res.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateProjId(req, res, next) {\n const projectId = req.body.projects_id\n Projects.findById(projectId)\n .then(project => {\n if (project) {\n next()\n } else {\n res.status(400).json({ message: 'id does not exist' })\n }\n ... | [
"0.77013254",
"0.7623687",
"0.7535162",
"0.7468263",
"0.74580693",
"0.74516195",
"0.69701844",
"0.68484473",
"0.6728313",
"0.67204136",
"0.65198666",
"0.6480382",
"0.64709055",
"0.64545596",
"0.64428025",
"0.6417208",
"0.6412084",
"0.6409924",
"0.63953346",
"0.63897794",
"0.6... | 0.7878535 | 0 |
Playing a clue sequence | function playClueSequence() {
guessCounter = 0;
let delay = nextClueWaitTime; //set delay to initial wait time
for (let i = 0; i <= progress; i++) {
// for each clue that is revealed so far
console.log("play single clue: " + pattern[i] + " in " + delay + "ms");
setTimeout(playSingleClue, delay, patter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function play()\n{\n // Ajoute un son aleatoire a la sequence (lettre)\n sequence = \"BVRJB\"\n\n // Joue la sequence\n i = 0;\n const metronome = setInterval( function () {\n joueSon(sequence[i++]);\n if (i >= sequence.length) clearInterval(metronome);\n }, 1000);\n\n // Attend ... | [
"0.7258547",
"0.7183983",
"0.6805229",
"0.6689187",
"0.6683225",
"0.663057",
"0.65932107",
"0.6566134",
"0.65625775",
"0.6539739",
"0.646152",
"0.6437237",
"0.64033324",
"0.6387871",
"0.6385837",
"0.6377124",
"0.63674",
"0.63653266",
"0.6354968",
"0.63418293",
"0.6341407",
... | 0.7551898 | 0 |
sqlite_add_agent_user_chat(); olab validate user on DB | function sqlite_validate_user_data(data, callback) {
var db;
db = new sqlite3.Database(file);
db.serialize(function() {
var stmt;
stmt = "SELECT * FROM cms_chatuser WHERE username = '" + data.user_name + "';";
db.all(stmt, function(err, rows) {
if (err) {
console.log("ERR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CheckUserSelLanguage() {\n mydb.readTransaction(\n function (t) {\n t.executeSql(\"SELECT * FROM user_profile\", [],CheckTheUserLanguageStatusFunc,errorHandler);\n }\n );\n}",
"addUsers(db, ctx, bot) {\n let { replayId, developerID , about} = require(\"./lib\");\n le... | [
"0.5620369",
"0.5384801",
"0.5231968",
"0.5163879",
"0.51283807",
"0.50834787",
"0.50540435",
"0.5019666",
"0.50062436",
"0.4989421",
"0.4941796",
"0.49403238",
"0.49253488",
"0.49200577",
"0.49170452",
"0.4903987",
"0.48937324",
"0.48840666",
"0.4868731",
"0.48666587",
"0.48... | 0.5798845 | 0 |
FUNCTION RETURN OBJECT WITH PARAMETERS, DUPLICATED EMAIL, FIND ID GIVEN A EMAIL, AND RERELATION CLIENT WITH AGENT | function get_ids_fron_email_given(email, id) {
client_email = "";
client_name = "";
client_id = "";
agent_name = "";
agent_id = "";
array_key = "";
object_key = "";
agent_or_client_assoc = "";
if (total_agents > 0) {
assoc_client = false;
//ASSOC CLIENT ID TO THE FIR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEmailAgent(params){\n\n}",
"function getCreator(creator_email, callback) {\n conn.query(\"SELECT * FROM Creator_Data WHERE email=$1\", [creator_email],\n function(error, result) {\n if(error) {\n console.error(error);\n } else if(result.rowCount>=2) {\n ... | [
"0.60493964",
"0.6037999",
"0.60045403",
"0.59394497",
"0.5848822",
"0.58022946",
"0.5685699",
"0.56716925",
"0.56666535",
"0.56375676",
"0.561716",
"0.56154406",
"0.5608614",
"0.55816245",
"0.55814475",
"0.55501246",
"0.54965967",
"0.5460948",
"0.5455289",
"0.5447904",
"0.54... | 0.7350855 | 0 |
Helper function para setear los atributos en los elementos del DOM | function setAttributes(elemento, atributos) {
for (const key in atributos) {
elemento.setAttribute(key, atributos[key]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setAttributes(elm, attrs){\r\n for(var attr in attrs)\r\n elm.setAttribute(attr, attrs[attr]);\r\n return elm;\r\n}",
"function setAttributes(ele,o)\n{\n\tfor (var i in o) {\n\t\tif ( o.hasOwnProperty(i) )\n\t\t\tele.setAttribute( i, o[i] );\n\t}\n}",
"function setAtribut(element, atribut... | [
"0.667487",
"0.65914154",
"0.65708274",
"0.6346943",
"0.63439226",
"0.6294333",
"0.6252804",
"0.6222376",
"0.62070215",
"0.61930704",
"0.61930704",
"0.61920005",
"0.61663055",
"0.61663055",
"0.61082345",
"0.60627586",
"0.6024583",
"0.59928566",
"0.59892595",
"0.59647596",
"0.... | 0.71534586 | 0 |
Creando elementos para mostar las fotos | function displayFotos () {
imagesLoaded = 0;
totalImages = fotosArray.length;
//console.log('Imágenes en total', totalImages);
//Ejecutar función para cada objeto en fotosArray
fotosArray.forEach((foto) => {// Cada objeto va a ser asignado a la variable 'foto'
// creamos los <a> apuntando a Unsplash
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listaFotosAux() {\n $(\".foto\").remove();\n var j;\n for (j = 0; j < listImages.length; j++) {\n var html = getHtmlListaFotos(listImages[j].url_img, listImages[j].msg, listImages[j].id, listImages[j].secret, j, 2);\n\n $('#muro').append(html);\n }\n}",
"function showMoreImgs(r... | [
"0.6082467",
"0.6013869",
"0.59702617",
"0.5889632",
"0.5877264",
"0.5867437",
"0.58588654",
"0.58529127",
"0.5764394",
"0.5755572",
"0.5691874",
"0.56915206",
"0.5682004",
"0.56607735",
"0.5641549",
"0.56383276",
"0.563699",
"0.56329197",
"0.56077325",
"0.5605779",
"0.559869... | 0.6208987 | 0 |
Garbagecollect the bytes that were already written for this file. (called when a read or write error occurs) | function gc(err) {
sails.log.debug("Garbage collecting file '" + file.filename + "' located at '" + fileSavePath + "'");
fs.unlink(fileSavePath, function(gcErr) {
if (gcErr) {
return done([err].concat([gcErr]));
} else {
fs.unlink(thumbSavePath, function(gcErr) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"wipeUnusedSpace() {\n // Mark internal only to be true so that the render doesn't treat it like\n // a new file, all existing data is kept\n this.onDataChange(undefined, false, true);\n }",
"function CollectGarbage() {\n\tvar key = \"\";\n\tfor ( var idx = 0; idx < STORAGE.length; idx++ )... | [
"0.6345439",
"0.609762",
"0.6078131",
"0.5893617",
"0.5873017",
"0.5859854",
"0.571827",
"0.57105017",
"0.56996477",
"0.56787854",
"0.56752276",
"0.56701285",
"0.56651783",
"0.56400526",
"0.55461395",
"0.55276984",
"0.55276984",
"0.5522761",
"0.5508167",
"0.5488989",
"0.54837... | 0.6732162 | 0 |
The message handler for gimme sending the peep request. Note: returns true, as this is aync. | peepAroundOnceContentLoaded(req, sender, res, secondTry) {
//this.lm(('Got message with request: ' + JSON.stringify(req));
// Don't respond if we didn't get all of the data we need.
if (!req || !sender || !res) {
//this.lm(('Peep action request missing required fields. Not resp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function respond() {\n var request = JSON.parse(this.req.chunks[0]);\n message = request.text;\n if (message.charAt(0) == '!') {\n response = run(request);\n send(response, this);\n }\n}",
"HandleMessage( msg ) {\n return false;\n }",
"function sendMessage(){\n log(\"<p>sent: \" + $(\"#p... | [
"0.5474619",
"0.54436594",
"0.53739995",
"0.53514135",
"0.5313109",
"0.5272861",
"0.52363557",
"0.52256864",
"0.51789683",
"0.51660705",
"0.51355237",
"0.50970894",
"0.5090353",
"0.5089151",
"0.5081615",
"0.5078021",
"0.50401783",
"0.5030326",
"0.5028754",
"0.5022954",
"0.500... | 0.5723797 | 0 |
Clean form error (New Grade Alert Form) | function cleanNewGradeAlertFormError(){
$('#formNewAlertGrade #name_new_grade').closest('div').removeClass('has-error');
$('#formNewAlertGrade #name_new_grade').closest('div').find('span').filter('.help-block').remove();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate() {\r\n //Get the value from the inputs\r\n var name = nameInput.value;\r\n var grade = numberInput.value;\r\n var section = letterInput.value;\r\n\r\n //This variable is for checking for errors in\r\n //It passes thru 3 filters, and in each filter it substracts one\r\n //So ... | [
"0.6217727",
"0.61238426",
"0.608927",
"0.6069669",
"0.602032",
"0.6000088",
"0.5977242",
"0.59729344",
"0.5962079",
"0.59305894",
"0.59048843",
"0.59039867",
"0.59039867",
"0.5900489",
"0.58954555",
"0.58947253",
"0.5853324",
"0.58221513",
"0.58068526",
"0.5806344",
"0.58034... | 0.7916458 | 0 |
Handle realtime transcription updates from DataStore. | async onTranscriptionSubscription(store, message) {
const user = await userService.getUser()
const localUser = user.name
const remoteUser = message.element.userLastUpdated
if (message.opType === 'UPDATE') {
// only update if it's a remote update
if (remoteUser !== localUser) {
store.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async updateTranscription(store, update) {\n console.log('updating Transcription', update)\n // throttle updates so DataStore doesn't shit the bed\n Timeout.clear('update-transcription-timer')\n Timeout.set(\n 'update-transcription-timer',\n async () => {\n const original = await DataS... | [
"0.6911705",
"0.56375265",
"0.55004793",
"0.5495286",
"0.5393774",
"0.5315237",
"0.5295372",
"0.5280597",
"0.51884305",
"0.5155161",
"0.51544744",
"0.51502764",
"0.5149285",
"0.5146364",
"0.51169395",
"0.51120156",
"0.50976896",
"0.5097559",
"0.5090106",
"0.506782",
"0.506064... | 0.64856297 | 1 |
Sets the timestamp of the last incoming update for regions. Helper for testing. | setLastRegionUpdate(value) {
LAST_REGION_UPDATE = value
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePinTimestamp(){\n \tdropNumpad(true);\n writeData('isPinLocked', {'id':1,'value': false} );\n\n \treadAllData('pin')\n \t\t.then(function(old) {\n \t\t\tvar post = {\n id : 1, //\n \t\t\t\ttime\t: new Date().getTime() /1000 | 0, // timestamp\n \t\t\t\... | [
"0.5981317",
"0.59278816",
"0.58955234",
"0.5791291",
"0.570762",
"0.567201",
"0.5616007",
"0.5616007",
"0.55859834",
"0.55381465",
"0.5486647",
"0.5482948",
"0.5462738",
"0.5458627",
"0.5436352",
"0.53903",
"0.5319431",
"0.5290198",
"0.5224176",
"0.52161264",
"0.52152324",
... | 0.72066444 | 0 |
This is the reducer to prepare for the app, for example, loading | function appInit(state = {appIsLoading: true, appData: null}, action) {
switch (action.type) {
case 'APP_LOAD_REQUEST':
return {
appIsLoading: true,
appData: {}
}
case 'APP_LOAD_SUCCESS':
return {
appIsLoading: false,
appData: action.data
}
default:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reducer(state, action) { //we have access to current state, action: object passed down to dispatch(). Returns new state to be set.\n switch(action.type) {\n case ACTIONS.MAKE_REQUEST:\n return {loading: true, jobs: []};\n case ACTIONS.GET_DATA: \n return {...state... | [
"0.62367225",
"0.6218441",
"0.6177528",
"0.6119528",
"0.60173315",
"0.60173315",
"0.5986673",
"0.59730196",
"0.5957998",
"0.5954288",
"0.5946273",
"0.58629423",
"0.57734925",
"0.5763792",
"0.5742364",
"0.57097447",
"0.5705411",
"0.56635517",
"0.56583637",
"0.56538284",
"0.562... | 0.63527244 | 0 |
Create a function that will call a callback with a specified index | function makeIndexedCallback(i, cb) {
return function(err, result) {
cb(i, err, result);
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"indexCallback(indx){\n // console.log(\"callback index \", indx);\n this.props.updateRenderDrip(indx);\n }",
"applyAtIndex(idx, arg) {\n // ... //\n }",
"setIndexCallback () {\n if (this.props.callback) {\n this.props.callback(this.state.currentIndex)\n }\n }",
"functio... | [
"0.7106919",
"0.687874",
"0.67990273",
"0.66353315",
"0.6598726",
"0.65519416",
"0.64454114",
"0.6435629",
"0.6435629",
"0.64203775",
"0.6361513",
"0.6337669",
"0.63325167",
"0.6312694",
"0.63049906",
"0.63049906",
"0.63049906",
"0.63049906",
"0.63049906",
"0.62024325",
"0.61... | 0.72245204 | 0 |
metod pozivaju hendleri za sabmit forme za dodavanje novog brenda i za sabmit forme za dodavanje novog modela, i svi ostali hendleri koji salju AJAX, metod salje AJAX na zadatu rutu i prima odgovor, ako su errori tj nije prosla validacija u kontroleru prikazuje ih a ako je uspesno upisano cisti formu i sprema je za nov... | function sendajax(formdata, urladdress, bilim){
$.ajaxSetup({//Laravelov _token
headers: {
'X-CSRF-Token': $('meta[name=_token]').attr('content')
}
});
//saljemo AJAX odgovarajucem metodu BrandsControllera preko rute koja je data kao argument pri pozivu metoda sa podatcima koji su takodje
//stig... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preciomoneda()\n{\n var selecvalue = tipo_registro.options[tipo_registro.selectedIndex].value;\n //var selectext = catalogo.options[catalogo.selectedIndex].text;\n if (selecvalue=='Intercambio' || selecvalue=='Venta') {\n var base_url= 'http://localhost/sistema_monedas/';... | [
"0.7116916",
"0.69893074",
"0.6943078",
"0.69381887",
"0.6910482",
"0.687723",
"0.68411005",
"0.6837851",
"0.6806753",
"0.6756435",
"0.67405355",
"0.67368907",
"0.67335594",
"0.6708385",
"0.6684259",
"0.66598445",
"0.6651594",
"0.66373616",
"0.6622968",
"0.6616044",
"0.661584... | 0.71918434 | 0 |
Origonally ased on geohash.js Geohash library for Javascript (c) 2008 David Troy Distributed under the MIT License | function Geohash() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_hash(pt) {\n return (15485867 + pt.X) * 15485867 + pt.Y;\n }",
"function hash(lat, lng, accuracy){\n var\n bitfield=[],\n data = [ [lat, -90, 90], [lng, -180, 180] ];\n \n for(var i=0; i<accuracy; i++){\n reduce(data[0], bitfield);\n reduce(data[1], bitfield);\n }\n \n ... | [
"0.6656766",
"0.6620235",
"0.64964515",
"0.6449145",
"0.6449145",
"0.63250077",
"0.61712855",
"0.6144912",
"0.6133372",
"0.6108716",
"0.60461026",
"0.6040294",
"0.6014493",
"0.60065603",
"0.60065603",
"0.5965204",
"0.5955418",
"0.5952426",
"0.59521955",
"0.59392214",
"0.59315... | 0.82936394 | 0 |
Get Google Fonts URI compatible string from array of font objects | function getGoogleFontsURI(arr) {
var familyParam = ""
// Loop though fonts and add to familyParam string
$.each(arr, function(i, font) {
familyParam += font.trim()
familyParam += '|'
})
// Remove last bar
familyParam = familyParam.slice(0, -1)
// Replace Spaces with plus.
familyParam = fami... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function quoteMultiNameFonts(theFont) {\r\n\tvar v, pM=theFont.split(',');\r\n\tfor (var i=0; i<pM.length; i++) {\r\n\t\tv=pM[i];\r\n\t\tv=v.replace(/^\\s+/,'').replace(/\\s+$/,'');\r\n\t\tif(/\\s/.test(v) && !/['\"]/.test(v)) {\r\n\t\t\tv=\"\\'\"+v+\"\\'\";\r\n\t\t\tpM[i]=v;\r\n\t\t}\r\n\t}\r\n\treturn pM.join();... | [
"0.56599957",
"0.56568307",
"0.5540027",
"0.55298185",
"0.5512627",
"0.5508425",
"0.55055434",
"0.54703534",
"0.54550916",
"0.53967786",
"0.53725433",
"0.53646815",
"0.5357309",
"0.5356481",
"0.52097106",
"0.5184963",
"0.516072",
"0.508229",
"0.5064478",
"0.5054793",
"0.50494... | 0.8153906 | 0 |
Get base url. Removes parameters. | function getBaseUrl(){
return window.location.href.replace(/\?.*/,'');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBaseUrl() {\n\tvar base;\n\n\tif (getURLParameter($(location).attr('href'), \"base\") != null) {\n\t\tbase = getURLParameter($(location).attr('href'), \"base\");\n\t} else {\n\n\t\tif (window.location.protocol == 'http:' || window.location.protocol == 'https:')\n\t\t\tbase = window.location.protocol + ... | [
"0.77684325",
"0.76955473",
"0.7538311",
"0.74731344",
"0.74523777",
"0.7424088",
"0.74114865",
"0.7399607",
"0.7374853",
"0.7322713",
"0.73026717",
"0.7217127",
"0.72020376",
"0.720119",
"0.71069175",
"0.71035737",
"0.70979106",
"0.70979106",
"0.70879215",
"0.7037961",
"0.70... | 0.77482766 | 1 |
Prettify CSV with space after comma | function prettifyCSV(csvStr){
// Remove unecessary spaces after comma
csvStr = csvStr.replace(/, /g, ",")
csvStr = csvStr.replace(/, /g, ",")
csvStr = csvStr.replace(/, /g, ",")
// Add space after comma and return
return csvStr.replace(/,/g, ", ")
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function csvQuotes(myText){\n myText = (\"\\\"\" + myTrim(myText) + \"\\\"\");\n return myText\n}",
"function csvQuotes(myText){\n myText = (\"\\\"\" + trim(myText) + \"\\\"\");\n return myText\n}",
"function csv(array){\n\n // this is not a world class csv generator\n return array.map(function(i... | [
"0.6262454",
"0.62044173",
"0.60706574",
"0.591795",
"0.58984894",
"0.5841801",
"0.58040625",
"0.5697556",
"0.5656975",
"0.5619743",
"0.55884326",
"0.5571834",
"0.5556735",
"0.5488665",
"0.54774076",
"0.5468064",
"0.54639643",
"0.5448536",
"0.5443864",
"0.54376817",
"0.541970... | 0.8276537 | 0 |
The following two functions allow for the lasers to stick to the background as the stealer is moving forwards or backwards | moveBgLeft() {
let minBgLeft = -this.bgImg.width + width;
if (this.bgLeft - this.moveSpeed > minBgLeft) {
for(let i = 0; i < lasers.length; i++){
let laser = lasers[i];
laser.x -= this.moveSpeed;
}
}
super.moveBgLeft();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function movingBackground() {\n if (gameState == 0 || gameState == 2 || gameState == 3) return;\n xBg -= 1;\n if (xBg < -400) {\n xBg = 0\n }\n}",
"backgroundTranslation() {\n this.x -= this.translationRate;\n if (this.x < this.resetX) {\n this.x = this.ninthFrameX;\n }\n }",
... | [
"0.65316945",
"0.62904125",
"0.62862515",
"0.62813944",
"0.6228878",
"0.6228878",
"0.62130964",
"0.6120359",
"0.6106934",
"0.6106934",
"0.61015457",
"0.6055908",
"0.601174",
"0.6000455",
"0.59958595",
"0.59728307",
"0.59445995",
"0.5942875",
"0.5942006",
"0.5903745",
"0.58968... | 0.6836515 | 0 |
similar format to functions found in chapter 1 getting the ceiling of big / small | function ceiling(small, big) {
return intDivisionRemainder(small, big) === 0
? intDivisionQuotient(small, big)
: intDivisionQuotient(small, big) + 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }",
"function ceiling(number_in,numDigits) {\n //\n if (number_in === '... | [
"0.6887355",
"0.6600806",
"0.61972797",
"0.6101968",
"0.5900936",
"0.5878914",
"0.57674885",
"0.57674885",
"0.57659954",
"0.5735265",
"0.5717055",
"0.5709533",
"0.5681809",
"0.5661612",
"0.56606376",
"0.5640841",
"0.5623699",
"0.56225294",
"0.5622277",
"0.561069",
"0.5598595"... | 0.7201939 | 1 |
finds the quotient of big / small, found when big is no longer bigger than small | function intDivisionQuotient(small, big) {
return small <= big
? 1 + intDivisionQuotient(small, big - small)
: 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function intDivisionRemainder(small, big) {\n return small <= big\n ? intDivisionRemainder(small, big - small)\n : big;\n}",
"function intDivisionRemainder(small, big) {\n return small <= big\n ? intDivisionRemainder(small, big - small)\n : big;\n}",
"function percentageOf(big... | [
"0.6885171",
"0.6885171",
"0.6846004",
"0.6846004",
"0.66660285",
"0.6471124",
"0.64070153",
"0.62252414",
"0.6214714",
"0.6104261",
"0.6081105",
"0.6075401",
"0.60735905",
"0.6069103",
"0.6068117",
"0.6003383",
"0.60011023",
"0.599396",
"0.5990645",
"0.5979897",
"0.5976149",... | 0.75289685 | 1 |
finds the remainder of big / small, found when big is no longer bigger than small | function intDivisionRemainder(small, big) {
return small <= big
? intDivisionRemainder(small, big - small)
: big;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function intDivisionQuotient(small, big) {\n return small <= big\n ? 1 + intDivisionQuotient(small, big - small)\n : 0;\n}",
"function intDivisionQuotient(small, big) {\n return small <= big\n ? 1 + intDivisionQuotient(small, big - small)\n : 0;\n}",
"function sc_remainder(x, ... | [
"0.6324743",
"0.6324743",
"0.6067571",
"0.6060301",
"0.60133225",
"0.60133225",
"0.60133225",
"0.5979142",
"0.5979093",
"0.597365",
"0.5955445",
"0.5953045",
"0.5919574",
"0.5919574",
"0.5917541",
"0.5913551",
"0.5905404",
"0.589502",
"0.5867946",
"0.5867946",
"0.5867946",
... | 0.7457075 | 1 |
armSlot can be: arm1, arm2, arm3. Should only be a ranged weapon | setArm(armSlot) {
this.instructions.weapon = armSlot;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UseItem(i:Item,slot:int,autoequip:boolean)\n{\n\tif(i.isEquipment){\n\t\t//This is in case we dbl click the item, it will auto equip it. REMEMBER TO MAKE THE ITEM TYPE AND THE SLOT YOU WANT IT TO BE EQUIPPED TO HAVE THE SAME NAME.\n\t\tif(autoequip)\n\t\t{\n\t\t\tvar index=0; //Keeping track of where we a... | [
"0.63809115",
"0.6044413",
"0.59787667",
"0.5938892",
"0.58944297",
"0.5892046",
"0.5821453",
"0.58071804",
"0.57177955",
"0.5643127",
"0.5625501",
"0.5473173",
"0.54623497",
"0.5395541",
"0.5341158",
"0.5329066",
"0.52872324",
"0.52454495",
"0.5236121",
"0.5235451",
"0.52169... | 0.71689546 | 0 |
Removes the usernames when page is reloaded | function unpopulateNames(){
var names = document.getElementById("userName");
for( var i = 0; i < masterUser.size; i++){
names.remove(names.i);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear_username() {\r\n \tself.user.username = '';\r\n }",
"function clearCurrentUsers() {\n users.innerHTML = ''\n}",
"function new_name(){\n localStorage.removeItem('name');\n location.reload();\n }",
"function logout() {\n let users = JSON.parse(localStorage.getIte... | [
"0.71827453",
"0.7015083",
"0.6947485",
"0.6881009",
"0.6837681",
"0.6799942",
"0.6726332",
"0.66804177",
"0.6649498",
"0.6571459",
"0.6553811",
"0.6472037",
"0.6422234",
"0.6379519",
"0.6369116",
"0.6365068",
"0.63609195",
"0.63527113",
"0.6329774",
"0.63249296",
"0.63169986... | 0.70460755 | 1 |
function to handle the change in the borderColor of the TextInput | inputHandler(borderColor){
this.setState(borderColor)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onInputChange(evt) {\n var targetEl = evt.target;\n targetEl.style.borderColor = '';\n }",
"function colorBorder(theInput){\n theInput.style.border = '0.5px solid #1C62B9';\n}",
"function inputBorderStyling() {\n $('.tagInputOverview').css({\n 'border-color': 'red',\n 'outli... | [
"0.758909",
"0.72520787",
"0.70079285",
"0.67223567",
"0.6560598",
"0.6500201",
"0.64803207",
"0.64597464",
"0.640153",
"0.6391477",
"0.6385429",
"0.6382916",
"0.6346554",
"0.63385034",
"0.63293004",
"0.62813973",
"0.6219209",
"0.620478",
"0.61401194",
"0.6086031",
"0.6082945... | 0.739342 | 1 |
returns the private variable | get privateVar() {
return this._privateVar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get variable() {\n\t\treturn this.__variable;\n\t}",
"getPrivateValue(){ // this is a true example of a \"getter function\"\n return this.#courseCount; // it is retrieving a value in the \"private variable\"\n }",
"get x() { return this[PRIVATE_X_KEY]; }",
"variables() {\n\... | [
"0.7656014",
"0.7372585",
"0.6553519",
"0.64185697",
"0.6405182",
"0.6349604",
"0.6340054",
"0.63230926",
"0.63062584",
"0.63062584",
"0.6284897",
"0.6275837",
"0.6239378",
"0.6213932",
"0.61545616",
"0.61181813",
"0.61078745",
"0.6062538",
"0.6046342",
"0.60267603",
"0.60181... | 0.82109 | 0 |
Send a 'ping' to all connected clients every three seconds | async function ping() {
let x, y = clientPool.length;
while(x < y) {
con.send(clientPool[x], 'ping', con.NET.PINGPONG);
++x;
}
setTimeout(() => { ping() }, 3000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pingClients() {\n\tvar length = players.length;\n\tfor(var i = 0; i < length; i++) {\n\t\tif (players[i].id) {\n\t\t\tpings[players[i].id] = { time: Date.now(), ping: 0 };\n\t\t\t//console.log('Ping? '+ players[i].id); //log filler\n\t\t\tgame.sockets[players[i].id].emit('ping');\n\t\t}\n\t}\n}",
"funct... | [
"0.7431262",
"0.6770075",
"0.6479216",
"0.63834333",
"0.6292849",
"0.6260204",
"0.6180769",
"0.6177816",
"0.6130045",
"0.6127141",
"0.6016144",
"0.59837663",
"0.59767467",
"0.59482384",
"0.5910079",
"0.589806",
"0.5885349",
"0.5809955",
"0.5786984",
"0.57762665",
"0.57377034"... | 0.7241053 | 1 |
Jumps to target page | function jumpPage(target){
// query wikipedia api
$.ajax({
type: "GET",
url: `https://en.wikipedia.org/w/api.php?action=parse&page=${target}&format=json`,
async: true,
dataType: 'jsonp',
crossDomain: true,
success: function(data) {
curr = data.parse.ti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jump(page) {\n const pageNumber = Math.max(1, page);\n setCurrentPage((currentPage) => Math.min(pageNumber, maxPage));\n }",
"goto(target) {\r\n this._nextTarget = target;\r\n this.uiDispatcher.debug(`Goto : ${target}`);\r\n }",
"function performJumpTo(){\n\tvar jumpToId = jq(\... | [
"0.70352",
"0.69264466",
"0.6880205",
"0.6854634",
"0.68532753",
"0.67504424",
"0.6670682",
"0.6663646",
"0.66532224",
"0.6640728",
"0.66195464",
"0.6610273",
"0.65934205",
"0.6586791",
"0.6581257",
"0.65810466",
"0.6565473",
"0.6556808",
"0.6545045",
"0.65443194",
"0.6540379... | 0.7261112 | 0 |
Write file contents after first ensuring the parent directory exists. | function writeFile(path, content) {
const parentDir = path.split('/').slice(0, -1).join('/');
return new Promise((resolve, reject) => {
mkdirp(parentDir, dirErr => {
if (dirErr) { return reject(dirErr); }
fs.writeFile(path, content, err => err ? reject(err) : resolve(path));
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write(filename, content) {\n var parents = path.dirname(path.join(tmpdir, filename));\n while (path.dirname(parents) !== parents) {\n if (!fs.existsSync(path.join(parents))) {\n fs.mkdirSync(path.join(parents));\n }\n parents = path.dirname(parents);\n }\n fs.writeFileSync(path.join(tmpd... | [
"0.6921688",
"0.6114506",
"0.59441286",
"0.59334075",
"0.5845113",
"0.5825365",
"0.57938683",
"0.56234944",
"0.56062835",
"0.5594077",
"0.546182",
"0.54238725",
"0.5320082",
"0.5306557",
"0.52925193",
"0.52856064",
"0.52197516",
"0.5205812",
"0.5195581",
"0.5179081",
"0.51472... | 0.618664 | 1 |
Triggered in the login modal to close it | function closeLogin() {
vm.modal.hide();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loginRequest() {\n this.$refs.companyDetailsModal.close();\n this.submitLogin();\n }",
"closeLoginForm() {\n document.getElementById(\"showLoginForm\").checked = false;\n this.switchToLogin();\n updatePageTitle(\"Utforsk nye aktiviteter\");\n }",
"closeDialog_() {\n // T... | [
"0.77372706",
"0.7736038",
"0.7603373",
"0.75521153",
"0.7522364",
"0.746197",
"0.73646194",
"0.7343659",
"0.72957563",
"0.7265426",
"0.71310407",
"0.7098961",
"0.7092938",
"0.7052342",
"0.69985217",
"0.69874185",
"0.6983679",
"0.696768",
"0.69457525",
"0.694272",
"0.6931427"... | 0.84683084 | 1 |
Create the rest of the card by embeding the video | function createBigCardVideos(youtubeObject) {
const link = `https://www.youtube.com/embed/${youtubeObject.items[0].id.videoId}`;
const container = document.querySelector('.big-card');
const el = document.createElement('div');
el.classList.add('single-video-container');
// console.log(youtubeObject... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createCard(movie, mediaType) {\n\tconst carWrapCard = document.createElement('div');\n\tcarWrapCard.classList.add('carousel__wrapper-card');\n\t// const flipCardContainer = document.createElement('div');\n\t// flipCardContainer.classList.add('flip-card-container');\n\t// const flipCard = document.createEl... | [
"0.6780416",
"0.6669307",
"0.66328675",
"0.66116494",
"0.65418327",
"0.6538421",
"0.6465583",
"0.646441",
"0.64155805",
"0.6402381",
"0.64008987",
"0.63956225",
"0.63737094",
"0.627037",
"0.6268202",
"0.6259044",
"0.6180305",
"0.6155911",
"0.6138349",
"0.61006165",
"0.6093742... | 0.6749912 | 1 |
Fragment is different than normal vNode, because when it needs to be cloned we need to clone its children too But not normalize, because otherwise those possibly get KEY and remount | function cloneFragment$1(vNodeToClone) {
var oldChildren = vNodeToClone.children;
var childFlags = vNodeToClone.childFlags;
return createFragment$1(childFlags === 2 /* HasVNodeChildren */ ? directClone$1(oldChildren) : oldChildren.map(directClone$1), childFlags, vNodeToClone.key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cloneFragment(vNodeToClone) {\n var oldChildren = vNodeToClone.children;\n var childFlags = vNodeToClone.childFlags;\n return createFragment(childFlags === 2\n /* HasVNodeChildren */\n ? directClone(oldChildren) : oldChildren.map(directClone), childFlags, vNodeToClone.key);\n }... | [
"0.7054098",
"0.67436993",
"0.6578064",
"0.64098126",
"0.64098126",
"0.6331597",
"0.6323067",
"0.63219607",
"0.63170296",
"0.63170296",
"0.63170296",
"0.63170296",
"0.63170296",
"0.6258691",
"0.6245179",
"0.6216499",
"0.6216499",
"0.6216499",
"0.6216499",
"0.6195238",
"0.6193... | 0.6875989 | 1 |
Fragment is different than normal vNode, because when it needs to be cloned we need to clone its children too But not normalize, because otherwise those possibly get KEY and remount | function cloneFragment(vNodeToClone) {
var oldChildren = vNodeToClone.children;
var childFlags = vNodeToClone.childFlags;
return createFragment(childFlags === 2
/* HasVNodeChildren */
? directClone(oldChildren) : oldChildren.map(directClone), childFlags, vNodeToClone.key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cloneFragment$1(vNodeToClone) {\n var oldChildren = vNodeToClone.children;\n var childFlags = vNodeToClone.childFlags;\n return createFragment$1(childFlags === 2 /* HasVNodeChildren */ ? directClone$1(oldChildren) : oldChildren.map(directClone$1), childFlags, vNodeToClone.key);\n }... | [
"0.68767446",
"0.67438954",
"0.6577036",
"0.6408459",
"0.6408459",
"0.63305336",
"0.63220346",
"0.632073",
"0.63157094",
"0.63157094",
"0.63157094",
"0.63157094",
"0.63157094",
"0.6257564",
"0.62442577",
"0.6215619",
"0.6215619",
"0.6215619",
"0.6215619",
"0.61936724",
"0.619... | 0.70551634 | 0 |
buildAlarmDescription takes a standard CloudWatch event and returns the key fields as a multiline string | function buildAlarmDescription(obj) {
var s =
"*Name*: " + obj.AlarmName + "\n" +
"*Description*: " + obj.AlarmDescription + "\n" +
"*Reason*: " + obj.NewStateReason + "\n" +
"*Metric*: " + obj.Trigger.MetricName + "\n";
if (obj.Trigger.Dimensions.length > 0) {
s += "*Dim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildEventDescription(data) {\n var title = data.title ? data.title : ' ';\n var description = data.description ? data.description : ' ';\n var speaker = data.speaker ? data.speaker : ' ';\n var room_color = data.room_color ? data.room_color : ' ';\n var desc = `\n Topic: ${title}\\\\n\n Descri... | [
"0.66678745",
"0.59217054",
"0.5825887",
"0.5658124",
"0.5646154",
"0.563287",
"0.556962",
"0.5523471",
"0.54915774",
"0.548736",
"0.548736",
"0.548736",
"0.54857653",
"0.5442851",
"0.54105777",
"0.5403223",
"0.5398395",
"0.5293056",
"0.5264141",
"0.526207",
"0.52332693",
"... | 0.757616 | 0 |
Updates an image in the DB. | function edit (im) {
var id = im.id;
delete im.id;
// find record
image.findByIdAndUpdate(id, im, function (err, i) {
if(err) { console.log (err); }
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDb(id) {\n db.Collection.update(\n {\n image: imageName\n },\n {\n where: {\n id: id\n }\n }\n /*jshint unused:false*/\n ).then(function (result) {\n // JSON response\n res.setHeader('Content-Type', 'application/json');\n ... | [
"0.7209146",
"0.6967028",
"0.6890995",
"0.672502",
"0.66822785",
"0.65140253",
"0.6508069",
"0.6461426",
"0.64054704",
"0.64004517",
"0.6376374",
"0.6241356",
"0.62395287",
"0.6202821",
"0.6134481",
"0.5990265",
"0.597356",
"0.5918814",
"0.59133446",
"0.5908434",
"0.58862877"... | 0.70324033 | 1 |
Saves an image in the DB by removing temporary. | function save (id) {
console.log('save - id', id);
// find record
image.update({_id: id}, {temporary: 0}, function (err, i) {
if(err) { console.log (err); }
console.log(i);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save() {\r\n bannerImage = document.getElementById('uploadedImage');\r\n imgData = getBase64Image(bannerImage);\r\n localStorage.setItem(\"imgData\", imgData); \r\n}",
"function saveImage() {\n let options = {\n method: 'POST',\n headers: {\n 'Accept': 'application... | [
"0.6341493",
"0.62924075",
"0.6016691",
"0.5966372",
"0.59570044",
"0.5862203",
"0.58059955",
"0.5764439",
"0.57617164",
"0.57346296",
"0.5723862",
"0.5690977",
"0.568833",
"0.56876117",
"0.5682524",
"0.5681028",
"0.5639539",
"0.56385964",
"0.5635161",
"0.5595155",
"0.5579067... | 0.64367896 | 0 |
returns if the current device supports orientation changes and device motion | function supported() {
return !!(window.DeviceMotionEvent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateDeviceOrientation(e) {\n isLandscape =\n document.documentElement.clientHeight < document.documentElement.clientWidth;\n isRotatedClockwise = window.orientation === -90;\n }",
"function moveable(){\n return (ignoreMoveable==true) ? false : window.DeviceOrientationEvent != undefin... | [
"0.68102723",
"0.67298365",
"0.65228075",
"0.6392176",
"0.63565075",
"0.63434535",
"0.63405985",
"0.6326249",
"0.6273394",
"0.6253179",
"0.6230729",
"0.62189305",
"0.61972225",
"0.61513036",
"0.6134655",
"0.6110363",
"0.6107265",
"0.6093731",
"0.6090344",
"0.6090344",
"0.6077... | 0.68799824 | 0 |
Creates a new segment of track and an accompanying canvas, and returns it. track the new segment of track | function createTrack(x1, y1, x2, y2, canvas){
var track = createTrackWithWidth(x1,y1, x2, y2, canvas, 4);
return track;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CanvasTrack(options) {\n // call super\n this.Track = Track;\n this.Track(options);\n \n this.onAddTrack = function (view) {\n this.canvas = $(\"<canvas></canvas>\");\n this.canvas.attr(\"width\", this.mainWidth);\n this.canvas.attr(\"height\", this.height);\n ... | [
"0.6258706",
"0.60487324",
"0.58884645",
"0.58140683",
"0.5777507",
"0.57559985",
"0.568871",
"0.56832606",
"0.56114227",
"0.55837166",
"0.5558838",
"0.5551879",
"0.5538357",
"0.55272025",
"0.5505055",
"0.541035",
"0.54073006",
"0.5315992",
"0.5278108",
"0.5259146",
"0.524239... | 0.6771662 | 0 |
Creates a new control point using the given coordinates, image, and mnemonics. | function createControlPoint(x, y, cMnemonic, canvas, img){
//Resize the MCP based on canvas size.
var idealWidth = 1080;
var idealHeight = 1250;
var cWR = canvas.width/idealWidth;
var cHR = canvas.height/idealHeight;
var oldCtx = canvas.getContext('2d');
// console.log("CP Canvas size:", canvas);
$(img).load(f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNewCoordinate() {\n var randCoordArr = generateXY();\n coordinates = new CurrentPicturePosition(randCoordArr[0], randCoordArr[1]);\n}",
"function add_control_points($m_d){\n\n var ctrl_pts = [[],[],[]];\n\n // Create control point divs\n for(var i=0; i<3; i++){\n for(var j=0; j<3... | [
"0.5145468",
"0.502942",
"0.4838667",
"0.47832277",
"0.47704604",
"0.4757081",
"0.4745855",
"0.47455695",
"0.47452536",
"0.47413144",
"0.4730108",
"0.47298664",
"0.47192705",
"0.4678196",
"0.46698648",
"0.46276575",
"0.46173126",
"0.4608646",
"0.4601607",
"0.4601607",
"0.4601... | 0.6798256 | 0 |
Changes the track from either green or red back to white (done after a 60 second gap) | function resetTrack(mcpData){
mcpData.color = "white";
for (var i = 0; i < mcpData.segments.length; i++){
changeTrack(mcpData.segments[i], mcpData.color);
}
mcpTable[key(mcpData.name)] = mcpData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"illuminateColor(color){\r\n this.color[color].classList.add('light')\r\n setTimeout(()=>this.turnOffColor(color),350)\r\n}",
"changeWaveColor(e) {\n if (e.pageY < 1500) {\n var colors = [\"purple\", \"blue\"]; // color array to rotate between\n let nextColor = this.state.waveCo... | [
"0.66481894",
"0.6504718",
"0.6441019",
"0.64404863",
"0.6385904",
"0.6375105",
"0.6366777",
"0.6344392",
"0.6279172",
"0.6275546",
"0.62551045",
"0.6253842",
"0.62293714",
"0.62044555",
"0.6203768",
"0.6184944",
"0.61566436",
"0.61337864",
"0.60950845",
"0.6071546",
"0.60649... | 0.66811836 | 0 |
Download library from github and move to the specified destination | download(credentials, destination) {
let defered;
defered = q.defer();
//Check if the library already exists
if (fs.existsSync(destination)) {
return q.reject('Library ' + credentials.user + '/' + credentials.repo + ' : ' + credentials.master + ' already exists');
}
if (!fs.existsSync(des... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function downloadGithub(fromUrl,toPath,cli,next) {\n\n // Split module / version\n var githubName = fromUrl;\n\n if(githubName) {\n\n var tag = githubName.split('@')[1] || \"\";\n var githubName = githubName.split('@')[0];\n var tmpName = githubName.replace(\"/\",\"-\");\n\n if(githubName.split(\"/\... | [
"0.6691255",
"0.6138134",
"0.5816831",
"0.5685271",
"0.5557331",
"0.546293",
"0.542891",
"0.54006106",
"0.5358958",
"0.5283189",
"0.52390707",
"0.5214901",
"0.5189951",
"0.518736",
"0.5170919",
"0.51654714",
"0.51554275",
"0.51271427",
"0.5110653",
"0.5093666",
"0.50891864",
... | 0.63817173 | 1 |
Connect SwitchSceneAction to props | function mapActionToProps(dispatch) { return bindActionCreators({ SwitchSceneAction }, dispatch); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onClickScene_() {\n this.portraitToggleScene(true, true);\n }",
"dispatchClick() {\n console.log('' + this.props.gameSwitch);\n this.props.gameSwitch(this.props.buttonType);\n }",
"pixelShooterClicked () {\n this.SceneManager.switchToUsingTransaction('PixelShooter/Level1', Transition.named('Scrol... | [
"0.6591658",
"0.6242583",
"0.5940627",
"0.59102875",
"0.59102875",
"0.59102875",
"0.5887388",
"0.5818711",
"0.5746276",
"0.57367516",
"0.5708777",
"0.5705186",
"0.567099",
"0.56671834",
"0.56306064",
"0.55979186",
"0.55746335",
"0.555306",
"0.5547006",
"0.5535256",
"0.5529889... | 0.7272182 | 0 |
update the profile and clear the input text | function updateProfile() {
if (newName.value!="") {
name.innerHTML = newName.value;
}
if (newEmail.value!="") {
email.innerHTML = newEmail.value;
}
if (newPhone.value!="") {
phone.innerHTML = newPhone.value;
}
if (newZipcode.value!="") {
zipcode.innerHTML = newZipcode.value;
}
if (newPassw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearProfile() {\n\t\tthis.profile.innerHTML = ``;\n\t}",
"clearProfile () {\n this.profile.innerHTML = \"\";\n this.repos.innerHTML = \"\";\n }",
"updateProfile() {}",
"clearProfile() {\n this.profile.innerHTML = '';\n }",
"onUpdateProfile() {\n logger.info('Updating profile');\n this... | [
"0.74951446",
"0.7337377",
"0.7290716",
"0.72487354",
"0.67263246",
"0.6691333",
"0.6674794",
"0.6582861",
"0.65820324",
"0.6506085",
"0.65014094",
"0.64924705",
"0.64649236",
"0.64552474",
"0.64146656",
"0.6365147",
"0.634278",
"0.63262904",
"0.6317791",
"0.63016313",
"0.628... | 0.79763085 | 0 |
Populating the state with the names of the addons | componentDidMount() {
window.analytics.load("rBiTH1qWEocYJOaLHF5VPA0jB1suwx1C");
window.analytics.page("Home");
// eslint-disable-next-line
for (let key of api.addons) {
this.setState(prevState => ({
addons: {
...prevState.addons,
[key.name]: true
}
}));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _storeStates() {\n var initialStates = [], currentStates = [];\n\n Y.Object.each(G._modules, function (module, moduleId) {\n initialStates.push(moduleId + '=' + module.initialState);\n currentStates.push(moduleId + '=' + module.currentState);\n });\n\n G._... | [
"0.6142267",
"0.57618433",
"0.56733596",
"0.5666339",
"0.55964035",
"0.55843633",
"0.5541971",
"0.5541182",
"0.5516434",
"0.5500225",
"0.54832643",
"0.5441804",
"0.5403053",
"0.54023874",
"0.5374898",
"0.5360883",
"0.5334284",
"0.5294796",
"0.52917814",
"0.5289193",
"0.528201... | 0.58677703 | 1 |
Clears all the actual messages. | function _clear() {
angular.forEach(messages, function(msg, key) {
delete messages[key];
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearMessages() {\n chrome.runtime.sendMessage({type: \"clearMessages\"}, function(response) {\n displayResponse(response);\n });\n }",
"clear() {\n this.msgs = [];\n }",
"function clearMessages() {\n Log.trace( \"Enter - DoubleRecordMailServiceClientCore.clearMe... | [
"0.7842649",
"0.77021545",
"0.7435233",
"0.7348898",
"0.7317583",
"0.73111165",
"0.7215072",
"0.7102316",
"0.7055676",
"0.7020303",
"0.69899267",
"0.69857997",
"0.69365233",
"0.69299954",
"0.6907846",
"0.68629",
"0.6848382",
"0.6800666",
"0.67615736",
"0.67576563",
"0.6721515... | 0.82339555 | 0 |
crea las credenciales para insertar un usuario | function createUserCredentials(username, password) {
password = CriptoService.hashValor(password);
var userCredentials = {
username: username,
password: password,
role: "cliente",
state: true
};
return userCredentials;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createClientCredentials(legalName, nit, tradeName, ownerName, ownerPhonenumber,\n businessPhonenumber, additionalInformation, email, minOrderPrice) {\n var clientCredentials = {\n legal_name: legalName,\n nit: nit,\n trade_name: tradeName,\n email: email,\n owner_name: ownerName,\n own... | [
"0.6383419",
"0.62530756",
"0.623341",
"0.6226304",
"0.6060454",
"0.5964039",
"0.595407",
"0.5940048",
"0.59289736",
"0.5918977",
"0.58776337",
"0.58505774",
"0.58172816",
"0.5808365",
"0.57960534",
"0.5785148",
"0.5768919",
"0.5755929",
"0.57530576",
"0.5749634",
"0.57060945... | 0.6450205 | 0 |
crea las credenciales para insertar un cliente | function createClientCredentials(legalName, nit, tradeName, ownerName, ownerPhonenumber,
businessPhonenumber, additionalInformation, email, minOrderPrice) {
var clientCredentials = {
legal_name: legalName,
nit: nit,
trade_name: tradeName,
email: email,
owner_name: ownerName,
owner_phonenumbe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createUserCredentials(username, password) {\n password = CriptoService.hashValor(password);\n var userCredentials = {\n username: username,\n password: password,\n role: \"cliente\",\n state: true\n };\n return userCredentials;\n}",
"function criaUser() {\r\n var Usuarios = {\r\n ... | [
"0.57747465",
"0.5729597",
"0.56863564",
"0.5641148",
"0.5604138",
"0.5584965",
"0.55249786",
"0.54823273",
"0.54736584",
"0.5458199",
"0.5429654",
"0.54059327",
"0.54045177",
"0.5383505",
"0.53652847",
"0.5356847",
"0.53561133",
"0.53382313",
"0.533316",
"0.52958095",
"0.524... | 0.7192801 | 0 |
Fetch games by rank | static fetchGamesByRank(rank, callback) {
DBHelper.fetchGames((error, games) => {
if(error) {
callback(error, null);
}
else {
const game = games.find(r => r.Rank == rank);
if(game) {
callback(null, game);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRank(playername, game) {\n let gameQuery = ''\n\n if(!game) {\n gameQuery = 'tiberian-dawn'\n } else if (game.toLowerCase() == 'ra'){\n gameQuery = 'red-alert'\n } else {\n gameQuery = 'tiberian-dawn'\n }\n\n return axios.get(`https://cnc.community/api/leaderboard/${gameQuery}/players/se... | [
"0.6476483",
"0.6223874",
"0.6097312",
"0.60538876",
"0.60277516",
"0.59843785",
"0.59805906",
"0.5977974",
"0.59217256",
"0.59100056",
"0.58602566",
"0.58375",
"0.5836297",
"0.58161795",
"0.57910234",
"0.574115",
"0.57310367",
"0.5723776",
"0.5723287",
"0.56457406",
"0.56403... | 0.78762424 | 0 |
Fetch games by a genre | static fetchGamesByGenre(genre, callback) {
DBHelper.fetchGames((error, games) => {
if(error) {
callback(error, null);
}
else {
const results = games.find(r => r.Genre == genre);
callback(null, results);
}
})... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function searchByGenre(genQuery, catQuery) {\n let vgUrl = getVideoGameUrl({ type: \"genres\", value: genQuery });\n let pageLimit = 2;\n let totalResults = [];\n let resultList = [];\n const rawgResp = await fetch(vgUrl);\n const rawgResults = await rawgResp.json();\n setLoadingText();\n\n // determ... | [
"0.7255892",
"0.69054466",
"0.68872815",
"0.6836134",
"0.67831963",
"0.674523",
"0.6738296",
"0.6697062",
"0.66723543",
"0.6629765",
"0.6628334",
"0.6585774",
"0.65763086",
"0.6480252",
"0.63355297",
"0.6333728",
"0.6302603",
"0.62928194",
"0.6283388",
"0.62545204",
"0.621521... | 0.83118737 | 0 |
Fetch games by a publisher | static fetchGamesByPublisher(publisher, callback) {
DBHelper.fetchGames((error, games) => {
if(error) {
callback(error, null);
}
else {
const results = games.find(r => r.Publisher == publisher);
callback(null, results);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static fetchGamesByOptions(name, genre, publisher, callback) {\n // Fetch all games\n DBHelper.fetchGames((error, games) => {\n if (error) {\n callback(error, null);\n } else {\n let results = games;\n if (genre != 'all') { // filter by genre\n ... | [
"0.6594542",
"0.6153844",
"0.5772737",
"0.5742046",
"0.5740015",
"0.5735894",
"0.571504",
"0.56073785",
"0.54748666",
"0.5473204",
"0.54342926",
"0.54324967",
"0.5424212",
"0.542098",
"0.54198176",
"0.54025424",
"0.5398433",
"0.53793067",
"0.5358008",
"0.53553927",
"0.5320557... | 0.8209845 | 0 |
Takes 2d array and returns length of longest row Sets all rows to equal length by splicing 1 to front of arrays | function maxLength(arr){
var max = -1;
for(var row = 0; row < arr.length; row++){
if(arr[row].length > max){
max = arr[row].length;
}
}
for(var row = 0; row < arr.length; row++){
while(arr[row].length < max){
arr[row].splice(0,0,-1);
}
}
console.log(arr);
return max;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function find_longest(array){\r\n\tvar longest_length = 0, longest_index;\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tif (array[i].length > longest_length){\r\n\t\t\tlongest_length = array[i].length;\r\n\t\t\tlongest_index = i;\r\n\t\t}\r\n\t}\r\n\treturn array[longest_index];\r\n}",
"function findLonge... | [
"0.6384833",
"0.63718414",
"0.6332412",
"0.62277234",
"0.62277234",
"0.62277234",
"0.62277234",
"0.62277234",
"0.62277234",
"0.6226022",
"0.61987436",
"0.61366045",
"0.611114",
"0.61040455",
"0.59929895",
"0.5976747",
"0.5961408",
"0.59498155",
"0.59229344",
"0.59047",
"0.589... | 0.6776699 | 0 |
Verify an attestation response with fmt 'packed' | async function verifyAttestationPacked(options) {
const { attStmt, clientDataHash, authData, credentialPublicKey, aaguid } = options;
const { sig, x5c, alg } = attStmt;
if (!sig) {
throw new Error('No attestation signature provided in attestation statement (Packed)');
}
if (typeof alg !== 'n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verifyAttestationPacked(_x) {\n return _verifyAttestationPacked.apply(this, arguments);\n}",
"function extractStaticReport(aisData,binPayload,nBits) {\n var lenerr = checkPayloadLength(aisData,nBits,422);\n if (lenerr) {\n return lenerr;\n }\n aisData.version = extractInt(binPayload,38,2);\n ai... | [
"0.6135289",
"0.5275512",
"0.5190437",
"0.5122045",
"0.50871867",
"0.5055617",
"0.5029328",
"0.5001743",
"0.49545026",
"0.4949397",
"0.48948154",
"0.4838143",
"0.48124236",
"0.4800304",
"0.4772103",
"0.47654384",
"0.4757374",
"0.4729775",
"0.47190037",
"0.4697439",
"0.4696014... | 0.6707207 | 0 |
Loops through the categories. Gets called on set interval below. | function LoopCategories() {
// Sets back to start if it's at the end
if (ActiveCategory >= categories.length)
ActiveCategory = 0;
$('.category').removeClass('active');
$('.category[data-id=' + (ActiveCategory) + ']').addClass('active');
RenderSectionTwo(categories[(ActiveCategory)]);
Act... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_category(direction) {\n \n //set previous panels and category\n prev_category = curr_category;\n prev_panel = curr_panel;\n\t\t\t\t\ttimer.start();\n \n switch (direction) {\n case \"up\":\n curr_panel = 1;\n if... | [
"0.6261516",
"0.62454545",
"0.62318695",
"0.6081169",
"0.60597914",
"0.59495485",
"0.5937331",
"0.5932674",
"0.57768047",
"0.57497036",
"0.57284",
"0.5649412",
"0.56455123",
"0.56450784",
"0.5611598",
"0.55709827",
"0.5568873",
"0.5564737",
"0.5534262",
"0.5526798",
"0.552066... | 0.7261832 | 0 |
Returns the Category from the categories array that matches the ID passed in. | function GetCategoryByID(id) {
return categories.filter(function (obj) {
return obj.id == id;
})[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }",
"function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }",
"function findCatById (id) {\r\n return catArray.find(c => c.id == id);\r\n }",
"function getCategory(id){\n return _categor... | [
"0.7834737",
"0.77846587",
"0.7780281",
"0.7632837",
"0.73184764",
"0.72542024",
"0.7095294",
"0.70382816",
"0.70367664",
"0.69674873",
"0.681025",
"0.67620015",
"0.65534085",
"0.64900607",
"0.6437234",
"0.63592726",
"0.63539404",
"0.6345058",
"0.62722534",
"0.6260848",
"0.62... | 0.83875364 | 0 |
Populates section two with the data from the category passed in. Fades in and fades out most elements and adds a class on the image to slide in. | function RenderSectionTwo(category) {
// How fast you want things to fade in and fade out
var speed = 200;
// Header
$('.category-header').fadeOut(speed, function () {
$(this).html(category.header).fadeIn(speed);
});
// Description
$('.category-description').fadeOut(speed, function ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LoopCategories() {\n // Sets back to start if it's at the end\n if (ActiveCategory >= categories.length)\n ActiveCategory = 0;\n $('.category').removeClass('active');\n $('.category[data-id=' + (ActiveCategory) + ']').addClass('active');\n RenderSectionTwo(categories[(ActiveCategory)... | [
"0.5965903",
"0.5965371",
"0.59038705",
"0.577098",
"0.57383716",
"0.5701671",
"0.555754",
"0.54799366",
"0.5463758",
"0.54310846",
"0.54196864",
"0.5341602",
"0.53302133",
"0.530973",
"0.5308524",
"0.5299417",
"0.5282318",
"0.5282318",
"0.52766037",
"0.52766037",
"0.52766037... | 0.79275197 | 0 |
This will simply fill the notes array with a fresh coat of Note instances based on its current state. | fill() {
this.notes = []
for (let fret of range(0, this.frets)) {
this.notes[fret] = []
for (let string of range(1, this.strings)) {
this.notes[fret][string - 1] = new Note(fret, string)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(notes = []) {\n if (!notes.length) {\n this.notes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n } else {\n this.notes = notes\n }\n }",
"refillNotes() {\n if(this.dirtyNotesId.size + 1 !== this.notes.length) {\n this.dataTableData = JSON.pars... | [
"0.68364954",
"0.6665591",
"0.65712166",
"0.6510906",
"0.6422695",
"0.6273582",
"0.6247074",
"0.6198872",
"0.619068",
"0.6186577",
"0.61735463",
"0.61366034",
"0.6126026",
"0.61133486",
"0.6050685",
"0.604838",
"0.603837",
"0.60192716",
"0.6010273",
"0.59981394",
"0.59928936"... | 0.8004676 | 0 |
This will handle the rebuilding of the intervalrelated data, but unlike the original this doesn't take care of the arguments parsing. | buildInterval() {
if (this.tuning.length !== this.strings) {
throw new Error('Tuning is invalid for the number of strings given.')
}
const ln = this.scaleLength * (this.maxIndex + 1) - 1
const intervals = range(0, ln).map(i => {
const f = i + 1
const index = Math.floor(i / this.scaleLe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modifyInterval () {\n try {\n // Retrieve time values from the user inputs, verify the dates are valid by attempting to create Date objects\n var subsetStart = new Date($('#subsetStart').combodate('getValue', null)._d);\n subsetStart = subsetStart.getTime();\n var subsetEnd ... | [
"0.62482613",
"0.602329",
"0.5815648",
"0.58090144",
"0.57889783",
"0.5786254",
"0.5748546",
"0.5673032",
"0.5607815",
"0.5522717",
"0.54405457",
"0.54324",
"0.53841686",
"0.53693724",
"0.5360616",
"0.5359917",
"0.53367156",
"0.53173435",
"0.5289303",
"0.5234565",
"0.5215532"... | 0.64267325 | 0 |
This will set up the shifted interval value for building the scale. | buildRootedValue() {
this.forEach((note, fret, string) => {
note.interval.shift = note.interval.value - this.root + 1
if (note.interval.shift < 1) {
note.interval.shift += this.scaleLength
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setScale(selector, value) {\n\t\t\tlet start = -2.2;\n\t\t\tlet end = 97.4;\n\t\t\tlet range = end - start;\n\n\t\t\t$(`${selector}.scale-space .tick`).css('left', `${range * value + start}%`)\n\t\t}",
"function Scale () {}",
"function changeRange() {\n\t\t\t\t// var v = range.max - range.value;\n\t\t... | [
"0.6000853",
"0.58510095",
"0.58453906",
"0.56276375",
"0.5581403",
"0.557939",
"0.55589503",
"0.54925126",
"0.54759336",
"0.54759336",
"0.54751766",
"0.53924817",
"0.5375054",
"0.53599846",
"0.5316859",
"0.5301575",
"0.52770895",
"0.52406514",
"0.5232146",
"0.5220475",
"0.52... | 0.6525257 | 0 |
Simple BinaryWriter is a minimal tool to write binary stream with unpredictable size. Useful for binary serialization. Copyright (c) 2016 Barbosik Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unle... | function BinaryWriter(size) {
if (!size || size <= 0) {
size = Buffer.poolSize / 2;
}
this._buffer = new Buffer(size);
this._length = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _BinaryWriter(byteLength) {\r\n this._arrayBuffer = new ArrayBuffer(byteLength);\r\n this._dataView = new DataView(this._arrayBuffer);\r\n this._byteOffset = 0;\r\n }",
"function BinaryPacker() {\n}",
"function BigEndianWriter(capacity){//Constants\n/**\n * Size of Int3... | [
"0.6373827",
"0.5946227",
"0.575813",
"0.57142645",
"0.56840235",
"0.5646015",
"0.5537363",
"0.54767716",
"0.545163",
"0.5418185",
"0.5418185",
"0.5418185",
"0.5418185",
"0.5418185",
"0.5403477",
"0.53870994",
"0.5384783",
"0.5368289",
"0.534568",
"0.5271903",
"0.52440464",
... | 0.73009527 | 0 |
The jQM pageshow callback for the node listing page. | function node_page_pageshow() {
try {
// Grab some recent content and display it.
views_datasource_get_view_result(
'drupalgap/views_datasource/drupalgap_content', {
success: function(content) {
// Extract the nodes into items, then drop them in the list.
var items = [];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function node_page_pageshow() {\n try {\n // Grab some recent content and display it.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_content', {\n success: function(content) {\n // Extract the nodes into items, then drop them in the list.\n var item... | [
"0.71650225",
"0.6579898",
"0.6504215",
"0.65009344",
"0.6500543",
"0.64930665",
"0.6478182",
"0.6394367",
"0.6328794",
"0.6269556",
"0.6269556",
"0.6224247",
"0.6182885",
"0.60869515",
"0.6080953",
"0.5934516",
"0.5925063",
"0.5916291",
"0.59002674",
"0.5740744",
"0.57276624... | 0.70667744 | 1 |
Run through all the available boxes and return every psquare (every square that would be created if that box were either blue or red) and its score | function findPsquares(color) {
var returnScore = 0,
thisScore,
allScores = 0,
thisBox,
upLeftScore,
upRightScore,
downLeftScore,
downRightScore;
for (let x = 0; x < board.size; x++) {
for (let y = 0; y < board.size; y++) {
thisBox = boa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addScore (box) {\n\t\tconst boxVal = $(box).data('box')\n\n\t\tif($(box).hasClass(orange)) {\n\t\t\torangeScore.push(boxVal);\n\t\t\tusedBoxes.push(boxVal);\n\t\t\tcheckForWinner(orangeScore)\n\t\t\tcheckForDraw();\n\t\t\tconsole.log(orangeScore)\n\n\t\t}\n\t\telse if($(box).hasClass(blue)) {\n\t\t\tblueS... | [
"0.70893973",
"0.7069377",
"0.66679364",
"0.63309",
"0.6226514",
"0.6161927",
"0.6111826",
"0.60928655",
"0.6068379",
"0.60620505",
"0.6051496",
"0.6016324",
"0.6011951",
"0.5982396",
"0.59625906",
"0.59127593",
"0.58812255",
"0.58728313",
"0.5846794",
"0.58259326",
"0.582214... | 0.78969824 | 0 |
Run through all the available boxes and return every pdiamond (every diamond that would be created if that box were either blue or red) and its score | function findPdiamonds(color) {
var returnScore = 0,
thisScore,
allScores = 0,
thisBox,
upScore,
rightScore,
downScore,
leftScore;
for (let x = 0; x < board.size; x++) {
for (let y = 0; y < board.size; y++) {
thisBox = board.box(x, y);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scoreDiamond(d) {\n if (!d) {\n return 0;\n }\n var x = d.x,\n y = d.y,\n side = d.side,\n c = d.color,\n delta = 1,\n diamondScore = 0,\n fillBox, fillScore;\n for (let i = 1; i <= side; i++) {\n for (let j = -delta; j <= delta; j++) {\n... | [
"0.7626112",
"0.67168784",
"0.60920316",
"0.57920676",
"0.5514166",
"0.5485776",
"0.54831326",
"0.54661494",
"0.54538554",
"0.54362273",
"0.5424985",
"0.5424775",
"0.54153186",
"0.5352664",
"0.53489417",
"0.53435063",
"0.5341195",
"0.5334872",
"0.531597",
"0.53041846",
"0.527... | 0.81314546 | 0 |
Returns true is box is a corner of square | function squareCorner(square, box) {
var x = square.x,
y = square.y,
side = square.side;
return ((box.x == x && box.y == y) || (box.x == x + side && box.y == y) || (box.x == x && box.y == y + side) || (box.x == x + side && box.y == y + side));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function in_box(x, y, box) {\n return (\n x >= box.x - trial.box_linewidth &&\n x <= box.x + box.w + trial.box_linewidth * 2 &&\n y >= box.y - trial.box_linewidth &&\n y <= box.y + box.h + trial.box_linewidth * 2\n );\n }",
"function in_box(x, y, box) {\n return x >=... | [
"0.7485855",
"0.74390453",
"0.7394299",
"0.7379427",
"0.7354824",
"0.7152879",
"0.6956486",
"0.6932188",
"0.6819177",
"0.6679628",
"0.6671201",
"0.6624337",
"0.657732",
"0.65715075",
"0.6515754",
"0.6514427",
"0.65142494",
"0.65126514",
"0.65004176",
"0.6497599",
"0.64959145"... | 0.83415854 | 0 |
Returns true is box is a corner of diamond | function diamondCorner(diamond, box) {
var x = diamond.x,
y = diamond.y,
side = diamond.side;
return ((box.x == x && box.y == y) || (box.x == x - side && box.y == y + side) || (box.x == x + side && box.y == y + side) || (box.x == x && box.y == y + 2 * side));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isCornerBlock(){\n return ((xCo == 0 || xCo == MAX_X - 1) && (yCo == 0 || yCo == MAX_Y - 1));\n }",
"isCorner(x, y) {\n //check if the random number give a cell in the corner\n if (x == 1) {\n if (y >= 1 && y <= spawnCorner)\n return true;\n ... | [
"0.6977331",
"0.68503124",
"0.6740337",
"0.6598644",
"0.6554822",
"0.6532507",
"0.63717103",
"0.636181",
"0.6320414",
"0.63005996",
"0.6245665",
"0.6236106",
"0.62145364",
"0.6208004",
"0.61851144",
"0.6125284",
"0.61148006",
"0.605118",
"0.60480136",
"0.60412955",
"0.6022687... | 0.8498182 | 0 |
Draw a selection box on the canvas \param ax x coordinate of the first point \param ay y coordinate of the first point \param bx x coordinate of the second point \param by y coordinate of the second point \param alpha circle transparency | function ksfCanvasdrawBox(ax, ay, bx, by, alpha)
{
this.clear();
context.save();
context.fillStyle = "rgba(255, 0, 0, " + alpha / 2 + ")";
context.beginPath();
context.arc(ax, ay, 5, 0, Math.PI*2);
context.arc(ax+bx, ay+by, 5, 0, Math.PI*2);
context.fill();
context.closePath();
context.restore();
context.stro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n if (canvasValid == false) {\n clear(ctx);\n \n // Add stuff you want drawn in the background all the time here\n \n // draw all boxes\n var l = boxes.length;\n for (var i = 0; i < l; i++) {\n drawshape(ctx, boxes[i], boxes[i].fill);\n }\n \n // draw selecti... | [
"0.600757",
"0.59270376",
"0.589858",
"0.5859297",
"0.5858715",
"0.57902634",
"0.5733858",
"0.56953496",
"0.5657093",
"0.56485385",
"0.5632532",
"0.55974495",
"0.55812645",
"0.55572206",
"0.55393136",
"0.5533301",
"0.5524826",
"0.5523123",
"0.5510159",
"0.55019987",
"0.549950... | 0.68947226 | 0 |
Draw a polygon on the canvas \param xList x coordinates of the points \param yList y coordinates of the points \param lastx x coordinates of the last points (null if no last point) \param lasty y coordinates of the last points (null if no last point) \param startRadius radius of the starting point (red area clickable t... | function ksfCanvas_drawPolygon(xList, yList, lastx, lasty, startRadius, alpha)
{
// Stop drawing if there is only a single point.
if (xList.length < 1)
{
return;
}
// Draw first/final large joint.
context.beginPath();
context.fillStyle = "rgba(255, 0, 0, " + alpha / 2 + ")";
context.arc(xList[0], yList[0], st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawPolygon(radius=150, sides=7, r=185, g=185, b=15){\n\n context.translate(canvas.width/2, canvas.height/2);\n var a = ((Math.PI * 2)/sides);\n context.beginPath();\n context.moveTo(radius, 0);\n for(var i=1; i<sides; i++){\n context.lineTo(radius*Math.cos(a*i), radius*Math.sin(a*i)... | [
"0.58817315",
"0.5667302",
"0.5618496",
"0.5592321",
"0.5582902",
"0.5582902",
"0.557946",
"0.55701494",
"0.54732853",
"0.5428364",
"0.53087753",
"0.52016157",
"0.51893026",
"0.51798075",
"0.5168534",
"0.51682687",
"0.5100212",
"0.5100212",
"0.5100212",
"0.50484115",
"0.50431... | 0.7405199 | 0 |
Draws an oval on the canvas \param cx x coordinates of the center points \param cy y coordinates of the center points \param r1 first radius of the oval \param p2x x coordinates of the last point (it belongs to the oval) \param p2y y coordinates of the last point (it belongs to the oval) \param alpha circle transparenc... | function ksfCanvas_drawOval(cx, cy, r1, p2x, p2y, alpha)
{
this.clear();
var r2, angle, tx, ty;
if (p2x !== null && p2y !== null)
{
tx=cx-p2x;
ty=cy-p2y;
r2 = Math.sqrt(Math.pow(tx,2)+Math.pow(ty,2));
angle = ksfGraphTools.mesureAngle(tx, ty);
}
else
{
r2 = r1;
angle = 0;
}
context.beginPath();... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawCircleArc(ctx, c, r, p1, p2, side) {\n var ang1 = Math.atan2(p1.y - c.y, p1.x - c.x);\n var ang2 = Math.atan2(p2.y - c.y, p2.x - c.x);\n ctx.arc(c.x, c.y, r, ang1, ang2, side);\n } //function drawCircleArc",
"function drawCircleArc(ctx, c, r, p1, p2, side) {\n var ang1 = Math.atan2(p1.y... | [
"0.6480061",
"0.6480061",
"0.6328843",
"0.62747943",
"0.6234262",
"0.6223571",
"0.61966485",
"0.61926883",
"0.61926883",
"0.61697835",
"0.61563665",
"0.61336786",
"0.6127303",
"0.61187565",
"0.6064672",
"0.6048589",
"0.6026641",
"0.6007063",
"0.5974172",
"0.5928856",
"0.59288... | 0.79969454 | 0 |
Draws a circle on the canvas \param cx x coordinate of the center points \param cy y coordinate of the center points \param p2x x coordinate of the point on the circumference \param p2y y coordinate of the point on the circumference | function ksfCanvas_drawCircle(cx, cy, px, py)
{
this.clear();
var r;
alpha = 1;
context.beginPath();
context.fillStyle = "rgba(255, 0, 0, "+(alpha/2)+")";
context.arc(cx, cy, 5, 0, Math.PI*2);
context.arc(px, py, 5, 0, Math.PI*2);
context.closePath();
context.fill();
context.save();
r = Math.sqrt(Math.pow(px... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function circle(cx,cy) {\n\tctx.beginPath();\n\tctx.moveTo(cx, cy);\n\tctx.arc(cx, cy, 11, 0, Math.PI*2, false);\n\tctx.closePath();\n\tctx.fill();\n}",
"function drawCircle( x, y ) {\n ctx2.beginPath();\n ctx2.arc(x, y, radius, 0, Math.PI * 2);\n ctx2.fillStyle = color;... | [
"0.74604267",
"0.7354573",
"0.696816",
"0.6899822",
"0.68729985",
"0.67293954",
"0.672822",
"0.67141753",
"0.6704494",
"0.6701812",
"0.6686893",
"0.6667741",
"0.6653933",
"0.6647541",
"0.6623299",
"0.66035",
"0.65896475",
"0.65756863",
"0.65560085",
"0.655071",
"0.6489017",
... | 0.75668174 | 0 |
Set the text shown in the tool description area \param msg [string] text to be shown \note This area is used to explain the current tool type to the user | function ksfCanvas_toolDescription(msg)
{
var tool_description = $(TOOL_DESCRIPTION);
if(tool_description !== null)
{
tool_description.text(msg);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ksfCanvas_toolText(msg)\n{\n\tif (tool_popover !== null)\n\t{\n\t\ttool_popover.text(msg);\n\t}\n}",
"function setupToolTips(id, msg) {\n let newID = id + 'tip';\n document.getElementById(newID).innerHTML = msg;\n document.getElementById(newID).style.visibility = \"hidden\";\n\n}",
"function displa... | [
"0.7936892",
"0.646894",
"0.6460253",
"0.63583845",
"0.6356342",
"0.63064396",
"0.628764",
"0.6280797",
"0.6101369",
"0.60876995",
"0.6062417",
"0.6010611",
"0.600984",
"0.59940404",
"0.59781617",
"0.59559566",
"0.5950516",
"0.59480155",
"0.59458333",
"0.58756226",
"0.5875622... | 0.8422497 | 0 |
Set the cursor of the graph \param cursor [string] cursor name as defined by css (see \note This area is used to provide the user with a short feedback on his actions | function ksfCanvas_setCursor(cursor)
{
$(GRAPH_ID).css( 'cursor', cursor );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeCursor(newCursor) {\n canvas.style.cursor = newCursor\n}",
"function showCursor(cur)\n {\n if (cur != undefined) selectCursor(cur);\n container.style.cursor = currentCursor;\n\t}",
"setMouseCursor (type = 'crosshair') {\n this.canvas.style.cursor = type;\n }",
"sh... | [
"0.75453436",
"0.70770466",
"0.699453",
"0.6845849",
"0.68218046",
"0.67714316",
"0.66954505",
"0.665407",
"0.6522687",
"0.63667685",
"0.6361136",
"0.62324804",
"0.62089086",
"0.62025577",
"0.61420774",
"0.6119118",
"0.6106799",
"0.6088502",
"0.6075785",
"0.6053869",
"0.60338... | 0.824374 | 0 |
Set the enbabled status of a button \param btn [string] jquerry name (id , .class ... etc) that points to the button \param enable [boolean] define if we want to enable or not the button \note depending on the string this can applies to multiple buttons | function ksfCanvas_enableBtn(btn, enable)
{
if (enable)
{
$(btn).removeAttr("disabled");
}
else
{
$(btn).attr('disabled','disabled');
}
if (btn === REQUEST_GATING_BTN && enable)
{
ksfCanvas.blinkButton(btn);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableButton(aID, aEnable)\n{\n return setButtonAttr(aID, \"disabled\", !aEnable);\n}",
"function btnEnable(btn) {\n if (btn.id === \"btnStart\") {\n btn.style.border = \"2px solid rgb(0, 153, 0)\";\n btn.style.backgroundColor = \"rgb(57, 230, 0)\";\n }\n else if (btn.id === \"bt... | [
"0.7053581",
"0.7029272",
"0.6819519",
"0.67338365",
"0.6697424",
"0.6578492",
"0.6568344",
"0.6565973",
"0.65659493",
"0.655193",
"0.65508944",
"0.6545778",
"0.6544079",
"0.65418035",
"0.65355814",
"0.65161204",
"0.6515447",
"0.6512304",
"0.65122277",
"0.65121293",
"0.650944... | 0.76063335 | 0 |
Replace the image of the graph by a spinner or the opposit \param enable [boolean] define if we replace the image by a spinner or not | function ksfCanvas_setLoading(enable)
{
if (enable)
{
$(GRAPH_ID).addClass("loading");
$("#graph-img").css("display", "none");
}
else
{
$(GRAPH_ID).removeClass("loading");
$("#graph-img").css("display", "");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enabled(enable) {\n if ( enable ) {\n this.material.emissiveTexture = this.thumbnail;\n } else {\n this.material.emissiveTexture = null;\n }\n this.title.isVisible = enable || this.alwaysShowTitle;\n this.isEnabled = enable;\n this.playSound(enable);\n }",
"function showSpinner(enabl... | [
"0.6044192",
"0.59061635",
"0.58126837",
"0.57701826",
"0.57516104",
"0.56291467",
"0.56027424",
"0.5537017",
"0.55131686",
"0.54060984",
"0.53884155",
"0.5356956",
"0.53457224",
"0.5345373",
"0.5327922",
"0.52850765",
"0.5283895",
"0.5279731",
"0.5278433",
"0.52639747",
"0.5... | 0.7144885 | 0 |
Makes an element blink \param btn element to blink (id, .class, etc) | function ksfCanvas_blinkButton(btn)
{
var resetBackColor = $(btn).css('background-color');
var resetColor = $(btn).css('color');
$(btn).animate(
{
"background-color": "#FF8500",
"color": "#fff"
}, 200, function()
{
$(btn).animate(
{
"background-color": resetBackColor,
"color": resetColor
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doBlink() {\n\t\t// Blink, Blink, Blink...\n\t\tvar blink = document.all.tags(\"BLINK\")\n\t\tfor (var i=0; i < blink.length; i++)\n\t\t\tblink[i].style.visibility = blink[i].style.visibility == \"\" ? \"hidden\" : \"\" \n\t}",
"function blink(dropDownID, color){\n\tvar btn = $('button#' + dropDownID);\... | [
"0.7078001",
"0.70733345",
"0.7001332",
"0.6914747",
"0.6831478",
"0.6829178",
"0.665815",
"0.6655835",
"0.6642689",
"0.65909266",
"0.6548775",
"0.6456204",
"0.64494383",
"0.64211714",
"0.6417099",
"0.639769",
"0.63824606",
"0.63470006",
"0.63405746",
"0.63371",
"0.632193",
... | 0.7903676 | 0 |
Substitute variables in the string with defined map. | function _substitute(str, map) {
for (var name in map) {
if (map.hasOwnProperty(name)) {
str = str.replace(new RegExp('@' + name, 'gi'), map[name]);
}
}
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replace(dict) {\r\n // Replace the template with the inputs,\r\n // write the replaced template to the output\r\n let ta_temp = document.getElementById(\"ta_template\");\r\n let ta_outp = document.getElementById(\"ta_output\");\r\n let string = ta_temp.value;\r\n Object.keys(dict).forEac... | [
"0.63718367",
"0.622557",
"0.6130654",
"0.61212397",
"0.6069825",
"0.6028023",
"0.5965122",
"0.5947553",
"0.5943413",
"0.5933159",
"0.5903744",
"0.58997196",
"0.5860197",
"0.58564633",
"0.5835731",
"0.577117",
"0.57433134",
"0.5701821",
"0.5687236",
"0.5672439",
"0.567218",
... | 0.73541623 | 0 |
Set the style element's content. | function _setStyleContent(el, content) {
if (el && el.tagName.toLowerCase() === 'style') {
el.styleSheet
? (el.styleSheet.cssText = content )
: (el.innerHTML = content);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StyleContent() { }",
"set css(val) {\n if (this.vueMeta) {\n if (this.isVueMeta23) {\n this.applyVueMeta23();\n }\n\n return;\n }\n\n this.checkOrCreateStyleElement() && (this.styleEl.innerHTML = val);\n }",
"set css(val) {\n if (this.vueMeta) {\n if (this.isVue... | [
"0.6947681",
"0.63392556",
"0.63392556",
"0.63392556",
"0.63392556",
"0.63392556",
"0.6327973",
"0.631135",
"0.631135",
"0.63094",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
"0.6291284",
... | 0.74493545 | 0 |
Log, unless logging is disabled. Parameters identical with console.log. | function log () {
if (shouldLog) {
console.log.apply(this, arguments)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function debuglog(){\n if(false)\n console.log.apply(this,arguments)\n}",
"function dummyLogging()\n{\n console.log.apply(console, arguments);\n}",
"function log(/* ...args */) {\n if (log_enabled) {\n console.log.apply(console, [].slice.call(arguments));\n }\n}",
"function _log() {\n if... | [
"0.8058679",
"0.7932008",
"0.78437793",
"0.7833965",
"0.782333",
"0.782333",
"0.7761453",
"0.7742438",
"0.76960164",
"0.7677412",
"0.76453763",
"0.7644265",
"0.76292354",
"0.7593469",
"0.756097",
"0.75562155",
"0.7502065",
"0.7443483",
"0.7416694",
"0.74152464",
"0.73566973",... | 0.82395834 | 0 |
Warn, unless logging is disabled. Parameters identical with console.error. | function warn () {
if (shouldLog) {
console.warn.apply(this, arguments)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function warn() {\n var messages = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n if (console) {\n console.warn.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(messages));\n }\n}",
"static warn(...args) {\n i... | [
"0.75325775",
"0.7492608",
"0.7344805",
"0.7028248",
"0.6983292",
"0.69615096",
"0.69577634",
"0.6880349",
"0.6840958",
"0.6807101",
"0.679461",
"0.67888224",
"0.67861515",
"0.6777445",
"0.67642",
"0.6727366",
"0.6719697",
"0.67176443",
"0.66272706",
"0.6609395",
"0.66088694"... | 0.806235 | 0 |
tryRegister(email, username, password) Given an email, name and password, checks if they're nonempty. If they are, make an AJAX call to tryregister.php and set any errors. | function tryRegister(email, username, password){
var error = 0;
if (email == ""){
$('#email').addClass("error");
$('#email').attr('placeholder', 'Email required');
error = 1;
}
if (password == ""){
$('#password').addClass("error");
$('#password').attr('placeholder... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function register() {\n const username = (document.querySelector(\"#username\").value);\n const password = (document.querySelector(\"#password\").value);\n const email = (document.querySelector(\"#email\").value);\n\n if (checkMatches(username, password, email) !== false) {\n putRegisterHTTPRequ... | [
"0.7712767",
"0.75203365",
"0.7338448",
"0.7325284",
"0.7141341",
"0.70833486",
"0.7031634",
"0.7020355",
"0.7015386",
"0.7003637",
"0.693078",
"0.69214547",
"0.69048285",
"0.6871453",
"0.6853322",
"0.6848778",
"0.68412584",
"0.68291354",
"0.6777829",
"0.67463267",
"0.6731460... | 0.8182563 | 0 |
Takes ownership of a lockfile if it's more than six hours old. / Racesafe version... 1) If date is "too old", pick a random time in the future. 2) Set the file date to that random time. 3) Wait one second (there's still an unlikely race here) 4) If the file date is the random time you chose, set the date to now and tak... | function take_lockfile(f)
{
var orig_date;
var future;
var remain;
var now = time();
if (!f.exists)
return false;
// TODO: This is hacked for a signed 32-bit time_t... watch out in 2038!
orig_date = f.date;
if (orig_date > (now - 60*60*6)) {
log(LOG_INFO, format("Lock is too recent to override n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCooldown(date) {\n fs.writeFileSync(\".cooldown\", date.getTime().toString());\n}",
"makeFileExpire(uri, item) {\n if (this.updating) {\n this.updateFile(uri, item);\n }\n else {\n let beFreshBefore = item.fresh;\n item.fresh = false;\n ... | [
"0.5858849",
"0.53290987",
"0.5167774",
"0.5080641",
"0.5042139",
"0.4918012",
"0.47536492",
"0.47119445",
"0.4693819",
"0.46584976",
"0.46173137",
"0.46004447",
"0.45962355",
"0.45771223",
"0.4569217",
"0.45551652",
"0.45455804",
"0.45426106",
"0.45219743",
"0.45210332",
"0.... | 0.7915787 | 0 |
Given a list of addresses to rescan, calls bp.addFile() for any pending file transfers. TODO: Call this after sending a M_EOB to rescan per FSP1024? We hold the lock files, so nothing should be changing the flow files (per FTS5005) though. This is mostly for REQ handling, so if we do integrate freqit.js, we should be f... | function add_outbound_files(addrs, bp)
{
function has_lock(addr) {
var bsy = outbound_root(addr, bp.cb_data.binkit_scfg)+addr.flo_outbound(bp.default_zone, bp.default_domain)+'bsy';
var i;
for (i=0; i<bp.cb_data.binkit_locks.length; i++) {
if (bp.cb_data.binkit_locks[i].bsy.name === bsy)
return true;
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addFiles(fileDescriptors) {\n _classPrivateFieldLooseBase(this, _assertNewUploadAllowed)[_assertNewUploadAllowed](); // create a copy of the files object only once\n\n\n const files = { ...this.getState().files\n };\n const newFiles = [];\n const errors = [];\n\n for (let i = 0; i < fileDescripto... | [
"0.5233822",
"0.51790774",
"0.51790774",
"0.5028572",
"0.5018726",
"0.50026834",
"0.4951148",
"0.48847368",
"0.4865553",
"0.48383087",
"0.4714968",
"0.47102305",
"0.46771917",
"0.4676788",
"0.46616974",
"0.4654863",
"0.45952097",
"0.45921886",
"0.45544016",
"0.45403072",
"0.4... | 0.6690086 | 0 |
Upgrade from separate binkit.ini/sbbsecho.ini/ftn_domains.ini to a combined sbbsecho.ini | function upgrade()
{
var sbbsecho_ini = new File(file_cfgname(system.ctrl_dir, "sbbsecho.ini"));
if (!sbbsecho_ini.open('r+'))
return sbbsecho_ini.name + " open error " + sbbsecho_ini.error;
printf("Updating %s\r\n", sbbsecho_ini.name);
var binkit_ini = new File(file_cfgname(system.ctrl_dir, "binkit.ini"));
if(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function install()\n{\n\tvar cnflib = load({}, \"cnflib.js\");\n\tvar xtrn_cnf = cnflib.read(\"xtrn.cnf\");\n\tif (!xtrn_cnf)\n\t\treturn \"Failed to read xtrn.cnf\";\n\n\tvar changed = false;\n\tif (!xtrn_area.event[\"binkout\"]) {\n\t\tprintf(\"Adding timed event: BINKOUT\\r\\n\");\n\t\txtrn_cnf.event.push( {\n\... | [
"0.56516105",
"0.50835943",
"0.50695205",
"0.49125153",
"0.48771816",
"0.48262423",
"0.47756356",
"0.47380117",
"0.47375003",
"0.46565107",
"0.46063387",
"0.45498028",
"0.45450556",
"0.4527981",
"0.45237297",
"0.45230225",
"0.45221964",
"0.44495463",
"0.4436988",
"0.44253784",
... | 0.70578516 | 0 |
This function positions a highlight box around the tabs in the tablist to use in focus styling | function setTablistHighlightBox() {
var $tab
, offset
, height
, width
, highlightBox = {}
highlightBox.top = 0
highlightBox.left = 32000
highlightBox.height = 0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectPosition(e) {\n removeColor();\n // Add border to current tab\n this.classList.add('current');\n}",
"function focusTab(idToShow, idToHighlight){\n\n\t//need to grab the parent so we can loop through tabs and palette content\n\tvar highlightId = dojo.byId(idToHighlight);\n\tvar tabListPar... | [
"0.6904388",
"0.6273315",
"0.6257644",
"0.62102747",
"0.61263907",
"0.6125824",
"0.61182714",
"0.6102847",
"0.6079776",
"0.6075041",
"0.606913",
"0.58886975",
"0.5879123",
"0.58053774",
"0.57814145",
"0.5765009",
"0.575531",
"0.575531",
"0.5752258",
"0.57382977",
"0.5724959",... | 0.81272495 | 0 |
Determine indentation of a line | function getIndent (line) {
return line.match(/^\s*/)[0].length
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCurrentLineIndentation() {\n return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length;\n }",
"function indentLevel(linea) {\n var level = 0;\n for ( i in linea ) {\n if ( linea[i] != ' ' ) { break;}\n level += 1;\n }\n return (level);\n}",
"indentation() {... | [
"0.76766205",
"0.7391099",
"0.72108173",
"0.66451913",
"0.6605668",
"0.659227",
"0.6554091",
"0.6517624",
"0.65137774",
"0.6504144",
"0.6500873",
"0.64427745",
"0.64390785",
"0.64390785",
"0.64207304",
"0.63853514",
"0.6349718",
"0.63473594",
"0.63473594",
"0.63473594",
"0.63... | 0.78210795 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.