Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
this function connects to our database, then starts the server
function runServer(databaseUrl=DATABASE_URL, port=PORT) { return new Promise((resolve, reject) => { mongoose.connect(databaseUrl, err => { if (err) { return reject(err); } server = app.listen(port, () => { console.log(`Your app is listening on port ${port}`); resolve(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start() {\n\n\tMongoClient.connect(settings.MONGO_CONNECTION_STRING, function (err, database) {\n\t\tif (err) {\n\t\t\tlog.error(err, 'Couldn\\'t connect to MongoDB. Did you start it?\\n' +\n\t\t\t\t'Try running `mongod` in another terminal window.');\n\t\t\tlog.error('Killing server process');\n\t\t\t// ...
[ "0.7422377", "0.7178266", "0.71676046", "0.7120612", "0.709689", "0.7026487", "0.6909485", "0.67506033", "0.67476386", "0.6623897", "0.66052973", "0.658141", "0.65450144", "0.65346646", "0.65305245", "0.6530326", "0.6518998", "0.645811", "0.6456917", "0.6449112", "0.64377123"...
0.0
-1
like `runServer`, this function also needs to return a promise. `server.close` does not return a promise on its own, so we manually create one.
function closeServer() { return new Promise((resolve, reject) => { console.log('Closing server'); server.close(err => { if (err) { reject(err); // so we don't also call `resolve()` return; } resolve(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async close() {\r\n\t\tconst close = util.promisify(this.httpServer.close).bind(this.httpServer);\r\n\t\treturn close();\r\n\t}", "function runServer() {\n const port = process.env.PORT || 8080;\n return new Promise((resolve, reject) => {\n server = app.listen(port, () => {\n console.log(`Your app is l...
[ "0.6954903", "0.6642822", "0.6545763", "0.6545763", "0.64256996", "0.6322857", "0.63090783", "0.63090783", "0.63090783", "0.63090783", "0.6308963", "0.6308963", "0.627102", "0.6236078", "0.62221116", "0.6210851", "0.6177554", "0.6170987", "0.61630434", "0.6160247", "0.6151976...
0.73711395
2
this method is called when your extension is deactivated
function deactivate() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivat...
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", "0.7342692", ...
0.73553675
49
Create a function that displays a Thank You for Meditating message if the User completes the meditation time.
function thankYou() { 'use strict'; // Get the element where the message will be displayed. var overlay = $('overlay'); // Show the element: overlay.style.display = 'block'; // Make the element disappear. setTimeout( function() { overlay.style.display = 'none'; }, 10000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_thank()\n{\n only_thankyou=1;\n}", "function updateMessage() {\n if (glassesAmount === 0) {\n messageParagraph.innerText = `Take your first glass of water of the day, please...`;\n removeTimerMessage();\n\n } else if (glassesAmount === 8) {\n messageParagraph.innerText = `Congratulati...
[ "0.68328327", "0.6088257", "0.60636765", "0.60554385", "0.60518235", "0.6026598", "0.6022459", "0.59927666", "0.59878194", "0.597376", "0.5970458", "0.5927684", "0.5903947", "0.5903339", "0.5887055", "0.58635813", "0.5833452", "0.58151585", "0.5795039", "0.5794546", "0.578947...
0.64845246
1
Calculate the total time
function calculateTotalTime() { for ( var i = 0, count = times.length; i < count; i++ ) { totalTime += +times[i].time; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "get total_time() { return this._total_time; }", "function calculateTime() {\n displayTime(Date.now() -...
[ "0.79914474", "0.79096437", "0.761379", "0.7520096", "0.72588086", "0.71568763", "0.70869756", "0.70869756", "0.70869756", "0.7075797", "0.70598245", "0.7041978", "0.70059353", "0.6959423", "0.695754", "0.686505", "0.68470216", "0.682821", "0.6808649", "0.67984766", "0.678399...
0.8394038
1
Get the canvas size
function setCanvasSize() { // Get the screen height and width screenHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight; screenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCSSSize(canvas) {\n return {\n width: canvas.clientWidth,\n height: canvas.clientHeight\n };\n}", "function height() {\n return canvas.height;\n }", "function canvasSize(target) { \n\t\t\t\t\t//var height = parseFloat(d3.select(target).node().clientHeight)\n\t\t\t\t\tvar width = p...
[ "0.7547369", "0.7411399", "0.73407084", "0.72923946", "0.7233141", "0.72012186", "0.719847", "0.70474696", "0.6997899", "0.696164", "0.6954182", "0.692022", "0.69092864", "0.69010746", "0.68191725", "0.67961794", "0.6794216", "0.67938286", "0.6784222", "0.6779677", "0.6716137...
0.67079055
21
Draw a circle on the canvas
function drawTimer() { // Clear the canvas context.clearRect( 0, 0, canvasSide, canvasSide ); center = canvasSide/2; radius = center - lineThickness - timerPadding; // Red circle context.beginPath(); context.strokeStyle = '#8C8255'; context.fillStyle = '#D0CFD7'; context.lineWidth = lineThick...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCircle(){\n //ctx.beginPath();\n ctx.arc(100, 75, 50, 0, 2 * Math.PI);\n ctx.stroke();\n }", "function drawCircle(){\nctx.fillStyle = 'green'\nctx.beginPath()\nctx.arc(canvas.width/2, canvas.height/2, canvas.height/4, 0, Math.Pi * 2, false)\nctx.fill()\n}", "function drawCircle(ctx, x, y...
[ "0.8267228", "0.8200815", "0.8085803", "0.80413884", "0.79817396", "0.79682595", "0.79308015", "0.79116666", "0.7908185", "0.79077953", "0.79070765", "0.7826135", "0.782417", "0.781921", "0.78122705", "0.77654546", "0.77650636", "0.775198", "0.7744877", "0.7726505", "0.772322...
0.0
-1
Calculate the degrees around the circle
function calculateDegrees( t ) { return (t/totalTime) * 360; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function radiansToDegree(r){\n return r * 180 / Math.PI;\n}", "function degrees(xx) {return (180.0 * xx / Math.PI);}", "function degreeToRadians(n){\n return (n / 180 * Math.PI).toFixed(2);\n}", "function radianToDegree(rad) {\n return rad * 180 / Math.PI;\n}", "function toDegrees(angle){return an...
[ "0.7708743", "0.75862366", "0.75698334", "0.74739397", "0.7452374", "0.7431962", "0.7424133", "0.7388311", "0.73720056", "0.73103184", "0.7265696", "0.72567743", "0.72558844", "0.7243289", "0.7242257", "0.7236496", "0.72337604", "0.7223811", "0.7220486", "0.71820825", "0.7176...
0.7092314
29
Calculate the total time
function calculateTotalTime() { for ( var i = 0, count = times.length; i < count; i++ ) { totalTime += +times[i].time; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "get total_time() { return this._total_time; }", "function calculateTime() {\n displayTime(Date.now() -...
[ "0.79914474", "0.79096437", "0.761379", "0.7520096", "0.72588086", "0.71568763", "0.70869756", "0.70869756", "0.70869756", "0.7075797", "0.70598245", "0.7041978", "0.70059353", "0.6959423", "0.695754", "0.686505", "0.68470216", "0.682821", "0.6808649", "0.67984766", "0.678399...
0.8394038
0
Create a div with an id
function createCanvas( elementId, parentElement ) { if ( $(elementId) ) { var elem = $(elementId); } else { var elem = document.createElement('canvas'); elem.id = elementId; parentElement.appendChild(elem); } return elem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDiv(div_id, div_class){\n let temp = document.createElement('div');\n temp.id = div_id;\n temp.className = div_class;\n return temp;\n}", "function CreateDIV(win, id) {\n var div = MaybeGetElement(win, id);\n if (!div) {\n div = AppendNewElement(win, win.document.body, \"div\");\n ...
[ "0.7893585", "0.7865542", "0.78563565", "0.78276104", "0.7772477", "0.773511", "0.7711506", "0.7640931", "0.7634219", "0.7634066", "0.7460113", "0.7384106", "0.7319373", "0.727668", "0.72427934", "0.71982574", "0.71982574", "0.71241575", "0.7055817", "0.70003104", "0.6995601"...
0.0
-1
Get the canvas size
function setCanvasSize() { // Get the screen height and width screenHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight; screenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCSSSize(canvas) {\n return {\n width: canvas.clientWidth,\n height: canvas.clientHeight\n };\n}", "function height() {\n return canvas.height;\n }", "function canvasSize(target) { \n\t\t\t\t\t//var height = parseFloat(d3.select(target).node().clientHeight)\n\t\t\t\t\tvar width = p...
[ "0.7547369", "0.7411399", "0.73407084", "0.72923946", "0.7233141", "0.72012186", "0.719847", "0.70474696", "0.6997899", "0.696164", "0.6954182", "0.692022", "0.69092864", "0.69010746", "0.68191725", "0.67961794", "0.6794216", "0.67938286", "0.6784222", "0.6779677", "0.6716137...
0.67079055
22
Draw a circle on the canvas
function drawTimer() { // Clear the canvas context.clearRect( 0, 0, canvasSide, canvasSide ); center = canvasSide/2; radius = center - lineThickness - timerPadding; // Red circle context.beginPath(); context.strokeStyle = '#979797'; context.fillStyle = '#7B0B0B'; context.lineWidth = lineThick...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCircle(){\n //ctx.beginPath();\n ctx.arc(100, 75, 50, 0, 2 * Math.PI);\n ctx.stroke();\n }", "function drawCircle(){\nctx.fillStyle = 'green'\nctx.beginPath()\nctx.arc(canvas.width/2, canvas.height/2, canvas.height/4, 0, Math.Pi * 2, false)\nctx.fill()\n}", "function drawCircle(ctx, x, y...
[ "0.8267228", "0.8200815", "0.8085803", "0.80413884", "0.79817396", "0.79682595", "0.79308015", "0.79116666", "0.7908185", "0.79077953", "0.79070765", "0.7826135", "0.782417", "0.781921", "0.78122705", "0.77654546", "0.77650636", "0.775198", "0.7744877", "0.7726505", "0.772322...
0.0
-1
Add ticks to mark end of preparation time and beginning of cool down time
function addTicks() { // Add a tick for preparation time if ( times[0].time > 0 && elapsed < times[0].time ) { drawTick( times[0].time ); } if ( times[2].time > 0 && elapsed < (totalTime - times[2].time) ) { drawTick( totalTime - times[2].time ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustTicks(evt, obj) {\n //Using adjustTM attribute to adjust the \n //number of major ticks to a best feasible value\n if(adjustTickCB.checked) {\n cpuGauge.setChartAttribute('adjustTM', 1);\n }\n else{\n cpuGauge.setChartAttribute('adjustTM', 0);...
[ "0.6037128", "0.6034696", "0.60222864", "0.60187846", "0.5991092", "0.59690243", "0.5954175", "0.5896089", "0.58322453", "0.58117557", "0.5721435", "0.56773525", "0.56541646", "0.5599639", "0.55802476", "0.5566873", "0.5530081", "0.5525324", "0.5521299", "0.5515315", "0.55116...
0.71423066
0
Calculate the degrees around the circle
function calculateDegrees( t ) { return (t/totalTime) * 360; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function radiansToDegree(r){\n return r * 180 / Math.PI;\n}", "function degrees(xx) {return (180.0 * xx / Math.PI);}", "function degreeToRadians(n){\n return (n / 180 * Math.PI).toFixed(2);\n}", "function radianToDegree(rad) {\n return rad * 180 / Math.PI;\n}", "function toDegrees(angle){return an...
[ "0.7708743", "0.75862366", "0.75698334", "0.74739397", "0.7452374", "0.7431962", "0.7424133", "0.7388311", "0.73720056", "0.73103184", "0.7265696", "0.72567743", "0.72558844", "0.7243289", "0.7242257", "0.7236496", "0.72337604", "0.7223811", "0.7220486", "0.71820825", "0.7176...
0.7092314
28
Check to see whether to play the gong
function checkGong() { // Is there a prep time? if ( times[0].time > 0 && times[0].gonged == false && elapsed >= times[0].time ) { times[0].gonged = true; gong.play(); } // Is there a cool down time? else if ( times[2].time > 0 && times[1].gonged == false && (totalTime - elapsed) <= ( times[2].time ) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_bot_playing() {\r\n\treturn voice_handler !== null;\r\n}", "IsPlaying() {}", "function checkGameStatus() {\n if (!gGame.isOn && gGame.shownCount === 0) {\n gStartTime = Date.now();\n gGameInterval = setInterval(showTime, 1000)\n gGame.isOn = true;\n } else return false;\n...
[ "0.70974654", "0.68905586", "0.68326837", "0.67303616", "0.6656011", "0.65981406", "0.65878636", "0.6575059", "0.6542933", "0.6509033", "0.6492582", "0.6485444", "0.64789224", "0.6435963", "0.6415659", "0.63961315", "0.6392008", "0.6343052", "0.6332555", "0.627947", "0.627823...
0.7877081
0
Show the modal layer
function showModal() { timer.className = 'modalTimer' ; modal.className = 'modal-visible' ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show(){\n\t\tthis.modalShadow.show();\n\t\tthis.modalBody.show();\n\t}", "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "function show() {\n // Add background overlay when a modal is appeared\n bg = document.createElement(\"div\");\n bg.setAttribute(\"id\", \...
[ "0.82073873", "0.7712813", "0.74863666", "0.7444895", "0.73988616", "0.7357224", "0.73412967", "0.73191625", "0.7245518", "0.722878", "0.72153175", "0.7195703", "0.7159128", "0.7159128", "0.71588385", "0.7134606", "0.7130324", "0.71113837", "0.7107514", "0.70886487", "0.70587...
0.0
-1
NO CANVAS Create the function that displays the meditation timer and counts the time.
function noCanvasMeditation(e) { 'use strict'; if (typeof e == 'undefined') e = window.event; // Make sure the overlay is hidden $('overlay').style.display = 'none'; // Get DOM elements var modal = $('modal'); var timer = $('timer'); var endLink = $('end-meditation'); var stopped = false; // Get form valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runTimer() {\n var displayText = runCounters(true)\n document.getElementById('timer-window').innerHTML = displayText\n}", "function displayTimer(){\n\t\tif(!timerOn){\n\t\t\treturn;\n\t\t}\n\t\tdocument.getElementById(\"numeric\").innerHTML=\"<h1>\"+count+\"</h1>\";\n\t\tdocument.bgColor = window....
[ "0.69332", "0.67522573", "0.6671292", "0.6658696", "0.66494113", "0.6635267", "0.6568702", "0.65636444", "0.655693", "0.6538679", "0.6530267", "0.652919", "0.65261215", "0.6509012", "0.6505747", "0.65036225", "0.6480018", "0.6479184", "0.6471749", "0.64546466", "0.6451228", ...
0.0
-1
Create a div with an id
function createDiv( elementId, parentElement ) { if ( $(elementId) ) { var div = $(elementId); } else { var div = document.createElement('div'); div.id = elementId; parentElement.appendChild(div); } return div; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDiv(div_id, div_class){\n let temp = document.createElement('div');\n temp.id = div_id;\n temp.className = div_class;\n return temp;\n}", "function CreateDIV(win, id) {\n var div = MaybeGetElement(win, id);\n if (!div) {\n div = AppendNewElement(win, win.document.body, \"div\");\n ...
[ "0.7893585", "0.7865542", "0.78563565", "0.78276104", "0.7772477", "0.773511", "0.7711506", "0.7640931", "0.7634219", "0.7460113", "0.7384106", "0.7319373", "0.727668", "0.72427934", "0.71982574", "0.71982574", "0.71241575", "0.7055817", "0.70003104", "0.6995601", "0.6988061"...
0.7634066
9
Convert seconds to m:ss for display
function convertTimeToMinutes( time ) { var min = 0, sec = '00'; if ( ( time % 60 ) < 10 ) { sec = '0' + Math.floor( time % 60 ); } else { sec = Math.floor( time % 60 ); } if (time > 60) { min = Math.floor( time / 60 ); } return min + ':' + sec; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#secondsToTime(s) {\r\n\t\tlet momentTime = moment.duration(s, 'seconds');\r\n\t\tlet sec = momentTime.seconds() < 10 ? ('0' + momentTime.seconds()) : momentTime.seconds();\r\n\t\tlet min = momentTime.minutes() < 10 ? ('0' + momentTime.minutes()) : momentTime.minutes();\r\n\r\n\t\treturn `${min}:${sec}`;\r\n\t}", ...
[ "0.796236", "0.7878488", "0.7820942", "0.7815193", "0.7803345", "0.7740842", "0.7728907", "0.77115524", "0.7694678", "0.76933", "0.7684029", "0.76817167", "0.76679087", "0.76633185", "0.7648385", "0.76435363", "0.76407516", "0.76270115", "0.7586301", "0.7582818", "0.75810224"...
0.0
-1
Increment the progress bar
function showProgress( time, elapsed ) { progressBar.style.height = ( 100 - ((elapsed/time) * 100 )) + '%'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increment() {\n let maxWidth = document.getElementById('progress-bar').offsetWidth;\n let currentWidth = document.getElementById('my-progress').offsetWidth;\n let newWidth = currentWidth + maxWidth * .1;\n document.getElementById('my-progress').style.width = `${newWidth}px`;\n let progressT...
[ "0.8293648", "0.7975323", "0.7946823", "0.7789385", "0.74957645", "0.73245114", "0.7321224", "0.73067945", "0.73052865", "0.7258726", "0.7246975", "0.71901065", "0.7098178", "0.70416427", "0.7041244", "0.70057577", "0.69780797", "0.696097", "0.69565845", "0.69533813", "0.6921...
0.0
-1
Function to count up to the full time for the section
function countTime( time ) { gong.play(); // Record the start time var start = new Date(); var elapsed = 0; var int = setInterval( function() { var now = new Date(); elapsed = (now - start)/1000; currentDisplayTime.innerHTML = convertTimeToMinutes(elapsed); showProgress( time, elapsed ); if ( e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count() {\n if (timeRemaining > 0) {\n timeRemaining--;\n $(\"#time-display\").text(\"Time Remaining: \" + timeRemaining + \" Seconds\");\n } else {\n unansweredNumber++;\n questionsCompleted++;\n clearInterval(intervalId);\n clearScreen();\n timesUpPrint();\n ...
[ "0.6676751", "0.6624856", "0.65659034", "0.6485614", "0.6484942", "0.64132303", "0.640483", "0.63906354", "0.6381164", "0.63666916", "0.634221", "0.63385415", "0.6338387", "0.6324496", "0.63239884", "0.6314355", "0.6287138", "0.6279818", "0.6264404", "0.62582827", "0.6257987"...
0.70053095
0
Function to get the next section of the meditation
function startNextSection() { for ( var i = 0, count = times.length; i < count; i+=1 ) { if ( times[i].time > 0 && i > currentSection ) { currentSection = i; resetTimer( times[i].time, times[i].title ); countTime( times[i].time ); return; } } closeMeditation(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "nextSection() {\n const sections = this.sections;\n const shouldLoopNavigation = this.getLoopNavigationAttribute(this.activeRegion);\n if (\n this.modalIsOpen ||\n this.popupIsOpen ||\n !sections ||\n !sections.length ||\n (!shouldLoopNavi...
[ "0.6699557", "0.6568023", "0.64401054", "0.6292188", "0.61262274", "0.6068505", "0.60433507", "0.5993141", "0.5927284", "0.59085256", "0.5821848", "0.5819629", "0.57522076", "0.57395077", "0.5707773", "0.5641396", "0.562988", "0.562628", "0.5626139", "0.5625552", "0.5613419",...
0.603787
7
Patterns to identify here: 1. We've got iteration happening. 2. We need to use the values array to figure out the 'score' for each letter. 3. We want to accumulate scores for the whole word into a single variable.
function scrabble(word, values) { var total = 0; // todo: to lower case for (var i = 0; i < word.length; i++) { // Finding the score for each letter. // Only add points if there is a score defined. if (values[word[i]] !== undefined) { total += values[word[i]]; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrabbleScore(word) {\n word = word.toUpperCase();\n let letterScore = 0;\n\n for (let i = 0; i < word.length; i++) {\n\t for (const pointValue in newPointStructure) {\n \n if (pointValue.includes(word[i])) {\n letterScore += Number(newPointStructure[pointValue]) \n }\n \n\t }\n\t}...
[ "0.7131889", "0.68606544", "0.6681001", "0.6668793", "0.6513461", "0.64800036", "0.63964975", "0.63867867", "0.63121325", "0.6275045", "0.62625164", "0.62038565", "0.61439025", "0.609056", "0.6071114", "0.604348", "0.6021391", "0.59744865", "0.5935986", "0.5906343", "0.586260...
0.7569339
0
now this set of code will do the query into the DOM only once
constructor() { let $=document.querySelector.bind(document); this._inputData = $('#data'); this._inputQuantidade = $('#quantidade'); this._inputValor = $('#valor'); this._listaNegociacoes = new ListaNegociacoes(model => this._negociacoesView.update(model)); this._negoci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cacheDom() {\n DOM.$consultanttablebody = $(\"#consultanttablebody\");\n DOM.$clientMenu = $(\"#clientmenu\");\n DOM.$document = $(document);\n }", "loadNext() {\n if (this.isSearch) {\n return;\n }\n if (this.__makingQuery) {\n return;\n }\n this.__makingQuery = true;...
[ "0.6045492", "0.5825988", "0.5807269", "0.5690035", "0.5647931", "0.5603117", "0.5566409", "0.55263966", "0.54886514", "0.5487489", "0.54872024", "0.547129", "0.54602575", "0.5448322", "0.54454845", "0.5444908", "0.5432416", "0.53709775", "0.5368787", "0.5358904", "0.5358904"...
0.0
-1
Y := (coor.Y offset)
function sliderPos(Y) { return Math.floor(Y / sliderHeight * maxPos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenerPosInicialY(){\n return (parseFloat(ball.style.top)*tablero.clientHeight/100);\n}", "function get_point_y(c) {\n\treturn 94 + c * 75;\n}", "function yOnCanvas(y){\r\n\treturn sciMonk.CanvasHeight - (sciMonk.CanvasHeight/sciMonk.Height)*y;\r\n}", "get adjustedY() { return this.y - this.orig...
[ "0.69169194", "0.6745806", "0.67267805", "0.6691393", "0.6661252", "0.65942574", "0.6561899", "0.6513396", "0.64528906", "0.6450524", "0.64463425", "0.6349765", "0.6348779", "0.6323056", "0.63198966", "0.6315569", "0.63053477", "0.62923753", "0.62871516", "0.6275334", "0.6269...
0.0
-1
Write array of bookmarks in let lb = listOfBookmarks Add bookmarks in slider sync
function loadBookmarks(bm) { let lb = $("#listOfBookmarks"); //debug(bm); // bm and slider clear lb.empty(); sliderBookMarks.empty(); bm.sort((a, b) => { if (+a.pos > +b.pos) return 1; if (+a.pos < +b.pos) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBookmarks() {\n bookmarksList.forEach((value) => {\n // Create a new div for bookmark to add it to the document\n const bookmark = document.createElement('div');\n bookmark.classList.add('bookmark');\n bookmark.setAttribute('data-index', value.id);\n // Set its innerHTML\n bookmar...
[ "0.73912716", "0.7235241", "0.72324497", "0.65960974", "0.65543735", "0.6521706", "0.6487406", "0.63737965", "0.6358657", "0.63398606", "0.62749094", "0.62644905", "0.6250098", "0.6161355", "0.61101145", "0.61052203", "0.60032666", "0.5993959", "0.5947267", "0.59422797", "0.5...
0.6559476
4
METODO PARA CREAR UNA FACTURA
async createfacture(req,res){ const item = req.body; //Validar informacion enviada por el usuario const { error } = facturaval(item); if (error) return res.status(400).send(error.details[0].message); //Validar si ya existe el mismo numero const numerodefactura = await...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function criarObjetoFis(_objeto) {\n var objeto = _objeto;\n switch (objeto) {\n case \"Esfera\":\n {\n try {\n if (document.getElementById(\"MassaEsfera\").value === \"\" || document.getElementById(\"MassaEsfera\").value <= 0) {\n alert(\"O valor da...
[ "0.62656057", "0.61901754", "0.61426187", "0.59995604", "0.59612584", "0.59281516", "0.5926803", "0.5870031", "0.58493745", "0.5841265", "0.5840257", "0.58386856", "0.58369064", "0.5797262", "0.57886964", "0.5775715", "0.5768349", "0.5764344", "0.57532454", "0.5740311", "0.57...
0.0
-1
METODO PARA OBTENER UNA FACTURA
async getfacture(req, res) { try { const id = req.params.id; const facture = await Facture.findAll({ where: { id: id }, }); if (facture.length >= 1) return res.status(200).send(facture); return res.status(404).send("facture with id"+id+"not found"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fm(){}", "function ondea(){\n /* REFIERE AL TÍTULO */ \n var titulo = document.querySelector(\"h1\"); \n /* CAPTURA EL CONTENIDO DEL TÍTULO */\n var texto = titulo.innerHTML; \n /* MIDE EL TAMAÑO DEL TÍTULO */\n var ancho = 700; \n var alto = 120; \n\n /*SIEMPRE AJUSTA EL ancho COMO MÚLTIPLO DE ...
[ "0.60860085", "0.60788804", "0.60479826", "0.59501296", "0.5906522", "0.58851916", "0.58760583", "0.5875929", "0.5864791", "0.58543247", "0.58482397", "0.58368593", "0.58318627", "0.5829903", "0.5814326", "0.58138365", "0.58009136", "0.5797947", "0.57888913", "0.577269", "0.5...
0.0
-1
METODO PARA OBTENER TODAS LAS FACTURAS
async getAllfacturies(req, res) { try { const facture = await Facture.findAll({ }); if (facture.length >= 1) return res.status(200).send(facture); return res.status(404).send("factures not found"); } catch (error) { res.status(500).send(error); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fa () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.f();\n\t}", "function frutas(fruta1, fruta2, ...restoDeFrutas){ //el ...variable va a crear un arr con el contendio de las frutas q ponga de mas\n\tporConsola(\"fruta: \" + fruta1);\n\tporConsola(\"fruta: \" + fruta2);\n\tporConsola(restoDeFrutas);\n}", "fun...
[ "0.58914316", "0.58046275", "0.5765774", "0.5678973", "0.56619084", "0.5535512", "0.55240077", "0.5517327", "0.55132824", "0.54783887", "0.546186", "0.54560024", "0.5436488", "0.54297507", "0.541909", "0.5415392", "0.54046017", "0.53736085", "0.5372074", "0.53482157", "0.5345...
0.0
-1
METODO PARA ACTUALIZAR UNA FACTURA
async upadatefacture(req, res) { try { const id = req.params.id; const facture = await Facture.update(req.body, { where: { id: id }, }); if (facture == 1) return res.status(200).send("facture updated succesfully"); return res ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dibujarFresado111(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\t\n\t//sacar el mayor ...
[ "0.63433117", "0.63379645", "0.633574", "0.6327003", "0.6321006", "0.63155687", "0.6303153", "0.62709117", "0.62556833", "0.625168", "0.62502146", "0.6237541", "0.6235877", "0.6210268", "0.6195525", "0.6188622", "0.61852705", "0.61743164", "0.6173688", "0.6166736", "0.6132869...
0.0
-1
METODO PARA ELIMINAR UNA FACTURA
deletefacture(req, res) { try { const id = req.params.id; Facture.destroy({ where: { id: id }, }).then((num) => { if (num == 1) return res.status(200).send("facture was deleted succesfully"); return res .status(404) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ondea(){\n /* REFIERE AL TÍTULO */ \n var titulo = document.querySelector(\"h1\"); \n /* CAPTURA EL CONTENIDO DEL TÍTULO */\n var texto = titulo.innerHTML; \n /* MIDE EL TAMAÑO DEL TÍTULO */\n var ancho = 700; \n var alto = 120; \n\n /*SIEMPRE AJUSTA EL ancho COMO MÚLTIPLO DE anchoFaja EN PIXELES*...
[ "0.62557405", "0.60608965", "0.60597646", "0.6032892", "0.6020702", "0.601462", "0.6011908", "0.6006633", "0.60000956", "0.59836555", "0.59778684", "0.59650624", "0.59619313", "0.59493643", "0.59472543", "0.5942788", "0.59321773", "0.59312534", "0.59261745", "0.5882152", "0.5...
0.0
-1
helper function to pull the next source or end the dest
function nextOrEnd() { var next = dest._buffer.shift(); dest._pipeCount -= 1; if (typeof next === 'function') { next(true); } else if (dest._pipeCount <= 0) { dest.end(); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextOrEnd () {\n var next = dest._buffer.shift();\n dest._pipeCount -= 1;\n\n if (typeof next === 'function') {\n next();\n } else if (dest._pipeCount <= 0) {\n dest.end();\n }\n }...
[ "0.65473866", "0.6300205", "0.61898124", "0.56602454", "0.56602454", "0.56602454", "0.5539527", "0.5517001", "0.5417174", "0.5403638", "0.5400652", "0.5400652", "0.5400652", "0.53059065", "0.52699184", "0.5268408", "0.51663446", "0.5159867", "0.51584625", "0.5157052", "0.5128...
0.65346235
1
helper function to do the work for this source this way flush and funnel can share the same buffer
function next (fromEndOrNext) { if (buff.hasEnded()) { //This is a HACK. There has got to be a better way. //The issue is that if you go through endOrNext and the //source hasEnded, then you will go back through endOrNext, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "emitBuffered() {\n this.receiveBuffer.forEach(args => this.emitEvent(arg...
[ "0.664337", "0.6558965", "0.655016", "0.65017235", "0.65017235", "0.63739324", "0.62884873", "0.62884873", "0.62884873", "0.6254237", "0.62219185", "0.6211279", "0.6187895", "0.61040425", "0.60330725", "0.60080665", "0.5936766", "0.59290504", "0.5880675", "0.58715314", "0.586...
0.0
-1
helper function to pull the next source or end the dest
function nextOrEnd () { var next = dest._buffer.shift(); dest._pipeCount -= 1; if (typeof next === 'function') { next(); } else if (dest._pipeCount <= 0) { dest.end(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextOrEnd() {\n var next = dest._buffer.shift();\n dest._pipeCount -= 1;\n\n if (typeof next === 'function') {\n next(true);\n } else if (dest._pipeCount <= 0) {\n dest.end();\n } else {\n ...
[ "0.65346235", "0.6300205", "0.61898124", "0.56602454", "0.56602454", "0.56602454", "0.5539527", "0.5517001", "0.5417174", "0.5403638", "0.5400652", "0.5400652", "0.5400652", "0.53059065", "0.52699184", "0.5268408", "0.51663446", "0.5159867", "0.51584625", "0.5157052", "0.5128...
0.65473866
0
helper function to do the work for this source this way flush and funnel can share the same buffer
function next () { if (source instanceof StreamBuffer) { if (source.hasEnded()) { source. //I need to nextOrEnd on end because the drain //may fill the dest Stream. If so, the StreamBuffer ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "emitBuffered() {\n this.receiveBuffer.forEach(args => this.emitEvent(arg...
[ "0.6642858", "0.6558569", "0.6550825", "0.65011847", "0.65011847", "0.6373278", "0.62895155", "0.62895155", "0.62895155", "0.6255771", "0.62236214", "0.62122715", "0.61878437", "0.6104957", "0.6035137", "0.6008747", "0.5937873", "0.59300417", "0.58815545", "0.5873035", "0.586...
0.0
-1
converts a number to the userformat: 1,234,567
function user_format_convert(param){ var formatted =''; //console.log('user_format_param: '+ param); if(param){ var raw_number = param; formatted = raw_number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); //console.log("user_format_formatted: "+formatted); return formatted; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatNumber(n) {\n // format number 1000000 to 1,234,567\n return n.replace(/\\D/g, \"\").replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")\n }", "formatNumber (num) {\n return num.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\")\n }", "function formatNumber(num) {\n r...
[ "0.80345196", "0.7878757", "0.78181314", "0.78181314", "0.77082723", "0.7672859", "0.76654017", "0.7654475", "0.7459709", "0.7441792", "0.7413847", "0.7384187", "0.73614395", "0.7272299", "0.724947", "0.7216215", "0.7169017", "0.713925", "0.7125841", "0.7099651", "0.70970154"...
0.74629664
8
convert seconds to mm:ss
function toMMSS (duration) { const min = Math.floor(duration / 60) const sec = duration - (min * 60) return min + ':' + (sec < 10 ? '0' + sec : sec) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatSecsAsMMSS(secs) {\n var formattedtime;\n var minutes = Math.floor(secs / 60);\n formattedtime = minutes;\n var seconds = secs - (minutes * 60);\n if (seconds < 10) {\n formattedtime += \":0\" + seconds;\n } else {\n formattedtime += \":\" + seconds;\n }\n return formattedtime;\n\n}", ...
[ "0.8034353", "0.80293006", "0.7937938", "0.79193985", "0.7859485", "0.7781171", "0.77732646", "0.7683846", "0.7672536", "0.7670425", "0.7666674", "0.7662892", "0.76429456", "0.7616924", "0.7616892", "0.75727445", "0.7570711", "0.75593394", "0.7557038", "0.75508565", "0.754341...
0.7549226
20
Constant declaration Module variables declaration
function resolver( resolve, reject ) { mongoose.connect( config.mongo.url ); var connection = mongoose.connection; connection.on( 'open', resolve ); connection.on( 'error', reject ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constants() {}", "function Constants() {}", "function h() {\n console.log(CONST_VAR);\n}", "function Constants() {\n throw new Error('Constants should not be instantiated!');\n}", "function ApplicationEditPageConstants() {\n }", "function Constants() {\n if (currentToken() == \"constante...
[ "0.7653512", "0.7653512", "0.6795028", "0.6548112", "0.6314456", "0.6289085", "0.61731184", "0.61696583", "0.6158501", "0.60156226", "0.601155", "0.6005308", "0.5965367", "0.59126896", "0.5852701", "0.5809219", "0.58064574", "0.57916474", "0.5773124", "0.5765902", "0.5765209"...
0.0
-1
Perform a deleteVideo request
function deleteVideo(videoName) { var requestData = '{' + '"command" : "deleteVideo",' + '"arguments" : {' + '"video" : "' + videoName + '"' + '}' + '}'; makeAsynchronousPostRequest(requestData, refresh, null); // Defined in "/olive/scripts/master.js". }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async delete (req, res) {\n try {\n if (typeof req.user === 'undefined' || req.user === null) {\n throw new Error('You are not connected')\n }\n Video.belongToUser(req.body.videoId, req.user.userId)\n console.log('\\n HI', req.params.idVideo)\n const deleteStruct = {\n vid...
[ "0.7798657", "0.7442146", "0.71945643", "0.701595", "0.69608194", "0.68270993", "0.6822745", "0.6709437", "0.6709437", "0.6709437", "0.6709437", "0.6709437", "0.6709437", "0.6709437", "0.6709437", "0.6643561", "0.6642144", "0.6620219", "0.65977216", "0.65939784", "0.6523342",...
0.79397947
0
Perform a splitVideo request
function splitVideo(videoName, splitTimeInSeconds) { var requestData = '{' + '"command" : "splitVideo",' + '"arguments" : {' + '"video" : "' + videoName + '",' + '"splitTimeInSeconds" : ' + splitTimeInSeconds + '' + '}' + '}'; makeAsynchronousPostRequest(requestData, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitVideo(ctx) {\n /* Generating the unique ids for the elements */\n const firstHalfId = getUniqueID()\n const secondHalfId = getUniqueID()\n \n /* Accessing key members for rendering */\n const targetNode = window.references[ctx.target.id]\n const targetNodeEnd = targetNode.data.metadata.endTime...
[ "0.6474439", "0.64645636", "0.5946501", "0.58028597", "0.5798874", "0.57109654", "0.56583387", "0.56476444", "0.5610512", "0.56079936", "0.5580517", "0.5532409", "0.5521178", "0.5500232", "0.5494928", "0.54946715", "0.5457521", "0.54538727", "0.54420555", "0.54098743", "0.538...
0.77043986
0
Perform a combineVideos request
function combineVideos(){ var requestData = '{' + '"command" : "combineVideos",' + '"arguments" : {' + '}' + '}'; makeAsynchronousPostRequest(requestData, null, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getVideos() {\n try {\n setSpinner(true);\n\n const params = {\n part: \"snippet\",\n regionCode: \"UY\",\n maxResults: 4,\n q: filter ?? \"\",\n type: \"video\",\n key: process.env.REACT_APP_YOUTUBE_API_KEY,\n };\n\n const responseIte...
[ "0.65650386", "0.63208646", "0.61130774", "0.60485893", "0.6033471", "0.6005311", "0.6001247", "0.5900821", "0.5839994", "0.5801869", "0.5750218", "0.57110876", "0.5705898", "0.5686539", "0.56036514", "0.56036013", "0.5555449", "0.55343264", "0.55260235", "0.5515055", "0.5465...
0.87480694
0
Perform a renameVideo request
function renameVideo(oldVideoName, newVideoName) { var requestData = '{' + '"command" : "renameVideo",' + '"arguments" : {' + '"oldVideoName" : "' + oldVideoName + '",' + '"newVideoName" : "' + newVideoName + '"' + '}' + '}'; makeAsynchronousPostRequest(requestData, refresh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renameMovie(id){\n showTheRenameDialog(id);\n}", "function deleteVideo(videoName) {\r\n\tvar requestData = '{'\r\n\t\t\t+ '\"command\" : \"deleteVideo\",'\r\n\t\t\t+ '\"arguments\" : {'\r\n\t\t\t+ '\"video\" : \"' + videoName + '\"'\r\n\t\t\t+ '}'\r\n\t\t\t+ '}';\r\n\tmakeAsynchronou...
[ "0.660857", "0.63415337", "0.61522853", "0.61038494", "0.5936558", "0.5891197", "0.58454406", "0.5810879", "0.578857", "0.57437384", "0.5705016", "0.5657197", "0.5647093", "0.5635761", "0.5626897", "0.562033", "0.5618061", "0.5553978", "0.55182254", "0.5453981", "0.5448103", ...
0.8370695
0
Perform an addToSelected request
function addToSelected(videoName) { var requestData = '{' + '"command" : "addToSelected",' + '"arguments" : {' + '"video" : "' + videoName + '"' + '}' + '}'; makeAsynchronousPostRequest(requestData, null, null); // Defined in "/olive/scripts/master.js". }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addSelectedToSelection(e) {\n let selectedOptions =\n this.props.selectedOptions.concat(getItemsByProp(this.state.filteredOptions,\n this.props.valueProp,\n this.state.selectedValues))\n this.set...
[ "0.6539131", "0.6518934", "0.6368464", "0.628681", "0.60695213", "0.6028136", "0.58279586", "0.5822224", "0.58147115", "0.5780281", "0.5743258", "0.5664302", "0.56535935", "0.56517524", "0.56291693", "0.56079966", "0.55956364", "0.5532287", "0.55192924", "0.54863864", "0.5484...
0.6625303
0
Perform a removeFromSelected request
function removeFromSelected(videoName) { var requestData = '{' + '"command" : "removeFromSelected",' + '"arguments" : {' + '"video" : "' + videoName + '"' + '}' + '}'; makeAsynchronousPostRequest(requestData, null, null); // Defined in "/olive/scripts/master.js". }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeSelected() {\n\n Model.clearSelected(this.currentCartItems);\n }", "removeSelected(option, options) {\n let index = options.indexOf(option);\n if (index > -1) {\n options = options.splice(index, 1);\n }\n }", "deleteOrder(selection){\r\n fetch(`http://localho...
[ "0.73192763", "0.6799155", "0.67755044", "0.6760232", "0.6702965", "0.6623423", "0.6517612", "0.64316034", "0.6416042", "0.6394003", "0.63802207", "0.63561386", "0.6351861", "0.6302346", "0.6293477", "0.6246716", "0.6239646", "0.6239326", "0.61759", "0.6165964", "0.6157377", ...
0.6762847
3
Video tag codecs: Also:
function updatePlayerWithNewElement(element) { var video = '<video id="player" preload="preload" controls="controls" poster="' + $(element).data('icon') + '">' + '<source src="' + $(element).data('url') + '" type="video/ogg; codecs=theora,vorbis" /></video>'; // TODO Get this from the database. $('#play...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkVideoSupport() {\n const video = document.createElement('video');\n if (!video.canPlayType('video/webm; codecs=\"vp8, vorbis\"')) {\n this.videos.forEach(video => video.src.replace('webm', 'mp4'));\n }\n }", "function TcVideo( aVideo , aCodec ) {\n\tthis.FSource = aVideo || \"\"; // Vídeo\...
[ "0.5946377", "0.58776915", "0.5699945", "0.56773233", "0.5658767", "0.5609474", "0.5578882", "0.55136687", "0.5453408", "0.54102606", "0.53738445", "0.52699095", "0.5254781", "0.525105", "0.5244009", "0.52169484", "0.52099526", "0.520697", "0.5196567", "0.5166376", "0.5159063...
0.0
-1
Perform an updatePosition request
function updatePosition(command, collectionItems) { var requestData = '{' + '"command" : "' + command + '",' + '"arguments" : {' + '"videos" : ['; if ($(collectionItems).length > 0) { $(collectionItems).each(function(index) { requestData += '{' + '"video" : "' + $(this).d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePositions(){\n this.api.get_positions(this.apiPositionListener)\n }", "function updatePosition() {\n\t\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocat...
[ "0.71481115", "0.7098166", "0.69987315", "0.6935715", "0.69272417", "0.6900887", "0.67124057", "0.67119896", "0.6704001", "0.6673082", "0.66280776", "0.6597174", "0.6572802", "0.65159935", "0.6481433", "0.641388", "0.6410026", "0.6382068", "0.63315994", "0.6313015", "0.630565...
0.6134687
30
Perform an updateVideosPosition request
function updateVideosPosition() { updatePosition('updateVideosPosition', '#videos > .video-container'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePosition(command, collectionItems) {\r\n\tvar requestData = '{'\r\n\t\t+ '\"command\" : \"' + command + '\",'\r\n\t\t+ '\"arguments\" : {'\r\n\t\t+ '\"videos\" : [';\r\n\t\t\r\n\tif ($(collectionItems).length > 0) {\r\n\t\t$(collectionItems).each(function(index) {\r\n\t\t\trequestData += ...
[ "0.7167021", "0.6776966", "0.6491552", "0.6317483", "0.630532", "0.6035253", "0.6034794", "0.5983699", "0.59095275", "0.5888573", "0.5870077", "0.5807438", "0.57454866", "0.57422096", "0.5715662", "0.57080775", "0.5699911", "0.5698119", "0.56764984", "0.5669832", "0.56465334"...
0.7710617
0
Perform an updateTimelinePosition request
function updateTimelinePosition() { updatePosition('updateTimelinePosition', '#timeline > .video-container'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePositions(){\n this.api.get_positions(this.apiPositionListener)\n }", "function handlerPositionUpdate () {\n var position = svl.panorama.getPosition();\n handlerPovChange(); // handle pov change\n\n // Store the current status\n// if ('storage' in svl) {\n// ...
[ "0.63982034", "0.6152702", "0.61255527", "0.60904837", "0.606011", "0.60241306", "0.5983095", "0.59351623", "0.58810985", "0.5874095", "0.58433175", "0.5835925", "0.58116156", "0.57935846", "0.579258", "0.5737894", "0.5717519", "0.5714197", "0.5707585", "0.5585228", "0.558140...
0.7081764
0
Calucalate deviation of list
function deviation(nArr) { var total = 0; nArr.forEach(function (data) { total = total + parseFloat(data); }); var meanVal = total / nArr.length; var devCal = 0; for (var key in nArr) { devCal += Math.pow((parseFloat(nArr[key]) - meanVal), 2); } var result = Math.sqrt(dev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeMeanStdev(list) {\n let sum = 0;\n for (let v of list) {\n sum += v\n }\n let mean = sum / list.length;\n\n let stdev = 0;\n for (let v of list) {\n stdev += (v - mean) * (v - mean)\n }\n stdev /= list.length;\n stdev = Math.sqrt(stdev);\n return [mean, s...
[ "0.7357918", "0.72340745", "0.6806234", "0.6783526", "0.6744959", "0.6687324", "0.65769255", "0.6546189", "0.65267134", "0.6465424", "0.64283526", "0.6309304", "0.62249583", "0.6187011", "0.61251205", "0.61002904", "0.6090227", "0.60426146", "0.6016765", "0.6014469", "0.59633...
0.69559455
2
Calculate Humidty Sensor readings
function humSenCalculation(arr, humRef) { //1% of reference value var tempVal = (1 / 100) * humRef; //calculate 1% of reference value for (var i = 0; i < arr.length; i++) { if (((tempVal + parseInt(humRef)) - arr[i]) > 1) return 'discard'; //reading will discarded if does not match 1% of referece v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getHumidityIntensity() {\n // get hum upper safe level\n let upperArr = [];\n let upperData = await fetch('https://api.thingspeak.com/channels/866214/fields/7',\n {\n method: 'GET',\n })\n upperData = await upperData.json();\n let upperFeed = upperData.feeds.r...
[ "0.65804905", "0.6488997", "0.64386904", "0.6436984", "0.63373303", "0.6296742", "0.6257519", "0.6171093", "0.6108623", "0.61072266", "0.60666394", "0.60071814", "0.6000244", "0.59693205", "0.5967284", "0.5954933", "0.58863616", "0.5880691", "0.5874596", "0.5866068", "0.58624...
0.56007063
32
function use for deleted Article from list and from database
function deleteRecord(id) { addOverLay(); $.ajax({ url : HOST_PATH + "admin/article/movetotrash", method : "post", data : { 'id' : id }, dataType : "json", type : "post", success : function(data) { if (data != null) { window.location.href = HOST_PATH + "admin/artic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_article(articleid)\n{\n change_article_state(articleid, \"delete\", \"deletebtn-a\" + articleid);\n}", "deleteArticle(articleId) {\n this.articles.find(article => article.config.id === articleId).delete();\n }", "deleteArticle(id) {\r\n API.deleteArticle(id).then(this.props.getA...
[ "0.71093374", "0.6786442", "0.6770359", "0.67130554", "0.669315", "0.6663919", "0.66420263", "0.6588558", "0.65812993", "0.6573651", "0.6500536", "0.64260775", "0.6369536", "0.63548034", "0.6331609", "0.6299135", "0.6294481", "0.6281361", "0.62795275", "0.62791675", "0.627704...
0.5934686
57
function used to render html for multiple chapters in articles
function getchapterhtml(el){ editCount = parseInt($(el).attr('rel')); count = editCount != undefined ? editCount + 1 : count; $.ajax({ url : HOST_PATH + "admin/article/chapters", type : "post", data : {'partialCounter' : count}, success : function(data) { $("div#multidiv").append(data); $(el)....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderChapters() {\n let firstChapter = createAndPushChapter('Chapter 1', 'The Lab', 'url(../img/background/thelabbg.png)');\n chapterArray[0].addParagraph(`You sit at your desk, looking over a beautiful ${userInfo[1]} sunset, working on your latest research in genetics. Everyone else in the office has...
[ "0.6609818", "0.652559", "0.62625676", "0.6143337", "0.611841", "0.6107817", "0.5982366", "0.5969492", "0.59230566", "0.592252", "0.590346", "0.58832175", "0.58821976", "0.5864069", "0.582201", "0.5818968", "0.581177", "0.58065724", "0.5804116", "0.57899725", "0.5777739", "...
0.6516744
2
change nickname for a single guild
async function updateNickname(guild, coin) { const testdata = await fetch(`https://api.pancakeswap.info/api/tokens/${pancake}`).then(response => response.text()); // get data as raw let realdata = JSON.parse(testdata) // convert data to json mprice = (realdata['data']['price'] * multiplier).toFixed(5); return g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeNickname() {\n userLog.name = command[1]; // je change le nickname de l'utilisateur\n }", "function newNick(message) {\n let newName = message.content.substr(6).toString()\n message.member.setNickname(newName)\n .catch(console.error)\n console.log(newName)\n messag...
[ "0.805856", "0.79232615", "0.77412534", "0.72732604", "0.699198", "0.6957306", "0.6846317", "0.6642037", "0.662881", "0.6610887", "0.6491461", "0.64284205", "0.6325657", "0.6288079", "0.62553436", "0.6173452", "0.61564136", "0.6139576", "0.6133027", "0.6102307", "0.60677063",...
0.6843425
7
encodes a new token for a user object
function tokenForUser(user) { const timestamp = new Date().getTime(); console.log(user); return jwt.encode({ sub: user.id, iat: timestamp }, process.env.AUTH_SECRET); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createToken( user ){ \n //Objeto con los datos de usuario que yo quiero almacenar en un token\n var payload = {\n sub: user._id,\n name: user.name,\n surname: user.surname,\n nick: user.nick,\n email: user.email,\n role: user.role,\n image: user.image...
[ "0.7331295", "0.73049515", "0.72620916", "0.7245161", "0.719234", "0.71856534", "0.7117872", "0.7112952", "0.7067185", "0.7057247", "0.7042045", "0.70394", "0.6996081", "0.6975335", "0.6965562", "0.69485605", "0.69388163", "0.692944", "0.6925361", "0.6890767", "0.6880967", ...
0.70371747
12
Create average tips vs. gender pie chart
function averageTipVsGender(data, timePeriod) { var compData = generateTipVsGenderCompositeData(regenerateCompositeData(data, timePeriod)); // Color mapping to gender for main chart var genderColor = d3 .scaleOrdinal() .domain(['Male', 'Female']) .range(['#5b63fe', '#fe5bde']); // Color mapping to gender fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawPieCharts(data) {\n\n if (!data) {\n return;\n }\n\n let radius = 100;\n let color = d3.scaleOrdinal(d3.schemeCategory10);\n let pie = d3.pie().value(function(d) {return d.value; }).sort(null);\n let arc = d3.arc().innerRadius(radius - 60).outerRadius(radius - 20);\n\n let ...
[ "0.6839532", "0.67211956", "0.65654063", "0.6429215", "0.638162", "0.63317215", "0.62406665", "0.6137627", "0.6080079", "0.59689784", "0.5958689", "0.5953144", "0.5943924", "0.5926423", "0.590171", "0.5881533", "0.5842553", "0.58290756", "0.5822267", "0.57624614", "0.57581353...
0.73289686
0
modal admin login& branch login js
function adminmode() { if (jQuery('.userlogin').hasClass('branchlogin')) { jQuery('.userlogin').removeClass('branchlogin'); jQuery('.userlogin').toggleClass('adminlogin'); if (jQuery('.userlogin').hasClass('adminlogin')) { jQuery('.logbutton').attr('id', 'adminlogbutton'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {\n $('#login').modal('show');\n}", "function doModalLogin_() {\n\tcustomModalBox.htmlBox('yt-LoginContent_Popup', '', 'Log in'); \n\tloginClose_();\n}", "function login() {\n vm.modal.show();\n }", "function doModalLogin() {\n\tcustomModalBox.htmlBox('yt-LoginContent_Popup', '', 'Log...
[ "0.6968676", "0.69534636", "0.6913576", "0.6867754", "0.67945886", "0.67707825", "0.67674017", "0.673011", "0.6716277", "0.67039984", "0.6691956", "0.6677055", "0.6655382", "0.6642349", "0.6642349", "0.6642349", "0.65643054", "0.6554685", "0.6525364", "0.6524222", "0.6512807"...
0.6556238
17
Builds out the typescript source code.
function buildTypescript() { const gulpTSProject = gulpTypescript.createProject(TSCONFIG_NAME); return gulp.src('src/**/*.ts') .pipe(gulpTSProject()) .pipe(gulp.dest(COMPILE_OUT_DIR)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildJavascript() {\n return buildGenerator('javascript', 'JavaScript');\n}", "typeScript(entry, output) {\n return this.ts(entry, output);\n }", "async buildCode() {\n\t\tawait this._codeSource.generated.generate();\n\t}", "ts(content, cb) {\n // compile some TypeScript...\n cb...
[ "0.6448517", "0.6364398", "0.633885", "0.625663", "0.6243877", "0.6045394", "0.5978513", "0.59673053", "0.59233505", "0.58902466", "0.5820908", "0.57860523", "0.5771764", "0.5764185", "0.5762683", "0.5755187", "0.57465154", "0.5701516", "0.5700017", "0.5655615", "0.56185126",...
0.6706062
0
Clears the build directory so that sources are uptodate.
async function clearBuildDirectory() { return del([COMPILE_OUT_DIR]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async clearBuild() {\n\t\tawait this.#fileManager.clearDir(this.#preprocessor.settings.build_dir);\n\t}", "function clean() {\n\tlog.info('Cleaning the build directory');\n\treturn doshell('rm -rf ' + buildDirectory);\n}", "function reset(cb) {\n\tdel( 'build/**/*' ).then( function( paths ) {\n\t\tconsole.log(...
[ "0.8083352", "0.72142047", "0.7147297", "0.7045589", "0.69722223", "0.68816626", "0.6718713", "0.66579103", "0.66466177", "0.6384754", "0.63693905", "0.63693905", "0.6342917", "0.6340363", "0.63262886", "0.6321789", "0.63111097", "0.62821674", "0.6265179", "0.62549686", "0.62...
0.81678784
0
Runs Jest to perform unit test coverage.
function jestTestsAndCoverage() { return gulp.src(SPEC_DIR) .pipe(jest(jestConfig)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runNodeTests() {\n const SPEC_DIR = 'test/node'\n runJasmine(SPEC_DIR, false, err => {\n if (err) {\n console.log('Node tests for build failed:', err.message)\n process.exit(2)\n }\n })\n}", "async function startTests() {\n console.log(\"🎸 Built Source Code\");\n const time = new D...
[ "0.66870695", "0.6533169", "0.64644337", "0.6442714", "0.64319575", "0.63920176", "0.6361632", "0.6350313", "0.62571156", "0.6248191", "0.6180095", "0.6166818", "0.6134192", "0.61313087", "0.60887927", "0.59773165", "0.5922572", "0.5914254", "0.5898738", "0.58763444", "0.5843...
0.7185733
0
Check to see if code complies with eslint.
function eslintCompliance() { return gulp.src([SRC_DIR, 'jest.config.js']) .pipe(eslint({ useEslintrc: true, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryToEnableLint() {\n try {\n cm.setOption(\"lint\", false);\n cm.setOption(\"lint\", true);\n } catch (ignore) {}\n }", "function yarnIntegrityCheck() {\n shell.cd(cwd);\n let out = shell.exec('yarn check --integrity').code;\n return out ? false : true;\n}", "f...
[ "0.6046056", "0.5875112", "0.5858075", "0.58229876", "0.577712", "0.5777091", "0.57632494", "0.5759095", "0.5752719", "0.574589", "0.5717171", "0.56529504", "0.56419003", "0.558716", "0.5556986", "0.55560446", "0.54865295", "0.54559773", "0.54189724", "0.5394938", "0.5390765"...
0.6311676
0
This helper function checks for user, password and count before allowing to 'restricted' /loggedin
function authenticate(req, res, next) { req.session.count = req.session.count || 0; req.session.count++; var user = req.session.user = req.body.user || ""; var password = req.body.password || ""; debugger; if (req.session.count > 3) { res.redirect('/toomany'); } else if (!fakeDB.exists(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkPassword() {\n if(user.password === '12345'){\n console.log(' Logged in ');\n } else {\n console.log('cannot log in');\n }\n }", "checkAuth() { }", "function idPassLength(user, pw) {\n\treturn user.length >= 6 && pw.length >= 6;\n}", "function checkPassword(...
[ "0.65159196", "0.6356261", "0.62297434", "0.62296474", "0.6228201", "0.6165585", "0.6157674", "0.6153153", "0.6149821", "0.61399335", "0.61323", "0.6130262", "0.6122208", "0.61168987", "0.6089209", "0.608429", "0.60830486", "0.60604584", "0.60552543", "0.60492736", "0.6024235...
0.6275499
2
asynchronously upload file by ajax
function upload_file(file, id) { var xhr = createXHR(), formData = new FormData, eleProgress = document.getElementById("J_p_" + id); formData.append("file", file); xhr.open("post", formAction, true); xhr.addEventListener("load", function (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadFile(){\n $('#fileError').empty()\n var form = new FormData();\n var files = $(\"#fileChooser\")[0].files[0];\n form.append(\"file\", files)\n $.ajax({\n type: 'POST',\n url: UPLOAD_FILE_URL,\n data: form,\n enctype : 'multipart/form-data',\n content...
[ "0.75091994", "0.74217397", "0.7402602", "0.7217749", "0.7213389", "0.7208933", "0.71092725", "0.71058625", "0.70932466", "0.708714", "0.70677805", "0.70320743", "0.70142746", "0.7013381", "0.70123523", "0.70088416", "0.7005214", "0.699494", "0.6976719", "0.69614726", "0.6953...
0.705655
11
fijaros que la variable a toma el valor de lado1 y variable b toma el valor de lado2
function escribePerimetro(a, b) { let perimetro = 2 * (a + b); document.write("el perimetro de un rectángulo de lados " + a + " y " + b + " es " + perimetro); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intercambiar() {\n const aux = vaso1;\n vaso1 = vaso2;\n vaso2 = aux;\n}", "function makeAbba(a, b) {\n\treturn a + b + b + a;\n}", "function perimetroTiangulo(lado1,lado2,base) { \n return lado1+lado2+base; \n }", "function altura(lado1, lado2, base) {\n if (\n lado1 === lado2 && lado...
[ "0.63503766", "0.6018611", "0.6009764", "0.5925142", "0.59107965", "0.5892388", "0.58718216", "0.5852918", "0.5809018", "0.5806598", "0.5797002", "0.5787087", "0.575698", "0.57326555", "0.57230335", "0.5722254", "0.57043946", "0.56804746", "0.567884", "0.56420654", "0.5625949...
0.0
-1
NEXT STEPS: We have the current messages from the server. Next, we would like to be able to do 2 things: 1. Accept the username for the chat app independent of the post request. How will we do this? Maybe we could create a POST request that ONLY submits the name. Potential problem: will this cause a blank message with ...
function submitMessage() { // here, we're going to create a function that will contain our POST request console.log("submitMessage running!"); let sendBtn = document.querySelector('#send'); // we want it to run only when we click, so let's ID the button sendBtn.addEventListener('click', function () { // an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMessage(){\n var msg = $(\"#sendtxt\").val();\n \n // Do not let user send message that is empty\n if(!msg)\n return;\n \n var data = {};\n data.database = \"chattest\";\n data.action = \"save_message\";\n data.content = $('<div />').text(msg).html()\n data.use...
[ "0.70815235", "0.70599633", "0.7017233", "0.6916753", "0.68295753", "0.6818271", "0.6815885", "0.670992", "0.67020804", "0.6663344", "0.6638064", "0.66318965", "0.6602738", "0.6592922", "0.65908", "0.6588592", "0.65811276", "0.6577122", "0.6572705", "0.6570547", "0.6539286", ...
0.63956547
37
Get for the real scalar component
get w() {return this._w;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get vector2Value() {}", "get x() {\n return this.r * toFloat;\n }", "get vector3Value() {}", "get tensor() {\n if (this.$isSeries) {\n return tensor1d(this.$data);\n } else {\n return tensor2d(this.$data);\n }\n }", "get scl() {\n\t\treturn p5.Vector.mult(this, scl);\n\t...
[ "0.6337299", "0.61833036", "0.60856485", "0.6035931", "0.5971939", "0.59395456", "0.5902134", "0.589657", "0.5851022", "0.5832252", "0.5819246", "0.57789475", "0.5740805", "0.57296735", "0.56956375", "0.56588244", "0.56482595", "0.5640953", "0.56329745", "0.56207097", "0.5610...
0.0
-1
Get for the imaginary x component
get x() {return this._x;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "xImage() {\n return this.cos() * this.length;\n }", "get x() {\n\t\t\treturn this._x / this.scale;\n\t\t}", "get x() {\n return this._x / this.scale;\n }", "RealX() {\r\n return this.x * tileSize * -1;\r\n }", "get x() {\n return this.r * toFloat;\n }", "ge...
[ "0.7249732", "0.66048527", "0.6588197", "0.6465843", "0.6336554", "0.6178098", "0.6157255", "0.60671717", "0.59760344", "0.59714305", "0.5944969", "0.59293157", "0.59264386", "0.5875035", "0.5855728", "0.58227414", "0.5797268", "0.5781148", "0.5780264", "0.5765059", "0.576095...
0.0
-1
Get for the imaginary y component
get y() {return this._y;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "yImage() {\n return this.sin() * this.length;\n }", "y() {\n\t\t\treturn this.data.y;\n\t\t}", "get y()\n\t{\n\t\treturn this._obj.y;\n\t}", "get y()\n\t{\n\t\tif (this._y != null)\n\t\t\treturn this._y;\n\n\t\t/*\n\t\tlet list = this.isInput ?\n\t\t\tthis.node.inputPlugs : this.node.outputPlugs;\n...
[ "0.76463693", "0.6829397", "0.66927373", "0.66329664", "0.66131383", "0.65300834", "0.65113366", "0.6484658", "0.6472205", "0.6425219", "0.6420933", "0.6401898", "0.637123", "0.6369763", "0.6351648", "0.6302339", "0.629693", "0.6269691", "0.6255192", "0.6142336", "0.60930926"...
0.6090392
21
Get for the imaginary z component
get z() {return this._z;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetiHatSrcZ() {\r\n\r\n\t\tvar iHatSrcZ = Math.cos(LowerPhi)*(Math.sin(beta)*Math.sin(alpha)) + Math.sin(LowerPhi)*(-Math.sin(beta)*Math.cos(alpha));\r\n\t\t\r\n\t\treturn iHatSrcZ;\r\n\t}", "function irot3_z(inp, by)\n{\n\tvar res = {}\n\tres.x = Math.cos(by) * inp.x + -Math.sin(by) * inp.y;\n\tres.y =...
[ "0.5971248", "0.5924784", "0.5870694", "0.57124496", "0.57041085", "0.569672", "0.5673278", "0.5662494", "0.56325215", "0.5594093", "0.5573335", "0.55488896", "0.5496328", "0.54930097", "0.54911673", "0.54818714", "0.5479905", "0.54505724", "0.5408119", "0.53956926", "0.53696...
0.61451054
0
Set for the real scalar component
set w(value) {this._w = value;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scaleEq(scalar)\n\t{\n\t\tthis._w *= scale;\n\t\tthis._x *= scale;\n\t\tthis._y *= scale;\n\t\tthis._z *= scale;\n\t}", "multiplyScalar(s) {\n\t\tthis.x *= s;\n\t\tthis.y *= s;\n\t\treturn this;\n\t}", "static setScaleV3(xyz, s) {\nxyz[0] *= s;\nxyz[1] *= s;\nxyz[2] *= s;\nreturn xyz;\n}", "set Normal(value)...
[ "0.610848", "0.59675026", "0.5941178", "0.5927717", "0.5922994", "0.58314747", "0.57926595", "0.5790892", "0.57738197", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0.57588464", "0...
0.0
-1
Set for the imaginary x component
set x(value) {this._x = value;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "xImage() {\n return this.cos() * this.length;\n }", "function xComponent(x, y, image){InputComponent.call(this,x,y,image)}", "get x() {\n return this._x / this.scale;\n }", "setX(x) {\n this.setXY(toInt(x), this.position[1]);\n }", "get x() {\n\t\t\treturn this._x / this.scale;\n\...
[ "0.6270927", "0.6166614", "0.60820395", "0.60763127", "0.6015034", "0.5935405", "0.58659256", "0.5844121", "0.5830768", "0.5788515", "0.5716904", "0.57161105", "0.57021284", "0.5695169", "0.5685073", "0.56097746", "0.55996895", "0.5583948", "0.55612797", "0.5556952", "0.55353...
0.6069518
4
Set for the imaginary y component
set y(value) {this._y = value;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set y(value) {}", "set setY (y) {\n this.y = y;\n }", "setY(val) {\r\n this.y=val;\r\n }", "yImage() {\n return this.sin() * this.length;\n }", "function setY(i:int){\n\tif(i<0 || i>rows) print(\"Invalid size!\");\n\telse{\n\t\t_y=i*_offsetY;\n\t}\n}", "setY(y) {\n this.s...
[ "0.70043814", "0.6942048", "0.6860575", "0.675759", "0.6656629", "0.6587817", "0.64730257", "0.6451805", "0.64195615", "0.6274914", "0.6214946", "0.62043196", "0.6096402", "0.60829854", "0.6069899", "0.60606617", "0.60528576", "0.60336834", "0.60250956", "0.60081315", "0.6006...
0.75781095
0
Set for the imaginary z component
set z(value) {this._z = value;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set zCoordinate (val) {\n this._z = val;\n \n if(this.dash) {\n this.dash.playerZ = val;\n }\n }", "set z(value) {}", "set zCoordinate (val) {\r\n this.z = val;\r\n \r\n if(this.dash && this.dashStr) {\r\n this.dash[this.dashStr] = val;\...
[ "0.62377435", "0.618673", "0.60836285", "0.6065111", "0.60333115", "0.60258716", "0.59183097", "0.5911604", "0.58566445", "0.5818764", "0.5781733", "0.5779658", "0.57552177", "0.56333166", "0.5590481", "0.5507866", "0.54501", "0.5446598", "0.5435501", "0.5382629", "0.53736377...
0.74603945
0
Get the additive inverse (negative value) of the quaternion.
negate () { return new Quaternion(-this._w,-this._x,-this._y,-this._z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get inverse() {\n let [a, b, c, d] = this.coeffs;\n return new MobiusTransform([\n d, b.neg,\n c.neg, a\n ]);\n }", "invert ()\n\t{\n\t\tvar fMagnitude = this._w * this._w + this._x * this._x + this._y * this._y + this._z * this._z;\n\t\tvar fInv_Magnitude = 1.0 / fM...
[ "0.701764", "0.66331595", "0.6572302", "0.6407554", "0.63682514", "0.6263263", "0.6112209", "0.6059538", "0.59422684", "0.59312975", "0.5907583", "0.58725184", "0.581096", "0.5796322", "0.5700162", "0.5675878", "0.56431776", "0.56409514", "0.5623951", "0.5596608", "0.5585321"...
0.6395218
4
Add two quaternions, returning the result in a new Quaternion
add(RHO) { return new Quaternion(this._w + RHO._w, this._x + RHO._x, this._y + RHO._y, this._z + RHO._z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function\nadd_quats(q1, q2)\n{\n var t1 = [], t2 = [], t3 = [], tf = [];\n var dest = [];\n \n t1[0] = q1[0];\n t1[1] = q1[1];\n t1[2] = q1[2];\n \n t1 = vscale(t1, q2[3]);\n \n t2[0] = q2[0];\n t2[1] = q2[1];\n t2[2] = q2[2];\n\n t2 = vscale(t2, q1[3]);\n \n t3 = vcros...
[ "0.68066895", "0.6308216", "0.59705836", "0.59324825", "0.5822057", "0.57575613", "0.5752472", "0.5741414", "0.5741414", "0.57102114", "0.57070607", "0.56623816", "0.5650253", "0.5509989", "0.54828906", "0.5480816", "0.5441491", "0.5409906", "0.5361003", "0.5358104", "0.53402...
0.65112704
1
Add two quaternions, placing the result in this Quaternion.
addEq(RHO) { this._w += RHO._w; this._x += RHO._x; this._y += RHO._y; this._z += RHO._z; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(RHO)\n\t{\n\t\treturn new Quaternion(this._w + RHO._w, this._x + RHO._x, this._y + RHO._y, this._z + RHO._z);\n\t}", "function\nadd_quats(q1, q2)\n{\n var t1 = [], t2 = [], t3 = [], tf = [];\n var dest = [];\n \n t1[0] = q1[0];\n t1[1] = q1[1];\n t1[2] = q1[2];\n \n t1 = vscale(t1, q2...
[ "0.6394726", "0.6325146", "0.6045123", "0.5719376", "0.5719376", "0.5640021", "0.5541164", "0.54703194", "0.545473", "0.5451425", "0.53838587", "0.53765595", "0.53646195", "0.5354613", "0.5309203", "0.5227911", "0.5145085", "0.5076728", "0.504664", "0.5002861", "0.49539065", ...
0.0
-1
Subtract one quaternion from another, returning the result in a new Quaternion. \f$(w_1 w_2,x_1 x_2, y_1 y_2, z_1 z_2)\f$
subtract(RHO) { return new Quaternion(this._w - RHO._w, this._x - RHO._x, this._y - RHO._y, this._z - RHO._z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static setSubtractQV(qv, qq) {\n//-------------\nqv[0] -= qq[0];\nqv[1] -= qq[1];\nqv[2] -= qq[2];\nqv[3] -= qq[3];\nreturn qv;\n}", "static subtractQV(qa, qb) {\nvar qv;\nqv = this.copyOfQV(qa);\nreturn this.setSubtractQV(qv, qb);\n}", "Subtract(x, y, z) {\n let vec = new Vec3(x, y, z);\n this.x...
[ "0.6513012", "0.62439924", "0.61064327", "0.61005336", "0.606297", "0.59491974", "0.5945463", "0.5882218", "0.5881911", "0.5873476", "0.5822188", "0.58090633", "0.5799417", "0.5779932", "0.56496274", "0.5579379", "0.5552112", "0.55133164", "0.53962797", "0.534348", "0.5342533...
0.69901013
0
Subtract one quaternion from another, placing the result in this Quaternion. \f$(w_1 w_2,x_1 x_2, y_1 y_2, z_1 z_2)\f$
subtractEq(RHO) { this._w -= RHO._w; this._x -= RHO._x; this._y -= RHO._y; this._z -= RHO._z; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subtract(RHO)\n\t{\n\t\treturn new Quaternion(this._w - RHO._w, this._x - RHO._x, this._y - RHO._y, this._z - RHO._z);\n\t}", "static setSubtractQV(qv, qq) {\n//-------------\nqv[0] -= qq[0];\nqv[1] -= qq[1];\nqv[2] -= qq[2];\nqv[3] -= qq[3];\nreturn qv;\n}", "slerp(q2, blend) {\n blend = Math.clamp(blen...
[ "0.68659747", "0.64705974", "0.6158528", "0.6061024", "0.6020847", "0.5994284", "0.59102225", "0.5856179", "0.58258396", "0.5816404", "0.5812078", "0.5790684", "0.57267326", "0.568586", "0.5674815", "0.5541957", "0.55359125", "0.55138487", "0.5490771", "0.5468029", "0.5427449...
0.53788733
23
Multiply the quaternion by a scalar factor \f$(s w, s x, s y, s z)\f$
scale(scalar) { return new Quaternion(this._w * scalar, this._x * scalar, this._y * scalar, this._z * scalar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Quaternion(\n /** defines the first component (0 by default) */\n x, \n /** defines the second component (0 by default) */\n y, \n /** defines the third component (0 by default) */\n z, \n /** defines the fourth component (1.0 by default) */\n w) {\n...
[ "0.6714782", "0.65437573", "0.63421226", "0.6163237", "0.61467296", "0.60833174", "0.6071188", "0.6071188", "0.60007733", "0.5980859", "0.5960301", "0.59250116", "0.58869", "0.5866997", "0.58624434", "0.5787617", "0.5786158", "0.5778411", "0.5756711", "0.5751872", "0.56824285...
0.6425579
2
Multiply a quaternion by a scalar factor \f$(s w, s x, s y, s z)\f$, storing the result in this quaternion
scaleEq(scalar) { this._w *= scale; this._x *= scale; this._y *= scale; this._z *= scale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Quaternion(\n /** defines the first component (0 by default) */\n x, \n /** defines the second component (0 by default) */\n y, \n /** defines the third component (0 by default) */\n z, \n /** defines the fourth component (1.0 by default) */\n w) {\n...
[ "0.65200347", "0.63545525", "0.6303725", "0.62945884", "0.61457556", "0.61457556", "0.5985547", "0.5978625", "0.5978046", "0.5958704", "0.58778644", "0.58250505", "0.5726721", "0.57121813", "0.56458265", "0.55656016", "0.5518143", "0.5511515", "0.5511065", "0.5502156", "0.546...
0.0
-1
Multiply the quaternion by a scalar factor or another Quaternion
multiply(factor) { if (typeof(factor) == "object") return this.qMultiply(factor); else return this.scale(factor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "multiplyEq(factor)\n\t{\n\t\tif (typeof(factor) == \"Quaternion\")\n\t\t\treturn this.qMultiplyEq(factor);\n\t\telse\n\t\t\treturn this.scaleEq(factor);\n\t}", "postMultiply(q) {\nvar qp;\n//-----------\n// Returns the quaternion product of this quaternion with the given one.\nqp = new RQ();\nRQ.setProductQV(q...
[ "0.6822176", "0.6759076", "0.6693365", "0.6645974", "0.661211", "0.615418", "0.60972726", "0.59338725", "0.5914594", "0.58685124", "0.5746052", "0.5732262", "0.56741244", "0.56741244", "0.56444883", "0.56393373", "0.5634556", "0.5627087", "0.5627087", "0.5627087", "0.5627087"...
0.5912877
9
Divide the quaternion by a scalar factor or another Quaternion
divide(factor) { if (typeof(factor) == "object") return this.qDivide(factor); else return this.scale(1.0 / factor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "divideEq(factor)\n\t{\n\t\tif (typeof(factor) == \"Quaternion\")\n\t\t\treturn this.qDivideEq(factor);\n\t\telse\n\t\t\treturn this.scaleEq(1.0 / factor);\n\t}", "scale(scalar)\n\t{\n\t\treturn new Quaternion(this._w * scalar, this._x * scalar, this._y * scalar, this._z * scalar);\n\t}", "set quaternionValue(v...
[ "0.7017397", "0.63377345", "0.6013152", "0.5994805", "0.5913696", "0.57541806", "0.57010925", "0.55864817", "0.55791265", "0.5557349", "0.5525383", "0.5479307", "0.5282229", "0.5244998", "0.52252096", "0.51871246", "0.5163643", "0.5077863", "0.50277686", "0.5017152", "0.50059...
0.6038725
2
Multiply the quaternion by a scalar factor or another Quaternion, storing the result in the current Quaternion
multiplyEq(factor) { if (typeof(factor) == "Quaternion") return this.qMultiplyEq(factor); else return this.scaleEq(factor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "postMultiply(q) {\nvar qp;\n//-----------\n// Returns the quaternion product of this quaternion with the given one.\nqp = new RQ();\nRQ.setProductQV(qp.xyzw, this.xyzw, q.xyzw);\nreturn qp;\n}", "mulQuat(q) {\n const qx = q[0], qy = q[1], qz = q[2], qw = q[3];\n let ax = this[0], ay = this[1], az...
[ "0.70372164", "0.68427587", "0.65262824", "0.6446755", "0.6190041", "0.60117584", "0.6000288", "0.59251827", "0.59205645", "0.58406126", "0.5684099", "0.5684099", "0.56386024", "0.5632529", "0.5629373", "0.5629373", "0.5629373", "0.5629373", "0.5629373", "0.5629373", "0.56293...
0.6699337
2
Divide the quaternion by a scalar factor or another Quaternion, storing the result in the current Quaternion
divideEq(factor) { if (typeof(factor) == "Quaternion") return this.qDivideEq(factor); else return this.scaleEq(1.0 / factor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scale(scalar)\n\t{\n\t\treturn new Quaternion(this._w * scalar, this._x * scalar, this._y * scalar, this._z * scalar);\n\t}", "set quaternionValue(value) {}", "divide(factor)\n\t{\n\t\tif (typeof(factor) == \"object\")\n\t\t\treturn this.qDivide(factor);\n\t\telse\n\t\t\treturn this.scale(1.0 / factor);\n\t}",...
[ "0.62426805", "0.6072235", "0.60386074", "0.59863514", "0.5845109", "0.5801429", "0.55790585", "0.55139285", "0.54824007", "0.53894246", "0.5367179", "0.53451204", "0.52835226", "0.5271762", "0.5243015", "0.5219798", "0.51517093", "0.51342463", "0.51153827", "0.5015892", "0.4...
0.6945964
0
Get a quaternion that is the multiplicative inverse of the current quaternion.
invert () { var fMagnitude = this._w * this._w + this._x * this._x + this._y * this._y + this._z * this._z; var fInv_Magnitude = 1.0 / fMagnitude; return new Quaternion (this._w * fInv_Magnitude,-this._x * fInv_Magnitude,-this._y * fInv_Magnitude,-this._z * fInv_Magnitude); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get inverse() {\n let [a, b, c, d] = this.coeffs;\n return new MobiusTransform([\n d, b.neg,\n c.neg, a\n ]);\n }", "get inverse() {\n let new_mult = this.multiplier.inv;\n let new_offset = this.offset.div(this.multiplier).neg;\n\n // Check if th...
[ "0.6935581", "0.69193137", "0.68225443", "0.6658018", "0.66115767", "0.65997887", "0.65986615", "0.6427436", "0.639458", "0.63113505", "0.62676346", "0.6164865", "0.6126448", "0.610865", "0.6091849", "0.60385776", "0.6008195", "0.59754163", "0.596678", "0.595112", "0.59482104...
0.7368448
0
Assigns the multiplicative inverse of the current quaternion to itself.
invertEq () { var fMagnitude = this._w * this._w + this._x * this._x + this._y * this._y + this._z * this._z; var fInv_Magnitude = 1.0 / fMagnitude; this._w *= fInv_Magnitude; this._x *= -fInv_Magnitude; this._y *= -fInv_Magnitude; this._z *= -fInv_Magnitude; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setInvert() {\nRQ.setConjugateQV(this.xyzw);\nreturn this;\n}", "inverse() {\n this.xyz = this.xyz.negate();\n return this;\n }", "get inverse() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.inverse$);\n\t}", "get inverse() {\n let new_mult = this.multiplier.inv;\n let new_offset = this.offs...
[ "0.678672", "0.6779782", "0.6479154", "0.6461353", "0.64504784", "0.64492005", "0.6364563", "0.6323807", "0.62947804", "0.62790555", "0.6239439", "0.61624223", "0.6135227", "0.6024307", "0.6023752", "0.60121566", "0.5877087", "0.5842521", "0.58400077", "0.5812094", "0.5779550...
0.5632319
25
Loads the Quaternion with a rotation about a specified axis.
loadRotationRadians(angle,axisX,axisY,axisZ) { var sinAng = Math.sin(angle * 0.5); this._w = Math.cos(angle * 0.5); this._x = axisX * sinAng; this._y = axisY * sinAng; this._z = axisZ * sinAng; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadRotationDegrees(angle,axisX,axisY,axisZ)\n\t{\n\t\tthis.loadRotationRadians(angle * Math.PI / 180.0,axisX,axisY,axisZ);\n\t}", "static fromRot(axis, angle) {\nvar q;\n//-------\nq = new RQ();\nq.setFromAxisAngle(axis, angle);\nreturn q;\n}", "function rotateAboutAxis(object, axis, degree) {\n\tvar rad = (d...
[ "0.6358872", "0.62221605", "0.6191447", "0.6115601", "0.60101193", "0.5978488", "0.5960263", "0.57466173", "0.57375497", "0.57262176", "0.5604207", "0.5579839", "0.54777974", "0.54748195", "0.54598886", "0.5388828", "0.5379988", "0.5379988", "0.532389", "0.5305826", "0.529481...
0.6532689
0
Loads the Quaternion with a rotation about a specified axis.
loadRotationDegrees(angle,axisX,axisY,axisZ) { this.loadRotationRadians(angle * Math.PI / 180.0,axisX,axisY,axisZ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadRotationRadians(angle,axisX,axisY,axisZ)\n\t{\n\t\tvar sinAng = Math.sin(angle * 0.5);\n\t\tthis._w = Math.cos(angle * 0.5);\n\t\tthis._x = axisX * sinAng;\n\t\tthis._y = axisY * sinAng;\n\t\tthis._z = axisZ * sinAng;\n\t}", "static fromRot(axis, angle) {\nvar q;\n//-------\nq = new RQ();\nq.setFromAxisAngle...
[ "0.6532689", "0.62221605", "0.6191447", "0.6115601", "0.60101193", "0.5978488", "0.5960263", "0.57466173", "0.57375497", "0.57262176", "0.5604207", "0.5579839", "0.54777974", "0.54748195", "0.54598886", "0.5388828", "0.5379988", "0.5379988", "0.532389", "0.5305826", "0.529481...
0.6358872
1
Sort an array by the order of its elements' appearance in a `precedence` array. Optionally specify a function for finding the value compared in sort.
function sortByPrecedence(array, precedence, indexFunction) { indexFunction = indexFunction || function(a) {return a;}; var copy = array.slice(); copy.sort(function(a, b) { return precedence.indexOf(indexFunction(a)) - precedence.indexOf(indexFunction(b)); }); return copy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortOn(arr) {\n var comparators = [];\n for (var i=1; i<arguments.length; i+=2) {\n comparators.push(getKeyComparator(arguments[i], arguments[i+1]));\n }\n arr.sort(function(a, b) {\n var cmp = 0,\n i = 0,\n n = comparators.length;\n while (i < n && cmp === 0) ...
[ "0.5867504", "0.57098174", "0.56998223", "0.5669935", "0.5664578", "0.5664578", "0.5664578", "0.5664578", "0.5350497", "0.52853775", "0.5251658", "0.52139974", "0.5179945", "0.5176343", "0.5147179", "0.5147179", "0.5115522", "0.49852452", "0.49778873", "0.4975186", "0.4953753...
0.78784865
0
A `CSSResult` that will be used to style the host, slotted children and the internal template of the element.
static get styles() { return css ` :host { display: inline-block; } [part=check] { visibility: hidden; } :host([checked]) [part=check] { visibility: inherit; } [part=label], [part=container] { display: inline-block; white-sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get styles() {\n return [\n css`\n :host {\n display: block;\n min-width: 112px;\n min-height: 112px;\n transition: 0.6s all ease;\n background-color: transparent;\n }\n #replacementcontent {\n visibility: visible;\n ...
[ "0.5636787", "0.5544273", "0.5463109", "0.54555887", "0.52096415", "0.52094877", "0.5166557", "0.5157025", "0.51493126", "0.5098314", "0.50796264", "0.5041339", "0.5031496", "0.50252175", "0.49210373", "0.48603526", "0.48497918", "0.48383382", "0.48363402", "0.4812941", "0.48...
0.48788595
15
A `TemplateResult` that will be used to render the updated internal template.
render() { return html ` <div part="container"> <div part="check"></div> </div> <div part="label"><slot></slot></div> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_$getTemplate(result2) {\n let template2 = templateCache.get(result2.strings);\n if (template2 === void 0) {\n templateCache.set(result2.strings, template2 = new Template(result2));\n }\n return template2;\n }", "function render(result,container){var templateFactory=arguments.length>2&&argument...
[ "0.65067834", "0.6463053", "0.6451787", "0.6414221", "0.6384781", "0.6319186", "0.6246026", "0.62067944", "0.6149994", "0.60902977", "0.60312545", "0.5909153", "0.58346695", "0.5797945", "0.5797945", "0.57735157", "0.5764297", "0.57556736", "0.5658788", "0.5647264", "0.562833...
0.0
-1
Check for mappings on various level, along the parameter order
function checkForMapping(paramValues,file) { if (isMappedFile(file)) { for (var i = 0; i < params.types.length; i++) { var paramConfig = image.config.config[params.types[i]]; var key = paramValues[i]; if (paramConfig[key]) { var fpConfig = paramConfig[key]["fish-pepper"]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyMap(map, name, parentName) {\n\n var curMatch, curMatchLength = 0;\n var curParent, curParentMatchLength = 0;\n\n // first find most specific contextual match\n if (parentName) {\n var mappedName;\n Object.getOwnPropertyNames(map).some(function(p) {\n var curMap = map[p];\n // Obj...
[ "0.542307", "0.5406128", "0.5394337", "0.5343914", "0.5320096", "0.51868993", "0.51853096", "0.51730645", "0.5161807", "0.5145728", "0.50506127", "0.50459814", "0.50184095", "0.50137955", "0.5000441", "0.4998619", "0.49809423", "0.49615976", "0.494685", "0.49338034", "0.49202...
0.5430074
0
Load the model & set it up for training
async function setupModel() { const model = await loadFrozenModel(MODEL_URL, WEIGHT_MANIFEST); const weights = model.weights; // TODO: there must be a better way const nonTrainables = /(batchnorm)|(reshape)/g; // Make weights trainable & extract them const vars = []; for (const weightName in weights) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "train() {\n\t\tif (!this.model) {\n\t\t\tthis.model = this.buildModel();\n\t\t}\n\t}", "async loadModel() {\n console.log('Loading model...');\n const startTime = performance.now();\n try {\n this.model = await tf.loadLayersModel(FAKE_NEWS_MODEL_URL, {fromTFHub: false});\n // Warms up the mode...
[ "0.78325063", "0.7411264", "0.73264843", "0.70605785", "0.7037542", "0.68741757", "0.68426365", "0.6828016", "0.6820462", "0.6801043", "0.6799568", "0.6763999", "0.6685226", "0.6641942", "0.6626265", "0.660333", "0.6498877", "0.6486049", "0.6482538", "0.6472091", "0.64623845"...
0.6915024
5
centercrop input Tensor3D into a square
function squareCrop(frame) { return tf.tidy(() => { const [h, w] = frame.shape; if(h > w) { const halfW = Math.floor(w / 2); const halfH = Math.floor(h / 2); return frame.slice([halfH - halfW, 0], [halfW * 2, -1]); } else { const halfH = Math.floor(h / 2); const halfW = Math....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centerCropAndResize(img) {\n return tfjsCore.tidy(function () {\n var _a = img.shape.slice(0, 2),\n height = _a[0],\n width = _a[1];\n var top = 0;\n var left = 0;\n if (height > width) {\n top = (height - width) / 2;\n } else {\n left = (width - hei...
[ "0.6401273", "0.61523634", "0.57169676", "0.5663189", "0.55151135", "0.5437553", "0.5430101", "0.5373129", "0.5373129", "0.5373129", "0.5365974", "0.53470606", "0.533078", "0.53179", "0.53060246", "0.52901435", "0.5233334", "0.5225676", "0.52202237", "0.519374", "0.5184092", ...
0.5499364
5
register module event listener for every api module except 'globalEvent'.
function registerModuleEventListener (name, module, meta) { if (name !== 'globalEvent') { module['addEventListener'] = function (evt, callbackId, options) { return addEventListener.call(this, name, evt, callbackId, options) } module['removeAllEventListeners'] = function (evt) { return removeAl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addGlobalListeners(replay) {\n // Listeners from core SDK //\n const scope = getCurrentHub().getScope();\n if (scope) {\n scope.addScopeListener(handleScopeListener(replay));\n }\n addInstrumentationHandler('dom', handleDomListener(replay));\n addInstrumentationHandler('fetch', hand...
[ "0.68350863", "0.66853505", "0.64076746", "0.63934994", "0.6334647", "0.6162797", "0.6128422", "0.6098046", "0.60248935", "0.5974297", "0.59492326", "0.5934999", "0.5917762", "0.5889381", "0.58613926", "0.58613926", "0.5845735", "0.58385164", "0.5831418", "0.58309263", "0.582...
0.7206862
0
Register a new component with the specified name.
registerComponent (name, comp) { ComponentManager.registerComponent(name, comp) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function componentAdd( $component, $name )\n {\n _components[$name] = $component;\n }", "function registerComponent(cmp) {\n\n var tag = cmp.tag.toUpperCase();\n\n if (Object.prototype.hasOwnProperty.call(data.components, tag)) console.warn('Doz', 'component ' + tag + ' overwritten');\n\n d...
[ "0.75834006", "0.69760174", "0.6785657", "0.6718653", "0.670157", "0.66940606", "0.63619953", "0.6357751", "0.6287714", "0.62867004", "0.62258506", "0.62048715", "0.6061536", "0.5953715", "0.59050035", "0.59050035", "0.5853775", "0.58391726", "0.58220476", "0.57509214", "0.57...
0.84815985
0
Register a new api module. If the module already exists, just add methods from the new module to the old one.
registerApiModule (name, module, meta) { registerModuleEventListener(name, module, meta) if (!protocol.apiModule[name]) { protocol.apiModule[name] = module } else { for (const key in module) { if (module.hasOwnProperty(key)) { protocol.apiModule[name][key] = module[key] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "registerApi (moduleName, name, method, args) {\n if (typeof method !== 'function') {\n return\n }\n if (!protocol.apiModule[moduleName]) {\n protocol.apiModule[moduleName] = {}\n protocol._meta[moduleName] = []\n }\n protocol.apiModule[moduleName][name] = method\n if (!args) {\n ...
[ "0.7317607", "0.7317607", "0.61272323", "0.6051628", "0.59997207", "0.57759076", "0.57759076", "0.5733931", "0.56971014", "0.56971014", "0.56971014", "0.56971014", "0.56971014", "0.56971014", "0.5692016", "0.5663743", "0.5653267", "0.55571514", "0.55402917", "0.5455578", "0.5...
0.7251186
3
Register a new api method for the specified module. opts: args: type of arguments the API method takes such as ['string', 'function']
registerApi (moduleName, name, method, args) { if (typeof method !== 'function') { return } if (!protocol.apiModule[moduleName]) { protocol.apiModule[moduleName] = {} protocol._meta[moduleName] = [] } protocol.apiModule[moduleName][name] = method if (!args) { return }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "registerApiModule (name, module, meta) {\n registerModuleEventListener(name, module, meta)\n if (!protocol.apiModule[name]) {\n protocol.apiModule[name] = module\n }\n else {\n for (const key in module) {\n if (module.hasOwnProperty(key)) {\n protocol.apiModule[name][key] = mo...
[ "0.6408944", "0.6408944", "0.5925296", "0.58006835", "0.58006835", "0.58006835", "0.58006835", "0.57867867", "0.5716054", "0.5679816", "0.5664423", "0.54921895", "0.54493546", "0.53746474", "0.53532565", "0.53482985", "0.52723366", "0.52608037", "0.5241464", "0.523107", "0.52...
0.8109481
0
Register a new weexbundleloader.
registerLoader (name, loaderFunc) { registerLoader(name, loaderFunc) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register(loader) {\n if (typeof indexOf == 'undefined')\n indexOf = Array.prototype.indexOf;\n if (typeof __eval == 'undefined' || typeof document != 'undefined' && !document.addEventListener)\n __eval = 0 || eval; // uglify breaks without the 0 ||\n\n loader._extensions = loader._extensions || [...
[ "0.6361173", "0.5807374", "0.56132865", "0.5343871", "0.5319602", "0.5310969", "0.53087586", "0.52513087", "0.5238428", "0.5238428", "0.5202196", "0.52019423", "0.5151992", "0.51048344", "0.51016414", "0.5073419", "0.50614566", "0.50401616", "0.5034628", "0.50217664", "0.4988...
0.6537986
0
To install components and plugins.
function install (mod) { mod.init(this) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function install() {}", "function install() {}", "function install() {}", "function install() {}", "function install() {\n}", "install() {\n this.installDependencies();\n }", "install() {\n\n }", "function onInstall(event) {\n Plugins.init();\n \n onOpen(event);\n}", "function _install_comp...
[ "0.789787", "0.789787", "0.789787", "0.789787", "0.7525695", "0.7500467", "0.7227384", "0.678238", "0.67633057", "0.6618867", "0.6544597", "0.6520503", "0.6472631", "0.6456274", "0.64365613", "0.64078647", "0.6400458", "0.6357939", "0.6353067", "0.6348141", "0.63288057", "0...
0.62955976
22
TODO better format and display user information
render() { return ( <div> {this.state.hasLoaded? <div> {_.isEmpty(this.state.publicUser)? <div> <h1>Sorry, the user {this.props.match.params.id} does not exist!</h1> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showFormarttedInfo(user) {\n console.log('user Info', \"\\n id: \" + user.id + \"\\n user: \" + user.username + \"\\n firsname: \" + user.firsName + \"\\n \");\n}", "function Info(user) {\n return `${user.name} tem ${user.age} anos.`;\n}", "function userinfo(user) {\r\n\r\nvar finals...
[ "0.74360996", "0.7114027", "0.68146783", "0.67249614", "0.6626354", "0.6601013", "0.6512578", "0.6507985", "0.64321256", "0.6422217", "0.63921934", "0.6369994", "0.63495034", "0.63495034", "0.63495034", "0.63495034", "0.6348353", "0.6319862", "0.629453", "0.6269499", "0.62677...
0.0
-1