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
23. Count quantity of inversion in the array
function countInversion(array) { let inversion = 0 array.forEach((item, i) => { if (item > array[i + 1]) inversion += 1 }) return inversion }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countInversion(arr) {\n return countInversionRecur(arr, 0, arr.length-1)\n}", "function countInversion2(arr) {\n if (arr.length < 1) return 0\n let count = 0\n // run a loop from right to left to inspect every element\n // run a inner loop to compare the outer element with every other ele...
[ "0.7560301", "0.72041386", "0.71267873", "0.6961724", "0.6610271", "0.63589424", "0.6353789", "0.63361555", "0.6312375", "0.62627274", "0.62328863", "0.62062675", "0.6188633", "0.61550957", "0.6129511", "0.6111939", "0.60953367", "0.6092796", "0.6088653", "0.6071093", "0.6068...
0.75420636
1
24. Count mean value of the array
function countMean(array) { if (!array.length) throw new Error('Provided empty array') let sum = 0 array.forEach(item => sum += item) return sum / array.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_mean(arr){\n\tvar count = 0\n\tfor(var i in arr){\n\t\tcount += arr[i]\n\t}\n\treturn (count/arr.length)\n}", "function mean(array) {\n let dataArr = 0;\n let hasil = 0;\n for(let i=0; i<array.length; i++){\n dataArr+= array[i]\n }\n hasil = Math.round(dataArr/array.length)\n ...
[ "0.7911731", "0.78874373", "0.77200633", "0.770057", "0.7650237", "0.76268363", "0.76108485", "0.7608911", "0.7589388", "0.7589388", "0.74934024", "0.7469818", "0.744256", "0.74265885", "0.74183697", "0.7411361", "0.7352086", "0.7352086", "0.73442084", "0.7317011", "0.7221855...
0.79773605
0
loads a given fixture from an ARI definition json file
function loadFixtureJson (fixtureName, done) { grunt.log.writeln( util.format('generating fixture for %s', fixtureName) ); var url = util.format( '%s/ari/api-docs/%s.json?api_key=%s:%s', options.baseUrl, fixtureName, options.username, options.password ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixture(name) {\n return fs.readFileSync('test/fixtures/' + name, 'utf8');\n}", "function importFixture(url, source) {\n let match = url.match(\"^fixture:(.*)$\")\n\n if (match) {\n let fixturePath = path.join(fixturesRoot, match[1])\n let fixture = fs.createReadStream(fixturePath, {encoding: ...
[ "0.6044876", "0.5997069", "0.5976897", "0.59607416", "0.58550626", "0.5808113", "0.57149553", "0.5619621", "0.5537081", "0.5521816", "0.5519164", "0.5454691", "0.5453249", "0.5440287", "0.5417455", "0.541737", "0.53921956", "0.5382177", "0.5271207", "0.5260042", "0.5259453", ...
0.6532258
0
USEUNIT InitializationEnviornment USEUNIT Listbox USEUNIT POSObjectMapping USEUNIT SelectSubPackagesFromWindow USEUNIT WrapperFunction USEUNIT SelectPaymentType
function _0001485874458651_40_Retail_Cash() { Log.AppendFolder("_0001485874458651_40_Retail_Cash"); try{ InitializationEnviornment.initiliaze(); AppLoginLogout.login(); WrapperFunction.selectKeyword("Retail"); selectPackage("Photo Package","Retail"); aqUtils.Delay(2000); W...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageInit() {\n\n $('#alert').hide();\n\n $(function() {\n $('[data-toggle=\"tooltip\"]').tooltip()\n })\n\n AddStyle('https://1048144.app.netsuite.com/core/media/media.nl?id=1988776&c=1048144&h=58352d0b4544df20b40f&_xt=.css', 'head');\n $('.services_selected_class').selectator({\n keepOpen: tru...
[ "0.5854362", "0.57955974", "0.5670503", "0.56004167", "0.5563039", "0.5506786", "0.5496428", "0.5490194", "0.54703975", "0.54496354", "0.54104596", "0.5393439", "0.5368943", "0.53643", "0.5343879", "0.531068", "0.5310541", "0.5297195", "0.5260313", "0.5238868", "0.5230634", ...
0.5808161
1
Get current absolute document height
function get_doc_height() { return Math.max( document.body.scrollHeight || 0, document.documentElement.scrollHeight || 0, document.body.offsetHeight || 0, document.documentElement.offsetHeight || 0, document.body.clientHeight || 0, document.documentElement.clientHe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDocHeight(e){var t=(e=e||document).body,e=e.documentElement,e=Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight);return console.log(\"Height is height \"+e),e}", "function getWindowHeight() {\n return 'innerHeight' in win ? win.innerHeight : doc.documentElement....
[ "0.7828268", "0.7827552", "0.78171474", "0.7812843", "0.7812249", "0.7807986", "0.78011996", "0.7793797", "0.7782665", "0.7782665", "0.77719975", "0.77445215", "0.7703454", "0.76878744", "0.76822627", "0.7680569", "0.7647809", "0.7605059", "0.7598347", "0.75963473", "0.759634...
0.78496665
0
Get current vertical scroll percentage
function get_scroll_percentage() { return ( (get_window_Yscroll() + get_window_height()) / get_doc_height() ) * 100; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScrollFraction() {\n const node = container.node();\n const visibleHeight = node.getBoundingClientRect().height;\n const scrollTop = node.scrollTop;\n const height = node.scrollHeight;\n\n return scrollTop / (height - visibleHeight);\n}", "function getScrollInfo() {\n let s =\n w...
[ "0.69354534", "0.6704692", "0.66537666", "0.6630675", "0.659771", "0.64331263", "0.64331263", "0.64331263", "0.64259547", "0.6390219", "0.6382322", "0.6362574", "0.63444394", "0.6341049", "0.62782335", "0.6256406", "0.6255679", "0.6254358", "0.62344044", "0.6232438", "0.62207...
0.7742317
0
Get Monero Core utils for clientside crypto and binary requests.
static async getCoreUtils() { if (MoneroUtils.coreUtils === undefined) MoneroUtils.coreUtils = await require('../submodules/mymonero-core-js/monero_utils/MyMoneroCoreBridge')(); return MoneroUtils.coreUtils; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get utils(){\n return Object.freeze({\n ordinalUtils: this.#ordinalUtils,\n lineUtils: this.#lineUtils,\n ruleUtils: this.#ruleUtils,\n tokenUtils: this.#tokenUtils,\n selectionUtils: this.#selectionUtils,\n completionUtils: this.#completionU...
[ "0.6577872", "0.5662606", "0.561983", "0.5591885", "0.5579366", "0.5579366", "0.54643625", "0.5320727", "0.5320727", "0.5320727", "0.5320727", "0.52162343", "0.51892066", "0.518354", "0.5130867", "0.50988996", "0.5066709", "0.4996356", "0.4956698", "0.49546024", "0.48583686",...
0.7637839
0
Decodes tx extra according to and returns the last tx pub key. TODO: use c++ bridge for this
static getLastTxPubKey(txExtra) { let lastPubKeyIdx; for (let i = 0; i < txExtra.length; i++) { let tag = txExtra[i]; if (tag === 0 || tag === 2) { i += 1 + txExtra[i + 1]; // advance to next tag } else if (tag === 1) { lastPubKeyIdx = i + 1; i += 1 + 32; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _decodePkcs1_v1_5(em,key,pub,ml){// get the length of the modulus in bytes\nvar k=Math.ceil(key.n.bitLength()/8);/* It is an error if any of the following conditions occurs:\n\n 1. The encryption block EB cannot be parsed unambiguously.\n 2. The padding string PS consists of fewer than eight...
[ "0.55723375", "0.5470506", "0.5338303", "0.52798456", "0.52734166", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.5227165", "0.51953375", "0.5179321", "0.5174522", "0.51457006", "0.5134146", "0.5117576"...
0.7447747
0
Determines if two payment ids are functionally equal. For example, 03284e41c342f032 and 03284e41c342f032000000000000000000000000000000000000000000000000 are considered equal.
static paymentIdsEqual(paymentId1, paymentId2) { let maxLength = Math.max(paymentId1.length, paymentId2.length); for (let i = 0; i < maxLength; i++) { if (i < paymentId1.length && i < paymentId2.length && paymentId1[i] !== paymentId2[i]) return false; if (i >= paymentId1.length && paymentId2[i] !== ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUUIDMatch(a, b) {\n return CanonicalJSON.stringify(a) === CanonicalJSON.stringify(b)\n}", "function idEquals(id1, id2) {\n if (id1 === id2) {\n return true;\n }\n // Allows number/string conversions\n if ((typeof id1 === 'number' && typeof id2 === 'string') ||\n (typeof id1 === 'string' &...
[ "0.62750566", "0.62024033", "0.6074195", "0.60675126", "0.6066328", "0.60184914", "0.6010203", "0.6001904", "0.5960228", "0.59537417", "0.5945807", "0.5937244", "0.5911712", "0.59053576", "0.59053576", "0.59053576", "0.59053576", "0.59053576", "0.59053576", "0.59053576", "0.5...
0.8362883
0
function ShowFlashMessage Generates HTML code for displaying flash messages. IN: type, type of the message to be shown IN: text, the text to display inside the flash message IN: permanent, true or false. Shows or hides the close button.
function ShowFlashMessage(type, text, permanent) { var knownTypes = ['info', 'success', 'error']; var permanentCode = ''; if (!permanent) { permanentCode = '<a class="close" data-dismiss="alert">×</a>'; } if (text === undefined || text === '') { return '<div class="alert alert-error">' + permanent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_flash (type, message) {\n var cleanMessage = DOMPurify.sanitize(message)\n var existingAlert = document.querySelector('.flash-alert')\n\n if (existingAlert) {\n existingAlert.remove()\n }\n\n var flashDiv = $('.alert-' + type)\n if (flashDiv.length === 0) {\n flashDiv = $('<div class=\"d-...
[ "0.76454616", "0.74882466", "0.7222811", "0.6916226", "0.68550676", "0.6829946", "0.6810309", "0.678869", "0.6765003", "0.67625135", "0.6758031", "0.6734077", "0.67236716", "0.6693917", "0.6690056", "0.6660096", "0.6658099", "0.66251856", "0.6576674", "0.6559374", "0.65592295...
0.8204526
0
function GenerateStatusesPulldown Generates HTML code for the button dropdown. Relies on bootstrap. IN: statusWithTransition, possible status transitions for the appointment IN: functionalTaskID, the appointment identifier
function GenerateStatusesPulldown(statusWithTransition, functionalTaskID) { var hasTransitions = (statusWithTransition.transitions !== -1); var htmlCode = ''; htmlCode += '<div class="btn-group">'; if (statusWithTransition.taskIsEditable) { if (hasTransitions) { htmlCode += '<a class="btn btn-prima...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetUpStatuses() {\n let statusmod = \"<h3 style='text-align:center'>Statuses</h3><p>\";\n let first = 1;\n let statlist = [];\n for (let status in statuses) {\n statlist.push(status);\n }\n statlist = statlist.sort();\n for (let i=0;i<statlist.length;i++){\n if (!FindStatusByName(statlist[i],...
[ "0.6236486", "0.58190316", "0.5803314", "0.5708481", "0.5701436", "0.5694752", "0.5678201", "0.5633722", "0.56220484", "0.56068254", "0.55784523", "0.55289173", "0.54953766", "0.5495121", "0.5472397", "0.5466151", "0.5432905", "0.5405858", "0.5368954", "0.53670424", "0.536460...
0.8784056
0
function GenerateModalContent Generates HTML code for the modal dialog content. Dynamic form creation. IN: appointment, possible status transitions for the appointment IN: readonly, boolean, show "view" form or "edit" form
function GenerateModalContent(appointment, readonly) { var gC = ''; var inputDisabled = 'readonly="readonly"'; var checkboxDisabled = 'disabled="disabled"'; var checkboxIsChecked = 'checked="checked"'; gC += '<form class="form-horizontal" id="appointmentForm">'; gC += '<legend>Appointment details</legend...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateModal(data) {\n const html = `\n <div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"mo...
[ "0.6456422", "0.6239596", "0.61938435", "0.61764485", "0.60295653", "0.5989991", "0.5986274", "0.5953287", "0.59437317", "0.5935103", "0.5921274", "0.5910877", "0.58848226", "0.5875975", "0.5855456", "0.58481205", "0.58364373", "0.5833974", "0.58240485", "0.582088", "0.582045...
0.8221192
0
Code to store/restore local namespace In generators, the namespace is stored in an attribute of the generator function until the iterator is exhausted, so that it can be restored in the next iteration
function jscode_namespace(iter_name, action, parent_id) { var _clean= ''; if (action === 'store') { _clean = ' = {}' } var res = 'for(var attr in this.blocks){' + 'eval("var " + attr + " = this.blocks[attr]")'+ '};' + 'var $locals_' + iter_name + ' = this.env'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Module_Namespace_iterator() {\n var N = this;\n if (!(N instanceof ModuleNamespaceExoticObject)) throw $TypeError();\n var exports = N.Exports;\n return CreateListIterator(exports);\n}", "function namespaceHTMLInternal() {\n _currentNamespace = null;\n}", "function SetIterator() {}", ...
[ "0.5288787", "0.5225532", "0.52098984", "0.518359", "0.5116002", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.51148725", "0.5040706", "0.4997062", "0.49799645", "0.49770617", "0....
0.6310613
0
Adds comments from the .proto as a JSDoc block. Looks up comments for the given descriptor in the source code info.
addCommentsForDescriptor(node, descriptor, trailingCommentsMode) { const source = this.registry.sourceCodeComments(descriptor); // add leading detached comments as line comments plugin_framework_1.addCommentBlocksAsLeadingDetachedLines(node, ...source.leadingDetached); // start with lead...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCommentBlock(descriptor, appendTrailingComments = false) {\n var _a;\n const source = this.registry.sourceCodeComments(descriptor);\n // start with leading block\n let commentBlock = (_a = source.leading) !== null && _a !== void 0 ? _a : '';\n // add trailing comments to the l...
[ "0.5996518", "0.5351281", "0.5350643", "0.5188883", "0.5179492", "0.5179492", "0.51322407", "0.5130439", "0.51303136", "0.5125273", "0.5094958", "0.50649846", "0.50294477", "0.5016913", "0.49258932", "0.4920164", "0.49184963", "0.49000195", "0.4896266", "0.48649904", "0.48489...
0.6905042
0
Returns a block of source comments (no leading detached!),
getCommentBlock(descriptor, appendTrailingComments = false) { var _a; const source = this.registry.sourceCodeComments(descriptor); // start with leading block let commentBlock = (_a = source.leading) !== null && _a !== void 0 ? _a : ''; // add trailing comments to the leading blo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractComments(source) {\n var index = 0, length = source.length, results = [], symbol, position, original;\n while (index < length) {\n symbol = source[index];\n switch (symbol) {\n // Parse line and block comments.\n case \"/\":\n original = symbol;\n symbol = source[++i...
[ "0.70759445", "0.69503826", "0.6673357", "0.6553498", "0.6553498", "0.65401244", "0.6310865", "0.62903506", "0.62903506", "0.62903506", "0.62858844", "0.62763155", "0.6235386", "0.6212697", "0.616021", "0.6105744", "0.6105744", "0.6105595", "0.6105595", "0.6105595", "0.610559...
0.6988638
1
Function called for paint events of the object tab window.
function objectWindowEventHandler(/**Event*/ event) { if (!event.isTrusted) return; // Don't trigger update too often, avoid overusing CPU on frequent page updates if (event.type == "MozAfterPaint" && Date.now() - objTabs.prevPositionUpdate > 20) objTabs._positionTab(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onRedraw() {}", "function startPainting(event) {\n paint = true;\n getPosition(event);\n}", "function paint()\n\t{\n\t\n\t\t//Runs paint method of map\n\t\tmap.paint()\n\t\t\n\t\tif (createTool.creationChange) {\n\t\t\tcreateTool.paintChange();\n\t\t}\n\t\t\n\t}///////////////////////////////////////////...
[ "0.6634239", "0.6327106", "0.625998", "0.6251288", "0.6063849", "0.6005157", "0.5992707", "0.595888", "0.58841544", "0.5846068", "0.5844553", "0.5837801", "0.58357906", "0.58339727", "0.57833177", "0.5724475", "0.57207626", "0.5702682", "0.568512", "0.568512", "0.5684718", ...
0.6776181
0
Reolves city name by id
function getCityNameById(id) { return "Sindi"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lookUpCitId(cityName){\n\tfor (var i=0; i < cityMap.length; i++) {\n\t\tif(cityMap[i].name.toLowerCase() == cityName.toLowerCase()){\n\t\t\treturn cityMap[i].id;\n\t\t}\n\t}\n\treturn '#'; // if ciy id is not found - edge case\n}", "function addCity() {\n\tvar city = data.response.geocode.feature.name;...
[ "0.706768", "0.67947966", "0.67627907", "0.6613218", "0.66003895", "0.6514852", "0.6514315", "0.64692396", "0.6451913", "0.64485186", "0.6421269", "0.6385431", "0.6356069", "0.6349189", "0.63097787", "0.62980735", "0.6245536", "0.6219319", "0.62144405", "0.62020814", "0.61950...
0.80381566
0
search appointmentTypes: find an appointmentType's index using its appointmentType ID
function getAppointmentTypeIndexById(appointmentTypeID) { console.log('getting appointmentType index by appointmentType ID'); console.log('appointmentTypeID: ', appointmentTypeID); var index = appointmentTypes.map(function(el) { return el.id; }).indexOf(appointmentTypeID); console.log('appoint...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAppointmentTypes() {\n var queryString = 'SELECT \"appointment_type\" FROM \"appointment_types\"';\n return getArrayFromQuery(queryString);\n}", "function getIndexByID(identifier, appointments) {\n for (var i = 0; i < appointments.length; i++) {\n if (appointments[i].id == identifier) {\n...
[ "0.5722869", "0.56965846", "0.56345475", "0.5457805", "0.544249", "0.5318256", "0.5150767", "0.51217073", "0.50776076", "0.5023363", "0.49910966", "0.49111697", "0.48966724", "0.4890953", "0.48838052", "0.48358098", "0.4832421", "0.48215282", "0.47767678", "0.47182798", "0.47...
0.7175438
0
populate the form with values from the On Deck event div
function populateOnDeckModal(onDeckEventDiv) { console.log('populateOnDeckModal'); clearModal(); console.log('populating modal with info from On Deck event div'); var event = { id: onDeckEventDiv.data('appointment_id'), title: onDeckEventDiv.data('title'), customerId: onDeckEventDiv.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateForm(event) {\n let nameValue = event.target.parentElement.querySelector('.dogName').innerText\n let breedValue = event.target.parentElement.querySelector('.dogBreed').innerText\n let sexValue = event.target.parentElement.querySelector('.dogSex').innerText\n\n document.querySelector('.formName...
[ "0.65747064", "0.6016224", "0.59746945", "0.5973853", "0.59526706", "0.5895527", "0.58890563", "0.58833385", "0.58723944", "0.58485943", "0.5823505", "0.5807691", "0.5798447", "0.5756164", "0.5754068", "0.5745347", "0.5736793", "0.5732669", "0.5724309", "0.5717924", "0.570408...
0.61296976
1
send POST request to /api/appointments to save event to db
function saveEvent(event) { $.ajax({ type: 'POST', url: '/api/appointments', data: event, success: function(data) {console.log(data)}, dataType: 'json' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAppointment(appointment){\n console.log('\\n\\n appointment date: ' + JSON.stringify(appointment))\n $http.post('/api/calendar', appointment).then(\n function(result){\n getAllAppointments()\n },\n function(err){\n console.lo...
[ "0.73513883", "0.67242306", "0.6696057", "0.66457576", "0.66162544", "0.64181155", "0.6369882", "0.6364323", "0.632561", "0.6321301", "0.6302771", "0.6277458", "0.6236553", "0.6233528", "0.62064576", "0.61785936", "0.6174653", "0.61584175", "0.6130135", "0.6125401", "0.603373...
0.80844516
0
send DELETE request to /api/appointments to delete event from db
function deleteEvent(eventID) { console.log('ATTEMPTING TO DELETE EVENT ' + eventID); $.ajax({ type: 'DELETE', url: '/api/appointments/' + eventID, data: eventID, success: function(data) {console.log(data)}, dataType: 'json' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function appointmentDelete(req, res){\n const appointmentId = req.body.id;\n\n if(appointmentId) {\n try{\n const results = await Appointments.deleteOne();\n\n if(results) {\n res.json({'data': results});\n } else {\n res.status(500)...
[ "0.76296943", "0.7408361", "0.73641574", "0.7272276", "0.71804774", "0.7177609", "0.70714307", "0.7035568", "0.7029642", "0.7029642", "0.70090157", "0.68054575", "0.67983663", "0.6795777", "0.67937595", "0.6769117", "0.67637956", "0.6720918", "0.6691156", "0.6663218", "0.6659...
0.7894081
0
function executeClick() Modify the default behaviour of hitting the enter key in the textbox in order to execute the javascript click event rather than a form submit.
function executeClick(e){ if(e.keyCode == 13){ var clicked = document.getElementById('search-button'); if(clicked){ clicked.click(); e.preventDefault(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evalEnterKey(obj) {\n if (event.keyCode === 13) {\n $(\"#btnSearchArtist\").click();\n }\n}", "function maybeTheyClickedEnter(event) {\n if (event.which == 13) {\n $(\"button#chrome_execute\").click();\n }\n }", "function enterbutton() {\n $(function() {\n ...
[ "0.7259121", "0.724965", "0.7245769", "0.72083235", "0.7150325", "0.70305437", "0.699906", "0.6988264", "0.6871704", "0.6867194", "0.68647754", "0.6844734", "0.68258107", "0.67807794", "0.67754567", "0.67436975", "0.6739191", "0.67029643", "0.67001", "0.6649982", "0.66440296"...
0.80835545
0
init payment service base by selected database
function NewPayment(DB_NAME){ let DB; if (DB_NAME === "Mongo") { DB = new MongoDB(); } else { DB = new PostgresDB(); } return new PaymentService(DB); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { \n \n ProductBaseDeal.initialize(this);\n }", "function init() {\n profitDB = getOrCreateDB(profitDBName);\n expoDB = getOrCreateDB(expoDBName);\n shipDB = getOrCreateDB(shipDBName);\n\n if (Object.keys(shipDB).length === 0) {\n genShipDB();...
[ "0.59368", "0.5685543", "0.5685108", "0.5663741", "0.56617594", "0.56108516", "0.56042224", "0.55315405", "0.5526344", "0.5512047", "0.54912233", "0.5483368", "0.5467054", "0.5456317", "0.54402894", "0.54216754", "0.54188395", "0.5412956", "0.5382808", "0.53566813", "0.535249...
0.6665511
0
TableIterator class. Represents an iterator returned by sub models which provide access to table objects.
function TableIterator(table, readOnly, selections, fields, orders, handler) { /** The modeljs iterator instance */ var m_iterator = null; /** The stored handler */ var m_handler = handler; // -------------------------------------------------------------- // Notification handlers // ------...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Table( ) {\n\n\tTable.byId[ Table.nextId ] = this;\n\tTable.quantity++;\n\n\t// Instance Properties\n\tthis.id = Table.nextId;\n\tTable.nextId++;\n\t// End Instance Properties\n\n\treturn this;\n\n}", "function Table() {\n var self = this;\n\n if (instance !== null) {\n ...
[ "0.5813387", "0.5652282", "0.5628268", "0.5603568", "0.55641764", "0.55468", "0.5518772", "0.55089575", "0.5462843", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53594065", "0.53...
0.60896254
0
SubModel class. This class is a base class for all sub models.
function SubModel(parentModel, definesClass) { /** The parent model instance */ var m_parentModel = parentModel; /** The class with internal model value defines. */ var m_definesClass = definesClass; /** Registered model objects */ var m_registrations = {}; /** Whether sub model is ready */ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SubEditorModel( config ) {\n SubEditorModel.superclass.constructor.call( this, config );\n }", "function BaseModel() {\n\t\t\tthis._emitter = this._util.emitter();\n\t\t\tif( this.inheritChain ) {\n\t\t\t\tthis._emitter.name = this.inheritChain[ this.inheritChain.length - 1 ];\n\t\t\t}...
[ "0.6987252", "0.66564506", "0.6421521", "0.6354267", "0.6190058", "0.6023044", "0.59717375", "0.5912055", "0.5768528", "0.5689152", "0.5685931", "0.5670661", "0.5635609", "0.563523", "0.5595667", "0.55863404", "0.55831236", "0.5571896", "0.55662113", "0.54885656", "0.54814506...
0.74104404
0
Background Image Pause Button
function pauseBg() { if (activePlayer == 'youtube') ytplayer.stopVideo(); else if (activePlayer == 'vimeo') $f(vmplayer).api('pause'); clearInterval(bgTimer); $('#bgControl .play').show(); $('#bgControl .pause').hide(); bgPaused = true; $('#bgImage img.new').stop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pauseHandler(e) {\n let button = document.querySelector('.pause')\n e.stopPropagation();\n if (gameOfLife) {\n clearInterval(gameOfLife);\n gameOfLife = null;\n button.style.backgroundImage = 'url(\"assets/play.svg\")'\n }\n else {\n gameOfLife = setInterval(lifeGen, gam...
[ "0.68742436", "0.6787964", "0.6749953", "0.6749953", "0.66860294", "0.66811156", "0.6670961", "0.66230303", "0.6598954", "0.65944433", "0.6593166", "0.65735024", "0.6527887", "0.6525463", "0.6484689", "0.643324", "0.64042157", "0.6324746", "0.63245475", "0.6294645", "0.627560...
0.7185525
0
Main Menu Item over Animation
function menuItemOver(obj) { if (obj == undefined) obj = this; if (!mobileDevice) clearTimeout(menuTimer); $(obj).find('span').stop(true, true).animate({top: 75}, 0).animate({top: 0}, 600, 'easeOutBack'); if (audioSupport) btnSound.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuItemFunction(e){\n\tvar menuView = $.menu_view,\n\t\tmenuIcon = $.menu_icon;\n\t//Animamos el fondo del item seleccionado\n\te.source.animate({\n\t backgroundColor: \"#A30000\",\n\t duration : 200,\n\t autoreverse : true,\n });\n\t//Ocultamos el menu\n\tmenuView.animate({\n\t\tleft: -200,\...
[ "0.67435974", "0.6655122", "0.65989804", "0.65151817", "0.64737815", "0.63984495", "0.6279612", "0.62763023", "0.6270506", "0.6246179", "0.62411696", "0.6209826", "0.6165701", "0.61462945", "0.610347", "0.6090828", "0.6083327", "0.60727316", "0.6058904", "0.59778804", "0.5970...
0.6752526
0
Set Content Margin according to Scroll
function setContentMargin() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setContentBottomMargin() {\n var windowHeight = $window.height();\n var lastContentItem = $contentItems.last();\n var contentBottomMargin = windowHeight - lastContentItem.height() - listHeight - topOffset * 2 - 20;\n if (contentBottomMargin <= 0) { return; }\n $content.css({ 'margin-bottom'...
[ "0.69225675", "0.67347646", "0.6691784", "0.66248804", "0.65968925", "0.64926404", "0.64783937", "0.6190614", "0.617146", "0.61051387", "0.60244745", "0.600552", "0.5915859", "0.59001505", "0.58750725", "0.58635354", "0.58314526", "0.5830059", "0.58090055", "0.57367444", "0.5...
0.71980757
0
POST /users Creates new user.
function createUser (req, res) { let newUser = new User(req.body); newUser.save((err, user) => { if (err) { return res.status(500).send(err); } res.status(201).location('/users/'+user._id).json(formatUser(user)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser(req, res) {\n var user = req.body;\n userModel\n .createUser(user)\n .then(\n function(user){ res.json(user); },\n function(error){ res.statusCode(400).send(error); }\n );\n }", "function createNewUser(req, res, n...
[ "0.7433191", "0.74031675", "0.73198545", "0.73170125", "0.72553843", "0.7220013", "0.7207971", "0.7178066", "0.71700335", "0.71603554", "0.71197", "0.7024915", "0.6995036", "0.6994576", "0.69923633", "0.6934931", "0.6933675", "0.69329983", "0.69247025", "0.69227743", "0.68954...
0.7721654
0
DELETE /users/:id Removes specified user.
function deleteUser (req, res) { User.remove({_id: req.params.id}, (err, result) => { if (err) { return res.status(500).send(err); } res.status(204).end(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove(id) {\n\n return API.http({\n method: appConfig.methods.DELETE,\n url: appConfig.API_USER_ROUTE + id,\n params: {}\n })\n .then(function (response) {\n\n logger.info('user deleted');\n });\n ...
[ "0.835051", "0.7919177", "0.7902244", "0.7890712", "0.78540456", "0.7836186", "0.77401435", "0.7719509", "0.7689125", "0.7653297", "0.76253057", "0.76124805", "0.7610195", "0.75768083", "0.75689286", "0.7548668", "0.75434583", "0.7528574", "0.75145483", "0.74429923", "0.74266...
0.82306373
1
calculates all cost based on staff and adds to total cost
function calcStaff() { var num = document.getElementById("photognum"); var hrs = document.getElementById("photoghrs"); var distance = document.getElementById("distance"); totalCost -= photographerCost; photographerCost = num.value * 100 * hrs.value + distance.value * num.value; totalCost += photographerCost...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcTotalPersonnelCost() {\r\n //total admin staff wage\r\n\r\n costPerFTEmployee = parseInt(accounting.unformat($(\"input[name='costOfFTEmployee']\").val()));\r\n sickDays = parseInt($(\"#sickdays\").val());\r\n paidLeave = parseInt($(\"#paidLeave\").val());\r\n\r\n salaryProgramDirectors =\r\n a...
[ "0.7401336", "0.68792653", "0.68715", "0.6806528", "0.6742827", "0.67376256", "0.6635922", "0.65532506", "0.6512787", "0.64561945", "0.6450074", "0.63917494", "0.6355812", "0.63551533", "0.63471484", "0.63310134", "0.632789", "0.6320631", "0.63128257", "0.6302762", "0.6294079...
0.71321654
1
Sets the basic page contents for an album
function set_album_context(albumid){ $("#content").empty(); AlbumId = albumid; $("#content").append("<h1>This is a view for a single album, a user cannot edit</h1>"); $("#content").append("<h2 id=album_title class=text-center></h2>"); $("#content").append("<ul id=album_list></ul>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreatePageAlbums(){\n\tElemId(\"BackgroundPicture\").src = \"\";\n\tElemId(\"BackgroundPicture\").style.opacity = 1.0;\n\t\n\tvar artistBigPic = CreateDiv(\"\", \"ArtistBigPic\", HTMLContent);\n\tvar artistBigPicInterior = CreateImg(\"\", \"ArtistBigPicInterior\", \"img/artists/\" + viewState.artist + \"....
[ "0.6674209", "0.6279978", "0.59658927", "0.5937278", "0.5933508", "0.58927417", "0.5834483", "0.58197004", "0.5805744", "0.579424", "0.5752813", "0.5670763", "0.5636981", "0.56287664", "0.56098753", "0.5594956", "0.5578363", "0.5572082", "0.55696285", "0.5566515", "0.55641025...
0.6670511
1
Function meant for displaying an album
function displayAlbum(album){ $("#album_title").val(album.title); for (i = 0; i < album.pics.length; ++i){ var new_ele = thumb_pic_template(album.pics[i].picid, album.pics[i].format); $("#album_list").append("<li>Picture: " + new_ele + "</li>"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArtistAlbums(albums) {\n\n if (!albums) {\n return;\n }\n $('header').show();\n $(\".results_subtitle\").val('');\n $(\".results_subtitle\").append('Albums');\n\n for (var i in albums) {\n if (albums[i].name != null && albums[i].images[0]....
[ "0.7424672", "0.74163765", "0.73210174", "0.728072", "0.7246903", "0.71490675", "0.7122066", "0.71184826", "0.7063462", "0.7059056", "0.70139444", "0.6993961", "0.69926095", "0.69920194", "0.6955221", "0.6942513", "0.6932424", "0.690829", "0.6893871", "0.6890523", "0.68872917...
0.7736566
0
Templating functions for pictures
function full_pic_template(src){ return '<img src="'+src+'" style="width:100%;height=100%;" alt="" />'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function picTemplate (pic) {\n //console.log(pic);\n var picSize = pic.sizes.size[3].source;\n //console.log(picSize);\n var picHTML = `<img src=\"${picSize}\">`;\n //console.log(picHTML);\n $(\".box8\").append(picHTML);\n}", "function photoTemplate(photo) {\n return `\n <div class=\"column pl-3\...
[ "0.6971605", "0.68765557", "0.67893213", "0.6764372", "0.67004293", "0.6381612", "0.6330742", "0.6291732", "0.62706727", "0.61760783", "0.61634415", "0.6155115", "0.6135719", "0.61148053", "0.61130756", "0.60866743", "0.60824394", "0.6079706", "0.6056421", "0.6046228", "0.603...
0.7062166
0
MESSAGE_TYPES 'Enum' for supported message types
static get MESSAGE_TYPES() { return { ServerClientChatMessage: 'ServerClientChatMessage', ServerHostMessage: 'ServerHostMessage', ServerPlayerMessage: 'ServerPlayerMessage' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get messageTypes () {\n\t\treturn [\"text\", \"dm\"]\n\t}", "static get NOTIFICATION_TYPES () {\n return {\n NOTHING: 0,\n COMPLETED: 1,\n EXPIRED: 2,\n REJECTED_PAYMENT: 3,\n BOUNTY_PAID: 4\n };\n }", "if (messageTypes.length === 1 && Arr...
[ "0.79412186", "0.6640633", "0.6368806", "0.6095352", "0.5888679", "0.58105457", "0.57428", "0.5624535", "0.5524791", "0.5472977", "0.5413964", "0.5388155", "0.5387914", "0.53495216", "0.53432024", "0.5337781", "0.5299058", "0.529436", "0.5277193", "0.5226364", "0.52190965", ...
0.830353
0
toJSON Returns a JSON object representation of the ServerClientChatMessage.
toJSON() { return { messages: this.messages }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messageType,\n\t\t\tpayload: this.payload\n\t\t};\n\t}", "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messageType,\n\t\t\tpayload: this.payload\n\t\t};\n\t}", "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messageType,\n\t\t\tpayload: this.payload.toJ...
[ "0.63577914", "0.63577914", "0.62029094", "0.58288366", "0.56857324", "0.5571267", "0.54802656", "0.5468294", "0.5321744", "0.5320618", "0.5317742", "0.524012", "0.5223548", "0.5198553", "0.5164537", "0.515082", "0.50974375", "0.5089712", "0.50747716", "0.5069531", "0.5064447...
0.64291537
0
toServerMessage Returns the message wrapped in a WSServerMessage
toServerMessage() { return new WSServerMessage(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseFromServer(message = {}, bodyType) {\n let ext = message.ext || {};\n let obj = copy(message, msgTpl.base);\n // body includes, all the messages are live body, separated from base\n // body includes ext attribute for self-defined properties. ex, picture resolution.\n let body = copy(message, msg...
[ "0.5658595", "0.5589782", "0.5151234", "0.5150332", "0.51461387", "0.5091958", "0.50709057", "0.50272155", "0.4976297", "0.49389812", "0.4920624", "0.49002334", "0.48618904", "0.48542148", "0.4853732", "0.48452076", "0.48439765", "0.48432988", "0.48432988", "0.48128483", "0.4...
0.8539807
1
Returns a the message as a JSON object.
toJSON() { return { messageType: this.messageType, payload: this.payload }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messageType,\n\t\t\tpayload: this.payload.toJSON()\n\t\t};\n\t}", "function jsonFormatter(message) {\n return JSON.stringify(message);\n}", "toJSON() {\n\t\treturn {\n\t\t\tmessages: this.messages\n\t\t};\n\t}", "function formatPostMessage(msg, username) {\n...
[ "0.76308525", "0.754492", "0.73505586", "0.6900919", "0.67314535", "0.6708455", "0.6561445", "0.6478569", "0.64357936", "0.64300925", "0.64000964", "0.63707614", "0.63540065", "0.6339562", "0.62715536", "0.6201208", "0.6156146", "0.6152712", "0.615077", "0.615077", "0.6133482...
0.774912
0
toServerMessage Returns the message wrapped in a WSServerMessage
toServerMessage() { return new WSServerMessage(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseFromServer(message = {}, bodyType) {\n let ext = message.ext || {};\n let obj = copy(message, msgTpl.base);\n // body includes, all the messages are live body, separated from base\n // body includes ext attribute for self-defined properties. ex, picture resolution.\n let body = copy(message, msg...
[ "0.5658595", "0.5589782", "0.5151234", "0.5150332", "0.51461387", "0.5091958", "0.50709057", "0.50272155", "0.4976297", "0.49389812", "0.4920624", "0.49002334", "0.48618904", "0.48542148", "0.4853732", "0.48452076", "0.48439765", "0.48432988", "0.48432988", "0.48128483", "0.4...
0.8539807
0
Returns a the message as a JSON object.
toJSON() { return { messageType: this.messageType, payload: this.payload }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messageType,\n\t\t\tpayload: this.payload.toJSON()\n\t\t};\n\t}", "function jsonFormatter(message) {\n return JSON.stringify(message);\n}", "toJSON() {\n\t\treturn {\n\t\t\tmessages: this.messages\n\t\t};\n\t}", "function formatPostMessage(msg, username) {\n...
[ "0.76308525", "0.754492", "0.73505586", "0.6900919", "0.67314535", "0.6708455", "0.6561445", "0.6478569", "0.64357936", "0.64300925", "0.64000964", "0.63707614", "0.63540065", "0.6339562", "0.62715536", "0.6201208", "0.6156146", "0.6152712", "0.615077", "0.615077", "0.6133482...
0.774912
1
Calculate the maximum number of pages
function numPages() { return Math.ceil(maxentries/opts.items_per_page); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(_maxentries/me.items_per_page);\n\t\t}", "function getNumberOfPages() {\n pages = Ma...
[ "0.79655004", "0.79655004", "0.7795297", "0.7664889", "0.7662004", "0.7538505", "0.74473196", "0.7425249", "0.74224824", "0.7408968", "0.7408701", "0.7147299", "0.711404", "0.7054996", "0.7045982", "0.69373345", "0.6936845", "0.69084144", "0.69084144", "0.68859184", "0.688472...
0.80042565
1
Container for information on an assignment
function Assignment() { this.name = ""; this.submissionLink = ""; this.contents = new Array(); // Some assignments consist of text directly on the Assignments link this.memo = ""; this.type = this.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInfoAssignments(req,res){\n\tAssignment.find({}).exec((err,assignments)=>{\n\t\tif(err){//error en la petición\n\t\t\tres.status(500).send({message:'Error de asignaturas'});\n\t\t}else{\n\t\t\tif(!assignments){//si no hay asignaturas\n\t\t\t\tres.status(500).send({message:'No hay asignaturas'});\n\t\t\...
[ "0.61380523", "0.61191803", "0.5738264", "0.56946623", "0.56856644", "0.5669526", "0.55561763", "0.5544172", "0.55091965", "0.5427407", "0.53754884", "0.5353118", "0.5248324", "0.5223822", "0.521524", "0.5198307", "0.5198307", "0.5198307", "0.5193772", "0.5140375", "0.5140375...
0.6806022
0
Huge container for information on a particular Course
function Course() { // Name of the course this.title = null; // Preferences for the course, in terms of removed tabs this.removedTabs = new Array(); // Preferences for the course, in terms of tab order this.tabOrder = new Array(); // Key under which this course can be found in Courses th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCourseInfo(course) {\n // create an Object whith course data\n const courseInfo = {\n image: course.querySelector('img').src,\n title: course.querySelector('h4').textContent,\n price: course.querySelector('.price span').textContent,\n id: course.querySelector('a').getA...
[ "0.6804132", "0.67823213", "0.67568064", "0.6443135", "0.63958246", "0.6352923", "0.6317988", "0.63053066", "0.6273936", "0.62731034", "0.6258609", "0.6214301", "0.6203558", "0.6193865", "0.6188982", "0.6185236", "0.61805093", "0.61652356", "0.61489123", "0.6148184", "0.61437...
0.7138804
0
A Tool from the Tools section of a Course
function Tool() { this.name = ""; this.link = ""; this.type = this.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tool() {}", "makeToolList() {\n const items = $gameParty.allItems().filter(item => {\n const isItem = DataManager.isItem(item) && item.itypeId === 1;\n const isUsable = isItem && (item.occasion === 0);\n return isItem && isUsable;\n });\n\n this.addCommand(J.ABS.Metadata.ClearSlo...
[ "0.73962414", "0.65583587", "0.6545912", "0.6426014", "0.6368914", "0.6333113", "0.62508446", "0.6246471", "0.62328476", "0.6118416", "0.6070153", "0.6033828", "0.59603626", "0.59253633", "0.5919372", "0.59165585", "0.59163386", "0.59092855", "0.5897472", "0.5896251", "0.5813...
0.65988207
1
Havent implemented refreshAllMarkers() in the code yet, but I think it will be useful in the future
function refreshAllMarkers() { /* markerList.forEach(marker => { marker.refreshIcon(); }); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reloadMarkers() {\n\t// Loop through markers and set map to null for each\n\tfor (var i = 0; i < markers.length; i++) {\n\t\tmarkers[i].setMap(null);\n\t}\n\n\t// Reset the markers array\n\tmarkers = [];\n\n\t// Call set markers to re-add markers\n\tsetMarkers(places);\n}", "function resetMarkers() {\n ...
[ "0.81716603", "0.80625916", "0.7771211", "0.7756353", "0.77559274", "0.7716201", "0.7684087", "0.7672155", "0.7621375", "0.76156044", "0.76096505", "0.75717413", "0.75717413", "0.75717413", "0.75717413", "0.75717413", "0.75717413", "0.75717413", "0.75717413", "0.75717413", "0...
0.849663
0
returns the summary table element
function getTable() { return document.querySelector('.coverage-summary'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSummary() {\n var output = '<table class=\"global-summary\"><thead>', $output,\n measure_names = $(\"#select-measure option\").toArray();\n\n // Basic table structure\n output += $('.local-summary thead tr').html();\n output += \"</thead><tbody>\";\n $(\...
[ "0.70478356", "0.69202673", "0.6648796", "0.6632758", "0.6515369", "0.65111375", "0.64779073", "0.6338542", "0.6317667", "0.62975097", "0.60901177", "0.60871017", "0.5987356", "0.5933494", "0.5912568", "0.58294", "0.58044577", "0.5797322", "0.57598156", "0.571809", "0.571809"...
0.6925689
1
returns the thead element of the summary table
function getTableHeader() { return getTable().querySelector('thead tr'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHeaderRowForSummary() {\n let headingRow = document.createElement(\"thead\");\n headingRow.appendChild(this.buildHeadingCell(this.store.constants.TYPE));\n headingRow.appendChild(\n this.buildHeadingCell(this.store.constants.RESBUD)\n );\n headingRow.appendChild(this.buildHeadin...
[ "0.79900634", "0.7452296", "0.7452296", "0.74192214", "0.74192214", "0.74192214", "0.74192214", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.74180084", "0.7398607", "0.7398607", "0.7398607", "...
0.8132142
0
returns the tbody element of the summary table
function getTableBody() { return getTable().querySelector('tbody'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFooterRowForSummary() {\n let row = this.store.utils.createElement(\"tfoot\");\n row.appendChild(this.store.utils.createElement(\"th\"));\n row.appendChild(this.store.utils.createElement(\"th\"));\n row.appendChild(\n this.store.utils.createElement(\"th\", {\n innerHTML: \...
[ "0.726334", "0.69296026", "0.6859728", "0.6593497", "0.641524", "0.62227255", "0.6115865", "0.60130566", "0.60025716", "0.59788036", "0.5917036", "0.591592", "0.58918124", "0.585752", "0.58548474", "0.5840922", "0.58237916", "0.5788724", "0.5743125", "0.5740914", "0.57401735"...
0.73000526
0
returns the th element for nth column
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_col(index) {\n return index % COLS;\n}", "function getCol(index)\n{\n\treturn index % NUMSTEPS;\n}", "function column(index) {\n return index % grid_size\n}", "function getColumnNImage(column){\n return guessTr.childNodes[2*column].childNodes[0];\n}", "get tableMainHeader(){\n ...
[ "0.66426784", "0.6579559", "0.6565287", "0.64178735", "0.6397439", "0.63653487", "0.6257051", "0.6197693", "0.61088544", "0.60019875", "0.598858", "0.598848", "0.5919789", "0.59182274", "0.5860811", "0.58498096", "0.5764077", "0.5730737", "0.57259965", "0.57115865", "0.570993...
0.8323701
0
loads all row data
function loadData() { let rows = getTableBody().querySelectorAll('tr'), i; for (i = 0; i < rows.length; i += 1) { rows[i].data = loadRowData(rows[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeRows() {}", "loadDataArray(array){\n // Verify & save data\n if(!array) return\n // Empty if need\n if(this.isLoaded) \n this.empty()\n // Fill rows\n let rows = [] \n array.forEach((obj,index)=>{ \n rows.push(this.createRo...
[ "0.69452286", "0.6851087", "0.6765745", "0.6388958", "0.6368347", "0.6360514", "0.634696", "0.6337415", "0.62868065", "0.6218054", "0.61269015", "0.6121523", "0.61167234", "0.603614", "0.6005727", "0.600459", "0.597891", "0.5969463", "0.59605485", "0.59605485", "0.5956906", ...
0.8137529
0
removes sort indicators for current column being sorted
function removeSortIndicators() { let col = getNthColumn(currentSort.index), cls = col.className; cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); col.className = cls; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unsortColumn(column) {\n if (column !== sortedColumn) {\n column.sort = undefined;\n }\n }", "restoreColOrder() {\n const cols = [];\n cols[this.model.get('createdAtIndex')] = this.$createdAt;\n cols[this.model.get('textIndex')] = this.$tweetText;\n cols[this.model.get('l...
[ "0.75356466", "0.69445175", "0.6770535", "0.67645556", "0.67579454", "0.6708147", "0.66696525", "0.66696525", "0.6666867", "0.6572911", "0.6539938", "0.6509339", "0.649048", "0.6488426", "0.64383036", "0.63360524", "0.6321631", "0.6296008", "0.6260827", "0.62608254", "0.62127...
0.8131832
0
adds sort indicators for current column being sorted
function addSortIndicators() { getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSortEvents() {\n query('.group')\n .bind('DOMSubtreeModified', function () {\n var sort = query(this).attr('aria-sort');\n var sortElement = query(this).find('.dx-column-indicators');\n var groupId = query(this).attr('data-id');\n\n var origin...
[ "0.72811", "0.7213452", "0.7136506", "0.69554824", "0.69554824", "0.692974", "0.6921489", "0.691356", "0.69110894", "0.6875855", "0.6820477", "0.6816885", "0.67659616", "0.6759562", "0.67398506", "0.6721199", "0.6679956", "0.6677744", "0.6675444", "0.6565269", "0.6555935", ...
0.7941158
0
draggablePanels Controller for draggable panels
function draggablePanels($scope) { $scope.sortableOptions = { connectWith: ".connectPanels", update: function(e, ui) { //console.log("update"); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setup_canvas_draggable(enabled) {\n this.opts.draggable = enabled;\n if (!this._initialized) {\n let dragging = false;\n let x, y;\n if (this.opts.hide_scrollbars_when_draggable) {\n // Avoid scrollbars when mind map is larger than the container (e_pane...
[ "0.6391674", "0.6375122", "0.6220396", "0.6046743", "0.6027569", "0.59968525", "0.5991287", "0.5925651", "0.59126234", "0.59071106", "0.5902255", "0.5861897", "0.58570397", "0.58465517", "0.5806319", "0.57994986", "0.57634985", "0.5760603", "0.57564783", "0.57314444", "0.5728...
0.6904235
0
function to determine what we are redeeming from
function redeemingFrom(string){ var r = {}; var decode = coinjs.addressDecode(string); if(decode.version == coinjs.pub){ // regular address r.addr = string; r.from = 'address'; r.redeemscript = false; } else if (decode.version == coinjs.priv){ // wif key var a = coinjs.wif2address(string); r.addr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findBuyedAttempts()\n{\n try { \n\tif (isinstancycontent == true)\n\t\tBuyedAttempts = LMSGetBuyedAttempts(); \n\telse\n\t\t BuyedAttempts = 0;\n\t}\n catch (e) { BuyedAttempts = 0; }\n if (BuyedAttempts == \"\" || BuyedAttempts == null)\n BuyedAttempts = 0;\n}", "async function getPendi...
[ "0.5467036", "0.53963596", "0.5378634", "0.53336114", "0.52490747", "0.52428555", "0.5219241", "0.5202898", "0.5199942", "0.51983726", "0.51867706", "0.51788735", "0.51714116", "0.51554173", "0.5153421", "0.5146519", "0.5143424", "0.51179665", "0.50891703", "0.5084588", "0.50...
0.6137498
0
THIS JAVASCRIPT FILE CONTAINS FUNCTIONS THAT RELATE TO VIEWING CHECKIN HISTORY AND FILTERING RESULTS IN THEIR RESPECTIVE TABLES the function fetch data from the sql prints all checkins for the user in descending order from checkin date
function printAllCheckins(){ var table = document.getElementsByTagName("tbody")[0]; var xhttp = new XMLHttpRequest; xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { console.log(document.getElementsByClassName("table-data"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recentCheckins() {\n\tvar checkin = Parse.Object.extend(\"CheckIn\");\n\tvar query = new Parse.Query(checkin);\n\t\n\t\n\tquery.equalTo(\"UserID\", userID);\n\tquery.limit(10); // We only want the first 10 to show under Recent Checkins\n\tquery.find({\n\t\tsuccess: function(results) {\n\t\t\t\n\t\t\tvar s...
[ "0.62981975", "0.58413744", "0.57691437", "0.5714886", "0.5677289", "0.5657731", "0.56134886", "0.5588566", "0.556207", "0.5558949", "0.5552359", "0.5540771", "0.5506007", "0.54326105", "0.53974265", "0.53938514", "0.53882873", "0.538813", "0.53733534", "0.5364127", "0.536412...
0.6184586
1
venueID not stored in session, so needs to be retrieved from database refining search for venues split into 2 functions, 1 to get venue ID and the other to get results from server and display in table
function getVenueID(){ var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = (function(){ if (this.readyState == 4 && this.status == 200){ var response = JSON.parse(this.responseText); console.log(response); var venueID = response[0].venueID; refineSearchVenue(venueID); } }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVenueDetailsFromDB(venueId, callback) {\n\tconsole.log(\"Getting details for a venue from DB\");\n\tvar sql = \"SELECT * FROM venue WHERE id = $1::INT\";\n\tvar params = [venueId];\n\tpool.query(sql, params, function(err, result) {\n\tif (err) {\n\t\tconsole.log(\"Error in query: \");\n\t\tconsole.log(...
[ "0.67717534", "0.6496878", "0.64289975", "0.6396698", "0.63711625", "0.63591254", "0.6257841", "0.62517244", "0.6243743", "0.62105685", "0.61709386", "0.61365765", "0.60842884", "0.60830593", "0.6075184", "0.6039651", "0.60325253", "0.6030792", "0.60030717", "0.5994792", "0.5...
0.6762161
1
Presents a button to conduct another search for viewing checkin history as an admin. Shows and hides according to page content.
function backToSearch(){ document.getElementsByClassName("table-admin")[0].style.display = "none"; document.getElementsByClassName("search-again")[0].style.display = "none"; document.getElementsByClassName("content-admin")[0].style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSearchPage() {\t\n\t$(\"#search_view_container\").addClass(\"active_view\");\n\t$(\"#trail_view_container\").removeClass(\"active_view\");\n\n\twindow.showingSearchPage = true;\n\tif(isMobile())\n\t\twindow.scrollTo(0,window.searchScroll);\n\t\n\t$(\"#search_button\").val(isDesktop()?\"Search For Trai...
[ "0.6517246", "0.6275994", "0.6216585", "0.6028822", "0.60168916", "0.6009049", "0.60053295", "0.5909504", "0.589284", "0.58688104", "0.5863485", "0.58275586", "0.5784728", "0.57709855", "0.5756597", "0.5756047", "0.574474", "0.57281137", "0.56880486", "0.5679157", "0.566257",...
0.6376396
1
filter hotspots Triggered by clicking the 'refine search' button takes in parameters from inputs to retrieve data from database. Prints out the results in the table.
function refineHotspots() { // getting data and storing them in variables var venueName = document.getElementById("vname").value; var date = document.getElementById("date").value; var streetNumber = document.getElementById("stNum").value; var streetName = document.getElementById("stName").value; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runSearch() {\n // Get the value property of the filter all\n var filterAll = {\n datetime: form.property(\"value\").trim(),\n city: formCity.property(\"value\").toLowerCase().trim(),\n state: formState.property(\"value\").toLowerCase().trim(),\n country: formCountry.property(\"v...
[ "0.6540842", "0.65397525", "0.6513382", "0.64969057", "0.6463677", "0.640333", "0.6316481", "0.6211832", "0.6184419", "0.61808085", "0.61788064", "0.6177439", "0.6148714", "0.6130164", "0.6112857", "0.6096931", "0.60918444", "0.60910004", "0.6090241", "0.6082248", "0.6029649"...
0.677573
0
hide toggles present on load of the page, and shows more toggles for looking up address information
function showHideToggles() { var addressToggles = document.getElementsByClassName("hidden")[0]; var toggles = document.getElementsByClassName("not-hidden")[0]; // Hidding and displaying the options according to the input if (addressToggles.style.display == "none") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showHideTogglesAdmin()\n {\n var addressToggles = document.getElementsByClassName(\"hidden\")[0];\n var toggles = document.getElementsByClassName(\"not-hidden\")[0];\n\n if (addressToggles.style.display == \"none\")\n {\n toggles.style.display = \"no...
[ "0.74964917", "0.6647082", "0.6473722", "0.6452929", "0.6439404", "0.63337827", "0.63317275", "0.6283611", "0.6218534", "0.6158226", "0.61537266", "0.61352885", "0.6094952", "0.60668284", "0.6033796", "0.6029978", "0.6011353", "0.59967655", "0.5973606", "0.59530026", "0.59529...
0.74632007
1
deleting a hotspot. takes in the onclick event to access the button element. This function uses the parent nodes of this button to link button click event to the corresponding row. posts row to server for deletion using hotspot ID.
function deleteHotspot(event) { var confirmDelete = confirm("Are you sure you want to delete?"); if (confirmDelete === true) { var idOfButton = event.target.id; // fetching data and dtoring them in different var var button = document.getElementById(`${i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"neighbor\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/neighbors/\" + id\n })\n .done(getNeighbor);\n }", "function deleteRow(btn) {\n \n ...
[ "0.7554343", "0.6579016", "0.65245336", "0.6464319", "0.64358336", "0.6412671", "0.6383547", "0.6366034", "0.63569075", "0.62776446", "0.6250401", "0.624892", "0.6245159", "0.62426347", "0.6196175", "0.61338735", "0.6120556", "0.60943604", "0.6086309", "0.6086045", "0.6066798...
0.7257499
1
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIE...
function addRandomGreeting() { const greetings = ["I'm originally from the suburbs of Chicago!", "I'm the youngest sibling!", "I skipped kindergarten!", "The longest road trip I've taken was 4 days to get to Mexico!"]; // Pick a random greeting. const greeting = greetings[Math.floor(Math.random() *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRandomGreeting() {\n const greetings =\n ['Computer Science Major', 'Anime Lover', 'Manchester United Fan', 'Student at Alcorn State University'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const gree...
[ "0.8555292", "0.7636668", "0.67618495", "0.6733824", "0.6638748", "0.65544534", "0.647902", "0.64150554", "0.6403894", "0.63993514", "0.63797617", "0.6372881", "0.63532215", "0.6344405", "0.633952", "0.63374656", "0.6336153", "0.6329673", "0.63194454", "0.6307658", "0.6270979...
0.84024125
1
randomUsername() will generate a random username.
function randomUsername() { let parts = []; parts.push( ["Small", "Big", "Medium", "Miniscule"] ); parts.push( ["Red", "Blue", "Bad", "Good", "Round"] ); parts.push( ["Bear", "Dog", "Potato", "Orangutan", "Klingon"] ); username = ""; for(part of parts) { user...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateUsername( userContext, events, done ) {\n\tconst username = makeRandomStr( 10 );\n\tuserContext.vars.username = username;\n\treturn done();\n}", "username(firstName) {\n const randomMax = words.length\n const randomNumber = Math.floor(Math.random() * randomMax)\n const rando...
[ "0.75390494", "0.75353837", "0.7435967", "0.73699576", "0.7285128", "0.713015", "0.71071947", "0.7014824", "0.68296015", "0.6730636", "0.67024255", "0.66824996", "0.6657307", "0.6610214", "0.65813035", "0.65755594", "0.6562484", "0.65183884", "0.64156604", "0.6412644", "0.639...
0.7630809
0
duplicateName() will check whether the name given to it is a duplicate or not. It returns some index: (>= 0) When the name is a duplicate. (1) When the name is NOT a duplicate.
function duplicateName(name) { // For every user in our user list. for (var key in everyUser) { // If the inputted name is equal to the name of another user, return that user's id. if (everyUser[key].username === name) { return key } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDuplicateName(u, name){\n\tfor(let key in u) {\n\t\tif(u[key][0] === name)\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "function isDuplicateProjectName(o, n) {\r\n\tvar retval = true;\t// Guilty until proven innocent.\r\n\tvar requestData = '{'\r\n\t\t+ '\"command\" : \"isDuplicateProjectName...
[ "0.65962434", "0.642642", "0.6361736", "0.6263557", "0.62251437", "0.60712373", "0.59796685", "0.59705895", "0.59528065", "0.5907644", "0.58917546", "0.5891591", "0.5828505", "0.5815395", "0.58110356", "0.579814", "0.57506824", "0.5742566", "0.5740919", "0.5692548", "0.564803...
0.7250704
0
randomGameCode() will generate a random game code of 5 units.
function randomGameCode() { return Math.floor(10000 + Math.random() * 90000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCode() {\n var code = \"\";\n var keys = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i=0; i < 6; i++ ) {\n code += keys.charAt(Math.floor(Math.random() * keys.length));\n }\n return code;\n}", "function codeGen() {\n let r = Math.ceil(Mat...
[ "0.7112026", "0.70946085", "0.68946993", "0.6864411", "0.67437303", "0.672185", "0.6658792", "0.6654874", "0.6615824", "0.6598218", "0.6531708", "0.64544123", "0.6412014", "0.6396053", "0.6372029", "0.6342196", "0.63240504", "0.63154453", "0.6309239", "0.6282339", "0.62521994...
0.8342427
0
duplicateCode() will check whether the code given to it is a duplicate or not. It returns the index: (>= 0) When the code is a duplicate. (1) When the code is NOT a duplicate.
function duplicateCode(code) { // For every user in our user list. for (var key in everyUser) { // If the inputted code is equal to the code of another user, return that user's id. if (everyUser[key].gameCode === code) { return key; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dupPostCode(code){\n var table = document.getElementById(\"tablePCode\");\n if (table.rows[0].cells.length === 0) {\n return false;\n }\n var rowCount = table.rows.length;\n for (var row = 0; row < rowCount; row++) {\n var cellCount = table.rows[row].cells.length\n for (var c...
[ "0.68461055", "0.6432301", "0.5779522", "0.5775099", "0.5775099", "0.5736087", "0.57220775", "0.5691777", "0.56814617", "0.557134", "0.5564171", "0.5504259", "0.5484277", "0.5436708", "0.5433113", "0.5428375", "0.5422735", "0.53272325", "0.5303964", "0.5302759", "0.5295363", ...
0.72221226
0
removeFromRandom() is a function that removes some socket.id inputted from our list of users seeking a random match.
function removeFromRandom(ident) { // If the user was seeking a random game: if (seekingRandom.includes(ident)) { // For every index in the list: for (var i = 0; i < seekingRandom.length; i++) { // If the user was found at index i: if (seekingRa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async purgeUser (userId, socket, requestId) {\n\t\tthis.log(`Last socket for user ${userId}`, socket, requestId);\n\t\tconst user = await this.getData('users', 'getById', userId);\n\t\tif (!user) { return; }\n\t\tfor (let teamId of user.teamIds || []) {\n\t\t\tconst userArray = this.userIdsByTeamChannel[`team-${te...
[ "0.70278764", "0.6684657", "0.6595933", "0.6536391", "0.6453114", "0.6404483", "0.6375302", "0.63222384", "0.62162787", "0.6162734", "0.61237645", "0.6064025", "0.6058253", "0.6054594", "0.59596753", "0.59449595", "0.5904954", "0.5863742", "0.5848963", "0.5832238", "0.5824232...
0.69942427
1
Hide outer circle and percents
function _hideOuterCircle() { NODES.loadOuterCircle.style.display = 'none'; NODES.percents.style.display = 'none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCircle() {\n showAxis(xbeeAxisBar);\n \n g.selectAll('.fill-square')\n .transition()\n .duration(1000)\n .attr('opacity', 0);\n \n g.selectAll('circle')\n .transition()\n .duration(1000)\n .attr('opacity', 1);\n \n g.selectAll('.total-rating-treatm...
[ "0.6443042", "0.6382224", "0.63749754", "0.6321652", "0.62986374", "0.61657155", "0.5791681", "0.57877964", "0.56510115", "0.55856764", "0.55768096", "0.55172426", "0.5460947", "0.5436646", "0.54362345", "0.54233503", "0.54134834", "0.54057705", "0.5402863", "0.5397236", "0.5...
0.796506
0
Is the general error handler for web queries, checks if the server returns a 200 and handles the code in the callback
function queryHandler(response, res, callback) { if (response.statusCode === 200) { //if the server returns a valid code try { callback(); } catch (err) {//if there is any issue with the callback res.json({ error: "the response could not be parsed", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function errorHandler(error)\n{ \n var rTxt = JSON.parse(error.responseText)[0];\n\n var rMsg = rTxt.msg;\n var rCode = rTxt.code;\n var httpCode = error.status;\n\n switch (httpCode) {\n case 400:\n alert(\"400\");\n break;\n\n case 404:\n aler...
[ "0.68210644", "0.67660433", "0.6759454", "0.6742948", "0.66789746", "0.66296554", "0.66178447", "0.661569", "0.660007", "0.65877944", "0.6586005", "0.65651137", "0.65600276", "0.6554448", "0.6551716", "0.654183", "0.65416044", "0.65258753", "0.65258753", "0.65258753", "0.6525...
0.6830733
0
query that handles searching for a country by lat and lng
function GeoQuery(lat, lng, res) { //send a get request for data from the server for the country belonging to the supplied lat and lng and processes the result request('http://ws.geonames.org/countryCodeJSON?username=michaeldeve&lat=' + lat + "&lng=" + lng, function (error, response, body) { queryHan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCountry(_lat, _lon) {\n var countryName = getCountryName(_lat, _lon);\n //find country code from latitude and longtityde\n country_list.forEach(function (country) {\n if (country['name'].includes(countryName)) {\n id = country['code'];\n }\n });\n $('#search...
[ "0.6977644", "0.6348623", "0.63407546", "0.63374287", "0.6277796", "0.62592554", "0.61463845", "0.6143947", "0.6143533", "0.6115334", "0.6063468", "0.6056817", "0.6054003", "0.6046127", "0.6011141", "0.60027087", "0.5975602", "0.5970188", "0.59697455", "0.59480554", "0.594499...
0.72073317
0
query that handles searching for a country by name
function SimpleNameQuery(userQuery, res, countryOrCode) { //wether to search by name or code var queryString = countryOrCode ? 'https://restcountries.eu/rest/v2/name/' : 'https://restcountries.eu/rest/v2/alpha/'; //send a get request for a specified country and display the results request(queryStrin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findCountries(country) {\n return country.name === country_name;\n }", "function search(ab){\n var x=\"\";\n var u = \"https://restcountries.eu/rest/v2/name/\";\n if(ab!==x){\n l=u.concat(ab);\n apiFetch(l);\n }else{\n console.log(\"No country name entered\");\n }\n}", "function se...
[ "0.7064869", "0.6853037", "0.6586285", "0.6555291", "0.64944685", "0.64370495", "0.64089745", "0.64069766", "0.6395035", "0.63009614", "0.6192084", "0.61811", "0.6122896", "0.6093065", "0.6058108", "0.6053679", "0.6007189", "0.60022306", "0.5977165", "0.59376276", "0.59302384...
0.69347805
1
increase array element. Maximum is the maximum of one element. Element overflow, if everything is max, false returned
function increaseArray(array, max) { for (let index = array.length -1; index >= 0; index--) { if (array[index] < max) { array[index] += 1 return array } else { array[index] = 0 } } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increment(input, maxs) {\n if (input.length != maxs.length) return false;\n for (var i = 0; i < input.length; i++) if (input[i]>maxs[i]) return false;\n\n\n for (var i = input.length - 1; i >= 0; i--) {\n if (input[i] != (maxs[i])) {\n input[i] ++;\n return input;\n ...
[ "0.6643932", "0.6375962", "0.59895986", "0.5943111", "0.59395355", "0.58894086", "0.5759", "0.57200205", "0.57200205", "0.5717414", "0.5673088", "0.5649395", "0.5607102", "0.55755126", "0.5461296", "0.5459889", "0.54292816", "0.5418508", "0.54096675", "0.5407929", "0.5396262"...
0.7455024
0
Create a reusable constructor for bands bands have members, names, date formed, and albums. They also have an onTour attribute as well. Use this constructor to create three of your favourite bands!
function Bands(members, names, dateFormed, albums, onTour) { this.members = members; this.names = names; this.dateFormed = dateFormed; this.albums = albums; this.onTour = onTour; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor({bands = []} = {}){\n this.bands = bands.map(x => new CostBand(x));\n }", "function Birds(name){\n this.name = name;\n}", "function bands(argument) {\n if (argument == \"\") {\n argument = \"backstreet boys\";\n }\n axios\n .get(\n \"https://rest.bandsintown.com/artists/\" ...
[ "0.7001015", "0.595583", "0.5910048", "0.58617574", "0.5723834", "0.5627004", "0.5612839", "0.5545518", "0.5507207", "0.54999095", "0.5408549", "0.540845", "0.54069275", "0.53815633", "0.53655535", "0.5348452", "0.5312473", "0.5308854", "0.53071064", "0.5290145", "0.52749956"...
0.7399395
0
function to mark the submarine as hidden
function hideSubmarine(submarine) { var submarine = models.submarineList.get(submarine.uuid); models.submarineList.remove(submarine); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideH() {\n var i;\n var molecule = Mol();\n var cys = OriCrystal();\n // Loop over all atoms, setting hide flag to 0 for all atoms\n for (i=1; i <= molecule[0].numatoms; i++) {\n if ( molecule[i].atomicnumber == 1 ) {\n molecule[i].hide = 1;\n }\n }\n\n // Finished with hideH routin...
[ "0.7019325", "0.6955318", "0.68381023", "0.6803857", "0.67738277", "0.6772594", "0.67016345", "0.6644121", "0.66362286", "0.66283303", "0.66110593", "0.66020864", "0.66020864", "0.6557771", "0.64963245", "0.64821583", "0.64821583", "0.64690495", "0.6455682", "0.6444027", "0.6...
0.7011541
1
add/set the theme into a cookie for use by integrated apps (e.g., UEBA)
_updateThemeCookie(themeName) { document.cookie = `nw-ui-theme=${themeName};Path=/;`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTheme(themeName) {\n localStorage.setItem('theme', themeName);\n document.documentElement.className = themeName;\n //console.log(\"themeName:\",themeName);\n}", "function setTheme(t) {\n localStorage.setItem(\"t\", t);\n document.body.setAttribute(\"t\", t);\n document.body.style = \"\";\...
[ "0.7223885", "0.7217724", "0.71189535", "0.6965608", "0.6949764", "0.6874083", "0.6874083", "0.6866539", "0.676083", "0.66958576", "0.66943", "0.66595745", "0.6620639", "0.66152585", "0.6609584", "0.6577426", "0.6555437", "0.6537833", "0.652825", "0.6519773", "0.64395434", ...
0.83503324
0
Takes data as props and creates a new book object. Then pushes the new book object to myLibrary.
function addBookToLibrary(title, author, pages, read, rating) { let temp = new Book(title, author, pages, read, rating) data.myLibrary.push(temp) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addBookToLibrary() {\n let newBook = new Book(bookTitle, authorName, pageNumber, readStatus)\n myLibrary.push(newBook)\n}", "function addBookToLibrary() {\n\n let newBook = new Book(title, author, pages, read)\n }", "function addBookToLibrary() {\n\tif(myLibrary.length > 0) {\n\t}\n\tlet book = ...
[ "0.81765294", "0.7981559", "0.7792073", "0.77854186", "0.7759177", "0.7754994", "0.7639799", "0.748493", "0.7473937", "0.7442249", "0.7421951", "0.73924583", "0.7358525", "0.7355089", "0.7352645", "0.7341603", "0.73029125", "0.7258912", "0.7227101", "0.72245353", "0.72160786"...
0.8238576
0
Removes all elements (Books) in the bookcontainer. Used when resetting the display: clear > redisplay
function clearDisplay() { let container = document.querySelector('.book-container') let books = document.querySelectorAll('.book-component') for (let i = 0; i < books.length; i++) { container.removeChild(books[i]) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearElement() {\n const section = document.querySelector('.books');\n while (section.firstChild) {\n section.removeChild(section.firstChild)\n }\n // https://medium.com/front-end-weekly/remove-all-children-of-the-node-in-javascript-968ad8f120eb\n}", "function resetBooks(){\n while...
[ "0.7958026", "0.739288", "0.72414154", "0.7060346", "0.69758725", "0.6900638", "0.69000053", "0.68418163", "0.676951", "0.66929704", "0.6625336", "0.6606209", "0.6502658", "0.64594156", "0.6388775", "0.6382876", "0.63657784", "0.6361421", "0.6361238", "0.63497823", "0.6349246...
0.8626181
0
Displays X or Checkmark depending on read status. Used in displayBook function.
function readDisplay (book) { return (book) ? `<img src='https://s2.svgbox.net/materialui.svg?ic=check_box' class='h5'>` : `<img src='https://s2.svgbox.net/materialui.svg?ic=indeterminate_check_box' class='h5'>` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showBookMarkIcon() {\n\tvar propertiesMap = getPropertiesMap();//JSON.parse(GetFromLocalStorage(\"i18nMap\", obfuscation));\n\tvar status = userobj.bookMarkChecker();\n\tif (status == \"Bookmarked\") {\n\t\t/*UI Cust suman */\n\t\t/*\n\t\t$('#bookMark img').attr('src',\n\t\t\t\tbaseurl+'epubimages/icon_bo...
[ "0.6112741", "0.60950345", "0.6042256", "0.6036176", "0.5884121", "0.5844536", "0.5816751", "0.57197773", "0.57123977", "0.55555737", "0.5537188", "0.552826", "0.5481555", "0.5469729", "0.5372727", "0.53574705", "0.53384423", "0.53100693", "0.5304834", "0.53045535", "0.530183...
0.65222895
0
Keeps track of the number of books by getting the number of bookcomponents Used when redisplaying books (ie. there is a change to the number of books)
function bookNums () { let bookNums = document.getElementById('book-nums') let nodes = document.querySelectorAll('.book-component') let num = [...nodes] bookNums.textContent = `${num.length} books` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBookCount() {\n this.totalBookCount = document.getElementById(\"totalBookCount\");\n this.bookObjArr;\n this.savedBooks = localStorage.getItem(\"savedBooks\");\n if (this.savedBooks == null) {\n this.bookObjArr = [];\n }\n else {\n this.bookObjArr ...
[ "0.695959", "0.6906734", "0.6791289", "0.66574514", "0.65822846", "0.6539231", "0.6378757", "0.637645", "0.6362484", "0.63604814", "0.63550663", "0.62557507", "0.62546283", "0.61879236", "0.61614317", "0.6149789", "0.61277133", "0.60995287", "0.60979736", "0.6097313", "0.6095...
0.72513217
0
Determine whether a form f has at least one item of type element_type with a name starting with any item in prefix_array that is selected.
function hasOneSelected (f, element_type, prefix_array) { var found = false; for (var i=0; i<f.length; i++) { var e = f.elements[i]; if (e.type == element_type) { for (var p=0; p<prefix_array.length; p++) { var prefix = prefix_array[p]; if (e.name.inde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckLikeElement(frm, strLike, type){\n\tvar check = false;\n\tfor(var j = 0; j < frm.length; j++){\n\t\tvar frmElement = frm.elements[j];\n\t\tif(frmElement.type == 'checkbox'){\n\t\t\tif(frmElement.name.substring(0, strLike.length) == strLike && frmElement.checked == true){\n\t\t\t\tcheck = true;\n\t\t\...
[ "0.5863678", "0.5732715", "0.5700722", "0.5700722", "0.5608442", "0.55108345", "0.5493639", "0.549348", "0.5492746", "0.5490751", "0.5482541", "0.5467521", "0.5466036", "0.5420284", "0.5418433", "0.5373919", "0.5340799", "0.5340799", "0.5338976", "0.53259283", "0.5304847", ...
0.7913659
0
Verify new summaries inplace before submission
function verifySummary () { var f = document.getElementById('summary_form'); // Check methodologies. One must be selected. if (hasOneSelected(f, 'radio', ['methodology']) != true) { alert('Please choose a methodology.'); return false; } // Check exposures and outcomes. At...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasSummary() {\n return (this.get('summary') !== this.get('commitMessage'));\n }", "function doRepopulateAfterVerify(occurrenceIds) {\n var sourceSettings = $(listOutputControl)[0].settings.sourceObject.settings;\n var docIds = [];\n\n // Build list of verified IDs to exclude from the new view...
[ "0.56504565", "0.56488943", "0.5404335", "0.52521133", "0.5246111", "0.5244722", "0.5222907", "0.52009124", "0.5136752", "0.50940967", "0.50797766", "0.5074747", "0.5070641", "0.5058487", "0.50275", "0.5013724", "0.5006624", "0.49715102", "0.4957645", "0.49376497", "0.4926639...
0.599145
0
Function of clearing all items and sum computing string
function clearAll () { boxSum.lastElementChild.remove(); boxSum.lastElementChild.remove(); boxSum.append( document.createElement('br') ); boxSum.append( document.createElement('br') ); for(let i = 0; i < arr.length; i++) { if (arr[i] != null) { task.lastElementChild.remove() } } measureUnit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAll() {\n populateDisplay(\"AC\");\n currentNumber = 0;\n tempSum = 0;\n lastOperator = \"\";\n buffer = [];\n}", "function clearAll() {\n calculation = [];\n $display.textContent = 0;\n multiDigit = \"\";\n}", "function clearAll() {\n inputOne = undefined;\n inputTwo = undefined;\n op...
[ "0.6555221", "0.63576365", "0.6297228", "0.62578166", "0.6192455", "0.61498475", "0.607411", "0.6060487", "0.602026", "0.6016621", "0.59800446", "0.59566575", "0.59519815", "0.5913466", "0.5913466", "0.58866656", "0.5841746", "0.58377975", "0.58227354", "0.5808924", "0.580702...
0.64914435
1
after we save the user, handle sending a confirmation
function postSave(err) { if (err) { return die('There was a problem validating your account ' + '- please enter your token again.'); } // Send confirmation text message var message = 'You did it! Signup complete :)'; user.sendMessage(message, function...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newUserConfirm() {\n\n\texecAjax('/new_user/',\n\t\t\tJSON.stringify({'p_data':window.newUsersObject.newUsers}),\n\t\t\tfunction(p_return) {\n\n\t\t\t\tv_usersObject.v_cellChanges = [];\n\t\t\t\twindow.newUsersObject.newUsers = [];\n\t\t\t\tif (v_usersObject.v_cellChanges.length === 0 && window.newUsersOb...
[ "0.6918779", "0.6855885", "0.6743706", "0.66328037", "0.65059745", "0.6446947", "0.6444936", "0.63661116", "0.6350664", "0.63493645", "0.6339499", "0.6274914", "0.6271314", "0.62587357", "0.624778", "0.62170017", "0.62076503", "0.6197207", "0.6185766", "0.6159505", "0.6141344...
0.7378495
0
Fire an orientation change event with the current window width as data
initOrientationChange() { window.addEventListener( 'orientationchange', () => { $( window ).trigger( 'orientationChange', $( window ).width() ) }, false ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handler() {\n // Get the current orientation.\n var orientation = get_orientation();\n\n if ( orientation !== last_orientation ) {\n // The orientation has changed, so trigger the orientationchange event.\n last_orientation = orientation;\n win.trigger( event_name );\n }\n }", ...
[ "0.70753443", "0.6956194", "0.69252455", "0.69025844", "0.68777186", "0.68777186", "0.68777186", "0.6716138", "0.66810393", "0.66323525", "0.6615418", "0.6615418", "0.6615418", "0.6615418", "0.6615418", "0.65108913", "0.62052745", "0.61743546", "0.61352766", "0.61284655", "0....
0.74764746
0
Handle create new file
function createNewFile() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFileName() {}", "function CreateNewFile(){\n isNewFile = true;\n var newFile = DefaultSavePath+CreateRandomFileName();\n //Clear current window \n if(EditorManager.editableCodeMirror.getValue() != null || EditorManager.editableCodeMirror.getValue() != \" \"){\n EditorManager.edi...
[ "0.69785297", "0.69421494", "0.68900573", "0.68656766", "0.68508625", "0.68077976", "0.673036", "0.6703219", "0.6665601", "0.6653335", "0.6616564", "0.65947855", "0.6563193", "0.65280193", "0.6422684", "0.64115494", "0.63992774", "0.6388551", "0.63355666", "0.620009", "0.6184...
0.78845644
0
saves references to handy DOM elements for this component in the this.dom object
setDomElements() { this.dom.panelTriggers = []; this.dom.panelBody = []; // to support nested accordions, make sure to only store the panel elements from // the direct children of this instance's element; otherwise, the nested accordion's // trigger event listener would be added...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get domEl() {return this._el;}", "function cacheDOM() {\n\t\tDOM.$sliderChevronLeft = $('.slider-chevron.left');\n\t\tDOM.$sliderChevronRight = $('.slider-chevron.right');\n\t\tDOM.$sliderOuter = $('.slider-outer');\n\t}", "function cacheDom() {\n DOM.addBtn = document.querySelector('#new-toy-btn');...
[ "0.70449245", "0.69078714", "0.689604", "0.67864215", "0.6771106", "0.67262894", "0.6630263", "0.6590496", "0.65651494", "0.6548105", "0.65234965", "0.64619505", "0.64317614", "0.64001834", "0.64001834", "0.63982916", "0.6392307", "0.63570374", "0.6352421", "0.6341844", "0.63...
0.7170842
0
opens/closes a panel's body
togglePanel(panelBody, panelIsOpen) { // get the height of the body's content wrapper at the moment before opening/closing const contentHeight = panelBody.firstElementChild.offsetHeight; // if currently open, close panelBody by setting the height to it's content height, // and then set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "toggle() {\n if (this.hasPanel()) {\n this.isOpen() ? this.close()...
[ "0.6610574", "0.6610574", "0.6610574", "0.6540702", "0.6482574", "0.640261", "0.6258455", "0.62415946", "0.6093296", "0.60796815", "0.6036008", "0.6032832", "0.5948192", "0.59069246", "0.5892318", "0.58781457", "0.5865433", "0.5860656", "0.5860069", "0.58053434", "0.5793253",...
0.68903196
0
name should be a string, calories should be a number value, isVegan, isGlutenFree, and isCitrusFree should be a boolean
function FoodItem(name, calories, vegan, glutenFree, citrusFree){ this.name = name; this.calories = calories; this.isVegan = vegan; this.isGlutenFree = glutenFree; this.isCitrusFree = citrusFree; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addFood(name, calories){\n\t\tfoods.food.push({foodName: name, foodCalories: calories, added: new Date(), number: foods.food.length+1});\n\t}", "function calculateCalories() {\n let value1;\n let value2;\n let value3;\n let value4;\n\n //formula values for men and women respectively\n ...
[ "0.62566", "0.6054597", "0.6028723", "0.5768671", "0.5716333", "0.56553197", "0.5626025", "0.55989283", "0.5532887", "0.5512704", "0.5500446", "0.54964244", "0.5478183", "0.54709005", "0.54673046", "0.5461591", "0.54215854", "0.53998756", "0.53851146", "0.5365091", "0.5358833...
0.7074367
0
name should be a string, description should be a string, price should be a number items should be an array functions to check if food complies with different diets the values isGlutenFree, isVegan, etc are booleans
function Plate(name, description, price, items){ this.name = name; this.description = description; this.price = price; this.items = items; Plate.prototype.checkGlutenFree = function(){ for(var i=0; i<this.items.length; i++){ if (this.items[i].isGlutenFree) { return false }else{ return t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FoodItem(name, calories, vegan, glutenFree, citrusFree){\n\tthis.name = name; \n\tthis.calories = calories;\n\tthis.isVegan = vegan; \n\tthis.isGlutenFree = glutenFree; \n\tthis.isCitrusFree = citrusFree; \n}", "isItem(obj, productName, price) {\n if (obj.productName === productName && obj.price === ...
[ "0.71021086", "0.6116904", "0.60391754", "0.59588677", "0.5922774", "0.59185374", "0.58396244", "0.57262903", "0.5718333", "0.57037234", "0.5696617", "0.56817955", "0.5673813", "0.56713444", "0.56656575", "0.5646686", "0.56302834", "0.5629858", "0.56077737", "0.56052655", "0....
0.6808077
1
Script to display two tables from Google Sheets as point and polygon layers using Leaflet The Sheets are then imported using Tabletop.js and overwrite the initially laded layers init() is called as soon as the page loads
function init() { var pointsURL = "https://docs.google.com/spreadsheets/d/1jBndsqchkcmiYXSIMU6U72jIQG5FId7mVMbrHJitAlI/edit?usp=sharing"; Tabletop.init({ key: pointsURL, callback: addPoints, simpleSheet: true }); // simpleSheet assumes there is only one table and automatically sends its data }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n var pointsURL = \"https://docs.google.com/spreadsheets/d/1QTY5ybMfttoqnuIwC8VyWDrvjr7vJrbqnEI_JmMnXvA/edit?usp=sharing\";\n\n Tabletop.init({ key: pointsURL, callback: addPoints, simpleSheet: true }); // simpleSheet assumes there is only one table and automatically sends its data\n\n}", "fu...
[ "0.71307194", "0.6783639", "0.6485978", "0.6434433", "0.632579", "0.6231472", "0.62028587", "0.6160629", "0.61072105", "0.60676605", "0.60165733", "0.5997932", "0.59600836", "0.5955027", "0.59536344", "0.5953388", "0.5940386", "0.5914384", "0.58922005", "0.58762354", "0.58668...
0.7139431
0
Onclicking it sends the selected team as a prop to SpecificTeam Component
handleClick(data,event){ this.setState({ specificTeam:data, SpecificSeason:this.props.teams.SpecificSeason }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selectedTeam(team) {\n\n this.selectedTeamInfo = team;\n this.team = true;\n this.getTeamMembers();\n }", "handleClick(team) {\n this.setState({rediteam:team})\n if (team.hasAccepted == 1) {\n this.setState({redirect:true});\n }\n else {\n this.setState({show:true})\n ...
[ "0.7425957", "0.6653693", "0.63472605", "0.6312752", "0.61052537", "0.6102045", "0.6075497", "0.6048605", "0.60087353", "0.5971102", "0.59465945", "0.5862503", "0.5801563", "0.5751281", "0.5715936", "0.5691785", "0.5671329", "0.56697243", "0.5655958", "0.5637004", "0.56314415...
0.75729066
0
Compute nearest lower power of 2 for n in [1, 2311]:
function nearestPowerOf2(n) { return 1 << 31 - Math.clz32(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nearestPowerOf2(n) {\n return Math.pow(2, Math.round(Math.log(n) / Math.log(2)));\n}", "function nearest_pow2( n )\n{\n\t var l = Math.log( n ) / Math.LN2;\n\t return Math.pow( 2, Math.round( l ) );\n}", "_getNearestPowerOfTwo(x: number): number {\n return Math.pow( 2, Math.round( Math.log( x ) /...
[ "0.824582", "0.7993726", "0.785414", "0.7226756", "0.69866383", "0.68214923", "0.6791269", "0.6745505", "0.6613963", "0.6598963", "0.6585966", "0.6563047", "0.65141475", "0.6513539", "0.6477422", "0.64426655", "0.6439537", "0.64360815", "0.6332093", "0.6309031", "0.63013476",...
0.8438535
0
Recibe las especificaciones de la horamiga (tipocomida, peso maximo, carga , itinerario, inventario, idPedido, idHormiag, encomienda) Crea la hormiga con dicha especificacion y la manda a volar.
function generarHormiga(especificaciones){ var hormiga = new Hormiga(especificaciones); console.log('Hormiga > Tipo comida ' + hormiga.obtenerTipoComida + ' Encomienda >'+hormiga.obtenerEncomienda + 'Peso maximo > '+hormiga.obtenerEncomienda+'itinerario:'+hormiga.obtenerItinerario); hormigasActivas++; console.log('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenerRegistroHorasSoloCategorias() {\n var params = {\n tipo: 2,\n idActividadUHorario: $scope.curso.idhorario\n }\n\n serviceCRUD.TypePost('registro_horas/obtener_registro_horas', params).then(function (res) {\n if (res.data.succeed == false) {\n ...
[ "0.6683656", "0.6536173", "0.63412976", "0.6288499", "0.626348", "0.62601924", "0.62597764", "0.62491274", "0.6206627", "0.6165332", "0.616315", "0.6154148", "0.6110304", "0.6085365", "0.60835534", "0.60480565", "0.60474914", "0.6038712", "0.6028388", "0.6028133", "0.6019242"...
0.73690045
0
Devuelve la cantidad de un determinado tipo de comida que posee un almacen
function devolverCantidadComida(obj,tipoComida){ obj.inventario.forEach(function(inventario){ if(inventario.tipoComida == tipoComida){ return inventario.cantidad; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tipoAtendimento(){\n\n\tvar vendedores = {} // Objeto para armazenar os vendedores\n\tvar loja = {'venda': 0,'nao_venda': 0, 'ajuste_conserto_montagem_pagamento':0, 'entrega':0,\n\t\t'troca_assistencia':0}; // Grafico para gerar o total das lojas\n\n\tfor(var v in atendimentoVendedor){\n\t\tvendedores[v] ...
[ "0.6002386", "0.59565467", "0.57489383", "0.5747489", "0.5662067", "0.56586367", "0.5501343", "0.5494324", "0.5471394", "0.54624474", "0.54586464", "0.5456234", "0.5441038", "0.54381776", "0.53924745", "0.5386958", "0.5367175", "0.5333138", "0.5318431", "0.53082883", "0.52946...
0.67278653
0
Busca el itinerario de la hormiga Recibe un tipo de comida y crea un arreglo con la lista de almacenes destinos en orden descendentes a sus cantidades disponibles
function buscarItinerario(tipocomida){ var itinerario = []; var almacenes = leerInventario(); almacenes.almacenes.forEach(function(almacen){ //almacenes.forEach(function(almacen){ almacen.inventario.forEach(function(inventario){ if(inventario.tipoComida == tipocomida) itinerario.push(almacen); }); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetarTranslado(){\n let centralCentral = new Object();\n centralCentral.tag = \"CC\";\n centralCentral.origem = localidades[2];\n centralCentral.destino = localidades[2];\n centralCentral.quilometro = 3;\n centralCentral.tempo = 5;\n centralCentral.valor = 5;\n centralCentral.espera = 1;\n\n tran...
[ "0.58962166", "0.5840928", "0.5783545", "0.5714371", "0.56706834", "0.5642137", "0.5626991", "0.56070954", "0.55893165", "0.55848515", "0.555435", "0.5543863", "0.55300343", "0.5491929", "0.5477931", "0.54458386", "0.5400154", "0.5395198", "0.5389114", "0.5382852", "0.5374052...
0.6167625
0
La funcion recibe un pedido de la hormiga reina, dicho pedido contiene los tipos de comida y cantidades que ella desea. El objetivo de la funcion es el de crear a las hormigas necesarias para satisfacer dicho pedido.
function recibirPedido(pedido){ var arrayEspecificaciones = []; pedido.Pedido.forEach(function(item){ console.log(item.tipo); console.log(item.cantidad); var tipoComida = item.tipo; var cantidad = item.cantidad; var encomienda = cantidad; var encomiendaHormiga = 0; var pesoMaximo = 0 ; var itinerario ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "juego(partido) {\n let resultados = {}\n\n function jugar(partido) {\n //añade los puntos por equipo\n for (let participante of partido) {\n const goles = puntos()\n resultados[participante] = goles\n }\n // condicion para volv...
[ "0.6743141", "0.6401321", "0.63662404", "0.6318035", "0.62408954", "0.6209629", "0.6192147", "0.61913705", "0.6188395", "0.61828524", "0.60995007", "0.60935545", "0.60876787", "0.6073757", "0.60668266", "0.6062001", "0.6055512", "0.6055388", "0.60403", "0.60394335", "0.603880...
0.6976792
0
Artifact: Exemption list callback Description: Grabs data from Chrome storage and determines if site is exempt.
function callback(result){ exemptionlist = result.exemptions; if (exemptionlist.includes(window.location.href)){ pageAllowed = false; } else{ pageAllowed = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LoadAndLogAndListDNL() {\n// var gettingAllStorageItems = browser.storage.local.get(null);\n/* var gettingAllStorageItems = chrome.storage.local.get(null);\n gettingAllStorageItems.then((res) => {\n NASaddr = res.NASaddress;\n NASport = res.NASport;\n NASlogin = res.NASlogin;\n NASp...
[ "0.60094994", "0.58231896", "0.5810588", "0.5748242", "0.574502", "0.5739698", "0.57156205", "0.56705827", "0.56151253", "0.5501214", "0.5498403", "0.54895675", "0.5485722", "0.5478162", "0.5470744", "0.54566574", "0.5448674", "0.54091305", "0.5396523", "0.53495944", "0.53483...
0.63206357
0
The engine can return params: "query=xxx&query=yyy" if e.g. a query rule modifies it. This however will cause us to miss the cache hydration, so we make sure to keep only the first query (always the one from the parameters).
function removeDuplicateQuery(params) { if (!params) { return params; } let hasFoundQuery = false; const queryParamRegex = /&?query=[^&]*/g; return params.replace(queryParamRegex, function replacer(match) { if (hasFoundQuery) { return ''; } hasFoundQuery = true; return match; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useQuery() {\n\t\treturn new URLSearchParams(useLocation().search);\n\t }", "getExistingQueryParams(){\n const params = _.omit(this.parseParms(window.location.href.split('?')[1]),['skip','take','page',\"\"]);\n let str = '';\n\n for(let key in params){\n str += `${key}=$...
[ "0.66588426", "0.6593289", "0.6576651", "0.65163", "0.6417726", "0.64040565", "0.6402209", "0.6402209", "0.6402209", "0.6402209", "0.6402209", "0.6402209", "0.6402209", "0.6402209", "0.6402209", "0.63981956", "0.63981956", "0.63981956", "0.63981956", "0.63981956", "0.63981956...
0.6949749
0
function to end trial when it is time
function end_trial() { // kill any remaining setTimeout handlers jsPsych.pluginAPI.clearAllTimeouts(); // gather the data to store for the trial let trial_data = { "rt": response.rt, "stimulus": trial.stimulus, "audioData":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n let trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n ...
[ "0.80625576", "0.7984754", "0.7978311", "0.79556", "0.78904575", "0.7834343", "0.7803416", "0.7762478", "0.7276052", "0.7267206", "0.7167829", "0.7130544", "0.70337206", "0.7021666", "0.69928324", "0.6843179", "0.680319", "0.67086214", "0.66648394", "0.6663631", "0.6587543", ...
0.80916923
0
remove existing colors and names from list function
function removeExistingColorAndName(members){ for(i = 0; i<members.length; i++){ var currentMember = members[i]; colors20 = colors20.filter(function(el) { return el != currentMember.clientData.color }); names20 = names20.filter(function(el){ return el != currentMember.clientData.name }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ColorList() {}", "function scrubAllColors() {\n findAllColoramas().forEach(function (pathItem) {\n get(\"tags\", pathItem)\n .filter(function (tag) {\n return new RegExp(\"colorama\").test(tag.name);\n })\n .forEach(function (tag) {\n tag.remo...
[ "0.7100791", "0.6819678", "0.6452552", "0.61101466", "0.6086112", "0.6082713", "0.604512", "0.6044265", "0.59994686", "0.59763277", "0.59397596", "0.58747447", "0.58064264", "0.58035403", "0.5803455", "0.5785943", "0.5781166", "0.576674", "0.57550484", "0.57487786", "0.571564...
0.68718797
1
Check if messages are coming from me
function isThisMyMessage(message){ if(message.clientId === drone.clientId){ return true; } else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isMe(message) {\n if(message && message.user == userName) {\n return true;\n }\n return false;\n }", "ownMessage(username) {\n if (username === Meteor.user().username) {\n return true;\n }\n else {\n return false;\n }\n }", "function...
[ "0.7448558", "0.6922349", "0.6906496", "0.6787475", "0.6562929", "0.65283173", "0.65130514", "0.6428512", "0.63869905", "0.6247606", "0.62341005", "0.62112594", "0.6209037", "0.620668", "0.620433", "0.6202744", "0.6167199", "0.6149694", "0.6116784", "0.61063737", "0.6101582",...
0.7079148
1