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 |
|---|---|---|---|---|---|---|
console.log(new SnapPoints().frameSnaps); var snap = new BABYLON.Vector3(0,0,0); var snap1 = new BABYLON.Vector3(1,1,1); var snap2 = new BABYLON.Vector3(2,2,2); console.log(findClosestSnap(snap,"door",new SnapPoints().frameSnaps)); | function findClosestSnap(currentPoint,type,snapArray)
{
var tempSnap;
var nearestSnap = null;
var nearestDist = 0;
for (var i = 0; i < snapArray.length; i++) {
tempSnap = snapArray[i];
if(tempSnap.isSnapped == true)
continue;
if(tempSnap.type == type)
{
nearestSnap = tempSnap;
nearestDist = BABY... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getClosestDoorSnapPair() {\n\t\t// calculate the click point position\n\t\tvar click = this.clickP.add(this.mdragOffset);\n\t\t// we want the door closest to the click point\n\t\tvar doorDist = -1;\n\t\t// these will get filled in if we find a door pair to snap to\n\t\tvar snapDoor = null;\n\t\tvar snapOtherDoor =... | [
"0.640438",
"0.6000461",
"0.59615004",
"0.5845208",
"0.58174366",
"0.57569605",
"0.5647107",
"0.56313777",
"0.5594225",
"0.55887294",
"0.5517087",
"0.5460473",
"0.5458334",
"0.54275566",
"0.5415177",
"0.5409794",
"0.5408257",
"0.54043317",
"0.54002583",
"0.53972644",
"0.53882... | 0.668674 | 0 |
allow enroll() fxn to take an array of courses and add them all to enrolled events | function enroll(events) {
events.forEach(event => {
enrolledEvents.push(event);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enrollCourse(name) {\n this.#courseList.push(name);\n }",
"function enrollBtn(course) {\n const newCourses = [...cart, course];\n setCart(newCourses);\n }",
"static enrollStudents(...students) {\n return \"Enrolling Students!!!!\"\n }",
"function enrollStudent(courseData, callback) {\n ... | [
"0.6820194",
"0.6313967",
"0.6065056",
"0.5983091",
"0.5836469",
"0.57471514",
"0.57050586",
"0.56735265",
"0.5572041",
"0.55625325",
"0.5469279",
"0.54689753",
"0.54522157",
"0.543186",
"0.54199725",
"0.53942037",
"0.5392127",
"0.5362705",
"0.53557295",
"0.5342846",
"0.53181... | 0.722717 | 0 |
7. Sa se scrie o functie care returneaza true daca cel putin unul din elementele arrayului are culoarea 'green'; | function checkColor(arr, color) {
return arr.some(elem => elem.color === color);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function conatinsPurple(arr) {\n\tfor (let color of arr) {\n\t\tif (color === 'purple' || color === 'magenta') return true;\n\t}\n\treturn false;\n}",
"color_available(v,color){\n let vertex = this.vertices[v]\n for(let i=0; i<vertex.length; i++){\n let adj = vertex[i]\n if(th... | [
"0.74394566",
"0.68736285",
"0.66835535",
"0.6558925",
"0.6539305",
"0.65188575",
"0.6515298",
"0.64710104",
"0.6382254",
"0.63201016",
"0.63097405",
"0.6273224",
"0.62103355",
"0.61629844",
"0.61542994",
"0.6142963",
"0.6140749",
"0.6132587",
"0.61129034",
"0.61055845",
"0.6... | 0.7093378 | 1 |
get color depending on score value | function getColor(score) {
return score === "Medical leave" ? '#fefefe' :
score > 99 ? '#409B06' :
// score > 99 ? '#4EAB07' :
// score > 99 ? '#4EAB07' :
// score > 74 ? '#82e0c3' :
score > 74 ? '#A8CA02' :
// score > 74 ? '#BED802' :
// score... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"scoreColor(score){\n let scorecolor=\"\"\n if(score>=80){\n scorecolor=\"high-score\"\n }else{\n if(score>=50){\n scorecolor=\"medium-score\"\n }else{\n if(score<50){\n scorecolor=\"low-score\"\n }\n }\n }\n ... | [
"0.8271672",
"0.80049753",
"0.8004877",
"0.7765328",
"0.74805576",
"0.7190643",
"0.69653004",
"0.69598967",
"0.69018453",
"0.6813913",
"0.6753133",
"0.6728585",
"0.67278033",
"0.671473",
"0.66851026",
"0.66650826",
"0.6663436",
"0.66014755",
"0.65902114",
"0.655242",
"0.65204... | 0.8213737 | 1 |
listen for clicks on portfolio and about me links at menu bar | function menuBar() {
$('.nav').on('click', '.portfolioLink', function (event) {
portfolioPage();
})
$('.nav').on('click', '.aboutLink', function (event) {
aboutPage();
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleLinkClicked(e){\n if(toggleNav && toggleNav.classList.contains('active')){\n toggleNav.click()\n }\n // subTitles.forEach(title => {\n // if(e.target.dataset.to === \"home\"){\n // $([document.documentElement, document.body]).animate({\n // scrollTop: 0\n // }, 1000);... | [
"0.68834996",
"0.6781462",
"0.6496091",
"0.646981",
"0.64270175",
"0.6422828",
"0.6371875",
"0.6328664",
"0.63138765",
"0.6301632",
"0.6275184",
"0.6254089",
"0.621386",
"0.6206641",
"0.6204545",
"0.6198126",
"0.61598957",
"0.61520404",
"0.6145899",
"0.6116486",
"0.61107427",... | 0.7172889 | 0 |
listening and checking for portfolio page button clicks | function portfolioButtonClick() {
$('.portfolioSection').on('click', '.next', function (event) {
event.preventDefault();
projectNo++;
$('.portfolioBox').empty();
return createProjects(projectNo);
})
$('.portfolioSection').on('click', '.prev', function (event) {
event... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startPage() {\n /*portfolio button click*/\n $('.start').on('click', '.portfolioButton', function (event) {\n portfolioPage();\n })\n /*about me button click*/\n $('.start').on('click', '.aboutButton', function (event) {\n aboutPage();\n })\n}",
"function portfolioToggle(... | [
"0.6915886",
"0.6342792",
"0.63176113",
"0.61565304",
"0.611078",
"0.60961634",
"0.59664285",
"0.59465283",
"0.5939185",
"0.59363544",
"0.5927047",
"0.58691317",
"0.58690596",
"0.5856874",
"0.58242655",
"0.57930994",
"0.5783704",
"0.5775732",
"0.57649815",
"0.5760388",
"0.574... | 0.69293046 | 0 |
On import coupons button is clicked. | function onImportButtonIsClicked(e) {
e.preventDefault();
$('#import-coupons-popup').modal('show');
$('#import-coupons-popup textarea').focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function importData() {\n $(\"#importData\").attr('class', 'fa fa-refresh fa-spin');\n ImportService.submitImport(2, \"a3\", \"A3\");\n $scope.checked = true;\n }",
"_onClickImportButton () {\n this.props.musicListAction.import()\n }",
"function init_btn_importar() {\n $(\"span.filtros... | [
"0.6326223",
"0.62825644",
"0.5898775",
"0.5849194",
"0.58354086",
"0.58130443",
"0.5770978",
"0.5703382",
"0.5684409",
"0.5662825",
"0.56468207",
"0.5586119",
"0.5583202",
"0.55084765",
"0.54653114",
"0.5449726",
"0.5447448",
"0.5420258",
"0.54156953",
"0.53981787",
"0.53774... | 0.76063997 | 0 |
get new deck id from api | static async getNewDeckId() {
let res = await this.request("/new/shuffle");
return res.deck_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getDeck () {\n const res = await axios.get(\"https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1\");\n deckId.current = res.data.deck_id;\n }",
"function getDeck() {\n $.ajax({\n url: \"https://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1\"... | [
"0.7418867",
"0.730739",
"0.7145672",
"0.67927366",
"0.65702486",
"0.6317006",
"0.6292223",
"0.62785184",
"0.62026",
"0.6096048",
"0.60731244",
"0.6020153",
"0.6013653",
"0.5980053",
"0.5932519",
"0.59027815",
"0.58624387",
"0.5823179",
"0.58075917",
"0.58014715",
"0.5782136"... | 0.8171264 | 0 |
return shuffled and formatted card data number of cards returned depends on selected level | static async getCards(level) {
let numOfUniqueCards;
if (level === "easy") {
numOfUniqueCards = 9;
} else if (level === "medium") {
numOfUniqueCards = 15;
} else {
numOfUniqueCards = 24;
}
let deckId = await this.getNewDeckId();
let res = await this.request(`/${deckId}/dr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initCards(level) {\n\t\tlet cards = [], self = this;\n\t\tlet pack = {\n\t\t\t'whot': [20, 20, 20, 20, 20],\n\t\t\t'star': [1, 2, 3, 4, 5, 7, 8],\n\t\t\t'box': [1, 2, 3, 5, 7, 10, 11, 13, 14],\n\t\t\t'plus': [1, 2, 3, 5, 7, 10, 11, 13, 14],\n\t\t\t'tri': [1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 14],\n\t\t\t'circ': [... | [
"0.667446",
"0.6319189",
"0.63051057",
"0.61791205",
"0.61715704",
"0.6113164",
"0.6054044",
"0.6052693",
"0.6048461",
"0.60301524",
"0.6018922",
"0.60045934",
"0.59544903",
"0.5916164",
"0.59145707",
"0.59121567",
"0.5897346",
"0.5870976",
"0.5869597",
"0.5864486",
"0.585956... | 0.74813426 | 0 |
This function will create a new answer object based on the text that was entered in the text input, and push it into the `answerItems` array | function addanswerItem(text) {
const answerItem = {
text,
id: Date.now(),
};
answerItems.push(answerItem);
renderAnswerItem(answerItem);
handleChange();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse(text) {\n\tvar question, rand, entry, x;\n\n\tfor(var i = 0; i < text.length; i++) {\n\t\tquestion = text[i].split(\"\\n\");\n\t\tconsole.log(question);\n\t\tvar entry = new questions(question[0])\n\n\t\tfor(var j = 1; j < question.length; j++) {\n\t\t\tconsole.log(question[j]);\n\t\t\tvar string = ... | [
"0.6880863",
"0.67490095",
"0.62036705",
"0.6140973",
"0.6078751",
"0.60421216",
"0.59702384",
"0.5912059",
"0.58697045",
"0.5811311",
"0.57814777",
"0.57659954",
"0.5755448",
"0.57379586",
"0.5728921",
"0.5720443",
"0.57139874",
"0.5682574",
"0.56416976",
"0.56393844",
"0.56... | 0.7601442 | 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"
]
]
}
} | [
"function callbackfn(val, idx, obj)\n{\n return val + 10;\n}",
"function callbackOnNthTime(cb, n) {\n\t var cnt = 0;\n\t return function() {\n\t if(cb && ++cnt === n) {\n\t return cb();\n\t }\n\t };\n\t }",
"function callbackOnNthTime(cb, n) {\n ... | [
"0.68492234",
"0.6599468",
"0.64303243",
"0.62134606",
"0.6176959",
"0.6119942",
"0.6095798",
"0.60949075",
"0.60719174",
"0.6009892",
"0.598706",
"0.5971675",
"0.59468186",
"0.5933714",
"0.59125584",
"0.59090674",
"0.59090674",
"0.59090674",
"0.59090674",
"0.5899052",
"0.587... | 0.72232974 | 0 |
on click to save note | onClickSaveNote() {
this.saveNote(this.state.newNote);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveNote() {\n console.log('Note saved!');\n}",
"function saveNote(place) {\n $(\"#save-button\").click(function(){\n var newNote = $(\".jqte_editor\").html();\n editDestinationNote(place, newNote);\n $.modal.close();\n });\n}",
"function saveNote() {\n\n var noteData;\n var ... | [
"0.80495214",
"0.7970897",
"0.7890531",
"0.7885904",
"0.77489036",
"0.7742023",
"0.75935215",
"0.75825185",
"0.75553584",
"0.75517166",
"0.750907",
"0.7436811",
"0.732383",
"0.72859985",
"0.72167933",
"0.709651",
"0.70916563",
"0.70910966",
"0.7086733",
"0.70618963",
"0.69975... | 0.8429098 | 0 |
Add url to queue | addUrl(url) {
this.queue.add(url);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToQueue () {\n // Agregar al archivo de descargas\n queue.add(url, item);\n // Si no se ha iniciado la descargar iniciarla al terminar la carga\n // del FS.\n if (!queue.started()) {\n queue.start();\n queue.next();\n }\n }",
"queue(uri... | [
"0.7780999",
"0.7037597",
"0.6902658",
"0.68277633",
"0.6743475",
"0.6617205",
"0.6504199",
"0.6473711",
"0.6385362",
"0.6329869",
"0.6329447",
"0.6279997",
"0.6163858",
"0.61447",
"0.6132156",
"0.6108215",
"0.60883117",
"0.60233843",
"0.6005948",
"0.59421307",
"0.59200877",
... | 0.9005625 | 0 |
Remove url from queue | removeUrl(url) {
this.queue.delete(url);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeFromQueue() {\n queueItems.shift();\n processNextInConnectionQueue(name, origin);\n }",
"addUrl(url) {\n this.queue.add(url);\n }",
"function clearQueue() {\n this._requests = [];\n}",
"dispose(url) {\n for (const [filePath, urlForFilePath] of urlForFilePaths.entries... | [
"0.7115295",
"0.6452421",
"0.6392303",
"0.63753825",
"0.6369148",
"0.63592374",
"0.6312106",
"0.6300744",
"0.6293443",
"0.627134",
"0.6250977",
"0.6247785",
"0.6215163",
"0.61968356",
"0.61968356",
"0.6132118",
"0.6118813",
"0.6105201",
"0.6094286",
"0.60921896",
"0.6083013",... | 0.87986755 | 0 |
Notify the user of new threads | notifyNewThread(thread) {
if (!this.isNotificationAllowed())
return;
const notificationTitle = `Palaver thread posted by ${thread.UserName}.`;
const strippedThreadTitle = $.trim(this.stripHtml(thread.Title));
const filteredThread = {
body: strippedThreadTitle.sub... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whenThreadsComplete() {\n return new Promise((resolve, reject) => {\n setInterval(() => {\n let active = 0;\n const threads = vm.runtime.threads;\n for (let i = 0; i < threads.length; i++) {\n if (!threads[i].updateMonitor) {\n a... | [
"0.6058357",
"0.5834762",
"0.56357574",
"0.5552059",
"0.5518385",
"0.5508962",
"0.5441068",
"0.54047024",
"0.538837",
"0.5377226",
"0.5355911",
"0.5345226",
"0.53357196",
"0.5324612",
"0.53073245",
"0.5269542",
"0.52568793",
"0.52470577",
"0.52404004",
"0.5237941",
"0.5224439... | 0.6151908 | 0 |
Notify the user of new comments | notifyNewComment(comment) {
if (!this.isNotificationAllowed())
return;
const title = `Palaver comment posted by ${comment.UserName}.`;
const strippedText = $.trim(this.stripHtml(comment.DisplayText));
const filteredComment = {
body: strippedText.substring(0, Math... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_notifyUsers(user, model, comment, callback) {\n // don't send anything if the commentis private\n if(comment.private) {\n return callback();\n }\n\n var mailSettings = {\n template: 'mail_ticketNewComment',\n templateData: {}\n };\n\n notify(user, model, mailSettings, callback... | [
"0.7574635",
"0.6700685",
"0.6689773",
"0.6479707",
"0.63892317",
"0.63564277",
"0.6343156",
"0.63126177",
"0.6281333",
"0.62779814",
"0.62775564",
"0.6202962",
"0.61973345",
"0.6137681",
"0.6128354",
"0.61255735",
"0.61224514",
"0.61116683",
"0.6097405",
"0.6068343",
"0.6044... | 0.737133 | 1 |
Demo2: dotFlash A single dot appears in a random place | function dotFlash(){
var time = ((Math.random()*2)+5) *100;
var thiscontainer = document.getElementById("dot-container");
var topPos = -randomNum(4)*100;
var leftPos = 200 + signMultiplier()*randomNum(2)*100;
var thissocks = document.createElement("div");
thissocks.id = "socks";
thissocks.className = "distra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"show(){\r\n if(this.dot){\r\n if(!this.eaten){//draw dot if not eaten\r\n fill(255, 255, 0);\r\n noStroke();\r\n ellipse(this.pos.x, this.pos.y, 3, 3);\r\n }\r\n }else if(this.bigDot){\r\n if(!this.eaten){\r\n fill(255, 255, 0);\r\n noStroke();\r\n ell... | [
"0.682977",
"0.66298354",
"0.64825696",
"0.62957335",
"0.6279404",
"0.62715137",
"0.62325376",
"0.62305623",
"0.62144727",
"0.61970544",
"0.6193176",
"0.61839294",
"0.6166929",
"0.61168396",
"0.6096545",
"0.6053515",
"0.60042256",
"0.59599173",
"0.59358644",
"0.5928742",
"0.5... | 0.73025036 | 0 |
distractValidate Functions// // / Validate1. changeDotColour() Adds a class to a dot/multiple dots to change its colour or add an image | function changeDotColour() {
var ptArr;
var modArray = ["star","music","madSteve","crow","lime","blueish" ,"yellow", "dark", "violet"];
ptArr = Math.random() < 0.5 ? selectSingle() : selectMultiple();
var modSelector = randomNum(7);
distractMod = modArray[modSelector];
var i;
for(i = 0; i < ptArr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateControl(dot, lowerX, upperX){\n var dotx = dot.getAttribute(\"cx\"), changed = false;\n var lowerX = lowerX + radius, upperX = upperX - radius;\n if(dotx <= lowerX){\n dot.setAttribute(\"cx\", lowerX);\n changed = true;\n }\n if(dotx >= upperX){\n dot.setAttribu... | [
"0.55711806",
"0.5502259",
"0.53926116",
"0.53622204",
"0.531675",
"0.53098524",
"0.5276867",
"0.52758265",
"0.5214451",
"0.51972896",
"0.5140862",
"0.51216644",
"0.5089769",
"0.49762458",
"0.49611765",
"0.49565887",
"0.4950472",
"0.4904706",
"0.4889511",
"0.48886478",
"0.488... | 0.5975299 | 0 |
Validate3: dotContainerText Flash words behind the dot container | function dotContainerText(){
var strArray = ["GET TO THE CHOPPER", "RutabAaAga", "Beard of Stars", "DEEP FRY EVERYTHING", "The Controllersphere", "IT HURTS"];
var string = strArray[randomNum(5)];
var topPos = -170 + (signMultiplier()*50);
var leftPos = 200 + (signMultiplier()*25);
var dCont = document.getEle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw1(words) {\n d3.select(\"#WordCloud-neg\").append(\"svg\")\n .attr(\"width\", layout.size()[0])\n .attr(\"height\", layout.size()[1])\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + layout.size()[0] / 2 + \",\" + layout.size()[1] / 2 + \")\")\n .selectAll(\"text\")\n ... | [
"0.5372591",
"0.5321462",
"0.53205526",
"0.5257871",
"0.52389985",
"0.52068394",
"0.5176765",
"0.5074701",
"0.5055097",
"0.5035957",
"0.50223047",
"0.50223047",
"0.5002186",
"0.4999329",
"0.49682698",
"0.49377897",
"0.49262255",
"0.49179268",
"0.49120784",
"0.48816925",
"0.48... | 0.55726945 | 0 |
Initialisations after the DOM becomes ready. | function initOnDomReady() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function qodeOnDocumentReady() {\n courseSection.rowRepeater.init();\n courseSection.lessonRepeater.init();\n courseSection.quizRepeater.init();\n qodefInitSortable();\n }",
"function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}",
"function init() {\n\t\tcacheDOM();\n\t\tbin... | [
"0.7643794",
"0.7472272",
"0.7472272",
"0.7472272",
"0.737669",
"0.7363354",
"0.7363354",
"0.7324905",
"0.732057",
"0.7253817",
"0.72478664",
"0.72373766",
"0.7230623",
"0.7205706",
"0.72010857",
"0.7175149",
"0.7160137",
"0.7154083",
"0.71349293",
"0.7133214",
"0.7126631",
... | 0.81075794 | 0 |
state will have user state will have module name state will have offers | constructor() {
super();
this.state = {
recommendedOffers: staticoffers
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moduleList(role, userToken) {\n\n log(\"Info\", \"AdminViewModules:moduleList(role,userToken) method is used to modulelist\");\n console.log(this.state.userToken);\n console.log(this.state.role);\n NetInfo.fetch().then(state => {\n if (state.type == \"none\") {\n console.log(state.type);\n ... | [
"0.5894209",
"0.5829493",
"0.57017004",
"0.56131583",
"0.55608815",
"0.55336136",
"0.55206555",
"0.55144465",
"0.5512413",
"0.54309076",
"0.53913456",
"0.53534126",
"0.53481585",
"0.5327235",
"0.53014374",
"0.5298259",
"0.52966326",
"0.5284663",
"0.5274364",
"0.5265104",
"0.5... | 0.58963734 | 0 |
Params: parameterOne, parameterTwo Response: Boolean Description: strict comparison between parameters | function match(parameterOne, parameterTwo) {
// if statement
if (parameterOne === parameterTwo) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function match(firstParam,secondParam){\n if(firstParam===secondParam){\n return true\n }\n else{\n return false\n }\n}",
"function testTwo(param1, param2) {\n return param1 * param2;\n}",
"constructor(provideFn,parameters,equalsFn){Object.defineProperties(this,{_provideFn:{value:p... | [
"0.62603176",
"0.5872391",
"0.55077976",
"0.54957396",
"0.5474282",
"0.5467657",
"0.5445956",
"0.54395294",
"0.543579",
"0.54289335",
"0.54257244",
"0.5414423",
"0.540738",
"0.53700525",
"0.53634703",
"0.53581226",
"0.53433305",
"0.5341436",
"0.5340007",
"0.5326021",
"0.53071... | 0.6698874 | 0 |
Params: parameterOne, parameterTwo Response: Void Description: logger for matched result | function logMatch(parameterOne, parameterTwo) {
console.log(`${parameterOne} does match ${parameterTwo}!`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logMatch(firstParam,secondParam){\n return \"The values \"+firstParam+\" and \"+secondParam+\" match.\"\n}",
"function logMatch(param1, param2) {\n const message= \"The values \" + param1 + \" and \" + param2 + \" do match.\"\n console.log(message);\n}",
"function logMatch(arg1,arg2){\n console.... | [
"0.75473756",
"0.7508372",
"0.6763382",
"0.66406953",
"0.65389323",
"0.63593715",
"0.6265584",
"0.6218586",
"0.6213028",
"0.61511075",
"0.59747803",
"0.59619147",
"0.56518626",
"0.5596883",
"0.5562723",
"0.5558933",
"0.55072385",
"0.5467763",
"0.5418782",
"0.5407514",
"0.5372... | 0.7637034 | 0 |
Params: parameterOne, parameterTwo Response: Void Description: logger for mismatched result | function logMismatch(parameterOne, parameterTwo) {
console.log(`${parameterOne} does not match ${parameterTwo}!`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logMismatch(firstParam,secondParam){\n return \"The values \"+firstParam+\" and \"+secondParam+\" do not match.\"\n}",
"function logMismatch(param1, param2) {\n const message= \"The values \" + param1 + \" and \" + param2 + \" do not match.\"\n console.log(message);\n}",
"function logMatch(firstP... | [
"0.7093126",
"0.70315826",
"0.69597715",
"0.689018",
"0.6847216",
"0.64326",
"0.6384459",
"0.6082803",
"0.58858085",
"0.5858742",
"0.5798044",
"0.5795692",
"0.5795692",
"0.57208544",
"0.56866324",
"0.5684911",
"0.568348",
"0.56011784",
"0.5490081",
"0.54373777",
"0.5417126",
... | 0.7116205 | 0 |
handle audio button clicked | function handleAudioButtonClick() {
muteButtonEngaged();
video.muted = !video.muted;
setAudioButton();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addEventListenerToAudioButton() {\n let a = document.getElementById(\"audio-button\")\n a.addEventListener(\"click\", this.playAudio)\n }",
"function PlayButtonPress(soundNumber)\n{\n\tGameObject.Find(\"AudioSource Object\").GetComponent(AudioSourceSetup).playButtonClick(soundNumber);\n}",
"fu... | [
"0.7483506",
"0.7420829",
"0.73646855",
"0.73503506",
"0.7328638",
"0.7291929",
"0.7144611",
"0.71148455",
"0.7111656",
"0.7109703",
"0.71035457",
"0.70892966",
"0.7071284",
"0.7064295",
"0.7044975",
"0.7044975",
"0.7029243",
"0.7013806",
"0.7003389",
"0.6994835",
"0.6983543"... | 0.8124349 | 0 |
ARRAY GENERATOR funciton to use the wordGenerator to create a number (b) of workd and shovel them into an array | function arrayMaker(b) {
var array = [];
// creating (b) number of words and pushing them into the array
array.push(wordGenerator(a)*b)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wordGen(numb, numb2){\n\t//create a blank array to be pushed to later in function\n\tvar array =[];\n\t//make the words be seperated by \"\"\n\tvar scramble = \"\";\n\t//make the alphabet including capital letters\n\tvar alphabet = \"abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tfor (var x = ... | [
"0.7158177",
"0.6951071",
"0.6949029",
"0.6532132",
"0.65284956",
"0.6464263",
"0.6460978",
"0.6325198",
"0.6278969",
"0.6238708",
"0.6211871",
"0.6176775",
"0.6147757",
"0.6087763",
"0.60761845",
"0.60480785",
"0.6036014",
"0.6006427",
"0.59783417",
"0.59490424",
"0.59424514... | 0.8127416 | 0 |
This insertion sort is utilised with the binary search when loading saved classes | function insertionSort() {
//The following lines display the insertion sort algorithm which sorts the array
tempArray = allClassesArray;
first = 0;
last = tempArray.length - 1;
positionOfNext = last - 1;
while (positionOfNext >= first) {
next = tempArray[positionOfNext];
current = position... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertionSort() {\r\n\tvar temp, inner;\r\n\tfor (var outer = 1; outer <= this.dataStore.length-1; ++outer) {\r\n\t\ttemp = this.dataStore[outer];\r\n\t\tinner = outer;\r\n\t\twhile (inner > 0 && (this.dataStore[inner-1] >= temp)) {\r\n\t\t\tthis.dataStore[inner] = this.dataStore[inner-1];\r\n\t\t\t--inne... | [
"0.6676756",
"0.6344497",
"0.6286832",
"0.6253068",
"0.6161141",
"0.6072113",
"0.6070398",
"0.6031899",
"0.5965818",
"0.59255123",
"0.5908328",
"0.58890235",
"0.5830779",
"0.5811738",
"0.5788201",
"0.57861996",
"0.5781369",
"0.5775268",
"0.5772046",
"0.5770949",
"0.57646996",... | 0.71913844 | 0 |
This binary search is used to find and load saved classes | function binarySearch() {
//Will jump out if the array is already empty
if(allClassesArray.length == 0) {
return false;
}
lower = 0;
upper = allClassesArray.length - 1;
foundIt = false;
requiredName = findClassNameInput.value;
//This will iterate through the array until it has found the value i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findClass() {}",
"function FindClasses(Event) {\n\tif (Event === undefined) {\n\t\tclasses.field = What(\"Class and Levels\");\n\t};\n\tvar temp = clean(classes.field.replace(/^\\d+/, \"\")) === \"\" ? \"\" : classes.field.replace(/^\\d+/, \"\").toLowerCase();\n\tvar tempArray = [];\n\tvar tempPosition ... | [
"0.6179436",
"0.52336407",
"0.5206463",
"0.51973635",
"0.5126883",
"0.5126883",
"0.5126883",
"0.5126883",
"0.5051227",
"0.5049608",
"0.5049608",
"0.5049608",
"0.5049608",
"0.50276935",
"0.50008214",
"0.4996156",
"0.49052578",
"0.48999655",
"0.48405698",
"0.4827722",
"0.482529... | 0.64487946 | 0 |
Function to check that the class name entered is unique | function checkClassName() {
isNameUnique = "true";
if (classNameInput.value === "") {
isNameUnique = "blank";
} else {
for (i = 0; i < allClassesArray.length; i++) {
if (
allClassesArray[i].name.toLowerCase() ==
classNameInput.value.toLowerCase()
) {
isNameUni... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkClassUniqueness() {\n lodash.forEach(uniqueClasses, function (classId) {\n var classData = lodash.find(ctrl.classList, ['id', classId]);\n var classIsUsed = lodash.some(ctrl.triggers, ['ui.selectedClass.id', classId]);\n\n lodash.merge(classData... | [
"0.7026774",
"0.69447446",
"0.69447446",
"0.6810084",
"0.6648888",
"0.64305246",
"0.6367316",
"0.6367316",
"0.63553494",
"0.6341764",
"0.631175",
"0.6302761",
"0.6302761",
"0.628729",
"0.62504154",
"0.62483746",
"0.6224753",
"0.6224753",
"0.6224753",
"0.6224753",
"0.6224753",... | 0.7815934 | 0 |
Will sort and divide class into groups determined by teacher (page 5) | function sortClass(sortMethod) {
groupedClassArray = [];
//This switch statement will determine which type of sort will be run
switch (sortMethod) {
case "sortAlphaLastname":
sortedArray = alphaSortClass("lastName");
break;
case "sortAlphaFirstname":
sortedArray = alphaSortClass(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sort() {\n const compare = (a, b) => {\n if (a == b) {\n return 0;\n } else if (a > b) {\n return 1;\n } else {\n return -1;\n }\n };\n\n for (const page of this.chart.pages) {\n [...page.queryS... | [
"0.5987191",
"0.57021517",
"0.5693762",
"0.56710756",
"0.5509236",
"0.55017143",
"0.5380599",
"0.537645",
"0.53653115",
"0.535424",
"0.5330856",
"0.5302289",
"0.5290118",
"0.52287394",
"0.5225243",
"0.5187781",
"0.5180122",
"0.5179864",
"0.51572174",
"0.5155355",
"0.51534206"... | 0.6610095 | 0 |
Function to sort class by each student's rank | function rankSortClass(rankMethod) {
tempArray = chosenClassArray;
first = 0;
last = tempArray.length - 1;
positionOfNext = last - 1;
//This will sort the array so that the it is in order from highest ranking to lowest ranking
while (positionOfNext >= first) {
next = tempArray[positionOfNext];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortRankings() {\r\n finalRankings = totalPoints.sort((a, b) => b.points - a.points);\r\n}",
"function ranking() { \n let higherThan = userRanking.sort((a, b) => b.correctAnswers - a.correctAnswers);\n console.log('El ranking de jugadores és: ' + JSON.stringify(higherThan));\n }",
... | [
"0.68344235",
"0.6445497",
"0.6343703",
"0.6160889",
"0.6146787",
"0.613834",
"0.61183405",
"0.60951436",
"0.60259604",
"0.602381",
"0.58796626",
"0.58377206",
"0.58039343",
"0.5796283",
"0.57937884",
"0.5789252",
"0.5772772",
"0.5761628",
"0.5761628",
"0.5761628",
"0.5749941... | 0.65617496 | 1 |
This function will allow the user to delete previously saved classes from local storage | function deleteSavedClass(className) {
className = className.slice(9);
confirmation = confirm(
"Are you sure you want to delete '" + className + "'?"
);
if (confirmation) {
for (i = 0; i < allClassesArray.length; i++) {
if (allClassesArray[i].name == className) {
allClassesArray.sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeLocalStorage(className) {\n for (let index = 0; localStorage.getItem(`task ${index}`); index += 1) {\n const taskInStorage = localStorage.getItem(`task ${index}`);\n if (taskInStorage.includes(className)) {\n localStorage.removeItem(`task ${index}`);\n }\n }\n}",
"function deleteLo... | [
"0.68536574",
"0.68392503",
"0.65649825",
"0.6458882",
"0.6406095",
"0.63959205",
"0.6350683",
"0.6347214",
"0.63435775",
"0.63296974",
"0.6313472",
"0.6312686",
"0.6286954",
"0.62817043",
"0.62745124",
"0.6272564",
"0.6263459",
"0.6232628",
"0.6221761",
"0.62088853",
"0.6200... | 0.8026102 | 0 |
( 02 ) Header Slider This section is for the header slider. It's based on owl carousel. Header Slider is divided to the following sections: | function headerSlider() {
var owlHS = $(".header-slider");
$(".header-slider").owlCarousel({
// Most important owl features
items: 5, // Items number appeared
singleItem: true, // Making only 1 item appearing
//Basic Speeds
slideSpeed: owlPagiS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function header() {\r\n\t\tvar headerHeight = jQuery(\"#header\").outerHeight();\r\n\t\tvar windowHeight = jQuery(window).height() - headerHeight;\r\n\t\tvar half = jQuery(window).height()/2 - 120;\r\n\t\t\r\n\t\t\r\n\t\tvar header = jQuery(\".slider-wrap\");\r\n\t\tvar text = jQuery(\".slider-wrap .stunningtext\"... | [
"0.628001",
"0.60907185",
"0.60597163",
"0.5982902",
"0.598289",
"0.5909521",
"0.58637846",
"0.5863485",
"0.58345926",
"0.5824859",
"0.5821736",
"0.58173513",
"0.5813348",
"0.58074284",
"0.5803174",
"0.57784265",
"0.57781494",
"0.57775944",
"0.57753575",
"0.57727623",
"0.5747... | 0.7970819 | 0 |
Fixing vertical featured image container width [ That appears in Firefox! ] | function FetImgWidth() {
$("header .vertical-featured-image-container").each(function() {
var getWidth = $(this).closest("[class*='col-']").width();
$(this).width(getWidth);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function item_resize() {\r\n\t $('.masonry-item .cover-item').each( function() {\r\n\t\t\tvar featured_area = $(this).find('.featured-area');\r\n\t\t\t\r\n\t\t\tif( !featured_area.is(':empty') ) {\r\n\t\t\t\tvar item_h = $(this).find('.post-header').height(),\r\n\t\t\t\t\titem_w = $(this).width(),\r\n\t\t\t\t\tf... | [
"0.65022165",
"0.62907434",
"0.61854905",
"0.61854905",
"0.6110082",
"0.60758066",
"0.6051568",
"0.58793145",
"0.5867299",
"0.58563685",
"0.5854504",
"0.5853664",
"0.58478653",
"0.5838378",
"0.58331907",
"0.58327734",
"0.5818372",
"0.5811268",
"0.5808513",
"0.58048433",
"0.58... | 0.6837737 | 0 |
( 07 ) Stellar Parallax This part contains the codes of the parallax effect using Stellar jquery plugin. It's applied here on header and parallax sections. It has the following code: | function parallaxStellar() {
$(function() {
$.stellar({
horizontalScrolling: false, // don't change this option
// verticalScrolling: false,
verticalOffset: 0,
responsive: true, // false
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parallaxStellar() {\n $(function() {\n $.stellar({\n horizontalScrolling: false, // don't change this option\n // verticalScrolling: false,\n verticalOffset: 0,\n responsive: true, // false\n });\n }); \n}",
"function stellarParallax() {\n ... | [
"0.8176598",
"0.77529746",
"0.77477056",
"0.76335",
"0.7484928",
"0.7363562",
"0.7346634",
"0.7303284",
"0.72707057",
"0.723606",
"0.7229761",
"0.72238517",
"0.7222209",
"0.7206189",
"0.71839345",
"0.7170514",
"0.7140677",
"0.7140677",
"0.7131663",
"0.71214634",
"0.71174246",... | 0.8243065 | 0 |
( 08 ) Count Up This part contains the codes of the count up plugin It has the following code: | function funFactCounter() {
$('.fun-facts-box .info-box-content span').counterUp({
delay: 10,
time: 1500
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function counterup(){\n if ( $('.counter').length ){\n $('.counter').counterUp({\n delay: 20,\n time: 1000\n });\n }\n }",
"function countUpAndDown () {}",
"function counterUp() {\r\n $('.counter').counterUp({\r\n delay: 10,... | [
"0.7046228",
"0.7000667",
"0.69657904",
"0.6924706",
"0.68646854",
"0.6842079",
"0.68037504",
"0.6612332",
"0.65906745",
"0.655873",
"0.6535875",
"0.65242165",
"0.6328121",
"0.627529",
"0.627529",
"0.62744385",
"0.62730825",
"0.62632203",
"0.6258323",
"0.62557256",
"0.6227376... | 0.70812976 | 0 |
Detect Hotkeys and Perform Action Additional hotkeys specified here via additional else if statements | function detectHotkeys(event, key) {
if(event.ctrlKey && event.shiftKey && key == 76){
const addLabelBtn = document.querySelector("#page-container > div > section > div > header > section.meta-data-container > div.labels-area > button");
addLabelBtn.click();
} else if (event.ctrlKey && event.shi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shouldExecuteHotkey(event) {\n return !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey;\n}",
"function keyboardShortcuts() {\n\t$mixpanel.track('VIEW_SHORTCUTS');\n\t//launch hotkeys\n\thotkeys.toggleCheatSheet()\n}",
"watchKeyboardDown(){\n if (keyIsDown(OPTION)) {\n op... | [
"0.6764427",
"0.6703581",
"0.66633767",
"0.6591812",
"0.6545744",
"0.6526901",
"0.6374554",
"0.63697666",
"0.6365603",
"0.6353904",
"0.6334004",
"0.6316254",
"0.63120425",
"0.62966526",
"0.62919676",
"0.6271426",
"0.6269333",
"0.62682945",
"0.62668043",
"0.62514836",
"0.62185... | 0.6999076 | 0 |
git information for the current commit | get git() {
return (0, _utils.getCommitData)(this.commit, this.branch, this.vars);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCommitInfo() {\r\n let commitHash;\r\n let commitDate;\r\n\r\n try {\r\n commitHash = execSync('git rev-parse HEAD').toString().trim();\r\n commitDate = execSync('git log -1 --format=%cd').toString().trim();\r\n }\r\n catch (err) {\r\n console.error(err);\r\n\r\n if (app.getAppPath().e... | [
"0.74396914",
"0.7408791",
"0.67437005",
"0.6679358",
"0.63696223",
"0.6351644",
"0.6316274",
"0.62562746",
"0.62334025",
"0.6020019",
"0.597329",
"0.59183717",
"0.5881988",
"0.5881733",
"0.58440137",
"0.57945454",
"0.5782247",
"0.5768745",
"0.56928486",
"0.5683993",
"0.56761... | 0.74857605 | 0 |
manually set build commit and branch targets | get target() {
return {
commit: this.vars.PERCY_TARGET_COMMIT || null,
branch: this.vars.PERCY_TARGET_BRANCH || null
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function attachNavigateToBranchLink() {\n var pr = pageState.getPullRequest();\n\n var $branchOriginSpan = jQuery('.ref-name-from');\n if ($branchOriginSpan.length === 0) {\n $branchOriginSpan = jQuery('.source-branch');\n }\n if ($branchOriginS... | [
"0.54878944",
"0.547099",
"0.53316724",
"0.5257673",
"0.5186706",
"0.5048577",
"0.48208335",
"0.47952297",
"0.47798374",
"0.47727942",
"0.47095513",
"0.47022542",
"0.4658877",
"0.46489692",
"0.46413484",
"0.4605114",
"0.45441258",
"0.45434144",
"0.45380524",
"0.45200548",
"0.... | 0.5506404 | 0 |
build marked as partial | get partial() {
let partial = this.vars.PERCY_PARTIAL_BUILD;
return !!partial && partial !== '0';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildPartials() {\n // where to look for partials\n var partials = [\n path.join(conf.paths.src, '/app/**/*.html')\n ];\n\n // set some options\n var minOptions = {\n empty: true,\n spare: true,\n quotes: true\n };\n\n // template cache parameters\n var cacheParams = {\n module: con... | [
"0.57339644",
"0.56973666",
"0.56973666",
"0.56955314",
"0.56522304",
"0.5551287",
"0.5420585",
"0.5365529",
"0.52822924",
"0.5231135",
"0.50781673",
"0.5062413",
"0.50617224",
"0.5029865",
"0.5025372",
"0.4995433",
"0.49928808",
"0.49849105",
"0.49355108",
"0.49123964",
"0.4... | 0.6026114 | 0 |
Assign a type class to it | function assignTypeClassToElement(type, element) {
if (type !== 'default') {
DOMUtils.addClass(element, _typeStyleMap[type]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"type(value) {\n this.newType = value\n }",
"function assignTypeClassToElement(type, element) {\n if (type !== 'default') {\n _nudoruBrowserDOMUtilsJs2['default'].addClass(element, _typeStyleMap[type]);\n }\n }",
"set type(value) {}",
"type(val) {\n this._type = val;\n retu... | [
"0.6783816",
"0.67767787",
"0.66947836",
"0.65064996",
"0.647729",
"0.621788",
"0.62138957",
"0.62138957",
"0.61002046",
"0.6018423",
"0.58799183",
"0.5878462",
"0.5878462",
"0.5878462",
"0.5864526",
"0.5785042",
"0.5741745",
"0.56642693",
"0.5650167",
"0.5638329",
"0.5626761... | 0.6866105 | 0 |
Clean up after the transition out animation | function onTransitionOutComplete(el) {
let idx = getObjIndexByID(el.getAttribute('id')),
boxObj = _children[idx];
boxObj.streams.forEach(function (stream) {
stream.dispose();
});
Draggable.get('#' + boxObj.id).disable();
_mountPoint.removeChild(el);
_children[idx] = null;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onTransitionOutComplete(el) {\n var idx = getObjIndexByID(el.getAttribute('id')),\n boxObj = _children[idx];\n\n boxObj.streams.forEach(function (stream) {\n stream.dispose();\n });\n\n Draggable.get('#' + boxObj.id).disable();\n\n _mountPoint.removeChild(el);\n\n _children[i... | [
"0.73712945",
"0.730614",
"0.72112584",
"0.71359956",
"0.7070733",
"0.7035455",
"0.70222276",
"0.70222276",
"0.6968755",
"0.6941072",
"0.6937227",
"0.68716955",
"0.6808546",
"0.67961144",
"0.6779942",
"0.67596084",
"0.6655638",
"0.6655638",
"0.6655638",
"0.6655638",
"0.665186... | 0.73382443 | 1 |
Determine if any open boxes have modal true | function checkModalStatus() {
let isModal = false;
_children.forEach(function (boxObj) {
if (boxObj.modal === true) {
isModal = true;
}
});
if (!isModal) {
ModalCover.hide(true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkModalStatus() {\n var isModal = false;\n\n _children.forEach(function (boxObj) {\n if (boxObj.modal === true) {\n isModal = true;\n }\n });\n\n if (!isModal) {\n _ModalCoverViewJs2['default'].hide(true);\n }\n }",
"hasOpenModals() { return this._modalStack.hasO... | [
"0.7826012",
"0.7824951",
"0.7824951",
"0.7824951",
"0.7824951",
"0.67430276",
"0.66131485",
"0.6598648",
"0.65744704",
"0.6316241",
"0.622431",
"0.62096554",
"0.61887085",
"0.6182918",
"0.6133763",
"0.611728",
"0.61117864",
"0.61114043",
"0.61095876",
"0.60914916",
"0.603609... | 0.79114187 | 0 |
props will have the lambda endpoint inside it | constructor(props){
super(props);
state = {
endpoint: props.lambda
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get properties() {\n return {\n endpoint: {\n type: String,\n },\n };\n }",
"function handler (event, context, callback){\n console.log('Lambda params:', JSON.stringify(event))\n \n // This handler will both catch APIGateway and CLI invokations\n // the passed in httpMethod wil... | [
"0.6093651",
"0.59489375",
"0.5817132",
"0.5651777",
"0.55657065",
"0.5483515",
"0.5472521",
"0.5345071",
"0.53406984",
"0.5317907",
"0.5302141",
"0.5295572",
"0.5283703",
"0.52783376",
"0.52761406",
"0.52702326",
"0.52618253",
"0.5248356",
"0.5241776",
"0.5234126",
"0.519658... | 0.7927131 | 0 |
Returns the anchor node in this row | function getAnchorNode(tr)
{
var id = tr.id.substring(1);
return document.getElementById("a"+id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAnchor() {\n return this.anchor;\n }",
"function deriveAnchor(edge,index,ep,conn){return options.anchor?options.anchor:options.deriveAnchor(edge,index,ep,conn);}//",
"getChildAnchor() {\n return this.childAnchor;\n }",
"function getAnchor(element) {\n if (!element) {\n retu... | [
"0.69409454",
"0.6660409",
"0.6582503",
"0.6250196",
"0.60857725",
"0.60785234",
"0.60785234",
"0.60785234",
"0.60785234",
"0.6064734",
"0.6062149",
"0.6062149",
"0.6043502",
"0.6043502",
"0.6035343",
"0.5980384",
"0.5882367",
"0.57532614",
"0.56824803",
"0.5575341",
"0.55343... | 0.68938625 | 1 |
showDetails INNER FUNCTION: flickrReq Parameters NONE Run after Google Places returns results for a selected place Makes an AJAX call to Flickr using the place's location and returns a random image, which is added to the map infowindow | function flickrReq(){
// AJAX request for a random Flickr image for the place
var flickrURL = "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=006be012bad8d36a3b22ab7bf7c88232&accuracy=16" +
"&lat=" + place.geometry.location.lat() + "&lon=" + place.geometry.location.l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getImage(place){\n\t\t// Get location data\n\t\tvar fullName = place.address_components[0].long_name;\n\n\t\tvar lat = place.geometry.location.lat();\n\t\tvar lng = place.geometry.location.lng();\n\n\t\t// Request images for the place\n\t\t$.ajax({\n\t\t\turl: \"https://api.flickr.com/services/rest/?metho... | [
"0.73399556",
"0.7004171",
"0.6886079",
"0.6859351",
"0.6854624",
"0.6851706",
"0.6846226",
"0.6810306",
"0.67918104",
"0.67739713",
"0.6773532",
"0.6763853",
"0.6750139",
"0.67396224",
"0.6735836",
"0.6711119",
"0.6696398",
"0.66764927",
"0.6607639",
"0.65957934",
"0.6585616... | 0.75152165 | 0 |
calculated mu as been mentioned on Wikipedia mu(i, j) = | mu(i, j) {
var top = tools.dot_product(this.matrix_before[i], this.matrix_after[j], this.dimensions);
var bottom = tools.dot_product(this.matrix_after[j], this.matrix_after[j], this.dimensions);
return top / bottom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Mu(){\n let Mw = (this.wu()/1000*Math.pow(this.Loh()/12,2)/2)*12\n let Mp = this.Pu()*(this.Lp + this.ev)\n //return Mw\n return Mp\n return (Mw + Mp)/1000\n }",
"function mean(input) {\n mu = input;\n}",
"function norm(u) {\r\n return Math.sqrt(dot(u, u));\r\n}",
... | [
"0.7029462",
"0.61163366",
"0.59423625",
"0.5811495",
"0.57153654",
"0.5634027",
"0.5610745",
"0.55950856",
"0.55707204",
"0.55454445",
"0.55454445",
"0.5538019",
"0.5526407",
"0.55239284",
"0.55152273",
"0.5506025",
"0.5474857",
"0.5438755",
"0.53822094",
"0.5353181",
"0.535... | 0.7779463 | 0 |
Starts a requestAnimationFrame loop and runs the render tasks in the allRenderTasks stack. As long as there are tasks in the stack, the loop continues. When the stack becomes empty due to removal of tasks, the requestAnimationFrame loop stops and the app sits there doing nothing silence, crickets. | async startAnimationLoop() {
if (document.readyState === 'loading')
await new Promise(resolve => setTimeout(resolve))
if (this.animationLoopStarted) return
this.animationLoopStarted = true
let timestamp = null
while (this.animationLoopStart... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function queue(){\n\t\twindow.requestAnimationFrame(loop);\n\t}",
"setuprenderloop() {\n requestAnimationFrame(this.renderloop.bind(this));\n }",
"setuprenderloop() {\n requestAnimationFrame(this.renderloop.bind(this));\n }",
"loop() {\n this.update();\n this.ren... | [
"0.66960734",
"0.6341425",
"0.6341425",
"0.63107955",
"0.627009",
"0.62576276",
"0.62184286",
"0.6213224",
"0.6206531",
"0.62011766",
"0.6192189",
"0.6185972",
"0.61824244",
"0.6174674",
"0.61447424",
"0.6128133",
"0.611535",
"0.6084409",
"0.6070011",
"0.6062797",
"0.6048672"... | 0.7169696 | 0 |
Function to get all ads | function get_all_ads() {
return all_ads;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function listAds(ctx) {\n ctx.loggedIn = sessionStorage.getItem('authToken') !== null;\n ctx.username = sessionStorage.getItem('username');\n try {\n let response = await requestor.get('appdata', 'ads', 'Kinvey');\n let ads = response.reverse();\... | [
"0.6617263",
"0.6514215",
"0.62691605",
"0.6182889",
"0.6174947",
"0.6167567",
"0.6128289",
"0.6124903",
"0.6110342",
"0.6101405",
"0.59643286",
"0.5922284",
"0.59137225",
"0.58824307",
"0.58443743",
"0.5840566",
"0.5839198",
"0.5823172",
"0.5777704",
"0.5777573",
"0.57626784... | 0.85728455 | 0 |
Function to get ads by brand_name | function get_ads_by_brand_name(brand_name) {
return brands_hash[brand_name.toLowerCase()];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_ads(brand_name, model) {\n if (brand_name == null && model == null) {\n return get_all_ads();\n }\n if (model == null && brand_name != null) {\n return get_ads_by_brand_name(brand_name);\n }\n if (model != null) {\n return get_ads_by_model(model);\n }\n}",
"async getAllBrandName() {\... | [
"0.77304935",
"0.6511178",
"0.6450558",
"0.6155358",
"0.61466455",
"0.6112661",
"0.6103804",
"0.6027555",
"0.6025167",
"0.59985256",
"0.5967351",
"0.59505033",
"0.59382224",
"0.59281254",
"0.58145154",
"0.57843465",
"0.5728162",
"0.5626425",
"0.5613271",
"0.5548332",
"0.55318... | 0.8627791 | 0 |
Function to get ads by model | function get_ads_by_model(model) {
return models_hash[model.toLowerCase()];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_ads(brand_name, model) {\n if (brand_name == null && model == null) {\n return get_all_ads();\n }\n if (model == null && brand_name != null) {\n return get_ads_by_brand_name(brand_name);\n }\n if (model != null) {\n return get_ads_by_model(model);\n }\n}",
"function getAdListing() {\n... | [
"0.692308",
"0.6249835",
"0.5548692",
"0.54351795",
"0.54257005",
"0.5383499",
"0.53603417",
"0.53209746",
"0.5320692",
"0.53160197",
"0.529048",
"0.5282255",
"0.5258073",
"0.5252256",
"0.5233231",
"0.51644266",
"0.5145192",
"0.5132194",
"0.51147366",
"0.50988066",
"0.5094688... | 0.8057478 | 0 |
Resolves as soon as the React relationship editor is ready. | function readyRelationshipEditor() {
const reactRelEditor = qs('.release-relationship-editor');
if (!reactRelEditor) return Promise.reject(new Error('Release relationship editor has not been found'));
// wait for the loading message to disappear (takes ~1s)
return waitFor(() => !qs('.release-relationship-editor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onAdd() {\n this.setReady(true);\n }",
"forceRender() {\n this.autoFetchJourneysChapters(this.state.journeyToView);\n console.log(\"---===< Re-render after CRUD. >===---\")\n }",
"renderedCallback() {\n this.setEditorAndButtonState();\n this.handleLinkPanelOpen();\n }",
"fun... | [
"0.5501628",
"0.54843336",
"0.5475657",
"0.53702766",
"0.52848685",
"0.5254469",
"0.5254469",
"0.5254469",
"0.5237895",
"0.51997083",
"0.5197682",
"0.51773196",
"0.51747036",
"0.5163954",
"0.5115973",
"0.50874174",
"0.50830996",
"0.5082677",
"0.50777996",
"0.50615823",
"0.505... | 0.75614256 | 0 |
in mm returns lit obj or null if gstring is a comment or blank line | static gcode_line_to_obj (gstring){
gstring = Gcode.gline_remove_comment(gstring)
if (gstring == "") { return null }
else if (gstring.startsWith(";")){ //semicolon on non first column starts end of line comment.
return Gcode.gcode_varline_to_obj(gstring)
}
else {
var litobj = {}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static gline_remove_comment(gstring){\n let comment_pos = gstring.lastIndexOf(\";\")\n if (comment_pos == -1) { return gstring.trim() }\n else if (comment_pos == 0) {\n if (gstring.includes(\"=\")) { return gstring.trim()} //not actually a comment, its a var\n else { return \"\" } //a ... | [
"0.5852328",
"0.5783544",
"0.56815076",
"0.56815076",
"0.56815076",
"0.5635473",
"0.51814747",
"0.51396435",
"0.50108594",
"0.50015026",
"0.49676147",
"0.49480793",
"0.4941684",
"0.4941684",
"0.4941684",
"0.49206004",
"0.49055094",
"0.48877788",
"0.486949",
"0.48558748",
"0.4... | 0.6208785 | 0 |
trims whitespace and comment. Careful: if line begins with semicolon, its not a comment | static gline_remove_comment(gstring){
let comment_pos = gstring.lastIndexOf(";")
if (comment_pos == -1) { return gstring.trim() }
else if (comment_pos == 0) {
if (gstring.includes("=")) { return gstring.trim()} //not actually a comment, its a var
else { return "" } //a comment whose li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trimComment(cssText){return cssText.replace(/(?:\\/\\*)[^*]*\\*\\//g,'');}",
"function fidoquoter_trim(src) {\n\treturn src.replace(/(^\\s+)|(\\s+$)/g, \"\");;\n}",
"function skipSpaceAndComments(s) {\n while (/^(\\s|#)/.test(s)) {\n let i = s.search(/\\S/);\n s = s.slice(i).replace(/^#.*?\\n/,... | [
"0.7369943",
"0.6789845",
"0.67847186",
"0.6722573",
"0.65411144",
"0.6539754",
"0.65168446",
"0.6476639",
"0.6461328",
"0.6448189",
"0.6433706",
"0.6408717",
"0.63496274",
"0.63357633",
"0.6318211",
"0.6276113",
"0.62020004",
"0.6200233",
"0.61718786",
"0.6153834",
"0.615200... | 0.68090665 | 1 |
subval can be "123", "123.45", "123%" "FFFFFF" "0x0", "123x45", "G28" "M104 S0", "12.3mm", "1548.5mm (3.7cm3)", "" return a number, [123, "%"] "FFFFFF", [0, 0] [123, 45], "G28" "M104 S0", [12.3, "mm"], "1548.5mm (3.7cm3)", "" | static gcode_process_subval(subval){
subval = subval.trim()
let x_pos = subval.indexOf("x")
if (subval.includes(" ")) { return subval } //just a string
else if ((x_pos != -1) &&
(x_pos != 0) &&
(x_pos != (subval.length - 1))) { //we've probably got subval of format "12x34"
let s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_val(val){\n if (val.indexOf(\"%\") > -1){\n val = val.replace(\"%\", \"\");\n return parseFloat(val) / 100.0;\n }\n return parseFloat(val);\n}",
"string_getValue(number_value) {}",
"parseEntry(value) {\n // make sure value is a string before replacement\n // const DE... | [
"0.59106886",
"0.58872175",
"0.5838546",
"0.57697874",
"0.57454264",
"0.5718507",
"0.56494164",
"0.5648264",
"0.5563262",
"0.5537897",
"0.5476117",
"0.5464664",
"0.54248714",
"0.54168415",
"0.54137194",
"0.54137194",
"0.5405028",
"0.5405028",
"0.54014766",
"0.53999376",
"0.53... | 0.77112114 | 0 |
G0 for "rapid move" or G1 code | static gobj_to_move_to(gobj, workspace_pose, robot){ //ok for say, gobj to not have Z. that will just return undefined, and
//move_to will get the existing Z value and use it.
if (typeof(gobj) == "string") {
gobj = Gcode.gcode_line_to_obj(gobj)
}
if (gobj) {
let [x_u, y_u, z_u] = this.XY... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function G0() {\r\n\tsendMessage('grado=0')\t\r\n }",
"function _G() {}",
"function genG1 () {\n return PointG1.BASE\n}",
"function updateGopher(){\n\t// don't update the gopher on the very first frame of the simulation.\n\tif (frameNum <= 0)\n\t\treturn;\n\n\tlet gopherTuple = []\n\t// if we are changing ... | [
"0.6542608",
"0.5850776",
"0.58058643",
"0.56980944",
"0.56195074",
"0.55355674",
"0.54876894",
"0.5401596",
"0.5400934",
"0.5368211",
"0.53639233",
"0.53401655",
"0.5327045",
"0.5318281",
"0.5314627",
"0.530323",
"0.530323",
"0.530323",
"0.53006846",
"0.5290987",
"0.52779603... | 0.58562624 | 1 |
load sets up the keyboard if this is the contact page, sets up the form information and the twitter stream embed | function load(){
// building the keyboard
buildKeyboard();
if(document.title == 'matheuPlouffe.com | contact')
{
// Twitter stream embed
var js,
fjs = document.getElementsByTagName("script")[0],
p = /^http:/.test(document.location)?'http':'https';
if(!document.getElementById("twitter-wjs")){
js = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadPage() {\n $('#getName').show();\n $('#messageContainer').hide();\n $('#footer_container').hide();\n initialLoad = 0;\n //$('#messages').hide();\n //$('#welcomeMessage').hide();\n document.getElementById(\"un\").focus();\n}",
"function load_Contact_page() {\r\n\r\n }",
"function load()\n... | [
"0.6291498",
"0.6217799",
"0.5910561",
"0.5870417",
"0.5828423",
"0.57617027",
"0.5735182",
"0.5685724",
"0.56246704",
"0.54929316",
"0.5484883",
"0.54817",
"0.54506284",
"0.54370135",
"0.5426092",
"0.54226583",
"0.5411291",
"0.54079777",
"0.5369466",
"0.5349394",
"0.534404",... | 0.82062733 | 0 |
algorithm to find the best team splits uses the floor of numPeople/numTeams to find the most people that can evenly go into the number of teams desired then adds one to some teams (found by subtracting the people that evenly went into the teams from the total number of people) until there is no one not on a team max di... | function getBestTeams(numPeople, numTeams) {
var array = [];
var pplPer = Math.floor(parseFloat(numPeople) / numTeams);
var teamsToAddTo = numPeople - pplPer * numTeams;
for (var i = 0; i < numTeams; i++) {
array[i] = pplPer;
}
for (var j = 0; j < teamsToAddTo; j++) {
array[j] +=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildNewTeams(participants, teamHistory, max_team_size) {\n\n // edge case, when num_participants < 6, can't guarantee uniqueness so just make random\n if (participants.length % max_team_size > Math.floor(participants.length / max_team_size) ) {\n return firstRoundTeams(participants, max_team_size);\... | [
"0.72355235",
"0.7216752",
"0.6021084",
"0.5988132",
"0.5913315",
"0.5906393",
"0.5847948",
"0.5795873",
"0.5716609",
"0.567734",
"0.55976295",
"0.5570726",
"0.5556701",
"0.55361444",
"0.5502387",
"0.5484526",
"0.547819",
"0.5474765",
"0.54554987",
"0.54469126",
"0.54417324",... | 0.7759436 | 0 |
returns the tip associated with the given day and month; month = 0(jan), 1(feb); day = 1,2..,31 | function getActivity(day,month){
return tipsArray[month][day];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"t(date) {\n return getDaysInMonth(date);\n }",
"function getDateInfo(monthEvents, month, day) {\n if(!(month in monthEvents)){\n return \"Nothing happened in this month.\";\n }\n var monthExist = monthEvents[month].search(month + \" \" + day + \"]\");\n if(monthExist < 0){\n return \"Nothing has ha... | [
"0.6063304",
"0.5601924",
"0.55222595",
"0.55222595",
"0.55222595",
"0.55222595",
"0.55222595",
"0.55222595",
"0.55222595",
"0.55222595",
"0.55222595",
"0.54900086",
"0.54900086",
"0.54900086",
"0.54428685",
"0.54428685",
"0.54428685",
"0.54428685",
"0.54428685",
"0.54428685",
... | 0.72567505 | 0 |
Returns the tx list | getTxList () {
const network = this.getNetwork()
const fullTxList = this.getFullTxList()
return fullTxList.filter(txMeta => txMeta.metamaskNetworkId === network)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getFullTxList () {\n return this.store.getState().transactions\n }",
"getTransactionsForBlock() {\n try {\n // Lay ra so luong transaction vua du 1 block\n const transactionsForBlock = this.transactions.slice(0, this.blockSize);\n // Clear khoi danh sach transaction trong hang cho de dao\n ... | [
"0.7189365",
"0.6493181",
"0.64843136",
"0.63635874",
"0.62662834",
"0.62544036",
"0.6189705",
"0.61877614",
"0.61835617",
"0.5987352",
"0.5977987",
"0.5972244",
"0.59636074",
"0.59371495",
"0.58698434",
"0.58534646",
"0.5836557",
"0.58299434",
"0.58002424",
"0.57807136",
"0.... | 0.7742649 | 0 |
Returns the number of txs for the current network. | getTxCount () {
return this.getTxList().length
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getNodeCount() {\n return this.nodeCount;\n }",
"getNodeCount() {\n return this.length;\n }",
"get_txCount() {\n return this.liveFunc._txCount;\n }",
"countNodes() {\n let count = 1;\n let current = this.head;\n if (current) {\n while (current.next) {\n... | [
"0.6191993",
"0.61771804",
"0.6165727",
"0.6164443",
"0.6140657",
"0.6133037",
"0.6131724",
"0.6126077",
"0.6072534",
"0.60469496",
"0.6034368",
"0.5963932",
"0.5905764",
"0.58996165",
"0.5891936",
"0.5866121",
"0.5824474",
"0.58033204",
"0.57350874",
"0.56860924",
"0.5670817... | 0.669584 | 0 |
Returns the full tx list across all networks | getFullTxList () {
return this.store.getState().transactions
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getTxList () {\n const network = this.getNetwork()\n const fullTxList = this.getFullTxList()\n return fullTxList.filter(txMeta => txMeta.metamaskNetworkId === network)\n }",
"function list_all() {\n for (i = 0; i < web3.eth.accounts.length; i++) {\n console.log(web3.eth.accounts[i... | [
"0.77485424",
"0.64099294",
"0.6178454",
"0.58712775",
"0.58424157",
"0.58022916",
"0.57933927",
"0.5785846",
"0.5778582",
"0.5736845",
"0.57325065",
"0.564367",
"0.5613749",
"0.55781746",
"0.5573425",
"0.5570796",
"0.5531252",
"0.54914784",
"0.5451527",
"0.5427361",
"0.54220... | 0.6733152 | 1 |
gets tx by Id and returns it | getTx (txId, cb) {
var txList = this.getTxList()
var txMeta = txList.find(txData => txData.id === txId)
return cb ? cb(txMeta) : txMeta
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getTransaction(id) {\n return this._model.getTransaction(id);\n }",
"findTransaction(id) {\n return this.transactions.find((tx) => tx.id === id);\n }",
"async function getTransaction(txId) { \n\n const txHash = Buffer.from(txId, \"hex\");\n\n let result = await client.getTransaction(txHash)... | [
"0.7049026",
"0.695121",
"0.6899742",
"0.6838388",
"0.6768881",
"0.6452496",
"0.63248986",
"0.62778395",
"0.6254565",
"0.6221982",
"0.6221072",
"0.6069302",
"0.6014179",
"0.60078037",
"0.6000637",
"0.59898084",
"0.5969138",
"0.59591496",
"0.5906278",
"0.5879262",
"0.5872017",... | 0.79629505 | 0 |
should update the status of the tx to 'rejected'. | setTxStatusRejected (txId) {
this._setTxStatus(txId, 'rejected')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onReject () {\n this.dispatch('reject', [this]);\n this.active = false;\n }",
"function rejected(x){\n settle(action.rejected(x));\n }",
"reject(num) {\n this.amount = this.amount - num;\n }",
"function reject(r) {\n if(r.state >= Rejected) {\n return;\n }\n if(r.... | [
"0.6972962",
"0.6876405",
"0.62709564",
"0.61904943",
"0.6130014",
"0.60726255",
"0.6032502",
"0.6022055",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5823792",
"0.5762507",
"0.5762302",
... | 0.8010314 | 0 |
should update the status of the tx to 'approved'. | setTxStatusApproved (txId) {
this._setTxStatus(txId, 'approved')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function approveCurrentActivity( itcb ) {\n Y.doccirrus.fsm[fsmName].approve( user, options, activity, false, onDefaultApprove );\n\n function onDefaultApprove( err, newState ) {\n if( err ) {\n Y.log( 'Could not approve invoic... | [
"0.6861484",
"0.68465227",
"0.66441876",
"0.64880025",
"0.6411441",
"0.6395598",
"0.6371633",
"0.63590455",
"0.6318732",
"0.6208048",
"0.6208048",
"0.61359",
"0.60890406",
"0.6085041",
"0.60752285",
"0.6037071",
"0.6020795",
"0.5996956",
"0.5991594",
"0.597048",
"0.5968393",
... | 0.7759664 | 0 |
should update the status of the tx to 'signed'. | setTxStatusSigned (txId) {
this._setTxStatus(txId, 'signed')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"signRawTransaction(unsignedTransactionHash) {\n return __awaiter(this, arguments, void 0, function* () {\n return this.query('signrawtransaction', Array.prototype.slice.call(arguments));\n });\n }",
"static signNonFungibleTokenItemStatusTransaction(transaction, signer, overrides) {\n ... | [
"0.5827008",
"0.5678778",
"0.55636257",
"0.5555557",
"0.5553321",
"0.5495543",
"0.54543084",
"0.544933",
"0.5407276",
"0.53845996",
"0.53839076",
"0.5359213",
"0.53157765",
"0.5312765",
"0.5242777",
"0.5242015",
"0.5206757",
"0.5186614",
"0.51771057",
"0.5170368",
"0.51573354... | 0.76682764 | 0 |
should update the status of the tx to 'submitted'. | setTxStatusSubmitted (txId) {
this._setTxStatus(txId, 'submitted')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setTxStatus (txId, status) {\n var txMeta = this.getTx(txId)\n txMeta.status = status\n this.emit(`${txMeta.id}:${status}`, txId)\n if (status === 'submitted' || status === 'rejected') {\n this.emit(`${txMeta.id}:finished`, txMeta)\n\n }\n this.updateTx(txMeta)\n this.emit('updateBadge')... | [
"0.6899083",
"0.67767495",
"0.66083765",
"0.6380671",
"0.63719994",
"0.63510484",
"0.6312468",
"0.62422264",
"0.62118685",
"0.6210766",
"0.6154104",
"0.6129984",
"0.606449",
"0.60256463",
"0.5997503",
"0.5939429",
"0.5939429",
"0.5939429",
"0.5925726",
"0.592462",
"0.5847482"... | 0.7892931 | 0 |
should update the status of the tx to 'confirmed'. | setTxStatusConfirmed (txId) {
this._setTxStatus(txId, 'confirmed')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"queryTransactionStatuses() {\n return __awaiter(this, void 0, void 0, function* () {\n const { transactions } = this.state;\n const { provider, network: currentNetworkID } = this.getNetworkState();\n const { chainId: currentChainId } = provider;\n let gotUpdates =... | [
"0.60668325",
"0.6027094",
"0.6016982",
"0.5989363",
"0.5956083",
"0.5920863",
"0.5874646",
"0.5874646",
"0.586921",
"0.5825157",
"0.5808871",
"0.57800496",
"0.57800496",
"0.57800496",
"0.57800496",
"0.57800496",
"0.5730574",
"0.5709243",
"0.5701914",
"0.570067",
"0.5651493",... | 0.77028567 | 0 |
merges txParams obj onto txData.txParams use extend to ensure that all fields are filled | updateTxParams (txId, txParams) {
var txMeta = this.getTx(txId)
txMeta.txParams = extend(txMeta.txParams, txParams)
this.updateTx(txMeta)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cloneTxParams(txParams){\n return {\n from: txParams.from,\n to: txParams.to,\n value: txParams.value,\n data: txParams.data,\n gas: txParams.gas,\n gasPrice: txParams.gasPrice,\n nonce: txParams.nonce,\n }\n}",
"function cloneTxParams(txParams) {\n return {\n from: txParams.f... | [
"0.6864202",
"0.6796983",
"0.57760704",
"0.5739195",
"0.56804913",
"0.54999405",
"0.5368122",
"0.5224773",
"0.51996356",
"0.5138345",
"0.5121591",
"0.5118807",
"0.510553",
"0.50396204",
"0.5029242",
"0.5013932",
"0.50005007",
"0.49886218",
"0.4932927",
"0.49221343",
"0.492086... | 0.7152074 | 0 |
checks if a signed tx is in a block and if included sets the tx status as 'confirmed' | checkForTxInBlock (block) {
var signedTxList = this.getFilteredTxList({status: 'submitted'})
if (!signedTxList.length) return
signedTxList.forEach((txMeta) => {
var txHash = txMeta.hash
var txId = txMeta.id
if (!txHash) {
const errReason = {
errCode: 'No hash was provide... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkTransaction(s){\n if(s.confirmed && s.confirmed.blockHash){\n this.loadData();\n }\n }",
"_checkPendingTxs () {\n var signedTxList = this.getFilteredTxList({status: 'submitted'})\n if (!signedTxList.length) return\n signedTxList.forEach((txMeta) => {\n var txHash = txMeta.hash\n ... | [
"0.67187536",
"0.6095662",
"0.5870953",
"0.5738896",
"0.5688946",
"0.5617442",
"0.55654883",
"0.55456877",
"0.5532662",
"0.5500532",
"0.5492475",
"0.5487327",
"0.5482379",
"0.5361069",
"0.53435",
"0.53401554",
"0.53215694",
"0.5282874",
"0.52732164",
"0.52711695",
"0.52706593... | 0.71251535 | 0 |
PRIVATE METHODS Should find the tx in the tx list and update it. should set the status in txData `'unapproved'` the user has not responded `'rejected'` the user has responded no! `'approved'` the user has approved the tx `'signed'` the tx is signed `'submitted'` the tx is sent to a server `'confirmed'` the tx has been ... | _setTxStatus (txId, status) {
var txMeta = this.getTx(txId)
txMeta.status = status
this.emit(`${txMeta.id}:${status}`, txId)
if (status === 'submitted' || status === 'rejected') {
this.emit(`${txMeta.id}:finished`, txMeta)
}
this.updateTx(txMeta)
this.emit('updateBadge')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function txUpdate() {\n let newNum = txNum - txLastNum;\n txLastNum += newNum;\n\n let newResults = results.slice(txUpdateTail);\n txUpdateTail += newResults.length;\n if(newResults.length === 0 && newNum === 0) {\n return;\n }\n\n let newStats;\n if(newResults.length === 0) {\n ... | [
"0.61938965",
"0.6043486",
"0.58022803",
"0.5683268",
"0.56104416",
"0.5530802",
"0.55038726",
"0.54607606",
"0.5444144",
"0.5428432",
"0.5359699",
"0.5332793",
"0.5329202",
"0.53220934",
"0.5265955",
"0.52615505",
"0.5259693",
"0.5247281",
"0.5232823",
"0.52118725",
"0.52067... | 0.62708086 | 0 |
Saves the new/updated txList. Function is intended only for internal use | _saveTxList (transactions) {
this.store.updateState({ transactions })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveListToStorage() {\n localStorage.setItem(\"savedList\", JSON.stringify(savedList));\n}",
"function save() {\n //store list data to the local storage key .\n localStorage.setItem(LOCAL_STORAGE_LIST_KEY, JSON.stringify(lists));\n localStorage.setItem(LOCAL_STORAGE_SELECTED_LIST_ID_KEY, selectedLis... | [
"0.63612866",
"0.62630713",
"0.6227412",
"0.614535",
"0.6066452",
"0.5988184",
"0.59785855",
"0.5954848",
"0.5922662",
"0.58954054",
"0.58932555",
"0.58887666",
"0.5887192",
"0.5886528",
"0.5886528",
"0.58767235",
"0.5875028",
"0.58571327",
"0.5853353",
"0.5852964",
"0.584697... | 0.686494 | 0 |
checks the network for signed txs and if confirmed sets the tx status as 'confirmed' | _checkPendingTxs () {
var signedTxList = this.getFilteredTxList({status: 'submitted'})
if (!signedTxList.length) return
signedTxList.forEach((txMeta) => {
var txHash = txMeta.hash
var txId = txMeta.id
if (!txHash) {
const errReason = {
errCode: 'No hash was provided',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSentTransactions() {\n var remote = StellarNetwork.remote;\n var account = session.get('address');\n var params = {\n 'account': account,\n 'ledger_index_min': 0,\n 'ledger_index_max': 9999999,\n 'descending': true,\n 'count': true\n };\n\n // Transactions\n ... | [
"0.6376342",
"0.6236857",
"0.6175698",
"0.6171491",
"0.5919266",
"0.5808583",
"0.5756718",
"0.5704916",
"0.5656497",
"0.56250477",
"0.5563066",
"0.5555983",
"0.5467635",
"0.54544693",
"0.5440281",
"0.54030406",
"0.53683525",
"0.5306411",
"0.5284916",
"0.527544",
"0.5228866",
... | 0.68048334 | 0 |
tree row on x | function xrow(){
for (var row = 0; row < 20; row++){
if (row != 9 && row != 10){
tree();
translate(96, -74, 0);
} else {
translate(96, 0, 0);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateTree(row) {\n // ******* TODO: PART VII *******\n // console.log(\"updating \" + row);\n // nodes\n d3.selectAll('.' + row)\n .attr('r', 8)\n ;\n // links\n d3.selectAll('.' + row + row)\n .attr('stroke-width', 5)\n ;\n }",
"function zrow(){\r\n\tfor (var row = 0; row < 9... | [
"0.6823855",
"0.6557261",
"0.6554431",
"0.642206",
"0.6345828",
"0.62616515",
"0.62616515",
"0.6253373",
"0.6248322",
"0.6223854",
"0.6158283",
"0.613845",
"0.6108021",
"0.60417366",
"0.5982185",
"0.59607196",
"0.59481764",
"0.5898983",
"0.5876351",
"0.5864277",
"0.58594006",... | 0.71073216 | 0 |
tree row on z | function zrow(){
for (var row = 0; row < 9; row++){
if (row != 4){
tree();
translate(0, -74, 96);
} else {
translate(0, 0, 96);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function syanTreeRow(treeParams, sideWalkParams, materials){\n var treeRow = new THREE.Object3D();\n // add the two rows of trees spaced in between the tiles\n var tree1 = syanFancyTree(treeParams, materials);\n var tree2 = syanFancyTree(treeParams, materials);\n var tree3 = syanFancyTree(treeParams, material... | [
"0.6744267",
"0.65239793",
"0.6457336",
"0.62388116",
"0.6151261",
"0.60805905",
"0.6041516",
"0.5951587",
"0.5934369",
"0.5917335",
"0.59096617",
"0.59094155",
"0.590079",
"0.5862008",
"0.5861997",
"0.58149934",
"0.5798224",
"0.57891744",
"0.57784",
"0.5770812",
"0.57612884"... | 0.7428077 | 0 |
Creates a standerd waypoint with the option of custom logic. To pass in the custom logic, just create a function with all the logic you would like to call when the waypoint is activated, then pass just the name of the function into this function without qoutes. Note that these waypoint functions are available to any js... | function createWaypoint(element, classToToggle, offset, cb) {
return jQuery(element).waypoint(function(direction) {
jQuery(element).toggleClass(classToToggle);
if (typeof cb !== "undefined") {
cb(element, classToToggle, offset, direction);
}
}, { offset: offset });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addWaypoints(){\n\tif($(window).width() > 991){\n\t\tvar waypoint = new Waypoint({\n\t\t element: document.getElementById('animate-hand'),\n\t\t handler: function() {\n\t\t $('.hand--bottom .hand').addClass('animated fadeInUp');\n\t\t },\n\t\t offset: '100%',\n\t\t})\n\t\tvar waypoint = new Waypoin... | [
"0.5886831",
"0.5789109",
"0.5604746",
"0.5575642",
"0.5543864",
"0.54993826",
"0.54937005",
"0.54275703",
"0.53617644",
"0.53274953",
"0.53005904",
"0.52973557",
"0.52168965",
"0.5168482",
"0.5129435",
"0.51292235",
"0.50962543",
"0.50765705",
"0.50393414",
"0.49938345",
"0.... | 0.6421897 | 1 |
A loop for standerd waypoint creation. Also has the ability to pass in custom logic, and classToToggle. Both are optional. Example Multiple Waypoints: waypointer(['.that', 'that', 'this'], 'resolved', '10%', animate); | function waypointer(elementArray, classToToggle, offset, cb) {
for (var i=0; i < elementArray.length; i++) {
createWaypoint(elementArray[i], classToToggle, offset, cb(elementArray[i]));
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function waypointer(elementArray, classToToggle, offset, cb) {\n for (var i=0; i < elementArray.length; i++) {\n createWaypoint(elementArray[i], classToToggle, offset, cb);\n }\n return true;\n}",
"createWaypoints() {\n\t\tthis.itemsToReveal.each(function() {\n\t\t\t//console.log(that);\n\t\t\tvar currentI... | [
"0.66851807",
"0.64329803",
"0.6413773",
"0.6306237",
"0.6229219",
"0.6143993",
"0.6072142",
"0.6021786",
"0.590181",
"0.5838376",
"0.5838376",
"0.5704878",
"0.55870324",
"0.55791867",
"0.5556896",
"0.5528616",
"0.55203414",
"0.55025566",
"0.54917383",
"0.5423686",
"0.5368166... | 0.6682254 | 1 |
Get cloud cover by calling the respective API | function getCloudCover(pass,weatherData){
var dateToFollow = pass["dateTimeStart"]
if(weatherData == null){
return 'N.A';
}
var hours = Math.round(Math.abs(dateToFollow - new Date()) / (60*60*1000));//36e5;
if(hours<1){
return weatherData.currently.cloudCover;
}else if(hours<49)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function fetchCover() {\n return await fetchImage(coverFileName, coverURL);\n}",
"function getCoverList(listQuery) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_utils_request__[\"a\" /* default */])({\n url: 'contentManagement/coverList',\n method: 'get',\n params: listQuery\n });\n}",
"asy... | [
"0.6832467",
"0.61036634",
"0.6080522",
"0.60227394",
"0.59824353",
"0.5959841",
"0.59597725",
"0.5946107",
"0.5940657",
"0.5911549",
"0.58791906",
"0.5863133",
"0.58487856",
"0.5773756",
"0.5726721",
"0.5710968",
"0.5702838",
"0.56838536",
"0.56636906",
"0.5642694",
"0.56300... | 0.66335154 | 1 |
Creates array of stories and checks for blacklisted urls, sends blacklisted urls to killLink | function killItems(item){
var links = item.getElementsByTagName("a");
for(var k=0; k < links.length; k++){
var link = links[k];
var href = link.href.toLowerCase();
// decide which type of link it is
var linkType = null;
if (href.indexOf("facebook.com/buzzfeed") !== -1 ){
linkType = "page link";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async prepareStories() {\n const sb_links = await this.storyblok.getLinks()\n for (let i = 0; i < this.settings.content_types.length; i++) {\n const content_type = this.settings.content_types[i]\n // Import taxonomies for the current content type\n await this.wp.importTaxonomies(content_type.t... | [
"0.56543374",
"0.5650156",
"0.5496802",
"0.54372156",
"0.5399723",
"0.5317386",
"0.52903545",
"0.52700156",
"0.5255715",
"0.5237337",
"0.5231191",
"0.5230659",
"0.5225086",
"0.51858044",
"0.51844776",
"0.5162299",
"0.51432145",
"0.5115939",
"0.5115777",
"0.51087296",
"0.50782... | 0.583609 | 0 |
Initializes a new instance of `XMLDTDElement` `parent` the parent `XMLDocType` element `name` element name `value` element content (defaults to PCDATA) | constructor(parent, name, value) {
super(parent);
if (name == null) {
throw new Error("Missing DTD element name. " + this.debugInfo());
}
if (!value) {
value = '(#PCDATA)';
}
if (Array.isArray(value)) {
value = '(' + value.join(',') + ')';
}
this.n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(parent, name, attributes) {\n var child, j, len, ref;\n super(parent);\n if (name == null) {\n throw new Error(\"Missing element name. \" + this.debugInfo());\n }\n this.name = this.stringify.name(name);\n this.type = NodeType.Element;\n this.at... | [
"0.6578307",
"0.61874634",
"0.6084897",
"0.6034634",
"0.59282637",
"0.59058976",
"0.58915204",
"0.5807117",
"0.5751715",
"0.5708818",
"0.56161267",
"0.5613574",
"0.55941516",
"0.54161966",
"0.54089475",
"0.53688145",
"0.53237593",
"0.5318868",
"0.5244524",
"0.5237872",
"0.521... | 0.7149 | 1 |
Converts the XML fragment to string `options.pretty` pretty prints the result `options.indent` indentation for pretty print `options.offset` how many indentations to add to every line for pretty print `options.newline` newline sequence for pretty print | toString(options) {
return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringify(node, options) {\n const finalOptions = { ...defaults, ...options };\n return genNode(Array.isArray(node) ? { type: 0, children: node } : node, finalOptions.initialIndent * finalOptions.initialIndent, finalOptions);\n}",
"toString(options = {}) {\n if (this.errors.length > 0)\n ... | [
"0.55093324",
"0.5468134",
"0.5416109",
"0.5395063",
"0.5386089",
"0.5376488",
"0.5366324",
"0.5327577",
"0.5304143",
"0.52997655",
"0.52816695",
"0.5278029",
"0.52723235",
"0.5218535",
"0.51642174",
"0.5159925",
"0.5125743",
"0.5116306",
"0.5035775",
"0.5019035",
"0.5006164"... | 0.5546718 | 1 |
Internal function. Overloads public addData(). Call with resize = true when resizing instead of actually adding data. TODO: this should be refactored to avoid calling addData on resize | _addData(data) {
if (this._svg !== undefined) {
this._svg.selectAll("*")
.remove();
}
if (!data || this.options.selectedAttributeIdx >= data.length) {
this.options.selectedAttributeIdx = 0;
}
this._removeMark... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addData(data, label) {\n //TODO: check sizes\n\n _data.push({\n label,\n data,\n });\n }",
"function addData() {\n \n}",
"function addData (obj){\n\n data.push(obj);\n\n updateDOM();\n}",
"function addData(obj) {\n data.push(obj);\n updateDOM();\n}",
"function addData(ob... | [
"0.6471357",
"0.63472146",
"0.6174805",
"0.61593676",
"0.61593676",
"0.6147681",
"0.6141599",
"0.6126675",
"0.6126675",
"0.6038441",
"0.60036236",
"0.59513855",
"0.59513855",
"0.59424484",
"0.5940658",
"0.5902806",
"0.58294034",
"0.58286643",
"0.5821531",
"0.58157694",
"0.576... | 0.6460233 | 1 |
Draws the currently dragged rectangle over the chart. | _drawDragRectangle() {
if (!this._dragStartCoords) {
return;
}
const dragEndCoords = this._dragCurrentCoords = this._dragCache.end = mouse(this._background.node())
const x1 = Math.min(this._dragStartCoords[0], dragEndCoords[0]),
x2 = Math.m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawDrag(x1, y1, x2, y2) {\n overlayCtx.fillRect(x1 + woff, y1 + hoff, x2 - x1, y2 - y1);\n}",
"function drawRect(ev)\r\n {\r\n if (event.button == 2) // if it is a click of the left mouse button\r\n {\r\n end_coords = map.mouseEventToLatLng(ev.originalEvent); //returns the ... | [
"0.6737426",
"0.6703317",
"0.66622317",
"0.66432047",
"0.6604353",
"0.65761125",
"0.655177",
"0.6531835",
"0.6455925",
"0.6415138",
"0.6382562",
"0.6329782",
"0.62956077",
"0.6239147",
"0.6235857",
"0.6235118",
"0.61414504",
"0.6116297",
"0.60996205",
"0.60873616",
"0.6082732... | 0.7548463 | 0 |
Handles end of drag operations. Zooms the map to the selected items extent. | _dragEndHandler() {
if (!this._dragStartCoords || !this._gotDragged) {
this._dragStartCoords = null;
this._gotDragged = false;
this._resetDrag();
return;
}
const item1 = this._findItemForX(this._dragStartCoords[0]),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onMoveEnd(e) {\n\t\tif (this.currentZoom != this.olMap.getView().getZoom()) {\n\t this.currentZoom = this.olMap.getView().getZoom();\n\t this.tgRoads.updateDisplayedRoadType(this.currentZoom);\n\t this.requestLocations = true;\n\t console.log('zoomEnd');\n\n\t this.tgLocs.initLocations();\n\t }\n\t... | [
"0.6959448",
"0.66631186",
"0.66093946",
"0.6554975",
"0.6549836",
"0.64167154",
"0.6405297",
"0.6378569",
"0.63745284",
"0.6361113",
"0.6361113",
"0.6306238",
"0.62328774",
"0.61991125",
"0.6184383",
"0.6137509",
"0.61220497",
"0.6098342",
"0.608357",
"0.60593414",
"0.593746... | 0.6689429 | 1 |
Calculates the full extent of the data array | _calculateFullExtent(data) {
if (!data || data.length < 1) {
return null;
}
let full_extent = new L.latLngBounds(data[0].latlng, data[0].latlng);
data.forEach((item) => {
if (!full_extent.contains(item.latlng)) {
full_ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcExtents(data, indicator) {\n\n // first find all the data points for a specific indicator across\n // all countries and join them into one array.\n var allValues = data.map(function(player) {\n return player[indicator];\n });\n\n // now go through all the data points and find the e... | [
"0.677335",
"0.66173154",
"0.66173154",
"0.6423953",
"0.6423619",
"0.62868917",
"0.6230843",
"0.6149618",
"0.60770917",
"0.60201585",
"0.60201585",
"0.59130317",
"0.58401555",
"0.5802321",
"0.5785563",
"0.5758234",
"0.5757039",
"0.5754187",
"0.57416195",
"0.5713307",
"0.57105... | 0.71510786 | 0 |
Make the map fit the route section between given indexes. | _fitSection(index1, index2) {
const start = Math.min(index1, index2), end = Math.max(index1, index2)
let ext
if (start !== end) {
ext = this._calculateFullExtent(this._areasFlattended.slice(start, end + 1));
} else if (this._areasFlattended.length > 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fitMap (route) {\n const allCoordinates = route.directions.features.map((feature) => {\n return feature.geometry.coordinates\n })\n\n var north, south, west, east\n north = south = allCoordinates[0][0][1]\n west = east = allCoordinates[0][0][0]\n\n for (let i = 0; i < allCoordinates.length; ... | [
"0.6189655",
"0.5357236",
"0.52962685",
"0.52690107",
"0.5154794",
"0.5140589",
"0.51405346",
"0.5120451",
"0.5092284",
"0.5076937",
"0.5067648",
"0.50277627",
"0.5008582",
"0.4995856",
"0.49949917",
"0.4992231",
"0.49908012",
"0.49864385",
"0.49854437",
"0.49661788",
"0.4952... | 0.65570503 | 0 |
calculates minimum and maximum values for the elevation scale drawn with d3 | _calculateElevationBounds() {
const max = d3Max(this._elevations)
const min = d3Min(this._elevations)
const range = max - min
this._elevationBounds = {
min: range < 10 ? min - 10 : min - 0.1 * range,
max: range < 10 ? max + 10 : max + 0.1 *... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"range(data) {\n this.customExtent = [d3.min(data, this.getMinFn()), d3.max(data, this.getMaxFn())]\n if(this.customExtent[0] > 0)\n this.customExtent[0] = 0\n\n if(this.customExtent[1] < 0)\n this.customExtent[1] = 0\n\n let difference = (this.customExtent[1] - this.customExtent[0]) * 0.05;\n... | [
"0.6807884",
"0.6572151",
"0.6319989",
"0.6248285",
"0.6229643",
"0.6228303",
"0.6217894",
"0.6208862",
"0.6159363",
"0.6142879",
"0.60334736",
"0.5962729",
"0.595231",
"0.5936224",
"0.58657694",
"0.58657694",
"0.5861314",
"0.58551645",
"0.58437043",
"0.58293456",
"0.5824716"... | 0.7401143 | 0 |
Creates focus Line and focus box while hovering | _createFocus() {
const boxPosition = this._elevationBounds.min
const textDistance = 15
if (this._focus) {
this._focus.remove();
this._focusLineGroup.remove();
}
this._focus = this._svg.append("g")
.attr("class", ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mouseoverLine() {\n if (dataAvgTempDrawed.length > 0){\n focus.style(\"opacity\", 1)\n focusText.style(\"opacity\",1)\n }\n }",
"function mouseover() {\n if (curr_emotion == \"all\" || curr_emotion == \"positive\"){ focus1.style(\"opacity\", 1) };\n if (curr_emotion ... | [
"0.68629855",
"0.6574338",
"0.63393664",
"0.6287921",
"0.6287921",
"0.6248083",
"0.6234759",
"0.6231432",
"0.6207353",
"0.6139444",
"0.6095838",
"0.6083097",
"0.6079229",
"0.607347",
"0.6005554",
"0.59896827",
"0.5978502",
"0.5917949",
"0.5915389",
"0.59112424",
"0.5911206",
... | 0.7045283 | 0 |
Creates horizontal Line for dragging | _createHorizontalLine() {
const self = this
this._horizontalLine = this._svg.append("line")
.attr("class", "horizontalLine")
.attr("x1", 0)
.attr("x2", this._width - this._margin.left - this._margin.right)
.attr("y1", this._y(this._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createLine() {\n let line = this.createLine();\n line.style.position = 'absolute';\n this._lines.push(line);\n this._lineContainer.appendChild(line);\n }",
"makeRow() {\n if (this.cursor) {\n if (this.cursor.isVerticalLine()) {\n // find region boundry\n ... | [
"0.7321681",
"0.67004204",
"0.663806",
"0.66135174",
"0.6521309",
"0.65006626",
"0.6472819",
"0.6467121",
"0.6384933",
"0.637443",
"0.63547623",
"0.63398707",
"0.6338898",
"0.63041323",
"0.62988484",
"0.6280178",
"0.6263519",
"0.6252957",
"0.624748",
"0.6246168",
"0.6178642",... | 0.7551154 | 0 |
Remove the highlighted segments from the map | _removeMarkedSegmentsOnMap() {
if (this._markedSegments !== undefined) {
this._map.removeLayer(this._markedSegments);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearHighlights() {\n for (i=0; i<7; i++) { // there are 7 vertices in an shape\n removeHighlight('c' + i);\n }\n}",
"function removeRange()\r\n {\r\n var toRemove = document.querySelector('input[name=\"listEntry\"]:checked').value;\r\n map.removeLayer(rectArray[toRemove]);... | [
"0.7043791",
"0.69785637",
"0.69176143",
"0.6786182",
"0.67462",
"0.66897875",
"0.667908",
"0.66402876",
"0.66302204",
"0.6600839",
"0.65782243",
"0.65353686",
"0.64933693",
"0.6487424",
"0.6457242",
"0.645096",
"0.6425885",
"0.64211416",
"0.6419882",
"0.64129245",
"0.6387502... | 0.8104427 | 0 |
Defines the ranges and format of x and y scales and appends them | _appendScales() {
const shortDist = Boolean(this._totalDistance <= 10)
this._x = scaleLinear()
.range([0, this._svgWidth]);
this._y = scaleLinear()
.range([this._svgHeight, 0]);
this._x.domain([0, this._totalDistance]);
this._y.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createXYScales() {\n const x = d3.scaleTime().rangeRound([0, this.width]);\n const y = d3.scaleLinear().rangeRound([this.height, 0]);\n return {x, y};\n }",
"function updateScales() {\n // a normal linear scale also works\n xScale = d3.time.scale()\n ... | [
"0.70894384",
"0.69255054",
"0.68603873",
"0.68521976",
"0.68259895",
"0.6753983",
"0.6586292",
"0.65596175",
"0.65516543",
"0.65458",
"0.65411544",
"0.6491575",
"0.6486687",
"0.63705176",
"0.63434625",
"0.6328821",
"0.6326847",
"0.63223267",
"0.62828493",
"0.6229123",
"0.622... | 0.7354927 | 0 |
Appends a background and adds mouse handlers | _appendBackground() {
const background = this._background = select(this._container)
.select("svg")
.select("g")
.append("rect")
.attr("width", this._svgWidth)
.attr("height", this._svgHeight)
.style("fill", "none... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mousePressed(){\n background(0,255,0);\n}",
"function _createBackground(){\n var backgroundSurface = new Surface({\n properties: {\n // The size of this surface will be inherited\n // from a parent modifier\n backgroundColor: '#FFFFF5',\n boxS... | [
"0.6630993",
"0.6215844",
"0.6129779",
"0.60236377",
"0.59583294",
"0.59458053",
"0.57945496",
"0.5728024",
"0.5672832",
"0.5653646",
"0.5649051",
"0.564807",
"0.56354076",
"0.5628699",
"0.5625327",
"0.5617051",
"0.56166416",
"0.5594525",
"0.559016",
"0.5585885",
"0.5578635",... | 0.6251743 | 1 |
Appends a grid to the graph | _appendGrid() {
this._svg.append("g")
.attr("class", "grid")
.attr("transform", "translate(0," + this._svgHeight + ")")
.call(this._make_x_axis()
.tickSize(-this._svgHeight, 0, 0)
.ticks(Math.round(this._svgWidth / 75))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawGrid() {\n var gridContainer = svg.append(\"svg:g\");\n\n // black background\n gridContainer.append(\"rect\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"100%\")\n .attr(\"fill\", backgroundColor);\n\n // draw horizontal and vertical... | [
"0.73407084",
"0.6992796",
"0.69381213",
"0.69381213",
"0.69283074",
"0.69027996",
"0.68822074",
"0.6861138",
"0.67877334",
"0.6775881",
"0.67326754",
"0.6728436",
"0.66991854",
"0.66465795",
"0.6637599",
"0.66067356",
"0.6592579",
"0.65524036",
"0.654097",
"0.65288115",
"0.6... | 0.73615295 | 0 |
Appends the areas to the graph | _appendAreas(block, idx, eleIdx) {
const c = this._categories[idx].attributes[eleIdx].color
const self = this
const area = this._area = d3Area().x(d => {
const xDiagonalCoordinate = self._x(d.position)
d.xDiagonalCoordinate = xDiagonalCoordinate
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawAreaChart() {\r\n\r\n // References\r\n // Area chart timeline\r\n // http://bl.ocks.org/mbostock/3883195\r\n\r\n var margin = {top: 40, right: 20, bottom: 40, left: 50},\r\n h = 180,\r\n areaChartWidth = width - margin.left - margin.right - 40,\r\n areaChartHeight... | [
"0.64460915",
"0.63588923",
"0.62956786",
"0.6140626",
"0.61224025",
"0.5981033",
"0.5949883",
"0.58814585",
"0.58617157",
"0.5840478",
"0.5834242",
"0.5814265",
"0.5811554",
"0.5782678",
"0.5775147",
"0.5747188",
"0.5685798",
"0.56660104",
"0.5649521",
"0.56280255",
"0.56201... | 0.7371768 | 0 |
Creates top border line on graph | _createBorderTopLine() {
const self = this
const data = this._areasFlattended
const borderTopLine = line()
.x(d => {
const x = self._x
return x(d.position)
})
.y(d => {
const y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawtopborder(number) {\n return '┏' + drawLine(number) + '┓';\n }",
"createBorderTop(x,y,size, colSize, rowSize){\n \n context.beginPath();\n context.moveTo(x,y);\n context.lineTo(x+size/colSize,y);\n context.stroke();\n \n\n }",
"function outerBorder() {... | [
"0.7591436",
"0.71525645",
"0.67346376",
"0.65951484",
"0.6313882",
"0.63121855",
"0.62014663",
"0.58313715",
"0.5802105",
"0.57973576",
"0.57470274",
"0.57423913",
"0.5735383",
"0.5735383",
"0.5698217",
"0.56946814",
"0.56847596",
"0.56648976",
"0.5641784",
"0.5615438",
"0.5... | 0.8322172 | 0 |
Finds a data entry for a given xcoordinate of the diagram | _findItemForX(x) {
const bisect = bisector(d => d.position).left
const xInvert = this._x.invert(x)
return bisect(this._areasFlattended, xInvert);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"lookup1D(x)\n {\n checkArgumentsDefinedAndHaveValue(arguments);\n return this.contents[x];\n }",
"function searchDataPoint() {\n\tvar dps = chart.data[0].dataPoints;\n\tfor (var i = 0; i < dps.length; i++) {\n\t\tif ((xValue >= dps[i].x.getTime() - xSnapDistance && xValue <= dps[i].x.getTime(... | [
"0.6262991",
"0.60093254",
"0.59247226",
"0.5762523",
"0.5745384",
"0.57324064",
"0.5706005",
"0.56867707",
"0.5677599",
"0.56732005",
"0.5634359",
"0.5595671",
"0.5584575",
"0.55773634",
"0.5559126",
"0.55441093",
"0.5529",
"0.55287945",
"0.55176586",
"0.55058813",
"0.545916... | 0.6317505 | 0 |
Finds data entries above a given yelevation value and returns geocoordinates | _findCoordsForY(y) {
let bisect = (b, yInvert) => {
//save indexes of elevation values above the horizontal line
const list = []
for (let i = 0; i < b.length; i++) {
if (b[i].altitude >= yInvert) {
list.push(i);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nearestStore() {\n console.log(yourPositon[0], yourPositon[1]);\n console.log(infoData[1].Position.PositionLon);\n const res = infoData.filter(\n (point) =>\n getDistance(\n [yourPositon[0], yourPositon[1]],\n [point.Position.PositionLat, point.Position.PositionLon]\n ) < 300... | [
"0.5980888",
"0.5925888",
"0.5839796",
"0.57673824",
"0.57213765",
"0.5623633",
"0.5546883",
"0.5511794",
"0.5477052",
"0.5448164",
"0.53913236",
"0.53751093",
"0.53702414",
"0.5350056",
"0.53454155",
"0.5318988",
"0.5303218",
"0.5285033",
"0.52784026",
"0.5263666",
"0.525730... | 0.6059018 | 0 |
Get the element that corresponds to the fqn | get(fqn) {
return this.elements[fqn];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function element(self, class_name)\r\n {\r\n return document.getElementById(self.widget_id).getElementsByClassName(class_name)[0] \r\n\t}",
"function getElem(el, binding) {\n if (binding.arg === 'window') return window\n\n return binding.arg ? document.querySelector(binding.arg) : el\n}",
"function... | [
"0.582531",
"0.57742786",
"0.5733378",
"0.57085425",
"0.5679807",
"0.56388634",
"0.56319654",
"0.56177443",
"0.56171453",
"0.55883265",
"0.55642724",
"0.55628556",
"0.55628556",
"0.55535597",
"0.5550105",
"0.55446386",
"0.55418134",
"0.5538603",
"0.5505065",
"0.55022466",
"0.... | 0.7576298 | 0 |
Returns a list of all the elements sorted by name | list() {
let oList = [];
Object.keys(this.elements).forEach((element) => {
oList.push(this.get(element));
});
oList.sort((a, b) => { return a.name.localeCompare(b.name); });
return oList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sortElements() {}",
"getListOrdered() {\n let ordenada = []\n for (let i in this.#elementos) ordenada.push(this.#elementos[i].clave)\n ordenada.sort()\n return ordenada\n }",
"function sortByName(a) {\n var result = a.slice()\n result.sort(function(x, y) {\n ... | [
"0.7068467",
"0.6816245",
"0.67724997",
"0.6581173",
"0.65417534",
"0.6438899",
"0.6397315",
"0.6397315",
"0.63652176",
"0.6361082",
"0.63132423",
"0.6238998",
"0.6217074",
"0.6192103",
"0.61343086",
"0.61296105",
"0.6065206",
"0.60053986",
"0.5961722",
"0.59599274",
"0.59525... | 0.80353904 | 0 |
Adds information to value object to be parsed for constraints | valueConstraints(element, value, title) {
if (value.identifier.fqn in this.elements) {
const valueElement = this.get(value.identifier.fqn);
value.path = valueElement.namespacePath;
value.name = valueElement.name;
} else {
value.name = value.identifier.fqn;
}
value.title = title;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"valueSet(constraint, subpath) {\n const name = 'Value Set';\n const binding = `(${constraint.bindingStrength})`;\n const value = constraint.valueSet + ' ' + binding;\n const lastMod = constraint.lastModifiedBy.fqn;\n //const href = constraint.uri;\n const vConstraint = this.newConstraint(name, va... | [
"0.628172",
"0.60004246",
"0.56918144",
"0.56695676",
"0.5452628",
"0.5318709",
"0.5209821",
"0.5204631",
"0.51892954",
"0.5188218",
"0.51004815",
"0.50945836",
"0.50767905",
"0.49914214",
"0.49702707",
"0.4957028",
"0.49556276",
"0.49380612",
"0.49053818",
"0.48641178",
"0.4... | 0.6371227 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.