query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
traceMover moves mover from current param to param for pos along a complex detour.
function traceMover(mover, pos, type) { if (traceLog && traceLog.currentMouseAndScripts) { traceLog.currentMover = []; } if (mover === previousMover) { stateIn.set(stateLastGood); // copy stateLastGood and use it as input tracingFailed = false; } else { previousMover = mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function traceOneStep() {\n stateInIdx = stateOutIdx = mover.stateIdx;\n const param = parameterPath(mover, t, tc, originParam, targetParam);\n if (traceLog) traceLog.currentParam = param;\n\n const stateTmp = stateOut;\n stateOut = stateIn;\n opMover.putParamToState(mover...
[ "0.6543641", "0.5610347", "0.54966974", "0.5469177", "0.5406883", "0.53981197", "0.5393311", "0.5385108", "0.5333813", "0.5315385", "0.53122234", "0.52998745", "0.5268998", "0.5242955", "0.5236932", "0.523047", "0.52276874", "0.5212546", "0.52092767", "0.5208217", "0.51826936...
0.7145623
0
Itterates over Runescape Ids from the Data spreadsheet gets the current price and returns the array [date,itemId,price]
function getCurrentItemPrices(){ //var data = createSheet("Data", [], 1, 2); var ss = SpreadsheetApp.openById("0ApfWd7fGI5rYdEYwWnVvUUI4LWxDbWxFZi1uUHpYcmc"); //var ss = SpreadsheetApp.getActive(); var datarange = ss.getRange("Responses!B:B"); //var datarange = spreadsheet.getRangeByName("ItemId"); var dval...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function priceRow(crypto, currency) {\n // Removed passing cells as arguments and then setting prices directly into them. Instead returns an array which can be set on the sheet.\n var buy_price = getPrice(crypto, \"buy\", currency);\n var sell_price = getPrice(crypto, \"sell\", currency);\n var arr = [NAMES[cr...
[ "0.61340004", "0.59561896", "0.570756", "0.56891143", "0.5656374", "0.5641227", "0.560715", "0.5599266", "0.5551677", "0.55314547", "0.55168015", "0.55113494", "0.5482324", "0.5469315", "0.5466551", "0.5450864", "0.5450099", "0.5429474", "0.54197824", "0.5402682", "0.5387212"...
0.7958945
0
Stop and reset the recognition process including the recognition task manager and all corresponding components and tasks. This function is called when a timeout occurs caused by the contiguity interval timer.
function _cancelRecognitionProcess(){ _firstEventTimeStamp = null; window.clearTimeout(_gestureContiguityIntervalTimer); if (_recognitionProcessManager.isWorking) { //check for noted already recognized gestures //console.debug(_recognitionProcessManager.recognize...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abort() {\n this.autoRestart = false;\n if (this.recognition && this.recognition.abort) {\n this.recognition.abort();\n }\n }", "function stopRecognition(){\r\n // TODO \r\n mic.removeClass('animate');\r\n start = false;\r\n }", "stop() {\n th...
[ "0.65184665", "0.6451222", "0.6429328", "0.63013035", "0.62516", "0.61887836", "0.6117402", "0.6117402", "0.6109785", "0.6074602", "0.605605", "0.6033423", "0.6010951", "0.6001564", "0.5975702", "0.59286386", "0.5927109", "0.5908731", "0.59075874", "0.5894388", "0.58925176", ...
0.7107563
0
Constructor of the recognition failed event
function GestureRecognitionFailedEvent(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ErrorEvent(files, operation, response) {\n this.files = files;\n this.operation = operation;\n this.response = response;\n }", "onErrorDataListener() {}", "failed(e) {\n this._result = null;\n }", "onErrorEvent(event) {\n this.onError(event.detail);\n }", "_onError(...
[ "0.6228619", "0.6176985", "0.5954882", "0.5946784", "0.5748923", "0.57099193", "0.5700117", "0.5683977", "0.563419", "0.5571803", "0.55660117", "0.5565564", "0.5550504", "0.55304563", "0.5521705", "0.55039036", "0.54908913", "0.5451093", "0.54458094", "0.5436791", "0.54233885...
0.6833163
0
Event interface of the recognitionstarted event.
function GestureRecognitionStartedEvent(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "record() {\n this.recognition.start();\n }", "onSpeechRecognitionStart_() {\n if (this.state_ !== Dictation.DictationState.STARTING) {\n // We tried to stop during speech shutdown.\n return;\n }\n this.state_ = Dictation.DictationState.LISTENING;\n }", "componentDidMount() {\n ...
[ "0.6416128", "0.62975365", "0.58315164", "0.5713", "0.56174755", "0.5586768", "0.5507977", "0.5426617", "0.54250675", "0.53178066", "0.5288185", "0.5275584", "0.52575535", "0.5249309", "0.52000165", "0.5199516", "0.5176467", "0.51746976", "0.5165494", "0.51394945", "0.5119641...
0.7557683
0
Recognizes the relation between gesture pathes.
function RelationRecognizer(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useGestures(props, visualElement) {\n usePanGesture(props, visualElement);\n useTapGesture(props, visualElement);\n useHoverGesture(props, visualElement);\n}", "function update_gesture_status(hand) {\n\n}", "function Awake () {\n\tgesture_HandRaise = new GestureHandRaise();\n\tgesture_Incline...
[ "0.57983893", "0.57872725", "0.54466033", "0.5388893", "0.53722805", "0.5358562", "0.5358562", "0.5288442", "0.5269929", "0.5269929", "0.5242486", "0.5167725", "0.51562786", "0.5154487", "0.5154487", "0.5153009", "0.51260626", "0.5124958", "0.51211405", "0.51211405", "0.51211...
0.5799353
0
StaticGestureRecognizer Recognizes static gestures like POINT. In this version only simple POINT gestures are implemented!
function StaticGestureRecognizer(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DollarRecognizer() // constructor\r\n{\r\n //\r\n // one predefined template for each gesture type\r\n //\r\n this.Templates = new Array();\r\n\r\n this.Templates[0] = new Template(\"star\", new Array(new Point(75, 250), new Point(75, 247), new Point(77, 244), new Point(78, 242), new Point(...
[ "0.53411263", "0.52154344", "0.51927006", "0.51721835", "0.51721835", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749", "0.5152749"...
0.78313196
0
Create an observer marker
function createObserverMarker(lon, lat, tab, color) { var point = new GLatLng(lat, lon); var infoTabs = [ tab ]; var marker = createMarker(point, infoTabs, createIcon(color)); return marker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupMarker() {\n locator = new google.maps.Marker({\n map: map,\n animation: google.maps.Animation.DROP\n\n });\n locator.addListener('click', function() {\n infowindow.open(map, locator);\n });\n}", "function createMarkers() {\n\n}", "function Observer() {}", "func...
[ "0.65378684", "0.65287316", "0.64654696", "0.64265895", "0.63198763", "0.6306935", "0.63065857", "0.63041806", "0.6262167", "0.60568327", "0.60261166", "0.59970057", "0.59757435", "0.5955581", "0.5949312", "0.5943244", "0.5936467", "0.59330064", "0.5926731", "0.5922186", "0.5...
0.735826
1
Function to handle various date jobs, in this case to return date number, month name or month number, depending on the request
function dateMaker(x) { var yesterdayDate = subDaysFromDate(new Date(),1); var monthNumber = yesterdayDate.getMonth(); var months = ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"] var month = months[monthNumber]; var dateNumber = yesterdayDate.getDate(); var year = yesterdayDate.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RecordsDate(date) {\n var splitDate = date.split('-');\n var year = splitDate[0];\n var month = splitDate[1];\n var day = splitDate[2];\n \n \n switch(month) {\n case '01':\n \n semesters = 'Second Semester';\n months = '...
[ "0.63193595", "0.62600476", "0.61576015", "0.6150897", "0.61405927", "0.6128139", "0.60923177", "0.6087092", "0.6076748", "0.60638887", "0.6006408", "0.5967457", "0.5923331", "0.59164417", "0.58691245", "0.5868972", "0.58632916", "0.58299583", "0.5814988", "0.57988197", "0.57...
0.68703604
0
Function to match yesterday with a sheet and column
function findYesterdaysColumn() { // Assigns spreadsheet to variable and sets it to active var ss = SpreadsheetApp.getActiveSpreadsheet(); // Grabs yesterday's month name var month = dateMaker('monthName'); // Sets active sheet to yesterday's month SpreadsheetApp.setActiveSheet(ss.getSheetByName(month)); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findToday(ss){\n var ss = ss;\n var todayDate = new Date();\n var timeZone = todayDate.getTimezoneOffset();\n var todayDateString = Utilities.formatDate(todayDate, timeZone, 'yyyy-MM-dd');\n var startRow = Math.floor((todayDate - new Date(2021,08,06))/(1000*60*60*24));\n for (var row = startRo...
[ "0.67378247", "0.5951514", "0.5931464", "0.5817322", "0.58162916", "0.57397974", "0.5610419", "0.5571184", "0.5442304", "0.5370339", "0.5347928", "0.5340999", "0.53084844", "0.5285986", "0.52439654", "0.5226999", "0.52112734", "0.52074593", "0.51981366", "0.5197051", "0.51783...
0.7595826
0
Returns the jumppoint leading to the given destination
jumpPointTo ( destination ) { for ( let i = 0; i < this.jumpPoints.length; i++ ) { if ( this.jumpPoints[i].destination === destination ) { return this.jumpPoints[i]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jumpTo(position)\n {}", "jumpTo( dest, callback ) {\n let _h = Math.max( 0, Math.floor( this._target.scrollHeight || 0, this._target.clientHeight || 0 ) );\n\n this._pos = this._target.scrollTop | 0;\n this._to = this._pos;\n this._max = Math.floor( _h - this._target.clientHeight || 0 );\n\n i...
[ "0.6212938", "0.6119622", "0.61043924", "0.5810993", "0.5698297", "0.56650585", "0.56591374", "0.5652394", "0.5641082", "0.56397057", "0.5635234", "0.55682063", "0.5544021", "0.54933476", "0.54858875", "0.54727834", "0.54623276", "0.5446419", "0.54343766", "0.54275894", "0.54...
0.8080105
0
Builds the security context from the result of validate_token.
function createSecurityContext(validateResult, next) { var actor, serializedToken; utils.debug('Building securitycontext (validationResult = %d).', validateResult.result); actor = validateResult.updated_client_actor || {}; if (!actor || !actor.token) { next(); return; } AuthT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SecurityContext(validateResult, actor, token) {\n validateResult = Number(validateResult);\n\n if (!validateResult) {\n validateResult = 110;\n }\n if (!actor) {\n actor = {};\n }\n if (!token) {\n token = {};\n }\n\n this.actor = {\n id: actor.actor_id,...
[ "0.6110629", "0.58032286", "0.5584673", "0.5369846", "0.5175186", "0.50601256", "0.5047053", "0.5041668", "0.5029243", "0.50227016", "0.48561266", "0.47983924", "0.4750264", "0.4728192", "0.4714382", "0.47115147", "0.4682493", "0.46786526", "0.46109703", "0.4605186", "0.45941...
0.6987807
0
checks the states of both requests to see if the transform can be applied
function checkStates() { if ( xml.ready() && xsl.ready() ) { //cache xsl request if id set if (xslCacheId && xslCacheId != "") { parent.cacheXsl( xslCacheId, xsl ); } //both requests are ready, do tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transform() {\n // if the status is unchecked or deleted, then don't transform\n if (!STOP_VALIDATING_ON.includes(this._status)) {\n let status = true;\n\n status = !this._transformMainService() ? false : status;\n status = !this._transformEstablishmentType() ? false : status;\n status = ...
[ "0.57880044", "0.5335582", "0.52647674", "0.5258171", "0.5222303", "0.5222303", "0.52068305", "0.5168619", "0.51569194", "0.51569194", "0.51569194", "0.51569194", "0.51569194", "0.51569194", "0.51569194", "0.5141001", "0.51079893", "0.50845754", "0.5059902", "0.5043823", "0.5...
0.67025197
0
this index.js file is used for including the faker library as a CommonJS module, instead of a bundle you can include the faker library into your existing node.js application by requiring the entire /faker directory var faker = require(./faker); var randomName = faker.name.findName(); you can also simply include the "fa...
function Faker (opts) { var self = this; opts = opts || {}; // assign options var locales = self.locales || opts.locales || {}; var locale = self.locale || opts.locale || "en"; var localeFallback = self.localeFallback || opts.localeFallback || "en"; self.locales = locales; self.locale = locale; se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Faker(opts) {\n var self = this;\n opts = opts || {}; // assign options\n\n var locales = self.locales || opts.locales || {};\n var locale = self.locale || opts.locale || \"en\";\n var localeFallback = self.localeFallback || opts.localeFallback || \"en\";\n self.locales = locales;\n self.locale = l...
[ "0.61751777", "0.5734677", "0.5718852", "0.5646984", "0.5625919", "0.56028104", "0.560203", "0.5568648", "0.55300623", "0.5375268", "0.5298777", "0.52925056", "0.5254871", "0.5226162", "0.52249146", "0.5224028", "0.52233225", "0.52203846", "0.51620877", "0.5159001", "0.514776...
0.57772076
1
this program is a JavaScript version of Mersenne Twister, with concealment and encapsulation in class, an almost straight conversion from the original program, mt19937ar.c, translated by y. okada on July 17, 2006. and modified a little at july 20, 2006, but there are not any substantial differences. in this program, pr...
function MersenneTwister19937() { /* constants should be scoped inside the class */ var N, M, MATRIX_A, UPPER_MASK, LOWER_MASK; /* Period parameters */ //c//#define N 624 //c//#define M 397 //c//#define MATRIX_A 0x9908b0dfUL /* constant vector a */ //c//#define UPPER_MASK 0x80000000UL /* most significant w-r b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MersenneTwister19937()\n{\n /* constants should be scoped inside the class */\n var N, M, MATRIX_A, UPPER_MASK, LOWER_MASK;\n /* Period parameters */\n //c//#define N 624\n //c//#define M 397\n //c//#define MATRIX_A 0x9908b0dfUL /* constant vector a */\n //c//#define UPPER_MASK 0x80000000UL /* mo...
[ "0.79024726", "0.7783943", "0.74435055", "0.7388256", "0.7388256", "0.7388256", "0.7388256", "0.7388256", "0.6801584", "0.6801584", "0.66365945", "0.6312761", "0.61584926", "0.59632343", "0.593904", "0.59230477", "0.58683926", "0.586101", "0.5846013", "0.5832885", "0.57791007...
0.7944841
1
Locks a game move
_lockMove() { this._movePending = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lockMoves() {\n let self = this;\n self.canMove = false;\n setTimeout(function() {\n self.canMove = true;\n if (self.checkGameOver() && self.changed) {\n self.populate();\n }\n }, this.moveLockTimout);\n }", "_unlockMove() {\n ...
[ "0.80269647", "0.69330555", "0.65838075", "0.64041626", "0.64041626", "0.6389601", "0.6353761", "0.6347194", "0.6212307", "0.61725134", "0.616745", "0.6158087", "0.6049265", "0.59966195", "0.59920484", "0.59759957", "0.58832526", "0.5851344", "0.58494943", "0.5827133", "0.582...
0.7381934
1
Unlocks a game move
_unlockMove() { this._movePending = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cmd_Unlock() {\n\t\tvar msg_box = document.getElementById(\"ta_Main\");\n\t\tswitch (current_loc) {\n\t\t\tcase 0:\n\t\t\t\t//If location is the prison cell, and the player has lock pick(s) in inventory, unlock door\n\t\t\t\tif ((loc_locked[current_loc] === true) && (inventory_q[1] != 0)) {\n\t\t\t\t\tupd...
[ "0.7023205", "0.6745147", "0.6698048", "0.6698048", "0.6558631", "0.64670634", "0.6447207", "0.644295", "0.63407034", "0.62818205", "0.6272515", "0.619464", "0.6172272", "0.6137663", "0.6086909", "0.60366946", "0.59649074", "0.59649074", "0.59649074", "0.5964113", "0.5932735"...
0.75905305
0
arguments :container, width, height, adunitId
getAd() { let adunit = {} if (arguments.length == 2) { adunit = { id: arguments[1] + '', minPrice: this.minPrice + '', creativeRestrictions: { acceptedCreativeMimeTypes: ['image/jpeg', 'image/png'], allo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupContainer(containerId) {\n\t\tvar container = document.getElementById(containerId);\n\t\tcontainer.style.width = gameContainer.size.width + 'px';\n\t\tcontainer.style.height = gameContainer.size.height + 'px';\n\t}", "function createAdDisplayContainer() {\n // We assume the adContainer is the DOM ...
[ "0.63817644", "0.609674", "0.5908924", "0.58668804", "0.56727576", "0.564321", "0.56353486", "0.56353486", "0.5528958", "0.5519654", "0.5478965", "0.54788226", "0.5459984", "0.5445426", "0.5415976", "0.5394074", "0.5333785", "0.5331113", "0.5310553", "0.5238912", "0.51977843"...
0.6374908
1
You have a positive number n consisting of digits. You can do at most one operation: Choosing the index of a digit in the number, remove this digit at that index and insert it back to another or at the same place in the number in order to find the smallest number you can get. Task: Return an array or a tuple or a strin...
function smallest(n) { n = String(n).split('').map(num => parseInt(num)); let startIndex = null; let endIndex = null; let ascNums = n.slice().sort((a,b) => a - b); let nextSmallest = ascNums[1]; // console.log(smallest, nextSmallest); // console.log(ascNums); // console.log(n); for (let i = 0; i < n.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextBigger(n){\n let number = n.toString(); //so that swapping digits is a little easier\n const swap = (a, b) => { return number.substring(0, a) + number.substring(b, b + 1) + number.substring(a + 1, b) +\n number.substring(a, a + 1) + number.substring(b + 1, number.length);\n }; //retu...
[ "0.6983644", "0.67446035", "0.6743353", "0.6654863", "0.66030437", "0.65843034", "0.6566995", "0.6555035", "0.6545022", "0.6540257", "0.6430725", "0.64100015", "0.6389176", "0.63626283", "0.6354482", "0.6348825", "0.6325675", "0.6323293", "0.63190657", "0.629992", "0.6292146"...
0.78191805
0
Some usage requires waiting on bot load, so it's best to wrap in async. Here we initialise the bot and our custom conversation branching (scene). Adding "global" listeners that our outside any scene's context. It will enter the 'welcome' path on room enter, or when greeted.
async function start () { await bot.load() scene.setup(bot) bot.global.enter(paths.welcome) bot.global.text(patterns.welcome, paths.welcome) bot.global.text(patterns.start, paths.start) await bot.start().catch((err) => { console.error(err) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n // Kick off the telegram bot, so it is listening for messages\n this.startTelegramBot();\n }", "[_eventsInit]() {\n const slack = this[_registry].get('Slack');\n\n // the client has successfully connected to the server\n slack.rtmClient.on('hello', () => {\n this._log.de...
[ "0.5970216", "0.57652324", "0.5757133", "0.57341266", "0.564829", "0.56398696", "0.5596394", "0.55936545", "0.5570484", "0.5565915", "0.5565685", "0.5553507", "0.5549066", "0.5488746", "0.54787433", "0.54714525", "0.54508865", "0.54138607", "0.5392999", "0.53886044", "0.53886...
0.66778827
0
display info to its respective DOM element
function displayInfo() { // pass the values of acctInfo to their respective DOM element $('.info-group').children('.info-display').each(function() { var dataName = $(this).data('name'); if (typeof(dataName) === 'undefined') { /* do nothing */ } else if(typeof(rentalUnitInfo[dataName]) === 'object') { var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showInfo() {\n this.eltTitre.textContent = this.name;\n this.eltAddress.textContent = this.address;\n this.eltValeurStatus.textContent = this.status;\n this.eltNbBikes.textContent = this.mainStands.availabilities.bikes;\n this.eltNbPlaces.textContent = this.mainStands.availabilit...
[ "0.7299884", "0.70961165", "0.70228195", "0.6922973", "0.69007367", "0.6898409", "0.6898163", "0.6887871", "0.68813115", "0.6840644", "0.6711965", "0.6665054", "0.66389894", "0.6627292", "0.6616692", "0.6582246", "0.6575612", "0.6572147", "0.65701354", "0.65103245", "0.646664...
0.7158513
1
attach/refresh event listener to .btnremove remove a list element in "Amenities" and "Terms and Conditions"
function addListenerBtnRemove() { $('.btn-remove').off() $('.btn-remove').on('click', function() { var dataName = $(this).parent().parent().data('name'); var indexLi = $(this).parent().index(); // update array rentalUnitInfo[dataName].splice(indexLi, 1); if(rentalUnitInfo[dataName].length) { $(this).p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove(){\n const btn = event.target;\n const index = parseInt(btn.parentElement.getAttribute(\"idx\"), 10);\n lists.splice(index, 1);\n document.getElementById(\"sec\").innerHTML = lists.map((list, i) => {\n return `<li idx=\"${i}\">${lists}<button type=\"button\" onclick=\"remove()\">De...
[ "0.711362", "0.6964219", "0.6805834", "0.6746588", "0.67282903", "0.6697038", "0.66967034", "0.6681024", "0.66801375", "0.6678361", "0.666302", "0.6619443", "0.65564024", "0.6534539", "0.6530313", "0.65275943", "0.65275604", "0.65081364", "0.6505064", "0.64754695", "0.6470691...
0.73858374
0
True if property is value.
function isValue(property, value) { return property === value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "function isValue(x) {\n\t\treturn x !== undefined && x !== null && x !== ''\n\t}", "function is(value) {\n var candidate = va...
[ "0.6580943", "0.65462154", "0.6540225", "0.6519191", "0.6519191", "0.64770514", "0.64228034", "0.6320551", "0.6319181", "0.6319181", "0.6298657", "0.6257985", "0.6254589", "0.6224932", "0.6216255", "0.6181197", "0.6176504", "0.61651635", "0.61651635", "0.6149734", "0.61350954...
0.7937575
0
Construct a Ship (app) instance.
function Ship() { this.load = loadShip(this); this.start = _.bind(this.start, this); this.load = _.bind(this.load, this); this.down = _.bind(this.down, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_ship(hp) {\n if (game_over === false) {\n ship = new MainShip(hp)\n console.log('created new ship')\n }\n}", "initializeShippingView() {\n const shippingView = new ShippingView();\n }", "function Ship() {\n let loc = config.boardSize / 2;\n MovingObject.call(this, loc, loc...
[ "0.58768815", "0.5866224", "0.5744847", "0.5636142", "0.56275046", "0.5511559", "0.54700446", "0.5412126", "0.5392299", "0.53303176", "0.52482575", "0.5243129", "0.5161747", "0.5125858", "0.5112916", "0.5104129", "0.5076229", "0.50407964", "0.49841356", "0.49704778", "0.49402...
0.59339553
0
assume radius ~ mass for vel change equation. Densities not implemented.
newVel (radius1, radius2, vel1, vel2) { let mass1 = radius1 * radius1 * Math.PI; let mass2 = radius2 * radius2 * Math.PI; return (vel1 * (mass1 - mass2) + (2 * mass2 * vel2)) / (mass1 + mass2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function circleRadius(mag) {\n return mag * 30000;\n}", "set diameter(d){\r\n this.radius = d / 2;\r\n }", "circumference() {\n this.circle['circumference'] = parseFloat((2 * Math.PI * this.dim.r).toFixed(this.fixed));\n }", "circumference() {\n return 2 * this.radius * Math.PI;\n }", "f...
[ "0.63559365", "0.6261403", "0.62123257", "0.60170984", "0.5985138", "0.5973125", "0.59719896", "0.59656525", "0.5948424", "0.5948239", "0.5902935", "0.5894876", "0.5881322", "0.5871619", "0.58644134", "0.58475626", "0.58466697", "0.5827486", "0.5824609", "0.5809193", "0.57676...
0.64921033
0
This method toggles Edit and save button names respectively.
function toggleEditButton() { var edit_button = document.getElementById('edit-save-button'); if (isSave === false) { edit_button.innerHTML = 'Save <i class="fa fa-save fa-lg" aria-hidden="true">'; isSave = true; } else { edit_button.innerHTML = 'Edit <i class="fa fa-edit fa-lg" aria-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_clickEditButton(e) {\n this.toggle();\n }", "handleEditToggle() {\n this.editMode = !this.editMode;\n }", "function editClicked() {\n toggleEditButton();\n toggleContentEditable();\n toggleBorder();\n}", "onToggleEdit() {\n\t\tlet newState = this.state;\n\t\tnewState.edit = !newState.edit;\...
[ "0.7333831", "0.6939404", "0.6905133", "0.6903566", "0.68755686", "0.6825736", "0.67780685", "0.6752093", "0.6746624", "0.67120534", "0.6711048", "0.66871905", "0.6673526", "0.6598764", "0.6535624", "0.65156025", "0.6445099", "0.6431253", "0.64294636", "0.63685334", "0.634945...
0.76485723
0
This method toggles content editable for post title and content
function toggleContentEditable() { var post_desc = document.getElementById('post-desc'); var content_edit = post_desc.getAttribute('contenteditable'); var title = document.getElementById('post-title-id'); var title_edit = title.getAttribute('contenteditable'); if (content_edit === "true" && title_ed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initiateEditContentMode(){\n if(otherMode === 0 || editMode === 1) {\n if (editMode === 1) {\n hideEditable();\n\n otherMode = 0;\n editMode = 0;\n } else {\n makeEditable();\n\n otherMode = 1;\n editMode = 1;\n }\n ...
[ "0.6881652", "0.6681994", "0.6669817", "0.65281016", "0.6505627", "0.63923305", "0.6354656", "0.6348801", "0.63363576", "0.62788576", "0.6150157", "0.6024944", "0.6020618", "0.5981349", "0.5970672", "0.5953636", "0.5948274", "0.5933196", "0.5903092", "0.58959216", "0.58618736...
0.8670643
0
This method toggles border for post title and content
function toggleBorder() { var post_desc = document.getElementById('post-desc'); var title = document.getElementById('post-title-id'); console.log(post_desc.style.border); if (post_desc.style.border === "") { post_desc.style.border = "solid"; } else { post_desc.style.border = ""; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeBorder() {}", "function widenBorder() {\n\t$(\"#nhContent\").css(\"border-right-width\", 0);\n}", "function border() {\n\tstrokeWeight(1);\n\tstroke(0);\n\tbackground(5, 25, 55);\n}", "function handler() {\n \n if(document.body.style.border == \"5px solid red\"){\n document.body.style.bord...
[ "0.58795196", "0.58557755", "0.5584073", "0.55187804", "0.54639393", "0.5457355", "0.5441086", "0.5412271", "0.5404819", "0.53910106", "0.537029", "0.53625983", "0.5332315", "0.53086686", "0.5228368", "0.52082556", "0.52026576", "0.5181829", "0.518066", "0.5171972", "0.516676...
0.77450144
0
This method loads the required post content from session.
function load() { var authorName = sessionStorage.getItem("postAuthorName"); var title = sessionStorage.getItem("postTitle"); var content = sessionStorage.getItem("postContent"); var post_author = document.getElementById('author'); post_author.innerHTML = authorName; var post_title = document....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static loadSession() {\n if (typeof window === 'undefined') return\n idFeedCache = parseJSON(window.sessionStorage.idFeedCache, {})\n itemFeedCache = parseJSON(window.sessionStorage.itemFeedCache, {})\n }", "function pageLoadData() {\n // create session data\n // var workingDate = pageload.getDate();...
[ "0.5766355", "0.56381893", "0.5576329", "0.5469006", "0.5449169", "0.54361904", "0.5415953", "0.5388589", "0.5371808", "0.53122675", "0.52883816", "0.5262744", "0.52513826", "0.5247588", "0.52416563", "0.5206631", "0.51620203", "0.51444256", "0.5143365", "0.5142139", "0.51234...
0.6570916
0
Takes the current theme config and resolves all page and widgetsetting refs
resolveAll() { this.config = appConfig.theme; writeToConfig({ theme: this.resolve() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useThemeOptions() {\n const { allChicagoDocsConfig } = useStaticQuery(graphql`\n query {\n allChicagoDocsConfig {\n nodes {\n assetsPath\n basePath\n basePathLabel\n docsPath\n mainMenu {\n name\n path\n }\n ...
[ "0.5992633", "0.5347761", "0.5347761", "0.5347761", "0.53452694", "0.5319518", "0.5303168", "0.5296951", "0.52881044", "0.52551377", "0.52518463", "0.52032655", "0.5177423", "0.51390153", "0.5125147", "0.51103914", "0.50992215", "0.50929844", "0.5059472", "0.50439376", "0.504...
0.61632955
0
Ask user to select exports folder
function getExportsFolder() { // Set up 'File open' modal var openPanel = NSOpenPanel.openPanel(); openPanel.setCanChooseDirectories(true); openPanel.setCanChooseFiles(false); openPanel.setCanCreateDirectories(false); openPanel.setTitle("Choose your exports folder"); openPanel.setPrompt("Choose"); // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "export () {\n let exportAs = $('#export-as-select').val()\n let fileName = $('#export-file-name').val()\n\n // validate the options\n let valid = this.validate({\n fileName: fileName\n })\n\n // if options invalid don't export\n if (!valid) {\n return\n }\n\n // what type of fi...
[ "0.63277364", "0.5896766", "0.5768226", "0.5637818", "0.56025267", "0.555448", "0.5515902", "0.551378", "0.5440296", "0.5381196", "0.5341029", "0.53328156", "0.532022", "0.53083545", "0.5303641", "0.52822727", "0.5262747", "0.5219752", "0.50640297", "0.5060905", "0.50232506",...
0.7235261
0
Get screens per page from Template > Artboard > Screens group
function getScreensPerPageFromTemplate(templatePage) { var artboard = templatePage.artboards().firstObject(); // Get Screens group var screens = getChildLayerByName(artboard, SCREENS_LAYER_GROUP_NAME); // Get number of children in Screens group return screens.layers().count(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTemplateScreens() {\n return getChildLayerByName(getFirstArtboard(), SCREENS_LAYER_GROUP_NAME);\n}", "function screensWidth(nths) {\n $('.startScreen').css('width', $(window).width() - $(window).width() / nths);\n $('.gameScreen').css('width', $(window).width() - $(window).width() / nths);...
[ "0.6357678", "0.5511002", "0.5489318", "0.5446991", "0.5402718", "0.5334095", "0.53031135", "0.52518415", "0.5250381", "0.52470213", "0.52024436", "0.51795554", "0.51706964", "0.5167039", "0.5152196", "0.51339173", "0.5124939", "0.50992036", "0.5054849", "0.5043587", "0.50435...
0.8123078
0
Get the 'Screens' group
function getTemplateScreens() { return getChildLayerByName(getFirstArtboard(), SCREENS_LAYER_GROUP_NAME); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function opGetOPScreen() {\n if (/\\/work_packages(\\/|$)/.test(window.location.pathname)) {\n return SCREEN_WORKPACKAGES;\n } else if (/\\/backlogs$/.test(window.location.pathname)) {\n return SCREEN_BACKLOG;\n } else if (/\\/roadmap$/.test(window.location.pathname)) {\n...
[ "0.5841954", "0.5832362", "0.58203125", "0.5815164", "0.56485546", "0.5583792", "0.55284786", "0.5484022", "0.5426231", "0.53578967", "0.5334438", "0.53304744", "0.53112143", "0.5174207", "0.51439214", "0.5140763", "0.5123341", "0.5087138", "0.5079352", "0.5077189", "0.505285...
0.7282014
0
This function applies the correct Skycon for a given weather type.
function setSkycon(weatherType, canvas) { let skycons = new Skycons({ 'color': 'black' }); let skycon = null; switch (weatherType) { case 'clear-day': skycon = Skycons.CLEAR_DAY; break; case 'clear-night': skycon = Skycons.CLEAR_NIGHT; break; case 'rain': skycon = Skycons...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCountryWeatherSection(type) {\n\n if (!(type == 'home' || type == 'current')) {\n\n debug_log('updateCountryWeatherSection: Invalid type specified');\n return false;\n\n }\n\n let countriesInfo = countriesInfoFunctions.returnCountriesInfo();\n let co...
[ "0.61724126", "0.60855377", "0.57856274", "0.5763619", "0.5735552", "0.5728352", "0.56682485", "0.55943716", "0.5513086", "0.55035675", "0.54829705", "0.53923607", "0.536343", "0.5361887", "0.5348394", "0.53434515", "0.53265303", "0.53016335", "0.5295624", "0.5255502", "0.522...
0.73961896
0
Checks Authorization if given token is valid, it will return the user object, if not, it will throw an authentication error.
checkAuthorization(token) { // TODO: check if the token is correct and is present. if (!token || token === '') { throw new Error("Token not present.") } // TODO: Check if token is valid. try { const user = JWT.verify(token, SECRET_KEY); if (us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifyToken(token) {\n return Token.findOne({ where: { uuid: token.uuid }, include: [User] })\n .then((token) => {\n if (token) return token.user\n throw new AuthenticationError('Invalid Token!')\n })\n }", "function authenticateToken(req, res, next) {\n const authHeader = r...
[ "0.729831", "0.67306614", "0.66935873", "0.66300255", "0.66095996", "0.65884215", "0.6582522", "0.65453804", "0.6535832", "0.6516154", "0.65157247", "0.6504189", "0.6466048", "0.6376465", "0.6342327", "0.63385886", "0.63017887", "0.62935716", "0.6290659", "0.62864506", "0.626...
0.8071135
0
This function below is used to get the number of Watershed Plans when passed in a specifi HUC8 number. It returns an integer that represents the amount of Watershed Plans that basin has. This number will then be shown in the rightmost 'well' underneath the 'Select Basin' button as well as the 'Basin Information' hub on...
function getWaterPlanNumber(HUC8) { if(counts[HUC8] != undefined) { return counts[HUC8]; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beeStings(weight){\n\n var numberOfStings = weight *8.666666667;\n return numberOfStings;\n\n}", "function calculateNumberofstings(weight){\n\n var stings = weight * beeStings;\n\n return stings;\n}", "function beeStings(weight) {\n var stingsPerLbs = 8.666666667; // Sets the number o...
[ "0.6105246", "0.59692", "0.577993", "0.5516978", "0.5494301", "0.54678065", "0.5460279", "0.5406471", "0.53635514", "0.5346281", "0.53003156", "0.5292949", "0.5265169", "0.5256225", "0.5250948", "0.52471274", "0.52441674", "0.5235069", "0.51953113", "0.518358", "0.5166662", ...
0.6950278
0
This function below is used to create the list that is displayed in the 'Select Basin' button. It will iterate over the array containing the names and id's of each basin. While iterating over the array, it will create multiple 'li' DOM's. Once the iteration is over, there will be an element with the id 'basinlist' that...
function createBasinList(basin_array) { for(HUC8 in basin_array) { var list = document.createElement('li'); var a = document.createElement('a'); a.setAttribute("href","#"); a.setAttribute("onclick",'clickOnMapItem(' + '"' + basin_array[HUC8][1] + '"); return false;'); var basin = document.createTextNod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createListBoxItems (beerInfo) {\n let sortedBeers = beerInfo.sort(function compare(beer1,beer2) {\n let beer1Name = beer1.beerName + ' - ' + beer1.brewer;\n let beer2Name = beer2.beerName + ' - ' + beer2.brewer;\n\n if (beer1Name < beer2Name)\n return -1;\n if (beer1Name > beer2Name)\n ...
[ "0.6808498", "0.6584904", "0.6299757", "0.62663364", "0.620767", "0.6174636", "0.6172341", "0.6160537", "0.61595416", "0.61087716", "0.61087716", "0.6032439", "0.6029693", "0.5980553", "0.59547114", "0.5880622", "0.5848701", "0.58461577", "0.58163583", "0.58109516", "0.580886...
0.7651695
0
This function is used for the CO_boundary style. It sets the weight of the line used to border Colorado, the color of that line, and sets the fill opacity to 0.
function setStateBoundaryStyle(feature){ return { weight: 5, color: 'black', fillOpacity: 0, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function singleBoundaryCrossed(){\n\t\tthis.className=\"boundary youlose\"\n\t}", "function cvjs_drawSpaceObject_RedlineFilledPolygon() {\n\t\tcvjs_addHandleFunc_RedlineFilledPolygon();\n}", "function drawBorder(object, remove) {\n if (remove == true) {\n object.style(\"stroke\", \"none\");\n } else {\n ...
[ "0.58891535", "0.5544023", "0.5510704", "0.5458396", "0.54145545", "0.54030305", "0.5389175", "0.5385207", "0.53710145", "0.5362226", "0.53463167", "0.53302824", "0.5302298", "0.5294922", "0.5292987", "0.5292769", "0.52883124", "0.5273012", "0.5256266", "0.5242369", "0.524027...
0.6213708
0
This feature is called by the onEachFeature function. It is what allows users to highlight over basins and will pop up a gray line outlining the basin.
function highlightFeature(e) { select_basin_call = false; var layer = e.target; layer.setStyle({ weight: 6, color: '#666', dashArray: '', }); if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { layer.bringToFront(); } info.update(layer.feature.properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightFeature(e) {\n var layer = e.target;\n\n\tlayer.setStyle({\n\t\tdashArray: '',\n\t\tfillOpacity: 0.7\n\t});\n\n\tif (!L.Browser.ie && !L.Browser.opera) {\n\t\tlayer.bringToFront();\n\t}\n\tif (e.target.feature.properties.rusinName) {\n\t\tupdateRusinDiv(layer.feature.properties, false);\n\t} el...
[ "0.66248655", "0.6424489", "0.64237005", "0.64002144", "0.6383615", "0.6334319", "0.63221765", "0.631658", "0.6315144", "0.6315144", "0.6300424", "0.62854743", "0.62718016", "0.6271645", "0.62699986", "0.6258599", "0.62262446", "0.62129194", "0.6206199", "0.6204582", "0.61825...
0.6863364
0
This function is also called by the onEachFeature function. It is used once a basin has been highlighted over, then the user moves the mouse it will reset the layer back to the original state.
function resetHighlight(e) { if(!e.target.feature.properties.hasBeenSelected) { geojson.resetStyle(e.target); info.update(); if(select_basin_call) { var layer = geojson.getLayer(e.target.feature.properties.HUC8); layer.fireEvent('mouseover'); select_basin_call = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetHighlight(e) {\n\tchorogeojson_layer.resetStyle(e.target);\n}", "function resetHighlight(e) {\n\tgeojson_layer.resetStyle(e.target);\n\tinfo_panel.update() //resets info panel\n\n}", "function resetHighlight(e) {\r\n\tgeojson_layer.resetStyle(e.target);\r\n\t// info_panel.update() // resets infop...
[ "0.76765287", "0.7554954", "0.7552759", "0.74905175", "0.74742055", "0.7452097", "0.73597646", "0.73564154", "0.7317056", "0.7305332", "0.72996366", "0.7289554", "0.7198692", "0.7185536", "0.7182495", "0.7145111", "0.71067995", "0.70850813", "0.7082801", "0.7082801", "0.70828...
0.7868277
0
This function is called by the onEachFeature function. It is used if a user clicks on a basin. Once a basin is selected, the proper SWE graphs will be accessible to view.
function selectBasin(e) { clickOnMapItem(e.target.feature.properties.HUC8); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickOnMapItem(HUC8)\n{\n if(basin_selected)\n {\n var old_layer = geojson.getLayer(old_basin);\n old_layer.feature.properties.hasBeenSelected = false;\n old_layer.fireEvent('mouseout');\n }\n var id = HUC8;\n old_basin = HUC8;\n //get target layer by it's id\n var layer = geojson.getLayer...
[ "0.6185747", "0.61059797", "0.6000959", "0.58994025", "0.5882157", "0.5811191", "0.57865983", "0.5709768", "0.5688865", "0.56073684", "0.5601486", "0.5597836", "0.5570821", "0.5565321", "0.55313146", "0.5524465", "0.55202186", "0.5511664", "0.5505907", "0.55057055", "0.546132...
0.65100586
0
This function is used to imitate the fire event 'mouseover'. It is called when a user selects a basin from the 'Select Basin' button. Once a basin is selected this function will imitate a user moving the cursor over a basin. This function takes in a HUC8 and will highlight the currently selected basin.
function clickOnMapItem(HUC8) { if(basin_selected) { var old_layer = geojson.getLayer(old_basin); old_layer.feature.properties.hasBeenSelected = false; old_layer.fireEvent('mouseout'); } var id = HUC8; old_basin = HUC8; //get target layer by it's id var layer = geojson.getLayer(id); //fire e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectBasin(e) \n{\n clickOnMapItem(e.target.feature.properties.HUC8);\n}", "function highlightBoro(e) {\n\t\n\tvar layer = e.target;\n\n\t// NOTE: this has to be here rather than in parent function (onEachBoro)\n\tlayer.setTooltipContent(layer.feature.properties.boro_name);\n\n\t// set highlight style...
[ "0.61969876", "0.60024047", "0.58242786", "0.56536484", "0.56110203", "0.55503947", "0.55421835", "0.55293536", "0.55046314", "0.5489856", "0.5476966", "0.5472882", "0.54629815", "0.5435064", "0.5427096", "0.5404464", "0.54016596", "0.5397342", "0.5390098", "0.5386099", "0.53...
0.6415109
0
enabled: false, custom: customTooltips,
custom(tooltip) { if (!tooltip) return; tooltip.displayColors = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function customTooltip(tooltip) {\n \n}", "_setDefaultTooltipPositionOption() {}", "function ApexTooltip() { }", "function MatTooltipDefaultOptions() { }", "onShowToolTip () {\n this.props.onShowToolTip(this.props);\n }", "function tooltipOff() {\r\n d3.event.preventDefault();\r\n tool...
[ "0.78783965", "0.7136919", "0.6941761", "0.6872321", "0.6802388", "0.67617863", "0.66655016", "0.6642208", "0.65334415", "0.65114975", "0.6491576", "0.6444483", "0.6444483", "0.6422533", "0.64065164", "0.639314", "0.63589", "0.6351554", "0.6307707", "0.6306957", "0.6277569", ...
0.8130597
0
Gets a cached .7z containing mods, or generates a new one if the files have changed. This method requires GameManagers to implement getModPackHash() and prepareModPackTempDir.
async getModPack() { const currentHash = await this.getModPackHash(); const storedHashFilePath = path.join(gameDir, "modPackData.json"); let lastModPackData = {}; try { lastModPackData = JSON.parse(await readFile(storedHashFilePath)); } catch (err) {} if (currentHash === lastModPackData.hash) { retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async #buildModPack() {\n\t\tconst modPackFilePath = generateBackupFilename(`${gameId}-mods`, gameDir);\n\t\tconst modPackFilename = path.basename(modPackFilePath);\n\t\tconst packTempPath = `/tmp/modpacks/${modPackFilename}`;\n\n\t\tconst archiveRootPath = await this.prepareModPackTempDir(packTempPath);\n\t\tawai...
[ "0.66397315", "0.52776176", "0.5183309", "0.5000209", "0.49162263", "0.48686832", "0.48562005", "0.4823597", "0.4799179", "0.47920313", "0.4771156", "0.47686273", "0.47648418", "0.4756496", "0.47535145", "0.47525552", "0.47334325", "0.47017944", "0.46985584", "0.46829295", "0...
0.7238835
0
Creates a new .7z containing mods, to be distributed to clients.
async #buildModPack() { const modPackFilePath = generateBackupFilename(`${gameId}-mods`, gameDir); const modPackFilename = path.basename(modPackFilePath); const packTempPath = `/tmp/modpacks/${modPackFilename}`; const archiveRootPath = await this.prepareModPackTempDir(packTempPath); await makeBackup(modPackF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async createZipFile() {\n\n const qextFile = resolve(this.extOutDir, `./${this.extensionName}.qext`);\n const jsFile = resolve(this.extOutDir, `./${this.extensionName}.js`)\n const wbFolder = resolve(this.extOutDir, `./wbfolder.wbl`) ;\n\n /** create new JsZip instance and add extensi...
[ "0.5935539", "0.5514462", "0.51758564", "0.5095275", "0.508563", "0.50849426", "0.5047286", "0.5019464", "0.49901345", "0.49893668", "0.49262282", "0.4837163", "0.48219022", "0.479373", "0.47899276", "0.4788207", "0.47636595", "0.47541326", "0.47524238", "0.47307184", "0.4697...
0.58088344
1
build test contracts array all contracts in input that ares Tests, run
function buildTestContractsArray(contractsInput) { const testContracts = []; const contracts = Object.assign({}, contractsInput); // contracts for (var contractName in contracts) { // eslint-disable-line const contractInterface = JSON.parse(contracts[contractName].interface); if (contractName !== 'Test...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTestMethodsFromABI(contractABI) {\n const testMethods = [];\n\n // if the method name has test in it, get object\n contractABI.forEach((methodABI, methodIndex) => {\n if (typeof methodABI.name === 'string'\n && methodABI.name.includes('test')\n && methodABI.name.indexOf('before_') !== 0...
[ "0.6120095", "0.588036", "0.58191353", "0.5778754", "0.56471974", "0.5633398", "0.5402229", "0.53972757", "0.53510773", "0.5323", "0.5308506", "0.52759916", "0.52681494", "0.52533597", "0.5166342", "0.5164974", "0.5159456", "0.5147112", "0.5139433", "0.51131654", "0.51099896"...
0.79085755
0
get test method objects from a contract ABI if method name includes 'test' then include it in array
function getTestMethodsFromABI(contractABI) { const testMethods = []; // if the method name has test in it, get object contractABI.forEach((methodABI, methodIndex) => { if (typeof methodABI.name === 'string' && methodABI.name.includes('test') && methodABI.name.indexOf('before_') !== 0 // no befor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildTestContractsArray(contractsInput) {\n const testContracts = [];\n const contracts = Object.assign({}, contractsInput);\n\n // contracts\n for (var contractName in contracts) { // eslint-disable-line\n const contractInterface = JSON.parse(contracts[contractName].interface);\n if (contractNa...
[ "0.6307044", "0.57913554", "0.5701616", "0.55949324", "0.5570145", "0.5563195", "0.545067", "0.54295796", "0.54029614", "0.517024", "0.5120203", "0.5119447", "0.511261", "0.51076835", "0.51076835", "0.50993496", "0.50870883", "0.5037246", "0.5024881", "0.49904045", "0.4972603...
0.84162456
0
returns true if the filename should be included
function filenameInclude(filename, exclude, include) { // eslint-disable-line var output = true; // eslint-disable-line if (exclude) { if (globToRegExp(exclude, { extended: true }).test(filename) && !globToRegExp(include || '', { extended: true }).test(filename)) { output = false; } } return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "include(filename) {\n if (!filename) {\n return false;\n }\n\n for (const possibleModule of modules) {\n if (filename.includes(path.normalize(possibleModule))) {\n return true;\n }\n }\n\n if (filename.includes(root)) {\n for (const ...
[ "0.757649", "0.6461848", "0.6307137", "0.62498206", "0.6248757", "0.6234743", "0.6211933", "0.62017643", "0.6185206", "0.6154132", "0.6142514", "0.6092126", "0.6067747", "0.60600907", "0.6041932", "0.603531", "0.6029979", "0.5925119", "0.5905136", "0.58286977", "0.5811159", ...
0.7848833
0
get all import paths from contract source
function allImportPaths(contractSource) { const noCommentSource = strip.js(String(contractSource)); const rawImportStatements = execall(/^(\s*)((import)(.*?))("|')(.*?)("|')((;)|((.*?)(;)))$/gm, noCommentSource); const importPaths = rawImportStatements .map(v => String(execall(/("|')(.*?)("|')/g, v.match)[0]....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSourcesWithDependencies(contractPath, sourcesByAbsolutePath, importRemappings) {\n const compiledImports = { [`./${path.basename(contractPath)}`]: sourcesByAbsolutePath[contractPath] };\n recursivelyGatherDependencySources(contractPath, path.dirname(contractPath), sourcesByAbsolutePath, importRem...
[ "0.6753179", "0.66978043", "0.6266403", "0.62168807", "0.6212132", "0.6135159", "0.6100928", "0.60724384", "0.6052945", "0.60452837", "0.5995759", "0.5969228", "0.58358556", "0.5821672", "0.58089703", "0.58078414", "0.58059555", "0.5792808", "0.5785794", "0.56972384", "0.5657...
0.78640777
0
return flat source object from a specific tree root
function buildFlatSourcesObjectFromTreeObject(treeObject) { const currentOutputObject = Object.assign({}); currentOutputObject[treeObject.path] = treeObject.source; Object.keys(treeObject.dependencies).forEach(dependantTreeObjectFileName => { Object.assign(currentOutputObject, buildFlatSourcesObjectFromTreeO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "flatten(obj) {\r\n return this.traverse(obj, '', getDefaultResult());\r\n }", "toJSON (src) {\n if (!src) src = this.root\n let dest = new Node(src.obj, src.dimension, null)\n if (src.left) dest.left = this.toJSON(src.left)\n if (src.right) dest.right = this.toJSON(src.right)\n return de...
[ "0.60985625", "0.5663366", "0.56390387", "0.562073", "0.54780763", "0.54674596", "0.54238504", "0.5393888", "0.53774405", "0.53433305", "0.5294962", "0.5268691", "0.52276075", "0.5210392", "0.51877517", "0.5181238", "0.51654094", "0.51611143", "0.5138876", "0.51367867", "0.51...
0.7221568
0
get all contract input sources
function getInputSources(dirname, exclude, include, focusContractPath, callback) { let filesRead = 0; const sources = {}; // get all file names dir.files(dirname, (filesError, files) => { if (filesError) { throwError(`while while getting input sources ${filesError}`); } // if no files in dir...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get sources() {\n const sources = [];\n for (let i = 0; i < this._sections.length; i++) {\n for (let j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }", "get sources() {\n...
[ "0.6175527", "0.61378825", "0.61378825", "0.61378825", "0.59427565", "0.5846517", "0.57455724", "0.5687343", "0.567554", "0.55927426", "0.5494584", "0.5447869", "0.54057145", "0.54057145", "0.54057145", "0.54057145", "0.53935766", "0.5388111", "0.5366022", "0.5316427", "0.530...
0.647514
0
is the contract abi a Test contract soltest abi
function contractIsTest(contractABI) { let returnValue = false; // check method ABI contractABI.forEach((methodObject) => { // does it contain the method AssertTrueLog, if so, its a test if (methodObject.name === 'AssertEqLog') { returnValue = true; } }); // return value return returnVal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function isContract(address) {\n const code = await provider.getCode(address);\n return code.slice(2).length > 0;\n}", "static async getContractAbi() {\n try {\n return await db.get('abi');\n } catch (err) {\n throw new Error(`system db: error when getting contract abi! ${err}`);\n }\n...
[ "0.6554397", "0.60394365", "0.59791154", "0.5963079", "0.5763542", "0.5654224", "0.56240964", "0.5620303", "0.54474884", "0.54299796", "0.5427259", "0.5361153", "0.5305867", "0.52801293", "0.5240589", "0.5240589", "0.5230367", "0.5187778", "0.5187778", "0.51534295", "0.512242...
0.7311254
0
increase the testrpc provider time by a specific amount, then mine
function increaseProviderTime(provider, time, callback) { if (typeof time !== 'number') { callback('error while increasing TestRPC provider time, time value must be a number.', null); return; } provider.sendAsync({ method: 'evm_increaseTime', params: [time], }, (increaseTimeError) => { if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function increaseTimestampBy(seconds) {\n const jsonrpc = '2.0';\n const id = 0;\n const send = (method, params = []) => web3.currentProvider.send({id, jsonrpc, method, params});\n await send('evm_increaseTime', [seconds]);\n await send('evm_mine');\n}", "function incrementBonusTime(){\n\n if (+extra...
[ "0.63912225", "0.6020759", "0.60122305", "0.59984875", "0.596747", "0.5935971", "0.59280866", "0.58821654", "0.5835706", "0.58355176", "0.57836205", "0.5736258", "0.5675611", "0.56655157", "0.564997", "0.5638477", "0.560064", "0.5580715", "0.5568501", "0.5567339", "0.55340755...
0.7433415
0
increase the TestRPC blocks by a specific count recursively
function increaseBlockRecursively(provider, count, total, callback) { // if the count hits the total, stop the recursion if (count >= total) { callback(null, true); } else { // else mine a block provider.sendAsync({ method: 'evm_mine', }, (mineError) => { if (mineError) { callb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increaseProviderBlock(provider, blocks, callback) {\n increaseBlockRecursively(provider, 0, blocks, callback);\n}", "initializeMockData() {\n /* let self = this;\n (function theLoop (i) {\n setTimeout(function () {\n let blockTest = new Block.Block(\"Test Block -...
[ "0.61904746", "0.5673516", "0.56658477", "0.55951154", "0.55488425", "0.5456523", "0.54356056", "0.54275274", "0.5424073", "0.54137754", "0.5384423", "0.5302789", "0.5294584", "0.52898437", "0.527739", "0.52659005", "0.5262752", "0.52612704", "0.52563524", "0.52388525", "0.52...
0.69790405
0
increase provider by block
function increaseProviderBlock(provider, blocks, callback) { increaseBlockRecursively(provider, 0, blocks, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increaseBlockRecursively(provider, count, total, callback) {\n // if the count hits the total, stop the recursion\n if (count >= total) {\n callback(null, true);\n } else {\n // else mine a block\n provider.sendAsync({\n method: 'evm_mine',\n }, (mineError) => {\n if (mineError) {...
[ "0.65874994", "0.59175175", "0.56344545", "0.5568702", "0.5566473", "0.5516331", "0.5507958", "0.54596335", "0.536422", "0.532041", "0.52935016", "0.5272607", "0.5223676", "0.5210539", "0.51968443", "0.5192885", "0.51839685", "0.5175817", "0.51530683", "0.51333827", "0.508985...
0.8408627
0
get block increase value from method name
function getBlockIncreaseFromName(methodName) { const matchNumbers = String(methodName).match(/_increaseBlockBy(\d+)/); if (matchNumbers !== null && typeof matchNumbers[1] === 'string') { return parseInt(matchNumbers[1], 10); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTimeIncreaseFromName(methodName) {\n const matchNumbers = String(methodName).match(/_increaseTimeBy(\\d+)/);\n\n if (matchNumbers !== null\n && typeof matchNumbers[1] === 'string') {\n return parseInt(matchNumbers[1], 10);\n }\n\n return 0;\n}", "function increment(){\n return {\n type:...
[ "0.6187084", "0.6027883", "0.5829862", "0.5776372", "0.577", "0.57560384", "0.5738301", "0.5735394", "0.571925", "0.5714172", "0.57044095", "0.56691", "0.5658407", "0.56274116", "0.5613571", "0.5608852", "0.55905604", "0.55756646", "0.5488322", "0.54828835", "0.5451827", "0...
0.774821
0
get time increase value from method name
function getTimeIncreaseFromName(methodName) { const matchNumbers = String(methodName).match(/_increaseTimeBy(\d+)/); if (matchNumbers !== null && typeof matchNumbers[1] === 'string') { return parseInt(matchNumbers[1], 10); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get time() {}", "function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+\" time: \"+(_.now()-start)+\"ms\")}}", "function timestat(){\n\t\n}", "function getBlockIncreaseFromName(methodName) {\n const matchNumbers = String(methodName).match(/_increaseBlockBy(\\d+)/);\n\n if (match...
[ "0.61040795", "0.6081375", "0.6013006", "0.59586054", "0.5915417", "0.5907122", "0.59042627", "0.5852781", "0.58111876", "0.57928544", "0.57533514", "0.57125527", "0.5700322", "0.56641", "0.563719", "0.5630976", "0.5626906", "0.5621469", "0.5621469", "0.5606753", "0.55894846"...
0.7837491
0
Gets the path of a value by getting the location of the field and traversing the selectionSet
function getFieldPath(info, maxDepth) { maxDepth = maxDepth || 50; var loc = get(info, 'fieldNodes[0].loc') || get(info, 'fieldASTs[0].loc'); var stackCount = 0; var traverseFieldPath = function traverseFieldPath(selections, start, end, fieldPath) { fieldPath = fieldPath || []; var sel = get(filter(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get valueElementPath() {\n return this.__valueElementPath.get();\n }", "getPartLocation(){\n let view = this.getView(); //oll section\n part_location = view.down('textfield[name=part_location]')\n return part_location.getValue();\n }", "getValue() {\n const sele...
[ "0.62661016", "0.5826999", "0.5593716", "0.5517925", "0.54789543", "0.54387856", "0.5352595", "0.5346967", "0.53279835", "0.5313046", "0.52972275", "0.52697617", "0.52536935", "0.5250741", "0.5250741", "0.5211934", "0.51887447", "0.515035", "0.51465225", "0.5138186", "0.51352...
0.6201111
1
Gets the return type name of a query (returns shortened GraphQL primitive type names)
function getReturnTypeName(info) { try { var typeObj = get(getSchemaOperation(info), '_fields["' + info.fieldName + '"].type', {}); while (!typeObj.name) { typeObj = typeObj.ofType; if (!typeObj) break; } return typeObj.name; } catch (err) { console.error(err.message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getReturnTypeName(type) {\n if (typeof type === 'string') {\n return type;\n }\n return type.name;\n}", "static getTypeName() {\n return this.gqlTypeName || this.name; // if typename is explicitly defined, return it; else, default to model name (i.e., assume model name = type name)\n ...
[ "0.64245325", "0.624973", "0.5610751", "0.5583273", "0.5516224", "0.5465791", "0.5465791", "0.5465791", "0.54627943", "0.5461125", "0.5451962", "0.5451962", "0.5442516", "0.5355436", "0.5314515", "0.53109723", "0.5285575", "0.5267145", "0.52664435", "0.5265707", "0.5240853", ...
0.6265972
1
Returns the _typeConfig object of the schema operation (query/mutation) Can be used to pass variables to resolve functions which use this function to access those variables
function getTypeConfig(info, path) { path = path ? '_typeConfig.'.concat(path) : '_typeConfig'; return get(getSchemaOperation(info), path, {}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSchemaType() {\n return this.spec.schemaTypeName;\n }", "function getTypeInfo(schema, tokenState) {\n var argDef = void 0;\n var argDefs = void 0;\n var directiveDef = void 0;\n var enumValue = void 0;\n var fieldDef = void 0;\n var inputType = void 0;\n var objectFieldDefs = void 0;\n var parentT...
[ "0.6085186", "0.5914835", "0.5713294", "0.56925833", "0.56617564", "0.5644441", "0.56076485", "0.5583434", "0.55734414", "0.5566491", "0.5566491", "0.5566491", "0.5566491", "0.5566491", "0.55591923", "0.55591923", "0.55591923", "0.55591923", "0.55591923", "0.55591923", "0.555...
0.5947549
1
optional: save the nonce generated within handleAuthStart handleAuthStart generates a unique nonce for you, no need to break out a crypto library after OAuth is complete, you can compare the nonce generated at this step vs the end for extra security
async function saveNonce({ req, shopName, nonce }) { // within this function, associate the nonce with the shopName of the merchant logging in you data store of choice // then within pages/api/auth/callback.js we'll verify the nonce is the same // not sure how to do this? Just don't pass saveNonce to handleAu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "login () {\n this.auth0.authorize({nonce: this.generateNonce()})\n }", "function authenticateAccount() {\n if (server === undefined) {\n // server receives account access token\n server = http.createServer();\n server.on('request', (req, res) => {\n if (req.url.substring(1,...
[ "0.58902717", "0.58566165", "0.5769523", "0.5760014", "0.5759069", "0.5717604", "0.57069963", "0.5699386", "0.5692729", "0.56783813", "0.56616354", "0.5645276", "0.5642396", "0.56368107", "0.56209666", "0.5604549", "0.56028956", "0.55822164", "0.55753183", "0.557024", "0.5567...
0.7050797
0
Since we can remove things now we have to be able to have a reference to the actual function since we have to use $rootScope.apply to bring the functions into "Angular Land" we can't just use the bare handler, so this function will wrap the supplied handler with the proper Angular code and return that function, which c...
function wrapHandler(handler) { return function() { var args = arguments; $rootScope.$apply(function() { handler.apply(null, args); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eventHandler(fn, scope){\n return function(){\n fn.apply(scope, [].concat(Array.prototype.splice.apply(arguments, [0])));\n }\n}", "_removeEventHandler(event, handler) {\n if (typeof event !== 'string') {\n // If `event` is a map, call `off()` for each entry.\n for (const eventName in ...
[ "0.62635064", "0.6202248", "0.61809623", "0.59865695", "0.59865695", "0.59865695", "0.59865695", "0.59265333", "0.59233904", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.59170306", "0.5908229", ...
0.6951641
0
This actually adds the event listener to the socket. Make sure the handler has already been wraped using the wrapHandler() function above
function addListener(e, wrapped_handler) { socket.on(e, wrapped_handler); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addHandler(socket, eventName, handler){\n if(!socket.connected){\n console.log(\"Cannot add handler to a socket that is closed: \", socket);\n }\n socket.on(eventName, handler);\n}", "addSocketListener (name, handler, socket) {\n\t\t(async () => {\n\t\t\tfor await (let data of socket.lis...
[ "0.74605393", "0.6979956", "0.66708815", "0.65694475", "0.6299873", "0.62842053", "0.6245342", "0.62428427", "0.6222596", "0.61786956", "0.61305994", "0.612149", "0.6109507", "0.6109269", "0.6109269", "0.6106452", "0.6088464", "0.605406", "0.6051348", "0.6021548", "0.60139394...
0.8127262
0
show the directions page
function showDirections(place){ $scope.$parent.destination = place.town_city + ', ' + place.st + ' ' + place.tel; $location.path('/directions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDirections () {\n var directionsService = new google.maps.DirectionsService();\n var directionsDisplay = new google.maps.DirectionsRenderer();\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: markerLatLong\n });\n directionsDisplay.setMap(map);\n dire...
[ "0.6999261", "0.65867966", "0.64930475", "0.64754194", "0.6424286", "0.6383365", "0.6368075", "0.6362467", "0.6352712", "0.6315834", "0.62994736", "0.62937075", "0.6193832", "0.61785424", "0.6143096", "0.6136646", "0.61299825", "0.61274785", "0.60773116", "0.6041347", "0.6037...
0.7038726
0
Make a Token that renders to given region if used in a different stack, otherwise undefined
function regionIfDifferentFromStack(region) { return cdk.Token.asString(new StackDependentToken(region, stack => stack.region)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "markRegions(token) {\n var r1, r2, len;\n\n r1 = r2 = len = token.length;\n\n // R1 is the region after the first non-vowel following a vowel,\n for (var i = 0; i < len - 1 && r1 == len; i++) {\n if (isVowel(token[i]) && !isVowel(token[i + 1])) {\n r1 = i + 2;\n }\n }\n // Or is ...
[ "0.5661994", "0.55132776", "0.52687144", "0.5217712", "0.51769775", "0.49577412", "0.493159", "0.48452833", "0.48397127", "0.4826435", "0.4826435", "0.48118746", "0.4801818", "0.47885394", "0.47802114", "0.47709316", "0.47709316", "0.47709316", "0.47661483", "0.4763856", "0.4...
0.72258323
0
Make a Token that renders to given account if used in a different stack, otherwise undefined
function accountIfDifferentFromStack(account) { return cdk.Token.asString(new StackDependentToken(account, stack => stack.account)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useToken$1() {\n const [theme, token, hashId] = useToken$2();\n return {\n theme,\n token,\n hashId\n };\n}", "async _generateToken() {\n let {changeLoader, setToken, payload} = this.props;\n let {anchor_transaction_id} = this.state;\n changeLoader(true);\n let au...
[ "0.59206223", "0.550049", "0.5483416", "0.54066765", "0.53712076", "0.5367757", "0.53356427", "0.5269137", "0.5263181", "0.5257666", "0.5229542", "0.5199281", "0.5178208", "0.51537687", "0.5152638", "0.5148635", "0.51438904", "0.5140393", "0.5131641", "0.51214945", "0.5111146...
0.7178617
0
initialize_labour_force(); Update nodes based on activity and duration
function timer() { if (curr_minute % 2 == 0 ){ updateMonths(0, Math.floor(curr_minute/2)); // update_labour_force(); } d3.range(nodes.length).map(function(i) { // console.log(curr_minute); var curr_node = nodes[i], curr_moves = curr_node.moves; // Time to go to next activity if (curr_no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timer() {\r\n d3.range(nodes.length).map(function (i) {\r\n var curr_node = nodes[i];\r\n tmpPop = POPULATIONMAP.get(curr_node.activity);\r\n tmpPop.popu -= 1;\r\n POPULATIONMAP.set(curr_node.activity,tmpPop);\r\n curr_n...
[ "0.6111984", "0.60758865", "0.6062431", "0.6059714", "0.5812478", "0.5806347", "0.57723063", "0.57669806", "0.57611775", "0.5750553", "0.5672602", "0.56434137", "0.5643016", "0.5593878", "0.5566651", "0.55605704", "0.5546403", "0.5499823", "0.5497254", "0.54878587", "0.547979...
0.6402123
0
Cleanup underlying C++ context, and release all resources that were created by this context. The JavaScript Context object(s) will not be garbagecollected without call(s) to this function
destroy() { if (this.cxxCtx) { this.cxxCtx.destroy(); this.cxxCtx = undefined; internal.cleanupContext(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n if (this.cxxObj) {\n this.cxxObj.destroy();\n this.cxxObj = null;\n }\n if (this.frame) {\n this.frame.destroy();\n this.frame = undefined;\n }\n }", "async cleanup() {\n if (global.jet.context) {\n if (global.jet.beforeContextReset) {\n await global....
[ "0.70623183", "0.6960057", "0.6763981", "0.6455487", "0.64545226", "0.6419131", "0.6351835", "0.6329949", "0.6327838", "0.6272092", "0.62361693", "0.6228148", "0.61964786", "0.6160893", "0.6160893", "0.6152779", "0.6134745", "0.6128099", "0.6095096", "0.6084183", "0.6081385",...
0.78231496
0
Destroy all resources associated with the colorizer
destroy() { this.release(); this.cxxColorizer = undefined; this.depthRGB = undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanUp() {\n this.registry.destroy();\n this.events.off();\n this.sound.stopAll();\n }", "cleanUp() {\n if ( this._bgmCurrentlyPlaying ) {\n this._bgmCurrentlyPlaying.stop();\n }\n\n for ( let [key, component] of Object.entries( this._components ) ) {\n ...
[ "0.71969247", "0.6921872", "0.6819914", "0.68082124", "0.6749286", "0.669795", "0.66953456", "0.6692225", "0.6688521", "0.6681832", "0.6681832", "0.6681832", "0.6681832", "0.6681832", "0.6681832", "0.66716486", "0.6667433", "0.6661527", "0.6655413", "0.6653983", "0.66532934",...
0.75942737
0
Disable a device stream explicitly, to remove any requests on this stream profile.
disableStream(stream) { const funcName = 'Config.disableStream()'; checkArgumentLength(1, 1, arguments.length, funcName); const s = checkArgumentType(arguments, constants.stream, 0, funcName); this.cxxConfig.disableStream(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disableAllStreams() {\n this.cxxConfig.disableAllStreams();\n }", "function deactivate() {\n var ln = streamProcessors ? streamProcessors.length : 0;for (var i = 0; i < ln; i++) {\n var fragmentModel = streamProcessors[i].getFragmentModel();fragmentModel.removeExecutedRequestsBeforeTim...
[ "0.6171522", "0.6119781", "0.60162", "0.59838516", "0.5805601", "0.5754145", "0.5707021", "0.5702878", "0.5701381", "0.5686168", "0.56721395", "0.5647137", "0.5623723", "0.5505728", "0.54392356", "0.5436226", "0.5380363", "0.53700024", "0.5366042", "0.5364405", "0.5347067", ...
0.7141018
0
Enable all device streams explicitly.
enableAllStreams() { this.cxxConfig.enableAllStreams(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disableAllStreams() {\n this.cxxConfig.disableAllStreams();\n }", "enableDefaultSensors() {\n let mask = 1;\n\n for (let i = 0; i < 32; ++i) {\n if ((this.defaultSensorsMask & mask) === mask) {\n const sensor = this.getSensor(i);\n if (sensor) {\n sensor.setEnabled(true);\n ...
[ "0.62120837", "0.5787477", "0.5741185", "0.5731212", "0.5731212", "0.5731212", "0.5727469", "0.5656899", "0.549436", "0.5402179", "0.5394628", "0.53867817", "0.5380411", "0.5351118", "0.53442746", "0.5326643", "0.5324595", "0.5279043", "0.5267265", "0.52294064", "0.519174", ...
0.7192733
0
Disable all device streams explicitly.
disableAllStreams() { this.cxxConfig.disableAllStreams(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disableStream(stream) {\n const funcName = 'Config.disableStream()';\n checkArgumentLength(1, 1, arguments.length, funcName);\n const s = checkArgumentType(arguments, constants.stream, 0, funcName);\n this.cxxConfig.disableStream(s);\n }", "enableAllStreams() {\n this.cxxConfig.enableAllStreams()...
[ "0.67263865", "0.6697138", "0.65109104", "0.6314438", "0.6254046", "0.6073768", "0.6021144", "0.5979277", "0.59529644", "0.59363693", "0.59146017", "0.5907842", "0.5873808", "0.5804909", "0.5790995", "0.5782979", "0.57729834", "0.56796855", "0.55830103", "0.5574665", "0.55606...
0.77294105
0
this function with help us create a string for translate when we want to pass in a scale and translate points
function stringify(scale, translate) { var k = scale / 256, r = scale % 1 ? Number : Math.round; return `translate(${r(translate[0] * scale)}, ${r(translate[1] * scale)}) scale(${k})`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringify(scale, translate) {\n var k = scale / 256, \n r = scale % 1 ? Number : Math.round; \n return 'translate(' + r(translate[0] * scale) + ',' + r(translate[1] * scale) + ') scale (' + k + ')';\n}", "function translator(d, i) {\n return \"translate(\" + xScale.range()[i] + \",\" +\n ...
[ "0.7039865", "0.6773521", "0.6516477", "0.64644146", "0.64637595", "0.63661546", "0.63624454", "0.63515884", "0.6351277", "0.63429487", "0.6321941", "0.62475324", "0.60125524", "0.5948011", "0.592821", "0.5924309", "0.58739775", "0.58684814", "0.5844083", "0.5842527", "0.5842...
0.7134237
0
Function: startSensorWatch(socket) Parameters: socket client communication channel Description: Read Temperature Sensor and send temperature in degrees of Fahrenheit every 4 seconds
function startSensorWatch(socket) { setInterval(function () { var a = myAnalogPin.read(); console.log("Analog Pin (A0) Output: " + a); //console.log("Checking...."); var resistance = (1023 - a) * 10000 / a; //get the resistance of the sensor; //console.log("Resistance: "+re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startSensorWatch(socket) {\n\n var touch_sensor_value = 0, last_t_sensor_value;\n\n //Touch Sensor connected to D2 connector\n var digital_pin_D2 = new mraa.Gpio(2);\n digital_pin_D2.dir(mraa.DIR_IN);\n\n //Buzzer connected to D6 connector\n var digital_pin_D6 = new mraa.Gpio(6);\n di...
[ "0.78888077", "0.7641872", "0.7045433", "0.6898562", "0.6393099", "0.6305455", "0.62687176", "0.62463415", "0.62079316", "0.6098634", "0.6049401", "0.59803", "0.5961752", "0.5961542", "0.59581834", "0.58839077", "0.58507013", "0.5832895", "0.5820781", "0.576186", "0.5744047",...
0.8404934
0
event handler to remove references to the bufferSourceNode when it is done playing
function _clearOnEnd(e) { const thisBufferSourceNode = e.target; const soundFile = this; // delete this.bufferSourceNode from the sources array when it is done playing: thisBufferSourceNode._playing = false; thisBufferSourceNode.removeEventListener('ended', soundFile._clearOnEnd); // call the onended call...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _clearOnEnd(e) {\n const thisBufferSourceNode = e.target;\n const soundFile = this;\n // delete this.bufferSourceNode from the sources array when it is done playing:\n thisBufferSourceNode._playing = false;\n thisBufferSourceNode.removeEventListener('ended', soundFile._clearOnEnd);\n // ...
[ "0.80727047", "0.6695309", "0.6676755", "0.6671237", "0.6630641", "0.6575216", "0.6515342", "0.6347164", "0.6302117", "0.6260048", "0.6226913", "0.6226193", "0.6216715", "0.62087715", "0.6208512", "0.6194562", "0.617269", "0.6136848", "0.6136607", "0.61079377", "0.60971606", ...
0.8043359
1
initialize counterNode, set its initial buffer and playbackRate
_initCounterNode() { var self = this; var now = ac.currentTime; var cNode = ac.createBufferSource(); const workletBufferSize = safeBufferSize(256); // dispose of worklet node if it already exists if (self._workletNode) { self._workletNode.disconnect(); delete self._workletNode; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n this.counter = 1000;\n }", "init() {\n this.counter = 2000;\n }", "async init(buffer)\n {\n // Create a buffer\n this.buffer = await this.webAudioContext.decodeAudioData(buffer);\n\n // Create a buffer source node\n this.sourceNode = this.webAudioContext.createBufferSour...
[ "0.67882913", "0.66102654", "0.61304176", "0.5992781", "0.5943268", "0.5812969", "0.58121234", "0.57910055", "0.5786197", "0.5720945", "0.56998837", "0.5683387", "0.5618134", "0.55662936", "0.55222183", "0.5439895", "0.5434864", "0.5421843", "0.54173326", "0.54164463", "0.541...
0.7975887
0
initialize sourceNode, set its initial buffer and playbackRate
_initSourceNode() { var bufferSourceNode = ac.createBufferSource(); bufferSourceNode.buffer = this.buffer; bufferSourceNode.playbackRate.value = this.playbackRate; bufferSourceNode.connect(this.output); return bufferSourceNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createNodes() {\r\n var context = WebAudio._context;\r\n this._sourceNode = context.createBufferSource();\r\n this._sourceNode.buffer = this._buffer;\r\n this._sourceNode.loopStart = this._loopStart;\r\n this._sourceNode.loopEnd = this._loopStart + this._loopLength;\r\n t...
[ "0.687296", "0.67780805", "0.67374897", "0.6626132", "0.65869623", "0.64747435", "0.61216986", "0.59694874", "0.59650826", "0.59261113", "0.5913979", "0.58816755", "0.58607143", "0.58565694", "0.58483386", "0.5832051", "0.57755595", "0.5728072", "0.56895244", "0.5637904", "0....
0.8206739
0
Remove all of the callbacks that had originally been scheduled via the addCue method.
clearCues() { this._cues = []; // this.elt.ontimeupdate = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispose() {\n\n\t\t\tcueList = [];\n\t\t\tvideo.removeEventListener('playing', trigger);\n\t\t\tvideo.removeEventListener('timeupdate', trigger);\n\t\t}", "function removeListeners () {\n _player.off('ima3error', onEvent);\n _player.off('ads-request', onEvent);\n _player.off('ads-load', onEv...
[ "0.7098683", "0.6436425", "0.63804775", "0.635616", "0.6312847", "0.62895554", "0.62807345", "0.62738436", "0.6241134", "0.6166435", "0.6159077", "0.61342627", "0.61276686", "0.61144495", "0.6090726", "0.60181427", "0.6002369", "0.5990648", "0.5990648", "0.5990648", "0.599064...
0.6451208
1
private method that checks for cues to be fired if events have been scheduled using addCue(callback, time).
_onTimeUpdate(position) { var playbackTime = position / this.buffer.sampleRate; var cueLength = this._cues.length; for (var i = 0; i < cueLength; i++) { var cue = this._cues[i]; var callbackTime = cue.time; var val = cue.val; var leftLimit = this._prevUpdateTime || 0; var righ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkComplete() {\n if (userScoreboard.fired != true) {\n //Diagnostic console.log\n console.log(\"checkComplete fired\");\n didNotFinish();\n\n }\n}", "function check() {\n if(!jpnode) {\n return;\n }\n for (var i = 0; i < soundObjects.length; i++) {\n ...
[ "0.5468552", "0.5261568", "0.52515686", "0.5149298", "0.51466966", "0.5140427", "0.51245075", "0.5118619", "0.5097635", "0.50939405", "0.508649", "0.5062022", "0.5059603", "0.5044086", "0.5041796", "0.5036064", "0.5023879", "0.5023683", "0.4999872", "0.4995244", "0.49871084",...
0.54781973
0
checkForms checks if all approvals are "approved" if they are it inserts the form into historyform and deletes it from masterform
function checkForms(PRIMARY_ID) { var sql = "SELECT * from masterform WHERE PRIMARY_ID = ?" connection.query(sql, [PRIMARY_ID], function (err, result, fields) { if (err) throw err; if ((result[0].REQUESTOR == "approved" && result[0].FISC_ADMIN == "approved" && result[0].DEPT_HEAD == "approved")) { var sql =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSavedForm(title) {\n if (title == 'Clearance Form') {\n debugger;\n if (ValidateClearanceForm()) {\n SaveClearanceForm();\n }\n }\n else\n if (title == 'Leave Application Form') {\n ...
[ "0.5799181", "0.5676526", "0.5676242", "0.56720424", "0.55886126", "0.54987824", "0.5457963", "0.5453558", "0.5444195", "0.5430202", "0.540822", "0.54028195", "0.54001296", "0.5337592", "0.53234065", "0.53218365", "0.5303464", "0.5277334", "0.52275467", "0.52166367", "0.52068...
0.6719162
0
Hash a password with the given salt The derived key is encoded with 'base64' [callback] takes the derived key as the only argument
function hashPwd(password, salt, callback) { var iterations = 1500; var keylen = 256; crypto.pbkdf2(password, salt, iterations, keylen, function(err, derivedKey) { var key = derivedKey.toString('base64'); if (typeof(callback) === 'function') { callback(key); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hashPassword(rawPassword, salt, callback) {\r\n if (typeof(salt) == \"function\") {\r\n //If only the password and callback were given, move the real callback\r\n callback = salt;\r\n var useSalt = createSalt();\r\n } else {\r\n var useSalt = salt;...
[ "0.7738151", "0.73094195", "0.697382", "0.69651115", "0.68626976", "0.68206644", "0.6795851", "0.67925036", "0.6770207", "0.66824293", "0.6633625", "0.6617764", "0.661324", "0.660677", "0.66058815", "0.6548921", "0.6530455", "0.6511202", "0.6444018", "0.6419528", "0.63929886"...
0.77161485
1
generateHashedPwd(); Encrypt a password with the given key. Clients should use the same algorithm so that the server can decrypt properly Techniques applied: AES256, with encoding: base64 and the key is 128bit long, with encoding: base64 The key is provided by the server NOTE: This function is just for reference while ...
function encryptPwd(password, key) { var cipher = crypto.createCipher("aes256", key); var encrypted = cipher.update(password, 'utf8', 'base64') + cipher.final('base64'); console.log('Encryption finish!'); console.log('Encrypted Password:' + encrypted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateHashedPwd() {\n\tvar password = 'testPwd1';\n\tcrypto.randomBytes(128, function(e, randomKey) {\n\t\tvar salt = randomKey.toString('base64');\n\t\tvar iterations = 1500;\n\t\tvar keylen = 256;\n\t\thashPwd(password, salt, function(derivedKey) {\n\t\t\tvar data = 'Key:' + derivedKey + '\\r\\n' + 'S...
[ "0.63520116", "0.6109834", "0.60078156", "0.5669263", "0.55022794", "0.54750866", "0.5466386", "0.5452463", "0.54450417", "0.5423496", "0.5419441", "0.5406591", "0.536629", "0.5364579", "0.53605765", "0.53361136", "0.5329146", "0.5319283", "0.5306822", "0.53009874", "0.529555...
0.70088595
0
Decrypt the encrypted password using the previous generated key [callback] takes the decrypted password as the only argument
function decryptPwd(encryptedPwd, key, callback) { var decipher = crypto.createDecipher('aes256', key); var plainPwd = decipher.update(encryptedPwd, 'base64', 'utf8') + decipher.final('utf8'); if (typeof(callback) === 'function') { callback(plainPwd); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decryptPassword(encryptedHex, callback) {\r\n chrome.storage.local.get(\"password_storage\", function(storage) {\r\n var key = storage[\"password_storage\"][\"password_key\"];\r\n var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\r\n var aesCtr = new aesjs.ModeOfOperation...
[ "0.7378544", "0.69814634", "0.68848884", "0.66687226", "0.65499747", "0.6521599", "0.6471524", "0.64572835", "0.6406328", "0.64014786", "0.62011796", "0.61979", "0.61915094", "0.6182788", "0.61494434", "0.61183375", "0.60817003", "0.60618496", "0.6042025", "0.602315", "0.6015...
0.7535285
0
Rules are: (1) the letters are adjacent in the English alphabet, and (2) each letter occurs only once. For example: solve("abc") = True, because it contains a,b,c solve("abd") = False, because a, b, d are not consecutive/adjacent in the alphabet, and c is missing. solve("dabc") = True, because it contains a, b, c, d so...
function solve(s){ let letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] let arr = s.split('').map(x => letters.indexOf(x)).sort((a, b) => a - b); for (let i = 0; i < arr.length; i++) { if (arr[i] === arr[i + 1] || arr[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solve(s){\n const checkUniformity = arr => {\n arr = arr.filter(n => n)\n if (arr.length < 2) return true\n arr.sort()\n return arr[0] === arr[1] && arr[0] === arr[arr.length - 1]\n }\n\n const charCounts = Object.values(s.split('').reduce((acc, l) => {\n if (ac...
[ "0.6931273", "0.6782084", "0.66025305", "0.6491091", "0.64406174", "0.6426278", "0.63026917", "0.62732667", "0.6254195", "0.6243879", "0.62219715", "0.621241", "0.62110883", "0.62041754", "0.619482", "0.6193787", "0.6182538", "0.6172683", "0.61619735", "0.6160027", "0.6145922...
0.7538377
0
Flows the content i.e. wraps the text into multiple lines, splits each line into chunks with the same attributes, and sets the component state based on the result. This state is then used for rendering the editor surface during the next render cycle. This should be called after any operation that may change the content...
_flow(modification) { let lines = [] let modStartAtLine let startChar if(modification) { let startLineIndex = 0 modStartAtLine = lineContainingChar(this.state.lines, modification.start, true) // shortcut beginning of flow, start at the line prior to the one containing the modificatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _renderLine(input, sb) {\n const fontIsMonospace = input.fontIsMonospace;\n const canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\n const containsForeignElements = input.containsForeignElements;\n const lineContent = input.lineContent;\n const len ...
[ "0.5719849", "0.57133", "0.56813115", "0.56275165", "0.56129193", "0.56038654", "0.55697024", "0.5559112", "0.55517316", "0.55487096", "0.5546537", "0.5541323", "0.55335665", "0.55335665", "0.55335665", "0.5495843", "0.5484677", "0.54826283", "0.5472073", "0.5470458", "0.5448...
0.67736214
0
submit the game to highscores
function submitGame(){ if(!xoxo){ var d = new Date().getTime(); //can do once every five minutes if(d-lastSubmit >= 300000){ lastSubmit = d; $.ajax({ url: 'highscores/highscores_submit.php', ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submit_score() {\n high_scores.push(document.getElementById(\"initials\").value + \" \" + score);\n view_high_scores();\n }", "function gameOver() {\r\n gameRunning = \"scoreSubmit\";\r\n //It first changes the state variable to the scoreSubmit, and then checks w...
[ "0.6835364", "0.66354805", "0.6604701", "0.6604701", "0.6591355", "0.6580184", "0.6564173", "0.6417146", "0.6416935", "0.6403002", "0.636179", "0.6347146", "0.6328081", "0.6327021", "0.6319925", "0.63065755", "0.62980795", "0.62975466", "0.62858933", "0.62828475", "0.6251036"...
0.6953154
0
Parse date from time dd/mm/yyyy hh:mm
static parseDate(time) { const date = new Date(time); function addLeadingZero(num) { return ("0" + num).slice(-2); } const day = addLeadingZero(date.getDate()); const month = addLeadingZero(date.getMonth() + 1); const year = date.getFullYear(); const hours = addLeadingZero(date.getHo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDate(d) {\r\n return Date.parse(d,'MM/dd/yyyy HH:mm').toString(\"MM/dd/yyyy T HH:mm EST \").replace('T ','at ').replace('EST','EST (UTC-05)');\r\n}", "function parseTime() {\n\t\t\tvar pos = i, offset_length = 0, hour_offset = 0, min_offset = 0, offset=0;\n\t\t\t// check for format hh:mm:ss-n?nn...
[ "0.68831325", "0.68119615", "0.6717754", "0.66864383", "0.66719663", "0.6633436", "0.653711", "0.65239704", "0.6497621", "0.64673513", "0.6429812", "0.63495594", "0.62196577", "0.6166641", "0.6166034", "0.615638", "0.6121662", "0.6055789", "0.6044964", "0.6029795", "0.6012603...
0.7212498
0
Adds the district listener, the back listener, and the footer listeners
addListeners(){ var self = this; d3.select(".state-districts-button") .on("click", function(){ // var file_name = "./map_data/congressional_borders/" + self.selected_state_id + "/state_senate/topo_quantize.json"; var file_name = node_url + "/request_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createListeners() {\n\t\tBISDT.Mediator.subscribe(BISDT.Events.URL_CHANGED, function(data) {onURLChanged(data);});\n\t\tsectionsView.addListener(BISDT.Events.SECTION_CHANGE, function(e) {onActiveSectionChange(e);});\n\t\twindow.addEventListener(\"scroll\", function(e) {onWindowScrolled(e);});\n\t}", "fu...
[ "0.6292617", "0.6138591", "0.5984852", "0.5954883", "0.5872068", "0.5856444", "0.5812811", "0.57938534", "0.5772826", "0.57693225", "0.5763128", "0.5745243", "0.57435256", "0.57435256", "0.57435256", "0.5729184", "0.57159865", "0.5709758", "0.567075", "0.5664762", "0.5652777"...
0.7271558
0
add movie fct as props to the add movie component with param (...movie)
function addMovieFunc(newobj) { setMovies([...movies, newobj]); setShow(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMovie() {\n\n}", "onAddition(movie) {\n this.setState({\n movies: [...this.state.movies, movie]\n })\n }", "addMovie(event) {\n var movie = this.state.newMovie;\n this.props.movies.push({title: movie});\n this.setState({newMovie: ''});\n this.refs.addMov.valu...
[ "0.6785144", "0.65390253", "0.65362585", "0.64902323", "0.6479925", "0.64659256", "0.6405063", "0.6388149", "0.6338431", "0.6313914", "0.62721235", "0.62643623", "0.62434125", "0.6183052", "0.608589", "0.6079868", "0.60765517", "0.6072504", "0.6057878", "0.6017149", "0.600133...
0.6852699
0
This code is governed by the BSD license found in the LICENSE file. / es5id: 10.4.3178s description: > checking 'this' (strict function declaration called by Function.prototype.bind(undefined)())
function f() { "use strict"; return this===undefined;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function f() {\n 'use strict';\n\n // non-strict: this=global -> !this=false\n var g = new Function('print(!this)');\n\n // strict: this=undefined -> !this=true\n print(!this);\n g();\n}", "function test_MISSING_BIND() {\n return !('bind' in Function.prototype);\n }", "function impimentsU...
[ "0.6748243", "0.64017385", "0.63772404", "0.63251424", "0.61943096", "0.6160862", "0.6087017", "0.6047286", "0.5988271", "0.59625626", "0.5860176", "0.5831209", "0.57822394", "0.57822394", "0.57822394", "0.57592285", "0.5745229", "0.57074183", "0.57011396", "0.57004505", "0.5...
0.7480853
0
designate a color for each city
function colorCodeCity(city) { // blue for Amsterdam if (city == "Amsterdam") { return "#2196F3" } // red for Rotterdam else if (city == "Rotterdam") { return "#F44336" } // yellow/orange for Den Haag if (city == "DenHaag") { return "#9C27B0" } // green for Groningen else if (city == "Groningen") { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cityStyle(k) {\n return {\n fillColor: cityColorArr[k],\n weight: 1,\n opacity: 1,\n color: cityColorArr[k],\n fillOpacity: ...
[ "0.7355873", "0.6700616", "0.6700616", "0.66280067", "0.66280067", "0.64824176", "0.6470857", "0.6345723", "0.61610925", "0.61593676", "0.6158387", "0.611726", "0.6099365", "0.60831165", "0.60314673", "0.60300624", "0.5975925", "0.59494644", "0.59076214", "0.5872818", "0.5867...
0.7552062
0
call changeTotal() for each city
function setTotals() { changeTotal("Amsterdam") changeTotal("Rotterdam") changeTotal("DenHaag") changeTotal("Utrecht") changeTotal("Groningen") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeTotal(city) {\n var json = $.getJSON(\"../data/kamers.json\", function(json) {\n\t// set a count variable\n var count = 0;\n for (var i = 0; i < json.length; i++) {\n\t\t// each time the city is in the data, add one to the count\n if (json[i].stad == city) {\n count++;\n ...
[ "0.70199394", "0.6681425", "0.64011264", "0.6363323", "0.62892056", "0.6208504", "0.61928993", "0.61839217", "0.6108169", "0.6025928", "0.59748715", "0.59714574", "0.5948901", "0.5945532", "0.59260017", "0.591507", "0.59059024", "0.5905199", "0.590135", "0.5897331", "0.589302...
0.6911883
1
set the width of the total bar for each city
function changeWidth(city) { var json = $.getJSON("../data/kamers.json", function(json) { // set a count variable var count = 0; for (var i = 0; i < json.length; i++) { // each time the city is in the data, add one to the count if (json[i].stad == city) { count++; } // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initOrganBars() {\r\n\t\t\t\t$(\"span.o_old\").css(\"width\", initValue*50/percentBase + \"%\");\r\n\t\t\t\t$(\"span.o_new\").css(\"width\", initValue*49.9/percentBase + \"%\");\t\t\t\t\r\n\t\t\t}", "function updateCityVisuals(city) {\n var name = city.city.replace(/ /g,'');\n d3.selectAll('circle...
[ "0.6496868", "0.6249794", "0.62091833", "0.61007214", "0.5983355", "0.5983355", "0.59111804", "0.59111804", "0.58890134", "0.5841591", "0.5780581", "0.57177234", "0.56780356", "0.5653884", "0.55959237", "0.55766845", "0.5560723", "0.55604434", "0.5537326", "0.5528022", "0.549...
0.72400624
0
call changeWidth() for each city
function changeWidths() { changeWidth("Amsterdam") changeWidth("Rotterdam") changeWidth("DenHaag") changeWidth("Utrecht") changeWidth("Groningen") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeWidth(city) {\n\n var json = $.getJSON(\"../data/kamers.json\", function(json) {\n\t // set a count variable\n var count = 0;\n for (var i = 0; i < json.length; i++) {\n\t\t// each time the city is in the data, add one to the count\n if (json[i].stad == city) {\n count++;\n...
[ "0.7401259", "0.642669", "0.62742335", "0.62089884", "0.6194105", "0.6078834", "0.6065331", "0.6040703", "0.60349226", "0.6004215", "0.59759164", "0.59393585", "0.5891038", "0.5884096", "0.5881079", "0.58595943", "0.58532715", "0.5847925", "0.58357877", "0.58297455", "0.58232...
0.7405088
0
modal window / show/hide/draggable
function ShowExistingWindow(windowName) { $('.modal').off('show.bs.modal', centerModals); $('.modal').on('show.bs.modal', centerModals); $("#" + windowName).closest("div.modal.fade").modal('show'); $("#" + windowName).closest("div.modal.fade").draggable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showModal() {\n tl.to($('.modal-Pop-Up-Window'), .3, { opacity: 1, 'pointer-events': 'all' });\n }", "show() {\n if (!this.__isShown) {\n qx.core.Init.getApplication().fireEvent(\"popup\");\n\n this.__registerEventListener();\n\n // Move outside of viewport\n t...
[ "0.75718224", "0.7163136", "0.69955283", "0.698124", "0.6888609", "0.6827375", "0.681447", "0.6781975", "0.67606056", "0.67603076", "0.66768515", "0.66768515", "0.6671243", "0.6642813", "0.6633612", "0.66255176", "0.66126984", "0.65812385", "0.6564005", "0.65638125", "0.65419...
0.7216089
1
display appropriate Preferred Contact field when selected
function showPreferredContact(method) { var email = document.getElementsByClassName("connect-email")[0]; var invalidEmailField = document.getElementsByClassName( "invalid-contact-email" )[0]; var invalidPhoneField = document.getElementsByClassName( "invalid-contact-phone" )[0]; var phone = document....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeContactLabel() {\n var c = $(this).attr('name').split('_')[0];\n var label = getContactLabel(c);\n $('.vertical-tabs__menu-item', '#webform-civicrm-settings-form').eq(c - 1).find('a strong').first().text(c + '. ' + label);\n $('select[data-type=ContactReference] option[value=' + c + '], ...
[ "0.6550139", "0.6209521", "0.6028392", "0.60180056", "0.6006689", "0.5820426", "0.5739877", "0.568665", "0.5592022", "0.5573813", "0.55493873", "0.5521885", "0.5501053", "0.54865116", "0.54834634", "0.5417128", "0.5372636", "0.53598017", "0.53562564", "0.534744", "0.5333672",...
0.66319364
0
Displays the sessions, hide delete functionality under bootstrap modal
render() { if (this.state.sessionID !== ""){ return( <Redirect to={`/session/${this.state.sessionID}`} /> ); } if (this.props.isMod){ return ( <section className="main"> <div className="container-fluid"> <div className="heading"> <h1><i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openDelete(){\n $('#modalWindow').css('display', 'block');\n $('#confirmDeleteK').css('display', 'block');\n var id = $(this).parent().parent().attr(\"id\");\n $('#DeleteKey').unbind('click');\n $('#DeleteKey').click(function(){\n remove(id);\n clos...
[ "0.616741", "0.6126192", "0.611044", "0.6085197", "0.6054635", "0.60256916", "0.6021868", "0.6020371", "0.5986399", "0.5906299", "0.5902137", "0.5885877", "0.5882215", "0.58551335", "0.5850176", "0.5846278", "0.5845242", "0.5839086", "0.5834456", "0.58237016", "0.5794559", ...
0.6156241
1
Adds a custom setting that can be chosen in the HangingProtocol UI and applied to a Viewport
function addCustomViewportSetting(settingId, settingName, options, callback) { CustomViewportSettings[settingId] = { id: settingId, text: settingName, options: options, callback: callback, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewportSettingsChanger() {\n const viewportMeta = document.querySelector('meta[name=\"viewport\"]');\n const viewportSettings = {\n landscape: `width=device-width, height=device-height, initial-scale=1, maximum-scale=1, shrink-to-fit=yes`,\n portrait: `width=device-width, height=850, ...
[ "0.59348935", "0.589204", "0.56192803", "0.5609099", "0.55898625", "0.5404868", "0.5404062", "0.5387817", "0.5374452", "0.5336455", "0.5331162", "0.532411", "0.5292278", "0.5287877", "0.52128166", "0.5211643", "0.51884764", "0.5178727", "0.51721936", "0.5166636", "0.5166636",...
0.69033664
0
Enter date values in hidden input fields on the Entry Modal
function setValues(){ let monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; let d = new Date(); let monthNumber = d.getMonth(); let monthName = monthNames[monthNumber]; let currentYear = d.getFullYear(); let currentDate = d.getDa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editEnterDate() {\n\t\t\treturn this.editEnter('date');\n\t\t}", "function addNewEntry(date, month, year) {\n clearNotice();\n\tdocument.getElementById('edit-field').style.display='block';\n\tvar selectedDate = new Date(year+\"-\"+(month+1)+\"-\"+date);\n\tdocument.getElementById('start_date').value ...
[ "0.7045442", "0.6635424", "0.6437961", "0.6413809", "0.63656414", "0.6324998", "0.6317314", "0.6308495", "0.6294693", "0.62928843", "0.6265452", "0.6241725", "0.62314117", "0.6229315", "0.6187034", "0.61812246", "0.6154812", "0.6135713", "0.61166286", "0.6111687", "0.6086213"...
0.681725
1
delete single image data
function deleteSingleImageData(req, res){ var deferred = q.defer(); var id = req.body.id; var delId = req.body.delId; shopGoodsModel.findOne({ "_id":id },function(err,docs){ if(err){ console.log(err); deferred.reject(err); } var imageArr = docs.goods_content; var basePath = config.delGoodsPath; v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_image(image_name, dialog_win){\n\t\tif (image_name != null){\n\t\t\tif(IPython.notebook.metadata[\"image.base64\"].hasOwnProperty(image_name)){\n\t\t\t\tvar base64 = IPython.notebook.metadata[\"image.base64\"];\n\t\t\t\tdelete base64[image_name];\n\t\t\t\t$(dialog_win).trigger('table_change', \"Sub...
[ "0.7271492", "0.71837175", "0.7099844", "0.70828754", "0.69900846", "0.6938785", "0.6856148", "0.6829619", "0.6812419", "0.67898625", "0.6778153", "0.67247176", "0.66426516", "0.6625701", "0.66080475", "0.6557762", "0.6503194", "0.64785725", "0.64785564", "0.6477294", "0.6440...
0.71837986
1