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
Provides props for an element that hides its children visually but keeps content visible to assistive technology.
function useVisuallyHidden(props) { if (props === void 0) { props = {}; } let { style, isFocusable } = props; let [isFocused, setFocused] = useState(false); let { focusProps } = useFocus({ isDisabled: !isFocusable, onFocusChange: setFocused }); // If focused, don't hide the elem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this._overlayContainer.getContainerElement();\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children...
[ "0.6586589", "0.64012474", "0.63346463", "0.62310296", "0.6170792", "0.6114905", "0.6091032", "0.6091032", "0.6091032", "0.60795337", "0.60795337", "0.606742", "0.60237914", "0.6020386", "0.601878", "0.6003084", "0.6003084", "0.6003084", "0.5986886", "0.5982203", "0.5982091",...
0.6459343
1
Helper to call ReactRef.attachRefs with this composite component, split out to avoid allocations in the transaction mountready queue.
function attachRefs() { ReactRef.attachRefs(this, this._currentElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachRefs() {\n\t\t ReactRef.attachRefs(this, this._currentElement);\n\t\t}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}"...
[ "0.75479835", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.75437784", "0.7532998", "0.7532998", "0.7532998", ...
0.758356
0
Return a firebase namespace object. In production, this will be called exactly once and the result assigned to the 'firebase' global. It may be called multiple times in unit tests.
function createFirebaseNamespace() { var apps_ = {}; var factories = {}; var appHooks = {}; // A namespace is a plain JavaScript Object. var namespace = { // Hack to prevent Babel from modifying the object returned // as the firebase namespace. __esModule: true, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFirebaseNamespace() {\n var apps_ = {};\n var factories = {};\n var appHooks = {};\n // A namespace is a plain JavaScript Object.\n var namespace = {\n // Hack to prevent Babel from modifying the object returned\n // as the firebase namespace.\n __esModule: true,\...
[ "0.74596286", "0.7391497", "0.73875356", "0.73875356", "0.73870945", "0.73870945", "0.73857725", "0.7296253", "0.7296253", "0.7295619", "0.7292638", "0.7236339", "0.72336054", "0.7231978", "0.6473545", "0.6040576", "0.5863775", "0.5818979", "0.57967186", "0.5793146", "0.57887...
0.7471524
0
Create a new App instance (name must be unique).
function initializeApp(options, name) { if (name === undefined) { name = DEFAULT_ENTRY_NAME; } else { if (typeof name !== 'string' || name === '') { error('bad-app-name', { name: name + '' }); } } if (contains(apps_, na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createApp() {\n // create store and router instances\n const store = createStore();\n const router = Object(src_router[\"createRouter\"])();\n\n // sync the router with the vuex store.\n // this registers `store.state.route`\n Object(vuex_router_sync[\"sync\"])(store, router);\n\n // create the app...
[ "0.69528586", "0.6900097", "0.6900097", "0.6900097", "0.6900097", "0.6900097", "0.6900097", "0.6900097", "0.6900097", "0.6898991", "0.6898991", "0.6840714", "0.6817035", "0.66975594", "0.66620046", "0.66571313", "0.6631588", "0.6627901", "0.66133785", "0.65745556", "0.6572698...
0.69215316
1
Render the overview tab
function renderOverview() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderOverview() {\n var nameText = $(\".city-name\").text(weatherData.name);\n var tempText = $(\".temp\").text(weatherData.temp);\n var humidText = $(\".humid\").text(weatherData.humid);\n var windText = $(\".wind\").text(weatherData.wind);\n ...
[ "0.6712174", "0.64907855", "0.6287717", "0.6081502", "0.59472793", "0.5925722", "0.58419544", "0.58312154", "0.58292645", "0.5824524", "0.579711", "0.5792282", "0.5759184", "0.57538295", "0.57271546", "0.5720337", "0.57152003", "0.57066387", "0.5678827", "0.56324935", "0.5628...
0.78561574
0
draw a path specified by an array of coords
function drawPath(a) { if (a.length > 0) { context.lineWidth = 1.5; context.beginPath(); context.moveTo(a[0][0], a[0][1]); for (i=1; i<a.length; i++) { context.lineTo(a[i][0], a[i][1]); } context.stroke(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawPoly(coords) {\n context.moveTo(coords.shift(), coords.shift());\n while (coords.length)\n context.lineTo(coords.shift(), coords.shift());\n }", "function path(xpts, ypts, size){\n ctx.moveTo(xpts[0]*size, ypts[0]*size);\n for (var i = 1; i<xpts.length; i++) {\n ctx.lineTo(x...
[ "0.69627666", "0.6945972", "0.6643801", "0.6643801", "0.64528716", "0.6322083", "0.6313443", "0.6227684", "0.62117094", "0.6191547", "0.6158912", "0.61431205", "0.61408794", "0.61234593", "0.611836", "0.6117447", "0.6072034", "0.60706633", "0.6040595", "0.60401094", "0.603715...
0.69633085
0
Functions // Grams per Day
function calculateDaily() { gramsPerDay.value = (amount.value * timesPerDay.value); dailyGrams.value = (amount.value * timesPerDay.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function perDay(objeto)\r\n{\r\n\tvar x = -1;\r\n\tvar dia = new Array();\r\n\tdia[0] = (objeto.metal==0) ? -1 : Math.floor(metalAlDia/objeto.metal);\r\n\tdia[1] = (objeto.cristal==0) ? -1 : Math.floor(cristalAlDia/objeto.cristal);\r\n\tdia[2] = (objeto.deuterio==0) ? -1 : Math.floor(deuterioAlDia/objeto.deuterio)...
[ "0.5836135", "0.5831459", "0.58051646", "0.5784761", "0.57057536", "0.565295", "0.56173563", "0.56102663", "0.5607785", "0.5603514", "0.5591187", "0.5570172", "0.55617", "0.5529498", "0.55185986", "0.54782975", "0.5477177", "0.54461616", "0.54069716", "0.5387387", "0.53850406...
0.71745366
0
Return a promise containing the top message and delete that from the queue.
receive() { const receiveParams = { QueueUrl: this.queueUrl } const prom = new Promise((resolve, reject) => { this.sqs.receiveMessage(receiveParams, (err, response) => { if (err) { console.log("Error receiving message", err); reject...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getMessage() {\n const onMessage = queue.length > 0\n ? Promise.resolve()\n : new Promise((resolve) => {\n queueNonEmptyResolver = resolve;\n });\n await onMessage;\n ...
[ "0.6930484", "0.67612284", "0.6585909", "0.6502577", "0.6368712", "0.6350033", "0.6309987", "0.62092584", "0.6208616", "0.6208411", "0.6196231", "0.6160554", "0.6123709", "0.6100971", "0.6097317", "0.60508406", "0.6050563", "0.60275626", "0.60259306", "0.6022707", "0.60178626...
0.6951405
0
Write a function called translator that receives a language (e.g. "fr", "eng" etc.). Log out the translated version (e.g. if the language is "eng" log "Hello World", if the language is "fr" log "Bonjour le monde" etc.)
function translator(lang) { if (lang === "en") { console.log("Hello"); } else if (lang === "fr") { console.log("Bonjour"); } else if (lang === "ms") { console.log("Hai"); } else { console.log("Perhaps your language is not available at a moment"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function helloWorld(language){if(language === \"es\"){return \"Hola a todos.\";}else if(language === \"fr\"){return \"Bonjour tout le monde.\";}else if (language === \"de\"){return \"Hallo, Welt.\";}else{return \"Hello, World.\";};}", "function selectLang(language){\n\tswitch (language){\n\t\tcase \"German\":\n\...
[ "0.7295876", "0.6896997", "0.6869249", "0.6865735", "0.68403363", "0.6783386", "0.6625388", "0.6590664", "0.64836454", "0.6443628", "0.6403929", "0.63967085", "0.6369432", "0.63690245", "0.63637537", "0.6329474", "0.63280076", "0.6313163", "0.62936455", "0.62434924", "0.62180...
0.78168815
0
Create a buffer containing the same constant value.
function createConstantBuffer(context, constant, length) { var buffer = context.createBuffer(1, length, context.sampleRate); var n = buffer.length; var data = buffer.getChannelData(0); for (var k = 0; k < n; ++k) { data[k] = constant; } return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBuffer() {\n var text = \"\";\n\n function buffer(value) {\n if (arguments.length == 0) {\n return text;\n }\n text += value;\n }\n\n buffer.clear = function() {\n text = '';\n }\n return buffer;\n}", "function Buffer(arg, encodingOrOffset, le...
[ "0.6208355", "0.60167783", "0.60167783", "0.60016465", "0.59523153", "0.5935437", "0.59123737", "0.59123737", "0.5910904", "0.58864784", "0.58847535", "0.5858507", "0.58457744", "0.5837669", "0.5828815", "0.5823473", "0.5823473", "0.5823473", "0.5823473", "0.5823473", "0.5823...
0.7460529
0
Create a constant reference signal with the given |value|. Basically the same as |createConstantBuffer|, but with the parameters to match the other create functions. The |endValue| is ignored.
function createConstantArray(startTime, endTime, value, endValue, sampleRate) { var startFrame = timeToSampleFrame(startTime, sampleRate); var endFrame = timeToSampleFrame(endTime, sampleRate); var length = endFrame - startFrame; var buffer = createConstantBuffer(context, value, length); return bu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constant(value) {\n return new Constant(value)\n}", "function setConstantValue(node, value) {\n var emitNode = getOrCreateEmitNode(node);\n emitNode.constantValue = value;\n return node;\n }", "function setConstantValue(node, value) {\n var emitNode ...
[ "0.62038815", "0.5925518", "0.5925518", "0.5914537", "0.5653872", "0.54141533", "0.5296812", "0.5151517", "0.5151517", "0.5151517", "0.5151517", "0.5151517", "0.511518", "0.50701666", "0.50701666", "0.50050735", "0.50050735", "0.50050735", "0.49811414", "0.4934112", "0.485842...
0.6297224
0
Create a linear ramp starting at |startValue| and ending at |endValue|. The ramp starts at time |startTime| and ends at |endTime|. (The start and end times are only used to compute how many samples to return.)
function createLinearRampArray(startTime, endTime, startValue, endValue, sampleRate) { var startFrame = timeToSampleFrame(startTime, sampleRate); var endFrame = timeToSampleFrame(endTime, sampleRate); var length = endFrame - startFrame; var array = new Array(length); var step = (endValue - startVal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createExponentialRampArray(startTime, endTime, startValue, endValue, sampleRate)\n{\n var startFrame = timeToSampleFrame(startTime, sampleRate);\n var endFrame = timeToSampleFrame(endTime, sampleRate);\n var length = endFrame - startFrame;\n var array = new Array(length);\n\n var multiplier...
[ "0.56614816", "0.56555367", "0.56461644", "0.54688793", "0.54271746", "0.5413916", "0.54066867", "0.53842103", "0.5378615", "0.5369153", "0.5364616", "0.536141", "0.5347865", "0.53133047", "0.53035086", "0.53033334", "0.5286262", "0.52795196", "0.5275886", "0.5271948", "0.527...
0.6969857
0
Create an exponential ramp starting at |startValue| and ending at |endValue|. The ramp starts at time |startTime| and ends at |endTime|. (The start and end times are only used to compute how many samples to return.)
function createExponentialRampArray(startTime, endTime, startValue, endValue, sampleRate) { var startFrame = timeToSampleFrame(startTime, sampleRate); var endFrame = timeToSampleFrame(endTime, sampleRate); var length = endFrame - startFrame; var array = new Array(length); var multiplier = Math.pow(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createExponentialApproachArray(startTime, endTime, startValue, targetValue, sampleRate, timeConstant)\n{\n var startFrame = timeToSampleFrame(startTime, sampleRate);\n var endFrame = timeToSampleFrame(endTime, sampleRate);\n var length = endFrame - startFrame;\n var array = new Array(length);\...
[ "0.62539357", "0.56753224", "0.5167722", "0.50204015", "0.49547577", "0.49390948", "0.49176905", "0.48385072", "0.4833904", "0.48049375", "0.47752598", "0.4774309", "0.4667742", "0.46649465", "0.46606874", "0.46068618", "0.46064502", "0.4604766", "0.46041897", "0.45952758", "...
0.73160976
0
Create a signal that starts at |startValue| and exponentially approaches the target value of |targetValue|, using a time constant of |timeConstant|. The ramp starts at time |startTime| and ends at |endTime|. (The start and end times are only used to compute how many samples to return.)
function createExponentialApproachArray(startTime, endTime, startValue, targetValue, sampleRate, timeConstant) { var startFrame = timeToSampleFrame(startTime, sampleRate); var endFrame = timeToSampleFrame(endTime, sampleRate); var length = endFrame - startFrame; var array = new Array(length); var c ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createExponentialRampArray(startTime, endTime, startValue, endValue, sampleRate)\n{\n var startFrame = timeToSampleFrame(startTime, sampleRate);\n var endFrame = timeToSampleFrame(endTime, sampleRate);\n var length = endFrame - startFrame;\n var array = new Array(length);\n\n var multiplier...
[ "0.63652986", "0.5668441", "0.5431491", "0.5112368", "0.5112368", "0.5112368", "0.50131875", "0.49777585", "0.4938768", "0.48877788", "0.48700145", "0.47793335", "0.47686777", "0.47686777", "0.47686777", "0.47256696", "0.46619496", "0.46150997", "0.46150997", "0.45784676", "0...
0.6794633
0
Return the difference between the starting value and the ending value for time interval |timeIntervalIndex|. We alternate between an end value that is above or below the starting value.
function endValueDelta(timeIntervalIndex) { if (timeIntervalIndex & 1) { return -startEndValueChange; } else { return startEndValueChange; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valueUpdate(timeIntervalIndex)\n{\n return -startingValueDelta;\n}", "function displacement(interval) { return interval.end - interval.begin; }", "function getLastIntervalToCombineIndex(intervals, intervalEnd) {\n let i = 0;\n while (intervalEnd >= intervals[i + 1].start) {\n i++;\n ...
[ "0.59226334", "0.55729115", "0.5513357", "0.54463935", "0.5160271", "0.50399655", "0.50340194", "0.49986959", "0.49849674", "0.49765748", "0.49320695", "0.49191758", "0.48122457", "0.4792187", "0.4783343", "0.47765264", "0.47567847", "0.47567847", "0.47567847", "0.47567847", ...
0.7561116
0
Return the difference between the starting value at |timeIntervalIndex| and the starting value at the next time interval. Since we started at a large initial value, we decrease the value at each time interval.
function valueUpdate(timeIntervalIndex) { return -startingValueDelta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endValueDelta(timeIntervalIndex)\n{\n if (timeIntervalIndex & 1) {\n return -startEndValueChange;\n } else {\n return startEndValueChange;\n }\n}", "getTickIndex(index, duration) {\n if (index == 0)\n return 0;\n var initial = this.durationMap[index];\n ...
[ "0.72368556", "0.51441884", "0.5095735", "0.5001722", "0.49674731", "0.4917955", "0.48706415", "0.4866934", "0.4842499", "0.48374778", "0.4738799", "0.47121587", "0.47085232", "0.4685986", "0.4629259", "0.45984715", "0.45680016", "0.45405808", "0.44982418", "0.44802698", "0.4...
0.6258411
1
Compare a section of the rendered data against our expected signal.
function comparePartialSignals(rendered, expectedFunction, startTime, endTime, valueInfo, sampleRate) { var startSample = timeToSampleFrame(startTime, sampleRate); var expected = expectedFunction(startTime, endTime, valueInfo.startValue, valueInfo.endValue, sampleRate, timeConstant); var n = expected.lengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "linesEquals(layout) {\n if (!this.scrollEquals(layout)) {\n return false;\n }\n const tmp = this._renderedLines._get();\n const lines = tmp.lines;\n for (let i = 0, len = lines.length; i < len; i++) {\n if (lines[i].dy === -1) {\n...
[ "0.5156189", "0.50537455", "0.4989221", "0.49486446", "0.49486446", "0.49486446", "0.49486446", "0.49375844", "0.4925051", "0.4885195", "0.4874672", "0.48379102", "0.4837775", "0.48046586", "0.4786692", "0.4778201", "0.47759217", "0.47705033", "0.47590768", "0.47533786", "0.4...
0.64262515
0
Find the discontinuities in the data and compare the locations of the discontinuities with the times that define the time intervals. There is a discontinuity if the difference between successive samples exceeds the threshold.
function verifyDiscontinuities(values, times, threshold) { var n = values.length; var success = true; var badLocations = 0; var breaks = []; // Find discontinuities. for (var k = 1; k < n; ++k) { if (Math.abs(values[k] - values[k - 1]) > threshold) { breaks.push(k); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLastDiscontinuity() {\n return this.discontinuities[this.videoSequencesCount - 1];\n }", "_getDrops(data, threshold, max) {\n let dropArrays = [];\n let interval = MARCH_INTERVAL;\n let length = data.length;\n let _values = []\n for (let i = 0; i < length;) {\n let _abs = Math.abs(data...
[ "0.5461037", "0.5357152", "0.5303283", "0.52878606", "0.52837306", "0.5133731", "0.50796014", "0.50766283", "0.50766283", "0.50766283", "0.5074004", "0.5032086", "0.49908742", "0.49896264", "0.49724767", "0.49636403", "0.49628827", "0.49533078", "0.49403718", "0.49283075", "0...
0.8041719
0
Create a function to test the rendered data with the reference data. testName string describing the test error max allowed error between rendered data and the reference data. referenceFunction function that generates the reference data to be compared with the rendered data. jumpThreshold optional parameter that specifi...
function checkResultFunction(testName, error, referenceFunction, jumpThreshold) { return function(event) { var buffer = event.renderedBuffer; renderedData = buffer.getChannelData(0); var threshold; if (!jumpThreshold) { threshold = discontinuityThreshold; } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testDataPoints(fieldName) {\n var stop = false\n var fieldVerboseName = fieldName.replace(\"_\", \" \")\n\n if (fieldName === \"fish_length\") {\n test = [300, 301]\n }\n else if (fieldName === \"fish_weight\") {\n test = [303, 304]\n }\n else if (fieldName === \"gonad_w...
[ "0.43106845", "0.4308303", "0.42204633", "0.42033625", "0.41417527", "0.41333556", "0.40972975", "0.40598482", "0.40110108", "0.3998592", "0.39915854", "0.3972955", "0.39718804", "0.39511305", "0.39456385", "0.39388257", "0.39327177", "0.39281565", "0.3922855", "0.39143705", ...
0.68453723
0
Run all the automation tests. numberOfTests number of tests (time intervals) to run. initialValue The initial value of the first time interval. setValueFunction function that sets the specified value at the start of a time interval. automationFunction function that sets the end value for the time interval. It specifies...
function doAutomation(numberOfTests, initialValue, setValueFunction, automationFunction) { var timeInfo = [0]; var valueInfo = []; var value = initialValue; for (var k = 0; k < numberOfTests; ++k) { var startTime = k * timeInterval; var endTime = (k + 1) * timeInterval; var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runTests(tests)\n{\n var result = new TestResult();\n \n try {\n for (var i = 0, j = tests.length; i < j; i++) {\n result.addResult(tests[i].name + \"\", tests[i]());\n }\n } catch (error) {\n alert(\"The following error prevented running all tests:\\n\\n\" +\n ...
[ "0.55329233", "0.553027", "0.54921925", "0.5481839", "0.5242175", "0.5209335", "0.51825583", "0.5179107", "0.5153203", "0.5118182", "0.51065135", "0.50943387", "0.50589013", "0.5030353", "0.49257237", "0.49148676", "0.48765823", "0.48533425", "0.4814597", "0.48133585", "0.480...
0.8716642
0
Function that runs every second to see if the hour has changed
function checkTime() { var currHour = moment().hour(); if(currHour !== hour) { hour = currHour; dateEl.text(moment().format("dddd, MMMM Mo")); updateBackgroundColors(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTime() {\n timerId = setInterval(function () {\n var timeNow = new Date();\n hours = timeNow.getHours();\n var checkHour = hours\n })\n}", "function surprise() {\n (function loop() {\n\n var now = new Date();\n console.log(now.get...
[ "0.7029273", "0.67010885", "0.6676623", "0.64853066", "0.64161783", "0.6413161", "0.63557655", "0.6334796", "0.63170254", "0.6303198", "0.6268601", "0.62488484", "0.624244", "0.6240175", "0.62389946", "0.6236726", "0.6219237", "0.61971974", "0.61963546", "0.6171397", "0.61621...
0.69768894
1
randomize array of images
function randomizeImages(){ Array.prototype.randomize = function() { var i = this.length, j, temp; while ( --i ) { j = Math.floor( Math.random() * (i - 1) ); temp = this[i]; this[i] = this[j]; this[j] = temp; } }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomizeImages(){\n Array.prototype.randomize = function()\n {\n var i = this.length, j, temp;\n while ( --i )\n {\n j = Math.floor( Math.random() * (i - 1) );\n temp = this[i];\n this[i] = this[j];\n this[j] = temp;\n }\n };\n images.randomize();\n setImages();\n re...
[ "0.82645535", "0.7871463", "0.7864614", "0.7765643", "0.77523786", "0.7685833", "0.7655439", "0.76454395", "0.7632018", "0.74495214", "0.73565155", "0.7289971", "0.7280227", "0.727578", "0.72599536", "0.71817285", "0.7166658", "0.7153698", "0.71476835", "0.7140083", "0.713779...
0.7982025
1
Parse Ensure JSON.parse does not parse undefineds
parse(val){ return val === undefined ? null : JSON.parse(val) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseJson(str){if(str.length===0){// special-case empty json body, as it's a common client-side mistake\nreturn{};}try{return JSON.parse(str);}catch(e){throw new ApiError(400,'Invalid JSON');}}", "function tryToParseJSON (json) {\n\t\tif (!sails.util.isString(json)) return null;\n\t\ttry {\n\t\t\treturn...
[ "0.69378144", "0.6824234", "0.68207043", "0.6768076", "0.6693547", "0.6629798", "0.6611526", "0.66102207", "0.66038704", "0.66005504", "0.65255475", "0.6449434", "0.64003557", "0.6394117", "0.6386743", "0.6364831", "0.6363721", "0.6309617", "0.6300094", "0.629945", "0.6258425...
0.6992017
0
Clear Clear the state
clear() { this._state = {} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChange...
[ "0.802911", "0.802911", "0.802911", "0.802911", "0.79205656", "0.79115283", "0.78373665", "0.7836028", "0.7710462", "0.76969504", "0.76547635", "0.75380814", "0.7528883", "0.7501685", "0.7364958", "0.73426217", "0.73085594", "0.7299012", "0.7297065", "0.7284596", "0.72726214"...
0.86106706
0
Convert month string into [1, 12] integer
function monthToInt(month) { var i; for(i=0 ; i<months.length ; i++) { if (months[i] == month) return i+1; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function month2number(str) {\n str = str.replace(\"Jan\", \"1\")\n str = str.replace(\"Feb\", \"2\")\n str = str.replace(\"Mar\", \"3\")\n str = str.replace(\"Apr\", \"4\")\n str = str.replace(\"May\", \"5\")\n str = str.replace(\"Jun\", \"6\")\n str = str.replace(\...
[ "0.73325455", "0.70721936", "0.68915755", "0.67841125", "0.6781805", "0.667088", "0.6658323", "0.6601883", "0.65945846", "0.6582781", "0.6551791", "0.6544168", "0.65377384", "0.6529431", "0.64979184", "0.6467792", "0.64251256", "0.63403815", "0.63312423", "0.6320018", "0.6317...
0.7072799
1
Convert [0, 6] integer into week day string
function intToWeekDay(val) { if (val >= 0 && val < 7) return wdays[val]; return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDayOfTheWeek(dayNum) {\n switch (dayNum) {\n case 0:\n return \"Sunday\";\n case 1:\n return \"Monday\";\n case 2:\n return \"Tuesday\";\n case 3:\n return \"Wednesday\";\n case 4:\n return \"Thursday\";\n ...
[ "0.71124095", "0.6943644", "0.69104546", "0.68885744", "0.6884372", "0.6884372", "0.6884372", "0.6779431", "0.67044264", "0.6661771", "0.6624594", "0.66213065", "0.6620955", "0.6609755", "0.6594376", "0.65887946", "0.65528625", "0.6508463", "0.647606", "0.64721674", "0.642146...
0.69656444
1
Convert week day string into [0, 6] integer
function weekDayToInt(wday) { var i; for(i=0 ; i<wdays.length ; i++) { if (wdays[i] == wday) return i; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dayOfWeekAsInteger(day) {\n return [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"][day];\n}", "function d3_time_parseWeekday(date, string, i) {\n d3_time_weekdayRe.lastIndex = 0;\n var n = d3_time_weekdayRe.exec(string.substring(i, i + 10));\n return n ? i += n[0].length : -1;\n}", ...
[ "0.7510023", "0.6931187", "0.6931187", "0.66574854", "0.6459332", "0.6457015", "0.6457015", "0.6450293", "0.6418515", "0.6356582", "0.634594", "0.6256352", "0.61240524", "0.6113523", "0.6085163", "0.6067791", "0.6046069", "0.60207105", "0.60058403", "0.5987328", "0.59256107",...
0.7083883
1
Convert "mmdd" date into web representation
function dateToWeb(date) { var intMonth, intDay; if (date.length == 3) { intMonth = parseInt(date.substring(0, 1)); intDay = parseInt(date.substring(1, 3)); } else { intMonth = parseInt(date.substring(0, 2)); intDay = parseInt(date.substring(2, 4)); } return intToMonth(intMonth) + ", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toDDMMYYYY(date){\n\treturn date.substring(6, 8) + \"/\" + date.substring(4, 6) + \"/\" + date.substring(0, 4) \n}", "convert(date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n\n if (month < 10) \n month = '0'...
[ "0.71643215", "0.70251715", "0.6900415", "0.6844107", "0.68393236", "0.6793315", "0.6766747", "0.67541546", "0.6749678", "0.6749227", "0.67130464", "0.67066514", "0.6633162", "0.6631369", "0.66287196", "0.6627115", "0.6623025", "0.6611027", "0.65962124", "0.659275", "0.659183...
0.77624965
0
Convert web representation into "mmdd" date
function webToDate(strDate) { var start = 0, end, month, day; end = strDate.indexOf(","); if (end > -1) { month = monthToInt(strDate.substring(start, end)); start = end + 2; day = strDate.substring(start); if (day.length == 1) day = "0" + day; return month + day; } return n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateToWeb(date)\n{\n var intMonth, intDay;\n\n if (date.length == 3)\n {\n intMonth = parseInt(date.substring(0, 1));\n intDay = parseInt(date.substring(1, 3));\n }\n else\n {\n intMonth = parseInt(date.substring(0, 2));\n intDay = parseInt(date.substring(2, 4));\n }\n\n return intToMo...
[ "0.74757594", "0.67247903", "0.65522176", "0.6514899", "0.651476", "0.6511328", "0.6503953", "0.6477436", "0.64494973", "0.6421758", "0.6419564", "0.6377069", "0.6373374", "0.63700366", "0.6346798", "0.63337016", "0.63303167", "0.6317867", "0.6312897", "0.628807", "0.6283547"...
0.6945459
1
Convert "hhmm" time into web representation
function timeToWeb(time) { var ldif = 4 - time.length; for(var i=0 ; i<ldif ; i++) time = "0" + time; return time.substring(0, 2) + ":" + time.substring(2, 4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "convertTimes(time) {\n console.log(\"== Grid: convertTimes ==\");\n var ampm = \"am\";\n var hour = parseInt(time.split(\":\")[0]);\n var min = time.split(\":\")[1];\n if (hour > 12) {\n hour = hour - 12\n ampm = \"pm\"\n }...
[ "0.7029389", "0.69440615", "0.6922428", "0.69001997", "0.6845525", "0.6838751", "0.677443", "0.6755068", "0.67481273", "0.6735777", "0.67131996", "0.67048734", "0.6696392", "0.66765624", "0.6661281", "0.66593933", "0.6654345", "0.66518897", "0.664498", "0.6616248", "0.6615909...
0.769131
0
Convert web representation into "hhmm" time
function webToTime(strTime) { if (strTime.indexOf(":") == 2) { return parseInt(strTime.substring(0, 2) + strTime.substring(3, 5)); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeToWeb(time)\n{\n var ldif = 4 - time.length;\n for(var i=0 ; i<ldif ; i++)\n time = \"0\" + time;\n\n return time.substring(0, 2) + \":\" + time.substring(2, 4);\n}", "function timeConverter(t)\n {\n var hours=t.match(/[0-9]{2}/);\n if(hours==\"00\")hours=\"24\";\n var min=t....
[ "0.7468134", "0.67717934", "0.6650492", "0.65293515", "0.6500126", "0.64964265", "0.6455986", "0.6432734", "0.64242435", "0.6418114", "0.64054376", "0.6399122", "0.6388637", "0.6386918", "0.63841486", "0.6368521", "0.6359003", "0.63306516", "0.63241863", "0.63158625", "0.6293...
0.74123573
1
Return Web representation of a given condition
function conditionToWeb(line) { var type = "network", item1 = "", operator = "", item2 = ""; var start, end; // Item1 if (line.substring(0, 6) == "clock.") { type = "clock"; end = line.indexOf("repeat_time(", 6); if (end > -1) { var initTime, endTime; item1 = "time"; opera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeSearchCondition(condition) {\n return encodeURIComponent(condition).replace('/</g', '%3C').replace('/=/g', '%3D').replace('/>/g', '%3E')\n .replace('/%26/g', '&');\n }", "function WorkFlowCondition(blogic, fieldName, operator, condValue, condId)\r\n{\r\n var cond = new Object();\r\n\...
[ "0.58790404", "0.5624914", "0.5580164", "0.55353576", "0.54959756", "0.54876596", "0.5443391", "0.5411012", "0.5360588", "0.5301719", "0.5242952", "0.52151674", "0.52085966", "0.51993567", "0.51899636", "0.51877", "0.51390016", "0.5064717", "0.5064717", "0.5064717", "0.503801...
0.6349096
0
this should be 5 or less / functions gets searchTerm, sets a new myLocation[x], saves location to local memory! ideally limit this to valid cities
function searchCity() { // console.log($("#search-input").val()); tempVar = $("#search-input").val(); myLocations[myLocations.length] = tempVar; jsonLocations = JSON.stringify(myLocations); localStorage.setItem("jsonLocations", jsonLocations); // return $("#search-input").val(); return tempV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveLocation(input){\n //add this to the saved locations array\n if (savedCities === null) {\n savedCities = [input];\n }\n else if (savedCities.indexOf(input) === -1) {\n savedCities.push(input);\n }\n //save the new array to localstorage\n localStorage.setItem(\"city\"...
[ "0.64308494", "0.6295265", "0.6204457", "0.60577106", "0.60254705", "0.602314", "0.59907097", "0.59529275", "0.59515196", "0.59456384", "0.59001833", "0.589689", "0.588122", "0.58359516", "0.58069897", "0.5804756", "0.5803141", "0.57780194", "0.57613003", "0.5757524", "0.5741...
0.6393643
1
Constructs a new PaginatedCompanyList.
constructor() { PaginatedCompanyList.initialize(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllCompanies() {\n $http({\n method: 'GET',\n url: '/init/getAllCompanies'\n }).then(function(response) {\n allCompanies.list = response.data;\n });\n }", "function loadCompanies() {\n xhr.requestCompanies(function(response) { \n var companyMap = {};\n ...
[ "0.59115374", "0.5797644", "0.55776715", "0.5535904", "0.54220605", "0.52394253", "0.51946825", "0.51498044", "0.51446855", "0.5138155", "0.5058819", "0.5052182", "0.50456357", "0.5033597", "0.50144017", "0.49697137", "0.4901041", "0.4893391", "0.48690766", "0.48617068", "0.4...
0.77187335
0
Crear un nuevo almacenamiento
async createAlmacenamiento(req, res) { // Añadir capa de validación const { almacenamientoid, almcontrato, almfechaacopio, almfechaingresobodega, almnumerobultos, almpesobulto, almpesototalingreso, almsaldo, almobservaciones, tratamientoid, centroacopioid } = req.body; try { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crearAtencion(atencion, dueño) {\n return new Atencion({\n ...atencion\n }).save()\n}", "function crearSalas(){\n\t\n\t//Creo el modelo\n\tfor (var i=0; i <=NRO_SALAS; i++){\n\t\tcrearSala(i);\n\t}\n\t\n\t//Reseteo el contador de quirofanos cargados\n\tquirofanosCargados = 0;\n}", "functi...
[ "0.643703", "0.61236995", "0.5824832", "0.57935965", "0.56696194", "0.56566465", "0.5628767", "0.56193936", "0.5582768", "0.55637705", "0.5536005", "0.55166835", "0.5442433", "0.5431112", "0.541893", "0.5402069", "0.5401712", "0.5394206", "0.537275", "0.5371986", "0.5367371",...
0.635006
1
Actualiza informacion de un almacenamiento
async updateAlmacenamiento(req, res) { const { id } = req.params; const { almacenamientoid, almcontrato, almfechaacopio, almfechaingresobodega, almnumerobultos, almpesobulto, almpesototalingreso, almsaldo, almobservaciones, tratamientoid, centroacopioid } = req.body; try { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function atualizarFabricante() {\n apiService.post('/api/fabricante/atualizar', $scope.novoFabricante,\n atualizarFabricanteSucesso,\n atualizarFabricanteFalha);\n }", "updateAgenda() {\n this.state.agenda.id_user_envia = this.state.userSession.id\n this.stat...
[ "0.6159863", "0.57944334", "0.57238096", "0.56977665", "0.5640583", "0.5549784", "0.55010194", "0.54484", "0.5439121", "0.5380262", "0.536677", "0.53579277", "0.53417534", "0.53197527", "0.5288567", "0.5258414", "0.52576554", "0.5250557", "0.5230439", "0.5193583", "0.51770043...
0.59498274
1
Proxy domLoaded to restoreOptions instead of supplying restoreOptions as callback directly, since we need the first parameter of restoreOptions
function domLoaded() { restoreOptions(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function domLoad() {\n // observe dom loaded\n document.removeEventListener(\"DOMContentLoaded\", domLoad, true);\n domLoaded = true;\n callbackIfReady();\n }", "_restoreFromPageCache(callback) {\n\t\tif (this.loadScript) {\n this.loadScript((script) => {\n...
[ "0.56621873", "0.5268028", "0.5256247", "0.52050894", "0.51965505", "0.51965505", "0.51965505", "0.5148883", "0.5123888", "0.5123888", "0.5123888", "0.51228184", "0.51228184", "0.5067938", "0.50613856", "0.5041325", "0.49920088", "0.49564707", "0.49561635", "0.495462", "0.494...
0.770348
0
We will delete profiles directly from this function instead as a callback of the proxy object, since: Deleting array entry is complicated, set callback will also be fired Deletion is one entry at a time
function deleteProfile() { // Let's not delete defaults if (profile.value !== DEFAULT_PROFILE_ID && profile.value !== NEW_PROFILE_ID) { let profile = document.querySelector("#profile"); let hideProfile = document.querySelector("#hideProfile"); let siteRegex = document.querySelector("#siteRegex"); /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteProfile(profile) {\n if (kbProfiles.length > 1 & profile != chosenProfile) {\n var profileIndex = kbProfiles.indexOf(profile);\n deleteProfilecard(profile);\n if (profileIndex > -1) {\n kbProfiles.splice(profileIndex, 1);\n }\n }\n document.getElementB...
[ "0.60906965", "0.6033137", "0.6032612", "0.5932877", "0.5836094", "0.5498456", "0.5452273", "0.54061776", "0.53493154", "0.5343262", "0.5315787", "0.5307375", "0.5304165", "0.53000796", "0.5275699", "0.5257154", "0.52569985", "0.5253229", "0.52486837", "0.52333033", "0.521937...
0.6180719
0
get multiple random numbers by one seed
function getMultiRandomNumber(seed, amount){ var numArr = new Array(); for (var i = 0; i < amount; i++){ a = random(seed+random(seed)); numArr[i] = a; seed = a; } return numArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seededRandomValues(seed, n) {\n var values = [];\n for (var i = 0; i < n; ++i) {\n var x = Math.sin(seed++) * 10000;\n values.push(x - Math.floor(x));\n }\n return values;\n}", "function myRandom(seed) {\n randomNumber = randomNums[seed][randCount];\n if(randCount<nNums-1){\n randCount +=...
[ "0.72597605", "0.7242947", "0.7196086", "0.719294", "0.6908071", "0.6808913", "0.68060493", "0.6803286", "0.6791763", "0.6791763", "0.6791763", "0.6761193", "0.67597526", "0.674186", "0.674186", "0.674152", "0.67034435", "0.67006904", "0.6666556", "0.6647643", "0.6624798", ...
0.8248473
0
Wait for a specific job to be completed
wait(jobId) { let job = this.jobs[jobId]; if (job.executed) { delete this.jobs[jobId]; } return job ? job.getPromise() : undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForJob(jobId, transcoder) {\n // TODO: esto es de aws y tarda 30 segundos en el loop.\n // se puede hacer uno propio para disminuir el tiempo,\n // o se puede configurar el webhook del transcoder para enterarse\n // de cuándo terminó el job.\n // console.log('==========================>>>> waitFo...
[ "0.7159146", "0.6717843", "0.6209269", "0.6208588", "0.60389197", "0.58564675", "0.57837915", "0.57746935", "0.57559615", "0.57365054", "0.5684581", "0.5684346", "0.5628467", "0.5619943", "0.5609962", "0.5595035", "0.5579004", "0.55259275", "0.5508856", "0.55068016", "0.54834...
0.71731466
0
Colse the info window
function closeInfo() { if (InforObj.length > 0) { // Detach the info-window from the marker InforObj[0].set("marker", null); // Close the window InforObj[0].close(); // Clear the array InforObj.length = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeInfoWindow(){\n\t$(\"#extra-bar\").hide();\n\t$(\"#map-window\").addClass(\"col-xs-11\").removeClass('col-xs-7');\n\t//$(\".menu-icon\").find('.filter-button').css({'width':'50%'})\n\t$(\".menu-icon\").data('clicked', false);\n\tupdateMapScale(1000)//change the map to be bigger when there is not an i...
[ "0.69325376", "0.6917348", "0.6882661", "0.66567403", "0.6617721", "0.6613213", "0.6583349", "0.65228385", "0.65221107", "0.65144914", "0.64935005", "0.63372135", "0.632008", "0.63132787", "0.630001", "0.62545025", "0.62530077", "0.6230163", "0.62042326", "0.6192877", "0.6169...
0.6995597
0
'specificRequest()' service FALLBACK IMPLEMENTATION request_id: a key (e.g. a String, Integer, Uuid or Enumeration)
specificRequest(request_id, ...args) { MxI.$raiseNotImplementedError(IAdaptee, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateRequestKey(request) {\n return JSON.stringify(request);\n}", "function ob(a,c){\"list\"==c?rb(\"REQ_OTHER_REQUEST\"):v.getRequestListById(a,function(d){var e,f=d;\"edit\"==c?(e=\"edit\",b.go(\"createrequest\",{id:a,type:e,data:f})):\"view\"==c?(e=\"view\",b.go(\"createrequest\",{id:a,type:e,dat...
[ "0.60892373", "0.5591829", "0.55914", "0.55096036", "0.5435189", "0.54248273", "0.53746724", "0.5369045", "0.5325532", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", "0.5283164", ...
0.6114543
0
this function creates the connections(lines) between particles which are less than a certain distance apart
joinParticles (particles) { particles.forEach(element => { let dis = dist(this.x, this.y, element.x, element.y) if (dis < 85) { stroke('rgba(255,255,255,0.04)') line(this.x, this.y, element.x, element.y) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__connect() {\n for (let a = 0; a < this.particlesArray.length; a++) {\n for (let b = a ; b < this.particlesArray.length; b++) {\n let distance = (( this.particlesArray[a].x - this.particlesArray[b].x ) * \n (this.particlesArray[a].x - this.particlesArray[b].x))\...
[ "0.72075176", "0.6949313", "0.6863981", "0.6813419", "0.6695884", "0.6644635", "0.65582854", "0.65203905", "0.65023994", "0.6422408", "0.639196", "0.6353", "0.6276703", "0.60585743", "0.59766585", "0.59170693", "0.5894661", "0.5814312", "0.5717548", "0.569497", "0.5631522", ...
0.70734984
1
Runs a loop which repeatedly logs a metric which includes the build ID and the uptime, with a reasonable delay between each iteration.
async _uptimeLoop() { const buildId = this._buildInfo.info.buildId; for (;;) { // Round the current uptime up to a multiple of the desired frequency (ok // ok ok, technically "wavelength"), delay until the time hits, and log // it. We log the "clean" exact value of the multiple, for the sake ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runDate() {\n let hours, minutes, seconds;\n for (let hours = 0; hours < 24; hours++) {\n hours = updateHours();\n for(let minutes = 0; minutes < 60; minutes++) {\n minutes = updateMinutes();\n for(let seconds = 0; seconds < 60; seconds++) {\n seconds = updateSeconds();\n c...
[ "0.6169315", "0.58399266", "0.5597329", "0.5477465", "0.5465025", "0.5377606", "0.5353174", "0.5207828", "0.51497096", "0.5147014", "0.51174605", "0.5073478", "0.5054659", "0.5031275", "0.5027236", "0.5023668", "0.4987184", "0.4986968", "0.49795055", "0.49382424", "0.4921578"...
0.7953663
0
function createBall() Creates the ball/s depending on _ballAmount and _diameter Called by: setup() Input: _ballAmount,_diameter Returns: N/A
function bb_createBall(_ballAmount, _diameter) { console.log("bb_createBall(_ballAmount,-diameter) / _ballAmount = " + _ballAmount + " / _diameter = " + _diameter) for (var i = 0; i < _ballAmount; i++) { ballsArray[i] = { ballHit: false, posX: gameCanvas.width / 2, posY: gameCanvas.height / 2, diamet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBall() {\n\t\t//our beginPath is where the creating of the ball starts.\n\t\t//It will end this function at our closePath()\n\t\tctx.beginPath();\n\t\t//the below line took a while. I used mdn\n\t\t//and found this link, that explained using PI due tot he fact the ball is circular\n\t\t//https://dev...
[ "0.76530194", "0.7309897", "0.6990479", "0.69339484", "0.6783371", "0.674202", "0.6726987", "0.6638226", "0.653297", "0.65225536", "0.6520134", "0.64854825", "0.6481009", "0.6479445", "0.6452711", "0.64203286", "0.64176095", "0.6386161", "0.6377504", "0.6356585", "0.63136137"...
0.7742172
0
function bb_startBtn() Make Canvas to fit screen and start the game Called by: start button in s_gamePg Input: N/A Returns: N/A
function bb_startBtn() { console.log("bb_startBtn") //Resizes the canvas based on size of box on screen var elmnt = document.getElementById("d_gameArea") gameCanvas.resize(elmnt.offsetWidth, elmnt.offsetHeight) gameCanvas.parent(d_gameArea); //Changes btn text between start and stop var btn = document.getElemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startUp() {\r\n\r\n // Turn screen on.\r\n graphics.fillStyle = \"white\";\r\n graphics.fillRect(0, 0, width, screenHeight);\r\n\r\n // Draw game name.\r\n graphics.fillStyle = \"#00ff99\";\r\n graphics.font = \"30px Arial\";\r\n graphics.fillText(\"Tumbly Fumbles\", width / 8, screen...
[ "0.7780328", "0.7661502", "0.7574737", "0.74735826", "0.73702264", "0.72977614", "0.72920567", "0.72254544", "0.7178587", "0.7145679", "0.71160257", "0.7096905", "0.70597076", "0.7035409", "0.70277154", "0.70019394", "0.6997862", "0.69936603", "0.69906884", "0.6987777", "0.69...
0.80217093
0
function bb_draw() Calls all the functions that would normally be called by draw only works when start button is clicked Called by: draw() Input: N/A Returns: N/A
function bb_draw() { //Check the ball is being clicked gameCanvas.mousePressed(bb_clicked); // Genreal movement of the balls for (var i = 0; i < ballsArray.length; i++) { ballsArray[i].bb_movement() ballsArray[i].bb_bounce() ballsArray[i].bb_display() } // end the game if (ballsArray.length <= 0) { bb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {}", "function draw() {}", "draw(){}", "draw(){}", "function draw() {\n checkState();\n}", "function draw() {\n checkState();\n}", "function draw() {\n background(30);\n\n if(state === `title`){\n title();\n instructions();\n start();\n }\n else if(state === `simulation`)...
[ "0.7256456", "0.7256456", "0.7194735", "0.7194735", "0.7135663", "0.7135663", "0.71247095", "0.71192896", "0.7042503", "0.7033629", "0.7031216", "0.7008803", "0.7008803", "0.70061713", "0.69975215", "0.6985931", "0.69796264", "0.6977968", "0.69717413", "0.6970587", "0.6959532...
0.75542814
0
function bb_clicked() Iterates over ballsArray to see if they got clicked and calls bb_updateBBScores() Called by: draw() Input: N/A Returns: N/A
function bb_clicked() { var ballHit = false; for (var i = 0; i < ballsArray.length; i++) { result = ballsArray[i].bb_checkBallHit(i); if (result == true) { hits++; ballHit = true; } } if (ballHit == false) { misses++; } console.log(" hits: " + hits + " misses: " + misses + " counter: " + counter);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bb_draw() {\n\t//Check the ball is being clicked\n\tgameCanvas.mousePressed(bb_clicked);\n\n\t// Genreal movement of the balls\n\tfor (var i = 0; i < ballsArray.length; i++) {\n\t\tballsArray[i].bb_movement()\n\t\tballsArray[i].bb_bounce()\n\t\tballsArray[i].bb_display()\n\t}\n\n\t// end the game \n\tif (...
[ "0.76732594", "0.7031678", "0.6775489", "0.6734064", "0.66937476", "0.65786356", "0.65328425", "0.6529223", "0.64255655", "0.6298105", "0.625008", "0.62153465", "0.6215245", "0.6211894", "0.6123528", "0.61170536", "0.61157143", "0.6096874", "0.60843277", "0.60759467", "0.6074...
0.86373526
0
bb_resetGame() Called by: bb_startBtn Resets the scores when start button clicked Input: N/A Returns: N/A
function bb_resetGame() { console.log('bb_resetGame') //Reset score score = 0; hits = 0; misses = 0; //create the balls bb_createBall(NUMBALLS, BALLDIA) // Start/Reset timer bb_timer = setInterval(bb_playTimer, 1000); counter = 10; ui_changeHTML("p_time", "Time : " + counter) ui_changeHTML("p_bbGameResu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGame(){\n\n\t\n\n\t\tclearQuestion();\n\n\t\t\n\n\t\t$(\"#category\").html(\"\");\n\n\t\tvar score = $(\".score-window\");\n\t\tscore.html(\t'<p> Right Answers: ' + right + '</p>' +\n\t\t\t\t\t'<p> Wrong Answers: ' + wrong + '</p>' +\n\t\t\t\t\t'<p> Unanswered: ' + unanswered + '</p>');\n\t\t$(\"#sta...
[ "0.8079309", "0.80495244", "0.794168", "0.7915402", "0.7858934", "0.78454226", "0.78400064", "0.78030163", "0.7802714", "0.77757007", "0.7772641", "0.77294725", "0.7691011", "0.76901156", "0.7688063", "0.7668655", "0.7663442", "0.76613384", "0.7660915", "0.76557034", "0.76501...
0.8363929
0
bb_updateBBScores() Updates the text which shows score/hits/misses Called by: bb_clicked Input: Output: n/a
function bb_updateBBScores() { ui_changeHTML("p_misses", "Misses : " + misses) ui_changeHTML("p_hits", "Hits : " + hits) score = (hits - misses) * (counter + 1) if (score < 0) { score = 0 } ui_changeHTML("p_score", "Score : " + score) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bb_clicked() {\n\tvar ballHit = false;\n\tfor (var i = 0; i < ballsArray.length; i++) {\n\t\tresult = ballsArray[i].bb_checkBallHit(i);\n\t\tif (result == true) {\n\t\t\thits++;\n\t\t\tballHit = true;\n\t\t}\n\t}\n\tif (ballHit == false) {\n\t\tmisses++;\n\t}\n\tconsole.log(\" hits: \" + hits + \" misses...
[ "0.7137256", "0.6967599", "0.69250244", "0.69050163", "0.68387705", "0.6804932", "0.6779154", "0.6766713", "0.671426", "0.6684278", "0.66336036", "0.6630753", "0.66130465", "0.65831923", "0.65796685", "0.65638924", "0.6538139", "0.65289545", "0.6524716", "0.6512787", "0.64919...
0.8427574
0
setOrientation (portrait or paisaje)
function setOrientation(newOrientation) { orientation = newOrientation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "swapOrientation() {\n if (this.orientation_ === 'horizontal') {\n this.orientation_ = 'vertical';\n } else {\n this.orientation_ = 'horizontal';\n }\n\n this.setOrientation(this.orientation_);\n }", "setOrientation() {\n switch (this.orientation) {\n case 0:\n ...
[ "0.79482627", "0.7905811", "0.7483175", "0.7199485", "0.71629715", "0.7062977", "0.7008728", "0.70019567", "0.6978713", "0.69060785", "0.67738307", "0.677157", "0.6740429", "0.65735143", "0.6565268", "0.65462565", "0.647643", "0.647643", "0.647643", "0.647643", "0.647643", ...
0.87923247
0
Returns a closured Freets object that can execute Freet operations Wherever you import this class, you will be accessing the same data.
function Freets() { let _data = []; let _counter = 0; const that = Object.create(Freets.prototype); /** * Add a Freet * @param {string} content - Freet content * @param {string} author - Freet user * @return {Freet} - returns a created Freet */ that.addFreet = (content, au...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TextOperation() {\n if (!this || this.constructor !== TextOperation) {\n // => function was called without 'new'\n return new TextOperation();\n }\n\n // When an operation is applied to an input string, you can think of this as\n //...
[ "0.5291045", "0.5215716", "0.5161117", "0.51481974", "0.5140906", "0.5114823", "0.506532", "0.5020585", "0.4991427", "0.49544448", "0.49309182", "0.4930771", "0.49215102", "0.4917998", "0.49110258", "0.48935944", "0.4887824", "0.48734725", "0.48692325", "0.48692325", "0.48692...
0.59845996
0
An indication that this item should be enabled only if the specified question is answered (hasAnswer=true) or not answered (hasAnswer=false).
get hasAnswer () { return this._hasAnswer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get answerBoolean () {\n\t\treturn this._answerBoolean;\n\t}", "function checkQuizAnswer(){\n let answer = $(\"input[name='quiz_answer']:checked\").val();\n let currentQuestion = STORE.questions[STORE.quizProgress];\n\n $(\"input[name='quiz_answer']\").attr('disabled', true);\n\n if( answer === curre...
[ "0.6454707", "0.64284414", "0.64139265", "0.6342054", "0.6198011", "0.60703814", "0.5989841", "0.58659166", "0.58111805", "0.58046216", "0.57859975", "0.57844776", "0.57844776", "0.57233393", "0.5706417", "0.5690564", "0.5681909", "0.56590194", "0.5595563", "0.55948883", "0.5...
0.68485343
0
Ask user to confirm an action. `message` explains the action and choices. Returns observable resolving to `true`=confirm or `false`=cancel
confirm(message) { const confirmation = window.confirm(message || 'Is it OK?'); return Object(rxjs__WEBPACK_IMPORTED_MODULE_1__["of"])(confirmation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmContinue(message) {\r\n\t\tconst res = !getHasChanges() || confirm(message || defaultMessage);\r\n\t\treturn res;\r\n\t}", "function confirmAction(url, message) {\n\tvar newmessage = message + \"\\n\" + \n\t\t\t\t\t\"Press OK to proceed\\n\" + \n\t\t\t\t\t\"Cancel to stay on the current page\";\n...
[ "0.6600648", "0.63209295", "0.615431", "0.60312045", "0.6023106", "0.60134083", "0.60134083", "0.59938943", "0.59593064", "0.5860808", "0.5744129", "0.5730539", "0.5702539", "0.5686073", "0.56856036", "0.5671805", "0.5658648", "0.56107384", "0.5602405", "0.55987954", "0.55963...
0.68434334
0
This function will get a reference to the title and set its text to the value of the pageTitle variable that was set above.
function setPageTitle() { const title = document.getElementById('title'); title.innerText = pageTitle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPageTitle() {\n let titleElement = document.getElementById('title');\n titleElement.innerText = pageTitle;\n}", "function setPageTitle() \r\n{\r\n const heading = document.getElementById('title')\r\n heading.innerText = pageTitle;\r\n}", "function setPageTitle() {\n document.getElementById('...
[ "0.8336586", "0.8248614", "0.81914437", "0.81150204", "0.8030685", "0.7886233", "0.7877104", "0.7735364", "0.7707533", "0.7675977", "0.76415867", "0.76372766", "0.760933", "0.75931495", "0.75931495", "0.75931495", "0.75931495", "0.75931495", "0.75931495", "0.75931495", "0.759...
0.8404265
0
Function to toggle Talisman functionality
function toggleTalisman() { useTalisman = !useTalisman; GM_setValue("useTalisman", useTalisman); if(useTalisman) { $("#xtal").attr("value", "Talisman"); } else { $("#xtal").attr("value", "Weapon"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleState() {\r\n runBest = !runBest;\r\n // Arata cel mai bun obiect\r\n if (runBest) {\r\n resetGame();\r\n runBestButton.html('continue training');\r\n // Antreneaza in continuare\r\n } else {\r\n nextGeneration();\r\n runBestButton.html('run best');\r\n }\r\n}", "toggle() {\n\n...
[ "0.6309955", "0.61343795", "0.584894", "0.5845731", "0.5792602", "0.5790221", "0.5784049", "0.57631993", "0.57332706", "0.57206106", "0.5716605", "0.570819", "0.57023126", "0.56798226", "0.565046", "0.564206", "0.55769885", "0.5573146", "0.5561984", "0.5557117", "0.5548127", ...
0.68462574
0
Function to toggle Auto Use Dust functionality
function toggleAutoUseDust() { autoUseDust = !autoUseDust; GM_setValue("autoUseDust", autoUseDust); if(autoUseDust) { $("#xadust").attr("value", "Dust:ON"); } else { $("#xadust").attr("value", "Dust:OFF"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleDustMerchant() {\r\n\t\tdustFight = !dustFight;\r\n\t\tGM_setValue(\"dustFight\", dustFight);\r\n\t\tif(dustFight)\r\n\t\t{\r\n\t\t\t$(\"#xdust\").attr(\"value\", \"Dust:Fight\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$(\"#xdust\").attr(\"value\", \"Dust:Accept\");\r\n\t\t}\r\n\t}", "function eaT...
[ "0.6130587", "0.58989525", "0.5767426", "0.5660524", "0.5658554", "0.5611274", "0.56034964", "0.5582961", "0.5488754", "0.5486684", "0.54809934", "0.5459227", "0.5456622", "0.54368234", "0.5417429", "0.53999287", "0.53999287", "0.53999287", "0.53999287", "0.53824794", "0.5380...
0.81141937
0
Function to toggle Wiseman functionality
function toggleWiseman() { wiseFight = !wiseFight; GM_setValue("wiseFight", wiseFight); if(wiseFight) { $("#xwise").attr("value", "Wise:Fight"); } else { $("#xwise").attr("value", "Wise:Accept"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle() {\n\n\t}", "function toggleTalisman() {\t\r\n\t\tuseTalisman = !useTalisman;\r\n\t\tGM_setValue(\"useTalisman\", useTalisman);\r\n\t\tif(useTalisman)\r\n\t\t{\t\r\n\t\t\t$(\"#xtal\").attr(\"value\", \"Talisman\");\r\n\t\t}\r\n\t\telse\r\n\t\t{ \r\n\t\t\t$(\"#xtal\").attr(\"value\", \"Weapon\");\r\n\t\t}...
[ "0.7075882", "0.69828725", "0.6850026", "0.6784166", "0.66947997", "0.66925883", "0.6648619", "0.66394687", "0.66269195", "0.65727353", "0.6570235", "0.6562778", "0.6541319", "0.650041", "0.64713764", "0.64666206", "0.6432149", "0.6421975", "0.6421975", "0.6421975", "0.640636...
0.8174949
0
Function to toggle Dust Merchant functionality
function toggleDustMerchant() { dustFight = !dustFight; GM_setValue("dustFight", dustFight); if(dustFight) { $("#xdust").attr("value", "Dust:Fight"); } else { $("#xdust").attr("value", "Dust:Accept"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleReceipt(){\n\tvar caller = document.getElementById(\"donation_receipt\");\n\tif (caller.value == \"on\"){\n\t\tcaller.value = \"off\";\n\t} else {\n\t\tcaller.value = \"on\";\n\t}\n}", "function setMerchant() {\n\tmerchant = true;\n\tdefence = false;\n\tleader = null;\n}", "function toggleVendor...
[ "0.6418393", "0.6197042", "0.61171526", "0.60912794", "0.5992406", "0.59706163", "0.59491855", "0.59466934", "0.5907747", "0.5895638", "0.5890221", "0.5866102", "0.5863881", "0.5824435", "0.5812786", "0.57686615", "0.57650644", "0.57367104", "0.5721276", "0.571027", "0.568042...
0.7905547
0
Function to toggle Billion functionality
function toggleBillion() { isBillion = !isBillion; GM_setValue("isBillion", isBillion); if(isBillion) { $("#xbil").attr("value", "Rage"); } else { $("#xbil").attr("value", "Energy"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function balloon_toggle(num)\n{\n if (0 == num)\n {\n ds = '#baloon-left';\n as = '#toggle-bl-left';\n }\n else if (1 == num)\n {\n ds = '#baloon-right';\n as = '#toggle-bl-right';\n }\n else\n {\n return false;\n }\n\n $(ds).toggleClass('inactive');...
[ "0.6688238", "0.66244304", "0.6245684", "0.60752267", "0.6038027", "0.59226763", "0.5903071", "0.58881354", "0.586974", "0.5733666", "0.5667066", "0.5644442", "0.5610549", "0.56067085", "0.5599272", "0.5595356", "0.5573349", "0.5554816", "0.5549419", "0.5538581", "0.55377185"...
0.7651359
0
==/Toggles== Returns random delay between each timeouts
function getRandomDelay() { return (Math.round(Math.random() * (MAX_DELAY)) + 500) / 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDelay() {\n return Math.round(Math.random() * 50) + 20;\n }", "function randomTimeout() {\r\n return Math.floor(Math.random() * 5) + 1;\r\n}", "function setTiming() {\r\n return Math.random() * (3000 - 1000) + 1000;\r\n}", "function randomTypeDelay() {\n return (Math.ra...
[ "0.7405077", "0.7150157", "0.6982839", "0.6980046", "0.6799693", "0.64097524", "0.6384664", "0.6315778", "0.6290074", "0.62662405", "0.62067777", "0.6166574", "0.61550164", "0.6129961", "0.6123371", "0.6117626", "0.61058766", "0.6105376", "0.6057122", "0.6055748", "0.6035009"...
0.72434574
1
Function to determine what type adventure is being processed.
function adventureType(mobname, actionResult, battleResult){ if(actionResult == null || mobname == null) { return NULL_ADVENTURE; } else if (actionResult.indexOf("Inside you find:") > 0) { return OPEN_BOX_OR_CHEST; } if(mobname == "A Puzzle Box") { if(actionResult.indexOf("and can be op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectAdventureTypeBasedOnCurrentArea () {\n\tif (cow.currentTab == \"main\") {\n\n\tvar x = 4.8; // default # of XPs per grind.\n\tvar v = 2.0; // Less XP for grinding a combat skill\n\tvar\ty = 35; // default chance of a mob dropping a gear piece\n\tvar z = 9.1; // Extra XPs for grinding in a skill gate...
[ "0.58715993", "0.5793373", "0.57922757", "0.5676265", "0.55634093", "0.54897624", "0.54849887", "0.54784566", "0.54572237", "0.54528415", "0.5427685", "0.5387371", "0.5382197", "0.5352443", "0.5340696", "0.5295418", "0.5292292", "0.52663994", "0.52640176", "0.52618706", "0.52...
0.6634605
0
Returns true if the sign given is an Encounter.
function isEncounterSign(areasign) { if(areasign && (areasign.indexOf("Encounter")> 0 || (areasign.indexOf("Boss") > 0 && areasign.indexOf("Mu Boss") == 0) || areasign.indexOf("Demon") > 0) ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canSign() {\n return !!this.privKey;\n }", "isExtendedEntry() {\n return (this.flags & 0x80) !== 0;\n }", "isEnumerated(){\r\n\t\treturn (this.enumeration != undefined)\r\n\t}", "checkIfProposalACK(peerAddr, amt, rawData) {\n try {\n rawData = JSON.parse(rawData);\n return ('...
[ "0.51111263", "0.50456417", "0.50331104", "0.4965025", "0.4948704", "0.49436206", "0.4939358", "0.4822408", "0.47541055", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47493643", "0.47321284", ...
0.69393396
0
Assigns the appropriate value to the input field based on the multiplier given and the player's level. Alerts the user if there was an error, or if they do not have enough coins.
function inputAmount(multiplier) { var curLevel = $("#curlevel").html(); var curCoins = $("#curcoins").html().replace(/[,\.]/g,""); var amount = (multiplier*(HP_VALUES_ARRAY[parseInt(curLevel)-1])+1); if (HP_VALUES_ARRAY[parseInt(curLevel)-1] >= 0) { if (multiplier > 6) { amount = 100000...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiply() {\n //Count highest number of rolls played so far\n if (repeatCurrent > maxTries) {\n reset();\n return $lobutton;\n } //reset if reach end of stakes with no win - LOSE MONEY\n //Set stake value based on repeat number (convert # to btc 1 = 0.00000001 btc)\n stake = number[repeatCurre...
[ "0.6235988", "0.6194795", "0.60547966", "0.60318434", "0.59902143", "0.598176", "0.59604234", "0.5945689", "0.5862913", "0.58497566", "0.5839657", "0.5815221", "0.5805423", "0.57866246", "0.5784705", "0.5783476", "0.57732344", "0.5772691", "0.57716477", "0.57686013", "0.57609...
0.8265835
0
clangformat on Helper function to test if an element is visible.
function isElementVisible(element) { return element && !element.hidden; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visible(element) {\n return _jquery2.default.css(element, 'visibility') === 'visible';\n }", "function visible(element) {\n return _jquery2.default.css(element, 'visibility') === 'visible';\n }", "function visibleInDom(el) {\n // Example where checking visibility matters...
[ "0.83202404", "0.83202404", "0.8121959", "0.81136703", "0.80556107", "0.80556107", "0.80556107", "0.80556107", "0.80556107", "0.804886", "0.7964124", "0.78796995", "0.78532", "0.78532", "0.78532", "0.78532", "0.78532", "0.78532", "0.78532", "0.78532", "0.78532", "0.78532", ...
0.84182334
0
Helper function to update website input and trigger validation.
async function updateWebsiteInput( dialog, passwordManager, newValue, isValid = true) { const shouldGetUrlCollection = !!newValue.length; if (shouldGetUrlCollection) { passwordManager.resetResolver('getUrlCollection'); passwordManager.setGetUrlCollectionResponse( isValid ? { // Matches...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process_web_form() {\n // TODO input variables\n}", "function doValidation() {\r\n\r\n}", "function inputValidation(input) {\r\n\r\n\t\t}", "updateInputs(){\n this.a = parseFloat(document.getElementById(\"a_input\").value);\n this.b = parseFloat(document.getElementById(\"b_input\")....
[ "0.6412574", "0.60812217", "0.5941397", "0.5816347", "0.5782189", "0.57786196", "0.57085377", "0.566087", "0.56090516", "0.5593289", "0.5580144", "0.5576758", "0.5572322", "0.55533504", "0.554889", "0.55474216", "0.5538109", "0.5535003", "0.5532442", "0.55290216", "0.54968166...
0.63336396
1
helper function which call predicate function per parameter and return true if all pass
function all(func) { return function() { var params = getParams(arguments); var length = params.length; for (var i = 0; i < length; i++) { if (!func.call(null, params[i])) { return false; } } return t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n ...
[ "0.75121087", "0.7405326", "0.73779166", "0.73017466", "0.7223573", "0.71279114", "0.70676655", "0.7053733", "0.7053733", "0.69930154", "0.6962775", "0.6942552", "0.6942552", "0.69152176", "0.68867135", "0.6884866", "0.6872408", "0.6865666", "0.6821448", "0.6762898", "0.66910...
0.7629264
0
helper function which call predicate function per parameter and return true if any pass
function any(func) { return function() { var params = getParams(arguments); var length = params.length; for (var i = 0; i < length; i++) { if (func.call(null, params[i])) { return true; } } return fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function any(func) {\n\t return function() {\n\t var params = getParams(arguments);\n\t var length = params.length;\n\t for (var i = 0; i < length; i++) {\n\t if (func.call(null, params[i])) {\n\t return true;\n\t }\n\t ...
[ "0.7573066", "0.74146605", "0.7244214", "0.72317517", "0.7078345", "0.7031565", "0.69665295", "0.6955235", "0.69282335", "0.6922249", "0.6921955", "0.6921955", "0.69022036", "0.6892056", "0.6802824", "0.6802824", "0.6800754", "0.67611986", "0.6748089", "0.67324436", "0.670515...
0.7770717
0
helper function which compares a version to a range
function compareVersion(version, range) { var string = (range + ''); var n = +(string.match(/\d+/) || NaN); var op = string.match(/^[<>]=?|/)[0]; return comparator[op] ? comparator[op](version, n) : (version == n || n !== n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareVersion(version, range) {\n\t var string = (range + '');\n\t var n = +(string.match(/\\d+/) || NaN);\n\t var op = string.match(/^[<>]=?|/)[0];\n\t return comparator[op] ? comparator[op](version, n) : (version == n || n !== n);\n\t }", "function satisfies(version, ra...
[ "0.7892299", "0.7379516", "0.7259245", "0.7239496", "0.7239496", "0.6762316", "0.67595494", "0.6637566", "0.6489277", "0.634744", "0.61702514", "0.61702514", "0.61622053", "0.6005824", "0.593857", "0.593857", "0.5915855", "0.59158415", "0.59010506", "0.5889296", "0.587918", ...
0.7830093
1
helper function which extracts params from arguments
function getParams(args) { var params = slice.call(args); var length = params.length; if (length === 1 && is.array(params[0])) { // support array params = params[0]; } return params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParams(args) {\n\t var params = slice.call(args);\n\t var length = params.length;\n\t if (length === 1 && is.array(params[0])) { // support array\n\t params = params[0];\n\t }\n\t return params;\n\t }", "function func_get_args() { }", "function ge...
[ "0.7099601", "0.69405603", "0.6484479", "0.6387203", "0.6369495", "0.62569076", "0.6250677", "0.62176746", "0.61616033", "0.6094156", "0.6072735", "0.6071971", "0.6058686", "0.6055579", "0.6040845", "0.60378164", "0.6006796", "0.5985069", "0.5972714", "0.5961184", "0.59402704...
0.70706373
1
API Set 'not', 'all' and 'any' interfaces to methods based on their api property
function setInterfaces() { var options = is; for (var option in options) { if (hasOwnProperty.call(options, option) && is['function'](options[option])) { var interfaces = options[option].api || ['not', 'all', 'any']; for (var i = 0; i < interfaces.length; i++)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInterfaces() {\n var options = is;\n for(var option in options) {\n if(hasOwnProperty.call(options, option) && is.function(options[option])) {\n var interfaces = options[option].api || ['not', 'all', 'any'];\n for (var i = 0; i < interfaces.length;...
[ "0.7185698", "0.7185194", "0.5934019", "0.5860726", "0.58041203", "0.56618947", "0.55910784", "0.5506451", "0.5435103", "0.5435103", "0.5435103", "0.53779453", "0.5329946", "0.5325661", "0.5233624", "0.5199557", "0.51691943", "0.51691943", "0.51634616", "0.51383984", "0.51362...
0.7201996
0
Create a skeleton new widget on disk. Note that we don"t send it to the server.
function create(clean) { // Next need to find out what kind of widget the user needs. return prompt(clean).then(responses => { return buildSkeletonWidget(responses, clean) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSkeletonWidget(responses, clean) {\n\n // Need a shortened unique version of name - all lower case with spaces taken out.\n const widgetType = getUniqueWidgetType(responses.widgetName)\n\n // Build up the context object for use with template generation.\n const context = buildContext(responses, w...
[ "0.68654835", "0.61115724", "0.5871954", "0.572589", "0.5700244", "0.56439406", "0.5434184", "0.5420324", "0.5393591", "0.5363566", "0.5332306", "0.5314707", "0.53108263", "0.53049546", "0.52933943", "0.5253648", "0.52471286", "0.5228671", "0.5191247", "0.5187361", "0.5168497...
0.69183
0
Build the base widget directory and return the path.
function buildWidgetDir(responses, clean) { // Build up the base widget path. const widgetDir = `${constants.widgetsDir}/${responses.widgetName}` // See if need to clean anything from disk first. clean && removeTrackedTree(widgetDir) // Create the base dir. makeTrackedTree(widgetDir) return widgetDir ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _computeBaseOpendatakitPath() {\n\t// To compute this we are going to rely on the location of the containing\n\t// file relative to the location we are serving as root. If this is\n\t// changed, this file must be updated appropriately.\n\t// Since we are expecting this file to live in app/index.html, we\n...
[ "0.62228936", "0.58393645", "0.58054984", "0.5628675", "0.5616726", "0.5522905", "0.5483414", "0.5360186", "0.5343018", "0.529664", "0.5265253", "0.52330464", "0.52121365", "0.5175564", "0.5134042", "0.5107959", "0.50957143", "0.5060084", "0.504017", "0.5039513", "0.5023845",...
0.6893828
0
Create a locale dir and file for specified locale.
function createLocaleDir(localeDir, widgetType, context) { // Need sub-directory for each locale. makeTrackedTree(localeDir) // Add a locale file. const localeFilePath = `${localeDir}/ns.${widgetType}.json` createWidgetFileFromTemplate(localeFilePath, context, "exampleResourcesJson") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveFile(locale, directory, fallback) {\n fallback = fallback || this.options.localeFallback;\n directory = directory || this.options.directory;\n let path = path_1.resolve(directory, `${locale}.json`);\n const parsed = path_1.parse(path);\n mkdir.sync(parsed.dir); // ensure t...
[ "0.62958074", "0.58996904", "0.58784187", "0.57682514", "0.57381195", "0.57302153", "0.56475896", "0.54893214", "0.5466112", "0.5447915", "0.5353805", "0.53423584", "0.52723366", "0.52468365", "0.5202505", "0.5191524", "0.51619256", "0.51507616", "0.51326984", "0.50943184", "...
0.71769536
0
Need a top level file for the widget metadata
function createWidgetMetadata(context, widgetDir, widgetType) { // Create the default internal metadata that the user cannot change. const internalMetadata = { "widgetType" : widgetType, "version" : 1, "displayName" : context.widgetName, "javascript" : widgetType, "global" : context.global, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function metadataEditor() {\n var features = \"width=500,height=640,status=yes,resizeable=yes,scrollbars=yes\";\n var metadataWin = window.open (\"/templates/metadata.xul\", METADATA_EDITOR, features);\n}", "static setupMetadataPanel() {\n $('#metaDataPanel').hide();\n $('#metaDataPanel .pane...
[ "0.59338737", "0.586525", "0.5479492", "0.53722936", "0.5371423", "0.5325949", "0.5321254", "0.5245704", "0.52147174", "0.5177242", "0.5167309", "0.5154645", "0.51272404", "0.51116496", "0.5081262", "0.5074977", "0.5074977", "0.5074977", "0.5074977", "0.5074977", "0.5072081",...
0.5865671
1
Create files for non global widgets.
function createNonGlobalFiles(widgetDir, context) { // Write out the base template. const widgetTemplatePath = `${widgetDir}/${constants.widgetTemplate}` createWidgetFileFromTemplate(widgetTemplatePath, context, "exampleTemplate") // Write out the base less file. const widgetLessPath = `${widgetDir}/${const...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWidgetFileFromTemplate(outputPath, context, name) {\n createFileFromTemplate(outputPath, context, figureWidgetPath(name))\n}", "function createFile(){\n var wrapper=$('#file-wrapper');\n $('.material-tooltip').each(function(){\n $(this).remove();\n });\n $('#action-button-wrapp...
[ "0.61101586", "0.5952757", "0.5803846", "0.5714367", "0.56626767", "0.5651699", "0.56282777", "0.55322015", "0.5508006", "0.54846334", "0.5475625", "0.54446536", "0.54426354", "0.54426324", "0.5414758", "0.5414083", "0.53874564", "0.53311807", "0.53203344", "0.5311023", "0.52...
0.7268558
0
Output any warnings that came back from the extension upload.
function reportWarnings(warnings) { if (warnings.length) { info("widgetUploadWarningsFound") warnings.forEach(warning => { logInfo(warning) }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleWarning(reason, position, code) {\n\t if (code === 3) {\n\t return;\n\t }\n\n\t ctx.file.message(reason, position);\n\t }", "function WARNING() {\n if (!debug) return;\n\n //var str = '';\n var arr = [];\n for (var i = 0, l = arguments.length; i < l; i++)...
[ "0.60276026", "0.59162825", "0.59129304", "0.59129304", "0.59129304", "0.59129304", "0.59129304", "0.59129304", "0.59129304", "0.5841654", "0.5780812", "0.57756466", "0.5683904", "0.5683904", "0.56658834", "0.5659892", "0.56408983", "0.5640364", "0.5631286", "0.5631074", "0.5...
0.679254
0
Given an output path, a set of user responses an a template name, render an example widget file.
function createWidgetFileFromTemplate(outputPath, context, name) { createFileFromTemplate(outputPath, context, figureWidgetPath(name)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderWithTemplate(name, context, renderHandler) {\n\n const src = fs.readFileSync(upath.resolve(__dirname, `${figureExamplePath(name)}.dust`), 'utf8')\n dust.loadSource(dust.compile(src, name))\n\n // Render it based on what the user wants to do.\n dust.render(name, context, renderHandler)\n}", "fu...
[ "0.649337", "0.6101639", "0.5979553", "0.5905392", "0.5905186", "0.5829122", "0.5815357", "0.5728321", "0.5706734", "0.56707966", "0.5624673", "0.5602409", "0.5562509", "0.55519116", "0.554254", "0.5521666", "0.5508812", "0.55056876", "0.5480037", "0.5451906", "0.54334825", ...
0.6848814
0
Resolves a relative path in terms of another file
function resolveRelativeToFile(absPath, relPath) { return path.resolve(path.dirname(absPath), relPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resolveFilename(parentPath, relativePath) {\n if (!parentPath) {\n const resolvedPath = this._moduleIds[relativePath];\n if (!resolvedPath) {\n throw new Error('Could not resolve \"' + relativePath + '\".');\n }\n return resolvedPath;\n }\n const deps = this._modules[parentPath...
[ "0.6835616", "0.68227017", "0.6618086", "0.6604142", "0.65954757", "0.65334064", "0.6523673", "0.6501675", "0.6496221", "0.64852005", "0.64807916", "0.6431944", "0.6374683", "0.6369175", "0.6328902", "0.6320099", "0.63168615", "0.63168615", "0.63168615", "0.6293241", "0.62869...
0.70994866
0
Determine an absolute path for the sourceRoot.
function getComputedSourceRoot(sourceRoot, generatedPath, pathMapping = {}) { let absSourceRoot; if (sourceRoot) { if (sourceRoot.startsWith('file:///')) { // sourceRoot points to a local path like "file:///c:/project/src", make it an absolute path absSourceRoot = utils.canonical...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function localSourceNameToPath(projectRoot, sourceName) {\n return path_1.default.join(projectRoot, sourceName);\n}", "function rootPath() {\n const scriptsPath = path.dirname(ABS_PATH_TO_CURRENT_FILE);\n const devtoolsFrontendPath = path.dirname(scriptsPath);\n const devtoolsFrontendParentPath = path.dirn...
[ "0.66516715", "0.66458327", "0.66284215", "0.6549371", "0.6391532", "0.638148", "0.62940705", "0.62368", "0.61291635", "0.6101782", "0.60872567", "0.6081816", "0.60455257", "0.6031984", "0.6017185", "0.5998627", "0.5998627", "0.5998627", "0.5998627", "0.5998627", "0.5998627",...
0.7109324
0
Sets attributes of a plane object such that it is in "take off" mode
function setupTakingOffPlane(plane) { plane.bitmap.alpha = 0; // set plane to not visible plane.takingOff = true; plane.bitmap.x = STAGE_WIDTH/2 - plane.width/2; plane.bitmap.y = 540 - plane.height/2; plane.label.x = plane.bitmap.x + plane.width/2 - plane.label.getMeasuredWidth()/2; // center label over plane pla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takeOff(plane) {\n\tnumberOfPlanesTakingOff--;\n\tplane.takingOff = false;\n\tcreatejs.Tween.get(plane.bitmap)\n\t\t.to({x:plane.bitmap.x + 150, rotation: -20}, 1700) // go down runway\n\t\t.to({x:plane.bitmap.x + 1000, y:plane.bitmap.y - 500}, 6000) // lift off\n\t\t.call( function() {\n\t\t\tstage.remov...
[ "0.674698", "0.59613657", "0.576155", "0.5702093", "0.5454181", "0.54037046", "0.534208", "0.5339074", "0.53212875", "0.53125834", "0.5285144", "0.5277155", "0.5258031", "0.52348924", "0.52212495", "0.5220822", "0.5200832", "0.5198465", "0.518116", "0.51738757", "0.5161646", ...
0.6815722
0
Plays a sound if the game is not muted.
function playSound(id) { if (!mute) { createjs.Sound.play(id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playSound(sound) {\n if (globals.audio) {\n\n sound.play(); // Play sound\n }\n}", "function handleSound() {\n if (!audioPlayer.paused) {\n pauseSound();\n } else {\n playSound();\n }\n }", "function playAttackSound() {\n\t\tif (isGameBegun == true && isGameOver == fal...
[ "0.7294825", "0.72864467", "0.7172978", "0.7159232", "0.7054821", "0.7041868", "0.7019019", "0.7019019", "0.7019019", "0.70169014", "0.6945102", "0.6920541", "0.6909056", "0.6906271", "0.69016445", "0.6847888", "0.68435484", "0.682253", "0.6815652", "0.68103594", "0.67789555"...
0.7400383
0
Animation of plane taking off from the runway.
function takeOff(plane) { numberOfPlanesTakingOff--; plane.takingOff = false; createjs.Tween.get(plane.bitmap) .to({x:plane.bitmap.x + 150, rotation: -20}, 1700) // go down runway .to({x:plane.bitmap.x + 1000, y:plane.bitmap.y - 500}, 6000) // lift off .call( function() { stage.removeChild(plane.bitmap); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function planeAnimation(delay,duration) {\n var plane = $(\"#plane\");\n plane.delay(delay).animate({\n top: 90,\n left: -300,\n height: 45,\n width: 87\n }, duration);\n}", "function setupTakingOffPlane(plane) {\n\tplane.bitmap.alpha = 0; // set plane to not visible\n\tplane.takingOff = true;\n\t...
[ "0.7120988", "0.70756084", "0.65948915", "0.65203345", "0.6392407", "0.6305687", "0.6286942", "0.6069462", "0.60601836", "0.605217", "0.5975507", "0.5968225", "0.59399253", "0.59396005", "0.59355175", "0.5931979", "0.59247214", "0.59229296", "0.59192675", "0.59176654", "0.589...
0.71458715
0
Animation of plane landing on the runway.
function land(plane) { plane.speed = 0; // set plane speed to 0 since we will be suing TweenJS for this, not the tick function plane.flying = false; // plane will no longer be updated createjs.Tween.get(plane.bitmap) .to({x:plane.bitmap.x - 1000, y:360, rotation: -10}, 3500) // send plane off to left of screen ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function planeAnimation(delay,duration) {\n var plane = $(\"#plane\");\n plane.delay(delay).animate({\n top: 90,\n left: -300,\n height: 45,\n width: 87\n }, duration);\n}", "function plan_flight(){\n\tif(plane.x>=0) plane.x-=plane.velocity;\t\n\telse plane.x= canvas_width;\n}", "positionAnimati...
[ "0.66295403", "0.65986204", "0.6126356", "0.6087973", "0.6033141", "0.60293084", "0.59977573", "0.5940479", "0.58801764", "0.58713216", "0.587101", "0.5864783", "0.5861714", "0.5837441", "0.5834409", "0.58278817", "0.5805359", "0.5787698", "0.5763183", "0.5752103", "0.5744409...
0.7481543
0
Sets no plane selected.
function resetSelectedPlane() { selectedPlane = null; questionElement.innerHTML = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Reset() {\n this.m_particleParameterSelectionEnabled = false;\n }", "function unselectAll() {\n\tfor (var i = 0; i < ALL_POINTS.length; i ++) {\n\t\tALL_POINTS[i].isSelected = false;\n\t}\n\t\n\tfor (var i = 0; i < ALL_WALLS.length; i ++) {\n\t\tALL_WALLS[i].isSelected = false;\...
[ "0.6660299", "0.5943755", "0.5868975", "0.5838573", "0.582958", "0.5824815", "0.58222747", "0.5817718", "0.5797721", "0.57954586", "0.5782504", "0.57821864", "0.5758613", "0.5753997", "0.5740454", "0.57304585", "0.5729403", "0.57124466", "0.56932926", "0.56928205", "0.5687362...
0.6704136
0
add old term to new array at a random position
function addItem(x) { // get random position within terms length var new_pos = Math.floor(Math.random()*terms.length); // if there is an empty space at the random position fill it if(!(new_array[new_pos])) { count -=1; new_array[new_pos] = terms[x]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fresh(array) {\n var index = rand_range(array.length - 2) + 1,\n selection = array[index];\n array[index] = array[0];\n array[0] = selection;\n return selection;\n} // end fresh", "addWord() {\n var availableWords = this.state.dictionary[this.state.round];\n var newWord = availa...
[ "0.6142696", "0.61073893", "0.6078937", "0.6052836", "0.60259557", "0.5979502", "0.59785223", "0.5965954", "0.59421355", "0.593101", "0.5903811", "0.5891509", "0.58858836", "0.58808154", "0.5866472", "0.58587855", "0.5794161", "0.5790085", "0.5759396", "0.57417077", "0.573921...
0.66520727
0
Finds the patterns to avoid in the gitignore file
parseGitIgnore() { const content = fs.readFileSync(this.path + '.gitignore').toString(); const rules = content .split(/\n/g) .filter(rule => !!rule.trim() && !/^\s*#/.test(rule)) .map(rule => new RegExp(rule .replace(/\r/g, '') .replace(/\*\*/g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getKeepPatterns(src) {\n if (!Array.isArray(this.info.files))\n throw new Error(`Package 'files' is not an array.`);\n\n const patterns = [];\n\n for (const pattern of constants.NEVER_IGNORE)\n patterns.push({pattern: pattern});\n\n for (let pattern of this.info.files) {\n if (cons...
[ "0.73485947", "0.6328467", "0.62442946", "0.61457956", "0.6128022", "0.61241275", "0.61221707", "0.60231817", "0.6016187", "0.6016187", "0.600095", "0.58884746", "0.5884013", "0.58595085", "0.5854643", "0.5851692", "0.5792124", "0.5782721", "0.5741017", "0.5729211", "0.571123...
0.7175959
1
Does git ignore this file?
isGitIgnored() { const relative = git.getRelativePath(this.path); return this.gitFilters.some(rx => rx.test(relative)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseGitIgnore() {\n const content = fs.readFileSync(this.path + '.gitignore').toString();\n const rules = content\n .split(/\\n/g)\n .filter(rule => !!rule.trim() && !/^\\s*#/.test(rule))\n .map(rule => new RegExp(rule\n .replace(/\\r/g, '')\n ....
[ "0.65412563", "0.60128355", "0.5981031", "0.5969234", "0.5908529", "0.58307594", "0.58007103", "0.5660747", "0.5610269", "0.55707", "0.55662113", "0.5565154", "0.5540374", "0.5532796", "0.5519228", "0.5518847", "0.5462565", "0.5447301", "0.5433336", "0.54250705", "0.53860533"...
0.7578172
0
Is it considered a hidden file (usually files beggining with a dot)
isHiddenFile() { return /^\./.test(this.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hiddenFileCheck(value, errObject) {\n if (value.indexOf(\".\") == 0) {\n errObject.exists = true\n errObject[\"Hidden Files\"].push(\"Hidden File Found!\")\n ErrCounter.Critical.HiddenFile++\n }\n}", "function isHidden(root, path) {\n\t path = path.substr(root.length).split(sep);\n\t for(va...
[ "0.7191875", "0.6975684", "0.69247895", "0.62964106", "0.624111", "0.62192965", "0.6205749", "0.6085651", "0.60167634", "0.5911345", "0.5911345", "0.5910363", "0.5888433", "0.58869445", "0.58863944", "0.58802444", "0.5879556", "0.5873659", "0.58672845", "0.5854558", "0.582591...
0.8364312
0
Gives the sibling before this file. `null` if it doesn't exist
get previousSibling() { if (!this.parent) return null; const idx = this.parent.children.indexOf(this); if (idx === 0) return null; return this.parent.children[idx - 1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prevSibling() { return this.sibling(-1); }", "previousSibling(editor, at) {\n const { selection } = editor;\n if (at === undefined) {\n at = selection;\n }\n if (at !== undefined && at !== null && Range.isRange(at) && Range.start(at).path) {\n const parentPath = Path.parent(Range.start(at)....
[ "0.6517249", "0.6388928", "0.62927806", "0.62857455", "0.6221796", "0.6115539", "0.60420984", "0.6011739", "0.6011739", "0.59014326", "0.5891527", "0.5883593", "0.5827796", "0.5825953", "0.58173084", "0.5787919", "0.57821465", "0.5748154", "0.5715578", "0.5715578", "0.5704997...
0.6518418
0
Gives the sibling after this file. `null` if it doesn't exist
get nextSibling() { if (!this.parent) return null; const idx = this.parent.children.indexOf(this); if (this.parent.children.length > idx + 1) return this.parent.children[idx + 1]; return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "nextSibling() { return this.sibling(1); }", "function nextSibling(){\n\tif(!this.parentNode){ return void 0;}\n\tvar siblings = this.parentNode._children;\n\tvar idx = siblings.indexOf(this);\n\treturn (idx>=0 ? siblings[idx+1] : null);\n}", "nextSibling() {\n return this.getSibling(true);\n }", "g...
[ "0.6183644", "0.6119494", "0.6083626", "0.598565", "0.584874", "0.5839279", "0.58231825", "0.58082557", "0.58082557", "0.57510996", "0.56830186", "0.56774575", "0.5667693", "0.5574647", "0.5541883", "0.55237293", "0.5487933", "0.54775614", "0.5471923", "0.5471923", "0.5439924...
0.65182376
0
the callback function to be run when the server response comes in. this callback assumes a chunked response, with several 'data' events and one final 'end' response.
function getServerResponse(response) { // when the final chunk comes in, print it out: response.on('end', function (data) { console.log(data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getServerResponse(response) {\n // when the final chunk comes in, print it out:\n response.on('end', function (data) {\n console.log(data);\n });\n}", "function callback(response) {\n var result = ''; // string to hold the response\n\n // as each chunk comes in, add it to the result st...
[ "0.7398147", "0.7123974", "0.70686555", "0.68945396", "0.68391126", "0.67294896", "0.66762054", "0.6548653", "0.6518528", "0.64469445", "0.64165574", "0.6384483", "0.63431036", "0.63431036", "0.63431036", "0.62756425", "0.6246934", "0.62338406", "0.6204958", "0.6188424", "0.6...
0.74055636
0
console.log(abbFunction('Judith Ugochi Iwuchi')); Write a function that takes a fullname and returns a shorter version of the name. The function should return the abbreviated output by returning a string that con tains the first letter of each name followed by a period and the complete last name.
function abbreFunction(fullname) { let array = fullname.split(' '); let result = ''; for (let i = 0; i < array.length - 1; i++) { array[i][0]; result += array[i][0] + ' '; } result += '. ' + array[2]; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function abbFunction(fullname) {\n let array = fullname.split(' ');\n let result = array[0];\n for (let i = 1; i < array.length; i++) {\n result += ' ' + array[i][0];\n }\n result += '. ';\n return result;\n}", "function abbrevName(name){\n// Crete variable that is an array that is split...
[ "0.8238774", "0.7895886", "0.7660475", "0.76109254", "0.76098436", "0.75521636", "0.73952174", "0.7354576", "0.7348505", "0.7344707", "0.7288583", "0.7274349", "0.72697747", "0.72535056", "0.7252462", "0.7223887", "0.72005355", "0.71909475", "0.7188172", "0.7180694", "0.71111...
0.7957513
1
=== Thm scroll anim===
function thmScrollAnim() { if ($('.wow').length) { var wow = new WOW({ mobile: false }); wow.init(); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleScroll(e) {\n this.animateTimeline();\n }", "function animateScroll(t,n,i,e,a,r){e=e?e:0;var o=document.documentElement,s=o.clientHeight,u=\"scrollMaxY\"in window?window.scrollMaxY:o.scrollHeight-s,c=window.pageYOffset,l=c,h=isNaN(t)?t.getBoundingClientRect():0;\"center\"===a?(l+=isNaN(t)?h.top+h.heigh...
[ "0.736698", "0.7283178", "0.7195918", "0.719517", "0.7015521", "0.69780475", "0.6966233", "0.6936686", "0.6901093", "0.6872711", "0.68709415", "0.68602794", "0.68498766", "0.68498766", "0.67830455", "0.6755476", "0.6716159", "0.66619676", "0.66412526", "0.66285783", "0.662617...
0.7460904
1
Randomly distribute particles in a disk shape ==================================================================================================
function seed_particles(parts, num) { var center_x = nx / 2; var center_y = ny / 2; var radius = min(nx / 2, ny / 2); for (var p=0; p<num; ++p) { var rangle = random() * TWO_PI; var rdist = random() * radius; parts[p] = {"x": center_x + cos(rangle) * rdist, "y": center_y + sin(rangle) * rdist, "len"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__createParticles() {\n let numberOfParticles = (this.cnv.height * this.cnv.width) / 10000;\n for (let i = 0; i < numberOfParticles * this.particlesSettings.numberMultiplier; i++) {\n let size = (Math.random() * this.particlesSettings.size) + 1;\n let x = ( Math.random() * ((win...
[ "0.6859675", "0.6705805", "0.6683778", "0.6631336", "0.66098744", "0.6546307", "0.6417473", "0.6411797", "0.63865143", "0.6342747", "0.62934226", "0.6276326", "0.6256972", "0.62459874", "0.6244139", "0.62384313", "0.62086004", "0.62055254", "0.61679584", "0.61669904", "0.6166...
0.7189838
0
Calculate the potential at a point in 2D space and time (in this case just some 2D perlin noise) ================================================================================================== It's scaled relative to the distance from the center to keep particles from flying out
function get_potential(x, y, res_x, res_y, time) { var distmult = pow(1 / (min(res_x, res_y)/2), 2); var dist_center = max(1 - (pow(x - res_x/2, 2) + pow(y - res_y/2, 2)) * distmult, 0); return (noise(x*detail, y*detail, time) * 2 - 1) * pot_scale * dist_center; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "distanceSquaredTo(point) {\n const offset = scratchOffset.copy(point).subtract(this.center);\n\n const halfAxes = this.halfAxes;\n const u = halfAxes.getColumn(0, scratchVectorU);\n const v = halfAxes.getColumn(1, scratchVectorV);\n const w = halfAxes.getColumn(2, scratchVectorW);\n\n const uHalf...
[ "0.6401955", "0.6033916", "0.6011041", "0.5903637", "0.5890131", "0.587032", "0.58307594", "0.5779309", "0.5747745", "0.56266195", "0.5598314", "0.5535681", "0.55325663", "0.55093944", "0.54887503", "0.5476851", "0.5476322", "0.54526865", "0.5447092", "0.5434178", "0.54340106...
0.67649025
0
Update the velocity field, advect the particles through it and draw them ==================================================================================================
function draw() { // Update velocities vel_from_pot(vel, nx, ny); // Fade effect for the trails fill(0, 0, 0, 1); noStroke(); rect(0,0,width,height); // Loop through the particles for (var p=0; p<num_particles; ++p) { // Advect the particle through the velocity field advect_particle(particles[p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function particleUpdate() {\n if (this.bFixed == false) {\n this.vx *= this.damping;\n this.vy *= this.damping;\n \n this.limitVelocities();\n this.handleBoundaries();\n this.px += this.vx;\n this.py += this.vy;\n }\n}", "update() {\r\n this.draw(); // call dra...
[ "0.7491537", "0.7361908", "0.72863793", "0.7284165", "0.72236973", "0.70930576", "0.704859", "0.70359504", "0.70292515", "0.6955868", "0.69504416", "0.6937556", "0.6917423", "0.68620235", "0.68620235", "0.6846669", "0.6841508", "0.6835386", "0.68320125", "0.6823441", "0.68006...
0.7604813
0
Bilinear sampling of a 2D field of 2D vectors ==================================================================================================
function sample_2d(arr, x, y, res_x, res_y) { x = min(max(x, 0), res_x-2); y = min(max(y, 0), res_y-2); var ix = floor(x); var iy = floor(y); var s0 = arr[IX(ix, iy )]; var s1 = arr[IX(ix+1, iy )]; var s2 = arr[IX(ix, iy+1)]; var s3 = arr[IX(ix+1, iy+1)]; var tx = x - ix; var ty = y - iy; va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bilinear(v00, v01, v10, v11, x, y) {\n\tvar v0x = (v01 - v00) * x + v00;\n\tvar v1x = (v11 - v10) * x + v10;\n\tvar vxy = (v1x - v0x) * y + v0x;\n\treturn vxy;\n}", "sampleBilinear(u, v) {\n\t\tconst x = u * this.width;\n\t\tconst y = v * this.height;\n\n\t\tconst loX = Math.floor(x);\n\t\tconst hiX = l...
[ "0.704938", "0.63206714", "0.6182507", "0.5686373", "0.56676537", "0.5461892", "0.53173995", "0.529644", "0.5290971", "0.5290971", "0.5290543", "0.52418536", "0.519361", "0.514102", "0.50960004", "0.50507236", "0.5039887", "0.49899587", "0.4977853", "0.4944644", "0.49283475",...
0.6391402
1
these are the final functions for drawing a stick figure / global line, circle, rad, arc draws a stick figure on the canvas the stick figure will stand over the point X,Y facing is a degree in which the stick figure is facing: 0 is to the right, 90 is towards us distance is the distance walked; a new step starts every ...
function drawStickFigure(c, x, y, facing, distance) { // because of the way the canvas works, it's best to draw lines at half-pixels x+=0.5; y+=0.5; // body is just a line line(c, x, y-40, x, y-80); // body // the arms and the legs look the same drawLimbs(c, x, y, distance); // legs drawLimbs(c, x, y-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disp_setup(){\n ctx.beginPath()\n ctx.arc(200,235,150,7*Math.PI/6,11*Math.PI/6,false)\n ctx.stroke()\n \n ctx.beginPath()\n ctx.moveTo(200,235)\n ctx.lineTo(70,160)\n ctx.stroke()\n \n ctx.beginPath()\n ctx.moveTo(200,235)\n ctx.l...
[ "0.6776504", "0.66543007", "0.66509545", "0.65929735", "0.6561579", "0.64674574", "0.64402497", "0.64395297", "0.6353548", "0.63292754", "0.63230664", "0.6280196", "0.6262032", "0.6260787", "0.62599176", "0.6249034", "0.6247793", "0.62338036", "0.6213218", "0.61829245", "0.61...
0.68750244
0
face draws the limbs; with the `distance` parameter, the limbs are drawn as an inmotion snapshot
function drawLimbs(c, x, y, distance) { // eslint-disable-line no-shadow // at rest, the legs are spread by 2*20 pixels // (the front leg is 20 pixels in front, the back leg is 20 pixels behind) let spread = 20; // if we have a distance parameter, we are moving (otherwise we are at rest) if (distan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawStickFigure(c, x, y, facing, distance) {\n // because of the way the canvas works, it's best to draw lines at half-pixels\n x+=0.5;\n y+=0.5;\n\n // body is just a line\n line(c, x, y-40, x, y-80); // body\n\n // the arms and the legs look the same\n drawLimbs(c, x, y, distance); // legs\n dra...
[ "0.5882518", "0.57004625", "0.5639661", "0.5576398", "0.5560555", "0.55514085", "0.55086875", "0.549951", "0.549657", "0.5490165", "0.5468567", "0.54571426", "0.5390135", "0.5383082", "0.53816116", "0.5338289", "0.53355205", "0.533489", "0.5332253", "0.5327868", "0.53098255",...
0.5853391
1