query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Funcao: MoviePlay(string) Descricao: Inicia o Video Parametros: 1 Nome do Obj Windows Media (String) Exemplo: MoviePlay('WMP');
function MoviePlayV6(wm) { mObj = eval(dc + wm) if(mObj.PlayState==1) { mObj.Play(); } else if (mObj.PlayState==2) { mObj.Pause(); } else mObj.Play(); }
[ "function MoviePlayer(){} // AppletMoviePlayer or FlashSWFMoviePlayer or FlashFLVMoviePlayer", "LoadMovie(int, string) {\n\n }", "function videoPlay () { \n player.playVideo()\n }", "function Play() {\n video.play();\n}", "function camPlayVideos(videos)\n{\n\tif (videos instanceof Array)\n\t{\n\t\t_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Born a misinterpretation of this kata, your task here is pretty simple: given an array of values and an amount of beggars, you are supposed to return an array with the sum of what each beggar brings home, assuming they all take regular turns, from the first to the last. For example: [1,2,3,4,5] for 2 beggars will retur...
function beggars(values, n) { if (n === 0) { return []; } let arr = []; for (let i = 0; i < values.length; i++) { if (arr[i % n]) { arr[i % n] += values[i]; } else { arr.push(values[i]); } } if (n > values.length) { arr = [...arr, ...new Array(n - values.length)....
[ "function beggars(values, n) {\n if (n === 0) {\n return [];\n }\n const resultsArr = [];\n let currentBeggar = 0;\n\n values.forEach(amount => {\n resultsArr[currentBeggar] = resultsArr[currentBeggar]\n ? resultsArr[currentBeggar] + amount\n : amount;\n currentBeggar++;\n if (currentBegg...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decreases the line count according to the given text that was unconsumed by the lexer.
_decLineCount(unconsumedText) { this._lineNum -= util.countSubstring(unconsumedText, '\n'); }
[ "_incLineCount(consumedText) {\n this._lineNum += util.countSubstring(consumedText, '\\n');\n }", "skipAheadBy(numChars) {\n const prevPos = this._pos;\n this._pos += numChars;\n if (this._pos > this._text.length) {\n this._pos = this._text.length;\n }\n // Pass the consume...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This changes the opacity of the "X" background based on the scroll
function backgroundOpacity(scrollPercent, background) { let opacity = 100 - 7 * scrollPercent; opacity = opacity.toFixed(2); //The opacity change stops at 30% if (opacity >= 30) { background.style.opacity = `${opacity}%`; } else { background.style.opacity = "30%"; } }
[ "function bgOpacityScroll(){\n\t\tvar scrolled = $(window).scrollTop();\n\t\tvar bgHeight = $('#bg-image').height();\n\t\tvar scrolledPercent = ((bgHeight - scrolled) / bgHeight);\n\n\t\tvar k = Math.min(1 - scrolledPercent, 0.6);\n\n\t\t$('.navbar-fixed-top').css('background-color','rgba(101,101,90,'+k+')');\n\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The constructor sets the intial "state" of the store, as well as any dependencies "deps" with other stores.
constructor(state = {}, deps = []) { super(); // Stores the state and dependencies. The "deps" // property is actually required by the // dispatcher. this.state = state; this.deps = deps; // Registers the store with the dispatcher. register(this); }
[ "init() {\n if (this._store) throw new Error('Store is already initiated, you cannot initiate it twice.');\n\n this._store = Redux.createStore(this._reducer.bind(this), this._initialState, this._enhancer);\n }", "__initStore() {\n this.state = {\n env: this.env,\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
resize to specific width and height, but keep aspect. callback should have signature (err, buffer).
function resizeKeepAspect(buffer, origin_width, origin_height, resize_width, resize_height, callback) { if (origin_width * resize_height === origin_height * resize_width && origin_width <= resize_width) { console.log('no need to resize!'); return callback(null, buffer); } var img = g...
[ "function resize(src, dst, width, height, callback) {\n\tconsole.log(\"src: \" + src);\n\tconsole.log(\"dst: \" + dst);\n\tlet dim = width + 'x' + height;\n\tconsole.log(\"dim: \" + dim);\n\n\tconst { exec } = require(\"child_process\");\n\texec(path.join(__dirname, 'aspectcrop.sh') + \" -a 4:3 \" + src + \" \" + d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
head :: Foldable f => f a > Maybe a . . Returns Just the first element of the given structure if the structure . contains at least one element; Nothing otherwise. . . ```javascript . > S.head ([1, 2, 3]) . Just (1) . . > S.head ([]) . Nothing . . > S.head (Cons (1) (Cons (2) (Cons (3) (Nil)))) . Just (1) . . > S.head (...
function head(foldable) { // Fast path for arrays. if (Array.isArray (foldable)) { return foldable.length > 0 ? Just (foldable[0]) : Nothing; } return Z.reduce (function(m, x) { return m.isJust ? m : Just (x); }, Nothing, foldable); }
[ "function head(a) {\n var first = a[Symbol.iterator]().next();\n\n if (first.done) throw new Error(\"Cannot get head of empty list\");\n return first.value;\n}", "function head(xs) {\n return(xs[0]);\n}", "function safeHead(x) {\n return Maybe.of(x[0]);\n}", "function head(xs) {\n if (is_pair(xs)) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a random number that is in the range of n bits.
function randomNBit(n) { return Math.floor(Math.random() * 2 ** n); }
[ "function rand(n) {\r\n if (n == 2) {\r\n if (!Rbits) {\r\n Rbits = 8;\r\n Rbits2 = rc4Next(randomByte());\r\n }\r\n Rbits--;\r\n var r = Rbits2 & 1;\r\n Rbits2 >>= 1;\r\n return r;\r\n }\r\n\r\n var m = 1;\r\n\r\n r = 0;\r\n while (n > ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns a list of all cell ids of the cells that border to "cell" and are of a different type a dictionairy with keys = neighbor cell ids, and values = number of "cell"pixels the neighbor cell borders to
cellNeighborsList( cell, cbpi ) { if (!cbpi) { cbpi = this.cellborderpixelsi()[cell] } else { cbpi = cbpi[cell] } let neigh_cell = [] let neigh_cell_amountborder = {} //loop over border pixels of cell for ( let cellpix = 0; cellpix < cbpi.length; cellpix++ ) { //get neighbouring pixels of borderp...
[ "function getNeighbors (cell) {\n var x = cell[0], y = cell[1];\n return [\n [x - 1, y + 1], [x, y + 1], [x + 1, y + 1],\n [x - 1, y ], [x + 1, y ],\n [x - 1, y - 1], [x, y - 1], [x + 1, y - 1]\n ];\n }", "function neighbouringCells(cell) {\n var x = getX(cell);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the ChatServer and begin handling events.
initialize() { debug("Initializing ChatServer"); const io = this.io; io.use(this._userMiddleware()); io.on(events.connection, (socket) => { this._handleNewUser(socket); socket.on(events.disconnect, this._handleDisconnect(socket)); socket.on(events.messageSent, this._handleMessageSent(s...
[ "function ServerInit() {\n\tServerSocket = io(ServerURL);\n\tServerSocket.on(\"connect\", ServerConnect);\n\tServerSocket.on(\"disconnect\", function () { ServerDisconnect(); });\n\tServerSocket.io.on(\"reconnect_attempt\", ServerReconnecting);\n\tServerSocket.on(\"ServerInfo\", function (data) { ServerInfo(data); ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for verifying communication to a device and updating app type, app name and sidebar according to the device type
function dev_replied(data) { localStorage.setItem("last_dev_ip", esp8266.ip); esp8266.name = data.device_name; esp8266.type = data.app_name; esp8266.api = data.api_version; switch (esp8266.type) { case "ESPBOT": esp8266.espbot_api = esp8266.api; break; case "SMART_TIMER": switch (es...
[ "function OnClickChangeDeviceType() {\n window.external.SetDiscoveryStopProgressFlag();// Set the flag to indicate that discovery de - initialization started.\n var label = GetControl('tdselectionMode');\n label.innerText = \" \";//remove the mode label\n window.external.DisconnectAllDevice();\n Load...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates a the gradient string that is used to change the DOM style
updateGradientString(){ let gradient = "linear-gradient(" let nrItems = 1 for (const [key, color] of Object.entries(this.colors)) { gradient += color.rgb if(nrItems == Object.keys(this.colors).length){ gradient += ")" } else { ...
[ "function currentGradient () {\n\t//css.textContent = load.style.background;\n\tcss.textContent = `linear-gradient(to right, ${color1.value}, ${color2.value})`;\n\n}", "function convertCSStext(){\n\tthis.value === \"hex\" ? \n\tcss.textContent = \"linear-gradient(to right, \" + color1.value + \", \" + color2.valu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for Load the item from the cart
function loadCart(){ cart = JSON.parse(sessionStorage.getItem('revonicCart')); // fetching original object items using JSON parse. }
[ "function loadCart() {\n cart = JSON.parse(localStorage.getItem(\"shoppingCart\"));\n }", "function loadCart() {\r\n shirtCart = JSON.parse(localStorage.getItem(\"CartItems\"))\r\n}", "function loadCartInformation() {\n // reserve cart\n // mmrCartService.cartList({\n // uid: $rootScope.$r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Main render, render other components depending on state. Map through array of Applicants (applicants) and for each applicant show applicants basic info (name, photo, place of employment, address). If applicant is chosen show more info about that applicant (experience, education and chat with admin). If showEditForm is ...
render(){ let expEduInfo = null; let chatInfo = null; let editForm = null; if(this.state.applicantMoreInfo.applicantId && this.state.showMoreInfo){ expEduInfo = <ExpEduInfo education={this.state.applicantMoreInfo.education} experience={this.state.applicantMoreInfo.experience}...
[ "render(){\n let expForm;\n if(this.state.addExperienceForm){\n expForm = <ExperienceForm onAddNewExp={this.onAddNewExperience} applicantId={this.props.id} />;\n }\n let eduForm;\n if(this.state.addEducationForm){\n eduForm = <EducationForm onAddNewEdu={this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SET Intialize an empty set Look through every value in array every time see a value, add it to seen set Check to see if value is in the seen set if it is, have found duplicate Just return the value you know this is 1st duplicate b/c you wouldn't have gotten to this point otherwise time complexity O(n) need to potential...
function firstDuplicateValue(array) { const alreadySeen = new Set(); for (let value of array) { if (alreadySeen.has(value)) return value; } return -1; }
[ "function findDup(array) {\n let seenArray = [];\n\n for (let num in array) {\n if (!seenArray.includes(array[num])) {\n seenArray.push(array[num]);\n } else {\n return array[num];\n }\n }\n return 'No duplicate';\n}", "function checkDuplicate2() {\r\n let arr = [\"abc\",\"xy\",\"bb\",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mark the tweets that the loggedin user has replied to.
function mark_my_replies() { if (!signin.authed) { return; } var me = $('#twitter-modal').data('twitter-user'); $('#tweets .replies .twittername') .filter(function isMe() { return $(this).text() === me; }) .closest('div.replies') // Walk up to parent. .closest('.twee...
[ "function tweetMentioned(tweet) {\n // Who sent the tweet?\n var name = tweet.user.screen_name;\n // What is the text?\n var txt = tweet.text;\n // the status update or tweet ID in which we will reply\n var nameID = tweet.id_str;\n\n // Get rid of the @ mention\n var txt = txt.replace(/@cel...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get elements by selector
getElementsBySelector(selector) { const ele = this.element ? this.element : this.element; return ele.querySelectorAll(`.${selector}`); }
[ "function retrieveElements(selector) {\n return document.querySelectorAll(selector);\n }", "function __( selector )\n{\n\treturn document.querySelectorAll( selector );\n\n}", "find(selector) {\n let result = [];\n for (var i = 0; i < this.htmlElements.length; i++) {\n result.concat(this.htm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create function to display flight data (if any)
function displayFlightInfo(data) { const newFlight = document.createElement("li"); newFlight.classList.add("flight-detail"); const airline = document.createElement("div"); airline.classList.add("airline"); airline.innerHTML = data.airline; newFlight.appendChild(airline); const flightNumber = document.cr...
[ "function displayFlightInfo(ident) {\n if (flightState === 1){\n console.log(\"!\")\n fill(255,216,0);\n textFont(font_2);\n textSize(12);\n textAlign(\"LEFT\");\n text(\"Date of Flight:\", width/2-500, height/2+25);\n fill(\"green\");\n text(ident.estimated_departure_time.date, width/2-350...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Raise a `BACKOFF` event for each connection in the pool.
backoff() { this.connections.forEach((conn) => conn.backoff()) if (this.backoffId) { clearTimeout(this.backoffId) } const onTimeout = () => { this.log('Backoff done') this.raise('try') } const delay = this.backoffTimer.getInterval() * 1000 this.backoffId = setTimeout(onT...
[ "abortAll( ) {\n\t\tpool.forEach( ( jqXHR, index ) => { // cycle through list of recorded connection\n\t\t\tjqXHR.abort( ); // aborts connection\n\t\t\tpool.splice( index, 1 ); // removes from list by index\n\t\t} );\n\t}", "function close_poll_connection() {\n pool_connection.end(function (err) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns image resolution similar to the base resolution according to the height you pass in
function calcRes(height) { let scaleFactor = height/baseRes[1]; let newRes = [baseRes[0]*scaleFactor, height]; return newRes; }
[ "get heightmapResolution() {}", "static GetImageScale(width, height, base)\n {\n if(width > height)\n {\n return [Math.round((width * base) / height), base]\n }\n else\n {\n return [base, Math.round((height * base) / width)]\n }\n }", "functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send a joke to the member requested it
sendJoke(name, data) { let member = Array.from(this.members).filter((user) => user.name === name); member[0].send(JSON.stringify(data)); }
[ "async function callJoke(msg) {\n try {\n var j = await jokeReceived();\n\n console.log(j);\n\n msg.channel.send('```' + j.joke + '```');\n\n } catch (error) {\n console.log(error)\n }\n }", "function chuckJoke() {\n axios.get('https://api.icndb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given completed_courses list, return array of classes with prereqs met and not taken already
function availCourses(completed_courses){ // return array var ret = []; console.log(completed_courses); // for each class in class_data, class_data.forEach(function(course){ //if course not in completed_courses or ret array, check for prereqs if(completed_courses.findIndex(c =...
[ "downstream(courses) {\n var course, j, len, res;\n res = [];\n for (j = 0, len = courses.length; j < len; j++) {\n course = courses[j];\n if (course.prereqs.includes(this) || course.coreqs.includes(this)) {\n res.push(course);\n }\n }\n return res;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show the send event modal
function popupEventSender() { // Show the modal $('#eventSenderModal').modal('show') }
[ "function showTalkModal(event, name) {\n event.preventDefault();\n document.getElementById(name).style.visibility = 'visible';\n document.getElementById(name).style.opacity = '1';\n}", "function send_sms_pool() {\n\n $(\"#sms_form_popup\").modal('show');\n}", "function openEventEnquiryModal() {\n $('#j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method expands the first expandable node on the home page. If the current page is not the home page, this method does nothing. When the path name ends with index.html or an empty string, it is home page.
function expandFirstOnHome() { const parts = location.pathname.split('/'); const lastPart = parts[parts.length - 1]; const isHomePage = (lastPart == '') || (lastPart == 'index.html'); if (isHomePage) { // expand the first expandable node in the toctree $('li.toctree-l1').has('ul').first...
[ "function goHome() {\r\n if (page.getCurPage() != 'home') {\r\n\t\tif (page.getCurPage() == \"browseStu\") {\r\n\t\t\t// remove the Browse Student Page\r\n\t\t\t$(\"#browseStuPage\").remove();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// adjust the pages that are shown\r\n\t\t\t// Hide the current page & make browse stude...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fncGetCookie =============== Get cookie value Parameters in strName string variable containing cookie name Return value string variable containing the cookie value, or default value of "NONE" if cookie does not exist
function fncGetCookie(strName) { var strSearch = strName + "="; // Check if there are any cookies if (document.cookie.length > 0) { strStart = document.cookie.indexOf(strSearch); // Check if specified cookie exists if (strStart != -1) { strStart += strSearch.length strEnd = document.cook...
[ "function getCookie(szName)\n{\n \tvar szValue =\t null;\n\tif(document.cookie)\t //only if exists\n\t{\n var arr = \t\t document.cookie.split((escape(szName) + '='));\n \tif(2 <= arr.length)\n \t{\n \tvar arr2 = \t arr[1].split(';');\n \t\tszValue = \t unescape(arr2[0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
looks for a given Note On event and sets its velocity. Returns true if succesful, false if not (i.e. Note On event does not exist).
function setNoteOnVelocity(stepNumber, instrumentIndex, noteNumber, velocity) { // restrict velocity to valid range velocity = clipInt0to127(velocity); // Safety step in case input validation is somehow missed. var searchResult = findNoteOnEvent(stepNumber, instrumentIndex, noteNumber); if (searchResult >= 0) { ...
[ "function setNoteOnEvent(stepNumber, instrumentIndex, noteNumber, velocity) {\n\tvar action = new Object();\n\taction.type = 'noteOn';\n\taction.instrumentIndex = instrumentIndex;\n\taction.noteNumber = noteNumber;\n\taction.value = clipInt0to127(velocity);\t\t\t// Safety step in case input validation is somehow mi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to run FuseBox with automatic build error trapping
function fuseRun() { return new Promise((resolve, reject) => { let _error = console.error; let errors = false; console.error = function() { errors = true; _error(...arguments); setTimeout(() => { reject(new Error('Build errors occurred')); }, 2000); ...
[ "function build() {\n throw Error('A build should not have been triggered!');\n }", "function failBuild(_a) {\n var { token, octokit } = _a, body = __rest(_a, [\"token\", \"octokit\"]);\n return __awaiter(this, void 0, void 0, function* () {\n if (process.env.ACTION_LOCAL_RUN === 'true') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
counts connections for every pixel/room and sends it to panels
function connCount(){ var connCount = [] for(var pixelid=0;pixelid<15;pixelid++){ connCount.push(null) var room = mobilesock.adapter.rooms[pixelid] if(room){ connCount[pixelid] = room.length }else{ connCount[pixelid] = 0 } } panelsock.emit('connCount',connCount) console.log(con...
[ "function connCount() {\n var connCount = []\n for (var pixelid = 0; pixelid < 50; pixelid++) {\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if (room) {\n phones = pixelid\n connCount[pixelid] = room.length\n } else {\n connCount[pixelid] = 0\n }\n }\n pa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
At points table, it adds a player to the total sum
function addPlayerPoints( playerRow ){ var totalPointsTable = document.getElementById("totalPointsTable"); //Table where the sum it is var totalPointsCell = document.getElementById("totalPointsCell"); //Cell of the total sum var temp = playerRow.textContent.split(" "); //Obtain the points o...
[ "function addPlayerTotal(player) {\n player.total += dieRollNumber;\n}", "addPlayerScore(uuid, points) {\n if (this.hasPlayer(uuid)) {\n this.players[uuid].score += points;\n }\n }", "function calculatePointsForPlayer(player)\n{\n var points = 0;\n for(var i = 0; i < players[p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates position of gate to mouse position if pressed/dragged
update() { if (this.pressed) { this.x = mouseX; this.y = mouseY; } }
[ "mouseDrag(){\n // If the equipment to be placed is selected, update it's position\n this.updateEquipmentBoxMovement();\n\n // Update the position of the object being moved by the mouse\n this.updateMovingEquipmentPos();\n }", "mouseDrag(prev, pt) {}", "function activateMove() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function below that allows playing and searching to be initiated and also allows the removal of the bot from the voicechat
async function youtubePlayer(msg) { if (msg.content == `/p` && msg.channel.id == "717931793222729740") { searching = true; arrayKill(); } if (msg.content == "/d") { msg.guild.me.voice.channel.leave(); } }
[ "VoiceChannel() {\n this.client.on('message', message => {\n if (message.content.startsWith('+$')) {\n if (message.content.startsWith('haos', 2)) { // budBOT joins the Voice Channel\n this.joinVoiceChannel(message, (err, connection) => {\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method should be used after the iid is retrieved by getIidPromise method.
function getIid() { return iid; }
[ "function getIid() {\n return iid;\n}", "setId(id) {\n this.id = id;\n return Promise.resolve();\n }", "function updateResultID() {\n for (var i = 0; i < self.resultList().length; i++) {\n self.resultList()[i].id(i + 1);\n }\n }", "function onGetIdTokenResult() {\n getIdTokenResult(false)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fill TargetTypeElement while choosing TargetType from the lineItem Targeting Table e.g. Adx DMA, Age, Countries etc
function fillTargetTypeElementForLineItem(elementsId){ var url = ""; var tarTypeElem = ""; var flag = false; clearCSSErrors("#lineItemTargetingTable", "#lineItemTargeting"); $("#tarTypeElementText").hide(); if ($('#sosTarTypeId').val() == "") { $("#sosTarTypeElement_custom").show(); $('#sosTarTypeElem...
[ "function addTargetsToLineItem(){\r\n\tif (validateAddTargets()) {\r\n\t\tvar valueToPrint = \"\";\r\n\t\tvar selectedElements = [];\r\n\t\tvar level = \"--\";\r\n\t\tvar not= \"--\";\r\n\t\tvar operation = \"--\";\r\n\t\tvar previousRowId = $(\"#geoTargetsummary\" , \"#lineItemTargeting\").find(\"tr:last\").attr(\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
production StringExpr ::== " CharList "
function parse_StringExpr() { tree.addNode('StringExpr', 'branch'); match('"', parseCounter); parseCounter++; parse_CharList(); //tree.endChildren(); match('"', parseCounter); parseCounter++; tree.endChildren(); }
[ "function parseStringExpr() {\n // make sure stringBuffer is empty\n stringBuffer = '';\n var stringStart = tokenStream[0];\n if(parseQuote() && parseCharList() && parseQuote()) {\n // wait until after parseCharList has executed so\n // the string characters can buf...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function declaration that creates buttons based on the list of topics array
function showButtons(){ // for loop to go through the array and create the buttomns // need to add class and atributes and name // have to append the buttons in the webpage $("#button-list").html(""); // cleans the button list before a new buttom is added and showButtons function add back the buttons ...
[ "function initializeButtons() {\n // Loops through the array of topics and makes a button for each\n for (var i = 0; i < topics.length; i++) {\n makeButton( topics[i] );\n }\n}", "function createButtons( getTopics ) {\n \n $(\"#topic-buttons\").empty();\n\n for (var i = 0; i < ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
testRPM The RPM test checks to see if the motor is going to run within a range of acceptable values. Formula: Check to ensure the RPM (after gearbox, if exists, is considered) is going to run at an acceptable speed. Acceptable speeds range from 6080 RPM.
function testRPM(RPM, gearRatioA, gearRatioB){ var message = ""; var acceptableRange = [60,80]; var status = true; if(RPM < acceptableRange[0]){ message = "This motor may work, but " + RPM + " RPMs is awfully slow. It may be too slow."; status = false; } if(RPM > acceptableRange[1]){ message = "Unfortunatel...
[ "function testTorque(torque){\n\tvar message = \"\";\n\tvar acceptableRange = [20,60];\n\tvar status = true;\n\tif(torque === \"\"){\n\t\tmessage = \"We were unable to calculate the torque of the motor. Please provide the power and RPM.\";\n\t\tstatus = false;\n\t\treturn buildResponse(status, message);\n\t}\n\tif(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fall semester stipend monthly rate
function FallSemesterRate(fallRate) { if( fallRate >= 0 ){ return fallRate / 4.5; } else { return alert("Invalid Amount"); } }
[ "get monthlyRate() { return (1+this.annualRate)**(1/12)-1 }", "function SpringSemesterRate(springRate)\n{\n\tif( springRate >= 0 ){\n\t\treturn springRate / 4.5;\n\t} else {\n\t\treturn alert(\"Invalid Amount\");\n\t}\n}", "function calcAnnual() {\r\n var bestPrice = plan1.price;\r\n var currDate = new Da...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
During offline, LocalDBService will answer to all the calls. All data modifications will be recorded and will be reported to DatabaseService when device goes online.
localDBcall(operation, params, successCallback, failureCallback, clonedParamsUrl) { return new Promise((resolve, reject) => { this.offlineDBService[operation.name](params, response => { if (operation.type === 'READ') { resolve(response); } ...
[ "goOffline() {\n\t\tfirebase.database().goOffline();\n\t}", "function updatelocaldatabase()\n{\n\t\tvar db = window.openDatabase(\"Fieldtracker\", \"1.0\", \"Fieldtracker\", 50000000);\n db.transaction(Querytoupdatelocal, errorCB);\n}", "_changeToOffline() {\n if (this.isOnline) {\n this.isOnline =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a new ConfigSettings instance. The values will be retrieved in the following order: local overrides commandline values environmant variables local configuration file default configuration file
function ConfigSettings(commandLineArgs, environmentVariables, localConfigFilePath, defaultConfigFilePath) { _super.call(this); this._localOverrides = {}; if (typeof commandLineArgs === 'string') { commandLineArgs = ConfigSettings.filterCommandLineArgs(commandLineArgs, process.argv);...
[ "function getConfig() {\n\tconst home = os.homedir();\n\tconst currentPath = process.cwd();\n\n\tconst globalOverrides = requireOptional(\n\t\t`/${home}/.new-component-config.json`\n\t);\n\n\tconst localOverrides = requireOptional(\n\t\t`/${currentPath}/.new-component-config.json`\n\t);\n\n\treturn {\n\t\t...defaul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
requires [dmg,output] cols selected cols should be [[dmgcol],[outputcol]]
calculateBurst(cols) { var splitDmg; for (var x=0,l=cols[0].length;x<l;x++) { splitDmg=cols[0][x].innerText.split("x"); cols[1][x].innerText=splitDmg[0]*splitDmg[1]; cols[1][x].classList.add("col-selected"); } }
[ "set cols(value){Helper.UpdateInputAttribute(this,\"cols\",value)}", "set _cols(value){Helper$2.UpdateInputAttribute(this,\"cols\",value)}", "function formatOutput(output, passCols, targetVis) {\n\n\t\toutput = output.filter(function(d) {\n\t\t\treturn passCols[d.id];\n\t\t});\n\n\t\tvar criteria = d3.set(outpu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets hub site data for the current web.
hubSiteData(forceRefresh = false) { return __awaiter(this, void 0, void 0, function* () { return this.clone(Web_1, `hubSiteData(${forceRefresh})`).get().then(r => JSON.parse(r)); }); }
[ "get hubSites() {\r\n return this.create(HubSites);\r\n }", "getSiteData() {\n return siteData\n }", "static getWebsites() {\r\n let websites;\r\n if (localStorage.getItem('websites') === null) {\r\n websites = [];\r\n } else {\r\n websites = JSON...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prints a number as a Cstyle float:
function toCfloat(n) { let s = (+n).toString(); // add point if needed: if (s.includes("e")) { return s; } else if (s.includes(".")) { return s + "f"; } else { return s + ".f"; } }
[ "function makeFloat(n) {\n\t\tn += (n.toString().indexOf('.') == -1) ? \".0\" : \"\";\n\t\treturn n;\n\t}", "function flow_ecma_string_of_float(num) {\n return caml_new_string(caml_js_from_float(num).toString());\n}", "writeFloat(value){return this.__writeFloatingPointNumber(value,4),this}", "function flow_g...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clear command, clears the current theme in config
function clear(cmd) { alloyCfg.global.theme = ""; console.log(chalk.yellow("\nClearing theme in config.json\n")); }
[ "function clear() {\n weavy.ajax(\"client/theme\", null, \"DELETE\").then(function () {\n });\n }", "__clearTheme() {\n const styleElement = document.getElementById(this.constructor.__fullId(this.__id) + \"_Styles\");\n if (styleElement) styleElement.parentElement.remove...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clones the current disclosure component state objects and returns the structure for further mutation.
static cloneDisclosureState(state) { const newState = { ...state }; newState.disclosureComponentKeys = Object.assign([], newState.disclosureComponentKeys); newState.disclosureComponentData = { ...newState.disclosureComponentData }; newState.disclosureComponentDelegates = Object.assign([], newState.discl...
[ "function cloneTreeInState() {\n const clonedState = { ...state };\n clonedState.rooNote = { ...state.rootNote };\n clonedState.selectedNote = { ...state.selectedNote };\n return clonedState;\n }", "copy_state(state){\n return {\n a: state.a.copy(),\n b: state.b.copy(),\n children: ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets or sets the xradius of the ellipse that is used to round the corners of the column. Use the `radiusX` property to round the corners of the column. ```html ``` ```ts series.radiusX=10; ```
get radiusX() { return this.i.po; }
[ "setRadiusX(radiusX) {\n assert && assert(isFinite(radiusX), `EllipticalArc radiusX should be a finite number: ${radiusX}`);\n if (this._radiusX !== radiusX) {\n this._radiusX = radiusX;\n this.invalidate();\n }\n return this; // allow chaining\n }", "get radiusX() {\n return this.i....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Instantiates an AssemblyScript module from a response using the specified imports.
async function instantiateStreaming(response, imports) { return postInstantiate( preInstantiate(imports || (imports = {})), (await WebAssembly.instantiateStreaming(response, imports)).instance ); }
[ "async function instantiateStreaming(response, imports) {\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n (await WebAssembly.instantiateStreaming(response, imports)).instance\n );\n }", "function instantiate(module, imports) {\n return postIns...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetch post to create new monster
function addMonster(formData) { fetch("http://localhost:3000/monsters", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, body: JSON.stringify({ name: formData.name, ...
[ "function postMonster(newMonster) {\n fetch(baseUrl, {\n //const headers declared globally\n headers, \n method: 'POST',\n body: JSON.stringify(newMonster)\n })\n .then(resp => resp.json())\n .then(monster => {\n renderMonster(monster)\n })\n}", "function createMonster(name, age, description){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
update stats sleep 5 secs and start gathering bitrate stats
function checkBitRateStats() { if (!isStarted) { setTimeout(checkBitRateStats, 2000); // setTimeout(func, timeMS, params...) } else { computeBitRateStats(); } }
[ "function listenToBandwithStats() {\n if (navigator.mozGetUserMedia) {\n console.log(\"Using Firefox stats API\");\n\n setInterval(function() {\n if (!bitrateManualOverride) {\n var selector = getStreamToListenOn();\n peerConnection.getStats(selector).then(f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
COMPUTER MOVES / getComputerMove Gets computer move strategy
function getComputerMove() { computerMoves++; let $boardSpaces = getBoardSpaceElements(); let isComputerFirstMove = computerMoves < 2; if (isComputerFirstMove) { var centerSpaceIndex = 4; var $centerSpaceElement = $($boardSpaces[centerSpaceIndex]); var isCenterSpaceEmpty = isBoardPositionEmpty($cen...
[ "function computerMove(){\n return bestComputerMove(FIELD, DEPTH);\n}", "function computerMove(){\n\t\tgetPoLR();\n\t\tvar win=checkProspectiveWinner();\n\n\t\tfor(i=0;i<win.length;i++){\n\t\t\tif(win[i].winner==0){//make winning move\n\t\t\t\tfindSpaceAndInsert0(win[i].index);\n\t\t\t\tconsole.log('------');\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
outcoming Connects to remote peer.
function connect(receiverPeerId) { if (conn) { conn.close(); alert('some connect is close') } conn = peer.connect(receiverPeerId, { reliable: true }); state = `connected to remote peer ${receiverPeerId}` listen(); }
[ "_connectPeer (cb) {\n cb = cb || this._onConnection.bind(this)\n if (this.closed) return\n if (this.peers.length >= this._numPeers) return\n let getPeerArray = []\n if (!process.browser) {\n if (this._params.dnsSeeds && this._params.dnsSeeds.length > 0) {\n getPeerArray.push(this._connec...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Apply image inversion if still necessary
function applyImageInversion() { var doInvertImages = isDarkTheme(requestedThemeName); if (doInvertImages !== didInvertImages) { imageInverter.toggle(doInvertImages); didInvertImages = doInvertImages; } }
[ "function doMirror(){\n if(imageIsLoaded(mirrorImage)){\n mirrorFilter();\n }\n}", "function updateImage() {\n if (wrongGuesses === 1) {\n var carl = document.getElementById(\"image-0\");\n carl.setAttribute(\"class\", \"invert\")\n }\n if (wrongGuesses === 2) {\n var maggie = documen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check Async Storage if token is available If it is available set loading state to false
async checkForToken(){ let token = await SecureStore.getItemAsync('token') console.log(token) this.setState({ token: token, loading: false }) }
[ "function HasToken(){\n return localStorage.getItem('token') != null\n}", "componentDidMount() {\n const obj = getFromStorage('Mern_App');\n if (obj && obj.token) {\n const { token } = obj;\n // Verify the token\n fetch('/api/account/verify?token=' + token)\n .then(res => res.json())\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stringify table. Creates a fenced table. The table has aligned delimiters by default, but not in `tablePipeAlign: false`: ```markdown | Header 1 | Header 2 | | :: | | | Alpha | Bravo | ``` The table is spaced by default, but not in `tableCellPadding: false`: ```markdown |Foo|Bar| |::|| |Baz|Qux| ```
function table(node) { var self = this var options = self.options var padding = options.tableCellPadding var alignDelimiters = options.tablePipeAlign var stringLength = options.stringLength var rows = node.children var index = rows.length var exit = self.enterTable() var result = [] while (index--)...
[ "function table(node) {\n var self = this;\n var options = self.options;\n var loose = options.looseTable;\n var spaced = options.spacedTable;\n var pad = options.paddedTable;\n var stringLength = options.stringLength;\n var rows = node.children;\n var index = rows.length;\n var exit = self.enterTable();\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Define a less than specification
function LessThanSpecification(num) { this.num = num; }
[ "numLt(key, value) {\n debug('Number property less than condition');\n debug('key - %s, value - %s', key, value);\n return new RangeQuery(key).lt(value);\n }", "function less(lhs, rhs) {\n return number(lhs) && lhs < rhs;\n }", "lessThan(number) {\n return this.addValidato...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chapter 7 Natalie Player Subbie Masturbate (After 3 times, the player cums)
function C007_LunchBreak_Natalie_SubbieMasturbate() { CurrentTime = CurrentTime + 120000; C007_LunchBreak_Natalie_MasturbateCount++; if (C007_LunchBreak_Natalie_MasturbateCount >= 4) { OveridenIntroText = GetText("SubbieMasturbate"); ActorAddOrgasm(); ActorChangeAttitude(1, 0);...
[ "function C007_LunchBreak_Natalie_SubbieMasturbate() {\n CurrentTime = CurrentTime + 120000;\n C007_LunchBreak_Natalie_MasturbateCount++;\n if (C007_LunchBreak_Natalie_MasturbateCount >= 4) {\n OverridenIntroText = GetText(\"SubbieMasturbate\");\n ActorAddOrgasm();\n ActorChangeAttitud...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for samelevel catalog members with the same name & nameInCatalog and print a warning about them
function checkUniqueMemberNames(catalogMembers, context = []) { const nameFrequencies = new Map(); catalogMembers .filter(m => m.type !== "group") .map(m => m.nameInCatalog || m.name) .forEach(name => { nameFrequencies.set(name, (nameFrequencies.get(name) || 0) + 1); }); nameFrequencies.forE...
[ "function sameCategoryName()\n {\n categories.each(function() {\n var name = $(this).data(\"name\").toString();\n\n var sameCategoryId = container.find(\"[data-name='\" + name + \"']\");\n\n if(sameCategoryId.length > 1) {\n console.error(\"There are categor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resets the text written to the gameover card on multiple play throughs
function resetGameOverCard(){ gameOverInfo = ''; }
[ "resetForGameOver() {\r\n this.removePhraseLi();\r\n this.resetHearts();\r\n this.resetKeyBoard();\r\n this.missed = 0;\r\n this.activePhrase = null;\r\n }", "function reset() {\n resetGame(gameId);\n updateCharList([]);\n updateChar(\"\");\n }", "function playAgain() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
bind user list element with appropriate redirect logic
function redirectUserBinding(){ var selector = thisInstance.constants.selector, classes = thisInstance.constants.classes, $userListWrapElements = $(selector.userEle); $userListWrapElements.click(function(event){ var $this = $(this); event.preventDefault();...
[ "function renderUserList(data) {\n if (!data.length) {\n window.location.href = \"/users\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n }", "function handleGetUser(event) {\n if (DEBUG) {\n console.log (\"Triggered handleGetUser\");\n }\n\n event.preventDefault();\n $(\"#user_list li\")....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts playing turn Launches click event and starts battle loop after 3 seconds
function playTurn() { if(battleInProgress == 0) { var playbutton = document.getElementById('app377144924760_playbutton'); clickElement(playbutton); battleInProgress = 1; // Start loop to check for battle status after 3 seconds // There is a loop within this to check if AJAX has loaded setTimeout(lo...
[ "function playerTurn() {\n enableExitButton();\n playerSequence = [];\n status.html(\"Your turn to play...\");\n if (hard.is(\":checked\")) {\n timer();\n colorsClicked = false; // Timer stops once the value is true.\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates modal window with Share Tribute textarea injected
function doModalShare() { customModalBox.htmlBox('yt-ShareContent', '', 'Share'); $('mb_close_link').addEvent('click', function() { $('yt-ShareContent').injectInside($('yt-ShareContainer')); if($('yt-ShareError')) $('yt-ShareError').remove(); }); }
[ "function share(){\r\n\turlstring = window.location.hostname+\"?seed=\"+state.getSeed()+\"&time=\"+endTime+\"&caption=\"+encodeURIComponent(captionText.toString())+\"&text=\"+encodeURIComponent(simText);\r\n\tconsole.log(urlstring);\r\n\tvar textarea = document.getElementById(\"sharetext\");\r\n\ttextarea.value = u...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove the modal backdrop.
removeBackdrop () { $('.modal-backdrop').remove() }
[ "_remove() {\n this.backdrop.remove();\n this.modal.remove();\n Utils.removeClass(document.body, 'modal-mode');\n }", "_removeBackdrop() {\n if (this._backdrop) {\n this._body.removeChild(this._backdrop);\n this._backdrop = null;\n }\n }", "_removeModal() {\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used in /compare/accom and /compare/universities
function parseCompareArgs(req, res){ if(req.query.courses){ courses = req.query.courses.split(","); unis = []; c = []; cbu = {}; courses.forEach(function (item) { t = item.split("@"); if(unis.indexOf(t[1]) == -1){ unis.push(t[1]); } if(c.indexOf(t[0]) == -1){ c.push(t[0]); } if(cbu[t[1...
[ "function Compare(){}", "function comparator(a, b) {\n if (a.name === lonelyIntern.name) return -1;\n return 0;\n }", "function author245c(record1, record2) {\n\t\tvar fields1 = select(['245..c'], record1);\n\t\tvar fields2 = select(['245..c'], record2);\n\n\t\tvar norm245c = ['toSpace(\"-\")...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is a function for getPipelineStepForRepository / Retrieve a given step of a pipeline.
getPipelineStepForRepository(incomingOptions, cb) { const Bitbucket = require('./dist'); let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // String | The UUID of the pipeline // String | The UUID of the step. /*let username = "username_example";*/ /*let rep...
[ "getStep (steps, id) {\n return steps.find(step => step.id === id)\n }", "function fetchStep(coordinates, pipelineData) {\n if (coordinates.length === 2) {\n return pipelineData[coordinates[0]].steps[coordinates[1]];\n } else {\n return pipelineData[coordinates[0]].streams[coordinates[1]].steps[co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A list item can contain a description.
function ListDescription(props) { var children = props.children, className = props.className, content = props.content; var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__["default"])(className, 'description'); var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__["getUnhandledProps"])(ListDescription...
[ "addNewDesc(itemId, desc)\r\n {\r\n if(this.currentList!=null)\r\n {\r\n let currItem = this.currentList.items[itemId];\r\n currItem.setDescription(desc);\r\n this.view.viewList(this.currentList, this.toDoLists);\r\n }\r\n }", "function ItemDescription (...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback function for when image has finished loading in the Viro360Photo. We then animate the WeWork ViroImage into the scene through the setting of state runShowTitleAnimation.
_onBackgroundPhotoLoadEnd(){ this.setState({ runShowTitleAnimation:true }); }
[ "_onBackgroundPhotoLoadEnd() {\n this.setState({\n runShowTitleAnimation:true\n });\n }", "showImage() {\n let self = this;\n self.animate();\n let waitForPrevious = setTimeout(function () {\n self.setLoaded();\n }, self.config[c.CONFI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback function when sending a colony ship Launch the next step of the sending if any. Shows succes or error if any. response: the response the function recieved from the server
function SendColonyShip(response) { var txt=SmartCut(response,'<body id="','"'); var gsp='galaxy='+sendingFleet.galaxyDest+'&system='+sendingFleet.systemDest+'&position='+sendingFleet.planetDest; // target??? switch(txt) { case 'fleet1': if(sendingFleet.step==1){ sendingFleet.step++; var fd=gsp+'&t...
[ "function replySucceeded(){self.status=C.STATUS_WAITING_FOR_ACK;setInvite2xxTimer.call(self,request,desc);setACKTimer.call(self);accepted.call(self,'local');}// run for reply failure callback", "function nextEmailResult(response) {\n if (response === 'fail') {\n var errmsg = 'draft1864Last: Sending an email t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handler for ChannelStateChange event
function channelStateChange(event, channel) { console.log(util.format('Channel %s is now: %s', channel.name, channel.state)); }
[ "function handleReceiveChannelStatusChange(event) {\n\n }", "function handleReceiveChannelStateChange() {\r\n var readyState = sendChannel.readyState;\r\n //trace('Receive channel state is: ' + readyState);\r\n }", "function handleReceiveChannelStatusChange(event) {\n if (rece...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
createYearDropdown generate the dropdown menu which allows the user to select the year that they last completed. The selection is based on the time of year. If Fall Term: On pattern selects everything up to the fall term of year specified If Winter Term: On pattern selects everything up to the Winter term of year speci...
function createYearDropdown() { var selectYearDropDown = document.getElementsByClassName('select-year'); for (var i = 0; i < selectYearDropDown.length; i++) { selectYearDropDown[i].onclick = function() { if (prerequisiteTable != null) { var text = this.innerHTML.split(/[ ,]+/); var year...
[ "function createYearLabel() {\n\n var\n yearFocused = MONTH_FOCUSED.YEAR,\n yearsInSelector = SETTINGS.yearSelector\n\n\n // If there is a need for a years selector\n // then create a dropdown within the valid range\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
End refreshAssessors Looks through all of the assessors, queries them for a final verdict, creates a summary verdict, and updates the DOM to display that.
function updateSummaryVerdict() { var verdicts = {G: 0, Y: 0, R: 0}; console.log("Update summary verdict"); $("#fitnessWidgetsLoadingAnim").hide(); for(var idx in assessors) { // Increment the number of times we've seen each verdict. var verdict = assessors[idx].getVerdict(); if(verdict) { v...
[ "function refreshAssessors() { \r\n\t// Remove all but first row.\r\n\tconsole.log(\"Refreshing \" + assessors.length + \" total assessors\");\r\n\t$(\"#assessmentTable\").find(\"tr:gt(0)\").remove();\r\n\t\t\t\r\n\tfunction runAssessorIdx(idx, assessors) {\r\n\t\tif(idx >= assessors.length || idx < 0) { throw \"In...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
UnionTypeDefinition : Description? union Name Directives[Const]? UnionMemberTypes?
parseUnionTypeDefinition() { const start = this._lexer.token; const description = this.parseDescription(); this.expectKeyword('union'); const name = this.parseName(); const directives = this.parseConstDirectives(); const types = this.parseUnionMemberTypes(); return this.node(start, { k...
[ "parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(star...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
new version of joke matcher returns a joke based on the first string it finds that contains a key
function matchjoke2(words){ for (var n = 0; n<words.length; n++){ for (var m=0; m<Object.keys(pundict).length; m++){ var key=Object.keys(pundict)[m] var trigger= new RegExp(key) if(trigger.test(words[n])){ var rand = Math.floor(Math.random()*pundict[key].length) return pundict[key]...
[ "function getJoke() {\n\tvar jokeFlag = 0;\n\tvar currJoke = allJokes[11];\n\tfor(var i = 0; i < allJokes.length + 1; i++) {\n\t\tif(allJokes[i].id == jokeId && jokeFlag != 1) {\n\t\t\tjokeFlag = 1;\n\t\t\tcurrJoke = allJokes[i];\n\t\t\ti = allJokes.length;\n\t\t}\n\t}\n\tif(!jokeFlag)\n\t\tgetJoke();\n\telse\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the address text of the given prediction.
getPredictionAddress(prediction) { if (prediction.predictionPlace) { // default prediction defined above return prediction.predictionPlace.address; } // prediction from Mapbox geocoding API return prediction.place_name; }
[ "getPredictionAddress(prediction) {\n if (prediction.predictionPlace) {\n // default prediction defined above\n return prediction.predictionPlace.address;\n }\n // prediction from Google Maps Places API\n return prediction.description;\n }", "function getAddress() {\n if (!label ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets sticky table element dimensions.
function setWidths() { $t.find( 'thead th' ).each( setHeadingWidth ).end().find( 'tr' ).each( setRowHeight ); // Set width of sticky table head: $stickyHead.width( $t.width() ); // Set width of sticky table column: $stickyCol.find( 'th' ).add( $stickyIntersect.find( 'th' ) ).width( $t.find( 'thead th' ...
[ "_setTableWidthAndPosition() {\n let table = this.get('table');\n let tableWidth = this.get('tableWidth');\n let hasBeenSet = this.get('widthAndPositionSet');\n if (tableWidth === 0 || hasBeenSet) {\n return;\n }\n\n let fixedColumnWidth = table.fixedColumnWidth();\n let width = table.$()....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This directive gets all the current states using $state.get() and displays them in a tree using D3 lib. It then listens for state events and updates the tree. Usage:
function stateVisDirective($state, $timeout, $interval) { return { scope: { width: '@', height: '@' }, restrict: 'AE', template: '<svg></svg>', link: function (_scope, _elem, _attrs) { var stateMap = {}; var width = _scope.width || 400, height ...
[ "function getTreeState() {\n var tree = viewTree.getData().getAllNodes();\n //isc.JSON.encode(\n return { width: viewTree.getWidth(),\n time: isc.timeStamp(),\n pathOfLeafShowing: viewInstanceShowing ? viewInstanceShowing.path : null,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function allows for the game to be intialized and to use the prompts function to start the prompts
function initgame() { prompts(); }
[ "function init() {\n promptManager()\n\n}", "function init () {\n\tprompt.get('choice', function (err, result) {\n\t\tvar choice = result.choice;\n\n\t\t// error handling - will run prompt again if user does not enter rock, paper, or scissors\n\t\tif (choice !== 'rock' && choice !== 'paper' && choice !== 'scis...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the default "load" and "message" event listeners to the element with id "listener". The "load" event is sent when the module is successfully loaded. The "message" event is sent when the naclModule posts a message using PPB_Messaging.PostMessage() (in C) or pp::Instance().PostMessage() (in C++).
function attachDefaultListeners(listenerDiv) { listenerDiv.addEventListener('load', moduleDidLoad, true); listenerDiv.addEventListener('message', handleMessage, true); listenerDiv.addEventListener('error', handleError, true); listenerDiv.addEventListener('crash', handleCrash, true); ...
[ "function attachDefaultListeners() {\n var listenerDiv = document.getElementById('listener');\n listenerDiv.addEventListener('load', root.moduleDidLoad, true);\n listenerDiv.addEventListener('message', root.handleMessage, true);\n listenerDiv.addEventListener('error', root.handleError, true);\n liste...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function will deal damage to the OPC
function DamageOPC(damageAmount) { OPC.hpCurrent -= damageAmount; if(OPC.hpCurrent < 1) { if(OPC.hpCurrent <= OPC.hpMax * -1) { OPC.state = "dead"; OPC.goal = "none"; combatStage = 0; } else { OPC.hpCurrent = 0; OPC.state = "unconscious"; } } WriteOPC(); }
[ "function god_attack_damage(){\n\tfor (var i = 0; i < pArmy.pGodMoves.length; i++)\n\t{\n\t\tif (pArmy.pGodMoves[i].status == \"activated\")\n\t\t{\n\t\t\tfor (var e = 0; e < eArmy.eFootSoldiers.length; e++)\n\t\t\t{\n\t\t\t\tif (pArmy.pGodMoves[i].z == eArmy.eFootSoldiers[e].y &&\n\t\t\t\t\tMath.abs(pArmy.pGodMove...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
properties Constructors Initializes a new instance of the `PdfGridColumnCollection` class with the parent grid.
function PdfGridColumnCollection(grid){/** * @hidden * @private */this.internalColumns=[];/** * @hidden * @private */this.columnWidth=0;this.grid=grid;this.internalColumns=[];}//Iplementation
[ "function PdfGridColumnCollection(grid) {\n /**\n * @hidden\n * @private\n */\n this.internalColumns = [];\n /**\n * @hidden\n * @private\n */\n this.columnWidth = 0;\n this.grid = grid;\n this.internalColumns = [];\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a promiise linked to a fontresource to be loaded
function SpeLoadFont( font_family ) { return new Promise( function( resolve, reject ) { if ( !SpeFontsCache[font_family] ) { const font_loader = new THREE.FontLoader(); const font_resource_path = SPE_PATH_FONTS + font_family + '.json'; font_loader.load( font_resource_path...
[ "get font() {}", "_loadFont(name, filename) {\n var s = document.createElement('style');\n var fontname = name;\n s.id = fontname;\n s.type = \"text/css\";\n document.head.appendChild(s);\n s.textContent = \"@font-face { font-family: \" + fontname + \"; src:url('\" + file...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sendSoapRequest Function sending the soap request to metapack
function sendSoapRequest() { //declaring local variables var soapHeaders = new Array(); var responseObject = null; var recievingUrl = ''; var encodedCredentials = ''; try { //passing the credentials to Base 64 in order to pass trough SOAP encodedCredentials = nlapiEncrypt(username + ":" + pass...
[ "function sendData(method,serviceName,soapBodyElement) {\r\n\r\nif (xmlhttp)\r\n {\r\n // alert(\"sending data ...\");\r\n xmlhttp.open(method,serviceName, true);\r\n\t xmlhttp.setRequestHeader(\"SOAPACTION\", serviceFunction);\r\n\t // construct SOAP body\r\n\t var soapBody = \"<?xml version='1.0' ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Subscribes to drawer events in order to set a class on the main container element when the drawer is open and the backdrop is visible. This ensures any overflow on the container element is properly hidden.
_watchDrawerToggle(drawer) { drawer._animationStarted .pipe(filter((event) => event.fromState !== event.toState), takeUntil(this._drawers.changes)) .subscribe((event) => { // Set the transition class on the container so that the animations occur. This should not /...
[ "_watchDrawerToggle(drawer) {\n drawer._animationStarted.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.filter)(event => event.fromState !== event.toState), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.takeUntil)(this._drawers.changes)).subscribe(event => {\n // Set the transition class on the conta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to check if result.json version of the given file exists. If it exists then read the file and print its contents. Otherwise, call function from fileData.js to read the file, then call function from textMetrics.js to simplify the file content, then call write function from fileData.js to write the simplified co...
async function fileMetrics(fileName){ if((!fileName)||(typeof(fileName)!="string")){ throw "Please provide a filename as a string to the function"; } //Splitting the given filename to obtain the filename without the extension let fileNameArr = fileName.split("."); //Creating the result.jso...
[ "function readResultsFromFile(file) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n console.log('Error: ' + err);\n return;\n }\n \n var json = JSON.parse(data);\n var results = parseResults(json);\n\n printResults(results);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Middleware para comprobar la operacion
function operacion_middleware(req, res, next) { let suma = ['suma']; let resta = ['resta']; let multiplica = ['multiplica']; let division = ['division']; let operacion = req.params.operacion; let data = req.body; if ((suma.indexOf(operacion) === -1) && resta.indexOf(operacion) === -1 ...
[ "function middleware(request, response, next) {}", "middleware() {\n let kepi = this;\n return function(req, res, next) {\n kepi.applyTo(res);\n next();\n }\n }", "middleware(methodName, cond) {\n\t\tif (!this.hasOwnProperty(methodName)) {\n\t\t\tnew Error('trying add middleware to nothing...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check and Resize empty columns
function emptyColumnCheck() { var data = grid.getData().getItems() || []; //Avoiding Resize functionality when there is no data. if (data.length === 0) { return; } var headerColumns = $('.slick-header-column', $(container)); var flag = []; ...
[ "function emptyColumnCheck() {\n //Avoiding Resize functionality when there is no data.\n if (data.length === 0) {\n return;\n }\n var headerColumns = $('.slick-header-column', $(container));\n var flag = [];\n var updateGrid = false;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To handle the naming inconsistency of the bccsp default property for CA/peer/orderer There are 3 variations currently BCCSP.default, BCCSP.Default and bccsp.default. Added bccsp.Default to be on safe side
getHSMBCCSP(bccsp) { const defaultVal = _.get(bccsp, 'BCCSP.default') || _.get(bccsp, 'BCCSP.Default') || _.get(bccsp, 'bccsp.default') || _.get(bccsp, 'bccsp.Default'); return defaultVal; }
[ "getDefault () {\n\t\treturn \"\";\n\t}", "function completeDefaults(){\n\t\tvar def=m_scenario_object.defaultmessage;\n\t\t\n\t\tif (!def){\n\t\t\tdef={};\n\t\t}\n\t\t\n\t\tif(def.type){\n\t\t\tm_default[\"type\"]=def.type;\n\t\t}else{\n\t\t\tm_default[\"type\"]=\"ONEWAY\";\n\t\t}\n\t\t\n\t\tif (def.length){\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a function for updating a path (array of arc ids)
function getDividedArcUpdater(map, arcCount) { return function(ids) { var ids2 = []; for (var j=0; j<ids.length; j++) { remapArcId2(ids[j], ids2); } return ids2; }; function remapArcId2(id, ids) { var rev = id < 0, absId = rev ? ~id : id, min = map[...
[ "updatePath() {\n this.isPath = true;\n const eventName = \"node-\" + this.row + \"-\" + this.col + \"-path\";\n sendEvent(eventName);\n }", "function const_path_alg(new_path, existing_path) {\r\n // array of points in the order they are added, format: {point: {x: __, y: __}, type: 'endpoint'/'in...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Export object (and members) as OpenStreetMap JSON
exportOSMJSON (conf, elements, callback) { if (this.id in elements) { return callback(null) } elements[this.id] = {} if ((this.properties & (OverpassFrontend.TAGS | OverpassFrontend.MEMBERS | OverpassFrontend.META)) !== (OverpassFrontend.TAGS | OverpassFrontend.MEMBERS | OverpassFrontend.META)) {...
[ "\n ()\n {\n return (\n JSON\n .stringify( this.map_o )\n )\n }", "function export_geojson(){\n datalayer.toGeoJson(function (data) {\n download(JSON.stringify(data, null, 2), \"MissionPlaner.json\", \"text/plain\");\n });\n}", "export() {\n const json = {}\n // saves the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hide ip modal and start server
function hideIpModal() { //Get IP serverip = $ipInput.val(); if (serverip.indexOf(":") !== -1) { serverport = serverip.substr(serverip.indexOf(":") + 1) | 0; serverip = serverip.substr(0, serverip.indexOf(":")); } else { serverport = 80; } ...
[ "function onChangeAddrServerButton() {\n\t\t$(\"#lost-connection-modal\").modal(\"hide\");\n\t\t$(\"#settings-modal\").modal(\"show\");\n\t}", "function onChangeAddrServerButton() {\n $(\"#lost-connection-modal\").modal(\"hide\");\n $(\"#settings-modal\").modal(\"show\");\n $(\"#settings-moda...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is given an array of quote objects and it returns a promise in shape of a quote string.
function returnRandomQuote(quotes) { if (quotes) { return new BPromise(function(resolve, reject) { var quote = quotes[ Math.floor(Math.random() * quotes.length) ]; resolve('"' + quote.quote + '" - ' + quote.origin); }); } else { throw 'utility.returnRandomQuot...
[ "function getQuotes() {\n return quotes.join(\"\\n\");\n}", "function getRandomQuote(quoteArray) {\n var quoteIndex = Math.floor(Math.random() * quoteArray.length);\n var randomQuote = quoteArray[quoteIndex];\n return randomQuote;\n}", "listQuotes() {\n return new Promise(resolve => {\n const quotes...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add a word tag into doc
function addTag(word){ var x = addkey(word) if (!x){ var t = document.createElement('text') var n = document.createTextNode(word) t.appendChild(n) t.classList.add('tagword') t.style.margin = '100px 5px' var par = document.getElementById("taghold") var ...
[ "function makeTags(tag, word){\n return '<'+tag+'>' +word+ '</'+tag+'>'\n}", "function Word(text, tag) {\n this.text = text;\n this.tag = tag || null;\n}", "addWord(elWord, definition, save=true) {\n // XXX decouple from TooltipManager\n TooltipManager.watch(elWord, definition);\n elWord.definit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if phone number is Kosher (phone supports only calls)
isKosher() { return this.phoneNumber.match(/^0([23489]80|5041|5271|5276|5484|5485|5331|5341|5832|5567)\d{5}$/) !== null; }
[ "function isincall () // boolean\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.IsInCall();\n else\n return false;\n}", "function holdCall(phone_num,cache){\n\n if(~PRODUCTION_SPAMPROOF_PHONE.indexOf(phone_num.trim(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the gobj's current renderState is such that it should render on top of other objects
function renderStateRendersOnTop(gobj) { return ((gobj.state.renderState === "unmatchedGiven") || (gobj.state.renderState === "matchedGiven") || (gobj.state.renderState === "targetHighlit")); }
[ "get isTop() { return (this.flags & 1 /* Top */) > 0; }", "checkHits(object) {\n\n if(this.inDisplay) {\n if(this.xPos + (this.size / 2) > object.leftSide &&\n this.xPos - (this.size / 2) < object.rightSide &&\n this.yPos + (this.size / 2) > object.topSide &&\n this.yPos - (this.size ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a Schema.org/Place/geo from bounding coordinates Either generates a GeoCoordinates (when the north and east coords are the same) or a GeoShape otherwise.
function generateSchemaOrgGeo (north, east, south, west) { if (north === south) { return { "@type": "GeoCoordinates", "latitude" : north, "longitude" : west } } else { return { "@type": "GeoShape", "box": west + ", " + south + " " + east + ", " + north } } }
[ "function genGeopoint(tupla, all) {\r\n try {\r\n if (tupla[0] == 0 && tupla[1] == 0 && !all)\r\n return undefined;\r\n return new firestore_1.GeoPoint(tupla[0], tupla[1]);\r\n }\r\n catch (e) {\r\n return undefined;\r\n }\r\n}", "function createGeometry(coords, type) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SZP0[] Set Zone Pointer 0 0x13
function SZP0(state) { var n = state.stack.pop(); if (DEBUG) console.log(state.step, 'SZP0[]', n); state.zp0 = n; switch (n) { case 0: if (!state.tZone) initTZone(state); state.z0 = state.tZone; break; case 1 : state.z0 = state.gZone; ...
[ "function SZP0(state) {\n\t var n = state.stack.pop();\n\n\t if (exports.DEBUG) { console.log(state.step, 'SZP0[]', n); }\n\n\t state.zp0 = n;\n\n\t switch (n) {\n\t case 0:\n\t if (!state.tZone) { initTZone(state); }\n\t state.z0 = state.tZone;\n\t break;\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If a function is going to be reused by multiple endpoints, the user should create multiple functions instead So the API name is identified by just eventType and funcName
getEventName(eventType, funcName) { return `sls-${eventType}-${funcName}`.replace(/-/g, '_'); }
[ "async function handleUtilsEndpoint(param,event,role) {\n\n\n}", "onNameChange(func){ return this.eventNameChange.register(func); }", "async function handleInfoEndpoint(param,event,role) {\n\n}", "function recordFunctions() {\n var hooks = [];\n Webhooks.Routes['function'].forEach(function(item) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================= ======================================================= Equiv.getAnswerType = function(answer, answerRoot)
function getType(answer, answerRoot) { // Create our return object. Assume it's an illegal type until we determine otherwise. var answerType = {type: typeList.types.BAD_TYPE}; // Don't use !answer. It could be 0! if (answer === undefined || answer === null) return answerType; // Check for No Solutions...
[ "function rational(answer, answerType, answerRoot)\n\t{\n\t\tif (answerRoot.isRational())\n\t\t{\n\t\t\tanswerType.type = typeList.types.EXPRESSION;\n\t\t\tanswerType.answerRational = answerRoot;\n\t\t\tanswerType.answerPolynomial = null;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function get_questi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initializes the cognito user pool for the instance
initUserPool() { var poolData = { "UserPoolId" : "us-east-2_0HlnZbskF", // Your user pool id here "ClientId" : "68ol44e7n6t83jdk8j0sqjsh9g" // Your client id here }; return new AmazonCognitoIdentity.CognitoUserPool(poolData); }
[ "initAWS() {\n AWS.config.update({\n region: 'us-east-1'\n });\n AWSCognito.config.region = 'us-east-1';\n AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n IdentityPoolId: 'us-east-1:b2600055-0fc7-4bb3-9bd0-6ba8fa16fd4f'\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get data in dataGridColumns table / Get dataGridColumn in dataGridColumns table
getDataGridColumns() { return this.dataGridColumns.findAll(); }
[ "function getColumns() {\n return Object.getOwnPropertyNames(data[0])\n }", "function getGridColumns() {\n var funtionName = \"getGridColumns\";\n var columns = [];\n try {\n columns = [\n { field: \"triipcrm_viewcolumnid\", hidden: true, template: '<spa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Write a JavaScript function roundNumber(value) that rounds floatingpoint number using Math.round(), Math.floor(). Write a JS program roundingNumbers.js that rounds a few sample values. Run the program through Node.js.
function roundNumber(value) { 'use strict'; console.log(Math.floor(value)); console.log(Math.round(value)); }
[ "function round(a){return Math.floor(a);}", "function ourOwnRound(theNumber) {\n\n // Create a variable \"results\" with no value given\n var results;\n // Using the % equation, we can extra the decimal place, and store it in \"decimalOFTheNUmber\"\n var decimalOfTheNumber = theNumber % 1;\n\n // W...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
common function to create vertical tabs for each object
function CreateVerticalTabs( VerticalObj ) { var tabStr = ""; var j = 0; tabStr += '<div class="col-xs-3">'; tabStr += '<ul class="nav nav-tabs tabs-left">'; $.each(VerticalObj, function(i, TabVal){ if(j == 0 ) tabStr += '<li class="active"><a href="#'+i+'" data-toggle="tab" aria-...
[ "function createTabs(numTabs)\r\n{\r\n var tabString = \"\";\r\n for(var i=0; i<numTabs; i++)\r\n {\r\n tabString += \"| \";\r\n }\r\n return tabString;\r\n}", "function create(){\n for (var i = 0; i < pages; i++){\n var $newtab = $('<div id=\"tab-' + toWords(i+1) + '\" class=\"tab\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }