query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
NOTE: nativeDispatchEvent is very performance sensitive.
function nativeDispatchEvent(srcEvent, eventType, eventPointer) { eventPointer = eventPointer || pointer; var eventObj; if (eventType === 'click' || eventType == 'mouseup' || eventType == 'mousedown' ) { eventObj = document.createEvent('MouseEvents'); eventObj.initMouseEvent( eventType,...
[ "function nativeDispatchEvent(srcEvent, eventType, eventPointer) { // 1533\n eventPointer = eventPointer || pointer; // 1534\n var eventObj; ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get coordinates of contour and sort them clockwise with upper left point as the first point.
function getContourCoordinates(contour) { let coordinates = []; let sum = []; for (let i = 0; i < contour.rows; i++) { coordinates.push({ x: contour.data32S[i * 2], y: contour.data32S[i * 2 + 1] }); sum.push(coordinates[i].x + coordinates[i].y); } let sortedCoordinates = [0, 0, 0, 0]; let firstInde...
[ "sortPoints() {\n // Array of points;\n const points = this.getVertices();\n // const points = this.getOrientedEdges();\n\n // Find min max to get center\n // Sort from top to bottom\n points.sort((a, b) => a.y - b.y);\n\n // Get center y\n const cy = (points[0].y + points[points.length - 1]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a provider for the type or undefined if not found.
getProviderForType(type) { const factory = this.typeToProviderFactoryMap[type]; return factory ? factory() : undefined; }
[ "function getProvider() {\n if (_provider === null) {\n return Provider.local();\n }\n return _provider;\n}", "function getProvider() {\n if(!_.isNull(provider)) return provider;\n\n // TODO could be worked out if we can talk to redis via the redis URL then use redis\n if(!_.isUndefined(C...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reflect incident vector i about the normal of surface vector s
function reflect(s, i) { var n = la2d.unitnormal(s); var scalar = 2 * la2d.dotprod(n,i); //scalar multiplier for normal var term = [scalar * n[0], scalar * n[1]]; return [-1*(term[0]-i[0]),-1*( term[1]-i[1])]; }
[ "reflectVector(normal){\n\t\tvar scalr = this.dot(normal);\n\t\tvar temp = Vector.scale(normal, scalr);\n\t\tvar doubled = Vector.scale(temp,2);\n\t\treturn Vector.subtract(doubled,this);\n\t}", "reflect(normal) {\n let n = normal.normSq()\n return this.subtract(normal.times(2 * this.dot(normal) / n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Interleave bits of 2 coordinates with 16 bits. Useful for fast quadtree codes.
function interleave2(x, y) { x &= 0xFFFF; x = (x | x << 8) & 0x00FF00FF; x = (x | x << 4) & 0x0F0F0F0F; x = (x | x << 2) & 0x33333333; x = (x | x << 1) & 0x55555555; y &= 0xFFFF; y = (y | y << 8) & 0x00FF00FF; y = (y | y << 4) & 0x0F0F0F0F; y = (y ...
[ "function interleave2(r, s1, s2) {\n for (var i = 0; i < 31; i += 1) {\n r[4 * i] = (s1[i] & 3) ^ ((s2[i] & 3) << 2);\n r[4 * i + 1] = ((s1[i] >>> 2) & 3) ^ (((s2[i] >>> 2) & 3) << 2);\n r[4 * i + 2] = ((s1[i] >>> 4) & 3) ^ (((s2[i] >>> 4) & 3) << 2);\n r[4 * i + 3] = ((s1[i] >>> 6) &...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
search and return an array of elements from the database, of which names contain the quary (case insensitive)
search(database, quary) { return database .filter((elementSearched) => { return elementSearched.name.toLowerCase() .includes(quary.toLowerCase()); }) .map((protester) => protester.name); }
[ "function search_by_name(where, query) {\n var res = new Array();\n set_result(where, res);\n var elems = names[query];\n if (elems) {\n var len = elems.length;\n for (var i = 0; i < len; i++) {\n res.push(elems[i]);\n }\n }\n set_result(where, res);\n}", "find(da...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a function named "rotate" that takes an array and returns a new one with the elements inside rotated n spaces. If n is greater than 0 it should rotate the array to the right. If n is less than 0 it should rotate the array to the left. If n is 0, then it should return the array unchanged. var data = [1, 2, 3, 4, ...
function rotate(array,n){ if ( n === 0 ) return array; var arr = array.slice(); if ( n > 0 ) { for ( var i = 0; i < n; i++ ) { arr.unshift(arr.pop()); } return arr; } for ( var i = 0; i > n; i-- ) { arr.push(arr.shift()); } return arr; }
[ "static rotateLeft(array, n) {\n // todo: 🙌 do magic !\n // get the desired shifted elements in separate array \n let shiftedElements = []\n for (let i = 0; i < n; i++) {\n shiftedElements[i] = array[i]\n }\n // do the shifts here \n let arrayLength = array.length\n l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
import DynamicGraph from './Component/DynamicGraph'; npm i save reactchartjs2 npm i save chart.js
function App() { return ( <div className="App"> <div className="chart"> <StaticLineGraph/> <StaticBarChart/> <StaticDoughNutGraph/> <GraphUsingHooks/> {/* <DynamicGraph/> */} </div> </div> ); }
[ "componentDidMount() {\n this.createChart();\n }", "componentDidMount() {\n this.generateChart();\n }", "componentDidMount() {\n this.showChart();\n }", "componentDidMount(){\n // this.makeGraph();\n }", "componentDidMount() {\n this.generateChart(this.props.data);\n }", "c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
define qForm saveOnSubmit(); prototype
function _qForm_saveOnSubmit(){ // grab the current onSubmit() method and append the saveFields() method to it var fn = _functionToString(this.onSubmit, "this.saveFields();"); this.onSubmit = new Function(fn); }
[ "function onSave(){\n var result = saveForm();\n if (result == null) \n return;\n \n if (result.code == 'executed') {\n var tabs = View.getControlsByType(parent, 'tabs')[0];\n tabs.selectTab(\"select\");\n }\n else {\n Workflow.handleError(result);\n }\n}", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CofactorEqual checks whether p, q are equal up to cofactor multiplication ie if their difference is of small order.
cofactorEqual(q) { const t1 = new CachedGroupElement(); const t2 = new CompletedGroupElement(); const t3 = new ProjectiveGroupElement(); q.toCached(t1); t2.sub(this, t1); // t2 = (P - Q) t2.toProjective(t3); // t3 = (P - Q) t3.double(t2); // t2 = [2](...
[ "cofactorEqual(q) {\r\n const t1 = new CachedGroupElement();\r\n const t2 = new CompletedGroupElement();\r\n const t3 = new ProjectiveGroupElement();\r\n q.toCached(t1);\r\n t2.sub(this, t1); // t2 = (P - Q)\r\n t2.toProjective(t3); // t3 = (P ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reseta as variaveis para reinicio de jogo;
function resetarVariaveis() { tabuleiro = ['', '', '', '', '', '', '', '', '']; jogadorAtual = 0; jogadorAnterior; estadosJogo.empate = false; estadosJogo.vitoria = false; }
[ "function reiniciarJogo() {\n somGameover.pause()\n $('.fim').remove()\n\n energiaAtual = 3\n velocidadeHelicopteroInimigo = 4\n velocidadeCaminhao = 3\n pontuacao = 0\n aliadosSalvos = 0\n aliadosPerdidos = 0\n fimDeJogo = false\n\n processarJogo()\n}", "function resetear () {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To enable logging for this class. Set `Vex.Flow.ModifierContext.DEBUG` to `true`.
function L() { if (ModifierContext.DEBUG) Vex.L("Vex.Flow.ModifierContext", arguments); }
[ "enableDebug() {\n\t\tthis._debugEnabled = true;\n\t}", "debug(msg) {\n this.log(this.LogLevel.DEBUG, msg);\n }", "static debug(message) {\n this.write('DEBUG', message);\n }", "debug ( /* ... */ ) {\n this.DEBUG >= this.level.number &&\n this.log.call( this, arguments, conso...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set our sound buffer, loop, and connect to destination connect each node to each other in a chain, and then connect to audioContext.destination javascriptNode is decrepreciated, as is scriptProcessorNode, but there isn't much documentation on audio workers
function setupSound() { sound = audioContext.createBufferSource(); sound.buffer = sampleBuffer; sound.loop = loop; //auto is false sound.playbackRate.value = playbackSlider.value; analyser.smoothingTimeConstant = .85, //0<->1. 0 is no time smoothing analyser.fftSize = 2048, //must be some numbe...
[ "function initScriptMode () {\n\t\t//buffer source node\n\t\tlet bufferNode = context.createBufferSource();\n\t\tbufferNode.loop = true;\n\t\tbufferNode.buffer = audioBufferUtils.create(samplesPerFrame, channels, {context: context});\n\n\t\tnode = context.createScriptProcessor(samplesPerFrame);\n\t\tnode.addEventLi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create table cell with style dropdown selected_style must be an integer
function create_style_cell(selected_style, watch_dso, style_change_callback) { let td = $("<td>", { class: "objects-style", }); /** * Get the integer that represents a style by its name * * If the given name could not be found returns -1 */ function get_style_id(style_name) ...
[ "function create_color_selection_table() {\n $.each(available_filetypes, function(i) {\n var tr = $('<tr>');\n\n var td_filetype = $('<td>').html(available_filetypes[i]);\n var td_bold = $('<td>').html(create_bold_checkbox(available_filetypes[i]));\n var td_foregro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get payment link status
getPaymentLinkStatus (clientId, paymentId) { return this.createRequest(`/clients/${clientId}/card2card/${paymentId}`,'GET'); }
[ "paymentLinkStatus (request) {\n return this._gatewayRequest('post', '/api/payment-link-status', request)\n }", "function getPaymentStatus() {\n return this.invoiceStatus.name;\n }", "getPaymentReadyStatus() {\n const mem = this.getAllMembers();\n for (let i = 0; i < mem.length; i++)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the currently selected scene from the scene dropdown
function codepad_get_scene() { var scenes_elem = document.getElementById("scene"); return scenes_elem.options[scenes_elem.selectedIndex].value; }
[ "getCurrentScene() {\n return this.scenes[this.currentSceneIndex];\n }", "function changeScene()\n{\n let optionSelected = document.getElementById(\"sceneSelector\");\n let valueSelected = optionSelected.options[optionSelected.selectedIndex].text;\n selectedScene = valueSelected;\n}", "getCur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merges raw control validators with a given directive validator and returns the combined list of validators as an array.
function mergeValidators(controlValidators, dirValidator) { if (controlValidators === null) return [dirValidator]; return Array.isArray(controlValidators) ? [].concat(_toConsumableArray(controlValidators), [dirValidator]) : [controlValidators, dirValidator]; }
[ "function mergeValidators(controlValidators, dirValidator) {\n if (controlValidators === null) return [dirValidator];\n return Array.isArray(controlValidators) ? [].concat(_toConsumableArray(controlValidators), [dirValidator]) : [controlValidators, dirValidator];\n }", "function mergeValidators(contr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function writes a cookie with a name, data, and a number of hours before expiring
function writeCookie(name, data, hoursTilExpire) { var date = new Date(); var exp = date.setTime(+ date + (hoursTilExpire * 3600000)); document.cookie = name + "=" + data + ";" + "expires=" + date.toGMTString() + ";"; }
[ "function writeCookie(name, value, hours)\n{\n var expire = \"\";\n if(hours != null)\n {\n expire = new Date((new Date()).getTime() + hours * 3600000);\n expire = \"; expires=\" + expire.toGMTString();\n }\n //document.write(expire);\n document.cookie = name + \"=\" + escape(value) + expire;\n \n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set curve for cross fade transition for second stream. For description of available curve types see afade filter description.
curve2(val) { this._curve2 = val; return this; }
[ "setCurve (frameIndex, cx1, cy1, cx2, cy2) {\r\n let tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n let dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n let ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n let dfx...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the Atom's Orbit's State 3 to the Scene (Atom Representation Scene)
function add_atom_orbit_state_to_scene_3() { // Creates the Atom's Particle's State's Orbit #3 create_atom_particle_state_orbit_3(); // Creates the Atom's Particle's State #3 create_atom_particle_state_3(); // Creates the group for the Atom's State's Pivot #3 atom_state_pivot_3 = new THREE.G...
[ "function add_atom_orbit_state_to_scene_1() {\n\n // Creates the Atom's Particle's State's Orbit #1\n create_atom_particle_state_orbit_1();\n\n // Creates the Atom's Particle's State #1\n create_atom_particle_state_1();\n\n \n // Creates the group for the Atom's State's Pivot #1\n atom_state_pi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call this function to ensure that require(id) returns a mock exports object based on the actual exports object created by the module.
function doMock(id) { explicitMockMap[id] = true; var entry = exportsRegistry[id]; if (entry && entry.module && entry.actual) { // Because mocking can be expensive, create the mock exports object on // demand, the first time doMock is called. entry.mocked || (entry.mocked = getMock(entry.actual)); ...
[ "function createMockModule(id, mocks) {\r\n const ret = new module_1.default(id);\r\n ret.exports = mocks;\r\n return ret;\r\n}", "define(id, exported) {\n const module = this.registry.get(id) || this.registerModule(id);\n if (!module.exports) {\n module.exports = exported;\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets or Sets the right indent for selected paragraphs.
get rightIndent() { return this.rightIndentIn; }
[ "set rightIndent(value) {\n if (value === this.rightIndentIn) {\n return;\n }\n this.rightIndentIn = value;\n this.notifyPropertyChanged('rightIndent');\n }", "_getIndent() {\n return repeat(this.format.indent.style, this._indent);\n }", "indent() {\n var ses...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Random computerPlay Generator function Stores possible plays in array uses built in floor, random, and length functions to generate a random number between 0 & 3 sets computerPlay equal to corresponding value stored in array
function getComputerPlay() { var plays = ['rock', 'paper', 'scissors']; computerPlay = plays[Math.floor(Math.random() * plays.length)]; }
[ "function computerPlay() {\n let plays = [\"Empty\", \"rock\", \"paper\", \"scissors\"]\n let randomNumber = Math.floor((Math.random() * 3) + 1)\n let computerHand = plays[randomNumber]\n return computerHand\n}", "function computerPlay() {\n return choices[Math.floor(Math.random()*choices.length)];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
search for local installation of Windows 10 tools in app's subfolder
function getLocalToolsPath(toolName) { // test WEBSITE_SITE_NAME environment variable to determine if the service is running in Azure, which // requires mapping the tool's location to its physical path using the %HOME_EXPANDED% environment variable var toolPath = process.env.WEBSITE_SITE_NAME ? ...
[ "function getWindowsKitPath(toolname) {\r\n var cmdLine = 'powershell -noprofile -noninteractive -Command \"Get-ItemProperty \\\\\"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows Kits\\\\Installed Roots\\\\\" -Name KitsRoot10 | Select-Object -ExpandProperty KitsRoot10\"';\r\n return execute(cmdLine).then(function (args...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If api call gets invalid endpoint exception, SDK should attempt to remove the invalid endpoint from cache.
function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; ...
[ "function invalidateCachedEndpoints(response) {\n var error = response.error;\n var httpResponse = response.httpResponse;\n\n if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)) {\n var request = response.request;\n var operations = req...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resizes range1 to ensure it fits in range 2 and clears extraneneous data/format
function resizeToTargetRange_(range1, range2) { var finalRange = range1 var startHeight = finalRange.getNumRows() if (startHeight > range2.getNumRows()) { finalRange = finalRange.offset(0, 0, range2.getNumRows()) finalRange.offset(range2.getNumRows() , 0, startHeight - range2.getNumRows())....
[ "function adjustSizeRange(min1, max1, min2, max2) {\n var min = (max2 <= min1 || min2 >= max1) ? Math.min(min1, min2) : Math.max(min1, min2);\n var max = Math.min(max1, max2);\n\n return {min, max};\n}", "_resetRange() {\n let prevRange = this._range;\n delete this._range;\n let range = this.ran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Command HTML This function returns a string containing the HTML used for editing actions. The "isEvent" parameter will be true if this action is being used for an event. Due to their nature, events lack certain information, so edit the HTML to reflect this. The "data" parameter stores constants for select elements to u...
html(isEvent, data) { return ` <div> <p> <u>Note:</u><br> Role icons only work in servers with a high enough boost level. If you are having issues, please ensure you are able to set role icons yourself before attempting with the bot. </p> </div> <br> <hr class="subtlebar"> <br> <role-input dropdownL...
[ "html(isEvent, data) {\n return `\n<span class=\"dbminputlabel\">Call Type</span><br>\n<select id=\"type\" class=\"round\">\n <option value=\"true\" selected>Wait for Completion</option>\n <option value=\"false\">Process Simultaneously</option>\n</select>\n\n<br><br>\n\n<action-list-input id=\"actions\" height...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return an array with tokens replaced with their Markov model neighbors.
function invertTokens (ngrams, tokens) { result = [] for (t in tokens) { token = tokens[t] entry = ngrams[token] if (entry) result = result.concat(Object.getOwnPropertyNames(entry.backw), Object.getOwnPropertyNames(entry.forw)) } ret...
[ "bratTokens() {\n var tokens = this.tokens();\n for (let i = 0; i < tokens.length; i++) {\n tokens[i] = util_1.Util.deepCopy(tokens[i]);\n tokens[i].form = util_1.Util.rtlFix(tokens[i].form);\n }\n return tokens;\n }", "tokens() {\n const result = [];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
of := (Value) => Continuable
function of(value) { return function continuable(callback) { callback(null, value) } }
[ "of(value) {\n return new Task(resolver => resolver.resolve(value));\n }", "of(value) {\n let result = new Future(); // eslint-disable-line prefer-const\n result._state = Resolved(value);\n return result;\n }", "static of(v) {\n\t\treturn Async.unit(v);\n\t}", "static resolve(value) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update scope variable tilesRemaining array
function updateTilesRemaining(){ $scope.tilesRemaining = []; $scope.tilesSelected.forEach(function(tileNumber){ if(!$scope.tiles[tileNumber-1].clicked && $scope.tiles[tileNumber-1].colored){ $scope.tilesRemaining.push(tileNumber); } }); }
[ "function updateAvailableTiles() {\n\tvisibleTiles = dora.concat(ownHand, discards[0], discards[1], discards[2], discards[3], calls[0], calls[1], calls[2], calls[3]);\n\tavailableTiles = [];\n\tfor (var i = 0; i <= 3; i++) {\n\t\tfor (var j = 1; j <= 9; j++) {\n\t\t\tif (i == 3 && j == 8) {\n\t\t\t\tbreak;\n\t\t\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! Determine if `obj` is something we can set a populated path to. Can be a document, a lean document, or an array/map that contains docs.
function isPopulatedObject(obj) { if (obj == null) { return false; } return Array.isArray(obj) || obj.$isMongooseMap || obj.$__ != null || leanPopulateMap.has(obj); }
[ "function pathFinder(obj, arr) {\n // base case - if arr.length === 0 return false\n if (arr.length === 0) {\n return false;\n }\n // if obj has a property === arr[0]\n if (obj.hasOwnProperty(arr[0])) {\n const newObject = obj[arr[0]];\n // shift first time and invoke pathFinder\n return pathFinder...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load Current Weeks Meals
function loadCurrentWeekMeals(firstDay){ // Create Array for Weeks Meal Plan Data const weekArray = []; // Set last day of week for end of day const lastDay = changeDate(firstDay, 7); lastDay.timeEndOfDay(); // Loop through meal plan data and check if meals are within the...
[ "function loadThisWeek() {\n var dateObj = {};\n var date = new Date();\n dateObj.dateTo = formatDate(date, TIME_END_DAY);\n var last = getFirstDayOfWeek(date);\n dateObj.dateFrom = formatDate(last, TIME_START_DAY);\n loadReport(dateObj);\n }", "function loadWeek()\n{\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepares to edit text on the tree. Detects closest literalsequence or sequence node to the selected text and appends an input box directly under the mouse containing the current text on the node. Displays directions for the user
function editTextNode(event){ // Set appropriate informative text on info model scope.$apply(function(){ scope.main.info = handlerHelpers.editingText; }); // The node that contains the text to change nodeID = $(event.toElement).closest('.literal-sequence, .l...
[ "onTextChange(nextText) {\n this.setState({\n textInput: nextText,\n rootNode: textToTree(nextText, this.state.displayOptions)\n });\n }", "_updateTextPosition() {\n const textElement = this._textElement;\n if (textElement) {\n const bbox = textElement.getBBox();\n const textPosit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clear references to IDB, e.g. during a close event
_clear () { // We don't need to call removeEventListener or remove the manual "close" listeners. // The memory leak tests prove this is unnecessary. It's because: // 1) IDBDatabases that can no longer fire "close" automatically have listeners GCed // 2) we clear the manual close listeners in databaseLif...
[ "_clear () {\n log('_clear database', this._dbName);\n // We don't need to call removeEventListener or remove the manual \"close\" listeners.\n // The memory leak tests prove this is unnecessary. It's because:\n // 1) IDBDatabases that can no longer fire \"close\" automatically have listeners GCed\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
=============================================== Portfolio image hover js ================================================
function ImageHover() { if ($(".portfolio_item").length) { imagesLoaded(document.querySelectorAll("img"), () => { document.body.classList.remove("loading"); }); Array.from(document.querySelectorAll(".portfolio_item")).forEach((el) => { const imgs = Array.from(el.querySelectorAll("...
[ "function portfolioGalleryHover() {\n var pictureBox = $(\".portfolioPhotoItem\");\n var portfolioImgOverlay = $(\".portfolioImgOverlay\");\n\n pictureBox.hover(function () {\n $(this).find(portfolioImgOverlay).show();\n }, function () {\n $(this).find(portfolioImgO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unwraps a result, returning the content of an `Err`. Throws if the value is an `Ok`, with a message provided by the `Ok` value.
unwrapErr() { if (this.isErr()) { return this.error } throw Error('called `Result#unwrapErr()` on an `Ok` value: ' + this.value) }
[ "unwrap() {\n if (this.isOk()) {\n return this.value\n }\n throw Error('Called `Result#unwrap()` on an `Err` value: ' + this.error)\n }", "function unwrapError(future) {\n return make(function (cb) {\n future.done(function (err, val) {\n if (err == null) {\n cb(n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
includeAction deprecated ifAction helper
function ifAction(rawActions) { console.error('Deprecation Warning: Please change `ifAction` to `includeAction`'); return includeAction(rawActions); }
[ "function ifAction(rawActions) {\n\t\t console.error('Deprecation Warning: Please change `ifAction` to `includeAction`');\n\t\t return includeAction(rawActions);\n\t\t}", "hasActions(context) {\n return false;\n }", "get hasAction() {\n return !!this.data.action;\n }", "static is...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure no prop conflicts. Verifies that developer has not passed any conflicting props. Provided so, throws an error.
ensureNoConflicts(props = {}) { const sum = this.sumPropsInObj(sizeRelatedProps, props) if (gt(sum, 1)) { throw Error( `You have specified more than one of the following size-related props: small, medium, large, huge, size. Only one of these props may be specified per each compone...
[ "function checkDeprecatedProps() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n /* eslint-disable no-console, no-undef */\n DEPRECATED_PROPS.forEach(function (depProp) {\n if (props.hasOwnProperty(depProp.old)) {\n var warnMessage = getDeprecatedText(depProp.o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to lock/unlock a user
function toggleLockUser(username, toLock, callback) { let queryStr = "UPDATE `marketplace`.`user` " + " SET `is_locked`= b? " + " WHERE (`username` = ? );"; let queryVar = [username]; if (toLock) { queryVar.unshift('1'); } else { queryVar.unshift('0'); } mySQL_DbConnection.query(queryStr, q...
[ "function lockUser(source, id) {\r\n\tvar username = $(source).parent().parent().find(\"td:first\").html();\r\n\taskConfirmation(\"User \\\"\" + username + \"\\\" won't be able to login anymore, do you confirm lock?\", \"Lock user\").pipe(function() {\r\n\t\tremoteCalls.lockUser(id, source);\r\n\t});\r\n}", "func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draw bodies using the provided function
drawBodies(fn) { this._drawBodies = fn; }
[ "function draw_bodies() {\n clear_canvas();\n for(var i=0; i < bodies.length; i++) {\n draw_body(bodies[i]);\n }\n\tif (draw_barycenters) {\n\t\tdraw_all_barycenters();\n\t}\n}", "function drawBody() {\n fill(bodyColor);\n stroke(bodyColor);\n strokeWeight(3);\n\n // collect the points\n let ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Form fields have autocomplete attributes when appropriate. Empty autocomplete are handled in hasNoFieldsWithEmptyAutocomplete().
function hasFieldsWithAutocompleteAttributes() { const problemFields = inputsSelectsTextareas .filter(field => field.autocomplete === null && (AUTOCOMPLETE_TOKENS.includes(field.id) || AUTOCOMPLETE_TOKENS.includes(field.name))) .map(field => stringifyElement(field)); if (problemFields.length) { ...
[ "function hasFieldsWithValidAutocompleteAttributes() {\n const problemFields = [];\n for (const field of inputsSelectsTextareas) {\n // fields missing autocomplete, autocomplete=\"\", and autocomplete=\"off\" are handled elsewhere.\n if (!field.autocomplete || field.autocomplete === 'off') {\n continue...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get search string for Reddit to get threads
function getRedditSearchString() { var videoId = getVideoId(); if(videoId) { return "https://api.reddit.com/search.json?q=" + encodeURI("(url:\"3D"+videoId+"\" OR url:\""+videoId+"\") (site:youtube.com OR site:youtu.be)") } return null; }
[ "function getRedditSearchString()\n{\n var videoId = getVideoId();\n if(videoId)\n {\n return \"https://api.reddit.com/search.json?q=\" + encodeURI(\"(url:\\\"3D\"+videoId+\"\\\" OR url:\\\"\"+videoId+\"\\\") (site:youtube.com OR site:youtu.be)\")\n }\n\n return null;\n}", "function getThrea...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stop path finding immediately if encountered such pixels traverse path found in 'metaInfo' one by one
async function traversePaths(canvas) { log("Traversing all paths..."); if (DEBUG_PATH) { drawing.canvasClear(tilesOverlay); drawing.canvasDrawLine(tilesOverlay, 0, 0, tilesOverlay.width, 0, [0xff, 0, 0, 0xff], 3); drawing.canvasDrawLine(tilesOverlay, tilesOverlay.width, 0, tilesOverlay.width, tilesOver...
[ "function walkToFinal(){\n //is this direction have barrier?no,go to;yes,search the other directions;\n if(coor[startPoint.y][startPoint.x+1]==0){\n startPoint.x++;\n stack.push({x:startPoint.x,y:startPoint.y});\n }else if(coor[startPoint.y+1][startPoint.x]==0){\n startPoint.y++;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
eliminarTodo. borra todas las tablas de la base de datos
function eliminarTodo() { ZCABD.transaction(function(tx) { tx.executeSql('DROP TABLE IF EXISTS FAVORITOS'); oktx('TODO eliminado'); }, errorBD); }
[ "function deleteButtonPressed(todo) {\n var motivoAsociado = db.get(\"motivo.\"+todo._id);\n db.remove(todo);\n db.remove(motivoAsociado);\n\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if security is enabled.
isSecurityEnabled() { return this._memberServices !== undefined; }
[ "isSecurityEnabled() {\n\t\treturn true;//to do\n\t}", "_isEnabled() {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n }", "hasSecureStatus() {\n return (this.isAuthenticated() && this.token.hasSecureStatus());\n }", "isEnabled() {\n return this.getOptions().e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run through all tests and detect their support in the current UA.
function testRunner() { var featureNames; var feature; var aliasIdx; var result; var nameIdx; var featureName; var featureNameSplit; for (var featureIdx in tests) { if (tests.hasOwnProperty(featureIdx)) { featureNames ...
[ "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n var modernizrProp;\n var mPropCount;\n\n for ( var featureIdx in tests ) {\n featureNames = [];\n feature = tests[featureIdx];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run light tests immediately and every 5 minutes afterwards (when minutes can be divided by 5)
function startLightTests(finish){ (new cronJob("*/5 * * * *", lightTests)).start(); lightTests(finish); }
[ "_triggerTimer() {\n if (!window._triggerTimerCount) {\n window._triggerTimerCount = 0;\n }\n window._triggerTimerCount++;\n let afn = this.onTimer(window._triggerTimerCount % 5 === 1);\n afn.then(() => {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert a passed form reference to a string formatted like a JavaScript array of objects
function form2ArrayString(form) { var elem, lastName = ""; var output = "["; for (var i = 0; i < form.elements.length; i++) { elem = form.elements[i]; if (elem.name && (elem.name != lastName)) { output += formObj2String(form.elements[i]) + ","; lastName = elem.name; } } output = output.substr...
[ "function objectifyForm(formArray) {//serialize data function\n var returnArray = {};\n for (var i = 0; i < formArray.length; i++){\n returnArray[formArray[i]['name']] = formArray[i]['value'];\n }\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
start watchers added for root directory.
function startWatcher(rootPath) { fs.readdir(rootPath, function (err, files) { if (err) { console.error(err); watcher_notification.dismiss(); messenger.error( ModuleMessage.WATCHER_ERROR, true, err ); ...
[ "start() {\n var watcher = this;\n fs.watchFile(watchDir, function() {\n watcher.watch();\n });\n }", "start() {\n for (const file of this.files) {\n const watcher = this._watch(file);\n\n this._watchers.set(file, watcher);\n }\n }", "start() {\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
;; camIsCheating() ;; ;; Check if the player is in cheat mode. ;;
function camIsCheating() { return __camCheatMode; }
[ "currentPlayerIsWiner() {return false;}", "function isPlayerTurn(){\n return playerTurn;\n }", "function C007_LunchBreak_Natalie_KneePlayer() {\n C007_LunchBreak_Natalie_VibratorPlayer++;\n C007_LunchBreak_Natalie_Intensify = true;\n C007_LunchBreak_Natalie_Knee = true;\n if (C007_LunchBreak_Nat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The grade() function determines whether each question was answered correctly, incorrectly, or not answered
function grade() { //question 1 answer r1 if (answer1 === "r1") { correct++; } else if ((answer1 === "r2") || (answer1 === "r3")) { incorrect++; } else { unanswered++; } //question 2 answer r3 if (answer2 === "r3") { correct++; } else if ((answer2 === "r2") || (answer2 === "r1"...
[ "computeGrade(){\n var cq = 0;\n \n this.questions.forEach(function(question, index, questions){\n if(question.isUserAnswerCorrect) { cq++; }\n });\n this.correctQuestions = cq;\n \n this.grade = (this.correctQuestions / this.questions.length) * 10;\n return this.grade;\n }", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hide the notification as long as it's timeoutable
_hideNotification() { if (this.props.timeoutable) { this._notificationTimer.clear(); this.props.removeNotification(); } }
[ "hideNotification() {\n clearTimeout(this.notification.timeout);\n\n this.notification.display = false;\n }", "hide () {\n if (this.toast && this.notifier) {\n this.notifier.hide(this.toast)\n }\n }", "setHideDelay() {\n if (this.inProgress) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transforms all files with this.options.transformFile and invokes done with the transformed files when done.
_transformFiles(files, done) { let transformedFiles = []; // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. let doneCounter = 0; for(let i = 0; i < files.length; i++)this.options.transformFile.call(this, files[i], (transformedFile)=>{ t...
[ "function transform(context, file, fileSet, next) {\n if (stats(file).fatal) {\n next()\n } else {\n debug('Transforming document `%s`', file.path)\n context.processor.run(context.tree, file, onrun)\n }\n\n function onrun(error, node) {\n debug('Transformed document (error: %s)', error)\n context...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract trakt id from scrobble data, returns 0 if id is not set
static traktIdFromData(data) { if (!data) return 0; let movieId = data.movie && data.movie.ids && data.movie.ids.trakt || null; if (movieId) return movieId; let episodeId = data.episode && data.episode.ids && data.episode.ids.trakt || null; if (episodeId) return episodeId; return 0; }
[ "function getTweetID(dataBlock){\n\treturn dataBlock['id_str'];\n}", "function extractId(houseData) {\r\n var extractedId = houseData.url.replace('https://anapioficeandfire.com/api/houses/', '').replace('/', '');\r\n return parseInt(extractedId);\r\n}", "function readId(parseState, u8view){\n\tif(parseSta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
INMODAL : callback for OK button when creating new version
function newVersionOkClick(){ // Call the route URL with the right parameters : suite and versionACopier var suite = $('button#newVersionOK').val(); var versionAcopier = ""; var copyItem = $('input[name=copyItem]:checked').val(); if(copyItem === "Y"){ versionAcopier = $('select#modal-vers option:selected...
[ "handleAddPackageVersions(){\n this.showSelectPackageVersionsModal = true;\n }", "_addSlots(){this.message=\"Slot Added Successfully\";this.$.modal.open()}", "function handleModalAccept() {\r\n var newBook = getNewBookValsFromModal();\r\n insertNewBook(newBook.id, newBook.title, newBook.author, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the countries
getAllCountries() { return this.countries; }
[ "function getAllCountries() {\n var result = [];\n\n for (var i = 0; i < countriesRootScope.countriesData.length; i++) {\n result.push(jQuery.extend({}, countriesRootScope.countriesData[i]));\n }\n\n return result;\n}", "getCountries(){\n return this.restClient.GET( this.relativeBasePath...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize the connection to rosbridge
function init() { initConnectionManager(); initPingService(); ros.connect(rosUrl); console.log('ros-connect-amigo initialized'); }
[ "function connect(){\n //IP Address of robot, can be local or global\n //If using global recommended to use a dynamic dns like noip\n\n //global connection requires port forwarding on port 80 for webserver\n // and port 9090 for rosbridge\n robot_IP = \"127.0.0.1\";\n\n //Init handle for rosbridge_websocket\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Collect all the strings in a nestedObject
function collectStrings(obj) { var resultado = []; for (const key in obj) { if (obj.hasOwnProperty(key)) { if(typeof obj[key] === "object"){ resultado = resultado.concat(collectStrings(obj[key])); }else if (typeof obj[key] === "string") { resul...
[ "function collectStrings(obj) {\n var stringsArr = [];\n\n function gatherStrings(o) {\n for (var key in o) {\n if (typeof o[key] === 'string') {\n stringsArr.push(o[key]);\n } else if (typeof o[key] === 'object') {\n return gatherStrings(o[key]);\n }\n }\n }\n\n gatherStrings...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes the data in segEndArr and segJoinArr Puts it in nodeArr and edgeArr so it can be graphed
function makeGraphable(){ for(var i=0;i<segEndArr.length;i++){ var segEnd=segEndArr[i], seq=segEnd[0], pos=segEnd[1], strand=segEnd[2]; nodeArr[nodeArr.length]= { data:{id:i+"", seq:seq, pos:pos, strand:strand}, classes:...
[ "function getSegmentAttached()\r\n{\r\n var arr = normalizeSegArray(segsArray); //start < end \r\n\r\n\r\n for(var i = 0; i < tConnArray.length;i++)\r\n {\r\n for(var j = 0; j < arr.length;j++)\r\n {\r\n if(tConnArray[i].interType == 1)\r\n {\r\n if(tCo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert BBcode tags into our message box, maintaining cursor/selection position in a variery of situations Params: (string) tag to insert, (bool) maintain selection after insertion, (string) text to insert tags around, (string) tag option string (i.e. [url=(OPTION)])
function insertTags(tag, saveSel, inner, tagEquals) { var msgBox = document.getElementById("messagearea"); if (msgBox && tag) { var tagOpen; var tagClose; if (tagEquals) { tagOpen = "[" + tag + "=" + tagEquals + "]"; } else { tagOpen = "[" + tag + "]"; } tagClose = "[/" + tag +...
[ "function insertTags(tagOpen, tagClose, sampleText) {\n var txtarea = document.forms.edit.content;\n if (!txtarea) {\n txtarea = document.getElementById(\"content\");\n }\n\n // IE\n if (document.selection && !is_gecko) {\n var theSelection = document.selection.createRange().text;\n if (!theSelection)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if shelter comes back, next search for pet. if not, then look up the shelter with petfinder API
function findShelterByPetfinderIdSuccess(response) { var existingShelter = response.data; if (!$.isEmptyObject(existingShelter)) { petfinderShelter = existingShelter; PetService .findPetByPetfinderId(vm.pet.id) ...
[ "function visitPet() {\n var petfinderShelter;\n\n // if the pet is from petshelter, simply navigate to the details page.\n if (vm.pet.source == \"PETSHELTER\") {\n $location.url(\"/shelter/\" + vm.pet._shelter + \"/pet/\" + vm.pet._id);\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to load equations
function loadEqn() { //randomize integers between 1 and 20 for the equations int1 = Math.floor( Math.random() * 20 + 1); int2 = Math.floor( Math.random() * 20 + 1); //random integer to determine addition or subtraction iSymb = Math.floor( Math.random() * 2 + 1); //initialize whether or not to display the correct ...
[ "function LoadSelected()\n{\n // Look for fckeditor\n\tif(oEditor && typeof(oEditor.FCKEquation)!='undefined')\n\t{\n FCKEquation = oEditor.FCKEquation;\n\t\tif(FCKEquation) \n\t\t\teSelected = oEditor.FCKSelection.GetSelectedElement();\n\t\n\t\tif ( eSelected && eSelected.tagName == 'IMG' && eSelected._fckequa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updateDetails Updates static information (not driven by d3) of the detail section in order to be aligned to d3's data displayed
function updateDetails(){ var title = d3.select("#name") .text(regionSelected.name); }
[ "function updateDetails(){\n\t// Title\n\td3.select(\"#region-name\")\n\t\t.text(regionSelected.name);\n}", "function updateDetails() {\n g(\".card--add .details\").innerHTML = TASK_DETAILS.active;\n slideToggle(g(\".card--add .details\"), null, .1);\n // update default level if needed\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create and track xhr request spans
function xhrCallback(handlerData, shouldCreateSpan, spans) { var _a, _b; if (!utils_2.hasTracingEnabled() || ((_a = handlerData.xhr) === null || _a === void 0 ? void 0 : _a.__sentry_own_request__) || !(((_b = handlerData.xhr) === null || _b === void 0 ? void 0 : _b.__sentry_xhr__) && shouldCreateSpan(ha...
[ "function xhrCallback(handlerData, shouldCreateSpan, spans) {\n var _a;\n var currentClientOptions = (_a = hub_1.getCurrentHub()\n .getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();\n if (!(currentClientOptions && utils_2.hasTracingEnabled(currentClientOptions)) ||\n !(handle...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a set of IDs and relationships, checks if a requirement has been satisfied by checking the isSelected of each ID and building a boolean expression with the resulting true/false values and the relationships. Returns true or false
function handleConditionalRequirements(courses) { let result_OR = false for(let or = 0; or < courses.length; or++) { let result_AND = true for(let and = 0; and < courses[or].length; and++) { result_AND = result_AND && lookup.get(courses[or][and]).isSelected } result_OR = res...
[ "function checkAllRelatedCovg(selectRelatedCovgListGrid, isSelected) {\r\n var pkSize = checkedRelatedCovgIds.length;\r\n var id = selectRelatedCovgListGrid1.recordset(\"ID\").value;\r\n if (isSelected) {\r\n selectRelatedCovgListGrid1.recordset(\"CREL_SELECT_IND\").value = -1;\r\n if (!isArr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request the OneTouch status.
function oneTouchStatus() { $http.post('/api/authy/onetouchstatus') .success(function (data, status, headers, config) { console.log("OneTouch Status: ", data); if (data.approval_request.status === "approved") { $window.location.href = $window.locat...
[ "function oneTouchStatus() {\n $http.post('/api/authy/onetouchstatus').success(function (data, status, headers, config) {\n console.log(\"OneTouch Status: \", data);\n\n if (data.approval_request.status === \"approved\") {\n $window.location.href = $window.location.origin + \"/protected\";\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The amount of pixels to offset from the right edge when flexRight is true. Defined with 6item arrays for the _rect parameter of setRect or the constructor. Can be set directly using the setFlexRight method.
get flexRightOffset() { if (this.isntNumber(this.__rightOffset)) { this.__rightOffset = 0; } return this.__rightOffset; }
[ "setFlexRight(_flag, _px) {\n if (this.isNullOrUndefined(_flag)) {\n _flag = true;\n }\n this.flexRight = _flag;\n if (this.isNullOrUndefined(_px)) {\n _px = 0;\n }\n this._rightOffset = _px;\n return this;\n }", "get flexRight() {\n return this.__flexRight || false;\n }", "g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set all values in a matrix
resetMatrix(mat, val) { mat.forEach((col) => col.fill(val)); }
[ "static set matrix(value) {}", "function setRow(row, value, matrix) {\n matrix[row].fill(value)\n }", "set(mat) {\n for (var i = 0; i < this.rows; i++) for (var j = 0; j < this.cols; j++)\n this.m[i][i] = mat.m[i][j];\n return this;\n }", "function mutableSet(row, column, value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Click loadmore from shortcode SNS Product Tabs
function snsWooLoadMore(){ $('.sns-woo-loadmore').each(function() { $(this).click(function(){ if(!$(this).hasClass('loaded')){ var btnid, numberquery, start, order, col, cat, loadtext, loadingtext, loadedtext, type, wrapid, eclass; btnid = $(this).attr('id'); numberquery = $(this).at...
[ "_loadMoreItems() {\n\t\tthis.$context.sendAction('load-more');\n\t}", "function _onClickSeeMore(event) {\n\t\tevent.preventDefault();\n\t\t\n\t\tif($isReady) {\n\t\t\t$isReady = false;\n\t\t\t\n\t\t\t_injectStoriesMarkup();\n\t\t}\n\t\t\n\t\tnew $.TrackingManager({'type':'click','prop4':$currentCategory + '_Stor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update shoppingcart to reflect contents of cart described in Json document.
function updateCart(cartJson) { console.log("Update cart"); // Handle the Json Object, parse its properties var jsonCart = JSON.parse(cartJson.data); var generated = jsonCart.cart.generated; if (generated > lastCartUpdate) { lastCartUpdate = generated; ...
[ "function updateCart(cartJson) {\n // Get the root \"cart\" element from the document\n // The getElementsByTagName() method returns a list of nodes for all elements with the specified name\n var cart = JSON.parse(cartJson);\n\n // Check that a more recent cart document hasn't been processed already\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store the final score in local memory.
function storeFinalScore() { localStorage.setItem("score", score); }
[ "function calculateFinalScore() {\n finalScore = Crafty(\"Score\")._score; // Accesses the Score entity. This requires there to be only one score entity at a time. \n metrics.set(\"finalScore\", finalScore);\n}", "function setScore() {\n localStorage.setItem(localStorage.length, score);\n }", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add New Workspace to View
function showNewWorkspace(workspaceName, id) { var workspacesDiv = document.getElementById("workspaces"); var firstWorkspace = document.getElementsByClassName("workspaceItem")[0]; var workspace = createWorkspaceButton(workspaceName, id); workspacesDiv.insertBefore(workspace, firstWorkspace); $('#workspaces').a...
[ "function createNewWorkspace(wsName) {\n\t$.ajax({\n\t\turl : serverURL + \"workspaces/\",\n\t\tmethod : 'POST',\n\t\tcontentType : \"application/json; charset=utf-8\",\n\t\tdataType : 'json',\n\t\txhrFields : {\n\t\t\twithCredentials : true\n\t\t},\n\t\tdata : JSON.stringify({\n\t\t\t\"name\" : wsName\n\t\t}),\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes all elements from Scene.
clear() { let toRemove = []; for (let i = 0; i < this.scene.children.length; i++) { let obj = this.scene.children[i]; if (obj.userData && obj.userData.isBodyElement) { toRemove.push(obj); } } for (let i = 0; i < toRemove.length; i++) { ...
[ "function clearScene() {\n for (var i = scene.children.length - 1; i >= 0; --i) {\n var obj = scene.children[i];\n scene.remove(obj);\n }\n}", "clearScene() {\n\n while(this.scene.children.length > 0) {\n this.scene.remove(this.scene.children[0]);\n }\n this.add...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Identify a semantic version within the given range for use in comparisons.
function forceSemanticVersion(range) { var re = /([0-9]+)\.([0-9]+)\.([0-9]+)/; var match = range.match(re); if(match != undefined) { return match[1] + "." + match[2] + "." + match[3]; } return undefined; }
[ "filterVersion(range) {\n range = semver.validRange(range);\n if (!range) {\n return () => true;\n }\n\n return (i) => {\n // i.version is the version to check\n let instanceVersion = i.version;\n\n return semver.satisfies(instanceVersion, range);\n };\n }", "static _minVersion...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
How many groups of cars are there?
function analyzeGroups(orderedCars) { var i = 0, groupLeaderSpeed = orderedCars[0], currentCarSpeed, groups = [[]]; while (i < orderedCars.length) { currentCarSpeed = orderedCars[i]; if (currentCarSpeed >= groupLeaderSpeed) { groups[groups.length-1].push(currentCarSpeed); } else...
[ "count() {\n let n = 0;\n for (const group of this.groups) {\n n += group[1].elements.length;\n }\n return n;\n }", "countInstances() {\n let n = null;\n // Note we're starting at i=1 (instances)\n for (let i=1; i < this.divisors.length; i++) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show Classic is called when the user clicks on the play Classic Version button. It makes the main area appear and hides the main menu area and any lizard game related elements.
function showClassic() { document.getElementById("lizard-spock-h1").style.display = "none"; document.getElementById("lizard-button").style.display = "none"; document.getElementById("spock-button").style.display = "none"; document.getElementById("lizard-rules").style.display = "none"; document.getEle...
[ "function showLizardSpock() {\n document.getElementById(\"rock-paper-scissors-h1\").style.display = \"none\";\n document.getElementById(\"classic-rules\").style.display = \"none\";\n document.getElementsByClassName(\"main-menu-area\")[0].style.display = \"none\";\n document.getElementsByClassName(\"main...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A pattern is: (1) Match (2) Node (3) Range (4) Keyword string (5) Link (6) Button patternAsNode may return null
function patternAsNode(pattern, doc) { if (!pattern) throw Error("null argument passed to patternAsNode"); if (instanceOf(pattern, DocumentFragment)) { return pattern; } else if (instanceOf(pattern, Node)) { return pattern; } else if (instanceOf(pattern, Link) || instanceOf(pattern, Button)) { throw...
[ "function patternAsNode(pattern, doc) {\r\n if (!pattern) throw Error(\"null argument passed to patternAsNode\");\r\n if (instanceOf(pattern, DocumentFragment)) {\r\n return pattern;\r\n } else if (instanceOf(pattern, Node)) {\r\n return pattern;\r\n } else if (instanceOf(pattern, Link) || instanceOf(patt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if this offer was made before
offered_before(o) { for (let i = 0; i<this.my_offers.length; i++) { let same = true for (let j = 0; j<this.my_offers[i][0].length; j++) { if (this.my_offers[i][0][j] != o[j]) { same = false; break; } } if (same) return true; } return false; }
[ "offered_before(o)\r\n\t{\r\n\t\tfor (let i = 0; i<this.my_offers.length; i++)\r\n\t\t{\r\n\t\t\tlet same = true\r\n\t\t\tfor (let j = 0; j<this.my_offers[i][0].length; j++)\r\n\t\t\t{\r\n\t\t\t\tif (this.my_offers[i][0][j] != o[j])\r\n\t\t\t\t{\r\n\t\t\t\t\tsame = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a local function that forwards to the remote function.
function deserializeFunction(message) { var id = message[1]; var port = message[2]; // TODO(vsm): Add a more robust check for a local SendPortSync. if ("receivePort" in port) { // Local function. return proxiedObjectTable.get(id); } else { // Remote function. Forward to its port. ...
[ "callRemoteFunc(name, ...args) {\n const parts = this._parseName(name);\n return this.callRemoteFuncForward(parts.forwarder, parts.name, ...args);\n }", "async proxyThruTo({ proxy, target, fncName, from, call = false, args = [] }) {\n\t\tconst abiEntry = target.abi.find(({ name }) => name === fnc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NWT primary entry point
function NWT() { }
[ "function _Main() {\n}", "Run() {\n\n }", "function NWTNode() {\n\t\n}", "function unsafeNwjsInit() {\n\tvar ngui = require(\"nw.gui\");\n\tvar nwin = ngui.Window.get();\n\tvar app = ngui.App;\n\t\n\tnwin.on(\"close\",function(event) {\n\t\trunline(\"quitQuestion();\");\n\t});\n}", "function main() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to populate the form with the questions and options
function populateForm() { for (var i = 0; i < questions.length; i++) { $("#question-form").append("<div id=" + "q" + i + "></div>"); $("#q" + i).append("<div><p>" + questions[i].question + "</p></div>"); for (var j = 0; j < questions[i].options.length; j++) { $("#q" + i).append( ...
[ "function populate() {\n\t\t$(\"#onlyQuestion\").text(questions[currentQuestion].question); // Inputs new Question\n\t\t$(\"#answerZero\").text(questions[currentQuestion].choices[0]) + $(\"#answerOne\").text(questions[currentQuestion].choices[1]) + $(\"#answerTwo\").text(questions[currentQuestion].choices[2]) + $(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the invoice date as a date string
function invoiceDateString() { return this.invoiceDate.split('T')[0]; }
[ "function xl_GetDateStr()\n{\n\tvar today = new Date()\n\tvar year = today.getYear()\n\tif(year<1000) year+=1900\n\t\tvar todayStr = GetMonth(today.getMonth()) + \" \" + today.getDate()\n\ttodayStr += \", \" + year\n\treturn todayStr\n}", "get dateFormated() {\n var dd = (this.date.getDate() < 10 ? '0' : '') +...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate keystore files from mnemonic phrase
fromMnemonic() { let keystoreFromMnemonic = async ( _mnemonic, _passwd, _index = 0, _hdpath = "m/44'/60'/0'/0/") => { let hdwallet = Wallet.hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_mnemonic)); let hdpath = _hdpath; let wallet = hdwallet.derivePath(_hdpath + _index).getWallet(); const address ...
[ "function genKeystore() {\n var keyFromPasswordPromise, password, seedPhrase, opt, ks, pwDerivedKey, tokenList, errorString;\n return regeneratorRuntime.wrap(function genKeystore$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new MustacheNode with a new preceding param (id).
function unshiftParam(mustacheNode, helperName, newHashPairs) { var hash = mustacheNode.hash; // Merge hash. if(newHashPairs) { hash = hash || new AST.HashNode([]); for(var i = 0; i < newHashPairs.length; ++i) { hash.pairs.push(newHashPairs[i]); } ...
[ "function unshiftParam(mustacheNode, helperName, newHashPairs) {\n \n var hash = mustacheNode.hash;\n \n // Merge hash.\n if(newHashPairs) {\n hash = hash || new Handlebars.AST.HashNode([]);\n \n for(var i = 0; i < newHashPairs.length; ++i) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
JSImage is an object for basic image manipulation and processing. It uses the HTML element and JavaScript to do the dirty work. "JSImage" is a terrible name. Help me think of a better one!
function JSImage( _canvas_id, _image_src ) { /******************************* * Private instance variables. * *******************************/ var marquee; var that = this; // hack to allow inner methods to access instance variables var canvas_element = document.getElementById( _canvas_i...
[ "function addImage(x, y, sizeX, sizeY, image) {\n\tvar w = new MultiWidgets.JavaScriptWidget();\n\n\tw.setLocation(x, y);\n\tw.setWidth(sizeX);\n\tw.setHeight(sizeY);\n\tw.img = new MultiWidgets.ImageWidget();\n\tw.img.addCSSClass(\"ImageW\");\n\n\tif (w.img.load(image)) {\n\t w.img.addOperator(new MultiWidgets....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
internal default indicator class
function Indicator(e) { this.ref = e; this.on = function() { this.ref.style.visibility = 'inherit'; }; this.off = function() { this.ref.style.visibility = 'hidden'; }; }
[ "function Indicators () {}", "get indicator(){\n return this._indicator;\n }", "createIndicator() {\n return this.fb.group({\n indicatorName: '',\n metrics: '',\n });\n }", "static _createIndicator(type, x) {\n\n let indicator = document.createElement(\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if a string is a valid RGB(A) string
function isRgb(string) { var rgb = string.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i); return (rgb && rgb.length === 4) ? true : false; }
[ "function isRGBColor(str) {\r\n if (!isString(str))\r\n return false;\r\n else\r\n return rgbColor.test(str);\r\n}", "function isColorStringHexRGB(raw) {\n return hexRGBRegex.test(raw);\n}", "function isRgb(string) {\r\n var rgb = string.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The number of concurrent downloads that happens at the same time
function getDownloadFileConcurrency() { return 2; }
[ "function countDownloads(pod){\n downloadCount++; //This HAS to be global\n if (downloadCount>=2){\n downloadCount=0;\n savePodcastData(pod);\n }\n}", "function gatherDownloadCounts () {\n function processNextBatch () {\n if (doDownloads) {\n var startTime = new Date...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ENSURE functions Ensure functions make sure that a certain GUI element that is needed for further processing is present. Paints a page container for the tab in focus, if not there yet.
function ensurePageForFocusedTab (sheetId, pageId, pageUrl, pageTitle, isCheckNewPage){ // var url = Utils.getCurrentPageURL(); // var urlTitle = Utils.getCurrentPageTitle(); Utils.log(1, "view.ensurePageForFocusedTab: Ensuring page for " + pageUrl); // Get the HooverPage object for this URL. ...
[ "function waitforQooxdoo() {\n if (window.qx.AppLoaded) {\n self.inlineIsle = globals.inlineIsle = new qx.ui.root.Inline(self.node, true, true).set({\n backgroundColor: 'transparent'\n });\n self.inlineIsle.setLayout(new qx.ui.layout.Canvas()); //QxPlayground's container will be r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Read the configuration file.
read() { this.exists() if (!this.validate()) { } const config = JSON.parse(fs.readFileSync(this.configPath)) return config }
[ "function read() {\n\tconfig = JSON.parse(fs.readFileSync(CONFIG_FILE, \"utf8\"));\n}", "readConfig() {\n try {\n this.config = JSON.parse(fs.readFileSync(this.configFile, 'UTF-8'));\n } catch (e) {\n this.log.error('could not read the config.json');\n this.resetConf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a multiline formatted address, from either a string or an address object
function multiLineAddress( address ) { if( ! address ) return ''; if( typeof address == 'string' ) return H(address) //.replace( /, USA$/, '' ) .replace( /, (\w\w) /, '\| $1 ' ) .replace( /, /g, '<br>' ) .replace( /\|/g, ',' ); return S( address.line1 ? H(address.line1) + '<br>' : '', ...
[ "function oneLineAddress( address ) {\r\n\tif( ! address )\r\n\t\treturn '';\r\n\t//if( typeof address == 'string' )\r\n\t//\treturn H(address).replace( /, USA$/, '' );\r\n\treturn H( S(\r\n\t\taddress.line1 ? address.line1 + ', ' : '',\r\n\t\taddress.line2 ? address.line2 + ', ' : '',\r\n\t\taddress.city, ', ', ad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the bind has an alias 'AS' in it, like 'GENERAL|message AS someMessage') In this case the alias will be the tobeused key in the component it is set upon.
parseAlias(storeLocationObject) { const bind = storeLocationObject.bind; if (bind.includes("AS")) { const argumentArray = bind.split("AS"); storeLocationObject.bind = argumentArray[0]; storeLocationObject.alias = argumentArray[1]; } else { storeLocationObject.alias = null; } ...
[ "isAlias() {\r\n return (this.getFlags() & typescript_1.SymbolFlags.Alias) === typescript_1.SymbolFlags.Alias;\r\n }", "function isAliasSymbol(symbol, ts) {\n return hasFlag(symbol.flags, ts.SymbolFlags.Alias);\n}", "normalizeContractAlias(nameOrAlias) {\n var _a;\n return _a = this.c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads Babel options: plugins and presets
function readBabelOptions(opts) { var babelPresets = [], // Add plugins to emit .d.ts files if necessary babelPlugins = opts.declaration ? [[require("babel-dts-generator"), { "packageName": "", "typings": fableLib.pathJoin(opts.workingDir, opts.out...
[ "function buildBabelOptions(script) {\n\t\t return {\n\t\t presets: script.presets || ['react', 'es2015'],\n\t\t plugins: script.plugins || ['transform-class-properties', 'transform-object-rest-spread', 'transform-flow-strip-types'],\n\t\t sourceMaps: 'inline'\n\t\t };\n\t\t}", "function buildBabelOpti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
intercepts clicks on links if the link is local '/...' we change the location hash instead
function interceptClickEvent(e) { var href; var target = e.target || e.srcElement; if (target.tagName === 'A') { href = target.getAttribute('href'); var isLocal = href != null && href.startsWith('/'); //put your logic here... if (isLocal) { ...
[ "function interceptClickEvent(e) {\n var href;\n var target = e.target || e.srcElement;\n if (target.tagName === 'A') {\n href = target.getAttribute('href');\n let isLocal = href != null && href.startsWith('/');\n\n //put your logic here...\n if (isLo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to rotate the images Input: "next" or "prev" to indicate direction
function rotateImgs(direction) { // Next // Current picture will rotate right and hide // Next picture will rotate left and show if (direction === "next") { let arcOptions1 = { "direction": "right" } let arcOptions2 = { "direction": "left" } imgs[currentImgIndex].hide("...
[ "function rotate(srcimage,direction){\rn=n+direction;\rif (n==allImages) n=0;\rif (n==-1) n=allImages-1;\rdocument.images[srcimage].src=imgObjects[n].src;\r}", "function rotateImage(direction) {\r\n\t// Get the current image angle.\r\n\timageObject = document.getElementById('content_preview_image1');\r\n\tif (ima...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes a circle [v,r] centered at Vector2 v and radius v and performs DFS n levels through the inversion circles vrs = [[v01,r01], [v02,r02], ..., [v0k,r0k]]. Accumulates [v1,r1,l1,c1], ..., [vm,rm,l1,cm] in dict res where the i'th circle, centered at vi of radius ri, has been hit ci times and first appears at level li....
function invertCircle(n, circle, vrs, dict={}, scale=1000) { let toKey = function(x, y, r) { if (r > radiusThresh) // treat big seed circle separate return "A"; // since it has same center as its inversion let xn = Math.round(x * scale); let yn = Math.round(y * scale); ...
[ "vertexVsCircle(v, c){\n return Gmt.Distance.plain(v.x, v.y, c.x, c.y) - c.radius;\n }", "function intersectRayCircle(p, v, s, r) {\n var m = p.subtract(s);\n var b = m.dot(v);\n var c = m.dot(m) - r * r;\n\n if (c > 0 && b > 0) { return; }\n\n var discr = b * b - c;\n if (disc...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the ID for the yellow eye image
function getYellowEye(callback) { canvas.get(`/api/v1/courses/${courseId}/files?search_term=${yellowEyeFilename}`, (err, files) => { if (err) { callback(err); return; } yellowEyeFile = files[0]; callback(null); }); }
[ "function retrieveImageId(cell) {\n return \"image\" + LZ(cell.x) + LZ(cell.y);\n}", "getPixelID() {\n const pixelPt = this.parent.previewPixelLockBoardPos;\n const color = parseInt(this.parent.board.currentColor.getAttribute(\"data-color-index\"));\n return `${color.toString(16)}.${pixelP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Language: GLSL Description: OpenGL Shading Language
function glsl(hljs) { return { name: 'GLSL', keywords: { keyword: // Statements 'break continue discard do else for if return while switch case default ' + // Qualifiers 'attribute binding buffer ccw centroid centroid varying coherent column_major const cw ' + 'de...
[ "function glsl(hljs) {\n return {\n name: 'GLSL',\n keywords: {\n keyword:\n // Statements\n 'break continue discard do else for if return while switch case default ' +\n // Qualifiers\n 'attribute binding buffer ccw centroid centroid varying coherent column_m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
9 Objectives Given array, swap first and last, second and secondtolast, third and thirdto last, etc. Have the function return this swapped array. For example swapTwoardCenter([true,42,"Ada",2,"pizza"]) should return ["pizza",2,"Ada",42,true]. Passing [1,2,3,4,5,6] should return [6,5,4,3,2,1].
function swapTowardCenter(arr){ for (let i = 0; i < arr.length/2; i++) { var temporaryVarForSwitchingIndex = arr[i] arr[i] = arr[arr.length - 1-i] arr[arr.length - 1-i] = temporaryVarForSwitchingIndex } return arr }
[ "function swapTowardCenter(arr){\n var temp = arr[0];\n arr[0] = arr[arr.length - 1];\n arr[arr.length - 1] = temp;\n var temp2 = arr[2];\n arr[2] = arr[arr.length - 3];\n arr[arr.length - 3] = temp2;\n return arr;\n}", "function swapTowardTheCenter(arr){\r\n for(var i=0; i<arr.length; i= ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shorting Selector Switch 2 Extends mxShape.
function mxShapeElectricalShortingSelectorSwitch2(bounds, fill, stroke, strokewidth) { mxShape.call(this); this.bounds = bounds; this.fill = fill; this.stroke = stroke; this.strokewidth = (strokewidth != null) ? strokewidth : 1; }
[ "function mxShapeElectricalSelectorSwitch6Position2(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}", "function mxShapeElectricalSelectorSwitch4Position2(bounds, fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }