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 |
|---|---|---|---|---|---|---|
Given a set of Users of a Project, returns those which are active in a certain format. | function getProjectMemebers(users){
var users_to_be_returned = [];
var y;
for (y in users) {
if(users[y].ProjectUser.active === true){
users_to_be_returned.push({
id: users[y].id,
email: users[y].email,
profi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAvailableOperator(project_users) {\n var project_users_available = project_users.filter(function (projectUser) {\n if (projectUser.user_available == true) {\n return true;\n }\n });\n // console.log('D -> [GET AVAILABLE PROJECT-USER ] - AVAILABLE PROJECT USERS (getAvailableOperator): ', project_us... | [
"0.6328378",
"0.6165192",
"0.60171044",
"0.58097816",
"0.5777066",
"0.57489836",
"0.56817025",
"0.5542995",
"0.54764336",
"0.54680586",
"0.54577434",
"0.54232365",
"0.54013896",
"0.5375087",
"0.53555727",
"0.53447306",
"0.53305185",
"0.53277934",
"0.53149426",
"0.5307509",
"0... | 0.69044966 | 0 |
Removes the Users from a given Project | function invalidateUsers(project){
//look for members
project.getUsers().then(function(users){
var x;
for (x in users) {
users[x].ProjectUser.active = false;
users[x].ProjectUser.save();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async removeProjectUser(input = { projectId: '0', userIds: [] }) {\n\n return await this.request({\n name: 'project.people.remove',\n args: [input.projectId],\n params: {\n remove: {\n userIdList: this.formatList(input.userIds)\n ... | [
"0.7459299",
"0.69526815",
"0.68115747",
"0.6519368",
"0.6384642",
"0.6371761",
"0.6354739",
"0.63208276",
"0.62880397",
"0.6193959",
"0.61319655",
"0.60958797",
"0.6046781",
"0.5975287",
"0.5962884",
"0.5961743",
"0.5954148",
"0.5951911",
"0.5949702",
"0.59258854",
"0.592348... | 0.7152272 | 1 |
Creates a record at ProjectIntegrations table for provided project and each available Integration. | function generateProjectIntegrationsRecords(project){
models.Integration.findAll().then(function(integrations){
if(integrations === null || integrations === undefined){
return;
}
for(var x in integrations){
project.addIntegration(integrations[x], { active: false });
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupIntegrations(integrations) {\n const integrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n }",
... | [
"0.5446376",
"0.53445137",
"0.53231156",
"0.53160775",
"0.52603334",
"0.5257165",
"0.51885307",
"0.5179023",
"0.516205",
"0.5155638",
"0.50598943",
"0.5012945",
"0.50026435",
"0.49861905",
"0.49705112",
"0.49076536",
"0.48926243",
"0.4883799",
"0.4876655",
"0.4823961",
"0.481... | 0.80977523 | 0 |
weather details based on country's capital and alpha2Code | async function weatherDetails(capital,alpha2Code){
const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${capital},${alpha2Code}&appid=3c1145541f4dd4f86ad50a2697490b1b`);
const weatherResponse = await response.json();
if(weatherResponse.cod==404) {
swal(weatherResponse.messa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWeather(country) {\n // distracting key names from oneCity object to use \n const { lat, lon, display_name } = country;\n fetch(\n `${BASE_URL}/onecall?lat=${lat}&lon=${lon}&exclude=current&cnt=4&appid=${API_KEY}&units=metric&lang=en`\n )\n .then((res) => res.json())... | [
"0.6509394",
"0.64381063",
"0.6433893",
"0.6414606",
"0.63746995",
"0.63669753",
"0.63111234",
"0.6286317",
"0.6262754",
"0.62623096",
"0.62607825",
"0.62390184",
"0.6238519",
"0.6232812",
"0.6228378",
"0.6222416",
"0.6207341",
"0.6191757",
"0.61816394",
"0.61787003",
"0.6176... | 0.7007325 | 0 |
get the previous comparison name from the current page and redirect to it. | function redirectPreviousComparison( ) {
redirectToComparison( $("#previous-page").attr( "href") );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"goToPrevious() {\n if (this.history.getPagesCount()) {\n this.transition = this.history.getCurrentPage().transition;\n if (!_.isEmpty(this.transition)) {\n this.transition += '-exit';\n }\n this.history.pop();\n this.isPageAddedToHistory ... | [
"0.69605243",
"0.6773345",
"0.672656",
"0.66344005",
"0.6590314",
"0.6590314",
"0.65638596",
"0.6526017",
"0.6519133",
"0.6515921",
"0.65052766",
"0.6480004",
"0.6424097",
"0.63844395",
"0.635687",
"0.63448423",
"0.634272",
"0.63121444",
"0.6294518",
"0.62682706",
"0.6246242"... | 0.7677555 | 0 |
get the next comparison name from the current page and redirect to it. | function redirectNextComparison( ) {
redirectToComparison( $("#next-page").attr( "href") );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function redirectPreviousComparison( ) {\n\n redirectToComparison( $(\"#previous-page\").attr( \"href\") );\n}",
"function goto_next_form() {\n context.current++;\n if (context.current >= context.workflow.length) {\n return finish_survey(); //todo: verify that when going Back and clic... | [
"0.67862695",
"0.61748403",
"0.6173028",
"0.5932165",
"0.59119684",
"0.57343346",
"0.57295835",
"0.5709965",
"0.5664455",
"0.5641435",
"0.56336796",
"0.5623923",
"0.5623648",
"0.5621304",
"0.5617399",
"0.5610238",
"0.5588575",
"0.5588575",
"0.55803704",
"0.55437297",
"0.55316... | 0.7533965 | 0 |
Enables sorting buttons used in conjunction with disable | function enableSortingBtn(){
document.querySelector(".bubbleSort").disabled = false;
document.querySelector(".insertionSort").disabled = false;
document.querySelector(".mergeSort").disabled = false;
document.querySelector(".quickSort").disabled = false;
document.querySelector(".selectionSort").disab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableSortingBtn(){\r\n document.querySelector(\"#bubble\").disabled = false;\r\n document.querySelector(\"#insertion\").disabled = false;\r\n document.querySelector(\"#merge\").disabled = false;\r\n document.querySelector(\"#quick\").disabled = false;\r\n document.querySelector(\"#selectio... | [
"0.8359131",
"0.8071291",
"0.8033943",
"0.8011487",
"0.7852813",
"0.7349154",
"0.70195335",
"0.6959187",
"0.68483084",
"0.6830566",
"0.67490196",
"0.67036545",
"0.65328604",
"0.63983315",
"0.6395336",
"0.63551337",
"0.62560594",
"0.62487864",
"0.62356323",
"0.6228502",
"0.620... | 0.8349426 | 1 |
Disables size slider used in conjunction with enable, so that we can disable during sorting and enable buttons after it | function disableSizeSlider(){
document.querySelector("#arr_sz").disabled = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function disableSizeSlider(){\r\n document.querySelector(\"#array_size\").disabled = true;\r\n}",
"function enableSizeSlider(){\r\n document.querySelector(\"#array_size\").disabled = false;\r\n}",
"function enableSizeSlider(){\n document.querySelector(\"#arr_sz\").disabled = false;\n}",
"function en... | [
"0.79666847",
"0.793539",
"0.7900308",
"0.7885283",
"0.69763577",
"0.69241995",
"0.69076985",
"0.6869688",
"0.6750201",
"0.67145187",
"0.6582697",
"0.6540448",
"0.6484977",
"0.64655125",
"0.6455869",
"0.64322186",
"0.6421058",
"0.63967186",
"0.6395608",
"0.63784057",
"0.63521... | 0.79432666 | 1 |
Enables size slider used in conjunction with disable | function enableSizeSlider(){
document.querySelector("#arr_sz").disabled = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableSizeSlider(){\r\n document.querySelector(\"#array_size\").disabled = false;\r\n}",
"function enableSizeSlider(){\r\n document.querySelector(\"#arr_sz\").disabled = false;\r\n}",
"function disableSizeSlider(){\r\n document.querySelector(\"#array_size\").disabled = true;\r\n}",
"functio... | [
"0.82435614",
"0.8164459",
"0.79509753",
"0.7905828",
"0.6809975",
"0.65721667",
"0.65301245",
"0.64087933",
"0.63519955",
"0.63383263",
"0.62945837",
"0.62821215",
"0.62486196",
"0.6237544",
"0.6233733",
"0.62263423",
"0.62046",
"0.6185541",
"0.6107982",
"0.6083892",
"0.6083... | 0.8173088 | 1 |
Serialize the attributes to JSON | toJSON() {
return clone(this.attributes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n return obj;\n }",
"toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n if (this.... | [
"0.73718286",
"0.678092",
"0.66635203",
"0.6604421",
"0.6552298",
"0.6507153",
"0.6471335",
"0.6448931",
"0.6444792",
"0.64349556",
"0.64227986",
"0.64227986",
"0.6421529",
"0.64115286",
"0.6385403",
"0.63655716",
"0.6286237",
"0.62815773",
"0.6281438",
"0.627497",
"0.6257686... | 0.73943335 | 0 |
Merge unmergedChanges into PouchDB | function mergeChanges(callback) {
var changes = changesByIdentifiers();
var numChanges = _.keys(changes).length;
if (numChanges) {
if (Logger.debug.isEnabled)
Logger.debug('Merging ' + numChanges.toString() + ' changes');
var op = new Operation('Merge Changes', function (done) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendDocumentState(){\n var document = this.revisionHistory[0];\n\n for(var index = 1; index < this.revisionHistory.length; index++){\n document = merge(document, this.revisionHistory[index]);\n }\n\n return document;\n }",
"mergeSaveUpdates(updateResponseData, collection... | [
"0.6186829",
"0.5978528",
"0.56249654",
"0.5367427",
"0.5367427",
"0.53271574",
"0.5317259",
"0.5317259",
"0.529495",
"0.5265304",
"0.521222",
"0.51935744",
"0.5190828",
"0.51727957",
"0.51596653",
"0.5159233",
"0.51468736",
"0.5143426",
"0.5143426",
"0.51416606",
"0.5133362"... | 0.6921329 | 0 |
Set editor content in textarea when form has been submitted | _setEditorContentOnFormSubmit() {
document.querySelector('#submit').addEventListener('click', () => {
let ckeditorContent = this.editor.getData();
$("textarea#entry_content").val(ckeditorContent);
return true;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save() {\n this.textarea.value = this.content();\n }",
"function save() {\r\n this.textarea.value = this.content();\r\n }",
"function save() {\n $editors.find('.text').each(function () {\n $(this).closest('.fields').find('textarea').val(this.innerHTML);\n });\n }",
... | [
"0.74588794",
"0.73977053",
"0.7131505",
"0.7119008",
"0.70866287",
"0.69927484",
"0.6831052",
"0.6825768",
"0.6733685",
"0.66775894",
"0.65944856",
"0.6580635",
"0.6558408",
"0.6546626",
"0.6500509",
"0.6452969",
"0.6445504",
"0.64452356",
"0.64342695",
"0.63857055",
"0.6378... | 0.79779845 | 0 |
if row exists in target, check the values. if different, update target. if row doesn't exist, create in target | async function backupPlan() {
const sourceSchema = await source.getSchema();
const targetSchema = await target.getSchema();
var backupPlan = [];
//check each table
loopi: for (var i = 0; i < sourceSchema.length; i++) {
const sourceHeader = sourceSchema[i][0];
const key = sourceHeader[1][0].column_name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateArchive(source_id, dest_id) {\r\n var dest_sheet = SpreadsheetApp.openById(dest_id);\r\n var source_data = SpreadsheetApp.openById(source_id).getSheets()[0].getDataRange().offset(1, 0).getValues();\r\n for (i in source_data) {\r\n var row = source_data[i];\r\n if (row[0])//if row[0] == anyt... | [
"0.6023816",
"0.55532897",
"0.5371708",
"0.5287573",
"0.5284369",
"0.52168655",
"0.5197279",
"0.51232344",
"0.5094514",
"0.5059745",
"0.50470066",
"0.50305057",
"0.5028199",
"0.50253594",
"0.50234663",
"0.49976325",
"0.49879497",
"0.49789676",
"0.49573517",
"0.4948072",
"0.49... | 0.567815 | 1 |
handler used to submit a new deck | function buttonSubmitHandler(deck) {
createDeck(deck).then((createdDeck) =>
history.push(`/decks/${createdDeck.id}`)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitHandler(updatedDeck) {\n updateDeck(updatedDeck).then((savedDeck) =>\n history.push(`/decks/${savedDeck.id}`)\n );\n }",
"create() {\n\t\t$.when($.ajax(CREATE_URL))\n\t\t\t.then((data, textStatus, jqXHR) => {\n\t\t\t\tif (data.success) {\n\t\t\t\t\tthis.update(data);\n\t\t\t\t\t//save ... | [
"0.7309825",
"0.6874492",
"0.6759441",
"0.6628136",
"0.65532875",
"0.65184665",
"0.6379258",
"0.629032",
"0.6071137",
"0.6037378",
"0.5998573",
"0.5996766",
"0.59856683",
"0.5979",
"0.5949988",
"0.5903462",
"0.59000283",
"0.58936954",
"0.58785415",
"0.58506036",
"0.5836138",
... | 0.7524397 | 0 |
using history to go back a page when user clicks cancel button | function cancel() {
history.goBack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancel() {\n window.history.back();\n}",
"cancel() {\n history.push('/Varelager');\n }",
"function voltarHistory()\n\t{\n\t\twindow.history.back();\n\t}",
"function goBack() {\n window.history.back();\n} // nu merge, mai este si forward, merge inainte spre urmatorul url din history",
"functi... | [
"0.8182814",
"0.78876525",
"0.78742963",
"0.78191036",
"0.7717506",
"0.7684806",
"0.7673093",
"0.7638848",
"0.7626808",
"0.7623137",
"0.7622078",
"0.7618014",
"0.7611376",
"0.76102734",
"0.75997275",
"0.7573906",
"0.75692976",
"0.75692976",
"0.7566136",
"0.75642556",
"0.75535... | 0.8532799 | 0 |
FOR HEAD // //////////////// render all shapes in headshapes | function renderHead(){
makeHead();
for (i = 0; i < headShapes.length; i++){
headShapes[i].render();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"renderAllShapes( ) {\n for( var i = 0; i < 6; i++ ){ \n for(var k = 0; k < 3; k++ ) {\n this.renderShape( Piece.getRandom(), k*5, i*5 );\n }\n }\n }",
"function renderScarf(){\n makeScarf();\n for (i = 0; i < scarfShapes.length; i++){\n scarfShapes... | [
"0.724084",
"0.7124353",
"0.71084815",
"0.7037156",
"0.7015452",
"0.68386567",
"0.68190336",
"0.6809297",
"0.67443645",
"0.6669349",
"0.66037863",
"0.65998596",
"0.65967536",
"0.6528773",
"0.65240747",
"0.65091395",
"0.64950895",
"0.6493821",
"0.64555925",
"0.64462876",
"0.64... | 0.86826605 | 0 |
FOR CLOTH // ///////////////// renders all shapes in scarfShapes list | function renderScarf(){
makeScarf();
for (i = 0; i < scarfShapes.length; i++){
scarfShapes[i].render();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"draw(){\n let shapes = this.shapeList.iterator();\n push();\n while(!shapes.isEmpty()){\n shapes.currItem().draw();\n shapes.next();\n }\n pop();\n\n this.drawText();\n }",
"renderAllShapes( ) {\n for( var i = 0; i < 6; i++ ){ \n ... | [
"0.75771004",
"0.7506801",
"0.71399885",
"0.70075756",
"0.69437194",
"0.67561096",
"0.6724537",
"0.6678995",
"0.66559273",
"0.6651667",
"0.66383547",
"0.66353506",
"0.662603",
"0.65511775",
"0.65124774",
"0.64992934",
"0.64474463",
"0.6442699",
"0.6419842",
"0.63885176",
"0.6... | 0.84150165 | 0 |
makes SCARF shapes and adds to scarfShapes list | function makeScarf(){
scarfShapes = [];
//front of scarf from left to right
var scarf1 = new Cube();
scarf1.color = CLOTH_COLOR;
scarf1.matrix.translate(-.07, -.01, -.01);
scarf1.matrix.rotate(bodyRotation, 0, 1, 0);
tempMatrix = new Matrix4(scarf1.matrix);
scarf1.matrix.scale(0.05, 0.05... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderScarf(){\n makeScarf();\n for (i = 0; i < scarfShapes.length; i++){\n scarfShapes[i].render();\n }\n }",
"drawShape(...shapes) {\n shapes = shapes.map((s) => {\n if (s instanceof Shape) return s;\n return new Shape(this.POLYGON, undefined, s);\n });\n this.current... | [
"0.7280239",
"0.62736106",
"0.6263705",
"0.6207246",
"0.6132876",
"0.61327684",
"0.607859",
"0.60044044",
"0.5994544",
"0.5956763",
"0.59308976",
"0.5919163",
"0.59137696",
"0.5856767",
"0.58275133",
"0.58204556",
"0.58118093",
"0.57879305",
"0.5777325",
"0.5772699",
"0.57608... | 0.6808386 | 1 |
authenticate by passing data to cookie and localStorage | function authenticate(data, next) {
setCookie("token", data.token);
setLocalStorage("user", data.user);
next();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeAuth(data){\n\tAUTHORIZATION_CODE = data.authToken;\n\tlocalStorage.auth = data.authToken;\n\t$(\"#js-login-user-form\").unbind().submit();\n}",
"login() {\r\n this.authenticated = true;\r\n localStorage.setItem(\"islogedin\", true);\r\n }",
"login(context, creds, redirect) {\n ... | [
"0.7011708",
"0.69820493",
"0.6978254",
"0.6953093",
"0.6875314",
"0.6794404",
"0.6762715",
"0.6754833",
"0.6754553",
"0.6744769",
"0.67342496",
"0.672817",
"0.67152405",
"0.6677837",
"0.66611016",
"0.66363513",
"0.6629535",
"0.66274273",
"0.66274273",
"0.65932286",
"0.659287... | 0.75496 | 0 |
Better Boids 07.06.2020 ///////////////////////////////////////////////////////////////////////////// Vector addition for any number of vectors of any dimension | function addVectors() {
let vector = [];
for (var vec of arguments) {
for (var elem = 0; elem < vec.length; elem++) {
if (isNaN(vector[elem])) {
vector[elem] = vec[elem];
} else {
vector[elem] += vec[elem];
}
}
}
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function vectorAdd(a, b) {\n\treturn [ a[0] + b[0], a[1] + b[1] ];\n}",
"function addVect(a, b) {\n return [ a[0] + b[0],\n a[1] + b[1],\n a[2] + b[2]\n ];\n}",
"function addVectors(vec1, vec2) {\n var result = [];\n var i;\n for (i = 0; i < vec1.length;i++) {\n re... | [
"0.7625064",
"0.7402324",
"0.73160917",
"0.7221163",
"0.7221163",
"0.71790606",
"0.70965356",
"0.7073721",
"0.6998477",
"0.69524",
"0.6868856",
"0.68461895",
"0.6815921",
"0.6808258",
"0.67435396",
"0.67371905",
"0.66226715",
"0.6614821",
"0.66000557",
"0.6457971",
"0.6457971... | 0.76791996 | 0 |
Vector subtraction for any number of vectors of any dimension | function subVectors() {
let vector = [];
for (var vec of arguments) {
for (var elem = 0; elem < vec.length; elem++) {
if (isNaN(vector[elem])) {
vector[elem] = vec[elem];
} else {
vector[elem] -= vec[elem];
}
}
}
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static subtract(v1,v2) {\n try {\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\n throw \"Vector.subtract: non-vector parameter\";\n else {\n var v = new Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);\n //v.toConsole(\"Vector.subtract: \"... | [
"0.6800913",
"0.6788665",
"0.6779058",
"0.67721057",
"0.66933507",
"0.66247314",
"0.6618391",
"0.6488951",
"0.64503056",
"0.64503056",
"0.63782513",
"0.6269047",
"0.6193696",
"0.6091098",
"0.60744977",
"0.6066378",
"0.6014831",
"0.60067177",
"0.60047275",
"0.6000684",
"0.5992... | 0.7258498 | 0 |
A geo is a float where the integer part is in degrees and the fractional part is in 60ths | function geoToRad(geo) {
var sign = geo >= 0 ? 1 : -1;
geo = Math.abs(geo);
var integerPart = Math.floor(geo);
var fractionalPart = (geo % 1) * 100;
fractionalPart = fractionalPart / 60;
return g.math.degToRad(integerPart + fractionalPart);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalizeLng( value ) {\n const rotation = Math.floor( ( value + 180 ) / 360 );\n const normalized = value - ( rotation * 360 );\n const rounded = Math.round( normalized * 1e2 ) / 1e2;\n\n return rounded;\n }",
"function geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n ... | [
"0.6228649",
"0.6112899",
"0.6034422",
"0.5960227",
"0.5719581",
"0.5701677",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5635337",
"0.5596975",
"0.55789965",
"0.55213153",
"0.5493802",
"0.54817885",
"0.54811484",... | 0.6792253 | 0 |
Based on the user's .projects file, if there are no projects, the Create New Projects form is displayed. If there is at least one project, the Select A Project form is displayed instead. | function createProjectsDialog() {
var projects = getProjects();
console.log(projects);
// If there are no projects, show the Create New Project form
if (projects.projects.length == 0) {
console.log(' There are no projects ');
showNewProjectForm();
}
else { // If there is at least one project, show the Selec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function okPressedOnProjSelect() {\n\tconst projNameInput = document.getElementById(\"userProjNameInput\").getBoundingClientRect(),\n\t\tprojFirstFileInput = document.getElementById(\"userFirstFileInput\").getBoundingClientRect(),\n\t\tprojTypeSelect = document.getElementsByClassName(\"selectProjectType\")[0].getB... | [
"0.7073251",
"0.6917091",
"0.6909235",
"0.6861231",
"0.68430156",
"0.67076445",
"0.6697091",
"0.6608477",
"0.6588019",
"0.6580874",
"0.6517345",
"0.6458994",
"0.64220756",
"0.6343993",
"0.63236284",
"0.6288533",
"0.62573487",
"0.6248783",
"0.61926204",
"0.6185092",
"0.6171639... | 0.8043304 | 0 |
Displays the Select a Project form with all of the user's projects in a radio button input form. | function showSelectProjectForm() {
hideError();
$( "div#projectSelectForm" ).css('display','block');;
$( "div#newProjectForm" ).css('display','none');
$( "div#editProject" ).css('display','none');
var projects = getProjects();
var formHTML = "";
// Make the form that shows all of the projects.
for (var i = 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectProject() {\n\thideError();\n\tvar choices = document.getElementsByName(\"selectprj\");\n\tvar prj = getProjects();\n\tfor (var i = 0; i < choices.length; i++) {\n\t\tif (choices[i].checked) { // If the current choice is checked, load that project\n\t\t\tloadProject(prj.projects[i].folderid);\n\t\t}... | [
"0.6948265",
"0.6798576",
"0.6509547",
"0.60625076",
"0.59241545",
"0.5847728",
"0.5801088",
"0.5781091",
"0.57480836",
"0.5738979",
"0.5736396",
"0.572793",
"0.57130426",
"0.5707189",
"0.5687865",
"0.56259835",
"0.5615128",
"0.5612143",
"0.5543332",
"0.55150944",
"0.5498172"... | 0.73632044 | 0 |
Called once a user has selected a template for a project. The selected templated is copied to the user's project folder. | function selectTemplate() {
hideError();
var prj = getProject($( "span#siteName" ).text());
var checked;
var choices = document.getElementsByName("templateSeletion");
for (var i = 0; i < choices.length; i++) {
if (choices[i].checked) {
checked = choices[i];
break;
}
}
copyFile('DefaultTemplate.html', '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onGoProject() {\n\t\n\tselectedProjectName = getSelected(projectSelect);\n\n\tif (!selectedProjectName)\n\t\talert('No project selected');\n\telse\n\t\twindow.location.assign(\"project.html?projectname=\" + selectedProjectName + \"×tamp=\" + Date.now());\t\n\t\n}",
"function templateChanged(selecte... | [
"0.6032563",
"0.6001773",
"0.59834844",
"0.5888642",
"0.5772936",
"0.5770488",
"0.57459706",
"0.5707612",
"0.5673704",
"0.5659481",
"0.5602853",
"0.559596",
"0.55920666",
"0.5489915",
"0.544831",
"0.54478616",
"0.54473394",
"0.54219633",
"0.5415068",
"0.54000086",
"0.5394099"... | 0.74331355 | 0 |
Hide the error message div | function hideError() {
$( "div#errorMessage" ).css('display', 'none');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideError() {\n error.hide();\n }",
"function _hideMessages(){\n $(errorClassContainer).hide(); \n }",
"function hideErrors() {\n $('errors').style.display = 'none';\n}",
"function hideErrors(){\n $('#com-name-error').css('display','none');\n $('#com-email-error').css('display','... | [
"0.8238875",
"0.8194412",
"0.80416137",
"0.7970067",
"0.7965281",
"0.79433596",
"0.7854959",
"0.7781862",
"0.77682924",
"0.77629405",
"0.7757531",
"0.7674684",
"0.7640328",
"0.76148176",
"0.7573902",
"0.7505848",
"0.75056946",
"0.7410692",
"0.74071085",
"0.7384872",
"0.737836... | 0.85702467 | 0 |
Display the list of Pages for the current Project with a button next to each to allow the user to select to open the page for editing. | function showPages() {
var pages = getPages();
var formHTML = "<ul>";
for (var i = 0; i < pages.length; i++)
{
formHTML = formHTML + '<li id="li_' + i +'">' + pages[i].title + ' <button id="bt_' + i + '" onclick="selectPage(' + i + ')">Edit</button></li>';
}
formHTML = formHTML + "</ul>";
$( "div#pagesList" )... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _viewProjectList() {\n const userProjects = todo.returnAll().slice(1);\n _renderPanel(projectPanel, renderList, userProjects);\n }",
"render (options = {}) {\n Page.list(options, (e, response) => {\n if (e === null && response) {\n this.renderProjects(response);\n ... | [
"0.67250353",
"0.62840044",
"0.6013476",
"0.5935113",
"0.5912639",
"0.58448744",
"0.582383",
"0.57786065",
"0.57673377",
"0.5734469",
"0.5712202",
"0.56787413",
"0.5651059",
"0.5636749",
"0.56299",
"0.56214505",
"0.56207013",
"0.5615102",
"0.56053394",
"0.55983275",
"0.559653... | 0.77545786 | 0 |
Display the list of Templates for the current Project. | function showTemplates() {
var templates = getTemplates();
var formHTML = "<ul>";
for (var i = 0; i < templates.length; i++)
{
formHTML = formHTML + '<li>' + templates[i].title + '</li>';
}
formHTML = formHTML + "</ul>";
$( "div#templatesList" ).html(formHTML);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadTemplates() {\n plugin.loadTemplates(self.settings().templates, true);\n }",
"function getTemplates() {\n return NuclioFunctionsDataService.getTemplates()\n .then(function (templates) {\n lodash.forIn(templates, function (value) {\n ... | [
"0.65689945",
"0.6517958",
"0.6470231",
"0.6372164",
"0.63681483",
"0.635468",
"0.634882",
"0.6282617",
"0.6176972",
"0.61682016",
"0.6136234",
"0.59955585",
"0.59579885",
"0.592066",
"0.5910821",
"0.5879709",
"0.58538",
"0.5824241",
"0.5780776",
"0.57174426",
"0.5712325",
... | 0.76152945 | 0 |
Display the list of Tiles for the current Project. | function showTiles() {
var tiles = getTiles();
var formHTML = "<ul>";
for (var i = 0; i < tiles.length; i++)
{
formHTML = formHTML + '<li>' + tiles[i].title + '</li>';
}
formHTML = formHTML + "</ul>";
$( "div#tilesList" ).html(formHTML);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Tiles(){\n \n }",
"function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}",
"getTiles() {\n return this._tiles;\n }",
"function generateTiles(){\n\n gridItems.splice(4,0,human);\n \n for(let item in gridItems){\n\n ... | [
"0.66693866",
"0.6191377",
"0.6156313",
"0.60692835",
"0.6048926",
"0.6005216",
"0.5903106",
"0.58780706",
"0.5841147",
"0.58378136",
"0.5835813",
"0.58191854",
"0.58090013",
"0.5774988",
"0.57713795",
"0.57463557",
"0.57359606",
"0.57179064",
"0.5701034",
"0.5700963",
"0.565... | 0.713198 | 0 |
remove tacos from group when collected or off world bounds | removeFromGroup(taco) {
this.tacos.remove(taco);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeAllGSighting(){\n \tremoveAllObjectMarker(SIGHTING);\n }",
"function removeOutOfBoundObj() {\n gameState.enemies.getChildren().forEach(enemy => {\n if (enemy.x > config.width + HALF_OBJ_PIXEL || enemy.x < -HALF_OBJ_PIXEL) {\n gameState.enemies.remove(enemy);\n }\n... | [
"0.6255462",
"0.61932296",
"0.609443",
"0.60242",
"0.5991895",
"0.5927983",
"0.5909376",
"0.59002405",
"0.5893578",
"0.58791345",
"0.5871592",
"0.5798537",
"0.57823277",
"0.5735109",
"0.5724794",
"0.57124895",
"0.5702811",
"0.56831443",
"0.5673988",
"0.5655363",
"0.56352615",... | 0.67239225 | 0 |
Move taco animation for taco hurricane | move(taco) {
if (taco.y === 100) {
this.game.add
.tween(taco)
.to({ y: "+300" }, 2000, Phaser.Easing.Linear.None, true);
} else if (taco.y === 400) {
this.game.add
.tween(taco)
.to({ y: "-500" }, 2000, Phaser.Easing.Linear.None, true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"animate(t) {\n if (this.origTile === this.destTile) {\n this.destTile.getPiece().startAnimation(this, this.removeAnimation, t, \"move\")\n } else {\n this.origTile.getPiece().startAnimation(this, this.moveAnimation, t + 0.2 / this.gameboard.orchestrator.moveSpeed, \"move\")\n ... | [
"0.6414418",
"0.63440406",
"0.63438326",
"0.6325128",
"0.6264927",
"0.6264927",
"0.6263514",
"0.6238182",
"0.622782",
"0.62273914",
"0.6195551",
"0.61361176",
"0.6105162",
"0.6093803",
"0.60810935",
"0.6064742",
"0.6036149",
"0.6026972",
"0.60048974",
"0.5979974",
"0.5979788"... | 0.6864644 | 0 |
collects and counts tacos, removes from group | collectTaco(guy, taco) {
//removes taco
taco.kill();
this.removeFromGroup(taco);
// Add and update the score
this.score += 1;
this.scoreText.text = "tacos collected: " + this.score + "/10";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeFromGroup(taco) {\n this.tacos.remove(taco);\n }",
"function counttroups(i){\n\tvar j;\n\tfor (var j in Territori){\n\t\tif (Territori[j].jugador==Jugador[\"jugador\"+i]){\n\t\t\tReinforce[j]=Number(Territori[j].tropes);\n\t\t}\n\t}\n\tReinforce.troup=0;\n\tcardtroups(i);\n}",
"function deleteTT() {\... | [
"0.62928957",
"0.550098",
"0.524224",
"0.50974715",
"0.509097",
"0.5043834",
"0.4972384",
"0.49221542",
"0.49209705",
"0.4916949",
"0.49149787",
"0.4889658",
"0.48752007",
"0.48444232",
"0.48391613",
"0.48206788",
"0.4797435",
"0.47852546",
"0.47821465",
"0.47701013",
"0.4764... | 0.649177 | 0 |
Comments : IAPWS Thermal conductivity of ordinary water substances 2011 | function thermal_conductivity(T, ρ) {
var T_hat = T / 647.096, ρ_hat = ρ / 322, k0_L = [2.443221E-3, 1.323095E-2, 6.770357E-3, -3.454586E-3, 4.096266E-4], k0 = 0;
for (var i = 0; i < 5; i++) {
k0 += k0_L[i] / Math.pow(T_hat, i);
}
k0 = Math.sqrt(T_hat) / k0;
var k1 = 0, k1_L = [1.60397357, -... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Deff(){\n return 5*(this.wt()*this.Sj/(12*12))*Math.pow(this.Lj,4)*Math.pow(12,4)/(384*29000000*this.Ieff())\n }",
"wu_nc(){\n return (1.2*this.DL + 1.6*this.CL)*(this.Sj/12)\n }",
"wu_c(){\n return (1.2*(this.DL+this.SDL) + 1.6*this.LL)*(this.Sj/12)\n }",
"function effWalW(hole... | [
"0.58215547",
"0.5636222",
"0.5617478",
"0.55430686",
"0.55158955",
"0.5479518",
"0.5431217",
"0.542841",
"0.5356578",
"0.5340162",
"0.5319471",
"0.53032184",
"0.5241868",
"0.52365357",
"0.52365357",
"0.52053314",
"0.51846224",
"0.51843643",
"0.51834023",
"0.5179701",
"0.5167... | 0.6018316 | 0 |
Since `workbench.action.splitEditor` command does await properly Notebook editor/document events are not guaranteed to be sent to the ext host when promise resolves The workaround here is waiting for the first visible notebook editor change event. | async function splitEditor() {
const once = getEventOncePromise(vscode.window.onDidChangeVisibleNotebookEditors);
await vscode.commands.executeCommand('workbench.action.splitEditor');
await once;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onEditorChange() {\n // If the handler is in standby mode, bail.\n if (this._standby) {\n return;\n }\n const editor = this.editor;\n if (!editor) {\n return;\n }\n const text = editor.model.value.text;\n const position = editor.getCurso... | [
"0.60444206",
"0.6033384",
"0.60305136",
"0.5729907",
"0.55549026",
"0.54215926",
"0.5409754",
"0.53749377",
"0.534147",
"0.5288445",
"0.5273965",
"0.5255825",
"0.52376854",
"0.5221918",
"0.52192885",
"0.5214232",
"0.5193468",
"0.51632136",
"0.51632136",
"0.51519316",
"0.5151... | 0.8135437 | 0 |
TOOLS / Extract int24 number from a buffer | function int24(raw, start) {
return (raw[start] << 8*2) + (raw[start+1] << 8) + raw[start+2];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extractInteger(buf, bufPos) {\n var x = buf[bufPos + 0] & 0xff;\n x <<= 8;\n x |= buf[bufPos + 1] & 0xff;\n x <<= 8;\n x |= buf[bufPos + 2] & 0xff;\n x <<= 8;\n x |= buf[bufPos + 3] & 0xff;\n return x;\n }",
"function extractInteger(buf, bufPos)... | [
"0.70015645",
"0.70015645",
"0.6938799",
"0.63611597",
"0.6191754",
"0.6191754",
"0.6191754",
"0.6191754",
"0.6127205",
"0.6032243",
"0.5947536",
"0.5924512",
"0.5887897",
"0.58736634",
"0.58736634",
"0.5860273",
"0.5806084",
"0.5806084",
"0.57973486",
"0.579348",
"0.579348",... | 0.72878087 | 0 |
TODO: Write an if statement that alerts "It's snowing!" if weather is equal to "snowing", else alert "Check back later for more details!" | function weatherForcast(weather){
if(weather == "snowing"){
alert("It's snowing!")
}else{
alert("Check back later for more details!")
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkForSnow(weather){\n if(weather === \"snowing\"){\n return(\"It's snowing\");\n }else{\n return(\"Check back later for updates\");\n }\n}",
"function choosyWeather(weatherString){\n if(weather == \"snowing\"){\n return \"It's snowing!\"\n }else if(weather == \"rai... | [
"0.8297829",
"0.74303365",
"0.74007255",
"0.72178525",
"0.69203705",
"0.67385733",
"0.67245966",
"0.67082393",
"0.64815396",
"0.64389026",
"0.6438208",
"0.6397656",
"0.6381838",
"0.6337729",
"0.63242114",
"0.63181883",
"0.6297238",
"0.6290521",
"0.6283441",
"0.6266299",
"0.62... | 0.86421216 | 0 |
TODO: Write an if statement that alerts true if numberInput is greater than 10, else alert "the number is less than 10" | function biggerThan10(num){
if(num>10){
alert(true)
}else{
alert("the number is less than 10")
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkNumber (input) {\n\t\tif (input <= 100 && input >= 1) {\n\t\t\tfizzbuzz();\n\t\t} else if (isNaN(input)) {\n\t\t\tprompt('You did not enter a number. Please enter a number between 1 and 100');\n\t\t} else {\n\t\t\tprompt('Your number (' + input + ') is not between 1 and 100. Please enter a number bet... | [
"0.7001619",
"0.69911623",
"0.69528955",
"0.68975174",
"0.6875412",
"0.67612",
"0.67171156",
"0.66576695",
"0.66169894",
"0.65761906",
"0.6464555",
"0.6436425",
"0.64256734",
"0.63840365",
"0.6370047",
"0.63669926",
"0.6360553",
"0.6343101",
"0.63325465",
"0.6311422",
"0.6305... | 0.7642027 | 0 |
================ NESTED STATEMENTS =============== TODO Together: If user is under 15, they are not eligible for a learners permit, else they are. If they are eligible, check age. If they are 15 they are eligible for a learners permit, if they are 16 or older and have a permit, they are eligible for license, if they ar... | function canDrive(age, permit){
if(age<15){
alert("You are ineligible for a license")
}else{
if(age ==15){
alert("You can get a permit")
}else if(age>16){
if(permit == false){
alert("You are not eligible for a linces")
}else{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function basicEligibility (user) {\n let unSubbed = user.contactMeta.unSubbed\n let createdInMs = new Date(user.createdAt).getTime()\n let weekInMs = 7 * 24 * 60 * 60 * 1000\n let tooSoon = createdInMs + weekInMs > Date.now()\n\n // if user has unSubbed or it's too soon, user is not eligible\n return !((unSu... | [
"0.64345884",
"0.64008784",
"0.6332788",
"0.6255381",
"0.6236765",
"0.6132061",
"0.61272466",
"0.60844904",
"0.60128844",
"0.59960437",
"0.59755206",
"0.59755206",
"0.59590006",
"0.59530085",
"0.5952217",
"0.5951615",
"0.5949662",
"0.59325916",
"0.59273255",
"0.58942544",
"0.... | 0.70465237 | 0 |
cannot just pass props.onChange() because we need to apply a value to it. So use an anonymous fcn to call props.onChange() with appropriate argument. Add onClick() in because score changes, so parent component will know Counter has changed in some way. | function Counter(props) {
return (
<div className="counter">
<button className="counter-action decrement" onClick={() => {props.onChange(-1)}} > - </button>
<div className="counter-score"> {props.score} </div>
<button className="counter-action increment" onClick={() => {props.onChange(1)}} > + <... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Counter(props) {\r\n return (\r\n <div className=\"counter\">\r\n <button\r\n className=\"counter-action decrement\"\r\n onClick={function() {\r\n props.onChange(props.score > 0 ? -1 : 0);\r\n }}\r\n >\r\n {\" \"}\r\n -{\" \"}\r\n </button>\r\... | [
"0.7688962",
"0.6906934",
"0.645741",
"0.6306355",
"0.6266607",
"0.6253338",
"0.6207408",
"0.61310345",
"0.6109435",
"0.6088051",
"0.6081485",
"0.6027538",
"0.6016813",
"0.59781986",
"0.5969336",
"0.594343",
"0.5912811",
"0.5906147",
"0.59048563",
"0.58958983",
"0.5881939",
... | 0.7623917 | 1 |
Sets contract and ABI of this account | setContract(contract) {
return this.blockchain.setContract(this.accountName, contract);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupContract(address) {\n if(!abis) {\n window.alert(\"ABI data not loaded\");\n return;\n }\n\n // Load contract ABI data\n var EInvoicingRegistry = web3.eth.contract(abis.EInvoicingRegistry.abi);\n\n // Instiate proxy object\n contract = E... | [
"0.6645107",
"0.5908933",
"0.5897514",
"0.58719933",
"0.57873416",
"0.57513285",
"0.56345177",
"0.56297964",
"0.56129175",
"0.5592269",
"0.5589618",
"0.55419654",
"0.55084866",
"0.53336",
"0.52960366",
"0.52342206",
"0.5217805",
"0.52074265",
"0.518001",
"0.51723355",
"0.5172... | 0.63991183 | 1 |
Gets the table rows of the specified table, keyed by scopes | getTableRowsScoped(tableName) {
return this.blockchain.getTableRowsScoped(this.accountName, tableName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAllRows() {\r\n\t\t// The table needs to be loaded before we attempt to access the rows.\r\n\t\t// We could just return an empty Map here, but throwing an error highlights the mistake.\r\n\t\tif (!this.isLoaded)\r\n\t\t\tthrow new Error('Attempted to read a data table rows before table was loaded.');\r\n\r\n\t\... | [
"0.5729941",
"0.5710928",
"0.54713917",
"0.54597116",
"0.54333866",
"0.53035617",
"0.52902913",
"0.5249361",
"0.523213",
"0.52026737",
"0.5176041",
"0.5171242",
"0.5136443",
"0.51039565",
"0.5102389",
"0.50705177",
"0.5063696",
"0.5063696",
"0.50234646",
"0.5002541",
"0.49954... | 0.6992064 | 0 |
Deletes this account's table data. The table names to delete can be passed as arguments. If no arguments are passed, deletes all table data of this account. | resetTables(...tableNames) {
return this.blockchain.resetTables(this.accountName, ...tableNames);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eliminarTablas(tx){\n\ttx.executeSql('DROP TABLE IF EXISTS Usuario');\n\ttx.executeSql('DROP TABLE IF EXISTS Historial');\n}",
"function deleteAllRows( tx, tableName ) {\n debug && console.log( \"MobileDb.deleteAllRows: Deleting all rows from table: \" + tableName );\n executeSql( 'DELETE... | [
"0.6096613",
"0.5828216",
"0.58168316",
"0.581614",
"0.56563014",
"0.5582224",
"0.5550331",
"0.55090016",
"0.5506656",
"0.5502945",
"0.5422984",
"0.54129547",
"0.5335847",
"0.53133905",
"0.53081876",
"0.52615213",
"0.5205817",
"0.51538664",
"0.5130325",
"0.5116082",
"0.510697... | 0.5858659 | 1 |
Loads initial contract data defined for the currently deployed contract. If no arguments are defined, it loads the data from the JSON fixture files. If tableName and fixtureScopeRowsMap are defined, it will only load the table data given by the fixtureScopeRowsMap argument | loadFixtures(tableName, fixtureScopeRowsMap) {
return this.blockchain.loadFixtures(this.accountName, tableName, fixtureScopeRowsMap);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadData(applicationName) {\n console.log(\"Loading \" + applicationName + \" options, mappings and tabs...\")\n\n var promises = [\"options\", \"mappings\", \"tabs\"].map(function(objectName) {\n return requestJSON(applicationName, objectName);\n });\n\n $q.all(promises).then(... | [
"0.54581",
"0.5351429",
"0.52211314",
"0.52137464",
"0.51743096",
"0.5067345",
"0.50235033",
"0.49020013",
"0.49002922",
"0.48940018",
"0.4889045",
"0.48852858",
"0.4870936",
"0.4858186",
"0.48522058",
"0.47917056",
"0.47870803",
"0.47835287",
"0.47818",
"0.47782597",
"0.4775... | 0.6749679 | 0 |
This function processes a ripgrep submatch to create the correct range. This is mostly needed for multiline results, since the range will have different start and end rows and we need to calculate these based on the lines that ripgrep returns. | function processSubmatch(submatch, lineText, offsetRow) {
const lineParts = lineText.split('\n');
const start = getPositionFromColumn(lineParts, submatch.start);
const end = getPositionFromColumn(lineParts, submatch.end);
// Make sure that the lineText string only contains lines that are
// relevant to this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"prevMatchInRange(state, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* ChunkSize */ - this.spec.unquoted.length);\n let cursor = stringCursor(this.spec, state, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n ... | [
"0.5964057",
"0.58694255",
"0.5589918",
"0.5475327",
"0.5437284",
"0.54146284",
"0.5292978",
"0.52874684",
"0.5233166",
"0.5106183",
"0.5103431",
"0.5064616",
"0.5036967",
"0.50120074",
"0.49957877",
"0.4956019",
"0.49510783",
"0.49505332",
"0.49298534",
"0.49143377",
"0.4877... | 0.6271829 | 0 |
We need to prepare the "globs" that we receive from the user to make their behaviour more userfriendly (e.g when adding `src/` the user probably means `src//`). This helper function takes care of that. | prepareGlobs(globs, projectRootPath) {
const output = [];
for (let pattern of globs) {
// we need to replace path separators by slashes since globs should
// always use always slashes as path separators.
pattern = pattern.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
if (pattern.leng... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalizeGlob(glob, _a) {\n var _b = (_a === void 0 ? {} : _a).globstar, globstar = _b === void 0 ? false : _b;\n if (glob.match(/\\0/g)) {\n throw new Error(\"Glob contains invalid characters: \\\"\" + glob + \"\\\"\");\n }\n if (!globstar) {\n return nor... | [
"0.68307453",
"0.6289471",
"0.6215168",
"0.61986595",
"0.61986595",
"0.61986595",
"0.61986595",
"0.61986595",
"0.61986595",
"0.6104956",
"0.60789645",
"0.59969705",
"0.59846795",
"0.58784884",
"0.58743244",
"0.58733004",
"0.5856829",
"0.5856829",
"0.5856829",
"0.5856829",
"0.... | 0.7225912 | 0 |
Checks of startDay and endDay follows calendar sequence. else throws error. | validateStartToEndDay(startDay, endDay) {
if (startDay > endDay)
throw Error("startDay must come before endDay following normal calendar sequence.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateDateRange(sMonth,sDay,sYear,eMonth,eDay,eYear,what){\r\n\t// validate date range 1 \r\n\t// make sure month is there\r\n\tvar sM = document.getElementById(sMonth);\t\t\r\n\tif(sM.value == \"\") {\r\n\t\talert(\"A starting month must be selected for \" + what + \".\");\r\n\t\tsM.focus();\r\n\t\tret... | [
"0.6565624",
"0.64928156",
"0.6414712",
"0.6274362",
"0.60714567",
"0.60016775",
"0.5980619",
"0.5954241",
"0.5935912",
"0.58888155",
"0.58417004",
"0.58304745",
"0.58207273",
"0.581318",
"0.58089656",
"0.58089656",
"0.58089656",
"0.58089656",
"0.5794568",
"0.5794568",
"0.577... | 0.82750934 | 0 |
asume that node and liked lists occurs let c1 = ll1.head; let c2 ll2.head; let ll1t = c1.next; let ll2t= c2.next; | function mergeLinkedLists() {
while (ll1t && llt2) {
c1.next = c2;
c2.next = ll1t;
c1 = ll1t;
c2 = ll2t;
ll1t = c1.next;
ll2t = c2.next;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mergeLists(head1, head2) {\n let node1 = head1;\n let node2 = head2;\n\n while (node1 && node2) {\n if (node1.value < node2.value) {\n if (node1.next) {\n if (node1.next.value > node2.value) {\n const temp0 = node1.next;\n node1.next = new Node(node2.value);\n ... | [
"0.6816404",
"0.6651812",
"0.6484453",
"0.64173526",
"0.63542366",
"0.63270545",
"0.62996775",
"0.6253741",
"0.6214152",
"0.6208442",
"0.61478674",
"0.61060375",
"0.6104064",
"0.6088266",
"0.6079337",
"0.6065334",
"0.6023501",
"0.59868383",
"0.59716326",
"0.59668875",
"0.5959... | 0.7001586 | 0 |
Test that it runs the init script. | function initScript() {
puerf.init({
mockFolder: mockFolderPath,
templateFolder: templateFolderPath
}, function() {
fs.stat(mockFolderPath, function(err, stat) {
t.ok(stat, 'init script created files');
testp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static initialize() {\n\t\tconsole.log(whereami() + \" script initializing\");\n\n\t}",
"function runStart()/* : void*/\n {\n this.setUp();\n }",
"function _testInit() {\n return ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP_NAME} -s \"${DEVICE_GROUP_DESCR}\" -p $... | [
"0.6642129",
"0.6621367",
"0.65926665",
"0.6580709",
"0.65768325",
"0.6573383",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.65624464",
"0.64611524",
"0.64469105",
"0.6387805",
"0.63733923",
"... | 0.7401508 | 0 |
Write a JavaScript function to compute the value of bn where n is the exponent and b is the bases. Accept b and n from the user and display the result. | function exponenet(n , b){
if (typeof n !== "number" || typeof b !== "number"){
return TypeError("Enter a number for both n and b")
} else {
return Math.pow(n, b)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getValueInBase(n,b){\n let rv=0;\n let pow=1;\n while(n > 0){\n let rem= n % b;\n rv = rv +(rem*pow);\n pow= pow * 10;\n n= n / b;\n }\n return rv;\n }",
"function base(b){\n return function(n){\n var result = 1\n for(var i = 0; i< b;i++){\n result ... | [
"0.77067345",
"0.74240464",
"0.73257536",
"0.7293689",
"0.72144014",
"0.7112765",
"0.6769974",
"0.6717539",
"0.66576004",
"0.6617618",
"0.6573803",
"0.6573628",
"0.65459424",
"0.6493347",
"0.6422224",
"0.6416376",
"0.6416376",
"0.6416376",
"0.6416376",
"0.6410674",
"0.6391252... | 0.7789091 | 0 |
Return y coordinate of point at location x | getYAt(x) {
return this.a * x + this.b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function determinePosition(x, y) {\n return new Point(x, y);\n}",
"function getLocation(x, y) {\n return {\n x: (x - canvas.getBoundingClientRect().left) > 0 ? (x - canvas.getBoundingClientRect().left) : 0,\n y: (y - canvas.getBoundingClientRect().top) > 0 ? (y - canvas.getBoundingClientRect().... | [
"0.71981084",
"0.70293033",
"0.690994",
"0.6899886",
"0.68840015",
"0.6875827",
"0.68192315",
"0.6784581",
"0.67447704",
"0.6712712",
"0.66985464",
"0.6694625",
"0.667822",
"0.65737",
"0.6568477",
"0.65544605",
"0.6554127",
"0.65497494",
"0.6548624",
"0.65478987",
"0.65394187... | 0.78065574 | 0 |
Display the line between original end and last points | display() {
line(this.start.x, this.start.y, this.end.x, this.end.y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw_first_line(){\n points.push(start);\n points.push(end);\n}",
"updateLastLine(line) { // this is used when drawing with the pen\r\n if (line.length < 2) return;\r\n var point1 = line.points[line.points.length - 1];\r\n var point2 = line.points[line.points.length - 2];\r\n ... | [
"0.7319256",
"0.7218509",
"0.6986056",
"0.6776664",
"0.6746633",
"0.6627865",
"0.65931773",
"0.64749277",
"0.64402616",
"0.64402616",
"0.64402616",
"0.64402616",
"0.64402616",
"0.6422656",
"0.6422656",
"0.6422656",
"0.6422656",
"0.6422656",
"0.64203084",
"0.64203084",
"0.6420... | 0.7387921 | 0 |
Display the vertical line between yMin and yMax | display(yMin, yMax) {
line(this.x, yMin, this.x, yMax);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillYAxis(minVal, maxVal, params) {\n var minLine = 0;\n var maxLine;\n if (params.autofit && !params.stacked) {\n // calculate autofit values\n minLine = Math.max(0, minVal - Math.ceil((maxVal - minVal) / 5));\n maxLine = maxVal + Math.ceil((maxVal - ... | [
"0.6579007",
"0.6466724",
"0.6407114",
"0.63360894",
"0.6295797",
"0.6259269",
"0.61957663",
"0.60419184",
"0.60164404",
"0.5997914",
"0.5995882",
"0.59692425",
"0.59226096",
"0.59152305",
"0.5909722",
"0.5905556",
"0.5903723",
"0.5896883",
"0.5889169",
"0.5879851",
"0.584876... | 0.8245753 | 0 |
Return the geometric middle point between two points | function getMiddlePoint(p1, p2) {
return createVector((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"midPoint(p1, p2) {\n return [(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2];\n }",
"function midpoint(P1, P2) {\n var x1 = P1[0];\n var y1 = P1[1];\n var x2 = P2[0];\n var y2 = P2[1];\n var result = [(x1 + x2)*0.5, (y1 + y2)*0.5];\n return result;\n}",
"function midXYBetweenTwoPoints(p1, p2) {... | [
"0.7666593",
"0.763843",
"0.7509905",
"0.7487029",
"0.74378276",
"0.7329553",
"0.7285146",
"0.7108893",
"0.70664257",
"0.6862229",
"0.6619186",
"0.6614679",
"0.6608776",
"0.655867",
"0.636137",
"0.6345827",
"0.6230285",
"0.6201691",
"0.6179173",
"0.61370814",
"0.6104577",
"... | 0.83476293 | 0 |
This function takes care of adding functionality to the "easy" and "hard" buttons on the website | function setButtons(){
easy.addEventListener("click", function(){
easy.classList.toggle("selected");
hard.classList.toggle("selected");
setColors(3);
mode = "easy"
});
hard.addEventListener("click", function(){
easy.classList.toggle("selected");
hard.classList.toggle("selected");
setColors(6);
mode ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableSteps() {\n $(\"#plusButtons\").css(\"opacity\",1);\n $(\"#plusSwish\").css(\"opacity\",1);\n $(\"#step2\").css(\"opacity\",1);\n $(\"#step3\").css(\"opacity\",1);\n $(\"#plusButtons span.button\").css(\"cursor\",\"pointer\");\n $(\"swish-QR\").removeAttr(\"src\");\n}",
"function... | [
"0.65348995",
"0.6522871",
"0.6445128",
"0.6426664",
"0.6390048",
"0.63692796",
"0.6334409",
"0.6272226",
"0.62408143",
"0.6230863",
"0.622864",
"0.6217107",
"0.61954314",
"0.6181244",
"0.6150092",
"0.61316663",
"0.6099156",
"0.6089175",
"0.60712314",
"0.6060451",
"0.60561407... | 0.6578693 | 0 |
Whenever the user guesses the right color, all the squares and the header background get the same color as the right answer's color | function rightAnswer(){
for(var i = 0; i<squares.length; i++){
squares[i].style.background = colorToGuess;
}
h1.style.background = colorToGuess;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function match() {\n for (let i = 0; i < numSquares; i++)\n squares[i].style.backgroundColor = targetColor;\n header.style.backgroundColor = targetColor;\n msg.textContent = \"Correct!\";\n newColorsBtn.textContent = \"Play again?\";\n}",
"function win(colorIn){\n for(var i = 0; i < colorSquares.length; ... | [
"0.76754373",
"0.759582",
"0.75414747",
"0.7392768",
"0.73548657",
"0.7266402",
"0.72427136",
"0.7162188",
"0.714797",
"0.713578",
"0.71135694",
"0.7053381",
"0.7004963",
"0.7001611",
"0.6995605",
"0.69779915",
"0.6974401",
"0.6969074",
"0.6960279",
"0.69462436",
"0.6936744",... | 0.7903101 | 0 |
Renders events to the DOM based on whether they are 'upcoming' or 'past' (stored in timing arg) | function renderEvents(timing) {
//Get today's date
let dateNow = new Date();
let eventList = events.map( (event,i) => {
//Get the date of the event...
let eventDate = new Date(event.date)
//...and only render if it meets requirements
if ( (eventDate<dateNow && timing==='past') || (ev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateEventText(timeOfDay, thisDate) {\n\n var eventID = timeOfDay + \"-\" + thisDate.format(\"YYYYMMDD\");\n // If retrieveEvent does not return false, assign its value to storedEvent and the do the following\n if (storedEvent = retrieveEvent(eventID)) {\n $(\"#\" + eventID).val(storedE... | [
"0.59355843",
"0.55365044",
"0.5517299",
"0.5510464",
"0.5494375",
"0.5471312",
"0.5456934",
"0.5361324",
"0.5302385",
"0.5289142",
"0.5278204",
"0.5256179",
"0.52511793",
"0.52452755",
"0.5220002",
"0.51814777",
"0.5150219",
"0.51204884",
"0.51198184",
"0.5104667",
"0.508931... | 0.61918205 | 0 |
Order list by distance | function orderByDistance() {
document.getElementById("list").innerHTML = "";
markers.sort(function(a, b){return b.distance - a.distance});
orderList();
clickList(markers[markers.length - 1].item);
scroll(markers[markers.length - 1].item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByDistance(distance){\n distance.sort(function(trainpointA, trainpointB){\n return trainpointA.distance - trainpointB.distance;\n });\n return distance;\n }",
"function sortByDistDM(a, b) {\n return (a.distance.value - b.distance.value)\n}",
"function SortNodesB... | [
"0.7208632",
"0.6947439",
"0.67876107",
"0.66520137",
"0.6558314",
"0.6555032",
"0.6513147",
"0.6416424",
"0.62982136",
"0.62982136",
"0.6295493",
"0.62774134",
"0.62774134",
"0.62774134",
"0.62734926",
"0.6153775",
"0.61132145",
"0.6100632",
"0.6002924",
"0.5949884",
"0.5897... | 0.7652706 | 0 |
Order list by libraries | function orderByLibraries() {
document.getElementById("list").innerHTML = "";
markers.sort(function(a, b){return a.libraries - b.libraries});
orderList();
clickList(markers[markers.length - 1].item);
scroll(markers[markers.length - 1].item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function packageSort(packages) {\r\n // packages = ['polyfills', 'vendor', 'app']\r\n const len = packages.length - 1;\r\n const first = packages[0];\r\n const last = packages[len];\r\n return function sort(a, b) {\r\n // polyfills always first\r\n if (a.names[0] === first) {\r\n return -1;\r\n ... | [
"0.6280011",
"0.6107415",
"0.58934605",
"0.5833995",
"0.56613153",
"0.56452763",
"0.5611515",
"0.56071484",
"0.55176985",
"0.5504676",
"0.5502654",
"0.54903597",
"0.5471959",
"0.5443877",
"0.54386187",
"0.5437041",
"0.5432181",
"0.5420739",
"0.5413591",
"0.5394727",
"0.539418... | 0.7217355 | 0 |
Order list by security | function orderBySecurity() {
document.getElementById("list").innerHTML = "";
markers.sort(function(a, b){return a.security - b.security});
orderList();
clickList(markers[markers.length - 1].item);
scroll(markers[markers.length - 1].item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortList(method, list, cb) {\n\tlist.forEach(function(v, i) {\n\t\tconsole.log('ENTITIES: ', v.entities)\n\t\tconsole.log('USER ENTITIES: ', v.user.entities)\n\t});\n\treturn cb(null, list);\n}",
"function sortUsersList() {\n let i, users, shouldSwitch;\n let list = document.getElementById(\"users... | [
"0.59962624",
"0.58936554",
"0.573622",
"0.5711251",
"0.56593025",
"0.5649729",
"0.5637",
"0.56225646",
"0.5618218",
"0.5618218",
"0.55992585",
"0.5595742",
"0.55867434",
"0.55778766",
"0.5554961",
"0.5530935",
"0.5527692",
"0.55122",
"0.550986",
"0.5489661",
"0.54844576",
... | 0.74753004 | 0 |
Find this extension's directory relative to the brackets root | function _extensionDirForBrowser() {
var bracketsIndex = window.location.pathname;
var bracketsDir = bracketsIndex.substr(0, bracketsIndex.lastIndexOf('/') + 1);
var extensionDir = bracketsDir + require.toUrl('./');
return extensionDir;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _getLocateDirectory() {\n\t\treturn OS.Path.join(Zotero.DataDirectory.dir, LOCATE_DIR_NAME);\n\t}",
"getCurrentDirectory(fileName, insertedPath) {\r\n var currentDir = path.parse(fileName).dir || '/';\r\n var workspacePath = vs.workspace.rootPath;\r\n // based on the project root\r\... | [
"0.6325137",
"0.62066483",
"0.60200095",
"0.5925445",
"0.5913836",
"0.58427024",
"0.58048314",
"0.578581",
"0.5780837",
"0.5757538",
"0.5729203",
"0.5727674",
"0.5709309",
"0.5699919",
"0.56655514",
"0.56595457",
"0.5648898",
"0.5600966",
"0.5593784",
"0.55807793",
"0.5580705... | 0.6912627 | 0 |
Loads a less file as CSS into the document | function _loadLessFile(file, dir) {
// Load the Less code
$.get(dir + file, function (code) {
// Parse it
var parser = new less.Parser({ filename: file, paths: [dir] });
parser.parse(code, function onParse(err, tree) {
console.assert(!err, err);
// Convert it to CSS and append that to the document ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _loadStyles() {\n var request = new XMLHttpRequest();\n request.open(\"GET\", \"LiveDevelopment/main.less\", true);\n request.onload = function onLoad(event) {\n var parser = new less.Parser();\n parser.parse(request.responseText, function onParse(err, tree) {\n ... | [
"0.7961053",
"0.7147661",
"0.6678807",
"0.6673834",
"0.6606411",
"0.66063374",
"0.6571635",
"0.63578624",
"0.62247837",
"0.618014",
"0.61740476",
"0.6121625",
"0.6118424",
"0.60998845",
"0.6068959",
"0.60597444",
"0.603635",
"0.6029404",
"0.6026527",
"0.60224164",
"0.59944427... | 0.76014477 | 1 |
Sets a line class and removes it after a delay | function setTemporaryLineClass(editor, line, klass, delay) {
// Make sure no other line class or previous trace class is in the way
// Might also happen when the same tracepoint is hit twice quickly
editor._codeMirror.setLineClass(line);
// Set the trace class. This triggers an animation in CSS since the <pre> ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre... | [
"0.62961596",
"0.6277942",
"0.6260513",
"0.6248695",
"0.6248695",
"0.6248695",
"0.6248695",
"0.6248695",
"0.6248695",
"0.6248695",
"0.6248695",
"0.6243501",
"0.62393683",
"0.62393683",
"0.62393683",
"0.6219283",
"0.6210775",
"0.6210775",
"0.6210775",
"0.6210775",
"0.6210775",... | 0.8096053 | 0 |
Direct the user to log in page of Instagram. | login() {
// At "Manage Clients" https://www.instagram.com/developer/clients/manage/
// Edit -> Security -> Turn off "Disable implicit OAuth"
//
let redirectUri = encodeURIComponent(location.href);
let url = `https://api.instagram.com/oauth/authorize/?client_id=${CLIENT_ID}&redirect_uri=${redirectUri}&respon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"navigate() {\n const CLIENTID = \"6edfa56b44354df2a6aa6d94c1646881\";\n const REDIRECTURI = \"http://localhost:3000/\";\n\n const url =\n \"https://api.instagram.com/oauth/authorize/?client_id=\" +\n CLIENTID +\n \"&redirect_uri=\" +\n REDIRECTURI +\n \"&response_type=token\";\n\n... | [
"0.7057003",
"0.6216904",
"0.6200342",
"0.61870384",
"0.6126864",
"0.6116824",
"0.6095553",
"0.6009978",
"0.5933927",
"0.5930426",
"0.5852748",
"0.58375686",
"0.5813102",
"0.5811668",
"0.58063865",
"0.5777292",
"0.5760441",
"0.5752017",
"0.5750695",
"0.57489854",
"0.57454693"... | 0.738667 | 0 |
Get user's recent photos and show them. | getRecents() {
let url = `https://api.instagram.com/v1/users/self/media/recent/?access_token=${this.accessToken}`;
jsonp(url, (response)=>{
let data = response.data;
this.renderPhotos(data);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLatestImages() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(galleryUrl == ''){\r\n\t\t\t\t\t\t\trestClient.findRestricted('sociallinks?socialCommunity=facebook&category=fadderuka', function(data) { \r\n\r\n\t\t\t\t\t\t\tif(data.length >= 1){\r\n\t\t\t\t\t\t\t\tgalleryUrl = data[0].address;\r\n\t\t\t\t\t\t\t}el... | [
"0.69923043",
"0.68996793",
"0.68142354",
"0.6401281",
"0.63646406",
"0.6341596",
"0.6283466",
"0.6254813",
"0.6154339",
"0.61156285",
"0.6102769",
"0.6059387",
"0.6035462",
"0.6033509",
"0.5969522",
"0.59647995",
"0.5950058",
"0.59115696",
"0.5849822",
"0.5810163",
"0.580359... | 0.80824167 | 0 |
private routine: create CSS object for debugConsole, just once | function createConsoleBoxStyle() {
var style = document.createElement("style");
style.type = "text/css";
style.innerHTML = ".debugConsoleDiv { " +
"pointer-events: none; " + // old browsers don't support this
"position: fixed; " +
"z-index: 999999;" +
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DebugStyling(){}",
"function DebugStyling() {}",
"function DebugStyling() { }",
"function initConsole() {\n // create temporary element\n var htmlFragment = document.createDocumentFragment(),\n temp = document.createElement('div');\n temp.innerHTML = \"<div id=\\\"debugConsoleDiv\\\" class=\\\"d... | [
"0.72911376",
"0.71455616",
"0.710237",
"0.6656697",
"0.6390268",
"0.63300157",
"0.6305692",
"0.6280211",
"0.62122726",
"0.6192523",
"0.61788267",
"0.6142363",
"0.60160726",
"0.59570307",
"0.59496",
"0.59128946",
"0.59128946",
"0.59128946",
"0.5890493",
"0.58769435",
"0.58558... | 0.73928905 | 0 |
Show / hide items depending on the number of rows on various viewports | function showHideContentGrids(ww, rows, $el) {
var contentType = $el.closest('.tg-content-grid').attr('data-content-grid-type');
$el.find('.l-gi').show();
if (contentType == '2') {
switch (true) {
case ww > 760:
break;
default:
$el.find('.l-gi').slice(-rows).hide(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hideOffscreenElements() {\n const startIndex = Math.floor(-(this.scrollContainer.y - this.y) / this.itemHeight);\n const endIndex = Math.floor(startIndex + (this.height / this.itemHeight));\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i];\n it... | [
"0.6676263",
"0.6632419",
"0.6568364",
"0.65096587",
"0.6418562",
"0.6397063",
"0.62342054",
"0.62253344",
"0.6199755",
"0.61743253",
"0.61339986",
"0.6042635",
"0.59601253",
"0.5937254",
"0.59241235",
"0.5897385",
"0.58830523",
"0.5834017",
"0.5824817",
"0.58114904",
"0.5767... | 0.6672725 | 1 |
function to save initials and score to local storage | function initialsSave() {
const initials = document.querySelector("#initials");
let initializer = initials.value.trim();
if (initializer !== "") {
let highScores = JSON.parse(window.localStorage.getItem("high-scores")|| "[]");
let newScore = {
score: secondsLeft,
ini... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initialsSave() {\n const initials = document.querySelector(\"#initials\");\n let initializer = initials.value.trim();\n if (initializer !== \"\") {\n let highScores = JSON.parse(window.localStorage.getItem(\"high-scores\") || \"[]\");\n\n let newScore = {\n score: seconds... | [
"0.81649226",
"0.79947585",
"0.78930926",
"0.77801293",
"0.775349",
"0.7710625",
"0.76934355",
"0.7652352",
"0.75935096",
"0.7585037",
"0.7574805",
"0.75725216",
"0.7569691",
"0.7539857",
"0.752194",
"0.7498728",
"0.74825907",
"0.74697745",
"0.7455102",
"0.7375357",
"0.736220... | 0.8183067 | 0 |
Get the current location from the GPS sensor Return promise with the gps data | function getLocation() {
return new Promise(function(resolve, reject) {
navigator.geolocation.getCurrentPosition(function success(position) {
console.log("Current position: ", position);
resolve(position.coords);
}, function error(err) {
console.log(err);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getGpsLocation() {\n return new Promise(\n (resolve, reject) => {\n if (\"geolocation\" in navigator) {\n // location is available\n navigator.geolocation.getCurrentPosition(function (position) {\n // Got location\n gpsLocation['lat'] = position.coords.la... | [
"0.821535",
"0.81354266",
"0.80344117",
"0.7929562",
"0.7824085",
"0.7737367",
"0.773396",
"0.7679788",
"0.7631308",
"0.76052517",
"0.7589576",
"0.75426936",
"0.75426936",
"0.75321484",
"0.752579",
"0.750157",
"0.7485199",
"0.7442982",
"0.7442982",
"0.74265397",
"0.7426139",
... | 0.8232805 | 0 |
M A S H // Multimodel Adaptive Spatial Hypertext // Objects Package // // Author: Luis FranciscoRevilla // Created: Nov 12, 2002 // Modified: Sep 28, 2007: Modified CONTROLS_IMG_DIR to point to WARP Server // // ============================================================================================================... | function MASH_ContextualMenu(tmpLeft, tmpTop, tmpObj) {
var tmpStyle = "align:left; vertical-align:top; background-color:#e4e4e4; border-color:#000000; border-width:1; border-style:solid; color:#000000; font-family:arial; font-size:9pt; font-weight:normal;";
this.base = MASH_Object;
this.base("", tmpLeft,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setContextualMenu(c){\n\n\t\tvar projection;\n var contextmenuDir;\n \n projection = map.getProjection() ;\n $('.contextualMenu').remove();\n\n //Il me semble intéressant de créer le menu contextuel par code afin de permettre l'animation par exemple dynamiquement.\n ... | [
"0.67377365",
"0.6255005",
"0.6201129",
"0.6148688",
"0.6122636",
"0.61192334",
"0.58697003",
"0.5854008",
"0.57712674",
"0.57696056",
"0.5713808",
"0.56553274",
"0.5648731",
"0.5645428",
"0.56369954",
"0.56362355",
"0.5618843",
"0.55704236",
"0.556306",
"0.5542582",
"0.55330... | 0.661626 | 1 |
Type guard for Blockquote. | function isBlockquote(node) {
return node.type === 'blockquote';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertBlockquote(node) {\n if (!isBlockquote(node)) {\n throw new Error('Node is not a Blockquote');\n }\n}",
"function hasBlockQuote(input)\n{\n\treturn (input.indexOf('<blockquote>') != -1 && input.indexOf('</blockquote>') != -1);\n}",
"get BackQuote() {}",
"function isSingleQuotable(... | [
"0.66709024",
"0.6466392",
"0.5920292",
"0.584331",
"0.5826799",
"0.5670453",
"0.56589663",
"0.56500185",
"0.5640022",
"0.56212854",
"0.56212854",
"0.56212854",
"0.56212854",
"0.5511549",
"0.5509715",
"0.54921955",
"0.54238766",
"0.54238766",
"0.54238766",
"0.5408647",
"0.540... | 0.68994176 | 0 |
Type assertion for Blockquote. | function assertBlockquote(node) {
if (!isBlockquote(node)) {
throw new Error('Node is not a Blockquote');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBlockquote(node) {\n return node.type === 'blockquote';\n}",
"function hasBlockQuote(input)\n{\n\treturn (input.indexOf('<blockquote>') != -1 && input.indexOf('</blockquote>') != -1);\n}",
"function isSingleQuotable(node) {\n return node.body.every((part) => part.type === \"@tstring_content\" ... | [
"0.72744644",
"0.6314206",
"0.5833715",
"0.559631",
"0.5379416",
"0.5319416",
"0.52220803",
"0.52116495",
"0.5207923",
"0.5201971",
"0.51936996",
"0.5192555",
"0.5192555",
"0.51865506",
"0.5182907",
"0.5182907",
"0.5182907",
"0.5182907",
"0.5163499",
"0.51507276",
"0.51507276... | 0.7308587 | 0 |
This method closes the panel, and if a value is specified, also sets the associated control to that value. It will also mark the control as dirty if this interaction stemmed from the user. | setValueAndClose(event) {
if (event && event.value) {
this._setValue(event.value);
this._onChange(event.value);
}
this.closePanel();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closePanel(data) {\n this.valueUpdated.next(data);\n }",
"function _close() {\n _utils.triggerCallback('BeforeClose', _this);\n\n if ( currValue != selected ){\n _utils.triggerCallback('BeforeChange', _this);\n\n var text = _this.items[selected].text;\n\n ... | [
"0.6808416",
"0.6275905",
"0.6223404",
"0.6164009",
"0.61544514",
"0.6123265",
"0.60576165",
"0.6048081",
"0.6025566",
"0.5958081",
"0.59551984",
"0.5917632",
"0.5868404",
"0.5787715",
"0.5723878",
"0.5712666",
"0.5694782",
"0.5588485",
"0.5580759",
"0.55600953",
"0.555656",
... | 0.6960181 | 0 |
Take an object map and resolve it as a grid array | function resolveObject(object) {
let grid = [];
let x = object.x;
let y= object.y;
let map = object.map;
for (var row = 0; row < map.length; row++) {
grid[x + row] = [];
for (var col = 0; col < map[row].length; col++) {
grid[x + row][y + c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadObject(object) {\n let grid = resolveObject(object);\n\n for (var row in grid) {\n if (grid.hasOwnProperty(row)) {\n for (var col in grid[row]) {\n if (grid[row].hasOwnProperty(col)) {\n map[row][col] = grid[row][col];\n... | [
"0.6426768",
"0.63467",
"0.603913",
"0.60291404",
"0.59248173",
"0.5847736",
"0.57060885",
"0.5628358",
"0.56027776",
"0.55916464",
"0.5585721",
"0.5547368",
"0.55357146",
"0.5526892",
"0.55237186",
"0.55175835",
"0.5458533",
"0.5444223",
"0.5424403",
"0.5419147",
"0.5415988"... | 0.7984025 | 0 |
Generates HTML for Honorable Rock data table row. Each row having different guilds from different months of a specified rank. | function generateTableRow(honorableRockDataReference, startDate, endDate, rank, colorScale)
{
let tableRowHtml = '';
for (let loopDate = moment(startDate); loopDate.isSameOrBefore(endDate); loopDate.add(1, 'months'))
{
let currentEntry = honorableRockDataReference.get(guildUtilities.getHonorableRockDataRef... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addRankingRow(rank) {\n $(\".team-rankings-table\").append(`\n <tr id=\"ranking-row-` + rank + `\">\n <td>` + (parseInt(rank) + 1) + `</td>\n </tr>\n `);\n}",
"function generateTableRow(date, guilds, colorScales)\n{\n let dateRowContentHtml = '';\n for (let i = 0; i < guilds.length; i++)\... | [
"0.63964754",
"0.6354005",
"0.6317297",
"0.6301854",
"0.6078427",
"0.6035334",
"0.6025235",
"0.6008758",
"0.60057884",
"0.5951096",
"0.594493",
"0.5865671",
"0.5850353",
"0.5844178",
"0.58428204",
"0.5833842",
"0.58294374",
"0.5827256",
"0.58091503",
"0.5796879",
"0.57873887"... | 0.7543035 | 0 |
Generates HTML for formatted guild name in [Icon]GuildName format. | function getFormattedGuildNameHtml(honorableRockDataReference, guildName)
{
let guildEntryReference = honorableRockDataReference.get(guildName);
let guildIconUrl = guildEntryReference ? guildEntryReference.iconUrl : '';
// Color is currently unused
let guildColor = guildEntryReference ? guildEntryReference.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderName (name, level, icon) {\n\tconst result = \n\t`\n\t<div class=\"container border\">\n\t\t<h1><img src=${iconURL+ icon}.png alt='Player Icon' class='icon'> ${name} Level: ${level}</h1>\n\t</div>\n\t`;\n\t$('div.player-name').html(result);\n}",
"_createIconHtml(iconName) {\n return `<i class=\... | [
"0.6718808",
"0.6219633",
"0.6083389",
"0.59297514",
"0.5663368",
"0.56206524",
"0.55388284",
"0.55117905",
"0.55005306",
"0.54835993",
"0.54397655",
"0.54209685",
"0.54033375",
"0.53293025",
"0.53157246",
"0.5304912",
"0.5299753",
"0.5280195",
"0.5260129",
"0.52389294",
"0.5... | 0.7920106 | 0 |
Returns a promise that resolves to a sorted list of all the todo lists for the current user together with their todos. The list is sorted by completion status and title (caseinsensitive). The todos in the list are unsorted. | async sortedTodoLists() {
const ALL_TODOLISTS = "SELECT * FROM todolists" +
" WHERE username = $1" +
" ORDER BY lower(title) ASC";
const FIND_TODOS = "SELECT * FROM todos WHERE todolist_id = $1";
let result = await dbQuery(ALL_TODOLISTS, this.username);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async sortedTodoLists() {\n const FIND_TODOLISTS = 'SELECT * FROM todolists' +\n ' WHERE username = $1' +\n ' ORDER BY lower(title) ASC';\n\n const FIND_TODOS = 'SELECT * FROM todos ' +\n ' WHERE username = $1';\n\n let resultTod... | [
"0.7737007",
"0.6792095",
"0.6747278",
"0.60884464",
"0.5996687",
"0.5971272",
"0.5957146",
"0.58969873",
"0.58316195",
"0.57684976",
"0.5748398",
"0.573977",
"0.5723325",
"0.5718585",
"0.5713401",
"0.5684476",
"0.567656",
"0.5632898",
"0.5616855",
"0.5616209",
"0.5598348",
... | 0.77149004 | 1 |
Returns the size, in pixels, of the smaller screen measure, either horizontal or vertical. | smallerScreenSize() {
return Math.min(this.clientWidth(), this.clientHeight());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWindowScreenSize() {\n var _ActualWindowScreen = $(this).scrollTop();\n return Math.floor(actualWindowScreen / $scope.constants.SCREEN_DIVISOR) * $scope.constants.SCREEN_DIVISOR;\n}",
"function getScreenSize() {\n\t\t\treturn window.innerWidth;\n\t\t} // end getScreenSize()",
"findSize() {\n ... | [
"0.74013406",
"0.7337311",
"0.7214828",
"0.72049576",
"0.702221",
"0.6887058",
"0.6845589",
"0.6733552",
"0.6731909",
"0.6670688",
"0.65870434",
"0.6500259",
"0.6494052",
"0.6434985",
"0.64291984",
"0.6406943",
"0.6405308",
"0.64029807",
"0.64001465",
"0.64001465",
"0.6394972... | 0.7852443 | 0 |
send vertex position of trail into trail object | function SendTrailPosition() {
var index = 0;
for (var v : Vector3 in trailPositions) {
trail.SetPosition(index,v);
index++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleDestination() {\n\n\n\n //old stuff\n /* console.log(\"tween completed\");\n playerObjectX = playerObject.x;\n playerObjectY = playerObject.y;\n targetX = lines[currentTargetNumber][0];\n targetY = lines[currentTargetNumber][1];\n\n console.log(playerObjectX);\n cons... | [
"0.65000635",
"0.6417845",
"0.64031327",
"0.62061095",
"0.60705143",
"0.60159874",
"0.5995899",
"0.5897553",
"0.58630973",
"0.5858168",
"0.58034563",
"0.5796829",
"0.5789156",
"0.57667017",
"0.5733123",
"0.57216775",
"0.5720675",
"0.5708689",
"0.5695404",
"0.56770915",
"0.564... | 0.7734533 | 0 |
add vertex position of trail (array) | function AddTrailPosition() {
if (linePart>9) {
for (var i=0;i<=8;i++) trailPositions[i] = trailPositions[i+1];
trailPositions[9] = Camera.main.ScreenToWorldPoint(Vector3(start.x, start.y, 10));
} else {
for (var ii=linePart;ii<=9;ii++)
trailPositions[ii] = Camera.main.ScreenToWorldPoint(Vector3(start.x, start... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SendTrailPosition() {\n\nvar index = 0;\nfor (var v : Vector3 in trailPositions) {\n\t\ttrail.SetPosition(index,v);\n\t\tindex++;\n\t}\n\n}",
"createTrail( first, second, hue ){\r\n let begin = this.transformIndex( first );\r\n let end = this.transformIndex( second );\r\n\r\n if( Math.abs... | [
"0.6756022",
"0.641576",
"0.6396191",
"0.61178976",
"0.60802186",
"0.60475177",
"0.59438497",
"0.593655",
"0.5929262",
"0.5838849",
"0.5832608",
"0.5825241",
"0.58208966",
"0.58177215",
"0.58177215",
"0.58039016",
"0.5776663",
"0.57588375",
"0.5739151",
"0.57313365",
"0.56822... | 0.72538096 | 0 |
Getter to retrieve the users array from localstorage as an array | function get_user_array(){
var user_array_string = localStorage['users'];
if(user_array_string == null){
reset_user_array();
return [];
}
var user_array = [];
try{
user_array = JSON.parse(user_array_string);
} catch(err){
reset_user_array();
return [];
}
return user_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserArray(){\n return localStorage.getItem('userArray');\n}",
"function getUsers() {\n if(localStorage.getItem(\"users\") == null) {\n users = [];\n return users;\n } else {\n users = JSON.parse(localStorage.getItem(\"users\"));\n return users;\n }\n }",
"function getAl... | [
"0.85427785",
"0.81087667",
"0.80533653",
"0.8011351",
"0.8011351",
"0.77658856",
"0.7698358",
"0.7606426",
"0.75062007",
"0.7471567",
"0.73764",
"0.7278137",
"0.71978587",
"0.7166965",
"0.7121372",
"0.7112208",
"0.69931924",
"0.69894105",
"0.6982618",
"0.69692796",
"0.696267... | 0.83064246 | 1 |
Setter to put a user array into localstorage | function set_user_array(user_array){
if(user_array == null){
console.log("trying to set users to null. Why do that???");
return false;
}
try{
var users_string = JSON.stringify(user_array);
}catch(err){
console.log("failed to stringify user_array");
return false;
}
localStorage['users'] = users_string;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeUserArray(userArr){\n localStorage.setItem('userArray', JSON.stringify(userArr));\n}",
"function saveUserArray(data) {\n users = data;\n}",
"function settingFunction() {\n\n let allUsersString = JSON.stringify(allUsers);\n localStorage.setItem('allUsers', allUsersString);\n\n}",
"function s... | [
"0.81534815",
"0.75111544",
"0.7486128",
"0.73678195",
"0.73678195",
"0.7339253",
"0.730601",
"0.72203475",
"0.71855634",
"0.71329063",
"0.71329063",
"0.71146476",
"0.7084836",
"0.706224",
"0.6998042",
"0.698379",
"0.69699657",
"0.6963116",
"0.6946769",
"0.68966824",
"0.68679... | 0.7833418 | 1 |
Add a user to localstorage, patients array optional | function add_user(email, password, patients){
if(user_exists(email)){
alert("User already exists");
return false;
}
var new_user = make_user(email, password, patients);
var user_array = get_user_array();
// if(user_array.isArray){
try{
user_array.push(new_user);
} catch(err) {
user_array = [ new_u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addUser(user){\n signUpContainer.push(user);\n localStorage.setItem(\"users\" , JSON.stringify(signUpContainer)) ;\n messageSuccess();\n clearInputs();\n}",
"function register() {\n\tvar nameValue = document.getElementById(\"name\").value;\n\tvar nameGiftValue = document.getEleme... | [
"0.717725",
"0.7177225",
"0.68154687",
"0.676308",
"0.67541915",
"0.6729621",
"0.66850555",
"0.6652635",
"0.6624968",
"0.6623281",
"0.66146517",
"0.6526933",
"0.6509406",
"0.64448565",
"0.6443752",
"0.6438336",
"0.6430864",
"0.64209634",
"0.6411453",
"0.6404872",
"0.63749236"... | 0.7615496 | 0 |
Initialize default user stuff if first time running | function initialize_shit(){
if(!user_exists('default')){
add_user('default', '', patients_default);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeUsers() {\n username = localStorage.getItem('staySignedInAs')\n if (username !== null) {\n useDefaults = localStorage.getItem('Defaults Used?' + username + 'Kixley@65810')\n useDefaults = parseBool(useDefaults)\n if (useDefaults === false) {\n useDefaultDiff = localStorage.getIte... | [
"0.7973728",
"0.7373478",
"0.71717",
"0.7057745",
"0.694566",
"0.69040895",
"0.68162715",
"0.6801008",
"0.67903924",
"0.6761892",
"0.67490906",
"0.6737761",
"0.6692597",
"0.66837025",
"0.668325",
"0.6621862",
"0.6605435",
"0.655456",
"0.6551842",
"0.6549091",
"0.6536498",
"... | 0.80152977 | 0 |
Remove a user from ls by email | function remove_user(email){
var user_array = get_user_array();
for(var i=0; i<user_array.length; ++i){
if(user_array[i].email == email){
user_array.splice(i,1);
set_user_array(user_array);
if(is_logged_in() && get_user_email() == email){
log_out();
}
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unsubscribe(email)\n {\n if (this.hasUser(email)) // Si esta suscripto\n {\n const indexToRemove = this.users.indexOf(email);\n this.users.splice(indexToRemove,1);\n }\n }",
"removeUser(user) {\n this.active_list = this.active_list.filter((a_user) => a_user... | [
"0.7471197",
"0.72034734",
"0.6946288",
"0.6748954",
"0.6595661",
"0.6546945",
"0.6546603",
"0.65146154",
"0.6506073",
"0.6497163",
"0.64460623",
"0.6389504",
"0.63872904",
"0.63311356",
"0.6311826",
"0.63076645",
"0.63023967",
"0.6290392",
"0.6280061",
"0.6247263",
"0.618095... | 0.7398358 | 1 |
Change the status of a patient (change indicator color) | function change_status(id, color){
// Ensure a valid color is chosen
switch(color){
case 'red':
case 'yellow':
case 'green':
break;
default:
console.log("invalid status color chosen; defaulting to yellow");
color = 'yellow';
}
var patients = get_ls_patients();
patients[id]['color_status'] = col... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Set()\n {\n this.changed = true;\n this.indicator.style.backgroundColor = 'red';\n }",
"function setStatus(node, status) {\n\n switch (status) {\n case node_status.ON :\n node.status({fill:\"green\",shape:\"ring\",text:\"on\"});\n break;\n case node_status.OFF :... | [
"0.6712845",
"0.63772404",
"0.62942666",
"0.61926687",
"0.6135897",
"0.6094406",
"0.6006848",
"0.59781665",
"0.5938956",
"0.5934879",
"0.5928388",
"0.58938366",
"0.5873793",
"0.5873466",
"0.5866802",
"0.58510387",
"0.5831478",
"0.57828134",
"0.57792693",
"0.5764036",
"0.57483... | 0.72080064 | 0 |
Change the status of a patient after some delay | function change_status_delay(id, color, delay_ms){
setTimeout(function(){ change_status(id, color); }, delay_ms);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeStatus() {\n for (let i = 0; i <= 5; i++) {\n delay(i, timerValues.currentSecond);\n }\n // if (didMountRef.current) {\n // } else didMountRef.current = true;\n }",
"function changeStaffStatus(seconds, availableStaff, status) {\n setTimeout(async function () {\n await s... | [
"0.652329",
"0.6474016",
"0.61221457",
"0.6046076",
"0.59245235",
"0.591753",
"0.58791816",
"0.5866611",
"0.5803668",
"0.57093376",
"0.56982535",
"0.56798184",
"0.5679417",
"0.5672405",
"0.5615233",
"0.560192",
"0.5586222",
"0.5580497",
"0.5562971",
"0.55530703",
"0.5548391",... | 0.673704 | 0 |
Create the patient fields on index.html from an array of patients | function create_patients(patient_array){
// console.log('creating patients');
var source = $("#patient_template").html();
var template = Handlebars.compile(source);
var parent_div = $("#templated_patients");
// Clear the div in case there's junk in it for some reason
parent_div.empty();
for(var i=0; i<patient_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPatientInfo() {\n getAllPatients(\n function(patientData) {\n let patientsDiv = document.getElementsByClassName(\"patients\")[0];\n patientsDiv.parentNode.removeChild(patientsDiv);\n\n patientsDiv = document.createElement(\"div\");\n patientsDiv.className = \"patients\";\n ... | [
"0.60429025",
"0.5957231",
"0.5926709",
"0.59007776",
"0.5858194",
"0.58274347",
"0.57388216",
"0.5496713",
"0.5467583",
"0.5384244",
"0.5361662",
"0.5350631",
"0.5284355",
"0.5282489",
"0.52821606",
"0.5255207",
"0.52308345",
"0.5224396",
"0.52194476",
"0.51935273",
"0.51836... | 0.65550685 | 0 |
Handler for when add medications is pressed | function add_meds_handler(patient_id){
console.log('button pressed from patient_id=' + patient_id);
var patients = get_ls_patients();
$("#meds_input_"+patient_id).val(patients[patient_id]['patient_meds']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClickAddCustom()\n{\n var name = document.getElementById('newGestureName').value;\n if (_points.length >= 10 && name.length > 0)\n {\n var num = _r.AddGesture(name, _points);\n $(\"#newGestureName\").val(\"\\\"\" + name + \"\\\" 가 추가되었습니다.\");\n }\n}",
"function EventHandler(... | [
"0.57623774",
"0.5601625",
"0.55177677",
"0.54511684",
"0.544479",
"0.5419335",
"0.5417025",
"0.537455",
"0.5353946",
"0.5335661",
"0.5330192",
"0.53215635",
"0.53121597",
"0.53098905",
"0.5299828",
"0.5291359",
"0.52763265",
"0.52500975",
"0.52422905",
"0.52375686",
"0.52165... | 0.6533265 | 0 |
eslintdisable camelcase, maxparams Create a markdown renderer that builds relative links based on the currentPath and site's base href | setMarkdownRenderer(currentPath) {
const md = new MarkdownIt({
html: true,
linkify: true,
typographer: true
});
md.use(markdownItTocAndAnchor, {
anchorLinkSymbol: "",
anchorClassName: "Anchor",
tocCallback: (tocMarkdown, tocArray) => {
this.props.updateTocArray(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"templatizeLocalLinks_(contents) {\n contents = contents.replace(patterns.newMarkdownLinkPattern(), (_, text, url, title='') => {\n return `[${ text }](${ this.templatizeLinkIfLocal_(url) }${ title })`;\n });\n contents = contents.replace(patterns.newHrefPattern(), (_, url) => {\n return `href=\"... | [
"0.632608",
"0.6039561",
"0.5927329",
"0.58909047",
"0.5871425",
"0.5864341",
"0.5808049",
"0.57858735",
"0.569553",
"0.5693062",
"0.5688307",
"0.5686127",
"0.56859624",
"0.5663415",
"0.56554174",
"0.5645385",
"0.5642691",
"0.56194043",
"0.561737",
"0.56171805",
"0.5616943",
... | 0.73094445 | 0 |
Check if in camera | isInCamera(cam) {
let px = this.pos.x;
let py = this.pos.y;
let w = this.spr.w/2;
let h = this.spr.h/2;
let wasInCamera = this.inCamera;
this.inCamera =
px+w >= cam.top.x &&
px-w <= cam.top.x + cam.w &&
py+h >= cam.top.y &&
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isCameraPresent() {\n return isBlinkGapDevice.hasCamera();\n}",
"async function hasCameraPermission() {\n const { status } = await Permissions.askAsync(Permissions.CAMERA)\n return (status === 'granted')\n}",
"hasEntered() {\n this.requestCameraAttention();\n return this.y > 0... | [
"0.7466287",
"0.6843533",
"0.67201954",
"0.6692698",
"0.6549074",
"0.6544706",
"0.65198",
"0.63869876",
"0.63808036",
"0.6326934",
"0.6286636",
"0.61511767",
"0.6125627",
"0.60620797",
"0.6002523",
"0.5953675",
"0.5946981",
"0.5930155",
"0.59292036",
"0.59024334",
"0.5896471"... | 0.73036706 | 1 |
Initialize Message from payload data into the current this. | constructor(rawPayload) {
super(rawPayload);
Object.assign(
this,
this._initMessageModel(this.rawPayload)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() { \n \n Message.initialize(this);\n }",
"constructor() {\n this.messages = {};\n this.payloads = {};\n }",
"constructor(message, data){\n this.message = message;\n this.data = data;\n }",
"load(data) {\n const { id, message, authorName, authorPhot... | [
"0.687086",
"0.6771553",
"0.6661632",
"0.64198226",
"0.6337324",
"0.627499",
"0.6105451",
"0.59849465",
"0.5969097",
"0.595423",
"0.59383434",
"0.59383434",
"0.5893458",
"0.5889208",
"0.58876115",
"0.58053005",
"0.5792677",
"0.5790248",
"0.57682455",
"0.57234573",
"0.5711083"... | 0.79091436 | 0 |
Tree \ \\ / Essentially the entire branch/path of the game is incorporated into a single binary tree data structure. Into [] / \ Day 1 [] [] / \ / \ Day 2 [] [] [] [] /\ /\ /\ /\ Day 3 [][][][][][][][] .............. Each node in this tree indicates a branch created by another choice. Not all nodes need to be filled in... | function makeTree(){
introNode.leftChild = day_0_Job_Selection;
day_0_Job_Selection.leftChild = day_1_Choosing_Savings;
day_1_Choosing_Savings.leftChild = day_2_Moving;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"buildTree(depthLimit, boardState, currPlayer = 'RR') {\n\n this.root = new Node(boardState, 0, null); // current board state.\n let nodes = [this.root];\n let childrenNodes = [];\n\n for (let j = depthLimit; j > 0; j--){ // limits the depth of the tree. **most computers can't calculate ... | [
"0.6382961",
"0.6138994",
"0.60764766",
"0.5929235",
"0.5890851",
"0.5763347",
"0.5756981",
"0.5744009",
"0.57326305",
"0.5698102",
"0.5611964",
"0.5587801",
"0.5541348",
"0.55213463",
"0.55127674",
"0.5512241",
"0.54901767",
"0.5462307",
"0.5462307",
"0.54384005",
"0.5410502... | 0.642197 | 0 |
Constructs a new GenreRelations. | constructor() {
GenreRelations.initialize(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() { \n \n ProgramRelations.initialize(this);\n }",
"constructor() { \n \n ItemRelations.initialize(this);\n }",
"function RelationDatabase() {\n this._referenceCounter = 1;\n this._tableCollection = {};\n this._dummyRecords = new Du... | [
"0.6232864",
"0.6184415",
"0.59296834",
"0.5692906",
"0.5689173",
"0.56460184",
"0.5560618",
"0.55275637",
"0.5435969",
"0.5382502",
"0.53683",
"0.5337654",
"0.53169733",
"0.52600116",
"0.5240981",
"0.51852584",
"0.5125731",
"0.508957",
"0.5080166",
"0.50351536",
"0.50334734"... | 0.81945926 | 0 |
Validates inputs to only allow hexademical colors and transparenceny. | function validateHex(input) {
let $fieldset = $(input).parent('fieldset');
$fieldset.removeClass("valid");
$fieldset.removeClass("invalid");
let inputText = input.val();
if ((/^(#[A-Fa-f0-9]{6}|#[A-Fa-f0-9]{3}|transparent)$/i).test(inputText)) {
$fieldset.addClass("va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isValidColor(text) {\n return hexColorRegEx.test(text);\n}",
"_validateColor(color) {\n if (\n (color === 'transparent' && this.get('isTransparencyEnabled')) ||\n (color === '' && this.get('canRemoveColor'))\n ) {\n return true;\n } else {\n let noHash = color.split('#').po... | [
"0.68343383",
"0.67728716",
"0.65698993",
"0.64930224",
"0.64470184",
"0.63622266",
"0.63429475",
"0.62471884",
"0.617671",
"0.6124956",
"0.6087656",
"0.60677767",
"0.60286254",
"0.6019617",
"0.59693736",
"0.5949029",
"0.5939103",
"0.5927525",
"0.59247714",
"0.58980614",
"0.5... | 0.6891835 | 0 |
any property present in `data.attributes` will be applied to the popper, they will be set as HTML attributes of the element | setAttributes(data.instance.popper, data.attributes);
// if arrowElement is defined and arrowStyles has some properties
if (data.arrowElement && Object.keys(data.arrowStyles).length) {
setStyles(data.arrowElement, data.arrowStyles);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePopperElement(popper, prevProps, nextProps) {\n var _getChildren = getChildren(popper),\n tooltip = _getChildren.tooltip,\n content = _getChildren.content,\n backdrop = _getChildren.backdrop,\n arrow = _getChildren.arrow;\n\n popper.style.zIndex = '' + nextProps.zIn... | [
"0.6250861",
"0.6207939",
"0.612997",
"0.611531",
"0.5962955",
"0.5919485",
"0.58591807",
"0.57340246",
"0.573194",
"0.571185",
"0.56983566",
"0.5694527",
"0.5683649",
"0.5660584",
"0.56381863",
"0.5633213",
"0.56052023",
"0.55180836",
"0.5508162",
"0.5508162",
"0.5508162",
... | 0.78691816 | 0 |
Organize data from the Promise results from Supabase data | function organizeDataFromSupabase(container_data) {
let events_data = {};
let parsed_dates = {};
for (let i = 0; i < container_data.length; i++) {
event_key = container_data[i].id;
events_data[event_key] = container_data[i];
//we get the parsed dates we need
parsed_dates[event_key] = getParsedDa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getData(result) {\n //here resolve the data\n Promise.resolve(result).then(value =>{\n //brack the hole function to differnt function\n getDate(value.updated); //call the function for date\n getTotal(value.total); //call the function for total cases\n ... | [
"0.5822486",
"0.5768462",
"0.5710882",
"0.564684",
"0.5637851",
"0.56332076",
"0.5611661",
"0.5599017",
"0.5553205",
"0.5540311",
"0.55388063",
"0.553132",
"0.5524102",
"0.55061615",
"0.5485836",
"0.5480551",
"0.5477262",
"0.546853",
"0.5464138",
"0.5463033",
"0.54593146",
... | 0.62897235 | 0 |
All File To ClientFiles Data Table Trigger Update To Client for ClientHome render Push to ClientHome | addFileToClientFiles(fileId, folderName) {
this.set({
addFileModal: false
});
this.save({
clientFiles: this.get('clientFiles').concat([{
___class: 'ClientFiles',
folderName: folderName,
files: {
___class:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshFileTables() {\n\n // extract current file ids for convenience\n var currentFileIds = $scope.currentSourceData.sourceDataFiles.map(function(item) {\n return item.id;\n });\n\n // available: any items not in current file ids (not attached to viewed\n // sourceData)\n $scope.tp... | [
"0.59524095",
"0.5554597",
"0.5520052",
"0.5506642",
"0.55020815",
"0.5478643",
"0.54732937",
"0.5459693",
"0.5424008",
"0.53929603",
"0.5386667",
"0.5359117",
"0.5339532",
"0.5337648",
"0.53304636",
"0.5327063",
"0.5326424",
"0.5299832",
"0.5278866",
"0.52778864",
"0.526867"... | 0.5779658 | 1 |
All Folder To ClientFolders Data Table Trigger Update To Client for ClientHome render Push to ClientHome | addFolderToClientFolders(subFolderId, folderName, clientId) {
console.log(clientId);
let clientFolders;
if(this.get('clientFolders')) {
clientFolders = this.get('clientFolders').concat([
{
___class: 'ClientFolders',
folderName: folderName,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onUpdateFolder() {\n this.onUpdateFolder();\n }",
"function getAllFolderSiteOneRow(grid, rowIndex) {\r\n // create request to express server\r\n var folderPath = grid.getStore().getAt(rowIndex).get('folderPath');\r\n if (folderPath != '') return;\r\n\r\n grid.getStore().getAt(rowInd... | [
"0.58079445",
"0.56818014",
"0.5617323",
"0.5507067",
"0.54916567",
"0.53915274",
"0.5354632",
"0.5315624",
"0.524171",
"0.52261",
"0.520073",
"0.5187031",
"0.51738745",
"0.51535124",
"0.5136645",
"0.50896424",
"0.5084867",
"0.50812143",
"0.50697273",
"0.50305367",
"0.5028231... | 0.60924006 | 0 |
Delete File From ClientFiles Data Table Update ClientFiles Table | deleteFileFromClient(clientFileId) {
let newClientFiles = this.get('clientFiles').filter((clientFile, i, arr) => {
if (clientFileId !== clientFile.objectId) {
return true;
}
});
this.save({
clientFiles: newClientFiles
}, {
s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recordInDB_file_deleted(file) {\n if (file.search(\"select-27.csv\") == -1) return;\n MongoClient.connect(DB_CONN_STR, {useNewUrlParser: true, useUnifiedTopology: true}, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO DELETE WHOLE FILE LINE... | [
"0.6648078",
"0.6539915",
"0.6367247",
"0.62852293",
"0.6202364",
"0.6174988",
"0.6134385",
"0.6114813",
"0.61115694",
"0.6081444",
"0.60515463",
"0.6042304",
"0.6003856",
"0.5966272",
"0.5965284",
"0.59601474",
"0.59492934",
"0.5944388",
"0.5924299",
"0.59074014",
"0.5861004... | 0.74620324 | 0 |
Delete Client From Clients Table Triggers('change') | deleteClient(client) {
console.log(client);
this.destroy({url: `https://api.backendless.com/v1/data/Clients/${client.objectId}`},
{
success: () => {
console.log('client deleted!');
},
error: () => {
console.log('client was NOT delet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteClient(client) {\n //console.log(\"[monitor_interface] Got clicked \" + client.target.parentNode.parentNode.id);\n //console.log(client);\n deleteClientById(client.target.parentNode.parentNode.id);\n }",
"function deleteClient($clientRow) {\n... | [
"0.6948938",
"0.6389969",
"0.6251538",
"0.6147419",
"0.6143458",
"0.6143458",
"0.6010062",
"0.598172",
"0.5924186",
"0.581262",
"0.57787794",
"0.5742329",
"0.57389677",
"0.5714596",
"0.56547517",
"0.56500626",
"0.56044966",
"0.55887544",
"0.5515364",
"0.55118835",
"0.5491319"... | 0.6667089 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.