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 |
|---|---|---|---|---|---|---|
Copyright 2020 Inrupt Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,... | async function internal_fetchAcl(resourceInfo, options = internal_defaultFetchOptions) {
if (!hasAccessibleAcl(resourceInfo)) {
return {
resourceAcl: null,
fallbackAcl: null,
};
}
const resourceAcl = await internal_fetchResourceAcl(resourceInfo, options);
const ac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function internal_fetchAcl(resourceInfo) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : internal_defaultFetchOptions;\n if (!hasAccessibleAcl(resourceInfo)) {\n return {\n resourceAcl: null,\n fallbackAcl: null\n };\n }\n try {\n const resourceAcl... | [
"0.73074865",
"0.6499332",
"0.62735546",
"0.6201636",
"0.60055685",
"0.59892154",
"0.59649414",
"0.59170026",
"0.5816977",
"0.5777782",
"0.5698429",
"0.56493706",
"0.56103075",
"0.5576465",
"0.5470789",
"0.54643345",
"0.5434104",
"0.5326573",
"0.5261042",
"0.52496266",
"0.523... | 0.72464395 | 1 |
Given the path to a Resource, get the URL of the Container one level up in the hierarchy. | function internal_getContainerPath(resourcePath) {
const resourcePathWithoutTrailingSlash = resourcePath.substring(resourcePath.length - 1) === "/"
? resourcePath.substring(0, resourcePath.length - 1)
: resourcePath;
const containerPath = resourcePath.substring(0, resourcePathWithoutTrailingSlas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internal_getContainerPath(resourcePath) {\n const resourcePathWithoutTrailingSlash = resourcePath.substring(resourcePath.length - 1) === \"/\" ? resourcePath.substring(0, resourcePath.length - 1) : resourcePath;\n const containerPath = `${resourcePath.substring(0, resourcePathWithoutTrailingSlash.lastIn... | [
"0.62915885",
"0.54436815",
"0.53890526",
"0.5315139",
"0.52817416",
"0.52817416",
"0.52817416",
"0.52817416",
"0.52477944",
"0.52477944",
"0.5233579",
"0.5191963",
"0.51607627",
"0.5122615",
"0.5114548",
"0.5052121",
"0.50058",
"0.5000162",
"0.49915594",
"0.4978659",
"0.4935... | 0.6407089 | 0 |
Initialises a new ACL Rule that grants some access but does not yet specify to whom. | function internal_initialiseAclRule(access) {
let newRule = createThing();
newRule = setIri(newRule, rdf.type, acl.Authorization);
if (access.read) {
newRule = addIri(newRule, acl.mode, internal_accessModeIriStrings.read);
}
if (access.append && !access.write) {
newRule = addIri(newR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internal_initialiseAclRule(access) {\n let newRule = createThing();\n newRule = setIri(newRule, rdf.type, acl.Authorization);\n if (access.read) {\n newRule = addIri(newRule, acl.mode, internal_accessModeIriStrings.read);\n }\n if (access.append && !access.write) {\n newRule = addIri(newRule, a... | [
"0.6851725",
"0.57136625",
"0.5695536",
"0.53183866",
"0.5204116",
"0.516126",
"0.5098284",
"0.49302867",
"0.486499",
"0.48219758",
"0.4806589",
"0.47952425",
"0.47536913",
"0.47055376",
"0.46551812",
"0.4643073",
"0.4632277",
"0.46142495",
"0.4589102",
"0.45888516",
"0.45840... | 0.6862444 | 0 |
Creates a new ACL Rule with the same ACL values as the input ACL Rule, but having a different IRI. Note that nonACL values will not be copied over. | function internal_duplicateAclRule(sourceRule) {
let targetRule = createThing();
targetRule = setIri(targetRule, rdf.type, acl.Authorization);
function copyIris(inputRule, outputRule, predicate) {
return getIriAll(inputRule, predicate).reduce((outputRule, iriTarget) => addIri(outputRule, predicate, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internal_duplicateAclRule(sourceRule) {\n let targetRule = createThing();\n targetRule = setIri(targetRule, rdf.type, acl.Authorization);\n function copyIris(inputRule, outputRule, predicate) {\n return getIriAll(inputRule, predicate).reduce((outputRule, iriTarget) => addIri(outputRule, predicate, i... | [
"0.6783603",
"0.571246",
"0.57053864",
"0.54067206",
"0.5343046",
"0.5128131",
"0.5072354",
"0.503569",
"0.48903996",
"0.47475582",
"0.47271517",
"0.46726197",
"0.4651414",
"0.46399942",
"0.4591834",
"0.4579239",
"0.45664987",
"0.45328376",
"0.4515738",
"0.44951573",
"0.44624... | 0.67980784 | 0 |
Given an ACL Rule, returns two new ACL Rules that cover all the input Rule's use cases, except for giving the given Actor access to the given Resource. | function internal_removeActorFromRule(rule, actor, actorPredicate, resourceIri, ruleType) {
// If the existing Rule does not apply to the given Actor, we don't need to split up.
// Without this check, we'd be creating a new rule for the given Actor (ruleForOtherTargets)
// that would give it access it does ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internal_removeActorFromRule(rule, actor, actorPredicate, resourceIri, ruleType) {\n // If the existing Rule does not apply to the given Actor, we don't need to split up.\n // Without this check, we'd be creating a new rule for the given Actor (ruleForOtherTargets)\n // that would give it access it doe... | [
"0.6790636",
"0.65747166",
"0.59163636",
"0.5910634",
"0.537435",
"0.49178812",
"0.47685245",
"0.4738013",
"0.4640746",
"0.4632122",
"0.45662802",
"0.45597386",
"0.4420053",
"0.4304637",
"0.4235503",
"0.42060822",
"0.41998047",
"0.4151438",
"0.41510317",
"0.415003",
"0.414215... | 0.6804245 | 0 |
Given two arrays, create an associative array (aka hash map, an obj / dictionary) containing keys from the first array, and values from the second. Associative arrays are sometimes called maps because a key (string) maps to a value | function ZipArr(keys, values) {
const hashMap = {};
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const val = values[i];
hashMap[key] = val;
}
return hashMap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zipArrays(arr1, arr2) {\n var newObject = {};\n for (var x = 0; x < arr1.length; x++) {\n var key = arr1[x];\n var value = arr2[x];\n newObject[key] = value\n }\n return (newObject)\n}",
"function Zip(arr1, arr2){\n var obj = {}\n for(var i = 0; i <... | [
"0.765689",
"0.7081893",
"0.68221754",
"0.663281",
"0.65183616",
"0.6482253",
"0.64498055",
"0.63609487",
"0.62521046",
"0.61362445",
"0.61068916",
"0.60737455",
"0.59644437",
"0.5958469",
"0.5950707",
"0.59487927",
"0.594547",
"0.5929449",
"0.5929449",
"0.5929449",
"0.592944... | 0.71642596 | 1 |
Updates drawing on defined interval | function update() {
const time = Date.now() / 1000;
coordinates = getCoordinates(time);
drawing.redraw(coordinates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mainUpdateDraw(){\r\n // Update colorConfiguration\r\n if(timePerDraw + timeCount >= timeMax) {\r\n // When it is the last turn\r\n modelUpdateSite(timeMax - timeCount);\r\n timeCount = timeMax;\r\n mainDraw();\r\n clearInterval(nIntervId);\r\n document.getE... | [
"0.666275",
"0.66524535",
"0.6605026",
"0.6584115",
"0.65721077",
"0.650891",
"0.65064025",
"0.64995503",
"0.64918625",
"0.64773643",
"0.6475135",
"0.63893044",
"0.6379103",
"0.63748986",
"0.63567996",
"0.63513505",
"0.632856",
"0.6320928",
"0.6296969",
"0.6279015",
"0.626573... | 0.6977651 | 0 |
delete people by id into request | function deletepeople(req, res) {
var peopleId = req.params.id;
people.findByIdAndRemove(peopleId, (err, peopleRemoved) => {
if (err) {
res.status(500).send({
message: "error en la petición para eliminar el people"
});
} else {
if (!people... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async deleteOnePeople(req, res) {\n //armazena o id recebido na requisição em uma constante\n const { id } = req.params;\n\n //Verifica se o ID da requisição existe no banco\n const idExists = await Pessoa.findOne({\n where: { id }\n });\n\n //Se o ID nao existe no banco retorna a requisição... | [
"0.74724853",
"0.7305481",
"0.7256056",
"0.72356474",
"0.71908563",
"0.7157473",
"0.7020487",
"0.6993236",
"0.69816136",
"0.69532436",
"0.6804079",
"0.6789499",
"0.6747644",
"0.6705972",
"0.6694533",
"0.6653943",
"0.6652685",
"0.6648937",
"0.6638191",
"0.6615388",
"0.66127163... | 0.76909477 | 0 |
update the people by id into request | function updatepeople(req, res) {
var peopleId = req.params.id;
var params = req.body;
people.findByIdAndUpdate(peopleId, params, (err, peopleUpdate) => {
if (err) {
res.status(500).send({
message: "error al actualizar el people"
});
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updatePeopleByID(people, people_id) {\n people = JSON.stringify(people);\n return axios\n .put(API_URL + people_id,\n people, {\n headers: authHeader()\n })\n .then(response => {\n return response;\n })\n .catch(err => {\n return err;\n });\n }",... | [
"0.7292375",
"0.69426",
"0.69409406",
"0.6800524",
"0.6780288",
"0.6713651",
"0.6665385",
"0.66618305",
"0.6559998",
"0.6550464",
"0.6540727",
"0.65212977",
"0.65060747",
"0.6453264",
"0.64255506",
"0.6409333",
"0.6348209",
"0.633177",
"0.6314303",
"0.6313785",
"0.63092667",
... | 0.7552189 | 0 |
init the entity edit form/display it | function update_entity_edit() {
var form_record = Domain.entities[current_entity];
Forms.init(form_record);
update_edit_form_display();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _edit() {\n $('name').value = this.name;\n $('key').value = this.key;\n $('action').value = this.action;\n switchToView('edit-form');\n}",
"function initializeForm() {\n editor.afform = editor.data.definition;\n if (!editor.afform) {\n alert('Error: unknown form');\n ... | [
"0.7124637",
"0.67622787",
"0.6722531",
"0.6581777",
"0.6581777",
"0.65200835",
"0.651822",
"0.65099406",
"0.6446042",
"0.6281105",
"0.6271282",
"0.6255175",
"0.6228188",
"0.6201671",
"0.617515",
"0.6132977",
"0.61046815",
"0.60953987",
"0.6093289",
"0.6079466",
"0.6064051",
... | 0.80138874 | 0 |
Check if the node is an instance method not excluded by config | function isIncludedInstanceMethod(node) {
if (node.static ||
(node.type === utils_1.AST_NODE_TYPES.MethodDefinition &&
node.kind === 'constructor') ||
(node.type === utils_1.AST_NODE_TYPES.PropertyDefinition &&
!enforceForClassFields)) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isMethodEom() {\n\t\treturn this.inputs.fields.method.val() == codetable.config.methods.eom.value;\n\t}",
"static [Symbol.hasInstance](obj) {\n return false;\n }",
"function instanceAvailability(pluginObj, methodName) {\n return (pluginObj._objectInstance &&\n (!methodName || typeof pluginObj._ob... | [
"0.6023555",
"0.5963673",
"0.57899946",
"0.57202846",
"0.5624016",
"0.5479326",
"0.54407096",
"0.5428302",
"0.5396942",
"0.53731453",
"0.5330174",
"0.5328233",
"0.5321968",
"0.53056675",
"0.53010714",
"0.5298837",
"0.52677816",
"0.5255463",
"0.5232176",
"0.5232176",
"0.522724... | 0.71184665 | 0 |
Checks if we are leaving a function that is a method, and reports if 'this' has not been used. Static methods and the constructor are exempt. Then pops the context off the stack. | function exitFunction(node) {
const stackContext = popContext();
if (stackContext?.member == null ||
stackContext.class == null ||
stackContext.usesThis ||
(ignoreOverrideMethods && stackContext.member.override) ||
(ignoreClassesTha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static popEnterContext() {\n if (Utils.enterFunctionStack.length)\n Utils.enterFunction = Utils.enterFunctionStack.pop();\n else\n Utils.enterFunction = null;\n }",
"_exitContext() {\n this._stack.pop();\n }",
"\"ClassBody:exit\"() {\n stack.pop()... | [
"0.6214324",
"0.5819079",
"0.5652767",
"0.55839795",
"0.546619",
"0.53720045",
"0.52686995",
"0.5235635",
"0.51722676",
"0.5171922",
"0.5081893",
"0.50533104",
"0.49074432",
"0.48200238",
"0.47930154",
"0.47803864",
"0.4773725",
"0.4765562",
"0.47604588",
"0.47303975",
"0.472... | 0.73043776 | 0 |
function declarations have their own `this` context | FunctionDeclaration() {
pushContext();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function foo() {\n alert(this);\n}",
"function y(){f.call(this)}",
"function y(){f.call(this)}",
"function y(){f.call(this)}",
"function aFunction () {\n console.log(this); \n}",
"function foo1() {\n console.log(\"Hello Foo1\");\n console.log(this);\n}",
"function fff() {\n \"use strict\";\n... | [
"0.66105896",
"0.6600593",
"0.6600593",
"0.6600593",
"0.6591204",
"0.6586688",
"0.65770483",
"0.6573295",
"0.65469456",
"0.6511474",
"0.6503741",
"0.64991826",
"0.64991826",
"0.6483954",
"0.6471858",
"0.6457388",
"0.6432266",
"0.6411941",
"0.6406237",
"0.6405225",
"0.63885057... | 0.6950959 | 0 |
Class static blocks are implicit functions. They aren't required to use `this`, but we have to push context so that it captures any use of `this` in the static block separately from enclosing contexts, because static blocks have their own `this` and it shouldn't count as used `this` in enclosing contexts. | StaticBlock() {
pushContext();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStaticContext(bind, scope) {\n\t var object = bind.object || bind.callee.object;\n\t return scope.isStatic(object) && object;\n\t}",
"function getStaticContext(bind, scope) {\n\t var object = bind.object || bind.callee.object;\n\t return scope.isStatic(object) && object;\n\t}",
"function getSta... | [
"0.6162322",
"0.6162322",
"0.6091307",
"0.6007116",
"0.56699437",
"0.56501",
"0.55792797",
"0.5576939",
"0.55430186",
"0.5529848",
"0.5501412",
"0.54843175",
"0.54804665",
"0.54312795",
"0.5380055",
"0.53540415",
"0.53540415",
"0.53540415",
"0.53540415",
"0.53540415",
"0.5354... | 0.77720225 | 0 |
Fetches playlist and refreshes the cache! | async fetch() {
return await this.client.playlists.get(this.id, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}",
"loadTracks(){\n let url = 'http://localhost:3000/user/' + Auth.getUsername() + '/playlist/' + this.props.params.playlistId;\n this.setState({playlistId: this.props.params.playlistId})... | [
"0.6886704",
"0.6813579",
"0.67492574",
"0.674804",
"0.6718849",
"0.6661126",
"0.66099346",
"0.6585739",
"0.6573778",
"0.6531322",
"0.65270114",
"0.6433837",
"0.640178",
"0.6388767",
"0.6336333",
"0.6333369",
"0.63044703",
"0.62863314",
"0.6257619",
"0.62295955",
"0.62295955"... | 0.7048619 | 0 |
Returns the images of the playlist! | async getImages() {
return await this.client.playlists.getImages(this.id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getImages() {\n var gallery = await getGallery();\n var featured = [];\n for (var i = 0; i < 5; i++) {\n featured.push(gallery.results[i].thumbs[1].src);\n }\n return featured;\n }",
"function getTrackImages(track_response) {\n let html_string = ... | [
"0.67257273",
"0.66914845",
"0.66511434",
"0.65310615",
"0.6421547",
"0.6320416",
"0.63089716",
"0.6300633",
"0.6282589",
"0.6277656",
"0.626762",
"0.62576455",
"0.62465733",
"0.6201905",
"0.6195636",
"0.619281",
"0.61193246",
"0.61193246",
"0.6116385",
"0.6083412",
"0.605134... | 0.7718846 | 0 |
Follow a playlist inshort words add the playlist to your library! | async follow(options) {
return await this.client.user.followPlaylist(this.id, options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSpotifyPlaylist(message) {\n spotifyApi.createPlaylist('MaeshBot\\'s Playlist', { 'description': 'Playlist converted from YouTube by MaeshBot :)', 'public': true })\n .then(function (data) {\n var spotifyPlaylistId = data.body.id;\n titles.forEach((title) => {\n ... | [
"0.677433",
"0.64986223",
"0.6493492",
"0.6493492",
"0.646766",
"0.64550793",
"0.64214367",
"0.64175487",
"0.63879865",
"0.6371848",
"0.63420475",
"0.6304552",
"0.6289914",
"0.6278197",
"0.6232196",
"0.6189356",
"0.61615723",
"0.6145459",
"0.614204",
"0.6121187",
"0.6107505",... | 0.6593376 | 1 |
Verify if many or some user follows a playlist! | async userFollows(...ids) {
return (await this.client.playlists.userFollows(this.id, ...ids))[0] || false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async follow(options) {\n return await this.client.user.followPlaylist(this.id, options);\n }",
"function showUserPlaylists() {\n getUserPlaylists().then(text => {\n var playlists = JSON.parse(text);\n for (var playlist in playlists) {\n console.log(playlist);\n i... | [
"0.6436244",
"0.6153629",
"0.60529715",
"0.5965384",
"0.5955001",
"0.58561844",
"0.5847063",
"0.5828068",
"0.5757109",
"0.5623597",
"0.5516313",
"0.5510739",
"0.55049795",
"0.547824",
"0.5473491",
"0.54650754",
"0.54450047",
"0.54427654",
"0.5436447",
"0.5413243",
"0.5401586"... | 0.6831895 | 0 |
Upload a custom image to the playlist! | async uploadImage(image) {
return await this.client.playlists.uploadImage(this.id, image);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function addImage() {\n const file = document.querySelector(\"#fileInput\").files[0]\n const title = $('#albumTitel').val()\n const desc = $('#albumDisc').val()\n const image = await toBase64(file)\n const hash = urlParams.get('hash');\n const id = urlParams.get('id');\n uploadImage(image, hash, id, t... | [
"0.6483397",
"0.6475716",
"0.64546806",
"0.638692",
"0.637733",
"0.62282383",
"0.61828727",
"0.6175715",
"0.61085385",
"0.60407573",
"0.60381454",
"0.60227203",
"0.6020132",
"0.59603626",
"0.59208256",
"0.5911862",
"0.589362",
"0.58862615",
"0.5870335",
"0.5865704",
"0.583238... | 0.6535686 | 0 |
Make a new flowfield | function mousePressed() {
flowfield.init();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FlowField(size, margin, modx, mody) {\n\tthis.data = [];\n\tthis.size = size; // 20 \n\tthis.margin = margin; // 5\n\n\tthis.simplex = new SimplexNoise();\n\n\t// TODO: add sliders -> modx/mody\n\t// this.gen(0.01, 0.02);\n\tthis.gen(modx, mody)\n}",
"_createField (name) {\n return new Field(this, na... | [
"0.63185966",
"0.60935646",
"0.59943604",
"0.5849046",
"0.5844564",
"0.5822452",
"0.5762089",
"0.57327855",
"0.57327855",
"0.57085264",
"0.5640998",
"0.5636888",
"0.5636199",
"0.5623771",
"0.56122154",
"0.5610377",
"0.56000036",
"0.5559603",
"0.5520856",
"0.55161107",
"0.5503... | 0.63131243 | 1 |
Finds the path to the tsc package executable by converting the file path of: /Users/spongebob/serverlessstack/node_modules/typescript/dist/index.js to: /Users/spongebob/serverlessstack/node_modules/.bin/tsc | function getTsBinPath() {
const pkg = "typescript";
const filePath = require.resolve(pkg);
const matches = filePath.match(/(^.*[/\\]node_modules)[/\\].*$/);
if (matches === null || !matches[1]) {
throw new Error(`There was a problem finding ${pkg}`);
}
return path.join(matches[1], ".bin"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildTypescript() {\n const gulpTSProject = gulpTypescript.createProject(TSCONFIG_NAME);\n\n return gulp.src('src/**/*.ts')\n .pipe(gulpTSProject())\n .pipe(gulp.dest(COMPILE_OUT_DIR));\n}",
"function CompileTypeScript(){\n console.log(\"Compiling ts files\");\n return tsProject.src().pipe... | [
"0.5768222",
"0.56403726",
"0.54107034",
"0.53999865",
"0.5376718",
"0.53067106",
"0.5168734",
"0.50462437",
"0.4975003",
"0.49520054",
"0.4905216",
"0.4895177",
"0.4894689",
"0.48793384",
"0.48453873",
"0.48255518",
"0.48008823",
"0.47945702",
"0.47790718",
"0.47707555",
"0.... | 0.78133136 | 0 |
Uses the current file path and the package name to figure out the path to the CLI. Converts: /Users/spongebob/Sites/serverlessstack/packages/resources/dist/App.js to: /Users/jayair/Sites/serverlessstack/packages/cli | function getSstCliRootPath() {
const filePath = __dirname;
const packageName = "resources";
const packagePath = filePath.slice(0, filePath.lastIndexOf(packageName) + packageName.length);
return path.join(packagePath, "../cli");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"extendCli (cli) {\n cli\n .command('metadata <targetDir> [...inputPaths]', 'Generate required metadata for the API reference docs')\n .option('-o <dir>', 'Output directory. Defaults to <targetDir>/api/')\n .action(async (targetDir, inputPaths, options) => {\n if (inputPaths.lengt... | [
"0.58825696",
"0.57669145",
"0.57090986",
"0.5559545",
"0.5548891",
"0.5541485",
"0.5535249",
"0.54688764",
"0.54665154",
"0.5427307",
"0.542678",
"0.54162115",
"0.52896017",
"0.52793556",
"0.5260363",
"0.52541715",
"0.52146494",
"0.5212609",
"0.5202647",
"0.52003866",
"0.517... | 0.6508852 | 0 |
defining function to get keys from all pages, data upload operation in callback function | function listAllKeys(marker, cb)
{
s3.listObjects({Bucket:bucket, Marker: marker,MaxKeys:500}, function(err, data1){
allKeys.push(data1.Contents);
//console.log('all keys have been listed now processing them to upload data in '+table);
allKeys[0].forEach(i=>{
//console.log(i.Key);
var par... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mget(keys, on_response) {\n this.httpGet('mget', function(resp) {\n on_response(resp.mgetIterator());\n //getMultiValue();\n }, keys.join('&'));\n }",
"function nextStepStorageUpload() {\r\n debug(3, \"nextStepStorageUpload\");\r\n getAmtStorage(function (statusCode, ... | [
"0.5703119",
"0.56706315",
"0.5668304",
"0.56641364",
"0.5656551",
"0.5651068",
"0.56042665",
"0.55924076",
"0.5560787",
"0.55088806",
"0.5497886",
"0.54933083",
"0.54896927",
"0.5465691",
"0.5413123",
"0.541302",
"0.5410574",
"0.5405655",
"0.53963906",
"0.53699446",
"0.53630... | 0.591746 | 0 |
deep loop an array, tranfer to an string as return value | function _loopArray(array, key) {
var res = [],
typeIn;
for (var i = 0, len = array.length; i < len; i++) {
typeIn = _typeOf(array[i]);
switch (typeIn) {
// two refrence type(Object/Array) need to loop them and push the return value to the result arr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n ... | [
"0.6583145",
"0.657352",
"0.657352",
"0.657352",
"0.6486381",
"0.6486381",
"0.64794815",
"0.64788955",
"0.64624196",
"0.61359483",
"0.5905356",
"0.5877329",
"0.5870592",
"0.5866502",
"0.5851196",
"0.58246475",
"0.5817183",
"0.581505",
"0.5814644",
"0.5800302",
"0.5756105",
... | 0.6817608 | 0 |
deep loop an object, tranfer to an string as return value | function _loopObject(object, key) {
var res = [],
typeIn;
for (var i in object) {
typeIn = _typeOf(object[i]);
switch (typeIn) {
// two refrence type(Object/Array) need to loop them and push the return value to the result array
case "A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function traverseObject (someObj){\n\n let result = \"\";\n let keys = Object.keys(someObj);\n \n for (i in obj){ \n result += i +\" is \"+someObj[i]+\"\\n\";\n }\n return result;\n}",
"function objectInspector(object, result) {\n if (object == null)\n return \"Object is null\";\n ... | [
"0.64115226",
"0.6397718",
"0.63198185",
"0.6175357",
"0.6081807",
"0.6074792",
"0.6056945",
"0.601672",
"0.59784734",
"0.5959685",
"0.5958645",
"0.5957209",
"0.59500766",
"0.59136075",
"0.5892083",
"0.58712894",
"0.58712894",
"0.58712894",
"0.58712894",
"0.58712894",
"0.5871... | 0.6793548 | 0 |
Take a potentialy stupidly long URL and inject ellipsis as reasonable. | function elideUrl(url) {
if (url.length < 40)
return url;
var protoIdx = url.indexOf("://");
var lslash = url.lastIndexOf("/");
if (lslash != -1)
lslash = url.lastIndexOf("/", lslash - 1);
if (lslash == -1)
return url;
return url.substring(0, protoIdx + 3) + "..." + url.substring(lslash);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function truncateUrl(url) {\n if (url.length > 80) {\n return url.substring(0, 80) + \"...\"\n }\n return url;\n}",
"urlShorten(url) {\n let name = url;\n\n if (url.length > 50) {\n name = url.substr(0, 33);\n name += \"...\";\n name += url.substr(-14);\n }\n\n return name;\n }"... | [
"0.75003093",
"0.6981463",
"0.67730224",
"0.67343116",
"0.6459926",
"0.63598764",
"0.63250875",
"0.62688357",
"0.6233244",
"0.62279963",
"0.61680484",
"0.61513317",
"0.6149428",
"0.6136886",
"0.6135124",
"0.6135124",
"0.6135124",
"0.61310506",
"0.61293375",
"0.61209434",
"0.6... | 0.73489004 | 1 |
Render Actions according to currTab | renderActions(currTab) {
switch(currTab) {
case 'userManagement' :
return (
<div className={`actionContent actionContentCluster`}>
<div className='tabContent'>
<Tabs className='line' id="primary-tab" selectedTabId={this.state.primaryTab} onChange=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n return (\n <div className='panel'>\n <button onClick={() => {this.selectTab(global.orgListTab)}}>Список организаций</button>\n <button onClick={() => {this.selectTab(global.empListTab)}}>Список сотрудников</button>\n <button onClick={() => {this.selectTab(global.orgTreeTab... | [
"0.63959426",
"0.61402667",
"0.60086167",
"0.5994197",
"0.59258115",
"0.5895228",
"0.5887188",
"0.58170706",
"0.57594866",
"0.5698229",
"0.5661457",
"0.5657182",
"0.5653229",
"0.5646771",
"0.5644574",
"0.5628576",
"0.55976963",
"0.55893105",
"0.55810356",
"0.55615777",
"0.555... | 0.7096787 | 0 |
Finds all urls in a page that match the keywords | function candidateUrls(htmlDoc) {
const links = htmlDoc.getElementsByTagName('a');
const candidates = [];
const uniqueUrls = {};
for (let i = 0, len = links.length; i < len; i++) {
if ((matchKeyword(links[i].href) || matchKeyword(links[i].innerText)) && !(links[i].href in uniqueUrls)) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchPages() {\n var searchUrl = baseURL + 'search';\n var searchArguments = {\n 'q' : document.getElementById('idSearchKeyword').value,\n 'type' : 'page',\n 'access_token' : access_token\n };\n \n http(searchUrl).get(searchArguments)\n .then(onSearchPageResult)\n ... | [
"0.58750945",
"0.58240217",
"0.572554",
"0.5640506",
"0.5626155",
"0.56229895",
"0.5586778",
"0.5553256",
"0.5520279",
"0.54893345",
"0.5468046",
"0.54595006",
"0.5447239",
"0.5392454",
"0.53905684",
"0.53884745",
"0.537848",
"0.5372801",
"0.5339105",
"0.53370035",
"0.5334221... | 0.65104604 | 0 |
Create button with passed text as parameter. | function createButton (text) {
//console.log("Creating a button");
var element = document.createElement("BUTTON");
var textNode = document.createTextNode(text);
element.appendChild(textNode);
return element;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createButton(buttonText, name) {\n\tvar button = document.createElement(\"button\");\n\tbutton.textContent = buttonText;\n\tbutton.name = name;\n\treturn button;\n}",
"function createButton(text) {\n return $('<button data-value=\"' + text + '\" class=\"btn btn-secondary team-select\" onclick=\"showFla... | [
"0.7960178",
"0.77927893",
"0.7730376",
"0.764866",
"0.761506",
"0.74744934",
"0.74339336",
"0.73666555",
"0.7337284",
"0.7317866",
"0.7292789",
"0.7261389",
"0.7205311",
"0.71923774",
"0.7181593",
"0.71598005",
"0.71472245",
"0.71445787",
"0.7135902",
"0.71075845",
"0.709333... | 0.8500169 | 0 |
Create an heading element based on the number passed in the first parameter and heading will have text passed in the second parameter. | function createHeading (headingNumber, text) {
//console.log("Creating a heading : H" + headingNumber);
if (headingNumber > 6 || headingNumber < 1) {
console.log("Error creating heading : H" + headingNumber + ". Creating H1 instead.");
headingNumber = 1;
}
var temp = "H" + headingNumber;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"heading(text, level) {\n\t\tlet tag = `h${level}`;\n\t\treturn `<${tag}>${text}</${tag}>\\n`;\n\t}",
"function createHeading(headingObj) {\n\n let heading = headingObj.size >= 1 && headingObj.size <= 5 ? document.createElement('h'+ headingObj.size) : document.createElement('h4');\n\n heading.innerText = (t... | [
"0.73076135",
"0.7267458",
"0.7219351",
"0.71945035",
"0.69314736",
"0.6849818",
"0.6730356",
"0.6642866",
"0.66206896",
"0.6606542",
"0.659741",
"0.6587114",
"0.65831125",
"0.6575767",
"0.6521958",
"0.6362299",
"0.63528603",
"0.6346532",
"0.63262886",
"0.62958705",
"0.629249... | 0.87032574 | 0 |
Create a div and return element. | function createDiv () {
//console.log("Creating a div");
var element = document.createElement("DIV");
return element;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function div() {\n return document.createElement('div');\n }",
"function div() {\n return document.createElement('div');\n}",
"function div() {\n return document.createElement('div');\n}",
"createElement() {\n this.element = document.createElement(\"div\");\n return this.element;\n }",... | [
"0.8232875",
"0.7959887",
"0.7959887",
"0.7789829",
"0.76014096",
"0.76014096",
"0.75880295",
"0.74766564",
"0.7382118",
"0.7320782",
"0.73112273",
"0.72392917",
"0.72392917",
"0.7228782",
"0.72176605",
"0.721139",
"0.7165098",
"0.71578723",
"0.71257323",
"0.7124865",
"0.7069... | 0.8271992 | 0 |
Create a TextInput and return element. | function createTextInput () {
//console.log("Creating a text input");
var element = document.createElement("INPUT");
element.setAttribute("type", "text");
return element;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeTextInput()\n{\n const textInput = $(\"<input></input>\", {\n\t\t type: \"text\"\n\t});\n return textInput;\n}",
"function __create_text_element() { \n var input_text = document.createElement(\"input\");\n input_text.setAttribute(\"id\", cssid);\n input_text.setAttribute(\"value\", value... | [
"0.77236587",
"0.7212284",
"0.7070209",
"0.6789027",
"0.67610335",
"0.6707604",
"0.66671455",
"0.66604817",
"0.65967447",
"0.65585613",
"0.6430263",
"0.6390147",
"0.6355094",
"0.63550335",
"0.631207",
"0.62934273",
"0.6282647",
"0.62817746",
"0.6271376",
"0.62502825",
"0.6206... | 0.83068043 | 0 |
Create an IMG tag, source of the image is received in the parameter. | function createImage (imgSource) {
//console.log("createImage is running");
var image = document.createElement("img");
image.src = imgSource;
return image;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createImage(src) {\n var img = new HTMLImageElement();\n img.src = src;\n return img;\n}",
"function createImgElement(src, container) {\n\tconst img = document.createElement('img')\n\timg.src = src\n\tcontainer.appendChild(img)\n}",
"function createImg (id, src) {\n\tvar img = document.create... | [
"0.69649255",
"0.6909228",
"0.684999",
"0.6758213",
"0.6693543",
"0.6553509",
"0.6502681",
"0.64675736",
"0.6439913",
"0.6392334",
"0.63907933",
"0.6388882",
"0.63728595",
"0.63371056",
"0.6335302",
"0.62490964",
"0.62285537",
"0.62251717",
"0.6216562",
"0.61991805",
"0.61991... | 0.71826065 | 0 |
Check ref for 'STT' and allow user to use STT | function allowSTT(payload) {
if (payload.ref === 'STT') {
STTModule.speechToText();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async apiEnableSTT() {\n const body = {\n enable_stt: true,\n enable_telemetry: true,\n };\n const headers = { Authorization: `Basic ${await I.getAuth()}` };\n\n const resp = await I.sendPostRequest('v1/Settings/Change', body, headers);\n\n assert.ok(\n resp.status === 200,\n `Fa... | [
"0.58249575",
"0.49223894",
"0.49085382",
"0.49065363",
"0.48699865",
"0.48422793",
"0.48130283",
"0.48052156",
"0.47529927",
"0.47426432",
"0.47103566",
"0.46278402",
"0.4605024",
"0.4590747",
"0.4586282",
"0.45845705",
"0.45844722",
"0.45806026",
"0.45780566",
"0.45554975",
... | 0.7047202 | 0 |
`startServerProcess` will be called automatically for us by the LSP client, and is where the server will be launched from. | startServerProcess(projectPath) {
return this.spawnServer(projectPath)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startServer() {\n\tserver = require(__dirname + '/NetworkServer');\n\tserver.startServer();\n}",
"function startServer() {\n var server = new Server();\n console.log('server started');\n}",
"setProcess(proc) {\n this.serverProcess = proc;\n }",
"function launchingServer() {\n console.in... | [
"0.7024257",
"0.6572033",
"0.653499",
"0.6402298",
"0.6358339",
"0.62719953",
"0.6123568",
"0.6026743",
"0.6026058",
"0.6018802",
"0.6014634",
"0.5965922",
"0.59589225",
"0.59533507",
"0.5865027",
"0.58607084",
"0.5860257",
"0.5813086",
"0.57860947",
"0.5782097",
"0.5771542",... | 0.7705466 | 0 |
Restart the LSP (hie) server, notify the user, and clear the subscriptions. | restartServer() {
this.subscriptions.dispose();
this.restartAllServers().then(() => {
atom.notifications.addInfo("HIE is has been restarted, and is currently initializing!");
}).catch(() => {
atom.notifications.addError("Something went wrong trying to restart HIE!");
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Restart() {\n socket.emit('ClientResetAll');\n }",
"liveReload () {\n (async () => {\n try {\n await this.call('http_server.dev_subscribe')\n this.ws.removeEventListener('message', this._cmdHandler)\n this.ws.addEventListener('message', this._cmdHandler)\n } cat... | [
"0.62756217",
"0.60697836",
"0.60292244",
"0.6018655",
"0.5894313",
"0.58741534",
"0.58136994",
"0.5779527",
"0.5743629",
"0.57391",
"0.5737201",
"0.56918794",
"0.56814426",
"0.568047",
"0.567722",
"0.5635775",
"0.5618101",
"0.55730265",
"0.55500793",
"0.5536367",
"0.55132073... | 0.7773434 | 0 |
Enable the LSP debugging found in Settings > Core > Debug LSP. | enableDebug(enabled) {
atom
.config
.set('core.debugLSP', enabled);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function turnOnDebug(){\n userProp.setProperty(g_debug_key, 'true');\n loadMenu(userProp.getProperty(g_debug_key));\n}",
"enableDebugLogging(enable) {\n HyperTrack.enableDebugLogging(enable);\n }",
"function setDebugMode(debugMode) {\n g_debug = debugMode;\n}",
"setDebug() {\n this.debug ... | [
"0.6577458",
"0.64127636",
"0.6241131",
"0.6166692",
"0.6091994",
"0.60912216",
"0.60793227",
"0.60348934",
"0.5980262",
"0.5959073",
"0.5874777",
"0.58088046",
"0.5768352",
"0.5725797",
"0.57224804",
"0.56775737",
"0.56271166",
"0.562117",
"0.5594667",
"0.55924284",
"0.55801... | 0.8192492 | 0 |
get the user input as well as id to update the Department Table. | function update (dept){
if (dept != 0){
var text = prompt ('Update What ? : ')
switch(text.toUpperCase()){
case "DEPARTMENT NAME":
var input = prompt (`ENTER ${text.toUpperCase()} : `)
updatedata(dept,1,input);
break
de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDepartment() {\n con.query(\"SELECT * FROM departments\", function(err, data) {\n if (err) throw err;\n let choices = [];\n for (i = 0; i < data.length; i++) {\n choices.push({name: `${data[i].name}`, value: `${data[i].name}`});\n }\n inquirer.prompt(\n [\n... | [
"0.72437954",
"0.71413594",
"0.70066404",
"0.696717",
"0.6917272",
"0.691568",
"0.6837133",
"0.68287677",
"0.6827254",
"0.6810633",
"0.6800269",
"0.6798293",
"0.67838657",
"0.6756007",
"0.67477554",
"0.67412114",
"0.6736868",
"0.6729634",
"0.6729422",
"0.67092144",
"0.6707363... | 0.7214541 | 1 |
Fin del metodo Se verifica que las ventas esten dentro del periodo y se muta el array original de ventas. OJO: ESTE METODO REVIERTE EL ARREGLO DE VENTAS YA QUE POR DEFECTO EN EL SERVIDOR ESTAS SON ENVIADAS EN ORDEN INVERSO | __validateSales() {
let salescorrect = [];
let salesIncorrect = [];
this.sales.forEach((sale) => {
if (
sale.saleDate.isSameOrAfter(this.since) &&
sale.saleDate.isSameOrBefore(this.until)
) {
salescorrect.push(sale);
} else {
salesIncorrect.push(sale);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"separarArrays() {\n console.log(this.month + '-' + this.year);\n this.fecha = this.month + '/01/' + this.year;\n this.array1 = [];\n this.anterior = null;\n for (let i = 0; i < this.arrayT.length; i++) {\n const element = this.arrayT[i];\n if (element.year =... | [
"0.63079166",
"0.5984927",
"0.5927405",
"0.58644",
"0.5845107",
"0.579917",
"0.57828903",
"0.5711615",
"0.5711615",
"0.5627098",
"0.561819",
"0.56143034",
"0.5593451",
"0.55629116",
"0.55582833",
"0.5554012",
"0.5551375",
"0.5543952",
"0.5536222",
"0.5509975",
"0.54887974",
... | 0.60625213 | 1 |
Firebase Initialization Functions ON_PAGE_LOAD Initializes the page after all the DOM objects have been parsed by the browser. | function on_page_load(event) {
// Initialize firebase
$.getScript(firebase_api, initialize_firebase);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onPageReady () {}",
"function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }",
"function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }",
"async function initializePage()... | [
"0.72444445",
"0.7174911",
"0.71179456",
"0.70634484",
"0.70289797",
"0.70100456",
"0.6993594",
"0.69780314",
"0.6969105",
"0.6966863",
"0.6931522",
"0.69300073",
"0.6874065",
"0.6830774",
"0.6814838",
"0.68098843",
"0.6779601",
"0.67666274",
"0.6765998",
"0.67586124",
"0.674... | 0.7634611 | 0 |
INITIALIZE_FIREBASE Initializes the firebase_ref global variable and other firebase global reference variables to be used in the app, using the Firebase javascript file. | function initialize_firebase() {
// Initialize Firebase
firebase.initializeApp(firebase_configuration);
firebase_ref = firebase;
firebase_database = firebase.database();
firebase_authentication = firebase.auth();
firebase_storage = firebase.storage();
console.log("Firebase Initialized");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function firebaseInit() {\n if (!$window.firebase.apps.length) {\n var firebaseConfig = {\n apiKey: 'AIzaSyBGm_Gwo7zUW3TjAKkVoODZ6g6n4Jx6z9w',\n authDomain: 'flh-pvstation.firebaseapp.com',\n databaseURL: 'https://flh-pvstation.firebaseio.com',\n storageBucket: 'flh-pvstation.ap... | [
"0.7894133",
"0.78281784",
"0.75997037",
"0.75755924",
"0.72937316",
"0.71063685",
"0.69574517",
"0.6746928",
"0.6714192",
"0.6528189",
"0.64338076",
"0.6404531",
"0.6362867",
"0.6339783",
"0.6335907",
"0.6318052",
"0.62014973",
"0.61923134",
"0.6187375",
"0.6186344",
"0.6186... | 0.8286683 | 0 |
SignIn Initialization Functions SETUP_SIGN_IN_CONTROLS Sets up the signin option buttons with click actions. | function setup_sign_in_controls() {
var btnCreateAccount = document.getElementById("btnCreateAccount");
btnCreateAccount.setAttribute("onclick", "create_new_account()");
var btnLogin = document.getElementById("btnLogin");
btnLogin.setAttribute("onclick", "log_in()");
var btnGoogle = document.getE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function interactiveSignIn() {\r\n }",
"function SignInButton(eventId) {\n setEventId(eventId);\n setModalVisibleSignIn(true);\n }",
"function setupButtons() {\n\t$('#btnLogin').click(login);\n\t$('#btnLogout').click(logout);\n}",
"function updateSignInButtonUI() {\n document.getElementById('quick... | [
"0.6370861",
"0.6341817",
"0.6315845",
"0.6204043",
"0.61545837",
"0.60552526",
"0.6050854",
"0.6037415",
"0.592416",
"0.58733904",
"0.5834189",
"0.5743045",
"0.5740248",
"0.56768656",
"0.5637365",
"0.5596773",
"0.559389",
"0.55929476",
"0.5571273",
"0.55361515",
"0.5487711",... | 0.7048377 | 0 |
INITIALIZE_USER_MEALS_FROM_DB_SNAPSHOT Get the user's meals from storage (not the meal plans but their list of meals) | function initialize_user_meals_from_db_snapshot(db_snapshot) {
set_meals_from_db_snapshot(db_snapshot);
// Set the initial current/previous meals to the first meal when loading the page.
previous_meal = meals[0];
set_current_meal(meals[0].id);
// Populate the app interface with data
populate_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMealsLS() {\n \n const mealIds = JSON.parse(localStorage.getItem('mealIds'));\n \n return mealIds === null ? [] : mealIds;\n \n}",
"function getMeals() {\n var meals = Object.keys(_meals).map(function (id) {\n var meal = _meals[id];\n meal.id = id;\n return meal;\n });\n ca... | [
"0.6095727",
"0.6063808",
"0.5993641",
"0.582253",
"0.52887994",
"0.50665724",
"0.50608927",
"0.5024369",
"0.49846742",
"0.4938709",
"0.48684022",
"0.48587745",
"0.4849196",
"0.481874",
"0.48007444",
"0.47841477",
"0.47744355",
"0.47633463",
"0.47529596",
"0.4737319",
"0.4720... | 0.6907719 | 0 |
Authentication Functions ON_AUTHENTICATION_STATE_CHANGED Handles what happens when a user logs in and out of the app. | function on_authentication_state_changed(firebase_user) {
if (firebase_user) {
// Set the user
user = firebase_user;
console.log("User '" + user.uid + "' is logged in.");
firebase_database.ref('Users').child(user.uid).once('value', function(db_snapshot) {
if (db_snapshot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleSignIn() {\n // Sign in the user -- this will trigger the onAuthStateChanged() method\n\n }",
"function authStateChanged(){\n swapAccountModes();\n}",
"function authStateObserver(user) {\n if (user) { // User is signed in\n console.log(\"User signed in\");\n } else { // User is si... | [
"0.73382884",
"0.68260103",
"0.6794902",
"0.675502",
"0.6753324",
"0.67494756",
"0.6686017",
"0.6676733",
"0.66674936",
"0.66225463",
"0.66070974",
"0.6573619",
"0.6561117",
"0.64922357",
"0.6490939",
"0.64811325",
"0.64811325",
"0.6478005",
"0.64624155",
"0.64610785",
"0.644... | 0.6922647 | 1 |
SignIn Implementation Functions TOGGLE_CREATE_ACCOUNT_VIEW Toggles between showing the controls to create a new user account or the regular login controls for existing users. | function toggle_create_account_view() {
var btnCreateAccount = document.getElementById("btnCreateAccount");
var linkCreateAccount = document.getElementById("linkCreateAccount");
var btnLogin = document.getElementById("btnLogin");
var sign_in_provider_title_container = document.getElementById("sign_in_pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCreateAccount()\n{\n hideOrShow(\"helloButtons\", false)\n hideOrShow(\"createAccount\", true)\n hideOrShow(\"login\", false)\n hideOrShow(\"text\", false)\n hideOrShow(\"backButton\", true)\n}",
"function setup_sign_in_controls() {\n\n var btnCreateAccount = document.getElementById(\"btnCre... | [
"0.6811198",
"0.66996706",
"0.6476756",
"0.640515",
"0.63383055",
"0.6309926",
"0.6175021",
"0.6136678",
"0.6089901",
"0.6015883",
"0.6014309",
"0.60028166",
"0.59908223",
"0.5974633",
"0.59193796",
"0.587651",
"0.58601457",
"0.5854134",
"0.58503246",
"0.5793822",
"0.5777116"... | 0.75863856 | 0 |
LOG_IN_WITH_GOOGLE logs the user in using the google provider. | function log_in_with_google() {
var provider = new firebase_ref.auth.GoogleAuthProvider();
log_in_with_provider(provider);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loginGoogle() {\n var GoogleAuth = gapi.auth2.getAuthInstance();\n if (!GoogleAuth.isSignedIn.get()) {\n // User is not signed in. Start Google auth flow.\n GoogleAuth.signIn();\n }\n }",
"function logInGoogle() {\n return firebase.auth().signInWithPopup(pr... | [
"0.7677541",
"0.75101376",
"0.7504264",
"0.732118",
"0.73156214",
"0.7313915",
"0.72677666",
"0.71993214",
"0.7097724",
"0.70564306",
"0.70318806",
"0.6921562",
"0.6915281",
"0.688575",
"0.688563",
"0.6848554",
"0.68277353",
"0.6810159",
"0.68081987",
"0.67831737",
"0.6765318... | 0.8370566 | 0 |
LOG_IN_WITH_FACEBOOK logs the user in using the google provider. | function log_in_with_facebook() {
var provider = new firebase_ref.auth.FacebookAuthProvider();
log_in_with_provider(provider);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function log_in_with_google() {\n var provider = new firebase_ref.auth.GoogleAuthProvider();\n log_in_with_provider(provider);\n}",
"function logInGoogle() {\n return firebase.auth().signInWithPopup(provider);\n}",
"function loginGoogle() {\n var GoogleAuth = gapi.auth2.getAuthInstance();\n ... | [
"0.7486606",
"0.69960284",
"0.6944657",
"0.68304366",
"0.67909855",
"0.6743207",
"0.67367834",
"0.6729697",
"0.67207533",
"0.6668873",
"0.66475403",
"0.6456085",
"0.6453893",
"0.64508015",
"0.64364463",
"0.64214534",
"0.64003134",
"0.63953364",
"0.6374229",
"0.63676393",
"0.6... | 0.7234786 | 1 |
LOG_IN_WITH_PROVIDER logs the user in using some provider. | function log_in_with_provider(provider) {
firebase_authentication.signInWithPopup(provider)
.catch(function(error) {
console.log(error.message);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function login(provider) {\n var auth = $firebaseAuth();\n return auth.$signInWithPopup(provider)\n .then(loginSuccess)\n .catch(loginError);\n }",
"function providerLogin(provider, oauthOption) {\n if (!provider) {\n console.log(\"Please input... | [
"0.63952667",
"0.63575894",
"0.63153905",
"0.5962134",
"0.593508",
"0.58268315",
"0.5725666",
"0.5725666",
"0.5701225",
"0.5691211",
"0.55011535",
"0.54715216",
"0.54506814",
"0.5430122",
"0.5426696",
"0.5405444",
"0.53797823",
"0.5338759",
"0.5332203",
"0.5297117",
"0.528089... | 0.7285252 | 0 |
SETUP_CALENDAR_TITLE_AND_NAV_BUTTONS Setup the calendar title section with a title and arrow button functionality | function setup_calendar_title_and_nav_buttons() {
// Calendar month title
document.getElementById("month_title").innerHTML = formatted_date(calendar_date);
// Previous month arrow button on click event
document.getElementById("previous_month").addEventListener("click", function () {
advance_mon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calendar_helper_setTitleAndBackground(cal_event){\n if (cal_event!=null){\n if (cal_event.is_valid)\n directions_api_addTravelTimeToTitle(cal_event);\n else\n calendar_helper_updateCalEventTitleAndBackground(cal_event, openingHoursToString(cal_event.available_destina... | [
"0.6622947",
"0.64361",
"0.6372157",
"0.63513637",
"0.6338693",
"0.6330884",
"0.6244345",
"0.6201982",
"0.60275924",
"0.5834757",
"0.5818622",
"0.58071035",
"0.57621485",
"0.5728462",
"0.5713073",
"0.57057166",
"0.5657067",
"0.56477",
"0.5637008",
"0.5631149",
"0.5620635",
... | 0.8094846 | 0 |
DISPLAY_MODAL Displays the welcome modal dialog | function display_modal() {
document.getElementById('welcome_modal').style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function welcomeMessage(){\n $('#introModal').show();\n }",
"function showModal() {\n setVisible(true);\n setSignUp(false);\n }",
"function showWelcome()\n {\n// switched off on client request\n//\tvar srcFile = \"../ModelPopup/WelcomeModal.aspx\";\t//COMDIFF: prepend \"../\"\n//\tvar cFrame = new E... | [
"0.7263645",
"0.70915484",
"0.6995772",
"0.6963428",
"0.6722902",
"0.6593593",
"0.64980173",
"0.64615417",
"0.64359486",
"0.64312685",
"0.64204293",
"0.6394584",
"0.63945544",
"0.6387657",
"0.6383752",
"0.6366172",
"0.63590556",
"0.63357353",
"0.6331435",
"0.63303256",
"0.629... | 0.73072535 | 0 |
HAS_VISITED Has the user visited the site before? | function has_visited() {
return document.cookie[0] = "has_visited=true";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkVisits(){\n\t\tif(localStorage.visits == 1){\n\t\t\t//No class will be toggled, the popup will remain invisible to user and screenreader.\n\t\t\tconsole.log(\"User has visited this site before.\");\n\t\t}else{\n\t\t\tsetTimeout(makeVisible, 3000); //Delays the popup for 3 seconds\n\t\t\tconsole.log(\... | [
"0.7172434",
"0.7006636",
"0.6698265",
"0.6427476",
"0.62589175",
"0.6122426",
"0.5919351",
"0.5867126",
"0.58406323",
"0.58390534",
"0.58126014",
"0.56906873",
"0.5602985",
"0.55868274",
"0.5540413",
"0.553599",
"0.55258",
"0.54959834",
"0.5422895",
"0.5383115",
"0.53521514"... | 0.74752396 | 0 |
ADVANCE_MONTH Advances the calendar to a different month based on a_value and then repopulates the calendar | function advance_month(a_value) {
// Increment/Decrement the month
calendar_date.setMonth(calendar_date.getMonth() + a_value)
// Format the new date to only have the month name and year (e.g. January 2017)
var current_calendar_date = formatted_date(calendar_date);
// Display the formatted date on ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateMonth(cal, elem) {\n\t\tif (isNaN(cal.date.getTime()))\n\t\t\tcal.date = new Date();\n\t\tcal.date.setMonth(parseInt(elem.value));\n\t\tcalRefresh();\n\t}",
"nextMonth() {\n if (this.monthIndex==11){\n this.monthIndex = 0;\n this.year += 1;\n this.month = mo... | [
"0.61362886",
"0.61096877",
"0.6061957",
"0.60579455",
"0.60300887",
"0.59892136",
"0.58945763",
"0.5888559",
"0.5856547",
"0.58542347",
"0.5843119",
"0.5826704",
"0.58225834",
"0.58185065",
"0.5816631",
"0.58023685",
"0.57941866",
"0.57941866",
"0.57765985",
"0.5776414",
"0.... | 0.6916662 | 0 |
POPULATE_CALENDAR_DAYS Populates the calendar with squares (days) and the populates it with meal plan data | function populate_calendar_days() {
// Clear the calendar (if not empty)
var calendar_element = document.getElementById('calendar');
calendar_element.innerHTML = "";
// Setup number of days, day index, calendar square count, etc.
var number_of_days = days_in_month(calendar_date.getMonth(), calendar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateDays() {\n var now = this.createMoment()\n , currentDayOfMonth = parseInt(now.format('D'), 10)\n , isCurrentMonth = parseInt(now.month(), 10) === this.currentView.month\n , isCurrentYear = parseInt(now.year(), 10) === this.currentView.year\n , selectedDayOfMonth = null\n ... | [
"0.61771244",
"0.60592055",
"0.6041684",
"0.5857326",
"0.5850986",
"0.58171374",
"0.5785413",
"0.5782716",
"0.5778777",
"0.5764715",
"0.5764715",
"0.5755865",
"0.57464904",
"0.5745344",
"0.5724017",
"0.57197636",
"0.5708672",
"0.57003546",
"0.5695345",
"0.5654416",
"0.5650087... | 0.7139738 | 0 |
FIRST_DAY_OF_MONTH Return the first day of the week for a given month (e.g. Monday = August 1, 2016). | function first_day_of_month(year, month) {
return new Date(year, month, 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWeekDayOfFirstDayInMonth(date) {\n const dateCopy = new Date(date);\n dateCopy.setDate(1);\n return dateCopy.getDay();\n}",
"function getWeekDayFirst(){\n var currentMonthFirstDayDate = getMonthFirstDayDate();\n var weekDay = currentMonthFirstDayDate.getDay();\n\n if(weekDay == 0){\n weekDay... | [
"0.77249473",
"0.77039826",
"0.7693036",
"0.76498896",
"0.7523786",
"0.7326546",
"0.7297549",
"0.7133928",
"0.70758206",
"0.7044948",
"0.69528687",
"0.69384474",
"0.693289",
"0.69238335",
"0.6898962",
"0.68681574",
"0.68057436",
"0.6730244",
"0.6628295",
"0.6551081",
"0.63283... | 0.7754164 | 0 |
ADD_NEW_MEAL_TO_CURRENT_MONTH_MEAL_PLAN Add a new meal to the meal plan for the current month | function add_new_meal_to_meal_plan(day, meal_id, plannedMonth_id)
{
firebase_database.ref('Users_Meals/' + user.uid + "/" + meal_id).once("value", function(db_snapshot) {
// Add the meal to the database
var db_plannedMonths_mealPlans_ref = firebase_database.ref('PlannedMonths_MealPlans/' + plannedMo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMealPlanData(date, meal) {\n const mealPlanObject = newMealPlanObject(date, meal);\n // console.log('Meal Plan Object:',mealPlanObject)\n mealPlanData.push(mealPlanObject);\n localStorage.setItem('mealPlanData', JSON.stringify(mealPlanData));\n }",
"function newMealPlan... | [
"0.63203377",
"0.59308565",
"0.5873011",
"0.57613236",
"0.57596076",
"0.57469463",
"0.5736202",
"0.5683051",
"0.5680928",
"0.56356156",
"0.56235117",
"0.5603784",
"0.55500984",
"0.549064",
"0.5476054",
"0.54205775",
"0.54092807",
"0.5404522",
"0.53950703",
"0.5377527",
"0.526... | 0.6435888 | 0 |
update_day Update a meal's day in a meal plan (e.g. If the user moved a meal from one day to another) | function update_day(meal_plan, target_day, meal_id)
{
// Find the meal in the meal plan using the meal_id and meal_plan parameters
for (var i = 0; i < meal_plan.meal_plan.length; i++)
{
// If found update the day to the target day parameter
if (meal_plan.meal_plan[i].meal.id == meal_id)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function overwrite_meal_plan_day(target_day, source_day) {\n // Check if current_plannedMonth is the same as the current month...\n if ((current_plannedMonth.formatted_date == formatted_date(calendar_date)) && (isValueSet(current_plannedMonth.id))) {\n // Save the changes to the database\n var ... | [
"0.65729046",
"0.61824036",
"0.6141158",
"0.6053912",
"0.5824515",
"0.5819598",
"0.57675207",
"0.56844944",
"0.56726456",
"0.56255674",
"0.56212485",
"0.5595673",
"0.5537778",
"0.55215764",
"0.55034894",
"0.5496663",
"0.54880404",
"0.541283",
"0.5395398",
"0.5325496",
"0.5320... | 0.7746502 | 0 |
ALLOW_MEAL_DROP Allows the meal image to be dropped over other HTML elements | function allow_meal_drop(event) {
// By default, data/elements cannot be dropped in other elements.
// To allow a drop, we must prevent the default handling of the element.
// This is done by calling the event.preventDefault() method for the ondragover event
event.preventDefault();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleImageDrop(e) {\n var file, imageReader;\n e.preventDefault();\n e.stopPropagation();\n if (e.originalEvent.dataTransfer) {\n if (e.originalEvent.dataTransfer.files.length > 0) {\n file = e.originalEvent.dataTransfer.files[0];\n ima... | [
"0.6210464",
"0.6151083",
"0.6138807",
"0.61040133",
"0.5930299",
"0.58637226",
"0.5846531",
"0.5822482",
"0.5811885",
"0.58010924",
"0.5798605",
"0.578432",
"0.5774976",
"0.57701427",
"0.57621485",
"0.57510567",
"0.5749075",
"0.57253766",
"0.571662",
"0.56939006",
"0.56925",... | 0.7415355 | 0 |
Overwrite Meal Plan Day Overwrites a meal plan day by updating the record of the source day with the target day, and deleting the record with the target day. | function overwrite_meal_plan_day(target_day, source_day) {
// Check if current_plannedMonth is the same as the current month...
if ((current_plannedMonth.formatted_date == formatted_date(calendar_date)) && (isValueSet(current_plannedMonth.id))) {
// Save the changes to the database
var db_planne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_day(meal_plan, target_day, meal_id)\n{\n // Find the meal in the meal plan using the meal_id and meal_plan parameters\n for (var i = 0; i < meal_plan.meal_plan.length; i++)\n {\n // If found update the day to the target day parameter\n if (meal_plan.meal_plan[i].meal.id == me... | [
"0.6803582",
"0.51420426",
"0.51364344",
"0.4944222",
"0.4884973",
"0.48739606",
"0.47653946",
"0.47322956",
"0.46900216",
"0.46298823",
"0.45578945",
"0.45316127",
"0.45139036",
"0.4509189",
"0.44942683",
"0.4461643",
"0.44584587",
"0.44399217",
"0.4434546",
"0.44319302",
"0... | 0.7398217 | 0 |
Deletes the currently selected meal from the users meals | function delete_meal_from_meal_list()
{
if (!current_meal.is_calendar_meal) {
if (confirm("Are you sure you want to remove " + current_meal.name + " from your meals? (This cannot be undone)")) {
// Get the meal id
var meal_id = current_meal.id;
// Remove that one item fr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mealReferenceDeletedDialog(selection, e){\n // Deleted Selected Item if no 'future' meal plan items have the meal in it\n // Todays Date\n const today = new Date();\n today.timeStartOfDay();\n // Meal Flag\n let activeMeal = false;\n // \n mealPlanDa... | [
"0.7068452",
"0.64599",
"0.6366295",
"0.6258887",
"0.60364574",
"0.6006233",
"0.6003295",
"0.59463567",
"0.5899161",
"0.58974135",
"0.58244497",
"0.5773802",
"0.5756936",
"0.5756093",
"0.5735364",
"0.57190645",
"0.5703632",
"0.56904674",
"0.56895304",
"0.5686548",
"0.56821406... | 0.7634294 | 0 |
Deletes the currently selected calendar meal from the current month's meal plan | function delete_meal_from_calendar()
{
if (current_meal.is_calendar_meal) {
var meal_id = current_meal.id
var meal_image_element_to_be_removed = document.getElementById("drag_" + meal_id + "_calendar");
var meal_name_element_to_be_removed = document.getElementById("calendar_day_data_containe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete_meal_from_meal_list()\n{\n if (!current_meal.is_calendar_meal) {\n if (confirm(\"Are you sure you want to remove \" + current_meal.name + \" from your meals? (This cannot be undone)\")) {\n // Get the meal id\n var meal_id = current_meal.id;\n\n // Remove ... | [
"0.70729387",
"0.67142147",
"0.6590024",
"0.62420714",
"0.6085105",
"0.60190547",
"0.5946139",
"0.5937166",
"0.58621114",
"0.5667965",
"0.5592405",
"0.5586643",
"0.55747086",
"0.5573048",
"0.5557868",
"0.55421025",
"0.5520313",
"0.5510156",
"0.5501188",
"0.5474628",
"0.547305... | 0.7086698 | 0 |
POPULATE_MEAL_LIST Populates the meal list on the right hand side of the interface | function populate_meal_list()
{
// Get the meal list (container) and clear it of any items
var meal_list_element = document.getElementById('meal_unordered_list');
meal_list_element.innerHTML = "";
for (var i = 0; i < meals.length; i++)
{
add_meal_list_element(meals[i].id, meals[i].name, mea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayRandomMeal(randomMeal) {\n const randomMealData = [];\n // Check if ingredients exist\n for (let j = 1; j <= 20; j++) {\n // push all the ingredient into the array\n if (randomMeal[`strIngredient${j}`]) {\n randomMealData.push(`${randomMeal[`strIngredient${j}`]} : ... | [
"0.5854556",
"0.58418244",
"0.58407193",
"0.58358",
"0.58102274",
"0.57712007",
"0.5746727",
"0.5736246",
"0.5680577",
"0.55658555",
"0.556381",
"0.5546484",
"0.55453587",
"0.55210805",
"0.5498256",
"0.54748785",
"0.5471428",
"0.5460729",
"0.54309297",
"0.54252726",
"0.541821... | 0.65346503 | 0 |
Add meal list element Adds a meal list element to the meal list with an id, name, and image_path. | function add_meal_list_element(id, name, image_path) {
var id = id;
var image_path = image_path;
var meal_list_item_element = document.createElement("li");
var meal_name_element = document.createElement("div");
var image_element = document.createElement("img");
// Set up the meal image element
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMealsToLs(idMeal) {\n const favMeals = getMealsFromLs();\n localStorage.setItem(\"fav-meals\", JSON.stringify([...favMeals, idMeal]));\n}",
"function addToImgList(name, id) {\n\t\n\tpoi_img_list.push({'name': name, 'data': {'$id': id}});\n}",
"function populate_meal_list()\n{\n // Get the meal... | [
"0.6918796",
"0.65563136",
"0.6544502",
"0.63317966",
"0.6093319",
"0.59685177",
"0.5691675",
"0.56803745",
"0.56755704",
"0.5650822",
"0.5635567",
"0.5586702",
"0.55838346",
"0.55703527",
"0.5568612",
"0.5559557",
"0.5500345",
"0.5484265",
"0.54832196",
"0.54638",
"0.5393871... | 0.6944235 | 0 |
Show Hide Ingredient Remove Buttons Toggles between sh | function show_hide_ingredeint_remove_buttons(isShow)
{
if (isShow) {
for (var ingredient in current_meal.ingredients) {
if (current_meal.ingredients.hasOwnProperty(ingredient)) {
// Ensure a remove button doesn't already exist
if (!isValueSet(document.getElementBy... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleRemoveButtonsVisibility() {\n if ($('.load-cars-editing-item').length > 1) {\n $('.remove-load-car-model').removeClass('hidden');\n } else {\n $('.remove-load-car-model').addClass('hidden');\n }\n}",
"function addDelete (ingredient){\n\n if (ingredient.hasClass('deleted')){... | [
"0.69256496",
"0.6606858",
"0.6438695",
"0.64115053",
"0.6172485",
"0.61491686",
"0.614793",
"0.6108648",
"0.60959595",
"0.60691166",
"0.60647833",
"0.6036152",
"0.60184646",
"0.6015815",
"0.600879",
"0.59746814",
"0.5965994",
"0.5961927",
"0.5948625",
"0.59391963",
"0.592628... | 0.7597566 | 0 |
SELECT_MEAL_IN_MEAL_LIST Select and highlight a meal in the meal list (if not in edit mode) and populate the editor with its data | function select_meal_in_meal_list(meal_id) {
// Only do this if not in edit mode
if (!is_edit_mode) {
// Chage the current meal to the newly selected/clicked meal
set_current_meal(meal_id);
current_meal.is_calendar_meal = false;
// Populate the meal editor with the current meal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setup_meal_editor_for_adding_new_meal()\n{\n // Setup the meal editor\n show_edit_mode_controls();\n\n // Populate the editor with the new meal (all fields will be blank)\n populate_meal_editor(current_meal);\n document.getElementById('meal_name_input').focus();\n}",
"function edit_curren... | [
"0.63412374",
"0.6027538",
"0.5889535",
"0.5798953",
"0.569519",
"0.55443394",
"0.5438471",
"0.53543305",
"0.53229535",
"0.52759045",
"0.526905",
"0.5267866",
"0.5244692",
"0.52194124",
"0.5214749",
"0.52077115",
"0.5205827",
"0.5174629",
"0.5168633",
"0.51107085",
"0.5097101... | 0.7598631 | 0 |
SELECT_MEAL_IN_CALENDAR Select a meal in the calendar (if not in edit mode) and populate the editor with its data | function select_meal_in_calendar(meal_id) {
if (!is_edit_mode) {
// Chage the current meal to the newly selected/clicked meal
if ((current_plannedMonth.formatted_date == formatted_date(calendar_date)) && isValueSet(current_plannedMonth.id)) {
firebase_database.ref('PlannedMonths_MealPlan... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select_meal_in_meal_list(meal_id) {\n // Only do this if not in edit mode\n if (!is_edit_mode) {\n // Chage the current meal to the newly selected/clicked meal\n set_current_meal(meal_id);\n\n current_meal.is_calendar_meal = false;\n\n // Populate the meal editor with the... | [
"0.6940012",
"0.6081746",
"0.6030642",
"0.5793306",
"0.5714934",
"0.5701504",
"0.5559973",
"0.5552621",
"0.5549432",
"0.552157",
"0.5463696",
"0.5462592",
"0.5401282",
"0.5321642",
"0.5321127",
"0.52979666",
"0.52179515",
"0.5204911",
"0.52045697",
"0.51949775",
"0.5144202",
... | 0.63199383 | 1 |
Setup_for_adding_new_meal Actions for when the add meal button is clicked in the meal list (a.k.a. the + button) | function setup_for_adding_new_meal()
{
// Ensure the user isn't already editing or adding a meal
if (!is_edit_mode && !is_adding_new_meal)
{
is_adding_new_meal = true;
is_edit_mode = true;
// Set the previous meal
previous_meal = current_meal;
// Set the current mea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setup_meal_editor_for_adding_new_meal()\n{\n // Setup the meal editor\n show_edit_mode_controls();\n\n // Populate the editor with the new meal (all fields will be blank)\n populate_meal_editor(current_meal);\n document.getElementById('meal_name_input').focus();\n}",
"function addMeal(mea... | [
"0.7050095",
"0.6705702",
"0.62353545",
"0.6087494",
"0.60081166",
"0.5978106",
"0.5972501",
"0.5919916",
"0.58909184",
"0.5801077",
"0.57883716",
"0.57689655",
"0.5758348",
"0.5757461",
"0.57470065",
"0.5741087",
"0.5735471",
"0.5614005",
"0.56058747",
"0.55951804",
"0.55908... | 0.7865924 | 0 |
Setup_meal_editor_for_adding_new_meal Actions for when the add meal button is clicked in the meal list (a.k.a. the + button) | function setup_meal_editor_for_adding_new_meal()
{
// Setup the meal editor
show_edit_mode_controls();
// Populate the editor with the new meal (all fields will be blank)
populate_meal_editor(current_meal);
document.getElementById('meal_name_input').focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setup_for_adding_new_meal()\n{\n // Ensure the user isn't already editing or adding a meal\n if (!is_edit_mode && !is_adding_new_meal)\n {\n is_adding_new_meal = true;\n is_edit_mode = true;\n\n // Set the previous meal\n previous_meal = current_meal;\n\n // Set... | [
"0.7983672",
"0.6843558",
"0.64641386",
"0.6334358",
"0.6235582",
"0.6143701",
"0.6124175",
"0.6044058",
"0.5722545",
"0.57064956",
"0.56175107",
"0.5580226",
"0.55318284",
"0.55254364",
"0.55074954",
"0.5507052",
"0.5504957",
"0.55038154",
"0.5478157",
"0.54552346",
"0.54496... | 0.80651766 | 0 |
Add meal list item from db snapshot Adds a new meal list element to the meal list using the db snapshot of the newly added meal | function add_meal_list_item_from_db_snapshot(db_snapshot) {
// Add the meal to "meals"
var meal_object = db_snapshot.val();
meal_object.id = db_snapshot.key;
meals.push(meal_object);
// Add the meal to the meal list from the snapshot
add_meal_list_element(meal_object.id, meal_object.name, meal_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_meal_list_item_with_changes_from_db_snapshot(db_snapshot) {\n // Update the meal list item to reflect what's in the database\n var id = db_snapshot.key;\n\n set_image_src(firebase_storage.ref().child((db_snapshot.val())[\"image_path\"]), document.getElementById(\"drag_\" + id));\n docum... | [
"0.71541923",
"0.6609926",
"0.6582057",
"0.64798784",
"0.64675564",
"0.64092594",
"0.625354",
"0.6229777",
"0.61478776",
"0.610278",
"0.6063976",
"0.6003349",
"0.59805334",
"0.58833736",
"0.58833736",
"0.5877362",
"0.5869437",
"0.5848727",
"0.5846417",
"0.5845219",
"0.5844072... | 0.86829346 | 0 |
Updates meal list item from db snapshot Updates meal list element in the meal list using the db snapshot of the edited meal | function update_meal_list_item_with_changes_from_db_snapshot(db_snapshot) {
// Update the meal list item to reflect what's in the database
var id = db_snapshot.key;
set_image_src(firebase_storage.ref().child((db_snapshot.val())["image_path"]), document.getElementById("drag_" + id));
document.getElement... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_meal_list_item_from_db_snapshot(db_snapshot) {\n // Add the meal to \"meals\"\n var meal_object = db_snapshot.val();\n meal_object.id = db_snapshot.key;\n meals.push(meal_object);\n\n // Add the meal to the meal list from the snapshot\n add_meal_list_element(meal_object.id, meal_obje... | [
"0.73472977",
"0.7231633",
"0.60236055",
"0.58929133",
"0.58213633",
"0.57944626",
"0.5784925",
"0.56861395",
"0.5682922",
"0.5671989",
"0.56393546",
"0.56384337",
"0.5637515",
"0.5635618",
"0.5634948",
"0.562959",
"0.56138164",
"0.5608734",
"0.5604109",
"0.5603705",
"0.55824... | 0.78266925 | 0 |
ADD_INGREDIENT Adds an ingredient to the current_meal with the value of the ingredient text field. | function add_ingredient()
{
var ingredient_input_field = document.getElementById('meal_ingredient_input');
if (is_edit_mode && ingredient_input_field.value != '')
{
// Get the value from the field
var ingredient = ingredient_input_field.value;
// Add it to the current meal
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addIngredientToList(ingredient) {\r\n console.log(ingredient);\r\n var ele = $(INGREDIENT_TEMPLATE);\r\n $(\"#add-ingredient .list-group\").append(ele);\r\n ele.find(\".amount\").html(ingredient.numberOfUnits);\r\n ele.find(\".unit\").html(ingredient.ingredient.unit.name);\r\n ele.find(\... | [
"0.6577114",
"0.6512802",
"0.6434407",
"0.6373025",
"0.6292291",
"0.624701",
"0.61457956",
"0.6028616",
"0.59949136",
"0.5971213",
"0.5919985",
"0.5918917",
"0.5901328",
"0.58976567",
"0.5876924",
"0.5836567",
"0.5773028",
"0.56852144",
"0.5668466",
"0.56636727",
"0.5601062",... | 0.78029233 | 0 |
HIGHLIGHT_CURRENT_MEAL Highlights the currently selected meal in the meal list so the user knows which one they are one | function highlight_current_meal(meal_id, is_being_selected_from_meal_list)
{
// Remove the highlight on the last selected meal in the meal list (if any)
var meal_list_element = document.getElementById("meal_list_item_" + previous_meal.id);
if (isValueSet(meal_list_element)) {
meal_list_element.style... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select_meal_in_meal_list(meal_id) {\n // Only do this if not in edit mode\n if (!is_edit_mode) {\n // Chage the current meal to the newly selected/clicked meal\n set_current_meal(meal_id);\n\n current_meal.is_calendar_meal = false;\n\n // Populate the meal editor with the... | [
"0.65122944",
"0.5944168",
"0.5640234",
"0.55943483",
"0.55845946",
"0.55724204",
"0.5558894",
"0.55437136",
"0.55037093",
"0.5470528",
"0.5462352",
"0.54587907",
"0.5447054",
"0.5446988",
"0.540732",
"0.53880346",
"0.5387685",
"0.53712404",
"0.5339119",
"0.53051734",
"0.5297... | 0.73823655 | 0 |
REMOVE_INGREDIENT Removes an ingredient from the current meal | function remove_ingredient(ingredient)
{
// Check if in edit mode (only remove in edit mode)
if (is_edit_mode)
{
// Remove (or delete) the ingredient from the ingredient list of the current meal
delete current_meal.ingredients[ingredient];
// Remove the ingredient HTML element
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeIngredient(e) {\n if(e.target.parentElement.classList.contains('delete-item')){\n e.target.parentElement.parentElement.remove();\n }\n}",
"[REMOVE_MEAL_ITEM](state, item) {\n state.meal.items = state.meal.items.filter(i => i !== item);\n }",
"deleteIngredient(ingredient){\n con... | [
"0.7028428",
"0.6556813",
"0.63961744",
"0.6315781",
"0.6255076",
"0.617809",
"0.6158856",
"0.6068365",
"0.6018195",
"0.5954789",
"0.5816391",
"0.5794746",
"0.57646465",
"0.5753491",
"0.5747772",
"0.5732158",
"0.5717099",
"0.56854993",
"0.56300724",
"0.55934584",
"0.5572549",... | 0.78848374 | 0 |
User Feedback Functions Shows the friend request popup dialog window | function show_user_feedback_dialog() {
document.getElementById('user_feedback_pop_up_background').style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_friend_request_dialog() {\n document.getElementById('friend_request_pop_up_background').style.display = \"block\";\n}",
"openFeedbackDialog() {}",
"showFeedback(feedback) {\n if (feedback === \"phoneAndPasswords\") {\n confirmAlert({\n title: 'Feil',\n ... | [
"0.723535",
"0.64272726",
"0.6390383",
"0.6357221",
"0.6339773",
"0.62764794",
"0.6250764",
"0.6223684",
"0.6197098",
"0.6191165",
"0.61780375",
"0.61545426",
"0.61398",
"0.60829264",
"0.60806227",
"0.60427284",
"0.60353804",
"0.6024525",
"0.6006914",
"0.6002944",
"0.598692",... | 0.6955936 | 1 |
Shows the friend request popup dialog window | function show_friend_request_dialog() {
document.getElementById('friend_request_pop_up_background').style.display = "block";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendRequest() {\n FB.ui({\n method: 'apprequests',\n suggestions: appFriendIDs,\n message: 'Learn how to make your mobile web app social',\n }, function(response) {\n console.log('sendRequest UI response: ', response);\n });\n}",
"function hide_friend_request_dialog(event) {\n var moda... | [
"0.6399213",
"0.6382023",
"0.62915903",
"0.6209512",
"0.6117244",
"0.60823417",
"0.60191494",
"0.5976136",
"0.59740245",
"0.5923282",
"0.59145766",
"0.588633",
"0.58822405",
"0.58628947",
"0.5847235",
"0.58406776",
"0.5837016",
"0.5834714",
"0.57720155",
"0.5751993",
"0.57307... | 0.79830205 | 0 |
Accepts the friend request of the currently selected "option" in the selction box | function accept_friend_request() {
handle_friend_request_accept_or_decline(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handle_friend_request_accept_or_decline(is_accepted) {\n var awaiting_friend_requests_selection_element = document.getElementById('friend_request_list');\n var selected_request = awaiting_friend_requests_selection_element.options[awaiting_friend_requests_selection_element.selectedIndex];\n var r... | [
"0.6804059",
"0.6523603",
"0.6275553",
"0.61874837",
"0.6067293",
"0.6009487",
"0.6001864",
"0.5974825",
"0.5923775",
"0.5870509",
"0.5869376",
"0.5802425",
"0.57710445",
"0.57445914",
"0.57418483",
"0.5734767",
"0.57339424",
"0.57251745",
"0.56582296",
"0.5655262",
"0.565092... | 0.6562888 | 1 |
Declines the friend request of the currently selected "option" in the selction box | function decline_friend_request() {
handle_friend_request_accept_or_decline(false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handle_friend_request_accept_or_decline(is_accepted) {\n var awaiting_friend_requests_selection_element = document.getElementById('friend_request_list');\n var selected_request = awaiting_friend_requests_selection_element.options[awaiting_friend_requests_selection_element.selectedIndex];\n var r... | [
"0.65437585",
"0.6132303",
"0.6071457",
"0.59440327",
"0.59316844",
"0.5851622",
"0.580661",
"0.57392174",
"0.57283163",
"0.57266504",
"0.57194453",
"0.57049584",
"0.5691077",
"0.568836",
"0.566818",
"0.56479305",
"0.561551",
"0.5594929",
"0.55901587",
"0.5515105",
"0.5502253... | 0.6946612 | 0 |
Accepts the friend request of the currently selected "option" in the selction box | function handle_friend_request_accept_or_decline(is_accepted) {
var awaiting_friend_requests_selection_element = document.getElementById('friend_request_list');
var selected_request = awaiting_friend_requests_selection_element.options[awaiting_friend_requests_selection_element.selectedIndex];
var request_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function accept_friend_request() {\n handle_friend_request_accept_or_decline(true);\n}",
"function acceptRequest() {\n $('.friends-requesting').on('click', '.accept', function () {\n var username = $(this).data('friend-name');\n\n var url = '/' + username + '/accept-friend';\n\n ... | [
"0.6562398",
"0.6522876",
"0.6276516",
"0.6189096",
"0.6068203",
"0.6011323",
"0.60015583",
"0.5975108",
"0.5922659",
"0.5870681",
"0.5869117",
"0.5802387",
"0.5770513",
"0.5743312",
"0.57408035",
"0.573446",
"0.573307",
"0.5724679",
"0.5656761",
"0.5655574",
"0.56519145",
... | 0.6804523 | 0 |
Populates the friend list in the popup that the user can share meals with | function populate_friend_list() {
firebase_database.ref('Users_Friends/' + user.uid).once("value", function(db_snapshot) {
var friends = db_snapshot.val();
var friend_selection_element = document.getElementById('share_meal_with_friend_list');
for (var friend_record_id in friends) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function friends() {\n // private variables\n var renderWidget = function(to_user) {\n var requestData = {\n 'to_user' : to_user\n }\n var promise = mymd.ajax.getDataObject('/friend/status/', requestData, 'friends');\n promise.done(function(status){\n if (status === 'AVAIL... | [
"0.64339495",
"0.6147363",
"0.61405736",
"0.60497755",
"0.6016186",
"0.6007366",
"0.58799595",
"0.58645177",
"0.58484644",
"0.5837395",
"0.58259827",
"0.5817545",
"0.5808157",
"0.58041054",
"0.578441",
"0.57740724",
"0.5767621",
"0.5761302",
"0.5758872",
"0.5747835",
"0.57418... | 0.6757425 | 0 |
Populates the image picker list with user images | function populate_meal_image_picker_list_with_user_images() {
toggle_image_category_label_selected(false);
populate_meal_image_picker_list(user_meal_images_url_cache);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populate_meal_image_picker_list_with_default_images() {\n toggle_image_category_label_selected(true);\n populate_meal_image_picker_list(default_meal_images_url_cache);\n}",
"function setUploadedImagesList() {\n //see: http://api.jquery.com/jQuery.get/\n $.post(\"./common/controller.php\",\n ... | [
"0.738267",
"0.7195557",
"0.6855397",
"0.6709198",
"0.6645978",
"0.66321075",
"0.64444494",
"0.6428592",
"0.63695693",
"0.62939435",
"0.62854195",
"0.62786144",
"0.6257429",
"0.62438464",
"0.6236135",
"0.62171066",
"0.6205457",
"0.62033004",
"0.6171401",
"0.61328745",
"0.6130... | 0.857716 | 0 |
Populates the image picker list with default images | function populate_meal_image_picker_list_with_default_images() {
toggle_image_category_label_selected(true);
populate_meal_image_picker_list(default_meal_images_url_cache);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populate_meal_image_picker_list_with_user_images() {\n toggle_image_category_label_selected(false);\n populate_meal_image_picker_list(user_meal_images_url_cache);\n}",
"function initializeImagePicker() {\n $('#selectProjectImages').imagepicker({\n selected: onImagePickerOptionChange\n ... | [
"0.7826656",
"0.72506833",
"0.71942616",
"0.7044729",
"0.66659313",
"0.66651803",
"0.645546",
"0.6446115",
"0.6376531",
"0.6340121",
"0.63147515",
"0.62980753",
"0.62853193",
"0.62758106",
"0.62694913",
"0.62436664",
"0.6220069",
"0.61999726",
"0.6182288",
"0.6172781",
"0.615... | 0.8657635 | 0 |
this function app holds the stack for all the screens | function App() {
//returns the screens from top to bottom
return (
//the navigation container holds all the screens for the navigation
<NavigationContainer>
{/*this holds the stack and gives the initial screen as the homescreen*/}
<Stack.Navigator initialRouteName="Home">
{/*this screen ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AppStack() {\n return(\n <NavigationContainer>\n <appNavStack.Navigator>\n <appNavStack.Screen name=\"Home\" component={HomeScreen} />\n </appNavStack.Navigator>\n </NavigationContainer>\n );\n}",
"function AppStack(){\n return(\n <Stack.Navig... | [
"0.65737754",
"0.6423468",
"0.6341023",
"0.62674",
"0.62468433",
"0.61834323",
"0.61466134",
"0.614258",
"0.61022586",
"0.60582155",
"0.60240626",
"0.5990084",
"0.59837866",
"0.5931289",
"0.5929412",
"0.59237283",
"0.59216964",
"0.5919241",
"0.5858223",
"0.5853835",
"0.584535... | 0.67886454 | 0 |
just to edit all spreadsheets simultaneously, delete/create functions as necessary | function deleteAndCreateSheets(){
var spreadsheets = DriveApp.getFolderById('1IwJosiO60iiGvzXhkXH1l55QycLGIEmg').getFiles();
var spreadsheet;
var sheetName = "";
var formula1 = '=IFERROR({{INDIRECT("'+sheetName+'!$A$1:$C$1")};{FILTER({INDIRECT("Old!$A:$C")},ISERROR(MATCH(INDIRECT("Old!$A:$A"),INDIRECT("'+she... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function gsrun(cl) {\n try {\n const gsapi = google.sheets({ version: \"v4\", auth: cl });\n const wb = new Excel.Workbook();\n let excelFile = await wb.xlsx.readFile(\"./allegro.xlsx\");\n let ws = excelFile.getWorksheet(\"Sheet1\"); // the name of the worksheet\n let datalocal = ws.getSheet... | [
"0.6239587",
"0.61918604",
"0.61625344",
"0.61175585",
"0.6064076",
"0.60611236",
"0.5986398",
"0.59846926",
"0.59496236",
"0.59265137",
"0.58395827",
"0.58386785",
"0.5838079",
"0.5786919",
"0.5779133",
"0.57636184",
"0.5626754",
"0.56034464",
"0.56021",
"0.5593818",
"0.5591... | 0.62259233 | 1 |
Back up sheet before clearing it so both sheets can be contrasted and compared | function backUpOldSheet(lab,excelToSheet) {
//declare both sheet variables
var backupSheet = SpreadsheetApp.openById(excelToSheet).getSheetByName("Old") || SpreadsheetApp.openById(excelToSheet).insertSheet("Old");
//SpreadsheetApp.openById(excelToSheet).setActiveSheet(SpreadsheetApp.openById(excelToSheet).getShee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearSheet() {\n var lastRow = sheet.getLastRow();\n var lastColumn = sheet.getLastColumn();\n\n if (lastRow > 1) {\n sheet.getRange(2, 1, lastRow - 1, lastColumn).clearContent();\n }\n}",
"function backupSheet(sheet) {\n if (_MAX_SHEET_BACKUPS>0) {\n var name = sheet.getName();\n var spre... | [
"0.6260509",
"0.6036539",
"0.5976039",
"0.5922102",
"0.58969724",
"0.5833462",
"0.56576043",
"0.56562704",
"0.565422",
"0.5646458",
"0.5568486",
"0.5544244",
"0.55318147",
"0.5520065",
"0.55124557",
"0.5473333",
"0.5473318",
"0.5427678",
"0.5378741",
"0.5373256",
"0.5339524",... | 0.67099774 | 0 |
List all the labs in the lab software folder | function listLabs(){
var labsArray = DriveApp.getFolderById("1QHnqC8YNWfXIUA2yOPNKOhSLszh61ZBU").getFiles();
var names = [];
var moddedNames = [];
var iterator = 0;
while (labsArray.hasNext()){
//Return labs (with the Excel file format removed from the end of the name)
lab = labsArray.next();
name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function grabLabyrinths() {\n // Grab all the labyrinths\n var labs = JSON.parse(localStorage['labyrinths']);\n\n return labs;\n}",
"function loadAll() {\n var repos = [\n {\n 'name' : 'Angular 1',\n 'url' : 'https://github.com/a... | [
"0.5414706",
"0.52921903",
"0.52513283",
"0.5190648",
"0.51535434",
"0.5151897",
"0.5089005",
"0.5053528",
"0.4998341",
"0.4997769",
"0.49881402",
"0.4987342",
"0.4985942",
"0.4982913",
"0.49404168",
"0.49354732",
"0.49181804",
"0.49062476",
"0.49042487",
"0.48947996",
"0.487... | 0.65204936 | 0 |
delete temporary container when tab is closing | function rmCallback(tabId, removeInfo) {
function cleanClosedTabs() {
tc.checkUnusedContainer()
}
setTimeout(cleanClosedTabs, 5000)
// ISSUE: no time to get tabId, by the time browser.tabs.get(tabId), the
// tab is already closed... so instead each time a tab is closed, we trigger
// a checkUnusedConta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClosed() {\n // save lastTab that the user was on\n dynamicData.state.activeTabName = currentTab;\n MyAvatar.hasScriptedBlendshapes = false;\n addRemoveFlowDebugSpheres(false);\n deleteMirror();\n }",
"handleClose() {\n this.clearContainer();\n }",
"clearTab... | [
"0.6687989",
"0.6644183",
"0.6633635",
"0.66271013",
"0.65982723",
"0.65567696",
"0.649482",
"0.6469267",
"0.6455183",
"0.6363359",
"0.6309993",
"0.63092846",
"0.63054156",
"0.6296762",
"0.62882984",
"0.6284084",
"0.62827367",
"0.62785506",
"0.6275606",
"0.6271215",
"0.625801... | 0.6695428 | 0 |
Load Intro Videos into the DOM | function loadVideos() {
// if(videosloaded === false) {
// var req = new XMLHttpRequest();
// req.open('GET', $vid+'intro.mp4', true);
// req.responseType = 'blob';
// req.onload = function() {
// // Onload is triggered even on 404
// // so we need to check the status code... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playVidintroVideo (event) {\n vidIntroVideo.play();\n }",
"function loadVideo(videoIndex) {\n var videoSrc = VIDEOS[videoIndex][1];\n $(\".main-video-source\").attr(\"src\", videoSrc);\n $(\".main-video\").get(0).load();\n}",
"function showIntro (){\n $('#video_intro')[0].play();\n ... | [
"0.66549265",
"0.66233003",
"0.65094346",
"0.65012884",
"0.64323926",
"0.63173693",
"0.6301405",
"0.6282816",
"0.62819207",
"0.627601",
"0.626389",
"0.6253703",
"0.62377393",
"0.62252873",
"0.6222931",
"0.6219971",
"0.62040895",
"0.61944294",
"0.6188886",
"0.6166575",
"0.6160... | 0.66811174 | 0 |
Add the included data | addIncludedArray(payload) {
if (!isEmpty(this.included)) {
payload.included = this.included;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addToIncluded(data) {\n let found = A(this.included).find((model) => {\n return model.id === data.id && model.type === data.type;\n });\n if (!found) {\n this.included.push(data);\n }\n }",
"function includeRawDataFile(includedFiles, files, entryFilename, data) {\n let orderedFiles = incl... | [
"0.7130495",
"0.62575454",
"0.6241283",
"0.5979261",
"0.57776153",
"0.57526535",
"0.56968796",
"0.5680832",
"0.5614621",
"0.5578443",
"0.55740047",
"0.5568747",
"0.5552338",
"0.5547961",
"0.5530501",
"0.55082005",
"0.55030566",
"0.54981554",
"0.5476164",
"0.54489905",
"0.5422... | 0.6403931 | 1 |
Add the model to included array unless it's already there. | addToIncluded(data) {
let found = A(this.included).find((model) => {
return model.id === data.id && model.type === data.type;
});
if (!found) {
this.included.push(data);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addIncludedArray(payload) {\n if (!isEmpty(this.included)) {\n payload.included = this.included;\n }\n }",
"addToIncludedFromProxy(proxy) {\n proxy.includeKeys().forEach((modelKey)=> {\n let includedModels = proxy.getInclude(modelKey);\n includedModels.forEach((data)=> {\n this.ad... | [
"0.6445763",
"0.5939194",
"0.5707134",
"0.56773376",
"0.554097",
"0.538011",
"0.5317643",
"0.52808577",
"0.5274417",
"0.5253805",
"0.5207235",
"0.51620704",
"0.51107633",
"0.5072144",
"0.50562036",
"0.50527143",
"0.5043685",
"0.497181",
"0.49610043",
"0.49606216",
"0.4956719"... | 0.76796573 | 0 |
Variant changed event handler that updates the displayed product attributes based on the given event. | _onUpdateVariant(event) {
const variant = event.detail.variant;
if(!variant) return;
// Update internal state
this._state.sku = variant.sku;
// Update values and enable add to cart button
this._element.querySelector(Product.selectors.sku).innerTe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onUpdateVariant(event) {\n const variant = event.detail.variant;\n if (!variant) return;\n\n // Update internal state and 'data-product-sku' attribute of price element\n this._state.sku = variant.sku;\n this._element.querySelector(Product.selectors.price).setAttribute('data-prod... | [
"0.7612619",
"0.70698595",
"0.68754286",
"0.60465467",
"0.60040057",
"0.59852195",
"0.59407586",
"0.58955383",
"0.5871188",
"0.58221376",
"0.58131146",
"0.5794267",
"0.57859236",
"0.5747644",
"0.5732184",
"0.57299066",
"0.5720449",
"0.5687718",
"0.56545645",
"0.5603162",
"0.5... | 0.76374644 | 0 |
Download content as a file Parameters : name : String, the name of the file to download content : String, the content of the file to save Return : none | static Download(name, content) {
var link = document.createElement("a");
// link.href = "data:application/octet-stream," + encodeURIComponent(content);
link.href = URL.createObjectURL(content);
link.download = name;
link.click();
link = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static Download(name, content) {\r\n\t\tvar link = document.createElement(\"a\");\r\n\t\t\r\n\t\tlink.href = \"data:application/octet-stream,\" + encodeURIComponent(content);\r\n\t\tlink.download = name;\r\n\t\tlink.click();\r\n\t\tlink = null;\r\n\t}",
"function download(content, fileName) {\n // response: res... | [
"0.793039",
"0.7385838",
"0.70497125",
"0.6961426",
"0.67662144",
"0.674092",
"0.66962326",
"0.6637164",
"0.66256",
"0.6581682",
"0.6568161",
"0.65481776",
"0.6547422",
"0.64895386",
"0.6482568",
"0.6441417",
"0.641632",
"0.6402751",
"0.6395186",
"0.63914263",
"0.6330986",
... | 0.79348105 | 0 |
Direct constructor if you have a server structure ready, or doing some tests. In case arguments are changed, please also check verifyRand function's comments. | constructor(
serverObj,
cryptor = undefined,
checkRand = false,
verifyRandDB = undefined
) {
if (cryptor === undefined) {
cryptor = new AESCryptor();
}
if (!(cryptor instanceof Cryptor)) {
throw new TypeError(
"'cryptor' argument must be an instance of class extending C... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Server() {}",
"constructor(){\n\n console.log(\"NodeServer constructor\");\n this.nodeServer = null;\n }",
"function myServer() {\n\tthis.server = server;\n}",
"constructor(cryptor, db, checkRand = false, verifyRandDB = undefined) {\n if (!(cryptor instanceof Cryptor)) {\n t... | [
"0.6609273",
"0.64721",
"0.6454524",
"0.6299455",
"0.62798524",
"0.6279031",
"0.62597185",
"0.624707",
"0.623463",
"0.6230891",
"0.6116112",
"0.6054751",
"0.6032929",
"0.6016437",
"0.6006561",
"0.60053205",
"0.59850985",
"0.59509975",
"0.59348774",
"0.59285295",
"0.5926809",
... | 0.697549 | 0 |
Verifies the Ticket Granting Ticket and returns the key stored in it. In case the structure of TGT is changed in Kerberos_KDC/KerberosTGS this must be updated. cUid1 and cUid2 are identifies of a perticular user, and must be same on TGS and on a perticuar server | verifyTicketAndGetKey(cUid1, cUid2, ticketEncStr) {
const ticket = this.decryptTicket(ticketEncStr);
const crrTime = Date.now();
// In case the requesting user is not the one ticket was granted to
if (ticket.uid1 !== cUid1 || ticket.uid2 !== cUid2) {
throw new ServerError('Invalid Ticket Holder');... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"verifyTGTAndGetKey(cUid1, cUid2, tgtEncStr) {\n const tgt = this.decryptTGT(tgtEncStr);\n const crrTime = Date.now();\n\n if (tgt.target !== 'TGS') {\n throw new ServerError('Not a TGT');\n }\n // In case there is some error of time settings on servers\n // The timestamps in ticket must alwa... | [
"0.7429949",
"0.5635286",
"0.54920065",
"0.4928039",
"0.48970625",
"0.4888657",
"0.47341797",
"0.46890387",
"0.45386603",
"0.44723982",
"0.4454376",
"0.44259897",
"0.43889698",
"0.43769178",
"0.4364664",
"0.4345232",
"0.43277267",
"0.42938018",
"0.42903212",
"0.4245621",
"0.4... | 0.7104273 | 1 |
Ecrypts the encrypted response object given. In case the structure of TGT is changed in Kerberos_KDC/KerberosTGS this must be updated. cUid1 and cUid2 are identifies of a perticular user, and must be same on TGS and on a perticuar server | encryptRes(cUid1, cUid2, response, ticket) {
const key = this.verifyTicketAndGetKey(cUid1, cUid2, ticket);
const encRes = this.cryptor.encrypt(
key,
JSON.stringify(response),
this.initVal
);
return encRes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"verifyTGTAndGetKey(cUid1, cUid2, tgtEncStr) {\n const tgt = this.decryptTGT(tgtEncStr);\n const crrTime = Date.now();\n\n if (tgt.target !== 'TGS') {\n throw new ServerError('Not a TGT');\n }\n // In case there is some error of time settings on servers\n // The timestamps in ticket must alwa... | [
"0.56285334",
"0.5577287",
"0.5477507",
"0.5342153",
"0.5055761",
"0.50464785",
"0.502915",
"0.50108266",
"0.49216682",
"0.49011195",
"0.48767644",
"0.48567805",
"0.48327535",
"0.47931775",
"0.468086",
"0.46408534",
"0.4618588",
"0.4585111",
"0.45789644",
"0.45774087",
"0.453... | 0.6550937 | 0 |
Function to verify the random number give by user is not already used by that user. Used to prevent Replay attacks. The checkRand argument in constructor must be given true in order to use this. This is not done directly in decrypt request as it may not be neccessary that the encrypted request will directly contain the... | verifyRand(rand, cUid1, cUid2) {
if (!this.checkRand) {
throw new TypeError(
'This instance was not initialized with check_rand = True'
);
}
if (!rand) {
throw new ServerError("'rand' is not present");
}
if (isNaN(rand)) {
throw new ServerError('rand must be a Number'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"verifyRand(rand, cUid1, cUid2) {\n if (!this.checkRand) {\n throw new TypeError(\n 'This instance was not initialized with check_rand = true'\n );\n }\n if (!rand) {\n throw new ServerError(\"'rand' is not present\");\n }\n if (isNaN(rand)) {\n throw new ServerError('rand ... | [
"0.664753",
"0.54153067",
"0.54123145",
"0.5407565",
"0.5259672",
"0.5244617",
"0.52163434",
"0.5214811",
"0.51767975",
"0.51248235",
"0.505062",
"0.5044654",
"0.49928358",
"0.49711823",
"0.49445507",
"0.49294806",
"0.49168947",
"0.49159414",
"0.4905623",
"0.48928273",
"0.487... | 0.670126 | 0 |
formats the results into a generic list with parameters like mainfieldtoshow and addnfieldtoshow | get resultsToShow() {
let resultsLocal = this.results.map(item => {
item.mainFieldToShow = item[this.mainFieldToShow];
item.addnFieldToShow = item[this.addnFieldToShow];
return item;
});
return resultsLocal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayResultList(resultsArray) {\n resultsArray.forEach(function (gmObject) {\n resultItem.innerHTML += '<li><span class=\"highlight\">From:</span> ' + companyname + ' ' + gmObject.from + '<br /><span class=\"highlight\">To:</span> ' + gmObject.to + '<br /><br /> <span class=\"h... | [
"0.61367404",
"0.6090331",
"0.58472806",
"0.58349466",
"0.5796645",
"0.57917655",
"0.577761",
"0.5772427",
"0.5752832",
"0.5662141",
"0.56609076",
"0.5650342",
"0.56444347",
"0.56244886",
"0.5612043",
"0.56025803",
"0.55978864",
"0.5596478",
"0.5594554",
"0.5543624",
"0.55369... | 0.67112064 | 0 |
For the makeTree function the aside element is created and to place the h1 within, you must append that variable to the variable where you created the aside element. Then, i simply declared the function makeBranches. Lastly, displayed all nodes by getting their id, giving propert of textcontent. | function makeTree() {
var eD = document.createElement("aside");
eD.setAttribute("id", "treeBox");
var evi = document.createElement("h1");
evi.textContent = "Node Tree";
eD.appendChild(evi);
document.getElementById("main").appendChild(eD);
var nodeList = document.create... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function configureTree(){\n\tvar config = {\n\t\tcontainer: \"#overview\",\n\t\tconnectors: {\n\t\t\ttype: 'step'\n\t\t},\n\t};\n\n\tvar parent_node = {\n\t\ttext: { name: \"INF3272\" },\n\t\tHTMLclass : \"nodeRoot\",\n\t\tinnerHTML : \"INF3272<p><a href=\\\"/node/116#overlay-context=node/11\\\" target=\\\"_self\\... | [
"0.6639786",
"0.6492744",
"0.6486497",
"0.637729",
"0.63582164",
"0.626032",
"0.6218442",
"0.6138482",
"0.61208284",
"0.6112614",
"0.60937726",
"0.6073147",
"0.60723066",
"0.6066317",
"0.6061379",
"0.6031488",
"0.599305",
"0.599199",
"0.5963775",
"0.5912824",
"0.5908873",
"... | 0.8066467 | 0 |
Creates Array of neighbours' positions for Block at given (x, y) position | function createNeighbours(x, y) {
var arr = new Array()
if(y > 1)
arr.push([x, y-1])
if(y < (h/blockSize)-1)
arr.push([x, y+1])
if(x > 1)
arr.push([x-1, y])
if(x < (w/blockSize)-1)
arr.push([x+1, y])
return arr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findNeighbouringBlocks(xpos, ypos){\n let neighbours = [];\n if (xpos > 0){\n neighbours.push([xpos - 1, ypos]);\n if (ypos > 0) {\n neighbours.push([xpos - 1, ypos - 1]);\n }\n if (ypos < levelMap[xpos].length - 1){\n neighbours.push([xpos - 1, ypos + 1]);\n }... | [
"0.7314274",
"0.72247803",
"0.70262647",
"0.6934295",
"0.6914383",
"0.6846744",
"0.6846675",
"0.6835263",
"0.67643243",
"0.67602813",
"0.67527944",
"0.6747329",
"0.67439944",
"0.674187",
"0.67407584",
"0.6738421",
"0.6736098",
"0.6720233",
"0.6706206",
"0.66940117",
"0.667975... | 0.8045704 | 0 |
Determines whether the hash argument affects the starting project | function isProjectRelatedHash(hash) {
if (!hash) {
return false;
}
switch (hash.cmd) {
case "follow":
case "newproject":
case "newjavascript":
// case "gettingstarted": // This should be true, #gettingstarted hash handling is not yet implemented
case "tutorial... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkHash() {\n // open pages on load based on the url hash\n var windowHash = window.location.hash;\n switch (windowHash ) {\n case \"#about\":\n loadAboutPage();\n break;\n case \"#gallery\":\n loadGalleryPage();\n break;\n case \"#projects\":\n loadProj... | [
"0.5926964",
"0.5705081",
"0.5680516",
"0.5629692",
"0.5616943",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5513765",
"0.5410207",
"0.5405082",
"0.5394439",
"0.53688616",
"0.53629494",
"0.53574973",
"0.5335367",
... | 0.6646892 | 0 |
This function migrates existing projectes in pouchDb to indexDb From browserworkspace to idbworkspace | function migrateBrowserWorkspaceAsync() {
return getDbAsync()
.then(function (db) {
return db.getAllAsync(HEADERS_TABLE);
})
.then(function (allDbHeaders) {
if (allDbHeaders.length) {
// There are already scripts using the idbworkspace, so a migration has already happ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"upgrade(db, oldVersion, newVersion, transaction) {\n //store\n const store = db.createObjectStore('messages', {\n keyPath: 'id',\n autoIncrement: true,\n })\n store.createIndex('row', 'row', { unique: false })\n store.createIndex('column', 'column', { unique: false })\n ... | [
"0.5659214",
"0.5638536",
"0.550151",
"0.5489688",
"0.544824",
"0.5408494",
"0.5360423",
"0.53015983",
"0.5301186",
"0.5280722",
"0.5276924",
"0.52618706",
"0.5252141",
"0.5252141",
"0.5245945",
"0.5244086",
"0.5244086",
"0.5244086",
"0.5244086",
"0.5244086",
"0.5244086",
"... | 0.5804242 | 0 |
checks to see if the line ends in a colon, indicating the start of a code block | function isCodeBlock(s) {
s = s.trim();
return s[s.length - 1] == ':';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function code(state, startLine, endLine/*, silent*/) {\n var nextLine, last;\n\n if (state.tShift[startLine] - state.blkIndent < 4) { return false; }\n\n last = nextLine = startLine + 1;\n\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++;\n continue;\n }\n if (sta... | [
"0.66460204",
"0.65503913",
"0.63841176",
"0.62989783",
"0.6284773",
"0.62635887",
"0.6233945",
"0.6208228",
"0.60732347",
"0.60516495",
"0.6051016",
"0.6048419",
"0.60191476",
"0.6011271",
"0.59917974",
"0.5976011",
"0.5955999",
"0.59334105",
"0.58098894",
"0.58005077",
"0.5... | 0.7525231 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.