query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
response callback the sends the GeoJson response to the SmileLoadMapFeatures controller ans shwos them on the map. Sends the response to the respObjcobject (GeoJSON) to smileFeatureStore loadDataviaReader function.
function _CallBack (resp) { // TODO: Fix loadingmask // myMask.hide(); //SMap.addFeatures(resp.features); respObj = {}; respObj = Ext.JSON.decode(resp.priv.responseText); ...
[ "function proccessResults() {\n // console.log(this);\n var results = JSON.parse(this.responseText);\n if (results.list.length > 0) {\n resetData();\n for (var i = 0; i < results.list.length; i++) {\n geoJSON.features.push(jsonToGeoJson(results.list[i]));\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete the user with userid as well as all of their reviews
function deleteUser(req, res, next) { //Check if the id is valid and exists in db Users.findOne({"_id": req.query.id}, function(err, result) { if (err){ console.log(err); } //console.log(result); //If the user exists, delete the user and ...
[ "async function deleteUser(userId) {\n await fetch(`/api/users/${userId}`, {\n method: 'DELETE'\n });\n\n // Re-fetch users after deleting\n fetchUsers()\n }", "function deleteUser(id) {\n // if it is NOT the same id return a list of all the users without that ID\n const updatedUse...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the height of the overlay : if the document height is taller than the window, then set the overlay height to the document height. : otherwise, just set overlay height: 100%
function setOverlayHeight() { if ($(window).height() < $(document).height()) { $overlay.css({height: $(document).height() + 'px'}); $iframe.css({height: $(document).height() + 'px'}); } else { $overlay.css({height: '100%'}...
[ "function fullscreenImgHeight() {\n $('#home, .background-video').css({height:window_height});\n }", "setHeight() {\n this.$().outerHeight(this.$(window).height() - this.get('fixedHeight'));\n }", "function setWindowHeight(element){\n\t$(element).height( getWindowHeight() );\n}", "function heightFulls...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generateForBob Calls generatePrimes to generate key values for Alice
function generateForBob() { generatePrimes("bob"); }
[ "function generateForAlice() {\n generatePrimes(\"alice\");\n }", "function makeBobKey() {\n bobKey = false;\n let p = document.getElementById(\"bobP\").value;\n let q = document.getElementById(\"bobQ\").value;\n let e = document.getElementById(\"bobE\").value;\n keyge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end switchText_cb resumeEditing The resumeEditing function is called when the user is in the correction mode and wants to return to the editing mode. It hides the results div and the suggestions div, then enables the text box and unhides the text box. It also calls resetAction() to reset the status message.
function resumeEditing() { with(currObj); if(currObj.config['useIcons']) { currObj.actionSpan.innerHTML = "<a class=\"resume_editing\"><img src=\"" + currObj.config['imagePath'] + "images/page_white_edit.png\" width=\"16\" height=\"16\" title=\"Resume Editing\" alt=\"Resume Editing\" border=\"0\" /></a>"; }...
[ "function switchText_cb(new_string)\r\n{\r\n\twith(currObj);\r\n\tnew_string = new_string.replace(/~~~/gi, \"\\n\");\r\n\r\n\t// Remove the prefixed asterisk that was added in switchText().\r\n\tnew_string = new_string.substr(1);\r\n\tcurrObj.objToCheck.style.display = \"none\";\r\n\tcurrObj.objToCheck.value = new_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
formatting Data to a more d3friendly format extracting packageNames and severityNames
function formatData(data){ //var severityNames = ["unknown", "negligible", "low", "medium", "high", "critical"] var severityNames = ["Critical", "High", "Medium", "Low"]; var packageNames = []; var blockData = []; data = data.sort(function(a, b) { return (a.Critical + a.High + a.Medium + a.Lo...
[ "function formatData(data) {\n return data.map((el) => {\n return {\n x: new Date(el[0]).toLocaleString().substr(11,9),\n y: el[1].toFixed(2),\n };\n });\n }", "function formatTacktickMessage(data) {\n var key = data.subtype === 'heading'?'FFP':'FFD';\n key += data.index;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reads local storage and returns data to restrieve image classes
function readLocalStorage(){ let retrievedJSONData = localStorage.getItem('images'); return JSON.parse(retrievedJSONData); }
[ "function getUploadData() {\n var localData = JSON.parse(window.localStorage.getItem(\"advantagescout_scoutdata\"))\n for (var i = 0; i < localData.length; i++) {\n var fields = Object.keys(localData[i])\n for (var f = 0; f < fields.length; f++) {\n var value = loc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the `Rect` bounds of a cell in scrollpane client space. If the cell is beyond the bounds of the userdefined table cells, it is considered a "ghost" cell. If a width/height is not defined for that row/column, we use the default width/height.
getGhostCellRect(rowIndex, columnIndex) { let left = 0; let top = 0; let width = 0; let height = 0; if (rowIndex >= this.rowHeights.length) { height = this.ghostHeight; top = this.getHeight() + this.ghostHeight * (rowIndex - this.numRows); } ...
[ "getRowRect(rowIndex) {\n const height = this.rowHeights[rowIndex];\n const top = this.cumulativeRowHeights[rowIndex] - height;\n return new Rect(0, top, this.getWidth(), height);\n }", "calcBoardCellSize(maxBoardWidth, cellCols, minCellSize) {\n let cellSize = Math.floor((maxBoardWidth...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ENDS Function to validate select_theme / Function to validate site_terms
function ssw_js_validate_terms() { var terms_checkbox = document.getElementById('ssw-steps').site_terms; if (terms_checkbox.checked) { document.getElementById("ssw-site-terms-error").style.display="none"; return true; } else { document.getElementById("ssw-site-terms-er...
[ "function ssw_js_validate_theme() {\n \n var theme_button = document.getElementById('ssw-steps').select_theme;\n var theme_button_count = -1;\n\n for (var i=theme_button.length-1; i > -1; i--) {\n if (theme_button[i].checked) {theme_button_count = i; i = -1;}\n }\n if (theme_button_count > ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is used if the binding provider doesn't include a getBindingAccessors function. It must be called with 'this' set to the provider instance.
function getBindingsAndMakeAccessors(node, context) { return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context)); }
[ "function addBindingProperty(e)\n {\n if(!e.binding)\n {\n e.binding = ko.dataFor(e.target);\n }\n\n return e;\n }", "function checkBindings () {\n addLog('checkBindings() was Triggered');\n // if dataBoundNodes has elements in it, loop through each one a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to get random value between intervals
function randomFromInterval(from,to){return Math.floor(Math.random()*(to-from+1)+from);}
[ "function getRandomValueInRange(min, max){\n if(max === min){\n return max;\n }\n var randomValue = (max - min) * Math.random() + min;\n return Math.floor(randomValue);\n}", "function getRandomFloat(min, max)\n{\n return min + Math.random() * (max - min);\n}", "function crystals(min,max){return Math.fl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates new blocks based on the user's input
function generateBlocks(){ var numberOfBlocks = ($("#number-Value").val()); blocksToCount = numberOfBlocks; // Keeps the blocks within legal limits of the game if (numberOfBlocks > 3 && numberOfBlocks <= 8){ // counts through the numbers and runs for the length of the number the user put in...
[ "function createNewBlock(name) {\n\t\t\t\tvar node = container, block, clonedNode, caretNode;\n\n\t\t\t\tblock = name || parentBlockName == \"TABLE\" ? dom.create(name || newBlockName) : parentBlock.cloneNode(false);\n\t\t\t\tcaretNode = block;\n\n\t\t\t\t// Clone any parent styles\n\t\t\t\tif (settings.keep_styles...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scroll the given document position into view.
scrollPosIntoView(pos) { this.viewState.scrollTo = EditorSelection.cursor(pos); this.requestMeasure(); }
[ "function scrollPathView(e) {\n\t\t\tvar target = e ? e.target : window.event.srcElement,\n\t\t\t\tmaxScroll = pathView.scrollWidth - pathView.clientWidth,\n\t\t\t\tscroll = pathView.scrollLeft,\n\t\t\t\tchange = 5;\n\n\t\t\t\tif (target.className === \"adi-path-right\") {\n\t\t\t\t\tpathView.scrollLeft = (scroll <...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get (eventual) Pet in editing from Local Storage
function getPetInEditFromLS(){ return localStorage.getItem("petInEdit"); }
[ "function getIdea(id) {\n return JSON.parse(localStorage.getItem(id));\n}", "function pullFromStorage(){\r\n return JSON.parse(localStorage.getItem(\"todoitems\"))\r\n}", "function createPet() {\n\n\t\n\tvar petDetails = [];\n\tvar petCollection;\n\n\t//collect any data already held in localStorage \n\tpe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Take two arguments and return an ordered array of [event, anchor]
function getEventAndAnchor (arg1, arg2) { var ev = null var anchor = null if (arguments.length === 2) { // Two arguments will come in this order ev = arg1 anchor = arg2 } else if (isHTMLElement(arg1)) { // If our first arg is an element // then use that as our anchor anchor = arg1 } e...
[ "function normalizeOnEventArgs(args) {\n if (typeof args[0] === 'object') {\n return args;\n }\n \n var selector = null;\n var eventMap = {};\n var callback = args[args.length - 1];\n var events = args[0].split(\" \");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merge two wallets without empty values
function mergeWallets(wallet1, wallet2) { let mergedWallet = copyWallet(wallet1) for (let bill in wallet2) { if (wallet2[bill] != 0) { mergedWallet[bill] = wallet2[bill] } } return mergedWallet }
[ "function copyWallet(wallet) {\n let newWallet = {}\n for (let bill in wallet) {\n if (wallet[bill] != 0) {\n newWallet[bill] = wallet[bill]\n }\n }\n return newWallet\n }", "async refreshWallets() {\n const gapLimit = 1; //after 20 empty addresse we drop out\n\n //Depo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decompress stream based on content and transfer encoding headers.
function decompressStream(stream, headers) { var transferEncoding = headers.get('Transfer-Encoding'); var contentEncoding = headers.get('Content-Encoding'); if (contentEncoding === 'deflate' || transferEncoding === 'deflate') return stream.pipe(Zlib.createInflate()); if (contentEncoding === 'gzip' || transferEn...
[ "function HeaderDecoder(direction) {\n this.encodingContext_ = new EncodingContext(direction);\n}", "function decode(content, encoding, decoder = \"text\") {\n if (encoding) {\n content = Buffer.from(content, encoding).toString();\n }\n switch (decoder) {\n case \"json\":\n try {\n return JSON.par...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To combine all strings in the given Ancestors object and add to the given Paths object It then resets the Ancestors object
function collectAncestors( Ancestors, Paths ){ Ancestors.Starts.forEach(function( start, i ){ Ancestors.Ends[i].forEach(function( end ){ addIfUnique( path.normalize(path.resolve(start+end)), Paths ); }) }); Ancestors.Starts = []; Ancestors.Ends = []; Ancestors.Base = ''; }
[ "function traverseUp( filePath, Paths, Ancestors ){\n\tvar index, start, end,\n\t\tsplit = filePath.split('^');\n\t\n\t//Throw an error if there is more than one ^ in the given filePath\n\tif( split.length > 2 ){\n\t\tthrow new Error('Invalid File Path : ' + filePath)\n\t}\n\t\n\t//Get the start directory and the e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CODING CHALLENGE 658 Many IDS (for emails or Google ID) are created using the person's name. Create a function that will return a fourcharacter ID using the person's first name and last name. The first character will be the first letter of the first name but in lowercase. The next three characters will be the first thr...
function createID(firstname, lastname) { return firstname[0].toLowerCase() + lastname[0].toUpperCase() + lastname.slice(1, 3).toLowerCase(); }
[ "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 1000; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }\n }", "function champIdToName(id) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parameters : None Purpose: Pull all jobs with null or "temp" jobTypes Output: Returns a list of all matching Jobs
async function getTempAndNullJobs() { var db = await MongoClient.connect(process.env.PROD_MONGODB); var nullJobsList = await db.collection('jobs').find({ "jobType": null }).toArray(); var tempJobsList = await db.collection('jobs').find({ "jobType": "temp" }).toArray(); tempJobsList = await t...
[ "filterJobs(jobs, filters = {}) {\n const { tag, name } = filters;\n const nameRegex = name && new RegExp(`(^| )${name}( |$)`);\n return jobs.filter(job => {\n if (tag && (!job.tags.length || job.tags.indexOf(tag) === -1)) {\n return false;\n }\n if (nameRegex && (!job.name || !nameRe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End call could be done by either doctor or user remember to handle concurrency in api
async endCall(duration){ try{ const _duration = this.callDurationCalculator(duration) const setCallHistory = await Axios.post(API_PREFIX+'Users/callEnded',{payload:this.props.navigation.state.params.payload,duration:_duration}); const {message,status} = setCallHistory.data; ...
[ "async function endSession() {\n updateStatus(\"Ending Call\");\n console.log(`Ending session: ${internal_call_id}`);\n\n try {\n var res = await fetch(\"/endSession?room_name=\" + internal_call_id);\n\n // basic error handling\n if (res.status !== 200) {\n console.log(res);\n alert(\"Failed t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialization and opening of game history page
function openHistoryPage() { renderHistory(); $("#start-screen").addClass("hide"); $("#setup-screen").addClass("hide"); $("#game-screen").addClass("hide"); $("#history-screen").removeClass("hide"); }
[ "function showHistory() {\n\n\t}", "function loadPageFromHistory() {\n\t\t//Load default page\n\t\trenderPage(getCurrentPageIdBasedOnHistory());\t\n\t}", "function initalhistory(){\n\tgetHistory();\n\tclearInterval(inithis);\n}", "getHistory () {\n return this.game.history({ verbose: true })\n }", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
guess click function that populates correct answer ID and checks if win or lose round
function guessClick() { $(".guesses").on("click", function () { guess = $(this).attr("answerID"); if (guess == 1) { win++ displayAnswer(); answerTimer(); } else { loss++; displayAnswer(); answerTimer(); ...
[ "function correct() {\n wins++;\n restartGame();\n }", "function correctGuess() {\n score += wrongAnswersLeft;\n if (score > hScore) {\n hScore = score;\n }\n setCorrectScreen(wrongAnswersLeft);\n }", "function makeGuess() {\n let radioButtons = Array.from(doc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays word1 and word2 where connected
function showConnections(word1, word2) { var e = getTreeEdge(word1, word2); if(e==null) e = getGraphEdge(word1,word2); if (e == null) return; currEdge = e; selected.data('poem').hidePoem(); for (var j = 0; j < poemList.length; j++) { poemList[j].attr("fill", deselectColor); } ...
[ "function isEdge(word1, word2) {\n for (var m = 0; m < edges.length; m++) {\n if (edges[m] == null) continue;\n if ((word1 == edges[m].w1 && word2 == edges[m].w2) || (word1 == edges[m].w2 && word2 == edges[m].w1)) return true;\n }\n return false;\n}", "function summaryLinkedContentWording()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the length of a row
function rowLength(row) { var rowLen = 0; for (var i = 0; i < row.length; i++) { rowLen += row[i].length } return rowLen }
[ "rowhSize() {\n return this.nodes.rowHolder.childElementCount - (this.displayedInfo.renderedEndRow !== null ? 1 : 0);\n }", "function obtenTablaLength(tabla){\t\r\n\t\treturn parseInt($(\"#\"+tabla+\">tbody>tr\").length);\r\n\t}", "function getElementWidth(row,index) {\n var counter = 0;\n for (var ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get optimization for webpack. We optimize all chunks because
getOptimization() { const { optimizeSplitChunks } = this.config; const optimization = { // We set runtimeChunk to be single // because user can (and probably should) // have multiple entry-point on the same page runtimeChunk: 'single' }; if (optimizeSplitChunks) { ...
[ "minChunks(module) {\n return (\n module.resource && /\\.js$/.test(module.resource) &&\n module.resource.indexOf(path.join(__dirname, '../node_modules') === 0)\n )\n }", "function getWebpackConfig(\n options = {\n /**\n * Whether we're compiling any CSS: if so, will ad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flush both queues and run the watchers.
function flushBatcherQueue() { var _again = true; _function: while (_again) { _again = false; runBatcherQueue(queue); runBatcherQueue(userQueue); // user watchers triggered more watchers, // keep flushing until it depletes if (queue.length) { _again = true; ...
[ "function runObservers () {\n try {\n queuedObservers.forEach(runObserver);\n } finally {\n currentObserver = undefined;\n queuedObservers.clear();\n }\n}", "start() {\n this.notify.debug('Start all queues');\n this.started = true;\n for (let queue of this.queues)\n que...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : createLinkForDevicelist AUTHOR : Juvindle C. Tina DATE : December 5, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : check available device PARAMETERS : device,device2
function createLinkForDevicelist(device,device2){ if(device.DeviceName != "" && device2.DeviceName != ""){ if(lineName != "" && lineName != null && lineName != undefined && (lineName.toLowerCase() == "ethernet" || lineType == "Any")){ checkPortOfDeviceList2(device.ObjectPath,device2.ObjectPath); }else if(lineNa...
[ "function validationinCreatingLink(device,device2){\n\tvar message = \"\";\n\tif(connectedSwitch == true){\n\t\tmessage = device.DeviceName + \" and \" + device2.DeviceName + \" have no port connected on same switch.\";\t\n\t\tif(globalDeviceType == \"Mobile\"){\n\t\t\terror(message,\"Notification\");\n\t\t}else{\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to generate one room
_generateRoom() { let count = 0; while (count < this._roomAttempts) { count++; let room = _features_js__WEBPACK_IMPORTED_MODULE_1__["Room"].createRandom(this._width, this._height, this._options); if (!room.isValid(this._isWallCallback, this._canBeDugCallback)) { ...
[ "function createRoom() {\n const roomCode = getRoomName();\n if (serverState.rooms[roomCode] != null) { // If not null, create it again\n return createRoom()\n }\n\n // Server state is a const with a rooms hash inside\n // Set that rooms hash, to have a players array, a code and a turn number\n serverStat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate losepwd stepone fields
function validateLosePwdOne(form) { var flag = validateField("#j_username", /.{1,100}$/, usernameErrormsg, true); flag = flag && validateField("#j_checkcode", /^[A-Za-z0-9]{5}$/, checkcodeErrormsg, false); flag = flag && validateField("#j_smscode", /^[0-9]{6}$/, smscodeErrormsg, false); return flag; }
[ "function sanityCheck(){\n if(!passLowerCase && !passUpperCase && !passNumeric && !passSpecial){\n // We can't have a password without anything in it!\n passLowerCase=true;\n document.getElementById(\"include-lowercase\").checked=true;\n }\n if(passLength>maxPassLength){\n // Larger passwords are mor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get content of element 'elem' if exist and remove it from the problem_data
function get_element_content_if_exist(problem_data, elem) { if(problem_data.hasOwnProperty(elem)) { var content = problem_data[elem][2]; if (elem == "time" || elem == "last_occurrence") { content = new Date(parseInt(content) * 1000).toLocaleString(); } ...
[ "remove(element) {\n this.set.splice(this.set.indexOf(element), 1);\n console.log(\"element removed successfully\");\n }", "function dropPointySubElements(element) {\n\tvar ret = [];\n\telement.each(function (idx, el) {\n\t\tvar jel = $j(el);\n\t\tvar hadOne = false;\n\t\tjel.find(\"em\").each(fu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the migration list.
update_list() { fetch(this.options.statusUrl) .then(response => response.json()) .then(migration => { this.el.find(':first').replaceWith($(createElementFromHTML(migration)).find(':first')); }); }
[ "updateList() {\n console.log(\"$$$$$$$$ updateList\");\n this.forceUpdate();\n }", "function migrate() {\n migrateNowPlaying();\n migratePlaylist();\n }", "async doMigrations() {\n // current store versions\n const storeVersions = {\n users: 1,\n chat: 1,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Internal compare array of changes from Oracle with Salesforce result set.
function compareChanges(timestamp,dbchanges, sfchanges,objectname) { var map={}; var missed = []; var sf_missed = []; var late = []; var okay = []; w.info(moment().format()+":"+'CompareChanges for '+objectname); if (sfchanges==null) { w.info(moment().format()+":"+' No data from Sa...
[ "haveChanges() {\n return this.code !== this.codeFromTableau;\n }", "function costas_verify ( array ){\n var result;\n var diff_array = array_diff_vector( array );\n var array_set = set_of_values( array );\n var diff_array_set = set_of_values( diff_array );\n //console.log( 'diff_array leng...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Main compression routine, palette indexes > LZW code stream. |index_stream| must have at least one entry.
function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) { buf[p++] = min_code_size; var cur_subblock = p++; // Pointing at the length field. var clear_code = 1 << min_code_size; var code_mask = clear_code - 1; var eoi_code = clear_code + 1; var next_code = eoi_code + 1; var cur_code_...
[ "function buildCharMapIndex() {\n // Unicode Blocks\n let basicLatin = []; // Block: 00..7E; Subset: 20..7E\n let latin1 = []; // Block: 80..FF; Subset: A0..FF\n let latinExtendedA = []; // Block: 100..17F; Subset: 152..153\n let generalPunctuation = []; //...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : showHideLinkMenu AUTHOR : Apple Kem E. Eguia DATE : March 07, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS :
function showHideLinkMenu(id){ switch(id){ case "linkList": $("#linkMenu").hide(); $("#subLink").show(); var bck = '<div id="linkBack" style="position:absolute;cursor:pointer;" onclick="linkBackBtn()"><img src="img/backArrow.png" style="width: 20px;margin-left: 3px;margin-top: 6px;"></div>'; $('...
[ "function show_hide_link(elt_id, link_elt_id, hide_label, show_by_default) {\n $(document).ready(function() {\n var to_toggle = $('#' + elt_id);\n var link_elt = $('#' + link_elt_id);\n var show_label = link_elt.html();\n if (show_by_default) {\n\tlink_elt.html(hide_label);\n\tto_toggle.show();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function essentially takes 2 variables called file_path and searchstring and then returns true if it finds the word and returns false.
function find_word(file_path,searchstring) { var fso,f,s_SearchString,s_FilePath,s_FileContent; var ForReading = 1, ForWriting = 2, ForAppending =8; s_SearchString = /searchstring/i; //s_SearchString = new String(searchstring); s_FilePath = new String (file_path); fso = new ActiveXObject("Scripting.FileSystemObje...
[ "function searchFileId(searchText) {\n if (searchText in cache.indexes) {\n return cache.content.files[cache.indexes[searchText]];\n }\n return false;\n}", "function doesWordExist(wordsArr, word) {\nif(wordsArr.includes(word)){\n return true;\n}else{\n return false;\n}\n}", "function stringCon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dismisses drawer with animation
dismissDrawerWithAnimation() { const { direction } = this.props; const { sideMenuIsDismissing } = this.state; const closeValues = { left: -this.drawerWidth, right: this.screenWidth, top: -this.drawerHeight, bottom: this.screenHeight }; // Animate side menu ...
[ "function menuClosed() {\n mainNav.classList.remove('main-nav-reveal');\n html.classList.remove('html-nav-opened');\n mainNav.style.overflowY = 'unset';\n}", "function closeMobileMenu() {\n navMenuMobile.style.maxHeight = null;\n navMenuMobile.style.pointerEvents = 'none';\n bodyOverlay.style.opacity = 0;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set all receptors to basic
function initReceptors(){ for ( var i = 0; i < 3; i++){ receptors[i] = []; for (var j = 0; j < 5; j++){ var color = null; if (receptors[i][j]){color = receptor[i][j].color;} receptors[i][j] = new Receptor(); if (color != null){receptors[i][j].color = ...
[ "init(){\n\t\tthis.calcStats();\n\t\tthis.hpRem = this.getStatValue(Stat.HP);\n\n\t\tthis.poisoned = false;\n\t\tthis.regen = false;\n\t\tthis.shield = false;\n\n this.healableDamage = 0; //damage that can be healed through heart collection\n\n this.eventListenReg.clear();\n\n this.warriorSkill...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a export friends link to the top of the worker tab.
function renderExportFriendsLink() { // Paint the Export friends to the top of the page. var exportFriendsLink = $('#pageNav #navAccount ul li:nth-child(2)').clone(); $('a', exportFriendsLink) .attr('id', 'export-friends-link') .attr('href', 'javascript:void(0);') .text('Export Friends!') ...
[ "function exportBookmarks() {\n\tvar folderName = prompt(chrome.i18n.getMessage(\"editExportPrompt\"));\n\n\t// If the cancel button was pressed\n\tif (folderName === null) {\n\t\tdocument.getElementById(\"export-button\").blur();\n\t\treturn;\n\t}\n\n\t// Default folder name if none is specified\n\tif (folderName ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
areas_black = bishop(chess,i,j,areas,true); areas_black = rook(chess,i,j,areas,true); areas = pawn(chess,i,j,areas,true); areas = knight(chess,i,j,areas,true); areas_white = bishop(chess,i,j,areas,false); areas_white = rook(chess,i,j,areas,false); areas = pawn(chess,i,j,areas,false); areas = knight(chess,i,j,areas,fals...
function findVulnerability(areas_black, areas_white, chess) { areas_white = [ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0],...
[ "function chessCalc(pieces) {\n //your code here\n }", "setBoard(height,width,start) {\nlet color = 'w';\nlet piece;\nif(start===true){\npiece= {king};\n}\nelse {\npiece= null;\n}\n\tfor(let i=0;i<height;i++){\n\tlet row =[];\n\t\tfor(let j=0;j<width;j++){\n\t\t\t//if the board has an even numbe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Notices and disclaimers regarding the use of the measure, or related to intellectual property (such as code systems) referenced by the measure.
get disclaimer() { return this.__disclaimer; }
[ "get softwareDamage () {\n return this._softwareDamage\n }", "get hardwareDamage () {\n return this._hardwareDamage\n }", "function YDataLogger_get_measureNames()\n {\n return this._measureNames;\n }", "function automatedReadabilityIndex(letters, numbers, words, sentences) {\n    return (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
private: used to recursively add new platform configs
function addConfig(configObj, platformObj) { for (var n in configObj) { if (n != PLATFORM && configObj.hasOwnProperty(n)) { if (angular.isObject(configObj[n])) { if (!isDefined(platformObj[n])) { platformObj[n] = {}; } addConfig(configObj[n], platformObj[n]); ...
[ "function updatePlatformConfig(platform) {\n var configData = parseConfigXml(platform),\n platformPath = path.join(rootdir, 'platforms', platform);\n\n _.each(configData, function (configItems, targetFileName) {\n var targetFilePath;\n if (platform === 'ios') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays the New File Dialog
function NewFilePrompt() { $("div#overlay-header").html("New File"); $("div#overlay-body").html($("div#overlay-templates div.overlay-new-file").html()); $("div#force-overlay").css("display", "block"); }
[ "function FilesDlg(form, element,directory, tag_id) {\n tag_id = parseInt(\"0\"+tag_id)*1;\n window.open('?page=filestoragedlg&isOpen=1&form=' + form + '&element=' + element + '&directory=' + directory + '&tag_id=' + tag_id,\n 'FilesDlg', 'menubar=no,width=400,height=400,scrollbars=yes,resi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decode Koremutake string to unsigned integer value
function decode(value) { var x = 0; while (value) { if (phonemes.indexOf(value.slice(0,2)) >= 0) { var bit = value.slice(0,2); value = value.slice(2); } else { var bit = value.slice(0,3); value = value.slice(3); } x = x * phonemes.length + phonemes.indexOf(bit); ...
[ "function hex2bigIntKey(s){ return bigInt2bigIntKey(hex2bigInt(removeWhiteSpace(s))); }", "static uint112(v) { return n(v, 112); }", "function decode(r) {\n let num = parseInt(r), arr = r.match(/[a-z]/g).map(x=>x.charCodeAt(0)-97), str= \"\";\n for(let code of arr){\n let orig = \"\";\n for(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the streamable URL from the URL provided for all of the soundcloud links. This will loop through and set all of the information for the soundcloud urls.
function privateGetSoundcloudStreamableURLs(){ var soundcloud_regex = /^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/; for( var i = 0; i < config.songs.length; i++ ){ /* If the URL matches soundcloud, we grab that url and get the streamable link if there is one. */ if( config.songs[i].url.match...
[ "function privateSoundcloudResolveStreamable(url, index){\n\t\tSC.get('/resolve/?url='+url, function( sound ){\n\t\t\t/*\n\t\t\t\tIf streamable we get the url and bind the client ID to the end\n\t\t\t\tso Amplitude can just stream the song normally. We then overwrite\n\t\t\t\tthe url the user provided with the stre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format the result item.
format(item, index) { if (this.onFormat) { item = this.onFormat(index, item, this.searchedInput); } return item; }
[ "formatResultCategories() {\n this.resultData.violations.forEach(item => {\n $('#violations ul').append(this.getResultItemHtml(item));\n });\n\n this.resultData.passes.forEach(item => {\n $('#passes ul').append(this.getResultItemHtml(item, 'pass'));\n });\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves Explore state to URL using the `left` and `right` parameters. If split view is not active, `right` will not be set.
function stateSave() { return function (dispatch, getState) { var _a = getState().explore, left = _a.left, right = _a.right, split = _a.split; var urlStates = {}; var leftUrlState = { datasource: left.datasourceInstance.name, queries: left.queries.map(app_core_utils_e...
[ "function splitOpen() {\n return function (dispatch, getState) {\n // Clone left state to become the right state\n var leftState = getState().explore.left;\n var itemState = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, leftState, { queryTransactions: [], queries: leftState.queries.sl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stores references to: the active element (to return focus) the scrolling parent (to return scroll) the scrolling offset of the parent (to return scroll)
saveScrollAndFocus () { this.activeElement = document.activeElement; // returning focus from ReactModal is not working properly, so storing a reference in here to return it this.scrollingParent = document.activeElement && findFirstScrollableParent(document.activeElement) || window; this.scrollTop = this.scr...
[ "function getParentWithScroll()/*:Element*/ {\n if (!this.dataViewScroller$_UfH) {\n this.dataViewScroller$_UfH = this.component.el.parent();\n while (this.dataViewScroller$_UfH) {\n var style/*:CSS2Properties*/ = this.dataViewScroller$_UfH.dom.style;\n if (style.overflow === \"auto\" || ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
JSON Pointer specification: from obj, return the property with a JSON Pointer prop, optionally setting it to newValue
function jptr(obj, prop, newValue) { if (typeof obj === 'undefined') return false; if (!prop || typeof prop !== 'string' || (prop === '#')) return (typeof newValue !== 'undefined' ? newValue : obj); if (prop.indexOf('#')>=0) { let parts = prop.split('#'); let uri = parts[0]; if (uri...
[ "function convertProperty(obj, prop, newProp) {\n if (obj.hasOwnProperty(prop)) {\n obj[newProp] = obj[prop];\n delete obj[prop];\n }\n return obj;\n}", "set(propObj, value) {\n propObj[this.id] = value;\n return propObj;\n }", "ensureProperty(obj, prop, value) {\n if (!(prop ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If any XHRs are opened, then wait for them to complete. Because an XHR may not be opened in the event handler, we wait for milliseconds to see if any XHRs are created. If there are, then we wait up to milliseconds for those XHRs to finish. Typically, you want to call this _before_ you do something that triggers an XHR,...
function whenXhrFinished(timeoutBeforeMs, timeoutAfterMs) { var p = new Promise(); var timeoutBeforeMs = timeoutBeforeMs || 10; var timeoutAfterMs = timeoutAfterMs || 2500; var xhrInterceptedCount = 0; var xhrFinishedCount = 0; var timerBefore; var timerBeforeF...
[ "function tryClickXhr(n) {\n var p = new Promise();\n\n whenAll(\n whenXhrFinished(),\n clickXhrElement()\n ).then(function (values) {\n var found = values[1]; // The return value from clickXhrElement()\n\n if (found && n > 1) {\n p.res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
findByText function to find element by css selector and then finds which element that contains the given text. Will search within an element object if given.
function findByText(css, text, element=false) { var els = findAll(css, element); for (var i = 0; i < els.length; i++) { if (els[i].innerText != "" && els[i].innerText.includes(text)) { return els[i]; } } }
[ "getElement(elementText){\n return $('//span[contains(text(), \"'+elementText+'\")]')\n }", "function contains(selector, text) {\r\n var elements = document.querySelectorAll(selector);\r\n return [].filter.call(elements, function (element) {\r\n return RegExp(text).test(element.textContent);\r\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
open FPDebugger.exe and record playback for a swf
async function main() { const childProcess = spawn(fp_player_path, [swfPath], { stdio: ['ignore', 'pipe', process.stderr] }); await echoReadable(childProcess.stdout); // get the output from the FP-Player from the Flash-logs try { //console.log("log", TestConfig.pathToFPLogs) let log = fs.readFileSync...
[ "function iefixNindexi1f1() {\r\n document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"100%\" height=\"100%\">\\n')\r\n document.write(' <param name=\"movie\" value=\"lab1.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
compare length of coordinates/array
function sameLength(g1,g2) { return g1.hasOwnProperty('coordinates') ? g1.coordinates.length === g2.coordinates.length : g1.length === g2.length; }
[ "function sameLength(g1,g2) {\n return g1.hasOwnProperty('coordinates') ? \n g1.coordinates.length === g2.coordinates.length\n : g1.length === g2.length;\n}", "function costas_verify ( array ){\n var result;\n var diff_array = array_diff_vector( array );\n var array_set = set_of_values( array );\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the tooltip triangle if this.props.hasTriangle is true
_renderTriangle(tooltipDirection) { const { triangleSize, triangleClass } = this.props; const { triangleLeft: left, triangleTop: top } = this.state; const triangleDirectionPosition = -1 * triangleSize; const addShadow = this.props.hasShadow && tooltipDirection == 'top'; const tri...
[ "initTooltip() {\n const self = this;\n\n // Array containing all tooltip lines (visible or not)\n self.d3.tooltipLines = [];\n self.curData.forEach(function (datum, index) {\n if (index > self.colorPalette.length) {\n notify().error(\"Palette does not contain e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send chats to chatList
sendChatsToList() { if (!this._chats) return; this._componenets.chatsList.setChats(this._chats) }
[ "function appendChatMessageRoom(li) {\n\t$('#messagesRoom').append(li);\n\n\t// scrolling the list to bottom so that new message will be visible\n\t$('#messagesRoom').scrollTop($('#messagesRoom').height());\n}", "function appendChatMessage(li) {\n\t$('#messages').append(li);\n\n\t// scrolling the list to bottom s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will set a cursor using an image and will handle cross browser issues.
function setCursor(canvas, image, defaultCursor) { canvas.style.cursor = (isIE() ? 'url(images/' + image + '.cur)' : 'url(images/' + image + '.svg) ' + + ' ' + curAnnotationXY + ' ' + curAnnotationXY) + ', ' + defaultCursor; }
[ "function setCursor(image) {\n\tif(!image)\n\t\tdelete theCanvas.style.cursor;\n\telse\n\t\ttheCanvas.style.cursor = \"url(\"+image.src+\") \"+\n\t\t\timage.hotSpotX+\" \"+\n\t\t\timage.hotSpotY+\n\t\t\t\", auto\";\n}", "function loadCursor(url, x,y) {\n\tvar img = loadImage(url);\n\timg.hotSpotX = x;\n\timg.hot...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The Cpu represents a Cpu from the kernel's point of view.
function Cpu(kernel, number) { if (kernel === undefined || number === undefined) throw new Error('Missing arguments'); this.kernel = kernel; this.cpuNumber = number; this.slices = []; this.counters = {}; this.bounds_ = new tr.b.Range(); this.samples_ = undefined; // Set during createSu...
[ "function Cpu(kernel, number) {\n if (kernel === undefined || number === undefined)\n throw new Error('Missing arguments');\n this.kernel = kernel;\n this.cpuNumber = number;\n this.slices = [];\n this.counters = {};\n this.bounds = new tr.b.Range();\n this.samples_ = undefined; // Set dur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test that our real smart folder is in fact a child if the correct smart folder parent
function test_smart_child_parent_relationship() { let folderIndex = assert_folder_visible(smartFolderA); let folderFTVItem = mc.folderTreeView.getFTVItemForIndex(folderIndex); if (!FTVItemHasChild(folderFTVItem, subfolderA, false)) throw new Error("Folder: " + subfolderA.name + " is not a child of our smart p...
[ "function test_real_child_parent_relationship() {\n smartFolderInbox = get_smart_folder_named(\"Inbox\");\n expand_folder(smartFolderInbox);\n // the real parent should be an Inbox\n let folderIndex = assert_folder_visible(subfolderA.parent);\n let folderFTVItem = mc.folderTreeView.getFTVItemForIndex(folderInd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flush metric data to Datadog server
flush() { const series = this.generateDatadogSeries(); if (series.length == 0) return; return fetch( `${this.opts.baseUrl}${this.opts.apiVersion}${this.opts.path}?api_key=${this.opts.apiKey}`, { method: "post", body: JSON.stringify({ series }), headers: { "Content-Type": "application/json...
[ "function clearData() {\n setInterval(function () {\n console.log(\"clearing.....\")\n axios.post(baseURL + '/api/clear')\n dataSet();\n // location.reload()\n }, 900000)\n}", "function flushPings() {\n var sqldata = 'DELETE FROM app_clients WHERE lastping < (UNIX_TIMESTAMP() - 600)';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encode packet as string.
encodeAsString(obj) { // first is type let str = "" + obj.type; // attachments if we have them if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { str += obj.attachments + "-"; } // if we have a namespace other than `/...
[ "function encode_packet( packet ) {\n var encoded = to_bytes( packet.id );\n encoded += String.fromCodePoint( packet.flags ).toBytes();\n encoded += String.fromCodePoint( packet.codes ).toBytes();\n encoded += to_bytes( packet.qd ); // Questions\n encoded += to_bytes( packet.answers.length ); // Answers\n enc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Evaluates whether this point is a counter overflow candidate
static evalIsCounterOverflow(dict) { return dict.IsCounterOverflow === 'X'; }
[ "static evalIsOverflowNotEmptyAndOverflowGreaterThanReading(context, dict) {\n if (!libThis.evalIsCounterOverflowEmpty(dict)) {\n return (libLocal.toNumber(context, dict.CounterOverflow) > libLocal.toNumber(context, dict.ReadingSim));\n } else {\n return false;\n }\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function will set max sec when audio is loaded and autoplay the audio
function setMaxsec(){ maxsec = $("#audio-player")[0].duration; $("#maxsec").text(timeConvert(maxsec)); changeWaveLength(); audioPlay(); }
[ "function setAudioTime() {\n let audioel = document.getElementById(\"audio-element\");\n const duration = audioel.duration;\n const timestamp = Date.now() / 1000;\n const audiotime = timestamp % duration;\n audioel.currentTime = audiotime;\n}", "function setTimer() {\r\n \t\t\tif (options.autoplay && timer =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
samplemetadata: title: Inspect a string with substring exclusions. description: Inspect a string with list of substrings to be used as exclusions. usage: node inspectWithExclusionDictSubstring.js myproject string excludedSubstringList
function main(projectId, string, excludedSubstringList) { excludedSubstringList = excludedSubstringList ? excludedSubstringList.split(',') : []; // [START dlp_inspect_string_with_exclusion_dict_substring] // Imports the Google Cloud Data Loss Prevention library const DLP = require('@google-cloud/dlp'); ...
[ "function main(projectId, textToInspect, words, infoTypes) {\n words = words.split(',');\n infoTypes = transformCLI(infoTypes);\n // [START dlp_deidentify_exception_list]\n // Imports the Google Cloud Data Loss Prevention library\n const DLP = require('@google-cloud/dlp');\n\n // Initialize client that will b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an AEAD cipher delegate used to encrypt packet fragments.
function createCipher(algorithm) { const cipherParams = AEADCipherParameters[algorithm]; const ret = ((packet, keyMaterial, connEnd) => { const plaintext = packet.fragment; // find the right encryption params const salt = (connEnd === "server") ? keyMaterial.server_write_IV : keyMaterial...
[ "function createDecipher(algorithm) {\n const decipherParams = AEADCipherParameters[algorithm];\n const ret = ((packet, keyMaterial, connEnd) => {\n const ciphertext = packet.fragment;\n const sourceConnEnd = (connEnd === \"client\") ? \"server\" : \"client\";\n // find the right decrypti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates image on threshold value change
updateThreshold() { if (this.suppressed == null) { return; } // Do double threshold const context = this.canvas.getContext('2d'); let imgData = context.getImageData(0, 0, 200, 200); let temp = new Array2D([...this.suppressed.data], this.suppressed.width, th...
[ "threshold(imageSrc, threshold){\n\t\tlet imageDst = new ITImage(), src = imageSrc.data, thresholdMap = [];\n\n\t\tfor (let i = 0; i < 256; ++ i){\n\t\t\tthresholdMap[i] = i <= threshold? 0: 255;\n\t\t}\n\n\t\tfor (let i = 0; i < src.length; ++ i){\n\t\t\timageDst.data[i] = thresholdMap[ src[i] ];\n\t\t}\n\n\t\tima...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
b1 += b2 :: BigNat > BigNat > Int returns new size of b1
function h$ghcjsbn_addTo_bb(b1, b2) { h$ghcjsbn_assertValid_b(b1, "addTo_bb b1"); h$ghcjsbn_assertValid_b(b2, "addTo_bb b2"); var i, c = 0, l1 = b1[0], l2 = b2[0]; if(l2 > l1) { for(i = l1 + 1; i <= l2; i++) { b1[i] = 0; } l1 = l2; } for(i = 1; i <= l2; i++) { c += b1[i] + b2[i]; b...
[ "add(otherSize) {\n const r = new Size(this.width + otherSize.width, this.height + otherSize.height);\n return r;\n }", "static concatTypedArrays(a, b) {\n const c = new (a.constructor)(a.length + b.length);\n c.set(a, 0);\n c.set(b, a.length);\n return c;\n }", "static mxAdd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the elment causes a visual line break ( or block elements)
function _isLineBreakOrBlockElement(element) { if (_isLineBreak(element)) { return true; } if (wysihtml5.dom.getStyle("display").from(element) === "block") { return true; } return false; }
[ "function is_line_container_clean(wrapper) {\n var children = get_real_children(wrapper);\n var ci = children.length;\n if (ci == 1 && children[0].nodeType == 1) {\n //cracking nuts like <p><i><b>LEGACY</b></i></p>\n return is_line_container_clean(child...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dashrath code end /Added by Dashrath check leaf lock details by leaf id
function checkLeafLockDetailsByLeafId(leafId, leafOrder, cNodeId, treeId) { var editStatus=$("#editStatus").val(); if(editStatus=='1') { //if draft leaf created by auto save method var newDraftLeafNodeId=$("#newDraftLeafNodeId").val(); if(newDraftLeafNodeId > 0) { var leafId = ne...
[ "function checkDraftLeafLockDetailsByLeafId(leafId, leafOrder) \r\n{\r\n var editStatus=$(\"#editStatus\").val();\r\n var addDraftLeafNodeId=$(\"#addDraftLeafNodeId\").val();\r\n\r\n if(editStatus=='1' && addDraftLeafNodeId > 0)\r\n {\r\n //if draft leaf created by auto save method\r\n var request = $.aja...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=================================================================================== =================================================================================== Mouse Position in Selectable Area This method checks whether the mouse pointer is within the selectable area. ==========================================...
function mousePosIsInSelectableArea(pos) { if(pos.x > leftMarg - 5 && pos.x <= leftMarg + drawW + 5 && pos.y > topMarg - 5 && pos.y <= topMarg + drawH + 5) { return true; } return false; }
[ "function insideSelector(event) {\n var offset = $qsBody.position();\n offset.right = offset.left + $qsBody.outerWidth();\n offset.bottom = offset.top + $qsBody.outerHeight();\n \n return event.pageY < offset.bottom &&\n event.pageY > offset.t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Plays 5 rounds, outputting the results of each round and the final score
function game() { let playerScore = 0; let computerScore = 0; /* Play 5 rounds */ for (let i = 0; i < 5; i++) { let results = playRound(prompt("Rock, Paper, Scissors?"), computerPlay()); /* If not draw, increment player or computer score */ if (results[1] !== "draw") ...
[ "function game() {\n let score = 0;\n\n for (let i = 0; i < 5; i++) {\n console.log(`Current round: ${i + 1}`);\n let userInput = getUserInput();\n let compInput = genCompInput();\n let result = gameLogic(userInput, compInput);\n console.log(result);\n if (result === 'You won the game.') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======== onChangePolicyFxn ======== onChange callback function for the policyFunction config
function onChangePolicyFxn(inst, ui) { let subState = inst.policyFunction !== 'Custom'; ui.policyCustomFunction.hidden = subState; }
[ "function onChangeEnablePolicy(inst, ui)\n{\n let subState = !inst.enablePolicy;\n\n ui.enablePinParking.hidden = subState;\n ui.policyInitFunction.hidden = subState;\n ui.policyFunction.hidden = subState;\n\n onChangePolicyInitFxn(inst,ui);\n onChangePolicyFxn (inst,ui);\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SUBJECT BASE CLASS Keeps track of subscribed observers
function Subject() { this._observerList = []; }
[ "function Subject() {\n this.observers = new ObserverList();\n}", "function Subject() {\n // create an Observers list instance, passing all methods on\n this.observers = new ObserverList()\n}", "subscribe(subject) {\n const attached = subject.attach(this);\n if (attached)\n this.subject = subject;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
zorder of a point given coords and size of the data bounding box
function zOrder(x, y, minX, minY, size) { // coords are transformed into (0..1000) integer range x = 1000 * (x - minX) / size; x = (x | (x << 8)) & 0x00FF00FF; x = (x | (x << 4)) & 0x0F0F0F0F; x = (x | (x << 2)) & 0x33333333; x = (x | (x << 1)) & 0x55555555; y = 1000 * (y - minY) / size; ...
[ "function getZ(x, y) {\n // We assume that the plane equation is up-to-date\n // with the current polygon.\n return -(A * x + B * y + D) / C;\n }", "function zoom2z(z) {\n return vgl.zoomToHeight(z + 1, m_width, m_height);\n }", "static zAxis() { return newVec(0.0,0.0,1.0); }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the item from the todo input and clears input field return the item
function getItem() { var item = $('#todoItemInput').val(); $('#todoItemInput').val(''); return item; }
[ "function clearInput() {\n\tif (e.key === 'Enter' && todoInput.value.length > 0) {\n\t\t// When there is a keypress, it will run this function which will create a new list\n\t\t// The function will grab the value of the text entered\n\t\tcreateNewTodoItem(todoInput.value);\n\t}\n}", "function inputToToDo () {\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete a stored access policy on the table
function deleteTablePolicy(table, name, options, _) { var deletePolicySettings = createTablePolicySetting(options); deletePolicySettings.resourceName = interaction.promptIfNotGiven($('Table name: '), table, _); deletePolicySettings.policyName = interaction.promptIfNotGiven($('Policy name: '), name, _); ...
[ "deletePolicy(callback) {\n return this.deletePolicyRequest().sign().send(callback);\n }", "function AM_policy_delete(amServer, inputAccountIntentId){\n\n var result = {};\n var ssoToken = amServer.ssoToken;\n\n restCall = {};\n restCall.url = constructAmUri(amServer) + \"/json/rea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates a dictionary mapping sample IDs onto time between timepoints
createTimeGapMapping() { let timeGapMapping = {}; this.patients.forEach(d => { let curr = this.sampleStructure[d]; for (let i = 1; i < curr.length; i++) { if (i === 1) { timeGapMapping[curr[i - 1]] = undefined } ...
[ "function TimeToObjectInstanceMap(\n createObjectInstanceFunction, parent, scopedId) {\n this.createObjectInstanceFunction_ = createObjectInstanceFunction;\n this.parent = parent;\n this.scopedId = scopedId;\n this.instances = [];\n }", "function getHourlyTransactions(txs){\n\tvar map = new Map(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
putMask_Date() ================ Method to Put the Date Mask Parameters Return value
function putMask_Date(oElement) { var lstrValue = oElement.value; if(lstrValue == "" || !isValidDate(lstrValue)) return; re = new RegExp("/","g"); lstrValue = lstrValue.replace(re,""); lstrValue = lstrValue.toUpperCase(); if (lstrValue.length == 8) { partOne = lstrValue.substring(0...
[ "function putMask_YearMonthDate(oElement)\n{\n var lstrValue = oElement.value;\n if(lstrValue == \"\" || !isInteger(lstrValue))\n return;\n\n re = new RegExp(\"/\",\"g\");\n lstrValue = lstrValue.replace(re,\"\");\n if (lstrValue.length == 6) {\n partOne = lstrValue.substring(0,4);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper class that accepts an element and a reference (this.next) to the next element in the linked list.
constructor(element) { this.element = element; this.next = null; }
[ "constructor(ref){\n this.ref = ref;\n this.next = null;\n }", "function next () {\r\n return this.siblings()[this.position() + 1]\r\n}", "function highlightNext($element) {\n var highlighted = $element.query('.'+_CLASSES.HIGHLIGHTED)\n var next\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recursive function to download tiles by column
function loadTiles(col, row, callback){ if(col > maxCol){ callback(null); } else { loadColumn(col, row, function(err){ if(err) callback(err); console.log("finished one column! "+ col); loadTiles(col+1, row, callback); }); } }
[ "getSurroundingTiles(x, y, data) {\n\n const tile = []; \n \n //up\n if (x > 0) {\n tile.push(data[x - 1][y]);\n } \n //down\n if (x < boardSize - 1) {\n tile.push(data[x + 1][y]);\n } \n //left\n if (y > 0) {\n til...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: _fnSetObjectDataFn Purpose: Return a function that can be used to set data from a source object, taking into account the ability to use nested objects as a source Returns: function: Data set function Inputs: string|int|function:mSource The data source for the object
function _fnSetObjectDataFn( mSource ) { if ( mSource === null ) { /* Nothing to do when the data source is null */ return function (data, val) {}; } else if ( typeof mSource == 'function' ) { return function (data, val) { return mSource( data, val ); }; } else if...
[ "function set_data(dest, key, data, context)\n{\n // If there is a transformation function, call the function.\n if (typeof context.transform == 'function') {\n dest = dest || {}\n data = context.transform(data, context.src, dest, context.srckey, context.destkey)\n }\n\n // See if data is null and there i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if the given `ch` the first thing in the string.
function isFirst(str, ch) { return str.substr(0, ch.length) === ch; }
[ "function isSingleCharacter(oneChar){\n if (typeof onChar !== \"string\"){\n return false;\n }\n else if (onChar.length > 1){\n return false;\n }\n else {\n return true;\n }\n}", "function isSingleCharacter(oneChar){\n if (typeof oneChar !== 'string'){\n console.log(\"Sorry, not a string\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts the pixel value as a number from a value, if it's a number or a CSS pixel string (e.g. `1337px`). Otherwise returns null.
function getPixelValue(input) { if (typeof input !== 'number' && input != null) { var _input$split = input.split(cssUnitPattern), _input$split2 = _slicedToArray(_input$split, 2), value = _input$split2[0], units = _input$split2[1]; return !units || units === 'px...
[ "function toCSSPixels(number) {\r\n if (Object.isString(number) && number.endsWith('px'))\r\n return number;\r\n return number + 'px'; \r\n }", "function getNumberFromValue(name, value) {\n if (statsNameBlackList[name])\n return NaN;\n return parseFloat(value);\n}", "function applyStyleSafel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove all posts when user performs a search / sort; then reload them from Firebase.
function reloadPosts() { /* visually remove the items from the layout */ var postList = document.getElementById("posts"); var items = postList.getElementsByClassName("grid-item"); /* remove the items from DOM */ while (postList.lastChild !== null) { postList.removeChild(postList.la...
[ "removeUsersFromPosts() {\n const usersPostsRef = firebaseDB.database().ref(`/Users/${this.state.userId}/Posts`)\n usersPostsRef.on('value', snapshot => {\n let usersPosts = snapshot.val();\n for (let usersPost in usersPosts) {\n var postRef = firebaseDB.database().ref(`/Posts/${usersPost}`)\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
now as a callback... hello line is executed first, then the callback() function is executed
function greet1(callback) { console.log('hello'); callback(); }
[ "function callback(callback){\n callback()\n}", "function foo(callback){\n callback();\n}", "[kClientHello](alpn, servername, ciphers, callback) {\n this.emit(\n 'clientHello',\n alpn,\n servername,\n ciphers,\n callback.bind(this[kHandle]));\n }", "function sayMessageAndWait(me...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ex number = 641573, number dapat di pecah menjadi beberapa pasang, yaitu 64, 41, 15, 57, 73 dari beberapa pasang tersebut didapati pasangan dengan nilai terbesar 73
function pasanganTerbesar(number) { // var max, untuk compare nilai maksimal var max = 0 // untuk mengubah number jadi string var number = number.toString() // untuk mengulang sepanjang number(String) ditambahkan for (i = 0; i < number.length - 1; i++) { //var pasangan = merupakan men...
[ "function bigint() {\n Swal.fire('Es un tipo de dato numerico que puede representar enteros cuyos digitos solo estan limitados por la memoria del sistema en el que se aloja el dato')\n}", "function formatRupiah(angka){\n var number_string = angka.toString(),\n sisa = number_string.length % 3,\n rup...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a reference to the current story $variables store.
function variables() { return State.variables; }
[ "function make ( ) {\n\n //\n // Most of these fields and methods are involved in the variable\n // identification algorithm.\n //\n //\n // The basic way this algorithm works is that as a scope is walked,\n // variables are collected into an 'unknown' array.\n //\n // Assigned variables ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the name of the command.
name() { return this._command.name; }
[ "get keyName() {\n const prefix = this.guildIDs ? this.guildIDs.join(',') : 'global';\n return `${prefix}:${this.commandName}`;\n }", "getCommand() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.instruction.command;\n });\n }", "function getC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validation of the volume to have atleast one volume and if volume is added, it should have no field empty
validateVolume() { this.job.validVolume = !this.httpHeader.some( (volume) => !volume.added && volume.model.container?.description && volume.model.container?.name && volume.model.container?.region, ) && this.job.volumes.length > 0; return this.job.valid...
[ "function addNewProductAdmin() {\n\n\tvar imageId = document.getElementById(\"imageId\").value;\n\tvar productName = document.getElementById(\"productName\").value;\n\tvar description = document.getElementById(\"description\").value;\n\tvar amount = document.getElementById(\"amount\").value;\n\tvar price = documen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The observable that emits when the modal is dismissed via the `.dismiss()` method. It will emit the reason passed to the `.dismissed()` method by the user, or one of the internal reasons like backdrop click or ESC key press.
get dismissed() { return this._dismissed.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["takeUntil"])(this._hidden)); }
[ "attemptDismiss() {\n\t\tif(this.state.currentModal.props.dismissible) this.state.currentModal.props.onDismiss();\n\t}", "async hide(isClosing = true) {\n const $obj = this.$();\n if (this.get('isTransitioning')) return;\n this.set('isClosing', isClosing);\n\n const promise = new Promise((reso...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The render method below is only allowed to return a single node. The following has 2 nodes and will throw an error: (This is like returning 2 React.createElement functions) return Hello World render methods bold child To fix this issue we can wrap them in a single node
render() { // parenthesis is not required but makes it nice to put things on new lines: return ( <div> <h1>Hello World render methods</h1> <b>bold child </b> </div> ); }
[ "render() {\n /**\n * You can create `ReactElements` in plain JavaScript using `React.\n * createElement` or use the built-in factories for common HTML tags. A\n * `ReactElement` factory takes a hash of properties as their first\n * argument followed by a variable number of optional child argumen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper method to see if messageId is a helpful answer.
function containsAnswer(helpfulAnswers, messageId) { return helpfulAnswers && helpfulAnswers.some( function(answer) { return answer.ID == messageId; }); }
[ "isMessage(this_frame) {\n return (this_frame.headers !== null && reallyDefined(this_frame.headers['message-id']));\n }", "validateMessage (message) {\n\t\tif (message.post.$set) { return false; }\n\t\tAssert.ifError(this.shouldFail);\t// if this test should fail, we should not have recieved a message\n\t\tAs...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION: applyServerBehavior DESCRIPTION: Collects values from the form elements in the dialog box and adds the Server Behavior to the user's document ARGUMENTS: sbObj ServerBehavior object one of the objects returned from findServerBehaviors RETURNS: string empty upon success, or an error message
function applyServerBehavior(sbObj) { var paramObj = new Object(); var errStr = ""; if (!errStr) { errStr = _input_type_text__tag.applyServerBehavior(sbObj, paramObj); if (paramObj.input_type_text__tag.tagName && paramObj.input_type_text__tag.tagName.toUpperCase() == "TEXTAREA") { para...
[ "function applyServerBehavior(sbObj)\n{\n var paramObj = new Object();\n var errStr = \"\";\n\n if (!errStr) {\n errStr = textNode.applyServerBehavior(sbObj, paramObj);\n\n if (paramObj.textNode.tagName && paramObj.textNode.tagName.toUpperCase() == \"TEXTAREA\") {\n paramObj.MM_subType = \"textarea\";...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loadMoreMessages(key, messageDiv) will load 10 more messages of task with keyString equals to key. After loading, scroll to element messageDiv
async function loadMoreMessages(key, messageDiv) { const queryURL = "/messages?key=" + key + "&cursor=" + cursorString; const request = new Request(queryURL, {method: "GET"}); const response = await fetch(request); const result = await response.json(); const msgResponse = result.messages; cursor...
[ "function reloadMessages(){\n if (!scrolling && message_open) {\n $.ajax({\n type: 'GET',\n url: \"/messaging/\" + oid + \"/message\",\n data: $(this).serialize(),\n success: function (response) {\n // console.log(response);\n $('.r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks whether the element is still inside its boundary after the viewport has been resized. If not, the position is adjusted so that the element fits again.
_containInsideBoundaryOnResize() { let { x, y } = this._passiveTransform; if ((x === 0 && y === 0) || this.isDragging() || !this._boundaryElement) { return; } const boundaryRect = this._boundaryElement.getBoundingClientRect(); const elementRect = this._rootElement.get...
[ "function elementCanExpand() {\n return element.offset().top + element.height() < $(window).height() + 100; // 100 = number of pixels below view\n }", "isInViewport() {\n const vm = this;\n\n if(vm.firstTime) {\n // first time set postion of e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Asserts that a value is a DOM Element.
function assertDomElement(value) { if (typeof Element !== 'undefined' && !(value instanceof Element)) { throw new Error('Expecting instance of DOM Element'); } }
[ "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefined':_typeof2(value))===(expectedType='string');}else if(expectedType==='Number'){valid=(typeof value==='undefined'?'undefined':_typeof2(value))===(expectedType='number');}e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display Map Date & Name
function displayMapTitle(){ date = formatDate(currentDay, 'long'); mapDisplayName = visibleMap.charAt(0).toUpperCase() + visibleMap.slice(1); $('#mapLabel').html("<h2>" + date + "</h2"); // with mapLabel subtitle -- $('#mapLabel').html("<h2>" + date + " <br /> <span class='subTitle'>" + mapDisplayName + "</span...
[ "function plot_layer_with_date(map_id, layer_name, layer_url_template, start_date, end_date) { \n\tlayer_url = layer_url_template.replace(START_TEMPLATE, start_date);\n\tlayer_url = layer_url.replace(END_TEMPLATE, end_date);\n\tplot_layer(map_id, layer_name, layer_url, layer_url_template);\n}", "function display...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
compute loss factor for nonIAA components due to krausen loss
function compute_LF_nonIAA_krausen(ibu) { var description = ibu.krausen.value; var IAA_krausenLoss = 0.0; var IAA_krausenLossFactor = 1.0; var LF_krausen = 1.0; var nonIAA_krausenLoss = 0.0; var nonIAA_krausenFactor = 0.0; IAA_krausenLossFactor = ibu.getKrausenValue(description); // krausen exp = 2.97...
[ "function compute_oAA_dis_mg(ibu, hopIdx, currVolume) {\n var AAloss_percent = 0.0;\n var k = 0.0;\n var oAA_addition = 0.0;\n var oAA_fresh = 0.0;\n var oAA_percent_boilFactor = 0.0;\n var oAA_percent_init = 0.0;\n var oAA_percent = 0.0;\n var ratio = 0.0;\n var relativeAA = 0.0;\n\n // The oAA_percent_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates a hash based on the data, timestamp, previous hash and nonce
calculateHash(data, timestamp, previousHash, nonce) { return SHA256(JSON.stringify(data) + timestamp + previousHash + nonce).toString(); }
[ "constructor(_data, _blockhash, _prevhash){\n this.timestamp = Date.now()\n this.data = _data\n this.prevHash = _prevhash\n this.nonce = nonce ++\n this.blockHash = _blockhash\n }", "constructor(index, timestamp, data, previoushash = ''){\r\n this.index = index;\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clears existing generation data
function clear() { generations = []; fittest = []; }
[ "clearData(){\n //reset table data \n this.config.currentData = {};\n this.config.pageCount=1; //table page count (will calculating later)\n this.config.pageLimit=10; //table page limit\n this.config.tableData={};\n this.config.currentPage=1; //table current page\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Example For str = "zaabcbd", the output should be removeDuplicateCharacters(str) = "zcd".
function removeDuplicateCharacters(str) { let unreplicatedChars = ''; for(let i = 0; i < str.length; i++) { if(str.indexOf(str[i]) === str.lastIndexOf(str[i])) { unreplicatedChars += str[i]; } } return unreplicatedChars; }
[ "function reverseCase(string) {\n var removeDups = /([a-zA-Z])\\1+/g;\n return string.replace(removeDups, convertCase);\n}", "function repeatChar(str,char){\n\tvar count=0;\n\tvar str1= str.split(\"\");\n var rep = str1.reduce((x,y)=> {\n if (y == char){\n return\tcount = count + 1\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }