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
strip the keyword of the ending % sign
function wordType(word) { return word.substring(1, word.lastIndexOf("%")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function de(e){return e+\"%\"}", "function removeVars(val) {\r\n\t\t\treturn val.replace(/%(\\w+)/g, '');\r\n\t\t}", "function removeVars(val) {\n\t\t\treturn val.replace(/%(\\w+)/g, '');\n\t\t}", "function removeVars(val) {\n\t\t\treturn val.replace(/%(\\w+)/g, '');\n\t\t}", "function removeVars(val) {\n\...
[ "0.6933865", "0.68884575", "0.68312585", "0.68312585", "0.68312585", "0.6273238", "0.6192847", "0.6173348", "0.61534214", "0.5983795", "0.5766058", "0.5766058", "0.572852", "0.57210165", "0.5669272", "0.5631969", "0.5619718", "0.56070304", "0.55775267", "0.5561018", "0.554292...
0.5818942
10
check to see if the isInputIntervention flag is true and set a global variable so that we send back correct event when intervention ends
function checkIfInputIntervention (interv) { var isInputIntervention = interv.isInputIntervention; // this flag will alter the event sent when the intervention dialog closes if (isInputIntervention || isInputIntervention === 'true') globals.isInputIntervention = true; else globals.isInputInterve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processingHotkey() {\n canAcceptNewInput = false;\n }", "function input(event) {\n if (bossFight == false) {// Take Input from the Player\n if (event.type === \"keydown\") {\n switch (event.keyCode) {\n case 37:\n gamerInput = new GamerInput(\"L...
[ "0.6495262", "0.60967535", "0.6096578", "0.6085044", "0.605517", "0.5865403", "0.580341", "0.580159", "0.57629335", "0.5701222", "0.5688238", "0.5631625", "0.56197155", "0.5596443", "0.5569014", "0.55642885", "0.5520343", "0.5508346", "0.5491826", "0.5472294", "0.5466672", ...
0.7307571
0
send a BeginProblem event for HTMl5 problems.
function sendBeginIntervention(globals) { incrementTimers(globals); servletGetWait("BeginIntervention", {probElapsedTime: globals.probElapsedTime}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function feedback1(msg) {\n getElm('error-nwl1').innerHTML = msg;\n}", "function control_on_iq_error(stanza) {\n var type = $(stanza).attr('type');\n var from = $(stanza).attr('from');\n var id = $(stanza).attr('id');\n// log('control_on_iq_error type=' + type + ' from=' + from + ' id=' + id);\n ...
[ "0.5309657", "0.51219916", "0.50923365", "0.50203913", "0.49562907", "0.49562907", "0.4911332", "0.4874304", "0.48477694", "0.4824222", "0.48161924", "0.4773094", "0.47707465", "0.47707465", "0.47707465", "0.4762035", "0.47528386", "0.47501907", "0.47464013", "0.47242644", "0...
0.0
-1
slide the user to the contact form at the bottom of the page
function directToContactForm () { $('html, body').animate({ scrollTop : $("#contact-me").offset().top }, 'slow'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToBottom(){\n if(!usePortalForContext() || jQuery(\"#fancybox-frame\", parent.document).length){\n jQuery.scrollTo(\"max\", 0);\n }\n else{\n\t\ttop.jQuery.scrollTo(\"max\", 0);\n }\n}", "function show_footer_contact_form() {\n\tchange_properties('.contact-form-button-submit', 'va...
[ "0.6614117", "0.64884824", "0.63888973", "0.6288314", "0.6207597", "0.620487", "0.6196842", "0.6164132", "0.61364406", "0.61253047", "0.6111894", "0.6040403", "0.5979381", "0.5957153", "0.5956911", "0.5940665", "0.5912923", "0.5904536", "0.58966815", "0.5895406", "0.58855754"...
0.7793537
0
FUNCTIONS / AUXILIARY FUNCTIONS
function getRandomInt(max) { // return random number from 0 to max-1 return Math.floor(Math.random() * Math.floor(max)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion (){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function ea(){}", "function fuctionPanier(){\n\n}", "function fuction() {\n\n}", "function oi(){}", "function _____SHARED_functions_____(){}", "function fun1( /*parametros opcionais*/ ){ /*ret...
[ "0.70597106", "0.69437784", "0.69437784", "0.69437784", "0.6594539", "0.6354416", "0.63454807", "0.634092", "0.63279265", "0.632029", "0.63157564", "0.62851673", "0.6253433", "0.6253189", "0.623611", "0.6193721", "0.6187019", "0.6187019", "0.6168668", "0.6164148", "0.6146124"...
0.0
-1
Fix to auto hide an element so that there's no flicker.
function autoHide(element, $animateCss) { var height = element[0].offsetHeight; var styles = window.getComputedStyle(element[0]); return $animateCss(element, { event: 'leave', structural: true, from: {"opacity": 0, "margin-top": -height + "px"}, to: {"opacity": 0, "margin-top": -height + "px"}, dur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide() {\n this.elem.classList.add(\"hiding\");\n setTimeout(() => this.elem.classList.add(\"noDisplay\"), 184);\n this.isHidden = true;\n }", "function disappear(element) {\n $(element).css({ 'display': 'none' });\n }", "forceHide() {\n this.__count = 0;\n this.hide();\n }", ...
[ "0.7236102", "0.71667564", "0.71345687", "0.7134072", "0.70425683", "0.6949098", "0.6947345", "0.6938069", "0.68381184", "0.6828984", "0.6821209", "0.68178076", "0.6795067", "0.67763394", "0.67525595", "0.67293155", "0.67260635", "0.6711845", "0.67112905", "0.6711185", "0.670...
0.0
-1
Grab a copy of the current queue Clear the queue for future use Process the existing queue Trigger digest if necessary
function processQueue() { var skip = scope && scope.$$destroyed; var queue = !skip ? nextTick.queue : []; var digest = !skip ? nextTick.digest : null; nextTick.queue = []; nextTick.timeout = null; nextTick.digest = false; queue.forEach(function (callback) { callback(); })...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this.queue = null;\n }", "clear() {\n this.queue.clear();\n }", "clear_queue() {\n this.queued.length = 0;\n }", "clear() {\n this._queue.kill();\n }", "clear() {\n this.queue = [];\n }", "function processQueue() {\n var queue...
[ "0.7029813", "0.6944687", "0.6832558", "0.682537", "0.6765456", "0.6749529", "0.67405677", "0.67405677", "0.6712291", "0.66250134", "0.6593097", "0.6575941", "0.656469", "0.65602833", "0.654959", "0.65100676", "0.6485702", "0.64564043", "0.6360853", "0.6360853", "0.6360853", ...
0.0
-1
$('div:last p:nthchild(3)').css ('backgroundcolor', 'pink'); $ ("h1").bind('mouseover', mouseOverMe).bind('mouseout', mouseOutMe); //$ ('div').bind('mouseover', mouseOverMe()); $ ('h1').bind ('click', mouseClick); })
function mouseOverMe() { $("h1").html("This is easy"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupLatestNews()\r\n{\r\n $j(\".lastNews\").hover(\r\n function()\r\n {\r\n $j(this).find(\".lastNewsTitle\").css(\"color\", \"#222\");\r\n }, \r\n function()\r\n {\r\n $j(this).find(\".lastNewsTitle\").css(\"color\", \"#444\");\r\n ...
[ "0.62866133", "0.58615", "0.58347285", "0.5826177", "0.5758129", "0.57344896", "0.56963724", "0.5571152", "0.55590105", "0.5546189", "0.5504113", "0.54783046", "0.5471809", "0.5469465", "0.5457023", "0.5433054", "0.5428356", "0.5420011", "0.5352461", "0.5347495", "0.5333878",...
0.6172584
1
This is the constructor function for each Stand.
function Stand(i){ this.locationName=locations[i]; this.minCustomersPerHour=minCustomersPerHour[i]; this.maxCustomersPerHour=maxCustomersPerHour[i]; this.avgCookiesPerCustomer=avgCookiesPerCustomer[0]; this.customersEachHour=[]; this.access=access[i]; this.cookiesSoldEachHour=[]; this.totalCookiesSoldPe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this._cs = [];\n this._stiff = 1;\n this._locks = {};\n this._mass = 1;\n }", "constructor() {\n super(`stationary`);\n\n this.namedStates[`stationary`] = new PStationaryState(300, 36000);\n this.namedStates[`walk`] = new PWa...
[ "0.6180147", "0.61659604", "0.6147267", "0.60260683", "0.5953961", "0.5947227", "0.59359413", "0.59315395", "0.5926867", "0.59243876", "0.5903823", "0.5891803", "0.58152413", "0.57952666", "0.57666427", "0.5764274", "0.57188255", "0.57188255", "0.57108736", "0.57084984", "0.5...
0.6141895
3
This randomizer determines how many customers arrive.
function getRandomInt(min, max){ return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCustomerNumber(){\r\n var customerNumber = getRandomIntInclusive(storeObjectArray[z].minCust, storeObjectArray[z].maxCust);\r\n return customerNumber;\r\n }", "function getRandomCustomer(minCust, maxCust) {\n return Math.floor(Math.random() * (maxCust - minCust+1) + minCust);\n}", ...
[ "0.6329547", "0.5890363", "0.58333194", "0.5688017", "0.5598351", "0.5576118", "0.5568593", "0.5541414", "0.5496878", "0.5496878", "0.5493917", "0.54857385", "0.54274726", "0.5377612", "0.5358727", "0.5356172", "0.5339497", "0.5330298", "0.53114736", "0.5277239", "0.5226643",...
0.0
-1
This renders the table.
function makeHeaderRow(){ var trEl=document.createElement('tr'); trEl.id='Header'; newElement('th','Locations:',trEl); for(i=0;i<hours.length;i++){ newElement('th',hours[i],trEl); } newElement('th','totals',trEl); profitTable.appendChild(trEl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable() {\n clearTable();\n showTable();\n}", "function renderStoreInTable() {\n\n var table = document.getElementById('store-table');\n var tableRow = document.createElement('tr');\n var tableCell = document.createElement('th');\n tableCell.textContent = this.location;\n tableRow.appendChi...
[ "0.80027777", "0.7191547", "0.717045", "0.7157561", "0.71498704", "0.71494836", "0.71347207", "0.7080255", "0.707443", "0.7031975", "0.70119953", "0.6959337", "0.6946614", "0.6939129", "0.6918071", "0.6901283", "0.6901166", "0.68888247", "0.6884991", "0.6853472", "0.68415815"...
0.0
-1
Zoom image of final result
function makePopUpVisible(i) { var w = $(window).width(); var h = $(window).height(); var d = document.getElementById('resize_div'+ i); var divW = $(d).width(); var divH = $(d).height(); if(i=='_Desktop') d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canvasZoomImage() {\n // move image left top corner to 0,0\n this.image.raster.position = this.image.raster.bounds.size.multiply(1 / 2); // set view to the center of image\n\n this.scope.view.center = this.image.raster.position; // derive zoom, so the image fits into the view\n\n var page_width_ratio ...
[ "0.73679435", "0.7349271", "0.7281506", "0.7194226", "0.7071577", "0.6970451", "0.6935313", "0.6842869", "0.6829841", "0.66547984", "0.6638498", "0.6574838", "0.6538244", "0.6492109", "0.6476552", "0.646898", "0.64560485", "0.6453421", "0.64492303", "0.6434017", "0.6423133", ...
0.0
-1
This transform function takes in an element and calls a callback.
function transform(html, callback) { var convertedHtml = inky.releaseTheKraken(html, opts.cheerio); callback(null, convertedHtml); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _transform(node, callback) {\n return node.map(function (child, path, parent) {\n var replacement = callback(child, path, parent);\n return _transform(replacement, callback);\n });\n }", "function _transform (node, callback) {\n return node.map(function(child, path, paren...
[ "0.63617", "0.63478065", "0.63478065", "0.633186", "0.62078094", "0.59716266", "0.5970875", "0.5944892", "0.5703417", "0.5662878", "0.55759966", "0.5507154", "0.5469926", "0.53978264", "0.5349687", "0.5342498", "0.5317446", "0.52954143", "0.52928144", "0.52715445", "0.5246709...
0.539731
14
Render each path with stylus and write output
function renderCss(sheet) { var styleCode = fs.readFileSync(sheet, 'utf8') var outputName = path.basename(sheet, '.styl') stylus(styleCode) .include(path.dirname(stylePaths)) .render(function(err, css) { var outputFile = path.resolve(outputDir, outputN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compile(str, path) {\n return stylus(str)\n .set('filename', path)\n .use(nib());\n }", "function drawAllPaths() {\n var\n //strokeStyle = '#000',\n startCursor = { x: 0, y: 0 },\n lastCursor = { x: 0, y: 0 },\...
[ "0.60956305", "0.60400426", "0.6018548", "0.59699184", "0.5925513", "0.5925513", "0.5868889", "0.58402413", "0.58335966", "0.5768785", "0.5743893", "0.57272565", "0.55742145", "0.55350435", "0.5518666", "0.54879737", "0.5374106", "0.53497046", "0.53072464", "0.5217612", "0.52...
0.58916605
6
by Nicholas Valletta TODO: refactor due to new implementation method. TODO: option to store keys through sync or local.
function save_options() { let auto_duo = document.getElementById('auto_duo'); chrome.storage.sync.set({ auto_duo: auto_duo }, function () { let status = document.getElementById('status'); status.style.color = 'green'; status.textContent = 'Options Saved!'; setTimeout(function () { status.textContent = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateKeys() {\n\t\tkeys = [];\n\n\t\tfor (var key in items) {\n\t\t\tkeys.push(key);\n\t\t}\n\n\t\tLocalStorage.length = keys.length;\n\t}", "function updateKeys() {\n\t\tkeys = [];\n\n\t\tfor (var key in items) {\n\t\t\tkeys.push(key);\n\t\t}\n\n\t\tLocalStorage.length = keys.length;\n\t}", "functio...
[ "0.67169154", "0.67169154", "0.67169154", "0.6528665", "0.6450845", "0.6285515", "0.6134335", "0.60762185", "0.60755855", "0.6075384", "0.6073262", "0.6014353", "0.59691966", "0.596667", "0.5950168", "0.59382075", "0.59349066", "0.59276444", "0.5927195", "0.59270316", "0.5923...
0.0
-1
Restores select box and checkbox state using the preferences stored in chrome.storage.
function restore_options() { chrome.storage.sync.get(['auto_duo'], function (items) { (document.getElementById('auto_duo')).checked = items.auto_duo; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restore_options() {\n $('#options-list input[type=\"checkbox\"]').each(function() {\n var obj = {};\n var check = $(this);\n obj[$(this).attr('id')] = 1;\n chrome.storage.sync.get(obj,\n function(item) {\n $(\"#\" + check.attr('id')).prop(\"checked\", item[check.attr('id')]);\n ...
[ "0.81282336", "0.79564077", "0.79525673", "0.795252", "0.7810898", "0.78092647", "0.7784593", "0.7781314", "0.7736731", "0.7690695", "0.76806706", "0.76780784", "0.7668044", "0.7657366", "0.7645378", "0.76452255", "0.76380944", "0.76322347", "0.7630097", "0.76254493", "0.7601...
0.74322665
34
Main Fuction to get data from Open Weather API Send data to backend server Fetch data back from server Update UI inside div with id entryHolder
function postWeatherAndFeelingsAndUpdateUI() { const zipCode = document.getElementById("zip").value; if (!zipCode) { alert("Please enter a zip code") } else { getWeather(baseURL,zipCode,APIKey).then(weatherData=>{ const feelings = document.getElementById('feelings').value; con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWeather() {\n\n // Name of city to retrieve data for\n const city = $(\"#city\").val()\n\n // connecting through https and updating on UI\n var weatherURL = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${key}`\n $.ajax({\n url: weatherURL,\n method: \"GE...
[ "0.7388939", "0.72897506", "0.7272131", "0.72678226", "0.7248138", "0.72341853", "0.72332", "0.7209985", "0.7175094", "0.7170546", "0.71678674", "0.71258926", "0.7120482", "0.71100336", "0.71089846", "0.708465", "0.70769596", "0.70432115", "0.7039078", "0.70379496", "0.702406...
0.6762428
70
mail type is html or text
function sendmail(to,subject,content) { from = 'no-reply@test.com' var mailOptions = { from: from, to: to, subject: subject, html: content }; transporter.sendMail(mailOptions, function(error, info){ if (error) { console.log(error); } else { //console....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasTextMimetype(types) {\n if (!types) return true;\n for (var i = 0; i < types.length; i++) {\n if (types[i] === \"Text\" || types[i] === \"text/plain\") return true;\n }\n\n return false;\n }", "function hasTextMimetype(types) {\n if (!types) return tru...
[ "0.6167329", "0.6167329", "0.60988915", "0.5931949", "0.58361715", "0.5684019", "0.5664172", "0.5652985", "0.55982393", "0.55295855", "0.5519108", "0.5508103", "0.5411636", "0.5393615", "0.5323263", "0.5271209", "0.5218634", "0.52101535", "0.5204214", "0.51835394", "0.5166403...
0.0
-1
Remove item from cart
function removeItem(removeButton) { /* Remove row from DOM and recalc cart total */ var productRow = $(removeButton).parent().parent(); productRow.slideUp(fadeTime, function () { productRow.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "function removeItemFromCart(){\n\n}", "function removeItem() {\n const productId = this.name;\n if(confirm(\...
[ "0.85030687", "0.8410504", "0.8372814", "0.83300054", "0.8259259", "0.82577634", "0.8061084", "0.80246276", "0.8015108", "0.7983536", "0.7972261", "0.7949188", "0.79356253", "0.7914591", "0.7854232", "0.78168416", "0.78163004", "0.78133774", "0.7791266", "0.7775568", "0.77559...
0.0
-1
mave object keeps moving right
function moveRight(){ console.log(birdX) //if not touching pillars console.log(isTouchingPillars(birdX, birdY)) if (! isTouchingPillars(birdX, birdY)){ birdX += 10 bird.style.left = `${birdX}px` bird.style.animation = 'none' setTimeout(moveRight, 50) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "frame () {\n\t\t// If th bonuss is without life, dn't move it.\n\...
[ "0.63129884", "0.6310073", "0.62465155", "0.61950886", "0.61474895", "0.6045042", "0.6039569", "0.6027025", "0.6013083", "0.6011881", "0.6008416", "0.5994504", "0.5994455", "0.59728885", "0.59626245", "0.593583", "0.59287435", "0.5919981", "0.5919406", "0.59119684", "0.590826...
0.0
-1
this changes w add the current tetra's blocks onto the world's block list
function touchdown(w) { // pick a random tetra var randomTetra = aux_1.Aux.listPickRandom(aux_1.Aux.tetraBlocks); w.tetra = randomTetra; var newBlocks = bset_1.BSet.blocksUnion(w.tetra.blocks, w.blocks); elim_1.Elim.eliminateFullRows(newBlocks); w.blocks = newBlocks; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function customBlocks() {\n\t\t\t\tBlockly.Blocks.fw = {\n\t\t\t\t \tinit: function() {\n\t\t\t\t\t\tthis.appendDummyInput()\n\t\t\t\t\t\t\t.appendField(new Blockly.FieldImage(\n\t\t\t\t\t\t\t\t'../../img/blockly-forwards.png', common.imageSize, common.imageSize));\n\t\t\t\t\t\tthis.setPreviousStatement(true);\n\...
[ "0.67570823", "0.6718662", "0.67000675", "0.6662629", "0.66606367", "0.6457118", "0.6389004", "0.63885015", "0.637275", "0.6364866", "0.6343906", "0.63395995", "0.6334992", "0.62951946", "0.6283941", "0.6283054", "0.6275582", "0.6256717", "0.6235365", "0.62278384", "0.6226256...
0.6023621
35
has the current tetra landed on any blocks? need to make a tmp tetra for this
function didLandedOnBlocks(w) { var tmpTetra = data_1.Data.tetraCopy(w.tetra); tetras_1.Tetras.tetraMove(0, 1, tmpTetra); return tetras_1.Tetras.doesTetraOverlapsBlocks(tmpTetra, w.blocks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameOverCheck() {\n /* iterate through every block in the tetromino */\n for (let i = 0; i < tetr[currTet].config[configState].length; i++) {\n /* current pos for each block*/\n let row = row_state + tetr[currTet].config[configState][i][0]*36;\n // if any of the blocks are at the top of the scr...
[ "0.6511118", "0.63651365", "0.6158139", "0.60679245", "0.6062995", "0.59919614", "0.59073627", "0.5868907", "0.58580333", "0.5846065", "0.5839109", "0.5811862", "0.57908267", "0.5785267", "0.576897", "0.5765897", "0.5731126", "0.5715454", "0.5712006", "0.56957173", "0.5680073...
0.73289347
0
take current tetra and move it down until it lands
function worldJumpDown(w) { if (didLanded(w)) { // do nothing } else { // move tetra down, and go to town // i.e. move tetra down and continue tetras_1.Tetras.tetraMove(0, 1, w.tetra); worldJumpDown(w); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveDown() {\n undraw(); //undraw tetromino\n currentPosition += width; //change reference point to one row down\n draw(); //draw the tetromino \n freeze(); \n }", "function moveTetroDown() {\n\tactiveTetro.y += 1\n\tif (hasCollisions()) {\n\t\tactiveTetro.y -= 1\n\...
[ "0.7410451", "0.6969279", "0.67738694", "0.66060907", "0.6515417", "0.64504313", "0.63957", "0.63563055", "0.6338647", "0.6315895", "0.62919456", "0.6287662", "0.6283419", "0.6273896", "0.62719905", "0.6267251", "0.6266917", "0.62148905", "0.6195622", "0.6190521", "0.61874914...
0.0
-1
move w.tetra by dx, dy, but only if you can
function worldMove(dx, dy, w) { var tmpTetra = data_1.Data.tetraCopy(w.tetra); tetras_1.Tetras.tetraMove(dx, dy, tmpTetra); tryNewTetra(w, tmpTetra); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move() {\n this.x += 3;\n this.y += 0;\n if (this.x > 50) {\n this.x += 0;\n this.y += 4;\n }\n if (this.x > 1200) {\n this.y = this.dy;\n this.x = this.dx;\n }\n }", "move(x, y) {...
[ "0.69959414", "0.69059265", "0.68139166", "0.67245054", "0.6622623", "0.6559958", "0.65594655", "0.65569216", "0.6505508", "0.64995635", "0.6472339", "0.6462172", "0.64550495", "0.64424616", "0.6408342", "0.6334624", "0.6334487", "0.6324441", "0.632172", "0.632172", "0.631597...
0.71419
0
try to rotate ccw
function worldRotateCCW(w) { var tmpTetra = data_1.Data.tetraCopy(w.tetra); tetras_1.Tetras.tetraRotateCCW(tmpTetra); tryNewTetra(w, tmpTetra); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "static rotateCCW(): State<Matrix, TetrisPiece> {\n return new State(piece => {\n const rotated = piece.rotateCCW();\n return [rotated.matrix, rotated];\n })\n }", "function rotate() {\n r...
[ "0.6605008", "0.65393627", "0.650318", "0.6451092", "0.6302152", "0.62608945", "0.62175435", "0.6195389", "0.6188428", "0.614062", "0.6129839", "0.61160475", "0.6116005", "0.60811824", "0.60811824", "0.60811824", "0.60584056", "0.6036342", "0.60217726", "0.6020638", "0.601342...
0.76768845
0
displays all items in bamazon.products as clitable
function displayItems() { connection.query("SELECT * FROM products", function(error, response) { if (error) throw error; //create new table to push product info into var itemsTable = new Table({ head: ["Item ID", "Product Name", "Price", "Quantity"] }); //loop through response and push each items info int...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayItems()\n{\n\t//Select All from (products) table within (bamazon) DB\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\n\t\tif(err) throw err;\n\n\t\t//Display all products in table by looping through each row inside table\n\t\tfor(var i = 0; i < res.length; i++)\n\t\t{\n\t\...
[ "0.7626837", "0.72855544", "0.7164313", "0.70652026", "0.70324385", "0.6985447", "0.6977872", "0.69624084", "0.68994236", "0.68712044", "0.6863019", "0.6855403", "0.6852442", "0.6843523", "0.68266207", "0.68240184", "0.6777316", "0.6751165", "0.674931", "0.67286897", "0.67268...
0.6796951
16
SHOW MORE INFO IN THIS FUNCTION, FEELS SHITTY TO USE
function addToInv() { inquirer.prompt([ { name: "itemid", message: "Please enter the ID of the item you would like to add inventory for.", type: "input", validate: function(value) { if (isNaN(value) === false) { return true; } return false; } }, { name: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', разработчики: ' + this.getDevelopers() ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "info() {\n if (this.numOfPages > 0) {\n return this.title + '<br>' + ' by ' + this.author + '<br>' + this.numOfPages + ' pages';\n ...
[ "0.6910086", "0.6842845", "0.6688466", "0.6485663", "0.64041877", "0.63142353", "0.6303076", "0.62863964", "0.62636507", "0.62611705", "0.62439376", "0.6208422", "0.6193722", "0.6175735", "0.6151727", "0.61182064", "0.6089749", "0.6084623", "0.607184", "0.603242", "0.6020486"...
0.0
-1
run at the end of other functions to ask if user wants to return to the menu
function returnToMenu() { inquirer.prompt({ name: "choice", type: "confirm", message: "Would you like to return to the menu?" }).then(function(input) { if (input.choice === true) { menu(); } else { connection.end(); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnToMainMenu() {\r\n\r\n // Reset the game state. \r\n resetGameState();\r\n\r\n // End game flag.\r\n gameHasStarted = false;\r\n\r\n // Reload main menu.\r\n startUp();\r\n}", "function returnToMenu() {\n inquirer.prompt([\n {\n type: \"confirm\",\n ...
[ "0.7266767", "0.71715796", "0.7027737", "0.70259327", "0.70177966", "0.6942707", "0.6851514", "0.67624533", "0.6684713", "0.6643727", "0.66437125", "0.66419363", "0.6605127", "0.6595907", "0.65848124", "0.6523501", "0.64905703", "0.6484639", "0.645053", "0.6449037", "0.644659...
0.7443909
0
this function will return an array of objects but we need to assign that to variable so we can access that information later.
function shuffle(deck) { for (let i = 0; i < 1000; i++) { let location1 = Math.floor((Math.random() * deck.length)); let location2 = Math.floor((Math.random() * deck.length)); // selects two random locations in the deck. // Math.random() will generate a float between 0 and 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "return_All_entred_element(){\n var objects = [this.name , this.preiorite , this.date];\n return objects;\n}", "clientArray() {\n let result = [];\n for (let i = 0; i < this.clients.length; i++) {\n result.push(this.clients[i].toObject());\n }\n return result;\n }", "...
[ "0.6968703", "0.67805386", "0.67210895", "0.668888", "0.6659293", "0.6628893", "0.65974313", "0.6589689", "0.6589366", "0.65777564", "0.6532503", "0.6493466", "0.649046", "0.64808875", "0.6466593", "0.6462494", "0.645409", "0.6432694", "0.6427242", "0.64258355", "0.6424623", ...
0.0
-1
Function to count words in a string
function count_words(file_contents, callback) { var words = file_contents.split(/[\s,]+/); callback(words.length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countNumOfWords(str) {\n\n}", "function wordscount(str){\n\treturn str.split(/\\s+/).length;\n}", "function wordCount(str){\nreturn str.split(\" \").length;\n}", "function wordCount(str) \n{ \n\treturn str.split(\" \").length;\n}", "function WordCount(str){\n return str.split(\" \").length;\n}", ...
[ "0.8852205", "0.8514409", "0.84355646", "0.84235895", "0.8372435", "0.83683497", "0.8352604", "0.8312657", "0.82961696", "0.8292321", "0.825289", "0.8154649", "0.81008506", "0.8095369", "0.80925304", "0.80541617", "0.8054082", "0.7971942", "0.7938248", "0.7916304", "0.7908491...
0.0
-1
everything happens within this function
function callbackStimuli(data) { design = YAML.parse(data); // setting up kinto var remote_adr = design.settings.server.remote_adr; var bucket_name = 'app'; var collection_name = design.settings.server.collection; if (test=="true"){ window.feedb = 'true'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "function _____SHARED_functions_____(){}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "function comportement (){\n\t }",...
[ "0.6018328", "0.58386177", "0.5734552", "0.57228434", "0.56853616", "0.56843585", "0.56775963", "0.5571142", "0.5551573", "0.55402815", "0.5533802", "0.5528185", "0.5510243", "0.54865843", "0.5477409", "0.5472676", "0.5454589", "0.5399292", "0.53944874", "0.539184", "0.539184...
0.0
-1
a number is an atomic blonde number if the sum and product of its digits are equal. For example, 123 is an atomic blonde number, as the sum of its digits (1+2+3) is 6, which is equal to the product of its digits (123). Write a program to check if a number is an atomic blonde number or not. For example: Input: 1412 Outp...
function atomicBlonde(num) { let numbers = [...num + ''].map(Number); numbers.forEach(function (num, ) { console.log(num); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNumber(a, b) {\n if (a == 8 || b == 8) {\n console.log(true);\n } else if (a + b == 8) {\n console.log(true);\n } else if (a - b == 8 || b - a == 8) {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "function balancedNum(number) {\n let str...
[ "0.6746378", "0.647038", "0.6354907", "0.6344186", "0.6277775", "0.62438697", "0.62039924", "0.61867625", "0.61865", "0.6179143", "0.6111712", "0.6094183", "0.6091255", "0.6081437", "0.6077601", "0.60567313", "0.6053555", "0.60390794", "0.6030007", "0.6027586", "0.59855926", ...
0.0
-1
add class error khi co loi
function setErrorFor(input, message) { var formGroup = input.parentElement; var formMessage = formGroup.querySelector(".form-message"); formMessage.innerText = message; formGroup.className = 'form-group error'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addError(obj){\n\t\t$obj = obj;\n\t\tif($obj.hasClass(\"input-ok\"))\n\t\t\t$obj.removeClass(\"input-ok\");\t\t\n\t\t$obj.addClass(\"input-error\");\n\t}", "function addErrorClass(element){\n var className = 'has-error';\n\n if( element.classList ){\n element.classList.add(className);\n ...
[ "0.6956755", "0.6803513", "0.67723393", "0.6714263", "0.6429501", "0.63901806", "0.63857394", "0.6375917", "0.62500644", "0.6104376", "0.6100914", "0.6100914", "0.60699177", "0.6041663", "0.6033479", "0.60266966", "0.59804255", "0.5961087", "0.5946808", "0.59448594", "0.59027...
0.0
-1
add class success khi khong co loi
function setSuccessFor(input) { var formGroup = input.parentElement; var formMessage = formGroup.querySelector(".form-message"); formMessage.innerText = ''; formGroup.className = 'form-group success'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusBarAddMessage(success ,message){\n\tvar className = (success)? 'success': 'error';\n\t$('footer .status-bar .messages').append('<p class=\"'+className+'\">'+message+'</p>');\n}", "function classAdd(me, strin) {\n me.className += \" \" + strin;\n }", "function addClass(result, error)\n{\n\tif...
[ "0.69425553", "0.64353794", "0.6415918", "0.6303356", "0.6252764", "0.6229465", "0.6218533", "0.61938274", "0.6178855", "0.61349", "0.6110915", "0.6085847", "0.60834056", "0.6070841", "0.6066185", "0.60613716", "0.60418177", "0.60370433", "0.60370433", "0.60351676", "0.603516...
0.0
-1
MOSTRAR PANEL REGISTRO ASISTENCIA
function registroDeAsistencia(){ $("#contenedor").load('ProfesorControllerC'); $("#semana").load('ProfesorControllerS'); $("#registrarHorario").show(); $("#menu").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usuario_agregar(formulario, accion){\n crud_usuario_maskara = new Ext.LoadMask(crud_usuario_formpanel.getEl(), {\n msg: 'Cargando...',\n removeMask: true\n });\n crud_usuario_maskara.show();\n setTimeout('crud_usuario_maskara.hide()', 500);\n var usuario_titulo_Panel = 'Nuevo ...
[ "0.6354422", "0.5948518", "0.59342694", "0.57819533", "0.5781163", "0.5772659", "0.57175356", "0.57082677", "0.5692516", "0.5623731", "0.5622563", "0.56094027", "0.55858904", "0.55754465", "0.5574537", "0.5552607", "0.5550854", "0.5542223", "0.55204266", "0.55103916", "0.5495...
0.51610684
94
MOSTRAR PANEL GENERAR REPORTES
function pReporAtras(){ $("#generarReporte").hide(); $("#menu").show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDataPanel() {\n var dataPanel,\n panelProperties = new Ext.Panel({\n region: 'north',\n height: 30,\n cls: 'properties-panel',\n html: '<div class=\"properties\">'\n + '<div class=\"left\"><p class=\"label\"><label for=\"speed\">Facteur de vites...
[ "0.6461263", "0.6135665", "0.60148007", "0.5964584", "0.59454197", "0.58935094", "0.5791309", "0.5777014", "0.5706352", "0.5670686", "0.5646964", "0.56449825", "0.5644306", "0.56266254", "0.5589845", "0.5584697", "0.5573626", "0.5557869", "0.5548485", "0.5535732", "0.5533717"...
0.0
-1
MOSTRAR PANEL Mis Asignaturas
function misAsignaturas(){ $("#contenedorMisAsignaturas").load('ProfesorControllerM'); $("#MisAsignaturas").show(); $("#menu").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrarAsignarNivel(){ // Cuando toque el boton \"asignar nivel\" voy a ver la seccion (Asignar nivel a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divMostrarTablaXDocente\").innerHTML = \"\"; //limpio tabla por posible interaccion anterior\r\...
[ "0.6301353", "0.6202639", "0.6168369", "0.6070992", "0.59770465", "0.59554785", "0.5940209", "0.59076995", "0.5864707", "0.58515006", "0.5793341", "0.5778715", "0.575598", "0.5751119", "0.5736215", "0.571227", "0.5707225", "0.5706319", "0.56958425", "0.56605566", "0.5656689",...
0.0
-1
position + point > position'
playStone(position, selectedPoint) { return position.map(point => { if (point.x === selectedPoint.x && point.y === selectedPoint.y) { point.color = this.state.turn; return point; } else { return point; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contains(p){\n return (this.x + this.size / 2 - p.getX()) ** 2 + (this.y + this.size / 2 - p.getY()) ** 2 <= this.size ** 2 / 4\n }", "contain(x2, y2) {\n let d = dist (x2, y2, this.x, this.y);\n if (d < this.r * 2) {\n return true;\n }\n else {\n return false;\n }\n }", "fun...
[ "0.6928552", "0.6643274", "0.6545471", "0.65423405", "0.6526163", "0.64926463", "0.644872", "0.644872", "0.6436502", "0.64166206", "0.64124525", "0.64124525", "0.6407588", "0.6325065", "0.63174623", "0.63062817", "0.6300087", "0.62429816", "0.6227527", "0.62172145", "0.621370...
0.0
-1
1. Decide the constant to be added or multiplied 2. Decide whether the final o[peration is to be addition or multiplication
function test(num) { return { multiplier: function(array) { var newArray = array.map(function(val) { return val * num; }); return newArray; }, adder: function(array) { var newArray = array.map(fu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(val) {\r\n let a = ((this.a * val.b) + (val.a * this.b));\r\n let b = (this.b * val.b);\r\n if(a==0){ return new Rational(0,1) }\r\n return new Rational(a,b)\r\n }", "function addition(){\n\tif(operation == \"\"){\n\t\tcheckNumString();\n\t\tnum1 = numString;\n\t\toperation = \"+\";\n\t\tnumStri...
[ "0.6516744", "0.60455626", "0.59841937", "0.59770226", "0.59369826", "0.59289175", "0.5909266", "0.5906696", "0.59049076", "0.5880328", "0.58272445", "0.5811125", "0.5810457", "0.5808697", "0.578968", "0.57671833", "0.57519567", "0.5743062", "0.57355887", "0.5721862", "0.5717...
0.0
-1
the functions to create an element
function addMatchTile(data) { // creating the tile div var matchtile = document.createElement('div'); matchtile.classList.add('match-tile'); // creating the home match box var homeTeam = document.createElement('div'); homeTeam.classList.add('team...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElement(elem) {\n\n\n\n\n\n\n}", "function create(element){\r\n\treturn document.createElement(element);\r\n}", "function elementCreator( type, id, className, value ){\n\t\t//Create element with it's class attribute, id and type\n\t\tvar button = addElement(type, className, id);\n\t\tif(value){\...
[ "0.7851564", "0.75512034", "0.75390595", "0.7519628", "0.7496026", "0.73256534", "0.7266272", "0.72639525", "0.72621775", "0.7238693", "0.72038656", "0.7196656", "0.71695995", "0.71406037", "0.711823", "0.71045727", "0.70760274", "0.707274", "0.69952446", "0.6979393", "0.6977...
0.0
-1
run matchmaking algo map words in a text to their frequency
function addWordsToDictionary(wordCountMap, dict) { for(let key in wordCountMap){ dict[key] = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordCountEnginePt2(document) {\n // your code goes here\n const frequencyCnt = {};\n document\n .toLowerCase()\n .split(' ')\n .forEach((word, index) => {\n word = word.replace(/[^a-z]/gi, '');\n if (word) {\n if (frequencyCnt[word]) {\n frequencyCnt[word] = {\n ...
[ "0.68326485", "0.6818848", "0.67493623", "0.66969794", "0.65839094", "0.65550244", "0.65402734", "0.6513482", "0.6483649", "0.63433665", "0.634307", "0.6287519", "0.62851065", "0.6267589", "0.6266542", "0.6219437", "0.6159283", "0.6127452", "0.6124069", "0.605584", "0.6037435...
0.0
-1
im including the checkbox on the data tab cause im too lazy to make a new class for it
constructor(){ this.stats = ["H", "VPIP", "PFR", "AF", "CB", "2B", "3Ba", "3B", "4B", "FC", "F2B", "F3B", "F3", "WTSD"]; this.lists = ["sortable1", "sortable2", "sortable3", "sortableBin"]; //will have to change if more lines are added or smth this.listItems = {}; //this.reverseListItems = {}; this.generateLi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCheckBox(data) {\n \t// update checkboxes\n \tdojo.forEach(data, function(item){\n \t\t\t\t\titem.chkBoxUpdate = '<input type=\"checkbox\" align=\"center\" id=\"'+item.expdIdentifier+'\" onClick=\"getCheckedRows(this)\" />';\n \t\t\t\t\titem.chkBoxUpdate.id = item.expdIde...
[ "0.7057048", "0.67178375", "0.6663855", "0.6427361", "0.6352195", "0.63270545", "0.63145876", "0.630605", "0.62914944", "0.6272617", "0.6245667", "0.6211213", "0.62055296", "0.61921453", "0.6184604", "0.6184604", "0.61468565", "0.61346716", "0.6118172", "0.60835296", "0.60727...
0.0
-1
This will be the main executable.
function main() { let config = { "timeBegin": new Date(Date.UTC(2016, 8, 17, 0, 0, 0)), "timeEnd": new Date(Date.UTC(2016, 8, 17, 23, 0, 0)), "goalPattern": { "metric": "invidi.webapp.localhost_localdomain.request.total_response_time.mean", "timeBegin": 1474106851, "timeEnd": 147415370...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n new App().main();\n}", "function main() {\n return _main.apply(this, arguments);\n}", "function main(){\n // Path\n if (program.moduleName) {\n var nameArg = program.args.shift();\n }else{\n console.log(chalk.red('Please enter a module name with -n.'));\n con...
[ "0.7631296", "0.7504473", "0.7451314", "0.7391033", "0.71119744", "0.6980815", "0.69427997", "0.69127244", "0.6898714", "0.6828662", "0.6823226", "0.6820901", "0.68203", "0.67797107", "0.67692786", "0.67604905", "0.673392", "0.67201513", "0.6716867", "0.66966385", "0.66949373...
0.0
-1
Have the function LongestWord(sen) take the sen parameter being passed and return the largest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty. ANSWER
function LongestWord(sen) { return sen.replace(/[^a-zA-Z ]/g;, '') .split(' ') .filter(String) .reduce(function(longest, word) { if (word.length > longest.length) return word; return longest; }, ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LongestWord(sen) { \n\tsen=sen.replace(/[^a-zA-Z ]/ig,'');\n\tvar splitStr = sen.split(' ');\n\tvar numArr = [];\n\tfor (var i=0; i<splitStr.length; i++) {\n\t\tnumArr.push(splitStr[i].length);\n\t\t}\n\t\tvar maxNum = Math.max.apply(null, numArr);\n\tfor (var i=0; i<splitStr.length; i++) {\n\t\tif (maxNu...
[ "0.911305", "0.90479773", "0.8942842", "0.8749717", "0.8746276", "0.8739405", "0.8735356", "0.87275726", "0.8687768", "0.8660646", "0.8627636", "0.8585451", "0.8580409", "0.85658807", "0.8526879", "0.842859", "0.84263486", "0.8420671", "0.83899844", "0.8384853", "0.83319455",...
0.8915858
3
Pull the list of yesterday's games TODO: use request.js
function fetchGames(callback){ var url = 'http://wap.mlb.com/gdcross/components/game/mlb/year_'+year+'/month_'+month+'/day_'+day+'/miniscoreboard.json'; console.log('fetching url: ' + url); http.get(url, function(res){ var body = ''; res.on('data', function(chunk) { body += chunk; }); res....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPreviousGames() {\n\t$.getJSON(\"/games\").done(function(response){\n\t\tconsole.log(response.games);\n\t\tshowGames(response.games);\n\t});\n}", "getPastGames() {\n\n // TODO: AXIOS Requeset to get information about old games for this user\n\n let pastGamesList = [];\n\n let num...
[ "0.6999972", "0.6760849", "0.6658916", "0.65452945", "0.6519678", "0.64421916", "0.63037056", "0.6286221", "0.6263255", "0.62438214", "0.6227729", "0.618438", "0.6164815", "0.61265343", "0.6113094", "0.60357726", "0.5995953", "0.59927106", "0.5969404", "0.59640384", "0.595654...
0.0
-1
Insert a completed game into the database
function insertGame(pgClient,date,winner,loser,callback){ var teamQuery = 'SELECT * FROM public.teams WHERE teams.name LIKE \'' +winner+ '\' OR teams.name LIKE \''+loser+'\''; console.log ('query: ' + teamQuery); pgClient.query(teamQuery , function(err, result) { if(err) return console.error...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addRecord(name, game) {\n //alert('DB access: addrecord');\n let newName = ModalRecord.clearName(name);\n let level = game.getAvailableLevelsArray()[game.level].label;\n let d = new Date();\n let dateStr = d.getDate() + '/' + (d.getMonth() + 1) + '/' + d.getFullYear();\n\n...
[ "0.6450073", "0.6417702", "0.64107525", "0.6315584", "0.61170214", "0.6072817", "0.6014022", "0.6005741", "0.5923453", "0.59049785", "0.5875079", "0.5875025", "0.5872787", "0.58533657", "0.58226985", "0.5816006", "0.5770315", "0.57656896", "0.57618904", "0.57388204", "0.57152...
0.6131668
4
calendar can automatically switch to Boulder time for users in different regions with TZID being set remind users events before 10 mins
function createICSfile(id){ var ele = document.getElementById(id) console.log(ele.getAttribute('data-content')) var params = ele.getAttribute('data-content').split("&") var temp_date = params[2].split(' ') console.log(temp_date) var temp_time = params[3].split(':') console.log(temp_time) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeTimeZone() {\n analyticsEvent('changed');\n setKnownBrowserOffset().done(function () {\n exports.navigate(nav.newBuilder('account').build());\n });\n }", "function bindTextClockEvent() {\n var parisTimeZone = 1;\n if (isBSTinEffect())\n parisTimeZone...
[ "0.6501056", "0.6066588", "0.6037252", "0.5880244", "0.5805889", "0.57486033", "0.5663471", "0.5648345", "0.5583735", "0.5523003", "0.551027", "0.5470217", "0.5469172", "0.54659295", "0.54390603", "0.5433942", "0.5408795", "0.53632104", "0.5362699", "0.53621304", "0.53323627"...
0.0
-1
1. create the filter factory functon
function LovesFilter() { return function(input) { input = input || ""; input = input.replace("likes", "loves"); return input; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterFactory() {\n var filter = {\n option: \"all\"\n };\n\n // Get current option\n filter.getCurrentOption = function(option) {\n return filter.option;\n };\n\n // Change filter options\n filter.changeOption = function(option) {\n filter.option = option;\n }...
[ "0.79439265", "0.7781205", "0.7303625", "0.7140073", "0.70791197", "0.7046091", "0.7028793", "0.69765824", "0.6969357", "0.6897573", "0.68666226", "0.6856234", "0.6856234", "0.6839022", "0.6827304", "0.6817548", "0.68025273", "0.6795554", "0.6781753", "0.67650825", "0.6765082...
0.0
-1
create two cubes in one mesh
function createTwoCubes() { // create a cube using coordinates var mesh = new Mesh3D(); mesh.quad([0, 0, 0], [0, 10, 0], [10, 10, 0], [10, 0, 0]); mesh.quad([0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]); mesh.quad([10, 0, 0], [10, 10, 0], [10, 10, 10], [10, 0, 10]); mesh.quad([0, 0, 0], [0, 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeCube2(){\n var vertexBuf = [];\n var triBuf = [];\n var normBuf = [];\n var vertices = [[0,0,1],[1,0,1],[1,1,1],[0,1,1],[0,0,0],[1,0,0],[1,1,0],[0,1,0]];\n var triangles = [[6,2,3],[3,7,6],[4,0,1],[1,5,4]];\n var normals = [[0,1,0],[0,1,0],[0,-1,0],[0,-1,0],[0,1,0],[0,1,0],[0,-1,0],[...
[ "0.73267215", "0.72259295", "0.71904576", "0.71072406", "0.7077887", "0.70721865", "0.6975852", "0.68389183", "0.6827413", "0.6804699", "0.6801083", "0.679201", "0.67504084", "0.6739166", "0.6715799", "0.67128927", "0.6669767", "0.6656178", "0.66471964", "0.66016185", "0.6592...
0.825007
0
; public static const ELEMENT_CELL:BEMElement =
function ELEMENT_CELL$static_(){LayoutPreviewRenderer.ELEMENT_CELL=( LayoutPreviewRenderer.BLOCK.createElement("cell"));}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ELEMENT_CELL_READ_ONLY$static_(){LayoutPreviewRenderer.ELEMENT_CELL_READ_ONLY=( LayoutPreviewRenderer.BLOCK.createElement(\"cell-read-only\"));}", "function ELEMENT_CELL_HIGHLIGHTED$static_(){LayoutPreviewRenderer.ELEMENT_CELL_HIGHLIGHTED=( LayoutPreviewRenderer.BLOCK.createElement(\"cell-highlighted\")...
[ "0.62141764", "0.589281", "0.575823", "0.57427096", "0.5728061", "0.5719228", "0.5656838", "0.5648537", "0.5640905", "0.5638554", "0.56214815", "0.55986404", "0.55937076", "0.55223334", "0.55172604", "0.5507675", "0.5495116", "0.54922885", "0.54828906", "0.5470257", "0.546925...
0.7541231
0
; public static const ELEMENT_CELL_HIGHLIGHTED:BEMElement =
function ELEMENT_CELL_HIGHLIGHTED$static_(){LayoutPreviewRenderer.ELEMENT_CELL_HIGHLIGHTED=( LayoutPreviewRenderer.BLOCK.createElement("cell-highlighted"));}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ELEMENT_CELL$static_(){LayoutPreviewRenderer.ELEMENT_CELL=( LayoutPreviewRenderer.BLOCK.createElement(\"cell\"));}", "function ELEMENT_CELL_READ_ONLY$static_(){LayoutPreviewRenderer.ELEMENT_CELL_READ_ONLY=( LayoutPreviewRenderer.BLOCK.createElement(\"cell-read-only\"));}", "get cellDeclaration() {\n ...
[ "0.6500478", "0.5599104", "0.552382", "0.5515218", "0.5346866", "0.5339542", "0.5332074", "0.5268651", "0.52682596", "0.52569836", "0.5255146", "0.5255146", "0.5222538", "0.5200591", "0.5190958", "0.5190231", "0.5190231", "0.5190231", "0.5190231", "0.51739943", "0.516258", ...
0.67596614
0
; public static const ELEMENT_CELL_READ_ONLY:BEMElement =
function ELEMENT_CELL_READ_ONLY$static_(){LayoutPreviewRenderer.ELEMENT_CELL_READ_ONLY=( LayoutPreviewRenderer.BLOCK.createElement("cell-read-only"));}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ELEMENT_CELL$static_(){LayoutPreviewRenderer.ELEMENT_CELL=( LayoutPreviewRenderer.BLOCK.createElement(\"cell\"));}", "function ELEMENT_CELL_HIGHLIGHTED$static_(){LayoutPreviewRenderer.ELEMENT_CELL_HIGHLIGHTED=( LayoutPreviewRenderer.BLOCK.createElement(\"cell-highlighted\"));}", "get cell() {\n let...
[ "0.66811067", "0.566477", "0.5531839", "0.5520248", "0.54989797", "0.5379705", "0.53456277", "0.5284072", "0.52571684", "0.5253587", "0.52382004", "0.52201504", "0.5214184", "0.5214184", "0.5202272", "0.51631707", "0.5160342", "0.51460785", "0.51453686", "0.5133477", "0.51334...
0.77583253
0
OBTENGO FECHA CON EL TIEMPO
function addZero(i) { if (i < 10) { i = '0' + i; } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preenche(){\n if(comentario.comentario==\"\"){\n c.email.innerText = \"user: \" + comentario.usuario.email;\n c.textoComentario.innerHTML = 'comentario apagado';\n c.botaoEnviarComentario = c.botoes.children[0];\n }else{\n c.email.innerText = \"use...
[ "0.6532022", "0.6224566", "0.6132787", "0.6088056", "0.6054971", "0.60042393", "0.5994302", "0.59848225", "0.5982992", "0.5966934", "0.5961242", "0.5942869", "0.59393173", "0.5926917", "0.5917895", "0.5913381", "0.5910635", "0.59012896", "0.58877116", "0.5882275", "0.58746845...
0.0
-1
const card = document.querySelector(".card");
function createCards(options){ //creatind div element with class ":card" let card = document.createElement("div"); card.className = "card"; let cardImgContainer = document.createElement('div'); cardImgContainer.className = "card__img"; card.append(cardImgContainer); //creating img element ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get listOfCardElements() { return $$(\".card\"); }", "function getCard(card){\n return card.getElementsByClassName('deck-card')[0].src;\n}", "function getCardElement(el) {\n if (el.className.indexOf('card ') > -1) return el;\n else return getCardElement(el.parentElement);\n}", "function getCards() {\n ...
[ "0.7361065", "0.71324724", "0.708151", "0.70259714", "0.696537", "0.6789957", "0.6787643", "0.6783077", "0.6776384", "0.6727095", "0.6646613", "0.6637186", "0.66077876", "0.6594521", "0.6534976", "0.64718527", "0.64390343", "0.6435751", "0.64342135", "0.6413153", "0.6405918",...
0.0
-1
adding privileges on role
function addPrivileges(roleId) { //fetching role id var superadmin if ($('.superAdmin' + roleId).prop('checked') == true) { superadmin = '1'; } else { superadmin = '0'; } //fetching role add permission var add = new Array(); $("input[name ='add[]']:checked").each(functio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setRole() {}", "function addRole(role) {\n roles.push(role);\n}", "function addRole(x) {\n this.forEach(function (user) {\n user.role = x\n });\n return this;\n}", "function set_roles() {\n\n // Define roles, resources and permissions\n acl.allow([\n {\n roles: '0', ...
[ "0.7291726", "0.70779556", "0.6899414", "0.67103875", "0.65322155", "0.65322155", "0.6449587", "0.64420205", "0.64015454", "0.6397547", "0.6383767", "0.6363275", "0.62216794", "0.62019885", "0.60828185", "0.6069623", "0.60266745", "0.60233164", "0.6005646", "0.60017705", "0.5...
0.5541131
72
returns a starting phrase about a third of the time, otherwise it's empty
function randomStartingPhrase() { if (Math.random() < 0.33) { return phrases[Math.floor(Math.random() * phrases.length)] } return '' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function first3(string){\n return(\n // your code here\n )\n}", "function takeString(stg)\n{ \n return sentence.substring(0,3);\n}", "step3a (word) {\n let result = word\n if (endsin(result, 'heid') && result.length - 4 >= this.r2 && result[result.length - 5] !== 'c') {\n // Delete\n ...
[ "0.6396629", "0.625098", "0.62401885", "0.5860954", "0.5820491", "0.5767547", "0.5693285", "0.5589274", "0.55429435", "0.5511907", "0.55027276", "0.54940116", "0.5488332", "0.548628", "0.54796493", "0.54385716", "0.54385716", "0.54385716", "0.54385716", "0.54385716", "0.54385...
0.61636466
3
Select all elements from the DOM that are called on when the Class is instantiated.
create() { this.element = document.querySelector( this.selectors.element ); this.elements = {}; each( this.selectors.elements, ( selector, key ) => { if ( selector instanceof window.HTMLElement || selector instanceof window.NodeList ) { this.elements[key] = selector; } else if ( Array.isArray( selector...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get elements() {\n return browser.elements(this._selector);\n }", "constructor(selector = 'body') {\n this._el = document.getElementsByClassName(selector);\n }", "function _gatherElements() {\n return jQuery('*[id]')\n .toArray()\n // use jQuery instances\n ...
[ "0.68437", "0.67812747", "0.6696645", "0.6690001", "0.66254514", "0.64673513", "0.6360627", "0.63435984", "0.6335375", "0.6307441", "0.6260298", "0.6252835", "0.6248919", "0.62249315", "0.61944014", "0.6169872", "0.6133515", "0.6091427", "0.60772926", "0.60735977", "0.6069107...
0.6444906
6
check if body is empty
function checkBody(res, body, cbk, isTrue) { if (isTrue) { cbk(body); return; } if (typeof body !== 'undefined' && body !== null && Object.keys(body).length > 0) { cbk(body); } else { Jwr(res, false, {}, "Requested body seems blank"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasBody(input)\n{\n\treturn (input.indexOf('<body>') != -1 || input.indexOf('<Body>') != -1 || input.indexOf('<BODY>') != -1);\n}", "function _validateRequestBody() {\n //Get req.body size\n var size = Object.keys(user).length;\n if (!user || size <= 0) {\n //send response\n res.statu...
[ "0.6984009", "0.68758726", "0.6798912", "0.675784", "0.6686694", "0.6662935", "0.6607625", "0.6591391", "0.6566626", "0.64104015", "0.6385804", "0.6355368", "0.63218933", "0.6318556", "0.62922704", "0.62922704", "0.6252569", "0.62476665", "0.62177634", "0.62070763", "0.619046...
0.7193264
0
The following are the callbacks that can be passed to createHook(). init is called during object construction. The resource may not have completed construction when this callback runs, therefore all fields of the resource referenced by "asyncId" may not have been populated.
init (asyncId, type, triggersAsyncId, resource) { fs.writeSync(1, "\n\t>>>>>> Hook init <<<<<<<<"+asyncId+"\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async init() {}", "async init() {}", "async init () {}", "async init() {\n\n }", "async init(){}", "async init( callback ) {\n throw \"implement me!\";\n }", "_init() {\n this.add(this.callback);\n }", "initialize(){// ensures first update will be caught by an early access of\n// `upda...
[ "0.6078233", "0.6078233", "0.6025239", "0.5860103", "0.5852568", "0.5841179", "0.5828192", "0.5816912", "0.5806557", "0.58024216", "0.5785586", "0.57516235", "0.57411355", "0.5730274", "0.57039946", "0.57039946", "0.567249", "0.5635842", "0.56246835", "0.55859333", "0.5540786...
0.75632495
0
Before is called just before the resource's callback is called. It can be called 0N times for handles (e.g. TCPWrap), and will be called exactly 1 time for requests (e.g. FSReqCallback).
before (asyncId) { fs.writeSync(1, "\n\tHook before "+asyncId+"\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tCodeStreamAPITest.prototype.before.bind(this),\n\t\t\tthis.init\n\t\t], callback);\n\t}", "function beforeAllHooks(cb) {\n var hooks;\n if (Array.isArray(resource._before) && resource._before.length > 0) {\n hooks = resource._before.slice...
[ "0.7082724", "0.69249225", "0.6779088", "0.6779088", "0.6779088", "0.6779088", "0.66780466", "0.6626254", "0.65904385", "0.6576186", "0.6393898", "0.6393797", "0.63630044", "0.6261963", "0.6211028", "0.61786115", "0.6144871", "0.61172944", "0.60947984", "0.60563856", "0.60447...
0.5325327
67
After is called just after the resource's callback has finished.
after (asyncId) { fs.writeSync(1, "\n\tHook after "+asyncId+"\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_after() {\n this._exitContext();\n }", "afterHandling() {}", "after()\n {\n }", "function after(object){\n if(object.after)\n object.after();\n }", "afterAll() {//\n }", "async [RpcProvider.after] () {\n // the after hook is perfect your cleaning things up, if ...
[ "0.7038537", "0.6478615", "0.61367613", "0.6119002", "0.61065185", "0.60048395", "0.5887363", "0.58851945", "0.58232826", "0.56802285", "0.56785864", "0.56416845", "0.56416845", "0.5591611", "0.5576724", "0.5558762", "0.55222225", "0.55161566", "0.5505956", "0.545295", "0.539...
0.50782263
62
Destroy is called when an AsyncWrap instance is destroyed.
destroy (asyncId) { fs.writeSync(1, "\n\tHook destroy "+asyncId+"\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n this.remove(this.callback);\n }", "destroy() {\n Object(_environment__WEBPACK_IMPORTED_MODULE_2__[\"inTransaction\"])(this.env, () => {\n Object(_lifetime__WEBPACK_IMPORTED_MODULE_3__[\"legacySyncDestroy\"])(this, this.env);\n Object(_lifetime__WEBPACK_IMPORTED_MODULE_3__[\"a...
[ "0.6953685", "0.68852615", "0.68852615", "0.679798", "0.67957586", "0.67957586", "0.67917377", "0.67917377", "0.67917377", "0.67917377", "0.67917377", "0.67917377", "0.6771052", "0.67401534", "0.67367435", "0.67214495", "0.66863286", "0.66560555", "0.6645479", "0.66212004", "...
0.0
-1
promiseResolve is called only for promise resources, when the `resolve` function passed to the `Promise` constructor is invoked (either directly or through other means of resolving a promise)
promiseResolve (asyncId) { fs.writeSync(1, "\n\tHook promiseResolve "+asyncId+"\n") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alwaysResolve(promise) {\n\treturn new Promise((resolve, reject) => {\n\t\tpromise.then(resolve, resolve)\n\t})\n}", "static resolve(p) {\n return (p instanceof promise) ? p : new promise((r,j)=>{\n r(p)\n })\n }", "function doResolve(promise, fn, onFulfilled, onRejected) {...
[ "0.71236515", "0.69224364", "0.6907216", "0.69070077", "0.6838358", "0.6752761", "0.6689283", "0.66214377", "0.6609369", "0.65817916", "0.6526728", "0.6526728", "0.6526728", "0.6526728", "0.6526728", "0.6526728", "0.6526728", "0.65219456", "0.65011156", "0.64919823", "0.64602...
0.0
-1
mouse down over element
function startDragSubstationDigital(evt) { if(!DraggingObjSubstationDigital &&addElemSubstationDigitalViz==true) //---prevents dragging conflicts on other draggable elements--- { objDragTargetSubstationDigital=activeElem if(objDragTargetSubstationDigital) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mouseDown(pt) {}", "mouseDown(pt) {}", "function onMouseDown(event) { }", "mouseUp(pt) {}", "mouseUp(pt) {}", "mouseDownUp(start, end) {}", "async elementMouseOver(e) {\n this.cancelEvent(e);\n const el = e.target;\n if (el) {\n this.selectedInstance = await this.ctx.api...
[ "0.8003874", "0.8003874", "0.75281906", "0.7427081", "0.7427081", "0.7269822", "0.71473676", "0.70807105", "0.70338225", "0.7016597", "0.6997129", "0.6997129", "0.6977151", "0.69688964", "0.694578", "0.69419897", "0.69419897", "0.6902494", "0.6883785", "0.6882526", "0.6836584...
0.0
-1
onItemPress is called when the TouchableOpacity is pressed it calls the onToggleDone handler that is passed as a property it calls the handler with the index prop that indicates the todo's place in the collection
onItemPress() { this.props.onToggleDone(this.props.index) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Todo({ todo, index, completeTodo, removeTodo }) {\n\n if (!todo.isCompleted) {\n return (\n <View style={{\n flex: 1,\n flexDirection: 'row',\n alignItems: 'stretch',\n padding: 5\n }}>\n <View style={{ width: 200 , padding: 5}}>\n <Text style={{ textDecorationLine: ...
[ "0.7240568", "0.6918608", "0.645337", "0.6435408", "0.6219472", "0.61429894", "0.61285007", "0.61212546", "0.6109862", "0.6100341", "0.6095373", "0.606236", "0.6037371", "0.6032694", "0.60162085", "0.60086304", "0.60054606", "0.5999128", "0.5995603", "0.59612435", "0.5953635"...
0.82349646
0
Getter function for events
function getEvents() { //e.preventDefault(); var userEmail; // var content = ''; firebase.auth().onAuthStateChanged(function(user) { if(user) { userEmail = user.email; } }); // Use "get" method to retrieve entire collection db.collection("events").get().then((q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get event() {\n\t\treturn this.__event;\n\t}", "get event() {\n\t\treturn this.__event;\n\t}", "get event() {\n\t\treturn this.__event;\n\t}", "get onEvent() {\n return this._onEvent;\n }", "getEventHandler() {\n return (this.eventHandler);\n }", "get event () {\n\t\treturn this...
[ "0.74962145", "0.74962145", "0.74962145", "0.74396235", "0.74307865", "0.73060924", "0.7206454", "0.7176937", "0.71732706", "0.71336544", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.7038121", "0.70381...
0.0
-1
EDITOR CONSTRUCTOR A CodeMirror instance represents an editor. This is the object that user code is usually dealing with.
function CodeMirror(place, options) { if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); this.options = options = options || {}; // Determine effective options based on given values and defaults. copyObj(defaults, options, false); setGuttersForLineNumbers(options); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EditorConstructor() { }", "function EditorConstructor() { }", "constructor(editor) {\n _defineProperty(this, \"editor\", void 0);\n\n _defineProperty(this, \"command\", void 0);\n\n if (!editor) {\n throw new Error('no editor');\n }\n\n this.editor = editor;\n this.command = thi...
[ "0.74126655", "0.74126655", "0.6985667", "0.69276", "0.6870653", "0.6862957", "0.68483263", "0.6847067", "0.6845284", "0.6843747", "0.6843747", "0.68417996", "0.683816", "0.6828127", "0.6823805", "0.68210196", "0.68210196", "0.68018687", "0.67857593", "0.67857593", "0.6785759...
0.68479943
7
DISPLAY CONSTRUCTOR The display handles the DOM integration, both for input reading and content drawing. It holds references to DOM nodes and displayrelated state.
function Display(place, doc) { var d = this; // The semihidden textarea that is focused when the editor is // focused, and receives input. var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); // The textarea is kept posit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Interpreter_CreateDisplayPanel()\n{\n\t//create a div\n\tvar theDisplayPanel = document.body.appendChild(document.createElement(\"DIV\"));\n\t//set its values\n\ttheDisplayPanel.style.cssText = \"position:absolute;width:100%;height:100%;overflow:auto;left:0px;top:0px;-moz-transform-origin:0 0;\" + (__DESI...
[ "0.664557", "0.6610947", "0.6567228", "0.6434448", "0.6390132", "0.63709974", "0.63011235", "0.62922496", "0.6060752", "0.6056811", "0.6053063", "0.6043945", "0.5972346", "0.59605443", "0.59545165", "0.5924039", "0.591236", "0.591236", "0.59122336", "0.5894869", "0.5878915", ...
0.0
-1
STATE UPDATES Used to get the editor into a consistent state again when options change.
function loadMode(cm) { cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); resetModeState(cm); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sync_options_and_states(update_states) {\n var that = this;\n var current = that.current;\n var options = that.options;\n \n if (update_states) {\n current.pos = options.pos || current.pos;\n current.data_set = options.data_set || current.data_set;\n ...
[ "0.72264963", "0.6557531", "0.65004337", "0.636211", "0.63114977", "0.62595415", "0.6165454", "0.6155256", "0.6061125", "0.60550684", "0.60429186", "0.60117173", "0.60117173", "0.60117173", "0.5979159", "0.59749466", "0.596928", "0.5962128", "0.5939207", "0.5934096", "0.58930...
0.0
-1
Returns a function that estimates the height of a line, to use as first approximation until the line becomes visible (and is thus properly measurable).
function estimateHeight(cm) { var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); return function(line) { if (lineIsHidden(cm.doc, line)) return 0; var widgetsHeight = 0; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t fo...
[ "0.7597833", "0.7595643", "0.7519606", "0.7509123", "0.7509123", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "0.7446284", "...
0.7166742
46
Rebuild the gutter elements, ensure the margin to the left of the code matches their width.
function updateGutters(cm) { var gutters = cm.display.gutters, specs = cm.options.gutters; removeChildren(gutters); for (var i = 0; i < specs.length; ++i) { var gutterClass = specs[i]; var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); if (gutterCla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapp...
[ "0.6624648", "0.6136517", "0.5908344", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.5870894", "0.58042896", ...
0.0
-1
Compute the character length of a line, taking into account collapsed ranges (see markText) that might hide parts, and join other lines onto it.
function lineLength(line) { if (line.height == 0) return 0; var len = line.text.length, merged, cur = line; while (merged = collapsedSpanAtStart(cur)) { var found = merged.find(0, true); cur = found.from.line; len += found.from.ch - found.to.ch; } cur = line; while (me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n w...
[ "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.768047", "0.767538", "0.767538", "0.767538", "0.767538", "0.767538", "0.76753...
0.76553917
25
Find the longest line in the document.
function findMaxLine(cm) { var d = cm.display, doc = cm.doc; d.maxLine = getLine(doc, doc.first); d.maxLineLength = lineLength(d.maxLine); d.maxLineChanged = true; doc.iter(function(line) { var len = lineLength(line); if (len > d.maxLineLength) { d.maxLineLength = len; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = le...
[ "0.75578374", "0.75578374", "0.75578374", "0.75578374", "0.75578374", "0.75578374", "0.75578374", "0.75578374", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585", "0.75558585"...
0.7503701
27
Make sure the gutters options contains the element "CodeMirrorlinenumbers" when the lineNumbers option is true.
function setGuttersForLineNumbers(options) { var found = indexOf(options.gutters, "CodeMirror-linenumbers"); if (found == -1 && options.lineNumbers) { options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); } else if (found > -1 && !options.lineNumbers) { options.gutters = opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGuttersForLineNumbers(options) {\n var found = false;\n for (var i = 0; i < options.gutters.length; ++i) {\n if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n if (options.lineNumbers) found = true;\n else options.gutters.splice(i--, 1);\n }\n }\n if (!found &...
[ "0.81626403", "0.81626403", "0.81626403", "0.81626403", "0.80995405", "0.8059217", "0.8059217", "0.8059217", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", "0.80101126", ...
0.80455315
8
Prepare DOM reads needed to update the scrollbars. Done in one shot to minimize update/measure roundtrips.
function measureForScrollbars(cm) { var scroll = cm.display.scroller; return { clientHeight: scroll.clientHeight, barHeight: cm.display.scrollbarV.clientHeight, scrollWidth: scroll.scrollWidth, clientWidth: scroll.clientWidth, hScrollbarTakesSpace: hScrollbarTakesSpace(cm), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n ...
[ "0.6302923", "0.6302923", "0.6302923", "0.6288367", "0.6288367", "0.62744635", "0.6270154", "0.6267724", "0.6267724", "0.62519085", "0.6244726", "0.62226504", "0.6197769", "0.6197769", "0.6193877", "0.61588645", "0.6146981", "0.6080233", "0.60619366", "0.604273", "0.6039361",...
0.0
-1
Resynchronize the fake scrollbars with the actual size of the content.
function updateScrollbars(cm, measure) { if (!measure) measure = measureForScrollbars(cm); var d = cm.display, sWidth = scrollbarWidth(d.measure); var scrollHeight = measure.docHeight + scrollerCutOff; var needsH = measure.scrollWidth > measure.clientWidth; if (needsH && measure.scrollWidth <= ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateScrollableContents() {\n if (this.intervalId_ !== null) {\n return;\n } // notifyResize is already in progress.\n\n this.requestUpdateScroll();\n\n const nodeList = this.shadowRoot.querySelectorAll('[scrollable] iron-list');\n if (!nodeList.length) {\n return;\n }\n\n let node...
[ "0.67460907", "0.6549103", "0.6544785", "0.6544785", "0.6544785", "0.654138", "0.65377885", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0.65326375", "0...
0.5969392
72
Compute the lines that are visible in a given viewport (defaults the the current scroll position). viewport may contain top, height, and ensure (see op.scrollToPos) properties.
function visibleLines(display, doc, viewport) { var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; top = Math.floor(top - paddingTop(display)); var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHei...
[ "0.7428004", "0.7423784", "0.7423784", "0.7401895", "0.7381045", "0.7378128", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "0.7356046", "...
0.7229076
44
LINE NUMBERS Realign line numbers and gutter marks to compensate for horizontal scrolling.
function alignHorizontally(cm) { var display = cm.display, view = display.view; if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; var gutterW = display.gutters.off...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=...
[ "0.68237305", "0.6636246", "0.6613658", "0.6610662", "0.65216875", "0.65216875", "0.65216875", "0.6500994", "0.64681387", "0.64681387", "0.6466621", "0.6466621", "0.6466621", "0.6466621", "0.6466621", "0.6466621", "0.6465702", "0.6465702", "0.6465702", "0.6465702", "0.6460707...
0.0
-1
Used to ensure that the line number gutter is still the right size for the current document size. Returns true when an update is needed.
function maybeUpdateLineNumberWidth(cm) { if (!cm.options.lineNumbers) return false; var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; if (last.length != display.lineNumChars) { var test = display.measure.appendChild(elt("div", [elt("div", last)], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\",...
[ "0.6708659", "0.6708659", "0.6708659", "0.6708659", "0.6708659", "0.6708659", "0.6698834", "0.6698834", "0.66813594", "0.66813594", "0.66813594", "0.66813594", "0.66601974", "0.66601974", "0.66494584", "0.66494584", "0.66494584", "0.66494584", "0.66494584", "0.66494584", "0.6...
0.6616522
42
Computes display.scroller.scrollLeft + display.gutters.offsetWidth, but using getBoundingClientRect to get a subpixelaccurate result.
function compensateForHScroll(display) { return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }", "functio...
[ "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6271024", "0.6242958", "0.62195975", "0.62193304", "0.62193304", ...
0.6104378
44
Does the actual updating of the line display. Bails out (returning false) when there is nothing to be done and forced is false.
function updateDisplayIfNeeded(cm, update) { var display = cm.display, doc = cm.doc; if (update.editorIsHidden) { resetView(cm); return false; } // Bail out if the visible area is already rendered and nothing changed. if (!update.force && update.visible.from >= display....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawUpdate( current ) {\n\n\t\tif ( previous.x !== current.x || previous.y !== current.y ) {\n\t\t\tmultiline( previous.x, previous.y, current.x, current.y, splits, lineSymmetryCtrl.checked );\n\t\t}\n\t}", "function checkLineChanged(currLine){\n if (currLine != prevLine){\n return true;\n }\n ret...
[ "0.61671185", "0.60690796", "0.6060248", "0.6060248", "0.60542053", "0.6020038", "0.5999325", "0.598918", "0.59889686", "0.59746116", "0.5963688", "0.5962917", "0.59485847", "0.59485847", "0.59485847", "0.59485847", "0.5925672", "0.59239405", "0.592233", "0.592233", "0.591772...
0.60204786
5
Read the actual heights of the rendered lines, and update their stored heights to match.
function updateHeightsInViewport(cm) { var display = cm.display; var prevBottom = display.lineDiv.offsetTop; for (var i = 0; i < display.view.length; i++) { var cur = display.view[i], height; if (cur.hidden) continue; if (ie && ie_version < 8) { var bot = cur.node.offsetTop ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h =...
[ "0.6847615", "0.6575622", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6520374", "0.6517116", "0.6517116", "0.6511045", "0.6511045", "0.6511045", "0.6507662", "0.64917886", "0.64917886", "0.64917886", "0.6491407", "0.64767325",...
0.0
-1
Read and store the height of line widgets associated with the given line.
function updateWidgetHeight(line) { if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) line.widgets[i].height = line.widgets[i].node.offsetHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].heigh...
[ "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.79324657", "0.79324657", "0.79289424", "0.7914109", "0.7914109", "0.7914109", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", ...
0.79586625
7
Do a bulkread of the DOM positions and sizes needed to draw the view, so that we don't interleave reading and writing to the DOM.
function getDimensions(cm) { var d = cm.display, left = {}, width = {}; for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { left[cm.options.gutters[i]] = n.offsetLeft; width[cm.options.gutters[i]] = n.offsetWidth; } return {fixedPos: compensateForHScroll(d), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateRendering() {\n this._domElement.style.width = this._width + 'px'\n this._domElement.style.height = this._height + 'px'\n this._adjustAll()\n }", "draw() {\n if (this._page !== currentPage) {\n return;\n }\n this.drawRectangles();\n if (!isReady) {\n ...
[ "0.58983", "0.58468074", "0.5799769", "0.5757686", "0.57288194", "0.57127064", "0.56729776", "0.5612521", "0.5602312", "0.5595048", "0.5584485", "0.5493505", "0.54847926", "0.5462245", "0.5460018", "0.541719", "0.541437", "0.5377288", "0.5369166", "0.53670514", "0.536432", ...
0.0
-1
Sync the actual display DOM structure with display.view, removing nodes for lines that are no longer in view, and creating the ones that are not there yet, and updating the ones that are out of date.
function patchDisplay(cm, updateNumbersFrom, dims) { var display = cm.display, lineNumbers = cm.options.lineNumbers; var container = display.lineDiv, cur = container.firstChild; function rm(node) { var next = node.nextSibling; // Works around a throw-scroll bug in OS X Webkit if (w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patchDisplay(cm, updateNumbersFrom, dims) {\n\t var display = cm.display, lineNumbers = cm.options.lineNumbers;\n\t var container = display.lineDiv, cur = container.firstChild;\n\t\n\t function rm(node) {\n\t var next = node.nextSibling;\n\t // Works around a throw-scroll bug in OS X We...
[ "0.6637529", "0.6637485", "0.6637485", "0.66369975", "0.66256374", "0.6614724", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", "0.6570161", ...
0.65094954
32
When an aspect of a line changes, a string is added to lineView.changes. This updates the relevant part of the line's DOM structure.
function updateLineForChanges(cm, lineView, lineN, dims) { for (var j = 0; j < lineView.changes.length; j++) { var type = lineView.changes[j]; if (type == "text") updateLineText(cm, lineView); else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); else if (type == "clas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t\t for (var j = 0; j < lineView.changes.length; j++) {\n\t\t var type = lineView.changes[j];\n\t\t if (type == \"text\") updateLineText(cm, lineView);\n\t\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t\...
[ "0.7632331", "0.76297593", "0.7610523", "0.7610523", "0.7610523", "0.7600449", "0.7600449", "0.7600449", "0.7600449", "0.7600449", "0.7600449", "0.75967455", "0.75958526", "0.75958526", "0.7588853", "0.7588853", "0.7588853", "0.7588853", "0.7588853", "0.7588853", "0.7588853",...
0.7583553
31
Lines with gutter elements, widgets or a background class need to be wrapped, and have the extra elements added to the wrapper div
function ensureLineWrapped(lineView) { if (lineView.node == lineView.text) { lineView.node = elt("div", null, null, "position: relative"); if (lineView.text.parentNode) lineView.text.parentNode.replaceChild(lineView.node, lineView.text); lineView.node.appendChild(lineView.text); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapp...
[ "0.63652897", "0.6070703", "0.57518905", "0.56793195", "0.5650686", "0.5588701", "0.55632764", "0.55362713", "0.55177873", "0.5483235", "0.54808384", "0.54808384", "0.5474382", "0.54581654", "0.5456185", "0.54484624", "0.54248106", "0.5405661", "0.5405661", "0.5405661", "0.54...
0.0
-1
Wrapper around buildLineContent which will reuse the structure in display.externalMeasured when possible.
function getLineContent(cm, lineView) { var ext = cm.display.externalMeasured; if (ext && ext.line == lineView.line) { cm.display.externalMeasured = null; lineView.measure = ext.measure; return ext.built; } return buildLineContent(cm, lineView); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built\n\t\t }\n\t\t return buildLineContent(cm, lineView)\n\...
[ "0.748198", "0.74742734", "0.7393433", "0.7393433", "0.7393433", "0.7393433", "0.7393433", "0.7393433", "0.7393433", "0.7393433", "0.739184", "0.739184", "0.739184", "0.7384763", "0.7384763", "0.7384763", "0.7384763", "0.7384763", "0.7384763", "0.7384763", "0.7384763", "0.7...
0.73631
30
Redraw the line's text. Interacts with the background and text classes because the mode may output tokens that influence these classes.
function updateLineText(cm, lineView) { var cls = lineView.text.className; var built = getLineContent(cm, lineView); if (lineView.text == lineView.node) lineView.node = built.pre; lineView.text.parentNode.replaceChild(built.pre, lineView.text); lineView.text = built.pre; if (built.bgClass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre...
[ "0.74867094", "0.74753976", "0.7463882", "0.7463882", "0.7463882", "0.7463882", "0.7463882", "0.7463882", "0.7463882", "0.7463882", "0.74568784", "0.74568784", "0.74568784", "0.7445559", "0.7445559", "0.7445559", "0.7445559", "0.7445559", "0.7445559", "0.7445559", "0.7445559"...
0.7449514
13
Build a line's DOM representation from scratch
function buildLineElement(cm, lineView, lineN, dims) { var built = getLineContent(cm, lineView); lineView.text = lineView.node = built.pre; if (built.bgClass) lineView.bgClass = built.bgClass; if (built.textClass) lineView.textClass = built.textClass; updateLineClasses(lineView); updateL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildLineElement(cm, lineView, lineN, dims) {\n\t\t var built = getLineContent(cm, lineView);\n\t\t lineView.text = lineView.node = built.pre;\n\t\t if (built.bgClass) { lineView.bgClass = built.bgClass; }\n\t\t if (built.textClass) { lineView.textClass = built.textClass; }\n\n\t\t updateLi...
[ "0.7639888", "0.75955623", "0.75483197", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7545719", "0.7539128", ...
0.7401656
43
A lineView may contain multiple logical lines (when merged by collapsed spans). The widgets for all of them need to be drawn.
function insertLineWidgets(lineView, dims) { insertLineWidgetsFor(lineView.line, lineView, dims, true); if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) insertLineWidgetsFor(lineView.rest[i], lineView, dims, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n inser...
[ "0.7027548", "0.7027548", "0.7027548", "0.7027548", "0.7027548", "0.7027548", "0.69329065", "0.6855795", "0.68497884", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0.68482625", "0....
0.70150566
6
SELECTION / CURSOR Selection objects are immutable. A new one is created every time the selection changes. A selection is one or more nonoverlapping (and nontouching) ranges, sorted, and an integer that indicates which one is the primary selection (the one that's scrolled into view, that getCursor returns, etc).
function Selection(ranges, primIndex) { this.ranges = ranges; this.primIndex = primIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Selection() {\n\t\tthis.originX = null;\n\t\tthis.originY = null;\n\t\tthis.finalX = null;\n\t\tthis.finalY = null;\n\t\tthis.minimapSide = MINIMAP_SIDE;\n\t\tthis.setOrigin = setOriginCoords;\n\t\tthis.setFinal = setFinalCoords;\n\t\tthis.getOriginX = getOriginX;\n\t\tthis.getFinalX = getFinalX;\n\t\tthi...
[ "0.7193935", "0.7182111", "0.7097247", "0.70234805", "0.6953221", "0.68312424", "0.67812407", "0.67812407", "0.67812407", "0.67812407", "0.67812407", "0.67812407", "0.67812407", "0.67812407", "0.67689145", "0.668979", "0.66337204", "0.65918106", "0.6569541", "0.6545104", "0.6...
0.6730548
15
Take an unsorted, potentially overlapping set of ranges, and build a selection out of it. 'Consumes' ranges array (modifying it).
function normalizeSelection(ranges, primIndex) { var prim = ranges[primIndex]; ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); primIndex = indexOf(ranges, prim); for (var i = 1; i < ranges.length; i++) { var cur = ranges[i], prev = ranges[i - 1]; if (cmp(prev.to(), cur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static _mergeRanges(ranges, newRange) {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRange[1] <= range[0]) {\n // Case 1: New range is before the search range\n ...
[ "0.70198345", "0.6832455", "0.6790611", "0.67756253", "0.66953534", "0.668972", "0.668972", "0.668972", "0.668972", "0.668972", "0.668972", "0.668972", "0.668972", "0.6681765", "0.66433257", "0.66398495", "0.66398495", "0.66398495", "0.66398495", "0.66398495", "0.66398495", ...
0.6718438
4
Most of the external API clips given positions to make sure they actually exist within the document.
function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_pos(){\n\t//Write our checking of all positions\n\n\tif (blob_pos_x > c_canvas.width - 20){\n\tblob_pos_x = blob_pos_x - 4;\n\t}\n\tif (blob_pos_x < 0){\n\tblob_pos_x = blob_pos_x + 4;\n\t}\n\tif (blob_pos_y > c_canvas.height - 20){\n\tblob_pos_y = blob_pos_y - 4;\n\t}\n\tif (blob_pos_y < 0){\n\tblo...
[ "0.5864847", "0.5675815", "0.5597132", "0.55336946", "0.5505028", "0.54783475", "0.5436124", "0.5401128", "0.5393276", "0.5389713", "0.5371284", "0.5357897", "0.532305", "0.5318283", "0.5305361", "0.530255", "0.52998257", "0.52911633", "0.52911526", "0.5287562", "0.52868515",...
0.0
-1
SELECTION UPDATES The 'scroll' parameter given to many of these indicated whether the new cursor position should be scrolled into view after modifying the selection. If shift is held or the extend flag is set, extends a range to include a given position (and optionally a second position). Otherwise, simply returns the ...
function extendRange(doc, range, head, other) { if (doc.cm && doc.cm.display.shift || doc.extend) { var anchor = range.anchor; if (other) { var posBefore = cmp(head, anchor) < 0; if (posBefore != (cmp(other, anchor) < 0)) { anchor = head; head = other; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend);\n }\n\n var newSel = normalizeSelection(doc.cm...
[ "0.6524732", "0.62137073", "0.6172779", "0.6172779", "0.6172779", "0.6172779", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", "0.6114598", ...
0.58588153
58
Extend the primary selection range, discard the rest.
function extendSelection(doc, head, other, options) { setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n\n if (posBefore != cmp(other, anchor) < 0) {\n anchor = head;\n head = other;\n } else if (posBefore != cmp...
[ "0.7361317", "0.72121984", "0.71236956", "0.71236956", "0.71236956", "0.7040623", "0.7036874", "0.7036874", "0.7036874", "0.7036874", "0.7036874", "0.7036874", "0.7036874", "0.7036874", "0.70040554", "0.70040554", "0.6841599", "0.6841599", "0.6841599", "0.6841599", "0.6841599...
0.7038878
6
Extend all selections (pos is an array of selections with length equal the number of selections)
function extendSelections(doc, heads, options) { for (var out = [], i = 0; i < doc.sel.ranges.length; i++) out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); var newSel = normalizeSelection(out, doc.sel.primIndex); setSelection(doc, newSel, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extendSelections(doc, heads, options) {\n\t\t for (var out = [], i = 0; i < doc.sel.ranges.length; i++)\n\t\t out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null);\n\t\t var newSel = normalizeSelection(out, doc.sel.primIndex);\n\t\t setSelection(doc, newSel, options);\n\t\t }", "f...
[ "0.6725686", "0.66993475", "0.66993475", "0.66993475", "0.667093", "0.66363275", "0.6631757", "0.6631757", "0.6631757", "0.6631757", "0.6631757", "0.6631757", "0.6631757", "0.6631757", "0.65674454", "0.65674454", "0.6553577", "0.6553577", "0.6553577", "0.6534233", "0.6534233"...
0.6623638
14
Updates a single range in the selection.
function replaceOneSelection(doc, i, range, options) { var ranges = doc.sel.ranges.slice(0); ranges[i] = range; setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateInRange(editor, range, offset = 0, updateFunc) {\n const baseRange = editor.getSelectedRange();\n editor.setSelectedRange(range);\n updateFunc();\n editor.setSelectedRange([baseRange[0] + offset, baseRange[1] + offset]);\n }", "updateRange(start, end) {\n this.range.start = start\n this....
[ "0.7218381", "0.69966", "0.6366824", "0.6361162", "0.6361162", "0.6361162", "0.63484067", "0.63484067", "0.63484067", "0.63484067", "0.63484067", "0.63484067", "0.63484067", "0.63484067", "0.63199526", "0.63136816", "0.63136816", "0.6311347", "0.62980735", "0.62980735", "0.62...
0.63363445
14
Reset the selection to a single range.
function setSimpleSelection(doc, anchor, head, options) { setSelection(doc, simpleSelection(anchor, head), options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resetSelection() {\n this.__selectedRangeArr = [];\n this.__anchorSelectionIndex = -1;\n this.__leadSelectionIndex = -1;\n }", "restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }", "reset() {\n this._selection = -1;\n }", "funct...
[ "0.79797", "0.7659073", "0.7618294", "0.74684507", "0.74392134", "0.7276428", "0.7236947", "0.7173246", "0.6906848", "0.6906848", "0.6906848", "0.688273", "0.687953", "0.687953", "0.687953", "0.687953", "0.687953", "0.687953", "0.687953", "0.687953", "0.6857984", "0.6857239...
0.0
-1
Give beforeSelectionChange handlers a change to influence a selection update.
function filterSelectionChange(doc, sel) { var obj = { ranges: sel.ranges, update: function(ranges) { this.ranges = []; for (var i = 0; i < ranges.length; i++) this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), clipPos(doc, ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() { }", "function SelectionChange() { }", "beforeSelectRow(rowid, e){\n }", "selectionChanged(context, onContextChanged) {\n retur...
[ "0.74342006", "0.74342006", "0.74342006", "0.74342006", "0.73138916", "0.73138916", "0.6497567", "0.6485535", "0.6449815", "0.64453065", "0.6394854", "0.6393972", "0.6393972", "0.6393972", "0.6390207", "0.6348505", "0.6310619", "0.6283051", "0.62365264", "0.62365264", "0.6180...
0.6072003
29