query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Load specific space data from an alias This will include keys
function getSpace(spaceAlias) { config = null; loadSpaces().forEach(function(item){ if(item.label == spaceAlias) { config = item; return false; } }); return config; }
[ "function loadSpaces() {\n if (spacesList == null) {\n try{\n fs.accessSync(spaceConfigFile);\n data = require(spaceConfigFile);\n spacesList = data.spaces;\n }\n catch(err) {\n throw \"Space configuration file not found or not accessible.\";\n }\n }\n\n return spacesList;\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
success msgs and payloads for reducer
function success(msg, payload) { return {type: msg, payload: payload}; }
[ "function _on_nominal_success(resp, man){\n\t\n\t// Switch on message type when there isn't a complete failure.\n\tvar m = resp.message_type();\n\tif( m == 'error' ){\n\t // Errors trump everything.\n\t anchor.apply_callbacks('error', [resp, anchor]);\n\t}else if( m == 'warning' ){\n\t // Don't really have...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This action is called when we click on a dupe to go an edit a different medication We replace instead of transitioning to avoid leaving this in the history. for new meds, we also discard the current changes to avoid saving the dupe.
editMedication(medication) { if (!this.get('isEditing')) { // Discard changes if this is a new medication and they clicked a dupe, that means they don't want to save it this.updateDirtyAfterRender(false); } // NOTE: We have to delay...
[ "modifyLivestockClick() {\r\n if (this.validateAtLeastOne()) {\r\n if (this.state.selectedData.length > 1) {\r\n if (this.checkForSameType()) {\r\n browserHistory.replace('/livestock/livestock-detail/modify-multiple');\r\n }\r\n }\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getting compare users trending lists
function getCompareUsers() { // sending the usernames to the backend var postParameters = {'usernames': JSON.stringify(usersToCompare)}; $.get("/compareUserTweets", postParameters, function(responseJSON) { var parsedResponse = JSON.parse(responseJSON); if (parsedResponse.indivLikes....
[ "calculateUserTrend(userid, userStartingWeight) {\n logger.info(\"calculating user assessment trends\");\n const assessments = assessmentListStore.getUserAssessments(userid);\n if (assessments.length > 0) {\n if (parseFloat(assessments[0].weight) <= parseFloat(userStartingWeight)) {\n assessmen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true when is an acronym of the string
function isAcronym(words, initials) { // Check to see if the first letters of each word in <words> is a letter in <initials> var wordinitials = []; var splitwords = words.split(" "); for (var w in splitwords) { wordinitials.push(splitwords[w].charAt(0)); }; return wordinitials.join("").toLowerC...
[ "function isHorseName(str){\n\tcheck=\"`~!@#$%^*()_+=|{}[];:/<>?\"+\"\\\\\"+\"\\\"\"+\"\\\"\";\n\tf1=1;\n\tfor(j=0;j<str.length;j++){\n\t\tif(check.indexOf(str.charAt(j))!=-1){\n\t\t\tf1=0;}}\n\tif(f1==0){return true;}\n\telse{return false;}\n}", "function acronym(phrase) {\n let acr = phrase\n .split(\" \")\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
on orientation change, listen for window resize once
function handleOrientationChange() { console.log('orientationchange') window.addEventListener('resize', handleResize, { once: true }); }
[ "function listenWindowResize() {\n $(window).resize(_handleResize);\n }", "onResize() {\n App.bus.trigger(TRIGGER_RESIZE, document.documentElement.clientWidth, document.documentElement.clientHeight);\n }", "function handleWindowResize() {\r\n width = window.innerWidth;\r\n}", "function ResizeHandler(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets subtitle text of the existing panel subtitle element if subtitle text and subtitle element exist
_setSubtitleText() { this.subtitle && this._setText(this.subtitle, '.js-OverlayHeader-subtitle'); }
[ "function parseSubtitle(data) {\n var captions = new subtitle();\n captions.parse(data);\n return captions.getSubtitles();\n}", "function loadSubCCText(text) {\n\tclearCC();\n\t$('#'+shell.caption.textEl).append(text);\n\tif (CCIsDim) enableCC();\n}", "function TEST(vid) {\n\tvar player;\n\t\n\tfunction onYo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clearScreenDithered drawChar(): Draws a single character at the specified line and column.
function drawChar(line, col, ch) { if (line < 0 || line >= LINES || col < 0 || col >= COLUMNS) return; // // attributes const a = line * COLUMNS + col const attr = makeAttribute(my.ink, my.paper) displayColours[a] = attr // // index of the first byte of the character in ...
[ "function drawText(line, col, text) {\r\n const length = text.length\r\n for (let i = 0; i < length && line < LINES; i++) {\r\n drawChar(line, col, text.charAt(i))\r\n if (++col >= COLUMNS) {\r\n col = 0\r\n line++\r\n }\r\n }\r\n}", "RenderChar(draw_list, size,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The default value inserted into the Hop Limit field of the IPv6 header of datagrams originated at this entity, whenever a Hop Limit value is not supplied by the transport layer protocol.
async getIpv6DefaultHopLimit() { return Promise.resolve() .then(() => fsp.readFile("/proc/sys/net/ipv6/conf/all/hop_limit")) .then(v => +v.toString().trim()); }
[ "get maxLength () {\n if (this._maxLength) return this._maxLength;\n let maxLength = Math.max(...this.lengths);\n if (this.allowNull === false && maxLength !== this.minLength) {\n let row = this.body.find(row => row.length > this.minLength);\n throw new Error(`extra column...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the given MaterialTextField.
function resetMaterialTextfield(element) { element.value = ''; element.parentNode.MaterialTextfield.boundUpdateClassesHandler(); }
[ "function onClickReset() {\r\n cleanInputs();\r\n resetFieldsUi();\r\n}", "function resetInputField(field) {\n field.value=\"\";\n}", "function resetForm() {\n setInputs(initial);\n }", "function reset() {\n\t\tclearInterval(timerId);\n\t\ttimeId = null;\n\t\tindex = 0;\n\t\tid(\"output\").textCo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Formula is only for fields Distance_to_Fiber_BuildOut__c and Fiber_Distance_Build_Out__c
function setDistanceToFiberFormula(attributeGroups, attributeValues){ var selectedOption = LineItemService.currentOption; if(!selectedOption || !selectedOption.lineItem){ return; } var uniBillableBandwidth = convertToMbs(attributeValues['UNI_Billable_Bandwidth__c']); //checkBandwidthThreshold(se...
[ "function field_calculate()\n{\n\n}", "function compute_LF_ferment(ibu) {\n var LF_ferment = 0.0;\n var LF_flocculation = 0.0;\n\n // The factors here come from Garetz, p. 140\n if (ibu.flocculation.value == \"high\") {\n LF_flocculation = 0.95;\n } else if (ibu.flocculation.value == \"medium\") {\n LF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Waits for an element to be hidden, or removed from the dom.
async waitForElementNotVisible (selector) { var waitFor = this.waitFor.bind(this) var findElement = this.findElement.bind(this) return new Promise(async resolve => { var isHidden = await waitFor(async () => { var el = await findElement(selector) return !el || !await el.isVisible() ...
[ "async waitForElementVisible (selector) {\n var waitFor = this.waitFor.bind(this)\n var findElement = this.findElement.bind(this)\n return new Promise(async resolve => {\n var isVisible = await waitFor(async () => {\n var el = await findElement(selector)\n return el && await el.isVisible...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CONTROL and SETUP functions / hide the loading gif test if the browser support progressive upload, draggable items, file reader and from data set mode to 'edit' andset button appeareance accordingly
function initialize() { $('#icon-loading').css('visibility','hidden') holder = document.getElementById('holder') tests = { //try to create the element in the DOM to check if supported filereader: typeof FileReader != 'undefined', //browser has a filereader dnd: 'draggable' in document.createElement('span'), //b...
[ "function toggleUploadUI( _mode ) {\n\tswitch( _mode )\n\t{\n\t\tcase('uploading'):\n\t\t\t$('#upload-bar').css('width','0%')\n\t\t\t$('#upload-bar-container').css('display','block')\n\t\t\t$('#info-container').css('display','none')\n\t\t\tbreak\n\t\tcase('uploaded'):\n\t\t\t$('#info-container').css('display','bloc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine which pane currently has focus (one of the folder pane, thread pane, or message pane). The message pane node is the common ancestor of the single and multimessage content windows. When changing focus to the message pane, be sure to focus the appropriate content window in addition to the messagepanebox (doing ...
get focusedPane() { let panes = ["threadTree", "folderTree", "messagepanebox"].map(id => document.getElementById(id) ); let currentNode = top.document.activeElement; while (currentNode) { if (panes.includes(currentNode)) { return currentNode; } currentNode = currentNod...
[ "focusNextWindow () {\n if (this.mailboxesWindow.isFocused()) {\n if (this.contentWindows.length) {\n this.contentWindows[0].focus()\n }\n } else {\n const focusedIndex = this.contentWindows.findIndex((w) => w.isFocused())\n if (focusedIndex === -1 || focusedIndex + 1 >= this.conten...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks URL hash for `confirmation_token=` then extracts the token which proceeds.
function detectEmailConfirmationToken() { try { // split the hash where it detects `confirmation_token=`. The string which proceeds is the part which we want. const token = decodeURIComponent(document.location.hash).split( "confirmation_token=" )[1]; return token; } catch (error) { console...
[ "function getActivationTokenFromURL() {\n\tvar searchParameters = getSearchParametersFromURL();\n\tif(searchParameters && searchParameters[ACTIVATION_CODE_KEY] && searchParameters[ACTIVATION_CODE_KEY].length > 0) {\n\t\treturn searchParameters[ACTIVATION_CODE_KEY];\n\t}\n\treturn undefined;\n}", "function getAcce...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hakee valitun joukkueen rastien koodit talteen
function haeRastiKoodit(joukkue) { let rastit = joukkue.rastit.slice(); for (let i = 0; i < rastit.length; i++) { for (let j = 0; j < data.rastit.length; j++) { if (rastit[i].rasti == data.rastit[j].id + "") { rastit[i].koodi = data.rastit[j].koodi; } } if (rastit[i].koodi == undefin...
[ "function makeHollandsBroodje() {\r\n console.log('neem een broodje. Leg er ham op. sluithet broodje')\r\n}", "kiesDeBeurt()\n {\n if (this.spelActief) {\n this.gi.innerHTML = \"Het is de beurt aan: Speler \" + this.actieveSpeler + \" <span class='player\"+this.actieveSpeler+\"'>(\" + this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Se o valor existir vai gerar um ERRO
function notExistsOrErro(value, msg) { try { existsOrErro(value, msg) } catch (msg) { return } throw msg }
[ "validarPessoa(pessoa) {\n if(!pessoa.nome) {\n throw 'O nome da pessoa é obrigatório';\n }\n if(!pessoa.sobrenome){\n throw 'O sobrenome da pessoa é obrigatório';\n }\n }", "validar() { }", "validate(value) {\n if (value < 0) throw new Error('Valor negativo para preço');\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The difference will be the input subtracted by the randomly generated winning number
difference() { return Math.abs(this.playersGuess - this.winningNumber); }
[ "function Subtraction() {\n var notANumber;\n var subtractionAnswer;\n var subtractionNumber1 = 0;\n var subtractionNumber2 = 0;\n var subtractionOutput;\n \n subtractionNumber1 = FirstNumber();\n subtractionNumber2 = Math.floor(Math.random() * subtractionNumber1);\n \n subtractionAnswer = prompt(\"What i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
change the default attrs
function setDefaultAttrs(attrs) { defaultAttrs = attrs; }
[ "defaultAttributes(attributeObj) {\r\n Object.keys(attributeObj).forEach(name => {\r\n let defaultVal = attributeObj[name];\r\n let userVal = this.getAttribute(name);\r\n\r\n if (!userVal) {\r\n this.setAttribute(name, defaultVal);\r\n }\r\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start reading the pins that are specified in this.pins array
startThermsReading() { setInterval(() => { for (let i = 0; i < this.pins.length; i++) { this.board.analogRead(this.pins[i], (value) => { this.therms.push(value); }); } }, 100); }
[ "getPins(cb) {\n\t\tappLauncherStore.getValue({ field: \"pins\" }, cb);\n\t}", "function loadPin() {\n $container.imagesLoaded(function(){\n $container.masonry({\n itemSelector: '.box',\n isFitWidth: true\n });\n });\n // Load all the buttons that goes onto the pins\n pageLoad(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setOptions Click handler called via meta_options 'click' event listener
function setOptions( e ) { if ( !e ) { e = window.event; } var i, thisClicked = e.target.value; if ( thisClicked !== 0 ) { for ( i = 0; i < this.options_list.length; i++ ) { this.options_list_elements[i].style.display = "none"; if ( thisClicked === this.options_list[i] )...
[ "function openOptionsPage() {\n runtime.openOptionsPage();\n}", "function bindOptions() {\n $('option').click(function() {\n openDocument(this.value);\n return false;\n })\n}", "onOptionsChange(options) {\n this.vssue.setOptions(options);\n }", "afterCreateControlAdaptionHook(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function formats an incoming Slack message by separating the message into 4 parts "Title, SubTitle, Paragraph 1 4"
function formatPostSlackMessage(message) { //title var title = message[0]; var titleToString = title.toString(); var titleAndValue = titleToString.split(': '); postTitle = titleAndValue[1]; //subtitle var subtitle = message[1]; var subtitleToString = subtitle.toString(); var subtitl...
[ "function splitParagraph(text){\n\n\tvar fragments = [];\n\n\twhile( text != ''){\n\t\tif (text.charAt(0) == \"*\"){\n\t\t\tfragments.push({type: 'emphasized',\n\t\t\t\t\t\t\t\t\t\t\tcontent: text.slice(1,takeUpTo('*',text))});\n\t\t\t//modify text so we remove the string we just stored\n\t\t\t//we add 1 because we...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Navigate to Submit an Ad Page
function gotoSubmitAd() { if (localStorage.getItem('user_id')) { window.location.href = "../dashboard/dashboard.html"; } else { window.location.href = "../login/login.html"; } }
[ "function continueShopping() {\n\tsaveFormChanges();\n\twindow.location.href = thisSiteFullurl + backURL;\n}", "function stepByStep() {\n\tgetValues();\n\tdocument.querySelectorAll(\"form\")[0].setAttribute(\"action\", \"/translator/stepByStep\");\n\tdocument.querySelectorAll(\"form\")[0].submit();\n}", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If messages have the same tag, then that influences grouping and whether a message is initally hidden or not, see isImportant(). So we are applying some "magic" rules here in order to hide exactly the right messages. 1. If a message does not have a tag, but is associated with robot comments, then it gets a tag. 2. Use ...
function computeTag(message) { if (!message.tag) { const threads = message.commentThreads || []; const comments = threads.map( t => t.comments.find(c => c.change_message_id === message.id)); const isRobot = comments.some(c => c && !!c.robot_id); return isRobot ? 'autogenerated:has-robot-commen...
[ "function hideEmail(email) {\n var result = \"\";\n var etindex;\n for (i = 0; i < email.length; i++) {\n if (i < 3) {\n result += email[i];\n }\n } result += \"...\"\n for (j = 0; j < email.length; j++) {\n if (email[j] == \"@\") {\n etindex = j;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add new Entry Distribution.
static add(entryDistribution){ let kparams = {}; kparams.entryDistribution = entryDistribution; return new kaltura.RequestBuilder('contentdistribution_entrydistribution', 'add', kparams); }
[ "static update(id, entryDistribution){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.entryDistribution = entryDistribution;\n\t\treturn new kaltura.RequestBuilder('contentdistribution_entrydistribution', 'update', kparams);\n\t}", "static add(entry, type = null){\n\t\tlet kparams = {};\n\t\tkparams.en...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A menu can either be a list of items, or a list of lists. The view expects a list of lists, so we take all items in the toplevel list that are not lists (orphans) and wrap them in an array.
function format(menu) { var orphans, sections; // Wrap orphaned items in an array orphans = reject(menu, isArray); sections = filter(menu, isArray); // Add then back as a proper section sections.push(orphans); // Return the new menu rejecting any empty sections return reject(sections, ...
[ "function render_menu(menu, root) {\n for(var idx in menu) {\n var item = menu[idx];\n var key = item.kind || 'item';\n\n // Collection of functions we're going to use to render each type of list item\n var render = {\n 'header' : function header_template(item) {\n var label =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shows the applying UI until the update has finished staging
waitForUpdateToStage() { if (!this.update) { this.update = this.um.readyUpdate; } this.update.QueryInterface(Ci.nsIWritablePropertyBag); this.update.setProperty("foregroundDownload", "true"); this.selectPanel("applying"); this.updateUIWhenStagingComplete(); }
[ "updateUIWhenStagingComplete() {\n let observer = (aSubject, aTopic, aData) => {\n // Update the UI when the background updater is finished\n let status = aData;\n if (\n status == \"applied\" ||\n status == \"applied-service\" ||\n status == \"pending\" ||\n status == ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Modifies filteredFinalData by filter type.
function filterFinalDataByType() { filterString = ""; filteredFinalData = []; for(i = 0; i < localFinalData.length; i++) { let t = localFinalData[i]; if (filterType == "users" && t.is_user == false) continue; if (filterType == "groups" && t...
[ "function update_filters() {\n //get currently selected (or unselected values for all ids in columns.head)\n for (var i = 0; i < columns.length; i++) {\n columns[i].filter = $('#'+columns[i].cl).val();\n }\n\n // apply filter\n filtered_dataset = full_dataset.filter(filter_function);\n filt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper to read in a single mpint
function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); }
[ "function read(pin) {\n var d = Q.defer();\n\n try {\n gpio.input(pin, (error, value) => {\n if (error) {\n d.reject(error);\n } else {\n d.resolve(value);\n }\n });\n } catch (err) {\n d.reject(err);\n }\n\n return d.promise;\n}", "function readPidData() {\n return t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
printLoginStatus(state: LoginState) success > body fail > reason
function printLoginStatus(state) { if (state.result === 'success') { console.log("" + state.response.body); } else { console.log("" + state.reason); } }
[ "function printLoginStatus(state) {\n if ('response' in state) {\n console.log(\"\" + state.response.body);\n }\n else {\n console.log(\"\" + state.reason);\n }\n }", "function login (password) {\n if (password === \"test1234\") {\n return \"Login Success!\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies the information contained in node to the invoice line designated by vrijeRegel. The information is locked until an unlock order is issued.
function addFacturerenRegelXML(vrijeRegel, node) { /* Ref(erence) is used to identify the original factureren database entry */ getFormElementByName(0, 'ref[]', vrijeRegel).value = node.getAttribute('ref'); document.getElementById('unlock_' + (vrijeRegel + 1)).style.display = 'block'; for(var i = 0 ; i < node.ch...
[ "updateInvoiceQR() {\n // Clean input address\n this.invoiceData.data.addr = this.invoiceData.data.addr.toUpperCase().replace(/-/g, '');\n this.invoiceString = JSON.stringify(this.invoiceData);\n // Generate the QR\n this.generateQRCode(this.invoiceString);\n }", "function ma...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
'big' refers the number of bags which can contain 5kgs of chocolate 'total' refers to the total kgs of chocolate.
function isThereEnoughChocolateBags(small, big, total){ const maxBigBoxes = total / 5; const bigBoxesWeCanUse = maxBigBoxes < big ? maxBigBoxes : big; total -= bigBoxesWeCanUse * 5; if(small < total)return false; else return true; }
[ "function totalPopCap(){\n\tvar total = 0;\n\tfor (var d in depotList){\n\t\ttotal += depotList[d].popCap;\n\t}\n\tfor (var h in houseList){\n\t\ttotal += houseList[h].popCap;\n\t}\n\treturn total\n}", "function hireaddbal() {\n sum = 0;\n master.hireitems.forEach(function (item) {\n sum += Math.floor(item.m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
implementation of fetching and rendering quotes, updating chart
function getQuote() { ticker = $(".get-quote input").val().toUpperCase(); let $quote = $("<p>"); if (ticker !== "") { // fetch quote fetchQuote(ticker).then(response => { quote = response; // render quote $(".render-quote")....
[ "function drawCharts(event) {\r\n\tfetchLineChart(event.target.textContent).then(res => {\r\n\t\tconsole.log(res);\r\n\t\t//updating the chart with the data of the selected activity\r\n\t\tline.data.datasets[0].data = res;\r\n\t\tline.update();\r\n\t});\r\n\r\n\tfetchBarChart(event.target.textContent).then(res => {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merge obj1 and obj2. If the property of obj1 is same to obj2's, it will be coverd.
function objMerge(obj1, obj2) { if ((typeof obj1 != 'object') || (typeof obj2 != 'object')) { return; } for (var prop2 in obj2) { obj1[prop2] = obj2[prop2]; } return obj1; }
[ "function MergeRecursive(obj1, obj2) {\n\n for (var p in obj2) {\n try {\n // Property in destination object set; update its value.\n if ( obj2[p].constructor==Object ) {\n obj1[p] = MergeRecursive(obj1[p], obj2[p]);\n \n } else {\n obj1[p] = obj2[p];\n \n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hideSplashScreen closes the current splash screen if it is not already closed.
async hideSplashScreen() { try { if (!this.splashScreenWindow) return; this.splashScreenWindow.close(); this.splashScreenWindow = null; } catch (err) { logger.error(`Unable to hide splash screen ${err.message}`); const error = new Error('Error hiding splash screen.'); throw (error); } }
[ "function remove() {\n if (isVisible()) {\n var extendedSplashScreen = document.getElementById(\"extendedSplashScreen\");\n WinJS.Utilities.addClass(extendedSplashScreen, \"hidden\");\n }\n }", "hideSplashScreen()\n {\n this.changeView(\"appMainViews\", \"app-view-...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add asset to the manager.
add( asset ) { if ( asset instanceof Asset ) { this._assets.set( asset.id, asset ); } else if ( asset instanceof Array ) { asset.forEach( this.add, this ); } else { this.add( this.load( asset ) ); } }
[ "static add(fileAsset){\n\t\tlet kparams = {};\n\t\tkparams.fileAsset = fileAsset;\n\t\treturn new kaltura.RequestBuilder('fileasset', 'add', kparams);\n\t}", "function createAsset(axios$$1, payload) {\n return restAuthPost(axios$$1, '/assets', payload);\n }", "addImage(url) {\n \n }", "add(item...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the chunk stream with a particular set of test data
function testChunkStreamWithData(data, chunkSize) { //We have to wrap all this in a promise so that the test runner //will wait until the asynchronous code has had a chance to complete return new Promise((resolve, reject) => { //Create a Node.js read stream with the test data const readStream = streamify(da...
[ "function addChunksAndExpect(expect, streamParser, chunks, expected) {\n let isDone = false;\n chunks.forEach((chunk, i) => {\n const ret = streamParser.addChunk(chunk);\n if (streamParser.done) {\n isDone = true;\n }\n if (isDone) {\n expect(ret).toEqual(expected);\n expect(streamParse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convienence constructor for line. You dont have to use this. Creating an object that has a startX starY endX endY will do just fine
function Line( x1, y1, x2, y2 ){ this.startX = x1; this.startY = y1; this.endX = x2; this.endY = y2; }
[ "function RoadLine(x1, y1, x2, y2) {\n\tthis.startX1 = x1;\n\tthis.startY1 = y1;\n\tthis.diffX = x2 - x1;\n\tthis.diffY = y2 - y1;\n\t\n\tthis.x1 = x1;\n\tthis.y1 = y1;\n\tthis.x2 = x2;\n\tthis.y2 = y2;\n\t\n\t//Draws Road Lines.\n\tthis.draw = function() {\n\t\tctx.beginPath();\n\t\tctx.lineCap = \"round\";\n\t\tc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
procesar HEADERS para mantener sesion
procesarHeaders(){ var headers = { "Accept": "*/*", "User-Agent": "Cliente Node.js" }; if(this.basicAuth != undefined){ headers.Authorization = "Basi c" + this.basicAuth; } return headers; }
[ "function HeaderHandler(aHeaders) {\n this.headers = aHeaders;\n}", "setHeader(key, value) {\n this._headers[key] = value\n }", "function TrackerSetHeader(\n Authorization = '',\n ppr = '',\n deltaId = '',\n deltamatic = '',\n channelId = '',\n appId = '',\n sessionId = ''\n ) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Discards mp3 files, which do not have a corresponding json feature pendant
function discardCorruptedFiles() { var count = 0; //we don not want the server to respond request as long as not done this job var audioFiles = fs.readdirSync("./mp3/tracks"); for (var i = 0; i < audioFiles.length; i++) { var jsonFile = audioFiles[i].replace('.mp3', '.json'); var json...
[ "function canPlayMp3()\n{\n var a = document.createElement('audio');\n return (a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));\n}", "deleteOldFiles()\n {\n var that = this;\n \n glob(config.mediaBasePath + \"/voice-*.mp3\", {}, function(err, files)\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
slices the daysAgoarray to "amount". if there are less, then fills the days with zerovalues if there are more, they are cut
function sliceStats(level, amount) { var tempStats = statData; if (tempStats[level].daysAgo.length < amount) { //console.log('length < amount, filling'); tempStats = fillDays(level, amount, tempStats); } if (tempStats[level].daysAgo.length > amount) { //console.log('length > amount,...
[ "limitArray(arr, limitTimeframeInSeconds){\n if(typeof limitTimeframeInSeconds && !limitTimeframeInSeconds){\n return arr;\n }\n limitTimeframeInSeconds = limitTimeframeInSeconds || 120;\n let timeInMS = limitTimeframeInSeconds * 1000;\n try{\n if(arr && arr.hasOwnProperty('earliestTime')){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cancel the dialog and then close it
cancel () { this.close(); this._reject(new Error('User closed dialog.')); }
[ "@action closeDialog() {\r\n\t\tif (this.dialog) this.dialog.opened = false;\r\n\t}", "function recordsetDialog_onClickCancel(theWindow)\r\n{\r\n // No need to do any additional processing for now.\r\n dwscripts.setCommandReturnValue(recordsetDialog.UI_ACTION_CANCEL);\r\n theWindow.close();\r\n}", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the outageType state, which is selected in the Form component
handleOutageType(value) { this.setState({outageType: value}); }
[ "setOptionValueType (event) {\n let selectedIndex = this.valueTypeRef.selectedIndex\n let selected = this.valueTypeRef.options[selectedIndex]\n this.setState({\n 'optionType': selected.value\n })\n }", "setButtonType(buttonType)\n {\n this.buttonType = buttonType;\n this.to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Para mostrar la capa con el calendario
function mostrarCalendario() { document.getElementById("capaCalendario").style.display="block"; }
[ "function mostrar_segunda_web(){\r\n document.getElementById(\"cabecera_aula\").style.display = 'block';\r\n document.getElementById(\"lema_aula\").style.display = 'block';\r\n document.getElementById(\"contenido_aula\").style.display = 'block';\r\n }", "function mostrarFecha(){\n var fecha = n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gestionar la llamada de callback al intentar iniciar sesion con google+
function signinCallback(authResult) { if (authResult['access_token']) { // Evitar el inicio de sesion automatico con el valor(PROMPT) de la propiedad "METHOD" if(authResult['status']['method'] == "PROMPT"){ gapi.auth.setToken(authResult); gapi.client.load('oauth2', 'v2', func...
[ "function register(){\n\tfunction asyncCallback(status, result){\n \tkony.print(\"\\n------status------>\"+status);\n \tif(status==400){\n \t\tkony.print(\"\\n------result------>\"+JSON.stringify(result));\n \t\tif(result[\"opstatus\"]==8009)\n \t\t{\n \t\t\tif(result[\"message\"]!=undefined)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update values Object with any changed arg values save arg clone if possible otherwise save arg with new valueMap
function getArgsValue(args, priorValueMap, values) { var valueMap = {}; Object.keys(args).forEach(function(idx) { if (args[idx] instanceof Object) //save any changed arguments { idx = isNaN(idx) ? idx : parseInt(idx); if (EZ.valueMap(args[idx], priorValueMap[i...
[ "setValue(attributeName, value) {\n const arg = this.args[attributeName];\n const newIdx = arg ? arg.values.indexOf(value) : 0;\n\n if (arg && newIdx !== -1 && newIdx !== arg.idx) {\n arg.idx = newIdx;\n this.emit('state.change.value', {\n value: arg.values[arg.idx],\n idx: arg.idx,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EmailIngestionProfile Add action allows you to add a EmailIngestionProfile to Kaltura DB.
static add(EmailIP){ let kparams = {}; kparams.EmailIP = EmailIP; return new kaltura.RequestBuilder('emailingestionprofile', 'add', kparams); }
[ "static update(id, EmailIP){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.EmailIP = EmailIP;\n\t\treturn new kaltura.RequestBuilder('emailingestionprofile', 'update', kparams);\n\t}", "static get(id){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\treturn new kaltura.RequestBuilder('emailingestionp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mutations called from WeatherSort.vue
UPDATE_SORT(store,sort){ // only update sort store if different sort is selected // I noticed clicking on sort buttons multiple times was messing with sort so I added this extra check if (store.selectedSort !== sort){ store.selectedSort = sort store.weatherData = sortArra...
[ "_refreshSortData() {\n if (this._isDestroyed) return;\n\n const data = (this._sortData = {});\n const getters = this.getGrid()._settings.sortData;\n let prop;\n\n for (prop in getters) {\n data[prop] = getters[prop](this, this._element);\n }\n }", "componentDidUpdate() {\n if (this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Safely compare two MACs. This function will compare two MACs in a way that protects against timing attacks. TODO: Expose elsewhere as a utility API. See:
function compareMacs(key, mac1, mac2) { var hmac = forge.hmac.create(); hmac.start('SHA1', key); hmac.update(mac1); mac1 = hmac.digest().getBytes(); hmac.start(null, null); hmac.update(mac2); mac2 = hmac.digest().getBytes(); return mac1 === mac2; }
[ "function isStrangePair(str1, str2) {\n\treturn (str1[0] === str2[str2.length -1] && str1[str1.length -1] === str2[0]);\n}", "function sameAscii(a, b) {\n\tc = 0;\n\td = 0;\n\t\n\tfor (let i = 0; i < a.length; i++) {\n\t\tc += a.charCodeAt(i);\n\t}\n\t\n\t\tfor (let i = 0; i < b.length; i++) {\n\t\td += b.charCod...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get value of a property and wrap it in a object in the 'codename' property
function getObjectCodenameProperty (data, property) { let value = null; if (data.hasOwnProperty(property)) { value = { codename: data[property].toString() }; } return value; }
[ "get propertyName() {}", "async expandProperty(property) {\n // JavaScript requires keys containing colons to be quoted,\n // so prefixed names would need to written as path['foaf:knows'].\n // We thus allow writing path.foaf_knows or path.foaf$knows instead.\n property = property.replace(/^([a-z][a-z...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns: 'normal' for old style slots `` 'scoped' for old style scoped slots (``) or bound vslot (`default="data"`) 'vslot' for unbound vslot (`default`) only if the third param is true, otherwise counts as scoped
function getSlotType(vm, name, split) { if (vm.$slots[name] && vm.$scopedSlots[name] && vm.$scopedSlots[name].name) { return split ? 'v-slot' : 'scoped'; } if (vm.$slots[name]) return 'normal'; if (vm.$scopedSlots[name]) return 'scoped'; }
[ "slot$(name,ctx){\n\t\tvar slots_;\n\t\tif (name == '__' && !this.render) {\n\t\t\treturn this;\n\t\t}\t\t\n\t\treturn (slots_ = this.__slots)[name] || (slots_[name] = imba$1.createLiveFragment(0,null,this));\n\t}", "function mySlotChange(eventData) {\n\t\t// $log.log(preDebugMsg + \"mySlotChange() \" + eventData...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates jobSelect appended to div jobMoveDrop
function showJobSelect(){ showSelect(appendJobSelect, jobMoveDrop, empMoveCancel, showMoveEmp, "jobSelected", "jobsArray", "jobs", showFullEmpMoveMenu, hideFullEmpMoveMenu); }
[ "function makeSelectField() {\n\t\tvar formTag = document.getElementsByTagName(\"form\"), //formTag is an array of all the form tags\n\t\t\tselectDiv = $(\"selectDiv\"),\n\t\t\tmakeSelect = document.createElement(\"select\");\n\t\t\tmakeSelect.setAttribute(\"id\", \"dropdownSelect\");\n\t\tfor(var i=0, j=pebbleGrou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Debug function to paint all intervals.
paintIntervals() { $paints.forEach($paint => document.body.removeChild($paint)); $paints = []; this.intervals.forEach(interval => { $paints.push(this.paint(interval)); }); console.log(this.intervals); }
[ "draw(interval) {\n this._context.translate(this._traceBox.x, this._traceBox.y);\n const tickMarks = this._ticks(interval);\n const tickValues = tickMarks.ticks;\n const tickFormat = tickMarks.params.formatter;\n\n this._context.beginPath();\n for (const tick of tickValues) {\n const xPos = M...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets all queries that depend on the specified fields
function queriesForFields(className, fields) { var classTree = queryFamilies[className]; if (!classTree) { return []; } var queries = {}; fields = fields.concat(''); for (var i = 0; i < fields.length; i++) { if (classTree[fields[i]]) { for (var hash in classTree[fields[i]]) { queries[h...
[ "function selectFields(camposSelecionados){\n var query;\n query = 'SELECT * ';//+ camposSelecionados;\n return query;\n}", "fields(fields) {\n fields = Array.isArray(fields) && arguments.length === 1 ? fields : Array.prototype.slice.call(arguments);\n\n var schema = this.schema();\n\n for (var val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Moves the sound at the event grandparent down by one / FIXME: DOM dependency
function moveSoundDown(e) { var thisSound, nextSound, playlist; e.preventDefault(); thisSound = this.parentNode.parentNode; nextSound = thisSound.nextElementSibling; playlist = thisSound.parentNode; if ( nextSound ) { nextNextSound = nextSound.nextElementSibling; if ...
[ "function goDown() {\n if (currentSectionIndex + 1 <= allSections.length - 1) {\n goToSection(currentSectionIndex + 1);\n } else {\n goToSection(0);\n }\n playRandomPeelingSound();\n }", "function endSound() {\n winSound.play();\n}", "function playNextLevelSound()\n{\n\tvar random = getR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The recursive implementation behind the publicly exposed function. Recursively builds up a callable form of the given function pased on the terms provided.
function termsToChainedFunction( terms, f, argumentsAlreadyProvided, packaging ) { var wrappedFunction = wrappedForChaining(terms, f, argumentsAlreadyProvided); return packaging( wrappedFunction, terms ); }
[ "function recursiveFunction(someParam) {\n recursiveFunction(someParam)\n}", "function liftg(binary){\n return function(first){\n if(first === undefined){\n return first;\n }\n return function more(next){\n if(next === undefined){\n return first;\n }\n first = binary(first,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Middleware that checks if a user is logged in. If so, the request continues to be processed, otherwise a 403 is returned.
function isLoggedIn(req, res, next) { if (res.locals.currentUser) { next(); } else { res.sendStatus(403); } }
[ "function isLoggedIn(request, response, next) {\n if(request.isAuthenticated()) {\n console.log('user is authenticated');\n next();\n } else {\n console.log('not authenticated');\n response.redirect('/');\n }\n }", "function prevent(req, res, next) {\n if(!req.isAuthenticated()){\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a VERY unoptimized way of correctly allocating tab/accordion open states between states.
function toggleActiveCollapse(tab, accordion){ // purpose: pass along active/collapse states to ensure parity between the two // detect whether a tab or accordion header was clicked // toggle the counterpart's states var $tab = $('#' + tab), $accordion = $('#' + accordion), ...
[ "switchState(state){\n\t\tthis.currentState = state;\n\t\tswitch(state){\n\t\tcase configNamespace.STATE_MACHINE.START:\n\t\t\tthis.drawStartPage();\n\t\t\tthis.longInfoText = infoTextsNamespace.longPageDescription.startPage;\n\t\t\tthis.drawShortInfoText(infoTextsNamespace.shortPageDescription.startPage);\n\t\t\tt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to change urlBar's UI
function updateURL() { if (gURLBar.focused || editing || window.getComputedStyle(gURLBar).visibility == "collapse") return; // checking if the identity block is visible or not (firefox 12+) try { origIdentity.collapsed = false; } catch (ex) {} urlValue = decodeURI(getURI().spec); if ...
[ "function handleURLBarEvents() {\n // Watch for urlbar value change\n let changeListener = {\n onLocationChange: function(aProgress, aRequest, aURI) {\n newDocumentLoaded = true;\n refreshRelatedArray = true;\n if (!tabChanged)\n origIdentity.collapsed = identi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the last date in the log file to resume streaming. Returns config.headers.lastLineDate if the log file isn't found.
function getLastEventDate() { try { const lastLineBuf = childProcess.execSync(`tail -1 ${config.logFilePath}`); const lastLine = lastLineBuf.toString('utf8'); const lastEventDate = lastLine.substring(0, 20); if (lastEventDate === '') { throw new Error({ message: 'No date found in file.' }); ...
[ "function today () {\n const filePath = util.currentLogPath();\n return io.read(filePath).then(chunks => {\n const dataObjs = binary.parseChunks(chunks);\n return dataObjs.map(dataObj => parseData(dataObj));\n });\n}", "function YInputChain_get_lastEvents()\n {\n var content; // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removing this album from the user's favours
function removeFromFavourites(e) { isFavourite = false const url = '/unfavourAlbum'; const data = { albumID: album._id } // Create our request constructor with all the parameters we need const request = new Request(url, { method: 'post', body: JSON.stringify(data), headers: { 'Acce...
[ "function removeFavourite(obj) {\n\tconst newFavArray = favArray.filter((item) => item.gif !== obj.gif);\n\tfavArray = [...newFavArray];\n\tlocalStorage.setItem(\"favourites\", JSON.stringify(favArray));\n\tlet isFavHidden = $favouriteSection.classList.contains(\"hidden\");\n\tif (!isFavHidden) {\n\t\t$maxGifSectio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
lock_token computed: true, optional: false, required: false
get lockToken() { return this.getStringAttribute('lock_token'); }
[ "get locked() { return false }", "get locker() {\n return this._locker || (this._locker = new InMemoryLock())\n }", "visitUser_lock_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function SingletonLock() {}", "setLocked () {\n this.platform.sendMessage({ action: 'metamask-set-locked' })\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a new ``uint112`` type for %%v%%.
static uint112(v) { return n(v, 112); }
[ "static uint120(v) { return n(v, 120); }", "static uint56(v) { return n(v, 56); }", "static uint(v) { return n(v, 256); }", "static uint144(v) { return n(v, 144); }", "static uint240(v) { return n(v, 240); }", "static uint32(v) { return n(v, 32); }", "static uint104(v) { return n(v, 104); }", "static ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
run controller code in CtrlAddAction.js
function Run_CtrlAddAction( config ) { if (AddAction_Controller) AddAction_Controller( config ); }
[ "function Run_CtrlViewActions( config ) {\n\tif (ViewActions_Controller)\n\t\tViewActions_Controller( config );\n}", "function Run_CtrlRegistration( config ) {\n\tif (Registration_Controller)\n\t\tRegistration_Controller( config );\n}", "function controller_by_user(){\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t} catch(e){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete_reservation reservation function updates reservation from reservations table input: attraction > name of attraction reserved input: account_id > user id of logged in account input: old_num_people > original number of people in reservation input: old_time > original time of reservation input: old_date > original ...
update_reservation(account_id, attraction, old_time, old_date, new_attraction, new_time, new_date) { let sql = "UPDATE reservations SET attractionRideName=$new_attraction, time=$new_time, date=$new_date WHERE attractionRideName=$attraction AND time=$old_time AND date=$old_date AND user=$user"; this.db.r...
[ "delete_reservation(attraction, account_id, res_time, res_date) {\n let sql = \"DELETE FROM reservations WHERE attractionRideName=$attraction AND time=$time AND date=$date AND user=$user\";\n this.db.run(sql, {\n $attraction: attraction,\n $time: res_time,\n $date: res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a style function usable with a GeoJSON layer. tracts is a list of Tract objects. data_point is a reference to an estimate in each tract's data. colors is a color set usable by get_color_list().
function get_style_function(tracts, data_point, colors) { var value, data = {}, histogram = [], minimum, maximum, color_list = get_color_list(colors); for(var i = 0; i < tracts.length; i++) { if(data_point == RESPONSES) { value = tracts[i].responses; ...
[ "function assignStyle(geojson) {\n for (let e in geojson.features) {\n let d = geojson.features[e].properties['DIST'];\n let color;\n switch(parseInt(d)) {\n case 1:\n color = \"#800000\";\n break;\n case 2:\n color = \"#8080...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Marks the button toggle as needing checking for change detection. This method is exposed because the parent button toggle group will directly update bound properties of the radio button.
_markForCheck() { // When the group value changes, the button will not be notified. // Use `markForCheck` to explicit update button toggle's status. this._changeDetectorRef.markForCheck(); }
[ "function trackRadioButtonState(elem, question) {\n\t\t\t\tquestion.Answers.isChecked = false;\n\t\t\t\tfor (var n = 0; n < question.Answers.length; n++) {\n\t\t\t\t\tquestion.Answers[n].isChecked = false;\n\t\t\t\t}\n\t\t\t\tquestion.isChecked = false;\n\t\t\t\tfor (var i = 0; i < question.Answers.length; i++) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write `data` to a `stream`. if the buffer is full will block until it's flushed and ready to be written again. [see](
function lowWrite(stream, data) { return new Promise((resolve, reject) => { if (stream.write(data)) { process.nextTick(resolve); } else { stream.once("drain", () => { stream.off("error", reject); resolve(); }); stream.once("error", reject); } }); }
[ "function ByteStream(data) {\n this.data = data;\n this.pos = 0;\n }", "async flush() {\n if (this.err !== null)\n throw this.err;\n if (this.n === 0)\n return;\n let n = 0;\n try {\n n = await th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrapper around callback to ensure locked tasks aren't toggled
toggleHandler() { let currentTask = this.props.task; if (!this.isLocked(currentTask)) this.props.toggleCallback(currentTask); }
[ "get locked() { return false }", "lock() {\n const iab = this.iab;\n const stateIdx = this.ibase;\n var c;\n if ((c = Atomics.compareExchange(iab, stateIdx,\n UNLOCKED, LOCKED_NO_WAITERS)) !== UNLOCKED) {\n do {\n if (c === LOCKED_POSSIBLE_WAITERS\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Concat two path into one.
function concatPath(a, b) { if (NodePath.sep === "\\") { return NodePath.normalize(a + "/" + b).replace(/\\/g, "/"); } else { return NodePath.normalize(a + "/" + b); } }
[ "function concatURI(a, b) {\n let started = b[0] === \"/\";\n let ended = a[a.length - 1] === \"/\";\n if (started && ended) {\n return `${a}${b.substr(1)}`;\n }\n if (started || ended) {\n return `${a}${b}`;\n }\n return `${a}/${b}`;\n}", "function joinPath(portion1, portion2) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetching a users projects/cell data table information from flux server
fetchData() { helpers.getUser().listProjects().then(projects => { var projectEntries = projects.entities.map(project => helpers.getUser().getDataTable(project.id).listCells()) Promise.all(projectEntries).then(projectEntries => { var cells = projectEntries.map(cell => cell.entities) this.setState({cells:...
[ "async refreshProjectsTableData ({ state, dispatch }, userId) {\n if (state.show_everyones_projects) {\n dispatch('fetchAllProjects')\n } else {\n dispatch('fetchUserProjects', userId)\n }\n }", "componentDidMount() {\n this.fetchUser();\n this.fetchProject(this.props.match.params.id);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves the image to a Meteor Collection called sketches. To check the collection's data: cd into the project directory and run mongo shell while an instance of the app is running
function save() { var image = canvas.toDataURL("image/png"); //grab the title the user entered var title = document.getElementById('nameForm').value; //save into collection called sketches, this is found in items.js Meteor.call('sketches.insert', title , image); console.log(title+" has been sav...
[ "\"/convertImages\"(req,res) {\n\n\t\tapp.run(function* (resume) {\n\n\t\t\t// get all plants from the database\n\t\t\tvar plants = yield app.db.collection(\"plant\").find().toArray(resume);\n\n\t\t\tfor(var i = 0; i<plants.length; i++) {\n\t\t\t\tvar plant = plants[i];\n\t\t\t\tvar img = plant.image;\n\n\t\t\t\tva...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FileSystemProvider Create a new filesystem based template provider with the given options.
function FileSystemProvider(opts) { this.directory = directory.resolver(opts || "./views"); }
[ "constructor ( name, options = {} ) {\n if (name === undefined) throw new Error('Pass a name to TemplateSet')\n \n // The name of the template set to use.\n // This will be used as the directory in `base_path` to read the template from\n this.base_name = name\n \n // The base path where the nam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add a note, with a connecting line on the left if we have one
noteAt(note, glyph, withLineTo = true) { if (!note) throw "NeumeBuilder.noteAt: note must be a valid note"; if (!glyph) throw "NeumeBuilder.noteAt: glyph must be a valid glyph code"; note.setGlyph(this.ctxt, glyph); var noteAlignsRight = note.glyphVisualizer.align === "right"; var needsLine = ...
[ "createNote(){\n let note = Text.createNote(this.activeColor);\n this.canvas.add(note);\n this.notifyCanvasChange(note.id, \"added\");\n }", "drawNote() {\n push();\n colorMode(HSB, 360, 100, 100);\n stroke(this.color, 100, 100, 100);\n fill(this.color, 100, 100, 100);\n let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the HTML Table out of myList.
function buildHtmlTable() { var columns = addAllColumnHeaders(myList); for ( var i = 0; i < myList.length; i++) { var row$ = $('<tr/>'); for ( var colIndex = 0; colIndex < columns.length; colIndex++) { var cellValue = myList[i][columns[colIndex]]; if (cellValue == null) { cellValue = ""; } row$...
[ "function buildHtmlTable(myList, selector) {\n let columns = addAllColumnHeaders(myList, selector);\n for (let i = 0; i < myList.length; i++) {\n let row$ = $('<tr/>');\n for (let colIndex = 0; colIndex < columns.length; colIndex++) {\n let cellValue = myList[i][columns[colIndex]];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
First, Draw bars and numbers to show Concurrency Next, draw got nodes and loop through all outgoing edges, drawing them as well Also, check for targets and draw corresponding arcs
function drawNodesAndEdges(sourceTurns, canvas, ctx, dotAlpha, glyphMap) { var i, conVats = {}, // storing last turn in proc order, [vat name] = sourceturns index conx, cony, //stores previous draw position for turn src, //source file from prev vat elem...
[ "function drawVCDAG() {\n\n var vcPartialOrders = findVCPartialOrdering()\n startXpos = 20\n distanceBtwnNodes = 75\n\n startYPos = 50\n distanceBetweenGraphs = 100\n\n d3.select(\"#vectorClocksOrderingSVG\").remove()\n var vcOrderingSVG = d3.select(\"#vectorClocksOrderingDiv\")\n .appen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function sendAndUpdate(xhr, json) is a function that sends data to a servlet
function sendAndUpdate(xhr, json) { xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8'); xhr.send(json); xhr.onreadystatechange = function () { if(xhr.readyState == 4){ if(xhr.status == 200){ document.getElementById('input_box').innerHTML = ""; ...
[ "function sendAndUpdate(xhr, json) {\n xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n xhr.send(json);\n xhr.onreadystatechange = function () {\n if(xhr.readyState == 4){\n if(xhr.status == 200){\n document.getElementById('input_box').innerHTML = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A schema is classified as a schema for a single property if: `type` is defined on the schema as a string. OR `default` is defined on the schema, as a reserved keyword. OR schema is empty.
function isSingleProperty (schema) { if ('type' in schema) { return typeof schema.type === 'string'; } return 'default' in schema; }
[ "schema(schema) {\n if (arguments.length) {\n this._schema = schema;\n return this;\n }\n if (!this._schema) {\n this._schema = this.constructor.definition();\n }\n return this._schema;\n }", "function schemaToSampleObj(schema) {\n var config = arguments.length > 1 && arguments[1] ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Login function This function is calling another functions inside such us: fetchOrder("status") to create status database at sessionStorage And it perform login function using array of users with passwords
function login() { fetchOrder("status"); var users = [{ name: "John Doe", password: "matrix", role: "Wherehouse Junior Manager" }, { name: "Agent Smith", password: "kill neo", role: "Heavy Duty Lift Technician" }, { name: "Agent Brown", pas...
[ "function logIn(){\r\n\t\t// username and password are what user types in, newuser is checked if the user\r\n\t\t// is creating a new account. newuser is boolean\r\n\t\tlet username = document.getElementById(\"username\").value;\r\n\t\tlet password = document.getElementById(\"password\").value;\r\n\t\tlet newuser =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes all data from the sheets (except the config)
function clearAllSheetData(){ var sheets = ['lists', 'bounced', 'paid', 'expired', 'log', 'otherdata'], sheet, rows, x, y, i, j; getScriptLock(); try{ for(x = 0, y = sheets.length; x < y; x++){ sheet = constants.ss.getSheetByName(constants.sheets[sheets[x]].name); rows = sh...
[ "function clearConfig() {\n const configSheet = getConfigSheet();\n const namedRanges = configSheet.getNamedRanges();\n namedRanges.forEach((namedRange) => {\n if (namedRange.getName() === 'gradeValues'\n || namedRange.getName() === 'gradeRanges') {\n const gradeRange = namedRange.getRange();\n f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter items with month select value
static filterMonth(items) { const month = document.getElementById("month-select").value; return items.filter((item) => item.date.split("-")[1] == month); }
[ "function _filterByMonth(override) {\n\t\tif(override) _offerModule.filterByMonth(override);\n\t\telse _offerModule.filterByMonth(_activeFilterButton.attr('month'));\n\t}", "function filter_by_month() {\n //get the value of the month and year the user wants to query\n let year_month = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output: | See the volume breakdown for the Osprey Women's Aura AG 50 Pack. | | The Osprey Women's Aura AG 50 Pack holds 55 liters, which is the 4th highest | capacity backpacking backpack for women [, and the 3rd highest capacity pack for men].
function generateMadlibsVolume(p, products) { var clause = null; if (p.gender == 'male') { const volume = getStats(p, segmentByVolume(p.gender, products)); clause = `which is the ${ordinal(volume.position)} highest capacity backpacking backpack for men in our database`; } else if (p.gender =...
[ "function generateMadlibsIntro(product) {\n var numVariants = \"one size\";\n if (product.sizes.data.length === 2) {\n numVariants = `two sizes (${product.sizes.data.join(\", \")})`;\n }\n if (product.sizes.data.length === 3) {\n numVariants = `three sizes (${product.sizes.data.join(\", \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upgrades all registered components found in the current DOM. This is automatically called on window load.
function upgradeAllRegisteredInternal() { for (var n = 0; n < registeredComponents_.length; n++) { upgradeDomInternal(registeredComponents_[n].className); } }
[ "function attachOnDOM(){\n\tdocument.getElementsByTagName('body')[0].appendChild(getComponent())\n}", "function activateCurrentComponents() {\n\t\tcurrentChild.children('.koi-component')\n\t\t\t.removeClass('deeplink-component-disabled')\n\t\t\t.trigger('load-component');\n\t}", "setDomElements() {\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroys a theme by id.
function destroy(id) { return models.Theme .destroy({ where: { id } }); }
[ "function destroy(id) {\n\treturn db.none(`DELETE FROM tours WHERE id=$1`, [id]);\n}", "function destroy(id){\n\t$('#btn-clear').css('z-index', '0');\n\tid = id.replace('-po', '');\n\t$('#' + id).popover('destroy');\n\t$.mask.close();\n\tif(id == \"eng-btn\"){\n\t\tarBtnPopOver();\n\t}\n\telse if(id == \"ar-btn\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function : updateMovement instructs gamemanager to handle hero movement Parameters: hm hero movement function responsible for updating hero Returns: void
function updateMovement(hm, key) { switch(key) { case W: hm(0,-1); break; case A: hm(-1,0); break; case S: hm(0,1); break; case D: hm(1,0); break; default: break; } }
[ "function updateHero(){\n\t\t// Attach a click event onto each character element to allow the player to pick one as\n\t\t// a hero.\n\t\t$(\".character\").on(\"click\", function(){\n\t\t\t\t// Load Hero Data into Hero object for use in the game\n\t\t\t\thero = { \n\t\t\t\t\tname:$(this).attr(\"data-name\"),\n\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all topic Names for one user in A group
function GetTopicNameArray(data, options){ var self = this; var selectSql = 'select t.topicID, t.topicName from user_topic as ut left join topics as t on t.topicID=ut.topicID where t.groupID=data.groupID and ut.userID=data.userID;'; self.connection.query(selectSql,function (err, result) { if(err){ ...
[ "function getGroupNames(){\n var ret = [];\n for (var i = 0; i < this.groups.length; i++) {\n ret.push(this.groups[i].name);\n }\n return ret;\n}", "function getTopicInfo()\n\t{\tvar userid= {};\n\t\tvar posts ={};\n\t\t\t\t\t\n\t\t\tPostFactory.getTopicInfo($routeParams, function (result){\t\n\t\t\tif(res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `ReplicationTimeValueProperty`
function CfnBucket_ReplicationTimeValuePropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but re...
[ "function CfnBucket_ReplicationTimePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
m [pubKeys ...] n OP_CHECKMULTISIG
function multisigOutput (m, pubKeys) { typeforce(types.tuple(types.Number, [types.Buffer]), arguments) var n = pubKeys.length if (n < m) throw new Error('Not enough pubKeys provided') return compile([].concat( OP_INT_BASE + m, pubKeys, OP_INT_BASE + n, OPS.OP_CHECKMULTISIG )) }
[ "function mMultiTest(m1,v){\n\tif(v[0].length !== 1){\n\t\tthrow new Error('ERROR: v[0].length !== 1')\n\t}\n\tif(m1[0].length !== v.length){\n\t\tthrow new Error('ERROR: m1[0].length !== v.length')\n\t}\n\tif(m1.length < 1 || v.length < 1){\n\t\tthrow new Error('ERROR: m1.length < 1 || v.length < 1')\n\t}\n\tif(m1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialization of the LoRa module
function loraInit() { lora = new RN2483(Serial2, {reset:B0}); lora.getStatus(function(x){console.log("Device EUI = " + x.EUI);}); // Setup the LoRa module setTimeout(function() {Serial2.println("mac set appeui " + appEUI);} , 1000); setTimeout(function() {Serial2.println("mac set appkey " + appKey);}, 2000)...
[ "function initialize() {\n\tpru.loadDatafile(1, 'pwm_data.bin');\n\tpru.execute(1, 'pwm_text.bin', 408);\n\tzeroMotors();\n}", "function initialize(){\n seconds = 0;\n INITIALIZING = true;\n SAVE_DATA = false;\n GEN_PASSENGERS = false; //If true, we are waiting for Python to return from Generating Pas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if a point is the start point of a location.
isStart(editor, point, at) { // PERF: If the offset isn't `0` we know it's not the start. if (point.offset !== 0) { return false; } var start = Editor.start(editor, at); return Point.equals(point, start); }
[ "isStart(editor, point, at) {\n // PERF: If the offset isn't `0` we know it's not the start.\n if (point.offset !== 0) {\n return false;\n }\n\n var start = Editor.start(editor, at);\n return Point.equals(point, start);\n }", "function LetterB_checkStart(x, y) {\n\t// alert(\"ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the "Match Day" wrapper BBCode for each day of the event
function createMatchDayLR(LRtext, currentMatchDay) { var dateVal = getMatchDate(currentMatchDay); var timeVal = $("input[name='time-cntl']", currentMatchDay).val(); var tzVal = $("input[name='tz-cntl']", currentMatchDay).val(); $(LRtext).append("[b][blue][big][date]"); $(LRtext).append(dateVal); $(LRtext).append...
[ "function createMatchDay() {\n\t\n\t// Create matchDay div\n\tvar matchDayElement = document.createElement('div');\n\tmatchDayElement.className = 'matchDay';\n\t$(matchDayElement).append('<h3>Match Day</h3>');\n\n\t// Add the date and time inserts\n\tcreateDateInput(matchDayElement, 'matchDayDateTime');\n\n\t// Add...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Array of bundles removed durring edit.
function bundlesRemove() { return bundlesDiffernce(preEditBundles(), postEditBundles()); }
[ "function postEditBundles() {\n var bundles = [];\n if ($scope.profile.bundle && $scope.profile.bundle.length) {\n bundles = bundles.concat($scope.profile.bundle);\n }\n if ($scope.selectedProtectedBundles && $scope.selectedProtectedBundles.length) {\n bundles = bundles.concat($scope.selectedP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a NetMask address representation
function createNetmaskAddr(bitCount) { var mask = [], i, n; for (i = 0; i < 4; i++) { n = Math.min(bitCount, 8); mask.push(256 - Math.pow(2, 8 - n)); bitCount -= n; } return mask.join('.'); }
[ "function getIpRangeFromAddressAndNetmask(str) {\r\n var part = str.split(\"/\"); // part[0] = base address, part[1] = netmask\r\n var ipaddress = part[0].split('.');\r\n var netmaskblocks = [\"0\", \"0\", \"0\", \"0\"];\r\n if (!/\\d+\\.\\d+\\.\\d+\\.\\d+/.test(part[1])) {\r\n // part[1] has to ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
refresh targets from application state
function refreshTargets(cb, err) { log('refreshTargets()') const targets = state.getTargets() log(targets) const out = {} // pair down the result for (var id in targets) { out[id] = { size: targets[id].size, index: targets[id].index, watching: {} } Object.keys(targets[id].watching).forEach(profile ...
[ "updateTargetCategories() {\n this.targetCategoryResults.length = 0;\n if (!this.targetQuery) {\n return;\n }\n this.editSelectedTargets = false;\n this.showTargetLoader = true;\n this.addMappingService_\n .findCategory(this.selectedTargetProviderId, this.targetQuery)\n .then(\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the sum of integers from FROM to TO. For example: sumRange(3, 6); Returns: 18 (= 3 + 4 + 5 + 6)
function sumRange(from, to) { var sum = 0; for (var i = from; i <= to; i++) { sum += i; } return sum; }
[ "function sumRange(num1, num2) {\n let sum = num1 + num2;\n if (sum >= 50 && 80 >= sum) return 65;\n else return 80;\n}", "function computeSumBetween(num1, num2) {\n\tvar results = 0;\n\tvar count = num1;\n\twhile (num1 < num2){\n\tresults = results + count++;\n\tnum2--;\n\t}\n\treturn results;\n}", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method opens a namespace channel for a message bus It then receives messages through onMessage and gets filtered into our communication protocol cases. For more info on castMessageBus, visit:
function setupMessageBus() { // create message bus for communications between receiver and sender window.castMB = castReceiverManager.getCastMessageBus(window.namespace) // onMessage gets called every time the sender sends a message // It receives messages through ooyala's message bus window.castM...
[ "function shovelToLocalBus(msg) {\n //announce to the local bus that a bitcoin tx has been broadcast\n localbus_pub.publish(CHANNEL_READER, msg);\n}", "function createMessageChannel(options, port) {\n var { channelName, endAtPage } = options;\n\n if (typeof channelName != 'string') throw new Error('cr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
class: SteadyDetector Detects steady event: steady Triggered when hand is steady. Triggered only once per steady event: unsteady Triggered when hand is unsteady. Triggered only once per unsteady.
function SteadyDetector(maxVariance) { if (undefined === maxVariance) { maxVariance = 50; } var frameCount = 15; var pointBuffer = []; var maxVariance = maxVariance; var events = Events(); function sumMatrix(mat) { var sum = 0; elements = mat.elements for(var i=0; i<elements.length; i++) ...
[ "function SwipeDetector() {\r\n\tvar events = Events();\r\n\tvar horizontalFader = Fader(Orientation.X);\r\n\tvar verticalFader = Fader(Orientation.Y);\r\n\tvar api = {\r\n\t\t// property: driftAmount\r\n\t\t// How fast should the swipe detector follow the hand point\r\n\t\tdriftAmount : 20,\r\n\t\t// property: hor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: resultant USAGE: resultant(major_generator, minor_generator); DESCRIPTION: This function will generate a Schillinger resultant based on two integers for the major generator and minor generator and return this as an array to the calling function. INPUTS: major_generator First generator for the resultant minor_...
function resultant(major_generator, minor_generator) { // var major_generator = 7; // var minor_generator = 3; var total_counts = major_generator * minor_generator; var result_counter = 0; var major_mod = 0; var minor_mod = 0; var i = 0; var j = 0; var resultant = []...
[ "function genMEDigestion(enzyArray) {\r\n //max emzymes == 3\r\n var array = [];\r\n\r\n //at least have 2 enzymes\r\n if (enzyArray.length > 1) {\r\n if (enzyArray.length == 2) {\r\n array.push([enzyArray[0], enzyArray[1]]);\r\n }\r\n else {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get the input ellipsoids from the standard class URL
function getInputEllipsoids() { const INPUT_ELLIPSOIDS_URL = "https://ncsucgclass.github.io/prog1/ellipsoids.json"; // load the ellipsoids file var httpReq = new XMLHttpRequest(); // a new http request httpReq.open("GET",INPUT_ELLIPSOIDS_URL,false); // init the request httpReq.send...
[ "function getEarthLayers() {\n // Init Iframes required for viewing elements properly in earth on Windows.\n initIframes();\n // Set up the layer list element and add the name as a header.\n var div = document.getElementById('LayerDiv');\n div.style.display = 'block';\n var name = window.location.pathname;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a padding of the given width on the right of the body.
_adjustBody(scrollbarWidth) { const body = this._document.body; const userSetPaddingStyle = body.style.paddingRight; const actualPadding = parseFloat(window.getComputedStyle(body)['padding-right']); body.style['padding-right'] = `${actualPadding + scrollbarWidth}px`; return () =>...
[ "function pad_right(s, width, fill) /* (s : string, width : int, fill : ?char) -> string */ {\n var _fill_23035 = (fill !== undefined) ? fill : 0x0020;\n var w = $std_core._int_to_int32(width);\n var n = s.length;\n if ((w <= n)) {\n return s;\n }\n else {\n return (s + (repeat32(string(_fill_23035), (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }