query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
change_color takes a path ID and a color (hex value) and changes that path's fill color.
function change_color(id, color) { try { var element = document.getElementById(id); // Can be a <g> element (with children), or a single <path> element. element.style.fill = color; fill_children(element, color); // Fill the child elements. } catch (e) { console.log("Error: " + e + "; id: " + id); }; }
[ "function changeColor(id, color) {\n\t// haal path dmv id en zet die naar kleur\n document.getElementById(id).style.fill = color;\n\n}", "function svgColorHandler(svgId, color) {\n document.getElementById(svgId).getSVGDocument().getElementsByTagName(\"g\")[0].style.fill = color;\n }", "function se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
new version: store by prefix add unique id to a subscription list
saveClient(client, uniqueid, prefix) { // console.log('saving client', uniqueid, prefix ); if( !this.ids.hasOwnProperty(prefix) ) { this.ids[prefix] = new Set(); } this.ids[prefix].add(uniqueid); this.sockets.set(uniqueid, client); }
[ "function addIdPrefix(component, prefix) {\n if (component.attr(\"id\") != undefined) {\n component.attr(\"id\", prefix + component.attr(\"id\"));\n }\n component.find('*').each(function () {\n if (jQuery(this).attr(\"id\") != undefined) {\n jQuery(this).attr(\"id\", prefix + jQuer...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isHostExists checks if hostname exists or not via hostname lookup
function isHostExists(hostname) { return __awaiter(this, void 0, void 0, function () { var rd, s, p; return __generator(this, function (_a) { switch (_a.label) { case 0: rd = redis_1.getRedis(); s = hostname.split(".")[0]; ...
[ "function procExists(host) {\n return typeof getProc(host) != 'undefined'\n}", "function checkCookieHost(cookie, host)\n{\n var domainPrefix = \".\";\n if (cookie.host.slice(0, domainPrefix.length) == domainPrefix) {\n if (cookie.host.substring(1) != host) {\n if (host.slice(-cookie.host.length) != coo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies over missing rates when available.
function supplementMissingRates( rates ) { if (rates.specific_std == null) { if ((rates.specific_type == 'Mobile' && rates.mobi_min_std != null) || (rates.specific_type == 'Landline' && rates.land_min_std == null && rates.mobi_min_std != null)) { rates.specific_std = rates.mobi_min_std; rates.specific_add5...
[ "fillBucket(sortedWishList){\n let bucketAmount = this.bucketTotal\n let paidWishes = []\n for(var i = 0; i < sortedWishList.length; i++){\n bucketAmount -= sortedWishList[i].wishExpense\n paidWishes.push(sortedWishList[i])\n if(bucketAmount == 0){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unrolls given node until total number of nodes reach the given limit
function unrollNodeUptoLimit(node, limit) { if (limit < 0) { return limit; } // Current node is not a repeated node, unroll its children if (!node.repeat || !node.repeat.count) { return unrollChildrenUptoLimit(node, limit); } // Curent node is a repeated node. // Make clones of it, unroll its children an...
[ "function unrollChildrenUptoLimit(node, limit) {\n\tif (!node.isGroup) {\n\t\tlimit--;\n\t}\n\tif (node.children) {\n\t\t// Make a copy of the children before unrolling as more might get added during unrolling\n\t\tvar nodeChildren = node.children.slice();\n\t\tfor (var i = 0; i < nodeChildren.length; i++) {\n\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a grapheme cluster end _after_ (not equal to) `pos`, if / possible. Moves across surrogate pairs, extending characters, / characters joined with zerowidth joiners, and flag emoji.
function nextClusterBreak(str, pos) { if (pos == str.length) return pos; // If pos is in the middle of a surrogate pair, move to its start if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1))) pos--; let prev = codePointAt(str, pos); pos += codePoint...
[ "static getLastCharactersToPos(writer, pos) {\r\n const writerLength = writer.getLength();\r\n const charCount = writerLength - pos;\r\n const chars = new Array(charCount);\r\n writer.iterateLastChars((char, i) => {\r\n const insertPos = i - pos;\r\n if (insertPos <...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Amount of program data placed in each load Transaction Minimum number of signatures required to load a program not including retries Can be used to calculate transaction fees
static getMinNumSignatures(dataLength) { return 2 * ( // Every transaction requires two signatures (payer + program) Math.ceil(dataLength / Loader.chunkSize) + 1 + // Add one for Create transaction 1) // Add one for Finalize transaction ; }
[ "getBakeProgress() {\n const pendingInputs = this.inputNums.length + this.loadingOutputs + this.inputs.length;\n let bakingInputs = 0;\n\n for (let i = 0; i < this.chefWorkers.length; i++) {\n if (this.chefWorkers[i].active) {\n bakingInputs++;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
todo the limts that i am giving are hard coded SHITTT console.log( let result = snail([ [1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17, 18, 19, 20], [21, 22, 23, 24, 25] ]); // ); sol = [ 1, 2, 3, 4, 5, 10, 15, 20, 25, 24, 23, 22, 21, 16, 11, 6, 7, 8, 9, 14, 19, 18, 17, 12, 13 ]; log(result); log(JSON...
function snail(grid) { if (grid.length == 1) { return grid[0][0] ? [grid[0][0]] : []; } let snail = []; let l = grid.length; let [startR, startC] = [0, 0]; let [r, c] = [0, 0]; while (grid[r][c] !== null) { snail.push(grid[r][c]); let i; // right // we dont want to push the first value since it coins...
[ "function gameOfLifeBestSolution(board) {\n const boardAsLivingCellsOnly = []\n board.forEach((row, rowIndex) => {\n row.forEach((cell, columnIndex) => {\n if (cell === 1) {\n boardAsLivingCellsOnly.push([rowIndex, columnIndex])\n }\n })\n })\n const nextLiveCells = []\n const nowDeadBut...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Open cash payment modal
openCashPayment() { scope.get(this).$broadcast('show-modal', 'cash-payment'); }
[ "function onBuyClicked() {\n createPaymentRequest()\n .show()\n .then(function (response) {\n // Dismiss payment dialog.\n response.complete(\"success\");\n // handlePaymentResponse(response);\n $(\"#checkout\").css(\"display\", \"none\");\n $(\"#completeOrd\").css(\"display\", \"blo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Event handler for the Chroma Key field
handleChangeChroma(event){ this.setState({chromaColour: event.target.value}) }
[ "function ChromaKey(video, buffer, output, color, variance, blur_radius) {\n this.video = video;\n this.buffer_canvas = buffer;\n this.buffer = buffer.getContext('2d');\n this.output_canvas = output;\n this.output = output.getContext('2d');\n this.color = color;\n this.variance = variance;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion LocalStoragespecific code. ////////////////// ////////////////// region Stats tracking. Collect initial references for each Stat.
function τSST_get_stat_references() { nodes.focus = $('#stats-panel div[class="stat-container focus"]'); nodes.focus_pct = nodes.focus.find('div[class="percentage"]'); for (var stat in all_stats) { nodes[stat] = $('#stats-panel div[class="stat-container ' + stat + '"]')...
[ "resetStats() {\n\t\tthis.gameDataList = [];\n\t\tthis.curGameData = null;\n\t}", "resetStats_() {\n this.mediaBytesTransferred = 0;\n this.mediaRequests = 0;\n this.mediaTransferDuration = 0;\n this.mediaSecondsLoaded = 0;\n }", "function copy_base_stats() {\n\tvar ret = {};\n\n\t// Should be fine...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method _jsTabControl_drawTab() This function draws an individual tab onto a jsDocument. Parameters: tab (jsTab) the tab to draw. objOwnerTD (jsTab) the cell to draw onto. Returns: nothing.
function _jsTabControl_drawTab(tab, objOwnerTD) { //begin table var objTable = document.createElement("table"); with (objTable) { setAttribute("border", "0"); setAttribute("cellspacing", "0"); setAttribute("cellpadding", "0"); } //begin row var objTR = document.createElement("tr"); objTable.appendChil...
[ "function _jsTabControl_draw() {\n\n\t//calculate tabsperstrip\n\tthis.tabsPerStrip = parseInt((window.innerWidth - IMG_BTN_MORE.width - IMG_BTN_LESS.width) / this.tabWidth);\n\n\t//calculate number of strips needed\n\tvar numStrips = Math.ceil(this.tabs.length / this.tabsPerStrip);\n\t\n\t//draw each strip\n\tfor ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function takes in a DOM object which represents a puzzle tile as parameter and returns in boolean whether that particular puzzle tile is ready to be moved. The only puzzle tiles that can be moved are the tiles adjacent to the empty tile.
function isMovable(tile) { var currentX = tile.style.left; var currentY = tile.style.top; if (currentX == emptyX && Math.abs(parseInt(currentY) - parseInt(emptyY)) == SIZE || currentY == emptyY && Math.abs(parseInt(currentX) - parseInt(emptyX)) == SIZE){ return true; ...
[ "isValidMoveNew(row, column) {\n if (!isInBoundaries(row, column)) {\n return false;\n }\n if (!this.tileSet.hasTileAt(row, column)) {\n return false;\n }\n var dx = [1, 0, -1, 0];\n var dy = [0, 1, 0, -1];\n let thisTile = this.tileSet.getTileA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes a new instance of `XMLComment` `text` comment text
constructor(parent, text) { super(parent); if (text == null) { throw new Error("Missing comment text. " + this.debugInfo()); } this.name = "#comment"; this.type = NodeType.Comment; this.value = this.stringify.comment(text); }
[ "function createTextElement(text) {\n return new VirtualElement(0 /* Text */, text, emptyObject, emptyArray);\n }", "function extractCommentText(text) {\n\t\n\tvar lines = text.split(\"\\n\")\n\n\tvar start = /^\\/\\*+/,\n\t\t\tlineStart = /^[ \\t]*\\*[ ]?/,\n\t\t\tend = /\\*+\\//;\n\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cut via the keyboard
function KeyCut(evt) { var nKeyCode; nKeyCode = GetKeyCode(evt); switch (nKeyCode) { case 13: //enter Cut(); break; default: //do nothing break; } }
[ "handleCopyCut(event) {\n event.stopPropagation();\n let activeNode = this.getActiveNode();\n if(!activeNode) return;\n\n // If nothing is selected, say \"nothing selected\" for cut\n // or copy the clipboard to the text of the active node\n if(this.selectedNodes.size === 0) {\n if(event.type...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by Java9ParserexceptionTypeList.
exitExceptionTypeList(ctx) { }
[ "exitExceptionType(ctx) {\n\t}", "visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "exitTryExpression(ctx) {\n\t}", "exitElementValueList(ctx) {\n\t}", "enterExceptionTypeList(ctx) {\n\t}", "visitExceptions_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitException_d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a synthetic lifecycle hook which gets inserted into `TView.preOrderHooks` to simulate `ngOnChanges`. The hook reads the `NgSimpleChangesStore` data from the component instance and if changes are found it invokes `ngOnChanges` on the component instance.
function rememberChangeHistoryAndInvokeOnChangesHook() { const simpleChangesStore = getSimpleChangesStore(this); const current = simpleChangesStore === null || simpleChangesStore === void 0 ? void 0 : simpleChangesStore.current; if (current) { const previous = simpleChangesStore.previous; if...
[ "static emitChanges() {\n changedStores.forEach(store => store.emitChange());\n changedStores.clear();\n }", "track() {\n const snapShot = () => {\n return JSON.stringify(this.fields.reduce((obj, key) => {\n obj[key] = this.ctx[key];\n return obj;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clean log entries (keep only the ones generated less than one minute ago)
processEntries() { let previousMinute = new Date(); // One minute ago. previousMinute = previousMinute.setMinutes(previousMinute.getMinutes() - 1); // Keep only "new" log entries (less than 1 minute) this.logEntries = reduce(this.logEntries, (list, entry) => { if (en...
[ "function cleanLog() {\n\tredis.zremrangebyscore('modLog', 0, Date.now() - 1000*60*60*24*7,\n\t\tfunction (err) {\n\t\t\tif (err)\n\t\t\t\twinston.error('Error cleaning up moderation log:', err);\n\t\t}\n\t);\n}", "#removeExpiredTimestamps(key) {\n const timestampsArray = this.#apiCallTimeStamps[key]\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isPointInRect checks if a point, 'pt', is in, a rectangle with cooridinates 'rpt', with size 'rsz' (point,point,point)
function isPointInRect(pt,rpt, rsz){ //logic that checks a point is in a rectangle if(!(pt.x < rpt.x || pt.y < rpt.y || pt.x > rpt.x + rsz.x || pt.y > rpt.y + rsz.y)){ //alert(); return true; }else return false; }
[ "function isRectTouching(pt1,sz1,pt2,sz2){\n\t//check if all 4 of the corners of rect1 are in this\n\treturn isPointInRect(pt1,pt2,sz2)//topleft\n\t\t|| isPointInRect(new point(pt1.x +sz1.x,pt1.y),pt2,sz2)//top right\n\t\t|| isPointInRect(new point(pt1.x +sz1.x,pt1.y + sz1.y),pt2,sz2)//bot right\n\t\t|| isPointInRe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
new TemplateSet( name_String, options_Object )
constructor ( name, options = {} ) { if (name === undefined) throw new Error('Pass a name to TemplateSet') // The name of the template set to use. // This will be used as the directory in `base_path` to read the template from this.base_name = name // The base path where the named template ...
[ "_setTemplate () {\n if (this._options.templatePath) {\n this._template = this._options.templatePath\n return\n }\n const generationTemplates = templates[this._options.generation]\n if (!generationTemplates) {\n throw new Error(`Generation not supported: ${generationTemplates}`)\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find a valid program address Valid program addresses must fall off the ed25519 curve. This function iterates a nonce until it finds one that when combined with the seeds results in a valid program address.
static async findProgramAddress(seeds, programId) { let nonce = 255; let address; while (nonce != 0) { try { const seedsWithNonce = seeds.concat(Buffer.from([nonce])); address = await this.createProgramAddress(seedsWithNonce, programId); } catch (err) { if (err instanceo...
[ "static async createProgramAddress(seeds, programId) {\n let buffer = Buffer.alloc(0);\n seeds.forEach(function (seed) {\n if (seed.length > MAX_SEED_LENGTH) {\n throw new TypeError(`Max seed length exceeded`);\n }\n\n buffer = Buffer.concat([buffer, toBuffer(seed)]);\n });\n buffe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Added by Dharmveer for EPC File upload on 10/09/2008
function uploadEPCFile(astrFilePath, aobjFileData) { var lstrData; lstrData = ""; try { objFSO = new ActiveXObject("Scripting.FileSystemObject"); if (objFSO.FileExists(astrFilePath)) { lstrData = objFSO.OpenTextFile(astrFilePath, 1,false,-2).ReadAll(); ...
[ "function of_electric_file(adbnetgrid,as_colfilelsh,as_write,as_compressed,as_colfilename,as_where, type)\r\n{\r\n\tif (type == undefined || type == null) {\r\n \t\ttype = 'blob'\r\n \t\tas_compressed = '0'\r\n \t}\r\n \tif (type == 'ftp') {\r\n \t\ttype = 'blob'\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Play Video by time
function playVideoOnTime(videodata) { $.each(getVideos, function(key, value) { // See if any video should be played now if ((value.startSeconds > 1)) { //console.log('Video ID :' + value.videoId + ' at : ' + value.startSeconds); domYouTubeContainer.tubepla...
[ "function playActorVideo(actor, time) {\n //playVideo(id, time - startTime of video)\n\n}", "function videoSeekTo(time) {\n player.seekTo(time);\n}", "play(startTime, endTime) {\n let { remote, fullScreen, playing } = this.props\n let { vc } = this\n log(`play startTime=${startTime}, en...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `ListenerTimeoutProperty`
function CfnVirtualNode_ListenerTimeoutPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but re...
[ "function CfnVirtualNode_GrpcTimeoutPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a checkbox input at the position (x,y) within this interactive.
checkBox(x, y, label, value) { return this.appendChild(new CheckBox(x, y, label, value)); }
[ "function addInputCheckbox(switchLabel, coin) {\n let inptSwtch = $(\"<input>\").attr(\"type\", \"checkbox\");\n addEventToSwitch(inptSwtch, coin);\n inptSwtch.appendTo(switchLabel);\n }", "render() {\n return (\n <Checkbox\n className=\"bookmark bookmark-toggle\"\n onChange={this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide dialogs and clear models
function hideModalDialogs() { self.$createModalWindow.hide(); self.$editModalWindow.hide(); $.each([self.$createModalWindow.find("input"), self.$editModalWindow.find("input")], function(index, item) { $.each(item, function(i...
[ "function clearDialog() {\n $(\".dialog\").empty();\n }", "_hideModel() {\n this._model.classList.add('hidden');\n }", "_closeModel() {\n this._model.querySelector('.close').addEventListener('click', e => {\n this._hideModel();\n });\n }", "function clearAndHideForm() {\n clearForm(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chapter 101 RopeGroup Player is chaste and cannot be plugged
function C101_KinbakuClub_RopeGroup_ChastityPlug() { if (Common_PlayerChaste) { OverridenIntroText = GetText("CannotPlug"); C101_KinbakuClub_RopeGroup_CurrentStage = 856; } }
[ "function C101_KinbakuClub_RopeGroup_PlayerWhimperLucy() {\n\tif (C101_KinbakuClub_RopeGroup_LucyIsAnnoyed <= 0) {\n\t\tPlayerUngag();\n\t\tActorChangeAttitude( 1, -1)\n\t} else {\n\t\tif (C101_KinbakuClub_RopeGroup_LucyIsAnnoyed >= 2 || ActorGetValue(ActorLove) >= 1) {\n\t\t\tOverridenIntroText = GetText(\"Annoyed...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Save blog as draft handler
function saveBlogAsNewDraft(e) { // Get content data from ckeditor var contentInput = CKEDITOR.instances.ckeditor.getData(); // Make 'tags' string to array var tagsArr = []; var tagsList = document.querySelectorAll('#myTags li .tagit-label'); function tagsToArr() { for (var i = 0; ...
[ "function save () {\n\n\tvar title = postTitle.value;\n\tvar content = postContent.value;\n\tvar savedPost = { \"title\": title, \"content\": content };\n\n\tsaving = setInterval( saveItemToLocalStorage, 5000, savedPost, 'savedPost' );\n\n}", "async create(draft) {\n return this.apiClient.createDraft(draft);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Continues the chunk upload session with an additional fragment. The current file content is not changed. Use the uploadId value that was passed to the StartUpload method that started the upload session. This method is currently available only on Office 365.
async continueUpload(uploadId, fileOffset, fragment) { let n = await spPost(File(this, `continueUpload(uploadId=guid'${uploadId}',fileOffset=${fileOffset})`), { body: fragment }); if (typeof n === "object") { // When OData=verbose the payload has the following shape: // { Continu...
[ "async finishUpload(uploadId, fileOffset, fragment) {\n const response = await spPost(File(this, `finishUpload(uploadId=guid'${uploadId}',fileOffset=${fileOffset})`), { body: fragment });\n return {\n data: response,\n file: fileFromServerRelativePath(this, response.ServerRelativ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decrements max listeners by one, if they are not zero.
decrementMaxListeners() { const maxListeners = this.getMaxListeners(); if (maxListeners !== 0) { this.setMaxListeners(maxListeners - 1); } }
[ "function getMaximumListeners() {\n const { settings } = state_1.getStore();\n return settings.options.maximumProcessListeners;\n}", "unregisterListener(aListener) {\n let idx = this._listeners.indexOf(aListener);\n if (idx >= 0) {\n this._listeners.splice(idx, 1);\n }\n }", "function liste...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialise theme image cache, and fetch any secondary branding image (if present)
async getThemeImages() { // Check if we know what our theme name is let themeconf = null; try { // Read our theme configuration (if any) data_string = await AsyncStorage.getItem(`@TexecomStore:theme`); if (data_string !== null) { themeconf = JSON.parse(data_string); } } c...
[ "function getImagesByTheme() {\n const themes = ['dogs', 'cats', 'cars', 'motorcycles', 'beach', 'california', 'new-york'];\n const randTheme = Math.floor(Math.random() * themes.length);\n return getImageData(themes[randTheme]);\n}", "function initBgImages() {\n if ($('.has-background-image').length) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET Endpoint to retrieve a blocks by address, url: '/api/stars/address:address'
getBlocksByAddress() { this.app.get('/stars/address::address', async (req, res) => { const { address } = req.params; // ensure address is valid if (checkAddress(address)) { try { // search through blockchain, add any blocks with matching address to total. const chainDat...
[ "getBlockByAddress() {\n this.server.route({\n method: 'GET',\n path: '/stars/address:{address}',\n handler: (request, h) => {\n return this.blockchain.getAllBlocksForAddress(request.params.address).then((blocks) => {\n blocks.forEach((bl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Same as "whereNull", but for the pivot table only
whereNullPivot(key) { this.pivotHelpers.whereNullPivot('and', key); return this; }
[ "get isPivotOnlyQuery() {\n return this.pivotQuery;\n }", "function filterOutNulls(response) {\n let dataTable = response.getDataTable();\n\n let filtered = [];\n for (const i in dataTable.wg) {\n // remove nulls and objects with null as their value\n filtered[i] = dataTable.wg[i].c.filter(func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Visit a parse tree produced by PlSqlParserparameter_spec.
visitParameter_spec(ctx) { return this.visitChildren(ctx); }
[ "visitCompiler_parameters_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "visitType_elements_parameter(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function isParameter(node) {\n\t return node.kind() == \"Parameter\" && node.RAMLVersion() == \"RAML08\";\n\t}", "visitParameter_name(ctx) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given x, y coordinates of a cell, return an id. This id can both be used to index a hash, and as an CSS id
function id (x, y) { return "cell-" + x + "-" + y; }
[ "function toId(xPos, yPos) {\n\t return \"boulder_\" + xPos + \"_\" + yPos;\n}", "function getCell(row, col) {\n return document.getElementById(`cell-${row}-${col}`);\n }", "function toCoordinate(id_num) {\n // Math doesnn't work properly for last cell\n if (id_num === \"256\") {\n return [...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
createTagAppend function that creates an element on the page at a given location and appends that element then returns the created the element.
function createTagAppend(loc, tag, id='', el_class='', text='') { var element = document.createElement(tag); if (id != '') { element.setAttribute('id', id); } if (el_class != '') { element.setAttribute('class', el_class); } if (text != '') { element.innerText = text; ...
[ "function createElement(loc, tag, id='', el_class='', text='') {\n var element = document.createElement(tag);\n if (id != '') {\n element.setAttribute('id', id);\n }\n if (el_class != '') {\n element.setAttribute('class', el_class);\n }\n if (text != '') {\n element.innerText ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests that isKeyRangeCompatible() returns false when the predicate involves 'null' values.
function testIsKeyRangeCompatible_False() { var table = schema.table('tableA'); var p = new lf.pred.ValuePredicate( table['id'], null, lf.eval.Type.EQ); assertFalse(p.isKeyRangeCompatible()); }
[ "static evalLowerRangeIsEmpty(dict) {\n return libVal.evalIsEmpty(dict.LowerRange);\n }", "static evalUpperRangeIsEmpty(dict) {\n return libVal.evalIsEmpty(dict.UpperRange);\n }", "function notNullish(value) {\n return value !== null && value !== undefined;\n}", "whereNullPivot(key) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
const gpu = new GPU() Generate connection matrices from genes
function generateNetwork() { globalInfo = getGlobalInfo() let connections = new Array() genome.forEach(g => { let gene = g.split(".") connections[gene[1]] = [...(connections[gene[1]] ?? []), {out: parseInt(gene[2]), weight: gene[3] / 100, enabled: !!parseInt(gene...
[ "function WebGLNetworkDevice() {}", "_setupFramebuffers(opts) {\n const {\n textures,\n framebuffers,\n maxMinFramebuffers,\n minFramebuffers,\n maxFramebuffers,\n meanTextures,\n equations\n } = this.state;\n const {weights} = opts;\n const {numCol, numRow} = opts;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function combines user inputs such as address, city, province and country to find the longitude and latitude
function geocodeAddress(geocoder) { var address = document.getElementById('addressBox').value; var city = document.getElementById('cityBox').value; var province = document.getElementById('provinceBox').value; var country = document.getElementById('countryBox').value; var totalAddress=address+", "+city+ ", "+p...
[ "function processAddress()\n{\n\tvar address = getAddress();\n\n\t//creating a geocoder object\n\tvar geocoder = new google.maps.Geocoder();\n\n\tgeocoder.geocode({'address': address}, function(results, status)\n\t{\n\t\t//If this was successful, then...\n\t\tif (status === 'OK')\n\t\t{\n\t\t\t//get the latitude an...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the drop event on an icon.
function dropIcon(dropTarget) { // Handle icon drop reordering event.preventDefault(); var oldPosition = getAppIndexById(event.dataTransfer.getData("text/plain")); var newPosition = getAppIndexById(dropTarget.id); apps.move(oldPosition, newPosition); drawIcons(); localStorage["apps"] = JSON.str...
[ "function dragOverIcon(dropTarget) {\n event.preventDefault();\n}", "function trashHandleItemDrop(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n var data = event.dataTransfer.getData(internalDNDType);\n console.log(\"drop detected for:\",data) \n dropFile(data...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
read course data from Courses.txt and return it as text
readCourseData(){ let url="https://maeyler.github.io/JS/data/Courses.txt"; fetch(url) .then(res => res.text()) .then(res => this.addCoursesToMap(res,this.courses)); }
[ "readText() {\n const filePath = this._fullname;\n const text = fs.readFileSync(filePath, 'utf-8');\n return text;\n }", "createCourse(txtLine){\r\n let words = txtLine.split(\"\\t\");\r\n let course;\r\n course = new Course(words[0], words[1], words[2], words.slice(3)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a string like ($1, $2, $3, $4...)
function createValueString(fields) { const valueString = Object.values(fields).map( (_, index) => `$${index + 1}` ).join(', '); return valueString; }
[ "function buildString() {\n var outString = arguments[0];\n for(var i = 1; i < arguments.length; i++) {\n outString = outString.replace(new RegExp(\"\\\\$\\\\[\" + i + \"\\\\]\", \"g\"), arguments[i]);\n }\n return outString;\n }", "function CONCATENATE() {\n for (var _l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function GetWindowHeight return the client browser height modified by : Manish Sharma modified on : 10032009
function GetWindowHeight() { //return window.innerHeight|| //document.documentElement&&document.documentElement.clientHeight|| //document.body.clientHeight||0; var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } ...
[ "getGameHeight() {\n return this.scene.sys.game.config.height;\n }", "function windowDimensions(){\n\tvar win = window;\n\twin.height = $(window).height();\n\twin.width = $(window).width();\n\treturn win;\n}", "_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the weight of a 23 bit codeword.
function weight(cw) { return w[cw & 0xf] + w[(cw >> 4) & 0xf] + w[(cw >> 8) & 0xf] + w[(cw >> 12) & 0xf] + w[(cw >> 16) & 0xf] + w[(cw >> 20) & 0xf]; }
[ "function extUtils_getWeightNum(weight)\n{\n if (typeof weight == \"string\")\n {\n var pos = weight.indexOf(\"+\");\n weight = parseInt((pos > 0)? weight.substring(pos+1) : weight);\n }\n\n return weight;\n}", "function hammingWeight(x){\n return x.toString(2).split('').filter(e => e === '1').length...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function adjusts the audio and cc_streaminfo elements to match the selected station. It must be called before the js from thassos is loaded.
function chooseStation() { var stationId = window.location.hash.substr(1); if (!stationId) { // this is the default if none selected stationId = 'nac_radio'; } var station = STATIONS[stationId]; var streamId = station.streamId; var url = station.url; var logo = station.logo; ...
[ "function chooseStation() {\n var stationId = window.location.hash.substr(1);\n\n if (!stationId) {\n // this is the default if none selected\n stationId = 'nac_radio';\n }\n\n var station = STATIONS[stationId];\n var streamId = station.streamId;\n var url = station.url;\n var logo = station.logo;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove an investment from the portfolio after a sale
function removeInvestment (symbol) { portfolio = portfolio.filter(item => item.symbol !== symbol) // blacklist.push(symbol) // buying = true }
[ "function removeFromPortfolio() { \n portfolioArr = JSON.parse(localStorage.getItem(\"stock\"));\n portfolioCash = localStorage.getItem(\"cash\");\n let quantity = parseInt(stockSaleInput.val());\n console.log(sellQuantityAvailable);\n console.log(quantity);\n\n if(sellQuantityAvailable < quant...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Timer class saves time stamp and counts time difference between current time (update() method) and saved time stamp.
function Timer() { /** * Time difference between last update() call and last set() call * * @member Timer */ this.elapsed = 0; /** * Time stamp * * @member Timer */ this.stamp = null; }
[ "function _updateTimer(){\n _timeNow = Date.now();\n var $dt = (_timeNow-_timeThen);\n\n _delta = _delta + $dt; // accumulate delta time between trips, but not more than trip window\n _now = _now+_delta; // accumulate total time since star...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
radius: radius of dot (will be capped at 1/4 of size, so dots don't overflow image bounds) size: size of twodot image (square) SVGs scale up/down very well, so there's no need to set a large size. Just use 100 and scale the image in CSS.
static makePolkaDotsSVG (radius=20, size=100) { let left = size * 0.25; let right = size * 0.75; let r = radius > size * 0.25 ? size * 0.25 : radius; let svgTag = `<svg xmlns='http://www.w3.org/2000/svg' width='${size}' height='${size}'><circle shape-rendering='geometricPrecision' cx='${left}' cy='${lef...
[ "function size_to_radius(size){\r\n\t\tswitch (size) {\r\n\t\t\t\tcase \"small\":\r\n\t\t\t\t\treturn 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"normal\":\r\n\t\t\t\t\treturn 5;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"large\":\r\n\t\t\t\t\treturn 10;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"huge\":\r\n\t\t\t\t\treturn 20;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a base64 encoded SHA1 hash from a string
function sha1(str) { return hash('sha1').update(str).digest('base64'); }
[ "function rstr_sha1(s)\n\t\t{\n\t\t return binb2rstr(binb_sha1(rstr2binb(s), s.length * 8));\n\t\t}", "function hex2base64(s){ return Crypto.util.bytesToBase64(hex2bytes(s)) }", "function hmacsha1(key, text)\n {\n return crypto.createHmac('sha1', key).update(text).digest('base64')\n }", "functio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constraint: only one change from previous state
function onlyOneChangeFromLastState(){ var constraints = []; for(var i = 1; i <= 9; i++){ var name = "cell-"+i; constraints.push( // Cell changed from un-marked to marked Logic.and( // was empty Logic.equiv(Logic.TRUE, (lastState[name+"$0"] ? Logic.TRUE : Logic.FALSE) ), // now marked Logic...
[ "function SetAnyChangeToTrue()\t\n\t\t{\n\t\t\t//Change has taken place\n\t\t\tanyChange = 1;\n\t\t}", "function checkChange(index0,index1,funCB){\n var bias_order0=calculateBias_order(arrIndexMap[index0],arrIndexMap[index1])\n var bias_cross0=calculateBias_cross(arrIndexMap[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store cast & crew details
function creditsDetails(data, movieData, item) { movieData[item]['cast'] = data.cast; movieData[item]['crew'] = data.crew; movieData[item]['cast_crew'] = combineLists([data.cast, data.crew]); movieData[item]['cast_crew_stats'] = {'cast': {}, 'crew': {}, 'overall': {}}; return movieData } // END: cr...
[ "function createCastCrewDIV(person, parent) {\n // creating elements\n var div1 = document.createElement(\"div\");\n var div2 = document.createElement(\"div\");\n var p = document.createElement(\"p\");\n var h4 = document.createElement(\"h4\");\n var a = document.createElement(\"a\");\n\n // assigning classe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the user and partner share a number of similar kinks.
function similiarKinks(userKinks, partnerKinks, similarities) { var similar = 0; for (var i = 0; i < userKinks.length; i++) { if (partnerKinks.indexOf(userKinks[i]) !== -1) { similar++; } if (similar >= similarities) { return true; } } return false; }
[ "function userHasBeenReferredByPartnerWhoSuppliesPromocodes() {\n for (var i = 0; i < referralPartnersWhoSupplyPromocodes.length; i++) {\n if (linkshareReferrerID == referralPartnersWhoSupplyPromocodes[i]) { // If the referrer is in the list of referral partners who supply voucher codes\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load the viewer document called when user click the load button in UI
function LoadDocumentBtnClicked() { //Initialize Viwer OnInitializeViwer(); //get the document provided by the user documentId = document.getElementById("DocIdTB").value; //load the document Autodesk.Viewing.Document.load(documentId, Autodesk.Viewing.Private.getAuthObject(), onSuccessDocumentL...
[ "static loadDocument(urn) {\n\n return new Promise((resolve, reject) => {\n\n const paramUrn = !urn.startsWith('urn:')\n ? 'urn:' + urn\n : urn\n\n Autodesk.Viewing.Document.load(paramUrn, (doc) => {\n\n resolve(doc)\n\n }, (error)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Automatically generated. Retrieves the `len` constructor field of the `:sslice` type.
function len(sslice) /* (sslice : sslice) -> int32 */ { return sslice.len; }
[ "static get length() {\n return 0;\n }", "function start(sslice) /* (sslice : sslice) -> int32 */ {\n return sslice.start;\n}", "function len( obj )\n {\n if ( undefined === obj.length && \"number\" !== typeof obj.length )\n { return undefined; }\n \n return obj.length\n }", "ch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Optional, empty implementation, called from createScene. Should return a ShadowGenerator.
async createShadows() {}
[ "function ShadowGenerator(mapSize,light,useFullFloatFirst){this._bias=0.00005;this._normalBias=0;this._blurBoxOffset=1;this._blurScale=2;this._blurKernel=1;this._useKernelBlur=false;this._filter=ShadowGenerator.FILTER_NONE;this._filteringQuality=ShadowGenerator.QUALITY_HIGH;this._contactHardeningLightSizeUVRatio=0....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all occurrences of needle from the beginning of haystack.
function ltrim(haystack, needle) { if (!haystack || !needle) { return haystack; } var needleLen = needle.length; if (needleLen === 0 || haystack.length === 0) { return haystack; } var offset = 0, idx = -1; while ((idx = haystack.indexOf(needle, offset)) === offset) { ...
[ "function trim_left_1(s, sub) /* (s : string, sub : string) -> string */ { tailcall: while(1)\n{\n if (empty_ques__1(sub)) {\n return s;\n }\n else {\n var _x34 = starts_with(s, sub);\n if (_x34 != null) {\n {\n // tail call\n var _x35 = (string_3(_x34.value));\n s = _x35;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
recursively walk the visual tree, collecting objects as we go
function traverseVisualTree(obj, parent) { obj.vtkey = visualNodeDataArray.length; visualNodeDataArray.push(obj); if (parent) { obj.parentKey = parent.vtkey; } if (obj instanceof go.Diagram) { var lit = obj.layers; while (lit.next()) traverseVisualTree(lit.value, ob...
[ "render() {\n const properties = Memory.getObject(allProperties, this);\n if (properties.recycle) {\n properties.recycle = false;\n if (properties.component && properties.component.canRecycle(properties.state)) {\n properties.state = properties.component.state;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function that reverses your telephone number. It should return the reversed telephone number. your code...
function reversePhone(number) { }
[ "function reversePhone(phone) {\n phone = phone + \"\";\n return phone.split(\"\").reverse().join(\"\");\n}", "function reverseDigitsOfNumber(enteredNumber) {\n var reversedNumber = enteredNumber.split(\"\").reverse().join(\"\");\n console.log(reversedNumber);\n}", "function reverseNumber(n) {\n let...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
used to tell all server viewers that a user left
function SendUserLeftServer(ws) { var returnMessage = {} returnMessage["type"] = "user-left-server"; returnMessage["data"] = {}; returnMessage.data["user-id"] = ws.userId; // don't use SendToAllServerViewers because we don't want to send this to the newly joined viewer // for (var i=0; i<serverViewers.leng...
[ "function SendUserLeft(ws, lobbyId) {\n var returnMessage = {}\n returnMessage[\"type\"] = \"user-left\";\n returnMessage[\"data\"] = {};\n returnMessage.data[\"user-id\"] = ws.userId;\n\n // tell all users in the lobby that a user joined the lobby //\n LobbyUserBroadcast(ws, lobbyId, returnMessage);\n\n // ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
array of census tract modal splits, usually returned using readonlyStore.findByIds(). Each modal split is displayed as a row.
@computed('acsModalSplits', 'ctppModalSplits', 'isRJTW') get selectedCensusTractData() { if (this.isRJTW) { return this.ctppModalSplits; } return this.acsModalSplits; }
[ "splitRows() {\n let rows = [];\n const shields = this.state.shields;\n\n for(var i = 0; i < shields.length; i+=6) {\n let oneRow = [];\n oneRow.push(shields.slice(i, i+6).map( (shield, idx) => {\n return (\n <div className=\"two columns\" key={i + idx} >\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws a team Banner
function drawTeamBanner (x, y, width, height, teamName) { return svg.append("svg:image") .attr("xlink:href", "../Resources/banners/banner_" + teamName + ".png") .attr("x", x) .attr("y", y) .attr("width", width) .attr("height", height); }
[ "drawLobbyView() {\n this.drawState();\n\n this.ctx.font = '20px Arial';\n this.ctx.fillStyle = '#FFF';\n this.ctx.textAlign = 'center';\n this.ctx.fillText('Waiting on another player...', this.canvas.width / 2,\n this.canvas.height / 2 - 60);\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds all of the dice that are fives to the box for fives, when the checkbox is checked, so long as the user has not done so already. If the user has already added a score value, the AddAlert() function is called to let them know they can't do that.
function AddFives(){ checkCtrl = document.getElementById("keepFives"); boxCtrl = document.getElementById("FivesValue"); NumberCheck = 5; UpperCheck(); }
[ "function AddFours(){\n\t\t\t\tcheckCtrl = document.getElementById(\"keepFours\");\n\t\t\t\tboxCtrl = document.getElementById(\"FoursValue\");\n\t\t\t\tNumberCheck = 4;\n\n\t\t\t\tUpperCheck();\n\t\t\t}", "function updateScore() {\n rollScore = 0\n\t\tlet numOfDice = 0\n let ones = '', twos = '', th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the given result is from a failed function trigger.
static isFailedFuncTrigger(result) { if (CommonUtil.isDict(result)) { for (const fid in result) { const funcResult = result[fid]; if (CommonUtil.isFailedFuncResultCode(funcResult.code)) { return true; } if (!CommonUtil.isEmpty(funcResult.op_results)) { for (...
[ "static isFailedTx(result) {\n if (!result) {\n return true;\n }\n if (CommonUtil.isDict(result.result_list)) {\n for (const subResult of Object.values(result.result_list)) {\n if (CommonUtil.isFailedTxResultCode(subResult.code)) {\n return true;\n }\n if (subResult....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
it hides the title of the expanded coupon.
function hideTitle() { UIController.getExpandedCoupon().firstElementChild.firstElementChild.classList.remove('show'); }
[ "function CtrlExpandCoupon() {\n var cpnClickedId;\n if(event.target.classList.contains('coupon')){ // check if the clicked element is indeed a coupon.\n cpnClickedId = event.target.id;\n UICtrl.expandCoupon(cpnClickedId);\n\n //decide what value we give to checkedFiel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
author: Ali El Zoheiry. description: sets the language of the words to be fetched from the database, based on which button the gamer clicked. params: l: is an integer value, 0 meaning the language is english, 1 meaning it is arabic, 2 meaning it is both. success: the button is clicked and the language is set. failure:
function setLang(l){ if(lockLangButtons == true){ return; } disableNav(); $('.zone').empty(); $(".zone").slideUp(1000); $(".zone").slideDown(1000); lang = l; setTimeout(function(){ newGame(); }, 1100); }
[ "function updateLanguage(select_language, select_dialect) {\n var list = langs[select_language.selectedIndex];\n select_dialect.style.visibility = list[1].length == 1 ? 'hidden' : 'visible';\n localStorage['dialect'] = select_dialect.selectedIndex; \n document.getElementById('voiceBtn').setAttribute('lang', li...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the CSV file from a list of users
function createCSV(users){ console.log("%s users found. Writing to CSV file...", users.length); var csfFile = csv.createCsvStreamWriter( fs.createWriteStream('users.csv'), { 'separator': ';', 'quote': '"', 'escape': '"', 'encoding': 'utf16le' } ); csfFile.writeRecord(["identifiant", "nom", "p...
[ "async generateSampleUsers() {\n // Create an arbitrary number of user details and add them to an array\n for (let newUsersNumber = 0; newUsersNumber < this.totalNumberOfUsers; newUsersNumber++) {\n this.allUsers.push(\n {\n username: faker.name.firstName(),\n company: fake...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to grabs followup cards from the database and update the view
function getFolUp() { $.get("/api/followup", function(data) { console.log("FollowUp", data); folUpCards = data; if (!folUpCards || !folUpCards.length) { displayEmpty(); } else { initializeCards(); } }...
[ "function populate_followers_list() {\n $.get('/dashboard/get_followers', function (data) {\n $('#followers_list').html(data);\n \n // Click handler.\n $('#followers_list .add_following').confirmDiv(function (clicked_elem) {\n $.get('/dashboard/add_user_following', {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Welcome a new user with a message
function welcomeUser(user) { user.notify('Welcome ' + user.getName() + '!'); }
[ "function welcomeUser() {\n let greeting = \"No Current User\";\n\n if (isLoggedIn === true) {\n greeting = \"Welcome, \" + currentUser.name;\n }\n\n return greeting;\n }", "showWelcomeMessage(welcomeMessageMode) {\n Instabug.showWelcomeMessageWithMode(welcomeMessageMode);\n }", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens the dialog to edit the properties for a folder
editFolder(aTabID, aFolder) { let folder = aFolder || GetSelectedMsgFolders()[0]; // If a server is selected, view settings for that account. if (folder.isServer) { MsgAccountManager(null, folder.server); return; } if (folder.flags & Ci.nsMsgFolderFlags.Virtual) { // virtual fold...
[ "editVirtualFolder(aFolder) {\n let folder = aFolder || GetSelectedMsgFolders()[0];\n\n function editVirtualCallback(aURI) {\n // we need to reload the folder if it is the currently loaded folder...\n if (gMsgFolderSelected && aURI == gMsgFolderSelected.URI) {\n // force the folder pane to re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Append a posting row to an .entryform.
function addPostingRow(form) { const newPosting = $('#posting-template').children[0].cloneNode(true); form.querySelector('.postings').appendChild(newPosting); return newPosting; }
[ "function createPostRow(postData) {\n var postId = \"post\" + postData.id;\n\n var newTr = $(\"<tr>\");\n newTr.attr('id', postId);\n newTr.data(\"posts\", postData);\n newTr.append(\"<td>\" + postData.title + \"</td>\");\n newTr.append(\"<td>\" + postData.body + \"</td>\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
parse a quotedfield character
function qfParseChar() { if (curCh === '"') { inValue = !inValue; return; } if (inValue) { value += curCh; return; } if (curCh === ',') { addValue(); } }
[ "function nqfParseChar() {\n if (escape) {\n value += curCh;\n escape = false;\n } else if (curCh === '\\\\') {\n escape = true;\n } else if (curCh === ',') {\n addValue();\n } else {\n value += curCh;\n }\n }", "visitQuo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call to action at the beginning of every turn this would be the main function, which in turn calls upon other potential behaviours; action determined by positioning random yet deterministic need to figure out a way to define neighbors add bite, fight, etc as object methods
function action(){ for (var neighbor in neighbors){ if(agent.type === 'Zombie' && neighbor.type === 'Human'){ bite(neighbor); } else if(agent.type === 'Zombie' && neighbor.type === 'Zombie'){ agent.move(); } else if(agent.type === 'Human' && neighbor.type === 'Zombie'){ fight(neighbor); ...
[ "function takeAIturn () {\n const ships = state.shipArray.filter(s => s.owner === state.playerTurn)\n const viewHexes = Object.entries(getUpdatedViewMask(state)).filter(([k, v]) => v > 1).map(([k, v]) => Hex.getFromID(k))\n\n ships.forEach(ship => {\n for (let i = 0; i < 5; i++) {\n const { attacks, move...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If an options object has an axisLabels property then it reverses the values of the array. Should this check to see if the property is an array?
function reverseAxisLabels(opts) { if (opts.axisLabels) { opts.axisLabels.reverse(); } return opts; }
[ "function onAxisAfterSetOptions() {\n var axis = this;\n if (axis.brokenAxis && axis.brokenAxis.hasBreaks) {\n axis.options.ordinal = false;\n }\n }", "function onAxisDestroy() {\n if (this.chart &&\n this.chart.labelCollectors) {\n var index = (this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
devuelve verdadero si el archivo es una imagen
is_image() { if ( this.file_type == "jpg" || this.file_type == "png" || this.file_type == "gif" ) { return true; } return false; }
[ "function validarFormatoImagen() {\n var extensionImagenes = /(.jpg|.jpeg|.png)$/i;\n var imagen = document.getElementById(\"img_area\");\n var archivo = imagen.value;\n if (!extensionImagenes.test(archivo)) {\n console.log(archivo);\n alert(\"El formato de la imagen no es válido.\");\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a command to the server to reboot the stb
function reboot() { sendPowerCommand('reboot'); }
[ "function restartGame(){\r\n\tsocket.emit(\"restart\");\r\n}", "function powerOff() {\n sendPowerCommand('off');\n}", "function rebootComputer(computerName) {\n // Wrapped in a promise due to the time it takes to execute the reboot command. Must be able init reboot on multiple computers at the same time.\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
binary search to find char in a line
findInsertIndexInLine(char, line) { let left = 0; let right = line.length - 1; let mid, compareNum; if (line.length === 0 || char.compareTo(line[left]) < 0) { return left; } else if (char.compareTo(line[right]) > 0) { return this.struct.length; } while (left + 1 < right) { ...
[ "binarySearch6() {\n var read = require('fs');\n var text = read.readFileSync(\"./mytext.txt\", 'utf-8');\n var word = text.split(\" \");\n word.sort();\n return word;\n }", "function findMarker(buf, pos) {\n for (var i = pos; i < buf.length; i++) {\n if (0xff === buf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load JSON file for highscores
function loadJson(){ for(let i = 0; i < hiScoreJSON.scores.length; i++){ let user = hiScoreJSON.scores[i].user; let carNum = hiScoreJSON.scores[i].cars; let difMode = hiScoreJSON.scores[i].mode; let rate = hiScoreJSON.scores[i].rating; let score = { "scores": { ...
[ "static loadJson(pathToJson) {\n\t\tconsole.log(\"Loading story.json...\");\n\t\tvar r = new XMLHttpRequest();\n\t\tr.open(\"GET\", pathToJson, true);\n\t\tr.onload = function() {\n\t\t\tif (this.status >= 200 && this.status < 400)\n\t\t\t{\n\t\t\t\t// Set the active story to the loaded JSON\n\t\t\t\tstoryData.stor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply the given update down the component hierarchy from this node, optionally excluding one node's subtree. This is useful for applying a full state update to one component while sending only "shared" state updates to the app root.
updateSelfAndChildren(stateUpdate, options = {}) { if (!this.initialized) { return; } const {store, cascade} = options; Object.assign(this[store], stateUpdate); if (store !== `state` || this.shouldComponentUpdate(null, this[store])) { this.domPatcher.update(this.state); if (casca...
[ "_updateStore(stateUpdate, options = {}) {\n const {cascade, store} = options;\n if (!this.initialized) {\n // just update store without patching DOM etc\n Object.assign(this[store], stateUpdate);\n } else {\n // update DOM, router, descendants etc.\n const updateHash = `$fragment` in s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if the email isn't already in the database, insert it
function insertEmail (email,callback){ console.log('insertEmail: ' + email); db.connect(function(error){ if (error){ return console.log('CONNECTION error: ' + error); } this.query().insert('emails', ['email'], [email] ) .execute(function(error, result) { if (error) { return co...
[ "function saveEmail(email) {\n var newSubscriptionRef = db.push();\n newSubscriptionRef.set({\n email: email,\n });\n}", "function checkEmail (email,callback){\n console.log('checkEmail');\n db.connect(function(error){\n if (error){\n return console.log('CONNECTION error: ' + error);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function name : validateNewsLetterMailForm Return type : none Date created :02May2011 Date last modified : 02May2011 Author : Deepesh Pathak Last modified by : Deepesh Pathak Comments : This function is used to validate the news letter mail form User instruction : validateNewsLetterMailForm(formID)
function validateNewsLetterMailForm(formID) { if(validateForm(formID, 'frmNewsLetterName', 'Title', 'R','frmSubscriberList','Subscriber','R')) { return true; } else { return false; } }
[ "function validateMessage(formname)\n{\n\t\n if(validateForm(formname,'frmSendToIds', 'Select Users', 'R', 'frmMessageType', 'Message Type', 'R', 'frmMessageSubject', 'message Subject', 'R'))\n {\t\n\t\t\n\t\t\n return true;\n } \n else \n {\n return false;\n } \n}", "function vali...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates conditionsTrack chart on click
function updateConditionsTrackChart() { updateConditionsTrackChart2(); }
[ "function updateConditionsTrackChart2(){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar temp = getDpsActive();\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar myData = \t[{\r\n\t\t\t\t\t\t\t\t\t\ttype: \"bar\",\r\n\t\t\t\t\t\t\t\t\t\tshowInLegend: true,\r\n\t\t\t\t\t\t\t\t\t\tcolor: \"blue\",\r\n\t\t\t\t\t\t\t\t\t\tname: \"Active\",\r\n\t\t\t\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the content of body cells using a renderer.
_renderBodyCellsContent(renderer, cells) { if (!cells || !renderer) { return; } this.__renderCellsContent(renderer, cells); }
[ "static renderTableBody() {\n\n // Reset options list of each filter\n filterRegistry.forEach(obj => obj.options = ['']);\n\n // This is how table body is created. D3 does its magic.\n var tableBody = d3.select('tbody');\n tableBody.selectAll('tr')\n .data(data.filter(e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set state of the replica to offline. This is typically called when mayastor stops running on the node and the replicas become inaccessible.
offline () { log.warn(`Replica "${this}" got offline`); this.isDown = true; this.pool.node.emit('replica', { eventType: 'mod', object: this }); }
[ "function stayOffline() {\n\t\t\tthis.$stayOffline = true;\n\t\t\tif (this.$retryPromise) {\n\t\t\t\tif ($timeout.cancel(this.$retryPromise)) {\n\t\t\t\t\tthis.$retryPromise = null;\n\t\t\t\t\tthis.$retryCount = 0;\n\t\t\t\t\tthis.$retryScheduled = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function setOfflineState(use...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts this LatLngPoint to a Universal Transverse Mercator point using the WGS84 datum. The coordinate pair's units will be in meters, and should be usable to make distance calculations over short distances.
toUTM() { return new UTMPoint().fromLatLng(this); }
[ "function CHtoWGSlat(y, x) {\n\n // Converts military to civil and to unit = 1000km\n // Auxiliary values (% Bern)\n var y_aux = (y - 600000)/1000000;\n var x_aux = (x - 200000)/1000000;\n \n // Process lat\n lat = 16.9023892\n + 3.238272 * x_aux\n - 0.270978 * Math.pow(y_aux,2)\n - 0.0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a new ``uint160`` type for %%v%%.
static uint160(v) { return n(v, 160); }
[ "static uint(v) { return n(v, 256); }", "static uint168(v) { return n(v, 168); }", "static uint208(v) { return n(v, 208); }", "static uint120(v) { return n(v, 120); }", "static uint240(v) { return n(v, 240); }", "static uint80(v) { return n(v, 80); }", "static uint256(v) { return n(v, 256); }", "stati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the private key fields N, e, and d from hex strings
function RSASetPrivate(N, E, D) { if (N != null && E != null && N.length > 0 && E.length > 0) { this.n = parseBigInt(N, 16); this.e = parseInt(E, 16); this.d = parseBigInt(D, 16); } else alert("Invalid RSA private key"); }
[ "function RSASetPrivate(N,E,D) {\r\n if(N != null && E != null && N.length > 0 && E.length > 0) {\r\n this.n = parseBigInt(N,16);\r\n this.e = parseInt(E,16);\r\n this.d = parseBigInt(D,16);\r\n }\r\n else\r\n alert(\"Invalid RSA private key\");\r\n}", "function seed2key(pk, c){ return hex2hexKey(h...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shortcut for getting the current col value (one based) Returns the column (position) where the last token starts
function col () { return index - token.length + 1; }
[ "function col(numCol) {\n return numCol * COL + COL_OFFSET;\n}", "get goalColumn() {\n let value = this.flags >> 5 /* RangeFlag.GoalColumnOffset */\n return value == 33554431 /* RangeFlag.NoGoalColumn */\n ? undefined\n : value\n }", "rightMostColumn(){\n let heade...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the FIO public key assigned to the FIOSDK instance.
getFioPublicKey() { return this.publicKey; }
[ "function getPublicKey(req, res) {\n var key_path = './server/keystore/key/public_key.pem';\n return g_fs.readFileAsync(key_path, \"ascii\")\n .then(function (content) {\n return res.send(content);\n })\n .catch(function (exception) {\n co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checking if there is something within a distance of the specified coords excludes the specified entity
function isSpaceOccupied(entity, distance, x, y){ if(entity !== 'tree'){ for(var i in treeList){ if(distanceBetweenCoords(treeList[i].x,treeList[i].y,x,y) < distance){ return true; } } } if(entity !== 'berryBush'){ for(var i in berryBushList){ if(distanceBetweenCoords(berryBushList[i].x,berryBus...
[ "function isInDistance (player, block) {\n const firstCondition = (Math.abs(block.dataset['x'] - player.position.x) <= 3)\n && (block.dataset['y'] === player.position.y);\n const secondCondition = (Math.abs(block.dataset['y'] - player.position.y) <= 3) \n && (block.dataset['x'] === player.position.x);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send a single emoji message
function sendEmoji(message, emojiName) { var emoji = message.guild.emojis.find(emoji => emoji.name === emojiName); message.channel.send('<:'+emoji.name+':'+emoji.id+'>') .catch(console.warn); }
[ "function sendmessage(type, message)\n\t{\n\t\tvar channel = 0;\n\t\tvar nums = [0,1,2,3,4,5,6,7,8,9];\n\t\tvar indexpos = 0;\n\t\tif(message.substr(0,1) == \"/\")\n\t\t{\n\t\t\tif(message.substr(1,1) == \"/\")\n\t\t\t{\n\t\t\t\tchannel = last_channel;\n\t\t\t\tmessage = message.substr(2);\n\t\t\t}\n\t\t\telse\n\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
FUNCTION NAME : deleteSpecificLink AUTHOR : Juvindle C Tina DATE : March 26, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : delete specific link PARAMETERS :
function deleteSpecificLink(){ var linkArray = new Array(); $('.linkiddelete').each(function(){ if($(this).is(':checked')){ linkArray.push($(this).attr('did')); } }); if(linkArray.length == 0){ alerts("Please select one entry."); return; } for(var t=0; t<linkArray.length; t++){ var pathArr = linkArra...
[ "function deleteLink(source,destination){\n\tif(globalInfoType == \"JSON\"){\n\t\tvar devices = getDevicesNodeJSON();\n var prtArr =[];\n for(var s=0;s < devices.length; s++){\n prtArr = getDeviceChildPort(devices[s],prtArr);\n }\n }else{\n var prtArr= portArr;\n }\n\tf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a simple 'function' that is also a RxJS AsyncSubject.
function async(mapFunction) { return factory(Rx.AsyncSubject, mapFunction); }
[ "async function asyncFunc() {\n return 123;\n}", "extendRxObservables() {\n return require('nylas-observables');\n }", "function Subject() {\n // create an Observers list instance, passing all methods on\n this.observers = new ObserverList()\n}", "static of (a) {\n return new Signal(emit => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
apply_selector Apply the selected filters to the page's elements. The function uses get_selector to get the filters. The filters are applied based on availability filter value. If availability is set means that we must check what is the availability of each domain at the end of our query. To avoid confusion when the re...
function apply_selector(){ $('.list').show(); handleErrorBox('hide'); var selector = get_selector(); $('.availabilityLoader').remove(); if($('.colored_tld').length){ single = $('.singleResult'); single.find('.tld').html(single.attr('data-tld')); $('.tldResults:has(.colored...
[ "function createAvailabilitySelector(selector){\n if(selector.indexOf('.tldResults') < 0){\n selector = '.tldResults' + selector;\n }\n\n if(fundamental_vars.appliedCriteria.availability == 'available'){\n selector = selector + '[data-status=\"1\"] .tld-line.asked,' + selector + '[data-status...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
class that controls the population of birds, and evolves them
constructor(size) { this.birds = []; this.size = size; this.actualBird = 0; //kind of an index for the population for (let i = 0; i < size; i++) { this.birds.push(new bird()); } this.generation = 0; this.melhor = this.birds[0]; this.la...
[ "function Population() {\n\n this.rockets = [];\n\n // creates initial rockets\n this.populate = () => {\n if (this.rockets.length > 0) this.rockets = [];\n for (let i = 0; i < popSize; i++) {\n this.rockets[i] = new Rocket(30, canvas.height/2);\n this.rockets[i].initiat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define the custom Writable class
function CustomWritable() { Writable.call(this); }
[ "function writerOf(type) {\n var self = getInstance(this, writerOf);\n self.type = type;\n return self;\n}", "function createObjWriter(obj) {\n wasmInternalMemory.memoryToRead = obj;\n var module = new WebAssembly.Instance(webAssemblyModule, importObject);\n return {read_i8: module.e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the average number. Examples: avgValue([10, 20]); // => 15 avgValue([2, 3, 7]); // => 4 avgValue([100, 60, 64]); // => 74.66666666666667
function avgValue(array) { var sum = 0; for(var i = 0; i <= array.length - 1; i++) { sum += array[i]; } var arrayLength = array.length; return sum/arrayLength; }
[ "function avg(v){\n s = 0.0;\n for(var i=0; i<v.length; i++)\n s += v[i];\n return s/v.length;\n}", "function averageNumbers(array){\n let sum = 0;\n let avg;\n for ( let i = 0 ; i < array.length ; i++ ){\n sum = sum + array[i];\n avg = sum / array.length\n }\n return avg\n}", "function absAv...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Turns a glob string into a regexp
function fs_glob_to_regexp(glob) { if (typeof glob !== 'string') { throw new Error("file_glob_to_regexp: glob must be a string"); } // make sure absolute glob = fs_expand_path(glob); // console.log("full glob is: " + glob); var parts = glob.split(''), length = parts.length, result = ''; var opt_g...
[ "function normalizeGlob(glob, { globstar = false } = {}) {\n if (!!glob.match(/\\0/g)) {\n throw new DenoError(ErrorKind.InvalidPath, `Glob contains invalid characters: \"${glob}\"`);\n }\n if (!globstar) {\n return mod_ts_1.normalize(glob);\n }\n const s = c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Escape for template's expression charactors.
function escapeTemplateExp(src) { // eslint-disable-next-line return src.replace(/[-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&'); }
[ "encodeSpecials() {\n const value = this.value;\n const regex = /(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))/g;\n return value.replace(regex, '\\\\\\\\$0');\n }", "function escapeRegex(target)\n{\n return String(target).replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').replac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This thread runs regardless of whether autosaving is enabled. mode = 'start' or 'stop'
function autosaveThread(mode) { // Start/restart the wait. if (mode === 'start') { clearInterval(autosaveTimer); autosaveTimer = setInterval(function(){ autosaveNotepad(); }, AUTOSAVE_SECONDS * 1000); } // Destroy the event. else if (mode === 'stop') { clearInterval(autosaveTimer); } }
[ "start() {\n if (!this.stop) return\n this.stop = false\n this.__poll()\n }", "function run() {\n if (running) {\n // all times in msec\n // minimum time per frame for not exceeding the given fps speed\n // fps=60 means maximum speed\n const minimumFrameTime = 1000 / anima...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws shapes to represent sound creates a 3 row repersentation based on what is the current shape being drawn will either display according to waveform data OR frequencey data
function drawSound(){ //drawCtx.clearRect(0, 0, drawCtx.canvas.width, drawCtx.canvas.height); let circleWidth = 1; let circleSpacing = 17.5; let topSpacing = 130; let currentHeight; for(let i=0; i<audioData.length;i++){ if (playButton.dataset.playing == "yes") currentHeight = (topSpacing-60) + 256-au...
[ "function createSpeakers(){\r\n drawCtx.strokeStyle = \"gray\";\r\n drawCtx.fillStyle = \"black\";\r\n\r\n drawCtx.lineWidth = 5;\r\n\r\n drawCtx.fillRect(50,100, 100,200);\r\n drawCtx.strokeRect(50,100, 100,200);\r\n drawCtx.strokeRect(50,100, 100,50);\r\n\r\n drawCtx.lineWidth = 3;\r\n dra...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }