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
Check if the specified calendar is writable from an ACL point of view.
userCanAddItemsToCalendar(aCalendar) { let aclEntry = aCalendar.aclEntry; return ( !aclEntry || !aclEntry.hasAccessControl || aclEntry.userIsOwner || aclEntry.userCanAddItems ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isCalendarWritable(aCalendar) {\n return (\n !aCalendar.getProperty(\"disabled\") &&\n !aCalendar.readOnly &&\n (!Services.io.offline ||\n aCalendar.getProperty(\"cache.enabled\") ||\n aCalendar.getProperty(\"cache.always\") ||\n aCalendar.getProperty(\"requiresNetwork\") ===...
[ "0.75636166", "0.65030366", "0.5670375", "0.5375114", "0.52913654", "0.523745", "0.52286804", "0.50780433", "0.5056158", "0.5025929", "0.5016948", "0.4878531", "0.4876354", "0.47928292", "0.47914124", "0.47734922", "0.4759501", "0.4739518", "0.47247875", "0.46604615", "0.4657...
0.6936581
1
Check if the user can delete items from the specified calendar, from an ACL point of view.
userCanDeleteItemsFromCalendar(aCalendar) { let aclEntry = aCalendar.aclEntry; return ( !aclEntry || !aclEntry.hasAccessControl || aclEntry.userIsOwner || aclEntry.userCanDeleteItems ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userCanAddItemsToCalendar(aCalendar) {\n let aclEntry = aCalendar.aclEntry;\n return (\n !aclEntry || !aclEntry.hasAccessControl || aclEntry.userIsOwner || aclEntry.userCanAddItems\n );\n }", "function checkPermissions()\n\t\t{\n\t\t\t//these will have to be recalced in case they change\n\t\t\tvar...
[ "0.73829097", "0.5936137", "0.5864279", "0.5740848", "0.5691731", "0.5242174", "0.49504387", "0.49009934", "0.48691478", "0.4868628", "0.4850866", "0.48434088", "0.48363453", "0.483121", "0.48117566", "0.4766176", "0.47558177", "0.47440588", "0.47322685", "0.47244853", "0.469...
0.88938004
0
Check if the user can fully modify the specified item, from an ACL point of view. Note to be confused with the right to respond to an invitation, which is handled instead by userCanRespondToInvitation.
userCanModifyItem(aItem) { let aclEntry = aItem.aclEntry; return ( !aclEntry || !aclEntry.calendarEntry.hasAccessControl || aclEntry.calendarEntry.userIsOwner || aclEntry.userCanModify ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userCanRespondToInvitation(aItem) {\n let aclEntry = aItem.aclEntry;\n // TODO check if || is really wanted here\n return calacl.userCanModifyItem(aItem) || aclEntry.userCanRespond;\n }", "_updateCanEdit() {\n const reviewRequest = this.get('reviewRequest');\n const userSession = RB.UserS...
[ "0.7299625", "0.6043377", "0.6025673", "0.5818552", "0.5803522", "0.57593066", "0.5750171", "0.56376034", "0.5603438", "0.55872506", "0.55696696", "0.5569447", "0.55693257", "0.5513042", "0.5471275", "0.5461129", "0.545165", "0.54469025", "0.5445282", "0.5419031", "0.54060316...
0.80974585
0
Checks if the user can modify the item and has the right to respond to invitations for the item.
userCanRespondToInvitation(aItem) { let aclEntry = aItem.aclEntry; // TODO check if || is really wanted here return calacl.userCanModifyItem(aItem) || aclEntry.userCanRespond; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userCanModifyItem(aItem) {\n let aclEntry = aItem.aclEntry;\n return (\n !aclEntry ||\n !aclEntry.calendarEntry.hasAccessControl ||\n aclEntry.calendarEntry.userIsOwner ||\n aclEntry.userCanModify\n );\n }", "_updateCanEdit() {\n const reviewRequest = this.get('reviewRequest'...
[ "0.696797", "0.6195808", "0.5796214", "0.57549435", "0.575177", "0.574474", "0.568467", "0.5652446", "0.5641973", "0.56376", "0.56246066", "0.5604169", "0.56007683", "0.55911547", "0.55782235", "0.5426276", "0.53729886", "0.5342076", "0.53103703", "0.5308522", "0.52489775", ...
0.7626089
0
Get sites for today
function getSitesToday() { // Get per day stats var key = getKeyName(); var st = JSON.parse(localStorage.getItem(key)); var sitesToday = {}; for (var site in st) { if (st.hasOwnProperty(site)) { sitesToday[site] = st[site]; } } return sitesToday; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getObservationsSiteList() {\n\t\t$.get('http://datapoint.metoffice.gov.uk/public/data/val/wxobs/all/json/sitelist?key=85d42778-8866-4eac-9f4e-ad2b5c42db1c',\n\t\t\tfunction(data) {\n\t\t\t\tlib.observationSiteList = data;\n\t\t\t\tweatherApp.init('UK');\n\t\t\t}\n\t\t);\n\t}", "function fetchSites() {\n...
[ "0.6378763", "0.6280113", "0.6220776", "0.5956067", "0.5926631", "0.58419067", "0.58310336", "0.57585865", "0.57470423", "0.56038594", "0.5579721", "0.5569694", "0.5541302", "0.54906", "0.54764605", "0.54570824", "0.5452477", "0.5439398", "0.5373613", "0.53621244", "0.5323767...
0.71900606
0
That function render stickers for the meme editor
function renderStickers() { const stickers = getStickers() const strHtmls = stickers.map(sticker => { return `<img src="${sticker.url}" alt="" onclick="onSetSticker(${sticker.id})">` }) document.querySelector('.stickers').innerHTML = strHtmls.join('') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildCanvasStickers(){\n\tfor(n=0;n<stickers_arr.length;n++){\n\t\t$.iconStickersObj[stickers_arr[n].thumbID] = new createjs.Bitmap(stickerLoader.getResult(stickers_arr[n].thumbID));\n\t\tcenterReg($.iconStickersObj[stickers_arr[n].thumbID]);\n\t\t$.iconStickersObj[stickers_arr[n].thumbID].visible = false...
[ "0.6193193", "0.56259435", "0.5514818", "0.54833883", "0.53274786", "0.530511", "0.5280421", "0.5236313", "0.51950514", "0.51842654", "0.5171075", "0.516625", "0.51615536", "0.5153914", "0.514021", "0.511974", "0.51090664", "0.50879496", "0.5086158", "0.5085532", "0.50587994"...
0.7238751
0
initializes game data to initial state modified variables: posX posY moveHistory
initGameData(){ // set position to center of the table this._posY = this._posX = parseInt(this._tableSize / 2); // clear history of moves this._moveHistory = []; this._isClicked = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InitBoardVars() {\n\t// Initialises the history array\n\tfor(var index = 0; index < MAXGAMEMOVES; ++index){\n\t\tBoard.history.push( {\n\t\t\tmove: NOMOVE,\n\t\t\tcastelPerm: 0,\n\t\t\tenPas: 0,\n\t\t\tfiftyMove: 0,\n\t\t\tposKey: 0\n\t\t});\n\t}\n\n\t// Initialises the PvTable array\n\tfor(index = 0; ind...
[ "0.6931251", "0.65930027", "0.65285164", "0.65004253", "0.6450892", "0.64308935", "0.639863", "0.63453764", "0.6293572", "0.6276519", "0.6274628", "0.62715924", "0.6246804", "0.6219415", "0.6210824", "0.6204919", "0.6202561", "0.6194578", "0.6176903", "0.61755544", "0.6162762...
0.80668026
0
load more posts, incremental loading of the post list
function nextPosts() { var url = $(articleListTailLink).get(0).href; $(articleListTailLink).html("Loading ..."); load(url, function (res, status) { if (status === "success") { cache[url] = res; cache[url] = $("<div>").append(res).find(mainContainer); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchMorePosts() {\n const localPage = page + 1;\n return fetchPosts(localPage)\n .then(results => {\n const newPosts = [...posts, ...results];\n setPosts(newPosts);\n })\n .catch(error => {\n setIsError(true);\n Logger.error(error);\n })\n .final...
[ "0.79316515", "0.7701504", "0.75831866", "0.74457824", "0.7377089", "0.736547", "0.7297446", "0.7292964", "0.72558385", "0.72221935", "0.71976393", "0.7187613", "0.7139266", "0.70878124", "0.708496", "0.708496", "0.70661056", "0.7061143", "0.69521916", "0.69120604", "0.689186...
0.7726693
1
utilitaires d'encodage/decode mime decodage uniquement pour v2 (v3 decodage automatique)
function commentDecodeMimeStr(str, charset) { CommentairesTrace("commentDecodeMimeStr str:"+str); //détection commentaire v2/v3 if (0==str.indexOf("Le%20")){ if (null!=str && ""!=str){ let tmp=str.replace(/\x09/g,""); tmp=tmp.replace(/[\x0D\x0A]/g,""); tmp=decodeURICompon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMimeTypesByExtension(){\n\t\treturn {\n\t\t\t'ai' : 'application/postscript',\n\t\t\t'aif' : 'audio/x-aiff',\n\t\t\t'aifc' : 'audio/x-aiff',\n\t\t\t'aiff' : 'audio/x-aiff',\n\t\t\t'asc' : 'text/plain',\n\t\t\t'atom' : 'application/atom+xml',\n\t\t\t'atom' : 'application/atom+xml',\n\t\t\t'au' : 'audio/basic',\n...
[ "0.61285496", "0.5773962", "0.5677877", "0.5677877", "0.5669207", "0.5668859", "0.5609824", "0.5595467", "0.5589073", "0.5582158", "0.5577832", "0.5560628", "0.5560628", "0.5560628", "0.5545314", "0.54891235", "0.5483833", "0.5459343", "0.5452048", "0.54421425", "0.5395485", ...
0.64841914
0
retourne la date courante
function DateDuJour(){ let courante=new Date(); let jour=courante.getDate(); if (jour<10) jour="0"+jour; let mois=courante.getMonth()+1; if (mois<10) mois="0"+mois; return jour+"/"+mois+"/"+courante.getFullYear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afficherdate(){ // permet d'avoir la date)\n let numeroJour = new Date().getDay();\n let nomJour = jourStr(numeroJour);\n let numeroMois = new Date().getMonth();\n let nomMois = moisStr(numeroMois);\n let annee =new Date().getFullYear();\n document.getElementById(\"date\").innerTex...
[ "0.6590312", "0.63492656", "0.6348058", "0.62784696", "0.62646747", "0.61960423", "0.616889", "0.6157708", "0.61362237", "0.61362237", "0.60991037", "0.60929996", "0.60872644", "0.60660636", "0.604311", "0.6040986", "0.6030744", "0.602746", "0.60016096", "0.5998577", "0.59916...
0.65241003
1
extraction du commentaire d'un message
function ExtraitCommentaire(msghdr){ let comment=""; let alire=Math.min(msghdr.messageSize, 100000); let dossier=msghdr.folder; let reusable=new Object(); let stream=dossier.getMsgInputStream(msghdr, reusable); let sstream=Components.classes["@mozilla.org/scriptableinputstream;1"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getDetails(msg) {\r\n\t\t\tlet elements = Array.from(msg.querySelectorAll(\".message > *\"));\r\n\t\t\t\r\n\t\t\tlet messageText = \"\";\r\n\t\t\tlet textWithoutEmotes = \"\";\r\n\t\t\tlet emotes = [];\r\n\t\t\tlet usersMentioned = [];\r\n\t\t\tlet bits = 0;\r\n\t\t\t\r\n\t\t\tfor (let element of elements) ...
[ "0.6591551", "0.6560237", "0.63400877", "0.6323922", "0.6318783", "0.6197589", "0.61789936", "0.6110824", "0.6042552", "0.5976805", "0.59163284", "0.5912681", "0.5901994", "0.5891331", "0.5834269", "0.578374", "0.5775442", "0.5760166", "0.5749055", "0.57373774", "0.5710167", ...
0.68486327
0
Construct a cell model from optional cell content.
constructor(options) { var _a; super({ modelDB: options.modelDB, id: options.id || ((_a = options.cell) === null || _a === void 0 ? void 0 : _a.id) || UUID.uuid4() }); /** * A signal emitted when the state of the model changes. */ this.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneCell(model, cell) {\n switch (cell.type) {\n case 'code':\n return model.contentFactory.createCodeCell(cell.toJSON());\n case 'markdown':\n return model.contentFactory.createMarkdownCell(cell.toJSON());\n default:\n ...
[ "0.5811454", "0.5699449", "0.5423137", "0.5393037", "0.5276982", "0.5276982", "0.5257173", "0.5225298", "0.5219491", "0.5185102", "0.51747274", "0.507133", "0.50646925", "0.5017029", "0.49976388", "0.4986654", "0.4985505", "0.49809945", "0.4937024", "0.49083215", "0.48876473"...
0.61733544
0
Get the trusted state of the model.
get trusted() { return this.modelDB.getValue('trusted'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set trusted(newValue) {\n const oldValue = this.trusted;\n if (oldValue === newValue) {\n return;\n }\n this.modelDB.setValue('trusted', newValue);\n }", "function getState() {\n if (window.usingWebComponentsPolyfill) {\n return app.activeModel;\n } else {\n...
[ "0.5663533", "0.56238306", "0.5460763", "0.54488313", "0.5429347", "0.5426378", "0.5409339", "0.5409339", "0.53971064", "0.53952336", "0.5317692", "0.5305434", "0.52669847", "0.5244133", "0.51777333", "0.51276016", "0.5112799", "0.5104766", "0.5079645", "0.5056014", "0.504307...
0.76656467
0
Set the trusted state of the model.
set trusted(newValue) { const oldValue = this.trusted; if (oldValue === newValue) { return; } this.modelDB.setValue('trusted', newValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get trusted() {\n return this.modelDB.getValue('trusted');\n }", "onTrustedChanged(trusted, args) {\n if (this._outputs) {\n this._outputs.trusted = args.newValue;\n }\n this.stateChanged.emit({\n name: 'trusted',\n oldValue: args.oldValue,\n ...
[ "0.60882574", "0.5991986", "0.54532707", "0.5327268", "0.52218795", "0.5188093", "0.51681477", "0.51267296", "0.5124604", "0.511296", "0.50551724", "0.5032675", "0.5010989", "0.4957094", "0.49251541", "0.49076495", "0.48999542", "0.48951215", "0.48938423", "0.48615402", "0.48...
0.78995615
0
Handle a change to the trusted state. The default implementation is a noop.
onTrustedChanged(trusted, args) { /* no-op */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTrustedChanged(trusted, args) {\n if (this._outputs) {\n this._outputs.trusted = args.newValue;\n }\n this.stateChanged.emit({\n name: 'trusted',\n oldValue: args.oldValue,\n newValue: args.newValue\n });\n }", "set trusted(newValue) {\...
[ "0.67840505", "0.6171301", "0.5965157", "0.5930843", "0.5921722", "0.5715753", "0.57125527", "0.5622049", "0.5612147", "0.5588606", "0.5520866", "0.5512966", "0.5506771", "0.5499376", "0.5485481", "0.5406508", "0.5393838", "0.5383523", "0.5380104", "0.5365738", "0.5365616", ...
0.7085581
0
Handle a change to the cell metadata modelDB and reflect it in the shared model.
onModelDBMetadataChange(sender, event) { const metadata = this.sharedModel.getMetadata(); this._modelDBMutex(() => { switch (event.type) { case 'add': this._changeCellMetadata(metadata, event); break; case 'change': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onSharedModelChanged(sender, change) {\n super._onSharedModelChanged(sender, change);\n this._modelDBMutex(() => {\n var _a;\n if (change.metadataChange) {\n const newValue = (_a = change.metadataChange) === null || _a === void 0 ? void 0 : _a.newValue;\n ...
[ "0.6857077", "0.6032895", "0.57523817", "0.5614182", "0.56037885", "0.55966944", "0.55138767", "0.54055464", "0.5357878", "0.531188", "0.52723044", "0.52723044", "0.5254396", "0.5236746", "0.5236741", "0.5235732", "0.5232421", "0.5217548", "0.5201647", "0.5180828", "0.5134886...
0.74973744
0
Change the cell metadata for a given event.
_changeCellMetadata(metadata, event) { switch (event.key) { case 'jupyter': metadata.jupyter = event.newValue; break; case 'collapsed': metadata.collapsed = event.newValue; break; case 'name': met...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onModelDBMetadataChange(sender, event) {\n const metadata = this.sharedModel.getMetadata();\n this._modelDBMutex(() => {\n switch (event.type) {\n case 'add':\n this._changeCellMetadata(metadata, event);\n break;\n case 'c...
[ "0.7125968", "0.561448", "0.5423826", "0.5362383", "0.53216857", "0.5191143", "0.5189915", "0.5189499", "0.5143844", "0.5112981", "0.5090948", "0.50898653", "0.50898653", "0.50898653", "0.50898653", "0.50233227", "0.50233066", "0.5021288", "0.50056314", "0.4991153", "0.498604...
0.81409824
0
Handle a change to the cell shared model and reflect it in modelDB. We update the modeldb metadata when the shared model changes. This method overrides the CodeEditor protected _onSharedModelChanged so we first call super._onSharedModelChanged
_onSharedModelChanged(sender, change) { super._onSharedModelChanged(sender, change); this._modelDBMutex(() => { var _a; if (change.metadataChange) { const newValue = (_a = change.metadataChange) === null || _a === void 0 ? void 0 : _a.newValue; if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onModelDBMetadataChange(sender, event) {\n const metadata = this.sharedModel.getMetadata();\n this._modelDBMutex(() => {\n switch (event.type) {\n case 'add':\n this._changeCellMetadata(metadata, event);\n break;\n case 'c...
[ "0.6633733", "0.6546084", "0.5908672", "0.58104986", "0.57897604", "0.57820606", "0.56526846", "0.5619333", "0.5613302", "0.5605911", "0.55464464", "0.5443226", "0.5412509", "0.53368163", "0.53305733", "0.5326271", "0.53127617", "0.5252282", "0.5244073", "0.52386206", "0.5198...
0.7240487
0
Construct a new cell with optional attachments.
constructor(options) { super(options); const factory = options.contentFactory || AttachmentsCellModel.defaultContentFactory; let attachments; const cell = options.cell; if (cell && (cell.cell_type === 'raw' || cell.cell_type === 'markdown')) { attachments = cell ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJSON() {\n const cell = super.toJSON();\n if (this.attachments.length) {\n cell.attachments = this.attachments.toJSON();\n }\n return cell;\n }", "function createCell(i, j) {\r\n var cell = {\r\n id: `cell-${i}-${j}`,\r\n i: i,\r\n j: j,\r\n ...
[ "0.58975506", "0.55486333", "0.54901385", "0.52991855", "0.5173305", "0.5162227", "0.5153504", "0.51111424", "0.5106569", "0.5106569", "0.5027938", "0.501699", "0.5003857", "0.499528", "0.49667332", "0.4927526", "0.49234954", "0.49234954", "0.49226552", "0.49085075", "0.48802...
0.6584124
0
Get the attachments of the model.
get attachments() { return this._attachments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attachments() {\n return this._attachments;\n }", "attachments() {\n return this._attachments;\n }", "attachments() {\n return this._attachments;\n }", "attachments() {\n return this._attachments;\n }", "getAttachments () {\r\n let entries = new Array();\r...
[ "0.7647142", "0.7647142", "0.7647142", "0.7647142", "0.63020676", "0.6184378", "0.6052065", "0.58224183", "0.57936686", "0.5745555", "0.56070304", "0.5582492", "0.5416655", "0.53042865", "0.52578366", "0.5253337", "0.52210784", "0.5174628", "0.5151333", "0.50759506", "0.50538...
0.76692206
0
Create an attachments model.
createAttachmentsModel(options) { return new AttachmentsModel(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Attachment() {\n}", "function createModel() {\n var model = {};\n\n var images = getImages();\n if (images.length) {\n model.images = images;\n }\n\n return model;\n }", "async upload(attachment, mime) {\n return this.rest.attachments.create(atta...
[ "0.591432", "0.57642454", "0.5668406", "0.5637252", "0.5629941", "0.5421605", "0.5415347", "0.54085016", "0.53717643", "0.53647536", "0.53629905", "0.53091264", "0.5286791", "0.527735", "0.52471656", "0.5227386", "0.5200483", "0.5192272", "0.5182303", "0.51383275", "0.5113939...
0.7510472
0
The execution count of the cell.
get executionCount() { return this.modelDB.has('executionCount') ? this.modelDB.getValue('executionCount') : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cnt() {\n return count;\n }", "function count() {\n return cnt;\n }", "getExecutionCountDecision() {\r\n let cellDecs = decisions_1.filterDecisions(this.decisions, ['cells'], 0, 2);\r\n for (let dec of cellDecs) {\r\n if (uti...
[ "0.6878655", "0.6744477", "0.67109543", "0.6514474", "0.6441189", "0.63833576", "0.63112307", "0.625739", "0.6225785", "0.6225785", "0.6167077", "0.6161603", "0.6161603", "0.6158642", "0.61563444", "0.61209905", "0.61146045", "0.6105301", "0.60918784", "0.60646594", "0.605531...
0.7291903
0
Handle a change to the trusted state.
onTrustedChanged(trusted, args) { if (this._outputs) { this._outputs.trusted = args.newValue; } this.stateChanged.emit({ name: 'trusted', oldValue: args.oldValue, newValue: args.newValue }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTrustedChanged(trusted, args) {\n /* no-op */\n }", "handleVerifyChange(event)\n\t{\n\t\tlet\tnewValue = r3IsEmptyEntityObject(event.target, 'value') ? null : event.target.value;\n\n\t\tif(!r3IsSafeTypedEntity(newValue, 'string')){\n\t\t\tconsole.warn('Changed verify new value is wrong.');\n\t\t\tret...
[ "0.69032735", "0.650126", "0.6421405", "0.62372077", "0.6108463", "0.5923103", "0.5893872", "0.5849937", "0.58455396", "0.5843079", "0.5840606", "0.58328086", "0.57247984", "0.5688536", "0.56730497", "0.5668315", "0.5621491", "0.5616218", "0.55837643", "0.5580124", "0.5553072...
0.74586767
0
Handle a change to the cell outputs modelDB and reflect it in the shared model.
onModelDBOutputsChange(sender, event) { const codeCell = this.sharedModel; this._modelDBMutex(() => { switch (event.type) { case 'add': { const outputs = event.newValues.map(output => output.toJSON()); codeCell.updateOutputs(event.newIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onSharedModelChanged(sender, change) {\n super._onSharedModelChanged(sender, change);\n this._modelDBMutex(() => {\n if (change.outputsChange) {\n this.clearExecution();\n sender.getOutputs().forEach(output => this._outputs.add(output));\n }\n ...
[ "0.67335856", "0.6099319", "0.59667116", "0.5891561", "0.57291245", "0.57291245", "0.56729805", "0.5472036", "0.546004", "0.5427554", "0.537462", "0.5327732", "0.52811235", "0.5222826", "0.51745427", "0.5166077", "0.5163974", "0.5159817", "0.5140897", "0.51146907", "0.5064631...
0.76904607
0
Handle a change to the output shared model and reflect it in modelDB. We update the modeldb metadata when the nbcell changes. This method overrides the CellModel protected _onSharedModelChanged so we first call super._onSharedModelChanged
_onSharedModelChanged(sender, change) { super._onSharedModelChanged(sender, change); this._modelDBMutex(() => { if (change.outputsChange) { this.clearExecution(); sender.getOutputs().forEach(output => this._outputs.add(output)); } if (c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onSharedModelChanged(sender, change) {\n super._onSharedModelChanged(sender, change);\n this._modelDBMutex(() => {\n var _a;\n if (change.metadataChange) {\n const newValue = (_a = change.metadataChange) === null || _a === void 0 ? void 0 : _a.newValue;\n ...
[ "0.729158", "0.6700831", "0.6089467", "0.5641546", "0.5612355", "0.5580545", "0.5504864", "0.54457635", "0.5427881", "0.5258171", "0.52170676", "0.52021176", "0.518686", "0.5174131", "0.5154975", "0.50776243", "0.50065625", "0.5003153", "0.49900538", "0.4984391", "0.49745014"...
0.7079608
1
Handle a change to the execution count.
_onExecutionCountChanged(count, args) { const codeCell = this.sharedModel; this._modelDBMutex(() => { codeCell.execution_count = args.newValue ? args.newValue : null; }); this.contentChanged.emit(void 0); this.stateChanged.emit({ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCounter() {}", "function updateCounter() {}", "countValueIncrement ( context ) {\n setTimeout( () => {\n context.commit( 'countValueIncrement' );\n }, 2000 );\n }", "function changeCount(state = { count: 0 }, action) {\n switch (action.type) {\n ...
[ "0.6428221", "0.6428221", "0.61887854", "0.6169925", "0.6036186", "0.60155463", "0.58830315", "0.5870433", "0.581008", "0.57886803", "0.5788188", "0.578681", "0.57826525", "0.57787967", "0.57407105", "0.5718845", "0.57082355", "0.5707307", "0.5690724", "0.5630666", "0.5614700...
0.79037845
0
Create an output area.
createOutputArea(options) { return new OutputAreaModel(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createOutput(index){\n\t\t\tout[index] = document.createElement(\"DIV\");\n\t\t\tout[index].id = \"crystal_out_\"+index;\n\t\t//out.classList.className = \"crystal_inp_green crystal_out_active\";\n\t\t\tout[index].classList.add(\"crystal_out\");\n\t\t\tout[index].classList.add(\"crystal_out_dark\");\n\t\t...
[ "0.66934043", "0.6586998", "0.6409025", "0.5971568", "0.5885343", "0.5823111", "0.5802928", "0.57454145", "0.5672952", "0.5670339", "0.56700367", "0.5669179", "0.5615628", "0.5565737", "0.5554395", "0.55244225", "0.5508457", "0.55042887", "0.5471188", "0.5431285", "0.53969556...
0.749772
0
Metodi per leggere/scrivere Dimensioni nello Storage TODO: da completare in base alla logica di PageStorage
constructor() { super(); // this.#dimensions = new Set(); this._dimensions = {}; // lista dimensioni presenti nello storage this.id = 0; // default // this.#name; this.storageKeys.forEach((key) => { let jsonStorage = JSON.parse(this.storage.getItem(key)); // console.log(key); if (jsonStorage.type =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storageSize() {\n return (1024 * 1024 * 5 - unescape(encodeURIComponent(JSON.stringify(storeObj))).length);\n }", "getSize() {\n let size = Object.values(this.storage);\n this.size = size.length\n return;\n }", "get allocatedStorage() {\n return this.getNumberAttr...
[ "0.63574547", "0.6215536", "0.6126403", "0.5947788", "0.578574", "0.5778824", "0.5728284", "0.5721043", "0.56891125", "0.5685105", "0.56775194", "0.5605973", "0.56059325", "0.5593845", "0.55554533", "0.55142105", "0.55023515", "0.549797", "0.5489538", "0.54853004", "0.5475511...
0.68799096
0
Player has joined session
function onJoinSession(data) { var joinSession = SearchServices.sessionByName(data.name); if (joinSession) { if (joinSession.getState() === 2) { // Spectate mode as game in progress this.emit("spectate session", {name: joinSession.name, level: joinSession.level}); for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join() {\n\t\t// Other player should see that I have joined the game...\n\t\t//COM.publish({cmd:\"join\", who:params.player});\n\t\tCOM.publish(new CMD.Join(params.player));\n\t}", "conferenceJoined() {\n this.conference.getParticipants().forEach(p => this.participantJoined(p.getId(), p));\n ...
[ "0.70703447", "0.67848665", "0.6706824", "0.6664548", "0.6661277", "0.66228175", "0.6568715", "0.65335834", "0.65286934", "0.64550006", "0.64433837", "0.6335789", "0.63137484", "0.62855536", "0.6238892", "0.62281567", "0.6181219", "0.6161089", "0.61601126", "0.61491776", "0.6...
0.6926341
1
Recursive Table Row ITEM Directive This directive actually checks the item passed in for the .children array, then creates new angulartablerowelements as needed
function itemDirective($compile){ return { restrict: "A", scope: { item: '=' }, link: function (scope, element, attrs) { if (scope.item.children) { var collectionSt = '<div agency-table-row collection="item.children" ng-show="item.active"></div...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agencyTableRowDirective($compile){\n return {\n restrict: \"A\",\n replace:true,\n template: '<div ng-repeat=\"item in collection\" item=\"item\">' +\n '<div class=\"row {{item.type}}\">' +\n '<div class=\"col-md-6\" ng-click=\"showChilds(item)\"><i ng-class=\"item.is...
[ "0.64301", "0.60337424", "0.59940153", "0.5660928", "0.5471392", "0.5458771", "0.5416401", "0.53611326", "0.5347718", "0.53095305", "0.52827424", "0.52381897", "0.5225736", "0.52210766", "0.51895213", "0.5161491", "0.5132992", "0.51246387", "0.5113775", "0.5095139", "0.509443...
0.69171184
0
pass in ownership and validation keys. Child address is generated from ownership public key and signed by ownership private key
async createTransactionSpecific (childOwnershipKeys, childValidationKeys) { this._newChildOwnershipKeys = childOwnershipKeys this._child = await Keyaddr.addrFromPublicKey(this._newChildOwnershipKeys["pubkey"]) this._child_sig = await Keyaddr.signEdText(this._newChildOwnershipKeys["privkey"], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(pk, pvk){\n this.publickey = pk\n this.privatekey = pvk\n}", "constructor(pubk, privk){\n this.publickey = pubk;\n this.privatekey = privk;\n\n}", "constructor(publickey,privatekey){\r\n this.publickey = pa;\r\n this.privatekey = pb;\r\n }", "constructor(pri,pub){\n this.privatekey=pri;...
[ "0.5875629", "0.5859613", "0.58022666", "0.57354546", "0.5627642", "0.5580693", "0.5580693", "0.5580693", "0.5580693", "0.5577563", "0.55626523", "0.55626523", "0.55626523", "0.5405636", "0.5379389", "0.53599364", "0.534034", "0.53306353", "0.5301602", "0.5301602", "0.5301602...
0.6637187
0
Decides what color blocks are based on time
function blockColor(now) { var hour = now.format('HH'); // For loop decides what color blocks are for (var k=0; k<9; k++) { // if the current hour is equal to the data value of time then set class to present if (hour == $('#' + k).attr('data-time')) { $('#' + k).removeClass("pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorTimeBlocks(){\n blockTime.each(function(){\n var thisBlock = $(this);\n var thisHour = parseInt(thisBlock.attr(\"data-hour\"));\n\n // Add styling and take it away with if statements\n if (thisHour < hrCurrent) {\n thisBlock.addClass(\"past\").removeClass(\"p...
[ "0.69926715", "0.69756573", "0.68649495", "0.6778794", "0.6524912", "0.63831806", "0.637391", "0.6289712", "0.6285886", "0.628126", "0.62709403", "0.62255484", "0.6215631", "0.62114644", "0.6176124", "0.61686164", "0.6139736", "0.61076325", "0.6079927", "0.6064031", "0.605606...
0.71055484
0
START: the options and visualisition cytobands /cytoBand is the g band width of cytoband track in the page is 1000pixels height is 15px
function showCytoband(canvasNode, cytobandsNode) { var cytobandNodes = cytobandsNode.getElementsByTagName(xmlTagCytoBand); var cytobands = []; var cytobandTrackWidth = 1000, chrLen, i; var bandRelativeFrom, bandRelativeTo, bandRelativeWidth; if(cytobandNodes.length == 0) { return; } for( i = 0; i < cytobandNod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n can = createCanvas(800, 400);\n\n // Add bar labels to the right of the canvas\n const labelContainer = document.getElementById(\"bar-labels\");\n for (let bar of bars) {\n let elm = createP(bar.title);\n elm.style(\"color\", bar.color);\n elm.parent(labelContainer);\n }\n\n con...
[ "0.5392262", "0.53093237", "0.5265173", "0.5253266", "0.52411485", "0.51473165", "0.51265585", "0.5124561", "0.51171106", "0.51159495", "0.51063836", "0.50748587", "0.5073574", "0.5071052", "0.5062533", "0.5056708", "0.505585", "0.5035246", "0.503518", "0.503178", "0.50184613...
0.70668596
0
Read data from local storage via storage.js and draw polylines on global accessible map (prepared from gmap.js)
function readAndDrawLocations() { var now = new Date(); var coords = readCoordinates( now - interval , now); /* * coordinate.id = timestamp; * coordinate.lat * coordinate.lon * coordinate.heading * coordinate.speed */ for ( var i = 1; i<= coords.length; i++) { var polyline = new GPolyline([ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawPolyFromPoints() {\n if (GLOBE.ADD_MODE) {\n ADDRESS.POLY_DRAFT.stopEdit();\n ADDRESS.POLY_DRAFT.setPath(toMVCArrayFromString($('#extracted_data').val(), false));\n $('.map_canvas').gsMap('setEditablePoly', ADDRESS.POLY_DRAFT, true);\n $('.map_canvas').gsMap(\"fitBounds\...
[ "0.6594382", "0.63747936", "0.6265504", "0.6243317", "0.6121018", "0.6117855", "0.6107693", "0.6062789", "0.6033789", "0.60097486", "0.59778583", "0.59662557", "0.5964466", "0.5944658", "0.59341204", "0.5919921", "0.59061503", "0.587637", "0.5852788", "0.58437663", "0.5840309...
0.64868635
1
Draw Tape on screen
function drawTape() { // Vertical Lines var x = 0; for(var i=0; i<=canvas.width; i++) { ctx.moveTo(x,70); ctx.lineTo(x,130); x += 50; } tapeLength = x - 50; // Top Line ctx.moveTo(0,70); ctx.lineTo(canvas.width,70); // Bottom Line ctx.moveTo(0,130); ct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawTeemo() {\n\n\timage(teemo, teemoX, teemoY, teemoWidth, teemoWidth);\n}", "function draw(){\n drawTerma(canvas,terma,TERMA_X,TERMA_Y);\n drawButtons(position); \n drawHelpIfEnabled();\n drawAlertIfShowing();\n }", "function draw() {\n if (screen === 0) {\n drawStartScreen();\n ...
[ "0.7257636", "0.69707704", "0.6827833", "0.6683352", "0.66289526", "0.6582903", "0.65535325", "0.6547557", "0.6498995", "0.6433885", "0.64295983", "0.64295983", "0.6414567", "0.64136213", "0.63791406", "0.63791406", "0.6362959", "0.63552314", "0.6353917", "0.63387096", "0.633...
0.7202098
1
Is the file in path expected to be a short one (1, 2 lines at most) or not? We just know that status.log and whatever.done files are oneliners.
function isShortFile(path) { var ext = path.split(".").pop(); var file = path.split("/").pop(); if (["done"].indexOf(ext) >= 0 || ["status.log"].indexOf(file) >= 0) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFileInConflict(path) {\n return Index.hasFile(path, 2);\n }", "function isLogFile(path) {\n\n var ext = path.split(\".\").pop();\n if ([\"log\", \"done\", \"youri\"].indexOf(ext) < 0) {\n return true;\n }\n\n return false;\n}", "function fileChecks( filepath )\n\t\t{\n\t\t\t// check if...
[ "0.5663505", "0.55914944", "0.5584151", "0.54294175", "0.53914595", "0.5356405", "0.5340579", "0.5288648", "0.52579623", "0.52435565", "0.5234097", "0.52142924", "0.52027965", "0.5201166", "0.5197432", "0.5150461", "0.51405036", "0.5124397", "0.51102096", "0.50785047", "0.507...
0.76909333
0
Inject elements with appropriate classes into given text to allow for highlighting specific portions of a text file. Here, log files with ok|success|test|warning|info|error|fail|etc.
function highlight_text(text) { return text.replace(/.*(ok|succe|test|warn|info|deprecat|error|fail|non\-standard|abort|missing\_deps).*/gi, function (match, p1, p2, offset, string) { var cl = 'none'; switch (p1.toLowerCase()) { case 'succe': case 'ok': cl = 'ok'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeClass(text) {\n var elements = document.getElementsByClassName('terminalWords');\n for (var i = 0; i < elements.length; i++) {\n if (elements[i].innerHTML == text) {\n elements[i].onmouseover = function() {};\n elements[i].onmouseout = function() {};\n elements[i].cla...
[ "0.58642507", "0.5822156", "0.55702585", "0.55344534", "0.5437274", "0.54009706", "0.5376166", "0.5345322", "0.53109443", "0.5287271", "0.5226371", "0.52179265", "0.51920605", "0.5177109", "0.5158308", "0.51111615", "0.50780976", "0.50742704", "0.5027292", "0.50145406", "0.50...
0.686353
0
If href is a log file, load it and display it in a decorated box plus controls to close/navigate it.
function show_log_file(ev) { if (isLogFile($(this).attr("href"))) { return true; } if (!ev.metaKey) { ev.preventDefault(); var elId = 'view-' + $(this).attr("href").replace(/\/|\./g, '-'); var cId = elId + '-container'; var c = $("#" + cId); var el = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showFiles(file) {\n WebTail.logs = file;\n const row = $('table.table tbody tr:last');\n const splitter = /^(.+)\\/([^/]+)$/;\n var prevDir = '';\n var f = file;\n\n var p = row.clone();\n var path = '&nbsp;';\n var a = splitter.exec(f.name); // split file dir and name\n if (a !...
[ "0.5699723", "0.55877966", "0.5492488", "0.54615796", "0.5403712", "0.53979117", "0.5336218", "0.5328927", "0.5318772", "0.5313886", "0.530499", "0.5296993", "0.5224715", "0.5182684", "0.51234066", "0.5111885", "0.51093936", "0.51029944", "0.50880045", "0.50869375", "0.506596...
0.67538065
0
Collision detection function. without it, nodes would overlap
function collide(node) { var r = node.radius + 25, //add buffer distance for collision nx1 = node.x - r, nx2 = node.x + r, ny1 = node.y - r, ny2 = node.y + r; return function(quad, x1, y1, x2, y2) { if (quad.point && (quad.point !== node))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collides() {\n //insert collision detection here\n}", "checkCollisions() {\r\n for (var i = 0; i < dots.length; i++) {\r\n if (dots[i].collides(this.pos, createVector(this.pos.x + this.tamanho, this.pos.y + this.tamanho))) {\r\n this.fading = true;\r\n this.dead = true;\r\n ...
[ "0.74677426", "0.72926766", "0.72118187", "0.72089165", "0.7143877", "0.71232486", "0.7119365", "0.71163964", "0.7103548", "0.70994186", "0.70887715", "0.7069292", "0.70276415", "0.69863546", "0.6956043", "0.6949673", "0.6942972", "0.6929144", "0.69231737", "0.68968624", "0.6...
0.7418297
1
Creates a string with a function call functionCallStr = string with function call return = string with translated Simpl
function functionCallWriter(functionCallStr){ return correctBoolExprForC(functionCallStr) + ";"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call2String(call, depth = 0) {\n return '' + call[0] + (call.length > 1 ? ' ' + JSON.stringify(call.slice(1), replacer(depth)) : '') + '\\n';\n}", "function CallSiteToString(){var fileName;var fileLocation=\"\";if(this.isNative()){fileLocation=\"native\";}else{fileName=this.getScriptNameOrSourceURL()...
[ "0.6460984", "0.6359608", "0.6359608", "0.6359608", "0.6359608", "0.61592674", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.61591506", "0.6143425", "0...
0.6574896
0
Creates a string with a return statement returnStr = string with return statement return = string with translated Simpl
function returnWriter(returnStr){ return "return " + correctBoolExprForC(returnStr) + ";"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnStringThings() {\n\treturn 'ABC'\n}", "function stringReturnOne() {\n\treturn \"I just want a job...\";\n}", "function Namaste() {\n return(\"this we all hello in India\")\n}", "function returnValueFunction() {\n return str\n }", "function retornaString(msgstr){\r\n\treturn(\"O ...
[ "0.63835853", "0.6369442", "0.61672056", "0.61481124", "0.60506105", "0.5990026", "0.59772575", "0.5938678", "0.5929012", "0.5897193", "0.5818778", "0.5817892", "0.5743149", "0.5724869", "0.5716173", "0.5708892", "0.5700543", "0.56927425", "0.56919783", "0.56675607", "0.56657...
0.6614558
0
Parses function calls found within expression func = functionjson with information the function call codeLineList = List of current line of code split by type operators codeLineIndex = index of current line of Simpl code return = functionjson if function call is ok or error
function functionCallParser(func, codeLineList, codeLineIndex){ const funcCallArgsEnd = codeLineList[codeLineIndex].charAt(codeLineList[codeLineIndex].length - 1); if(funcCallArgsEnd === ")"){ const args = functionCallArgParser(func, codeLineList[codeLineIndex].substring(func.operator + 1, codeLineList[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functionCallHandler(func, codeLine){\n if (codeLine.charAt(codeLine.length - 1) === \")\"){\n const argStr = codeLine.substring(func.operator + 1, codeLine.length - 1);\n args = functionCallArgParser(func, argStr);\n if (args.args === \"ok\"){\n return functionCallWriter...
[ "0.71182877", "0.6902295", "0.6459257", "0.6341568", "0.6268608", "0.62450325", "0.6109524", "0.6068318", "0.6064909", "0.59706795", "0.5946628", "0.5924084", "0.59071887", "0.58433723", "0.5820606", "0.5810258", "0.58040214", "0.58010185", "0.5793886", "0.57836556", "0.56546...
0.7544919
0
Parses argument part of function declaration argStr = string argument part of function declaration return = List of argument variabel types and names
function functionArgHandler(argStr){ if (argStr.length > 0){ const argList = argStr.split(","); let arguments = []; for (arg in argList){ for (rule in simplType){ if (argList[arg].startsWith(simplType[rule].id)){ if (simplType[rule].id === "voi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFuncDefArgsList(inst) {\n const args = []\n let arg = null\n let code_inst = inst\n\n do {\n arg = syntax.parseVariable(code_inst)\n if(!arg)\n break\n\n code_inst = arg.remain\n args.push(arg.parsed)\n\n if(!/(^\\s*,\\s*)/.test(arg.remain))\n break\n\n ...
[ "0.7064655", "0.6964731", "0.68405545", "0.6637622", "0.66235226", "0.6537872", "0.6523338", "0.6477286", "0.6397678", "0.63738567", "0.6364688", "0.63205755", "0.63101697", "0.6255652", "0.61551285", "0.61362195", "0.6135588", "0.61040974", "0.60991365", "0.6080173", "0.6078...
0.793819
0
Parses a function declaration newfunc = functionjson with information the function call line = string with Simpl code identified as a function declaration return = string from functionWriter with translated Simpl or error
function functionDeclarationHandler(newFunc, line){ if(line.charAt(line.length - 1) === "{"){ const argEndIndex = line.indexOf(")"); if (argEndIndex < 0){ return {"id": "error", "type": "error", "error": "function syntax - missing )"}; }; const name = line.substring(newFu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ast_FunctionDeclaration(ast, retArr, funcParam) {\n\t\t// TODO: make this less hacky?\n\t\tvar lines = jsFunctionString.split(/\\r?\\n/);\n\n\t\tvar start = ast.loc.start;\n\t\tvar end = ast.loc.end;\n\n\t\tvar funcArr = [];\n\n\t\tfuncArr.push(lines[start.line-1].slice(start.column));\n\t\tfor (var i=sta...
[ "0.7050365", "0.68985856", "0.66711843", "0.66083246", "0.6594444", "0.62862134", "0.626214", "0.6259722", "0.62487173", "0.62271667", "0.61823505", "0.61646104", "0.6143431", "0.60994", "0.60994", "0.6080457", "0.6044793", "0.60180455", "0.59637845", "0.58829236", "0.5879473...
0.82862234
0
Champions Function: retrieveSimilarClothing from the championList
function champions_retrieveSimilarClothing(){ var searchList = champions_getSearchList(); // Get the search list from the championsTable var queryTable = normalizeQuery(queryVector, idfTable); var k = 6; var index = champions_selectBestK(queryTable, tfIdfTable, k, searchList); console.log("Champions index"); co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChampionIDs(){\n\n}", "function foundChamp(champion) {\n console.log(champion.name);\n}", "function getChampionList(req, res, next) {\n request(\"https://na.api.pvp.net/api/lol/na/v1.2/champion?freeToPlay=2&api_key=eeadbecb-9b8f-4377-8895-98f9eaa9406e\", function(error, response, body) {\n ...
[ "0.5935423", "0.5815855", "0.5624582", "0.5588849", "0.5570762", "0.5455677", "0.54473215", "0.5415948", "0.5401203", "0.5389376", "0.53330386", "0.5330315", "0.5312144", "0.52924216", "0.52594733", "0.52538556", "0.5246827", "0.5213636", "0.51858246", "0.5138724", "0.5094939...
0.75898504
0
Champions Function: Gets the search list from championsTable according to queryVector
function champions_getSearchList(){ var searchList = []; var listNum = championsTable[0].length; var threshold = 0.7; var maxColIndex; var colMag = 0; for (var i = 0; i < 16; i++){ if (queryVector[i] >= colMag){ colMag = queryVector[i]; maxColIndex = i; } } searchList = searchList.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter() {\n var searchKey = document.getElementById(\"searchKey\").value\n tableComponents.searchList(searchKey)\n}", "getAllChampions() {\n return new this.Parse.Query(this.New())\n .find(results => {\n results.forEach(result =>\n this.Parse.de...
[ "0.54868233", "0.5456076", "0.5412007", "0.5336969", "0.5334496", "0.53160185", "0.5289477", "0.52318746", "0.517756", "0.5163076", "0.51165783", "0.51136047", "0.5109741", "0.5107701", "0.5106939", "0.509765", "0.5093267", "0.5086419", "0.5072817", "0.5061457", "0.5054372", ...
0.76649636
0
Calculate tfid and magnitudes of each doc, obtain normalized tfIdfTable
function computeTfIdf(database, idfTable){ var tfIdfTable = []; var magTable = []; for(var x = 0; x < docNum; x++){ tfIdfTable[x] = []; magTable[x]= 0; for(var y = 0; y < attriNum; y++){ tfIdfTable[x][y] = (1+Math.log(1+database[x][y])) * idfTable[y]; //tf-idf //this part edits the importance of c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binTFIDF(binLength, data) {\n const bins /* type: Omit<Bin, 'tfidf'>[] */ = chunk(data, binLength)\n .map((bin /* type: (Episode & { topWords: object })[] */) => {\n // Sum items in bin\n const cfd = bin.reduce((prev, curr) => {\n Object.entries(curr.topWords...
[ "0.59953755", "0.5716088", "0.54485375", "0.5301218", "0.50600326", "0.47692358", "0.47449115", "0.47252974", "0.4694097", "0.46337903", "0.46317", "0.45937604", "0.45798075", "0.45703503", "0.45245364", "0.45127973", "0.44955474", "0.44863695", "0.44703206", "0.44506562", "0...
0.76354927
0
Compute cosine similarity between query and documents, select the top k results
function selectBestK(query, tfIdfTable, k){ kSimTable = []; var cosSimTable = []; for(var x = 0; x < docNum; x++){ cosSimTable[x]=0; for(var y = 0; y < attriNum; y++){ cosSimTable[x] += query[y] * tfIdfTable[x][y]; } } var index = []; while(index.length < k){ //for each document, take the la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function champions_selectBestK(query, tfIdfTable, k, searchList){\n\n\tvar cosSimTable = [];\n\tfor(var x = 0; x < searchList.length; x++){\n\t\tvar docIndexToCompare = searchList[x];\n\t\tcosSimTable[x]=0;\n\t\tfor(var y = 0; y < attriNum; y++){\n\t\t\tcosSimTable[x] += query[y] * tfIdfTable[docIndexToCompare][y]...
[ "0.74146897", "0.682976", "0.6416689", "0.59950817", "0.5693856", "0.5692313", "0.56905437", "0.56905437", "0.5664244", "0.5656558", "0.5357412", "0.53504753", "0.5344137", "0.5344064", "0.5251164", "0.5234562", "0.52210295", "0.5202566", "0.5151771", "0.51495254", "0.508668"...
0.73110443
1
Champions Function: Compute cosine similarity between query and documents, select the top k results
function champions_selectBestK(query, tfIdfTable, k, searchList){ var cosSimTable = []; for(var x = 0; x < searchList.length; x++){ var docIndexToCompare = searchList[x]; cosSimTable[x]=0; for(var y = 0; y < attriNum; y++){ cosSimTable[x] += query[y] * tfIdfTable[docIndexToCompare][y]; } } console.log(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectBestK(query, tfIdfTable, k){\n\t\n\tkSimTable = [];\n\n\tvar cosSimTable = [];\n\tfor(var x = 0; x < docNum; x++){\n\t\tcosSimTable[x]=0;\n\t\tfor(var y = 0; y < attriNum; y++){ \n\t\t\tcosSimTable[x] += query[y] * tfIdfTable[x][y];\n\t\t} \n\t} \n\n\n\n\tvar index = [];\n\twhile(index.length < k...
[ "0.6837997", "0.6325446", "0.6172062", "0.57932866", "0.57154477", "0.57154477", "0.55430037", "0.5507788", "0.5289797", "0.51942724", "0.51918095", "0.50909436", "0.5060065", "0.5048845", "0.5042644", "0.5037236", "0.5028394", "0.5013475", "0.500974", "0.50021815", "0.499791...
0.7592996
0
eg: checkshirts0.jpg > ir_corpus/Tops/checkshirts0.jpg
function createPathToImage(filename,labelled) { if (labelled){ return "ir_corpus/labelled_clothes/" + classifier + "/" + filename } else{ return "ir_corpus/unlabelled_clothes/" + classifier + "/" + filename } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "convert2png(fname,watermark_text) {\n\ttry {\n\t const t = path.basename(fname)\n\t const new_dir = path.join(OUTPUT_DIR_IMAGE, t.split(\".\")[0])\n\t const t_saved = path.join(new_dir, `sconvert.png`)\n\n\t const created = this.ensureDir(new_dir)\n\n\t if (created) {\n\t\tif (watermark_text == null...
[ "0.5819546", "0.5566232", "0.5491337", "0.5429853", "0.53850514", "0.52797794", "0.524528", "0.5242802", "0.5215544", "0.5210472", "0.5199971", "0.5183259", "0.51724046", "0.51585084", "0.51179034", "0.49959937", "0.4993313", "0.4985329", "0.4978499", "0.4925596", "0.4923227"...
0.6461133
0
2. Write a function called 'addThree' that adds three numbers together and returns the result
function addThree (num1, num2, num3) { var result = num1+num2+num3; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addThree (num1, num2, num3) {\n return (num1 + num2 + num3);\n}", "function addThree(num1, num2, num3) {\n var sum = num1 + num2 + num3;\n return sum;\n}", "function addThree(num){\n return num + 3\n}", "function sumThree(num1, num2, num3) {\r\n return num1 + num2 + num3;\r\n}", "function...
[ "0.91425204", "0.90645766", "0.8745516", "0.8723477", "0.8713635", "0.8700892", "0.86347526", "0.86000204", "0.8502834", "0.8497182", "0.8455901", "0.8455901", "0.8440038", "0.8319021", "0.82742906", "0.82648015", "0.8223813", "0.82159656", "0.820011", "0.8150027", "0.8086616...
0.916012
0
3. Write a function called 'smallestNumber' that returns the smaller of 2 numbers
function smallestNumber (num1, num2) { if (num1<num2) { return num1; } else { return num2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smallestNumber(num1, num2) {\n if (num1 < num2) {\n return num1;\n } else {\n return num2;\n }\n}", "function smallestNumber (num1, num2) {\n if (num1 > num2) {\n return num2;\n } else {\n return num1\n }\n}", "function min(number1, number2) {\n if (number1 < number2)\n return nu...
[ "0.8789647", "0.87769616", "0.82362974", "0.81735575", "0.81641436", "0.80770755", "0.80519277", "0.7898773", "0.78880304", "0.78656626", "0.7857528", "0.78243005", "0.7792669", "0.77415127", "0.7714189", "0.77109367", "0.7703224", "0.7676264", "0.7646241", "0.761809", "0.751...
0.88299483
0
7. Write a function called 'removeOdd' that removes all ODD number from an array
function removeOdd(array) { // console.log(array); for (var i = 0; i < array.length; i++) { if (array[i] % 2 !== 0) { array.splice(i, i + 1); } // console.log(array); } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeOdd (array) {\n return array.filter(function(item){\n return item % 2 == 0;\n })\n // for (var i = 0; i < array.length; i++) {\n // while (array[i] % 2) {\n // array.splice(i, 1);\n // }\n // }\n // return array;\n}", "function removeOdd(array) {\n var newarray = [];\n for (va...
[ "0.8230295", "0.7971545", "0.75474054", "0.74677914", "0.74626243", "0.7378301", "0.73654735", "0.71145684", "0.71044225", "0.7074957", "0.7025326", "0.70038253", "0.69730043", "0.69158036", "0.6876353", "0.6846614", "0.68260634", "0.6825655", "0.680786", "0.6799219", "0.6786...
0.8222134
1
10. Write a function called 'allElementsExceptFirstThree' that discards the first 3 elements of an array, e.g. [1, 2, 3, 4, 5, 6] becomes [4, 5, 6]
function allElementsExceptFirstThree(array) { for (var i = 0; i < 3; i++) { array.shift(); } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allElementsExceptFirstThree (array) {\n var result = [];\n for (var i = 3; i < array.length; i++) {\n result.push(array[i]);\n }\n return result;\n}", "function getAllElementsButNth(array, n) {\n array.splice(n,1)\n return array; \n}", "function getAllElementsButNth(array, n) {\n // your c...
[ "0.8709766", "0.7324169", "0.7292572", "0.72552216", "0.7247833", "0.6886538", "0.6843434", "0.6841822", "0.6675272", "0.6668871", "0.66640115", "0.6644941", "0.6641941", "0.6636085", "0.66319185", "0.66192645", "0.65914935", "0.6585153", "0.6582312", "0.65686077", "0.6523827...
0.905932
0
Search the row of a table with a given content and minimal number of colomns
function searchTableRow(searchText, searchCol, minCol) { // Get all table row objects rowObj = selenium.browserbot.getCurrentWindow().document.getElementsByTagName("TR"); // Add a preceeding backslash to the special charactors. // This eleminates the problem of matching "${passVar}" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contains(selector, XorO) {\n debugger;\n var elements = document.querySelectorAll(selector); // store which BIG ROW did user select | if select any of the first top row, will output [td.col0.row0.diagonal0, td.col0.row1, td.col0.row2.diagonal1]\n // once we store what is on the big row, run function(el...
[ "0.6065105", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.56168723", "0.5600388", "0.55984557", "0.55974036", ...
0.5946496
1
Create li element for Chosen Plugin jQuery
function createChosenElement(id, label) { var li = selenium.browserbot.getCurrentWindow().document.createElement("LI"); li.id = "select_tags_chzn_c_" + id; li.setAttribute("class", "search-choice"); var span = selenium.browserbot.getCurrentWindow().document.createElement("SPAN"); span.innerHTML = label; var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function after_list(){\n\n\t$(\"#destinatario\").chosen({\n\t\t\twidth: \"570px\",\n\t\t\tplaceholder_text_multiple: \"selecciona un usuario de la lista\",\n\t\t\tmax_selected_options: 2\n\t\t});\n}", "function createList() {\n $ul = document.createElement('ul');\n $ul.classList.add('select-list');...
[ "0.66285926", "0.6501229", "0.64766645", "0.63214916", "0.629082", "0.6271663", "0.61635786", "0.6154174", "0.61426014", "0.61280173", "0.6121988", "0.61172765", "0.6107589", "0.60681677", "0.6016562", "0.5978755", "0.5972054", "0.59658986", "0.59627306", "0.59567595", "0.594...
0.66671693
0
Module context Add the i18n strings for this module.
function add_i18n() { var i18n = {}; i18n[I18N.LANG.EN] = {}; i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Old Twinoid elements (by Davf)'; i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'More information here [fr]: http://userstyles.org/styles/99207/hordes-elements-twinoidi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Show the spoilers without mouse hover';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'Show the spoilers content without hovering with your mouse.';\n\n ...
[ "0.7535766", "0.7376228", "0.73373884", "0.7198185", "0.6936543", "0.6789325", "0.6789325", "0.6759906", "0.6759906", "0.6759906", "0.6759906", "0.6699999", "0.64615047", "0.6410443", "0.639502", "0.6338752", "0.6327051", "0.6220929", "0.61274666", "0.60958207", "0.60598046",...
0.75683755
0
Search for an employee in schedule
function search__schedule() { var search__key = $('#search__text').val(); var date = $('#week__dropdown').val(); $.post('../resources/utilities/search.php', { search__key: search__key, date: date, task: "search__schedule__employees" }, function (data) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SearchEmployee(empid)\r\n{\r\n if (empid == undefined)\r\n {\r\n return undefined;\r\n }\r\n\r\n var result = null;\r\n for (var i = 0; i < employees.length; i++)\r\n {\r\n if (empid == employees[i].EmpId)\r\n {\r\n result = employees[i];\r\n br...
[ "0.6080877", "0.58493376", "0.58380747", "0.5792079", "0.5705462", "0.56509036", "0.56406814", "0.5611582", "0.5587581", "0.5562278", "0.5543946", "0.5534308", "0.5522793", "0.55124485", "0.5512032", "0.5492568", "0.54369855", "0.5421267", "0.53793615", "0.5356195", "0.535264...
0.6093591
0
18/11/2021 Estraggo la password smanettando sul range.
async function extractPassword (data) { data = Buffer.from(data.toString('hex'), 'hex') const b = data[data.length - 1] & 0xff const range = await copyOfRange(data, 8, data.length - b) return range }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ValidatePassword(password) {\r\n if(password.length>6 || password.length<8){ \r\n return true;\r\n }\r\n else{\r\n document.getElementById('pwdtext').innerHTML = \"Password range invalid, retry!\";\r\n document.getElementById('pwdtext').style.color = 'red'\r\n return false;\r\n } \r\n}"...
[ "0.6765752", "0.6709919", "0.6619552", "0.65997773", "0.65676737", "0.6564807", "0.65556234", "0.6553816", "0.65442675", "0.651206", "0.6488902", "0.64837664", "0.6483192", "0.6477775", "0.6476229", "0.64452916", "0.6439664", "0.64334685", "0.6399283", "0.6387457", "0.6384914...
0.6761407
1
18/11/2021 Copy of array range. If _to is > _arr.length, append 0
async function copyOfRange (_arr, _start, _to) { const ret = [] for (let index = _start; index < _to; index++) { try { ret.push(_arr[index]) } catch (error) { ret.push(0) } } return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterRange1(arr,min,max) {\n for(ind=0; ind <= (max-min); ind++) {\n arr[ind] = arr[min+ind]\n }\n arr.length = (max-min+1)\n return arr\n}", "function arrayRemove(array, from, to) {\n var rest = array.slice((to || from) + 1 || array.length);\n array.length = from < 0 ?...
[ "0.645333", "0.6321243", "0.6202412", "0.6191202", "0.6118781", "0.6080295", "0.60330963", "0.6028767", "0.59758586", "0.5953746", "0.5936456", "0.59248173", "0.58915013", "0.58550864", "0.5827489", "0.5811949", "0.5807853", "0.5805539", "0.5805292", "0.57977897", "0.5788713"...
0.7720808
0
Read the XML text Returns an object with all necessary info, or error if the keyring password is wrong or something is going bad
async function load (_sXML, _keyringPassword) { if (_keyringPassword === undefined) _keyringPassword = '' if (_sXML === undefined) _sXML = '' // All returned key are in base64 per comodità. try { jSonXMLKeyringFile = await xml2json(_sXML) XMLKeyringFileString = _sXML _retJson.ETSProje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getXMLLogin() {\n \"use strict\";\n return btoa(connectionData.username + \":\" + decryptString(connectionData.key, connectionData.password));\n}", "function extractText() {\n if (!checkPassword(decPwd.value)) return;\n var bytes = mp3.extractText();\n if (decPwd.value) {\n bytes =...
[ "0.5757558", "0.51720303", "0.5117019", "0.5070865", "0.48802558", "0.4852603", "0.4852603", "0.4852603", "0.4852603", "0.4852603", "0.4852603", "0.4852603", "0.4852603", "0.4820353", "0.48179147", "0.47627333", "0.46866137", "0.46575418", "0.46575418", "0.46575418", "0.46575...
0.5972406
0
transform panel create and setting
function initPanel(s,i){//setting and transform data s.addDropDown("type",["translate","rotate","scale","reflect_tetra_1","reflect_tetra_2","reflect_square","reflect_octa","custom","empty"],(p)=>{ (Settings.transforms[i]).type = p.value; updateTransPanel(s,(Settings.transforms[i])); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function panelcreate() {\n\n// Create an intro panel with labels.\nvar intro = ui.Panel([\n ui.Label({\n value: 'Urban PM Explorer',\n style: {fontSize: '1.4pw', fontWeight: 'bold'}\n }),\n ui.Label({\n value:'Displayes PM₂.₅ values for all urban areas on Earth', style: {fontSize: '.9vw', fontWeight: '...
[ "0.6301165", "0.62539417", "0.6195896", "0.6184258", "0.615917", "0.6117177", "0.60947317", "0.60947317", "0.6088869", "0.60594094", "0.60514814", "0.59850353", "0.596448", "0.5953646", "0.5928805", "0.5917943", "0.59168243", "0.5914383", "0.59051883", "0.58956105", "0.587808...
0.7365567
0
setup VAO for a single square in gl state machine
function enableSquareVAO(gl, shaderProgram){ vertexPosition = gl.getAttribLocation(shaderProgram, 'vertex'); //create a buffer for square's positions. const vertexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); const vertexes = [ -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createVAO () {\n var vao = new REGLVAO(gl)\n vaoSet[vao.id] = vao\n stats.vaoCount = vaoCount\n sharedVAO = vao\n return vao\n }", "setup () {\n gl.bindBuffer (gl.ARRAY_BUFFER, this.vBuffer);\n var vPosition = gl.getAttribLocation (program, \"vPosition\");\n gl.verte...
[ "0.66023487", "0.6461524", "0.63813674", "0.63767505", "0.6312802", "0.6256708", "0.6222931", "0.61481893", "0.61361325", "0.6062426", "0.60319686", "0.59368277", "0.5933679", "0.59122986", "0.58882564", "0.5849875", "0.5842796", "0.58143383", "0.58142763", "0.57845193", "0.5...
0.7063304
0
defaults for crud list
static getCrudDefaults() { return { sortField: "_id", sortDir: "asc", }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "list(){this._followRelService(\"list\",\"List\")}", "constructor() {\n super('List', []);\n this.success();\n this.lists = {};\n }", "function RequestUserList() {\n}", "getAll () {\n\t\t// TODO: to be setup with pagination later\n\t}", "constructor(data) {\n console.log(\"list\")\n ...
[ "0.6284366", "0.6115488", "0.60917157", "0.5967562", "0.59145117", "0.5895657", "0.58752596", "0.58752596", "0.58386105", "0.5811536", "0.57675666", "0.5744044", "0.57316864", "0.5707898", "0.5667871", "0.5663615", "0.5648352", "0.56403863", "0.5620857", "0.5613711", "0.55810...
0.6748015
0
Should we log database actions on instances of this model? Subclasses can override this (logModel) to say that we shouldnt create log entries when they are deleted etc.
static getShouldLogDbActions() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log() {\n\t\t\treturn;\n\t\t}", "function Log(){}", "function log(action, type, message) {\n console.log(message)\n c.db.none('insert into log(action, type, message, time)' +\n 'values($1, $2, $3, clock_timestamp())', [action, type, message]);\n}", "l(val, level) {\n const ml = new MongoL...
[ "0.56054693", "0.5397265", "0.5363376", "0.53237677", "0.52174515", "0.51758134", "0.51737815", "0.5157467", "0.51038456", "0.5056268", "0.50253433", "0.50164115", "0.50080997", "0.49862003", "0.49625936", "0.4952734", "0.49236616", "0.48871216", "0.4877822", "0.4877698", "0....
0.68665624
0
simple wrapper that makes more explicit that an exception will be thrown on save error
async dbSaveThrowException(jrContext) { return await this.dbSave(jrContext, false, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n // not implemented\n }", "async function saveExceptionInDB() {\n const tempExMessageInstance = generateModelTestInstance();\n \n let savingResult;\n \n try{\n savingResult = await tempExMessageInstance.save()\n assert(!savingResult.isNew);\n }catch(error){\n ...
[ "0.6971316", "0.658312", "0.64259386", "0.6411774", "0.63471127", "0.62732416", "0.62689376", "0.61923563", "0.6173075", "0.6173075", "0.6134063", "0.6063691", "0.60512733", "0.6029106", "0.5978985", "0.5932897", "0.5861801", "0.5760683", "0.5755602", "0.57487464", "0.5742403...
0.68119836
1
isolate use of this.mongooseModel
static getMongooseModel() { return this.mongooseModel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(mongooseModel) {\n super(mongooseModel)\n this.mongooseModel = mongooseModel\n }", "getInstance() {\n // Ensure model schema is initialized only once\n if(!mongoose.modelNames().includes(SCHEMA_NAME))\n this.initSchema();\n\n return mongoose.model(SCHEMA_NAME);\n }", "getInsta...
[ "0.73757917", "0.6779052", "0.6677987", "0.651075", "0.64567155", "0.6304574", "0.62693936", "0.6256734", "0.62559986", "0.6170425", "0.6152731", "0.6129053", "0.611701", "0.6108579", "0.60631245", "0.59925145", "0.5957443", "0.5938487", "0.59279275", "0.591455", "0.589332", ...
0.76751876
0
Helper function to make a value function for the extraData field
static makeModelValueFunctionExtraData() { // a value function usable by model definitions return async (jrContext, viewType, fieldName, obj, editData, helperData) => { let str; if (editData && fieldName in editData) { // they are editing this field on a crud form, return the current editing value (not a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_value(type, data, extra) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlet str = type + \" <code>none</code>\"\n\t\t\t\t\t\tfor (let i = 0 ; i < data.length; i++) {\n\t\t\t\t\t\t\tlet tmpS = JSON.stringify(data[i])\n\t\t\t\t\t\t\tif (tmpS.indexOf(type) !== -1) {\n\t\t\t\t\t\t\t\ttmpS = tmpS.replace(/\"/g, \"\")\n\t...
[ "0.6296361", "0.624875", "0.6090589", "0.60765153", "0.5822006", "0.5805123", "0.57333755", "0.57191104", "0.57046217", "0.57034564", "0.5600461", "0.55812174", "0.55325687", "0.55222315", "0.55033565", "0.54667616", "0.54622895", "0.5439801", "0.54139185", "0.5409985", "0.53...
0.72335845
0
converts lvl to xp
function getXP(lvl){ return Math.pow(lvl,4) + 1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CalcXPnextlvl() {\n\tvar lvl = Number(What(\"Character Level\"));\n\tevent.value = lvl && !isNaN(lvl) && lvl < (ExperiencePointsList.length - 1) ? ExperiencePointsList[lvl] : \"\";\n}", "levelToXP(level) {\n if (level >= 2) {\n // Sum of geometric series\n const a = 1000, r ...
[ "0.6668501", "0.63432556", "0.5958128", "0.5831203", "0.5691925", "0.56903076", "0.5660067", "0.5584235", "0.5576111", "0.55298865", "0.55249196", "0.5500025", "0.54862744", "0.54798436", "0.54543144", "0.5446439", "0.54345036", "0.5387378", "0.5384299", "0.5370104", "0.53674...
0.74211806
0
Top 5 Items Graph
function topItemsGraph(r) { let beerItemArray = [] let beerItemSalesArray = [] let beerItemSalesMaster = [] // Creates the Beer Item Array for the Fetch Date Range r.forEach(item => { if (beerItemArray.includes(item.Product.name) === false) { beerItemArray.push(item.Product.name) } }) // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayTop5() {\n globalData.ranking = [];\n globalData.currentRankCounter = 0;\n createBeerArray();\n rankBeers();\n displayRankedBeers();\n}", "getTopFiveArtistsByPlays() {\n let dObj = this;\n let artistGroup = dObj.artistNameDimension.group();\n return artistGroup.top(5);\n ...
[ "0.6692606", "0.667029", "0.6532511", "0.62334645", "0.6224719", "0.60632867", "0.6027448", "0.60052013", "0.5993573", "0.5986255", "0.5968371", "0.5943313", "0.59201765", "0.5892098", "0.58890367", "0.58686304", "0.5864055", "0.5824954", "0.57791114", "0.5764337", "0.5737191...
0.7070919
0
Calcular total de los productos agregados al carrito:
calcTotal() { return this.products .map( price => price ) .reduce( (ac, price) => ac + price, 0 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcularTotal(){\n\t\tlet suma = carrito.reduce((sum,item) => sum + item.precio*item.cantidad, 0);\n\t\tsetTotal(suma.toFixed(2));\n }", "function calcularTotal() {\r\n\r\n // Se limpia el precio anterior\r\n total = 0;\r\n\r\n // Se recorre el array del carrito\r\n carrito....
[ "0.8298966", "0.7917431", "0.78896123", "0.7849596", "0.7760131", "0.76725763", "0.76456505", "0.76354486", "0.75972503", "0.75854766", "0.7572562", "0.75656223", "0.7533845", "0.7516463", "0.75022876", "0.74675244", "0.742749", "0.74208474", "0.7382719", "0.73731023", "0.737...
0.8204577
1
Check whether or not an address has been submitted. If not, display an error.
function checkAddress() { if (form1.address.value == "") { document.getElementById("addressMissing").style.visibility = "visible"; document.getElementById("address").focus(); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check() {\n try {\n ethers.utils.getAddress(inputTargetAddress.val());\n } catch (error) {\n submit.addClass('disable');\n return;\n }\n submit.removeClass('disable');\n }", "function ValidateAddress()\n{\n\tvar add=document.getElementById(...
[ "0.72488177", "0.7102579", "0.68972117", "0.67708915", "0.6767248", "0.67191285", "0.65739226", "0.6569287", "0.65484923", "0.65440124", "0.6479823", "0.6437625", "0.6406592", "0.6401912", "0.63957375", "0.63583827", "0.6356599", "0.63421804", "0.6302902", "0.6272655", "0.624...
0.75596064
0
Hide the address error if one is entered.
function dismissAddressWarning() { document.getElementById("addressMissing").style.visibility = "hidden"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAddress() {\n\tif (form1.address.value == \"\") {\n\t\tdocument.getElementById(\"addressMissing\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"address\").focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function ValidateAddress()\n{\n\tvar add=document.getElementById('addre...
[ "0.71384645", "0.6524876", "0.6426", "0.64149606", "0.63976616", "0.63519245", "0.6345395", "0.62654406", "0.62652963", "0.6262429", "0.62227255", "0.62106615", "0.6135132", "0.6109885", "0.6107922", "0.6093847", "0.608741", "0.6079904", "0.6050053", "0.6031574", "0.59490335"...
0.7548942
0
Check if either gender has been selected. Otherwise, display an error.
function checkGender(){ if (document.getElementById('sexMale').checked) { return true } else if(document.getElementById('sexFemale').checked) { return true } else { window.alert("Please select a gender."); return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateGender(){\n var joinErr = document.getElementById(\"genderErr\");\n var genderValidity = true;\n var male = document.getElementById(\"male\");\n var female = document.getElementById(\"female\");\n try{\n if(!male.checked && !female.checked){\n male.style.outline = \"2px solid red\";\n...
[ "0.7910757", "0.73433554", "0.7192232", "0.7051497", "0.6763601", "0.6752279", "0.6712602", "0.66678685", "0.66564316", "0.6620392", "0.65951836", "0.6553554", "0.647031", "0.6224808", "0.6213411", "0.61970955", "0.6176199", "0.6167787", "0.6135784", "0.6122822", "0.60708636"...
0.7489549
1
Cache the query by remembering the list of full months of given range
remember ({ serviceId, start, end }) { const ranges = getFullMonthsRanges({ serviceId, start, end }) const uncached = _.differenceWith(ranges, rangeCache, _.isEqual) if (!uncached) return rangeCache = [...rangeCache, ...uncached] return rangeCache }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_months_range(t, range)\n {\n var start = new Date(t * 1000);\n\n start.setMonth(start.getMonth(), 1);\n start.setHours(0);\n start.setMinutes(0);\n start.setSeconds(0);\n start.setMilliseconds(0);\n\n var end = webix.Date.add(new Date(start), range, ...
[ "0.60820365", "0.6067076", "0.6039932", "0.601402", "0.59630007", "0.5941755", "0.5898436", "0.5862578", "0.5845608", "0.57828027", "0.5706386", "0.56899977", "0.56077105", "0.559945", "0.54877764", "0.548224", "0.5469901", "0.5425019", "0.5407599", "0.540174", "0.53289443", ...
0.6874978
0
move todo to complete or pending list
function moveTodo(todo, list) { // get the task let task = todo.innerText; if (list === 'complete') { todo.querySelector('.btn-complete-task').setAttribute('data-glyph', 'minus') todo.querySelector('.btn-complete-task').classList.add('btn-pending-task') todo.querySelector('.btn-complete-task').classL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveToDone(id) {\n this.setState({\n todos: this.state.todos.map((todo) => {\n if (todo.id === id) {\n return {\n id: todo.id,\n text: todo.text,\n complete: !todo.complete,\n favorite: todo.favorite,\n toedit: todo.toedit\n };...
[ "0.6994545", "0.6875958", "0.68467623", "0.67623717", "0.6745369", "0.6741076", "0.6643143", "0.6627495", "0.66151196", "0.65901077", "0.6589671", "0.65127474", "0.65086925", "0.6477213", "0.6475476", "0.64506024", "0.6446762", "0.6435061", "0.643431", "0.64175504", "0.640546...
0.78576064
0
add new todo list accept paramter for manual create todo
function addTodoList(task, list = 'pending') { // get the task from input const taskInput = document.getElementById("input-task"); // if parameter task is not empty then priority on using it first let taskInputVal = (task) ? task : taskInput.value; if (taskInputVal == "" || taskInputVal == undefined) { /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addNewList(title) {\n let newList = {\n id: nextId(),\n title,\n todos: []\n }\n \n this._todoLists.push(newList);\n return true;\n }", "function addToDo() {\n const taskString = document.getElementById(\"new-task-description\").value\n const newLi = document.createElement(\"...
[ "0.78562677", "0.778098", "0.7724478", "0.7722614", "0.76964134", "0.76721114", "0.76699525", "0.7636699", "0.76009905", "0.758103", "0.7572168", "0.75695235", "0.756875", "0.75557137", "0.7545059", "0.7509102", "0.75089425", "0.74786377", "0.74786377", "0.7467118", "0.746411...
0.79111177
0
Sets up a system to update stocks once per minute. Returns a function for unsubscribing.
function stockUpdater() { // Create timeout to update at the top of the minute let unsubType = 'timeout'; let unsubHandle = setTimeout(() => { unsubHandle = -1; unsubType = 'interval'; // Create interval to call every minute at the top of the minute unsubHandle = setInterval(() => { tryStoc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "periodicUpdate() {\n var self = this;\n\n if (self.tout !== null) {\n self.log.debug(\"Update already scheduled\");\n return;\n }\n\n // Determine polling interval\n var refresh;\n if (self.count < self.maxCount) {\n self.count++;\n refresh = self.shortPoll;\n } else {\n ...
[ "0.6080328", "0.5622555", "0.5577171", "0.5557838", "0.5536516", "0.54781204", "0.5408842", "0.5404648", "0.5387581", "0.5360337", "0.5354004", "0.5339871", "0.53147054", "0.53075933", "0.5305004", "0.52927744", "0.52833396", "0.5269657", "0.52633053", "0.5251671", "0.5249736...
0.75523925
0
Try updating stock data on Firestore a single time.
function tryStockUpdate() { const globalStocksDoc = firebase.firestore().collection('global').doc('stocks'); try { // Contend for right to pull data from polygon. Whoever succeeds in // committing a successful transaction to Firestore first wins. firebase.firestore().runTransaction(async (t) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async checkHand() {\n this.db = firebase.firestore();\n await this.db.collection(\"room\").doc(this.props.room.id).update({\n currentBettingAmount: 0,\n })\n }", "async update() {\n try {\n const { year, month, amount, seller, brand, exported } = this;\n await Fire...
[ "0.67622113", "0.64692366", "0.63442326", "0.6171437", "0.6139748", "0.61346006", "0.60449165", "0.604459", "0.594767", "0.5945602", "0.59367007", "0.59287727", "0.5892708", "0.589034", "0.58835745", "0.5879225", "0.5872865", "0.58586746", "0.5846212", "0.5840045", "0.5826127...
0.7826813
0
listen for result event creating onSpeak function
function onSpeak(e){ //as a parameter 'result' is e // console.log(e); //see what we're getting back don't need const msg = e.results[0][0].transcript; //capturing message console.log(msg); writeMessage(msg); checkNumber(msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSpeak(e) {\n const msg = e.results[0][0].transcript;\n writeMessage(msg);\n checkNumber(msg);\n}", "function onSpeach(){\n spechToText.on(\"ready\",x=> msgTextAdd(x)); \n }", "function speak (message) {\n msg.text = message;\n msg.onend = function () { console.log(\"on end!\...
[ "0.7899104", "0.73101485", "0.7119289", "0.7044745", "0.6823889", "0.67784137", "0.6747763", "0.6734638", "0.6734263", "0.6713697", "0.6702008", "0.6690171", "0.66682863", "0.66641647", "0.66458285", "0.66347253", "0.66313523", "0.66301763", "0.6608544", "0.65921986", "0.6581...
0.8156258
0
Define a callback methods on survey complete
onComplete(survey, options) { //Write survey results into database console.log("Survey results: " + JSON.stringify(survey.data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSubmit(answer) {\n // Raise our callback \n this.onAnswer({\n answer\n });\n }", "onComplete(survey) {\n //log results and post request to route to mailer\n /* console.log(\"Survey results: \" + JSON.stringify(survey.data)); */\n\n axios({\n method: \"POST\",\n ...
[ "0.61000335", "0.60913724", "0.60762477", "0.60298693", "0.59786105", "0.5957674", "0.59502596", "0.5949339", "0.5913375", "0.5892888", "0.58304644", "0.57335293", "0.57202446", "0.5635425", "0.5605917", "0.560436", "0.55867076", "0.55035836", "0.54975635", "0.5493423", "0.54...
0.62377036
0
Return true if tree is a part of a cycle that: A) Never connects to the top of the tree B) Has not not had a point in the cycle arbitraryly declared its top yet.
function isDisconnectedCycle (tree, seen) { if (!seen) seen = {} if (tree.isTop || tree.cycleTop || tree.requiredBy.length === 0) { return false } else if (seen[tree.path]) { return true } else { seen[tree.path] = true return tree.requiredBy.every(function (node) { return isDisconnectedCyc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isUndirectedCyclic(){\n // Mark all the vertices as not visited\n let visited =[]\n for(let i=0; i<this.num_nodes; i++){\n visited.push(false)\n }\n // Call the recursive helper function to detect cycle in different\n // DFS trees\n for(let i=0; i<this.nu...
[ "0.6834713", "0.6455395", "0.63759774", "0.6369835", "0.62566054", "0.6235807", "0.619124", "0.6188024", "0.6182291", "0.6171704", "0.616443", "0.61158484", "0.61089885", "0.6078186", "0.6067059", "0.6066126", "0.6064583", "0.60371476", "0.6035822", "0.60278773", "0.6000141",...
0.7431395
0
Reads complete line from STDIN
function readLine() { return input_stdin_array[input_currentline++]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async readInputLine(rl) {\n return new Promise(resolve => {\n rl.on('line', (input) => {\n //console.log(`Received: ${input}`);\n resolve(input);\n });\n });\n\n }", "function forEachLineOfInput(callback) {\n var buf = \"\";\n var stdin = process.openStdin();\n stdin.setEncoding...
[ "0.6169494", "0.6031107", "0.59816337", "0.5972953", "0.59512717", "0.57951844", "0.568947", "0.56889063", "0.5601439", "0.55043113", "0.54542446", "0.544314", "0.5442857", "0.5393464", "0.5375135", "0.5351484", "0.5326777", "0.5267067", "0.5245641", "0.5243726", "0.52321637"...
0.64939994
0
console.log(secret_number + " control test")
function generate_secret_number() { secret_number = Math.floor(Math.random() * (100 - 1)) + 1; //#uncomment this if you want the answer but wanna test anyways // console.log(secret_number + " generated") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SecretCode(){\n\tvar SecretNum = 87;\n\t//this is private;\n}", "function secretNumber(){\n\tsecretNumber = Math.floor(Math.random()*100)+1;\n}", "function bruceBanner(num) {\n console.log('#####' + 'Challenge' + num + '#####' );\n }", "function randomNumber() {\n secretNumber = Math.fl...
[ "0.66868794", "0.66487795", "0.6622521", "0.65113646", "0.6452317", "0.62127286", "0.61655086", "0.6076563", "0.60674155", "0.60651803", "0.60262537", "0.6011281", "0.5986929", "0.59790325", "0.5977172", "0.59378606", "0.59378606", "0.592319", "0.5915943", "0.5913337", "0.591...
0.71789145
0
net.users[i].data is signups[i] Build matrix of rows for spreadsheet
function userToRow(data) { // todo var row = []; row.append(''); // attendance }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildUserDataTable(users){\n\t\tvar userRows = [];\n\t\t\n\t\tusers.forEach(function(element, index){\n\t\t\tvar user = element;\n\t\t\tif(user && user.userID){\n\t\t\t\t//Adiciona um array com as colunas que irão ser apresentadas no dataTable\n\t\t\t\tuserRows.push([\n\t\t\t\t '<label class=...
[ "0.6315132", "0.6171406", "0.6130465", "0.59385014", "0.59184986", "0.5837008", "0.580592", "0.5787604", "0.57514447", "0.56175554", "0.5600328", "0.5572571", "0.5572046", "0.55414546", "0.55341434", "0.55254906", "0.5521842", "0.5499449", "0.54854506", "0.5484032", "0.548363...
0.628414
1
Take a window and create various helper properties and functions
function makeWindowHelpers(window) { let {clearTimeout, setTimeout} = window; // Call a function after waiting a little bit function async(callback, delay) { let timer = setTimeout(function() { stopTimer(); callback(); }, delay); // Provide a way to stop an active timer function stop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createWindow() {\n const gameHeight = this._getGameHeight();\n const gameWidth = this._getGameWidth();\n const dimensions = this._calculateWindowDimensions(gameWidth, gameHeight);\n this.graphics = this.scene.add.graphics();\n\n this._createOuterWindow(\n dimensions.x,\n dimensions.y,\n ...
[ "0.6437048", "0.642449", "0.63733226", "0.636357", "0.6331518", "0.629078", "0.6263504", "0.6261028", "0.6189937", "0.61830884", "0.61760384", "0.6175766", "0.61577046", "0.6136428", "0.6110195", "0.61008996", "0.6096941", "0.60864836", "0.60864824", "0.6079599", "0.60712755"...
0.7117495
0
Check if a query is a twitterlike input
function twitterLike(query) { return query.search(/^[@#][^ ]*$/) == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ContainsTwitter(urlstring)\n{\n if (urlstring.indexOf('twitter.com') !== -1)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function twitMatchesSearchQuery(twit, searchQuery) {\n /*\n * An empty query matches all twits.\n */\n if (!searchQuery) {\n r...
[ "0.6163493", "0.60481226", "0.588891", "0.5880072", "0.5877585", "0.5834486", "0.5809881", "0.58098507", "0.5598219", "0.5587933", "0.5563627", "0.5558821", "0.55440694", "0.5483163", "0.5473229", "0.5448631", "0.54265815", "0.54110116", "0.5390575", "0.5379692", "0.53290695"...
0.80150324
0
do query and load rankings
function load_rankings() { var path = "ranking/" + ranking_attribute_mysql + "/" + teams_mysql_ranking_dict[ranking_attribute_mysql]; get(path) .then(function(json) { if (json === undefined) { return; } rankings_obj = JSON.parse(json); filter_invalid_values(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllRanking() {\n\t$.ajax({\n\t\ttype: 'GET',\n\t\tcontentType: 'application/json',\n\t\turl: '/api/processes',\n\t\tsuccess: function(processes) {\n\t\t\tlet rankOneProcess;\n\t\t\t\n\t\t\t/** Store the processes */\n\t\t\tfor(var i = 0; i < processes.length; i++) {\n\t\t\t\t/** Transfer the values fro...
[ "0.6281452", "0.6174316", "0.61324435", "0.6100104", "0.6010846", "0.59199566", "0.5915292", "0.5792396", "0.57833254", "0.57549924", "0.57351375", "0.5707796", "0.5672774", "0.56724197", "0.5671631", "0.56667644", "0.5623317", "0.5586696", "0.55643004", "0.55001515", "0.5498...
0.73822176
0
define sudoku grid class
function Grid() { //repositories this.cells = []; this.rows = []; this.columns = []; this.boxes = []; this.lastRemoved; //last cell to have had its value hidden this.recursedCells = []; //array of blank cells that have already been recursed over by hideValue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(rows,cols,size) {\n this.grid = [];\n\n //setup rows and columns\n for(let r = 0; r < rows; r++) {\n this.grid.push([]);\n for(let c = 0; c < rows; c++) {\n this.grid[r].push(0);\n }\n }\n\n this.spacing = size;\n }",...
[ "0.7219655", "0.7040866", "0.7030156", "0.70285684", "0.7003431", "0.6988388", "0.6962533", "0.69302136", "0.69206876", "0.68752337", "0.68386155", "0.67898566", "0.6773574", "0.6732734", "0.6718941", "0.6711127", "0.667462", "0.6669916", "0.6669578", "0.66487044", "0.6648704...
0.7201286
1
Show the popup "Save rating"
showPopupSaveRating() { this.isShow = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPopupRating(rating, args) {\n showInPopup(rating, args, displayRating, \"rating\");\n}", "function saveButtonClicked() {\n setShowRecipePopup(!showRecipePopup);\n }", "closePopupSaveRating() {\n this.isShow = false;\n }", "function close_ratings() {\n // document.getElementById...
[ "0.6931922", "0.6785541", "0.66704935", "0.6373692", "0.622469", "0.61999774", "0.61999774", "0.61999774", "0.6158564", "0.6158275", "0.6150695", "0.61393857", "0.608248", "0.6057924", "0.60411876", "0.6030455", "0.60205245", "0.5988855", "0.5951634", "0.59345573", "0.5920477...
0.7617875
0
Close the popup "Save rating"
closePopupSaveRating() { this.isShow = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeReviewWindow(type){\r\n if (type === \"save\") {\r\n Daily.saveEverything(starRatingSet, currentItemToSave);\r\n }\r\n Daily.reviewClosed();\r\n clicked = false;\r\n decolorStars(starRating);\r\n\r\n document.querySelector(\"#review-text\").value = \"\";\r\n }", "function cl...
[ "0.741429", "0.71439344", "0.6890814", "0.68181074", "0.6788797", "0.6722829", "0.66685754", "0.6528725", "0.65227515", "0.6506031", "0.6478098", "0.64311653", "0.64239305", "0.63672984", "0.63489914", "0.63395727", "0.63296986", "0.6328151", "0.63275236", "0.63021785", "0.62...
0.7951374
0
Check in sessionStorage if material has been rated by the current user"
isMaterialRated(materialId) { const ratings = sessionStorage.getItem("ratedMaterials"); const parsedRatings = ratings !== null ? JSON.parse(ratings) : []; return parsedRatings.includes(materialId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_user_score() {\n if (\"user_logged\" in sessionStorage) {\n\n // take the value of score in local\n var score_user_local = JSON.parse(localStorage[sessionStorage.logged_in_user]).score;\n\n // compares the score and the score il local store of the user logged in\n if (score > score_use...
[ "0.6082607", "0.59399027", "0.59257656", "0.5920892", "0.58751076", "0.580589", "0.5789301", "0.5725657", "0.56997085", "0.56871074", "0.56520057", "0.5651729", "0.5639616", "0.5638701", "0.56228507", "0.5613788", "0.55912715", "0.5586721", "0.5585316", "0.55705136", "0.55675...
0.7167898
0
takes object containing optional search, min, and max returns list of companies filtered by search criteria
static async getAll({ search, min, max }) { //if search, min, or max are undefined then they will default to values shown below search = search === undefined ? '%%' : `${search}%`; min = min === undefined ? -1 : +min; max = max === undefined ? 1000000000 : +max; //if min is greater than max then th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async filterCompanies(search) {\n let res = await this.request('companies', { search });\n return res.companies\n }", "static async search(searchTerm, minEmployees = 0, maxEmployees = 1000000) {\n\n let result;\n if (searchTerm === undefined) {\n result = await db.query(\n ...
[ "0.6594719", "0.61905307", "0.61109", "0.6064111", "0.6039508", "0.597449", "0.5969867", "0.5904324", "0.5859382", "0.56822675", "0.56575453", "0.56255054", "0.5596407", "0.5586602", "0.55856895", "0.5569512", "0.54984194", "0.54733145", "0.54156494", "0.5414305", "0.53917766...
0.67436033
0
update data for one company. Returns updated company.
static async updateOne(handle, companyUpdates) { try { let { query, values } = sqlForPartialUpdate( 'companies', companyUpdates, 'handle', handle ); let result = await db.query(query, values); return result.rows[0]; } catch (err) { let error = new Er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async update(handle, data) {\n let { query, values } = sqlForPartialUpdate(\n \"companies\",\n data,\n \"handle\",\n handle\n );\n\n const result = await db.query(query, values);\n const company = result.rows[0];\n\n if (!company) {\n throw new ExpressError(`There exi...
[ "0.7559607", "0.6751226", "0.6655625", "0.66275877", "0.64180386", "0.64049876", "0.6275618", "0.6266585", "0.62629807", "0.62312657", "0.5867963", "0.5848133", "0.5818126", "0.57734746", "0.5763", "0.5741667", "0.57364464", "0.56828445", "0.5679437", "0.56794", "0.56766415",...
0.7533518
1
Returns a function that calls all given functions
getMultiFunction(...fns) { return function(...args) { fns.forEach((fn) => { fn && fn.apply(this, args); }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callTogether () {\n var funcs = arguments\n var length = funcs.length\n var index = length\n\n if (!length) {\n return function () {}\n }\n\n return function () {\n length = index\n\n while (length--) {\n var fn = funcs[length]\n if (typeof fn === 'function') {\n var result...
[ "0.6944046", "0.6944046", "0.6944046", "0.6944046", "0.6890857", "0.6839026", "0.6828817", "0.6683921", "0.66787845", "0.6657449", "0.6630225", "0.65643173", "0.64814365", "0.63388354", "0.6251966", "0.62338024", "0.62320447", "0.61884224", "0.61871976", "0.61706376", "0.6123...
0.7138512
0
geneate an array of dates around the current day but a year in the past
function generateDateArr(){ var dates = []; var aYearAgo = addYears(-1); for(var i = 0; i < 30; i ++ ){ var newDate = addDays( i, aYearAgo ); // put it in iso format, as that is what the forecast api takes dates.push( newDate.toISOString().split('.')[0] ); } return dates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructDates(yearsBack) {\n var now = new Date();\n var starting_date = new Date(now);\n starting_date.setDate(starting_date.getDate() - 365 * yearsBack - 3);\n var start_date = formatDate(starting_date);\n var today = formatDate(now);\n return [start_date, today];\n}", "function generateDates()...
[ "0.65813494", "0.61825204", "0.60962033", "0.5971808", "0.5873984", "0.58713245", "0.5865683", "0.58460444", "0.5788984", "0.5774864", "0.5727588", "0.5710579", "0.5702124", "0.5700744", "0.5696131", "0.5617181", "0.55913246", "0.55102175", "0.55016196", "0.5494593", "0.54124...
0.66437256
0
The current offer. Undefined unless signaling state HaveLocalOffer, HaveRemoteOffer, of Stable.
get offer() { return this._offer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isBasicOffer(offerObj) {\n return offerObj.reference === this.LogsConstants.basicOffer;\n }", "get avail() {\n return this.getAvailability();\n }", "function onOfferFulfilled(description) {\n rtcPeerConnection.setLocalDescription(description);\n webSocketConnection.send(JSON.stringify({ mes...
[ "0.5826292", "0.57474965", "0.5736633", "0.5702915", "0.56865835", "0.5641961", "0.5502291", "0.5486557", "0.54384416", "0.54376686", "0.53790605", "0.53517133", "0.5318025", "0.52636874", "0.525767", "0.5250457", "0.524956", "0.5108567", "0.5076611", "0.50589496", "0.5045214...
0.7722968
0
Reconfirm the dialog. Only matters if handling reINVITE request.
reConfirm() { // When we're confirmed start the retransmitting whatever // the 2xx final response that may have confirmed us. if (this.reinviteUserAgentServer) { this.startReInvite2xxRetransmissionTimer(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promptAgain() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Would you like to search for anyting else?:\",\n name: \"confirm\",\n default: true\n }\n ])\n .then(function(inquirerR...
[ "0.6187998", "0.6072644", "0.603394", "0.6006586", "0.5975347", "0.59741753", "0.5875713", "0.5859984", "0.58551127", "0.58450675", "0.5810907", "0.58053213", "0.5782535", "0.5775167", "0.57631344", "0.5760622", "0.57193244", "0.57187754", "0.5707397", "0.5677252", "0.5656183...
0.7239521
0
The UAC core MUST generate an ACK request for each 2xx received from the transaction layer. The header fields of the ACK are constructed in the same way as for any request sent within a dialog (see Section 12) with the exception of the CSeq and the header fields related to authentication. The sequence number of the CSe...
ack(options = {}) { this.logger.log(`INVITE dialog ${this.id} sending ACK request`); let transaction; if (this.reinviteUserAgentClient) { // We're sending ACK for a re-INVITE if (!(this.reinviteUserAgentClient.transaction instanceof InviteClientTransaction)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createACK()\n{\n return ACK_HEADER;\n}", "function replySucceeded() {\n self.status = C.STATUS_WAITING_FOR_ACK;\n\n setInvite2xxTimer.call(self, request, sdp);\n setACKTimer.call(self);\n accepted.call(self, 'local');\n }", "function setACKTimer() {\n var self = this;\n\n t...
[ "0.614724", "0.59927815", "0.57482976", "0.5621359", "0.559142", "0.55395937", "0.55385476", "0.54584104", "0.54300034", "0.5312674", "0.529369", "0.52881753", "0.52635294", "0.52609706", "0.51967317", "0.5186094", "0.51529723", "0.51301", "0.50851876", "0.5064817", "0.505939...
0.68138105
0
An INFO request can be associated with an Info Package (see Section 5), or associated with a legacy INFO usage (see Section 2). The construction of the INFO request is the same as any other nontarget refresh request within an existing invite dialog usage as described in Section 12.2 of RFC 3261.
info(delegate, options) { this.logger.log(`INVITE dialog ${this.id} sending INFO request`); if (this.early) { // FIXME: TODO: This should throw a proper exception. throw new Error("Dialog not confirmed."); } return new InfoUserAgentClient(this, delegate, options);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function info() {\n\t// Call actual info message\n\toriginalFunctions.info(getPrefix() + join(arguments));\n}", "function _trigStartGetInfoRequest(layersToRequest) {\n var responseFeatureCollections = _createResponseFeatureCollections(layersToRequest);\n eventHandler.TriggerEvent(ISY.Events.EventTypes.Feat...
[ "0.58304936", "0.58242476", "0.5717313", "0.5629878", "0.5554452", "0.55370784", "0.5466899", "0.5447013", "0.5445617", "0.5385278", "0.5352085", "0.5343543", "0.53363043", "0.53276044", "0.529663", "0.5281859", "0.52775824", "0.5277151", "0.5216717", "0.519076", "0.51649106"...
0.6012547
0