query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
code TODO: new_added_naats_bookmarkCtrl | controller_by_user controller by user
function controller_by_user(){ try { $ionicConfig.backButton.text(""); } catch(e){ console.log("%cerror: %cPage: `new_added_naats_bookmark` and field: `Custom Controller`","color:blue;font-size:18px","color:red;font-size:18px"); console.dir(e); } }
[ "function controller_by_user(){\r\n\t\ttry {\r\n\t\t\t\r\n$ionicConfig.backButton.text(\"\");\t\t\t\r\n\t\t} catch(e){\r\n\t\t\tconsole.log(\"%cerror: %cPage: `post_bookmark` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\r\n\t\t\tconsole.dir(e);\r\n\t\t}\r\n\t}", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes this class by creating an instance of the Gadget Adapter. If the Gadget Adapter assembly is not yet retistered, the corresponding registry values are added to register the Gadget Adapter. (i.e. runtime registration)
function Initialize() { // Check if the gadget adapter needs to be registered if(InteropRegistered() == false) { // Register the adapter since an instance couldn't be created. RegisterGadgetInterop(); } // Load an instance of the Gadg...
[ "function RegisterGadgetInterop()\r\n {\r\n try\r\n {\r\n // Full path to the Gadget.Interop.dll assembly\r\n var fullPath = System.Gadget.path + assemblyStore;\r\n var asmPath = fullPath + assemblyName;\r\n \r\n // Register the interop assembl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test DB state after update and reload
function testPostUpdateState (cb) { d.find({}, function (err, docs) { var doc1 = _.find(docs, function (d) { return d._id === id1; }) , doc2 = _.find(docs, function (d) { return d._id === id2; }) , doc3 = _.find(docs, function (d) { return d._id === id3; }) ; ...
[ "function testPostUpdateState (cb) {\n d.find({}, function (err, docs) {\n var doc1 = _.find(docs, function (d) { return d._id === id1; })\n , doc2 = _.find(docs, function (d) { return d._id === id2; })\n , doc3 = _.find(docs, function (d) { return d._id === id3; })\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store the data returned by the most recent callback
function generalCallback(data) { lastValue = data; }
[ "function generalCallback(data) {\n lastValue = data\n }", "function processCallback(callback){\n if(callback.sequence == currentSequence()){ //they're up to date, add them to the listeners pool to wait for new data\n callbacks.push(callback)\n } else { //they're out of date, run ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================================================================= PLAYING ============================================================================= Detailed description can be found in Section 5.1 Reservoir Calculation in the SIGCOMM Submission The purpose of Reservoir: the accumulate enough buffer so t...
function _getReservoirCalculationFromFragments(stream, streamingIndex) { var _bbconfig = config.bufferBased; //configurable QoE nobs var _maxReservoirSizeMilliseconds = _bbconfig.maxReservoirSizeMilliseconds, _minReservoirSizeMilliseconds = _bbconfig.minReservoirSizeMilliseconds, _reservoirL...
[ "function Reservoir(){var bs;this.setModules=function(_bs){bs=_bs;};this.ResvFrameBegin=function(gfp,mean_bits){var gfc=gfp.internal_flags;var maxmp3buf;var l3_side=gfc.l3_side;var frameLength=bs.getframebits(gfp);mean_bits.bits=(frameLength-gfc.sideinfo_len*8)/gfc.mode_gr;/**\n * <PRE>\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map a socket message to the router
function mapRoute (messageName) { socket.on(messageName, function (socketReq, callback) { sails.log.verbose('Routing message over socket: ', socketReq); callback = callback || function noCallback(body, status) { sails.log.error('No callback specified!'); }; var verb = getVerb(socketRe...
[ "function mapRoute (messageName) {\n\t\t\tsocket.on(messageName, function (socketReq, callback) {\n\t\t\t\tsails.log.verbose('Routing message over socket: ', socketReq);\n\n\t\t\t\tvar verb = getVerb(socketReq, messageName);\n\n\t\t\t\t// Translate socket.io message to an Express-looking request\n\t\t\t\tinterpret(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the full property name. The full property path, excluding the schema name is returned. i.e. the referenced property "cell_line.cell_morphology.cell_size" returns a property name of "cell_morphology.cell_size".
function getPropertyName(propertyPaths) { const [, ...propPaths] = propertyPaths; return propPaths.join("."); }
[ "get propertyPath() {}", "function getPropertyName(sPath) {\n\t\t\t\tvar aParts, sPropertyName;\n\t\t\t\tif (sPath.indexOf(\"/\") !== -1) { // sPath contains at least one navigation property\n\t\t\t\t\taParts = sPath.split(\"/\");\n\t\t\t\t\tsPropertyName = aParts.pop(); // the last one will be the property name\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update array with artworks
setArtworks(state, artworks) { state.artworks = artworks; }
[ "function updateTrackArray() {\r\n dataHolder.mapTracks(function (container, i) {\r\n container.track.updatePos(i);\r\n });\r\n }", "function updateChartArrays() {\n for (var i = 0; i < fullCatalogue.length; i++) {\n // look at our songs array, look at each object, look at the song...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stop copy of content
function killCopy(e){ return false }
[ "clearCopy() {\n copyText('');\n }", "stop() {\n this.contentMap.forEach((val, filePath) => {\n if (!this.overrides.has(filePath)) {\n fs.unlinkSync(this.getAbsPath(filePath));\n }\n });\n }", "resetCopied() {\n this.set('copied',false);\n this.set...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Below method is used for incrementing the count of line items array
addLineItem(){ this.setState({ lineItems: this.state.lineItems + 1 }); this.state.lineItemsArray.push({id: this.state.lineItems, desc: "", amount: 0}); }
[ "_incLineCount(consumedText) {\n this._lineNum += util.countSubstring(consumedText, '\\n');\n }", "advanceCurrentItem() {\n this.itemCounter++;\n }", "function refreshLineCount() {\r\n\t\tvar innerTable;\r\n\t\tfor (var i = 0; i < codeTable.rows.length; i++) {\r\n\t\t\tinnerTable = codeTable.r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete all readings for a device
function deleteAllSigfoxReadings(req, res, next) { //res.json("Dummy Controller!") var input = req.swagger.params var deviceID = input.deviceID.value sigfoxDAO.deleteAllReadings(deviceID) .then(x => { res.json(x) }) .catch(err => { res.json(err) }) }
[ "async function deleteSensors() {\n let deletePromises = [];\n for(let dev of config.devices) {\n let p = rp({\n method: 'DELETE',\n uri: dev.host + \":\" + dev.port + \"/api/sensor\"\n }).then((result) => {})\n .catch((err) => {\n console.log(err);\n });\n deletePromises...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get values from input fields in 'new project' window
function getProjectName() { return document.getElementById("userProjNameInput").value; }
[ "function addButtonClick() {\n\tname = $('body > div.project form.project input.name').val();\n\tdescription = $('body > div.project form.project input.description').val();\n\taddProject(name, description);\n}", "function newProjectForm(fields){\n elementCreator('submit','button', projectForm, 'Save')\n let sub...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will fetch all the path(hash) available in link The implementation is nearly identical to jQuery's
function getPaths($) { return $(".link") .map(function (i, elem) { return $(this).attr("href"); }) .get(); }
[ "_getHrefFromLocation(){// path, query hash\nlet href=this._location.path;if(0<this._location.query.length){href+=`?${this._location.query}`}if(0<this._location.hash.length){href+=`#${this._location.hash}`}return href}", "function extractPaths(data){\n\t\n\tvar regexp = /href=\"([^\\.:]+?)\"/g;\n\tvar path;\n\twh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
starts the specified loader
initLoader(loaderName) { loaderName = true; }
[ "function GoLoader() {}", "_preload() {\n const preloader = new Preloader();\n preloader.run().then(() => {\n this._start();\n });\n }", "register( loader ) {\n this.loaders.set( loader.name, loader )\n }", "function LoadManager() {}", "function LoadManager(){}", "function LoaderBase() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts the current Hijri date to Gregorian.
toGregorian(hDate) { const hYear = hDate.year; const hMonth = hDate.month - 1; const hDay = hDate.day; let gDate = new Date(GREGORIAN_FIRST_DATE); let dayDiff = hDay - 1; if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) { for (let y = 0; y < hYear - HIJRI_BEGIN...
[ "function toGregorian(jalaliDate) {\n var jdn = jalaliToJulian(jalaliDate.year, jalaliDate.month, jalaliDate.day);\n var date = julianToGregorian(jdn);\n date.setHours(6, 30, 3, 200);\n return date;\n }", "function toGregorian(jalaliDate) {\n var jdn = jalaliToJulian(jalaliDa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the multitree control
function renderMultiTree(multiTree){ // Draw hidden value var multiTreeHiddenInput = $('<input type="hidden">'). appendTo(multiTree); // Creates tree layout var tree = $('<div class="ui-analysis-...
[ "function render(self) {\n var container = document.getElementById(self.node),\n leaves = [],\n click = function(e) {\n e = e || window.event;\n //var parent = (e.target || e.currentTarget || e.srcElement).p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EnumTypeExtension : extend enum Name Directives[Const]? EnumValuesDefinition extend enum Name Directives[Const]
function parseEnumTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'enum'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var values = parseEnumValuesDefinition(lexer); if (directives.length === 0 && values.length === 0) { ...
[ "parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Repositions the panel to the top of page if the panel is outside of the visual viewport. It will also reposition all child panels of the current panel.
function repositionPanel(panel) { var scrollY = DomUtils.getViewPort().y; function toggleFixedChildPanels(fixed, deltaY) { var parent; for (var i = 0; i < visiblePanels.length; i++) { if (visiblePanels[i] != panel) { parent = visiblePanels[i].parent(); while (parent && (parent = parent.parent...
[ "function SetMapPanelTop() {\n var top = getMapCanvas().offsetTop;\n panel.style.top = top + 'px';\n }", "function repositionPanel(panel){var scrollY=DomUtils.getViewPort().y;function toggleFixedChildPanels(fixed,deltaY){var parent;for(var i=0;i<visiblePanels.length;i++){if(visiblePanels[i]!=pane...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggles between dark and light theme
function toggleTheme() { setTheme(theme === 'light' ? 'dark' : 'light'); }
[ "function toggleTheme () {\n // if the theme is not light, then set it to dark\n \n if (theme === 'light') {\n setTheme('dark');\n // otherwise, it should be light\n } else {\n setTheme('light');\n }\n}", "switchTheme(){\n this.dark = ! this.dark;\n }", "function toggleTheme () {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upon calling a new wsLib_convertBootstrapDropdownToSelect(), Bootstrap Dropdown menus with the class ".jsbootstrapselect" will be modified to behave similarly to a tag.
function wsLib_convertBootstrapDropdownToSelect($whichContainer, whichFunction) { var $bootstrapSelect; if($whichContainer !== undefined) { // if a container exists, focus only on the container $bootstrapSelect = $whichContainer.find('div.js-bootstrap-select'); // Dropdown to convert to "select" ...
[ "function updateSelectCSS() {\n\t// remove default style from select boxes and add bootstrap style\n\t$('select').addClass(\"form-control\").removeClass(\"dc-select-menu\");\n}", "function Bootstrap_Select(){\t\n\t\t\tjQuery('.selectpicker').selectpicker();\n\t\t}", "function bootstrapClass()\n {\n $(\".pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter Coffee You love coffee and want to know what beans you can afford to buy it. The first argument to your search function will be a number which represents your budget. The second argument will be an array of coffee bean prices. Your 'search' function should return the stores that sell coffee within your budget. T...
function search(budget, prices) { // return array of prices that are within budget return prices .filter(price => price <= budget) .sort((a, b) => a - b) .join(','); }
[ "function search(budget, prices) {\n\n // return array of prices that are within budget\n return prices.filter(p => p <= budget).sort((a, b) => a - b).toString();\n\n\n}", "function search(budget, prices) {\n\n // return array of prices that are within budget\n const priceList = prices.filter(price ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up the script necessary to toggle a group as a disclosure
function createDisclosure(groupId, headerId, widgetId, defaultOpen, collapseImgSrc, expandImgSrc, animationSpeed, renderImage) { jq(document).ready(function() { var groupToggleLinkId = groupId + "_toggle"; var expandImage = ""; var collapseImage = ""; if (renderImage) { ...
[ "function createDisclosure(groupId, headerId, widgetId, defaultOpen, collapseImgSrc, expandImgSrc, animationSpeed, renderImage) {\n jQuery(document).ready(function () {\n var groupToggleLinkId = groupId + \"_toggle\";\n\n var expandImage = \"\";\n var collapseImage = \"\";\n if (rende...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toma la opcion del select y la envia a GeoCodeAddress()
function codeAddressBySelectedOption() { //Obtengo el select del formulario. var select = document.getElementById("selectSucs"); //obtengo la direccion de la sucursal del formulario var address = select.options[select.selectedIndex].id; console.log('direccion: ' + add...
[ "function geolocaterSetSelectAddress(aAddress) {\n var elem = gui.addrs.select;\n elem.streetNumber = aAddress.street_number || '';\n elem.street = aAddress.street || '';\n elem.premises = aAddress.premises || '';\n elem.city = aAddress.city || '';\n elem.county = aAddress.county || '';\n elem.region = aAddr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Auto Login from "Remember Me"
function autoLogin() { // start with no authentication tokens this.removeUserToken(); // "remember me" - automatic login var dfd = $q.defer(); getLoginUser(function (loginUser) { if(loginUser && ...
[ "function defaultLoginToRememberMe(){\n $.CurrentUser.RememberMe == true\n document.forms[\"frmLogin\"][\"userName\"].value = $.CurrentUser.UserName;\n document.forms[\"frmLogin\"][\"userPassword\"].value = $.CurrentUser.UserPassword;\n $('#rememberMe').prop(\"checked\", true);\n}", "function autoLogi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate Subscription Channel List ================================== generate_channel_list(channels_object);
function generate_channel_list(channels, nopresence) { var list = []; utils.each(channels, function (channel, status) { if (nopresence) { if (channel.search('-pnpres') < 0) { if (status.subscribed) list.push(channel); } } else { if (status.subscribed) list.push(channel); ...
[ "function generate_channel_list(channels, nopresence) {\n var list = [];\n each( channels, function( channel, status ) {\n if (nopresence) {\n if(channel.search('-pnpres') < 0) {\n if (status.subscribed) list.push(channel);\n }\n } else {\n if (sta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a mock of the socket, as some functions require the socket's id as arguments
function createMock() { return { id: Math.floor(Math.random() * 9000000000) + 1000, on: () => { // Do nothing, as we only have to mock the socket for its id, not its functionality } } }
[ "function MockSocket (id) {\n\n\treturn {\n\t\tid: id,\n\t\temit: function () {}\n\t};\n\n}", "function getMockSocket() {\n const socketId = randomString.generate(5);\n const mockSocket = {\n id: socketId,\n };\n return mockSocket;\n }", "function MockSocketIO() {\n this.function_calls = {};\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sorts the nodes in a trie in place.
function orderTrie(node) { if (!node.c) return; const nodes = [...node.c].sort(([a], [b]) => (a < b ? -1 : 1)); node.c = new Map(nodes); for (const n of node.c) { orderTrie(n[1]); } }
[ "function sortTrie(trie) {\n trie.children = trie.children.sort((a, b) => {\n const result = a.prio - b.prio;\n if (result !== 0) {\n return result;\n }\n\n return b.path.length - a.path.length;\n });\n\n for (const child of trie.children) {\n sortTrie(child);\n }\n}", "function sortNodes(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function use to retrieve data from either sessionStorage or localStorage. Used to get values back when page is refreshed or form values saved when offline
function retrieveDataFromStorage() { var id, elm; // If HTML5 Storage is supported if (localStorage !== 'undefined' || sessionStorage !== 'undefined') { // If we got something stored in sessionStorage if (sessionStorage.formData) { formDataObj = JSON.parse(sessionStorage.getItem('formD...
[ "function getDataLocalStorage()\r\n{\r\n\tlet retrievedData = JSON.parse(localStorage.getItem(LOCKER_DATA_KEY));\r\n\treturn retrievedData;\r\n}", "function getDataLocalStorage() {\r\n return JSON.parse(localStorage.getItem(LOCKER_DATA_KEY));\r\n}", "function getDataLocalStorage() {\r\n // Getting the loc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A custom renderer that adds the `multiselect` class to each `vaadincomboboxitem`.
_customRenderer(root, comboBox, model) { let comboBoxItem = root.firstElementChild; let comboBoxItemContent; if (!comboBoxItem) { // build the template comboBoxItem = document.createElement('div'); comboBoxItem.setAttribute('part', 'item-template'); root.appendChild(comboBoxItem); ...
[ "multipleSelectedItem(options) {\n const extraClass = options.highlighted ? \" highlighted\" : \"\";\n return `<span class=\"selectivity-multiple-selected-item${extraClass}\" data-item-id=\"${escape(\n options.id,\n )}\">${options.removable\n ? '<a class=\"selectivity-mult...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Log open event's time(type:0)
async eventOpenTime() { // eventTAT'S sysKey const sysKey = this.ctx.params.sysKey; const eventTAT = this.ctx.request.body; eventTAT.sysKey = sysKey; if (!await this.service.eventTAT.eventLog(eventTAT, 0)) { this.response(403, 'log event open...
[ "async eventOpenTime() {\n \n // eventTAT'S sysKey\n const sysKey = this.ctx.params.sysKey;\n\n if (!await this.service.eventTAT.eventLog(sysKey, 0)) {\n this.ctx.body = this.service.util.generateResponse(403, 'log event open time failed');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function clears the value of next Id
function clearNextId(){ NextId = undefined; }
[ "reset() {\n this._nextId = 1;\n this._ids = {};\n }", "function resetLastId() {\n\t\t lastId = 0;\n\t\t}", "function resetLastId() {\n lastId = 0;\n}", "function resetLastId() {\n\t lastId = 0;\n\t}", "function resetIdCounter() {\n idCounter = 0\n}", "function resetIdCounter() {\n idCou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prosedur Print_custom Mengecek apakah fungsi getNama_custom() mengembalikan nilai true Kemudian mengambil kembalian dari fungsi getNama_custom() Sebelum print dilakukan pembersihan object yang aktif agar kontrol pembantunya tidak ikut di cetak. Timeout Prosedur untuk menuggu pemberisah object aktif. hal ini dilakukan k...
function print_custom() { if (getNama_custom()) { nama = getNama_custom(); //bersihkan canvas sebelum print canvas_custom.discardActiveObject(canvas_custom.getActiveObject()); canvas_custom.requestRenderAll(); //timeout menuggu canvas dibersihkan setTimeout(function () { //printing ...
[ "function print() {\n if (getNama()) {\n nama = getNama();\n //bersihkan canvas sebelum print\n canvas.discardActiveObject(canvas.getActiveObject());\n canvas.requestRenderAll();\n //timeout menuggu canvas dibersihkan\n setTimeout(function () {\n //printing\n $(\"#c\")\n .get(0)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Highlight theme item on page load and on click
function HRhighlightThemeItem(theme) { $('.theme-switcher button').each(function() { if ($(this).attr('rel') == theme) { $(this).addClass('active'); } else { $(this).removeClass('active'); } }); }
[ "function handleactiveitemtheme() {\n\t\t$('.theme-color > a.active-item-theme').on(\"click\", function() {\n\t\t\tvar activeitemtheme = $(this).attr(\"active-item-theme\");\n\t\t\t$('.pcoded-navbar').attr(\"active-item-theme\", activeitemtheme);\n });\n }", "_highlight() {\r\n this.tag('MenuList')\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to Check Current Store GiftCard and Reward Enabled Permission
function CheckGiftCardPermission() { var storeId = 0; storeId = SetStoreId(); var count = 0; //SetMenuNavigation(storeId); var carryOutEnabled = localStorage.getItem("CarryOutEnabled").trim(); var giftCardsEnabled = localStorage.getItem("GiftCardsEnabled").trim(); var giftCardProgramEnabled ...
[ "function checkMgrBypass(){\n\tif(catItem == '060e40894f8ca600af76d0af0310c793'){ //Generic Request\n\t\tvar grMember = new GlideRecord('sys_user_grmember');\n\t\tgrMember.addQuery('user', user);\n\t\tgrMember.addQuery('group', '86091e154ff24200336ad49f0310c731'); //iCentra Acute Scheduling;\n\t\tgrMember.query();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines the grouping behavior for the action and its children.
get groupingBehavior () { return this._groupingBehavior; }
[ "_applyGroupModifications () {\n // iterate all actions\n Object.keys(this.actions).forEach(actionName => {\n // get all action versions\n const actionVersion = this.actions[actionName]\n\n // iterate all action versions\n Object.keys(actionVersion).forEach(versionNumber => {\n // a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a css style string formed by taking the properties in the `styleInfo` object and appending the property name (dashcased) colon the property value. Properties are separated by a semicolon.
function styleString(styleInfo){var o=[];for(var name in styleInfo){var v=styleInfo[name];if(v||v===0){o.push("".concat(camelToDashCase(name),": ").concat(v));}}return o.join('; ');}
[ "function styleString(styleInfo) {\n\t const o = [];\n\t for (const name in styleInfo) {\n\t const v = styleInfo[name];\n\t if (v || v === 0) {\n\t o.push(`${camelToDashCase(name)}: ${v}`);\n\t }\n\t }\n\t return o.join('; ');\n\t}", "function styleString(styleInfo) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch the user's filters from the HTML form and return an object containing the filters
function getUserFilters(){ let inputFilters = document.getElementById('filterForm').elements; let userFilters = new Object; // For each filter input we get from the HTML form, we assign a parameter to the userFilter object. for (let i = 0; i < inputFilters.length; i++){ if(inputFilters[i].value){ use...
[ "function collectFilters() {\n var filters = {};\n $(\".filter\").each(function () {\n filters[$(this).attr(\"id\")] = $(this).val();\n });\n\n return filters;\n }", "function getFilters(){\n return filters;\n }", "function getFilters () {\n var filters = {};\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initiate the take action
function prepareForTake() { actions.take = true; input.placeholder = "Take what?"; }
[ "takeAction(action) {\n this.simulation.takeAction(action);\n }", "init() {\n\t\tif (this.actions) {\n\t\t\tthis.actions.start();\n\t\t}\n\t}", "_onAutoInputTpbActs() {\r\n this.startTpbCasting();\r\n this.setActionState(\"waiting\");\r\n }", "function C999_Common_CuffsKey_Run() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On Submit Check that all fields are submitted If error found ennunciate and set focus
function checkOnSubmit(){ var errClassArray = document.getElementsByClassName("error"); var inputClassArray = document.getElementsByClassName("userInput"); var errClassLength = errClassArray.length; var inputClassLength = inputClassArray.length; //Check userInput class values. Flag first blank var inputCheck...
[ "function doOnFieldsFocus() {\r\n\t\t\tvar $wrapper = $(this).parents(o.inputWrapperSel).eq(0),\r\n\t\t\t\t$errorElem = $wrapper.length ? $wrapper : $(this);\r\n\t\t\tif($errorElem.hasClass(o.invalidClass)) {\r\n\t\t\t\t$errorElem.addClass(o.afterValidClass);\r\n\t\t\t}\r\n\t\t\t$errorElem.removeClass(o.invalidClas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
I converted the SVG logo to this component using this service: reactsvgr.com
function SvgRecipcartLogo(props) { return ( <svg id="recipcart_logo_svg__Layer_1" xmlns="www.w3.org/2000/svg" x={0} y={0} viewBox="0 0 273 76" xmlSpace="preserve" width="6em" height="6em" {...props} > <style /> <path d="M117 32.7l...
[ "function ReactLogo_ReactLogo({\n className\n}) {\n return /*#__PURE__*/react[\"createElement\"](\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n className: `${ReactLogo_default.a.ReactLogo} ${className || ''}`,\n viewBox: \"-11.5 -10.23174 23 20.46348\"\n }, /*#__PURE__*/react[\"createElement\"](\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end onButtonClick Add Parent Key Fields PFK_keyfieldname
function addParentKeys( parseg, LastSeqNum, NewId, dbName, ProjName, EnvName, cobName, firstParFld, dType ) { // alert( "add parent fields" ); var numtempsegflds = parseg.getElementsByTagName( "field" ).length; var tempFldName = ""; var fieldAtt = []; ...
[ "add() {\n const { form } = this; //pega a referencia do form no html\n const keys = form.getFieldValue('keys'); //a lista de Keys (id) da lista de inputs \n const nextKeys = keys.concat(++id); // soma 1 a ultima key\n form.setFieldsValue({\n keys: nextKeys, // coloca a ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform a function in place. Returns nothing.
function transform_function(func) { if (ends_with_underscore(func.name)) { function_vars = {} idents.push_callback() func.name = strip_underscore(func.name) func.params.push(idents.callback.value) func.body.children.push({ type: RETURN, implicit: true,...
[ "set transform(f) { this._transform = f || (x => x); }", "function transform_script(script) {\n idents.reset()\n scan_for_functions_to_transform(script).forEach(transform_function)\n\n // Post-processing. The script is already valid, but we clean up redundancies to improve readability of the output.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new constraint metadata.
addConstraintMetadata(metadata) { this.constraintMetadatas.push(metadata); }
[ "addValidationMetadata(metadata) {\n this.validationMetadatas.push(metadata);\n }", "addPlacementConstraint(constraint) {\n if (isFargateCompatible(this.compatibility)) {\n throw new Error('Cannot set placement constraints on tasks that run on Fargate');\n }\n this.placem...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create and show insertion point for edge at the given position
showInsertionPointForEdgeAt(x, y) { // create insertion point as necessary if (!this.insertionEdgeEl) { this.insertionEdgeEl = document.createElement('div'); this.insertionEdgeEl.className = 'edge-insertion-point'; this.el.appendChild(this.insertionEdgeEl); } this.insertionEdgeEl.style...
[ "showInsertionPointForEdge(block, edge) {\n // insertion point may alternate so ensure we remove the block cursor\n this.hideBlockInsertionPoint();\n\n // get node representing this part and its AABB\n const node = this.layout.nodeFromElement(block);\n const AABB = node.getAABB();\n const xpositio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds he token to the local storage and sets the Auth $http header or removes the header
function setToken(token) { if (token) { localStorage.addLocal('token', token); $http.defaults.headers.common.Authorization = 'Bearer ' + token; } }
[ "_appendToken() {\n let authToken = localStorage.getItem('token');\n if (authToken) {\n this.headers['Authorization'] = authToken;\n }\n }", "function updateAuthHeader (token) {\n if (angular.isUndefined(token)) {\n if (angular.isUndefined(self.token)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Saves shortcuts to OmniDB database.
function saveShortcuts() { var v_shortcut_list = []; for (var property in v_shortcut_object.shortcuts) { if (v_shortcut_object.shortcuts.hasOwnProperty(property)) { v_shortcut_list.push(v_shortcut_object.shortcuts[property]); } } var input = JSON.stringify({ "p_shortcuts": v_shortcut_list, "...
[ "function saveShortcuts() {\n\n\tvar v_shortcut_list = [];\n\n\tfor (var property in v_shortcut_object.shortcuts) {\n if (v_shortcut_object.shortcuts.hasOwnProperty(property)) {\n v_shortcut_list.push(v_shortcut_object.shortcuts[property]);\n }\n }\n\n\tvar input = JSON.stringify({\"p_shortcuts\": v_s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
auto Dj Check: bot will enter/leave booth based on provided model settigs
function djCheck () { if (model.autoDj && !playingTrack) { if (!inTheBooth && djs.length <= model.autoDjThreshold) { api.joinBooth(); core.showMessage(model.resources.dj.autoDj.activate); inTheBooth = true; } else if (inTheBooth && djs.length > model.autoD...
[ "function modelLoaded(){\r\n console.log(\"model loaded\");\r\n stock = document.getElementById(\"input_text_stock\").value;\r\n if (stock === \"APPL\") {\r\n \t\tnn.load(applmodelDetails, applmodelLoaded);\r\n }\r\n else if (stock === \"AMZN\") {\r\n \t\tnn.load(amznmodelDetails, amznmodelLoaded);\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if the last component in the name is a segment number..
function endsWithSegmentNumber(name) { return name.components != null && name.components.length >= 1 && name.components[name.components.length - 1].length >= 1 && name.components[name.components.length - 1][0] == 0; }
[ "isSegment() {\n var lstrs = this.nxps('./kml:LineString', this.el);\n //console.err(\"There are\", lstrs.length,\"line strings in this segment\");\n return lstrs.length > 0;\n }", "function atLastSegment(state: State) {\n return state.sectionIdx === lastSectionIdx(state)\n && st...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
JSONHttpRequest 0.3.0 Copyright 2011 Torben Schulz < This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed...
function JSONHttpRequest() { var _xmlHttpRequest = getXMLHTTPRequest(); var _responseJSON = null; var _userContentType = false; // INFO Defining 'this' as '_self' improves compression, since keywords won't be shortened, // but variables will, and it delivers us from the need...
[ "function JSONHttpRequest() {\n\t\tvar _xmlHttpRequest = getXMLHTTPRequest();\n\t\tvar _responseJSON = null;\n\t\tvar _userContentType = false;\n\t\t// INFO Defining 'this' as '_self' improves compression, since keywords won't be shortened,\n\t\t// but variables will, and it delivers us from the need to reset ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
void GearSort(sortfunc) Sorts the gear table according to the sorting function that is passed to sortfunc. GearSort contains members that can act as sorting functions for the Array.sort() method.
function GearSort(sortfunc) { // Create a shortcut to the rows of the skills table. var rows = document.getElementById("gear").rows; // Now copy all the data in each row (the first two are headers and // the last is a footer). debug.trace("Copying gear data..."); var rows_c = new Array(); for (var i = 2;...
[ "function GearSort(sortfunc)\n{\n // Create a shortcut to the rows of the skills table.\n var rows1 = document.getElementById(\"gear0\").rows;\n var rows2 = document.getElementById(\"gear1\").rows;\n\n // ================================================\n // Now copy all the data in each row (the first two are...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edit User Post Function
function editUserPost() { var editPostBtn = document.getElementById('editPostBtn'); editPostBtn.style.display = 'none'; var savePostBtn = document.getElementById('savePostBtn'); savePostBtn.style.display = 'inline-flex'; var postTitle = document.getElementById('postTitle'); postTitle.setAttribute('contenteditabl...
[ "function EditPost() {\n if (post.user._id === \"60f67bd86bce175ba8dec1d7\") {\n setEdited(!edited);\n } else {\n alert(\"You can't Edit someone's post!!!\");\n }\n }", "function EditPost() {\n if (post.user._id === \"60c8aef9a3a3d700151cb054\") {\n setEdited(!edited);\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
player/Playbackbusy.js Helper method for initializing playback.busy property.
function Playback$initBusy(playback) { var GRACE_PERIOD = 199, UPDATE_INTERVAL = 100; var _busy = playback.busy, _lastNonBusy = 0, _busySince, _earliestEta, _lastProgressBackwardsTime, _updateBusyInterval; playback.state.addListener(function () { _s...
[ "get busySignal() {\n return this._busySignal;\n }", "function SetBusy(enableBusy)\n{\n}", "function player_busy_music() {\n\treturn player.music.preloading;\n}", "get isBusy() {\n return this._busyCount > 0;\n }", "function setBusy() {\n if(busyCounter === 0) {\n events.emit('bu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
selector for the First Password error
get errorFirstPassword () { return $('#register-error-first-password') }
[ "get errorSecondPassword () { return $('#register-error-second-password') }", "get errorPassword () { return $('#login-error-password') }", "function action_invalid_register_password(){\n \t\n \t$(\"#error-register_password\").css(\"color\",\"red\");\n\t\t$(\"#error-register_password\").html(\"Invalid pas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the investments as a list
getInvestments() { var investmentsList = []; for(var projectId in this.investments) investmentsList.push(this.investments[projectId]); return investmentsList; }
[ "get investigations() {\n\t\treturn this.__investigations;\n\t}", "createPortfolio(investments) {\r\n var portfolio = []\r\n for (var i = 0; i < investments.length; i++) {\r\n var crypto_symbol = investments[i][0];\r\n var currency = investments[i][1];\r\n var quanti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
we only callback when we're not too busy otherwise we wait to prevent too much mem usage
function trycallback() { if (dataqueue.length > MAX_QUEUE_LEN) window.setTimeout(trycallback, 2000); else callback(); }
[ "_bufferLoaded(callback) {\n this._loadingCount--;\n\n if (this._loadingCount === 0 && callback) {\n callback();\n }\n }", "_bufferLoaded(callback) {\n this._loadingCount--;\n if (this._loadingCount === 0 && callback) {\n callback();\n }\n }", "callback() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get information about the resource at the other end of this feed's url. Specifically, we care about ETag and LastModified headers, ContentType, and whether or not we should try to download it. See
async function getFeedInfo(feed) { const info = { status: null, etag: null, lastModified: null, contentType: null, shouldDownload: true, }; let response; try { // Do a HEAD request, and see what the current version info for this URL is response = await fetch(feed.url, addHeaders({ m...
[ "getResourceInfo() {\n if (this.m_resourceInfo === undefined) {\n this.computeResourceInfo();\n }\n return this.m_resourceInfo;\n }", "function info(key, newKey, /*function(result,headers)*/ callbackFnOrOb) { \r\n\t\t//if (console.logEnabled) console.log(this.name +\".read(\"+ k...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Triggers when the tracker notices that a device changed.
function changeListener(device) { // refreshData() }
[ "triggerDeviceAddedObserver() {\n this.observables_.trigger(ON_UPDATE_LIST_CHANGED);\n }", "_detectedChangeHandler(newValue) {\n this.log.debug(\n this._detectedProperty,\n 'of device',\n this.device.type,\n this.device.id,\n 'changed to',\n newValue\n )\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a Paper object Version 3 of ApplyPatternSet is another restructure that handles multiple patterns, but allows for specifying if we care about a reference line for a pattern if a reference for a pattern is undefined or null, then apply the pattern 1 time and 1 time only.
static applyPatternSet(point, patternSet) { // See SampleStructures.js for what patternSet should look like. // return an array of points var rtnVal = []; var newPoint = point; var remainingCounts = patternSet.counts; var buildRef = new Point([0,0]); // Loop throught each pattern for (var patternIdx...
[ "function pattern3_orig() {\n\n}", "function Pattern() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var flag = args.pop();\n this.patterns = args;\n this.flag = flag;\n }", "function pattern1_o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Regex to check if user wants to stop the current process
setStopRegex(s) { this.stopRegex = s; }
[ "stopProcess(name) {\n const flags = spellCore.getProcessFlags()\n let wasRunning = !!flags[name]\n if (wasRunning) {\n if (flags[name] === \"!\") delete flags[name]\n else if (flag[name] > 0) flags[name]--\n }\n if (spellCore.DEBUG_PROCESSES)\n console.warn(\"stopProcess\", { name, wa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new JobsActionLog.
function JobsActionLog() { _classCallCheck(this, JobsActionLog); _defineProperty(this, "Action", undefined); _defineProperty(this, "InputMessage", undefined); _defineProperty(this, "OutputMessage", undefined); }
[ "function JobsAction() {\n _classCallCheck(this, JobsAction);\n\n _defineProperty(this, \"ID\", undefined);\n\n _defineProperty(this, \"Label\", undefined);\n\n _defineProperty(this, \"Description\", undefined);\n\n _defineProperty(this, \"Bypass\", undefined);\n\n _defineProperty(this, \"BreakAft...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function will change view when keys are presses
function eventNoteListKeyCtrlChangeView(moduleObject, element, event, keys) { var newView = false; // Get next View if (event.keyCombination == this.keys["view"]["prev"]){ newView = array_prev(moduleObject.selectedview, moduleObject.availableViews); } else if (event.keyCombination == this.keys["view"]["next"]){ ...
[ "function keystroke(event) \n{\n 'use strict';\n\n // Left arrow?\n if (event.which == 37) {\n pfView.moveLeft();\n }\n\n // Right arrow?\n else if (event.which == 39) {\n pfView.moveRight();\n }\n}", "keyPress(which) {\n if (!which || !this.DisplayService.interests[this.inte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a permission if it doesn't exist yet.
createPermission(existingPermissions, application, permission) { const existingPermission = _.find(existingPermissions, { applicationId: application.id, name: permission }); if (existingPermission) { return Promise.resolve(true); } const payload = { name: permission, description: permission....
[ "function createPermission(accessToken, existingPermissions, application, permission) {\n const existingPermission = _.find(existingPermissions, { applicationId: application.id, name: permission });\n if (existingPermission) {\n return Promise.resolve(true);\n }\n\n const payload = {\n name: permission,\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get a group from backend
retrieveGroup(name, id) { return axios.get(`${JPA_API_URL}/users/${name}/groups/${id}`); }
[ "function getGroup() { return group; }", "getGroups() {\n return httpService(`${config.dbApiUrl}/groups`, 'GET');\n }", "function getGroup(db, group_name, callback) {\n db.get('SELECT * FROM ' + TABLE_NAME + ' WHERE ' + ROW_NAME + '=$name', {\n $name: group_name\n }, function(err, group) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add referee to our website For manage_league/addReferee
async function addReferee(req) { let user = await auth_utils.getUserFromDB(req.body.user[0].userName); await DButils.execQuery( `INSERT INTO Referees (userID, training) VALUES (${user.userID}, '${req.body.training}')` ); }
[ "function addReference(){\r\n\t\t\r\n\t}", "function openReference(){\n\tutils.OpenPage(\"New Lead\",\"/Input Management/newlead.html\",data.Lead_Id,\"\");\n}", "function createNewLeague() {\n history.push(`/admin/leagues/new`);\n }", "function addLeadToDemo() {\r\n\t\r\n}", "function addReferences()\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
What is it? What does it do? Constructor: What is it? It's a Building What does it have? It has floors.
function Building(floors){ // this = {} this.what = "building"; this.floors = floors; // returns "this" in the background }
[ "function Building (floors) {\n // constructure properties, this keyword is instance of\n this.what = 'Building';\n this.floors = floors;\n}", "function Building(name){\n this.name = name; \n this.numFloors = 4; \n }", "function Building() {\n\t// The building's state.\n\tthis.state = 'stand';\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s
function flushTypeQueue() { while(typeQueue.length) { var type = typeQueue.shift(); if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime."); angular.extend($types[type.name], injector.invoke(type.def)); } }
[ "function flushTypeQueue() {\n forEach(typeQueue, function(type) {\n if (UrlMatcher.prototype.$types[type.name]) {\n throw new Error(\"A type named '\" + type.name + \"' has already been defined.\");\n }\n var def = new Type(isInjectable(type.def) ? injector.invoke(type.def) : type.def);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method Name: rippleback Function : to navigate back to the home form
function rippleback() { kony.print("\n**********in rippleback*******\n"); frmHome.show(); }
[ "function goBack() {\n navigation.goBack();\n }", "onBack() {\n Actions.home();\n }", "function onBackClick() {\n\t$.trigger(\"backButtonClick\");\n}", "function BackButton() { }", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnAndroidBackButton_Click( e )\r\n{\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create WebDriver instance based on your browser config;
function createDriver() { let browserConfig = process.env.BROWSER || 'firefox'; let browser = browserConfig.toLowerCase(); if (['chrome', 'firefox', 'ie'].indexOf(browser) < 0) browser = 'firefox'; // const binary = new firefox.Binary(firefox.Channel.RELEASE); // binary.addArguments('-headless'); ...
[ "function CustomWorld() {\n this.driver = new seleniumWebdriver.Builder()\n .forBrowser('firefox')\n .build();\n}", "createDriver () {\n const {\n mode,\n test: {\n options: {\n client,\n driver,\n },\n },\n } = this.context\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Configures the Scroll Bars on initialization
_setScrollBars() { const that = this; if (!that._scrollView) { that._scrollView = new LW.Utilities.Scroll(that.$.timeline, that.$.horizontalScrollBar, that.$.verticalScrollBar); } const vScrollBar = that._scrollView.vScrollBar, hScrollBar = that._scrollV...
[ "function initScrollbars () {\r\n scrollarea = $('.scroll-area').not('.left-sidebar .scroll-area');\r\n addScroll(scrollarea, options.colors.gray_lighter, '6px', options.colors.gray_lighter, '5px', false);\r\n }", "function initScrollBar() {\n if ( !settings.scrollBar ) return;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTIONS FUNCTIONS FUNCTIONS Function initialize gets a user trip dataset and a desired timestep as inputs, and it returns a JSON object that contains the reconstructed accumulation dynamics time series data as an output
function initialize(trips,timeStep,startDate,endDate){ minutesTimeStep = timeStep; //Create a range of timesteps (in minutes) that will be used to create the bins for sampling stationEvents to create the accumulation dynamics minutesRange = d3.time.minutes(startDate, endDate, timeStep); // minutesRange.filter(func...
[ "function tripPlanner(begin_id, stop_id, date, time) {\n let outputFormat = 'rapidJSON';\n let coordOutputFormat = 'EPSG:4326';\n let depArrMacro = 'dep'; // dep or arr\n let itdDate = date; // YYYYMMDD\n let itdTime = time; // HHMM 24-hour format. \n let type_origin = 'stop';\n let na...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method handles the action taken when user clicks on the Logout button The Homepage.js component is rendered on the root element of index.html
ifLogoutClicked() { ReactDOM.render( <Homepage />, document.getElementById('root') ); }
[ "ifLogoutClicked() {\n ReactDOM.render(\n <Homepage/>,\n document.getElementById('root')\n );\n }", "static logOut(){\n Component.renderComponent('menu', 'authForm');\n\n const props = {\n message: 'You log out'\n }\n \n Component.rend...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the button value to "Processing...", avoid user presses the button more than once
function set_processing_cmd(thisForm, thisButton, cmdValue) { var processing_string = "Processing..." ; if (thisButton.value == processing_string) { alert("Processing...") ; return false; } thisButton.value = processing_string ; if (cmdValue != null && cmdValue != '') thisForm.cmd.value = cmdV...
[ "setStatusProcessing() {\n this._clearState();\n\n this._buttonElement.textContent = 'Отправляется...';\n this._buttonElement.classList.add('form-control__submit_state_disabled');\n }", "function updateButton(button, clicked) {\n button.innerText = clicked ? \"Pause\" : \"Animate\";\n updateColor(butt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
On component mount we will check code in url parm fetch token from fb code
async componentDidMount(){ const searchStr = window.location.search const urlParams = queryString.parse(searchStr); if(urlParams.code) { const accessToken = await fbUtils.getAccessTokenFromCode(urlParams.code); if(accessToken){ document.getElementById('my-login-card').innerHT...
[ "function getCode() {\n const urlParams = new URLSearchParams(window.location.search);\n let authcode = urlParams.get(\"code\");\n return new Promise((resolve, reject) => {\n if (authcode !== \"\" || authcode !== undefined) {\n resolve(authcode);\n } else {\n reject(\"Auth code not found\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
blockUI with a single cancel button
function blockUI_cancel(msg, func) { if($.type(func)!="undefined") { myfunc=func; } else { myfunc=function() { }; } $.blockUI( {message: msg+"\ <div class='button-raw med'>\ <button class='secondary med' onClick='$.unblockUI();myfunc();'>"+_("cancel")+"</button>\ </div>", css: {width:'320px', padding:'...
[ "function handleCancelButton() {\n\t\tconsole.log(\"Now cancelling action..\");\n\t\tCounterStart = 0; \t// reset counter\t\t\t\t\n\t\tcloseCancelPopup();\n\t\trevertChanges(command);\n\t\tconsole.log(\"Reverting changes..\");\t\n\t}", "function evhan_cancel_button(ev) {\n ev.preventDefault();\n if (!is_ope...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert to Fuzzy name
function _fuzzyName(name) { // 使用されない(と思われる)記号の削除(/\^$*+?.|[]{};"'%&=~@`,_!#) name = name.replace(/[\/\\\^\$\*\+\?\.\|\[\]\{\}\;\"\'\%\&\=\~\@\`\,\_\!\#]/g, ''); // 「:」「:」「・」「・」スペース、タブを無視 name = name.replace(/[::・・  \t]/g, ''); // 括弧を全角に統一 name = name.replace(/\(/g, '(').replace(/\)/g, ')'...
[ "function normalizeName(n) {\r\n\t\treturn n.toLowerCase().replace(/[àâä]/gi, 'a')\r\n .replace(/[éèêë]/gi, 'e')\r\n .replace(/[îï]/gi, 'i')\r\n .replace(/[ôö]/gi, 'o')\r\n .replace(/[ùûü]/gi, 'u')\r\n .replace(/ /gi, '_');\r\n //return libutils.no_accent(n.toLowerCase());\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check command`s result by exec project info command
static checkProjectInfo(expectInfo = {}) { return ImptTestHelper.runCommand(`impt project info -z json`, (commandOut) => { const json = JSON.parse(commandOut.output); expect(json.Project).toBeDefined; expect(json.Project['Device file']).toBe(expectInfo.dfile ? expectInfo.dfil...
[ "function execWithProject(ctxt, args, cmd)\n{\n // the options\n var env = args.global.environ;\n var path = args.global.file;\n var params = args.global.param || {};\n var force = {};\n [ 'code', 'host', 'user' ].forEach(name => force[name] = args.global[name]);\n if ( args.globa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Begginng of the functions which display and hide how to add tag info
function showTagInfo(){ $("#tagInfo").toggle(); }
[ "function displayTags(tags) {\n var inner = \"\";\n for(var i = 0; i < tags.length; i++) {\n inner += \"<span class=\\\"tag is-info\\\">\" + tags[i] + \"</span>\";\n }\n document.getElementById(\"tag-holder\").innerHTML = inner;\n}", "function showTags() {\n\t\t//first sort the tags alphabetica...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return weights of the model in some standard format
getWeights() { return this.model.getWeights(); }
[ "function getWeights() {\n return weights;\n }", "getWeights() {\n\t\t\t//stores the weights\n\t\t\tvar weights = [];\n\n\t\t\t//for each layer\n\t\t\tfor(var i = 0; i < this.neuronLayers.length; i++) {\n\t\t\t\t//for each neuron\n\t\t\t\tfor(var j = 0; j < this.neuronLayers[i].numNeurons; j++) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map overlay directives all work the same. Take map marker for example will $watch 'myMarker' and each time it changes, it will hook up myMarker's events to the directive dom element. Then uievent will be able to catch all of myMarker's events. Super simple.
function mapOverlayDirective(directiveName, events) { app.directive(directiveName, [function () { return { restrict: 'A', require: '^uiMap', link: function (scope, elm, attrs, controller) { controller.map.promise.then(function (map)...
[ "function mapOverlayDirective(directiveName, events) {\n app.directive(directiveName, [function () {\n return {\n restrict: 'A',\n link: function (scope, elm, attrs) {\n scope.$watch(attrs[directiveName], function (newObject) {\n bindMapEvents(scope, events, newOb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create cells para la tabla, consists of: tdelement, textelement with value, inputelement "hidden" with value and name InputName = string of the inputvalue
function createCells(cellName, cellValue, cellText) { //create td-element var TD1 = opener.document.createElement("td"); //create text-element with value var TD1text = opener.document.createTextNode(cellText); TD1.appendChild(TD1text); //create input-element "hidden" var Input1 = opener.document.createEl...
[ "function createTdinput()\r\n{\r\n var td = document.createElement('td');\r\n var input = document.createElement('input');\r\n \r\n input.setAttribute('type', 'text'); // type generico para los de tipo texto\r\n input.setAttribute('placeHolder', 'ingrese una cantidad'); // texto sugerido\r\n\r\n td.a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Now that everything _really is_ ready, it's time to (finally!) go through the `source` array and run `documentOne()` on each one of them. Also, if the sources are being converted to HTML, the `css` file and the `public` directory for that layout are copied over using the `copyAsset` utility function Note that `configur...
async function documentAll(config = {}) { configure(config) await fs.mkdirs(config.output) for (const source of config.sources) { await documentOne(source, config) } await copyAsset(config.css, 'file', config) await copyAsset(config.public, 'directory', config) }
[ "async function documentOne(source, config = {}) {\n configure(config)\n\n const buffer = await fs.readFile(source)\n let lines = buffer.toString().split('\\n')\n\n const lang = getLanguage(source, config)\n if (lang) {\n if (lang.literate) {\n lines = litToCode(lines, lang)\n }\n const sections ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroy all remaining children in `this.top`.
destroyRest() { this.destroyBetween(this.index, this.top.children.length); }
[ "destroyChildren() {\n while(this.children.length)\n this.children.shift().destroy();\n }", "_destroy() {\n const stack = [];\n\n if (this.root) {\n stack.push(this.root);\n }\n\n while (stack.length > 0) {\n const tile = stack.pop();\n\n for (const child of tile.ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create dialog to edit a role
function createEditRoleDialog(data) { let modal_id = 'edit-role-modal'; let template = $(document.querySelector('#edit-role-modal_template').content.cloneNode(true)); let content = $('#content'); template.find('#edit-role-form').attr('action', '/edit/role/' + data['id']); template.find('#input-nam...
[ "function editRole() {\n let role_id = $(this).data().roleid;\n\n $.ajax({\n url: \"/edit/role/\" + role_id,\n type: 'GET'\n }).done(function (resp) {\n createEditRoleDialog(resp);\n }).fail(function (response) {\n addStatusMessage(response.responseText, false);\n\n $(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test passowrd incryption / 1 => test create user
async TestCreateUser(){ const user_obj = {id :4, Lastname : "Ibrahim", Firstname : "ahmed", email : "ahmedH@gmail.com", password : "eshu12" , dateOfBirth : '1997/11/27', createdAt: '2020-04-02 10:35:00', modifiedAt : '2020-04-02 10:35:00', role : 1}; var response = await user.createUserWithIncr...
[ "function test_create_user(first, last, password, email){\r\n console.log(\"Testing user creation\");\r\n user_model.create_user(first, last, password, email);\r\n\r\n}", "function createUser() {\n var newUser = {\n username: 'contributor'.toLocaleLowerCase(),\n password: _util.sha1('type p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fixup weirdness that can happen in API data where min values are larger than max values, in this case we'll swap them
function fixup({ min: maybeMin, max: maybeMax, value: unclampedValue, ...etc }) { const min = Math.min(maybeMin, maybeMax); const max = Math.max(maybeMin, maybeMax); const value = Math.min(max, Math.max(min, unclampedValue)); return { min, max, value, ...etc }; }
[ "function resetMinMax() {\n values.activeRange.min = values.activeRange.max = -1;\n }", "adjustRange() {\r\n\t\tthis.min = parseFloat(this.minObj.value);\r\n\t\tthis.max = parseFloat(this.maxObj.value);\r\n\t\tthis.adjustValue();\r\n\t}", "_setValuesNoTrans(valueMin,valueMax,eventName) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A Visual element in a URDF.
function UrdfVisual(options) { var xml = options.xml; this.origin = null; this.geometry = null; this.material = null; this.name = options.xml.getAttribute('name'); // Origin var origins = xml.getElementsByTagName('origin'); if (origins.length === 0) { // use the identity as the default this.or...
[ "exportVisualData() {\n let iv = this.i.nw();\n return (iv);\n }", "drawElement(element) {\r\n if (UXFCanvas.hasElementSupport(element.id)) {\r\n UXFCanvas.umlElements[element.id](this, element);\r\n } else {\r\n UXFCanvas.umlElements[\"Default\"](this, element);\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method ListChildCategoryValues Parameters string szLiraryId, string szDataValue Return JSON data Created 8132014 Author wilson.souza Project OADOCS Description list all child category
function ListChildCategoryValues(szLibraryId, szCategoryId, szParentCategoryValue, szSecurityCode) { try { var szUrl = Utilities.formatString( "https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s/categories/%s/values?securityCode=%s", szLibraryId, szCategoryId, szSecurityCode);...
[ "function ListChildCategoryValues(szLibraryId, szCategoryId, szParentCategoryValue, szSecurityCode)\n{\n try\n {\n var szUrl = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s/categories/%s/values?securityCode=%s\",\n szLibraryId, szCategoryId, szS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays Twitter's rate limit for searching Tweets (450 per 15 minutes)
function getRateLimit() { var T = new Twit(config); T.get('application/rate_limit_status', {q: 'resources=help,users,search,statuses'}, function (e,d,r) { if (e) { console.log(e); } else { d.resources.search['/search/tweets'].reset= new Date(d.resources.search['/search/tweets'].reset*1000); console.log...
[ "function GetTweets(resultLimit) {\n twitter.get('statuses/user_timeline', function (error, tweets, response) {\n if (!error) {\n for (var i = 0; i < resultLimit; i++) {\n console.log(tweets[i].text, tweets[i].created_at);\n }\n }\n });\n}", "function initT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Bubble the click and show effect if .waveseffect elem was found
function showEffect(e) { var element = getWavesEffectElement(e); if (element !== null) { Effect.show(e, element); if ('ontouchstart' in window) { element.addEventListener('touchend', Effect.hide, false); element.addEventListener('touchcan...
[ "function setRippleEffect() {\n if ( Waves.displayEffect() ) {\n Waves.displayEffect(); \n }\n }", "function showEffect(e) {\r\n var element = getWavesEffectElement(e);\r\n if (element !== null) {\r\n Effect.show(e, element);\r\n if ('ontouchsta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws path from bow to target.
function drawPath() { canvasContext.setLineDash([5, 3]) canvasContext.lineWidth = 2; canvasContext.strokeStyle = 'orange'; canvasContext.beginPath(); canvasContext.moveTo( bowLocation[0] + imgBow.width / 2, bowLocation[1] + imgBow.height / 2); canvasContext.lineTo( targetL...
[ "drawPath() {\n this.ctx.stroke();\n this.begin();\n }", "function drawPath(startTile,endTile){\n\tpathToDraw = pathFind(startTile,endTile);\n}", "drawPath() {\n\t\tif (this.drawing) {\n\t\t\trenderingContext.beginPath();\n\t\t\trenderingContext.moveTo(this.previousPos.x, this.previousPos.y);\n\t\t\trend...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays the current time based on the number of seconds left
function displayTime() { //Calculate the number of minutes and seconds based on the current time var min = Math.floor(currentTime / 60); var sec = Math.floor(currentTime % 60); //Add a 0 to the front of the second when appropriate if (...
[ "function countdown () {\n timeLeft--\n if (timeLeft >= 0) {\n time.innerText = timeLeft + ' secs'\n }\n }", "function showTime() {\t\n\tdisplay.textContent = m + \":\" + s;\n\tif (time > 0) {\n\t time-= 1000;\n\t} else {\n\t\tswitchMode();\n\t}\n}", "function showTime(){\n\t$(\"#time\").text(se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Banner autoresize s.header > divheader s.banner > divbanner
function refreshBanner(s) { var headerIH = $(s.header).innerHeight(); /* Resize */ $(s.banner).realHeight(headerIH); $(s.banner).children("div").realHeight($(s.banner).innerHeight()); /* Replace */ $(s.banner).css( "top", (headerIH - $(s.banner).outerHeight(tru...
[ "function updateBanner(){\t\n\t\tvar vOffset=$('header').height()+150;\n\t\tif(window.innerHeight>768) vOffset+=window.innerHeight-768;\n\t\t//$('div#banner').css('width',parseInt(window.innerWidth));\n\t\t//$('div#banner').css('height',(parseInt(window.outerHeight)+vOffset)*0.3);\n\n\t\t$('div#banner').css('width'...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format given date to YYYY/MM/DD HH:II
function formatDate(date) { date = new Date(date * 1000); return '' + date.getFullYear() + '/' + lpad(date.getMonth(), 2, '0') + '/' + lpad(date.getDate(), 2, '0') + ' ' + lpad(date.getHours(), 2, '0') + ':' + lpad(date.getMinutes(), 2, '0'); }
[ "function fmtDate(date){\n var res = \"\";\n res = date.substring(0,4)+\"/\"+date.substring(4,6)+\"/\"+date.substring(6,8);\n res = res + \" 06:00:00\";\n return res;\n }", "function formatDate(date) {\n var year = date.getFullYear(),\n month = date.getMonth() + 1, // months a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function called when the color of the picker changes
function onColorChange() { color = colorpicker.value; }
[ "function on_colors_changed() {}", "function colorPicker(event) {\n color = event.target.value;\n}", "function watchColorPicker(event) {\n document.querySelectorAll(changeSelector).forEach(function(s) {\n s.style.color = event.target.value;\n });\n }", "function OnColorPickerOk(ol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
formatPlexPointsToArrayPoints given an array of Complex Points, I return the data points as [x, y]
function formatPlexPointsToArrayPoints(arr){ var formattedArr = []; for(var i=0; i < arr.length; i++){ formattedArr.push([arr[i].dataPt.x, arr[i].dataPt.y]); } return formattedArr; }
[ "function ptsToArray(points) {\n var ptArray = [];\n for (var ptID = 0, nPts = points.length; ptID < nPts; ptID += 1) {\n var pt = points[ptID];\n ptArray.push(pt.x);\n ptArray.push(pt.y);\n }\n return ptArray;\n}", "function convertToArray(points) {\n const arr = [];\n poin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function Definitions The StateAvailable function will be called when self.state[] has valid information for the requested entity state is the initial state Methods
function OnStateAvailable(self, state) { self.set_field(self, "state", self.map_state(self, state.state)) }
[ "function OnStateAvailable(self, state, entity)\n { \n console.log(\"initial \" + entity)\n //console.log(state)\n }", "function OnStateAvailable(self, state)\n {\n set_value(self, state)\n }", "function OnStateAvailable(self, state)\n {\n self.state = state;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a function that takes one parameter, an array of elements, and logs every other one of its elements, beginning at index 0, to the console.
function loopEveryOther(array) { // for (i = 0; i < array.length; i+= 2){ // console.log(array[i]); var i = 0; while (i < array.length) { console.log(array[i]); i += 2; } }
[ "function loopEveryOther(array) {\n\t// create a loop which iterates over every other element of the input array\n\tfor (let i = 0; i < array.length; i += 2) {\n\t\t// log every other array element to the console\n\t\tconsole.log(array[i]);\n\t}\n}", "function printEvens(someArr){\n for(let i = 0; i < someArr....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send GET request to bridge for the fullstate. Run the response thru '_prepareForGun' to convert Arrays to Objects Put the fullstate in gun (gun.get('HUE'))
function _fullStateToGun(rootURL,gun) { console.log('Trying to connect to HUE Bridge @ : "%s" ',rootURL) axios .get(rootURL) .then(function (response) { console.log('Connected...Fetching FullState') _saveToGun(_prepareForGun(response.data)); }).catch(function (error) { console.log('Could NOT connect...
[ "function findGun() {\n if (gun) {\n Entities.editEntity(gun, { position: getPositionGun() });\n } else {\n gun = Entities.addEntity({\n description: \"CC_BY Alan Zimmerman\",\n position: getPositionGun(),\n modelURL: Script.resolvePat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function clean_table Clean all the information stored in the table passed as parameter. Get the table id empty Used when the user logs out and the reloading of the application is needed plus the initializing of specific html elements
function clean_table(id){ tbody = $(id); tbody.empty(); }
[ "function cleanTable() {\r\n var cleanTableUrl = \"../php/cleanTabledb.php\";\r\n sendRequest(cleanTableUrl, { method: 'POST' }, load, console.log);\r\n var table = document.querySelector(\"#main-table\");\r\n table.parentNode.removeChild(table);\r\n tableCreate(30, 30);\r\n setContextMenus();\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The beforeCreate hook runs at the very initialization of your component. Data has not been made reactive, and events have not been set up yet.
beforeCreate() {}
[ "preCreate () {\n debug('preCreate not implemented')\n }", "beforeCreate() {\n let instance = new VueJobs();\n instance.init(Vue);\n\n if (instance) {\n this.__$VueJobsInstance = instance;\n this[instance.options.accessorName] = instance;\n }\n }", "afterCompetenceCreate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }