query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Retrieve a multivalue query parameter. If key is not given, it will return all query keyvalues.
getQueryParameters(key) { if (key) { const values = this.queryParams[key.toLowerCase()]; if (typeof values == 'string') { const result = []; result.push(values); return result; } else if (Array.isArray(values)) { ...
[ "function QueryString(key)\n{\n\tvar value = null;\n\tfor (var i=0;i<QueryString.keys.length;i++)\n\t{\n\t\tif (QueryString.keys[i]==key)\n\t\t{\n\t\t\tvalue = QueryString.values[i];\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn value;\n}", "function getQueryItem(key){\n var pageURL = decodeURI(window.location.search.su...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Replica un caracter segun la cantidad indicada
function repitechar(cantidad, carac) { var caracter = carac; var numero = parseInt(cantidad); var cadena = ''; for ( var r = 0; r < numero; r++) { cadena += caracter; } return cadena; }
[ "function contarCaracteres(cadena){\n\tvar cadena=cadena.toString();\n\tvar no=cadena.length;\n\t//con 23px caben hasta 12 caracteres\n\tif(no>12 && no<=16){// de 12 caracteres en adelante y menos o igual a 16 carcateres\n\t\tentrada.style.paddingTop='40px';\n\t\tentrada.style.fontSize='18px';//16 caracteres\n\t}el...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the user icon.
set icon(aValue) { this._logger.debug("icon[set]"); this._icon = aValue; }
[ "set icon(aValue) {\n this._logService.debug(\"gsDiggUserDTO.icon[set]\");\n this._icon = aValue;\n }", "set icon(value) {\n this.setAttribute('icon', value);\n }", "function setIcon(icon) {\n this.icon = icon;\n }", "function iconHandler(e) {\n iconBig.setAttribute('src', e.target.files[0]....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event function to be called when the comments content has fulled loaded into the window.
function CommentsLoaded() { //Comments.commentsWindow.document.myComments.comments.focus(); // if the user clicked the "Done" button prior to the update completing, close the // comments window. if (CommentsUpdateFlag) { CommentsUpdateFlag = false; // make sure the update flag is turned off if (CommentsCloseF...
[ "function listenCommentsClick() {\n\t$('a.load_comments').on('click', function (event) {\n\t\tevent.preventDefault();\n\n\t\tgetPostComments(this.href);\n\t})\n}", "function commentLoaded() {\n\t\tfor(var comment of commentList) {\n\t\t\tif(comment.data == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconsole.log...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
computes the size properties for the confirmed color badge canvas
_computeConfirmedColorSizeProperties() { // use the container of the badge to define its draw area requestAnimationFrame(() => { const confirmedColorBadgeContainer = this.shadowRoot.querySelector('#confirmedColorBadge'); if (confirmedColorBadgeContainer) { const box = getBoundingCl...
[ "function getSizes()\n {\n sizes.field.rows = 3;\n sizes.field.cols = 6;\n\n sizes.desk.height = DOM.parent.offsetHeight / 3;\n sizes.desk.width = properties.coverSize.width * sizes.desk.height / properties.coverSize.height;\n sizes.deskContainer.marginBottom = sizes.desk.width...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove teacher from list of clients in the classroom
function exitClassroomTeacher(id) { // server-side // remove client from classroom var classroomid = clients[id].classroomid; // you can only remove the student from the classroom if the classroom exists if (classroomid && classrooms[classroomid]) { delete classrooms[classroomid].teacher; } }
[ "removeTeacher() {\n this.teacher = null;\n updateRoster(this);\n }", "function removeTeacher(e) {\n\tdelName = e.childNodes[0].childNodes[0].childNodes[0].innerHTML;\n\t// Make request object\n\tvar reqData = {\n\t\tmethod:\"del_teacher\",\n\t\tcontents: {\n\t\t\tuname:localStorage[packagePrefix...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
register an comment listener to be notified when a comment is added or deleted to an comments
function notifyCommentListeners(comments){ commentListeners.forEach(function(listener){ listener(comments); }); }
[ "function addCommentEvents() {\n\t$('.remove-comment').on('click', function () {\n\t\tlet id = $(this).attr('data-id');\n\t\tremoveComment(id);\n\t});\n\n\t$('.update-comment').on('click', function(){\n\t\tlet id = $(this).attr('data-id');\n\t\tlet content = $(this).parent().parent().find('.comment-content').html()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function schedulePlan It will be called when clicking 'Schedule Plan' process in event tab on techspec screen.
function schedulePlan() { var url = "scheduled"; var htmlAreaObj = _getWorkAreaDefaultObj(); var objAjax = htmlAreaObj.getHTMLAjax(); var objHTMLData = htmlAreaObj.getHTMLDataObj(); sectionName = objAjax.getDivSectionId(); //alert("sectionName " + sectionName); if(objAjax && objHTMLData) { if(!is...
[ "function schedule(event) {\n // local constants\n const scheduleText = 'schedule';\n const scheduledText = 'scheduled';\n\n const targetElementId = event.target.id;\n const targetElement = document.getElementById(targetElementId);\n const parentElement = targetElement.pare...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function list: ===validateCheckbox(class) > check if the checkboxes has been at least 1 checked, have to give them the same class name ===nl2br(text) > \r \n \r\n >
function validateCheckbox(classKeo) { var anychecked = false; $("."+classKeo).each(function(){ if($(this).is(':checked')) { anychecked = true; } }); if(anychecked) { return true; } else { return false; } }
[ "function checkboxFieldValidator(checkboxes) {\n let isSelected = false;\n for (let i = 0; i < checkboxes.length; i++) {\n // at least one box must be checked\n if (checkboxes[i].checked) {\n isSelected = true;\n break;\n }\n }\n if (!isSelected) {\n act...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handler for adding workstation to workgroup
addWorkstation(id){ this.props.actions.addWorkstationsToWorkgroup([id]); }
[ "addWorkstations(){\n\t\tthis.props.actions.addWorkstationsToWorkgroup(this.props.selectedWorkstations);\n\t}", "function addSwimlane() {\n showProcessingDiaglog();\n var sw = new Swimlane();\n $.ajax({\n url: \"Handler/SwimlaneHandler.ashx\",\n data: {\n action: \"addSwimlane\",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroy Wallet This will completely destory the user's wallet, as well as ALL imported seeds.
destroyWallet (state) { /* Destory master mnemonic. */ state.masterMnemonic = null /* Destory master seed. */ state.masterSeed = null /* Reset all (imported) seeds. */ state.importedSeeds = [] /* Reset active accounts (address) index. */ state.activeAcc...
[ "async deleteWallet () {\n return indy.deleteWallet(this.walletHandle, this.walletConfig, this.walletCredentials)\n }", "deleteWallet() {\n localStorage.clear();\n return;\n }", "async close() {\n log.debug('closing wallet', this.handle, this.config);\n if (this.handle && this.handle !=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of column header strings, given any sheet's range
function getHeaders(sheet,range,columnHeadersRowIndex) { var numColumns = range.getEndColumn() - range.getColumn() + 1; // The 1D range of sheet headers (column titles) for a given range var headersRange = sheet.getRange(columnHeadersRowIndex, firstBarcodeColumn, 1, numColumns); return headersRange.getValue...
[ "function colnames_(sheet) {\n var names = []; \n for(var icol=1; icol!=sheet.getLastColumn()+1; ++icol) {\n var name = sheet.getRange(1, icol).getValue()\n .toString().trim();\n if(name.length==0)\n break;\n names.push(name);\n }\n \n return names;\n}", "function getHeaders(sheet) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Class Cube 1. used as loaded module enter Cube(name, requires, callback); 2. used as Cube constructor var loader = new Cube(name); loader.load(requires, callback);
function Cube(name, requires, callback) { if (arguments.length === 3) { var ld = new Cube(name); ld.load(requires, callback); } else { this.name = name ? name : '_' + (count++); this.base = BASE; this.charset = CHARSET; // FLAG[this.name] = []; // FLAG[this.name].module...
[ "function Cube(name, requires, callback) {\n if (arguments.length === 3) { // register module\n var ld = new Cube(name);\n ld.load(requires, callback);\n } else { // new loader\n this.name = name ? name : '_';\n this.base = BASE;\n this.charset = CHARSET;\n // FLAG[this.name] = [...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filtering by user is done by Meteor.publish. Reduces UserClubs database down to just club names, then matches that club name field with the data in the Clubs database to create an array of the relevant clubs' data
filterClubs() { const myClubList = _.pluck(this.props.userClubs, 'club'); const myClubs = _.sortBy(_.flatten(_.map(myClubList, (name) => _.where(this.props.clubs, { nameOfOrganization: name }))), 'nameOfOrganization'); return myClubs; }
[ "function getClubLists(){\n\n var thisSS = SpreadsheetApp.openById(myClubsSSId);\n var clubInfo = thisSS.getSheetByName(clubListSheetName).getDataRange().getValues();\n var clubMgrs = thisSS.getSheetByName(managerClubsSheetName).getDataRange().getValues();\n var clubMembers = thisSS.getSheetByName(studentclubsS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get broadcast start timestamp
async getBroadcastStart(contentId) { try { this.debuglog('getBroadcastStart') if ( !this.temp_cache[contentId] ) { this.temp_cache[contentId] = {} } let cache_data = await this.getAiringsData(contentId) let broadcast_start_offset let broadcast_start_timestamp if...
[ "function YDataStream_get_startTime()\n {\n return this._utcStamp - parseInt(+new Date()/1000);\n }", "getAbsoluteStartTime() {\n return this.get('metronome').beatToTime(this.get('startBeat'));\n }", "function getStartTime() {\n if (hasTrackPoints) {\n return trackSegments[0].tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the method we expose will do some simple autoqueuing for us to avoid the long text problems and keep things simple.. periods make for a natural place to pause, so this isn't 'bullet proof' but in practice it seems to work pretty well.
say(text) { let queue = [] text.split(/[.,&"\n]/).forEach((shortText) => { queue.push(shortText) //queue.push(this.__sayThis(shortText)) }) return this.__sayNext(queue).then(() => { console.log('all my speaking should be done now') }) }
[ "say(text) {\n \t\tlet queue = [], ret\n \t\tif (text.length > 64) {\n\t \t\ttext.split(/[.,&\"\\n]/).forEach((shortText) => {\n\t \t\tqueue.push(shortText)\n\t \t\t})\n \t\t} else {\n \t\t\tqueue.push(text)\n \t\t}\n\n \t\tret = BasicVoiceSpeaker.__last.then(() => {\n \t\t\treturn this.__sayNext(queue)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
doublebrick recolor and remove
function doubleBrickHit(ball, doubleBrick) { if(doubleBrick.hitOnce === false) { doubleBrick.shapeColor = color(255,255,255); doubleBrick.hitOnce = true; //console.log("hit"); } else if(doubleBrick.hitOnce === true) { doubleBrick.remove(); //console.log("hit"); ...
[ "function clearTint() {\n\tOutliner.elements.forEach(obj => {\n\t\tconst geometry = obj.mesh.geometry;\n\t\tgeometry.deleteAttribute('color');\n\t\tobj.preview_controller.updateFaces(obj);\n\t});\n}", "ClearBlendShapes() {}", "function cvjs_clearDrawingRedlines()\n{\n\n// empty\n}", "function removeColour_han...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the specifc time windows for multiple data fetches required to fetch an entire range
function calculateCallTimeWindows(startTime, endTime, intervalObj, maxBars) { //next we want to determine how many calls we need to make to fetch all intervals between start and end time. let windowStart = startTime; let windowEnd = 0; let finalMaxBars = maxBars || defaultMaxBars; let results = []; ...
[ "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "function determineConsumptionWindows(responseObject) {\n\n let metersWith...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function handles the changing of the viewpointLight
function doChangeViewLight() { if (document.getElementById("light2").checked) { scene.add(viewpointLight); } else { scene.remove(viewpointLight); } if (!animating) { render(); } }
[ "static set lightmapsMode(value) {}", "function switchView() {\n var active = _activeCameraToolpath;\n if (active == 'camera') {\n _activeCameraToolpath = 'toolpath';\n //Place code here to change in application\n } else {\n _activeCameraToolpath = 'camera';\n //Place code here to cha...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform the tree associated with a file with configured plugins.
function transform(context, file, fileSet, next) { if (stats(file).fatal) { next() } else { debug('Transforming document `%s`', file.path) context.processor.run(context.tree, file, onrun) } function onrun(error, node) { debug('Transformed document (error: %s)', error) context.tree = node ...
[ "function applyTransforms (filename, src, options, done) {\n options.use = [].concat(options.use || []).concat(options.u || [])\n mapLimit(options.use, 1, iterate, function (err) {\n if (err) return done(err)\n done(null, src)\n })\n\n // find and apply a transform to a string of css\n // (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the express server, listen on the port provided in the config file. Call this when database syn is done.
function startServer() { app.serverInstance = server.listen(config.PORT, config.HOST, function() { logger.info('Express server listening on %d, in %s mode...', config.PORT, config.ENV); }); }
[ "function startExpressServer(){\n\tserver = app.listen(environmentVariables.portNo, function(){\n\t\tvar host = server.address().address;\n\t\tvar port = server.address().port;\n\n\t\tlogger.info(\"Express Server - Server is operational: \" + host + \" \" + port);\n\t});\n\t//Function call to load routes\n\trouteLo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns HTML code of the Instructor Infor container retrieved from user directory
function getInstructorInfo(container) { return container.html(); }
[ "function loadInstructor(icon, body, entry, opens) {\n $.get('/api/instructor/' + icon.instructorId, function (instructor) {\n // Stop if already loaded\n if (!$(body).is(':empty')) return;\n\n var courses = instructor.courses;\n for (var index in courses) {\n var course = courses[index]\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
================================================================================ Function to enhance any select element into an accessible autocomplete (by id) ================================================================================
function enhanceSelectIntoAutoComplete(selectElementId, dataSource, submitOnConfirm = false) { selectElementId = selectElementId.replace( /(:|\.|\[|\]|,|=)/g, "\\$1" ) let selectElementName = selectElementId.replace( /(\_)/g, "\." ) accessibleAutocomplete.enhanceSelectElement({ selectElement: docume...
[ "function addToAutoComplete(name, id, title){\r\n\t\tif(title == null || title.length == 0 )\r\n\t\treturn;\r\n\t\ttitle= title.split('-')[0];\r\n\t\tif(getById(name + 'Select')){\r\n\t\t\tif(isIE()){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tvar selElm = getById(name + 'Select');\r\n\t\t\t\t\tvar x = selElm.outerHTML.replace(s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the function which starts method playComp of class Game
function startPlayComp() { startModule.game.playComp(startModule.game, startModule.deck, startModule.person1, startModule.person2, startModule.table, 'tableHtml', 'person1', 'person2', socket); }
[ "function playGame() {\n setComputerChoice();\n compare();\n}", "startCompetition() {\n this.gameStarted = true;\n this.pause = false;\n }", "startGame() {\n this.startPart();\n }", "plays(_game) {\n this.game = _game\n }", "function startGame() {}", "function playingGame(){\n\t// c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chech if all players have submitted an answer
function allAnswered() { var allAnswered = true; for (let player of game.players) { if (!player.answered && !player.czar) { // still waiting on answer allAnswered = false; } }; return allAnswered; }
[ "function isPlayerAnsweredAllQuestions() {\n return gameState.answerListByPlayer.length === gameState.questionListBySystem.length;\n }", "function end_ques_on_all_input(){\r\n\r\n console.log(\"Contacts:\" +contacts.length +\"Passed:\" + passed_users.length);\r\n \r\n if (contacts.length + pa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
View record details in the form (not editable).
function viewRecord(id, callbackWhenFinished) { editRecord(id, true, callbackWhenFinished); }
[ "get record() {\n return this.form.record;\n }", "function detail(record){\n storageData.currentdata=record;\n modalDetail.ModalInstance();\n }", "viewCurrentRecord(currentRow) {\r\n this.bShowModal = true;\r\n this.isEditForm = false;\r\n this.record = currentRow;\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Zeina Accordion Written specially for Zeina Theme
function zeinaAccordion(selector) { $(document).on('click', selector + ' .accordion-row .title,' + selector + ' .accordion-row .open-icon', function() { var me = this, accordion = $(this).parents('.accordion'), $prev, $accRow = $(this), $accT...
[ "function loadAccordions() {\r\n\r\n\r\n var mainAccordion = new accordion('content_main',{\r\n resizeSpeed : 15,\r\n\r\n defaultSize : {\r\n height:75\r\n }\r\n });\r\n\r\n // var VerticalAccordion = new accordion('vertical_container', {\r\n\r\n /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a polyline connecting the source and destination airports
generatePolyline() { return new google.maps.Polyline({ path: [this.sourceAirport.latLng, this.destinationAirport.latLng], geodesic: true, strokeColor: "rgb(255, 155, 0)", strokeOpacity: 1, strokeWeight: 2 }); }
[ "function createRoute(start) {\n //Get the path to generate\n if (path.length === 0 || start.properties.name !== path[0]) {\n path = findShortestPath(start.properties.name, destination.properties.name).path;\n }\n let endNode;\n\n //console.log(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The expectations for a message
function testMessageContent(message){ //should be these properties var keys = [ 'id', 'guid', 'parentmessage', 'groupid', 'userid', 'user', 'messagetext', 'createdtime', 'timestamp' ]; expect(message).to.contain.keys(keys); //and the right number...
[ "function expectMessage(el, message) {\n var ariaDescribedBy = el.getAttribute('aria-describedby');\n expect(ariaDescribedBy).toBeDefined();\n var cdkDescribedBy = el.getAttribute(index_1.CDK_DESCRIBEDBY_HOST_ATTRIBUTE);\n expect(cdkDescribedBy).toBeDefined();\n var messages = ariaDescribedBy.split('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Asynchronously invoke all OnChanged methods automatically called when value is set
async InvokeChanged(){ await Promise.all(this._onChanged.map(func => func(this._value))) }
[ "notifyValueChange() {\n this.setInputValue();\n }", "OnValueChanged() {\n this._dirty = true;\n }", "OnValueChanged()\n {\n this._dirty = true;\n }", "OnValueChanged() {\n this._dirty = true;\n\n if (this._onModified) {\n this._onModified(this);\n }\n }", "_dochang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the reading progress lines of post.
function readProgress() { var $post = $('.main-content'); var scrollH = ($post[0] && $post[0].getBoundingClientRect().top * -1) || 0; var percent = parseInt((scrollH / Math.abs(($post.height() - $(window).height()))) * 100); percent = percent > 100 ? 100 : percent < 0 ? 0 : percent; ...
[ "function readProgress () {\n // Not on post page.\n if ($('#is-post').length === 0) {\n return\n }\n\n var $post = $('.content')\n var postTop = $post.offset().top\n var postEndTop = 0\n var postEndHeight = 0\n var postReadingHeight = 0\n var isEnablePostEnd = false\n var percent...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
===================== Shipment Header Begin =====================
function InitShipmentHeader() { bkgBuyerSupplierDirectiveCtrl.ePage.Masters.Address = {}; bkgBuyerSupplierDirectiveCtrl.ePage.Masters.AutoCompleteOnSelect = AutoCompleteOnSelect; bkgBuyerSupplierDirectiveCtrl.ePage.Masters.SelectedLookupData = SelectedLookupData; bkgBuyer...
[ "function InitShipmentHeader() {\n bkgBuyerForwarderDirectiveCtrl.ePage.Masters.Address = {};\n bkgBuyerForwarderDirectiveCtrl.ePage.Masters.AutoCompleteOnSelect = AutoCompleteOnSelect;\n bkgBuyerForwarderDirectiveCtrl.ePage.Masters.SelectedLookupData = SelectedLookupData;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds page type as body class.
function addPageTypeAsBodyClass() { document.body.classList.add(`${window.blog.pageType}-page`); }
[ "function manageBodyClasses() {\r\n if($_body.hasClass(\"js-no-ajax\")) {\r\n $_body.addClass($(\".page-main.page-current .page-toload\").attr(\"data-bodyClass\"));\r\n } else {\r\n $_body.removeClass($(\".page-main.page-current .page-toload\").attr(\"data-bodyClass\"));\r\n $_body.addClass($(\".page-mai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add a raw attr (use this in preTransforms)
function addRawAttr (el, name, value) { el.attrsMap[name] = value; el.attrsList.push({ name: name, value: value }); }
[ "function addRawAttr (el, name, value) {\n el.attrsMap[name] = value;\n el.attrsList.push({ name: name, value: value });\n }", "function addRawAttr(el, name, value) {\n el.attrsMap[name] = value;\n el.attrsList.push({\n name: name,\n value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gmaps API extension Polygon getBounds extension googlemapsextensions
function extendGmaps() { if (!google.maps.Polygon.prototype.getBounds) { google.maps.Polygon.prototype.getBounds = function(latLng) { var bounds = new google.maps.LatLngBounds(); var paths = this.getPaths(); var path; for (var p = 0; p < paths.getLength(); p++) { ...
[ "function getPolygonBounds(poly){\n var bounds = new google.maps.LatLngBounds()\n poly.getPath().forEach(function(element,index){bounds.extend(element)})\n return bounds;\n }", "function CreateBoundsPolygon(ne, sw) {\n var x1 = ne.lng();\n var y1 = ne.lat();\n var x2 = sw.lng();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
:note: should attach doOnBlur to window.blur after page is init'ed for first time, or if widnow not focused, then attach focus listener link147928272
function ifNotFocusedDoOnBlur() { // was ifNotFocusedAttachFocusListener if (!document.hasFocus()) { attachFocusListener(); } }
[ "function ifNotFocusedDoOnBlur() { // was ifNotFocusedAttachFocusListener\n\tif (!isFocused(window)) {\n\t\tattachFocusListener();\n\t}\n}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.
function attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { // TODO: Warn if _enabled is false. var nativeEventTarget = getEventTarget(nativeEvent); var targetInst = getClosestInstanceFromNode(nativeEventTarget); if (targetInst !== null) { var nearestM...
[ "function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n // TODO: Warn if _enabled is false.\n return_targetInst = null;\n var nativeEventTarget = getEventTarget(nativeEvent);\n var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (targetInst !== n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
INIT Called when cards CSV has downloaded. Parses the card info into the card UI, gets annyang set up, then adds the keyboard search/filter events
function init(cardData) { var regexpCards = "("; cards = $.csv.toObjects(cardData); cards.forEach(function(card, idx, arr) { add(card["name"], card["type"], card["elixir"]); regexpCards += card["name"] + '|'; }); regexpCards += 'hint)'; var regexp ...
[ "function init() {\n\trequest.csv('data/data.csv', function(error, data) {\n\t\tgraphicData = formatData(data);\n\n\t\trender();\n\t\t$(window).resize(utils.throttle(onResize, 250));\n\t});\n}", "function initialize() {\n var currentCard = $currentCardInput.val();\n var $activeCard = currentCard...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function validates user profile email
function validateEmail() { var x=document.forms["profile"]["email"].value; var atpos=x.indexOf("@"); var dotpos=x.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { alert("e-mail address is not valid"); return false; } }
[ "validateEmail() {\n\n var emailId = this.state.userdata.email;\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(emailId))\n {\n return (true)\n }\n return (false)\n }", "validateUserEmailField(pUserEmail) {\n let validUserEmailField = true...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Traverses the tree in a breadthfirst manner, i.e. in layers, starting at the root node, going down to the root node's children, and iterating through all those nodes first before moving on to the next layer of nodes Applies the given callback to each tree node in the process You'll need the queuehelper file for this. O...
breadthFirstForEach(cb) { const queue = []; queue.push(this); while (queue.length !== 0) { const currentNode = queue.shift(); cb(currentNode.value); if (currentNode.left) queue.push(currentNode.left); if (currentNode.right) queue.push(currentNode.right); } }
[ "traverseBreadthFirst(callback) {\n const queue = [];\n queue.push(this);\n while(queue.length) {\n const current = queue.shift();\n callback(current);\n current.children.forEach(child => queue.push(child));\n }\n }", "traverseBreadthFirst(callback)\n {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attach all required listeners to the JSON parser. This should only be called once.
attachJsonParserListeners() { // Listen to json parser events this.jsonParser.onValue = (value) => { const depth = this.jsonParser.stack.length; const keys = (new Array(depth + 1).fill(0)).map((v, i) => { return i === depth ? this.jsonParser.key : this.jsonParser....
[ "attachJsonParserListeners() {\n // Listen to json parser events\n this.jsonParser.onValue = (value) => {\n const depth = this.jsonParser.stack.length;\n const keys = (new Array(depth + 1).fill(0)).map((v, i) => {\n return i === depth ? this.jsonParser.key : this.j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: toggleCategories Purpose: toggle the display style of elements with the class category Parameters: new display style as string
function toggleCategories(sett) { for (var i = 0; i < categoryStyle.length; i++) { categoryStyle[i].style.display = sett; } }
[ "function toggleCategory() {\n this.classList.toggle(\"active\");\n fetchResources();\n }", "function toggleCategory() {\n $(this).closest('.category').toggleClass('category_SHOW');\n }", "function hideCat(){\n document.getElementById(\"cat\").classList.toggle(\"hideCat\")\n}", "toggleCateg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the Fragment in the main Navigation that is capable if displaying events posted by the chair and create new events.
renderEventFragment() { const personCanPostForChair = this.props.personIsEmployee || this.props.personIsSuperAdmin; return ( <Grid> <Grid.Row columns={2} verticalAlign="middle"> <Grid.Column width={10}> <Header> {i18next.t("chairpage-events-fragment-headline")}</Header>...
[ "function renderEvents() {\n\t$(\"#event-items\").html(\"\");\n\n\tif (show_events) {\n\t\tvar i = 0;\n\t\t// if (eventsLogList.length > 10) {\n\t\t// \ti = eventsLogList.length - 10;\n\t\t// }\n\t\tfor (;i < eventsLogList.length; i++) {\n\t\t\tvar eventsListItem = $(\"#event-template\").clone();\n\t\t\teventsListI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Control connection sent an unexpected request requiring a response from our part. We can't provide that (because unknown) and have to close the contrext with an error because the FTP server is now caught up in a state we can't resolve.
onUnexpectedRequest(response) { const err = new Error(`Unexpected FTP response is requesting an answer: ${response.message}`); this.ftp.closeWithError(err); }
[ "onUnexpectedRequest(response) {\n const err = new Error(`Unexpected FTP response is requesting an answer: ${response.message}`);\n this.ftp.closeWithError(err);\n }", "_handleConnectResponse() {\n return this.ftp.handle(undefined, (res, task) => {\n if (res instanceof Error) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
addExports :: String > String
function addExports(json) { return `module.exports = ${json}` }
[ "addExports(output, entryPointBasePath, exports, importManager, file) {\n exports.forEach(e => {\n let exportFrom = '';\n const isDtsFile = isDtsPath(entryPointBasePath);\n const from = isDtsFile ? e.dtsFrom : e.from;\n if (from) {\n const basePath =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
<< FUNCIONES RELACIONADAS CON EL TIEMPO DE JUEGO / TILE LOGIC Funciones de click on tile
function tileClick() { //le quitamos el eventlistener para no poder hacerle click this.removeEventListener("click", tileClick); //cambiamos clase para mostar la tile this.classList.replace("undigged", "digged") //comprobamos si la tile tiene algun item que mostrar stageMaster[currentPlayerLev...
[ "function tileClick() {\n\tmoveOneTile(this);\n}", "function clickTile() {\n let tileId = this.getAttribute(\"data-id\");\n let image = this.getAttribute(\"src\");\n let tile = tileArray.find(tile => tile.img===image);\n moveTile(tile,tileId);\n}", "function tileClicked(event) {\n\tselectTile(event.target);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform a custom axios request. data is an object containing the following properties: method url data ... request payload auth (optional) username password
customRequest(data) { return axios(data); }
[ "customRequest(data) {\n return axios(data)\n }", "customRequest (data) {\n return axios(data)\n }", "request(data) {\n return axios(data)\n }", "customRequest(data) {\n return axios_default()(data);\n }", "customRequest(data) {\n return Vue.prototype.$axios(data)\n }",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CustomRoom is a functional component. It returns a button to switch the app to "FindingRoom" mode.
function CustomRoom({ setMode, userID }) { //Require login before using this function const customRoom = () => { if(userID===null){ alertify.error('Login first!'); }else { setMode("FindingRoom"); } } return <button className="menuButton" onClick={customRoom}>Custom Room</button> }
[ "selectRoom() {}", "_createRoom() {\n console.log(\"Creating a Room\");\n this.props.navigator.push({\n title: \"Create a Room\",\n component: CreateRoom\n });\n }", "function clickRoom(room) {\n\tvar elem = document.getElementById(ROOM_ID_PREFIX + room);\n\t// var item = findRoomById(room);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies the properties from the given token to this instance.
copyFrom(token) { this.batchID = token.batchID this.vertexID = token.vertexID this.indexID = token.indexID }
[ "setToken(token = null) {\n this.token = token;\n\n\n //this.instance.defaults.headers.common['Authorization'] = _.get(token, '_id');\n }", "setToken(token) {\r\n this._token$.next(token);\r\n }", "initializeUpdateFormWith(token) {\n this.updateTokenForm.name = token.name;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
changes donut jpg depending on hunger stat
function changeDonut() { var star = document.getElementById('donut'); if (hunger === 4) { star.src = "https://res.cloudinary.com/dytmcam8b/image/upload/v1561725898/virtual%20pet/h1.png"; } else if (hunger === 3) { star.src = "https://...
[ "function changeImageUT() {\n\t\t\tthis.src = \"images/thumbsup.png\";\n }", "function updatePicture(char) {\n if (char === 'r') {\n return 'assets/images/rock.png'\n } else if (char === 'p') {\n return 'assets/images/paper.png'\n } else if (char === 's') {\n return 'assets/images/scissors.png'\n }\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Link this item to another item
link(l2){ if (l2 instanceof LinkItem){ this.next = l2; l2.last = this } }
[ "addLink(){\n this.list.addLink(this.name, this.url);\n }", "addLink (item) {\n // make sure something has been entered into the form\n if (this.newLinkText && this.newLinkURL) {\n // add new link to the links field of the given item\n itemsRef.child(item['....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new quaternion vector containing the conjugate of this one.
static conjugateQV(qa) { var qv; qv = this.copyOfQV(qa); return this.setConjugateQV(qv); }
[ "conjugate(target = new Quaternion()) {\n target.x = -this.x;\n target.y = -this.y;\n target.z = -this.z;\n target.w = this.w;\n return target;\n }", "function quatConjugate(quat) {\n return [quat[0],-quat[1],-quat[2],-quat[3]]\n}", "get conjugate() {\n return Complex(this.real, -thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Makes the last array member visible.
showLastElement() { const that = this, settings = []; let xDimension, yDimension; if (that.type === 'none') { return; } if (that.dimensions === 1) { const indexerValue = parseFloat(that._indexers[0].value), cellsCount = that._...
[ "function storeLastVisible(){\n lastVisible.index = visible.index;\n lastVisible.total = visible.total;\n lastVisible.year = visible.year;\n lastVisible.embarked = visible.embarked;\n lastVisible.disembarked = visible.disembarked;\n }", "get lastMarkerVisibility() {\n return thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Iterate through the supplied command directory to populate the commandArr.
initialize() { const commandFiles = requireDir(nonPrefixCommandsPath, { recurse: true }); for (const directory in commandFiles) { for (const file in commandFiles[directory]) { const command = require( `${nonPrefixCommandsPath}/${directory}/${file}` ); if (command instance...
[ "loadCommands() {\n var categories = fs.readdirSync(__dirname + '/commands')\n for(var i in categories) {\n var category = categories[i]\n var commands = fs.readdirSync( __dirname + '/commands/' + category)\n for(var j in commands) {\n var command = comm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns `true` if Juliaclient backend is running and ink is being consumed
isClientAndInkReady () { return client.isActive() && this.ink !== undefined }
[ "function isClient()\n{\n if (!server.IsRunning() && !framework.IsHeadless())\n return true;\n return false;\n}", "isJsControllerRunning() {\r\n debug(\"Testing if JS-Controller is running...\");\r\n return new Promise(resolve => {\r\n const client = new net_1.Socket();\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The identifier of the direction DOWN
static get DIRECTION_DOWN() { return "down"; }
[ "static get DIRECTION_UP() {\n return 'DIRECTION_UP';\n }", "static get DIRECTION_UP() {\n return \"up\";\n }", "static down() {\n\n // Return a Direction pointing towards the ground\n return new Direction([0, -1, 0]);\n }", "*directionVerticalDown() {\n yield this.sendEvent(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a given url is absolute
function isUrlAbsolute(url) { return /^https?:\/\/|^\/\//i.test(url); }
[ "function isAbsolute(path) {\n\t\tvar parts = path.split('/');\n\t\treturn /http:|https:|ftp:/.test(parts[0]);\n\t}", "function isAbsolutePath(href) {\n return constants_1.default.ABS_URL.test(href);\n}", "function isAbsolute(path) {\n if (!path) return false;\n\n return (path[0] == \"/\" || pa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a tileGroup is a winning hand
function checkForWinningHand(tileGroup) { // Hand must have 14 tiles if (tileGroup.length != MAX_HAND_SIZE) { return false; } const markedTiles = Array(MAX_HAND_SIZE).fill(false); return backtrackingCheck(tileGroup, markedTiles, false); }
[ "checkWin(){\n this.red = this.findType('red') // unflipped red tiles\n this.blue = this.findType('blue') // unflipped blue tiles\n // Check team winner\n if (this.red === 0) {\n this.over = true\n this.winner = 'red'\n }\n if (this.blue === 0) {\n this.over = true\n this.win...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion region Listados Funcion principal para generar los listados de productos
function crearListadoProductos(dataProductos) { //Limpiamos el div catalogo para filtrar por etiquetas correctamente $("#divProductosCatalogo").html(""); //Vaciamos la constante productos productos.splice(0, productos.length); if (dataProductos && dataProductos.data.length > 0) { for (let i ...
[ "function listarProductos(){\n\n\t\t//var id = $('.agregarProducto').attr('idProducto');\n\n\t\tvar listaProductos = [];\n\n\t\tvar descripcion = $('.nuevaDescripcionProducto');\n\n\t\tvar cantidad = $('.nuevaCantidadProducto');\n\n\t\tvar precio = $('.nuevoPrecioProducto');\n\n\t\tvar impuesto = $('#nuevoImpuestoV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the list level
getListLevel(list, listLevelNumber) { if (!isNullOrUndefined(list)) { let abstractList = this.viewer.getAbstractListById(list.abstractListId); if (!isNullOrUndefined(list) && abstractList.levels.length <= listLevelNumber && listLevelNumber >= 0 && listLevelNumber < 9) { ...
[ "function getLevel() {\n\t\t\tif ( 'level' in get ) {\n\t\t\t\tlevel = parseInt(get['level']);\n\t\t\t}\n\t\t}", "get get_level () {\n return this._level;\n }", "function getLevel(){\n return level\n}", "get level() {\n let ptr = this.parent;\n let lvl = 0;\n while (ptr) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler for 'wheel' events
function onWheel( tracker, event ) { handleWheelEvent( tracker, event, event, false ); }
[ "function onWheel(tracker,event){handleWheelEvent(tracker,event,event);}", "onMouseWheel(e){}", "function onWheel( tracker, event ) {\n handleWheelEvent( tracker, event, event );\n }", "function onMouseWheel (event) {\n}", "function handleWheel(e){\n if (Math.abs(e.deltaY) <= WHEEL_SENSITIV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the next usable tab index in the specified direction from the current tab. A "usable tab index" takes into account hiddin tabs in Firefox and if use of highlighted/multiselected tabs is enabled, takes that into account as well. tabs: The list of tabs tab: The current tab direction: Either DIRECTION_LEFT or DIRECTIO...
function getNextUsableTabIndex(tabs, tab, direction, indexLimit) { var candidateIndex; for(candidateIndex = tab.index + direction; candidateIndex != (indexLimit+direction); candidateIndex += direction) { if(isHidden(tabs[candidateIndex]) || (!disableTabMultiselect && tabs[candidateIndex].hig...
[ "function getIndexLimitInDirection(tabs, tab, direction) {\n var indexLimit;\n if(tab.pinned) {\n if(direction < 0) {\n indexLimit = getFirstPinnedTabIndex(tabs);\n } else {\n indexLimit = getLastPinnedTabIndex(tabs);\n }\n } else {\n if(direction < 0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove either body or particle from this world. Support removing a range and negative index.
remove(which, index, count = 1) { let param = (index < 0) ? [index * -1 - 1, count] : [index, count]; if (which == "body") { this._bodies.splice(param[0], param[1]); } else { this._particles.splice(param[0], param[1]); } return this; }
[ "removeFromWorld() {\n World.remove(this.world, this.body);\n }", "remove() {\n if (this.world) {\n this.world.removeCollider(this);\n }\n }", "delete() {\n Matter.World.remove(world, this.body);\n }", "onRemoveFromWorld() {\n //game.physicsEngine.world.removeBody(this.physics...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sync controls. Receives data from other users and reconfigures controls to match the settings of the group. Currently only does colors.
function syncControls (palette) { // Sync colors. if (palette.hasOwnProperty('colors')) { var current = 0; $$('.proto').forEach(function (proto) { proto.dataset.color = palette.colors[current++]; setPresetOptions(proto); }); } }
[ "function syncHightlightGUI() {\n // sync user highlight\n for(var key in userDict) {\n var user = userDict[key];\n // check to see what status username selection should be in\n if (user.selectedSocketCount === 0) {\n // deselect\n user.jq...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs an intersection spec from an intersectionInfo object and a given GObj that will be merged to it
function infoToGObjSpec(info, givenGObj) { var newSpec = { kind: "Point", constraint: info.constraint, genus: "Intersection", label: givenGObj.label, style: givenGObj.style }; switch (info.constraint) { case "Intersection": ...
[ "function intersection() {\n var typeSpec = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n typeSpec[_i] = arguments[_i];\n }\n return new TIntersection(typeSpec.map(function (t) { return parseSpec(t); }));\n}", "function insect(name, legs, color, gender, skeleton, bodyshape) {\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
expect the next mask
function expectNext(sequence, recognizers, current) { return expectMask(sequence, recognizers, getNext(sequence, current)); }
[ "setMask(mask) { this.maskBits |= mask; }", "function nextCaretPositionInMask(position, mask)\r\n{\r\n\tvar nextPosition = position;\r\n\r\n\tfor (var i = position + 1; i < mask.length; i++) {\r\n\t\tif (maskSymbols.indexOf(mask.charAt(i)) != -1) {\r\n\t\t\tnextPosition = i;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For each menu item it sets the item.state property item.state is the uirouter state such as "root.administration"
function formMenuState(menuItem, state){ // For root node if(!_.isString(state)){ menuItem.state = AppConfig.get('rootState') + '.' + menuItem.value; } else { menuItem.state = state + '.' + menuItem.value; } if(menuItem.items && menuItem.items.length) { menuItem.item...
[ "populateStates(){\n\t\tlet stateMenuItems = this.state.stateList.map(state => (\n\t\t\t<MenuItem value={state.name} key={state.id}>{state.name}</MenuItem>));\n\t\tthis.setState({ stateMenuItems: stateMenuItems });\n\t}", "function update_menu_state (state) {\n\tcurrent_menu_state = state;\n}", "includeMenuComp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns u times k
function mult2d(u, k) { return [u[0]*k, u[1]*k] }
[ "v_kmult(v, k){\n for(let i = 0; i < v.length; ++i){ v[i] *= k; }\n\t\treturn v;\n }", "v_kpow(v, k){\n for(let i = 0; i < v.length; ++i){ v[i] = Math.pow(v[i], k); }\n\t\treturn v;\n }", "m_kmult(m, k){\n for(let i = 0; i < m.length; ++i){\n for(let j = 0; j < m[0].length;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests whether two traits are equivalent. T1 is equivalent to T2 iff both describe the same set of property names and for all property names n, T1[n] is equivalent to T2[n]. Two property descriptors are equivalent if they have the same value, accessors and attributes.
function eqv(trait1, trait2) { var names1 = getOwnPropertyNames(trait1); var names2 = getOwnPropertyNames(trait2); var name; if (names1.length !== names2.length) { return false; } for (var i = 0; i < names1.length; i++) { name = names1[i]; if (!trait2[name] || !isSameDesc(trait...
[ "function testEqv(trait1, trait2, id) {\n QUnit.test(id, function(assert) {\n var names1 = getOwnPropertyNames(trait1);\n var names2 = getOwnPropertyNames(trait2);\n var name;\n assert.strictEqual(names1.length, names2.length,\n id+': traits declare same amount of properties'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event handlers for SharedObject component // Called directly on component load to pass back shared object information
handleSetSharedObjectDetail(event) { //console.log('handling handleSetSharedObjectDetail event ',event.detail); this.sharedObject = event.detail; // Fire event for create component to disable button const evt = new CustomEvent('sharedobjectselected'); this.dispatchEvent(evt); ...
[ "handleSetSharedObjectDetail(event) {\n this.sharedObjectDetail = event.detail;\n\n // Fire event for create component to enable save button\n const evt = new CustomEvent('enablesave');\n this.dispatchEvent(evt);\n\n this.rule.objectSharedAPIName = this.sharedObjectDetail.objectAp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! AMENDMENT TRANSFERS AND LEDGER ENTRIES file_end_check boolean argument instructing function of dayend/fileend condition
function amendment_check(file_end_check) { let ID_tracker = -1; for (const key in Accounts) { // Used to apply correct AccountID to amendment ledger entries ID_array = Object.keys(Accounts); ID_tracker++; amendment_ID = Number(ID_array[ID_tracker]); // * SAVINGS to CUR...
[ "_isEndOfFile () {\n return this._index >= this._text.length;\n }", "function checkEndIntroductions() {\n let pathLength = getPersonalityPath().length;\n let files = getFileOrCreate(getPersonalityPath() + PATH_SEPARATOR + 'Session' + PATH_SEPARATOR + 'End' + PATH_SEPARATOR + 'EndIntroductions').listFile...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. get the maxheight of the visible slides 2. set transitionDuration to speed 3. update inner wrapper height to maxheight 4. set transitionDuration to 0s after transition done
function updateInnerWrapperHeight(){var maxHeight=autoHeight?getMaxSlideHeight(index,items):getMaxSlideHeight(cloneCount,slideCount);if(innerWrapper.style.height!==maxHeight){innerWrapper.style.height=maxHeight+'px';}}// get the distance from the top edge of the first slide to each slide
[ "function updateInnerWrapperHeight () {\n var heights = [], maxHeight;\n for (var i = index; i < index + items; i++) {\n heights.push(slideItems[i].offsetHeight);\n }\n maxHeight = Math.max.apply(null, heights);\n\n if (innerWrapper.style.height !== maxHeight) {\n if (TRANSITIONDURATION) { ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets a blend mode, ensuring that it is valid.
function getBlendMode(name) { if (!name) return pixi.BLEND_MODES.NORMAL; name = name.toUpperCase(); while (name.indexOf(' ') >= 0) { name = name.replace(' ', '_'); } return pixi.BLEND_MODES[name] || pixi.BLEND_MODES.NORMAL; }
[ "get blendMode() {\r\n if (this._colorFilter) return this._colorFilter.blendMode;\r\n return this._blendMode;\r\n }", "function getBlendMode(name) {\n if (!name)\n return pixi_js__WEBPACK_IMPORTED_MODULE_0__[\"BLEND_MODES\"].NORMAL;\n name = name.toUpperCase();\n w...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
will scan through all calendar days in the store and save references to special ones to the properties, for speedup
clearCache() { const me = this; if (me.suspendCacheUpdate > 0) return; me.holidaysCache = {}; me.availabilityIntervalsCache = {}; const daysIndex = (me.daysIndex = {}), weekAvailability = (me.weekAvailability = []), nonStandardWeeksStartDates = (me.nonStandardWeeksStartDates = []), ...
[ "function getAllDays() {\n for (var x = 0; x < self.dates.length; x++) {\n for (var z in self.dates[x]) {\n self.allDays.push(self.dates[x][z]);\n }\n }\n }", "initializeDaysInCalendar() {\n const noOfDays...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an object of route parameters in `url`. If the URL doesn't match those supported by Websockets, it returns `null`.
function parseRoute(url) { var parsed = LIST_MACHINES_RE.exec(url); if (parsed) { return { dataCenter: parsed[1], user: parsed[2], id: null }; } parsed = GET_MACHINE_RE.exec(url); if (parsed) { return { dataCenter: parsed[1], user: parsed[2], id: parsed[3] ...
[ "static parseRoute(routeUrl) {\n\t\tlet piecesArr = [];\n\t\trouteUrl.split('/').forEach(piece => {\n\t\t\tpiece = piece.trim();\n\t\t\tif (piece[0] === ':') {\n\t\t\t\tpiecesArr.push({ type: 'parameter', name: piece.substr(1) });\n\t\t\t} else if (piece.length > 0) {\n\t\t\t\tpiecesArr.push({ type: 'text', value: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggle a boolean conf for this page
function toggleConfBool(conf, defval){ var val = confBool(conf, defval, undefined, true); setData(conf, val ? '0' : '1'); return !val; }
[ "toggle() {\n if(this.enabled)\n this.enabled = false;\n else this.enabled = true;\n }", "function toggleSettingsRedirect() {\r\n shouldRedirect = !shouldRedirect;\r\n $(\"#settingsRedirectCheck\").prop(\"checked\", shouldRedirect);\r\n}", "function toggleConfShowButtons(){\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given n and firstNumber, find the number which is written in the radially opposite position to firstNumber. Example For n = 10 and firstNumber = 2, the output should be circleOfNumbers(n, firstNumber) = 7.
function circleOfNumbers(n, firstNumber) { let half = n/2; let result = firstNumber + half; if(result > (n-1)){ result = result - n; } return result; }
[ "function circleOfNumbers(n, firstNumber) {\n const diff = n / 2;\n let opposite = 0;\n\n if (firstNumber < diff) {\n opposite = firstNumber + diff;\n } else if (firstNumber > diff) {\n opposite = firstNumber - diff;\n } else {\n opposite = 0;\n }\n return opposite;\n}", "function circleOfNumbers(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a singular building and the correct latitude and longitude and updates the building.
function updateBuildingWithLatLon(newLat, newLon, id) { const newLatLonObject = {'latitude': newLat, 'longitude': newLon}; try { BuildingsAccessObject.update(id, { $set: newLatLonObject }); } catch (error) { throw new Error("Invalid latitude or longitude"); } }
[ "changeGeoLocation(lat, long) {\n\t\tthis.lat = lat;\n\t\tthis.long = long;\t\t\n\t}", "changeLocation(lat, lon){\n this.lat = lat;\n this.lon = lon;\n }", "searchCoordUpdate(searchCoord, lat) {\n\t\tthis.setState({\n\t\t\tsearchCoord: searchCoord\n\t\t})\n\t\tthis.getPlaceseData(this.state.searchCoord);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a radio input with a label after it, connects them (Yeah, accessibility!), and assigns them under parent
function createRadioInput(parent, id, name, value, labelText, def) { var telem = document.createElement("label"); telem.setAttribute("for", id); telem.innerHTML = labelText; var telem2 = document.createElement("input"); telem2.type = "radio"; telem2.id = id; telem2.name = name; telem2.va...
[ "function radio(el, value, label) {\n // UNDONE: template\n \n if (label.charAt(0) != ' ') label = ' '+label;\n var input = \"<input type='radio' name='\" + name + \"' value='\" + value + \"'>\";\n el.append(input, label, \"<br>\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates counter value depending on input
function update(msg, counter){ //Adds a unit to the counter value if (msg === "+"){ return (counter+1); } //Subtracts a unit to the counter value else if (msg === "-"){ return (counter-1); } //q to quit else if (msg === "q"){ process.exit(0); } //Invalid input, nothing happens to counter value else{ return co...
[ "function Counter(value) {}", "function changeBy(val){\r\n \r\n counterValue=counterValue+val;\r\n }", "function updateScoreCounter(value){\n totalScore += value;\n updateHTML();\n checkWinLose();\n}", "function incrementCounter() {\n model.counter.set('value', model.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Translate static models if surpassed by the player
function translateStaticModels(zPosPlayer) { let surpassDistance = 80; let respawnDistance = 1400; if (environment == environments.COUNTRY || environment == environments.HIGHWAY) respawnDistance = 1000; for (const model of Object.values(staticModels...
[ "function addStaticModels() {\r\n for (const model of Object.values(staticModels)) {\r\n const modelScene = model.gltf.scene;\r\n\r\n // Crosswalks and clouds don't have some parameters (they aren't gltf)\r\n if (!model.position)\r\n continu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all parts info with positions
getPartsInfoWithPositions() { //models dictionary var dict = { "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YXV0aGQtdmdvOXRudzI2a3dpaW5lZWVuc2t0YWUxZnVxejI3dnctNHY2LWM1NzE1NDQ2MWUxMDdjY2Q5OTcyZmM0ZWEwM2UzNTdjMzExOGQ1ZjUvTmV3JTIwU2luZ2xlJTIwRG9vciUyMChMZWZ0KSUyMDgwMCUyMDIwMDAuaWFtLnppcA": "Door", ...
[ "getPositions(fractional = false) {\n let positions = [];\n let atoms = this.atoms.children;\n let nAtoms = atoms.length;\n if (fractional) {\n for (let i = 0; i < nAtoms; ++i) {\n let atom = atoms[i];\n let position = this.toScaled(atom.position....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parses minutes into a readable date string.
function parseMinutes( mins ) { var days = Math.floor( mins / 60 / 24 ); mins = mins - (days * 60 * 24); var hours = Math.floor( mins / 60 ); var minutes = mins - (hours*60); var dateString = days; dateString += (days == 1) ? " day, ":" days, "; dateString += hours; dateString += (hours == 1) ? " hour, ":" hou...
[ "humanizeMinutes(minutes, start_at_hours) {\n var days, hours, humanized_effort, show_minutes, unit;\n humanized_effort = \"\";\n start_at_hours = start_at_hours || false;\n if (minutes != null) {\n minutes = parseInt(minutes);\n if (!isNaN(minutes)) {\n if (!start_at_hour...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generic method used to generate all entities involved in the game. Parameters: player true or false flag that defines if an entity is a player or enemy bull true or false flag that defines whether bulk entity generation is required x,y coordinates of the starting position of each entity path image path of the entity sp...
generateEntities(player,bulk,x,y,path,speed) { if (player) { // generating single players return new Player(x,y,path,speed); } else { if (bulk) { // generating multiple enemies var val = 1; /*reassigning this as the reference is lost within functions*/ ...
[ "function SetUpEntities () {\n\t\n\tplayer = new Entity(\"Player\", \"player\", \"#00FFFF\", 17, 17);\n\tplayer.isClient = true;\n\tcameraX = player.x + 0.5;\n\tcameraY = player.y + 0.5;\n\t//cameraZ = player.z;\n\ttargetX = player.x + 0.5;\n\ttargetY = player.y + 0.5;\n\t//targetZ = player.z;\n\tpromptMessage = ne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Migrate settings from older versions to newer versions.
_migrate_settings(settings) { // Migrate required information over to the new settings. let collection = ""; if (typeof (settings.sceneCollection) !== "undefined") { collection = String(settings.sceneCollection); delete settings.sceneCollection; } if (typeof (settings.sceneId) !== "undefined") { de...
[ "function migrateLegacySettings()\n {\n function Old_Settings()\n {\n var defaults = {\n debug_logging: false,\n youtube_channel_whitelist: false,\n show_context_menu_items: true,\n show_advanced_options: false,\n display_stats: true,\n display_menu_stats: true,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a year day out of the given week number.
function getDayFromWeek(week, year, weekday, utc) { if (weekday === void 0) { weekday = 1; } if (utc === void 0) { utc = false; } var date = new Date(year, 0, 4, 0, 0, 0, 0); if (utc) { date.setUTCFullYear(year); } var day = week * 7 + weekday - ((date.getDay() || 7) + 3); return day...
[ "function Year(num, sWeekday){\n\n}", "static fromWeekOfYear(year, weekOfYear, time) {\n time[0] = year;\n var day = TimeUtil.dayOfWeek(year, 1, 1);\n var doy;\n if (day < 4) {\n doy = (weekOfYear * 7 - 7 - day) + 1;\n if (doy < 1) {\n time[0] = tim...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the analysis parameter of the moisture when the user changes the drop down menu
function moistureSelect(analysis_params) { var myList=document.getElementById("myMoisture"); analysis_params.moisture = myList.options[myMoisture.selectedIndex].value; return analysis_params }
[ "function onChangeAnalysisUnitHandler() {\n currentAnalysisUnit = wemsAnalysisVM.selectedAnalysisUnit;\n switch (wemsAnalysisVM.selectedAnalysisUnit) {\n case \"kW\":\n currentFactor = 1;\n break;\n\n case \"won\":\n currentFactor = co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
====================================================================== ====================================================================== [S07251664|A01_DIrectory_01.txt::DRC1: CLS_add_expense_page.render ^B] [ DEF1: CLS_add_expense_page.render ^B]
render () { return ( <div> {/* // SEC_017 --- 176. Styling Expense Form 13:19 */} <div className="primary-page-header"> {/* [S07251678|_page-header.scss::.primary-page-header css2;^B] */} <div className="content-container"> {/* [S07251678|_content-container.scss::.content-cont...
[ "function drawAddExpensePanel()\n{\n addExpensePanel = new AddTransPanel(\"addExpensePanel\", \"Expense\", recentExpData, expCategoryData);\n addExpensePanel.drawPanel();\n}", "function createPlanPageLogic (){\n var action = pageContent.querySelector(\"#actions\"),\n partialDOM = document.createElement(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run the specified ruleSet
function runRuleSetAsync(ruleSet, context) { return ruleSetExecutor.runRuleSetAsync(ruleSet, context || getDocumentElement()); }
[ "function RuleSet (language) {\n let data = englishRuleSet\n DEBUG && console.log(data)\n switch (language) {\n case 'EN':\n data = englishRuleSet\n break\n case 'DU':\n data = dutchRuleSet\n break\n }\n if (data.rules) {\n this.rules = {}\n const that = this\n data.rules.for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
absolutely position the menu in context of the target
function setMenuPosition(target) { var position = utils.getPosition(target), menuNode = this.menuNode; menuNode.style.display = 'block'; menuNode.style.left = position.x + "px"; menuNode.style.top = position.y + "px"; }
[ "function setMenuPosition(){\n const clientRect = range.getBoundingClientRect();\n const menu = texthighlight.querySelector(\"#contextmenu\");\n menu.style.left = clientRect.left + \"px\";\n const position =(clientRect.bottom - clientRect....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Table Body component that is wrapped around the table rows for each employee
function TableBody() { // importing store to grab employee data and mapping through each employee to display their information const { store } = useContext(EmployeeContext); return ( <tbody> {store.selectedEmployees.map((employee, i) => <TableRow key={i} ...
[ "makeTableBody() {\n var rows = [];\n for (var row = 1; row <= 9; row++) {\n \n // Each row consists of array of cells\n var cells = [];\n \n // The first cell of the row is the header\n cells.push(<Cell key={row+'.'+0} isHeader={true} rowId={row} mouseLoc={this.state.highlight} ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stop webclient (log out)
function stop_webclient() { // Disconnect XMPP active911.gps=null; active911.timer_controller.remove_all(); active911.xmpp.disconnect(); active911.xmpp=null; // Show the login form $("#loading_area").hide(); $("#client_area").hide(); $("#register_area").slideDown(); }
[ "function stopClient() {\n console.log(\"Timeout, closing connection automatically...\");\n HSLclient.end();\n}", "stop() {\n\t\tif (this.connection) {\n\t\t\tthis.connection.close();\n\t\t\tlog.debug('WebSocket client disconnected from ' + this.params.url);\n\t\t}\n\t}", "stop()\r\n {\r\n try \r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exculde URL status Which is checking the referrer URL is matching with any of the URL from given list Exclude URL's. If no, then show the invitation else not.
function checkExcludeURLStatus() { var excludeStatus = false, urls = settings.excludeURL, len = urls.length, i = -1, href = document.referrer; while (++i < len && !excludeStatus) { if (url_check_equals(urls[i], href)) { exclude...
[ "function callback(result){\n exemptionlist = result.exemptions;\n if (exemptionlist.includes(window.location.href)){\n pageAllowed = false;\n } else{\n pageAllowed = true;\n }\n}", "function isInExcludedList(url){\n return excludedRouteList.find(excludeRoute => url.includes(excludeRoute));\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cette fonction retrourne les chiffre d'une colomne
function chiffresColomne(colomne,grille){ let chiffresDeLaColomne = []; for(let ligne of grille){ chiffresDeLaColomne.push(ligne[colomne]); } return chiffresDeLaColomne; }
[ "function getCibles(tool, cellVise){ // leek se trouvant dans la L'AOE de l'arme\n\tvar from, orientation;\n\tif(typeOf(cellVise) == TYPE_ARRAY){\n\t\tfrom = cellVise['from'];\n\t\torientation = cellVise['orientation'];\n\t\tcellVise = cellVise['cell'];\n\t\tif(!(cellVise !== null && orientation != null && from !==...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
WoDUiGemDropDownElement: End / WoDUiGemDropDownSelectable: Begin
function WoDUiGemDropDownSelectable( parentIsInline ) { WodUiWidget.call(this, 'div') this.setClass('gemselect selectable'); this.parentIsInline = parentIsInline this.options = new Array(); this.selectedIndex = 0; }
[ "function WoDUiGemDropDown( socketLabel, isInline ) {\n\n WodUiWidget.call(this, 'div')\n\n this.selectedIndex = 0;\n this.click = false;\n this.socketLabel = socketLabel\n\n this.isInline = isInline\n\n var cssClass = isInline\n ? 'gemselect main inline'\n : 'g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the input samples to the input buffer.
function addShortSamplesToInputBuffer( samples, numSamples) { if(numSamples == 0) { return; } enlargeInputBufferIfNeeded(numSamples); move(inputBuffer, numInputSamples, samples, 0, numSamples); numInputSamples += numSamples; }
[ "function addSampleToRecording(inputBuffer) {\n var currentBuffer = inputBuffer.getChannelData(0);\n\n if (recording == null) {\n // handle the first buffer\n recording = currentBuffer;\n } else {\n // allocate a new Float32Array with th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CHECK FIRST LETTER CAPITLIZED task: make a function that, given a string, determines if the 1st letter is capitalized or not input: 'Fruit' output: true input: 'fruit' output: false this doesn't work
function checkFirstLetterCapitalized( word ){ if(word[0] === word[0].toUpperCase()){ return true; } else { return false; } }
[ "function checkFirstLetterCapitalized( word ){\n\n}", "function isCapital(letter) {\n\n}", "function hasCapitalLetter(input) {\n for (var i = 0; i < input.length; i++) {\n if (input[i] === input[i].toUpperCase()) {\n return true;\n }\n }\n}", "function is_capitalized(word) {\n const firstChar = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a natural TeX string for the polylogarithmic expression (n^k log^i n).
function formatPolyLog(k, i) { // Process n^k var result = null; if (typeof k === 'number') { if (k === 0 && i !== 0) result = ''; else if (k === 0 && i === 0) result = '1'; else if (k === 0.5) result = '\\sqrt{n}'; else if (k === 1) result = 'n'; else k = k.toString(); } if (result !== nu...
[ "function formatPolyLog(k, i) {\r\n\t// Process n^k\r\n\tvar result = null;\r\n\tif (typeof k == \"number\") {\r\n\t\tif (k == 0 && i != 0)\r\n\t\t\tresult = \"\";\r\n\t\telse if (k == 0 && i == 0)\r\n\t\t\tresult = \"1\";\r\n\t\telse if (k == 0.5)\r\n\t\t\tresult = \"\\\\sqrt{n}\";\r\n\t\telse if (k == 1)\r\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a specific component in the global Gradeable (see GradeableComponent.php/getGradedData())
function getComponent(c_index) { return grading_data.gradeable.components[c_index - 1]; }
[ "function getGradeable() {\n if (typeof(grading_data) === 'undefined' || grading_data === null){\n return null;\n }\n return grading_data.gradeable;\n}", "getComponent(name) {\n return (this._nextDict[name] || [undefined])[0];\n }", "getComponent(name) {\n const hasComponent = this.ha...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets all the Categories from the Database and displays them in the HTMLCode
function GetDBCategories(){ if (!window.openDatabase) { alert('Databases are not supported in this browser.'); return; } $('.category').html(''); db.transaction(function(tx) { var innerJoin = ''; var where = ''; if (loggedInUser != 1){ innerJoin = ' LEFT JOIN UserLessons ON Lesson.Lesson...
[ "async function showCategories() {\n const res = await axios.get(`${MD_BASE_URL}/categories.php`);\n $('<div class=\"col-10\"><h3 class=\"title text-center\">CATEGORIES</h3></div>').appendTo($cateList);\n for (let cate of res.data.categories) {\n generateCatHTML(cate);\n }\n }", "function render...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }