query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
on change role user click
function onChangeRoleUserClick() { $('#modal-change-role').modal('show'); let vSelectedRow = $(this).parents('tr'); let vSelectedData = gCustomerTable.row(vSelectedRow).data(); gCustomerId = vSelectedData.id; }
[ "function ChangeUserRole(){\n\t\n\tCURRENT_ROLE = $('#' + USER_ROLE).val();\n\t\n\tAuthentificate();\n\t\n}", "function roleClick(el) {\n //console.log(el.val());\n updateUserRole(el);\n}", "function updateRole() {\n\n}", "function selectRole(role) {\n vm.role = role;\n vm.user.role_id = role.id;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates nodes for this html value
function createNodesFromHtml(value) { if (!value || value === '') return [ document.createTextNode('') ]; var nodes = []; var childNodes = []; var el = $('<div/>'); el.html(value); childNodes = el[0].childNodes; for (var i = 0; i < childNodes.length; i++) { nodes.push(childNodes[i].cloneNode(t...
[ "function build_node(tag_name, val) {\n\t\t\tvar\n\t\t\ttag_name = tag_name.replace(/[^\\w\\-_]/g, '-').replace(/-{2,}/g, '-').replace(/^[^a-z]/, function($0) { return 'node-'+$0; }),\n\t\t\tpadder = new Array(depth + 2).join('\\t'),\n\t\t\tnode = '\\n'+padder+'<'+tag_name+'>\\n'+padder+'\\t';\n\t\t\tnode += typeof...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates database scheme and populates 'unis' table with the api response from
async function createDb() { const db = knex({ client: 'sqlite3', connection: () => ({ filename: './uni.db', }), useNullAsDefault: true }) const createUniTableCall = db.schema.createTable('unis', (table) => { table.increments('id') table.string('name') table.string('country') ...
[ "function populateDB(){\n populateTableDocs();\n populateTableInvInd();\n populateTableTerms();\n }", "function createUserTable(){\n knex.select('*').from('userdetail')\n .then((data)=>{\n for(var i of data){\n userTable(i.email.split('@')[0]+i.password)\n // console.log(i.fullnam...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add the images to an already created poi
function addImagesToPoi(poi_oid) { // add images for (var img of poi_img_list) { var img2poi_params = "?oid=" + poi_oid + "&new_img_oid=" + img.data.$id + "&display_name=" + img.name; jQuery.ajax({ url: updatePoi_url + img2poi_params, data: null, type: "POST", async: true,...
[ "function addImagesToPG ()\n {\n try\n {\n const selectedImages = images.filter(image => image.selected);\n images.map(img=>{img.selected = false});\n setPGData([...storeData, ...selectedImages]);\n setSelectedImagesCount(0); setSelectionMode(false...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get popup content for a district. Shows state, district, image & name of representative
function getDistrictInfoByGeoid(attributes) { if (isDefined(attributes)) { var geoid = attributes.GEOID for (var i = 0; i < members.length; i++) { if (members[i].GEOID === geoid) { return ` <div class="borderedRow"> ...
[ "function popupContent(name,adr){\n\tname = name_format(name)\n\tif (typeof adr != \"undefined\"){\n\t\tadr = adr.trim()\n\t}\n\tcontent = \"<p><strong>Name: </strong>\" + name + \"<br /><strong>Address: </strong>\" + adr + \"</p>\"\n\n return content;\n}", "function getPopupContent(incident) {\n var weathe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When an annotation started to be hovered.
function handleAnnotationHoverIn (annotation) { if (_getSelectedAnnotations().length === 0) { core.enable({ uuid : annotation.uuid, text : annotation.text, disable : true }) } }
[ "handleHoverInEvent (e) {\n console.log('handleHoverInEvent')\n this.highlight()\n this.emit('hoverin')\n dispatchWindowEvent('annotationHoverIn', this)\n }", "handleHoverInEvent (e) {\n console.log('handleHoverInEvent')\n this.highlight()\n this.emit('hoverin')\n dispatch...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a focus style which can be used to define an :after focus border.
function getFocusStyle(theme, inset, color, position) { if (inset === void 0) { inset = '0'; } if (color === void 0) { color = theme.palette.neutralSecondary; } if (position === void 0) { position = 'relative'; } return index_1.mergeStyles({ outline: 'transparent', position: position ...
[ "get borderTypeFocusUnderlineColor() {\n return brushToString(this.i.o3);\n }", "function getFocusStyle(theme, inset, position, highContrastStyle, borderColor, outlineColor) {\n if (inset === void 0) { inset = 0; }\n if (position === void 0) { position = 'relative'; }\n if (highContrastStyle ==...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Flush channel members table Find channel that the bot belongs to, get the members and save to local db
function refreshChannelMembers(isFirstTime) { membersService.flushMembers(); let deferred = Q.defer(); const resp = {}; web.users.list().then(success => { const usersList = success; if (usersList !== undefined) { resp.ok = true; resp.members = user...
[ "getChannelMembers() {\n const resp = {};\n return web.channels\n .list()\n .then(res => {\n const channel = res.channels.find(c => c.is_member);\n if (channel) {\n resp.ok = true;\n resp.members = channel.member...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
= Description Default endDrag event responder method. Sets internal flags by default. This is the preferred method to extend if you want to do something when a drag event ends. If you extend, remember to call +this.base();+ = Parameters +x+:: The horizontal coordinate units (px) of the mouse cursor position. +y+:: The ...
endDrag(x, y) {}
[ "function dragend(d) {\n\t\n}", "function onDragEnd() {\n gCurrLineDrag = -1;\n gIsMouseDown = false;\n if (!getMeme()) return;\n renderInputField();\n gCanvas.style = ('cursor:;')\n}", "function DIF_enddrag(e) {\r\n\tDIF_dragging=false;\r\n//\tDIF_objectDragging.style.cursor=\"auto\";\r\n\tDIF_i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reseller.set_reverse [PRODUCTION] [See on api.ovh.com](
SetNewReverseToIp(reverse, serviceName) { let url = `/hosting/reseller/${serviceName}/reverse`; return this.client.request('POST', url, { reverse }); }
[ "async setReverseName(_name, _registrantAccount, _gasPrice) {\n try {\n var _tx = await this.reverseRegistrarSigner.setName(_name, {\n gasPrice: _gasPrice,\n from: _registrantAccount\n });\n return {\n tx: _tx\n };\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function for filling the second data table with the medians of the selected school(s) total scores
function showMedianTotalScoreGrid() { var htmlList = ""; var ctrl = "satMedianGrid"; //Build a HTML table on the fly dynamically and initialize it as a jQuery data table htmlList += "<table width= 100% style= 'margin-top:12px:width:100%' class='row-border table-striped table-hover' id = 'table-" + ctrl...
[ "function showMeanMathScoreGrid() {\n var htmlList = \"\";\n var ctrl = \"satMeanGridMath\";\n\n //Build a HTML table on the fly dynamically and initialize it as a jQuery data table\n htmlList += \"<table width= 100% style= 'margin-top:12px:width:100%' class='row-border table-striped table-hover' id = '...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get specific country border data from geojson file
function getGeoJson() { console.log({ iso3: 'it', country: country }); console.log(`http://api.geonames.org/countryInfoJSON?formatted=true&lang=it&country=${country}&username=Romancevic&style=full`) console.log('Hello') $.ajax({ url: "libs/php/getCountryPolygon.php", ...
[ "function displayBorders(json, map, flagColors, inp, func, country, citiesWithIds, markerGroup, hlMarker, getWiki, getPhoto, getWeather) {\n var c = L.geoJson(json, {\n onEachFeature: onEachFeature,\n style: style\n }).addTo(map);\n\n var selCountry;\n\n // Add style to each country border polygon\n func...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Main function to try getting a quote, getting a photo URL from NASA, downloading that photo, and tweeting a message, gracefully handling errors when possible
function bot() { // try getting a quote return getQuote().then(function(quoteinfo) { //try getting a photo URL return getPhotoInfoFromNasa().then(function(photoinfo) { var quoteandattrib = quoteinfo.quoteText + "\n-" + quoteinfo.quoteAuthor + "\n@happyspacebot\n"; var updatedcopyright = (typ...
[ "function handleURL(url) {\n if (args.download) {\n if (url !== null)\n downloadURL(url, args.download, console.log);\n else\n console.log(\"Could not find picture. Check your internet or the date.\")\n } else {\n console.log(url);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
mark properties as mortgaged, add funds to player, update bottom list
_uiPropertyMortgaged (data) { this.uiService.propertyMortgaged(data.squares); // mark each square as mortgaged data.squares.forEach(squareId => { this.mapData.squares[squareId].isMortgaged = true }) // add funds from mortgaging to player this.playersData[data.play...
[ "function addPropertyToPlayerWallet(player, property){\n\n\n\n let propertyColor = property.color;\n\n\n player.propertiesCount += 1;\n\n\n \n player.propertiesByColor[propertyColor.index].properties.push(property);\n\n property.landLord = player;\n\n player.cash -= property.value;\n\n \n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws the number of bullets at the bottom of the screen
function bulletCount(){ let xPos = width - width/25; let yPos = height - height/25; for(let i = 0; i < reload; i++){ fill('rgba(255, 0, 0, 0.5)'); noStroke(); ellipse(xPos, yPos, width/100, width/100); xPos -= width/50; } }
[ "function drawBullets() {\n\tbullets.innerHTML = \"\";\n\tfor (let i = 0; i < bulletsArray.length; i++) {\n\t\tbullets.innerHTML += `<div class='bullet1' style='left:${bulletsArray[i].left}px; top:${bulletsArray[i].top}px'></div>`;\n\t}\n}", "function drawBullets() {\n for (var i = 0; i < bullets.length; i++) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Which link are we ACTUALLY showing right now? Return 1 if none. If we're showing several, returns the first one.
function currentLinkShown(vidnumber) { var linkNumber = -1; for (var i = 0; i < linkTimer[vidnumber].length; i++) { if (linkTimer[vidnumber][i].shown) { linkNumber = i; break; } } return linkNumber; }
[ "function currentLink(t, vidnumber) {\n var linkNumber = -1;\n\n for (var i = 0; i < linkTimer[vidnumber].length; i++) {\n if (\n t >= linkTimer[vidnumber][i].time &&\n t < linkTimer[vidnumber][i].time + hxLinkOptions.hideLinkAfter\n ) {\n linkNumber = i;\n break;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parcours le panier et affiche les objets + le total de la commande
function panier() { for(i=0; i<objPanier.length; i++) { afficheCamera(i); } //affiche le prix total de la commande prixTotal(); }
[ "totalContenu() {\n console.log(`Il y a ${this.contenu.length} personne(s) dans le/la ${this.nom}`);\n }", "function panierLength() {\n let panier = getPanier();\n let TotalProduits = 0;\n Object.keys(panier).forEach(id => {\n\n TotalProduits += panier[id].nombre;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tells firebase to delete a message with a specific ID on the Contact Us admin page.
function delete_button_pressed(obj){ firebase.database().ref('contact_us').child(obj).remove().then(function(){ window.alert("Message Deleted"); window.location.reload(false); }).catch(function(error){ }); }
[ "deleteMessage() {\n firebase.database().ref('comments/' + this.props.movieId + '/' + this.props.messageId).remove();\n }", "async delete_message(msgid) {\n \n }", "function deleteMessage(){\r\n deleteMessageDB(id);\r\n}", "function delete_message(message) {\n admin_bot._api('chat.de...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds timestamp date from a date
function buildDateFromDate(date){ var year = date.getFullYear(); var month = date.getMonth(); var day = date.getDate(); var hour = date.getHours(); var dDate = new Date(year, month, day, hour); var sDate = Date.parse(dDate); return sDate; }
[ "function buildDateStamp(date) {\n if (date === void 0) { date = new Date(); }\n var year = \"\" + date.getFullYear();\n var month = (\"\" + (date.getMonth() + 1)).padStart(2, '0');\n var day = (\"\" + date.getDate()).padStart(2, '0');\n return [year, month, day].join('-');\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
API test for 'GetAcList', Get access control list
function Test_GetAcList() { return __awaiter(this, void 0, void 0, function () { var in_rpc_ac_list, out_rpc_ac_list; return __generator(this, function (_a) { switch (_a.label) { case 0: console.log("Begin: Test_GetAcList"); in_rpc_...
[ "get accessList() {\n const value = this.#accessList || null;\n if (value == null) {\n if (this.type === 1 || this.type === 2) {\n return [];\n }\n return null;\n }\n return value;\n }", "function internal_getAgentAccessAll(acpData) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
keep track of recent plugins
function keepTrackOfRecentPlugins(pluginFolder) { window.localStorage.setItem('lastPlugin', pluginFolder); var recentPlugins = localStorage.getItem('__recentPlugins'); if (recentPlugins) { try { recentPlugins = JSON.parse(recentPlugins); } catch (e) { } } if (!(recentPlugins && recentPlugins....
[ "pluginRefresh() {}", "function updatePlugins() \n{\n\tfor (let pluginId in localStorage.getItem(\"SkyX/Plugins/PluginsTable\"))\n\t{\n\t\tUpdatePlugin(pluginId);\n\t}\n}", "orderPlugins() {\r\n debug('orderPlugins:before', this.pluginNames);\r\n const runLast = this._plugins\r\n .filte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads a font face via either the native FontFace API, or CSS injection TODO: consider support for multiple format URLs per face, unicode ranges
injectFontFace ({ family, url, weight, style }) { if (this.supports_native_font_loading === undefined) { this.supports_native_font_loading = (window.FontFace !== undefined); } // Convert blob URLs, depending on whether the native FontFace API will be used or not. // ...
[ "loadFontFace (family, face) {\n if (face == null || (typeof face !== 'object' && face !== 'external')) {\n return;\n }\n\n let options = { family };\n let inject = Promise.resolve();\n\n if (typeof face === 'object') {\n Object.assign(options, face);\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse microsyntax template expression and return a list of bindings or parsing errors in case the given expression is invalid. For example, ``` ^ ^ absoluteValueOffset for `templateValue` absoluteKeyOffset for `templateKey` ``` contains three bindings: 1. ngFor > null 2. item > NgForOfContext.$implicit 3. ngForOf > ite...
parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) { const tokens = this._lexer.tokenize(templateValue); const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, templateValue.length, false /* parseAction */, this.errors, 0...
[ "parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {\n const tokens = this._lexer.tokenize(templateValue);\n const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* None */, this.errors, 0 /* relative offset */);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set coordinates in block
function set_block_coordinates(block_element, coordinates) { if (coordinates !== null) { block_element.parentNode.setAttribute("data-lat", coordinates.lat); block_element.parentNode.setAttribute("data-lng", coordinates.lng); } }
[ "function setPosition(block, x, y){\n\n\t\t\t\tif (!block.dirty) \n\t\t\t\t\treturn\n\n\t\t\t\tvar dx = x - block.x\n\t\t\t\tvar dy = y - block.y\n\n\t\t\t\t\n\n\t\t\t\t// Set our children's positions\n\t\t\t\tblock.allChildren.forEach(function(d, i){\n\t\t\t\t\td.x += dx\n\t\t\t\t\td.y += dy\n\t\t\t\t})\n\n\t\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Skip the next token if it is punctuation, otherwise die
function skip_punc(char) { if (is_punc(char)) { input.next(); } else { input.croak(`Expected punctuation: "${char}"`); } }
[ "function skip_punc(chs) {\n if (is_punc(chs)) input.next();\n else input.croak('Expecting punctuation: \"' + chs + '\"');\n }", "function skip_punc(chs) {\n if (is_punc(chs)) input.next();\n else input.croak(\"Expecting punctuation: \\\"\" + chs + \"\\\"\");\n }", "function tokenSkip() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load tasks from devDependencies
function loadDevDependencies() { var packageJson = grunt.file.readJSON(consts.packageJson); var tasks = packageJson.devDependencies || {}; var prefix = consts.gruntPrefix; Object.keys(tasks).forEach(function(task) { if (task.indexOf(prefix) === 0) { grunt.loadNpmTasks(task) ...
[ "function loadTasks() {\n try {\n var tasks = require('./build/tasks');\n tasks.helpers = require('./build/helper');\n return tasks;\n }\n catch (ex) {\n\n // When the gulpfile loaded first,\n // tasks hasn't been built yet.\n }\n}", "function loadTasks() {\n Entry.setContext(CONTEXT);\n var ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Install a message filter for a message handler. A message filter is invoked before the message handler processes a message. If the filter returns `true` from its [[filterMessage]] method, no other filters will be invoked, and the message will not be delivered. The most recently installed message filter is executed firs...
function installMessageFilter(handler, filter) { getDispatcher(handler).installMessageFilter(filter); }
[ "function installMessageFilter(handler, filter) {\n\t getDispatcher(handler).installMessageFilter(filter);\n\t}", "function installMessageFilter(handler, filter) {\n getDispatcher(handler).installMessageFilter(filter);\n }", "function installMessageFilter(handler, filter) {\r\n getDispat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Restricted route to update a prescription
editPrescription(data, id) { axios(`${this.base}/prescriptions/${id}`, { method: 'PUT', headers: { Authorization: `Bearer ${TokenService.read()}` }, data }) .then(response => { console.log('Prescription updated successfully! New Data:', response.data); this.setState(prevState => { pr...
[ "function editPublication(req, res) {\r\n var userId = req.decoded.uid\r\n var id = req.params.id\r\n var userPublicaiton = {\r\n id: id,\r\n developer_id: userId,\r\n title: req.body.cTitle,\r\n year: req.body.cYear,\r\n link: req.body.cLink\r\n }\r\n dashboardService.editPublication(userPublic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
newroom: Called from the Room list view. Looks at the roomname form value and requests the database to create a new room by this name.
function newroom() { $("#warning2").html(""); var tmproomname = document.roomform.roomname.value; if (tmproomname.search(/[^a-zA-Z0-9]/) != -1 || tmproomname.length > 16) { $("#warning2").html("Viallinen huoneen nimi."); return; } var roomname = tmproomname; if (player != "" && passcode != "" && roomname != "...
[ "async function newRoom() {\n let room;\n try {\n room = await rest.post(`${url}/rooms`, {});\n if (room.error) throw new Error(room.message);\n } catch (error) {\n showModalOnScreen(true, error.message);\n return;\n }\n setShowRoom(true);\n setRoomID(room.idRoom);\n setHash...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
endregion Sprite_Icon region Sprite_Face A sprite that displays a single face.
function Sprite_Face() { this.initialize(...arguments); }
[ "function drawFace() {\n penUp();\n moveTo (260, 336);\n penRGB (0, 0, 0, 1);\n dot (1);\n penUp();\n moveTo (274, 336);\n dot (1);\n penUp();\n moveTo(260, 343);\n penWidth (1);\n penDown();\n turnLeft(180);\n arcLeft(180, 8);\n penUp();\n}", "displayFace() {\n\t\tthis.location.top_left_x = parseIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds an image size inside a category
function findImage(width, height, category) { const cat = categories[category] if(!cat) return null return cat.find(e => { if(e.width == width && e.height == height) return e }) }
[ "getImageDimensions(url) {\n\t\treturn probe(url);\n\t}", "function getScaledDimensions(arg){\n\n var feats = null;\n\n for(var idx = 0; idx < gImageStats.length; ++idx){\n if(gImageStats[idx].id == arg){\n feats = gImageStats[idx];\n break;\n }\n }\n\n if(feats == ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
b. Make a constructor function called `Celsius` that has one property: `celsius`, and two methods `getFahrenheitTemp`, and `getKelvinTemp`.
function Celsius(celsius){ this.celsius = celsius this.getFahrenheitTemp = function(){ return 1.8 * this.celsius + 32 } this.getKelvinTemp = function(){ return this.celsius + 273 } }
[ "function Celsius (celsius) {\n this.celsius = celsius;\n this.getFahrenheit = function(){\n return celsius * 1.8 + 32;\n }\n this.Kelvin = function(){\n return celsius + 273.15;\n }\n}", "function Celsius (celsius) {\n this.celsius = celsius,\n this.getFahrenheitTemp = function() {\n console.log(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws the original image, masked by the line drawn in drawLineToCanvas.
function drawImageCanvas() { // Emulate background-size: cover var width = imageCanvas.width; var height = imageCanvas.width / image.naturalWidth * image.naturalHeight; if (height < imageCanvas.height) { width = imageCanvas.height / image.naturalHeight * image.naturalWidth; height = imageCanvas.heigh...
[ "function drawMask() {\n bannerPreviewWidth = $scope.options.width * $scope.scaleFactor;\n bannerPreviewHeight = $scope.options.height * $scope.scaleFactor;\n var previewCenter = {\n left: $scope.options.left + bannerPreviewWidth / 2,\n top: $scope.options.top + bann...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Accepts a public key, calculating its "balance" based on the amounts transferred in all transactions stored in the chain. Note: There is currently no way to create new funds on the chain, so some keys will have a negative balance. That's okay, we'll address it when we make the blockchain mineable later.
getBalance(publicKey) { // Your code here }
[ "function balance( key ){\n\n\tcheckForMissingArg( key, \"key\" );\n\t\n\treturn getPublicKey(key).then( Blockchain.getBalance );\n}", "async function getBalance(publicAddress) { \n\n let publicKey = await getPublicKey(publicAddress);\n\n let balance = await client.getBalance(publicKey);\n balance = sdk....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert a node between the parent and the container. When no container is given, the node is appended as a child of the parent. Also updates the element stack accordingly.
_insertBeforeContainer(parent, container, node) { if (!container) { this._addToParent(node); this._elementStack.push(node); } else { if (parent) { // replace the container with the new node in the children const index = parent.c...
[ "function insert(parent, elm, ref) {\n if (isDef(parent)) {\n if (isDef(ref)) {\n if (nodeOps.parentNode(ref) === parent) {\n nodeOps.insertBefore(parent, elm, ref);\n }\n }\n else {\n nodeOps.app...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Declare a function to get the blur (=the click outside the text area) Check if the input is valid mail
function handleBlur() { if (!inputValue.includes('@')) { alert("Warning : '@' missing , this isn't a valid mail") } }
[ "function validateBlurEmailText() {\n\n if (emailInput.value === \"\" || emailInput.value === null) {\n infoDivMail.style.display = \"block\"\n infoDivMail.style.color = \"red\"\n infoDivMail.innerText = \"Email field is empty\"\n return;\n }\n if (!isEmail(emailInput.value)) {\n infoDivMail.style...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format a Ripple Amount for editing by the user
function formatForEdit(amount) { var formatted = $filter('rpamount')(amount, {group_sep:false, hard_precision:true, max_sig_digits:20}); return formatted; }
[ "function formatForEdit(amount) {\n var formatted = $filter('rpamount')(amount, {group_sep:false, hard_precision:true, max_sig_digits:20});\n\n return formatted;\n }", "function formatAmount() {\n\treturn \"$\" + phonePurchase.toFixed(2);\n}", "asText4() {\nreturn this._makeText(`${this.amount.toFi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove pagemode/scrollelement scroll event listener
removeScrollListener(element) { const { scrollHandler } = this; element.removeEventListener('scroll', scrollHandler, false); }
[ "removeScrollHandling() {}", "removeOnScrollListener_() {\n if (this.scrollUnlisten_) {\n this.scrollUnlisten_();\n this.scrollUnlisten_ = null;\n }\n }", "function _unbindScrollListener() {\n\t Utils.removeEvent($(window), Constants.SCROLL);\n\t}", "function _unbindScroll () {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pass out all the props from class App to class TodosListItems
renderItems(){ const props = _.omit(this.props,'todos'); return _.map(this.props.todos, (todo,index) => <TodosListItems key={index} {...todo} {...props}/> ); }
[ "renderItems() {\n\n const props = _.omit(this.props, 'todos');\n\n return _.map(this.props.todos, (todo, index) =>\n <TodosListItem key={index} {...todo} {...props} />);\n }", "function AppView(props) {\n this.props = props;\n this.state = {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts an RGB object to an HSB object
function rgb2hsb(rgb) { var hsb = { h: 0, s: 0, b: 0 }; var min = Math.min(rgb.r, rgb.g, rgb.b); var max = Math.max(rgb.r, rgb.g, rgb.b); var delta = max - min; hsb.b = max; hsb.s = max !== 0 ? 255 * delta / max : 0; if(hsb.s !== 0) { if(rgb.r === max) { hsb.h = (rgb.g...
[ "function rgb2hsb(rgb) {\n var hsb = { h: 0, s: 0, b: 0 };\n var min = Math.min(rgb.r, rgb.g, rgb.b);\n var max = Math.max(rgb.r, rgb.g, rgb.b);\n var delta = max - min;\n hsb.b = max;\n hsb.s = max !== 0 ? 255 * delta / max : 0;\n if( hsb.s !== 0 ) {\n if( rgb.r === max ) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check lastname with regex & add/remove class
function checkLastname(lastname) { if (!lastname.match(nameReg)) { lastnameError.textContent = 'Le champ ne doit pas contenir de chiffres ou de caractères spéciaux et contenir au moins 2 caractères.'; formSub.lastname.classList.add('invalid'); lastnameValid = false; } else { lastnameError.textConte...
[ "function validateLastName(el) {\r\n if (!el.val().match(/^[a-zA-Z\\'\\-\\ ]+$/)) {\r\n } else {\r\n removeAlert(el, 'err-invalidAccntNo');\r\n }\r\n }", "function validateLastName(lname){ \n if(lname.match(/^[A-Za-z]+$/)) \n return true;\n else\n retu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a Modern team site backed by Office 365 group. For use in SP Online only. This will not work with Apponly tokens
createModernTeamSite(displayName, alias, isPublic = true, lcid = 1033, description = "", classification = "", owners, hubSiteId = "00000000-0000-0000-0000-000000000000", siteDesignId) { const postBody = { alias: alias, displayName: displayName, isPublic: isPublic, ...
[ "async function createOrUpdateWebApp() {\n const subscriptionId =\n process.env[\"APPSERVICE_SUBSCRIPTION_ID\"] || \"34adfa4f-cedf-4dc0-ba29-b6d1a69ab345\";\n const resourceGroupName = process.env[\"APPSERVICE_RESOURCE_GROUP\"] || \"testrg123\";\n const name = \"sitef6141\";\n const siteEnvelope = {\n kin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform a deleteVideo request
function deleteVideo(videoName) { var requestData = '{' + '"command" : "deleteVideo",' + '"arguments" : {' + '"video" : "' + videoName + '"' + '}' + '}'; makeAsynchronousPostRequest(requestData, refresh, null); // Defined in "/olive/scripts/master.js". }
[ "function deleteVideo(req, res){\n var id = req.params.id;\n var remaining = videoModel.deleteVideo(id);\n res.json(remaining);\n }", "function deleteVideo() {\n axios\n .delete(`${config.apiUrl}/api/v1/video/${props.videoId}`)\n .then(() => {\n history.goBa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that posts colorbox data to the 'createuser' controller
function submitUser() { //set the colorbox data to certain variables var username = $('.submit-user-wrapper input#first-name').val() + $('.submit-user-wrapper input#last-name').val(); var password = username; var email = $('.submit-user-wrapper input#email').val(); var phone = $('.submit-user-wrappe...
[ "function user_create_form() {\n /* Request Configuration Params */\n var url = \"/users/signup\";\n var method = GET;\n var paramStr = null;\n\n ajaxRequestHandler(url, method, paramStr);\n}", "function createUser() {\n let usern = $('#usernameFld').val();\n let pswd = $('#pa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the selection to employees array and fades it out
function selectEmployee(selection) { employees.push(selection.attr('src')); selection.addClass('fade'); }
[ "function showSelectedEmployee(event, value) {\n if (value) {\n const employeeToDisplay = props.unassignedWorkers.filter((em) => em.id === value.id);\n setDisplayEmployee(employeeToDisplay[0]);\n } else {\n setDisplayEmployee(value);\n }\n }", "function prev(){\n let current = employeesA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trata o evento de adicionar items. Se a estrutura for alterada aqui, mudar tambem a leitura das gEntradas que depende da ordem dos doms.
function ClickAdicionarItem(tipo_item) { gEntradas[tipo_item].push({ chave: '', em_uso: false }); AtualizaGeralSemLerEntradas(); }
[ "function AdicionaItem(tipo_item, div, div_pai) {\n var input_em_uso = CriaInputCheckbox(false);\n input_em_uso.name = 'em_uso';\n input_em_uso.addEventListener('change', {\n tipo_item: tipo_item,\n handleEvent: function(e) {\n ClickUsarItem(this.tipo_item, e.target); } });\n div.appendChild(in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to fabricate and return the id of the fabricated object So instead of: Fabricator.fabricate('organization').then(o => o.id) You can do: Fabricator.fabGetId('organization')
static fabGetId(name, customAttr) { return Fabricator.fabricate(name, customAttr).then(obj => obj.id); }
[ "_getId(o) {\n return crypto.createHash('sha1').update(JSON.stringify(o)).digest('hex');\n }", "getRelationshipId() {}", "getId() {\n const parent = this.getParent();\n return parent ? `${parent.getId()}/${this.getInternalId()}` : this.getInternalId();\n }", "SET_FORMATI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
= Description Default startDrag event responder method. Sets internal flags by default. This is the preferred method to extend if you want to do something when a drag event starts. If you extend, remember to call +this.base();+ = Parameters +x+:: The horizontal coordinate units (px) of the mouse cursor position. +y+:: ...
startDrag(x, y) {}
[ "function dragStart(e) {\n //setting the initial position of our pointer\n if (e.type === \"touchstart\") { // is it a touch event?\n initialX = e.touches[0].clientX - xOffset;\n initialY = e.touches[0].clientY - yOffset;\n } else { // if ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get DFS Slates by Date / / The date of the game(s). Examples: 2017DEC01, 2018FEB15.
getDFSSlatesByDatePromise(date){ var parameters = {}; parameters['date']=date; return this.GetPromise('/v3/nba/projections/{format}/DfsSlatesByDate/{date}', parameters); }
[ "getDfsSlatesByDatePromise(date){\n var parameters = {};\n parameters['date']=date;\n return this.GetPromise('/v3/soccer/projections/{format}/DfsSlatesByDate/{date}', parameters);\n }", "getDfsSlatesByDatePromise(date){\n var parameters = {};\n parameters['date']=date;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new topic with name, type (optional) and description (optional). If "create" option is "unless_exists", the constraints will be on the name and type (and not the type's included_types). Also, if topic exists with a description, it's description will be updated if description is specified. If "included_types" o...
function create_topic(options) { var o; try { o = { name: validators.String(options, "name", {required:true}), type: validators.MqlId(options, "type", {if_empty:""}), included_types: validators.StringBool(options, "included_types", {if_empty:true}), description: validators.String(option...
[ "function createTopic() {\n// Creates a new topic\n pubsub\n .createTopic(topic)\n .then(results => {\n const topicResult = results[0];\n console.log(`Topic ${topicResult} created.`);\n// Once the topic is created, create a subscription to pai...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Highlight playable cards in hand
function highlightCards() { let playCard = $('.game button[name="play_card"]'); if (playCard.length === 1 && playCard.val() === 0) { // case 1: single play card button mode is active if ($('.game__hand.my-hand .selected-card').length === 0) { // case 1: highlight playable cards $('....
[ "function doCardHighlighting() {\n for (let sprite of cardSprites) {\n if (isSelectionCardHovering(sprite)) {\n sprite.tint = 0x990000;\n } else {\n sprite.tint = 0xFFFFFF;\n }\n }\n}", "function highlightCards () {\n const cl = createKnown()\n const diff = $(cl).not(knownList).get()\n $('...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call bindNumber or bindString appropriatly
bindValue(val, pos) { if (pos == null) { pos = this.pos++; } switch (typeof val) { case "string": return this.bindString(val, pos); case "number":case "boolean": return this.bindNumber(val+0, pos); case "object": if (val === nul...
[ "async _processExecuteBind(bindInfo, bindData) {\n\n // setup defaults\n bindInfo.isArray = false;\n\n // if bind data is a value that can be bound directly, use it; otherwise,\n // scan the bind unit for bind information and its value\n let bindValue;\n if (this._isBindValue(bindData)) {\n b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wrapper class over the 'debugfs' command to modify Ext2/3/4 filesystems
function DebugFS(device) { if(!(this instanceof DebugFS)) return new DebugFS(device) function exec(request, write, callback) { var argv = [device, '-R', request] if(write) argv.push('-w') execFile(DEBUGFS_BIN, argv, callback) } this.ls = function(filespec, callback) { exec('ls -p '+file...
[ "function DeviceDriverFileSystem() // Add or override specific attributes and method pointers.\n{\n // \"subclass\"-specific attributes.\n // this.buffer = \"\"; // TODO: Do we need this?\n // Override the base method pointers.\n this.driverEntry = krnFSDriverEntry;\n this.isr = null;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a subreddit from the exclude list on the options page and in the preferences.
removeSubredditFromExcludeList(event) { /* Retrieve the subreddit item that will be removed. */ let subredditElement = event.target.parentNode; /* Remove the item from the preferences file. */ this.excludedSubreddits.splice(this.excludedSubreddits.indexOf(subredditElement...
[ "addItemToExcludeList(event) {\n /* Retrieve the subreddit name from the text field, and add it to the list. */\n let subredditName = this.excludeSubredditsField.value;\n this.addSubredditExclusionItem(subredditName, true);\n /* Add the subreddit name to the list in prefe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
override the deleteRemoteModel feature by forcing for some moment the sync of a specific field
async deleteRemoteSpecificField(collection, model_name) { let was = this.getServerInstance().sync_models; this.getServerInstance().sync_models = [model_name]; // this calls uses the global SYNC_MODELS to know which models should go on backend let result = await this.deleteRemoteModel(co...
[ "function deleteLocal(model, opt) {\n\tif (model instanceof Backbone.Collection) {\n\t\t// Call \"delete\" on every element if this is a Collection\n\t\treturn Q.all(model.map(function(mod) {\n\t\t\treturn Q.promise(function(resolve, reject) {\n\t\t\t\t// TODO try/catch?\n\t\t\t\tremoveInfo(mod);\n\t\t\t\t_.each(ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function which gets added to the function for the click listener on the microblog_icons
function clickMicroblogIcon(e) { var room = e.features[0].properties.room; var microblog = null; for (var i = 0; i < microblogs.length; i++) { if (room === microblogs[i].room) { microblog = microblogs[i]; ...
[ "function clickMicroblogIcon(e) {\n var room = e.features[0].properties.room;\n var microblog = null;\n for (var i = 0; i < microblogs.length; i++) {\n if (room === microblogs[i].room) {\n microblog = microblogs[i];\n }\n }\n\n Microblo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
takes a 'transition string' and returns a d3 transition method default is easeLinear
getTransitionMethod (transition) { switch (transition) { // ease linear case "easeLinear": return d3EaseLinear; break; // easeQuadIn as d3EaseQuadIn, case "easeQuadIn": return d3EaseQuadIn; break; ...
[ "function getTransition() {// Function to get transition for d3.v.6\n return d3.transition()\n .duration(750)\n //.ease(d3.easeLinear)\n}", "function transition(g) {\n return g.transition().duration(500);\n }", "function GTransition( data ) {\n\tthis.duration = 0.2 ;\n\tthis.easing = 'lin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up factor 1 and factor 2 listeners so that appropriate information is displayed in the factor card of each sample.
function set_factor_to_sample_listeners(design_1_radio, design_2_radio, design_inputs) { var factor_1_card = design_inputs.children('.factor_card:first'); var factor_2_card = design_inputs.children('.factor_card:last'); set_factor_card_to_sample_listener(factor_1_card, 'sa...
[ "function set_factor_card_to_sample_listener(factor_card,\n sample_factor_group_class_name,\n other_factor_card,\n prefix) {\n var name_div = factor_card.find('.factor_name_inputs');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Because of the left and transfer panes resizing options, we are now implementing the UI layout logic here, instead of the original code from the styles.css. The main reason is that, the CSS is not able to correctly calculate values based on other element's properties (e.g. width, height, position, etc). This is why we ...
function fm_resize_handler() { // transfer panel resize logic var right_pane_height = ($('#fmholder').outerHeight() - ($('#topmenu').outerHeight() + $('.transfer-panel').outerHeight())); $('.fm-main.default').css({ 'height': right_pane_height + 'px' }); $('.transfer-scrolling-table').css({ ...
[ "handleResize() {\n\n\t\tthis.layoutMarginals();\n\n\t}", "function adjustLayout() {\n\t\n\t minHeight = 620;\n\t minWidth = 900;\n\t\n\t var width;\n\t var height;\n\t\n\t if (VIEWPORT_WIDTH < minWidth && VIEWPORT_HEIGHT > minHeight) {\n\t width = minWidth;\n\t height = VIEWPORT_HEIG...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hides all text areas for the customization sections.
function hideTextAreas() { for (let i = 1; i < customizationSections.length - 1; i++) { document.getElementById(customizationSections[i] + "_desc").style.display = "none"; } }
[ "hideTextMenu() {\n this.textTag.css(\"height\", \"0%\");\n $(this.codeMirror.container).hide();\n this.textSidebarTag.hide();\n this.textTag.hide();\n }", "function hideAllPanes() {\n hideInformation();\n hideIndicators();\n }", "function hideAllContent() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
assignKeybinds Sets keybinds to the keyboard
assignKeybinds() { //KEYBOARD INPUT this.room2_key_W = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.W); this.room2_key_A = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.A); this.room2_key_S = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.S); t...
[ "function setup_keybinds()\n{\n Mousetrap.bind( [ 'command+shift+k', 'ctrl+shift+k' ] , function(e)\n {\n open_switcher();\n });\n}", "assignKeybinds() {\n //KEYBOARD INPUT\n this.key_W = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.W);\n this.key_A = this.input.k...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override widget's default show() to refresh content every time Git widget is shown.
show() { super.show(); this.component.refresh(); }
[ "function updateWidget()\n {\n //todo\n }", "function displayWidget () \n{\n\tif(!window.TGS || !TGS.IsReady())\n\t{\n\t\treturn;\n\t}\n\n\tinitWidget();\n}", "_onCurrentChanged(sender, args) {\n const oldWidget = args.previousTitle\n ? this._findWidgetByTitle(args.previou...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Piracy obeys a similar approximation of the inverse square law, just as patrols do, but piracy rates peak at the limit of patrol ranges, where pirates are close enough to remain within operating range of their home base, but far enough away that patrols are not too problematic.
piracyRate(distance = 0) { const radius = this.piracyRadius(); distance = FastMath.abs(distance - radius); let rate = this.scale(this.faction.piracy); const intvl = radius / 10; for (let i = 0; i < distance; i += intvl) { rate *= 0.85; ...
[ "calculatePi() {\n let result = 0.0;\n let divisor = 1.0;\n for (let i = 0; i < 2000000000; i++) {\n if (i % 2) {\n result -= 4 / divisor;\n } else {\n result += 4 / divisor;\n }\n divisor += 2;\n }\n return result;\n }", "function calculatePi(precision) {\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
disable close button and send sms to friends button is poll is closed
function checkIfPollClosed() { if (!result.is_open) { // $('.list-group').remove(); $('.close-poll').remove(); $('.friends-button').remove(); $('#is-poll-closed-text').text('Poll is closed'); } }
[ "function chatBoxClose(){\n\tnanuTalk.style.display='none';\n\tchatAreaShow.style.display='none';\n\tsendBtn.disabled=false;\n}", "bindMsgBoard() {\n this.$app.find('.fb-close').off('click').on('click', ()=>{\n this.hideMsgBoard();\n });\n }", "function reject_answer() {\r\n\r\n send({\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loads in all the CSV files of companies that are checked
function initCSV() { var all = $('#chkAllCompanies').is(':checked'); var caltex = $('#chkCaltex').is(':checked'); var shell = $('#chkShell').is(':checked'); var BP = $('#chkBP').is(':checked'); var mobil = $('#chkMobil').is(':checked'); var filter = {}; if (!$('#chkAllFuel').is(':checked')) ...
[ "function getCsvFiles() {\n\tlet path = '../data/';\n\tvar fs = require('fs');\n\tvar files = fs.readdirSync(path);\n\t\n\tfiles.forEach(function(filename) {\n\t\tif (filename.split('.').pop() == \"csv\") {\n\t\t\topenFile(filename.split('.')[0], path+filename);\n\t\t}\n\t});\n}", "function storeCompanies(compani...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to give animation while implementing dijkstra with slow speed
animateDijkstraSlow(visitedNodesInOrder, nodesInShortestPathOrder) { for (let i = 1; i <= visitedNodesInOrder.length-1; i++) { if (i === visitedNodesInOrder.length-1) { setTimeout(() => { this.animateShortestPath(nodesInShortestPathOrder); }, 500 * i); return; } e...
[ "function animateDijs() {\n const visitedNodes = dijkstra(nodes, startingPoins, endPoint);\n //dijsktra returna vse visited nodese\n //loopamo skozi vsakega in mu dodamo class listo visited z delajom\n for (let i = 0; i < visitedNodes.length; i++) {\n setTimeout(() => {\n const element = visitedNodes[i]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
C3496Endre passord ugyldig gammelt passord
function endrePassUgyldigGammelt() { Aliases.hovedmeny.linkMinProfil.Click(); endrePassord(func.random(8), testData.endreInfo.passord); Aliases.pageEndrePassord.buttonEndrePassord.Click(); aqObject.CheckProperty(Aliases.pageEndrePassord.feilmeldingBytte, "contentText", cmpContains, "Beklager, bytte ...
[ "passendeUtstyr() {\n // Bruker typen til å hente ut utstyrstypene som passer med sykkeltypen\n s_restriksjon.HentPassendeUtstyr(this.type, minusUtstyr => {\n this.minusUtstyr = minusUtstyr;\n });\n }", "function beregnForbruk() {\n regnUtForbruk(26);\n }", "function XujWkuOtln(){return 23;/*...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a function that will return a random number between 532 and 13267. Test it.
function randomNum_532_13267(){ return Math.random()*(13267-532)+532; }
[ "function getRandomNum() {\n return Math.floor(Math.random() * 10000);\n}", "function getRandomNum() {\r\n\treturn Math.floor(Math.random() * 1e13);\r\n}", "function getRandomNum() {\n return Math.floor(Math.random() * 5);\n}", "function randomNum () {\n return Math.floor((Math.random() * 5000)+1);\n}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Patch taxonomy by id. If the metadata field is provided, existing metadata fields would be updated and new metadata fields would be added.
async function patch (id, entity, auth) { const instance = await dbHelper.get(Taxonomy, id) if (entity.metadata) { const inputFields = Object.keys(entity.metadata) const existingFields = Object.keys(instance.metadata) const sharedFields = _.intersection(inputFields, existingFields) if (inputFields...
[ "async update({ params, request }) {\n\t\tconst { id } = params;\n\t\tconst upTaxonomy = await Taxonomy.getTaxonomy(id);\n\t\tconst { taxonomy, description } = request.all();\n\t\tupTaxonomy.merge({ taxonomy, description });\n\t\tawait upTaxonomy.save();\n\t\treturn Taxonomy.query()\n\t\t\t.where('id', upTaxonomy.i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Array: slice() The first parameter specifies the start index (included) and the second parameter specifies the end index (excluded). The original array will not be modified. Write a function halve that copies the first half of an array. With an odd number of array elements, the middle element should belong to the first...
function halve(anArr) { let a = Math.round((anArr.length)/2); return anArr.slice(0, a); }
[ "function halve (num) {\n var myArray = num;\n // var halfArray = myArray.length / 2 + 1;\n if (myArray.length % 2 !== 1) { //Array par\n var halfArrayPar = myArray.length / 2;\n return myArray.slice(0, halfArrayPar)\n } else { // Array impar\n var halfArrayImpar = myArray.length / ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check the new coords are within the bounds of Mars
checkMarsBounds(coords) { let out_of_bounds = false; if ((coords['x'] > this.marsBounds['x']) || (coords['y'] > this.marsBounds['y'])) { // if new coords are out of bounds, add 'scent' this.robotScents.push(coords); this.robotPosition.push('LOST'); out_of_...
[ "inBounds(loc) {\n if (loc.getRow() >= 0 && loc.getRow() <= 19 &&\n loc.getColumn() >= 0 && loc.getColumn() <= 19)\n return true;\n else\n return false;\n }", "function MoleCoordsOK(x, y) {\n /* IMPORTANT: This loop will FAIL if:\n molexTotal.length != mole...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Concat et2 name together, eg. et2_concat("namespace","test[something]") == "namespace[test][something]"
function et2_form_name(_cname,_name) { var parts = []; for(var i=0; i < arguments.length; ++i) { var name = arguments[i]; if (typeof name == 'string' && name.length > 0) // et2_namespace("","test") === "test" === et2_namespace(null,"test") { parts = parts.concat(name.replace(/]/g,'').split('[')); } } va...
[ "function getJoinedConcatParts(node, scope) {\n return node.value.parts.map((part) => getPartValue(part, scope)).join('');\n }", "function merge(el1, el2) {\n return el1.concat(' ' + el2); \n}", "function joinNamespace(namespace, name) {\n if (namespace && name) {\n return [namespace, name].j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Promotion analytics for upgrade messages on course home. eslintdisablenextline classmethodsusethis
configureUpgradeAnalytics() { $('.btn-upgrade').each( (index, button) => { const promotionEventProperties = { promotion_id: 'courseware_verified_certificate_upsell', creative: $(button).data('creative'), name: 'In-Course Verification Prompt', position: $(button)...
[ "calculateUpgradeIncrease() {\n const upgrades = Object.values(this.upgrades);\n let upgradeProductivity = 0;\n upgrades.forEach((upgrade) => {\n if (upgrade.bought) {\n upgradeProductivity += upgrade.productivity;\n }\n });\n this.upgradeIncrease = upgradeProductivity;\n }", "upg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. loadAboutScreen function is being called from the about button click on the landing screen 2. Purpose of this function is to initialise the about screen and load various elements of the screen 3. It takes no arguments 4. Usage Example: 5. Function Call loadAboutScreen() 6. Data returned No data returned
function loadAboutScreen() { //add background class to body addBackground(); //destroy previous page's back button, if any destroyBackButton(); //empties the contents of game-display-div which is the wrapper div of the game UI clearDisplayDiv(); //assigns the element with id 'game-display-di...
[ "function run () {\n if (m.debug > m.NODEBUG) { console.log('screens.aboutScreen.run'); }\n \n // one-time initialization\n if (needsInit) {\n // draw logo\n var $canvasBox = $('#aboutLogoBox');\n m.logo.drawLogo($canvasBox, false, 0, 0, 0);\n\n $('#aboutMenuButton')\n // navi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
change the dateValue, beginTime, endTime by direction and periodType.
function changeDateHandler(direction){ if(direction < 0){ direction = -1 }else{ direction = 1 } if (periodType == 'day') { dateValue = moment(dateValue).add(1*direction, 'days').format('YYYY-MM-DD') updateDayBeginEndQueryTime() } else if (periodType == 'week'...
[ "function changeDate(newDate) {\n if (periodType == 'day') {\n \tconsole.log('changeDate day')\n dateValue = moment(newDate).format('YYYY-MM-DD')\n updateDayBeginEndQueryTime()\n }else if(periodType == 'week'){\n console.log('changeDate week')\n \t\tdateValue = getWeekBeginDate(new Date(mom...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `CfnApiProps`
function CfnApiPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); errors.collect(cdk.propertyValidator('accessLogSetting', CfnApi_AccessLogSettingPropertyValidator)(properties.accessLogSetting)); errors...
[ "function CfnRestApiPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('apiKeySourceType', cdk.validateString)(properties.apiKeySourceType));\n errors.collec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the value of the query param at the start of the string or an empty string
function matchUrlQueryParamValue(str) { var match = str.match(QUERY_PARAM_VALUE_RE); return match ? match[0] : ''; }
[ "function matchUrlQueryParamValue(str) {\n var match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n }", "function matchUrlQueryParamValue(str) {\n const match = str.match(QUERY_PARAM_VALUE_RE);\n return match ? match[0] : '';\n}", "function matchUrlQueryParamValue(str) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the colors of all the tiles in the window
function updateTiles() { forEachTile(function update(row, col) { setTimeout(function () { tileColor = jQuery.Color().hsla({ hue: (tileColor.hue() + (Math.random() * tileMaxHueShift)) % 360, saturation: tileMinSaturation + (Math.random() ...
[ "function updateTileColor() {\r\n var grid, i, count;\r\n\r\n grid = this;\r\n\r\n for (i = 0, count = grid.allNonContentTiles.length; i < count; i += 1) {\r\n grid.allNonContentTiles[i].setColor(config.tileHue, config.tileSaturation,\r\n config.tileLightness);\r\n }\r\n }", "function n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When a picture is removed, all pictures are reorganized
function reorganizeImgs(ImgToRemove) { let $individual = findSelectedIndividuals()[0]; let miniPics = []; $('#mini .miniPic').each(function() { miniPics.push($(this).css('background-image')); }); miniPics.splice(miniPics.indexOf(ImgToRemove), 1); $('#miniBottom').empty(); $('#miniSid...
[ "function tryDeleteAgain() {\n deleteResizedImage();\n }", "function removePics() {\r\n\t\tpicsContainer.innerHTML= '';\r\n\t\tsumButtonSwitch();\r\n}", "function clearImages() {\n let photos = id(\"pictures\").children;\n while (photos.length > 0) {\n photos[0].remove();\n }\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2. Register the task at some point in your app by providing the same name, and some configuration options for how the background fetch should behave Note: This does NOT need to be in the global scope and CAN be used in your React components!
async function registerBackgroundFetchAsync() { // console.log('registering background fetch...') return BackgroundFetch.registerTaskAsync(BACKGROUND_FETCH_TASK, { minimumInterval: 60 * 15, // 15 minutes stopOnTerminate: false, // android only, startOnBoot: true, // android only }) }
[ "async function registerBackgroundFetchAsync() {\n const { status } = await Location.requestBackgroundPermissionsAsync();\n if (status === 'granted') {\n await Location.startLocationUpdatesAsync(BACKGROUND_FETCH_TASK, {\n accuracy: Location.Accuracy.Highest,\n timeInterval: 15000,\n distanceInte...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Diffs files in a source directory against a destination directory.
function diffFiles(libConfig) { libConfig.files.forEach((file) => { const dir = path.parse(file).dir; gulp.src(libConfig.src + file) .pipe(diff(libConfig.dest + dir)) .pipe(diff.reporter({ fail: true, quiet: true })) .on('error', () => { console.error(new Error( // eslint-disable-li...
[ "function diffFiles(libConfig) {\n libConfig.files.forEach(function (file) {\n var dir = path.parse(file).dir;\n\n gulp.src(libConfig.src + file)\n .pipe(diff(libConfig.dest + dir))\n .pipe(diff.reporter({ fail: true, quiet: true }))\n .on('error', function (error) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called from dcallback <service.getDetails(request, dcallback)<Save_checked_links_Button to recreate a lkoptions link list on LinkOption page out of localStorage
function displayLinks() { initiate_geolocation(); $('#lkoptions').empty(); for(var i=0, len=localStorage.length; i<len; i++) { console.log(i); var key = localStorage.key(i); if (key.substr(0,4)=='LINK') { var value = localStorage[key]; var lobj =JSON.parse(value); console.log('r...
[ "function saveLinksToLocalStorage(){\n //localStorage.removeItem('links');\n localStorage.setItem('links', JSON.stringify(modelController.storage.getAllLinks()));\n }", "function saveLinksList () {\n $('<div></div>').addClass('g-overlay').height($(document).height()).appendTo('body...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
04. First and Last K Numbers
function firstAndLastKNumbers(arr) { let k = arr.shift(); console.log(arr.slice(0, k).join(' ') + '\n' + arr.slice(arr.length - k).join(' ')); }
[ "function firstAndLastKNumbers (input) {\n let count = input.shift();\n\n console.log(input.slice(0, count).join(' '));\n console.log(input.slice(input.length - count, input.length).join(' '));\n}", "function lastKNumbersSequence(n, k) {\n\tlet res = [1];\n\tfor (var i = 1; i < n; i++) {\n\t\tres.push(res.slic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Produces the SAS permissions string for an Azure Storage account. Call this method to set AccountSASSignatureValues Permissions field. Using this method will guarantee the resource types are in an order accepted by the service.
toString() { // The order of the characters should be as specified here to ensure correctness: // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas // Use a string array instead of string concatenating += operator for performance const permissions = []...
[ "static parse(permissions) {\n const accountSASPermissions = new AccountSASPermissions();\n for (const c of permissions) {\n switch (c) {\n case \"r\":\n accountSASPermissions.read = true;\n break;\n case \"w\":\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a request to a link depending on the channel and then sets the mod file. The checkMod function looks at the file and returns true or false depending whether the person specified is in the mod.json file.
function getMods(chanel) { var channel = getUser(chanel); //Get the absolute username try { var modsFile = JSON.parse(fs.readFileSync('mod.json', 'utf8')); // Read the modsfile } catch (err) { //If there is an error, rewrite with a useable default var def = "{}"; fs.writeFile('mod.json', J...
[ "function SetModChannel(){\n modchannel = client.channels.find(\"name\", config.modchat);\n modChannelID = modchannel.id;\n}", "IsMod(channel) {\n if (this._selfUserState(channel, \"mod\")) return true;\n if (this._hasBadge(channel, \"moderator\")) return true;\n return false;\n }", "function checkI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
constructors Initialize the new instance for `PdfPage` class.
function PdfPage(){var _this=_super.call(this,new PdfDictionary())||this;/** * Stores the instance of `PdfAnnotationCollection` class. * @hidden * @default null * @private */_this.annotationCollection=null;/** * Stores the instance of `PageBeginSave` event for Page ...
[ "function PdfPage() {\n var _this = _super.call(this, new PdfDictionary()) || this;\n /**\n * Stores the instance of `PdfAnnotationCollection` class.\n * @hidden\n * @default null\n * @private\n */\n _this.annotationCollection = null;\n /**\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
se crea el servicio dataService, que lo crea DataServiceProvider
function DataServiceProvider() { // Crea un dataService this.serviceUrl = null; //this.setConfig = function (serviceUrl) { // Por si se le llama desde fuera del proyecto // this.serviceUrl = serviceUrl; //}; this.$get = get; get.$inject = ['$http']; function g...
[ "function getDataService() {\n // set the data service endpoint\n return new breeze.DataService({\n serviceName: window.location.protocol + '//' + window.location.host + '/odata/'\n });\n }", "function createSemanticDataServices() {\n const SemDatSrvs = new SemanticDataServices(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use the module reference to determine which scripts apply to the current page.
function loadModulesByPage(page, getVariables) { page = page || ""; var modulesToLoad = pageReference[page]; if (modulesToLoad) { for (var i = 0; i < modulesToLoad.length; i++) { var module = modulesToLoad[i]; if (!(module.key) || moduleEnabled(module.key...
[ "function call_support_scripts(AD_PRIVACY){\n // (this one is just a test)\n // if (browser.Chrome){\n // var support_url = '/chrome_support'\n // var support_script = document.createElement(\"script\");\n // AD_PRIVACY.scripts_needed++;\n // support_script.src = DOMAIN_ROOT + support_url ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
After you've run setupInitialProperties(), you can run this function from the Run menu to search and tweet just one Tweet. This happens independently of the timed running if you've already run start().
function doWorkflow() { var props = PropertiesService.getScriptProperties(); var twit = new Twitterlib.OAuth(props); var i = -1; var tweets = searchTweets(twit); if(tweets) { for(i = tweets.length - 1; i >= 0; i--) { if(sendTweet(tweets[i].id_str, tweets[i].text, twit)) { ScriptPropertie...
[ "function startSearch() { // searches for last tweet/retweet from @arielengle & calls retweetAriel()\n console.log(\"startSearch: Initialized\");\n eventParams = {\n q: \"arielengle\",\n count: 1\n }\n\n T.get(\"search/tweets\", eventParams, startData);\n\n function startData(err, data, response) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
funcion que maneja todos los movimientos de la tienda, ya sea aumentar, reducir, y calcular el costo total item 0: chamarra $5000 item 1: lentes de sol $2000 item 2: cachito del avion $500 item 3: le dice a la funcion que el usuario quiere saber cuanto es el total de su carrito, incluido el iva
function carrito(item, add) { if (item == 0 && add == 0 && aItem > 0) { aItem--; aStr = "" + aItem; document.getElementById("cantidad1").innerHTML = "Cantidad: " + aStr; } if (item == 0 && add == 1) { aItem++; aStr = "" + aItem; document.getElementById("cantid...
[ "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upload function: upload IC pic to storage
function uploadToStorage(file, location, userId) { // Create the file metadata var metadata = { contentType: 'image/jpeg' }; // Upload file and metadata to the object 'images/mountains.jpg' var uploadTask = location.put(file, metadata); // Listen for state changes, errors, and completion of the upload. ...
[ "function _cloudKitUpload(cb){\n ckassetService.request()\n .then( tokenResponseDictionary => {\n var data = new Uint8Array(this.croppedImageData);\n\n ckassetService.upload(tokenResponseDictionary.data.tokens[0].url, data, 'image/png', assetDictionary => {\n this.recordName = tokenResponseDi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Container Object name: Name of Game type String image: Link to thumbnail image type String link: Link to 'store' page type String Gets the url's for a genre/category search, then calls both api's and processes the data
async function searchByGenre(genQuery, catQuery) { let vgUrl = getVideoGameUrl({ type: "genres", value: genQuery }); let pageLimit = 2; let totalResults = []; let resultList = []; const rawgResp = await fetch(vgUrl); const rawgResults = await rawgResp.json(); setLoadingText(); // determines the amount ...
[ "async function searchByName(query) {\n let vgUrl = getVideoGameUrl({ type: \"name\", value: query });\n let bgUrl = getBoardGameUrl({ type: \"name\", value: query });\n const rawgResp = await fetch(vgUrl);\n const rawgResults = await rawgResp.json();\n const atlasResponse = await fetch(bgUrl);\n const atlasR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an existing Device resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
static get(name, id, opts) { return new Device(name, undefined, Object.assign(Object.assign({}, opts), { id: id })); }
[ "function getDeviceState(id) {\r\n //Resolve device object of the affected device\r\n let device = null;\r\n for (let i = 0; i < deviceList.length; i++) {\r\n if (deviceList[i].id === id) {\r\n device = deviceList[i];\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
MASTER COPY CONFUSION WARNING: This function lives at conservaround.glitch.me Round x to nearest r, avoiding floating point crap like 9999.1=999.900000001 at least when r is an integer or negative power of 10. MASTER COPY CONFUSION WARNING: This function lives at conservaround.glitch.me
function tidyround(x, r=1) { if (r < 0) return NaN if (r===0) return +x const y = round(x/r) const rpow = /^0?\.(0*)10*$/ // eg .1 or .01 or .001 -- a negative power of 10 const marr = normberlize(r).match(rpow) // match array; marr[0] is whole match if (!marr) return y*r const p = -marr[1].length-1 // p ...
[ "function roundToNearest(argument) {\n}", "function tidyround(x, r=1) {\n if (r < 0) return NaN // this makes no sense and probably wants a loud error\n if (r===0) return +x // full machine precision!\n const y = round(x/r) // naively we'd just be returning round(x/r)*r but...\n const marr = r.toExpon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set onclick functions for board specified by outerY and outerX for player to play
function setOnClickFunctionsForBoard(outerX, outerY, player) { if(player1IsHuman == true && player2IsHuman == true){ if(player1Turn == true){ document.getElementById("playerTurn").innerHTML = "Player 1's turn."; document.getElementById("playerTurn").style.color = "red"; player1Turn = false; } else{ docu...
[ "function setOnClickFunctionsForBoard(outerX, outerY, player)\r\n{\r\n //Set onclick functions for unselected cells in current inner board\r\n for(var i = 0; i < 3; i++)\r\n {\r\n for(var j = 0; j < 3; j++)\r\n {\r\n //Set onclick for this cell to call markCellForPlayer if cell is ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END getNoAccessNotification START getCustomNotification
function getCustomNotification(customMsg) { var resultMsg = customMsg, customMsgT = '<ul class="ASWidget-customMsg-Ul"><li class="normalPostEntryItem">' + $('<div/>').addClass('container-ASWidgetAlert').append(createAlert(resultMsg, 'danger'))[0].outerHTML + '</li></ul>'; return customMsgT; }
[ "onNotification(notification) {}", "getNotification() {\n if (this.displayModel) {\n return super.getNotification();\n } else {\n return {};\n }\n }", "function getNoAccessNotification() {\n\t\t\tvar resultMsg = localizeString(\"ASWidget-no-access-to-entries\", \"You do not have permission t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Module object that gets automatically instantiated & linked to the appropriate framework. When using the 'singleDevice' framework it is instantiated as sdModule.
function module() { this.moduleConstants = {}; this.startupData = {}; this.moduleName = ''; this.moduleContext = {}; this.activeDevice = undefined; /** * Function is called once every time the module tab is selected, loads the module. * @param {[type]} framework The active fram...
[ "function module() {\n this.moduleConstants = {};\n this.REGISTER_OVERLAY_SPEC = {};\n this.startupRegList = {};\n this.interpretRegisters = {};\n this.startupRegListDict = dict();\n\n this.moduleContext = {};\n this.activeDevice = undefined;\n this.deviceInfo = {\n type: '',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Alias for `getArgTC()` but returns statically checked InputTypeComposer. If field have other type then error will be thrown.
getArgITC(argName) { const tc = this.getArgTC(argName); if (!(tc instanceof InputTypeComposer)) { throw new Error(`Resolver(${this.name}).getArgITC('${argName}') must be InputTypeComposer, but recieved ${tc.constructor.name}. Maybe you need to use 'getArgTC()' method which returns any type composer?`); ...
[ "getFieldArgITC(fieldName, argName) {\n const tc = this.getFieldArgTC(fieldName, argName);\n\n if (!(tc instanceof InputTypeComposer)) {\n throw new Error(`${this.getTypeName()}.getFieldArgITC('${fieldName}', '${argName}') must be InputTypeComposer, but recieved ${tc.constructor.name}. Maybe you need to ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns the actionsclass for a specific action
function getActionClass(action) { if(actions.indexOf(action) !== -1) { return 'action'; } if(movements.indexOf(action) !== -1 ) { return 'movement'; } return 'invalid'; }
[ "function ActionType() { }", "function getAction()\n{\n\treturn this.action;\n}", "function getAction() {\n\t\treturn new Action();\n\t}", "function actionCreator() {return action}", "function actionCreator(){\n return action;\n }", "function actionCSSClass(action) {\n \tvar htmlClass = '';\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates and array of notes that fit the height and pitch of the loopboard
function generateNotes(eigth, rows) { eigth = Number(eigth); let dur = ['c', 'd', 'e', 'f', 'g', 'a', 'b']; let notes = []; let listpos = 0; for (let i = 0; i<rows; i++) { if (i > 0 && i%7 === 0) { eigth += 1; listpos += 7; } notes.push(dur[i-listpos]+eigth.toString...
[ "function createNoteList(numNotes) {\n\t\t// generate random starting heights for the notes, ensuring no overlap\n\t\tvar startingHeights = [];\n\t\t// build a list of possible starting heights\n\t\tvar maxHeight = 250 * numNotes;\n\t\tvar heightList = [];\n\t\tfor (i = 200; i < maxHeight; i += 200) {\n\t\t\theight...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }