query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Function to variable set correct padding based on number of nodes
function setNewPadding(sankeyData) { columnMap = new Map(); for (const [key, value] of Object.entries(sankeyData.nodes)) { if (columnMap.has(value.assessment)) { columnMap.set(value.assessment, columnMap.get(value.assessment) + 1) } else { columnMap.set(value.asse...
[ "static getNodePaddingToTargetNodes(node, targetNodes, links, linkType) {\n\t\tlet padding = 0;\n\t\tif (linkType === \"Elbow\") {\n\t\t\tconst maxIncrement = this.getCountOfLinksToTargetNodes(node, targetNodes, links) * node.layout.minInitialLineIncrement;\n\t\t\tpadding = node.layout.minInitialLine + node.layout....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
simulate ATM boot and startup
function bootATM() { console.clear(); console.log('Booting...'); console.log('ATM connecting to remote services...'); setTimeout(function () { console.clear(); runApp(); } , 5000); }
[ "async boot () {\n this.log.debug('Booting emulator ...')\n\n /**\n * throw properly when vdi medium couldn't be loaded\n */\n try {\n await VirtualBox.manage(['startvm', this.uuid])\n } catch (err) {\n this.log.errorAndThrow(err)\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
\ Function : viewSource() Description : Shows the HTML source code generated by the WYSIWYG editor Usage : showFonts(n) Arguments : n The editor identifier (the textarea's ID) \
function viewSource(n) { var getDocument = document.getElementById("wysiwyg" + n).contentWindow.document; var browserName = navigator.appName; // View Source for IE if (browserName == "Microsoft Internet Explorer") { var iHTML = getDocument.body.innerHTML; getDocument.body.innerText = iHTML; } ...
[ "function viewSource(n) {\r\n var getDocument = document.getElementById(\"wysiwyg\" + n).contentWindow.document;\r\n var browserName = navigator.appName;\r\n\t\r\n\t// View Source for IE \t \r\n if (browserName == \"Microsoft Internet Explorer\") {\r\n var iHTML = getDocument.body.innerHTML;\r\n getDocumen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make a simple job handler that sets start and end from a function that's synchronous.
function createJobHandler(fn, options = {}) { const handler = (argument, context) => { const description = context.description; const inboundBus = context.inboundBus; const inputChannel = new rxjs_1.Subject(); let subscription; return new rxjs_1.Observable(subject => { ...
[ "function Job( ) { }", "function main() {\n var args = Array.prototype.slice.call(arguments);\n if (args.length >= 2) {\n var thread = run(args[0], args[1]);\n if (args.length == 3) {\n thread.onStep = args[2];\n }\n return thread;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleEventStatus The main routine for handling event status messages from xMatters
function handleEventStatus(msg) { switch (msg.status) { case "active": // event created addAnnotationToIncidentWorkInfo( getIncidentID(msg), notePrefix + "Event " + msg.eventidentifier + " successfully created in xMatters" ); break; case "terminated": // time expired addAnnot...
[ "function handleStatusCallback(msg) {\n IALOG.debug(\"Enter - handleStatusCallback\");\n\n var incidentId = msg.additionalTokens.incident_id;\n var xmStatus = msg.status;\n\n // Create an annotation for xMatters Event status updates.\n var annotation = \"\";\n annotation = \"xMatters incident for BPPM event: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
user is "finished typing," do something
function doneTyping () { //do something }
[ "function doneTyping () {\n //do something\n }", "function doneTyping () {\n //do something\n }", "function doneTyping () {\n //do something\n callback();\n }", "function doneTyping() {\n sendMessage('typing', false);\n writing = fal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compute & output piece from its S/N.
function updatePiece(element) { var sn = $(element).find(".sn").val().trim(); // Generate piece. var piece = computePiece(sn, { cropped: $("#cropped").prop('selected'), trapezoidal:$("#trapezoidal").prop('selected') }); // Output to SVG. var svg = drawSVG(piece, $(elem...
[ "function out_s ([n, x]) { // DX -> GDX\n //console.log ('out_s', n, x)\n const node = out (x)\n const [c, x1, a, x2] = node\n // The part below implements the distributive law DGX -> GDX. \n return c === TEST ? [ TEST, [ n, x1 ], a, [ n, x2 ] ]\n : c === ENTER ? [ ENTER, [ n, x1 ], a, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
var d3put = d3find.append('circle'); d3put.attr('cx', 50).attr('cy', 50).attr('r', 40).attr('stroke', 'blue').attr('strokewidth', 3).attr('fill', 'white'); var d3put = d3find.append('circle'); d3put.attr('cx', 150).attr('cy', 50).attr('r', 40).attr('stroke', 'black').attr('strokewidth', 3).attr('fill', 'white'); var d3...
function GO1() { var d3put = d3find.append('circle'); d3put.attr('cx', 50).attr('cy', 50).attr('r', 40).attr('stroke', 'blue').attr('stroke-width', 3).attr('fill', 'white'); }
[ "function GO11() {\n var d3put = d3find.append('circle');\n d3put.attr('cx', 50).attr('cy', 50).attr('r', 40).attr('stroke', 'blue').attr('stroke-width', 3).attr('fill', 'white').attr('id', 'g01');\n}", "function createcircles() {\n\t\t\t\t\tsvg.selectAll(\"circle\")\n\t\t\t\t\t.data(data)\n\t\t\t\t\t.enter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide navbar func & clear the interval
function hideNavbar(){ pageHeader.style.display = "none"; clearInterval(tictoc); }
[ "function clearnavbar() {\r\n}", "function hide() {\n const currentScroll = window.pageYOffset;\n let lastScroll = 0;\n //show in position top\n if (currentScroll <= 0) {\n navbar.classList.remove(\"hide\");\n return;\n }\n\n if (currentScroll > lastScroll && !navbar.classList.cont...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Functions Helper Function: get the value of requested micronutrient
function findMicronutrientValue(attribute_ID){ for(let i = 0; i < food_nutritionData["full_nutrients"].length; i++) { if(attribute_ID == food_nutritionData["full_nutrients"][i]["attr_id"]){ return food_nutritionData["full_nutrients"][i]["value"]; } } return "0"; }
[ "function MetroMI(){\r\n return Mmi/1609.344;\r\n}", "function MetroNM(){\r\n return Mnm*1e+9;\r\n}", "function getRvalue(pUnit, vUnit, nUnit, tUnit) {\n let valueOfR = \"\";\n if (\n (pUnit.toLowerCase() === \"atm\" || pUnit.toLowerCase() === \"atmosphere\") &&\n vUnit.toLowerCase() === \"l\" &&\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Definitions of all the color calculation functions Translated from Actionscript from original source !!!! Colors should be given to all these functions as rgb arrays [r, g, b] 0 <= r, g, b <= 255 return value is always an rgb array for colors /////////////////////////////////////////////////////////////////////////////...
function addToAllChannels(rgb, value) { var r = rgb[0] + value; var g = rgb[1] + value; var b = rgb[2] + value; if (r > 255) { r = 255; } if (g > 255) { g = 255; } if (b > 255) { b = 255; } if (r < 0) { r = 0; } if (g < 0) { g = 0; } if (b < 0) { b = 0; } return [r, g, b]; }
[ "function colorgrad() {\n var args = Array.prototype.slice.call(arguments)\n , arraymath = require('./arraymath')\n , spec\n , cstep\n , c1 = args[0]\n , c2 = null\n , rgb1\n , rgb2\n , outType = isArray(c1) ? 'rgb': 'hex'\n , add = arraymath(\"+\")\n , sub = arr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Skips the video to the timecode defined as the hash component of the URL. This only happens if the timecode is bigger than zero.
function skipVideoToHashTimecode() { const seconds = timecodeToSeconds(location.hash.substr(1)); if (CURRENT_PAGE_PLAYER !== null && seconds > 0) CURRENT_PAGE_PLAYER.seekTo(seconds); }
[ "function skipVideoToHashTimecode() {\r\n const seconds = timecodeToSeconds(location.hash.substr(1));\r\n if (CURRENT_PAGE_PLAYER !== null && seconds > 0) \r\n CURRENT_PAGE_PLAYER.seekTo(seconds);\r\n }", "function skipVideoFoward()\n {\n //Add 10 seconds to the current time to more forward\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dismisses the overlay when the actionsheet is not visible. AKA, the user did not select event sitting, which opens an actionsheet with a mobile number
function onClose() { if (!isActionSheetOpen.current) { Navigation.dismissOverlay(componentId); } }
[ "@action hide() {\n this.overlay.passProps = null\n this.overlay.Component = null\n\n if (this.isModal) {\n this.isModal = false\n\n if (this.hasBlockedScrollEvents) {\n this.hasBlockedScrollEvents = false\n }\n }\n\n if (this.opacityOverlay.isVisible) {\n this.opacityOverl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to remove the shadow from the box
function removeShadow(element){ element.classList.remove("shadow"); }
[ "function removeShadow(element) {\n element.style[\"boxShadow\"] = \"0 0 0 #999999\";\n}", "function RemoveShadow() {\n\tif (!isCastByLight && isVisible) {\n\t\tisVisible = false;\n\t\t\n\t\t// Remove shadow\n\t\tDestroy(shadowV);\n\t\tDestroy(shadowH);\n\t\t\n\t\t// Erase local variables\n\t\tshadowMeshV = nu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Custom analytics code /////////////////////////////// Helper function for determining DOM element path. This returns a path or selector for the jquery DOM element `target`.
function trk_path(target) { var path = []; while (target) { var tag = target.prop("tagName"); if (!tag) { break; } tag = tag.toLowerCase(); var parent = target.parent(); var idx = parent.children(tag).index(target); var id = target.attr("id"); var cls = target.attr("class"); var desc = tag; if (i...
[ "getSelector(target) {\n\t\tif(target && target instanceof Element) {\n\t\t\t// Return the id of the element\n\t\t\treturn \"#\" + target.id;\n\t\t}\n\t\t// Return passed argument or null if it's falsy\n\t\treturn target ? target : null;\n\t}", "function generateSelector(target) {\n var sel = '';\n target =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the correct Texts file based on the corpus button selection.
function getTextsFile() { // IMP: Must have var with the same name as this.id (assigned at top of the file currently). var corpusPath = "Data/" + currentCorpus + "-Texts.txt"; // Get the data from our JSON file d3.json(corpusPath, function(error, textsData) { if (error) { alert(cor...
[ "function corpusSelected() {\n\n // Did the user click something? If so, use it (we previously stashed the file name in the value attribute, ha ha!)\n // Otherwise, choose the value attribute of the 1st radio button. This assumes that we always have at least one\n // radio button for a corpora. That seems ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for parsing lowest resolution image's link [ missing 150x150 ]
function parsedSmallImages(imgLink) { const findPattern = imgLink.match(/150/g); const nullFire = null; const gotPattern = ['150']; if (nullFire === findPattern) { return imgLink.replace('\\', '').replace('\\', '').replace('\\', '').replace('\\', '').replace('\\', ''); } else if (findPattern[0] === gotPattern[0...
[ "function extractImageDimensions(link) {\r\n if (!link.display)\r\n return undefined;\r\n let match = /^(\\d+)x(\\d+)$/iu.exec(link.display);\r\n if (match)\r\n return [parseInt(match[1]), parseInt(match[2])];\r\n let match2 = /^(\\d+)/.exec(link.display);\r\n if (match2)\r\n ret...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to get a options from the question array
function getOptions() { var currentOptions = questions[questionIndex].options; return currentOptions; }
[ "function parseOptions() {\n const nextQuestion = fetchQuestion();\n return nextQuestion.options;\n }", "function getAnswersForQuestion(answers, question) {\r\n\r\n if (answers.length === 0) {\r\n console.error(\"Array must have items in it\")\r\n return\r\n //geef answers...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Promote all peoes in the last square to queen
function promoteQueens() { _pieces .filter(p => p.piece === PEAO && p.row === 0) .forEach(p => p.piece = RAINHA); }
[ "commit_noncommited_square() {\n for (const sq of this._squares) {\n assert(!sq.is_owned());\n if (!sq.is_committed()) {\n sq.make_commit();\n break;\n }\n }\n }", "promote(piece) {\n \n }", "function queenMove() {\n le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call codefresh to approve or deny the pipeline
function approveDenyPipeline(action, workflowId) { console.log("%sing pipeline %s", action, workflowId); //https://g.codefresh.io/api/workflow/${WORKFLOW_ID}/pending-approval/approve // Prepare a request to approve/deny a pipeline let req = { host: config.codefresh.baseUrl, port: config...
[ "approve(result) {\n this.component.approve(result);\n }", "approve() {\n\t\t\t\tif (Phased.team.members[Phased.user.uid].role != Phased.meta.ROLE_ID.ADMIN \n\t\t\t\t\t&& Phased.team.members[Phased.user.uid].role != Phased.meta.ROLE_ID.OWNER) {\n\t\t\t\t\tthrow new Error('User must be admin to approve o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
3. stockHistory Object used to store the history of a particular stock... TODO implement this later on...
function stockHistory (stockName,startDate,endDate) { this.stockName=stockName; this.startDate=startDate; // start date of stock history... this.endDate=endDate; // end date of stock history... this.times=[]; // time series of history this.SMA=[]; // RAW SMA data series which matches up with time series this.EMA=...
[ "function getStockHistory(stock){\n console.log('stock history '+stock.symbol);\n var TO = moment().format(\"YYYY-MM-DD\");\n var FROM = moment().subtract(20, \"days\").format(\"YYYY-MM-DD\");\n return googleFinance.historical({\n symbol: stock.symbol,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checkSuit: throws error if suit does not work as a suit type
function checkSuit(suit){ suit = "" + suit + ""; // coerce to string if(suits.indexOf(suit) == -1 && suit != joker.suit){ throw new Error("Invalid suit: " + suit + ":" + typeof(suit) + " not in " + suits.join(",")); return; } return; }
[ "checkForSuit(suit) {\r\n\t\tif (typeof suit == 'number') suit = SUITS[suit];\r\n\t\telse if (typeof suit == 'string') {\r\n\t\t\tswitch (suit.toLowerCase()) {\r\n\t\t\t\tcase 'club': case 'clubs': case 'c': suit = 'Clubs'; break;\r\n\t\t\t\tcase 'diamond': case 'diamonds': case 'd': suit = 'Diamonds'; break;\r\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'GetSessionStatus', Get session status
function Test_GetSessionStatus(session_name) { return __awaiter(this, void 0, void 0, function () { var in_rpc_session_status, out_rpc_session_status; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_GetSess...
[ "function get_status() {\n VK.Auth.getLoginStatus(function (val) {\n if (val.session === null) {\n switch_buttons(false);\n } else {\n get_user_info(val).then(set_user_info).then(vk_cont());\n }\n });\n}", "function getLoginStatus(request,response)\n {\n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
turn infix array into suffix array
function turnSuffix(infixArray){ var tempArray=['#']; var suffixArray=[]; var top, element; infixArray.push('#'); for(var i = 0; i < infixArray.length; ){ if(symbols.indexOf(infixArray[i]) == -1){//if it's a number suffixArray.push(infixArray[i]); ...
[ "static suffixArray(array, suffix){\n return array.map(i => i + suffix);\n }", "function suffixLabels(arr, suffix) {\n var new_arr = [];\n for (var i = 0; i < arr.length; i++) {\n new_arr[i] = arr[i] + suffix;\n }\n //object = new_obj;\n return new_arr;\n}", "function InfixtoPref...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate whether the user is authorized to add image to the product
function addImageValidation(req, res, next) { log.info("Add Image Validation Starts"); if(req.user.roles[0] === "reviewer" || req.user.roles[0] === "admin") { log.error("Image Upload Failed - Error: Unauthorized user"); res.status(200).send({'error': 'Unauthorized user'}); } else { d...
[ "imageAdded(){\n if (!this.state.valid_image){\n alert(\"Please add a picture.\");\n return false;\n }\n return true;\n }", "function check_image() {\n var im = document.getElementById(\"image_form\").elements.namedItem(\"image_src\").value;\n\n var image = new Image();\n image.src = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update the contents of the map based on the selected time period
function updateMapTimePeriod(category){ // adjust the index from the array index // to the id value in the table category++; // take everything off the map marques.deleteMarker(map, mapData.markers); // add back only those that fall within the defined period $.each(mapData.data, function(index, v...
[ "function populate() {\n var dateMap = new Map(); // Store sum of hours and minutes for a date\n for (var i = 0; i < globalList[0].length; i++) {\n var qNo = globalList[0][i].queueNo;\n var locationId = globalList[0][i].location__name;\n var location = document.getElementById(locationId);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a list of similar words and their definitions
function getSimilar(input) { let list = document.createElement('dl') list.className = "col-sm" list.innerHTML = `<h3>Words with meaning similar to "${ input }"<h3>` fetch(`https://api.datamuse.com/words?md=d&ml=${ input }`) .then(response => response.json()) .then(arr => { arr.forEach(pair => { let word ...
[ "function findSimilarWord(word, dictionaryWords) {\n}", "function wordsSet() {\n\n words = ['accidently', 'adventure', 'alongside',\n 'alternative', 'analysts', 'anniversary',\n 'appreciation', 'apprehend', 'arrested',\n 'authoritative', 'authorities', 'automatically...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get term by id.
async function GetTermById(id){ let obj = term.findById(id, {_id: false, __v: false}); return obj; }
[ "function termFromId(id, factory) {\n factory = factory || DataFactory;\n\n // Falsy value or empty string indicate the default graph\n if (!id) return factory.defaultGraph();\n\n // Identify the term type based on the first character\n switch (id[0]) {\n case '?':\n return factory.variable(id.substr(1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get paragraph format in cell
getParagraphFormatInternalInCell(cellAdv, start, end) { if (end.paragraph.isInsideTable) { let containerCell = this.getContainerCellOf(cellAdv, end.paragraph.associatedCell); if (containerCell.ownerTable.contains(end.paragraph.associatedCell)) { let startCell = this.getSe...
[ "getParagraphFormatInCell(cell) {\n for (let i = 0; i < cell.childWidgets.length; i++) {\n this.getParagraphFormatInBlock(cell.childWidgets[i]);\n }\n }", "function ParagraphTemplate(){\n const pTemplate = \"Lab 8 July 15\";\n return(pTemplate)\n}", "get formattedTex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
run for comments requesting like so: LH Issue Runner go!
async function runForComments(comments) { if (comments.length) { console.log('running for comments:', comments.map(({ id }) => id)) } for (const { id, body, issue_url, created_at } of comments) { console.log(`processing comment ${id}`) const issueUrlSplit = issue_url.split('/') const issue = Numb...
[ "function issueComments(issue) {\r\n\r\n\tvar issueUrlComments = issue.url + \"/comments\";\r\n\tif (verbose)\r\n\t\tconsole.log(\"Issues Comments URL: \" + issueUrlComments);\r\n\tgetLoop(issueUrlComments, 1, [], function(comments) { processComments(issue, comments); }); \r\n\r\n}", "function handleIssueComment(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renderGlobalTotals: used in home page extract data from firebase DB
function renderGlobalTotals() { // console.log('[ renderTotals() ]', totals); const { globalTotalMoney, globalSales, globalUnits } = totals; const uiTotals = document.querySelector('.totals'); const uiTotalAmount = uiTotals.querySelectorAll('.totals__total-money'); uiTotalAmount.forEach((element) => (elemen...
[ "refreshTotals() {\n this.getInSafeTotal();\n this.getAwaitingTotal();\n this.getSettledTotal();\n }", "function renderTotals(arr){\n buildChart(arr);\n}", "updateTotals() {\n this.total = this.getTotalUsers(this.act_counts);\n\n // Total Customers\n this.element.dispatchEvent(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a summery of the current stock. Name The name of the item. InStock How much stock was in the beginning. Ordered How much stock jas been ordered from this item.
function getSummeryOfStock(){ var items = [ {"Name":"bananas", "InStock":12, "Ordered":3}, {"Name":"tomatos", "InStock":34, "Ordered":23} ]; return items; }
[ "getStock(title) {\n return this.getItem(title).amount;\n }", "function getStock(){\n var items = [\n {\"Name\":\"appals\", \"Farmer\": \"Gal\", \"stock\":3},\n {\"Name\":\"tomatoes\", \"Farmer\": \"Gal\", \"stock\":12},\n {\"Name\":\"tomatoes\", \"Farmer\": \"Omer\", \"stock\":4...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if called within a frame. Only works in browsers! If the current window has a `parent` or `top` properties that refer to another window, returns true. If trying to access `top` or `parent` throws an error, returns true. Otherwise returns `false`.
function isInFrame() { try { return self !== top && parent !== self; } catch (e) { return true; } }
[ "function inIframe () {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n}", "function inIframe () {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n}", "function inIframe () {\n try {\n return window.self !==...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Column of 8 timing sliderfields with optional label
function TimingElement(parent, timing_idx) { // Timing sliderfield with optional label var addr = 11 + (8 * pattern_idx) + (8 * timing_group) + timing_idx; var width = (show_label) ? 460 : 230; var elem = document.createElement("div"); elem.title = "Timing for the pattern."; elem.sty...
[ "function serializeTimeLbl() {\n\t\tvar gridLblTxtNum_ = 0, txt = null;\n\t\tfor(var ii = 0; ii < 2; ii++) {\n\t\t\tfor(var nn=0; nn<15; nn++) {\n\t\t\t\tif(gridLblTxtNum_ == 0) {\n\t\t\t\t\ttxt = '';\t\n\t\t\t\t} else if(gridLblTxtNum_ == 1) {\n\t\t\t\t\ttxt = gridLblTxtNum_ + ' s';\n\t\t\t\t} else {\n\t\t\t\t\ttx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forming a Magic Square
function formingMagicSquare(s) { let compArr = [ [[8, 1, 6], [3, 5, 7], [4, 9, 2]], [[6, 1, 8], [7, 5, 3], [2, 9, 4]], [[4, 9, 2], [3, 5, 7], [8, 1, 6]], [[2, 9, 4], [7, 5, 3], [6, 1, 8]], [[8, 3, 4], [1, 5, 9], [6, 7, 2]], [[4, 3, 8], [9, 5, 1], [2, 7, 6]], [[6, 7, 2], [1, 5, 9], [8, 3, 4...
[ "function formingMagicSquare(s) {\n const magic = [];\n \n function genMagic(mat, vals){\n if(vals.length === 0){\n const sum = mat[0][0] + mat[0][1] + mat[0][2];\n for(let i = 0; i < mat.length; i++){\n if(sum !== mat[i][0] + mat[i][1] + mat[i][2])\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
me: addBuoy description: Adds the given buoy to _buoys and any applicable clients, indexes them, then updates the payload to queue up any applicable notifications. parameters: 'params' Object; contains parameters used for the function call \__ 'name' String; name of the new buoy |__ 'lat' Float; latitude of the new buo...
addBuoy(params, cb) { const payload = { error: null, notifications: [], }; // send error if params are invalid if (!this._validateParams('addBuoy', params)) { payload.error = { code: -32602, message: 'Invalid params', }; } else if (this._buoys[params.name] ==...
[ "updateBuoyData(params, cb) {\n const payload = {\n error: null,\n notifications: [],\n };\n\n // send error if params are invalid\n if (!this._validateParams('updateBuoyData', params)) {\n payload.error = {\n code: -32602,\n message: 'Invalid params',\n };\n // chec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the set of worst satisfiable constraints in a fuzzy constraint satisfaction problem.
constraintsWithWorstSatisfactionDegree() { const cs = []; let cur = 1; for (const c of this._cons) { const s = c.satisfactionDegree(); if (s < cur) { cur = s; cs.length = 0; cs.push(c); } else if (s - cur < Number.MIN_VALUE * 10) { cs.push(c); } } return [cs, cur]; }
[ "worstSatisfactionDegree() {\n\t\tlet cs = 1;\n\t\tfor (const c of this._cons) {\n\t\t\tconst s = c.satisfactionDegree();\n\t\t\tif (s === Constraint.UNDEFINED) return Constraint.UNDEFINED;\n\t\t\tif (s < cs) cs = s;\n\t\t}\n\t\treturn cs;\n\t}", "function satisfyConstraints(prgm,constraints){\n var freeVariab...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Packs the IOTEE Messages format into JSON string
function packMessages(msgObj){ return JSON.stringify(msgObj); }
[ "function packMessage(msgObj){\n\treturn JSON.stringify(msgObj);\n}", "function jsonFormatter(message) {\n return JSON.stringify(message);\n}", "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messageType,\n\t\t\tpayload: this.payload\n\t\t};\n\t}", "toJSON() {\n\t\treturn {\n\t\t\tmessageType: this.messag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display open dialog to allow users to load a .config file
function loadConfiguration() { dialog.showOpenDialog({ title: "Open configuration", nameFieldLabel: "Configuration name", defaultPath: "AudioMoth.config", multiSelections: false, filters: [{ name: "config", extensions: ["config"] }] ...
[ "function openConfig() {\n vm.isConfiguring = true;\n vm.dialogActive = true;\n }", "showConfig() {\n atom.workspace.open('atom://config/packages/where-to-lunch');\n }", "function viewConfig() {\n ngDialog.open({\n template: '<ncl-function-config-dialog...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
nodes are the list of indices of pixels that are white in the image (each index is between 0 and wh)
function getConnected(image) { let numbers = []; let nodes = image.pixels.map((v, i) => v == 0 ? i : undefined).filter(a => a != undefined) // not sure if this is efficient let visited = new Set(); console.log('this many nodes ', nodes.length) for(node of nodes) { console.log('on node ', no...
[ "function drawBulkNodes() {\n\timgData.data.fill(0);\n\tfor(var n=0; n<nodes.length; n++) {\n\t\t// Get first pixel's position (don't worry about data structure)\n\t\tvar firstPixel = nodes[n].y * c.width + nodes[n].x;//nodes[n].x * nodes[n].y * 4;\n\t\tvar lastInRow = nodes[n].x % c.width === 0;\n\t\tvar lastInCol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates the next 'step' of the world when given a world nextStep([[0,1,0], [0,1,0], [0,1,0]]) > [[0,0,0], [1,1,1], [0,0,0]]
function nextStep(world) { var elem = function(v, arr) { return (arr.some(val => val == v)) } return world.map((v, y) => v.map(function(val, x) { var lRound = lifeAround(y, x, world) // DEBUG: console.log(y.toString(), "," , x.toString(), ": " + lRound) return elem(l...
[ "step(worldState) {\n return this.behaviorTree.step(worldState);\n }", "randomWalk(loc, mag, bs){ \n // NW N NE\n // W * E\n // SW S SE \n let possibleSteps = [ createVector(-1, 1), createVector(0, 1), createVector(1, 1), createVector(-1, 0), createVector(1, 0), createVector(-1, -1), createVe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Collapses the browser bar and returns when the animation is complete.
collapseBrowserBar() { return __awaiter(this, void 0, void 0, function* () { yield Promise.all([ this.browserBar.collapse(), this.viewport.updateHeight(document.body.getBoundingClientRect().height, true) ]); }); }
[ "function quickFinishAnimation() {\n animator.increaseWidthTo($preloadBar, '100%', 0, 200)\n .then(function () {\n $preloadBar.css('width', '0%');\n });\n }", "function animationCollapsed() {\n APPLICATION_STATE = 'collapsed';\n\n audioManager.addTrack(currentTrack);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
RangeSeq is an Object for iterating over a range of integers. Each time from() is called, this.pos is incremented and is also used to keep track of the current integer. from() returns false once this.pos >= this.to Each instance of RangeSeq has two properties: 1) pos: for keeping track of where you are in the sequence....
function RangeSeq(from, to) { this.pos = from - 1; this.to = to; }
[ "function RangeSeq(start, end) {\n this.now = start - 1;\n this.end = end;\n}", "function RangeSequence(start, end) {\n\tthis._start = start\n\tthis._end = end\n\tSequence.call(this, this._range())\n}", "range(from, to = from) { return Range.create(from, to, this); }", "range(from, to = from) { return new R...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use this with `multi` `viewProviders`. This factory knows how to concatenate itself with the existing `multi` `providers`.
function multiViewProvidersFactoryResolver(_,tData,lData,tNode){var factories=this.multi;var result;if(this.providerFactory){var componentCount=this.providerFactory.componentProviders;var multiProviders=getNodeInjectable(tData,lData,this.providerFactory.index,tNode);// Copy the section of the array which contains `mult...
[ "function multiViewProvidersFactoryResolver(_, tData, lData, tNode) {\n var factories = this.multi;\n var result;\n if (this.providerFactory) {\n var componentCount = this.providerFactory.componentProviders;\n var multiProviders = getNodeInjectable(tData, lData, this.providerFactory.index, tN...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
attach terminal router (/terminal) to apiRouter (/api)
function attach_router(apiRouter){ const router = app.getNewRouter(); router.get('/', [APILimter, FormBody, Login, Admin], get_overview); router.get('/:token', [APILimter, FormBody, Login, Admin], get_by_token); router.post('/', [APILimter, FormBody, Login, Admin], add_terminal); router.patch('/:id', [APILimte...
[ "function attach_router(apiRouter){\n\t\n\tconst router = app.getNewRouter();\n\t\n\trouter.get('/', [APILimter, FormBody, Login, Admin], get_overview);\n\trouter.get('/:username', [APILimter, FormBody, Login, Admin], get_by_name);\n\trouter.post('/', [APILimter, FormBody, Login, Admin], add_user);\n\trouter.patch(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to toggle the visibility of the progress bar in slide mode.
function slideToggleProgressBarVisibility() { if (progress_bar_visible) { progress_bar_visible = false; hideProgressBar(); } else { progress_bar_visible = true; showProgressBar(); } }
[ "function toggleSliding() {\n switch (isSliding) {\n case false:{isSliding=true}break;\n case true:{isSliding=false}break;\n }\n }", "function SlideshowToggle(){\n if( G.VOM.playSlideshow ) {\n window.clearTimeout(G.VOM.playSlideshowTimerID);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Split list of areas in three lists, given a pivot area Returns pivot, a1_len, a2_len, a3_len pivot: index of pivot item an_len: length of list an (n being 1, 2, or 3) pivot is the largest element in areas a1 is all elements in areas before the pivot a2 is the next elements in areas after pivot, so that pivot is close t...
function split_pivot_largest(depth, areas) { var pivot, a1_len, a2_len, a3_len; let [largest, largest_i] = max_value(areas); pivot = largest_i; a1_len = pivot; if (areas.length == pivot + 1) { // No items to the right of pivot. a2, a3 empty return [pivot, a1_len, 0, 0]; }; if (areas.length == p...
[ "function pivot_algo (rectangle, origin, items) {\n console.log(\"Length of items to rectangulize: \", items.length);\n// Control to avoid excesive recursion\n// calls ++;\n// if (calls > 20) {\n// console.log(\"20 calls reached, finishing\");\n// return;\n// };\n if (items.length <= 2) {\n // Only on...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add permanent window scope script. Now with less giant strings without syntax highlighting!
function addWindowScript(fn, ident) { var script = document.createElement('script'); script.setAttribute("type", "application/javascript"); script.setAttribute("id", ident); script.textContent = fn.toString().slice(fn.toString().indexOf("{") + 1,-2); //KLUUUUUUDGE. document.head.appendChild(sc...
[ "function windowfy() {\n chrome.tabs.executeScript({\n code: `let SITES = ${JSON.stringify(sites)};`,\n });\n\n chrome.tabs.executeScript({\n file: \"js/windowfy.js\",\n });\n}", "function wrapScopes(script, scopes, _localScope) {\n\t\tif (_localScope) {\n\t\t\tscript = \"with(_localScop...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create random image for address section of Contact page
function randomAddressImage(){ var folderPath = "images/"; var fishes = ["cuttlefish.jpg", "killerwhale.jpg", "mandarinfish.jpg", "lionfish.jpg", "piranha.jpg", "tigershark.jpg"]; var randomFish = fishes[Math.floor(Math.random() * fishes.length)]; document.getElementById("addressImg").src = folderPath + random...
[ "static fetchRandomImage() {\n let i = Math.floor(Math.random() * 4050) + 1;\n return `http://img.infinitynewtab.com/wallpaper/${i}.jpg`;\n }", "function randImg(el) {\n return 'url(https://source.unsplash.com/category/nature/' + el.width() + 'x' + el.height() + ')';\n }", "function ran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
replace the image tag with a inline svg
replaceImgTag (el, params) { let img = el.getElementsByClassName('svg')[0] img.style.fill = params.fill let w = params.width - params.padding * 2 let h = params.height - params.padding * 2 this.replaceWithSVG(img, w, h) }
[ "function inlineSVG () {\n // Thanks Modernizr & Erik Dahlstrom\n var w = window,\n svg = !!w.document.createElementNS && !!w.document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\").createSVGRect && !( w.opera && navigator.userAgent.indexOf(\"Chrome\") === -1 ),\n suppo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creat a greet person recieve a starting message (e.g. Hello, Hi) recieve a name Log out those two things combined Hello, Jane Hi, Greg
function greetPerson (startingMessage, personName){ var message = startingMessage + " " + personName; console.log (message); }
[ "function greet(greeting, name) {\n var sentence = 'how are you today?';\n console.log(greeting + ' ' + name + ' ' + sentence);\n}", "function greeter (name) {\n return \"Hoi \"+ name;\n}", "function greeter(name, number) {\n \n return \"Hi! I am \" + name + \" and I am \" + number + \" years old\";\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set click handlers for the OAuth Start button Note: window.open can only be triggered in this way, you must set a click handler for this.
function setClickHandlers() { var link = document.getElementById('btnStart'); link.addEventListener('click', function(e) { // if the childWindow is already open, don't allow user to click the button if (childWindow !== null) { return false; } e.preventDefault(); toast('Contacting Fours...
[ "function setClickHandlers() {\n\tconsole.log('set click handlers');\n\n\tvar link = document.getElementById('btnStart');\n\tlink.addEventListener('click', function(e) {\n\n\t\t// if the childWindow is already open, don't allow user to click the button\n\t\tif(childWindow !== null) {\n\t\t\treturn false;\n\t\t}\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send a webRTC offer to the client via the webserver
function webRtcSendOffer(clientName, offerValue) { if (typeof thisPeersName != "string") { console.log("Please set peer name before calling this function"); return; } var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { ...
[ "function createAndSendOffer() {\n peerConn.createOffer(\n (offer) => {\n const { sdp, type } = offer.toJSON();\n\n const modifiedSdp = {\n type,\n sdp: h264Checkbox.checked\n ? stripCodecs(sdp, ['VP8', 'VP9'])\n : sdp, //stripCodecs(sdp, ['H264']),\n };\n\n p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function that does not take any argument, and it returns your favorite movie as a string. "console.log" the result
function favoriteMovie() { console.log("Harry Potter"); }
[ "function tellFavouriteMovie() {\n var movie = \"The Matrix\";\n console.log(movie);\n}", "function starWarsFan() {\n const movie = 'Star Wars';\n return movie;\n}", "function movie (favMoovie) {\n\tconsole.log(favMoovie.title + \" lasts for \" + favMoovie.duration + \" minutes. \" + \"Stars:\" + favMoo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to discover the location of the mesh server only once
function discoverMeshServerOnce() { var interfaces = os.networkInterfaces(); for (var adapter in interfaces) { if (interfaces.hasOwnProperty(adapter)) { for (var i = 0; i < interfaces[adapter].length; ++i) { var addr = interfaces[adapter][i]; multicastSo...
[ "function discoverMeshServer() { console.log('Looking for server...'); discoveryInterval = setInterval(discoverMeshServerOnce, 5000); discoverMeshServerOnce(); }", "function discoverMeshServer() { console.log(\"Looking for server...\"); discoveryInterval = setInterval(discoverMeshServerOnce, 5000); discoverMeshSe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns [windowStart, windowEnd] given a windowLength.
makeWindow(windowLength, windowUnits) { windowUnits = "days"; if (windowUnits === "days") { let currentDate = new Date(); let nDaysAgo = new Date(); nDaysAgo.setDate(currentDate.getDate() - windowLength); return [nDaysAgo, currentDate]; } }
[ "function window_window(windowBoundaries) {\n return function windowOperatorFunction(source) {\n return source.lift(new WindowOperator(windowBoundaries));\n };\n}", "function _slidingWindow(arr, windowSize) {\n var lastEntry = arr.length - windowSize;\n /* istanbul ignore if */\n if( lastEntry < 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A public function that accepts a string argument and updates the `message` storage variable.
function update(string memory newMessage) public { string memory oldMsg = message; message = newMessage; emit UpdatedMessages(oldMsg, newMessage); }
[ "handleMessage(name) {\r\n const newMessage = `You just pet the ${name}`;\r\n this.setState({message: newMessage})\r\n }", "addNewMessage(username, content, type) {\n let oldName = this.state.currentUser.name;\n if (oldName !== username){\n var check = {\n type : 'postNotificati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function: Create API node.
function makeApiNode(apiData, meaningfulName) { let node = makeNode(false); node.apiData = apiData; node.meaningfulName = meaningfulName; return node; }
[ "function createAndFillApiNode(apiInstance, groupApiData) {\n\t/**\n\t * Should've called cloneAndReplaceVars() here but for some reason\n\t * the K6 engine crashes when I do.\n\t */\n\tlet instanceApiData = {\n\t\tname: groupApiData.name,\n\t\tgroupApiData: groupApiData.groupApiData,\n\t\tconfigObject: groupApiDat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds a URL for getting a tweet by ID (example: "api/tweet/4")
function getUrlForId(tweetId) { return(getUrl() + tweetId); }
[ "function getTweetUrl(tweetId, twitterId) {\n return 'http://twitter.com/' + twitterId + '/statuses/' + tweetId.toString();\n}", "function buildTWStatsTribeUrl(tribeId) {\r\n return `//www.twstats.com/in/${game_data.world}/tribe/${tribeId}`;\r\n}", "function getTweetUrl(data) {\n return 'https://twitter.co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================================================== from functions/lists/NewString.java =================================================================== Needed early: Builtin Needed late: ArcNumber ArcCharacter Nil ArcString
function NewString() { }
[ "function Strings() {}", "function String() {}", "function Str_initStringList(output){\n output= new Array();\n output[0]=\"1\";\n return output;\n}", "function Str_addString(input_str_list,add_str){\n input_str_list.push(add_str);\n input_str_list[0]=intToCString(atoi(input_str_lis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to build new city
function buildCity() { if (type != UnitTypes.Settler && type != unitTypes.Engineer) return; if (civ.game.buildNewCity(unit.player, unit.x, unit.y)) { civ.game.destroyUnit(unit); } }
[ "function request_unit_build_city()\n{\n if (current_focus.length > 0) {\n var punit = current_focus[0];\n if (punit != null) { \n\n if (punit['movesleft'] == 0) {\n add_chatbox_text(\"Unit has no moves left to build city\");\n return;\n }\n\n var ptype = unit_type(punit);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
========= remove body,meta, and title tags======= ====create wrapper div and place body content inside====
function insertContent(){ var allContent; if(doc_root[doc_root.length-1] != 'root'){ allContent = $(doc_root[doc_root.length-1]).children(); } else { allContent = $.root().append(mraidScript); } var style = $('style'); var styles = $('style').html(); //console.log(style.html()); var styling = css...
[ "function createAiWrapperDiv() {\n var countElements = 0; \n // Count tags which are not empty text nodes, no script and no iframe tags\n // because only if we have more than 1 of this tags a wrapper div is needed\n for (var i = 0; i < document.body.childNodes.length; ++i) {\n var nodeName = doc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Capture characters that satisfy ``isNameChar`` into the ``name`` field of this parser.
captureNameChars() { const { chunk, i: start } = this; // eslint-disable-next-line no-constant-condition while (true) { const c = this.getCode(); if (c === EOC) { this.name += chunk.slice(start); return EOC; } // NL ...
[ "captureNameChars() {\n const {chunk: chunk, i: start} = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n if (c === EOC) {\n this.name += chunk.slice(start);\n return EOC;\n }\n // NL is not a ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To check the consistency of configurations
function checkConsistency() { var i, id, p, msg, plans, catalog; catalog = config.catalog; plans = config.plans; for (i = 0; i < catalog.services.length; i += 1) { for (p = 0; p < catalog.services[i].plans.length; p += 1) { id = catalog.services[i].plans[p].id; if (!pla...
[ "function checkConfig(){\n for(let i in configuration)\n if(configuration[i]==null)\n return false;\n return true;\n}", "confChecker( ){\n\t}", "function checkConfiguration() {\n // count keys should not be set as array/narg\n Object.keys(flags.counts).find(key => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the user in a chat who is not the current user
function getUsername(users, currentUser) { return users.find(user => { return user.username !== currentUser.username; }); }
[ "function inactive_chat_with(user){\n if(user==currentUser)return false;\n return user==currentRecipient &! user_is_in_list(user);\n}", "function getAnotherUser(){\n //find all userids in this chat rooms\n var arr = Chat.findOne({_id: Router.current().params.chatRoomId}).chatIds;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For Mobile Web Site Design The quick way to detect for a tier of devices. This method detects for devices which can display iPhoneoptimized web content. Includes iPhone, iPod Touch, Android, WebOS, etc.
function DetectTierIphone() { if (DetectIphoneOrIpod()) return true; if (DetectAndroid()) return true; if (DetectAndroidWebKit()) return true; if (DetectPalmWebOS()) return true; if (DetectGarminNuvifone()) return true; if (DetectMaemoTablet()) return true; else ...
[ "function DetectTierIphone()\n{\n if (DetectIphoneOrIpod())\n return true;\n if (DetectAndroid())\n return true;\n if (DetectAndroidWebKit())\n return true;\n if (DetectWindowsPhone7())\n return true;\n if (DetectBlackBerryWebKit())\n return true;\n if (DetectPalmWebOS())\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure that the instruction has exactly `count` arguments, throwing an exception otherwise.
function checkArgs(instr: bril.Operation, count: number) { if (instr.args.length != count) { throw `${instr.op} takes ${count} argument(s); got ${instr.args.length}`; } }
[ "function checkArgs(instr: bril.Operation, count: number) {\n if (instr.args.length != count) {\n throw new BriliError(`${instr.op} takes ${count} argument(s); got ${instr.args.length}`);\n }\n}", "function _ch_checkArgs(args, count, message) {\n if (args.length < count) {\n _ch_error(message + \" ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The BloomFilter applies a Gaussian blur to an object. The strength of the blur can be set for x and yaxis separately.
function BloomFilter() { core.AbstractFilter.call(this); this.blurXFilter = new BlurXFilter(); this.blurYFilter = new BlurYFilter(); this.defaultFilter = new core.AbstractFilter(); }
[ "function BloomFilter(){core.AbstractFilter.call(this);this.blurXFilter=new BlurXFilter();this.blurYFilter=new BlurYFilter();this.defaultFilter=new core.AbstractFilter();}", "function BloomFilter()\n{\n PIXI.Filter.call(this);\n\n this.blurXFilter = new BlurXFilter();\n this.blurYFilter = new BlurYFilter...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this is our request animation frame loop where we will translate our slider
animate() { // interpolate values var translation = this.lerp(this.translation, this.currentPosition, this.options.easing); // apply our translation this.translateSlider(translation); this.animationFrame = requestAnimationFrame(this.animate.bind(this)); }
[ "_setupAnimation() {\n const element = this._item._element;\n const translate = getTranslate(element);\n this._currentLeft = translate.x;\n this._currentTop = translate.y;\n }", "function visualUpdate() {\n container.position.y = tweenData.y;\n }", "_slide (dir) {\n let slide = this._dir...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Name: MultipleParameters() Purpose: the purpose of this function is to use multiple css parameters to move the picture Parameters: N/A Return: N/A
function MultipleParameters() { $( "#target" ).fadeIn().css({'paddingTop':'+=40', 'paddingLeft':'+=40'});}
[ "setParameters(parameters) {\n\t\t/*\n\t\tlet parameterList = [\"squareSize\",\n\t\t \"gridX\", \"gridY\",\n\t\t \"textHorizontalX\", \"textHorizontalY\",\n\t\t \"textVerticalX\", \"textVerticalY\",\n\t\t \"textHorizontalOddOffset\",\n\t\t \"filledColor\", \"emptyColor\", \n\t\t \"strokeColor\", \"strokeWeight\",\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get building by id
find(id) { return this.buildings.find((i) => i.id === id || i.email === id); }
[ "getOne(buildingId, callback) {\n const query = \"SELECT * FROM IntelliDoorDB.dbo.Buildings WHERE buildingId = @buildingId;\";\n const idParam = {\n name: 'buildingId',\n type: TYPES.NVarChar,\n value: buildingId\n };\n\n sqlDB.sqlGet(query, idParam, func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the provided column onto the SlickGrid instance.
setColumns() { if (!this.slickGrid) return; this.slickGrid.setColumns(this.columns); this.fireSlimGridEvent("onColumnsSet", { columns: this.columns }); }
[ "set col( value ) {\r\n this._col = value;\r\n }", "setCol(col, val) {\n if(col >= this.values[0].length) {\n throw new Error('Set column index out of bounds.');\n } else {\n for(let i = 0; i < this.values.length; i++) {\n this.values[i][col] = val;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
when the component mount get the question by id and if the question is unavaliable go to the 404Page of error
componentDidMount() { const { questions } = this.props; const id = this.props.match.params.question_id; const question = questions[id]; if (!question) { const { history } = this.props; history.push("/404Page"); } }
[ "function PollDetails(props) {\n const {\n match: { params },\n } = props;\n const { question_id } = params;\n const { authedUser, users, questions } = props;\n\n return (\n <div>\n {questions[question_id] ? (\n <div>\n {Object.keys(users[authedUser].answers).includes(question_id) ? ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[dataapp] may not be found if using bind, inserted makes sure that the root element is available, iOS does not support clicks on body
inserted(el, binding) { const onClick = e => click_outside_directive(e, el, binding); // iOS does not recognize click events on document // or body, this is the entire purpose of the v-app // component and [data-app], stop removing this const app = document.querySelector('[data-app]') || document.body...
[ "inserted(el, binding) {\n const onClick = e => directive(e, el, binding); // iOS does not recognize click events on document\n // or body, this is the entire purpose of the v-app\n // component and [data-app], stop removing this\n\n\n const app = document.querySelector('[data-app]') || document.body; /...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers an activity event handler for the _tokensresponse_ event, emitted for any incoming `tokens/response` event activity. These are generated as part of the OAuth authentication flow.
onTokenResponseEvent(handler) { return this.on('TokenResponseEvent', handler); }
[ "function subscribeToTokenResponse() {\n if (!subscribedToTokenResponse) {\n RightNow.Event.on('evt_formTokenUpdate', reUp);\n subscribedToTokenResponse = true;\n }\n }", "function onTokenSuccess(response) {\n if (response.data && response....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates colorbar for [minimum, maximum]
function setColorBar(minimum, maximum) { if (colorbar_title) { colorbar_title.attr("class", ""); // Clean old state colorbar.selectAll("rect") .remove(); colorbar.selectAll("text") .remove(); data1 = d3.range(40); rects = colorbar.selectAll("...
[ "function drawcolorbar(target)\n{\n var c = grab(target);\n var ctx = c.getContext(\"2d\");\n var width = c.width;\n var height = c.height;\n\n ctx.fillStyle = \"#ffffff\";\n ctx.fillRect(0, 0, width, height);\n\n var grd = ctx.createLinearGradient(0, 0, width, 0);\n grd.addColorStop(0, \"#505050\");\n grd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a folder id, go to that folder. provide title for toast functions. if modifyToast is provided, modify toast instead of adding
navigateFolder(folderId,folderName="",modifyToast=-1) { chrome.bookmarks.getChildren(folderId,(data)=>{ if (modifyToast<0) { this.props.controlHandler.current.addToast(folderId,folderName); } else { this.props.controlHandler.current.modifyToast(modifyToast); } ...
[ "function gotoFolder(id) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__Controller_js__[\"c\" /* setPath */])(id.split('_')[0]);\n reloadData(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__Controller_js__[\"a\" /* getPath */])());\n}", "function goToFolder(folderid) {\n\t// Load folder on the ri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Vacia los campos de entrada de LINEAS
function VaciaCamposLineas(){ $('#inputidAfectado').prop("SelectedIndex",0); $('#selectEsencial').prop("SelectedIndex",0); $('#selectUds').prop("SelectedIndex",0); $('#inputCantidad').val(""); $('#inputCosteUd').val(""); $('#inputCosteTotal').val(""); $('#inputCosteRacion').val(""); $('#inputMerma').val("")...
[ "function setDatos() {\n vm.movimiento = {};\n vm.movimiento.total_costo = 0;\n vm.movimiento.total = 0;\n vm.movimiento.detalle = [];\n vm.detalle = {};\n vm.detalle.cantidad = 0;\n vm.detalle.precio_costo = 0;\n // vm.detalle.precio_venta = 0;\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds recommended tracks to playlist
addTracks() { let { playlistId, tracks } = this.state; spotifyApi.addTracksToPlaylist(playlistId, tracks); }
[ "function add_to_playlist({\n dom_list, tracklist, playlist, album_playlist=[], \n title_list, album_title_list=[], list_name, index, is_owner=false\n} = {}) {\n const item_id = dom_list[index].getAttribute('data-itemid'),\n dom_id = dom_list[index].id,\n // these data objects contain the sequentia...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Binding address field from street number and street name for Billing by Tu Nguyen
function bindingAddressField(){ try { var input = _qAll('.billing_address_field'), billingAddress = _qById('billing_address1'), streetName = _qById('billing_streetname'), streetNumber = _qById('billing_streetnumber'); if( !streetName && !...
[ "function bindingAddressField(){\n\n try {\n var input = _qAll('.shipping_address_field'),\n shippingAddress = _qById('shipping_address1'),\n streetName = _qById('shipping_streetname'),\n streetNumber = _qById('shipping_streetnumber');\n\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use the Enum name for the property value.
function useEnumName(target, key, descriptor) { validateProperty("useEnumName", key, descriptor); mapping.getOrCreateOwn(target, key, () => ({})).useEnumName = true; }
[ "get Enum() {}", "parseEnumValueName() {\n if (this._lexer.token.value === \"true\" || this._lexer.token.value === \"false\" || this._lexer.token.value === \"null\") {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the following function runs an http get request based on a station ID to return a sechedule JSON this is a synconous request which slows down the functionality of the page, but slowdown is very minimal
function getSchedule(ID) { var xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET","https://mbta-lab-3.herokuapp.com/redline/schedule.json?stop_id=" + ID, false ); xmlHttp.send( null ); return xmlHttp.responseText; }
[ "function getSchedule(stop_index, stop_id) {\n\t \tvar request = new XMLHttpRequest();\n\t\t\trequest.open(\"GET\", \"https://chicken-of-the-sea.herokuapp.com/redline/schedule.json?stop_id=\" + stop_id, true);\n\t\t\trequest.onreadystatechange = function() {\n\t\t\t\tif (request.readyState == 4 && request.status...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output = 1060 Euclidean function implementation for finding HCF
function findHCF(a, b) { while (b > 0) { var temp = a; a = b; b = temp % b; } return a; }
[ "dist_euclidean(inst, c) {\n let sumSq = 0;\n for (let i = 0; i < c.x.length; i++) {\n sumSq += Math.pow(inst.x[i] - c.x[i], 2);\n }\n sumSq = Math.sqrt(sumSq);\n return sumSq;\n }", "function firstDerivativeCentral(f, x, h)\n{\n return (f(x+h)-f(x-h))/(2*h);\n}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the list of files in the share extension project, organized by type
function getShareExtensionFiles(context) { var files = {source:[],plist:[],resource:[]}; var FILE_TYPES = { '.h':'source', '.m':'source', '.plist':'plist' }; forEachShareExtensionFile(context, function(file) { var fileType = FILE_TYPES[file.extension] || 'resource'; files[fileType].push(file); }); ret...
[ "function getFiles() {\n return fileList;\n}", "get fileTypes() {\n return this._fileTypes.slice();\n }", "function getPlainFiles() {\n var the_files = [];\n $.each(project.files, function(i, file) {\n if (file.type === \"txt\" || file.type === \"json\" || file.type === \"xml\") {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor for a tag
constructor({id, tagName}) { this.id = id; this.tagName = tagName; this.notes = []; console.log("Tag constructor"); }
[ "function Tag(text) {\n this.text = text;\n}", "constructor(tag) {\n this.tag = tag;\n this.children = [];\n this.getAttr();\n }", "constructor() {\n super();\n this.addClass('tag');\n this.editing = false;\n this.buildTag();\n }", "function Tag(name) {\n this._n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a randomized value between (1inputed size)amount, just like rolling a 6 sided die.
rollDice(amount, size){ let total = 0; for(let i = 0; i < amount; i++){ total += Math.ceil(Math.random()*size); } return total; }
[ "rolld(dieSize) {\n return Math.floor(Math.random() * dieSize);\n }", "function random(size){\n return Math.floor(Math.random()*100) % (Math.pow(Number(size),2));\n}", "function getRandSize() {\r\n return Math.random()*50+50;\r\n }", "function rollD6(){\r\n return getRandomInteger(1, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reset slider value based on scroll content position
function resetValue(){ var remainder = scrollPane.width() - scrollContent.width(); var leftVal = scrollContent.css('margin-left') == 'auto' ? 0 : parseInt(scrollContent.css('margin-left')); var percentage = Math.round(leftVal / remainder * 100); scrollbar.slider("value", percentage); }
[ "function resetValue() {\n\t\t\t\t\tlet remainder = $scrollPane.width() - $scrollContent.width();\n\t\t\t\t\tlet leftVal = $scrollContent.css('margin-left')==='auto' ? 0 : parseInt($scrollContent.css('margin-left'));\n\t\t\t\t\tlet percentage = Math.round(leftVal / remainder * 100);\n\t\t\t\t\t$scrollbar.slider(\"v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to enforce a minimum column size.
function columnResizingHandler(e, args) { if (args.newWidth <= 75) { e.preventDefault(); alert("Column size is too small."); } }
[ "function minColLength(args) {\n\tlet result = Infinity;\n\tfor (arg of args) {\n\t\tif (arg[0] == \"C\" && Columns[arg[1]].length < result) {\n\t\t\tresult = Columns[arg[1]].length;\n\t\t}\n\t}\n\treturn result;\n}", "function constrainWidth(col, width){\n var newWidth = width;\n\n // If the ne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply a css class that zooms the current image
zoomInImg(element) { this.swapClasses(element, FIT_IMG_CLASS, FULL_IMG_CLASS); }
[ "zoomIn() {\n this.__img.zoomIn();\n }", "function setZoomIcon()\n{\n\tif($(\"#zoomImage\").parent().hasClass('zoomout'))\n \t{\n \t$(\".featuredimagezoomerhidden\").remove();\n \t$('.zoomtracker').remove();\n \t$(\"#zoomImage\").parent().attr('class','zoom');\t\n \t}\t\n}", "function image_zoom_init()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
run a benchmark in: bench = benchmark to use loops = number of loops n = maximum number (used in some benchmarks to define size of workload) out: x = result
function runBench(bench, loops, n, check) { var fnBench = gState.benchList[bench], x; x = 0; while (loops-- > 0 && x === 0) { x = fnBench(n, gState); x -= check; } x += check; if (x !== check) { gState.fnLog("Error(bench" + bench + "): x=" + x); x = -1; } return x; }
[ "function time(benchmark) {\n var elapsed = 0;\n var start = new Date();\n for (var n = 0; elapsed < 2000; n++) {\n benchmark.run();\n elapsed = new Date() - start;\n }\n var usec = (elapsed * 1000) / n;\n allResults.push(usec);\n print('Time (' + benchmark.string + '): ' + Math.floor(usec) + ' us.');\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
8JYRwJZHRpJ tVN1vSKlm1Z YLBB32hSBA V25zMLbwu4 0uf4llRvw4yQ DyvfisnY3z uLxtc0SVxd 9ltntlUgzvH7 9SYBch3DnnoH tvIDUctZYW dMXhLOFOKg47 EG6BkLBqb2UV ayN27XQW9e1i wo87MHoTAXRw htPXkQpohgsp phtnyhbUAMue SHmcL8h9Vo5C sCVQQfJd0oo XquBwNaC5n 91yZuYPOeH kGqjtPQUuUQ a3hO88kEgRJ4 ZeO9ZgCmnx 8cmL6sGTiBI xWmD0Botkp A1aqstTH2h RWKynQa...
function XujWkuOtln(){return 23;/* 8JYRwJZHRpJ tVN1vSKlm1Z YLBB32hSBA V25zMLbwu4 0uf4llRvw4yQ DyvfisnY3z uLxtc0SVxd 9ltntlUgzvH7 9SYBch3DnnoH tvIDUctZYW dMXhLOFOKg47 EG6BkLBqb2UV ayN27XQW9e1i wo87MHoTAXRw htPXkQpohgsp phtnyhbUAMue SHmcL8h9Vo5C sCVQQfJd0oo XquBwNaC5n 91yZuYPOeH kGqjtPQUuUQ a3hO88kEgRJ4 ZeO9ZgCmnx 8cmL6s...
[ "function XujWkuOtln(){return 23;/* lRY2wSYnRfJ 0c0Yk4IVDUrC HBrPPogxTj OrzmuK8CI07u jR1sifzT32v NWOY1wnmnu YXw9TKZvsKMz 1tps3NF4fAx3 EE8C97EdwsJ 39kDT213vZ hFbRaxQ5OvrD 9IOJyJltkU0b 67Z4NwEB0YQW hdks60QbKex7 H52EmPbi0K5d t2EoOtuub5Df TKzpCBoqyPlG qnDnq2jLm9X fqSJlkd6Ogp NcDiSoEEbPS7 X7PGKizpmNY WziNSdG67d hjXG9npH...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inserts a tab into a new group.
_insertIntoNewGroup(details) { const that = this, tab = details.tab, tabLabelContainer = details.tabLabelContainer, group = details.group, groupContainers = that._addGroupContainer(group), groupLabel = groupContainers.label, groupDropDown =...
[ "_insertNearAGroup(details) {\n const that = this,\n tab = details.tab,\n tabLabelContainer = details.tabLabelContainer;\n let index = details.index;\n\n index = Math.max(0, Math.min(index, that._tabs.length));\n\n const previous = that._tabs[index - 1],\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detects if the current device is an Internetcapable game console.
function DetectGameConsole() { if (DetectSonyPlaystation()) return true; if (DetectNintendo()) return true; if (DetectXbox()) return true; else return false; }
[ "function DetectGameConsole()\n{\n if (DetectSonyPlaystation())\n return true;\n if (DetectNintendo())\n return true;\n if (DetectXbox())\n return true;\n else\n return false;\n}", "checkInternetConnection() {\r\n if (navigator.onLine) {\r\n return true;\r\n } else {\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The `Mod` class to use when creating new `Mod` instances. Can be overridden for testing, etc.
get Mod() { return this._Mod || Mod; }
[ "function Modifiers() {\n this.modTypes = [];\n}", "function ModObject( modderId, modVal, modType ) {\n this.modderId = modderId;\n this.modVal = modVal;\n this.modType = modType;\n}", "get modulationType() {\n return this._modulator.type;\n }", "function Module(name) {\n if (isU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a DAG with each node assigned "rank" and "order" properties, this function will produce a matrix with the ids of each node.
function buildLayerMatrix(g){var layering=_.map(_.range(maxRank(g)+1),function(){return[]});_.forEach(g.nodes(),function(v){var node=g.node(v),rank=node.rank;if(!_.isUndefined(rank)){layering[rank][node.order]=v}});return layering}
[ "getGroupedNodeIds() {\n const ids = [];\n Object.values(this.nodes).forEach(node => (node.group ? ids.push(node.index) : null));\n return ids;\n }", "function transitionMatrix(graph) {\n let name2id = {};\n let id2name = [];\n let names = new Set();\n for (let name in graph) {\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Okey what this part of the code does it that it checks to see if the text with the Id tag bottomless has the same string as it was created when you hit "Click Me" the text is now "Programming is Cooler" and if it is, it will change the text to "it already exist", if it is not it will change it to Programming is Cooler"
function afterPlacement() { var b = "Apple Bottom Jeans With The Fur"; var a = document.getElementById('bottomless').innerHTML; //console.log(iop); //console.log(a); if(a == b) { document.getElementById("bottomless").innerHTML = "Already Exist"; console.log(a); console.log("the Value is def.1"); } ...
[ "function isDuplicate(){\n var element = document.getElementById(text);\n var dupElement = document.getElementById(\"tagDiv\").contains(element);\n return dupElement;\n }", "function updateBlankWord() {\n const updateBlank = document.getElementById('blank-word');\n updateBl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'RebootServer', Reboot server itself
function Test_RebootServer() { return __awaiter(this, void 0, void 0, function () { var in_rpc_test, out_rpc_test; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_RebootServer"); in_rpc_...
[ "reboot() {\n this.send({ system: { reboot: true } });\n }", "async reboot() {\n\t\tif(!this._isConnected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.log('info', 'Ending connecting and rebooting...');\n\t\tawait got.put(`https://${this.config.host}/api/settings/reboot`, {\n\t\t\tjson: {\n\t\t\t\tid: 0\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edit food diary entry
function editEntry(entryId, entry) { return Restangular.one(foodDiaryEndpoint, entryId).customPUT(entry); }
[ "function editEntry(entry){\n // making entry the variable that represents the entry id which includes amount, name,type\n let ENTRY = ENTRY_LIST[entry.id];\n // if the entry type is an input, we are going to update the item name and cost in the input section\n if (ENTRY.type == \"inputs\"){\n it...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resize a Float32Array buffer in an efficient way
function resizeBuffer (oldBuffer, newSize) { const newBuffer = new Float32Array(newSize); newBuffer.set(oldBuffer); return newBuffer; }
[ "function resizeBuffer(oldBuffer, newSize) {\n var newBuffer = new Float32Array(newSize);\n newBuffer.set(oldBuffer);\n return newBuffer;\n}", "resizeBuffer( addedLength ){\n //based on http://stackoverflow.com/questions/4554252/typed-arrays-in-gecko-2-float32array-concatenation-and-expansion\n v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forces deep rerender of all mounted React components.
function forceUpdateAll() { isRequestPending = false; var rootInstances = getRootInstances(), rootInstance; for (var key in rootInstances) { if (rootInstances.hasOwnProperty(key)) { rootInstance = rootInstances[key]; // `|| rootInstance` for React 0.12 and earlier ro...
[ "function deepForceUpdate(component) {\n\t if (component._instance) {\n\t // React 0.13\n\t component = component._instance;\n\t }\n\n\t bindAutoBindMethods(component);\n\n\t if (component.forceUpdate) {\n\t component.forceUpdate();\n\t }\n\n\t if (component._renderedComponent) {\n\t deepForceUpda...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }