Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
dash before all cap letters, including first for WebkitTransform => webkittransform
function toDashedAll(str) { return str.replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dasherize(strText)\n{\n var intPos = 0;\n while (intPos < strText.length) {\n var strCarac = strText[intPos];\n var intAscii = ord(strCarac);\n if ((!empty(strCarac)) && (strCarac == strCarac.toUpperCase()) && (((intAscii >= 48) && (intAscii <= 57)) || ((intAscii >= 65) && (intA...
[ "0.6951775", "0.6756827", "0.67321754", "0.6595519", "0.64716977", "0.64716977", "0.64716977", "0.64716977", "0.64716977", "0.64716977", "0.6413287", "0.6413287", "0.6413287", "0.6413287", "0.63865757", "0.63447744", "0.6310986", "0.6255228", "0.6203943", "0.6203943", "0.6203...
0.58940583
50
munge timelike parameter into millisecond number '0.4s' > 40
function getMilliseconds(time) { if (typeof time == 'number') { return time; } var matches = time.match(/(^\d*\.?\d*)(\w*)/); var num = matches && matches[1]; var unit = matches && matches[2]; if (!num.length) { return 0; } num = parseFloat(num); var mult = msUnits[unit] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ms_seconds(x){ return x / 1000;}", "function secToMs(time) {\n return time * 1000;\n}", "function secToMs(time) {\n return time * 1000;\n}", "static timeToMilli(/*String*/ time) {\n let sign = 1;\n time = time.trim();\n if (time.startsWith('-')) {\n sign = -1;\n ...
[ "0.7070455", "0.6705883", "0.6697832", "0.66274965", "0.6506226", "0.645973", "0.6459349", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0.63458616", "0....
0.6378923
7
every 30min to check & reset auto_inc.
function resetAutoInc() { THK.DB.resetAutoInc(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshTimer() {\n clearInterval(autoAdvanceTimer);\n autoAdvanceTimer = setInterval(autoAdvance, 10000);\n}", "initForAutoTickInterval() {\n this.firstTickCount = null;\n }", "function startInterval() {\n let collectionInterval = setInterval(calcAutoUpgrade, 3000);\n\n}", "function start...
[ "0.624415", "0.62314993", "0.6081814", "0.59722954", "0.587263", "0.57993275", "0.577554", "0.5767103", "0.5765425", "0.5760425", "0.57544935", "0.56662595", "0.5637486", "0.56254643", "0.5612684", "0.5593709", "0.5558431", "0.5546653", "0.55387187", "0.55377847", "0.55204374...
0.5275861
48
Load plugin into page.
function loadPlugin() { this.fs = document.createElement("embed"); this.fs.style.position = "absolute"; this.fs.style.left = "-9999px"; this.fs.id = "fs2"; this.fs.setAttribute("type", "application/x-thk-nico-dl"); document.documentElement.appendChild(this.fs); fs2 = document.getElementById...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPlugin($){\n\n\t\t\tif( !options.jqueryUrl.wasAlreadyLoaded ){\n\t\t\t\twindow.jQuery_loadedByMochup = $;\n\t\t\t}\n\n\t\t\tif( !(window.JSON && JSON.stringify) && options.jsonUrl ){\n\t\t\t\t$.getScript( options.jsonUrl );\n\t\t\t}\n\n\t\t\tif( $.fn.mochup ){\n\t\t\t\t$(options.scope).mochup();\n\t\t...
[ "0.66210955", "0.6481543", "0.6365908", "0.63299286", "0.6037717", "0.597393", "0.5954654", "0.59455156", "0.593641", "0.58170253", "0.581269", "0.5741249", "0.57350206", "0.57270074", "0.57204866", "0.5720447", "0.57045627", "0.57045627", "0.5681664", "0.5654946", "0.5654946...
0.6645459
0
from plugin call back, and write data into 'localStorage'
function plugin_callback() { if(arguments.length > 0) { var _action = arguments[0]; if(_action=="DLProgress") { THK.DB.insertIntoPluginMsg( {action: _action, progress: arguments[1], vid: arguments[2], msg:""} ); } else if (_action=="addNewDL") { var dir_path ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function storeLocal() {\n $.get(\"/api/commander\").then(function(results) {\n localStorage.setItem(\"mtgCommanders\", JSON.stringify(results));\n $.get(\"/api/league_data\").then(function(data) {\n localStorage....
[ "0.73840785", "0.70705163", "0.70580685", "0.7009254", "0.6964983", "0.6941392", "0.69156826", "0.68396354", "0.6757029", "0.6738562", "0.66834855", "0.6669416", "0.6654523", "0.6631487", "0.66187453", "0.6602049", "0.65917957", "0.6585603", "0.65775245", "0.65617806", "0.655...
0.0
-1
export/return localStorage to other script
function getOptionSetting() { return localStorage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeLocal() {\n $.get(\"/api/commander\").then(function(results) {\n localStorage.setItem(\"mtgCommanders\", JSON.stringify(results));\n $.get(\"/api/league_data\").then(function(data) {\n localStorage.setItem(\"data\", JSON.stringify(data));\n window.location.replace(\"/setup\...
[ "0.7236938", "0.6945726", "0.68950075", "0.6745221", "0.6719346", "0.6686792", "0.6645001", "0.6641036", "0.66242146", "0.6617526", "0.65792066", "0.65688664", "0.6567359", "0.65517354", "0.6543976", "0.65065813", "0.64971924", "0.6494584", "0.6493671", "0.6451862", "0.644675...
0.63259476
47
translate x, y, height and width to left, right, top, bottom
function translateToRect(_rect) { var that = {}; // convert konva rect/image to an object that contains x, y, width and height var rect = _rect.attrs || _rect; that.left = rect.x, that.right = rect.x + rect.width, that.top = rect.y, that.botto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trackTransforms(x, y, w, h) {\n\toriginX = x;\n\toriginY = y;\n\toriginWidth = w;\n\toriginHeight = h;\n}", "setElementPixelPositions(left, right, bottom, top) {\r\n // entire image width, height\r\n let imageW = this.mTextureInfo.mWidth;\r\n let imageH = this.mTextureInfo.mHeight;\...
[ "0.66692394", "0.6642488", "0.65538204", "0.6451788", "0.6298046", "0.62616855", "0.62590784", "0.62204707", "0.6209477", "0.62030077", "0.6182592", "0.61712277", "0.61609864", "0.6151473", "0.61015105", "0.6097363", "0.60965466", "0.6085121", "0.60769886", "0.6073049", "0.60...
0.5760653
58
Used for exposing Scene related API
function Scene(config) { this.config = config; this.___init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Scene() {}", "function Object_Scene() {\n Object_Scene.__super__.constructor.call(this);\n\n /**\n * Indicates that the scene is still in prepare-state and not ready yet.\n * @property preparing\n * @type boolean\n */\n this.preparing = true;\n\n /**\n * The behavior-componen...
[ "0.82457346", "0.75198793", "0.70682514", "0.70682514", "0.69555265", "0.6951978", "0.6944452", "0.69269437", "0.69242275", "0.6906253", "0.68355715", "0.6796655", "0.6751587", "0.6742077", "0.6712648", "0.6689515", "0.6669318", "0.6664553", "0.66344756", "0.6576889", "0.6569...
0.67877144
12
window.ComputerScene = new Scene(configuration); ComputerScene.start(); })();
function updateTipsText(data) { $('.course-stage-note').empty(); if (typeof (data) == 'string') { $('.course-stage-note').html(data); } else { data = (data == null ? _topTooltip : data); var needEvent = false; var tmpStrArr = []; for (var i = 0; i < data.lengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeScene(){}", "function DashboardScene () {\n}", "function start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}", "startGame() {\n this.scene....
[ "0.71502864", "0.7055169", "0.69813", "0.69580495", "0.6906624", "0.68951845", "0.68387204", "0.6803238", "0.6758319", "0.66801345", "0.667211", "0.6638286", "0.66015816", "0.66014284", "0.65953696", "0.6587308", "0.6539719", "0.6534558", "0.6524286", "0.65213215", "0.6519874...
0.0
-1
retrieves data from Taste Dive with user's input
function getDataFromTasteDiveApi(searchTerm, callback) { const settings = { url: BOOK_ENTRY_URL, data: { q: `${searchTerm}`, type: "books", info: 1, limit: 20, k: "310938-Coffeean-LGCO6BCH", }, jsonp: "callback", dataType: 'jsonp', type: 'GET', success: functi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readStoke(data){\nfoodS = data.val();\n}", "function pasteData(){\n const text = navigator.clipboard.readText()\n //Insert data and run pre checks\n .then(text => {\n insertBoxContent(text)\n preCheck()\n })\n .catch(err => {\n console.error('Failed to read cl...
[ "0.61949456", "0.6171254", "0.5856317", "0.575552", "0.575552", "0.56684494", "0.56527156", "0.56489307", "0.56489307", "0.56489307", "0.56489307", "0.56489307", "0.56489307", "0.56489307", "0.56489307", "0.5620788", "0.5610995", "0.5577703", "0.5577703", "0.5523949", "0.5435...
0.5839404
3
renders the Taste Dive recommendation on the front end
function renderInitialResult(results) { const result = results[0] // provides a result if the user enters something that isn't a book or author, or if the API doesn't have that particular book in the system if (!results) { $(".bookSuggest").addClass("hidden"); $('.book-results').html(""); $(".book-res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderRecommend(bool, help) {\n if (bool) {\n return (\n <div>\n <TiTick /> I recommend this product\n </div>\n );\n } else {\n return (\n <div>\n was this review helpfull? <span>yes</span> {help} | <span>Report</span>\n </div>\n );\n }\n ...
[ "0.5641625", "0.5548342", "0.5369756", "0.5366102", "0.5331898", "0.5331332", "0.5294207", "0.5215724", "0.51880926", "0.5179638", "0.51627904", "0.5146877", "0.5144948", "0.5133394", "0.5106226", "0.50972915", "0.50944716", "0.5090896", "0.5070207", "0.5062436", "0.5051702",...
0.0
-1
allows user to see another book result by scrolling through a set number (20) of results from the Taste Dive API
function tryAnotherBook(result) { let counter = 0; let suggestionLength = result.length - 2; $(".bookSuggest").on("click", function(){ if (counter <= suggestionLength) { counter++; } else { counter = 0; } $('.book-results').html(""); $(".book-results").append(`<h3>${result[counter]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scrollToSpread(book){\n let bookEl = document.getElementById('book');\n if(bookEl && book) {\n let asksLength = Object.keys(book.asks).length;\n if (asksLength) bookEl.scrollTop = asksLength * 29.5;\n }\n }", "function displayBookRecommendation(data) {\n const results = data.results.map((ite...
[ "0.67295945", "0.6305331", "0.62370694", "0.6164374", "0.5952009", "0.5828901", "0.58115536", "0.5801181", "0.57900554", "0.5762507", "0.57378715", "0.5732193", "0.57137305", "0.57031465", "0.57012165", "0.56710154", "0.5665251", "0.56495315", "0.5647906", "0.5643825", "0.564...
0.6407485
1
a callback function for the Taste Dive API
function displayBookRecommendation(data) { const results = data.results.map((item, index) => renderInitialResult(item)); $(`.book-results`).html(results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDataFromTasteDiveApi(searchTerm, callback) {\n const settings = {\n url: BOOK_ENTRY_URL,\n data: {\n q: `${searchTerm}`,\n type: \"books\",\n info: 1,\n limit: 20,\n k: \"310938-Coffeean-LGCO6BCH\",\n },\n jsonp: \"callback\",\n dataType: 'jsonp',\n type: 'GE...
[ "0.63963836", "0.57913834", "0.57346606", "0.56078124", "0.55566734", "0.5516073", "0.5497134", "0.54735357", "0.5454123", "0.54099023", "0.5397845", "0.5385224", "0.53529215", "0.5321802", "0.5321802", "0.5321802", "0.5321802", "0.5321802", "0.52872384", "0.52627164", "0.524...
0.0
-1
Changes Progress Bar on Geocode Success
function updateTastediveProgress(message, percentage) { $(".progressBar>span").addClass(`fill${typeof percentage == "number"?percentage:100}`); if(message) $(".progressBar>label").text(message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finishGeo(addr){\n\tsearchbarInput.value = addr;\n}", "processGeocodeData(results, status) {\n let first = 0;\n if (status === \"OK\") {\n const location = results[first].geometry.location;\n let position = {\n 'lat': location.lat(),\n 'lng': location.lng(),\n }\n ...
[ "0.67380166", "0.6659353", "0.65752643", "0.65616435", "0.6556386", "0.653988", "0.65129423", "0.64956987", "0.64619267", "0.64382243", "0.6417509", "0.6405862", "0.6403263", "0.6397645", "0.63821626", "0.63695157", "0.63564026", "0.6353589", "0.63448286", "0.6343035", "0.626...
0.0
-1
Create a function named Car with one property named `manufactured_date`
function Truck () {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Car () {\n this.manufactured_date = Date.now();\n}", "function Car () {\n this.manufactured_date = Date.now();\n}", "function Car(brand, model, dateOfProduction) {\r\n this.brand = brand;\r\n this.model = model;\r\n this.dateOfProduction = new Date(dateOfProduction);\r\n this.getYear = function ...
[ "0.7450929", "0.7450929", "0.68161595", "0.64097613", "0.61454475", "0.60681844", "0.60054827", "0.595179", "0.5883073", "0.5877641", "0.5850279", "0.5805724", "0.5788173", "0.5775941", "0.5771353", "0.5750307", "0.57389516", "0.56727374", "0.56197107", "0.5596456", "0.559416...
0.0
-1
Create a function named Make. Set its prototype to the Car function. Define a property `manufacturer` with a default value of empty string.
function Make (maker) { this.manufacturer = maker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CarMaker() {}", "function Make () {\n this.manufacturer = \"\";\n}", "function CarMaker(){}", "function Car(color, make, speed) {\n this.color = color;\n this.make = make;\n this.speed = speed;\n this.drive = function(speed, make) { console.log(\"The \" + make + \" is driving \" + speed...
[ "0.74377453", "0.7348721", "0.7265616", "0.6743508", "0.6692832", "0.66849464", "0.66726553", "0.6617407", "0.66161525", "0.6610494", "0.656416", "0.65438724", "0.6527263", "0.65200615", "0.6496172", "0.6495241", "0.6463314", "0.6429576", "0.6416479", "0.6406495", "0.6401555"...
0.74469405
0
Create a function named Model. Set its prototype to the Make function. Define a property `modelName` with a default value of empty string.
function Model () { this.modelName = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createModel(name, mappings, methods) {\n /*\n * this looks weird. what it is doing is identical to the commented-out\n * Model function below. why we're doing it this way is that if we use\n * the commented-out version, all models created with this helper function\n * will appear in t...
[ "0.736441", "0.71079105", "0.67212886", "0.65496856", "0.63978666", "0.63978666", "0.62949276", "0.6274179", "0.6202178", "0.60905194", "0.6078804", "0.6044896", "0.60037524", "0.5961307", "0.58658206", "0.5863754", "0.5829947", "0.5792462", "0.57360977", "0.5724725", "0.5695...
0.72997236
1
Create a new Make object your favorite one (e.g. Mini)
function Mazda (name) { this.modelName = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Make (maker) {\n this.manufacturer = maker;\n}", "function createObject(makeNewItem, makeNewPrice) {\n\tthis.name = makeNewItem;\n\tthis.price = makeNewPrice;\n\treturn {name, price};\n}", "function Make () {\n this.manufacturer = \"\";\n}", "function newCar(make, model, color, type, tires, mode...
[ "0.6786418", "0.67577446", "0.63735616", "0.60827917", "0.6019521", "0.5928556", "0.59160787", "0.591396", "0.59087616", "0.5835463", "0.58299226", "0.5759626", "0.5725248", "0.5723746", "0.5700719", "0.5699376", "0.56845766", "0.56828153", "0.56825584", "0.5672477", "0.56540...
0.0
-1
Being a rich, avid car collector, you own 2 cars from your second favorite manufacturer. You also one 1 car from your third favorite manufacturer.
function Nissan (name) { this.modelName = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCarsByPrice(_carprice){\n for(let i=0;i<cars.length;i++){\n if(cars[i].Price>_carprice){\n cars[i].showCarDetails()\n }\n }\n}", "function displayCar(id){\n\n if(id===dealerAuto.id && dealerAuto.id==1){\n return dealerAuto.brand+\" \"+dealerAuto.model;\n }else if(...
[ "0.582805", "0.5744921", "0.5738095", "0.57076997", "0.5693144", "0.5636142", "0.5635483", "0.5633919", "0.5625975", "0.5605485", "0.5564218", "0.5542468", "0.55385196", "0.55313885", "0.5506943", "0.5496982", "0.5492952", "0.5479074", "0.5431457", "0.53934383", "0.53934383",...
0.0
-1
function to get data
function get(url){ return new Promise ( (resolve, reject) => { var xhr = new XMLHttpRequest(); xhr.open("GET", url); xhr.onload = function() { if (xhr.status == 200){ resolve(JSON.parse(xhr.response)); } else { reject(Error(xhr.statusT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data() {}", "getData(){}", "GetData() {}", "function getData(data) {\n return data;\n}", "getData () {\n }", "function getData() {\n console.log(data)\n }", "function getData(data) {\n return data;\n}", "function getdata() {\n\n var url = `/data`;\n\n d3.json(url).then(funct...
[ "0.9073805", "0.81470644", "0.76786083", "0.7283723", "0.7260649", "0.725146", "0.72503495", "0.7162216", "0.7045259", "0.7045259", "0.7028227", "0.6961415", "0.6958213", "0.6958213", "0.6877223", "0.6869949", "0.68692756", "0.683924", "0.6825971", "0.6825008", "0.6815222", ...
0.0
-1
onclick > Quando eu der um click ondblclick > Quando eu der doubleclick onmouseover > Quando eu passar o mouse por cima
function print() { console.log('print'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "e_onDblClick(e)\n\t{\n\t\t\n\t}", "_evtDblClick(event) { }", "function myDblClick(e) {\n\t\tgetMouse(e);\n\t\t// for this method width and height determine the starting X and Y, too.\n\t\t// so I left them as vars in case someone wanted to make them args for something and copy this code\n\t\t// var width = 20;...
[ "0.7772179", "0.7542439", "0.73877585", "0.7369674", "0.73377705", "0.72762823", "0.72762823", "0.71890545", "0.7129483", "0.71074003", "0.70890963", "0.7053831", "0.6945261", "0.68857217", "0.68351895", "0.68263626", "0.6795516", "0.6694871", "0.66584355", "0.6657962", "0.64...
0.0
-1
A fresh builder instance should contain a blank product object, which is used in further assembly.
function ConcreteBuilder1() { this.reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "build(builder) {\n // the director assembles then returns a new product\n builder.step1();\n builder.step2();\n return builder.get();\n }", "getProduct() {\n MxI.$raiseNotImplementedError(IBuilder, this);\n }", "function Builder() {}", "function Builder() {}", "constructor() {\n /**...
[ "0.69342", "0.6716686", "0.6302168", "0.6302168", "0.6162936", "0.59902775", "0.5975304", "0.5906697", "0.5906523", "0.58167267", "0.58167267", "0.580309", "0.57691324", "0.57509655", "0.5700348", "0.5667882", "0.5667882", "0.56478006", "0.5601173", "0.55960053", "0.5524311",...
0.54520684
25
The client code creates a builder object, passes it to the director and then initiates the construction process. The end result is retrieved from the builder object.
function clientCode(director) { var builder = new ConcreteBuilder1(); director.setBuilder(builder); console.log('Standard basic product:'); director.buildMinimalViableProduct(); builder.getProduct().listParts(); console.log('Standard full featured product:'); director.buildFullFeaturedProduc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Builder() {}", "function Builder() {}", "build(builder) {\n // the director assembles then returns a new product\n builder.step1();\n builder.step2();\n return builder.get();\n }", "function Builder()\n{\n //trace(\"constructor\")\n // constructor\n // in memory representation ...
[ "0.74387693", "0.74387693", "0.7402083", "0.7104536", "0.7058726", "0.6688508", "0.66655475", "0.63993925", "0.6211262", "0.61052376", "0.6058881", "0.60161376", "0.59996223", "0.59161484", "0.580223", "0.58005005", "0.577425", "0.57728815", "0.57728815", "0.5727611", "0.5706...
0.6227521
8
Interprets a template literal as an HTML template that can efficiently render to and update a container.
function html(strings) { var template = templates.get(strings); if (template === undefined) { template = new Template(strings); templates.set(strings, template); } for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { values[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(data, template) {\n var html = template.innerHTML;\n\n // Attempts\n // to compile the tmplate.\n for (var key in data) {\n var placeholder = '{{' + key +'}}';\n\n if (html.search(placeholder) !== -1) {\n html = html.replace(placeholder, data[...
[ "0.68499357", "0.6643047", "0.6481813", "0.64474124", "0.6418813", "0.6355961", "0.63275623", "0.63266206", "0.6312045", "0.625699", "0.6174169", "0.6138651", "0.6101609", "0.6083771", "0.6065754", "0.605996", "0.60480756", "0.6019613", "0.6018117", "0.5993114", "0.5991439", ...
0.5638832
72
Renders a template to a container. To update a container with new values, reevaluate the template literal and call `render` with the new result.
function render(result, container) { var partCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultPartCallback; var instance = container.__templateInstance; // Repeat render, just call update() if (instance !== undefined && instance.template === result.template && insta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(result, container, templateFactory = defaultTemplateFactory) {\n const template = templateFactory(result);\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === template &&\n ...
[ "0.7300793", "0.71649975", "0.71590704", "0.6952459", "0.6931553", "0.68365276", "0.6775153", "0.6631702", "0.66148883", "0.6588854", "0.64092004", "0.64037967", "0.6329535", "0.627194", "0.6246976", "0.62411445", "0.62304044", "0.61287194", "0.6118346", "0.61105096", "0.6080...
0.7104564
3
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.69679236", "0.69377637", "0.67660517", "0.644171", "0.63287604", "0.62983114", "0.6256009", "0.6210124", "0.61941147", "0.61812603", "0.6174446", "0.6158444", "0.6158444", "0.6158444", "0.6154958", "0.60953784", "0.6039884", "0.5989862", "0.5980611", "0.5979347", "0.597915...
0.0
-1
comes from templatestamp.js but removing the templating using html
function createNodeEventHandler(context, eventName, methodName) { // Instances can optionally have a _methodHost which allows redirecting where // to find methods. Currently used by `templatize`. context = context._methodHost || context; var handler = function handler(e) { if (context[methodName]) { c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function htmlTemplate(innerHtml) {\n\tvar file_data = fs.readFileSync('template.html', 'utf8');\n\treturn file_data.replace('[[YIELD]]', innerHtml);\n}", "template() {\n return '';\n }", "template() {\n return '';\n }", "template() {\n return '';\n }", "template() {\n r...
[ "0.6771114", "0.6759031", "0.6759031", "0.6759031", "0.6759031", "0.66759735", "0.65846443", "0.6442848", "0.64158654", "0.6385928", "0.6324103", "0.62831444", "0.62606007", "0.6254751", "0.6242903", "0.6183478", "0.6173929", "0.61685723", "0.6162739", "0.6159107", "0.613389"...
0.0
-1
Note: This function is based on the computation of the Levenshtein "edit" distance. The one change is that "updates" are treated as two edits not one. With Array splices, an update is really a delete followed by an add. By retaining this, we optimize for "keeping" the maximum array items in the original array. For exam...
function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { // "Deletion" columns var rowCount = oldEnd - oldStart + 1; var columnCount = currentEnd - currentStart + 1; var distances = new Array(rowCount); // "Addition" rows. Initialize null column. for (var i = 0; i < rowCount; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findShortestEdit() {\n let deletionCount = initialArray.length;\n let additionCount = currentArray.length;\n let editCount = deletionCount + additionCount;\n for (let i = 0; i < initialArray.length; ++i) {\n if (i > editCount) {\n ...
[ "0.65105236", "0.6445838", "0.63306093", "0.6327568", "0.6327568", "0.6327568", "0.6327568", "0.6327568", "0.6327568", "0.62649906", "0.62649906", "0.62649906", "0.62649906", "0.6258469", "0.6251155", "0.6169972", "0.6153358", "0.6139856", "0.6134279", "0.61261135", "0.612611...
0.5271106
55
This starts at the final weight, and walks "backward" by finding the minimum previous weight recursively until the origin of the weight matrix.
function spliceOperationsFromEditDistances(distances) { var i = distances.length - 1; var j = distances[0].length - 1; var current = distances[i][j]; var edits = []; while (i > 0 || j > 0) { if (i == 0) { edits.push(EDIT_ADD); j--; continue; } if (j == 0) { edits.push(EDIT_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "recursive(WM, start) {\n if (WM == null || WM.length == 0) return null;\n this._recursive_helper(WM, start, []);\n return this._getSmallestPath(this.V);\n }", "function minimumCostPath(matrix, i = 0, j = 0) {\r\n let n = matrix.length;\r\n let m = matrix[0].length;\r\n if (i == n - 1 && j == m - 1) ...
[ "0.550799", "0.5344403", "0.53443855", "0.529473", "0.52473885", "0.5246386", "0.52352303", "0.5227119", "0.5200383", "0.5194031", "0.51732826", "0.5170687", "0.51566565", "0.5148945", "0.5148945", "0.5148945", "0.5148945", "0.5148945", "0.5144651", "0.51182663", "0.510508", ...
0.0
-1
Expose a method for transforming tokens into the path function.
function tokensToFunction(tokens) { // Compile all the tokens into regexps. var matches = new Array(tokens.length); // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (_typeof(tokens[i]) === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^...
[ "0.618919", "0.6013548", "0.5990742", "0.5988443", "0.5988443", "0.5988443", "0.5988443", "0.5988443", "0.5988443", "0.59617156", "0.59617156", "0.59617156", "0.59617156", "0.59617156", "0.5929689", "0.5923312", "0.5904867", "0.5898217", "0.5898217", "0.5898217", "0.5898217",...
0.58416975
33
This is a dummy function to check if the function name has been altered by minification. If the function has been minified and NODE_ENV !== 'production', warn the user.
function isCrushed() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uglify(name) {\n console.log(\"Hello \" + name);\n}", "function keepNonMinified(file) {\n\tvar keep = true;\n\tif(file.path.match('.js$')) {\n\t\tvar minPath = file.path.replace('.js', '.min.js');\n\t\tkeep = !exists(minPath);\n\t}\n\treturn keep;\n}", "function markFuncFreeze(fun, opt_name) {\n /...
[ "0.6025318", "0.5777536", "0.5716528", "0.56810373", "0.56810373", "0.5636732", "0.5636732", "0.56214815", "0.5576784", "0.55481094", "0.5527685", "0.55207425", "0.55207425", "0.55207425", "0.55207425", "0.55207425", "0.5508346", "0.5493248", "0.54866606", "0.54797167", "0.54...
0.0
-1
implements but isnt the same type as...
implements(doesThis, implementThat) { const t= this.get(doesThis); return t && (t.with && t.with.slots && t.with.slots.indexOf(implementThat)>=0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SkipSelfDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function SelfDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "get kind() {\n throw new Error('Sub-class to implement.');\n }", "function SuperclassBare() {}", "function Supe...
[ "0.62530637", "0.61500245", "0.6144249", "0.59519315", "0.59519315", "0.58247787", "0.58186656", "0.58153194", "0.5769815", "0.57195395", "0.5714316", "0.5693419", "0.5675045", "0.5675045", "0.5675045", "0.56708544", "0.5655487", "0.5650892", "0.5634743", "0.56178486", "0.561...
0.5893327
5
implements or is the stame type as...
areCompatible(doesThis, implementThat) { const t= this.get(doesThis); return t && ((t.name === implementThat) || ((t.with && t.with.slots && t.with.slots.indexOf(implementThat)>=0))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "is(type) { return this.type == type; }", "function Is() {\r\n}", "function Type() {}", "is(value) {\n throw new Error(\"Datatype.is() is abstract\");\n }", "is() {\n\t return _register.call(this, 'is', arguments);\n\t }", "static isOfMyType(node) {\n return true; // default implementatio...
[ "0.6649781", "0.64264256", "0.6345792", "0.627337", "0.6184719", "0.6097522", "0.60857916", "0.607825", "0.606653", "0.6031238", "0.60273784", "0.6002524", "0.59920895", "0.59813577", "0.5897393", "0.5878806", "0.58738077", "0.58437085", "0.5843553", "0.5843553", "0.5843553",...
0.57894725
24
register a new named type
static newType(spec) { return allTypes.newType(spec); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerTypeByName(type) {\n if (registryLogger.isDebugEnabled()) {\n registryLogger.debug('Register Type \\'%s\\' by name [%s]', type.id, type.typeName);\n }\n typeByName[type.typeName] = type;\n return type;\n}", "function registerType(type) {\n if (logger.isDebugEnabled()) logger.debug('Reg...
[ "0.7726133", "0.6892239", "0.68583554", "0.6704976", "0.6704976", "0.66765875", "0.6613023", "0.6610482", "0.652058", "0.642952", "0.63253516", "0.62827206", "0.6282687", "0.62649554", "0.6235319", "0.6218896", "0.6218896", "0.6152616", "0.6141469", "0.6004949", "0.59654224",...
0.595491
22
spec for the named type
static get(typeName) { return allTypes.all[typeName]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "type_spec() {\n const startToken = this.currentToken;\n\n let typeTok = this.currentToken;\n if (typeTok.type === Lexer.TokenTypes.TYPE_INTEGER || typeTok.type === Lexer.TokenTypes.TYPE_REAL || typeTok.type === Lexer.TokenTypes.TYPE_BOOLEAN) {\n this.eat(typeTok.type);\n return new AST.TypeNode(...
[ "0.6604134", "0.64738655", "0.64738655", "0.6425226", "0.6365305", "0.6314605", "0.62310445", "0.6188713", "0.6075157", "0.6053059", "0.6038685", "0.6002432", "0.600236", "0.6000953", "0.6000953", "0.6000953", "0.6000953", "0.6000953", "0.6000953", "0.6000953", "0.6000953", ...
0.0
-1
types compatible with the named slot
static slats(slotTypeName) { const slats= []; const all= allTypes.all; for (const typeName in all) { const type= all[typeName]; if (type.uses === 'flow') { const spec= type.with; const slots= spec.slots; if (slots && slots.includes(slotTypeName)) { slats.push(ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSlotType(vm, name, split) {\n if (vm.$slots[name] && vm.$scopedSlots[name] && vm.$scopedSlots[name].name) {\n return split ? 'v-slot' : 'scoped';\n }\n\n if (vm.$slots[name]) return 'normal';\n if (vm.$scopedSlots[name]) return 'scoped';\n}", "function getSlotType(vm, name, split) {\n if (vm....
[ "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6079808", "0.6074059", "0.6074059", "0.5828765", "0.57076484", "0.5664092", "0.5664092", "0.5664092", "0.5664092", ...
0.59609526
15
where t is a Type object
static labelOf(t) { const label= !t.desc ? Filters.titlecase(t.name.replace(/[-_]/g, ' ')) /* friendlyish name */ : (typeof t.desc === 'string') ? t.desc : t.desc.label; return label; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Type() {}", "getType() {}", "function u(t) {\n if (null == t) return {\n value: t\n };\n if (Array.isArray(t)) return {\n type: [t[0]],\n value: null\n };\n\n switch (typeof t) {\n case \"object\":\n return t.constructor...
[ "0.6965796", "0.6618095", "0.6538913", "0.64398396", "0.63896435", "0.6369946", "0.62553823", "0.61998427", "0.61684275", "0.6146182", "0.60903955", "0.60406476", "0.59906995", "0.5910201", "0.58914256", "0.5852693", "0.58514726", "0.58230734", "0.5809549", "0.58076966", "0.5...
0.0
-1
produce an item/tree for the named type; filling out defaults for all required fields.
static createItem(typeName, ctx=null) { console.debug("Types.createItem", typeName); if (typeof typeName !== 'string') { throw new Error("expected type string"); } var ret; const type= allTypes.get( typeName ); if (!type ) { throw new Error(`unknown type '${typeName}'`); } c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType...
[ "0.58500165", "0.57982147", "0.56861496", "0.56564534", "0.5598639", "0.544062", "0.544062", "0.54211783", "0.53805095", "0.5370593", "0.53423005", "0.53210086", "0.53138494", "0.5289265", "0.52819395", "0.52743345", "0.5271153", "0.5224387", "0.5216129", "0.5214395", "0.5198...
0.6729465
0
route middleware to ensure user is logged in
function isLoggedIn(req, res, next) { if (req.isAuthenticated()) return next(); res.redirect('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLoggedIn(req, res, next) {\n\tconsole.log('isLoggedIn middleware');\n if (req.isAuthenticated()) {\n \treturn next();\n } else {\n \tres.redirect('/users');\n }\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n else res.redirect('/signin');\n }", "...
[ "0.78317004", "0.7822493", "0.7810512", "0.7780801", "0.7771141", "0.7766273", "0.77625203", "0.7753347", "0.7751826", "0.77515084", "0.7750319", "0.7744125", "0.7740947", "0.7735627", "0.77335143", "0.77335143", "0.7731155", "0.7726039", "0.7724748", "0.7715397", "0.7715397"...
0.7648786
70
Now the sequential iteration pattern with Array.reduce
function countTo(num) { async function countToTask(number, delay=1000) { async function sleepForSomeTime(delay) { return new Promise(resolve => { setTimeout(() => resolve(), delay); }); } for (let i = 0; i < number; i++) { console.log(`>> counting task ${ i + 1 }/${ number }`); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myreduce(arr,cb,acc){\n for(var i=0;i<arr.length;i++){\n acc=cb(acc,arr[i])\n }\n return acc\n}", "reduce(callback, accumulator) {\n for (let i = 0; i < this.arr.length; ++i) {\n accumulator = callback(accumulator, this.arr[i], i);\n }\n\n return accumulator;\n }", "func...
[ "0.74959093", "0.740343", "0.7281262", "0.72786784", "0.72476", "0.71544474", "0.71162325", "0.70845973", "0.70353323", "0.6991889", "0.6986408", "0.69812435", "0.696453", "0.69604665", "0.6935751", "0.69332826", "0.69070834", "0.68876755", "0.6880979", "0.6854574", "0.682023...
0.0
-1
(int, int) Genera el codigo HTML para tener una tabla de NxM
function TablaNM(n, m){ htmlRow = '<tr>' + '<td><input type="number"></td>'.repeat(m) + '</tr>'; return htmlRow.repeat(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeHtmlBoard() {\n \n for(i = 0; i < WIDTH; i++) {\n const row = document.createElement('th');\n row.setAttribute('id', `${i}`)\n topLine.append(row);\n\n }\n \n for (let x = 1; x < 6; x++) {\n const tableRowCell = document.createElement('tr');\n body.append(tableRowCell);\n for...
[ "0.6403953", "0.63483256", "0.61653346", "0.61134934", "0.6090155", "0.6061975", "0.6011196", "0.5986596", "0.5955844", "0.59357727", "0.5915501", "0.58970094", "0.5852372", "0.58391577", "0.58288586", "0.5801488", "0.57979697", "0.57636863", "0.5758236", "0.5757786", "0.5756...
0.5888825
12
calls all create filter functions after the data has finished loading in index.js
function initialiseFilters() { // this used to be the undo button, so it would apply in the same way as reset document.getElementById("undo").onclick = () => resetClicked() createRatingSlider() createGenreSelector() createYearSlider() createRuntimeSlider() createLanguageSelector() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleLoadFiltersData() {\n /**\n * Genres.\n */\n getGenres().then((genres) => {\n // eslint-disable-next-line no-underscore-dangle\n this.setGenres(genres.__type.enumValues.map(({ name }) => ({\n id: name,\n name,\n })));\n }).catch((error) => {\n console.log('E...
[ "0.6770003", "0.66149205", "0.6603635", "0.6590992", "0.6580396", "0.6555879", "0.6539255", "0.65285605", "0.6474726", "0.6474326", "0.64692026", "0.64320654", "0.643181", "0.6383235", "0.6353389", "0.6348828", "0.63400465", "0.6328731", "0.6309865", "0.6303511", "0.6296599",...
0.0
-1
creates the rating slider for filtering by rating (min = 0, max = 10)
function createRatingSlider(){ // create a range slider for the filter // modified from: https://materializecss.com/range.html const slider = document.getElementById('ratingSlider'); noUiSlider.create(slider, { start: [0, 10], connect: true, step: 0.1, orientation: 'horiz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RatingSlider({ rating, handleOnRatingChange, initialRating }) {\n\n return (\n <div className=\"row justify-content-md-center my-3\">\n { initialRating ?\n <div className=\"pull-center col-12\">Ratings of <strong><span className=\"rate-color\">{rating}</span>/10</strong> or above</div>...
[ "0.6627384", "0.6561542", "0.6540523", "0.6481119", "0.63554305", "0.63042694", "0.6280117", "0.6280117", "0.6123423", "0.6041436", "0.60312474", "0.5973375", "0.5969273", "0.5826653", "0.57068956", "0.5702316", "0.56928325", "0.56841946", "0.56577665", "0.5633318", "0.562259...
0.83261746
0
creates a year slider for filtering by year min and max are determined by years recorded in the dataset
function createYearSlider(){ const range = getYearRange() // create a range slider for the filter // modified from: https://materializecss.com/range.html const slider = document.getElementById('yearSlider'); noUiSlider.create(slider, { start: [range.low, range.high], connect: true, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterByYearAndSlider() {\n if (running) {\n\n displayYear = displayYear + 1;\n if (displayYear > 2017) {\n displayYear = 2007;\n }\n slider.value = displayYear;\n yearDisplay.innerText = displayYear;\n }\n}", "function setMinMax(dataSet) {\r\n $(\"...
[ "0.78327596", "0.7661593", "0.75982213", "0.75089943", "0.73508006", "0.7331824", "0.7227333", "0.72213185", "0.72212124", "0.7198151", "0.7130783", "0.71213746", "0.6883271", "0.68629664", "0.6852284", "0.68505836", "0.68279475", "0.68279475", "0.68099576", "0.6779946", "0.6...
0.81313837
0
creates a run time slider for filtering by run time min and max are determined by run time in the data set
function createRuntimeSlider(){ const range = getRuntimeRange() // console.log(range) // create a range slider for the filter // modified from: https://materializecss.com/range.html const slider = document.getElementById('runtimeSlider'); noUiSlider.create(slider, { start: [range.low, ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_timeslider(data){\r\n\t\tconsole.log(\"init_timeslider\");\r\n\t\tvar minDatum = data[0][selectedOptions.dateField];\r\n\t\tvar maxDatum = data[data.length-1][selectedOptions.dateField];\r\n\t\tdocument.getElementById(\"time_slider\").setAttribute(\"max\", data.length-1);\r\n\t}", "function sliderC...
[ "0.6787208", "0.66049093", "0.6445087", "0.6441154", "0.6308611", "0.6257159", "0.6114176", "0.6038033", "0.60307574", "0.5923833", "0.58787566", "0.5838748", "0.5826821", "0.5799174", "0.57941914", "0.57923585", "0.57852435", "0.5747574", "0.5743459", "0.57385933", "0.573246...
0.6966335
0
creates a genre selector for filtering by genre options are dynamically filled by whats in the data set Null or "" were replaced to "Unknown"
function createGenreSelector(){ let genres = getGenres() genres = genres.sort() const genreSelector = document.getElementById("genreSelector"); genreSelector.innerHTML = "" for (const genre of genres) { // modified from: https://stackoverflow.com/questions/17730621/how-to-dynamically-add-opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filteredByGenre(e){\n // if supress is on, return straight away so we dont apply the filter till select all has completed\n if (supressGenreFilter) return;\n var instance = M.FormSelect.getInstance(document.getElementById(\"genreSelector\"));\n const selectedValues = instance.getSelectedValues...
[ "0.72194046", "0.72040397", "0.7123617", "0.7073253", "0.70573395", "0.6615724", "0.65932363", "0.6482486", "0.64544135", "0.6375279", "0.63735557", "0.63735557", "0.63350743", "0.62555254", "0.6240133", "0.6190105", "0.61633956", "0.614874", "0.6144862", "0.612743", "0.61226...
0.6776085
5
creates a language selector for filtering by language options are dynamically lfilled by whats in teh data set Null or "" were replaced with "Unknown"
function createLanguageSelector(){ let languages = getLanguages() languages = languages.sort() const languageSelector = document.getElementById("languageSelector"); languageSelector.innerHTML = "" for (const language of languages) { // modified from: https://stackoverflow.com/questions/17730...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeLanguage(languages) {\n for(var k in languages) {\n let opt = Utility.createNode('option', { \n value: k, innerHTML: languages[k]\n });\n $('#select-language').append(opt);\n }\n /*Translate.google_translate_support_lang().then(data => {\n const langs = data.data.langu...
[ "0.669868", "0.6638855", "0.64337397", "0.6433025", "0.6397268", "0.63898146", "0.6365635", "0.63349956", "0.6327713", "0.62200564", "0.6198317", "0.6137648", "0.6072487", "0.6016662", "0.60089165", "0.600868", "0.5962646", "0.5952182", "0.59068584", "0.58900476", "0.5866905"...
0.70431864
0
updates the objects key value for rating to be the function min to max
function filteredByRating(min, max){ filters.rating = { apply: (d) => d.imdb >= min && d.imdb <= max, min, max } applyFilters(false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRubricMinScoreAgainstMax(max) {\r\n var min = viewModel.assessment.rubricMinScore;\r\n if (min > max) {\r\n viewModel.set('assessment.rubricMinScore', max);\r\n }\r\n }", "function updateMinMax() {\n min = parseInt(minValueField.value);\n max = parseInt(maxValueFi...
[ "0.6029552", "0.60176474", "0.5999247", "0.58696145", "0.5864666", "0.5786374", "0.5746484", "0.5706185", "0.56901705", "0.56792575", "0.5671983", "0.56429213", "0.56240904", "0.5622834", "0.55651146", "0.556272", "0.5562541", "0.55621177", "0.5552557", "0.5546956", "0.553394...
0.61805093
0
updates the objects key value for year to be the function min to max
function filteredByYear(min, max){ filters.year = { apply: (d) => d.year >= min && d.year <= max, min, max } applyFilters(false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeYear(minYear, maxYear){\n\t\tlet self = this;\n\t\tself.current = minYear;\n\t\tthis.maxYear = maxYear;\n\t\tself.update();\n\t}", "setMinMaxYear(minYear, maxYear)\n {\n // Integrity check: really an integer?\n if ((!this._main.modules.helpers.checkIfInt(minYear)) ||\n (!this._main.modules.he...
[ "0.73928297", "0.6952789", "0.68894035", "0.67442733", "0.66037154", "0.6431401", "0.6320633", "0.6320633", "0.6320633", "0.6320633", "0.6320633", "0.6320633", "0.6320633", "0.63140076", "0.6298154", "0.629082", "0.6244567", "0.624294", "0.61984694", "0.6180386", "0.613141", ...
0.64656585
5
updates the objects key value for runtime to be the function min to max
function filteredByRuntime(min, max){ const range = getRuntimeRange() if (min === range.low && max === range.high) filters.runtime = undefined else { filters.runtime = { apply:(d) => d.runtime >= min && d.runtime <= max && !isNaN(d.runtime), min, max } } apply...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get value(){ \r\n return { \r\n min : this._value[ 0 ], \r\n max : this._value[ 1 ]\r\n };\r\n }", "_homogonizeMinMaxTimestamps () {\n const minTimes = this.tierNameList.map(tierName => this.tierDict[tierName].minTimestamp);\n const maxTimes = this.tierNameList.map(ti...
[ "0.62733567", "0.62481767", "0.61962456", "0.6134071", "0.6095387", "0.59515566", "0.58861965", "0.5859758", "0.57512575", "0.57512575", "0.57512575", "0.57512575", "0.57512575", "0.57512575", "0.56203496", "0.56186885", "0.5606045", "0.56000435", "0.558666", "0.5584592", "0....
0.5209511
54
updates the genre filter
function filteredByGenre(e){ // if supress is on, return straight away so we dont apply the filter till select all has completed if (supressGenreFilter) return; var instance = M.FormSelect.getInstance(document.getElementById("genreSelector")); const selectedValues = instance.getSelectedValues() if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filterFilmsViewByGenre(genre) {\n this.fullList.forEach(filmData => {\n this.elem.galleryList.querySelector(`[data-id=\"${filmData.id}\"]`).style.display =\n (filmData.genres.includes(genre) || genre === '-') ? 'block' : 'none';\n });\n }", "function updateFiltered()\r\...
[ "0.6822443", "0.6727348", "0.6709336", "0.6525029", "0.6371758", "0.611368", "0.6075163", "0.6037916", "0.603634", "0.60262746", "0.6014863", "0.6004037", "0.5991892", "0.5970143", "0.5948864", "0.593202", "0.5895465", "0.5852122", "0.5834661", "0.58334994", "0.5828404", "0...
0.65346164
3
resets the filters and applies the filters, resets the filter elements in view too
function resetClicked(){ filters.rating = undefined filters.genres = undefined filters.language = undefined filters.runtime = undefined filters.year = undefined // reset the sliders and option boxes const runtimeRange = getRuntimeRange() const yearRange = getYearRange() // move the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetAllFilters() {\n setVeggiesToRender(veggies);\n setFruitiesToRender(fruities);\n setSaladsToRender(salads);\n setMonth(\"Alle\");\n }", "clearFilters() {\n this.filters.clear();\n this.filter();\n }", "resetFilters () {\n this.setFilters({});\n }", "resetAllFilterViews()...
[ "0.79677427", "0.7949672", "0.7928564", "0.7918002", "0.76195276", "0.7616898", "0.75216997", "0.75199586", "0.75092673", "0.74844253", "0.7463133", "0.7441866", "0.74215966", "0.7420715", "0.7386432", "0.7379282", "0.73543465", "0.73515743", "0.73500437", "0.73351717", "0.73...
0.0
-1
apply the filter and run the vis again
function applyFilters(fromReset){ // filter the data let data = getMediaData() if (filters.rating) data = data.filter(filters.rating.apply) if (filters.genres) data = data.filter(filters.genres) if (filters.language) data = data.filter(filters.language) if (filters.runtime) data = data.filter(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectFilter() {\n createVisualization();\n}", "filter() {\n\n\n /** This is the representation of the fill column after the alt column filters have been applied to it. This data will be combined with the fillColFilterData when it is time to draw to the canvas.\n * @alias filteredAltColD...
[ "0.69405663", "0.68162906", "0.6720493", "0.6690221", "0.66266745", "0.66087914", "0.6489487", "0.6464215", "0.64562184", "0.64244646", "0.6370613", "0.6350637", "0.6343453", "0.6331633", "0.6292336", "0.62887037", "0.6277975", "0.62753856", "0.62589854", "0.6234616", "0.6230...
0.6830363
1
then catch merupakan method yang digunakan untuk menghandle output dari promise jika resolve>Fullfilled masuk ke .then jika reject masuk ke .catch TRY CATCH
async function cekHari(x) { try { let result = await cekHariKerja(x); await showDay(result); } catch (error) { console.log(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initiateRequest() {\n loaderDiv.classList.toggle('animate');\n let result = new Promise((resolve, reject) => {\n setTimeout(() => {\n console.log(\"Inside promise\");\n resolve(\"API call has got the response\");\n // reject(\"Error while getting data from the...
[ "0.6618499", "0.6474034", "0.63654995", "0.6364881", "0.6361696", "0.6209395", "0.6203569", "0.6190611", "0.6174446", "0.6168413", "0.61392456", "0.6137437", "0.6111129", "0.60901606", "0.60001105", "0.5992178", "0.5991558", "0.5939752", "0.5933545", "0.5931837", "0.58913034"...
0.0
-1
try catch untuk digunakan menghandle error di async/await
function showDay(result) { return console.log(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function errors() {\r\n try {\r\n let promesa = await Promise.reject(\"Error en el async\");\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}", "async function taskOne() {\n try{\n throw new Error('Some Problem');\n await sleep(4000);\n return 'one val...
[ "0.7450053", "0.7050948", "0.70085895", "0.68107647", "0.68005013", "0.669449", "0.6601708", "0.6461525", "0.6355378", "0.6350014", "0.6340597", "0.6336931", "0.6289018", "0.6209058", "0.6116016", "0.6115611", "0.610687", "0.60610247", "0.6015588", "0.60030717", "0.6002153", ...
0.0
-1
This is more elegant way to write reducers as compared to switch case
function ADD_TODO( state, action ){ return [{ id: state.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, completed: false, text: action.text }, ...state]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reducer(){\n\n}", "reduce(state, payload) {\n let {action, data} = payload;\n\n switch(action) {\n case 'moveTo':\n state = state.withMutations(s => {\n s = s.set('isMoving', true);\n s = s.set('movingTo', [data[0], data[1]]);...
[ "0.70082355", "0.64578867", "0.6438689", "0.6394318", "0.6325266", "0.63120556", "0.6308934", "0.62299955", "0.6199402", "0.6187668", "0.6168032", "0.61549896", "0.6127527", "0.61261487", "0.6117332", "0.6087055", "0.60804385", "0.60500884", "0.60350436", "0.60260683", "0.602...
0.0
-1
change for every page API Calls =================================================== API call to fetch data from Firebase
async function fetchAPIData (path) { const request = await fetch(path); const data = await request.json(); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getRecentBills(state) {\n await firebase.auth().onAuthStateChanged((user) => {});\n /*\n const user = firebase.auth().currentUser;\n if (user == null) {\n throw 'accessing bills while currentUser for Firebase is null';\n }\n const ref = firebase.database().ref(`users/${user.uid}/subtop...
[ "0.6311507", "0.63055617", "0.6064061", "0.60372", "0.6025327", "0.6012507", "0.5946206", "0.58585787", "0.5828529", "0.5815143", "0.5797845", "0.5793535", "0.57908845", "0.57427126", "0.57193047", "0.5705863", "0.56922764", "0.5673733", "0.5670192", "0.56501645", "0.56499153...
0.0
-1
API call to fetch data from Firebase
async function fetchChatMessages () { const request = await fetch('/messages'); const data = await request.val(); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchSkillsAndProjects() {\n // firebase endpoint\n const url = 'https://portfolio-5e471.firebaseio.com/.json';\n // get request to firebase endpoint\n axios.get(url)\n .then( (response) => {\n // Running setState method for skills and projects\n this.setState({\n skills: re...
[ "0.6427102", "0.64187956", "0.63860625", "0.63842946", "0.6253435", "0.6197522", "0.6187517", "0.61654276", "0.60881156", "0.607933", "0.60574085", "0.60498637", "0.6039674", "0.60274595", "0.6023017", "0.6017643", "0.601755", "0.6008613", "0.6004479", "0.60026705", "0.596500...
0.0
-1
Get Firebase Details from API
async function getFirebaseContent () { try { const events = await fetchAPIData('/events'); const content = await fetchAPIData('/content'); const messages = await fetchAPIData('/messages'); const gallery = await fetchAPIData('/gallery'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserDetails(callback){\n var user = baseRef.getAuth();\n baseRef.fetch(user.uid,{\n context:this,\n then:callback\n });\n }", "function get() {\r\n database.ref('test/' + dev_name).on('value', function(snapshot) {\r\n var data = snapshot.val();\r\n console.log(data);\r\n ...
[ "0.6837173", "0.64849216", "0.63333917", "0.625019", "0.6239082", "0.6181168", "0.6132738", "0.6112533", "0.6015252", "0.59933615", "0.59812707", "0.5969495", "0.59313136", "0.5921232", "0.5906329", "0.5890435", "0.5874468", "0.58454627", "0.58408123", "0.5835696", "0.5818627...
0.6114889
7
POPULATE THE DOM CONTENT ====================================== reset message thank you div
function resetMessageDom () { $("#successMsg").hide(); // $("#newWish").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetMessageDivs() {\n gees.dom.clearHtml('ResponseMessage');\n gees.dom.clearHtml('status');\n gees.dom.clearHtml('globe');\n}", "function clearmessage(){\n\t$(\"#message\").html(\"<p></p>\");\n}", "function thanks() {\r\n\"use strict\";\r\ndocument.getElementById('thank').innerHTML = \"<div class...
[ "0.6897082", "0.68477374", "0.67612475", "0.6717177", "0.6625107", "0.65597284", "0.65192974", "0.64809775", "0.64478344", "0.64218855", "0.64024377", "0.6396378", "0.6377968", "0.634549", "0.63298804", "0.6312612", "0.6304376", "0.62997234", "0.6262953", "0.62587845", "0.625...
0.7437521
0
Populate all date fields from Firebase
async function populateDateFields (fb) { const query = document.querySelectorAll('.date_field'); eventFieldsDomList = Array.from(query); eventFieldsDomList.map(e => e.innerHTML = fb.events.date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUpFields(fields){\n\n\t_.forEach(fields, function(value, key){\n\t\tif(value.type == 'date'){\n\t\t\t$scope.data.thisContent[value.field || value.key] = {\n\t\t\t\tstartDate: $scope.data.thisContent[value.field || value.key] || null,\n\t\t\t\tendDate: null //have to stub but don't use all the time\n\t\...
[ "0.66016495", "0.5745578", "0.5741045", "0.57117295", "0.5700807", "0.5675197", "0.56351113", "0.5519185", "0.5518367", "0.5508499", "0.55056995", "0.5504829", "0.5502234", "0.5396549", "0.5372155", "0.5356283", "0.5353221", "0.5352196", "0.53521264", "0.53279346", "0.5323908...
0.6453016
1
Function to validate the input fields
function validateForm () { const nameFieldDom = document.getElementById('name'); const textFieldDom = document.getElementById('message'); const checkboxDom = document.getElementById('isAttending'); // console.log('Data within these fields is: ', nameFieldDom.value, textFi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verify_inputs(){\n if(document.getElementById(\"Split_By\").value == ''){\n return false;\n }\n if(document.getElementById(\"Strength\").value == ''){\n return false;\n }\n if(document.getElemen...
[ "0.75716704", "0.7498527", "0.7475599", "0.74356055", "0.7426005", "0.7376726", "0.73753077", "0.7356976", "0.72828335", "0.72743195", "0.72681874", "0.725369", "0.72524756", "0.72331893", "0.7224246", "0.7209773", "0.71886057", "0.7175569", "0.71740365", "0.71532345", "0.715...
0.69344854
44
Function to display success result
function displaySuccess () { $('.validationText').hide(); $('#wishForm').hide(); return $("#successMsg").show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function successTest(data){\r\n return showSuccess(data.message)\r\n}", "function showSuccess() {\n showStatus();\n}", "function displayResults() {\n var res = \"\";\n if (sStatement.length > 0 ) {\n res += \"Successfully posted: \" + sStatement + \"\\n\";\n }\n if (fSt...
[ "0.74503636", "0.7390496", "0.7042577", "0.70395637", "0.6946025", "0.69420373", "0.69303805", "0.68928623", "0.68261385", "0.6778124", "0.6757147", "0.67315924", "0.67008823", "0.66976404", "0.6675765", "0.66717", "0.66204673", "0.66011465", "0.65963566", "0.6588868", "0.658...
0.7284725
2
Function show loading screen
function showLoadingScreen () { const chatContainerDom = document.getElementById('chatReadSection'); const loadingDom = document.createElement('div'); loadingDom.setAttribute('class', 'loading-screen'); loadingDom.innerHTML = 'Loading Wishes...'; chatContainer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayLoading() {\n console.log(\"Loading...\");\n }", "function showLoadingView() {\n $loader.css(\"display\", \"block\");\n }", "function show_loader()\r\n {\r\n $(\"#loader\").show();\r\n }", "function Procesando() {\n $(\"#divLoading\").show();\n }", "function sho...
[ "0.86275953", "0.84092975", "0.8147831", "0.8127018", "0.80940235", "0.799847", "0.79926014", "0.79022604", "0.7851811", "0.7839007", "0.78318197", "0.7822983", "0.7777691", "0.7773789", "0.7772992", "0.7743702", "0.7743384", "0.7742114", "0.7732376", "0.770485", "0.76794404"...
0.7484896
48
Function hide loading screen
function hideLoadingScreen () { const chatContainerDom = document.getElementById('chatReadSection'); const loadingDom = document.querySelector('#chatReadSection>div.loading-screen'); if (loadingDom) chatContainerDom.removeChild(loadingDom); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideLoadingView() {\n}", "function hideLoadingScreen(){\n $( \".loader\" ).hide();\n $(\".loader-text\").html(\"Cleaning sequences!\");\n}", "function hideLoadingView() {\n $loader.css(\"display\", \"none\");\n }", "function hideLoader() {\n\n loader.style.display = \"none\";\n\n }", "fu...
[ "0.84616023", "0.84118193", "0.83624727", "0.82337576", "0.8126654", "0.81264806", "0.8125736", "0.81152946", "0.81152946", "0.8113029", "0.8104922", "0.80975026", "0.8091695", "0.80758834", "0.8063565", "0.8048171", "0.80103457", "0.80048984", "0.7989266", "0.7963812", "0.79...
0.7450023
69
Submit Chat Post Message to Firebase
async function onChatFormSubmission() { console.log('jQuery submit form!'); if (validateForm()) return $('.validationText').show(); else { const nameFieldDom = document.getElementById('name'); const textFieldDom = document.getElementById('message'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendData() {\r\n var key = firebase.database().ref(`messages`).push().key;\r\n let obj = {\r\n key: key,\r\n sender: name,\r\n msg: input.value,\r\n msgTime: time,\r\n };\r\n firebase.database().ref(`messages/${key}`).set(obj);\r\n input.value = \"\";\r\n}", "function sendMessage(){\n ...
[ "0.7519369", "0.7389048", "0.71282506", "0.69886374", "0.6861449", "0.6842325", "0.67828214", "0.67624164", "0.6756764", "0.672771", "0.672771", "0.6708927", "0.6708719", "0.6691594", "0.668193", "0.6670771", "0.66529673", "0.6624317", "0.6579325", "0.6533707", "0.6529572", ...
0.6262233
55
INIT scripts ==================================================== Async Main Method
async function initMethod () { const fb = await getFirebaseContent(); resetMessageDom(); populateDateFields(fb); populateScriptureContent(fb); populateVenueHeader(fb); populateChatContent(fb); populateInvitationContent(fb); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async init() {}", "async init() {}", "async init () {}", "async init(){}", "async init() {\n\n }", "async init () {\r\n debug.log('called init');\r\n return;\r\n }", "async init () {\n this.bridge = await this._getBridge()\n this.lamps = await this._getLamps()\n this.modules ...
[ "0.8144177", "0.8144177", "0.8082911", "0.75952196", "0.7587575", "0.754891", "0.74703115", "0.7341163", "0.7341163", "0.7334857", "0.717473", "0.71694523", "0.71694523", "0.7139944", "0.7110292", "0.706567", "0.7040772", "0.699337", "0.69719183", "0.6898727", "0.6867167", ...
0.0
-1
var AudioSlide = require('/common/AudioSlide')
function StorySlide(_slideData, _storyID , _mediaManager , _speechManager , _fxManager , _touchSound){ this.touchSound = _touchSound; // start animated array this.animatedItems = []; this.storyID = _storyID; this.mediaManager = _mediaManager; this.speechManager = _speechManager; this.fxManager = _fxManager; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playAudio() {}", "function require() { return {}; }", "function SoundLoader() {\n}", "function audio (audioURL) {\n //create new audio object and pass file path as parameter\n let audio = new Audio(audioURL);\n //play method\n audio.play();\n}", "function audio(audioURL) {\n let audio = new ...
[ "0.58425814", "0.57811177", "0.57235503", "0.5703932", "0.5689688", "0.5589312", "0.5507189", "0.54883164", "0.54864544", "0.5450334", "0.5437322", "0.5417594", "0.5417594", "0.5387641", "0.5339266", "0.5295366", "0.5264521", "0.52547157", "0.52390414", "0.52197057", "0.52118...
0.0
-1
Function to gather docs for table and map
function getFilteredDocs() { // Store all docs filtered by search term let filteredDocs; if (dbState.search == "") { // If no search term is entered, then just gather all docs filteredDocs = db.find({}); } else { // Create a regular expression of search term searchSubstr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GenerateDocs () {\n\t\t\t\tif (!!PT._docs) return;\n\t\t\t\t// ------------------------------------------\n\t\t\t\tlet THS = this,\n\t\t\t\t\ttget = (w)=>(n)=>(w[n]),\n\t\t\t\t\ttadd = (w)=>(t)=>(w[t.unique(t.name)]=t.toDoc()),\n\t\t\t\t\tikey = ['L','O'], omit = [\n\t\t\t\t\t\t\t\t'GenerateDocs','Docs','Exa...
[ "0.7047739", "0.66952354", "0.6255857", "0.62060076", "0.61011124", "0.5846999", "0.5807662", "0.57535976", "0.573341", "0.5615411", "0.55807865", "0.55367863", "0.552348", "0.5500592", "0.54973227", "0.5487464", "0.54653287", "0.5421494", "0.54136413", "0.54103696", "0.53957...
0.0
-1
Opening edit window also requires loading previous content into inputs and saving id in dbState
function loadDocOnAddPage(id) { searchedDocs = db.findOne({ _id: id }, function (err, doc) { if (err) console.log(err); dbState.editingID = doc._id; dbState.editingDate = doc.date; let inputs = document.querySelectorAll("#add-page input"); let textArea = document.querySelec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "edit() {\n this._enterEditMode();\n }", "function _edit() {\n $('name').value = this.name;\n $('key').value = this.key;\n $('action').value = this.action;\n switchToView('edit-form');\n}", "function editopen(id, url) {\n\t$('#idedit').val(id);\n\t$('#urledit').val(url);\n}", "handleEdit(i...
[ "0.7279281", "0.717106", "0.70534253", "0.6899905", "0.68427664", "0.6835704", "0.6835704", "0.6835704", "0.6835704", "0.6835704", "0.6835704", "0.6835704", "0.6814589", "0.6794985", "0.6787211", "0.6773041", "0.6748955", "0.6731673", "0.6722172", "0.671131", "0.6710811", "...
0.64411724
45
Function to format phone number inputs
function formatPhoneInput() { let inputNode = document.querySelector("#phone-input"); let originalCursorPosition = inputNode.selectionStart; let originalValue = inputNode.value; let validChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; let unformattedNumber = ""; for (let char of or...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function phoneFormatter() {\n\t\t$('#number').on('input', function () {\n\t\t\tlet number = $(this).val().replace(/[^\\d]/g, '');\n\t\t\tif (number.length == 7) {\n\t\t\t\tnumber = number.replace(/(\\d{3})(\\d{4})/, '$1-$2');\n\t\t\t} else if (number.length == 10) {\n\t\t\t\tnumber = number.replace(/(\\d{3})(\\d{3...
[ "0.82152337", "0.8108129", "0.79832727", "0.78421044", "0.78032947", "0.77826315", "0.7742471", "0.7725056", "0.76708734", "0.76391536", "0.76391536", "0.7634792", "0.76322025", "0.7443094", "0.7391562", "0.73735094", "0.7371285", "0.73013276", "0.72646374", "0.7248596", "0.7...
0.8119584
1
Function to manipulate table header html to display the correct sort icon with correct direction
function updateSortIcon() { // Remove previous downward sort icon, if it exists if (document.querySelector("th i.fa-sort-down")) { document.querySelector("th i.fa-sort-down").classList.remove("fa-sort-down"); } // Remove previous upward sort icon, if it exists if (document.querySelector("th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTableHeader() {\n return headers.map(({ name, field, sortable }, index) => {\n // specify icon classes\n const cls = [classes.sort_icon];\n if (sortingField === field && sortingOrder === 'desc') cls.push(classes.rotated);\n\n return (\n <th\n key={index}\n ...
[ "0.776546", "0.7214889", "0.7207482", "0.71102417", "0.6984208", "0.69262755", "0.68924516", "0.6833165", "0.66354793", "0.6624988", "0.660084", "0.65939814", "0.6593098", "0.65914327", "0.65906024", "0.65906024", "0.65906024", "0.65906024", "0.65906024", "0.65906024", "0.659...
0.76496357
1
Functions to toggle between different pages
function showTablePage() { loadDocsInTable(); document.querySelector("#table-page").style.display = "inherit"; document.querySelector("#map-page").style.display = "none"; document.querySelector("#add-page").style.display = "none"; document.querySelector("#table-page-tab").style.backgroundColor = "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_page() {\n $(\".toggleable\").addClass(\"hidden\");\n $(window.location.hash).fadeIn(200).removeClass(\"hidden\");\n if (window.location.hash == \"#page-map\") initialize(); // for map\n if (window.location.hash == \"#page-drugs\") render_drug_list(); // for drugs\n if (window.locati...
[ "0.72986275", "0.7052928", "0.68428737", "0.683521", "0.6783917", "0.67502844", "0.6709241", "0.66964257", "0.6637122", "0.65859014", "0.65825474", "0.6582369", "0.6559408", "0.6533016", "0.65029746", "0.6442019", "0.64030516", "0.6400296", "0.6380354", "0.6378177", "0.636972...
0.0
-1
read from database text to send it via mail to user test2 callback working
function getText(callback) { connection.query("SELECT text FROM mail_notif WHERE employees_id=?", [i], function (err, result) { if (err) throw err; callback((result.length > 0) ? result[0].text : ""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendTextEmail() {\n email([EMAIL], null, null, null, this.state.text);\n }", "function uploadNote()\n {\n // Get the content of email and then calls the 'callback' function.\n var item = Office.context.mailbox.item.body.getAsync(\"text\", callback);\n }", "function getMail(callback) {\r...
[ "0.6044768", "0.59665495", "0.5779634", "0.56597066", "0.5557487", "0.5556599", "0.5541372", "0.55372906", "0.5462343", "0.54621476", "0.54420763", "0.54009145", "0.53953636", "0.5392798", "0.5387185", "0.5387011", "0.5383705", "0.53588414", "0.53555655", "0.53443736", "0.532...
0.64475656
0
test3 callback for mails
function getMail(callback) { connection.query("SELECT main_mail FROM mail_notif WHERE employees_id=?", [i], function(err, result) { if (err) throw err; callback((result.length > 0) ? result[0].main_mail : ""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testEmail(doSort, AddAnn, AddComic) {\r\n\r\nvar subject = \"Test Newsletter Week \" + getWeek();\r\nvar body = createEmail(AddAnn, AddComic, doSort);\r\nvar recipient = userEmail;\r\n\r\nsendAndSaveEmail(subject, recipient, body, false);\r\n}", "function emailSuccess() {}", "function Survey_Connector...
[ "0.6879609", "0.6730726", "0.64725095", "0.6310128", "0.62570125", "0.61981946", "0.61587584", "0.6154078", "0.59822434", "0.594627", "0.58991414", "0.5885474", "0.58732367", "0.5812994", "0.57771116", "0.57706743", "0.57565755", "0.57506776", "0.56888247", "0.5688079", "0.56...
0.0
-1
async..await is not allowed in global scope, must use a wrapper
async function main(){ // Generate test SMTP service account from ethereal.email // Only needed if you don't have a real mail account for testing // create reusable transporter object using the default SMTP transport let transporter = nodemailer.createTransport({ host: "some host", port: 465...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async method(){}", "async function MyAsyncFn () {}", "async function test() {}", "async function WrapperForAsyncFunc() {\n const result = await AsyncFunction();\n console.log(result);\n}", "async function asyncFn(){\n\n return 1;\n}", "async function foo() {\n return 1\n}", "async method...
[ "0.72744536", "0.72034025", "0.7089427", "0.7000267", "0.69711095", "0.69406927", "0.6841097", "0.68316275", "0.6773007", "0.67503726", "0.67205113", "0.670386", "0.6693055", "0.6580003", "0.6549973", "0.654307", "0.6539515", "0.6538346", "0.6524191", "0.6501013", "0.6489862"...
0.0
-1
create a node which will uppercase a string
function toUpper(str) { return str.toUpperCase() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uppercase(input) {}", "function upperCase(name){\n\n}", "function uppercase(str)\n{\n\t//code goes here\n}", "function gen_uppercase() {\r\n return gen_lowercase().toUpperCase();\r\n}", "function up(text) {\n var x = text;\n x.value = x.value.toUpperCase();\n}", "function toUpper(c){\r\...
[ "0.68226635", "0.6530252", "0.64736015", "0.6391183", "0.63584834", "0.63010806", "0.62926847", "0.6238545", "0.622187", "0.6146249", "0.6137965", "0.6074398", "0.60730267", "0.6066556", "0.6061028", "0.605665", "0.6049845", "0.60475165", "0.60340405", "0.60340405", "0.602555...
0.5672014
60
fixed drawer : changing false to true
function handleDrawerClose() { setOpen(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_drawerOrTabsLayout () {\n if (window.innerWidth > this.maxDrawerWidth) {\n this.drawerMode = false\n } else {\n this.drawerMode = true\n }\n }", "floatDrawer() {\n this.__isFloating = true;\n }", "_handleDrawer () {\n this.drawerIsOpen = !this.drawerIsOpen\n }", "function start_d...
[ "0.72694135", "0.7128216", "0.7022075", "0.675633", "0.64913243", "0.6481487", "0.6472909", "0.6472909", "0.63603127", "0.6359509", "0.632511", "0.6298307", "0.62973034", "0.6249445", "0.6231097", "0.61942357", "0.6165398", "0.61534566", "0.6135306", "0.6134425", "0.6116712",...
0.62139344
15
draws the entire rink including all of the regulation lines, and objects
function drawCanvas() { //create the outline of the rink ctx.beginPath(); ctx.moveTo(0, c.height - radius); ctx.lineTo(0, radius); ctx.arc(radius + 0, radius + 0, radius, Math.PI, 1.5 * Math.PI); ctx.lineTo(c.width - radius - 0, 0); ctx.arc(c.width - r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "redraw() {\n this.clear();\n this.beginFill();\n this._out.drawShape(this._properties);\n this.endFill();\n }", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big re...
[ "0.70087284", "0.6836402", "0.68023753", "0.6628745", "0.6615933", "0.66133", "0.66104525", "0.6552536", "0.6541876", "0.64918095", "0.64889723", "0.64877355", "0.6452861", "0.6452274", "0.6446682", "0.6425064", "0.6381672", "0.6380964", "0.63794285", "0.6371892", "0.6367299"...
0.6291103
38
function to start the animation
function startAnimation() { timerId = setInterval(updateAnimation, 16); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "function start() {\n startSeconds = new Date().getTime() / 1000;\n animating = true;\n }", "function start () {\n animationInt = window.setInterval(animationMan...
[ "0.8029579", "0.7969622", "0.77308905", "0.76269525", "0.76111966", "0.75280774", "0.75130165", "0.74908835", "0.74908835", "0.74908835", "0.7482891", "0.74748856", "0.7449658", "0.74231595", "0.7360628", "0.7334921", "0.729568", "0.72882426", "0.72631085", "0.7251844", "0.72...
0.77769625
2
updates the position of the CPU striker according to the vertical coordinate of the puck
function moveCPUStriker() { var yDelta = puckPosY - cpuStrikerPosY; if (yDelta !== 0) { cpuStrikerPosY += cpuStrikerSpeed * (yDelta / Math.abs(yDelta)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onUpdatePosition() {\n gridDotUpper.position = position;\n gridDot.position = position;\n gridDotMiddle.position = position;\n\n if (guitarString) {\n guitarString.updateDotPosition(self);\n }\n }", "updatePosition() {\n this.handleWrapping();\n this.x += this.vx...
[ "0.63642997", "0.61462814", "0.612312", "0.61111706", "0.6072513", "0.6044441", "0.6021535", "0.5961713", "0.595827", "0.59111786", "0.58824813", "0.5834022", "0.5817463", "0.58091843", "0.57775986", "0.57753575", "0.5738198", "0.5732108", "0.57314754", "0.57256734", "0.57173...
0.74567854
0
reset the puck position in the event of a goal
function resetPuck() { puckPosX = c.width / 2; puckPosY = c.height / 2; puckDirX = 0; puckDirY = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetPlayerPos () {\n player.x = 200;\n player.y = 400;\n this.gotGift = true;\n }", "resetState() {\n this._movements = 0;\n }", "resetPos() {\n this.x = 2 * this.rightLeft;\n this.y = 4 * this.upDown + 54;\n }", "resetPosition() {\n\t\tAnimated.spring(this.state.pos...
[ "0.7242871", "0.72248", "0.7168808", "0.7077942", "0.7048528", "0.7036975", "0.6983315", "0.6964474", "0.6959107", "0.6951054", "0.694996", "0.6926476", "0.6861003", "0.6857024", "0.6855127", "0.6826859", "0.6808265", "0.67805415", "0.67742753", "0.6731174", "0.67174107", "...
0.7802704
0
reset the striker positions in the event of a goal
function resetStrikers() { if (home) { playerStrikerPosX = 0.2 * c.width; cpuStrikerPosX = 0.8 * c.width; } else { playerStrikerPosX = 0.8 * c.width; cpuStrikerPosX = 0.2 * c.width; } cpuStrikerPosY = 0.5 * c.height; pla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetState() {\n this._movements = 0;\n }", "resetPlayerPos () {\n player.x = 200;\n player.y = 400;\n this.gotGift = true;\n }", "resetSkier () {\n \n this.isJumping =false;\n this.setDirection(this.direction);\n }", "reset() {\n this._objInfo....
[ "0.70556855", "0.66617316", "0.66484636", "0.6572333", "0.6543569", "0.65099394", "0.6495316", "0.647855", "0.6466087", "0.6458823", "0.64549273", "0.64524335", "0.6434146", "0.6404296", "0.640321", "0.6377526", "0.63723165", "0.6344312", "0.6316699", "0.63085127", "0.6307166...
0.70868045
0
determine whether a goal has been scored
function goalScored() { if (puckPosX + radius < 0) { awayScore += 1; document.getElementById("away").innerHTML = "AWAY " + awayScore; return true; } else if (puckPosX - radius > c.width) { homeScore += 1; document.getElementById("home").innerHT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isGoal() {\n if (this.hamming == 0) {\n return true;\n }\n return false;\n }", "function checkGoal()\n{\n\tvar goal1 = (block1Index[0] == block1Goal[0] && block1Index[1] == block1Goal[1]);\n\tvar goal2 = (block2Index[0] == block2Goal[0] && block2Index[1] == block2Goal[1]);\n\tv...
[ "0.69302195", "0.65789664", "0.63776183", "0.63342327", "0.6166921", "0.5998331", "0.5986994", "0.5884024", "0.58551174", "0.5848467", "0.581008", "0.579242", "0.57768035", "0.5765132", "0.57217443", "0.5713316", "0.57053006", "0.56870365", "0.56849587", "0.56644905", "0.5659...
0.6438459
2
function to update the animation
function updateAnimation() { drawCanvas(); puckCollision(); if (goalScored()) { resetPuck(); resetStrikers(); } moveCPUStriker(); seconds = seconds - (16 / 1000); // as long as there is time remaining, don't stop if (seconds > 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n this.animation.update()\n }", "updateAnimation() {\n this.animator.animate();\n }", "function animate() {\n\t\t\trequestAnimationFrame( animate );\n\t\t\t//stats.update();\n\t\t\t\n\t\t\tupdate();\n\t\t\tdraw();\n\t\t}", "updateAnimation() {\n return;\n }", "function animate(...
[ "0.81103164", "0.80337965", "0.783426", "0.7751872", "0.76258653", "0.74620646", "0.7405757", "0.738195", "0.73059946", "0.7192373", "0.7154272", "0.71409583", "0.7139489", "0.71175134", "0.71107155", "0.7100068", "0.70945287", "0.7091415", "0.7032584", "0.7015193", "0.701468...
0.70807403
18
increments the period and resets the rink
function nextPeriod() { resetPuck(); resetStrikers(); periodNum += 1; period.innerHTML = "PERIOD " + periodNum; seconds = 30; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NextPeriod()\n{\n\tif(boolSaveChanges || bSelectChanged)\n\t\tSaveChanges(\"MoveToNextPeriod()\", \"Period\")\n\telse\n\t\tMoveToNextPeriod()\n}", "reset() {\n this.interval = 1000;\n }", "function rePPOne() {\n deletePayPeriod(1);\n}", "reset() {\n this.timer = 500;\n this.inte...
[ "0.631118", "0.62407815", "0.60375357", "0.59917986", "0.587074", "0.5840256", "0.5608807", "0.5580081", "0.55705845", "0.5565783", "0.5560999", "0.5552284", "0.5533077", "0.5527856", "0.55147696", "0.5513764", "0.5510394", "0.55013454", "0.54865855", "0.5479944", "0.54739845...
0.6856182
0
stops the animation when the game is over
function stopAnimation() { // end the game, give the user some closure clearInterval(timerId); var homeScore = document.getElementById("" + "home").innerHTML[document.getElementById("" + "home").innerHTML.length - 1]; var awayScore = document.getElementById(""...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "function stop() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.none);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function stopAnimat...
[ "0.78636533", "0.7852133", "0.767835", "0.7641521", "0.75854987", "0.7546804", "0.7510946", "0.744811", "0.74313754", "0.74313754", "0.74313754", "0.73732907", "0.7371351", "0.73657924", "0.7322031", "0.7274406", "0.7272535", "0.72635955", "0.7246321", "0.7197203", "0.718511"...
0.0
-1
Higherorder function criar de forma literal
function fun1 ( ) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function a(e){return function(t){return i(t,e)}}", "function a(e){return function(t){return i(t,e)}}", "function makefunc(x) {\r\n// return function() { return x; }\r\n// return new Function($direct_func_xxx$);\r\n return new Function(\"return x;\")\r\n}", "function Fn($1) { return function($2) { retu...
[ "0.68213266", "0.68213266", "0.66918623", "0.66415274", "0.6633955", "0.66268224", "0.64124084", "0.63379675", "0.63215744", "0.6316638", "0.63116926", "0.6303936", "0.62954974", "0.62859297", "0.62859297", "0.6276858", "0.6253075", "0.6246681", "0.6246681", "0.6246681", "0.6...
0.0
-1
CREATE // Employess, Persona & Department \\
function addEmployee() { connection.query("SELECT * FROM persona", function(err, res) { if (err) throw err; console.log(results); inquirer.prompt([ { name: "firstName", type: "input", message: "What is the employees First Name?" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEmployeeTable() {\n var sql = `CREATE TABLE employees (\n id INTEGER AUTO_INCREMENT PRIMARY KEY,\n first_name VARCHAR(30) NOT NULL,\n last_name VARCHAR(30) NOT NULL,\n role_id INTEGER NOT NULL,\n manager_id INTEGER,\n CONSTRAINT fk_role FOREIGN KEY (role_...
[ "0.64908123", "0.634691", "0.59378743", "0.5815896", "0.57681054", "0.57127583", "0.5650823", "0.55799943", "0.5562626", "0.556144", "0.5529662", "0.55183256", "0.54921395", "0.5379174", "0.53736466", "0.5331651", "0.52779025", "0.52411526", "0.52160853", "0.52108204", "0.519...
0.0
-1
UPDATES // employees, persona
function updateEmployee() { connection.query(`SELECT * FROM employees`, function (err, res) { inquirer.prompt([ { name: "update", type: "rawlist", message: "Which employee would you like to update?", choices: res.map(item => item.first_name, item.last_name, item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateEmployee() {\n\n}", "'UPDATE_EMPLOYEE'(state, payload) {\n const copy = state.employees.slice();\n const index = copy.findIndex(e => e.id === payload.id);\n if (index > -1) {\n copy[index] = payload\n }\n\n state.employees = copy;\n\n // clear t...
[ "0.6857453", "0.64686", "0.64326465", "0.63366973", "0.6335875", "0.62932974", "0.62587315", "0.62302893", "0.6230201", "0.6131886", "0.612398", "0.611207", "0.6089455", "0.6082706", "0.6053336", "0.6039142", "0.60331905", "0.60320926", "0.60283524", "0.6023923", "0.6022289",...
0.62949395
5
logout CONCATENATED MODULE: ./redux/actions/users/loadRestricts.js
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logoutUser() {\n return dispatch => {\n dispatch(logOut());\n }\n}", "function logoutAction() {\n localStorage.removeItem(\"ecom_token\");\n return { type: types.UNAUTHENTICATED };\n}", "static _revokeUserAuthorizationFromStore() {\n store.dispatch(actions.setIsAuthorized(false));\n ...
[ "0.70336664", "0.67594457", "0.6747321", "0.66878253", "0.66002864", "0.6557384", "0.65093786", "0.65017164", "0.6500574", "0.6441885", "0.6416278", "0.6295192", "0.62038875", "0.6201943", "0.620099", "0.6171591", "0.6145657", "0.61317486", "0.6116732", "0.6115525", "0.611241...
0.0
-1
Section: Game Logic / Applies an effect to this entity. Usually called by another antity. e.g. a fireball hits this character and applies an "ON FIRE" effect.
applyEffect (effect, source) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawEffect() {\n var effect = this.decideParticleEffect();\n if (effect)\n this.game.addEntity(effect);\n }", "async apply_effects(action, ability, effect) {\n let effect_result;\n for (let j = 0; j < action.targets.length; ++j) {\n const target_info = action....
[ "0.6816017", "0.6531633", "0.64066064", "0.6396464", "0.6314823", "0.6294035", "0.6162397", "0.61376107", "0.60909903", "0.6083888", "0.6083673", "0.6054424", "0.60234463", "0.6017968", "0.6003083", "0.59131837", "0.5879867", "0.5879867", "0.5879867", "0.5873463", "0.58352774...
0.64166164
2
Section: Event Handling / Triggers when this entity hits/touches/intersects with another.
onCollision (target, collisionCorrection) { this.doBounce(target, collisionCorrection) this.x = collisionCorrection.x this.y = collisionCorrection.y }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function areEntitiesTouching( e1, e2 ) {\r\n\treturn areRectanglesTouching( e1.getEncompassingRectangle(), e2.getEncompassingRectangle() );\r\n}", "onCollision(otherObjects) {}", "static _handle_hit_triggers() {\n \n // begin collision checking by preparing qaudtrees:\n // clear & fill all...
[ "0.6723335", "0.6401459", "0.6301124", "0.61956143", "0.61021465", "0.6028036", "0.596869", "0.5931681", "0.58952284", "0.5886834", "0.58358836", "0.58157086", "0.5804548", "0.5801994", "0.57982606", "0.57950175", "0.578285", "0.57684", "0.57684", "0.57643235", "0.5756377", ...
0.0
-1
Section: Physics / By default, every moving entity decelerates (because we don't exist in a perfect vacuum and the game doesn't take place on a slippery ice). Entities can intentionally override this logic, e.g. "if a hero is walking, ignore deceleration."
doMoveDeceleration (timeStep) { const moveDeceleration = this.moveDeceleration * timeStep / EXPECTED_TIMESTEP || 0 const curRotation = Math.atan2(this.moveY, this.moveX) const newMoveSpeed = Math.max(0, this.moveSpeed - moveDeceleration) this.moveX = newMoveSpeed * Math.cos(curRotation) this.moveY =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update () {\n let max = this.maxSpeed * this.dt;\n // if (!isNaN(max) && this.steeringForce.length() > 0) {\n this.steeringForce = this.steeringForce.minimizeInPlaceFromFloats(max, max, max); // TODO: convert Three.js clampLength method to BABYLON\n // this.steeringForce.multipl...
[ "0.67713875", "0.6677823", "0.6594795", "0.64594257", "0.6452771", "0.63812804", "0.6364082", "0.6344952", "0.6343844", "0.63409764", "0.6306976", "0.61993176", "0.6194874", "0.61624706", "0.6162076", "0.61173207", "0.6088063", "0.6086028", "0.6083092", "0.6044437", "0.604121...
0.6398301
5
Every entity has a maximum speed limit. Intentional movement speed and external force movement speed are treated separately.
doMaxSpeedLimit (timeStep) { // Limit max move speed if (this.moveMaxSpeed >= 0) { const correctedSpeed = Math.min(this.moveMaxSpeed, this.moveSpeed) const moveAngle = this.moveAngle this.moveX = correctedSpeed * Math.cos(moveAngle) this.moveY = correctedSpeed * Math.sin(moveAngle) }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constrainSpeed(maxSpeed) {\n if (this.velocity.magSq() > maxSpeed * maxSpeed)\n this.velocity.setMag(maxSpeed);\n }", "update () {\n let max = this.maxSpeed * this.dt;\n // if (!isNaN(max) && this.steeringForce.length() > 0) {\n this.steeringForce = this....
[ "0.7295972", "0.6564142", "0.65252084", "0.6466163", "0.64013666", "0.6308161", "0.6298227", "0.6285381", "0.6281134", "0.62644553", "0.61998713", "0.61614203", "0.6145519", "0.603506", "0.6021482", "0.5995015", "0.5972975", "0.595949", "0.5933871", "0.57841855", "0.57590854"...
0.74858725
0
When a solid pushed entity hits another solid entity, momentum is transferred. Usually, this leads to elastic collisions, because that chaos is fun!
doBounce (target, collisionCorrection) { if ( this.movable && this.solid && !target.movable && target.solid ) { if ( this.shape === SHAPES.CIRCLE && target.shape === SHAPES.CIRCLE ) { // For circle + circle collisions, the collision correction already // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collide(p2, damp = 1) {\n // reference: http://codeflow.org/entries/2010/nov/29/verlet-collision-with-impulse-preservation\n // simultaneous collision not yet resolved. Possible solutions in this paper: https://www2.msm.ctw.utwente.nl/sluding/PAPERS/dem07.pdf \n let p1 = this;\n let dp ...
[ "0.5961542", "0.5958212", "0.5899356", "0.5851236", "0.5838427", "0.5838427", "0.5829877", "0.5786387", "0.57783145", "0.5773231", "0.57531756", "0.57386935", "0.5677521", "0.56752056", "0.5649827", "0.5638443", "0.5622544", "0.5600119", "0.5596315", "0.5596315", "0.55921775"...
0.0
-1
Section: Getters and Setters
get left () { return this.x - this.size / 2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get section() {\n\t\treturn this.__section;\n\t}", "static get properties(){return{}}", "static get properties(){return{}}", "get () {\n }", "constructor(getter, setter) {\n this.getter = getter;\n this.setter = setter;\n }", "get first_Name() {\n return this.first_Name;\n}", "get descriptio...
[ "0.6452716", "0.63409144", "0.63409144", "0.6277427", "0.5991298", "0.59745187", "0.5952272", "0.59276944", "0.5923167", "0.5909003", "0.5905831", "0.5905831", "0.5905831", "0.58842695", "0.58842695", "0.5872024", "0.58621883", "0.5829508", "0.581825", "0.5792139", "0.5783458...
0.0
-1
Get the account and project name using a user and Expo config. This will validate if the owner field is set when using a robot account.
getProjectOwner(user, exp) { if (user.kind === 'robot' && !exp.owner) { throw new (_internal().XDLError)('ROBOT_OWNER_ERROR', 'The "owner" manifest property is required when using robot users. See: https://docs.expo.dev/versions/latest/config/app/#owner'); } return exp.owner || user.username; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getGitUserAndEmail() {\r\n const userName = await spawnGit([\"config\", \"--global\", \"user.name\"]);\r\n const email = await spawnGit([\"config\", \"--global\", \"user.email\"]);\r\n\r\n if (!userName.length || !email.length) this.sendMessage({ type: \"userNotConfigured\" });\r\n\r\n ...
[ "0.6326673", "0.60357517", "0.587709", "0.58454514", "0.5833825", "0.57194585", "0.56616485", "0.55245537", "0.5480681", "0.5469157", "0.54369116", "0.53143525", "0.53024757", "0.5269872", "0.52298594", "0.5197643", "0.51545334", "0.5149355", "0.5133753", "0.50823414", "0.507...
0.76959383
0
Logs in a user for a given login type. Valid login types are: "userpass": Username and password authentication If the login type is "userpass", we directly make the request to www to login a user.
async loginAsync(loginType, loginArgs) { if (loginType === 'user-pass') { if (!loginArgs) { throw new Error(`The 'user-pass' login type requires a username and password.`); } const apiAnonymous = _internal().ApiV2.clientForUser(); const loginResp = await apiAnonymous.postAsync('aut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function api_login(user, pass){\n\t\tif(!isBlank(main_data.login.un) && !isBlank(main_data.login.pass)){\n\t\t\tvar myJSON = {\"_object\":\"auth\",\"_action\":\"login\",\"_source\":main_data.login.method,\"email\":main_data.login.un,\"password\":main_data.login.pass};\n\t\t\tapi_get(myJSON,api_login_callback);\n\t...
[ "0.6891293", "0.6714658", "0.6677029", "0.6289115", "0.62435734", "0.62321824", "0.6223657", "0.6223657", "0.62207824", "0.61790687", "0.61690986", "0.6151321", "0.61480606", "0.6131736", "0.6127041", "0.61108345", "0.60993654", "0.6096437", "0.6095599", "0.60903656", "0.6082...
0.6818609
1
Ensure user is logged in and has a valid token. If there are any issues with the login, this method throws.
async ensureLoggedInAsync() { if (_internal().ConnectionStatus.isOffline()) { throw new (_internal().XDLError)('NETWORK_REQUIRED', "Can't verify user without network access"); } let user = await this.getCurrentUserAsync({ silent: true }); if (!user && this._interactiveAuthenticationCal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async login(token) {\n let valid = await this.validToken(token);\n if (valid)\n this.token = token;\n else\n throw \"Cannot login. Invalid token given.\";\n }", "async login(token) {\n let valid = await this.validToken(token);\n if (valid)\n ...
[ "0.68142915", "0.68142915", "0.68057585", "0.67767996", "0.6553391", "0.6550487", "0.6515234", "0.6493899", "0.6472996", "0.64675325", "0.64057875", "0.63871866", "0.63855374", "0.6384044", "0.6383455", "0.637488", "0.63130885", "0.6247143", "0.62207425", "0.6219464", "0.6212...
0.0
-1