query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Funcao: MovieReverse(string) Descricao: Volta o Video Parametros: 1 Nome do Obj Windows Media (String) Exemplo: MovieReverse('WMP');
function MovieReverseV6(wm) { mObj = eval(dc + wm); mObj.fastReverse(); }
[ "function videoRewind()\n{\n executeCommand(Command.Rewind);\n}", "exitScreenDescriptionReverseVideoClause(ctx) {\n\t}", "Reverse() {\n\n }", "function entra() {\r\n tituloreverse;\r\n}", "trailer(){ \n if (this.box.video) {\n \n return this.detail.vi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds a URI for redirecting to Keycloak OpenID Auth
function buildOauthRedirectUrl(kc, state) { let params = { response_type: 'code', client_id: kc.clientId, redirect_uri: kc.redirectUri, state: state, prompt: true, scope: 'openid' }; return `${getRealmUrl( kc )}/protocol/openid-connect/auth?${formEncode(params)}...
[ "function buildurl(provider) {\n var server = config.server.uri || \"http://localhost:3000\";\n\n var url = \"https://\" + config.passport.auth0.domain + \"/authorize\" +\n \"?response_type=code&scope=openid%20profile\" +\n \"&client_id=\" + config.passport.auth0.clientid +\n \"&redirect_uri=\" + server ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
place js code snippet into the first mbox of the page
function placeJsToMbox(selector, jsCode) { var str = "<script type='text/javascript'>"; str += jsCode; str += "<"; str += "/script>"; //$(str).appendTo(selector); $(selector).append(str); }
[ "function addScriptBody(code) {\n var $highlight, $script, name, email, date;\n if (!code) {\n date = getDate() || '[date]';\n name = getUserName() || '[name]';\n email = settings['login' + detectEnvironment()];\n if (!email || email == '@maxymiser.com') {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The recursion doesn't need to be a complete traversal of the vnode graph, instead it can be partial, when a custom element vnode is found, we don't need to continue into its children because by attempting to disconnect the custom element itself will trigger the removal of anything slotted or anything defined on its sha...
function recursivelyDisconnectChildren(vnodes) { for (let i = 0, len = vnodes.length; i < len; i += 1) { const vnode = vnodes[i]; if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined$3(vnode.elm)) { // vnode is a VElement with children if (isUndefined$3(vnode.ctor)) { ...
[ "function recursivelyDisconnectChildren(vnodes) {\n for (let i = 0, len = vnodes.length; i < len; i += 1) {\n const vnode = vnodes[i];\n\n if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined(vnode.elm)) {\n // vnode is a VElement with children\n if (isUndefined(vnode.ctor)) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle followers to parent codemark or review or code error as needed
async handleFollowers (thing, op, options = {}) { // if this is a legacy codemark, created before codemark following was introduced per the "sharing" model, // we need to fill its followerIds array with the appropriate users if (thing.get('followerIds') === undefined) { op.$set.followerIds = await new Codemark...
[ "async handleFollowers (attributes, options) {\n\t\t// get the stream, if this is a codemark for a CodeStream team\n\t\tlet stream;\n\t\tif (!attributes.providerType && attributes.streamId) {\n\t\t\tstream = options.stream || await this.request.data.streams.getById(attributes.streamId);\n\t\t}\n\n\t\t// get user pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform a term based search with de selected location (from location state)
function doSearchWith(location) { state = 1; locations = []; errorMessage = ''; searchTerm = location; $$('#search-text').val(searchTerm); doSearchByTerm(); }
[ "function doSearchByTerm(location) {\n app.showPreloader();\n\n ps.searchByTerm(searchTerm, searchByTermSuccess, searchByTermError);\n\n function searchByTermSuccess(data) {\n processResponse(data);\n }\n\n function searchByTermError(data) {\n showErrorState(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render the table with the color cells according to each fire intensity index value
function renderFire() { let table = document.getElementById('table') let tableHtml = '' let pixelIndex = 0 for (let x = 1; x <= fireHeight; x++) { tableHtml += '<tr>' for (let y = 1; y <= fireWidth; y++) { updatePixelFireIntensity(pixelIndex) let color = fire...
[ "function colorChart() {\n let table, dataCells, i, LNG;\n table = $('table.historical-confidence-table');\n dataCells = table.find('td');\n i = 0;\n LNG = dataCells.length;\n for (i; i < LNG; i++) {\n let thisCell, thisValue, thisHue, thisColor;\n thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the current line indentation.
getCurrentLineIndentation() { return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length; }
[ "getCurrentLineIndentation() {\n return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length;\n }", "getIndentationLevel() {\r\n const indentationText = this._context.manipulationSettings.getIndentationText();\r\n return this._context.languageService.getIdentationAtPosition(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
stickMe function This function will run til busted or higher than player
function stickMe() { // The end result should have hit and stick disabled disableButtons(); // hitDealer is similiar to fucntion hitMe function hitDealer(){ addCard(deck[index], dealer); isBusted(dealer); } // While dealerNotBusted hit var dealerHit = true; while (dea...
[ "stick(hand) {\n hand.stuck = true;\n this.emit('msg', `${hand.name} has decided to stick`);\n }", "function stickMovement() {\n var sum_x = Number(left_x + right_x);\n var sum_y = Number(left_y + right_y);\n\n if (left_x >= stick_sensitivity | left_x <= -stick_sensitivity ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a random string from strings.json
randomString() { let len = strings.length; let index = Math.floor(Math.random() * len); let str = strings[index]; return str; }
[ "function set_random_strings(json) {\n\t\ttry {\n\t\t\tlet str = JSON.stringify(json);\n\t\t\tif (str && typeof str === 'string') {\n\t\t\t\tstr = str.replace(/\\$RANDOM8/g, t.misc.simpleRandomString(8).toLowerCase());\n\t\t\t\tstr = str.replace(/\\$RANDOM16/g, t.misc.simpleRandomString(16).toLowerCase());\n\t\t\t\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
should take two generators and return a generator that combines the sequences what on Earth is a generator? Evan makes it sounds like a var i'm thinking it's a binary function will consult Freya
function concat(gen1,gen2) { return function(){ const value = gen1() if(value !== undefined){ return value } else { return gen2() } } }
[ "function concat(generator1, generator2) {\n return function() {\n var next = generator1();\n if ( next === undefined ) {\n next = generator2();\n }\n return next;\n };\n}", "function concat(gen1, gen2) {\n return function() {\n var i = gen1();\n if(i === undefined) {\n i = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
calculate sliders' min based on display.size display.size = container.size slider.size
function onUpdateMin() { // store current min var pxmin = xslider.min; var pymin = yslider.min; // store current values var xcurr = xslider.value; var ycurr = yslider.value; // set new min. slider will internally try to update current value to ensure it's within its range. e.g. if curr = 20, new min =...
[ "function onChange()\n\t{\n\t\t// decide if we need sliders based on new content size. default is they are hidden\n\t\t// we update both h and v sliders even when only content.width is changed as it's possible that both sliders\n\t\t// will hide/show based on the change in content.width alone\n\t\thslider.hide = tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1. keep connected with Logentries TCP api 2. keep log the missed containers (in case docker event api disconnected) 3. keep connected with docker event api
function connectLE(){ try{ if (leSocket.ready) { return; } }catch(err){} log('Connecting Logentries...') leSocket = tls.connect(443, "data.logentries.com", {}, function () { if (leSocket.authorized) { leSocket.setEncoding('utf8'); leSocket.set...
[ "async containerLogs(executor, container) {\n let log = this.log;\n return new Promise(function(resolve, reject) {\n let logBuffer = [];\n\n // create a single stream for stdin and stdout\n let logStream = new stream.PassThrough();\n logStream.on('data', fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sube volumen del track
function SetVolumenTrackUp(num_track) { try { let aux = document.getElementById('soundTrack'+num_track).volume; aux += 0.1; if (aux>1){aux=1;} document.getElementById('soundTrack'+num_track).volume = aux; } catch(err) { DebugLog(err.message.toString()); } }
[ "function subirVolumen() {\r\n document.getElementById(\"boton_video\").volume +=0.1;\r\n}", "changeVol(){\n let vol = vols / 100;\n this.vidsource.volume = vol;\n this.volumeChange = vols;\n }", "computeVolume(track, selection) {\n if (track.volume === 0) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Each delegate is associated with a set of bindingMaps, one for each content which may be used by a template. The intent is that each binding delegate gets the opportunity to prepare the instance (via the prepare delegate calls) once across all uses. TODO(rafaelw): Separate out the parse map from the binding map. In the...
function getInstanceBindingMap(content, delegate_) { var contentId = getContentUid(content); if (delegate_) { var map = delegate_.bindingMaps[contentId]; if (!map) { map = delegate_.bindingMaps[contentId] = createInstanceBindingMap(content, delegate_.prepareBinding) || []; ...
[ "function bindContainers() {\n $(\".animated-container .email-container\").on({\n mouseenter: function () { changeStylesToAnimatedContent(this, true) },\n click: function() { changeStylesToAnimatedContent(this, true) },\n mouseleave: function() { changeStylesToAnimatedContent(this, false) },...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will delete all cookies
deleteAllCookies() { const cookies = document.cookie.split("; "); for (let c = 0; c < cookies.length; c++) { const d = window.location.hostname.split("."); while (d.length > 0) { const cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=;...
[ "function deleteAllCookies() {\n\t\tvar cookies = document.cookie.split(\";\");\n\n\t\tfor (var i = 0; i < cookies.length; i++) {\n\t\t\tvar cookie = cookies[i];\n\t\t\tvar eqPos = cookie.indexOf(\"=\");\n\t\t\tvar name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;\n\t\t\tdocument.cookie = name + \"=;expires=Thu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function returns an array of sorted objects where each object has "title" and "count" key/value pair that represents the number of borrows that book has. We are only returning up to 5 most popular books.
function getMostPopularBooks(books) { // this constant variable utilizes the mapOutObjNameAndCount helper function. const arrayOfBookNamesAndCount = mapOutObjNameAndCount(books, "title"); books.forEach(({ title, borrows }) => { let borrowedCount = borrows.length; arrayOfBookNamesAndCount.find(({ name }) ...
[ "function getMostPopularBooks(books) {\n let result = [];\n\n books.reduce((acc, book) => {\n result.push({ name: book.title, count: book.borrows.length });\n }, []);\n console.log(result.sort((b, a) => a.count - b.count).slice(0, 5));\n return result.sort((b, a) => a.count - b.count).slice(0, 5);\n}", "f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
function HttpsProxyAgent(opts) { if (!(this instanceof HttpsProxyAgent)) return new HttpsProxyAgent(opts); if ('string' == typeof opts) opts = url.parse(opts); if (!opts) throw new Error( 'an HTTP(S) proxy server `host` and `port` must be specified!' ); debug('creating new HttpsProxyAgent instance: %o', opts...
[ "function HttpsProxyAgent (opts) {\n if (!(this instanceof HttpsProxyAgent)) return new HttpsProxyAgent(opts);\n if ('string' == typeof opts) opts = url.parse(opts);\n if (!opts) throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');\n debug('creating new HttpsProxyAgent instance: %j',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion relacionada que obtiene la lista de alimentos del xml
function cargaComida(xml) { var i; var xmlDoc = xml.responseXML; var x = xmlDoc.getElementsByTagName(t)[0].getElementsByTagName("alimento"); for (i = 0; i < x.length; i++) { comidas += "<li class='comida'>" + x[i].childNodes[0].nodeValue + "</li>"; }; var texto = ...
[ "function obtenTemasDisponibles(xml){\n var xmlDoc = xml.responseXML;\n var x = xmlDoc.getElementsByTagName(\"tema\");\n var nuevosTemas = new Array();\n\n for(var i=0; i<x.length;i++){\n nuevosTemas.push(x[i].getElementsByTagName(\"nombre\")[0].childNodes[0].nodeValue);\n }\n console.log(n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the key generating function to its initial state.
function resetKeyGenerator() { n = 0; generate = function generate() { return "" + n++; }; }
[ "reset() {\r\n\t\t// Shortcut\r\n\t\tlet hasher = this._hasher;\r\n\r\n\t\t// Reset\r\n\t\thasher.reset();\r\n\t\thasher.update(this._iKey);\r\n\t}", "reset() {\n // Shortcut\n const hasher = this._hasher;\n\n // Reset\n hasher.reset();\n hasher.update(this._iKey);\n }", "reset() {\n // Short...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! FUNCTION TO PLAY THE DICE ROLL SOUND WHEN CALLED
function playDiceRoll(path) { new Audio(path).play(); }
[ "function playWrongCoinPicked() {\r\n clickWrongPickedSound.play();\r\n clickWrongPickedSound.volume=0.7;\r\n}", "function playCoinPicked() {\r\n clickPickedSound.play();\r\n clickPickedSound.volume=1;\r\n}", "function playRoll () {\n\t\t$('#ryu-roll-sound')[0].volume = 0.5;\n\t\t//$('#ryu-roll-soun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To highlight in parallel coordinate
function highlightDataInParallelCoordinate(){ var array_highlighted = []; for(var i = 0; i < circles.length; i++){ if(circles[i].color_fill.length > 1) array_highlighted.push(getSingleDisplayUnit(circles[i])); else if(marqueeTool_activated == "marquee_default" && marquee_activated_num > -1 && marqueeTools["mar...
[ "function highlightDataInParallelCoordinate(){\n var array_highlighted = [];\n for(var i = 0; i < circles.length; i++){\n if(circles[i].color_fill.length > 1)\n array_highlighted.push(getSingleDisplayUnit(circles[i]));\n }\n if(array_highlighted.length > 0)\n parcoords.highlight(array_highlighted);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Analyze the content of a string
function contentAnalyze( string, callback ) { $.ajax({ url : 'http://query.yahooapis.com/v1/public/yql', jsonp : 'callback', dataType : 'jsonp', data : { q : "select * from contentanalysis.analyze where text=\"" + string + "\"", format : 'json' }, success : function(data){ return cal...
[ "function StringScanner() {}", "function StringMatcher() {}", "function countforstring() {\n\nanalize = new String('A lot of animals (300-1000) live in the Africe (we have 6 continents), but there are a lot of fruits (100) in Africa too: mango, banana, nuts.');\nalert (\"String will be check: \" + analize);\nst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Behavior: Flip & Flop Markup (start code) %%fliph300w500nonedefaultprimaryinfowarningsuccessdanger Front Back /% (end) DOM Structure (start code) div.flipcontainer div.flip div.face ..front face.. div.face ..back face (end)
function Flip(element, options){ var args = options.prefix.sliceArgs(element), arg, divider = "hr", css = {}, frontback = ["default", "default"]; //require exactly to blocks: one for front and one for back if( element.getChildren(divider).length == 1 ){ while( args.length ...
[ "function flip(e){\n var currCard = aCards[self.currentPage];\n currCard.flip();\n var currView = getCurrentWebView();\n setTheHTML(currView,currCard.currentHTML());\n }", "renderCardNodeFlip(cardInstance) {\n cardInstance.flipCard();\n cardInstance.fetchNode().attr(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders the sendEmails button for hosts.
renderSendEmails() { if (this.state.hosting) { return ( <div> <button className="btn btn-default" onClick={this.sendEmails}> Send Reminder Emails to Guests </button> </div> ) } }
[ "function onSendButtonClicked() {\n let event = new Event(Config.FORGOT_PASSWORD_VIEW.EVENT.SEND_BUTTON_CLICKED, this.emailField.value);\n this.notifyAll(event);\n}", "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "function sendTestMailClicked() {\n\tvar sendbutton = getObj('testmail_send_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Parse the main pattern json file args: json text data global: patternJsonData: Data of each breakout breakoutsList: List of breakout day and symbol patternBreakouts:
function readJsonFile(data) { //console.log(this.result); var obj = JSON.parse(data); // dictionary of symbols containing the breakouts for each symbol patternJsonData = obj[1]; // Breakouts list var breakoutsList = obj[0]; breakoutsList.sort(function (a, b) { return parseInt(b[1])...
[ "function parsePatternJson(jsonPatterns) {\n var patternAnnotations = []\n\n for (var i = 0; i < jsonPatterns.length; i++) {\n var pattern = jsonPatterns[i];\n var name = pattern[\"Name\"];\n\n // Create new pattern annotation objects\n var patternAnnotation = new PatternAnnotation...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
startTracker app & inquirer prompt
function startTracker() { inquirer .prompt({ type: "list", name: "menu", message: "What would you like to do?", choices: [ "View All Employees", "Add Employee", "Update Employee Role", "View All Roles", "Add Role", ...
[ "function startTracker() {\n inquirer.prompt({\n name: 'action',\n type: 'list',\n message: 'What would you like to do?',\n choices: [\n \"View All Departments\",\n \"View All Roles\",\n \"View All Employees\",\n \"Add Department\",\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a DIV ready to append to the page with our zoom and pan controls
function createControls() { var controls = document.createElement('div'); controls.id = 'SVGZoom.controls'; controls.innerHTML = '<div style="position: absolute; left: 4px; top: 4px; z-index: 1004;" unselectable="on">' + '<div id="SVGZoom.panup" style="position: absolute; left: 13px; top: 4px; width: 18p...
[ "function zoomEditView(){\n zoomview.createAndAddOverlay();\n var popup = createPopup();\n var formDiv= createFormDiv();\n var div = document.createElement('div');\n div.className = \"formInDiv\";\n div.appendChild(formDiv);\n popup.appendChild(div);\n documen...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set bio on change
setNewBio(bio) { this.setState({ newBio: bio }); }
[ "setBio(newBio) {\n this.setState({\n bioinfo: newBio\n });\n }", "function bioRecall(newBio) {\n sangerApp.biography = newBio;\n }", "function _changeBio(bioToChangeTo) {\n\t\t\t//If the bio exists - \n\t\t\tconsole.log(info.bios);\n\t\t\tif(info.bios[bioToChangeTo]) {\n\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
global _ / global flotFinance / global ko / global log / global moment / global numeral / global links / global symbols / global async / global defaultValue / global defaultBooleanValue / global defaultNumberValue / global defaultDate / global getLinks / global formatDate / global formatLongDate / global formatAbrevate...
function ViewModel() { var self = this; var url = $.url(); // Data var defaultParams = {}; defaultParams.symbol = '^GSPC'; defaultParams.timePeriod = '3years'; defaultParams.fromDate = null; defaultParams.toDate = null; defaultParams.scale = 'days'; defaultParams.showVolume = tr...
[ "function Model() {\n\t\tthis.dataSeries = ko.observableArray([new Series()]);\n\n\t\tthis.intervalType = ko.observable('most-recent');\n\n\t\tvar currentDate = new Date;\n\t\tthis.startDate = ko.observable(new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), 1));\n\t\tthis.endDate = ko.observable(curren...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggle all inherited members in the class (link in the class title)
function toggleAllClassInherited() { var a = $("#toggleAllClassInherited"); // get toggle link from class title var toggles = $(".toggle-all", $("#doc-content")); if (a.text() == "[Expand All]") { toggles.each(function(i) { toggleAllInherited(this, true); }); a.text("[Collapse All]"); } else {...
[ "function ensureAllInheritedExpanded() {\n var toggles = $(\".toggle-all\", $(\"#doc-content\"));\n toggles.each(function(i) {\n toggleAllInherited(this, true);\n });\n $(\"#toggleAllClassInherited\").text(\"[Collapse All]\");\n}", "function classToggle() {\n\n this.classList.toggle(classOne);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
markerConnectTest(); addLinesAndLinesOnClick(); addHundredLineSingleLayer(); addHundredLineLayers(); addLineOnClick(); addMarkerOnClick(); testDrawMarkerAtUserLocation(); testDrawLine(); testDrawSimpleLineAtUserLocation(); Test ability to add 100 layers with 1 line each. 15 seconds to load and slight lag, probably bett...
function markerConnectTest() { var basePoint = null; var geoJson = null; mapManager.moveToUserLocation(); mapManager.getUserLocation(function () { var basePoint = mapManager.lastUserLocation; var testPointList = []; var testPointIdList = []; for (let i = 0; i < 10; i++) ...
[ "function AddFeatureLayers() {\n if (operationalLayersCollection.length != 0) {\n for (var i = 0; i < operationalLayersCollection.length; i++) {\n var layerId = operationalLayersCollection[i].Key;\n\n if (operationalLayersCollection[i].hasDynamicMapService) {\n var map...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ANIMATE() This function toggles the animate.css class name on the box element
function animate() { console.log("Animate blev kaldt"); // Get the #box element var $box = $("#box"); // Toggle the class $box.toggleClass("animated wobble"); }
[ "setAnimate(state) {\n state\n ? this.area.classList.add('is-animate')\n : this.area.classList.remove('is-animate');\n }", "function animate() {\n // is element in view?\n if (inView()) {\n // element is in view, add class to element\n element.classList.add('animate');\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves information about a newlybooked sear to sessionStorage; removes input data stored in sessionStorage. Calls printPass().
function submitForm() { var columnIdx = oldSeat.getAttribute("id"); var rowIdx = oldSeat.parentNode.getAttribute("id"); seats[rowIdx][columnIdx] = "busy"; if(!sessionStorage.getItem("bookedSeats")) { sessionStorage.setItem("bookedSeats", true); } sessionStorage.setItem("seatsUpd", JSON.stringify(seats)...
[ "function updateSessionStorage()\n{\n //save stickman to session as \"stk_man\"\n stk_man = new Stickman();\n sessionStorage.setItem(\"stk_man\", JSON.stringify(stk_man));\n\n //save History to session as \"hist\"\n sessionStorage.setItem(\"hist\", JSON.stringify(hist.toJSON()));\n\n}", "funct...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an iterator over the map's entries, in reverse key order. If a key is provided, iteration starts immediately before this key.
riterator(key: ?K): SortedMapIterator<K, V> { if (key) { let iter = new SortedMapIterator(this.tree.iterator(), "prev"); iter.next(); // Skip element after this key. return iter; } else { let iter = this.tree.iterator(); iter.prev(); // Advance from null iterator to one pointing ...
[ "function reverseMap(map) {\n var revMap = {};\n\n for (var k in map) {\n revMap[map[k]] = k;\n }\n\n return revMap;\n }", "function make_reverse_iterator(it) {\r\n return it.reverse();\r\n}", "iterator(key: ?K): SortedMapIterator<K, V> {\n if (key) {\n retur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
transform xml document via xslSrc and save to file if modified
function transmorph( xslSrc, file, filterKey, filterValue ) { var result = transform( xslSrc, filterKey, filterValue ); saveFile( result, file ); }
[ "function transform(xml, xsl,target) {\n load(xml, function(inputXml) {\n load(xsl, function(xsltSheet) {\n displayResult(inputXml, xsltSheet,target);\n });\n });\n}", "function transform( xslSrc, filterKey, filterValue, arg )\r\n{\r\n // load the xsl stylesheet\r\n var xsl = new Ac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add new members to the group chat
async addMembersToTalk(parent, args, ctx, info) { // check login if (!ctx.request.userId) { throw new Error('You must be logged in to do that!'); } // check that the user is the member of the talk // TODO // add new members // transform array of members const members = args.member...
[ "async AddMembers(group, members) {\n return await this.AddMember(group, members.join(','));\n }", "addGroup({name, leader, members}) {\r\n // Push group details into list.\r\n this.list.push({name, leader, members});\r\n }", "function addGroupMembers(socket, msg){\n\tvar Members = [];\n\tfor(var i=0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enable sorting on the newly added search results list. TODO: Don't let the user reorder search results.
function enableSorting() { $("#search-results ul").sortable({connectWith: '#playlist ul'}).disableSelection(); }
[ "ascendingOrder() {\n\t\tthis.criterias.orderBy.descending = false;\n\t\tthis.setVisibleResults();\n\t}", "_sortItems() {\n if (this.uninitialized) {\n return;\n }\n if (this._sort.comparator) {\n this._filtered.sort((a, b) => this._sort.compare(a, b));\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function hastimerRestarted Action: After the user is notified the timer is reset. This function checks if the timer has been reset so it can trigger the countdown check again. Parameter: eventAlias > the alias of the event we wish to check the timer Parameter: minutes > the minutes after the timer has been reset | e.g....
function hasTimerRestarted(eventAlias, minutes, timerName){ var timerid=document.getElementById(timers[eventAlias]); var time=timerid.innerHTML; if((time.length<=5 && time.substring(0,2)>minutes)) { //alert('reverse timer is working'); flags[eventAlias]=0; } }
[ "function isTimerEnding(eventAlias, minutes, timerName){\r\n\tvar timerid=document.getElementById(timers[eventAlias]);\r\n\tvar time=timerid.innerHTML;\r\n\tif((time.length<=5 && time.substring(0,2)<minutes) && document.getElementById(eventAlias+'_watch').checked)\r\n\t{\r\n\t\t//alert('Event is about to start:' + ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update slack if there's an endpoint to post to and the status has changed
function shouldUpdateSlack() { var currStatusStr = JSON.stringify(status); console.log('curr', currStatusStr, "last", lastStatusStr) // only update if we have a defined endpoint if (process.env.ENDPOINT && currStatusStr !== lastStatusStr) { updateSlack(); } lastStatusStr = currStatusStr; }
[ "function updateSlack() {\n \n var body = JSON.stringify(createMessage(status));\n \n console.log(\"message\", body)\n \n request({\n method: 'post',\n url: process.env.ENDPOINT,\n headers: {\n 'Content-Type': \"application/json\"\n },\n body: body\n }, function(err, resp, respBody) { \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
clear all the changes
function flushChanges() { self.changes = []; }
[ "clearAll() {\n this.old.clear();\n this.young.clear();\n }", "function flushChanges() {\n\t self.changes = [];\n\t }", "clearChanges() {\n this.changes = {};\n }", "function clearEverything() {\n Action.clear();\n Document.clear();\n DocumentF...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
theHungryProgrammer(['fries', 'fish', 'beer', 'chicken', 'beer', 'eggs'], ['Add spaghetti', 'Shift 0 1', 'Consume 1 4', 'End']);
function theHungryProgrammer(meals, commands) { let count = 0; for (let c of commands) { c = c.split(/\s+/); if (c[0] === 'End') { break; } switch (c[0]) { case 'Serve': if (meals.length > 0) { console.log(meals.pop() + ' served!'); } break; case 'Eat': if (meals.length > 0) { conso...
[ "function warnTheSheep(queue) {\n\nfor(let i=0;i<queue.length;i++){\nif(i===queue.length-1 ){\n\nreturn \"Pls go away and stop eating my sheep\"\n\n}else if (queue[i]==='wolf'){\nlet m=queue.length-(i+1)\nreturn `Oi! Sheep number ${m}! You are about to be eaten by a wolf!`\n }\n }\n }", "function revealMistery (a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the term frequency (tf) of a given term in a document Term frequency is computed as: number of ocurrences of the term /length of document;
calculateTermFrequency(term, doc) { let numOccurences = 0; for (let i = 0; i < doc.length; i++){ if (doc[i].toLowerCase() == term.toLowerCase()){ numOccurences++; } } return (numOccurences * 1.0 / (doc.length + 1)) }
[ "function doTF(c){\n termfrequency = {};\n\n let words = text[c].split(' '); //gives the individual words\n for (let i = 0; i < words.length; i++) {\n //The hasOwnProperty() method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inhe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback once port has been found
function portFound() { global.shipp.log("Open port found. Listening on port " + port); global.shipp.ports.server = port; next(null, port); }
[ "function find_port(callback) {\n let port = null;\n for (;;) {\n port = crypto.randomBytes(2).readUInt16LE(0);\n if (port < MIN_PORT)\n continue;\n if (PORTS.has(port))\n continue;\n PORTS.add(port);\n break;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Close attachment details modal dialogue
function closeAttachmentDetail() { $("#invoiceId", "form#ajaxUploadForm").val(''); $("#transactionId", "form#ajaxUploadForm").val(''); $("#transactionType", "form#ajaxUploadForm").val(''); $('#divAttachment').dialog('close'); }
[ "_close() {\n this.attachmentViewer.close();\n }", "closeModalDialog() {\n set(this, 'approveDeleting', null);\n set(this, 'denyDeleting', null);\n\n this.send('removeModalDialog');\n }", "closeModalDialog() {\n this.set('approveDeleting', null);\n this.set('denyDeleting', ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all mentions and filter by hashtag and favorite flag
getMentions(hashtag) { return this.twitter.getMentions() .then((mentions) => { // filter by favorited flag/hashtag return _.filter(mentions, (m) => { return !m.favorited && m.text.includes(hashtag); }); }); }
[ "replyToMentions(hashtag) {\n return this.getMentions(hashtag)\n .then((mentions) => {\n // debug console.log('Filtered mentions:', mentions);\n return Promise.all(_.map(mentions, (t) => {\n return this.reply(t);\n }));\n });\n }", "function concernedTweets(tweets=[],lookedHashtag=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is called whenever the system recieves a change in the buzzer status.
function handleBuzzerStatusEvent(topic, data) { data = JSON.parse(data); if (data.active == true) { buzzer.activate(jeopardy.getStatusIndicatorElement()); } else { buzzer.deactivate(jeopardy.getStatusIndicatorElement()); } }
[ "function buzzerStatusChanged(event, enabled, round, teams){\n buzzerEnabled = enabled;\n buzzRound = round;\n }", "_checkingHandler() {\n this.state = 1;\n this.lastInfoObject = undefined;\n this.emit('notify-windows', 'checking-for-update');\n this.emit('status-changed',...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the corresponding list of members for the group with the id
async function getGroupMembers(id) { var currId = id; return fetch('https://www.googleapis.com/admin/directory/v1/groups/' + currId + '/members', { headers: { 'authorization': `Bearer ` + token, } }) .then(response => response.json()) .then(data => { var currMembe...
[ "async getGroupMembers(id) {\r\n if(!id) throw 'user id not specified';\r\n\r\n const user = await this.getUserById(id);\r\n const groupInfo = user.profile.groups;\r\n\r\n if(groupInfo.length == 0 || !groupInfo)\r\n {\r\n return [];\r\n }\r\n\r\n const groupID = groupInfo[0]._id;\r\n\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make all pNoses equal to 0, 0
function resetNoses() { for (let i = 0; i < pNoses.length; i++) { pNoses[i] = [0, 0]; } }
[ "function resetpoints() {\n points.rival = 0;\n setVar(\"rprival\",0);\n points.ally = 0;\n setVar(\"rpally\",0);\n points.counselor = 0;\n setVar(\"rpcounselor\",0);\n flags = {\"f1\":0,\"f2\":0,\"f3\":0,\"f4\":0};\n setVar(\"f1\",0);\n setVar(\"f2\",0);\n setVar(\"f3\",0);\n setVar(\"f4\",0)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function will set the given teams as being selected in the UI and in the NFL_PICKS_GLOBAL variable (NFL_PICKS_GLOBAL.selections.teams). It expects the given teams variable to either be... 1. An array of team abbreviations. 2. A comma separated string of team abbreviations. 3. A single team abbreviation. It will pu...
function setSelectedTeams(teams){ //Steps to do: // 1. Check whether the teams variable is an array. // 2. If it is, just keep it. // 3. Otherwise, it's a string so check to see if it has multiple values. // 4. If it does, then turn it into an array. // 5. Otherwise, just put it in there as a single value. // ...
[ "setTeams(state, value) {\n state.leagues[value.league].teams = value.data;\n }", "function updateAvailableTeamOptions(){\n\t\n\t//Steps to do:\n\t//\t1. Get the year values as integers.\n\t//\t2. Go through every team and get when it started and ended.\n\t//\t3. If the year it started is after any of the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
uploadStart : File is sent to server
function uploadStart(event, file) { resetUploadUI(); uploadElement.addClass('uploading'); }
[ "function startUpload() {\n totalUploaded = filesUploaded = 0;\n uploadNext();\n }", "function onUploadStart(event) {\n\t\n\t}", "function startUpload() {\r\n\r\n\ttotalUploaded = filesUploaded = 0;\r\n\tuploadNext();\r\n\r\n}", "function onUploadStart(event) {\n\n}", "function onUploadStar...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if current taxon has been previously created under a taxonName with an appended number by checking the parent of any matching taxonName found. If the parent matches, this taxon has already been created with the proper parent and there is nothing more to do.
function taxonObjWasCreatedWithSharedTaxonym (taxonName, newParentId, tP) { // console.log("taxonObjWasCreatedWithSharedTaxonym called for ", taxonName) var taxonym1 = taxonName + '-1'; return hasBeenCreated(taxonym1); /** Returns true if a taxon record is found with pas...
[ "function hasBeenCreated(taxonym, cnt) {\n if (taxonym in tP.taxaObjs) {\n if ( tP.taxaObjs[taxonym].parent === newParentId ) { return true; \n } else {\n var nextTaxonym = taxonym + '-' + ++cnt;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
25.4.1.8 TriggerPromiseReactions ( reactions, argument )
function TriggerPromiseReactions(reactions, argument) { for (var i = 0, len = reactions.length; i < len; ++i) EnqueueJob('PromiseJobs', PromiseReactionJob, [reactions[i], argument]); return undefined; }
[ "function TriggerPromiseReactions ( reactions, argument ) {\n reactions.forEach(function( reaction ) {\n EnqueueTask(PromiseReactionTask, [reaction, argument]);\n });\n }", "function TriggerPromiseReactions (reactions, argument) {\n for (var i = 0, len = reactions.length; i < len; ++i) { EnqueueJob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add all members of a group as participants of a competition.
async function addAllGroupMembers(competition, groupId) { // Find all the group's members const members = await groupService.getMembers(groupId); // Manually create participations for all these players await Participation.bulkCreate(members.map(p => ({ competitionId: competition.id, playerId: p.id }))); // ...
[ "async function addAllGroupMembers(competition, groupId) {\n if (!competition) {\n throw new BadRequestError('Invalid competition.');\n }\n\n if (!groupId) {\n throw new BadRequestError('Invalid group id.');\n }\n\n // Find all the group's members\n const members = await groupService.getMembers(groupId)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Basic Evolutionary Game Theory Tools / Find the 4 nearest neighbors. Argument: site Optional BOOLEAN argument: non_empty_sites
function find_neighbors(site, strategy, non_empty_sites) { non_empty_sites = default_val(non_empty_sites, true); var size = Math.floor(Math.sqrt(strategy.keys().length)), hood = [site - 1, site + 1, site - size, site + size] .map(function(d) { return d % size; }); console.log(size, site, hood); ...
[ "addNeighbors(game, grid){\r\n this.neighbors = []; // start with empty neighbors\r\n let col = this.loc.x/game.w;\r\n let row = this.loc.y/game.w;\r\n let n,ne,e,se,s,sw,w,nw = null; // all eight neighbors\r\n\r\n if(row > 0 ){\r\n n = grid[col][row-1];\r\n if(!n.occupied && !n....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Params form Div
function getParamsForDiv( trackedEntityDiv) { var params = ''; jQuery("#" + trackedEntityDiv + " :input").each(function() { var elementId = $(this).attr('id'); if( $(this).attr('type') == 'checkbox' ) { var checked = jQuery(this).attr('checked') ? true : false; params += elementId + "...
[ "function getParamsForDiv( patientDiv)\r\n{\r\n\tvar params = '';\r\n\tjQuery(\"#\" + patientDiv + \" :input\").each(function()\r\n\t\t{\r\n\t\t\tvar elementId = $(this).attr('id');\r\n\t\t\t\r\n\t\t\tif( $(this).attr('type') == 'checkbox' )\r\n\t\t\t{\r\n\t\t\t\tvar checked = jQuery(this).attr('checked') ? true : ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a sudoku cell, returns the row
function returnRow(cell) { return Math.floor(cell / 9); }
[ "function returnRow(cell) {\n return Math.floor(cell / 9);\n}", "function returnRow(cell) {\n return Math.floor(cell / 9);\n}", "function getRow(cell)\n {\n let result = -1;\n if(cell !== undefined)\n {\n result = cell.dataset.row;\n }\n return result;\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Recreate the array of identities for a given account.
function recreateIdentities(universe, accountId, oldIdentities) { let identities = []; for (let [,oldIdentity] in Iterator(oldIdentities)) { identities.push({ id: accountId + '/' + $a64.encodeInt(universe.config.nextIdentityNum++), name: oldIdentity.name, address: oldIdentity.address, re...
[ "function recreateIdentities(universe, accountId, oldIdentities) {\n var identities = [];\n for (var iter in Iterator(oldIdentities)) {\n var oldIdentity = iter[1];\n identities.push({\n id: accountId + '/' + $a64.encodeInt(universe.config.nextIdentityNum++),\n name: oldIdentity.name,\n addre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filters items by code and title
function search(text) { text = text.toLowerCase(); var container = $("#catalog"); // clear everything $(container).html(''); // paint only items that fullfil the filter for (var i = 0; i < DB.length; i++) { var item = DB[i]; // decide if the items fullfils the filter //...
[ "function filterFun(item) {\n const e = item.title;\n return (\n e.includes(\"covid\") ||\n e.includes(\"COVID\") ||\n e.includes(\"coronavirus\") ||\n e.includes(\"Coronavirus\")\n );\n}", "function filterItems(item) {\n // search is not case sensitive\n return (item.description !== undefin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
20th March: assign minmax for a field using MeterID:
function assignMinMaxOnMeterID(meterID) { if (Object.keys(minmaxjson).length > 0) { json = minmaxjson; if (json[meterID] != undefined) { let sorteddependencyarray = json[meterID].sort(function (b, a) { return Object.keys(a["dep"]).length - Object.keys(b["dep"]).length }); ...
[ "function setMinMaxAtt() {\r\n let date = moment().format('YYYY-MM-DD');\r\n console.log(date);\r\n minDate.setAttribute('min', date);\r\n //\r\n\r\n let date2 = moment().add(15, 'days').format('YYYY-MM-DD');\r\n console.log(date2);\r\n minDate.setAttribute('max', date2);\r\n}", "updateMinMax...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resizes an image before it gets sent to the server. This function is the default behavior of `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with the resized blob.
resizeImage(file, width, height, resizeMethod, callback) { return this.createThumbnail(file, width, height, resizeMethod, true, (dataUrl, canvas)=>{ if (canvas == null) // The image has not been resized return callback(file); else { let { resizeMimeType: resiz...
[ "resize(imageOptions = {}, callback) {\n const allowedImageOptions = this.filterImageOptions(imageOptions)\n const imagePath = path.join('public', allowedImageOptions.path)\n const readStream = fs.createReadStream(imagePath)\n\n if (!imageOptions.path) { this.throwError() }\n\n let storage = safeImag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function is called to set up our Highlight Images
function SetHighlight () { if( showHighlight == true ) { // Enable images if they are off if( highlightBase != null && highlightBase.gameObject.activeInHierarchy == false ) highlightBase.gameObject.SetActive( true ); if( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == fa...
[ "function setupHighlighters(){\n\tfor(var i=0; i< num_highlighters; i++){\n\t\thighlighter[i] = svgHotteness.append(\"circle\")\n\t\t\t.classed(\"highlighter\", true)\n\t\t\t.attr(\"stroke\", \"rgb(255,0,0)\")\n\t\t\t.attr(\"fill\", \"green\")\n\t\t\t.attr(\"r\", 1)\n\t\t\t.attr(\"stroke-opacity\", .3)\n\t\t\t.attr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a debugging function to turn on showing of url
function showURL() { SETTINGS.SHOWURL = true; setFloatURL(loadedURL); }
[ "_showUrl(url) {\n let urlText = url;\n if (urlText.length > this._config.CUT_URL_LENGTH) {\n urlText = url.substr(0, this._config.CUT_URL_LENGTH) + '...';\n }\n\n $(this._selector).find('.observation a')\n .attr('href', url)\n .text(urlText);\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get the path Length of a SVG path and set Dashoffest and Dasharray to the length of the path
function getPathLength(el) { var pathLength = el.getTotalLength(); // console.log(pathLength); el.style.strokeDashoffset = pathLength; el.style.strokeDasharray = pathLength; }
[ "function dottedLen(path) {\n\t var s=path.style['stroke-dasharray'];\n\t var r=s.split(\",\");\n\t return parseFloat(r[0])+parseFloat(r[1]);\n }", "function pathLength() {\n\t\tvar l = this.getTotalLength();\n\t\treturn -l;\n\t}", "GetPathLength(path) {\n let path_distance = 0;\n for (let j = 0; j < ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns final excavation state for the tunnel ROOM | TUNNEL | ANTEROOM | DOOR tunneled into an existing open space CLOSED fully excavated tunnel, ending on closed space DUNGEONOVERLAP can't excavate; outside the level bounds PREFABOVERLAP can't excavate: overlapping room prefab ROOMCORNEROVERLAP can't excavate: touches...
excavate(startPosition, direction, stepLength, tunnelWidth) { this.direction = direction this.tunnelWidth = tunnelWidth const radius = (this.tunnelWidth - 1) / 2 if (this.direction === 'EAST') { Object.assign(this, { x: startPosition.x+1, y: startPosition.y-radius, width: 0, height: this.tunnelWi...
[ "function TravelRHR() {\n\tif (gridArr[OPC.currentPos].room == \"ST\") { // check to see if it's time to exit the dungeon\n\t\topenCounter = 0; // open amount on map\n\t\tfor(i = 0; i < gridArr.length; i++) {\n\t\t\tif(gridArr[i].open > 0) {\n\t\t\t\topenCounter ++;\n\t\t\t}\n\t\t}\n\t\texploredCounter = 0; // expl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TOGGLE EXTERNAL PIN ////////////////////////////////////////// triggered by: user click arguemnts: MID what it does: just send a msg to the server why: to activate / deactivate external devices ///////////////////////////////////////// TOGGLE EXTERNAL PIN
function toggle_external_pin(mid){ if(is_button_active("#"+mid+"_toggle_setupcontrol")){ return; }; var b=$("#"+mid+"_toggle_extension_text"); if(b.length){ b.text("wait.."); }; var cmd_data = { "cmd":"toggle_external_pin", "mid":mid}; con.send(JSON.stringify(cmd_data)); }
[ "function turnPinOn(e) {\n\te.writeSync(0);\n}", "function toggle(state, pin) {\n var Relay = new Gpio(pin, 'out');\n if (state = 1) {\n Relay.writeSync(1);\n } \n else if (state = 0) {\n Relay.writeSync(0);\n } \n else {\n console.error(new error(\"invalid argum...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the Browsersync server. Watches for file changes in the 'src' folder.
function serve() { const options = { server: { baseDir: BUILD_PATH }, open: false // Change it to true if you wish to allow Browsersync to open a browser window. } browserSync(options) // Watches for changes in files inside the './src' folder. gulp.watch(`${SOURCE_PATH}/**/*.js`, ['watch...
[ "function serve() {\n\n var options = {\n server: {\n baseDir: BUILD_PATH\n },\n open: false // Change it to true if you wish to allow Browsersync to open a browser window.\n };\n\n browserSync(options);\n\n // Watches for changes in files inside the './src' folder.\n gulp.watch(SOURCE_PATH + '/*...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Destroy all created popovers
function destroy() { $(config.popoverClass).remove(); // Unbind all events. $.each(config.events, function(index, event) { $(document).unbind(event); }); $(document).trigger(config.events.destroyed); }
[ "function clearPopovers ($popover) {\n $(clearSelector).not($popover).popover('hide');\n }", "function clearPopOver() {\n $('.popover').remove();\n}", "function removePopover(id)\n\t{\n\t\t$(id).popover('destroy')\n\t}", "destroy () {\n\n tiny.off(this.container, highlightEvent, this._highli...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initalize the Admin Menu Tabs class.
static init() { const adminMenuTabs = new AdminMenuTabs(); adminMenuTabs.binds(); adminMenuTabs.setActiveTab(); }
[ "function init_tabs () {\n var tabs = $ ('#tabs');\n tabs.tabs ({\n /*\n * Display a Wordpress spinner.\n *\n * See: https://make.wordpress.org/core/2015/04/23/spinners-and-dismissible-admin-notices-in-4-2/\n */\n 'beforeLoad' : function (event, ui) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used to store the current `_frameDeltaTime` and override the current delta with a static value This method should be called immediately before performing calculations for an aircraft's future path. Immediately after those calculations are performed, `.restoreDeltaTimeAfterFutureTrackCalculation()` should be called so p...
saveDeltaTimeBeforeFutureTrackCalculation() { this._futureTrackDeltaTimeCache = this._frameDeltaTime; this._frameDeltaTime = SIMULATION_RATE_FOR_TRACK_PROJECTIONS; }
[ "restoreDeltaTimeAfterFutureTrackCalculation() {\n this._frameDeltaTime = this._futureTrackDeltaTimeCache;\n this._futureTrackDeltaTimeCache = -1;\n }", "updateTimeProperties () {\r\n this.timeAtThisFrame = new Date().getTime();\r\n\r\n // divide by 1000 to get it into seconds\r\n this.t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Only attackers fall back
function onlyAttackersFallBack() { console.log("Attackers FallBack"); for (let name in Game.creeps) { let creep = Game.creeps[name]; if (creep.memory.role == "attacker") { creep.memory.order = "go_home"; } } }
[ "attack() {}", "static getFallbackAttacks(npc) {\n return [{ // array of 1 attack\n damageDice: '1d1',\n magicalModifier: 0,\n attacksPerRound: 1,\n verb: 'attack',\n // range: 0, \n }]\n }", "function findNoAttackers(defender) {\n var noAttackers = [];\n for (var type in t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Type guard to ensure that a given value is a `AwsRegion`
function isAwsRegion(region) { return (typeof region === "string" && /^(us|eu|af|ap|me|sa|ca)\-(north|south|east|west|central|northeast|southeast)\-[1-3]$/.test(region)); }
[ "function isRegionProvider(arg) {\n return arg.getRegion !== undefined;\n}", "function assertValidRegion({region}) {\n return region;\n}", "function requireRegion() {\n if (vars_1.region === undefined) {\n throw new Error(\"No AWS region has been configured\");\n }\n return vars_1.region;\n}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unsubscribes specified channel by updating channels at Parse.com
function unsubscribe(channel) { var deferred = $q.defer(), parse = config.parse; instance.then(function instanceSuccess() { var index = parse.channels.indexOf(channel); if(index >= 0) { parse.channels.splice(index, 1); _updateParseInstallation().then(function updateParseInstallationSuc...
[ "unsubscribeChannels() {}", "unsubscribe(channel) {\n // already subscribed ?\n var existingSubscribers = this.subscribersByChannel.get(channel);\n // unable to cancel if not existing channel\n if (!existingSubscribers) {\n return;\n }\n\n if (existingSubscribers > 1) {\n // only remov...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PUT /markets/ update market
function updateMarket(data, callback) { $.ajax({ url: 'markets/', type : 'PUT', data: JSON.stringify(data), contentType: "application/json;charset=utf-8", success: function (res, textStatus) { callback(res, textStatus); }, error: function (res, tex...
[ "async function trySetMarket(currency) {\n\tconst market = await bittrex.getMarket(currency);\n\tif (!market) {\n\t\treturn log('no such market');\n\t}\n\tctx.currentMarket = market;\n\tctx.updated();\n\n\tawait updateTicker();\n}", "function setMarket(market) {\r\n\r\n\tsettings.market = market;\r\n\t$('#setting...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
disconnect and delete user when closing window
handleWindowClose(event) { event.preventDefault(); const data = { id: this.state.userId }; Actions.disconnectUser(data); // warn server that client got disconnected emitUserDisconnected(io); return true; }
[ "_onDisconnect () {\n\t\twinston.info(`Client ${this.user.id} disconnected.`);\n\t\tthis.removeAllListeners();\n\n\t\troomManager.removeUserFromAll(this.user);\n\t\tuserManager.remove(this.user);\n\t\tthis.prompt = null;\n\t}", "function disconnect_user() {\n //pkt = {\"action\":\"disconnect\"}\n //ws.send(JSON...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loads an image from a url encodes as a base64 string and display on texture not used
async getTextureFromURL(url) { var url = "http://169.254.100.32:8080/captureKinectImage"; fetch(url).then((response) => { response.arrayBuffer().then((buffer) => { var base64Flag = 'data:image/jpeg;base64,'; var imageStr = arrayBufferToBase64(buffer); ...
[ "function textwise_real_image_url(url) {\r\n\tvar imageloader = new Image();\r\n\timageloader.src = url\r\n\treturn imageloader.src;\r\n}", "function loadTextureFromServer(filename) {\r\n return new Promise((resolve, reject) => {\r\n let xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onload = functi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sends an email based on message message should be a 3 tuple of email, subject, Content delimiter = ","
function sendEmail(sender_psid, message){ let parts = message.split(","); DatabaseUtils.getEmailToken(sender_psid).then( (token) => { let response; if(!token){ response = { text: "Email not setup yet", } sendMessage(sender_psid, response); return; } EmailUtils.sendMai...
[ "function mailer(to, posts) {\n posts.forEach(function(post) {\n message += \"<li><a href='\";\n message += post.url;\n message += \"'>\";\n message += post.title;\n message += \"</a></li>\";\n });\n \n message += \"</ul>\";\n \n console.log(message);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Shorthand to dispatch a mouse event on the specified coordinates.
function dispatchMouseEvent(node, type, x = 0, y = 0, event = createMouseEvent(type, x, y)) { return dispatchEvent(node, event); }
[ "function dispatchMouseEvent(node, type, x, y, event) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (event === void 0) { event = createMouseEvent(type, x, y); }\n return dispatchEvent(node, event);\n }", "function dispatchMouseEvent(node, type, x, y, event) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loadCanvas requests for the canvas object from the server for the project which the user wants to view. Once the canvas has been loaded, we hook the socket handlers and canvas handlers and reset the state.
loadCanvas(projectName, sessionIdentifier) { console.log(`Received a request to loadCanvas, name: ${projectName}, ${sessionIdentifier}`); api.getCanvasJSON(projectName) .then((json)=> { var canvas = this.state.canvas; if (canvas == null) { canvas = new fabric.Canvas('c', { ...
[ "async function OnCanvasLoad() {\n\tif (pendingUpdate) Update();\n}", "prepareCanvas() {\n this.prepareDrawingCanvas();\n this.preparebrushCanvas();\n this.loadSelectedImage();\n }", "function initCanvas() {\n if(isDebugged) {\n debug.style.display = \"block\";\n } else {\n debug.s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if there is any element on the web page that contains "contact" word in it's text. If yes than return the link
function getUrlToContactUsWebPage($){ var contactURL = ""; $("a").each(function(i, elem){ var text = $(this).text(); var regex = /contact/i; if(regex.test(text)){ contactURL = $(this).attr('href'); } }); return contactURL; }
[ "link(linkText, inDocument, inWindow) {\n var links = inDocument.getElementsByTagName('a');\n for (var i = 0; i < links.length; i++) {\n var element = links[i];\n if (PatternMatcher.matches(linkText, Utils.getText(element))) {\n return element;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function that checks for the winner of the fight depending on the player's health.
function winnerCheck() { //result is defaulted to "no winner" var result = "no winner"; //if both players' healths are less than 1 or equal to 0 or less, then both players die at the end of the round. if (fighters[0].health < 1 && fighters[1].health < 1) { resul...
[ "playerHealth(value) {\n if (value <= 0 && this.monsterHealth <= 0) {\n // It is draw\n this.winner = 'draw';\n } else if (value <= 0) {\n // The monster won\n this.winner = 'monster';\n }\n }", "checkWinCondition() {\n for(const player of this.getPlayersInFirs...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stores the feedback submitted by the customers.
function storeFeedback() { let url = URL + "feedback"; let params = new FormData(id("feedback")); fetch(url, { method : "POST", body : params }) .then(checkStatus) .then(response => response.text()) .then(displaySuccess) .catch(handleRequestError); }
[ "save() {\n this.firestoreService.add(`feedback`, this.model).then(() => {\n this.toast(this.translate.instant('feedback-component.success-message'));\n this.closeModal();\n });\n }", "function submitFeedback() {\n feedbackForm.submit();\n}", "function saveFeedback() {\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function modifies the data.narrow filters to use integer IDs instead of strings if it is supported. We currently don't set or convert user emails to user IDs directly in the Filter code because doing so breaks the app in various modules that expect a string of user emails.
function handle_operators_supporting_id_based_api(data) { const operators_supporting_ids = new Set(["dm", "pm-with"]); const operators_supporting_id = new Set([ "id", "stream", "sender", "group-pm-with", "dm-including", ]); if (data.narrow === undefined) { ...
[ "function filterUsers() {\n var usersIds = getUsersId();\n return allUsers.map(function(el) {\n if (!el.universal && usersIds.indexOf(el.id) < 0) {\n return el;\n }\n });\n }", "setIdFilter(value) {\n const values = Utils.isArray(value) ? value : [value];\n // Initialize o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
called on change of playlist select element
function changePlaylist() { // clear track specific data $("#trackName").empty(); $("#trackRating").val("(Rate track)"); var playlistIndex = $("#playlist").val(); if (playlistIndex == "select") { $("#playlistPlayer").empty(); } else { // load selected playlist on page var userLib = Library.forCur...
[ "function onPlaylistSelect() {\n var selectedPlaylistObj = getSelectedPlaylist(playlistSelector),\n selectedPlaylist = playlistData[selectedPlaylistObj.playlistIndex];\n\n switch (selectedPlaylist.type) {\n case 'EXPLICIT':\n videoIds = selectedPlaylist.video_ids;\n break;\n case ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws the I mesh using vertex and color buffers.
function drawIMesh (){ var vertexBufferData = triangleBufferDataFromVertices(letterVertices); // Setup the color buffer for the vertex colors. var vertexColorBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer); var colorSet = [ [1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 1...
[ "function drawMesh() {\n ctx.beginPath();\n for (let yl = 1; yl < col; yl++) {\n ctx.moveTo(cellSize * yl , 0);\n ctx.lineTo(cellSize * yl , height);\n }\n for (let xl = 1; xl < row; xl++) {\n ctx.moveTo(0 , cellSize * xl);\n ctx.lineTo(width , cellSize * xl);\n }\n ctx.lineWidth = 1;\n ctx.strok...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the RAM size in bytes.
getRamSize() { let kb; switch (this.ramSize) { case RamSize.RAM_4_KB: kb = 4; break; case RamSize.RAM_16_KB: kb = 16; break; case RamSize.RAM_32_KB: kb = 32; break; ...
[ "static get systemMemorySize() {}", "get ramSize() {\n return this.getNumberAttribute('ram_size');\n }", "get memorySize() {\n return this.getNumberAttribute('memory_size');\n }", "ramSize() {\n return `${_.sample(['4', '6', '8', '16', '32', '64'])}GB`;\n }", "static get MAX_BYTES() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove unnecessary auto added dependency:
function removeDependencies() { if (!fs.existsSync(DIST_LIB_PATH)) { return; } fs.writeFileSync(DIST_PACKAGE_PATH, JSON.stringify( { ...getPackage(DIST_PACKAGE_PATH), dependencies: undefined, }, null, INDENTATION, ), ); }
[ "ignore() {\n const reg = /^\\.{0,2}\\//;\n const deps = this.dependencies.filter((dep) => reg.test(dep));\n\n this.dependencies = deps;\n }", "resetDependencies() {\n // we only need to resolve new dependencies if we're an automatic custos\n if (this.auto) this.needsLayout = true;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Connect to a server as a client. hostnameHostname to connect to nickDesired nickname
function IRC_client_connect(hostname,nick,username,realname,port,password) { var sock; if (!port) port = 6667; if (!username) username = "irclib"; if (!realname) realname = IRCLIB_VERSION; if (js.global.ConnectedSocket != undefined) { try { sock = new ConnectedSocket(hostname, port); } catch(e) { ...
[ "_connectToHost() {\n let selectedServers = this.serverList.listbox.selected;\n Client\n .connect(selectedServers ? selectedServers[1] : this.ip.text)\n .then(() => Client.emit(\"setNick\", this.nick.text))\n .then(() => {\n Client.user.nick = this.nick.text;\n this.canvas\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[setImage(color)] injects the carSVG with a color [color] into the 'div.modalimg' element in the DOM
function setImageColor(color) { const icon = document.querySelector('.modal--img'); icon.innerHTML = carSVG(color); }
[ "function setColor(value){\n\tvar colorComponent = document.getElementById('color');\n\tcolorComponent.innerHTML = value;\n // set images\n\tvar imgColorProduct = product.imgColors.find(result => result.color === value); // find object by color\n\tdocument.getElementById('image-a').src = imgColorProduct.img[0]....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
\brief Return a free obj_id
function neoip_xdomrpc_cb_new_obj_id(obj) { var obj_id; // draw a new random obj_id until a free one is found do { obj_id = Math.floor(Math.random() * 65536); }while( neoip_xdomrpc_cb_arr[obj_id] != null ); // return the obj_id return obj_id; }
[ "function getFreeId() {\n let id;\n let testing = 1;\n while (getItem(toStringId(testing))) {\n testing += 1;\n }\n return toStringId(testing);\n}", "function getFreeId() {\n while(entities[nextId] !== undefined) {\n nextId++;\n }\n return nextId++;\n}", "function getLastUsedId(priva...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new V1EarlyStopping.
constructor() { V1EarlyStopping.initialize(this); }
[ "constructor() {\n\n V1EarlyStopping.initialize(this);\n }", "constructor() { \n \n V1Environment.initialize(this);\n }", "constructor() {\n\n V1Stage.initialize(this);\n }", "constructor() {\n\n V1TFJob.initialize(this);\n }", "constructor() {\n\n V1Run...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format a value into a displayfriendly, humanreadable fashion. `null` is formatted as `'null'` Strings are formated with flanking pair of quotes. Arrays are formatted with flanking pair of square brackets.
function formatAsFriendlyString(value) { if (value === null) { return 'null'; } else if (Array.isArray(value)) { return '[' + value.map(function (v) { return formatAsFriendlyString(v); }).join(',') + ']'; } else if (typeof value === 'string') { return "\"" + value + "\""; ...
[ "function formatAsFriendlyString(value) {\n if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return '[' + value.map(function (v) {\n return formatAsFriendlyString(v);\n }).join(',') + ']';\n } else if (typeof value === 'string') {\n return \"\\\"\" + value + \"\\\"\"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create the hero text from the style name
function createHeroText(beerName){ var styleHeroName = '<div class="mdl-grid style_name">{{beerName}}</div>'; return styleHeroName.replace('{{beerName}}', beerName); }
[ "createTitleText() {\n\t\tvar pressStartText = \"Toque na tela \\npara começar!\";\n\t var pressStartStyle = { font: \"bold 18px Arial\", fill: \"#ff0044\", align: \"center\" , stroke: '#000000', strokeThickness: 6};\n\t this.pressStart = this.add.text(this.world.centerX - 55, 150, pressStartText, pressStartS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the structure type is undefined, create a new one.
checkStructureType (structureType) { return structureType === null ? { type: 'producer_structure', harvestingWeeks: new Set(), continuousProduction: false, turnipYield: 0 } : structureType }
[ "function StructType() {}", "function postFlowAction$SetStructureType() { \n /* Check if the StructureType property exists in memory with a value; if so, assign StructureType with the existing value; otherwise assign an initial/default value of \"\".*/\n var unit = pega.ui.ClientCache.find('pyWorkPage.BCU.Sele...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When Display parking areas button is clicked, it will change its text to "Hide parking areas" and add markers When Hide parking areas button is clicked, it will change its text to "Display parking areas" and remove all markers
function ToggleParkingAreas(markerList){ let x = document.getElementById("ParkingAreas"); if (x.innerHTML === "Display Parking Areas") { x.innerHTML = "Hide Parking Areas"; FetchCarparkData(carparkList); } else { let length = markerList.length; for (let i = 0; i < length...
[ "function hideMarker() {\n if (this.textContent === 'Restaurants') {\n if (toggle) {\n map.removeLayer(fusionMarker);\n map.removeLayer(indianMarker);\n map.removeLayer(goldenMarker);\n toggle = false;\n } else {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the state of the item begins with the given state or one of the given states
function isState(item, state) { var value = (item.State || "").toLowerCase(); if (angular.isArray(state)) { return state.some(function (stateText) { return _.startsWith(value, stateText); }); } else { return _.startsWith(value, state); } }
[ "[symbols.itemMatchesState](item, state) {\n const base = super[symbols.itemMatchesState] ?\n super[symbols.itemMatchesState](item, state) :\n true;\n if (!base) {\n return false;\n }\n const text = this[symbols.getItemText](item).toLowerCase();\n const filter = state.filter && state.f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes typeof from object.prototype
function deregister() { if (Object.prototype.typeOf === boundTypeOf) { Object.prototype.typeOf = otypeof; otypeof = undefined; } }
[ "function unBoxMethods(object, prototype) {\n if (!object || typeof object['traits'] === 'undefined') {\n return object;\n }\n var names = Object.getOwnPropertyNames(prototype);\n var mangle = '$Bg';\n for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\n var name_1 = names_1...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
2 functions validate() is to check if numbers are correct, and make() is to establish the grade using a equation
function validate() { declareVar(); //Validate if (first == "" || second == "" || third == "") { document.getElementById("demo").innerHTML = ("Please enter numbers in each box."); return false; } else if (first < 0 || first > 100) { document.getElementById("demo").innerHTML = (...
[ "function assignGrade () {\r\n var grade = Math.floor(document.projectThree.inputOne.value); // collects input from grade input box\r\n var gpa = document.projectThree.inputTwo.value; // collects input from GPA? input box\r\n var honors = document.projectThree.inputThree.value; // collects input from Honor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search for 15(default number) tweets with a hashtag.
function search(hashtag, resultType){ var params = { q: hashtag, // REQUIRED result_type: resultType, //mixed,recent or popular lang: 'en' } Twitter.get('search/tweets', params, function(err, data) { if (!err) { console.log('Found tweets: ' + data.statuses.length); console.log('First one: ' + data.sta...
[ "function searchTopHashes(){\n let tweets = streams.home;\n for(var i = 0; i < tweets.length; i++){\n if(tweets[i].message.includes('#')){\n let hashStart = tweets[i].message.indexOf('#');\n let hashCut = tweets[i].message.slice(hashStart+1);\n\n if(streams.topHashes[hashCut] !== und...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register a callback for whne the image's title changes
onDidChangeTitle (callback) { const renameSubscription = this.file.onDidRename(callback); this.subscriptions.add(renameSubscription); return renameSubscription; }
[ "onDidChangeTitle(callback) {\n return this.emitter.on('did-change-title', callback)\n }", "onDidChangeTitle (callback) {\n const renameSubscription = this.file.onDidRename(callback)\n this.subscriptions.add(renameSubscription)\n return renameSubscription\n }", "_onTitleChanged() {\n this.t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }