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
Function called by load config button see: uploader.addEventListener("change", handleFiles, false);
function handleFiles() { const file = this.files[0]; $.ajax({ url: file.path, dataType: 'json', type: 'get', cache: false, success: function (data) { console.log("read pre defined config"); handleViewSetup(data); }, error: function (requestObject, error, errorThrown) { alert(error); alert(er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initApplication() \n{\n document.getElementById('file').addEventListener('change', handleFileSelect, false); \n}", "initInputFileOnchange() {\n document.querySelectorAll('.ribs-fileuploader').forEach((uploaderDiv) => {\n uploaderDiv.querySelector('input[type=file]').addEventListener('chan...
[ "0.7281437", "0.699782", "0.6960162", "0.6957443", "0.6955761", "0.69410557", "0.6921319", "0.68571115", "0.68520135", "0.67997193", "0.6795996", "0.6713265", "0.6713265", "0.669124", "0.6689752", "0.6689506", "0.6674914", "0.6666937", "0.66546506", "0.664744", "0.66453815", ...
0.70841414
1
Render view file in view_path. Replace %placeholders% with locals.
function render_view(view_name, locals){ var view = view_cache[view_name]; if(!view) { view = fs.readFileSync(view_path + '/' + view_name + '.view.html').toString(); view_cache[view_name] = view; } if (locals != 'undefined') { for (l in locals) { var searchfor = '%' + l + '%'; view = view.replace(new...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render_file(locals, cb) {\n // cached?\n var template = cache[filename];\n if (template) {\n return cb(null, template(locals, handlebarsOpts));\n }\n\n fs.readFile(filename, 'utf8', function(err, str){\n if (err) {\n return cb(err);\n }\n\n var template = handleba...
[ "0.6284576", "0.611442", "0.60762036", "0.5990203", "0.59561175", "0.5949313", "0.5842117", "0.5800042", "0.56675595", "0.5654119", "0.5654119", "0.5654119", "0.5603638", "0.5596236", "0.55116236", "0.55073756", "0.55064124", "0.5502894", "0.5443407", "0.5437155", "0.54305893...
0.71740496
0
Genearte UUID based on remote address
function gen_uuid(remote_addr) { var random = ''; for (var i=0; i < 32; i++) { random += Math.floor(Math.random() * 16).toString(16); } return crypto.createHash('md5').update(random + remote_addr).digest('hex'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate_uuid(){\n\t\tvar uuid = \"\";\n \n\t\tfor (i = 0; i < 32; i++){\n\t\t\tuuid += Math.floor(Math.random() * 16).toString(16);\n\t\t}\n\t\t\n\t\treturn uuid;\n\t}", "generateUUID(){\n var uuid = ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n (c ^ crypto.getRandomValues(...
[ "0.73122895", "0.72161174", "0.7203223", "0.7197786", "0.7160125", "0.71579015", "0.7150108", "0.714505", "0.7138445", "0.7138445", "0.713491", "0.7129246", "0.7126733", "0.7118249", "0.7095726", "0.70946914", "0.70864224", "0.7079466", "0.70713395", "0.70290464", "0.7001436"...
0.8521843
0
Loads the `phpintegratorbase` package
consumeIntegratorBase () { // TODO use activatePackage or revert back to consuming actual service const integratorBasePath = atom.packages.resolvePackagePath('php-integrator-base') if (integratorBasePath) { const coreService = new PhpCoreService(integratorBasePath) this.getWorkspace().setCoreService(coreS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "load()\n {\n \treturn new Promise((resolve, reject) => {\n this.context.audioWorklet.addModule(this.base_url + \"organ-processor.js\").then(() => {\n this.node = new organPolyNode(this.context, {});\n this.node.onprocessorerror = () => { console.log('An error from organ-proce...
[ "0.5229607", "0.5193868", "0.51604915", "0.5094963", "0.50017405", "0.4976933", "0.49655434", "0.49424627", "0.49211487", "0.4916206", "0.48986542", "0.48957056", "0.48749602", "0.48734188", "0.48633918", "0.4855657", "0.48545805", "0.48201543", "0.48119265", "0.48057935", "0...
0.6713308
0
Loads the `treeview` package and attaches a view
consumeTreeView () { atom.packages.activatePackage('tree-view').then((pkg) => { if (pkg && pkg.mainModule && pkg.mainModule.treeView) { this.tree = new PhpUnitTreeView(this.getWorkspace(), pkg.mainModule.treeView) if (this.state && this.state.tree) { this.tree.deserialize(this.state.tree) } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TreeView() {\n this.anchor = '';\n this.collapsible = true;\n this.initiallyCollapsed = true;\n this.icons = {};\n this.icons.dirOpen = 'fa fa-folder-open';\n this.icons.dirClosed = 'fa fa-folder';\n this.icons.file = 'fa fa-file';\n this.icons.active = true;\n this.ommit = [];\n}", "function d...
[ "0.6852252", "0.67925745", "0.65281385", "0.6257671", "0.61588526", "0.610237", "0.60684425", "0.60609317", "0.6055408", "0.60386044", "0.60168314", "0.60168314", "0.60151523", "0.5998344", "0.598981", "0.598981", "0.598981", "0.598981", "0.59659755", "0.59419733", "0.5910165...
0.75869626
0
Add fields from the file data.
function addFieldsFromFile(node, file) { settings.includeFileFields.forEach(function (field) { if (file.hasOwnProperty(field)) { node[field] = file[field]; } }); return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _attachFields()\n {\n if (_fields.length > 0) {\n for (var i = 0; i < _fields.length; i++) {\n fd.append(_fields[i].name, _fields[i].value);\n }\n }\n }", "function fileAdded(e, data)\n {\n log(\"Upload.fileAdded (Id=%s)\", id);\...
[ "0.61445355", "0.5681214", "0.567198", "0.55968696", "0.5579997", "0.5564931", "0.55578375", "0.55496347", "0.55363464", "0.5526279", "0.55195135", "0.55047756", "0.5483555", "0.54667497", "0.54488283", "0.54014784", "0.53878665", "0.538726", "0.53868437", "0.53243744", "0.53...
0.67243767
0
call the server and get the chat version we also send it the current chat version so in case there was a change in the chat content, we will get the new string as well
function ajaxChatContent() { $.ajax({ url: CHAT_LIST_URL, data: "chatversion=" + chatVersion, dataType: 'json', success: function(data) { console.log("Server chat version: " + data.version + ", Current chat version: " + chatVersion); if (data.version !== chatV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_sendVersion () {\n // todo: include sending local ip address\n const message = this.messages.Version( { relay: this.relay } );\n this.versionSent = true;\n this.sendMessage( message );\n }", "function version(io, socket, data) {\n gpio.getInfo(gpioUser);\n io.sockets.emit('updatechat', 'SERVE...
[ "0.6486", "0.63364816", "0.63322717", "0.61413616", "0.6135571", "0.598184", "0.5887217", "0.5870951", "0.5836702", "0.5781073", "0.575575", "0.57421815", "0.57390654", "0.570828", "0.5632338", "0.56145036", "0.5606249", "0.5602876", "0.5599109", "0.55953854", "0.55609214", ...
0.6791964
0
zainicjowana zmienna globalna tworze funkcje
function zmienWartosc() { // zmieniam wartosc zmiennej globalnej liczba = 20; console.log(liczba); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function globalMehtod() {\n\n }", "function _fn(){ /*...*/ }\t//Funzioni private", "function twGlobalMap(){}", "function getGlobalVariable(){\n\treturn;\n}", "function fun1(){\r\n oppsGlobal = 5; // not used var means Global\r\n }", "function inicializar() {\n }", "function setGlo...
[ "0.7624376", "0.65174484", "0.64986795", "0.6349063", "0.6344209", "0.6236753", "0.6183244", "0.6162894", "0.6137491", "0.61251664", "0.6114759", "0.60760635", "0.60673046", "0.59778327", "0.59727526", "0.5944737", "0.5940726", "0.59040374", "0.59015465", "0.5875765", "0.5875...
0.6616097
1
Genera un objeto Blob con los datos en un archivo XML
function generarXml(datos) { var texto = []; texto.push('<?xml version="1.0" encoding="UTF-8" ?>\n'); texto.push('<datos>\n'); texto.push('\t<nombre>'); texto.push(escaparXML(datos.nombre)); texto.push('</nombre>\n'); texto.push('\t<telefono>'); texto.push(escaparXML(datos.telefo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getXML(){\n conn.connect(function (err){\n if(err)\n console.log(err);\n req.query('SELECT dbo.fnACRONIS_WebOrders() AS Orders ', function(err, recordset){\n if(err)\n console.log(err);\n else { \n\n //create file xml\n ...
[ "0.5545839", "0.5522679", "0.54781014", "0.5453908", "0.5438086", "0.5421078", "0.54097164", "0.5387313", "0.5376927", "0.53598684", "0.5314481", "0.5309244", "0.52713823", "0.52682936", "0.5248168", "0.5239917", "0.5234305", "0.5174357", "0.516069", "0.51568776", "0.51568776...
0.6860168
0
A `dragstart` event has begun within the text editor component.
function editOnDragStart(editor: DraftEditor): void { editor._internalDrag = true; editor.setMode('drag'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startDrag() {}", "onDragStart(event) {\r\n if (this.state.inEditMode) {\r\n event.dataTransfer.setData(\"text\", locationAncestor_type_1.dragAndDropName);\r\n this.module.onDragStart();\r\n }\r\n }", "function editOnDragStart(editor) {\n\t editor._internalDrag =...
[ "0.78175", "0.76812345", "0.74967486", "0.74893457", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7336515", "0.7170924", "0.71629864", "0.714563", "0.71429366", "0.7138021", "0.7130949", "0.7067909", ...
0.7729146
1
Insert the given book `queryBook` in the library, assigning it the given shelf. If the book is already in the library and the user selects a different shelf on it, it will move to that one.
insertInLibrary(shelf, queryBook) { // Store the current shelf the given book is on. let oldShelf = queryBook.shelf; // Check if the current book shelf is different from the one passed // by the user selection. if (oldShelf !== shelf) { // Update the API and insert `queryBook` in the library a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToShelf(book, shelf, library) {\n library.books[library.index] = book;\n library.index++;\n }", "updateShelf(book, shelf) {\n var newBooks = this.state.books.filter(title => title.id === book.id)[0]\n newBooks.shelf = shelf\n this.props.onShelfChange(newBooks, shelf)\n }", "updateBook...
[ "0.68962294", "0.62926334", "0.62426484", "0.622251", "0.6164332", "0.6024052", "0.5908331", "0.5688798", "0.56647706", "0.56574005", "0.5595908", "0.55321115", "0.55274236", "0.5522755", "0.5503803", "0.5493506", "0.5421896", "0.5404429", "0.53935593", "0.53887916", "0.53774...
0.8226448
0
2 Move present to past or future Move new present node to middle, if needed
adjustPresentNode (nextProps) { if (this.state && !isEmpty(this.state.present)) { // - present need go to past, future node comes to present if (!isEmpty(nextProps.artists.past) && this.state.present.id === nextProps.artists.past[nextProps.artists.past.length - 1].id) { let past = this.state.pas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move() {\r\n if (this.cur.getPrevious()) {\r\n this.cur = this.cur.getPrevious();\r\n }\r\n }", "function callback_move_current_node_up() {\n var neighbour_node = get_current_node().parent().prev();\n move_current_node_to_neighbour(neighbour_node, \"before\")\n}", "function moveUp...
[ "0.6140103", "0.6027661", "0.6015296", "0.5983393", "0.5956161", "0.5925517", "0.588686", "0.5821068", "0.5740724", "0.570945", "0.565025", "0.563919", "0.56341684", "0.56035614", "0.5599984", "0.55855525", "0.55851483", "0.556654", "0.55369043", "0.55248874", "0.5521024", ...
0.6681248
0
The item's enhancement increases by 1. If the item enhancement level is 20, the enhancement level is not changed. The durability of the item is not changed.
function success(item) { if (item.enhancement === 20) return { ...item } else return { ...item, enhancement: item.enhancement + 1 }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateItem() {\r\n\r\n\t\t// Base decay\r\n\t\tlet decay = 1;\r\n\r\n\t\t// If Sell In date is passed\r\n\t\tif (this.sellIn <= 0) decay = decay*2;\r\n\r\n\t\t// Update quality \r\n\t\t// Quality can never be lower than 0\r\n\t\tthis.quality -= decay;\r\n\t\tif (this.quality < 0) this.quality = 0;\r\n\r\n\t\tthis....
[ "0.64711976", "0.6428171", "0.6274172", "0.62033415", "0.6154656", "0.6029075", "0.6010919", "0.60028446", "0.59817195", "0.59599084", "0.59441054", "0.5904808", "0.58476245", "0.5838842", "0.5771509", "0.57710344", "0.5740496", "0.5737558", "0.56817925", "0.5677997", "0.5647...
0.65055144
0
If the item's enhancement is less than 15, the durability of the item is decreased by 5. If the item's enhancement is 15 or more, the durability of the item is decreased by 10. If the item's enhancement level is greater than 16, the enhancement level decreases by 1 (17 goes down to 16, 18 goes down to 17).
function fail(item) { if (item.enhancement < 15) { if ((item.durability - 5) < 0) item.durability = 0; else item.durability -= 5 return { ...item, durability: item.durability }; } else { if ((item.durability - 10) < 0) item.durability = 0; else item.durability -= 10 if (item....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fail(item) {\n if(\n typeof item.name !== \"string\" ||\n typeof item.enhancement !== \"number\" ||\n typeof item.durability !== \"number\" ||\n item.enhancement > 20 ||\n item.enhancement < 0 ||\n item.durability > 100 ||\n item.durability < 0\n ){\n return 'Error with your...
[ "0.62673163", "0.62529397", "0.6168157", "0.60747105", "0.60622764", "0.5962027", "0.59315073", "0.57997996", "0.57937855", "0.57477564", "0.57475203", "0.57237506", "0.570997", "0.5691516", "0.5676309", "0.5647926", "0.5633966", "0.5614667", "0.55843925", "0.55538577", "0.55...
0.6942902
0
functions to find nearest palindrome date
function forwardNextDate(date, month, year) { let yearForward = Number.parseInt(year); let monthForward = Number.parseInt(month); let dateForward = Number.parseInt(date); let diff = 0; let found = false; while (!found) { dateForward++; if (isLeapYear(yearForward)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNextPalindrome(date) {\n var nextDate = getNextDate(date);\n var ctr = 0;\n\n while (1) {\n ctr++;\n var palindrome = checkForAllDateFormats(nextDate);\n if (palindrome) {\n return (\"This date is not Palindrome, though after \" + ctr + \" days on \" + nextDate....
[ "0.68642414", "0.68019074", "0.6568026", "0.60427547", "0.5958924", "0.5713761", "0.56871814", "0.5634942", "0.55707973", "0.5527716", "0.55246496", "0.5511399", "0.5485256", "0.5479822", "0.5466222", "0.54320884", "0.541311", "0.54079396", "0.5390234", "0.53841233", "0.53839...
0.7131393
0
Pure helper function to create a new Comment and add it to the state.
function createComment(state: State, author: ?string, text: ?string): State { let newState = $.extend({}, state); if (!author || !text) { return newState; } newState.status = 'ok'; var newComment = new Comment(author, text); newState.comments = newState.comments.set(newComment.id, newComment); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createComment() {\n Message.loading();\n Comment.create({}, {\n post: $state.params.post,\n content: PostCommentModel.form.content\n }).$promise\n .then(function(comment) {\n console.log(\"---------- comment ----------\");\n console.log(comment);...
[ "0.7212933", "0.71955186", "0.7124099", "0.7029597", "0.69240415", "0.6825397", "0.67949134", "0.66819555", "0.6669035", "0.66473377", "0.6592221", "0.6511727", "0.6498013", "0.6473077", "0.642128", "0.6376469", "0.6376469", "0.6376469", "0.6370322", "0.63699466", "0.63532263...
0.8092718
0
Return creatures from the provided bestiary which are one of: A named creature A copy of a creature An NPC as these creatures are likely to be missed by the automated tagging during conversion.
function getTaggableCreatureList (filename) { if (!filename) return []; const bestiaryJson = ut.readJson(filename); return (bestiaryJson.monster || []) .filter(it => it.isNamedCreature || it.isNpc || it._copy) .map(it => ({name: it.name, source: it.source})); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSantasNaughtyList(persons, badHabit) {\n const coalRecipients = [];\n\n for (let i = 0; i < persons.length; i++) {\n const person = persons[i];\n\n for (let j = 0; j < person.habits.length; ++j) {\n const personsHabit = person.habits[j];\n\n if (personsHabit === badHabit) {\n c...
[ "0.5264865", "0.51549816", "0.5077964", "0.48887193", "0.4885874", "0.48669314", "0.48667294", "0.48141083", "0.48047155", "0.47940564", "0.47810408", "0.4774428", "0.47555858", "0.4725212", "0.47141573", "0.46954805", "0.46905643", "0.4680644", "0.46642792", "0.46362954", "0...
0.5745329
0
Getting the symbol types from the table
function getSymbolTypes(rule, types) { // getting the symbols var seq_symbol = getSequentSymbols(rule); var symbols = seq_symbol[1]; var original_sequents = seq_symbol[2]; var types = fixTypes(types); var connectives = []; // defining the types for (var i = 0; i < symbols.length; i++) { if (types[symbols[i]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function produceSymbolTable(tbl) {\n var a = Object.keys(tbl);\n a.sort();\n var nt = {};\n var k;\n for (var i = 0, len = a.length; i < len; i++) {\n k = a[i];\n // `$eof` and `EOF` are synonyms of `$end` (`$eof` is for bison compatibility);\n //...
[ "0.64118546", "0.6190746", "0.6090457", "0.5980775", "0.59718996", "0.59609103", "0.59211177", "0.59060204", "0.58875", "0.5839788", "0.58057153", "0.580221", "0.5794173", "0.56958675", "0.5633534", "0.55902445", "0.5550976", "0.5513362", "0.5490972", "0.5463289", "0.546108",...
0.65077287
0
Parse the Email Info Layout
function parseEmail(re) { var semiRemove = re.indexOf(":"); //Remove for tag (only first instance) re = re.replace("MATMSG:", ""); re = re.replace("TO:", ""); re = re.replace(" ", ""); var semi = re.indexOf(";"); var Email = re.substring(0, semi); re = re.replace(Email, ""); re = re.slice(1); re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseMessage(line) {\n const [from_user, from_site, from_room, to_user, to_site, to_room, body] =\n line.split('~');\n\n // const msg = line.split('~');\n // if (msg.length < 7) {\n // return;\n // }\n\n return { from_user, from_site, from_room, to_user, to_...
[ "0.5293866", "0.5213139", "0.51040274", "0.5040065", "0.5039253", "0.5013117", "0.50114924", "0.50047463", "0.49912286", "0.4980935", "0.49581388", "0.4947729", "0.4932386", "0.49036303", "0.48977697", "0.4894676", "0.4870558", "0.4855537", "0.4828157", "0.48219848", "0.48005...
0.57039696
1
Parse the SMS Info Layout
function parseSMS(re) { //Remove for tag (only first instance) re = re.replace("SMSTO:", ""); var colon = re.indexOf(":"); var PhoneNumber = re.substring(0, colon); var SMS = re.substring(colon + 1, re.length); return [PhoneNumber, SMS]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseMessage(line) {\n const [from_user, from_site, from_room, to_user, to_site, to_room, body] =\n line.split('~');\n\n // const msg = line.split('~');\n // if (msg.length < 7) {\n // return;\n // }\n\n return { from_user, from_site, from_room, to_user, to_...
[ "0.566763", "0.5479201", "0.5366683", "0.5328703", "0.5323242", "0.53222424", "0.53121537", "0.52968085", "0.5221031", "0.5204505", "0.5190198", "0.5132318", "0.5084829", "0.50800467", "0.5060257", "0.50434947", "0.50076234", "0.5004904", "0.4988219", "0.49822688", "0.4975758...
0.5803125
1
Initialize the view. Args: options (object): Options passed to this view. Option Args: elements (Array, optional): An initial array of elements to center.
initialize(options={}) { this._elements = options.elements || new Map(); this._$window = $(window); this._updatePositionThrottled = _.throttle(() => this.updatePosition(), 10); this._$window.on('resize', this._updatePositionThrottled);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(elements, heading, pasive, options) {\n getOptions(options);\n\n if (elements.global) {\n setUpMarkup(elements.global, heading);\n }\n else {\n setUpPartialMarkup(elements.canvas, elements.parent, elements.strip, elements.search, heading);\n }\...
[ "0.59049886", "0.5342971", "0.5342971", "0.5213773", "0.5200594", "0.5173386", "0.5145952", "0.51412076", "0.5122021", "0.5113127", "0.5100748", "0.5098163", "0.50897574", "0.50787544", "0.5059375", "0.5045956", "0.5043294", "0.5035844", "0.5035844", "0.5025211", "0.502119", ...
0.57083684
1
Set the elements and their containers. Args: elements (Map): The elements to center within their respective containers.
setElements(elements) { this._elements = elements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeElements(elements) {\n if ($('.home')) return; // Nothing to do on the home page\n\n let cellSize = window.innerWidth/columnCount;\n\n for (let key in elements) {\n let el = $(key),\n wrapper = el.parentNode,\n sta...
[ "0.5723735", "0.571367", "0.5583746", "0.55746466", "0.53992623", "0.53985393", "0.53985393", "0.53985393", "0.5270801", "0.5254172", "0.52534926", "0.5236609", "0.5213197", "0.51811814", "0.5151634", "0.5092961", "0.5092961", "0.5090419", "0.50780237", "0.50779927", "0.50652...
0.6049197
0
CLAUSE CLASS Clause( int arr[], double radius, boolean framed )
function Clause( arr, radius ){ this.size = 0; this.container = new createjs.Container(); this.arr = arr.slice(); this.tmpArr = []; for( var i = 0; i < this.arr.length; i++ ) if( this.arr[i] ) { this.size++; this.tmpArr.push( (i+1)*sign(this.arr[i] )); } this.setRadius( radius ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Qd(a){this.radius=a}", "function fc(a){this.radius=a}", "function je(a){this.radius=a}", "function oc(a){this.radius=a}", "function Cc(a){this.radius=a}", "function Bc(a){this.radius=a}", "function ec(b){this.radius=b}", "function ae(a){this.radius=a}", "function xe(a){this.radius=a}", "...
[ "0.59814906", "0.56408405", "0.54746264", "0.5382989", "0.5372571", "0.5370016", "0.53150046", "0.5304218", "0.5245279", "0.51989937", "0.5196132", "0.51943225", "0.51900053", "0.5182635", "0.51793", "0.51606643", "0.51303244", "0.5116106", "0.5078815", "0.5073677", "0.506949...
0.78901273
0
getButtonGraphics( boolean isActive ) returns a Graphics() object, drawing the clause firing button's borders.
function getButtonGraphics( isActive ){ var g = new createjs.Graphics(); if( isActive ){ g.beginFill(activeMenuColor).drawRoundRect( -buttonSize/2, -buttonSize/2, buttonSize, buttonSize, round ); }else{ g.beginFill(inactiveMenuColor).drawRoundRect( -buttonSize/2, -buttonSize/2, buttonSize, buttonSize, round ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawButton(){\n\t//Draw the center\n\tctx.beginPath();\n\tif (buttonPressed){\n\t\tctx.fillStyle=buttonPressedCol;\n\t}else{\n\t\tctx.fillStyle=buttonUnpressedCol;\n\t}\n\tctx.arc(buttonCenterX,buttonCenterY,buttonRadius ,0,Math.PI*2);\n\tctx.fill();\n\tctx.closePath();\n\n\t//Draw the outer line\n\tctx.b...
[ "0.6075853", "0.5706412", "0.5589832", "0.55627275", "0.55129856", "0.5426153", "0.5371265", "0.53631717", "0.5355751", "0.5292688", "0.52824676", "0.527331", "0.5200971", "0.51782405", "0.5163259", "0.5156403", "0.5122628", "0.5121792", "0.51017684", "0.5089937", "0.5084729"...
0.78887194
0
void checkObsoletes() if the mob is a proper subset of some weapon, then the weapon is marked as obsolete (and eventually disappears). assumption: the weapons themselves are NOT subsets of each other.
function checkObsoletes( ){ for( var j = 0; j < buttonsPerRow * buttonRowCount; j++ ){ if( buttonArray[j].clause === null ) continue; if( buttonArray[j].isObsoleted ) continue; // if a weapon is a subset of the mob, then the mob does not give new obsolete weapons due to transitivity if( containsArray( mob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkUnlockBuyableUpgrades() {\n // temp variables to improve code readability\n const [coffee, multiMonitor, headphones] = [\n this.upgrades.coffee,\n this.upgrades.multiMonitor,\n this.upgrades.headphones\n ];\n\n if (this.score >= coffee.price && !coffee.unlocked) {\n UI.unlockBu...
[ "0.6032784", "0.5942558", "0.59013134", "0.57667255", "0.57641697", "0.5585526", "0.54955643", "0.54930276", "0.5467947", "0.537985", "0.5378862", "0.5353165", "0.53416216", "0.53221774", "0.53141767", "0.53125346", "0.52635515", "0.5233261", "0.52326334", "0.5223492", "0.522...
0.8267501
0
Get a document (row) from a `collection` (table) where `field` == `value` ex: get('goals', 'evidence', 'straight A's')
async find(collection, field, value) { try { const querySnapshot = await this.api.collection(collection).where(field, "==", value) .get(); return querySnapshot.docs.shift().data(); } catch (err) { return 'Error retrieving documents (aka rows): ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findByField(field, value) {\n logger.debug('Finding', field, value)\n\n if (value === undefined) {\n return this.query().where(field)\n }\n\n return this.query().where(field, value)\n }", "function findDoc(col, key, val)\n{\n\tlet init = initializeDb();\n\treturn init.then(function()\n\t...
[ "0.63429713", "0.6228222", "0.62052685", "0.59697324", "0.58965605", "0.58495015", "0.5632379", "0.55931866", "0.55551726", "0.5527926", "0.5517223", "0.5476595", "0.54751384", "0.5473252", "0.5445944", "0.54111385", "0.54044145", "0.53996754", "0.5377052", "0.5315158", "0.53...
0.77722245
0
Get a document (aka row) from a collection (table) by its id
get(collection, id) { return this.find(collection, 'id', id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readDocument(collection, id) {\n // Clone the data. We do this to model a database, where you receive a\n // *copy* of an object and not the object itself.\n var collectionObj = data[collection];\n if (!collectionObj) {\n throw new Error(`Object collection ${collection} does not exist i...
[ "0.6968537", "0.6931169", "0.6931169", "0.69242156", "0.6899704", "0.68816596", "0.68727696", "0.67518646", "0.67418766", "0.6622694", "0.65870696", "0.657133", "0.6533373", "0.6465477", "0.64101434", "0.6395872", "0.6333771", "0.6326045", "0.63111925", "0.6301121", "0.629472...
0.7162517
0
Delete a document (row) from a collection (table) by id
delete(collection, id) { this.api .collection(collection) .doc(id) .delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(id){\n console.debug(\"Delete \"+this.props.schema.title+\" with ID \"+id);\n let db = new PouchDB(OBJECT_DB);\n\n db.get(id, function(err, doc){\n db.remove(doc, function(err, response){\n if(err)\n console.error(err);\n\n thi...
[ "0.755612", "0.7463424", "0.74597836", "0.7442909", "0.73929447", "0.73883826", "0.73883826", "0.7344847", "0.7331587", "0.7094714", "0.7036158", "0.69839424", "0.69296074", "0.6868355", "0.68475735", "0.6825845", "0.68235016", "0.67983115", "0.67959285", "0.6751374", "0.6750...
0.7970193
0
Wrap provided content in a class name
function wrapClass(wrapper, content) { return wrapper + ' {\n' + content + '}'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap( mxsClass, value ){\r\n\t\t\t\t\t\t\r\n\t\t\treturn \"<font class='\" + mxsClass + \"'>\" + value + \"</font>\";\r\n\t\t\t\r\n\t\t}", "function makeEl(s) {\n var a = s.split('.');\n var tag = a.shift();\n var el = document.createElement(tag);\n el[className] = a.join(' '...
[ "0.62364453", "0.6119594", "0.5950534", "0.5871829", "0.58696806", "0.5843386", "0.58276844", "0.5749683", "0.5724558", "0.57176197", "0.56798923", "0.5670495", "0.5669825", "0.56592834", "0.56539255", "0.56539255", "0.5645492", "0.56403804", "0.56355053", "0.56321657", "0.56...
0.7332757
0
Function that checks if valArray includes false and stores boolean true/false in arrayBoolean for intForm
function arrayBoolean() { let submitNow = true; if (valArray.includes(false)) { submitNow = false; } return(submitNow); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBoolArray(array){\n for(let i = 0; i<array.length; i++){\n if (array[i] === false){\n return false;\n }\n }\n return true\n}", "function remove_false_value(array) { \n\n var final_array = [];\n if (!Array.isArray(array)) { \n return \"Introduceti un array!\"\n...
[ "0.6887675", "0.66487247", "0.65375495", "0.6471921", "0.64526117", "0.6410517", "0.60813934", "0.6029209", "0.59904605", "0.59682745", "0.59623075", "0.59437346", "0.59225446", "0.59116924", "0.59023005", "0.5880528", "0.5880528", "0.5880107", "0.58772457", "0.5838729", "0.5...
0.7851114
0
checks value of arrayBoolean and use boolean value for alert
function submitSubmit() { if (arrayBoolean() === true) { alert("You have successfully signed up"); } else { alert("please fill in the mandatory fields in the form") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayBoolean() {\n let submitNow = true;\n if (valArray.includes(false)) {\n submitNow = false;\n } return(submitNow);\n}", "function check(){\n\t\thasresult = [];\n\t\tcal.each(function(){\n\t\t\tif($(this).val()){\n\t\t\t\thasresult.push(\"true\");\n\t\t\t} else {\n\t\t\t\thasresult.pu...
[ "0.67607594", "0.6574712", "0.63840854", "0.63328075", "0.62857175", "0.62459815", "0.61544025", "0.6074176", "0.6055319", "0.60405695", "0.5996629", "0.58961874", "0.58636045", "0.58442044", "0.5826619", "0.5826619", "0.5817693", "0.5817693", "0.57961416", "0.57951653", "0.5...
0.66945344
1
This function will apply push page down to info bar
function apply_push_page_down(info_bar) { setTimeout(function() { var has_toggle_btn = info_bar.data('toggle'), toggle_visible = info_bar.data('toggle-visible') || null, toggle = false; push_page_down( info_bar, toggle, toggle_visible ); }, 30...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cal_top_margin_push_down(info_bar,animate_push_page, toggle ) {\n\n var cp_push_down_support_container = jQuery(\"#cp-push-down-support\").val(); // Retrieve class / ID which user enter in &author setting\n var cp_top_offset_container = jQuery(\"#cp-top-offset-container\").val();\n va...
[ "0.6896858", "0.66465604", "0.62743247", "0.6237889", "0.6175835", "0.608319", "0.6027352", "0.59959733", "0.5916115", "0.5857835", "0.58029324", "0.57946455", "0.5794549", "0.57741064", "0.57741064", "0.5772325", "0.5760621", "0.57401335", "0.5727784", "0.5707901", "0.570052...
0.7715732
0
Function for adding focus/blur listners This is to create continuity between table cells throughout the app so they listen for the same events
function addCellListeners(listenArr){ setImmediate(function(){ listenArr.loopItems(function(listenObj){ //Focus Listeners if(listenObj.focus) addCellListener(listenObj.el, listenObj.focus, "focus"); //Click Listeners if(listenObj.clic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusChangeListener() {\n if(focused) {\n setFocused(true);\n setEditableField({rowId: null, cellId: null});\n if(typeof onCSVCellFocusChange === 'function') {\n onCSVCellFocusChange();\n }\n }\n }", "bindFocusEvents() {\n ...
[ "0.65233874", "0.61251044", "0.60573816", "0.6044695", "0.6044695", "0.6044695", "0.6044695", "0.6044695", "0.6044695", "0.6044695", "0.60320926", "0.5999788", "0.5964428", "0.5932322", "0.59050107", "0.5866505", "0.5810057", "0.5779145", "0.576101", "0.5710412", "0.56676126"...
0.61584795
1
Accepts an array of functions and calls them
function callFunctions(arr, args){ if(arr && typeof arr == "object" && arr.length > 0){ arr.forEach(function(func){ if (func && typeof func == "function") func(args); }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invoke() {\n\tvar fns = arguments[0];\n\tvar args = [];\n\tfor (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n\tfor (var i = 0; i < fns.length; i++) {\n\t\tassertFunction(fns[i], \"Functions[\" + i + \"] is not a function\");\n\t\tfns[i].apply(null, args);\n\t}\n}", "function flow(inpu...
[ "0.75037867", "0.67833096", "0.6753499", "0.6704", "0.66681594", "0.65857893", "0.65186125", "0.65186125", "0.65186125", "0.6515037", "0.65127844", "0.64852124", "0.6477116", "0.64699304", "0.64411336", "0.64215136", "0.6394226", "0.63915294", "0.6387102", "0.637933", "0.6362...
0.8237607
0
Open Project Photos Folder
function photoNav(projectNum, btnEl){ if(projectNum){ var split = projectNum.split("-"); if(split.length == "2"){ var rootPath = 'file://ANDDC01/projects/PHOTOS/'; var baseNum = split[0]; //Navigate if(isIE()){ try { document.location = (rootPath + baseNum + "/" + projectNum + "/"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openProject(){\r\n fileDialog.open()\r\n}", "onMnuOpenClick() {\n\t\t// Show dialog to select directories only\n\t\tvar dir = dialog.showOpenDialog(this.window, {\n\t\t\ttitle: 'Select source directory',\n\t\t\tproperties: ['openDirectory']\n\t\t});\n\n\t\tif (dir && dir.length > 0) {\n\t\t\tthis.loa...
[ "0.6457855", "0.60540104", "0.5996415", "0.5986624", "0.5929346", "0.59088385", "0.5811017", "0.5807111", "0.5741284", "0.57186323", "0.5683009", "0.5643535", "0.5499873", "0.54969394", "0.54962176", "0.5495816", "0.548508", "0.5474123", "0.54720455", "0.5469338", "0.54495704...
0.62118894
1
Function for calculating volume Input take in plates, the weight of the bar, how many sets, reps output the total volume or work created
function calculateVolume (platesSide, barWeight,sets, reps){ var totalPlatesWeight; var totalWeight; var totalVolume; totalPlatesWeight = platesSide * 2; totalWeight = totalPlatesWeight + barWeight; totalVolume = sets * reps * platesSide; return totalVolume; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcPrismVolume() {\n var length = document.getElementById(\"lengthValue\");\n var width = document.getElementById(\"widthValue\");\n var height = document.getElementById(\"heightValue\");\n var prism = document.getElementById(\"prismVolume\");\n\n var volume = length.value;\n volume *= width.value;...
[ "0.69029146", "0.6537174", "0.6487962", "0.6202567", "0.61805075", "0.61553913", "0.6151621", "0.61349374", "0.61179405", "0.6094667", "0.606269", "0.6057406", "0.59839845", "0.5969025", "0.5896534", "0.5891178", "0.5871934", "0.5835975", "0.5830462", "0.5798392", "0.57965463...
0.8319962
0
Generate a set of expressions from the blocks currently in the workspace.
function generateExpressionsFromTopBlocks() { var obj = {}; var topBlocks = Blockly.mainBlockSpace.getTopBlocks(); var equationList = topBlocks.forEach(function (block) { var equation = getEquationFromBlock(block); obj[equation.name || COMPUTE_NAME] = equation.expression; }); return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateExpressionsFromBlockXml(blockXml) {\n if (blockXml) {\n if (Blockly.mainBlockSpace.getTopBlocks().length !== 0) {\n throw new Error(\"generateTargetExpression shouldn't be called with blocks\" +\n \"if we already have blocks in the workspace\");\n }\n // Temporarily put the b...
[ "0.72894657", "0.60753334", "0.58647305", "0.5802962", "0.55832404", "0.5544446", "0.55093586", "0.5507596", "0.5486915", "0.54608953", "0.5451304", "0.5451304", "0.5451304", "0.5451304", "0.5451304", "0.5451304", "0.5451304", "0.5451304", "0.5451304", "0.5447295", "0.5424906...
0.7082319
1
Given some xml, generates a set of expressions by loading the xml into the workspace and calling generateExpressionsFromTopBlocks. Fails if there are already blocks in the workspace.
function generateExpressionsFromBlockXml(blockXml) { if (blockXml) { if (Blockly.mainBlockSpace.getTopBlocks().length !== 0) { throw new Error("generateTargetExpression shouldn't be called with blocks" + "if we already have blocks in the workspace"); } // Temporarily put the blocks into the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateExpressionsFromTopBlocks() {\n var obj = {};\n\n var topBlocks = Blockly.mainBlockSpace.getTopBlocks();\n var equationList = topBlocks.forEach(function (block) {\n var equation = getEquationFromBlock(block);\n obj[equation.name || COMPUTE_NAME] = equation.expression;\n });\n return obj;...
[ "0.54774445", "0.47658753", "0.46556476", "0.46391922", "0.4618435", "0.4582179", "0.45736513", "0.4555839", "0.45306128", "0.45164496", "0.4474551", "0.44525546", "0.4383569", "0.4345887", "0.4345887", "0.43142968", "0.43004355", "0.42951918", "0.42826128", "0.42812768", "0....
0.72989583
0
Draws a user expression and each step collapsing it, up to given depth. Returns true if it couldn't collapse any further at this depth.
function animateUserExpression (maxNumSteps) { var finished = false; if (_(appState.userExpressions).size() > 1 || _(appState.targetExpressions).size() > 1) { throw new Error('Can only animate with single user/target'); } var userExpression = appState.userExpressions[COMPUTE_NAME]; if (!userExpressi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCollapse() {\n var lines = 0;\n \n for (var i = 0; i < deadSquares.length; i++) {\n if (deadSquares[i].length >= GRID_SIZE / 2) {\n collapseRow(i);\n lines++;\n levelHandler();\n }\n }\n return lines\n}", "function collapsed(d) {\n if (d.children && d._children) {\n...
[ "0.52594626", "0.50755215", "0.4695774", "0.46470964", "0.46277106", "0.46237698", "0.45583752", "0.45514402", "0.45163468", "0.44610745", "0.44544443", "0.44305497", "0.4420869", "0.43987682", "0.4393201", "0.4377139", "0.43742916", "0.43474466", "0.43466908", "0.43225405", ...
0.6343643
0
Add some text to parent element at given xPos with css class className
function addText(parent, str, xPos, className) { var text, textLength; text = document.createElementNS(Blockly.SVG_NS, 'text'); // getComputedTextLength doesn't respect trailing spaces, so we replace them // with _, calculate our size, then return to the version with spaces. text.textContent = str.replace(/ /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLabel(parent, x, y, class_, text) {\n return parent.append(\"text\")\n .attr(\"class\", class_)\n .attr(\"x\", x)\n .attr(\"y\", y)\n .text(text);\n}", "translateTextX (offsetX) {\n this.x += offsetX;\n }", "function addText(classAttr, x, y, textAnchor, text) {\n ...
[ "0.6792648", "0.622738", "0.6129372", "0.6121901", "0.6083902", "0.6046232", "0.5959079", "0.5841632", "0.57841116", "0.577842", "0.5698205", "0.5647003", "0.5569408", "0.5532325", "0.55318", "0.5520129", "0.54819757", "0.54556507", "0.5444333", "0.54274607", "0.54213786", ...
0.6893413
0
Deep clone a node, then removing any ids from the clone so that we don't have duplicated ids.
function cloneNodeWithoutIds(elementId) { var clone = document.getElementById(elementId).cloneNode(true); var descendants = clone.getElementsByTagName("*"); for (var i = 0; i < descendants.length; i++) { var element = descendants[i]; element.removeAttribute("id"); } return clone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _clone(node){\n\t\tvar lastId = 0;\n\t\tvar clones = {}; // target property creates cycles\n\t\tfunction cloneOne(child){\n\t\t\tif (!child || !child.type) \n\t\t\t\treturn child;\n\t\t\tvar cloneId = child._cloneId;\n\t\t\tif (!cloneId) \n\t\t\t\tcloneId = (child._cloneId = ++lastId);\n\t\t\tvar clone = ...
[ "0.6949485", "0.6272557", "0.6219733", "0.621439", "0.6189871", "0.6186048", "0.6042231", "0.5937221", "0.58742803", "0.5848384", "0.5810177", "0.5798048", "0.5717888", "0.5695791", "0.56469643", "0.5609693", "0.5602556", "0.5598846", "0.5560192", "0.5553531", "0.55406874", ...
0.65906745
1
clamps a value between 1.0 and 1.0
function clamp(value) { return (value < -1.0) ? -1.0 : (value > 1.0) ? 1.0 : value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clamp01 (val) {\r\n\t return mathMin(1, mathMax(0, val))\r\n\t }", "saturate(val) {\n\t\tif(val < 0.0) return 0.0;\n\t\tif(val > 1.0) return 1.0;\n\t\treturn val;\n\t}", "function clamp01(val) {\n return mathMin(1, mathMax(0, val));\n }", "set Clamp(value) {}", ...
[ "0.6338082", "0.6322782", "0.6308883", "0.6303889", "0.6276106", "0.6274296", "0.62666", "0.62666", "0.62666", "0.62362844", "0.62362844", "0.62357175", "0.62357175", "0.6221774", "0.62205046", "0.6217658", "0.6217658", "0.6217658", "0.6217658", "0.6217658", "0.6193735", "0...
0.6724236
0
purpose: create an array of wildcard character representing each letter of the word params word word to guess wildChar character to use as the wildcard character returns: an array of wildcard character with the same length as the word to guess
function createPlaceholder( word, wildChar ) { const blankWord = []; const length = word.length; for (let i=0; i < length; i++) { blankWord.push(wildChar); } return blankWord; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeNewWord(dictionary, letters) {\n\t\t\tvar possible = [];\n\t\t\tfor (word in dictionary) {\n\t\t\t\t//console.log(letters);\n\t\t\t\tif (letters.length == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (var i = 0; i < word.length; i++) {\n\t\t\t\t\tvar char = word.charAt(i);\n\n\t\t\t\t\tif (contain...
[ "0.63641787", "0.6214868", "0.6133963", "0.6072083", "0.6047262", "0.59814703", "0.5886438", "0.5851431", "0.5844273", "0.58265644", "0.58088243", "0.5762138", "0.57390803", "0.57187843", "0.5717057", "0.5691508", "0.5673306", "0.5662194", "0.5660909", "0.5616723", "0.5584218...
0.6418991
0
purpose: check if there is a match between the word and user input returns: a boolean, true if there was a match
function isMatch( word, userInput ) { return ( word.indexOf(userInput) > -1 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchWord() {\n if (wordInput.value === wordNow.innerHTML){\n return true\n } else {\n return false\n }\n}", "function matchWords() {\n if (wordInput.value.toLowerCase() === currentWord.innerHTML.toLowerCase()) {\n message.innerHTML = 'Correct';\n retu...
[ "0.7875809", "0.7800119", "0.76767284", "0.76028854", "0.7540958", "0.7517544", "0.75160736", "0.74845207", "0.74845207", "0.74845207", "0.74801475", "0.74611545", "0.74432635", "0.7438989", "0.74365306", "0.7430902", "0.73708975", "0.7366622", "0.7356584", "0.7344988", "0.73...
0.8391301
0
get all instances of all adapters in the list
function getAllInstances(adapters, callback) { var instances = []; var count = 0; for (var k = 0; k < adapters.length; k++) { if (!adapters[k]) continue; if (adapters[k].indexOf('.') === -1) count++; } for (var i = 0; i < adapters.length; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all() {\n //Return the adapters as an array of name values.\n return Object.keys(adapters).map(retAdapter);\n\n /** Creates a name adapter pair for the adapter */\n function retAdapter(name) {\n return {\n ...
[ "0.75258946", "0.669568", "0.6562605", "0.6047414", "0.5960003", "0.5896917", "0.57836527", "0.57833934", "0.5741217", "0.5736246", "0.57231516", "0.5717943", "0.569121", "0.5639892", "0.5633254", "0.56155837", "0.5575268", "0.5564279", "0.555662", "0.55193675", "0.5509141", ...
0.7798026
0
Check if some adapters must be restarted and restart them
function checkRestartOther(adapter, callback) { var adapterDir = tools.getAdapterDir(adapter); try { var adapterConf = JSON.parse(fs.readFileSync(adapterDir + '/io-package.json').toString()); if (adapterConf.common.restartAdapters) { if (typeof adapterConf.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async restart() {\n if (!this.raw) {\n throw new Error(nls_1.localize('noDebugAdapter', \"No debug adapter, can not send '{0}'\", 'restart'));\n }\n this.cancelAllRequests();\n await this.raw.restart();\n }", "_restart(options) {\n return t...
[ "0.61900294", "0.6019556", "0.59651357", "0.5718877", "0.5701499", "0.56902075", "0.56354153", "0.5515452", "0.54687715", "0.5431958", "0.53873307", "0.5376844", "0.53177017", "0.52869725", "0.5281249", "0.5258493", "0.5180091", "0.51436156", "0.5135875", "0.5135785", "0.5120...
0.7833853
0
Promises to load the implementation for the named sensor module
function loadSensorModule(sensorName) { var candidate = path.join(SENSOR_PATH, sensorName + '.js'); return FS.isFile(candidate).then(function(isFile) { return isFile ? require(candidate) : Q.reject('Sensor module file "' + candidate + '" not found'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImplementation(){\n if(typeof window.Promise === 'undefined'){\n throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n \" e.g: require('any-promise/register/bluebird')\")\n }\n return {\n Promise: window.Promise,\n implementation: 'window.Promise'\n ...
[ "0.6152714", "0.6152714", "0.6152714", "0.6152714", "0.6152714", "0.6152714", "0.6152714", "0.6152714", "0.6135431", "0.60817677", "0.5907683", "0.5770368", "0.5736537", "0.5724055", "0.5711692", "0.56119525", "0.5611218", "0.5523914", "0.550349", "0.5486107", "0.5482456", ...
0.7066674
0
Promises the current reading of the named sensor
function getCurrentReading(config, sensorName) { if (!_.isObject(config.sensors[sensorName])) { return Q.reject('Sensor "' + sensorName + '" has not been configured'); } return loadSensorModule(sensorName).then(function(sensorModule) { if (!_.isFunction(sensorModule.getCurrentReading)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read() {\n var readout = sensorLib.read(); //#C\n console.log(\n \"Temperature: \" +\n readout.temperature.toFixed(2) +\n \"C, \" + //#D\n \"humidity: \" +\n readout.humidity.toFixed(2) +\n \"%\"\n );\n return {\n hum: readout.humidity.toFixed(2...
[ "0.6250952", "0.61733663", "0.6159534", "0.6065802", "0.5881249", "0.58082896", "0.58036476", "0.58036476", "0.574773", "0.5667182", "0.5653348", "0.5593892", "0.5536152", "0.55109847", "0.55009353", "0.5497178", "0.5492119", "0.54868084", "0.5473783", "0.5443164", "0.5435738...
0.7019579
0
Promises to write the current readings of all named sensors to a log entry
function writeLogEntry(config, sensorNames) { var currentReadings = _.map(sensorNames, _.partial(getCurrentReading, config)); return Q.all([ getCurrentTimestamp(config), getPersistenceLayer(), Q.all(currentReadings) ]).spread(function(currentTimestamp, persistenceLayer, readings) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logAll(sensorInfos) {\n return Promise.all(sensorInfos.map(_logSensorInfo)).then(function(results) {\n results.map(function(sensorInfo) {\n logger.info('Logged:', JSON.stringify(sensorInfo));\n });\n }, function(error) {\n logger.error('Logging failed:', error);\n }).then(fu...
[ "0.59956557", "0.5790061", "0.56404495", "0.55825293", "0.54314774", "0.5407783", "0.5329073", "0.5326463", "0.52865255", "0.5238551", "0.5226544", "0.5130474", "0.5034724", "0.50328684", "0.5023053", "0.4972751", "0.49558854", "0.49298868", "0.49097887", "0.48766628", "0.486...
0.63958126
0
Promises to output the HTML viewer application to the given path
function outputViewerHTML(config, outputPath) { if (!config.global.dataFile) { return Q.reject('No data file configured (config.global.dataFile should point to one)'); } var outputFile = path.join(path.resolve(outputPath), 'weightwatcher.html'); return FS.makeTree(outputPath).then(function() { /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "open (path) {\n browser.setWindowSize(2000, 2000)\n return browser.url(path)\n }", "function htmlTask() {\n return src(filePaths.htmlPath)\n .pipe(htmlmin({ collapseWhitespace: true }))\n .pipe(dest(\"pub\"))\n .pipe(browserSync.stream());\n}", "function html() {\n let output_di...
[ "0.6055797", "0.60049224", "0.6004603", "0.5981095", "0.58974093", "0.58783704", "0.587443", "0.5816181", "0.5809824", "0.5613494", "0.5606891", "0.5553134", "0.5533806", "0.5520424", "0.5519899", "0.551043", "0.5497158", "0.5486938", "0.54669327", "0.5460244", "0.54563594", ...
0.6711609
0
generates a date which is (sub) days ago e.g. createDate(1) is yesterday
function createDate(sub) { var today = new Date(); var prev = new Date(); prev.setDate(today.getDate() - sub); var d = prev.getDate() + "-" + (prev.getMonth() + 1) + "-" + prev.getFullYear(); return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateDate(first, second){\n var dt = new Date(first);\n var result = Math.round((new Date(second) - new Date(first))/(1000*60*60*24));\n if(result > 0){\n if(result == 1){\n return result + ' day ago';\n }\n return (result + ' days ago');\n }else{\n return ('crea...
[ "0.6937261", "0.69103265", "0.6824293", "0.6790752", "0.6568727", "0.65682036", "0.65353966", "0.6516829", "0.65122736", "0.6472316", "0.64526147", "0.6447012", "0.64041746", "0.63529456", "0.6286167", "0.6266394", "0.6253017", "0.6222025", "0.62199485", "0.6207861", "0.62065...
0.7348524
0
sql to find the count on a specified day SELECT count IN sq WHERE date = d async function as this may take a while
async function getCount(d) { const tag = await Tags.findOne({where: {date: d}}); return tag.count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function theDailyQuery(date) {\n let totalReplies = 0;\n let totalRepliesM = 0;\n let totalSubscribers = 0;\n let totalUniqueUsers = 0;\n let avgReplies = 0;\n let strDate = helpers.formatDateForQuery(date);\n\n let queryTotal = \"SELECT COUNT(*) FROM messages \" +\n \"WHE...
[ "0.66027313", "0.6534596", "0.60531425", "0.5929995", "0.57970893", "0.5787432", "0.57551426", "0.5666319", "0.56603956", "0.56249964", "0.5610069", "0.5580843", "0.5578178", "0.5562997", "0.55360013", "0.5521024", "0.5508698", "0.5507381", "0.54974544", "0.54771906", "0.5451...
0.7145356
0
An implementation of mapdata utils which support googlemaps.
function GoogleMapDataUtils(){ /** * Extracts path-coord. from polyline. * @param polyline : PolylineHolder * @return [google.maps.LatLng] */ this.extractPath = function(polyline){ return _.chain(polyline.runLocations).map(function(runLocation){ return new google.maps.LatLng(runLocation.latitu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MapUtils() {\n}", "function ob_loadMap(o){o(\".ob-google-map-canvas\").each(function(){var e=o(this),a=new google.maps.Geocoder;a.geocode({address:e.data(\"address\")},function(o,t){if(t==google.maps.GeocoderStatus.OK){var i=Number(e.data(\"zoom\"));i||(i=14);var n=\"user_map_style\",s={zoom:i,scrollwhe...
[ "0.683178", "0.6811863", "0.67465675", "0.67064035", "0.66491365", "0.65758973", "0.6485282", "0.643329", "0.6373717", "0.6373119", "0.6370119", "0.6370112", "0.6352775", "0.6328413", "0.6323231", "0.63077736", "0.6299223", "0.62951815", "0.62765545", "0.62615854", "0.6258964...
0.76404727
0
Process the passed arguments and send them to monitor execution. Receive: arguments to be processed
function monitorInputProcess(args) { //<METRIC_STATE> var metricState = args[0].replace("\"", ""); var tokens = metricState.split(","); var metricsExecution = new Array(7); for(var i in tokens) metricsExecution[i] = (tokens[i] === "1"); // <HOST> var hostname = args[1]; // <PORT> var port = args[2]; if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processArgs() {\n for (const arg in receivedArgs) {\n // eslint-disable-next-line no-prototype-builtins\n if (receivedArgs.hasOwnProperty(arg)) {\n const argument = getArgumentDefinitionFromArgument(receivedArgs[arg]);\n switch (argument[0]) {\n case \...
[ "0.65207404", "0.6507617", "0.64751613", "0.6393536", "0.639203", "0.6228068", "0.6179707", "0.6150801", "0.60950625", "0.6026894", "0.5880674", "0.58798736", "0.58255744", "0.5730761", "0.5654214", "0.5589117", "0.5577703", "0.5546846", "0.5505114", "0.5455237", "0.5450276",...
0.6569202
0
Return the watching files in absolute path
function getWatchFiles(doc) { return __awaiter(this, void 0, void 0, function* () { let cwd, files; if (vscode.workspace.rootPath) { let detectList = yield vscode.window.showInputBox({ placeHolder: "e.g. app/*.html|app/*.css", prompt: "Enter relative...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get watchGlob () {\n return [\n `${this.rootDir}/${this.config.directories.content}/**/*.adoc`,\n `${this.rootDir}/${this.config.directories.pages}/${this.config.edge.contentView}`\n ]\n }", "watch() {\n fs.readdir(this.watchDir, (err, files) => {\n if (err) throw err;\n for (var in...
[ "0.66066813", "0.65742373", "0.6375459", "0.6366537", "0.63281286", "0.6289332", "0.624852", "0.61936665", "0.61629266", "0.6144538", "0.6144052", "0.60785824", "0.6076252", "0.603982", "0.6007274", "0.59861934", "0.59454745", "0.59349275", "0.5932534", "0.5929746", "0.591971...
0.70444685
0
HopfieldNetwork is a hopfield network built using object oriented principles
function HopfieldNetwork(nodeNum=4) { this.nodeNum = nodeNum; // Number of nodes that is in the network this.nodes = []; // Array to contain the nodes }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Network() {}", "function Network() {}", "function Network() {}", "function Network() {}", "function Network() {}", "function Network() {}", "function Network() {\n // The Network has a list of neurons\n this.neurons = [];\n\n // We can add a Neuron\n this.addNeuron = function(n) {\n thi...
[ "0.5870809", "0.5870809", "0.5870809", "0.5870809", "0.5870809", "0.5870809", "0.56521404", "0.5642202", "0.5628489", "0.5563147", "0.54905903", "0.54900837", "0.53814834", "0.5381399", "0.5381052", "0.53733283", "0.53685826", "0.5365888", "0.5354896", "0.5274659", "0.5266601...
0.73683757
0
the smart contract Calls the getRootCAs function of the smart contract and returns the result in a given callback function
function getRootCAs(callback) { let CAs = []; contract.methods.getRootCAs().call((err, result) => { if (err) { console.log('Something went wrong while getting list of root CAs'); } else { CAs = result; } callback(CAs); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "regRoot(cb)\n {\n this.rootCbs.push(cb);\n }", "async function readRoots() {\n const merkleInstance = new ethers.Contract(contractAddress, merkleAbi.abi, provider);\n\n const numRoots = await merkleInstance.functions.currentRootIndex();\n\n console.log(numRoots);\n\n for(var i=0; i<=numRoots; i+...
[ "0.58656216", "0.57756335", "0.48873535", "0.48800546", "0.48758182", "0.48665112", "0.4783756", "0.47728017", "0.4768205", "0.47680905", "0.47644347", "0.4758685", "0.47561413", "0.4749005", "0.4745025", "0.47288075", "0.47213152", "0.4711238", "0.47052234", "0.4699644", "0....
0.8037786
0
Takes a PEM encoded certificate, validates it towards the list of root CAs coming from the getRootCAs function, and returns the validation status in a given callback function
function validateCert(certPEM, callback) { getRootCAs(CAs => { let caChain = []; CAs.forEach(ca => { if(ca.revocationReason === '10') { ca = ca.caCert.replace(/\\n/g, '\n'); caChain.push(ca); } }); if (caChain.length === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateCert(cert, cb)\n{\n function getOcspCache()\n {\n try\n {\n if (!getOcspResponseCache().downloadCache(getOcspResonseAndVerify))\n {\n setTimeout(getOcspCache, 10);\n }\n }\n catch (e)\n {\n process.nextTick(function ()\n {\n cb(e);\n });...
[ "0.62105805", "0.5418084", "0.53025407", "0.526277", "0.5232253", "0.50077766", "0.49568328", "0.49390143", "0.49165004", "0.48531753", "0.48477298", "0.4840267", "0.47996914", "0.4770043", "0.4767648", "0.47557473", "0.47417158", "0.4729665", "0.46044856", "0.4598131", "0.45...
0.7696841
0
Based on Jamie et at 2012 "Regions of Dynamical Stability for Discs and Planets in Binary Stars of the Solar Neighborhood" (function might be moved out to general library later)
stabilityRegions(m1, m2, sMA, ecc) { const q = m2 / (m1 + m2); const q1 = m1 / m2; const q2 = m2 / m1; const rEgg = qi => 0.49 * (qi ** (2 / 3)) / ((0.6 * (qi ** (2 / 3))) + Math.log(1 + (qi ** (1 / 3)))); const rI = qi => rEgg(qi) * sMA * (0.733 * ((1 - ecc) ** 1.2) * (q ** 0.07)); co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "syndicate(region, extra, all) {\n if (!game.global.tech['syndicate'] || !game.global.race['truepath'] || !game.global.space.syndicate?.hasOwnProperty(region)){\n return extra ? {p: 1, r: 0, s: 0} : 1;\n }\n let rivalRel = game.global.civic.foreign.gov3.hstl;\n ...
[ "0.6010907", "0.58078134", "0.5662023", "0.562256", "0.5599135", "0.547047", "0.5453651", "0.54226536", "0.53960806", "0.5336504", "0.5308822", "0.52803653", "0.52048117", "0.51980615", "0.518348", "0.5178228", "0.51741445", "0.51721793", "0.5169464", "0.51679355", "0.5162078...
0.62732565
0
List all problems from a delivery
async index(req, res) { const problems = await DeliveryProblem.findAll({ where: { delivery_id: req.params.deliveryId }, }); return res.json(problems); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async list(req, res) {\n const { delivery_id } = await req.params;\n\n /** Verifica se a ordem de envio existe. */\n const delivery = await DeliveryOrder.findByPk(delivery_id);\n\n if (!delivery) {\n return res.status(400).json({ error: `Delivery not found.` });\n }\n\n /** Localiza a ordem....
[ "0.67943656", "0.650528", "0.64107853", "0.6057831", "0.56774145", "0.5549799", "0.5373494", "0.5222302", "0.52084064", "0.51980484", "0.5176023", "0.5159118", "0.51373893", "0.51179147", "0.5080331", "0.50593543", "0.50067216", "0.495615", "0.4940899", "0.4883962", "0.484904...
0.6877684
0
Creates a new delivery problem
async store(req, res) { const schema = Yup.object().shape({ description: Yup.string().required(), }); try { // abortEarly = false to show all the errors found await schema.validate(req.body, { abortEarly: false }); } catch (error) { return res.status(400).json({ errors: error.err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async store(req, res) {\n const { id: order_id } = req.params;\n\n /** processo devalidação dos dados */\n const schema = Yup.object().shape({\n description: Yup.string().required(),\n });\n\n if (!(await schema.isValid(req.body))) {\n return res.status(400).json({ message: 'Validation fai...
[ "0.66959184", "0.62218976", "0.5903668", "0.58330256", "0.57972324", "0.5785449", "0.5765735", "0.5712345", "0.5694272", "0.5682047", "0.5616701", "0.5530823", "0.5514526", "0.549944", "0.54855925", "0.54447085", "0.5432962", "0.5424904", "0.54120743", "0.5387338", "0.5349246...
0.66990167
0
Add and edit article with file upload XHR
uploadArticle(article, files, method) { return new rxjs__WEBPACK_IMPORTED_MODULE_4__["Observable"]((observer) => { const xhr = new XMLHttpRequest(); const formData = new FormData(); if (files.length) { formData.append('image', files[0], files[0].name); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editPost(POST_ID) {\n\n\n\n var id = POST_ID.split('/posts/')[1];\n console.log('aaa' + POST_ID)\n title = $(\"#title1\").val();\n description = $(\"#description1\").val();\n console.log(\"title = \", title);\n console.log(\"des = \", description);\n var x_server = windo...
[ "0.63898844", "0.63694614", "0.6290866", "0.62265754", "0.6221258", "0.6154016", "0.6138663", "0.6005987", "0.598688", "0.5982758", "0.59622175", "0.5937474", "0.5932277", "0.5926126", "0.5923979", "0.5922072", "0.59064513", "0.5904487", "0.58902633", "0.5876128", "0.586457",...
0.660654
0
Return an async function to start a transaction and create a post
function createPostInTx(post, timeout) { return function(done) { // Transaction.begin(db.connector, Transaction.READ_COMMITTED, Post.beginTransaction({ isolationLevel: Transaction.READ_COMMITTED, timeout: timeout, }, function(err, tx) { if (err) return done(err); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async beginTransaction() {\n }", "function postAutoTransaction(req, res, next) {\n const year = req.body.year;\n const month = req.body.month - 1;\n const day = req.body.day;\n const hour = req.body.hour;\n const minute = req.body.minute;\n\n const date = new Date(year, month, day, hour, minut...
[ "0.6814821", "0.66075885", "0.6461136", "0.6433244", "0.6433244", "0.6363675", "0.6336394", "0.6304396", "0.6267988", "0.6198964", "0.619397", "0.6160329", "0.6158842", "0.6153863", "0.614046", "0.61134064", "0.6020497", "0.59692234", "0.59670174", "0.59596646", "0.59572744",...
0.670021
1
Return an async function to find matching posts and assert number of records to equal to the count
function expectToFindPosts(where, count, inTx) { return function(done) { const options = {model: 'Post'}; if (inTx) { options.transaction = currentTx; } Post.find({where: where}, options, function(err, posts) { if (err) return done(err); posts.length.shoul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function findPost(req, res){\n const foundPost = PostModel.find( { tags: { $in: [ req.body.tags ]}} );\n const pageResults = 10;\n const page = req.params.page || 1;\n\n if(foundPost === null){\n return res.json({\n message: 'No posts found'\n });\n }\n\n else {\n ...
[ "0.6632778", "0.6135023", "0.6130952", "0.6009677", "0.58716637", "0.584575", "0.5728961", "0.57174826", "0.5683905", "0.5670177", "0.5647184", "0.5623066", "0.55973613", "0.55860955", "0.55717814", "0.5566498", "0.55564255", "0.5531106", "0.5524265", "0.54957557", "0.5490433...
0.70631677
0
display the list of selected parcels in the LIST tab data comes in as a JSON
function displayList(bca_data) { $("#list").empty(); // the length will be 0 when a property is clicked on that has no associated BCA data if (Object.keys(bca_data).length > 0) { // create a table to hold the results var html = '<table id="list-table" class="table table-condensed">'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParcelInfo(parcel_list) {\n $.ajax({\n type: 'GET',\n url: '../getparcelinfo?parcelList=' + parcel_list.toString(),\n success: function(result) {\n var json = jQuery.parseJSON(result);\n displayList(json);\n if (parcel_list.length > 1) {\n ...
[ "0.650145", "0.6134624", "0.6045335", "0.60244983", "0.6017145", "0.59664303", "0.5883064", "0.58316296", "0.5814708", "0.57567376", "0.5716469", "0.5703853", "0.5688398", "0.56571215", "0.56514555", "0.5642303", "0.5629303", "0.562747", "0.5612271", "0.560856", "0.5597355", ...
0.622105
1
display demographic info for surrounding area using information gathered in the 2011 Canadian census
function displayDemoCensus(csduid) { // undefined csduid occurs when user clicks on a property that has no associated BCA data if (typeof(csduid) == 'undefined') { var html = '<p>No data could be found for the selected parcel(s).</p>'; $('#demographics-census').empty(); $('#demographics-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMap() {\n OM.gv.setResourcePath(\"../..\");\n \n //this defines a universe with the custom Albers-USA map projection that\n //scales and moves the states of Alaska and Hawii closer to the lower 48\n //states.\n var config = {\n //special srid 505050 represents the client-side ...
[ "0.6337103", "0.61297494", "0.59896123", "0.5842422", "0.58371663", "0.5812482", "0.58110845", "0.5780538", "0.5777104", "0.5777035", "0.5742038", "0.57250434", "0.5719739", "0.5711395", "0.5704672", "0.5693919", "0.56884265", "0.5686817", "0.5674054", "0.56402344", "0.562450...
0.6260055
1
display demographic info for surrounding area using information gathered in the 2011 Canadian National Household Survey
function displayDemoNHS(csduid) { // undefined csduid occurs when user clicks on a property that has no associated BCA data if (typeof(csduid) == 'undefined') { var html = '<p>No data could be found for the selected parcel(s).</p>'; $('#demographics-nhs').empty(); $('#demographics-nhs')....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayDemoCensus(csduid) {\n // undefined csduid occurs when user clicks on a property that has no associated BCA data\n if (typeof(csduid) == 'undefined') {\n var html = '<p>No data could be found for the selected parcel(s).</p>';\n $('#demographics-census').empty();\n $('#dem...
[ "0.6033563", "0.59176934", "0.5818389", "0.58081454", "0.5781689", "0.5769509", "0.57504237", "0.57422113", "0.5738764", "0.57218343", "0.57026607", "0.5692195", "0.5676534", "0.565199", "0.56401855", "0.56294036", "0.5589685", "0.5581465", "0.555707", "0.5550798", "0.5528331...
0.60832906
0
generate a string of geometry points to be used when finding selected points using PostGIS
function getGeomStr() { // there will be only one feature in the layer var coords_arr = drawing_source.getFeatures()[0].getGeometry().getCoordinates().toString().split(","); var coords_list = ''; // loop through all of the points in coords_arr for (var i=0; i<coords_arr.length; i++) { // ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toString(){// convert to a poly point string\nfor(var i=0,il=this.length,array=[];i<il;i++){array.push(this[i].join(\",\"))}return array.join(\" \")}", "function genPointString(vectorArray,radius){\n var pointString = \"\";\n for (i=0; i < n; i++){\n pointString =...
[ "0.6650668", "0.6559325", "0.64927316", "0.63779175", "0.6357382", "0.63222647", "0.62527525", "0.6072796", "0.6048747", "0.6048747", "0.6005424", "0.5981772", "0.5893098", "0.5881888", "0.5784347", "0.5774827", "0.57499856", "0.56764793", "0.5665826", "0.5660314", "0.5650760...
0.7918097
0
Event Functions Check if cookieBox must be displayed. Called when DOM is ready
function loadCookieBox(){ var hideCookieBox = getCookie('hideCookieBox'); if(hideCookieBox !== "true") showCookieBox(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCookieAgreement() {\n var cookiesClicked = Cookies.get('cookiesClicked')\n if (typeof cookiesClicked == 'undefined') {\n $(\".cookie-warning\").css(\"bottom\", $(\".footer\").height() + 30);\n $(\".cookie-blocker\").css({\n \"position\": \"absolute\",\n \"top\": \"0\",\n \"bottom\":...
[ "0.7113178", "0.6988333", "0.6907754", "0.6866528", "0.6808647", "0.670798", "0.6702143", "0.667093", "0.66088915", "0.6603226", "0.65387386", "0.6528833", "0.6439662", "0.64362", "0.6391863", "0.6321185", "0.6311609", "0.63107073", "0.63104016", "0.6308993", "0.62901574", ...
0.72274786
0
Check if anything was clicked three times
function clickListener(){ /* Using "HTML5 data attribute to prevent using a global variable (even if this might not be the most performant way)*/ var counter = getByElement('body').getAttribute('data-count'); counter++; // Update data-attribute in HTML body tag getByElement('body').se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickCounter() {\n if (startTimer) {\n if (timeDifference() > 3) {\n resetTimer();\n }\n }\n clickCount += 1;\n if (clickCount == 1) {\n startTimer = Date.now();\n }\n }", "function isDoubleClicked(element) {\n //if already clicked return TRUE to indicate this cl...
[ "0.67808515", "0.67206043", "0.66744345", "0.6643101", "0.6566059", "0.6414824", "0.63712937", "0.6317364", "0.6281667", "0.6281196", "0.6281196", "0.6224033", "0.6160691", "0.615812", "0.6113513", "0.6092398", "0.6076174", "0.6054989", "0.6002556", "0.5999004", "0.5988534", ...
0.68243
0
Builds pathfinder functionality and listens for grid square events
function buildPathfinder() { var movePath = []; var realMovePath = []; var finder = new PF.AStarFinder(); // filter enemies from square array var enemies = _.filter( self._gridArray, function( square ) { if( square.instance.model.get('enemy') ) return square; }); // Add click listene...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddListeners() {\n const squarediv = document.querySelectorAll(\"div.grid\");\n\n // I have deviated from the project instructions.\n // Instead of drawing a sketch by hovering the cursor over the grid without clicking any button,\n // I chose a more natural approach. The user should be able to draw w...
[ "0.56973195", "0.55451906", "0.5510531", "0.5499112", "0.5496545", "0.5476586", "0.5448993", "0.5416958", "0.5388468", "0.5336513", "0.530876", "0.53068125", "0.52965945", "0.52865106", "0.52863", "0.5285844", "0.5266944", "0.5245378", "0.5234061", "0.5233916", "0.52003556", ...
0.69239396
0
function yang akan memfilter angka genap dari array number menjadi leih besar dari 5
function lebihBesardariLima(param) { // parameter param = digunakan untuk mengambil argumen array number[] // singkatnya : (param = number[]) return param.filter(function (e) { // parameter e = digunakan untuk menangkap setiap elemen dari array number // singkatnya : (e = elemen dari array ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filtro(){\n var eleitos = [4, 6, 7, 9, 12, 13]\n var novosEleitos = eleitos.filter(exe5)\n // o vetor gerado, não necessáriamente tem o mesmo número de elementos que o vetor original\n // diferentemente da função map\n console.log(novosEleitos)\n}", "function fnFilter(){\r\n var a = [1...
[ "0.6615224", "0.63428265", "0.62557477", "0.61752564", "0.6162096", "0.6144475", "0.61126375", "0.60990644", "0.60990644", "0.6095335", "0.6080014", "0.60781187", "0.60531", "0.6029796", "0.6025635", "0.6009422", "0.5984662", "0.5984662", "0.5984662", "0.59832186", "0.5980829...
0.63848925
1
Load Service Providers create object from service provider and register it in serviceProviders array
loadServiceProviders() { for(let i = 0; i < ServiceProviderContainer.length; i++) { let SP = new ServiceProviderContainer[i](this); SP.boot(); this.serviceProviders.push(SP); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadServiceProviders() {\n return __awaiter(this, void 0, void 0, function* () {\n const providers = this.resolve(ConfigRepository_1.ConfigRepository).get('app.providers');\n if (!providers) {\n throw new Error('No service providers found.');\n }\n ...
[ "0.71790797", "0.6968107", "0.6778954", "0.65843123", "0.65313435", "0.65134186", "0.64882785", "0.6487965", "0.6487965", "0.6487965", "0.6487965", "0.64399576", "0.64399576", "0.6435088", "0.63784176", "0.63759744", "0.62757486", "0.62156856", "0.61314684", "0.6067911", "0.5...
0.7824614
0
onItemClicked must be implemented in the extending class.
itemClicked(e, item) { // CartComponent itemClicked e.preventDefault() e.stopPropagation() // If the Quick Add button was clicked if (e.target.type === 'button') { this.addToCartClicked(e, item) } this.props.actions.product....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "itemClicked(e, item) {\n e.preventDefault()\n e.stopPropagation()\n\n // If the Quick Add button was clicked\n if (e.target.type === 'button') {\n this.addToCartClicked(e, item)\n }\n }", "function itemClickHandler (item) {\n\n if (!angular.isFunction(vm.onItemClick)...
[ "0.71105134", "0.7007866", "0.69625473", "0.69544405", "0.6902719", "0.68117887", "0.6739488", "0.6629057", "0.6623241", "0.66216296", "0.6596708", "0.65535676", "0.6518273", "0.64828134", "0.64497536", "0.6418312", "0.6413924", "0.63884103", "0.6362882", "0.6359414", "0.6343...
0.70158523
1
Set initial value for boundAttributes to bind attributes and properties together
static get boundAttributes() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init(){\n this._super(...arguments);\n this.set('_initialAttrs', this.get('attrs'));\n }", "_setAttributes() {}", "initAttributes(props) {\n if (props.value) {\n const attributes = props.value.get(constants.TARGETS).reduce(\n (result, status) => result.set(\n ...
[ "0.6916948", "0.6337058", "0.6207869", "0.61346924", "0.59155434", "0.589261", "0.5857018", "0.5844933", "0.58438045", "0.5730349", "0.56848705", "0.56830394", "0.5677519", "0.5677519", "0.5645555", "0.5613277", "0.56030995", "0.5586116", "0.5565809", "0.55537707", "0.553562"...
0.67448986
1
Set default observed attributes to include boundAttributes
static get observedAttributes() { return [...this.boundAttributes]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get boundAttributes() {\n return [];\n }", "static get observedAttributes() {\n // All attributes\n return CustomSlider.inputAttributes\n .concat(CustomSlider.customAttributes)\n .concat(CustomSlider.tagAttributes);\n }", "observeAttributes() {\n\n // Trigger changes on model...
[ "0.7333482", "0.6669292", "0.6629327", "0.65768075", "0.6549306", "0.6506059", "0.65046763", "0.6463332", "0.64517", "0.6379673", "0.63724124", "0.63670796", "0.636536", "0.6363354", "0.6360969", "0.633565", "0.6331611", "0.6295176", "0.62888795", "0.62273353", "0.6222882", ...
0.7417101
0
Attaches a click event handler if disabled is present. Ensures disabled components cannot emit click events
attachDisabledClickEventHandler() { if (this.constructor.observedAttributes.includes('disabled')) { this.on( 'click', event => { if (this.disabled) { event.stopImmediatePropagation(); } }, true ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickEnabled() {\n return true;\n }", "function clickEnabled() {\n return true;\n }", "handleButtonClick(e) {\r\n if (!this.disabled) {\r\n this._ripple(e.offsetX, e.offsetY, e.target);\r\n if (typeof (this.onClick) === \"function\") {\r\n ...
[ "0.6654274", "0.6654274", "0.6505364", "0.64407533", "0.6325482", "0.61232305", "0.61215794", "0.6107061", "0.60611695", "0.6053627", "0.6052489", "0.60436136", "0.5993074", "0.58748114", "0.5873545", "0.5845611", "0.58042175", "0.575307", "0.5735267", "0.5730645", "0.569194"...
0.84915555
0
no need to add the tab group to the rootwindow just create and return the tabgroup open it later on
function createApplicationTabGroup() { var tabGroup = Ti.UI.createTabGroup({tabsTintColor: Ti.Locale.getString('themeColor')}); Ti.App.mainTabGroup = tabGroup; tabGroup.addEventListener('newLoggedInUser', function () { Ti.API.info("Received newLoggedInUser event. Rebuilding feedWindow"); FeedWi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_insertIntoNewGroup(details) {\n const that = this,\n tab = details.tab,\n tabLabelContainer = details.tabLabelContainer,\n group = details.group,\n groupContainers = that._addGroupContainer(group),\n groupLabel = groupContainers.label,\n gro...
[ "0.6420529", "0.6151997", "0.60765433", "0.6048552", "0.6005803", "0.6003297", "0.59601545", "0.5951338", "0.5940883", "0.59320354", "0.58497566", "0.5784695", "0.57533175", "0.57497257", "0.57497257", "0.5737971", "0.57246363", "0.57210714", "0.5716912", "0.57105756", "0.569...
0.7255325
0
Save the new checkbox option for 'Search for tabs in the current window only' and show a success message
function saveWindowOption() { chrome.storage.sync.get({currentWindowOnly: false}, function () { var checked = document.getElementById('current-window').checked; chrome.storage.sync.set({currentWindowOnly: checked}, function () { insertHTML('general', SUCCESS); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveOptions() {\n var newTab = document.getElementById('newTab').checked;\n chrome.storage.sync.set({\n newTab: newTab\n }, function () {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'O...
[ "0.5874067", "0.5779427", "0.5687689", "0.5672869", "0.56187093", "0.5584805", "0.5569603", "0.5561455", "0.54729706", "0.54622597", "0.5444691", "0.5423065", "0.5419387", "0.5413984", "0.5413064", "0.54112285", "0.5389525", "0.53832245", "0.53681153", "0.5360268", "0.5337308...
0.6529492
0
Add a new URL to the list of blocked URLs in the user settings
function addBlacklistURL() { var url = document.getElementById('blacklist-url').value; url = getDomain(url); // clean the URL to its domain // If the url is invalid, show a message and exit the function if (url.length == 0 || !validURL(url)) { insertHTML('blacklist-add', INVALID); retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "redirectIfBlocked() {\n chrome.storage.local.get(['blockedSites', 'redirectUrl'], (items) => {\n var blockedSites = items.blockedSites || []\n var redirectUrl = items.redirectUrl ? `http://${items.redirectUrl}` : 'http://theguardian.com'\n\n blockedSites.forEach((item) => {\...
[ "0.72203016", "0.6806635", "0.63352764", "0.63329226", "0.6245835", "0.5977796", "0.5967975", "0.5955469", "0.5903048", "0.5851836", "0.58411723", "0.58347553", "0.57993805", "0.57909", "0.57811296", "0.56307787", "0.56228775", "0.5576046", "0.55293024", "0.5477429", "0.54350...
0.8193265
0
Given a URL or list of URLs, update the select option blacklist box with these new additions
function refreshBlacklist(url, newURL) { document.getElementById('blacklist-url').value = ''; if (newURL) { // Append the new URL to the end of the existing ones document.getElementById('blacklisted').innerHTML += '<option value=' + url + '>' + url + '</option>'; } else { // Go throu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addBlacklistURL() {\n var url = document.getElementById('blacklist-url').value;\n url = getDomain(url); // clean the URL to its domain\n // If the url is invalid, show a message and exit the function\n if (url.length == 0 || !validURL(url)) {\n insertHTML('blacklist-add', INVALID);\n ...
[ "0.743676", "0.74235564", "0.66219443", "0.65756255", "0.62122524", "0.60404813", "0.60353804", "0.58863693", "0.5794686", "0.5763883", "0.56476855", "0.5631186", "0.5630191", "0.5572962", "0.5567628", "0.55577755", "0.55043393", "0.5462697", "0.540508", "0.5386013", "0.53713...
0.8323262
0
Handle when the user clicks 'Remove' to remove an item/items from the blacklist
function removeClick() { var options = document.getElementById('blacklisted').selectedOptions; // If no options have been selected, show that as a message if (options.length == 0) insertHTML('blacklist-remove', NO_ITEM); // Create an array of the values (i.e. URLs) of the options var urls = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function liFruitsHandler(eventObject) {\n console.log('li cliked', eventObject.target);\n eventObject.target.remove();\n}", "handleRemoveItem() {\n this.handleChooseItem(parseInt(this.state.boxSelected), -1);\n this.toggleClose();\n }", "function onRemoved() {\n console.log(\"Item rem...
[ "0.70097464", "0.68257755", "0.6785574", "0.6742616", "0.6742616", "0.6731363", "0.67301816", "0.67225724", "0.66306704", "0.6622372", "0.65794224", "0.65075654", "0.64986503", "0.6475372", "0.64577365", "0.64557654", "0.6428976", "0.6397147", "0.63964283", "0.6394127", "0.63...
0.70099217
0
Given a list of URLs, we remove them from the blocked URLs list of the user settings
function removeURLs(toRemove) { chrome.storage.sync.get({blockedURLs: []}, function (obj) { // Remove the newly removed URLs from the user settings list var urls = obj.blockedURLs; urls = urls.filter(function (url) { return toRemove.indexOf(url) == -1; }); // Set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RemovePriorityFromWebsite(url) {\n chrome.storage.sync.get(['CTMS_urls'], function(result) {\n let userPrioUrls = [];\n if(!result){ \n userPrioUrls = result;\n userPrioUrls.forEach(crrurl => {\n if(crrurl.url === url){\n userPrioUrls...
[ "0.6753118", "0.66416574", "0.64949125", "0.64078623", "0.6354371", "0.6340911", "0.62991995", "0.6229901", "0.61092556", "0.5941469", "0.59093845", "0.5905867", "0.5885753", "0.5879101", "0.58342427", "0.576517", "0.57562196", "0.5744657", "0.5719971", "0.57156646", "0.57062...
0.81064993
0
Translations autocomplete input box
function init_translations() { $( '.tr_lang' ).each( function(){ var tr_lang = $( this ).attr( 'id' ).substring( 8 ); var td = $( this ).parent().parent().siblings( '.pll-edit-column' ); $( this ).autocomplete( { minLength: 0, source: ajaxurl + '?action=pll_posts_not_translat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autocomplete(input, array) {\r\n\r\n}", "function textTranslated(data) {\r\n var translation = data.translation;\r\n\r\n var inputText = document.getElementById(\"inputText\");\r\n inputText.value = translation;\r\n}", "function autocompletar()\n{\n var locales=new Array();\n var url=ur...
[ "0.64584816", "0.63715875", "0.6221613", "0.6177019", "0.6160165", "0.61324465", "0.60576713", "0.6055109", "0.6034127", "0.5999539", "0.5999091", "0.5956575", "0.5945913", "0.5941352", "0.59405243", "0.59340304", "0.5887479", "0.5886877", "0.58815706", "0.5868898", "0.586553...
0.67506516
0
Respond to the selection of a new shape type.
function onTypeChanged () { // Clear out old clicks and start fresh clickList = [] // Deselect any scene shape and disable transformation controls $('#shapeSelect')[0].selectedIndex = -1 $('#transformSet').prop('disabled', true) // Reset default radius when we move to circle type (this avoids // the cas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Shape(type) {\n this.type = type;\n this.get_type = function() {\n return this.type;\n }\n}", "function plotSelect(type) {\n\tif (type == GlobalStrings.ROOM) {\n\t\troomSelected();\n\t} else if (type == GlobalStrings.DOOR) {\n\t\tdoorSelected();\n\t} else if (type == GlobalStrings.HALLWA...
[ "0.6307292", "0.62541497", "0.61716896", "0.6136809", "0.60309273", "0.59484917", "0.5929292", "0.5913459", "0.58687377", "0.58624774", "0.5855415", "0.58458", "0.58248186", "0.5823337", "0.5785952", "0.5754851", "0.5746305", "0.5652595", "0.56396997", "0.5629374", "0.5613918...
0.67726564
0
Copy the current shape properties (color, filled and radius) in the GUI to the current actively selected shape in the scene.
function updateShapeProperties () { // Check index and retrieve relevant shape let index = $('#shapeSelect')[0].selectedIndex if (index >= 0 && index < Interface.scene.length) { let shape = Interface.scene[$('#shapeSelect')[0].selectedIndex] // Copy GUI values to shape properties shape.color = GUICol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onActiveChanged () {\n // Check index and retrieve relevant shape\n let index = $('#shapeSelect')[0].selectedIndex\n if (index >= 0 && index < Interface.scene.length) {\n let shape = Interface.scene[$('#shapeSelect')[0].selectedIndex]\n\n // Copy shape properties into the GUI\n $('#redColor')....
[ "0.70044005", "0.651573", "0.6196063", "0.61479986", "0.6078468", "0.6025111", "0.5970048", "0.5953986", "0.5936021", "0.5924155", "0.58615184", "0.58249164", "0.5824898", "0.576486", "0.576165", "0.5650106", "0.5643475", "0.56327426", "0.56074506", "0.56023645", "0.55753475"...
0.7819441
0
Copy the current shape transformation values in the GUI to the current actively selected shape in the scene.
function updateShapeTransformation () { // Check index and retrieve relevant shape let index = $('#shapeSelect')[0].selectedIndex if (index >= 0 && index < Interface.scene.length) { let shape = Interface.scene[$('#shapeSelect')[0].selectedIndex] // Copy values from all transformation controls shape.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onActiveChanged () {\n // Check index and retrieve relevant shape\n let index = $('#shapeSelect')[0].selectedIndex\n if (index >= 0 && index < Interface.scene.length) {\n let shape = Interface.scene[$('#shapeSelect')[0].selectedIndex]\n\n // Copy shape properties into the GUI\n $('#redColor')....
[ "0.7386766", "0.63309216", "0.63228154", "0.6037235", "0.5827235", "0.5743599", "0.5708688", "0.5699288", "0.5680395", "0.5643753", "0.5552136", "0.5552136", "0.5539055", "0.5515453", "0.5506081", "0.54890585", "0.54827046", "0.54711634", "0.5458173", "0.54531467", "0.5450806...
0.7798004
0
Extract and parse out the color values in the GUI.
function GUIColor () { return new Color( parseFloat($('#redColor').val()) / 255, parseFloat($('#greenColor').val()) / 255, parseFloat($('#blueColor').val()) / 255 ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readRgb(event) {\n if (event.target.matches('#red')) {\n rgbData.red = event.target.value\n } else if (event.target.matches('#green')) {\n rgbData.green = event.target.value\n } else if (event.target.matches('#blue')) {\n rgbData.blue = event.target.value\n }\n // console.log...
[ "0.6785145", "0.6409468", "0.63964117", "0.6382588", "0.63803107", "0.63803107", "0.63636714", "0.63533247", "0.63178074", "0.6264341", "0.62616205", "0.623352", "0.6223568", "0.6211351", "0.6191601", "0.61843556", "0.6180908", "0.61742365", "0.6123073", "0.6119634", "0.61175...
0.6944644
0
follows these rules: 1) ackermann(0,num2) == num2+1; 2) ackermann(num1,0) == ackermann(num11,1) if num1 > 0 (otherwise see 1) 3) ackermann(num1,num2) == ackermann(num11,ackermann(num1,num21)).
function ackermann(num1,num2){ if(num1 === 0){return num2 + 1} if(num2 === 0){return ackermann(num1-1,1)} return ackermann(num1-1,ackermann(num1,num2-1)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Ackermann(m, n) {\n if (m == 0) { return n + 1; }\n if (m > 0 && n == 0) {\n return Ackermann(m - 1, 1);\n }\n if (m > 0 && n > 0) {\n return Ackermann(m - 1, Ackermann(m, n - 1));\n }\n}", "function ack(m, n) {\n // Assumption: m and n are natural numbers (non-negative i...
[ "0.7258532", "0.67120415", "0.5171651", "0.48203522", "0.4761154", "0.47561163", "0.47419196", "0.4714657", "0.4604351", "0.45971686", "0.45782626", "0.454428", "0.45362735", "0.4480291", "0.4445671", "0.44358724", "0.44335", "0.44295895", "0.44086877", "0.43997833", "0.43837...
0.84405625
0
Finds a patient by identifier and navigates to the next page (usually dashboard). This method is only necessary because when you call sendKeys with the full a patient identifier string the app interprets this as a barcode scan.
searchByIdentifier(identifier) { this.searchField.sendKeys(identifier); browser.sleep(2000); // wait for spinner return this.afterSearch(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextPatient() {\n var currentPatient = waitingRoom.shift();\n document.getElementById('currentPatient').innerHTML =\n 'The current patient is: ' + currentPatient;\n printWaitingRoom();\n}", "function nextButtonClicked() {\n\thideDeviceKeyboard();\n\tFingerprint.isAvailable(isAvailableSuc...
[ "0.546634", "0.5462036", "0.5367391", "0.5193599", "0.51715285", "0.51059383", "0.5049958", "0.50349647", "0.5030958", "0.49724576", "0.49445876", "0.4895324", "0.48927918", "0.48868203", "0.48838368", "0.48775455", "0.4854747", "0.48426616", "0.48270127", "0.48169994", "0.47...
0.57956535
0
Assign Batch to students
async AssignBatch(req, res) { const thisBatch = await Batch.findOne({ batchId: req.body.batch.batchId }); if (thisBatch) { const newStudents = []; _.forEach(req.body.students, (student) => { newStudents.push(mongoose.Types.ObjectId(student._id)); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyAssignedIDsToStudents(students, capstones, groups, capsToStudents) {\n\t// for each group\n\tfor (var g = 0; g < groups.length; g++) {\n\t\t// for each capstone in this group\n\t\tfor (var i = 0; i < groups[g].length; i++) {\n\t\t\t// get student ID's\n\t\t\tvar stuIDs = capsToStudents[groups[g][i]];...
[ "0.5962955", "0.57583845", "0.5654526", "0.55512613", "0.55060124", "0.54849476", "0.5477918", "0.5464728", "0.5404799", "0.5374954", "0.5362178", "0.5326719", "0.5324234", "0.52985185", "0.52744234", "0.5272329", "0.52540034", "0.5231737", "0.5224635", "0.5221554", "0.521458...
0.74339855
0
Delete Batch if not contains any student
async DeleteBatch(req, res) { console.log(req.params.batchId); await Batch.findOne({ batchId: req.params.batchId }).then(batch => { // console.log(batch); if (batch.students.length > 0) { return res.status(Httpstatus.INTERNAL_SERVER_ERROR).json({ message: 'Please ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeStudent(student, ENo, Class)\n{\n // params -> both 'student name' and 'Enroll No.' to detect right student\n\t\n // special characters not allowed\n\t\n if(!(box.tableExists(Class)))\n\t{\n\t /* throw an error pop-up with 'bootstrap' */\n\t}\n\telse\n\t{\t\n\t\tbox.deleteRows(Class, fun...
[ "0.6400744", "0.636994", "0.62283224", "0.60782546", "0.6022478", "0.5942446", "0.5887477", "0.58631694", "0.5778566", "0.5740825", "0.5727322", "0.5718749", "0.5713938", "0.57063675", "0.5702945", "0.56492066", "0.5604208", "0.5598794", "0.5596472", "0.5569625", "0.5536007",...
0.6714767
0
Get Students by batch
async GetStudentsByBatch(req, res) { const AllStudentsOfBatch = []; await Batch.findOne({ batchId: req.params.batchId }).then(batch => { batch.students.forEach(student => { Student.findById({ _id: mongoose.Types.ObjectId(student.studentId) }).then(studentResp => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getStudents() {\n try {\n const students = await Student.findAll({\n include: {\n model: Mark,\n required: true,\n include: {\n model: ClassSubject,\n required: true,...
[ "0.6402431", "0.6180651", "0.6167374", "0.6144187", "0.6140677", "0.6127039", "0.5886603", "0.58392197", "0.57488173", "0.57473785", "0.5699263", "0.5620302", "0.55966944", "0.5545089", "0.5541215", "0.55145776", "0.55117244", "0.54811126", "0.5458699", "0.5453595", "0.544137...
0.7682804
0
Set the friend state if friend is in list
function setFriendState(friendsList, username, state) { //console.log(lang.format("Setting friend {0}'s state to {1}", username, JSON.stringify(state))); var items = friendsList.items; for (var i = 0; i < items.length; ++i) { if (username === items[i].data.canonicalUsername) { setActivity(items[i], state); b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setFriends(friends) {\n\n this.setState({\n friends: friends\n });\n }", "function updateFriendsList(list){\n $(\"#friends-list ul\").children().remove()\n $(\"#offline-friends ul\").children().remove()\n\n offlineFriends.forEach((friend) => {\n if(list[friend] ){\n $(\"#fr...
[ "0.6631011", "0.6320794", "0.62527156", "0.61501837", "0.59485114", "0.5916505", "0.59012383", "0.58623487", "0.58482563", "0.58104", "0.5704197", "0.56815654", "0.567299", "0.5648958", "0.56012696", "0.5590797", "0.55580544", "0.55048674", "0.5488828", "0.5485877", "0.547806...
0.79857236
0
Get the Most Interesting URI from a presence state, so we can play it
function getUriFromPresenceState(state) { var type = getPresenceType(state); var uri; switch (type) { case PRESENCE_TYPES.PLAYLIST_PUBLISHED: uri = state["playlist_published"]["uri"]; break; case PRESENCE_TYPES.PLAYLIST_TRACK_ADDED: case PRESENCE_TYPES.PLAYLIST_TRACK_STARRED: uri = state["playlist_tra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUriKey(){\n var uriPart = getLastUriPart();\n if(uriPart === \"index\"){\n checkPuzzle();\n }\n let match = listOfWomen.filter(element => element === uriPart);\n if (match.length == 1){\n initSoundElements();\n return match[0];\n }\n}", "function getUrlState(){\n var currentLo...
[ "0.5550399", "0.5226836", "0.522405", "0.5120633", "0.51200545", "0.50968075", "0.49992052", "0.4953611", "0.48783818", "0.48564318", "0.48481575", "0.48091605", "0.47703168", "0.4761641", "0.47590834", "0.47486356", "0.47407937", "0.4721566", "0.47158813", "0.46925804", "0.4...
0.74225074
0
calculateItemPrice Function The main function
function calculateItemPrice() { try { //Call initialiseDates function initialise(); loadItems(); } catch(e) { errorHandler("calculateItemPrice : " +e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function itemPrice(x){\n\t\tvar finalprice = 0;\n\t\tvar q = \"qitem\"+x;\n\t\tvar p = \"pitem\"+x;\n\t\tvar t = \"titem\"+x;\n\t\tvar c = \"citem\"+x;\n\t\tvar ct = \"ctitem\"+x;\n\t\tvar quantity = document.getElementById(q).value;\n\t\tif(!isNaN(Number(quantity))){\n\t\t\tvar price = document.getElementById(p)....
[ "0.7577764", "0.73894924", "0.73860055", "0.73851377", "0.7272953", "0.7197294", "0.71763176", "0.70540416", "0.70063215", "0.6998625", "0.6982219", "0.6978582", "0.6968823", "0.69686943", "0.6951117", "0.6945707", "0.68989617", "0.68594337", "0.6850349", "0.6831721", "0.6770...
0.79438627
0
loadItems Function Load all the items that needs the shipping price to be set
function loadItems() { //Declaring the local variables /*var itemSearch = new Array(); var itemFilters = new Array(); var itemColumns = new Array(); var itemShippingCost = 0.0;*/ try { //var record = nlapiLoadRecord('item', itemIntID); nlapiLogExecution('Audit', 'item record', itemIntID); /*//...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadItems() {\n API.getOrders()\n .then(res =>\n setItems(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadItems() {\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n\n ...
[ "0.7528145", "0.6982357", "0.6919753", "0.68690765", "0.65398246", "0.6442941", "0.6424031", "0.641393", "0.6391045", "0.63886684", "0.62693876", "0.62349874", "0.6221695", "0.61949515", "0.6185756", "0.61431664", "0.6142567", "0.6100563", "0.60997117", "0.6095674", "0.608258...
0.73714846
1
$("option1").on("click", question2); $("option2").on("click", question2); $("option3").on("click", correct++, question2); $("option4").on("click", question2);
function question2() { $("#question").html("<h2>What was the name of Han Solo's ship?</h2>"); $("#option1").html("The Millenium Falcon"); $("#option2").html("The Cobra Starship"); $("#option3").html("The Ebon Hawk"); $("#option4").html("The Death Star"); $("button").on("click", question3); $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function answerClick () {\n\n//question 1 answer set\n$(\"#answer1-4\").on(\"click\", function(){ \n correctAnswerTotal++;\n console.log(correctAnswerTotal);\n $( \"#answer1-1\" ).off( \"click\" );\n $( \"#answer1-2\" ).off( \"click\" );\n $( \"#answer1-3\" ).off( \"click\" );\n $( \"#answer1-4\"...
[ "0.76875925", "0.71809244", "0.7176812", "0.7142705", "0.7104097", "0.71023506", "0.7075256", "0.70634586", "0.7050866", "0.7044296", "0.6969531", "0.69691724", "0.6966195", "0.69355106", "0.6902427", "0.68888664", "0.6879881", "0.68532205", "0.6829234", "0.68009937", "0.6793...
0.8335346
0
Wrapper to accept verbatim rules
function Apply(rule) { if (typeof(rule) === 'function') return rule; return Verbatim(rule); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "virtual(str) {\n let [prop, value] = this.parse(str)\n let rule = parse('a{}').first\n rule.append({ prop, value, raws: { before: '' } })\n return rule\n }", "virtual(str) {\n let [prop, value] = this.parse(str)\n let rule = parse('a{}').first\n rule.append({ prop, value, raws: { before: ''...
[ "0.58895147", "0.58895147", "0.56329894", "0.5466138", "0.5444605", "0.5364942", "0.53436065", "0.53436065", "0.53376985", "0.53376985", "0.53127", "0.52546096", "0.52546096", "0.52546096", "0.52546096", "0.52118", "0.51752955", "0.5100586", "0.5050713", "0.5037094", "0.49738...
0.6407484
0
Match any of the rules with lefttoright preference
function Any() { var rules = Array.prototype.slice.apply(arguments).map(Apply); return function($) { for (var i=0; i < rules.length; i++) { var $next = rules[i]($); if ($next !== $) return $next; // when one rule matches: return the match } return $; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "headMatchRule(string){\n let location_of_first_equals_sign = string.indexOf('=')\n if (location_of_first_equals_sign < 1){\n return ''\n }\n\n let left_of_first_equals_sign = string.substring(0, location_of_first_equals_sign)\n let trimmed_left_of_first_equals_sign = left_of_first_equals_sign.t...
[ "0.54568887", "0.5430775", "0.5430775", "0.53067404", "0.5295324", "0.5213921", "0.51627976", "0.5043292", "0.5015938", "0.4931926", "0.48854253", "0.48538172", "0.48514876", "0.48373002", "0.48341638", "0.48125473", "0.480851", "0.48081794", "0.47980615", "0.47816756", "0.47...
0.54452544
1