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
=> true / The hasOwnProperty method is defined in Object.prototype, which can be accessed by Bird.prototype, which can then be accessed by duck. This is an example of the prototype chain. In this prototype chain, Bird is the supertype for duck, while duck is the subtype. Object is a supertype for both Bird and duck. Ob...
function Animal() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}", "function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}", "function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}", "function hasOwnProperty(obj,prop)...
[ "0.70428836", "0.70428836", "0.70428836", "0.70148486", "0.70148486", "0.70148486", "0.70148486", "0.70148486", "0.70148486", "0.70148486", "0.70148486", "0.6844002", "0.669489", "0.66839814", "0.66839814", "0.6561305", "0.6453997", "0.6410805", "0.6395239", "0.63906443", "0....
0.0
-1
Should print "nom nom nom"
function Dog() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Kenalan () {\n console.log(`Nama Saya, Jane`)\n console.log(`Saya Suka Masak`)\n console.log(`Sekian`)\n}", "function imprimirNombre(name){\n console.log(`Hola me llamo ${name}`);\n}", "function testMe(words) {\n var n = words.split(\" \");\n return \".\" + n[n.length - 1];\n ...
[ "0.6007571", "0.5989375", "0.58191055", "0.5807686", "0.57504904", "0.5748581", "0.5717691", "0.5717691", "0.56910074", "0.56411016", "0.5588314", "0.5570201", "0.55568784", "0.55373216", "0.553109", "0.5518844", "0.5513187", "0.5508343", "0.5505606", "0.549778", "0.5473611",...
0.0
-1
Reset an Inherited Constructor Property must set the constructor b/c it is inherited for the super type
function Bird(){}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SuperType() {\n\t \t\t\t\tthis.property = true;\n\t \t\t\t}", "reset(){\n this.constructor(0,0,0);\n }", "function SuperType(){\n this.property = true;\n}", "function SuperType(){\n this.property = true;\n}", "function SuperType(){\n this.property = true;\n}", "function SuperType(...
[ "0.6492773", "0.6371443", "0.63345534", "0.63345534", "0.629028", "0.6253882", "0.6228353", "0.61484593", "0.6113238", "0.6113238", "0.60818577", "0.5986412", "0.5952724", "0.58746606", "0.5856558", "0.5844449", "0.58194935", "0.58005583", "0.5780889", "0.5690412", "0.5686307...
0.0
-1
prints "Flying, wooosh!" Use Closure to Protect Properties Within an Object from Being Modified Externally
function Bird() { let hatchedEgg = 10; // private property this.getHatchedEggCount = function() { // publicly available method that a bird object can use return hatchedEgg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printProp() {\n return this.prop;\n }", "function changedGreeting (obj){ //l\n obj.greetings = \"hola\";\n}", "function newProperty(){\r\n\tconsole.log(\"showing of properties:\\n\")\r\nvar student = {name: \"David Aughan\", class: \"VI\", id: \"12\", city: \"Barcelona\"};\r\nconsole.log(student...
[ "0.6372203", "0.6221375", "0.61426586", "0.6131983", "0.61023253", "0.59498584", "0.59035826", "0.5842938", "0.58251816", "0.58217555", "0.57867604", "0.57832515", "0.57605565", "0.5752156", "0.57276034", "0.57206404", "0.5717729", "0.5717729", "0.57076424", "0.5702349", "0.5...
0.0
-1
adds the ball's velocities to their coordinates and applies gravity
function update_ball_positions(){ for (let b = 0; b < balls.length; b++){ let ball = balls[b]; ball.x += time_delta_s * ball.vx; ball.y += time_delta_s * ball.vy; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply_gravity(){\r\n for (let b = 0; b < balls.length; b++){\r\n balls[b].vy += gravity * time_delta_s;\r\n }\r\n}", "function update() {\n// update velocity\n vy += gravity; // gravity\n \n // update position\n x += vx;\n y += vy; \n \n // handle bouncing\n if (y > ...
[ "0.7684458", "0.7355067", "0.735153", "0.7292837", "0.71155673", "0.7109163", "0.704054", "0.701028", "0.69660884", "0.6950258", "0.6893481", "0.6874766", "0.686529", "0.68386203", "0.67800486", "0.67450297", "0.6734245", "0.6722989", "0.67201525", "0.67175245", "0.67062527",...
0.7051968
6
adds the gravity acceleration to the ball's vertical velocities
function apply_gravity(){ for (let b = 0; b < balls.length; b++){ balls[b].vy += gravity * time_delta_s; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateVelocity() {\n this.velocityVector.addVectors(this.gravityVelocityVector, this.inertiaVelocityVector);\n if (params.showArrows) {\n this.velocityArrow = new THREE.ArrowHelper(this.velocityVector.clone().normalize(), this.mesh.position, this.velocityVector.length() / 1000 + this.r ...
[ "0.6998862", "0.6957733", "0.6945084", "0.6891159", "0.6877255", "0.6871194", "0.68249434", "0.6822375", "0.6808871", "0.6785061", "0.6784792", "0.6764855", "0.6712566", "0.6698245", "0.6686577", "0.6676494", "0.6659802", "0.66325366", "0.66309273", "0.6596873", "0.6587074", ...
0.7294612
0
distance between two objects with x,y attrs.
function dist(c1, c2){ return ((c2.x - c1.x) ** 2 + (c2.y - c1.y) ** 2) ** 0.5; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distance(object,x,y)\n{\t\n\treturn Math.sqrt(Math.pow(object.x - x, 2) + Math.pow(object.y - y, 2));\n}", "function distanceTo(obj1x, obj1y, obj2x, obj2y) {\n var dx = obj2x- obj1x;\n var dy = obj2y - obj1y;\n return Math.sqrt(dx * dx + dy * dy)\n ...
[ "0.78376245", "0.77431345", "0.74322844", "0.74065286", "0.7385659", "0.7381762", "0.7345666", "0.73331827", "0.7260001", "0.72552294", "0.72310424", "0.72004414", "0.7158843", "0.7157819", "0.71383744", "0.71098167", "0.71094394", "0.71003103", "0.7092202", "0.70738316", "0....
0.6903976
40
random float (incl. min, excl. max)
function rand_num(min, max){ return Math.random() * (max - min) + min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomFloat(min, max){\r\n\treturn Math.random() * (max - min) + min;\r\n} // END - Random value", "function randomFloat(min,max){\n return min+(Math.random()*(max-min));\n}", "function randomFloat(min, max) {\n return min + Math.random() * (max - min);\n }", "function randomFloat(min, ma...
[ "0.8809509", "0.87543845", "0.86855006", "0.85904", "0.8581913", "0.85280657", "0.85116786", "0.8489586", "0.8489586", "0.846239", "0.8414141", "0.83351874", "0.83058566", "0.8050679", "0.799308", "0.7985081", "0.7978061", "0.79767007", "0.79360044", "0.7905484", "0.7892773",...
0.0
-1
takes two objects with centres and radii and returns if the circles overlap
function overlap(b1, b2){ if (dist(b1, b2) < b1.r + b2.r){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overlappingCircles(c1, c2) {\n var dx = c2.x - c1.x;\n var dy = c2.y - c1.y;\n var dist = Math.sqrt(dx*dx + dy*dy);\n return dist < c1.r + c2.r\n }", "function circlesIntersect(a, b){\n\tlet aRadius = a.getBounds().width/2;\n\tlet bRadius = b.getBounds().width/2;\n\treturn bRadius + aRadius...
[ "0.82789415", "0.8085985", "0.7744851", "0.77156603", "0.7444749", "0.73603755", "0.73224264", "0.7224532", "0.72069335", "0.7199351", "0.7158405", "0.7140034", "0.7101687", "0.7080634", "0.70539826", "0.7025919", "0.7009141", "0.699294", "0.6970477", "0.6923145", "0.6913834"...
0.67614114
32
returns final velocities of masses after a 1d collision
function momentum(u1, u2, m1, m2){ //http://farside.ph.utexas.edu/teaching/301/lectures/node76.html let v1 = (u1 * (m1 - m2) + 2 * m2 * u2) / (m1 + m2); let v2 = (u2 * (m2 - m1) + 2 * m1 * u1) / (m1 + m2); return [v1, v2]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collision (b) {\n\n let mdiff = this.mDiff(b);\n if (mdiff.hasOrigin()) {\n\n let vectors = [ new Vector (0,mdiff.origin.y),\n new Vector (0,mdiff.origin.y+mdiff.height),\n new Vector (mdiff.origin.x, 0),\n new Vector (mdiff.origin.x + mdiff.wid...
[ "0.72020817", "0.6271658", "0.62584287", "0.61796975", "0.6170356", "0.6156485", "0.6153417", "0.6089164", "0.60493094", "0.6045416", "0.60390925", "0.5961477", "0.59479403", "0.5946493", "0.592291", "0.5870751", "0.5846741", "0.5776363", "0.5752341", "0.5751604", "0.5748022"...
0.53402215
85
draws a circle on the main canvas
function draw_circle(x, y, radius, color){ //color = ('0' + (x / cnvs.width) * 0xff).toString(16).substr(-2).repeat(3); ctx.beginPath(); ctx.arc(x, y, radius, 0, Math.PI * 2); ctx.fillStyle = color; ctx.fill(); }
{ "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}", "draw() {\n ctx.beginPa...
[ "0.8221404", "0.81248826", "0.7966899", "0.792822", "0.79111546", "0.7854215", "0.78450155", "0.7831788", "0.7824819", "0.7806415", "0.77593195", "0.77310157", "0.7705146", "0.76866966", "0.76764387", "0.7665069", "0.76241815", "0.76149124", "0.76072896", "0.7590298", "0.7560...
0.7551573
22
blanks the canvas for next update
function clear_screen(){ if (tracing) return; ctx.clearRect(0, 0, cnvs.width, cnvs.height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCanvas() {\n ctx.clearRect(0, 0, 430, 430);\n fillCanvas();\n }", "function clearCanvas() {\r\n\tcanvasBackground.clear();\r\n\tcurrentFile.drawObjects.length = 0;\r\n\tpencilObj.length = 0;\r\n\t$(\"#foreground\").html(\"\");\r\n\t$(\"#foreground\").css({ 'display': 'none' });\r\...
[ "0.76332176", "0.7629053", "0.76096404", "0.7520652", "0.74107146", "0.73992115", "0.73494405", "0.73284215", "0.7308924", "0.7306159", "0.73051006", "0.7287708", "0.72819936", "0.7245801", "0.7245503", "0.72388965", "0.721924", "0.71980274", "0.7198002", "0.7170221", "0.7161...
0.6847139
100
counter for the stepping
function testmove() { var ob = getObject("testobject"); var nextpos = posseq[i % posseq.length]; ob.move(nextpos[0], nextpos[1], nextpos[2]); i++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberSteps() {\n\tlet countPlay = numMove + 1; \n\tnumMove = document.getElementById('moveCount').innerHTML = countPlay;\n}", "function initStepCounter() {\n currentStep = 0;\n var totSteps = document.getElementById(\"totalSteps\");\n var counter = document.getElementById(\"currentStep\");\n\n coun...
[ "0.6822664", "0.67547905", "0.66649663", "0.6653996", "0.6643917", "0.6575664", "0.6539912", "0.65044457", "0.64643484", "0.6424696", "0.6415097", "0.63515145", "0.63479435", "0.6342367", "0.63113296", "0.6308117", "0.62612957", "0.6249807", "0.622192", "0.6211417", "0.618620...
0.0
-1
Extract the role permissions from the JWT or use the already provided role permissions object in supplied in the constructor token parameter
extractPermissions() { let token = this.token; /* Decode the JWT if the token parameter is a string * or set permissions directly if the token is an object. * If none of the above types were sent, throw an invalid error */ if (typeof token === 'string') { try { let decoded = jwt.verify(tok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authorize(args = []) {\n let roles = args;\n\n if (typeof roles === 'string') {\n roles = [roles];\n }\n\n return (req, res, next) => {\n try {\n const { token } = req;\n const { sub, role, id } = jwt.verify(token, JWT_SECRET);\n // If there are roles and is included in the role t...
[ "0.5944255", "0.5725199", "0.5645262", "0.5580367", "0.5511797", "0.54863626", "0.548469", "0.54586035", "0.54517174", "0.5437685", "0.54122686", "0.54082096", "0.5352693", "0.5331196", "0.5323533", "0.53165334", "0.5302098", "0.52842057", "0.5281257", "0.52799314", "0.526719...
0.7492785
0
store one entry, use to display selected weekday
function init() { locationHashChanged(); displayHeader(); checkRoute(); handleDropDownClicked(); handleAddMeal(); handleCloseMeal(); handleAddDish(); handleRemoveDish(); handleMealSave(); handleMealEdit(); handleMealDelete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showEntry(day){\n var today = new Date();\n if(day == \"tomorrow\"){\n currentEntryDate = new Date(new Date().setDate(today.getDate()+1));\n } else if(day == \"today\"){\n currentEntryDate = new Date();\n } else if(day == \"yesterday\"){\n currentEntryDate = new Date(new D...
[ "0.6356752", "0.6201012", "0.59697396", "0.58604574", "0.5837845", "0.5832661", "0.58262545", "0.58078665", "0.580314", "0.569936", "0.5659474", "0.56342334", "0.56249696", "0.562342", "0.56174654", "0.56166065", "0.56084126", "0.55971336", "0.55889195", "0.5588274", "0.55582...
0.0
-1
CHECK IF TODAY'S ENTRY OR PREVIOUS ENTRY ROUTE
function checkRoute() { const targetWeek = JSON.parse(localStorage.getItem('TargetWeek')); if (targetWeek === null) { getThisWeeksEntries(); } else { getPreviousWeeksEntries(targetWeek); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDate(int,tomorrow,array){\r\n\tvar dateInfo = getTime();\r\n\tif(tomorrow){ //adjust day if needed\r\n\t\tif(dateInfo[2] == 6) {\r\n\t\t\tdateInfo[2] = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdateInfo[2] = dateInfo[2]+1;\r\n\t\t}\r\n\t}\r\n\tvar hourFloat = concot(dateInfo);\r\n\tif(finder(\"openWhen\",que...
[ "0.6484794", "0.63411516", "0.60947865", "0.6059116", "0.6026507", "0.59870344", "0.58931476", "0.58702105", "0.5824747", "0.5813437", "0.57856655", "0.57544124", "0.57063675", "0.5675403", "0.5670011", "0.56659263", "0.563447", "0.56228936", "0.56199396", "0.56188655", "0.56...
0.5712152
12
when user clicks on a date in nav
function locationHashChanged() { const urlHash = window.location.hash.substr(1); const targetWeek = JSON.parse(localStorage.getItem('TargetWeek')); if (targetWeek === null) { getThisWeeksEntries(); } else { getPreviousWeeksEntries(targetWeek); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionDateSelectedForAgendaManage(){\n\n\t}", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "_goToDateInView(date, view) {\n this.activeDate = date;\n this.currentView = view;\n }", "function openDatePicker () {\n if (dat...
[ "0.6920961", "0.6814929", "0.6814929", "0.6785301", "0.6705702", "0.6569615", "0.6552459", "0.654041", "0.64908177", "0.6487324", "0.64476895", "0.6437146", "0.6429374", "0.6420793", "0.6326563", "0.6312688", "0.62609804", "0.62506956", "0.62455237", "0.6234718", "0.6191094",...
0.0
-1
GET ENTRIES FOR 7 DAYS TO STORE
function getThisWeeksEntries() { const user = JSON.parse(localStorage.getItem('user')); const userId = user._id; const today = moment().startOf('day').toISOString(); const endDate = today; const startDate = moment(today).startOf('week').toISOString(); $.ajax({ url: `/api/entries/week/${userId}/`, type: 'GET'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEvents(day, cbSuccess, cbError) {\n\tif (day < 14 || day > 23)\n\t\tcbError(\"Invalid day requested\")\n\n\tif (!Modernizr.localstorage) {\n\t\tcbError(\"No localStorage accessible\")\n\t\treturn\n\t}\n\n\t// Manage current day\n\tvar cachedData = $.parseJSON(localStorage.getItem(\"day_\" + day));\n\ti...
[ "0.63045996", "0.62213564", "0.6126784", "0.6011704", "0.5969684", "0.5895138", "0.5894253", "0.5835983", "0.58335114", "0.5805993", "0.5755911", "0.574816", "0.57425874", "0.57092553", "0.56980276", "0.5694232", "0.5680802", "0.56754446", "0.56630623", "0.56606907", "0.56571...
0.6053751
3
GET ENTRIES FOR 7 DAYS TO STORE
function getPreviousWeeksEntries(targetWeek) { const user = JSON.parse(localStorage.getItem('user')); const userId = user._id; const startDate = moment(targetWeek).startOf('week').toISOString(); let endDate; const compareToday = moment(targetWeek).isSame(new Date(), 'week'); if (compareToday) { const today = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEvents(day, cbSuccess, cbError) {\n\tif (day < 14 || day > 23)\n\t\tcbError(\"Invalid day requested\")\n\n\tif (!Modernizr.localstorage) {\n\t\tcbError(\"No localStorage accessible\")\n\t\treturn\n\t}\n\n\t// Manage current day\n\tvar cachedData = $.parseJSON(localStorage.getItem(\"day_\" + day));\n\ti...
[ "0.6302667", "0.62205493", "0.61247396", "0.60558724", "0.6012593", "0.5969285", "0.589541", "0.5894002", "0.5835853", "0.583273", "0.58068705", "0.5755062", "0.5749889", "0.5743629", "0.57107365", "0.5696359", "0.56954014", "0.5679975", "0.5675875", "0.56630105", "0.5661846"...
0.0
-1
make api call for guild member data
function getCharacterItems(e) { let itemList = ''; let thumbnail = ''; fetch('https://us.api.battle.net/wow/guild/Stormrage/MERCENARIES%20FOR%20AZEROTH?fields=members&locale=en_US&apikey=yku5p7jc26x5pnnj9qy73ufdfh48pgqj') .then(res => res.json()) .then(guild => { guild.members.forEach(member => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function member(authToken) {\n let responseData = {};\n\n try {\n const address = `${apiConfig.URL_SCHEME}://${apiConfig.IP}:${apiConfig.PORT}${apiConfig.EXT}/boardInfo/member`;\n const settings = {\n headers: {\n Authorization: authToken,\n },\n };\n\n const response = await a...
[ "0.6523479", "0.6211551", "0.60751444", "0.6023187", "0.59097373", "0.59045386", "0.5853261", "0.5845319", "0.5845319", "0.58223087", "0.5780708", "0.57437044", "0.57316977", "0.57310534", "0.57308847", "0.572237", "0.570159", "0.56941426", "0.5567677", "0.55611736", "0.55501...
0.0
-1
Displays the warning modal
function warn() { modal.style.display = 'block'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayWarning(modal, title, message, yesButtonText, yesButtonHandler, noButtonText, noButtonHandler) {\r\n\tyesButtonText = yesButtonText || \"YES\";\r\n\tnoButtonText = noButtonText || \"NO\";\r\n\tnoButtonHandler = noButtonHandler || closeModal;\r\n\t$(modal + \" .modalHeader .modalHeaderCenter h2\").t...
[ "0.7607568", "0.7276568", "0.71941876", "0.7179187", "0.71761656", "0.71044683", "0.70656645", "0.70272744", "0.6994323", "0.69355774", "0.69205886", "0.6913067", "0.68975616", "0.68389875", "0.68381774", "0.6826543", "0.679678", "0.67683667", "0.6752988", "0.67326665", "0.66...
0.8194572
0
Alerts the user that the timer has ended
function playDoneSound() { var audio = new Audio('sound/alarmsound.mp3'); audio.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countDownTimeOut() {\n setNormalTimer(true)\n setTimeOut(true)\n setIsPlaying(false)\n Alert.alert(\"Time Out!\", \"Would You Like to Continue With Normal Timer?\", [\n {\n text: \"Give Up - Back To Home\",\n onPress: () => {dispatch(setFinished(true)); navigat...
[ "0.7177108", "0.7079157", "0.7059867", "0.7021935", "0.69854164", "0.6943413", "0.6936497", "0.6903015", "0.6887975", "0.68587863", "0.6812434", "0.67727673", "0.6744301", "0.67284137", "0.6720455", "0.67194456", "0.67048526", "0.6697493", "0.66730905", "0.66681194", "0.66429...
0.0
-1
Found this nifty code on changed it a little bit / Takes a num and returns a time string in HH:MM:SS format
function converNumToTimeString (num) { var sec_num = parseInt(num, 10); // don't forget the second param var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - (hours * 3600)) / 60); var seconds = sec_num - (hours * 3600) - (minutes * 60); if (hours < 10) {hours = "0" + h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function time(num)\r\n { \r\n var hours = Math.floor(num / 60); \r\n var minutes = num % 60;\r\n return hours + \":\" + minutes; \r\n}", "function timeString(num) {\n return (num < 10 ? '0' : '') + num;\n }", "function timeConvert(num) { \n if (num < 60) {\n return \"0:\" + String(num);\n }\n...
[ "0.8340869", "0.8240731", "0.82297486", "0.8172928", "0.8032566", "0.8015701", "0.80019677", "0.7956353", "0.7944958", "0.7874052", "0.78693724", "0.78627914", "0.78585476", "0.7851677", "0.7842079", "0.78405577", "0.782986", "0.7824321", "0.7794324", "0.7787374", "0.77872664...
0.84306973
0
function to prompt the options to manger
function start() { console.log( chalk.magenta.bold( '--~~~--~~~--~~~--~~~ WELCOME TO BAMAZON INVENTORY CONTROL ~~~--~~~--~~~--~~~--' ) ); inquirer .prompt([ { type: 'list', name: 'inventoryOption', message: 'What would you like to do?', choices: [ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function managerOptions() {\n inquirer.prompt([\n {\n name: \"option\",\n message: \"Hello, random manager. What would you like to do today?\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Pro...
[ "0.75947285", "0.7565368", "0.7394442", "0.7369746", "0.7349788", "0.73051107", "0.7274854", "0.71635365", "0.70839876", "0.69602054", "0.6944301", "0.6942398", "0.69280285", "0.6850583", "0.6847442", "0.6840706", "0.6762587", "0.6761438", "0.6707346", "0.67058307", "0.669296...
0.0
-1
This is the reactive property function that gets returned.
function reactiveProperty(newValue){ // Check for too many arguments. if(arguments.length > 1) { throw Error(errors.tooManyArgsSetter); } // This implements the setter part of the setter-getter. if(arguments.length === 1){ // Grab the old value for passing into...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get property(){}", "get () {\n }", "get property() {\n return super.property;\n }", "get() {\n return this.value\n }", "get active() {\n return this.#active;\n }", "static get property(){}", "get() {\n return this.value;\n }", "get() {\n return this.value;\n }", "get() {\...
[ "0.69745624", "0.68669844", "0.6791722", "0.6732385", "0.6704372", "0.6666782", "0.6635999", "0.6635999", "0.6635999", "0.6635999", "0.66293985", "0.66293985", "0.6414843", "0.6387731", "0.636944", "0.6363697", "0.6360901", "0.6329627", "0.6319184", "0.6277798", "0.62352693",...
0.63148814
19
This is the AJAX function, used to determine if an HTML file exists. It uses a callback function to modify the necessary HTML Element. Essentially, the AJAX will execute, and once it's done, it will return a boolean the specified function. It's that function that will modify the TABLE element.
function urlExists(url, callback){ $.ajax({ type: 'HEAD', url: url, success: function(){ callback(true); }, error: function() { callback(false); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnCheckFileExists(filename)\n{\n\t$.ajax({\n\t //url:\"logs/\"+filename,\n url:filename,\n\t type:'HEAD',\n\t\t async: false,\n\t error: function()\n\t \t{\n\t\t\tcheckFileExistsStatus = false;\n\t\t\treturn false;\n\t\t},\n\t success: function()\n\t \t{\n\t\t\tcheckFileExistsStat...
[ "0.6440997", "0.6177554", "0.6105317", "0.5963949", "0.59464735", "0.58307487", "0.5747952", "0.5695929", "0.5611687", "0.55917585", "0.5562774", "0.5547352", "0.5545038", "0.54753184", "0.5473416", "0.54660344", "0.54414326", "0.54136175", "0.5411703", "0.53718305", "0.53601...
0.5723653
7
Funcion para obtener todas las materias
function obtenerMaterias(){ $.ajax({ url : '/materias-all', method : 'GET', }) .done(function(response){ if(response.length > 0){ let template = ''; response.forEach((element, index) => { template += ` ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMatieres(req, res){\n Matiere.find((err, matieres) => {\n if(err){\n res.send(err)\n }\n\n res.send(matieres);\n });\n}", "get allMillennialVampires() {\n \n }", "function obt_medicines(queryData, funcion){\n\tconsole.log(\"Realiza funcion obtener medicinas...
[ "0.5735768", "0.56199086", "0.5445853", "0.54215944", "0.5391958", "0.52916384", "0.5288359", "0.5263301", "0.5217668", "0.5209085", "0.51570195", "0.5147397", "0.51411116", "0.51402193", "0.5136708", "0.5123095", "0.5121069", "0.5105102", "0.509347", "0.5084879", "0.5067848"...
0.6632629
0
for JSONP translate api
function addScript(src) { var elem = document.createElement("script"); elem.src = src; document.head.appendChild(elem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate(wordToTranslate, origin, destination) {\r\n $.getJSON(\"http://glosbe.com/gapi/translate?from=\" + origin + \"&dest=\" + destination + \"&format=json&phrase=\" + wordToTranslate.text() + \"&pretty=true&callback=?\", function (json) {\r\n if (json !== \"Nothing found.\") {\r\n ...
[ "0.66617996", "0.66382974", "0.6593405", "0.64693636", "0.64274335", "0.6311173", "0.63026375", "0.628022", "0.62782884", "0.6196872", "0.6175725", "0.6159275", "0.6123286", "0.60825866", "0.6056613", "0.6049543", "0.6019354", "0.6019216", "0.6003419", "0.59911996", "0.597404...
0.0
-1
Handler to register user
function registerUser(newUserObj, done) { logger.info("Inside service method - register user"); newUserObj.userId = uuidv4(); usersDao.addUser(newUserObj, done); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register() {\n User.register(self.user, handleLogin);\n }", "function registerUser() {\n addUser()\n }", "async registerUser(userInfo) {}", "function registerUser(ev) {\n ev.preventDefault();\n let registerUsername = $('#registerUsername');\n let registerName = $('...
[ "0.8213138", "0.80815554", "0.7796619", "0.76008534", "0.75842625", "0.75074565", "0.74321026", "0.7355835", "0.7348403", "0.7337956", "0.7319194", "0.72998166", "0.72995603", "0.7275625", "0.72606045", "0.72567654", "0.72397137", "0.7230194", "0.722471", "0.72092205", "0.719...
0.0
-1
Handler to find user by email id
function findUser(emailId, done) { logger.info("Inside service method - find user by email id"); usersDao.getUserbyEmail(emailId, done); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUser(emailId, callback) {\n this.User.findOne({emailId: emailId})\n .exec()\n .then(function (foundUser) {\n callback(foundUser);\n });\n }", "function getUserByEmail(req, res, next){\n userModel.getUserByEmail(req.query.email)\n .then(function(data)...
[ "0.76744336", "0.7635818", "0.7505204", "0.74229544", "0.72788763", "0.7275622", "0.7273908", "0.7247214", "0.7222827", "0.7214184", "0.72058445", "0.719927", "0.71779937", "0.7156597", "0.7139545", "0.71197945", "0.71098214", "0.7108792", "0.7106213", "0.708546", "0.70728266...
0.7407693
4
Handler to find user by user id
function findUserById(userId, done) { logger.info("Inside service method - find user by id"); usersDao.getUserbyId(userId, done); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "user(_, { id }) {\n return User.find(id);\n }", "function findUserById(req, res) {\n var userId = req.params['userId'];\n\n userModel\n .findUserById(userId)\n .then(function (user) {\n res.json(user);\n });\n\n }", "function findUserById...
[ "0.7643242", "0.7620529", "0.7606407", "0.76008034", "0.7491358", "0.74537766", "0.7444283", "0.73919225", "0.73849165", "0.7382397", "0.7380041", "0.7362789", "0.73351914", "0.7306758", "0.72927564", "0.7284403", "0.72806484", "0.7223875", "0.72166055", "0.7197202", "0.71950...
0.695879
40
Handler to share notes to user
function shareNoteToUser(userId, noteId, done) { logger.info("Inside service method - share notes to user"); usersDao.addNoteToUser(userId, noteId, done); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handler () {\n notes.addNote(title, body);\n }", "function shareUserToNote(userId, noteId, accessType, done) {\n logger.info(\"Inside service method - share notes\");\n notesDao.addUserToNote(userId, noteId, accessType, done);\n}", "handler(argv) {\n notes.addNote(argv.title,argv.body)\n ...
[ "0.6939456", "0.6864643", "0.659061", "0.64427036", "0.64362705", "0.62951374", "0.60991424", "0.60842943", "0.6047421", "0.60244596", "0.60230666", "0.60036266", "0.5991764", "0.5958152", "0.5908776", "0.58980143", "0.589604", "0.5892207", "0.5883408", "0.5876685", "0.585893...
0.6746071
2
Handler to unshare notes from user
function unShareNoteFromUser(userId, noteId, done) { logger.info("Inside service method - unshare notes from user"); usersDao.removeNoteFromUser(userId, noteId, done); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handler(argv) {\n notes.removeNote(argv.title)\n // console.log('Removing the note')\n }", "function logout(){\n if(conn_id !=null ){\n\n if(sharing_student == conn_id){//this student is being shared, need to notify teacher\n var student ={\n 'people_id':conn_id,\n ...
[ "0.6495836", "0.63942474", "0.5909016", "0.5882216", "0.5863067", "0.5782627", "0.57312465", "0.57311636", "0.5728911", "0.5685085", "0.5669451", "0.5661033", "0.56319076", "0.5578378", "0.5578378", "0.55337316", "0.55281174", "0.5509757", "0.5509378", "0.5498368", "0.5497325...
0.7055128
0
Loading sample data to the collection. It is called in the DB.mixin after the database connection establishing & the collection is empty.
async seedDB() { await this.adapter.insertMany([ { name: "Samsung Galaxy S10 Plus", quantity: 10, price: 704 }, { name: "iPhone 11 Pro", quantity: 25, price: 999 }, { name: "Huawei P30 Pro", quantity: 15, price: 679 }, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initData() {\n this.db.listCollections().toArray((err, info) => {\n if (err) {\n console.log(err);\n return;\n }\n console.log(\"collections\", info.length, info);\n if (info.length === 0) {\n this.seedData();\n }\n });\n }", "function loadFixture(data, collec...
[ "0.6972527", "0.6719397", "0.6604066", "0.6442934", "0.63969225", "0.6197649", "0.613533", "0.61112076", "0.6068696", "0.6043665", "0.6040342", "0.60048115", "0.6002565", "0.5978077", "0.59590006", "0.5953708", "0.5931058", "0.5866361", "0.5833466", "0.58225393", "0.5797679",...
0.53844386
43
Fired after database connection establishing.
async afterConnected() { // await this.adapter.collection.createIndex({ name: 1 }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onConnectionOpen() {\n fs.readdirSync(path.resolve(__dirname, '../', 'models')).forEach(function (file) {\n require(`../models/${file}`);\n });\n console.log('Database connection successful');\n}", "function onDeviceReady() {\n \n db.transaction(populateDB, errorCB, successCB...
[ "0.66400313", "0.641346", "0.64118177", "0.63924587", "0.6386081", "0.6372042", "0.6352106", "0.6352106", "0.6316173", "0.6316167", "0.6311983", "0.62450945", "0.61954826", "0.6182201", "0.617041", "0.6135739", "0.6096625", "0.6086941", "0.60544944", "0.60359246", "0.6007354"...
0.0
-1
Return a promise; resolve once modules have loaded
function load () { const modules = registerModules(api) api.modules = modules return Promise.resolve(modules) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolve() {\n var promises = [];\n var args = flatten(arguments);\n for (var i = 0; i < args.length; i ++) {\n promises.push(Esquire.resolve(args[i], true, true));\n }\n\n /* Await for resolution of dependencies */\n return Promise.all(promises).then(function(result) {\n var mo...
[ "0.7021769", "0.70141006", "0.6729327", "0.6639082", "0.6519164", "0.6448496", "0.6423394", "0.6418123", "0.6382348", "0.63671476", "0.6321541", "0.6206907", "0.61743915", "0.6014623", "0.5991118", "0.59756327", "0.5967465", "0.5951517", "0.5950185", "0.59471345", "0.59471345...
0.7092074
0
Create listeners for all events.
loadEventListeners() { /********************************** * Watch tokens minted event below * **********************************/ this.state.token.LogTokensMinted({ fromBlock: 'latest', toBlock: 'latest' }) .watch((err, res) => { console.log(`Tokens Minted! TxHash: https://kovan.etherscan.io/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createListeners() {\n\n this.listenDeleteAllFiltersOptions();\n\n this.listenMainInputOnType();\n\n this.listenClickFilterOption();\n\n this.listenDeleteFilter();\n\n this.listenMainInputOnFocus();\n\n this.listenMainInputOnBlur();\n\n this.listenClickModalFilter();...
[ "0.7474072", "0.7262588", "0.72459424", "0.7155504", "0.696653", "0.69082296", "0.6871134", "0.6787983", "0.6784198", "0.676285", "0.67352927", "0.6726042", "0.6697574", "0.6677279", "0.66603464", "0.66543937", "0.6604338", "0.65685225", "0.65637434", "0.653011", "0.65166473"...
0.0
-1
Load all orders into the order book via exchange events
loadOrderBook() { this.state.exchange.LogOrderSubmitted({}, {fromBlock: 0, toBlock: 'latest'}) .get((err, orders) => { for (let i = 0; i < orders.length; i++) { // confirm the order still exists then append to table this.state.exchange.orderBook_(orders[i].args.id, (err, order) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadOrders(){\n orderService.orders().then(function(data){\n all_orders = data;\n povoateTable();\n setupDeleteListener();\n })\n}", "function getAllOrders() {\n\tsocket.on('db', function(data) {\n\t\tallOrders = data.db;\n\t});\n}", "function loadOrders(){\n\t\t$.get(\"get_...
[ "0.6812702", "0.67213637", "0.6444701", "0.6270708", "0.62352324", "0.62056273", "0.6154619", "0.6082203", "0.59805906", "0.58782667", "0.5828127", "0.5805187", "0.57723117", "0.57353425", "0.570806", "0.5694862", "0.5691461", "0.5678709", "0.5675929", "0.56607753", "0.562179...
0.7114444
0
Submit a new order to the order book.
submitOrder() { // First give the exchange the appropriate allowance // NOTE if the submitOrder fails the exchange still has the allowance this.state.token.approve( this.state.exchange.address, this.state.bidAmount*10**this.state.tokenDecimals, { from: this.web3.eth.accounts[this.state.d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async submit(ev) {\n const { orderId, orderInfo, stripeCharge, history } = this.props;\n\n if (isEmpty(orderInfo)) {\n toast.info(\"Order not made yet. Please go back and try again!\", {\n position: toast.POSITION.TOP_CENTER\n });\n } else {\n let { token } = await this.props.stripe....
[ "0.6820572", "0.67152274", "0.6525468", "0.65245235", "0.6385662", "0.63174766", "0.6311187", "0.6265486", "0.6260277", "0.61516", "0.61200595", "0.606583", "0.6057871", "0.6045188", "0.60434306", "0.60369295", "0.59931207", "0.59802127", "0.59631205", "0.5960352", "0.5945801...
0.59634316
18
_DEFINE MAIL OPTIONS This method comiles all the required information into a single object
function _defineMailOptions(to, from, cc, subject, body, attch) { return { from: from, to: to, cc: cc, subject: subject, text: body.plainText, html: body.htmlText }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mailOptions(moneda, texto, mails) {\n return {\n from: '\"Fred Foo 👻\" <mail@mail.com>', // sender address //todo sender\n to: mails.join(', '), // list of receivers\n subject: `Alerta ${moneda}`, // Subject line\n text: texto, // plain text body\n };\n }", "sendMail(options) {}", "...
[ "0.6358757", "0.59990644", "0.58754534", "0.5718587", "0.56254154", "0.56049466", "0.5501807", "0.53644836", "0.53397447", "0.52825594", "0.5281263", "0.5270805", "0.5249233", "0.5181623", "0.5166763", "0.51453066", "0.51325405", "0.5114757", "0.5110848", "0.51037776", "0.509...
0.7551804
0
SEND This method composes and sends an email
function send(to, from, cc, subject, body, attch) { //build the mail options var mailOptions = _defineMailOptions(to, from, cc, subject, body, attch); //return async work return new Promise(function(resolve, reject) { console.log('sending mail'); //send mail with the defined transport object TRANSPORTER.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "async send(data) {\n const from = data.username;\n // 1) Render HTML based on a pug template\n if (!data.template) data.template = \"general\";\n\n const html = pug.renderFile(`${__dirname}/../views/email/${data...
[ "0.74316025", "0.71801716", "0.70347667", "0.6996827", "0.69617045", "0.69406945", "0.6897136", "0.6896438", "0.6824455", "0.68202645", "0.68119377", "0.6809229", "0.6805231", "0.6803455", "0.6775757", "0.6762394", "0.67457813", "0.6739347", "0.6729238", "0.6721419", "0.67138...
0.66002965
26
Objeto Nombre: Ruleta, Propiedades: Metodos:
function Ruleta(){ Ruleta.prototype.tirar = function(){ return Math.floor((Math.random() * _numCasilleros)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Ruleta(opciones, lienzoRuleta)\n{\n opcionesDefecto = {\n 'canvasCc' : 'canvas1', // Id of the canvas1 which the wheel is to draw on to.\n 'centroX' : null, // X position of the center of the wheel. The default of these are null which means will be placed in...
[ "0.60954064", "0.5988693", "0.5843432", "0.57225716", "0.57008123", "0.5700237", "0.56574905", "0.5624514", "0.5608383", "0.54827857", "0.5471464", "0.546599", "0.545639", "0.54095495", "0.53761005", "0.53689957", "0.53657144", "0.53368646", "0.53303534", "0.52998024", "0.529...
0.54572886
12
Objeto Nombre: Credito, Propiedades: private integer saldo Metodos:
function Credito(){ var saldo=_saldo; Credito.prototype.getSaldo = function(){ return saldo; } Credito.prototype.incrementar = function(n){ saldo += n; } Credito.prototype.disminuir = function(n){ saldo -= n; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get saldo() {\n\t\treturn this.ingreso - this.deuda\n\t}", "function debitObligatoire(sum) {\n\t$('#btnBuy').attr('disabled', 'disabled');\n\t$('#btnFinTour').attr('disabled', 'disabled');\n\t$('#btnSell').attr('disabled', 'disabled');\n\t$('#btnUpgrade').attr('disabled', 'disabled');\n\n\tif (sentJson.account <...
[ "0.6823762", "0.6625475", "0.6398299", "0.6321491", "0.62216574", "0.6194253", "0.61774635", "0.6162236", "0.6133926", "0.6122236", "0.61005276", "0.5972774", "0.59311646", "0.59184223", "0.59059954", "0.5858228", "0.58505315", "0.58424693", "0.5837514", "0.5813358", "0.57828...
0.7174145
0
Objeto Nombre: Apuesta, Propiedades: Metodos:
function Apuesta(){ var valor;//declaracion variable private var tipo; var casillero; //declaracion variable static para contar instancias del objeto if ( typeof Apuesta.nApuestas == 'undefined' ) { Apuesta.nApuestas = 0; } ++Apuesta.nApuestas; Apuesta.prototype.getNapuestas = function(){ return Apu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculoYMuestroPropuestas (datos) {\n\n \tconst tasaA = objTasas.tasaA;\n \tconst tasaB = objTasas.tasaB;\n \tconst tasaC = objTasas.tasaC;\n\n \tconst propuestaA = new Propuesta(datos.valor_inmueble, datos.monto_credito, datos.plazo, tasaA.tasa_anual, tasaA.comision_apertura_porcentaje, tasaA.comisio...
[ "0.64347166", "0.642561", "0.6215651", "0.5840358", "0.572298", "0.5700871", "0.56785405", "0.56702095", "0.5621305", "0.55924636", "0.55718654", "0.55679107", "0.55510813", "0.5521797", "0.5520121", "0.55184263", "0.5509153", "0.5500023", "0.54965776", "0.5480884", "0.547378...
0.70898217
0
Objeto Nombre: Juego, Propiedades: Metodos:
function Juego(){ this.tablero = new Tablero(); this.listaApuestas=[]; this.listaCuadros; this.flag=""; this.credito = new Credito(); this.revancha=false; Juego.prototype.iniciar = function(){ this.listaCuadros=this.tablero.crear(); this.tablero.redraw(); this.ocultarTodos(); var select=document.getE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "function Propiedades() {\n this.texto = \"Palabra\";\n console.log(\"this.texto\", this.texto);\n this.numero = 5;\n ...
[ "0.67803204", "0.6700877", "0.66604483", "0.6584072", "0.65001225", "0.6464344", "0.6412755", "0.63559794", "0.6340887", "0.6313214", "0.63097095", "0.6306097", "0.6293123", "0.6245858", "0.6204475", "0.62034154", "0.6069744", "0.6066642", "0.6044088", "0.6037597", "0.6011063...
0.0
-1
Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function myFunction() { if (window.pageYOffset >= sticky) { navbar.classList.add("sticky") } else { navbar.classList.remove("sticky"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stickyScroll() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function navfixedScroll() {\n if (window.pageYOffset > sticky+200) {\n navbar.classList.add...
[ "0.89610565", "0.8700405", "0.8650548", "0.85641605", "0.852811", "0.8515302", "0.8434557", "0.8410528", "0.84083074", "0.83688575", "0.8313112", "0.8286574", "0.8273387", "0.8266388", "0.8265736", "0.82545966", "0.82478327", "0.82242423", "0.82242423", "0.82242423", "0.82210...
0.8219485
24
Function to calculate layer offset
function getOffset(z_index) { // Calculate the amount you want the layers to move based on touch or mouse input. // You can play with the touch_multiplier variable here. Depending on the size of your canvas you may want to turn it up or down. const touch_multiplier = 0.35; const touch_offset_x = pointer.x * z_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "getOffsetAt(layerID, out = null) {\n if (!out) out = new Point()\n\n out.x = this.compositeEffect.getLayerAt(layerID).x\n out.y = this.compositeEffect.getLayerAt(layerID).y\n\n return out\n }", ...
[ "0.73510635", "0.6550552", "0.65257645", "0.6473226", "0.63955194", "0.6363454", "0.6350071", "0.6265532", "0.62523544", "0.62429345", "0.6230642", "0.61745423", "0.6076272", "0.6065721", "0.6065721", "0.6065146", "0.6012655", "0.60103774", "0.6005775", "0.60048693", "0.60025...
0.62481636
9
Runs when touch or mouse click starts
function pointerStart(event) { // Ok, you touched the screen or clicked, now things can move until you stop doing that moving = true; // Check if this is a touch event if (event.type === "touchstart") { // set initial touch position to the coordinates where you first touched the screen pointer_initial.x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function touchStarted() {\n touch_start = true;\n mousePressed() \n mouseClicked()\n}", "function onTouchStarted(eventData)\n{\n isTouching = true;\n}", "function touchStarted() {\n\tisTouchDevice = true;\n}", "function dnd_TouchStart()\n{\n\tvar e;\n\tvar rect;\n\n\tvar i;\n\n\tvar tx;\n\tvar ...
[ "0.81615853", "0.76214266", "0.7553709", "0.7510287", "0.7455035", "0.73604417", "0.7265074", "0.7262824", "0.72599846", "0.725249", "0.7237911", "0.7234126", "0.7182554", "0.7167542", "0.715162", "0.71396405", "0.7108116", "0.7091514", "0.70788634", "0.70436233", "0.70436233...
0.6704322
58
Runs when touch or mouse is moved
function pointerMove(event) { // This is important to prevent scrolling the page instead of moving layers around event.preventDefault(); // Only run this if touch or mouse click has started if (moving === true) { let current_x = 0; let current_y = 0; // Check if this is a touch event if (event.t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function touchMoved() {\n // do some stuff\n return false;\n }", "function sketchpad_touchMove(e) { \n // Update the touch co-ordinates\n getTouchPos(e);\n\n // During a touchmove event, unlike a mousemove event, we don't need to check if the touch is engaged, since there will always ...
[ "0.7456434", "0.73646367", "0.73470247", "0.73470247", "0.73470247", "0.73366827", "0.73266673", "0.73219645", "0.7314798", "0.7307009", "0.7279179", "0.7240145", "0.7225442", "0.7210945", "0.71926737", "0.71187735", "0.71081686", "0.7082312", "0.70778227", "0.705805", "0.703...
0.65202594
95
const deck = this.props;
render(props){ const {deck,title,strategy} = this.props; return( <div className = "deck"> <h2>{title}</h2> {deck.map((card,i) => <Card {...this.props} key = {i} i = {i} card = {card}/>)} <h3>Strategy</h3> <p className = "deck-strategy">{strategy}</p> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get card() {\n return this.props.card;\n }", "function mapStateToProps(state) {\n return {\n cardList: state.activeDeck.deck\n };\n}", "prepDeck() {\n const { CARD_SUITS, CARD_VALUES } = this.props;\n\n const deck = [];\n CARD_SUITS.forEach(suit => {\n CARD_VALUES.forEach(value => ...
[ "0.775648", "0.7191123", "0.6870679", "0.6851983", "0.68452275", "0.6837349", "0.6824792", "0.6824502", "0.6541878", "0.6507832", "0.65029466", "0.646315", "0.6459959", "0.64480907", "0.63983274", "0.63905734", "0.63894945", "0.6372853", "0.6363875", "0.6356653", "0.6348304",...
0.7467705
1
render() is a required function for our component React will invoke this function when it mounts the component
render() { // The render needs to return JSX. // JSX is bascially HTML, but you can use components as well, // for example, when we render this card, we do so in the // Game component by using <Card /> // Props become and object so, className="foo", becomes { className : "foo"} // on this.props,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n this.render()\n\n }", "render() {\r\n return <div />\r\n }", "render() {\n return <div />\n }", "render(){\n //esto es lo que te devuelve esta funcion\n return <div></div>;\n }", "render() {\n return <div></div>;\n }", "render() {\n return(<div ...
[ "0.8093806", "0.79293096", "0.7802954", "0.76837903", "0.76651305", "0.7639189", "0.76313347", "0.7627755", "0.74531496", "0.7419403", "0.74125874", "0.73925143", "0.73409986", "0.7283458", "0.7205412", "0.71945477", "0.71862495", "0.71862495", "0.7177452", "0.7173485", "0.71...
0.0
-1
const LIST = [0 ,100, 200, 300, 500, 40000000];
function median_calcule(list){ list = list.sort((a,b) => a - b) console.log(list) const midle_list = parseInt(list.length / 2); function is_list_even(number){ if (number % 2 === 0){ return true; } else { return false; } } let median; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_list(l) {\n let nums = Array(1000).fill().map((e,i)=>i+1);\n nums.push(0);\n let result = [];\n for(let i=0; i<l.length; i++){\n if(nums.includes(l[i])){\n result.push(l[i])\n }\n }\n return result;\n}", "function tenList(list, p, valor) {\n var list = sendMap(list, p, valor...
[ "0.6510304", "0.64222515", "0.638467", "0.62901425", "0.59102434", "0.58886397", "0.5844962", "0.5787728", "0.5772576", "0.571564", "0.568588", "0.5628423", "0.5627901", "0.55875885", "0.5583791", "0.558061", "0.55431205", "0.5541123", "0.55235976", "0.5519175", "0.550095", ...
0.0
-1
Script: jfather.js Description: Functions to serialize/unserialize objects Author: Max Power Version: 1.0 Date: 10/09/2010 Class:JFather Description:Serialize/Unserialize objects
function JFather() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get serializedObject() {}", "function Serializer() {\n //TODO: preserve references to same objects\n var self = this, vars = [], deps = {}, depCount = 0;\n this.serialize = serialize;\n this.vars = vars;\n\n function serialize(o) {\n\n //TODO: use references to objects\n\n if (isArra...
[ "0.68647116", "0.66590726", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", "0.6598404", ...
0.0
-1
Removes the trailing slash of a path if there is one. Preserves the root path `/`.
function removePathTrailingSlash(path) { return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeTrailingSlash(path) {\n return path.replace(/[/\\\\]+$/, '');\n}", "function rtrim(path) {\n\t\treturn _.str.rtrim(path, \"/\");\n\t}", "function ensureTrailingSlash(path) {\n return path.endsWith(\"/\") ? path : path + \"/\";\n}", "function removeTrailingDirectorySeparator(path) {\n ...
[ "0.8183537", "0.76394737", "0.7634813", "0.7630832", "0.74765897", "0.7307071", "0.7307071", "0.7225244", "0.7206773", "0.7177472", "0.71762687", "0.71762687", "0.71762687", "0.71762687", "0.71762687", "0.71660686", "0.7164059", "0.711366", "0.711366", "0.711366", "0.711366",...
0.8441131
18
It'd be best to stop exporting this. It's an implementation detail. We're only exporting it for backwards compatibilty with the `pageloader`. Only cache this response as a last resort if we cannot eliminate all other code branches that use the Build Manifest Callback and push them through the Route Loader interface.
function getClientBuildManifest() { if (self.__BUILD_MANIFEST) { return Promise.resolve(self.__BUILD_MANIFEST); } var onBuildManifest = new Promise(function (resolve) { // Mandatory because this is not concurrent safe: var cb = self.__BUILD_MANIFEST_CB; self.__BUILD_MANIFEST_CB = function () { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadPage(rawPath){const pagePath=Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\"findPath\"])(rawPath);if(this.pageDb.has(pagePath)){const page=this.pageDb.get(pagePath);return Promise.resolve(page.payload);}if(this.inFlightDb.has(pagePath)){return this.inFlightDb.get(pagePath);}const inFlight=Promise.all([this.l...
[ "0.57678956", "0.57678956", "0.57080084", "0.55319226", "0.54264075", "0.5416864", "0.5416864", "0.53812265", "0.53577936", "0.5356763", "0.53309864", "0.53309864", "0.5311969", "0.53091663", "0.5302229", "0.53021204", "0.526643", "0.52546006", "0.5244544", "0.5244544", "0.52...
0.0
-1
returns a function for filtering head child elements which shouldn't be duplicated, like Also adds support for deduplicated `key` properties
function unique() { var keys = new Set(); var tags = new Set(); var metaTypes = new Set(); var metaCategories = {}; return function (h) { var isUnique = true; var hasKey = false; if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) { hasKey = true; var key = h.key.slice(h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dedupeSeen() {\n if (this.isEmpty()) {\n return this;\n }\n\n const seen = {};\n let runner = this.head;\n seen[this.head.data] = true;\n\n while (runner && runner.next) {\n if (seen.hasOwnProperty(runner.next.data)) {\n runner.next = runner.next.next;\n } else {\n se...
[ "0.571847", "0.5487058", "0.5400345", "0.53828883", "0.527172", "0.5270638", "0.52649933", "0.5224878", "0.5223402", "0.5223402", "0.5223402", "0.521879", "0.52147794", "0.52147794", "0.52147794", "0.52147794", "0.52147794", "0.52147794", "0.52147794", "0.52147794", "0.521477...
0.51402414
37
This component injects elements to `` of your page. To avoid duplicated `tags` in `` you can use the `key` property, which will make sure every tag is only rendered once.
function Head(_ref) { var children = _ref.children; var ampState = (0, _react.useContext)(_ampContext.AmpStateContext); var headManager = (0, _react.useContext)(_headManagerContext.HeadManagerContext); return /*#__PURE__*/_react["default"].createElement(_sideEffect["default"], { reduceComponentsToState: red...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisplayTags(props) {\n let dispArr = [];\n clothing.tags.forEach(element => {\n dispArr.push(<div> - {element} </div>);\n });\n\n return (\n <div>{dispArr}</div>\n );\n }", "render() {\n return [\n \"Some text.\",\n <h2 key=\"heading-1\">A heading</h2>,\n ...
[ "0.63119", "0.61855817", "0.6155112", "0.56447935", "0.5621291", "0.56128496", "0.55026406", "0.54639494", "0.5438886", "0.54160297", "0.5408958", "0.5400442", "0.5377898", "0.5342119", "0.53378916", "0.5332815", "0.5310332", "0.5298507", "0.529667", "0.52720606", "0.52555525...
0.0
-1
MIT License Copyright (c) Jason Miller ( Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut...
function mitt() { var all = Object.create(null); return { on: function on(type, handler) { ; (all[type] || (all[type] = [])).push(handler); }, off: function off(type, handler) { if (all[type]) { all[type].splice(all[type].indexOf(handler) >>> 0, 1); } }, emit: fun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Utils() {}", "function Utils() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);el...
[ "0.5445532", "0.5445532", "0.54254943", "0.54254943", "0.541232", "0.53875417", "0.531241", "0.52768654", "0.52768654", "0.52768654", "0.52768654", "0.5262506", "0.5258644", "0.5244575", "0.5221693", "0.5221693", "0.5191524", "0.5176642", "0.51576704", "0.51507103", "0.515071...
0.0
-1
Detects whether a given url is routable by the Next.js router (browser only).
function isLocalURL(url) { // prevent a hydration mismatch on href for url with anchor refs if (url.startsWith('/') || url.startsWith('#') || url.startsWith('?')) return true; try { // absolute urls can be local if they are on the same origin var locationOrigin = (0, _utils.getLocationOrigin)(); var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canRoute(url) {\n\tfor (var i = ROUTERS.length; i--;) {\n\t\tif (ROUTERS[i].canRoute(url)) return true;\n\t}\n\treturn false;\n}", "function canRoute(url) {\n\tfor (var i = ROUTERS.length; i--;) {\n\t\tif (ROUTERS[i].canRoute(url)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function canR...
[ "0.68352807", "0.67967844", "0.67967844", "0.67967844", "0.67967844", "0.677482", "0.64716387", "0.638162", "0.63316905", "0.62876475", "0.6255582", "0.62307817", "0.62307817", "0.6143045", "0.613459", "0.6097652", "0.6080661", "0.6070064", "0.5880203", "0.5866608", "0.585099...
0.0
-1
Resolves a given hyperlink with a certain router state (basePath not included). Preserves absolute urls.
function resolveHref(router, href, resolveAs) { // we use a dummy base url for relative urls var base; var urlAsString = typeof href === 'string' ? href : (0, _utils.formatWithValidation)(href); try { base = new URL(urlAsString.startsWith('#') ? router.asPath : router.pathname, 'http://n'); } catch (_) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveHref(currentPath, href, resolveAs) {\n // we use a dummy base url for relative urls\n var base = new URL(currentPath, 'http://n');\n var urlAsString = typeof href === 'string' ? href : (0, _utils.formatWithValidation)(href); // Return because it cannot be routed by the Next.js router\n\n if (!i...
[ "0.6116957", "0.6116957", "0.6116957", "0.6116957", "0.6116957", "0.6116957", "0.6116957", "0.6077001", "0.6077001", "0.6077001", "0.6077001", "0.6077001", "0.60475135", "0.60475135", "0.6040217", "0.6040217", "0.60355747", "0.6027559", "0.5896182", "0.57660264", "0.57660264"...
0.65395296
0
Map of all components loaded in `Router` Static Data Cache Inflight Server Data Requests, for deduping
function Router(_pathname, _query, _as, _ref) { var _this = this; var initialProps = _ref.initialProps, pageLoader = _ref.pageLoader, App = _ref.App, wrapApp = _ref.wrapApp, Component = _ref.Component, err = _ref.err, subscription = _ref.subscription, isF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get cache() {\n let res = new Map();\n this.all().forEach(x => res.set(x.ID, x.data));\n return res;\n }", "loadStaticRoutes () {\n LOG.debug(`location.RouteLoader.loadStaticRoutes [loading static routes]`)\n const ds = DSSelector.getDS()\n const numbersAPI = new NumbersAPI(ds)\n...
[ "0.5855903", "0.58440864", "0.5696772", "0.5696772", "0.566051", "0.5615975", "0.5510682", "0.5402514", "0.5396061", "0.53824353", "0.535719", "0.535719", "0.53342307", "0.53242385", "0.53242385", "0.53242385", "0.53242385", "0.53242385", "0.53242385", "0.53242385", "0.532423...
0.0
-1
Translates a logical route into its pages asset path (relative from a common prefix) "asset path" being its javascript file, data file, prerendered html,...
function getAssetPathFromRoute(route) { var ext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var path = route === '/' ? '/index' : /^\/index(\/|$)/.test(route) ? "/index".concat(route) : "".concat(route); return path + ext; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get assetPath() {}", "get assetPath() {}", "pagePathToRender(pathname) {\n let path = pathname.replace(global.rootUrl, '');\n return path.slice(-1) === '/' ? path : path + '/';\n }", "function getAssetPathFromRoute(route, ext = '') {\n const path = route === '/' ? '/index' : /^\\/index(\\/|$)/.test(r...
[ "0.6113052", "0.6113052", "0.59755594", "0.5929081", "0.56715703", "0.5633719", "0.5609163", "0.5606019", "0.55020756", "0.54851013", "0.5452858", "0.54429543", "0.54052794", "0.53986275", "0.53925455", "0.53853226", "0.53580946", "0.5346322", "0.53450066", "0.5331505", "0.53...
0.627356
8
Parses pathrelative urls (e.g. `/hello/world?foo=bar`). If url isn't pathrelative (e.g. `./hello`) then at least base must be. Absolute urls are rejected with one exception, in the browser, absolute urls that are on the current origin will be parsed as relative
function parseRelativeUrl(url, base) { var globalBase = new URL( false ? 0 : (0, _utils.getLocationOrigin)()); var resolvedBase = base ? new URL(base, globalBase) : globalBase; var _URL = new URL(url, resolvedBase), pathname = _URL.pathname, searchParams = _URL.searchParams, search = _URL.searc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseRelativeUrl(url,base){const resolvedBase=base?new URL(base,DUMMY_BASE):DUMMY_BASE;const{pathname,searchParams,search,hash,href,origin,protocol}=new URL(url,resolvedBase);if(origin!==DUMMY_BASE.origin||protocol!=='http:'&&protocol!=='https:'){throw new Error('invariant: invalid relative URL');}return{...
[ "0.8161255", "0.79064167", "0.78959113", "0.7885397", "0.7885397", "0.7881505", "0.78795093", "0.78795093", "0.78795093", "0.7778019", "0.77758485", "0.77758485", "0.7768038", "0.7768038", "0.7768038", "0.7768038", "0.7768038", "0.7768038", "0.7768038", "0.7768038", "0.669658...
0.7759163
22
this isn't importing the escapestringregex module to reduce bytes
function escapeRegex(str) { return str.replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UnescapeSpecialChars(text) {\n\ntext = text.replace(/7f8137798425a7fed2b8c5703b70d078/gm, \"\\\\\")\ntext = text.replace(/833344d5e1432da82ef02e1301477ce8/gm, \"`\")\ntext = text.replace(/3389dae361af79b04c9c8e7057f60cc6/gm, \"*\")\ntext = text.replace(/b14a7b8059d9c055954c92674ce60032/gm, \"_\")\ntext = ...
[ "0.657282", "0.6311734", "0.6300425", "0.6300425", "0.6300425", "0.6300425", "0.6300425", "0.6300425", "0.6300425", "0.6268723", "0.6265532", "0.6265532", "0.6265532", "0.6265532", "0.6265532", "0.6265532", "0.6259872", "0.6236007", "0.6221664", "0.6221664", "0.6221664", "0...
0.0
-1
AsyncMode should be deprecated
function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setAsync(){\n this.async = true;\n }", "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;lowPriorityWarning$1(false,'The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactI...
[ "0.71772456", "0.71477026", "0.71477026", "0.71477026", "0.707457", "0.6901749", "0.6824169", "0.6809441", "0.6809441", "0.6793582", "0.6785743", "0.67846984", "0.6757779", "0.6750946", "0.6745032", "0.6745032", "0.67303115", "0.67276573", "0.67276573", "0.67276573", "0.67276...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.5276731", "0.52603525", "0.51912946", "0.5183357", "0.5126483", "0.50448495", "0.48931673", "0.4861047", "0.48415267", "0.48314145", "0.48242697", "0.48147812", "0.48078167", "0.47866392", "0.47839633", "0.47597152", "0.47521117", "0.47409353", "0.47275993", "0.47050476", ...
0.0
-1
Experimental Create Event Handle API.
function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEventHandler() {\n return {\n handleEvent: function handleEvent(event) {\n switch (event.type) {\n\n case 'encrypted':\n if (event.initData) {\n var initData = ArrayBuffer.isView(event.initData) ? e...
[ "0.6675035", "0.6479107", "0.64392054", "0.6429872", "0.6142637", "0.6102399", "0.59711486", "0.59674567", "0.5964464", "0.5946079", "0.59298646", "0.59168935", "0.5894774", "0.5892875", "0.5872369", "0.5844633", "0.58258116", "0.5786885", "0.57783765", "0.573211", "0.5716495...
0.0
-1
AsyncMode should be deprecated
function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setAsync(){\n this.async = true;\n }", "function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;lowPriorityWarning$1(false,'The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactI...
[ "0.71772456", "0.71477026", "0.71477026", "0.71477026", "0.707457", "0.6901749", "0.6824169", "0.6809441", "0.6809441", "0.6793582", "0.6785743", "0.67846984", "0.6757779", "0.6750946", "0.6745032", "0.6745032", "0.67303115", "0.67276573", "0.67276573", "0.67276573", "0.67276...
0.0
-1
Experimental Create Event Handle API.
function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEventHandler() {\n return {\n handleEvent: function handleEvent(event) {\n switch (event.type) {\n\n case 'encrypted':\n if (event.initData) {\n var initData = ArrayBuffer.isView(event.initData) ? e...
[ "0.6675035", "0.6479107", "0.64392054", "0.6429872", "0.6142637", "0.6102399", "0.59711486", "0.59674567", "0.5964464", "0.5946079", "0.59298646", "0.59168935", "0.5894774", "0.5892875", "0.5872369", "0.5844633", "0.58258116", "0.5786885", "0.57783765", "0.573211", "0.5716495...
0.0
-1
by calls to these methods by a Babel plugin. In PROD (or in packages without access to React internals), they are left as they are instead.
function warn(format) { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetIfUsingPreact() {\n if (window.preact !== undefined) {\n jsxLoader.compiler.pragma = 'React.createElement';\n jsxLoader.compiler.pragmaFrag = 'React.Fragment';\n }\n }", "react() {\n return;\n }", "function globalizeReact() {\n ...
[ "0.62313867", "0.5989008", "0.5950191", "0.5713265", "0.5713265", "0.5707186", "0.56897974", "0.56897974", "0.5586768", "0.5557041", "0.5544687", "0.5544687", "0.55119157", "0.55119157", "0.55119157", "0.55119157", "0.55119157", "0.55119157", "0.55119157", "0.55119157", "0.55...
0.0
-1
Base class helpers for the updating state of a component.
function Component(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || Rea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n BaseState.update.call(this);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "func...
[ "0.7217204", "0.67610246", "0.66769236", "0.66106635", "0.6540022", "0.65259355", "0.6489663", "0.64705694", "0.645821", "0.63847154", "0.6354757", "0.63347685", "0.63053316", "0.6304944", "0.62717897", "0.6266675", "0.621649", "0.6214279", "0.6194085", "0.6189877", "0.615812...
0.0
-1
Convenience component with default shallow equality check for sCU.
function PureComponent(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useStrictEquality(b, a) {\n return a === b;\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "function defaultEqualityCheck(a, b) {\n return !a && !b || a === b;\n }", "equals() {\n return false;\n }", "equals() {\n return false;\n }", ...
[ "0.6083551", "0.579784", "0.5669391", "0.56581414", "0.56581414", "0.5631642", "0.55893344", "0.55893344", "0.55851346", "0.5546245", "0.548746", "0.5484109", "0.5481716", "0.5481716", "0.54722977", "0.54722977", "0.54722977", "0.5451884", "0.5451884", "0.5441116", "0.5398943...
0.0
-1
an immutable object with a single mutable value
function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "static set one(value) {}", "function makeImmutableObject(obj) {\n\t if (!globalConfig.us...
[ "0.6674448", "0.66609514", "0.6358345", "0.6347869", "0.6347869", "0.6263268", "0.6230736", "0.6136926", "0.61048114", "0.5915378", "0.5889688", "0.580687", "0.5776291", "0.5763881", "0.57248324", "0.56947106", "0.566211", "0.5636481", "0.56181127", "0.5606209", "0.5606209", ...
0.0
-1
Create and return a new ReactElement of the given type. See
function createElement(type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; { warnIfStringRefCannotBeAutoConv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=con...
[ "0.6892785", "0.6835945", "0.67671967", "0.6757371", "0.67459184", "0.67459184", "0.67459184", "0.67459184", "0.67459184", "0.67459184", "0.67459184", "0.67459184", "0.67459184", "0.6564956", "0.6557279", "0.6407604", "0.6407604", "0.6407604", "0.6407604", "0.6407604", "0.638...
0.0
-1
Clone and return a new ReactElement using element as the starting point. See
function cloneElement(element, config, children) { if (!!(element === null || element === undefined)) { { throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); } } var propName; // Original props are copied var props = _assign({}, elemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneElement(element,config,children){if(!!(element===null||element===undefined)){{throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+element+\".\");}}var propName;// Original props are copied\nvar props=_assign({},element.props);// Reserved names are extracted\...
[ "0.69132274", "0.68906343", "0.66943085", "0.66943085", "0.6692962", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6646507", "0.6633278", "0.661405", "0.661405", ...
0.66117495
69
Flatten a children object (typically specified as `props.children`) and return an array with appropriately rekeyed children. See
function toArray(children) { return mapChildren(children, function (child) { return child; }) || []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArrayChildren(children) {\n var ret = [];\n React__default.Children.forEach(children, function (child) {\n ret.push(child);\n });\n return ret;\n }", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,function(child){return child;}...
[ "0.775594", "0.7520282", "0.74348474", "0.7408082", "0.7408082", "0.7408082", "0.7408082", "0.7408082", "0.7408082", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74...
0.73843
59
Experimental Create Event Handle API.
function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEventHandler() {\n return {\n handleEvent: function handleEvent(event) {\n switch (event.type) {\n\n case 'encrypted':\n if (event.initData) {\n var initData = ArrayBuffer.isView(event.initData) ? e...
[ "0.6675035", "0.6479107", "0.64392054", "0.6429872", "0.6142637", "0.6102399", "0.59711486", "0.59674567", "0.5964464", "0.5946079", "0.59298646", "0.59168935", "0.5894774", "0.5892875", "0.5872369", "0.5844633", "0.58258116", "0.5786885", "0.57783765", "0.573211", "0.5716495...
0.0
-1
Try/catch helper to minimize deoptimizations. Returns a completion record like context.tryEntries[i].completion. This interface could have been (and was previously) designed to take a closure to be invoked without arguments, but in all the cases we care about we already have an existing method we want to call, so there...
function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryCatch(fn, obj, arg) { // 59\n try { // 60\n return { type: \"normal\", arg: fn.call(obj, arg) }; ...
[ "0.5071568", "0.5061275", "0.4849881", "0.47927505", "0.47927505", "0.47927505", "0.47927505", "0.47927505", "0.47831497", "0.47831497", "0.47063333", "0.46893752", "0.46678346", "0.4655878", "0.46554154", "0.46554154", "0.46554154", "0.46371436", "0.46213374", "0.46146342", ...
0.0
-1
Dummy constructor functions that we use as the .constructor and .constructor.prototype properties for functions that return Generator objects. For full spec compliance, you may wish to configure your minifier not to mangle the names of these two functions.
function Generator() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempCtor() {}", "function temporaryConstructor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function HelperConstructor() {}", "function DummyClass() {\r\n // ...
[ "0.72178733", "0.70246404", "0.69524163", "0.69524163", "0.69524163", "0.69524163", "0.69524163", "0.69524163", "0.67616016", "0.6600864", "0.657289", "0.657289", "0.657289", "0.64865565", "0.6444541", "0.6399193", "0.63944674", "0.63771313", "0.63771313", "0.633868", "0.6277...
0.0
-1
Helper for defining the .next, .throw, and .return methods of the Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return th...
[ "0.74807125", "0.74807125", "0.74807125", "0.74807125", "0.74807125", "0.74807125", "0.71783626", "0.6994318", "0.6994318", "0.6972502", "0.69664234", "0.69664234", "0.69664234", "0.69664234", "0.69664234", "0.69664234", "0.69664234", "0.69664234", "0.69664234", "0.69664234", ...
0.0
-1
Formatting function for row details modify as you need
function format () { // `d` is the original data object for the row return '<table cellspacing="0" class="dashboard long">'+ '<tr>'+ '<th>Polling Station</th>'+ '<th>Ballot Papers Issued</th>'+ '<th>Postal Packs</th>'+ '<th>Station Open</th>'+ '<th>Status</th>'+ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detailFormatter(index, row, element) {\n\tvar html = '<div align=\"center\"><h1>System requirements</h1></div>\\n\\n';\n\thtml += row['system_requirements'] + '\\n\\n';\n\thtml += '<div align=\"center\"><h1>Description</h1></div>\\n\\n';\n\thtml += row['description'] + '\\n\\n';\n\n\treturn html;\n}", "...
[ "0.71958286", "0.7134036", "0.7086379", "0.70721686", "0.70449245", "0.7015324", "0.69551414", "0.6905901", "0.6881804", "0.68527037", "0.6846784", "0.6842614", "0.6805365", "0.67612135", "0.67612135", "0.67612135", "0.6725851", "0.6699415", "0.6688908", "0.66849744", "0.6642...
0.61212695
46
Update the total cost
function updateCost(amount) { activityCost += amount; document.getElementById("total").innerHTML = "Amount due: $" + activityCost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCurrentCost(){\n \n}", "function updatePrice() {\n var sum = 0;\n for(var i = 0; i < $scope.currentItems.length; i++) {\n sum += $scope.currentItems[i].price;\n }\n\n $scope.totalCost = sum + (sum * taxRate);\n $scope.totalCost = Math.floor($scope.totalCost);\n consol...
[ "0.8073945", "0.7657305", "0.7577992", "0.7419366", "0.73507273", "0.7315209", "0.7277084", "0.72491896", "0.7247815", "0.71494144", "0.71334755", "0.70284426", "0.69852126", "0.69213104", "0.69160616", "0.69098806", "0.68849033", "0.68777454", "0.687028", "0.68276167", "0.68...
0.7608049
2
loads data from each batch from the local database and returns a wrapper with id, inputTensor, labelTensor
function prepareBatchData(batchSize, offSet) { const batchData = Realm.open({schema: [ImageSchema]}) .then((realm) => { const start = offSet; const end = offSet + batchSize; const batch = realm .objects('Image') .filtered('(' + start + ' <= uid)&&(uid < ' + end + ')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readFiles(evt) {\n let label = 0;\n let target = evt.target.id;\n //decide the label of the selected images based on the file chooser\n if(target == \"college_female\") {\n label = 0;\n } else if(target == \"college_male\") {\n label = 1;\n } else if(target == \"sh_female\") {\n label = 2;\...
[ "0.5727309", "0.5668746", "0.54158777", "0.54147935", "0.5381747", "0.53733516", "0.5369538", "0.52546734", "0.51913804", "0.51790094", "0.51761234", "0.5147029", "0.51454407", "0.51418865", "0.51329273", "0.5125952", "0.5114979", "0.51139337", "0.51073426", "0.5071331", "0.5...
0.632984
0
function to get form values
function getInputVal(id){ return document.getElementById(id).value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFormValuesAndDisplayResults() {\n}", "function getFormValues() {\n\tname = document.getElementById(\"name\").value;\n\temail = document.getElementById(\"email\").value;\n\tsubject = document.getElementById(\"subject\").value;\n\tmessage = document.getElementById(\"message\").value;\n}", "function f...
[ "0.8115061", "0.7739999", "0.7729837", "0.7690455", "0.7588425", "0.7514238", "0.7499329", "0.7498871", "0.74585134", "0.74411017", "0.7435742", "0.7373737", "0.7328542", "0.73269343", "0.7287043", "0.72496235", "0.71228313", "0.7111757", "0.71078146", "0.7081316", "0.7077044...
0.0
-1
save the message to firebase
function saveMessage(name, email, message){ var newMessageRef = messagesRef.push(); newMessageRef.set({ name: name, email: email, message: message }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveMessage(msg){\n const result = messageRef.push().set(msg);\n console.log(result);\n}", "function saveMessage(appid,name,dob,gname,prclass,schooltype,bsid,regID,meet){\r\n /*\r\n var newMessageRef = messagesRef.push();\r\n MessageRef.set({\r\n */\r\n firebase.database().ref('vtoix2023/' + ...
[ "0.8078678", "0.80516887", "0.8039144", "0.80071694", "0.7971167", "0.79409456", "0.79259706", "0.79159164", "0.79113483", "0.78327626", "0.78071576", "0.7804999", "0.7803701", "0.7791655", "0.77861166", "0.7781209", "0.77461946", "0.772954", "0.77248895", "0.7716248", "0.771...
0.7513753
48
Here data is taken from a predefined json response (news.js), a FETCH (GET) call can be made here to get the news data from the database.
render() { return ( <div> { news.map(item => { return ( <div class="box"> <article class="media"> <div class="media-content"> <div class="content"> <p> <strong>{item.title}</strong> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchTheData() {\r\n let baseURL = \"https://newsapi.org/v2/top-headlines\";\r\n deleteOld();\r\n let search = \"?q=\" + id(\"search\").value;\r\n id(\"searchTerm\").textContent = id(\"search\").value;\r\n let apiKey = \"&apiKey=c1c6c8286a5449b7a7fcc01deb46437c\";\r\n fetch(baseURL + sea...
[ "0.7513699", "0.7495739", "0.7480466", "0.74365175", "0.7366173", "0.7306222", "0.72779304", "0.7261266", "0.7195346", "0.7051329", "0.69857305", "0.696469", "0.69363797", "0.6928188", "0.69268703", "0.68970287", "0.68480265", "0.6825617", "0.68102455", "0.68082255", "0.67756...
0.0
-1
TODO: rename SetView to Collection Once everything's moved over to this, we can change the underlying representation
get isCollection() { return this.isSetView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoto_set_view(options){\n\toptions = options || {};\n\toptions.el_class = 'album_view';\n\toptions.max_items = 60;\n\toptions.small_item_class = zoto_set_view_item;\n\toptions.empty_data_set_str = 'There were no sets found.';\n\tthis.$uber(options);\n}", "constructor() {\n super();\n this.itemview...
[ "0.60004073", "0.5718442", "0.55774975", "0.5536291", "0.5519775", "0.54826754", "0.5428687", "0.5421644", "0.5421644", "0.5396343", "0.53763235", "0.5326648", "0.5269024", "0.52373743", "0.5231835", "0.52032614", "0.52032614", "0.52032614", "0.51214826", "0.5114128", "0.5113...
0.6283316
0
TODO: update call sites to use the type checker instead (since they will have additional information about direction etc.)
equals(type) { return TypeChecker.compareTypes({type: this}, {type}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get direction() {\n return this.callInfo.direction;\n }", "function transportType(wheels,checker){\n checker(wheels); //checker is an arg function\n }", "type (prm) {\n try {\n return this.member(\n 'type',\n ['top', 'right', 'bottom', 'left'],\n ...
[ "0.54428935", "0.5385165", "0.5119344", "0.5092286", "0.50827384", "0.5066511", "0.5063708", "0.5022408", "0.50140154", "0.49658597", "0.49631628", "0.49041793", "0.49020496", "0.48281607", "0.48166123", "0.47960132", "0.4790315", "0.4770063", "0.47656813", "0.47635505", "0.4...
0.0
-1
TODO: remove this in favor of a renamed setViewType
primitiveType() { return this.setViewType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentViewType( viewType )\r\n\t{\r\n\t\tcurrentViewType = viewType;\r\n\t}", "function changeView(type) {\r\n\t//var orient = \"orientPortrait\";\r\n\tvar nodes = {};\r\n\tnodes.mapPane = dijit.byId(\"mapPane\");\r\n\tnodes.mapBox = dojo.byId(\"objContents\");\r\n\tnodes.dateArea = dojo.byId(\"date...
[ "0.7128034", "0.64454424", "0.64357036", "0.62008095", "0.61740196", "0.6116748", "0.61048675", "0.610354", "0.60722226", "0.60722226", "0.60722226", "0.6055413", "0.603195", "0.603195", "0.59906137", "0.5985983", "0.58513945", "0.584731", "0.5831957", "0.5829492", "0.5819711...
0.0
-1
Tests whether two types' constraints are compatible with each other
static canMergeConstraints(type1, type2) { return Type._canMergeCanReadSubset(type1, type2) && Type._canMergeCanWriteSuperset(type1, type2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doTypesOverlap(schema, typeA, typeB) {\n // So flow is aware this is constant\n var _typeB = typeB;\n\n // Equivalent types overlap\n if (typeA === _typeB) {\n return true;\n }\n\n if ((0, _definition.isAbstractType)(typeA)) {\n if ((0, _definition.isAbstractType)(_typeB)) {\n // If both ...
[ "0.67699635", "0.67699635", "0.67699635", "0.6603936", "0.65932316", "0.6541816", "0.6541816", "0.6506127", "0.6506127", "0.6494143", "0.6442848", "0.61919177", "0.60405344", "0.60405344", "0.5962715", "0.5903227", "0.58476907", "0.5766614", "0.5738357", "0.56857365", "0.5627...
0.68639976
0
TODO: is this the same as _applyExistenceTypeTest
hasProperty(property) { if (property(this)) return true; if (this.isSetView) return this.setViewType.hasProperty(property); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test( type, name ) {\n if( typeof type === 'string' ) {\n // Convert a type definition like 'object' to a function performing the test.\n let isa = Tests[type];\n // Make sure we have a test.\n if( isa === undefined ) {\n throw new Error(`Unsupported type '${type}...
[ "0.57557636", "0.56532097", "0.56532097", "0.56532097", "0.56532097", "0.56532097", "0.56532097", "0.5600487", "0.5493948", "0.5455638", "0.5245384", "0.5242885", "0.5242885", "0.5242885", "0.5242885", "0.5242885", "0.5242885", "0.52072847", "0.5181519", "0.5181469", "0.51461...
0.0
-1
var newSprite = new GermMaker(0);
function rotate (x, y, sin, cos, reverse) { return { x: (reverse) ? (x * cos + y * sin) : (x * cos - y * sin), y: (reverse) ? (y * cos - x * sin) : (y * cos + x * sin) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newGame () {}", "function drawconstructor() {\nvar e=drawSprite(0,game,\"paper\",0,0,w,w,0,0,1);\nreturn e\n}", "function start() {\n wagon = new sprite(30, 30, \"images/ferry.png\", 500, 150);\n board.start();\n}", "function createNewClass ()\n{\n window.Enemy = new Phaser.Class({\n\n Extend...
[ "0.70582354", "0.7033415", "0.689344", "0.68526536", "0.6750051", "0.6705552", "0.66378254", "0.6636519", "0.66008484", "0.6570873", "0.65559137", "0.6549335", "0.6540916", "0.6525957", "0.65141475", "0.6510309", "0.6465257", "0.6458937", "0.6442842", "0.6434436", "0.6420375"...
0.0
-1
checks if the user is already credentialed. If so then it redirects them home
componentDidMount() { if (this.context.username) { this.props.history.push("/"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAuth() {\n if (CONFIG.userLogged) {\n $location.path('/home');\n }\n }", "function checkUser() {\n service.onceAuthData().then(function(authData){\n if (authData && !authData.anonymous) {\n $location.path('/main/' + au...
[ "0.7046501", "0.6996824", "0.68437004", "0.6823879", "0.678091", "0.67692345", "0.6762327", "0.6757186", "0.67397904", "0.67346907", "0.6733728", "0.66470456", "0.66470456", "0.6617586", "0.6589253", "0.65750325", "0.6567729", "0.65156406", "0.6511373", "0.6510981", "0.650673...
0.0
-1
submission of login data
async handleSubmit(event) { //I meant to hide the salt before I made the website live. kinda too late now considering people have //already made accounts and what not //At least I made a warning not to put in real credentials. It's properly hashed on the server side //but none of this matters anyways be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {\n var userName = document.getElementById(\"username\");\n var password = document.getElementById(\"password\");\n\n var logonForm = document.getElementById(\"logonForm\");\n logonForm.setAttribute(\"class\", \"hiddenPage\");\n\n request.userName = userName.valu...
[ "0.7320821", "0.72658813", "0.72658813", "0.7222672", "0.7172933", "0.7068091", "0.700367", "0.699987", "0.69827783", "0.69707084", "0.68911666", "0.6809034", "0.6803291", "0.6795155", "0.67857057", "0.6769473", "0.6733308", "0.6731496", "0.67288166", "0.6726884", "0.6712174"...
0.0
-1
copy own properties from 'api' to 'prototype, with name hinting for 'super'
function extend(prototype, api) { if (prototype && api) { // use only own properties of 'api' Object.getOwnPropertyNames(api).forEach(function(n) { // acquire property descriptor var pd = Object.getOwnPropertyDescriptor(api, n); if (pd) { // clone property via descripto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $__jsx_merge_interface(target, source) {\n\tfor (var k in source.prototype)\n\t\tif (source.prototype.hasOwnProperty(k))\n\t\t\ttarget.prototype[k] = source.prototype[k];\n}", "function copySuperAttr(obj, name, suffix) {\nvar desc;\nvar o = obj;\n// It may be an inherited property, so check the prototyp...
[ "0.6520795", "0.64638054", "0.6276752", "0.62449545", "0.62106776", "0.61203355", "0.5924081", "0.58979887", "0.58913815", "0.587711", "0.58556086", "0.58556086", "0.58508337", "0.58384514", "0.58281034", "0.5824686", "0.5820453", "0.58069474", "0.58008236", "0.5797887", "0.5...
0.8268814
2
super `arrayOfArgs` is an optional array of args like one might pass to `Function.apply` TODO(sjmiles): $super must be installed on an instance or prototype chain as `super`, and invoked via `this`, e.g. `this.super();` will not work if function objects are not unique, for example, when using mixins. The memoization st...
function $super(arrayOfArgs) { // since we are thunking a method call, performance is important here: // memoize all lookups, once memoized the fast path calls no other // functions // // find the caller (cannot be `strict` because of 'caller') var caller = $super.caller; // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $super(arrayOfArgs) {\r\n // since we are thunking a method call, performance is important here: \r\n // memoize all lookups, once memoized the fast path calls no other \r\n // functions\r\n //\r\n // find the caller (cannot be `strict` because of 'caller')\r\n var caller = $...
[ "0.8088924", "0.62895703", "0.62814957", "0.62814957", "0.6137884", "0.58687305", "0.58344924", "0.5825536", "0.5825536", "0.5825536", "0.5825536", "0.5501057", "0.5501057", "0.5468386", "0.5412923", "0.5363373", "0.5301669", "0.5241828", "0.5222874", "0.5178687", "0.51512754...
0.8135983
1
NOTE: In some platforms (IE10) the prototype chain is faked via __proto__. Therefore, always get prototype via __proto__ instead of the more standard Object.getPrototypeOf.
function getPrototypeOf(prototype) { return prototype.__proto__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n var prototype = Object.getPrototypeOf(this);\n }", "function getPrototypeOf(prototype) {\r\n return prototype.__proto__;\r\n }", "function getPrototypeOf(prototype) {\n return prototype.__proto__;\n }", "function getPrototypeOf(prototype) {\n return prototyp...
[ "0.805142", "0.7955869", "0.7948563", "0.7948563", "0.7948563", "0.76773053", "0.7494572", "0.7426799", "0.7426799", "0.7388271", "0.7195084", "0.7189742", "0.7189742", "0.7189742", "0.70103604", "0.70103604", "0.70103604", "0.70103604", "0.70103604", "0.70103604", "0.7010360...
0.79398286
6
utility function to precompute name tags for functions in a (unchained) prototype
function hintSuper(prototype) { // tag functions with their prototype name to optimize // super call invocations for (var n in prototype) { var pd = Object.getOwnPropertyDescriptor(prototype, n); if (pd && typeof pd.value === 'function') { pd.value.nom = n; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function name() {}", "function g(t,e){var i,n;return t&&e?(i=\"\"+t+e[0].toUpperCase()+e.slice(1),n=t+\"-\"+e):(i=t||e,n=t||e),{name:i,classname:n}}", "function MyNameE() {\n return \"Carles\";\n}", "function myName6(name){\n\treturn name;\n}", "additionalNametags(self) { return []; }", "function func...
[ "0.70128214", "0.6082764", "0.6016005", "0.6002549", "0.5989228", "0.5927652", "0.5884773", "0.58778095", "0.58549553", "0.58535755", "0.58470404", "0.5805608", "0.5805608", "0.5805608", "0.5805608", "0.5805608", "0.58024025", "0.58004814", "0.5795103", "0.5783226", "0.577091...
0.563317
33
property binding bind a property in A to a path in B by converting A[property] to a getter/setter pair that accesses B[...path...]
function bindProperties(inA, inProperty, observable) { log.bind && console.log(LOG_BIND_PROPS, inB.localName || 'object', inPath, inA.localName, inProperty); // capture A's value if B's value is null or undefined, // otherwise use B's value // TODO(sorvell): need to review, can do with ObserverTransform...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bindProperties(inA, inProperty, inB, inPath) {\n log.bind && console.log(LOG_BIND_PROPS, inB.localName || 'object', inPath, inA.localName, inProperty);\n // capture A's value if B's value is null or undefined,\n // otherwise use B's value\n var path = Path.get(inPath);\n var v = path.getVal...
[ "0.80962896", "0.6769513", "0.6231342", "0.6170477", "0.6159197", "0.6159197", "0.6094494", "0.6064484", "0.60368866", "0.5943908", "0.5943908", "0.5943908", "0.59178054", "0.5881578", "0.5881578", "0.5881578", "0.57714605", "0.5753089", "0.5709306", "0.5693692", "0.5686244",...
0.7537892
1
An event controller is the host element for the shadowRoot in which the node exists, or the first ancestor with a 'lightDomController' property.
function findEventController(node) { while (node.parentNode) { if (node.lightDomController) { return node; } node = node.parentNode; } return node.host; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective)[\"native\"];\n }", "function getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective).native;\n}", "function getHostElement(componentOrDirective) {\n return getLContext(componen...
[ "0.58851135", "0.5666892", "0.5666892", "0.5666892", "0.5666892", "0.5666892", "0.5666892", "0.5628797", "0.5574102", "0.5428309", "0.5349954", "0.5349954", "0.5349954", "0.5349954", "0.5349954", "0.5349954", "0.5349954", "0.5349954", "0.5301401", "0.5301401", "0.5202304", ...
0.8059481
0