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
var recursivePromise = Promise.promisify(
function recursiveDataGrabber(query, max, data, callback_0){ console.log('Controller: Data with Max: '+data.length +' MAX: '+ max); search.getAllUserInstancesAgain(query,max).then(function (results){ results = JSON.parse(results); data = data.concat(results); if (data.length >= limit || results.length < 200) { console.log('Controller: Recursion DONE LENGTH:'+data.length); callback_0(data); return; } else { recursiveDataGrabber(query, results[199].id_str, data, callback_0); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promisify(inner) {\n return new Promise((resolve, reject) =>\n inner((err, res) => {\n if (err) return reject(err);\n else return resolve(res);\n })\n );\n}", "function promisify(fn) {\n return function(...args) {\n return new Promise( function(resolve, reject) {\n ...
[ "0.6813291", "0.6415146", "0.640557", "0.6283072", "0.62223774", "0.6081148", "0.60807854", "0.6064911", "0.60550886", "0.60303", "0.5965134", "0.5840433", "0.5803601", "0.5795231", "0.5795231", "0.5795231", "0.5770007", "0.57583547", "0.57022774", "0.5701393", "0.5701393", ...
0.0
-1
CODILITY PROBLEMS ============================================================================================== Lesson 4 Counting Elements ============================================================================================== L4 Perm Checker / A nonempty zeroindexed array A consisting of N integers is given. A permutation is a sequence containing each element from 1 to N once, and only once. For example, array A such that: A[0] = 4 A[1] = 1 A[2] = 3 A[3] = 2 is a permutation, but array A such that: A[0] = 4 A[1] = 1 A[2] = 3 is not a permutation, because value 2 is missing. The goal is to check whether array A is a permutation. Write a function: function solution(A); that, given a zeroindexed array A, returns 1 if array A is a permutation and 0 if it is not. For example, given array A such that: A[0] = 4 A[1] = 1 A[2] = 3 A[3] = 2 the function should return 1. Given array A such that: A[0] = 4 A[1] = 1 A[2] = 3 the function should return 0. Assume that: N is an integer within the range [1..100,000]; each element of array A is an integer within the range [1..1,000,000,000]. Complexity: expected worstcase time complexity is O(N); expected worstcase space complexity is O(N), beyond input storage (not counting the storage required for input arguments). Elements of input arrays can be modified. Perm Check permutation checker, given a zeroindexed array A, returns 1 if array A is a permutation and 0 if it is not
function permCheck(A) { var distinctNumberObject = {}, len = A.length, largest = Math.max.apply(Math,A), distinctNumbersCounted = 0; // largest number must equal size of array for it to be a permutation. if (largest === len) { for (i = 0; i < len; i++) { var distinctNumberIndex = A[i] - 1; if (!distinctNumberObject[distinctNumberIndex]) { distinctNumberObject[distinctNumberIndex] = true; distinctNumbersCounted++; if (distinctNumbersCounted === largest) { return 1; } } } } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const N = A.length;\n let count = new Array(N+1).fill(0);\n \n for(let i in A){\n if(A[i] > N){\n return 0;\n }\n if(count[A[i]] > 0){\n return 0;\n }\n count[A[i]]++;...
[ "0.68444836", "0.66633946", "0.6649471", "0.6557802", "0.64224577", "0.63520896", "0.62780696", "0.62755716", "0.62748027", "0.62715364", "0.6223827", "0.61813194", "0.61736655", "0.6140965", "0.61363196", "0.610516", "0.6084023", "0.6071268", "0.6035077", "0.59985274", "0.59...
0.77779937
0
Create the function to run for both events
function runEnter() { // Prevent the page from refreshing d3.event.preventDefault(); // Select the input element and get the raw HTML node var inputElementDate = d3.select("#datetime"); // var inputElementCity = d3.select("#city"); // var inputElementState = d3.select("#state"); // var inputElementCountry = d3.select("#country"); // var inputElementShape = d3.select("#shape"); // Get the value property of the input element var inputValue = inputElementDate.property("value").trim(); console.log(inputValue); var filteredData = dataList.filter(dataList => dataList.datetime === inputValue); console.log(filteredData); tbody.html(""); let response = { filteredData }; if(response.filteredData.length !== 0) { getData(filteredData); } else { tbody.append("tr").append("td").text("There are no sightings for the current search criteria. Please try again!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Events(){}//", "function Events(){}//", "onEvent() {\n \n }", "function EventHelper (possibleEvents) {\n }", "function constroiEventos(){}", "handleEvents() {\n }", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events...
[ "0.6424834", "0.6424834", "0.6390404", "0.6353437", "0.63517565", "0.62114793", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", "0.6175389", ...
0.0
-1
random float for specifying ball direction
function randomFloat(min,max){ return min+(Math.random()*(max-min)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BallStartPosition()\n {\n var randomNum = Math.floor(Math.random()*2)\n if(randomNum == 0)\n {\n ball.speedX = -ball.speedX;\n ball.speedY = -ball.speedY;\n }\n if(randomNum == 1)\n {\n ball.speedX = Math.abs(ball.speedX);\n ball.speedY = Math.abs(ball.speedY);\n }\n ...
[ "0.7768337", "0.77296907", "0.74361587", "0.73115885", "0.7135385", "0.71310353", "0.7108028", "0.7074491", "0.7020762", "0.7005384", "0.7002904", "0.6989081", "0.6962469", "0.6896277", "0.6894648", "0.6847753", "0.6826241", "0.67911685", "0.6751009", "0.67328095", "0.6731257...
0.0
-1
random color for balls
function randomColor(){ return `rgb(${randomInt(0,256)},${randomInt(0,256)},${randomInt(0,256)})`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomColor() {\n r = random(255);\n g = random(255);\n b = random(255);\n}", "function ballsBgColor() {\n const randomNumber = Math.floor(Math.random() * balls.length);// Random number between 0 and 5\n for (let i = 0; i < balls.length; i += 1) {\n if (i === randomNumber) { // To put the answer...
[ "0.81134444", "0.7710204", "0.77017725", "0.77001345", "0.76753265", "0.767251", "0.76707643", "0.7653003", "0.76454043", "0.7631624", "0.76299345", "0.7571218", "0.7569614", "0.75645864", "0.75579494", "0.7557005", "0.75545645", "0.7542439", "0.75405586", "0.7533367", "0.752...
0.0
-1
generates balls on screen
function generate(){ for (let i=0;i<randomInt(40,300);i++){ var x = randomInt(50,1150); var y = randomInt(50,650); var r = randomInt(10,30); cond = false; if(i!==0){ do{ x = randomInt(50,1150); y = randomInt(50,650); r = randomInt(10,30); for(j = 0; j < ballarray.length; j++){ if (dist(x,y,ballarray[j].x,ballarray[j].y) -(r + ballarray[j].size)< 10){ cond = true; break; } else{ cond =false; } } }while(cond); } ballarray.push(new ball(x,y,r)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initBalls() {\n container.css({'position':'relative'});\n for (i=0;i<ballCount;i++) {\n var newBall = $('<b />').appendTo(container),\n size = rand(ballMinSize,ballMaxSize);\n newBall.css({\n 'position':'absolute',\n 'width': '5em',\n 'height': '5em',\n 'background-image...
[ "0.79297787", "0.77312446", "0.76148176", "0.7614811", "0.7538535", "0.7502164", "0.74750805", "0.7460339", "0.74571425", "0.73702365", "0.7358047", "0.73537654", "0.73315406", "0.73086935", "0.7247816", "0.7241751", "0.7214185", "0.7196349", "0.7102294", "0.708334", "0.70823...
0.6984431
24
Retrieve the search results.
componentWillMount(): void { this._updateSearch(this.props.filter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchAndResults() {\n return messenger.searchIsReady().then(function (data) {\n var bag = data;\n quickSearch.getFormConfig($stateParams.entityId, $stateParams.userId, $stateParams.formId).then(function (data) {\n vm.data = data;\n ...
[ "0.7297593", "0.72167414", "0.7154665", "0.70559335", "0.7008465", "0.7007643", "0.69624525", "0.69535667", "0.6947637", "0.6902696", "0.6847962", "0.6824126", "0.67735595", "0.67410344", "0.67110157", "0.66888815", "0.6644403", "0.6642325", "0.66234", "0.66161823", "0.660391...
0.0
-1
const socket = io.connect(); Function that will get the Streamer's camera
async function startVideo() { console.log("Requesting Local Media"); try { // TODO: Add checking for camera and audio const userMedia = await navigator.mediaDevices.getUserMedia({ audio: false, video: true, }); console.log("Recieved Local Media"); stream = userMedia; videoElementHTML.srcObject = stream; socket.emit("stream_online"); } catch (err) { console.error(`Error getting local media: ${err}`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onLoad() {\n // opens websocket\n function isOpen(ws) {\n return socket.readyState === ws.OPEN;\n }\n //connecting to camera using websocket\n var socket = new WebSocket(\"ws://\" + window.location.host + \"/ws\");\n var img_socket = new WebSocket(\n \"ws://\" + window.location.host + \"/ws_ca...
[ "0.7234021", "0.7009632", "0.6764083", "0.6715808", "0.6542103", "0.6523225", "0.6460521", "0.6446046", "0.6441944", "0.643081", "0.6361702", "0.62628293", "0.6206829", "0.61739737", "0.6143523", "0.612827", "0.6116145", "0.6101446", "0.60846347", "0.60835785", "0.6079427", ...
0.59327835
32
Only show the star counter if the number of star is greater than 2
showStarCounter() { const currentBoard = Boards.findOne(Session.get('currentBoard')); return currentBoard && currentBoard.stars >= 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function starCount() {\n if (moves == 22 || moves == 27 || moves == 32) {\n hideStar();\n }\n}", "function starCount() {\n if (moveCount >= starChart4 && moveCount < starChart3) {\n $('.star4').hide();\n starResult = 3;\n\t}\n else if (moveCount >= starChart3 && moveCount < starChart2) {\n $('.st...
[ "0.75931925", "0.75653076", "0.75070995", "0.7431751", "0.74291766", "0.7384715", "0.72422016", "0.7238542", "0.71884614", "0.71672255", "0.71468824", "0.71317893", "0.7130833", "0.70577246", "0.70502913", "0.7042862", "0.7031024", "0.7030213", "0.6967661", "0.69583267", "0.6...
0.75144744
2
Limit amount of threads used for each image sharp.concurrency(1); Create preview for image path Image file path. resizeConfig width height max_width max_height jpeg_quality gif_animation skip_size imageType gif, jpeg, png, etc
async function createPreview(image, resizeConfig, imageType) { // To scale image, we calculate new width and height, // resize image by height, and crop by width let saveAsIs = false; let u = resize_outline(image.width, image.height, resizeConfig); let scaledWidth = u.crop_width; let scaledHeight = u.crop_height; let outType = resizeConfig.type || imageType; if (imageType === outType) { // If image size is smaller than 'skip_size', skip resizing; // this saves image as is, including metadata like EXIF // if (resizeConfig.skip_size && image.length < resizeConfig.skip_size) { saveAsIs = true; } // If image is smaller than needed already, save it as is // if (scaledWidth >= image.width && scaledHeight >= image.height) { if (!resizeConfig.max_size || image.length < resizeConfig.max_size) { saveAsIs = true; } } } // Do not repack small non-jpeg images, // we always process jpegs to fix orientation // if (saveAsIs && imageType !== 'jpeg') { return { image, type: imageType }; } let sharpInstance = sharp(image.buffer); let formatOptions = {}; if (outType === 'jpeg') { // Set quality for jpeg image (default sharp quality is 80) formatOptions.quality = resizeConfig.jpeg_quality; // Rotate image / fix Exif orientation sharpInstance.rotate(); // Jpeg doesn't support alpha channel, so substitute it with white background if (imageType === 'gif' || imageType === 'png') { sharpInstance.flatten({ background: 'white' }); } } if (!saveAsIs) { if (resizeConfig.unsharp) { sharpInstance.sharpen(); } sharpInstance.resize(Math.round(scaledWidth), Math.round(scaledHeight), { fit: 'cover', position: 'attention', withoutEnlargement: true }); } let res = await sharpInstance.toFormat(outType, formatOptions) .withMetadata() .toBuffer({ resolveWithObject: true }); return { image: { buffer: res.data, length: res.info.size, width: res.info.width, height: res.info.height, type: res.info.type }, type: outType }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previewImages(input, imgId, parentId, cssClass, maxImages) {\n // Ensure at least one image is selected and there's no more than maxImagess\n if (input.files[0] && (input.files.length <= maxImages)) {\n // counter to keep track of the element ID to be modified\n var i = 0; \n //...
[ "0.6110448", "0.56923664", "0.5627865", "0.5626599", "0.56240946", "0.5608498", "0.5601916", "0.5593498", "0.558684", "0.55845207", "0.55675715", "0.55589616", "0.5557858", "0.5547128", "0.55332875", "0.5467738", "0.54672444", "0.5462436", "0.54510015", "0.54483396", "0.54419...
0.6013363
1
Remove all metadata (Exif, ICC, photoshop stuff, etc.)
function filterJpegPreview(buffer) { buffer = image_traverse.jpeg_segments_filter(buffer, segment => { if (segment.id >= 0xE1 && segment.id < 0xF0) return false; return true; }); return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripMetadata(data) {\n return data.Properties;\n }", "function cleanMeta(obj) {\n delete obj._id;\n delete obj._rev;\n delete obj.docType;\n}", "function i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}", "function m(e){var t=[];for(var n in e){var i...
[ "0.6675288", "0.640114", "0.63121706", "0.61797065", "0.5982011", "0.59794635", "0.5946059", "0.59440136", "0.5847914", "0.58420014", "0.5819018", "0.57720083", "0.57626057", "0.573764", "0.56843233", "0.562532", "0.5587533", "0.5587533", "0.5422192", "0.54016703", "0.5361417...
0.0
-1
Remove metadata (ICC, photoshop stuff, etc.), and filter exif
function filterJpegImage(buffer, comment) { buffer = image_traverse.jpeg_segments_filter(buffer, segment => { if (segment.id >= 0xE2 && segment.id < 0xF0) return false; return true; }); buffer = image_traverse.jpeg_exif_tags_filter(buffer, entry => { return entry.data_length < 100; }); if (comment) { buffer = image_traverse.jpeg_add_comment(buffer, comment); } return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExifPropClean(prop, value) {\n\tvar cleansed=new Object();\n\tcleansed.name=null;\n\tcleansed.desc=null;\n\tswitch(prop) {\n\t\tcase \"Make\": \n\t\t\tcleansed.name=\"Camera\";\n\t\t\tcleansed.desc=value;\n\t\tbreak;\n\t\tcase \"Model\": \n\t\t\tcleansed.name=prop; \n\t\t\tcleansed.desc=value;\n\t\tbre...
[ "0.599326", "0.59427935", "0.56942064", "0.55306035", "0.54907334", "0.5378107", "0.536386", "0.53288746", "0.5325352", "0.5261711", "0.5199587", "0.51725966", "0.51718825", "0.5148193", "0.5137347", "0.50965416", "0.50762236", "0.5048262", "0.5035441", "0.50271004", "0.50232...
0.5274883
9
Origin of coordinates is topright.
function posToBrgDst(x1, y1, x2, y2) { var dx = x2-x1; var dy = y2-y1; return [ Math.atan2(dx,dy), Math.sqrt(dx*dx+dy*dy) ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get right() {\n // x is left position + the width to get end point\n return this.x + this.width\n }", "reverse() {\n return Point(\n 0 - this.x,\n 0 - this.y\n )\n }", "moveToBottomRight([horizontal, vertical], context) {\n return context.changeHorizontalPosition(horizontal...
[ "0.61981183", "0.6040655", "0.60228854", "0.6018739", "0.5838677", "0.5786062", "0.576662", "0.57398444", "0.5737066", "0.5726313", "0.5708169", "0.5681476", "0.567363", "0.56489915", "0.5635827", "0.5630266", "0.5628155", "0.56176966", "0.5615726", "0.55727214", "0.5563737",...
0.0
-1
Given an angle in Artemis' format, return the angle in degrees as a prettyprinted string.. Pi becomes 0 (north) Pi/2 becomes 90 (east) 0 becomes 180 (south) Pi/2 becomes 270 (west) Pi becomes 360 (north)
function radianToDegrees(rad) { if (isNaN(rad)) { return 'N/A'; } var degrees = 180 + ( 180*rad/Math.PI ); return degrees.toFixed(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format_angle(x, pos_char, neg_char, is_html, a) {\n if (!a)\n a = expand_angle(Math.abs(x), settings.degrees_format);\n var s = '';\n var symbols = [is_html? '&deg;' : '', \"'\", '\"'];\n var space = is_html? '&nbsp;' : ' ';\n for (var i = 0; i <= settings.degrees_format; i++)\n s += (i == 0? '...
[ "0.7214117", "0.702506", "0.69961894", "0.6696864", "0.6584051", "0.65414405", "0.6492527", "0.649025", "0.6393008", "0.6379663", "0.6338646", "0.6286558", "0.6284792", "0.626988", "0.6259668", "0.62576634", "0.624441", "0.6235654", "0.62316", "0.6228806", "0.622699", "0.61...
0.0
-1
Function to find numbers with repeated digits
function findRepeatedDigit(number) { let tempNumber = number; if (number > 10) { let lastDigit = number % 10; number = parseInt(number / 10); let firstDigit = number % 10; if (lastDigit == firstDigit) return tempNumber; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sameDigits(a,b) {\n //solution here\n}", "function findDigits(n) {\n let digitArray = n.toString();\n let count = 0;\n for (let i = 0; i <= digitArray.length; i += 1) {\n if (n % digitArray[i] === 0) {\n count++;\n }\n }\n return count;\n}", "function findDigits(n) {\r\n var k=n....
[ "0.70402455", "0.7035918", "0.68731666", "0.67960244", "0.6695744", "0.6534807", "0.653358", "0.6532217", "0.6479978", "0.64749825", "0.6473566", "0.64413553", "0.6434672", "0.64343786", "0.64313453", "0.64313453", "0.64313453", "0.64313453", "0.64313453", "0.64313453", "0.64...
0.7518012
0
zone format list pages
function formatToList(arr){ //array to format number list //var arr = [1,2,3,4,8,15,16,17,20,21,30] //arr = arr.map(Number); arr = arr.sort(function(a, b){return a - b}); var start = arr[0]; var end = arr[0]; var result = ""; for(var i in arr){ i = parseInt(i); if (arr[i] === arr[i+1]-1){ end = arr[i+1]; } else{ if (start >= end){ result += start+","; }else{ result += start+"-"+end+","; } start = arr[i+1]; } } result = result.slice(0, result.length-1) result = result.split(",") return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displaySetup(page,list){\n const end = ( (page*8+8<list.length)?(page*8+8) : list.length )\n this.setState({lastInd: end});\n return(list.slice((page*8), end));\n }", "function CakePhpListLayer() {\n\n}", "function set_up_regions_template(data)\n\t{\n\t\tvar temp;\n\t\tvar str;\n\t\tstr...
[ "0.5775443", "0.5446374", "0.53642035", "0.5326982", "0.53079766", "0.5255189", "0.52353305", "0.52117807", "0.5188642", "0.5186896", "0.51785135", "0.51746905", "0.51744676", "0.5137783", "0.51350546", "0.5133172", "0.5131016", "0.51281786", "0.5119937", "0.5109162", "0.5107...
0.0
-1
14/11/2018: Aula 7 Marcio Justo: JavaScript
function subtracao() { var numeroUm = document.getElementById("valor-um").value; var numeroDois= document.getElementById("valor-dois").value; if (isNaN(numeroUm)) { alert('Número Um inválido!'); } if (isNaN(numeroDois)) { alert('Número Dois inválido!'); } alert(parseInt(numeroUm) - parseInt(numeroDois)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcola_jdUT0(){\n\n // funzione per il calcolo del giorno giuliano per l'ora 0 di oggi in T.U.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // restituisce il valore numerico dataGiuliana.\n \n \n var data=new Date();\n\n var anno = data.getYear(); // anno\n var mese ...
[ "0.6087893", "0.59904623", "0.5989278", "0.5923899", "0.5849531", "0.584033", "0.5806088", "0.5794761", "0.57887447", "0.5749848", "0.5729964", "0.5703972", "0.56496435", "0.5645243", "0.56417555", "0.5634543", "0.5623934", "0.5607767", "0.5607352", "0.5607352", "0.56040776",...
0.0
-1
Verifica Campo da Cidade/Pais
function verificaCampoPreenchido(cidade) { var preenchido; if(cidade != ""){ preenchido = true; } return preenchido; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function esCampo(campo)\n{\n\tif (campo==null) return false;\n\tif (campo.name==null) return false;\n\treturn true;\n}", "function check_ciudad() {\n\n\t\tif($(\"#Ciudad option:selected\").val() == 0) {\n \t\t$(\"#errorciudad\").html(\"Seleccione una ciudad\");\n\t\t\t$(\"#rrorciudad\").show();\n\t\t\terror_v...
[ "0.6524344", "0.5869477", "0.578313", "0.57750964", "0.5773307", "0.5652721", "0.5649926", "0.56426054", "0.55872846", "0.556624", "0.55623364", "0.55515414", "0.55429775", "0.5536049", "0.55336326", "0.55009115", "0.549372", "0.5457524", "0.54054654", "0.53910077", "0.536918...
0.5916437
1
Fala com o OpenWeather
function recebeOpenWeather(cidade) { $.ajax({ url:'http://api.openweathermap.org/data/2.5/weather?q=' + cidade + "&units=metric&lang=pt" + "&APPID=0799ebbcad862deddeeebe1f4ccc65d7", type:"GET", dataType:"json", success: function(data){ var widget = show(data); $("#show").html (widget); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGeoWeather() {\n \tweather.getGeoWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}", "function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tu...
[ "0.68570834", "0.68568385", "0.68553346", "0.684191", "0.68400156", "0.6828727", "0.67853075", "0.67686415", "0.6762652", "0.67233264", "0.67045337", "0.669729", "0.66521275", "0.6651089", "0.6646564", "0.6644218", "0.6620485", "0.6620354", "0.66140944", "0.66072685", "0.6590...
0.0
-1
VoterGroup Constructor for a VoterGroup object. VoterGroup has a ownerId.
constructor(ownerId, name) { this.ownerId = ownerId; this.membersId = new Array(); this.membersId.push(this.ownerId); this.name = name; this.groupId = 'group' + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); this.type = 'group'; this.electionsId = new Array(); if (this.__isContract) { delete this.__isContract; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(groupid, ownerusername, createdAt) {\n\n this.groupid = groupid;\n this.ownerusername = ownerusername;\n this.createdAt = createdAt\n\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnUserHierarchyGroup.CFN_RESOURCE_TYPE_NAME, properties: props });\n ...
[ "0.5636722", "0.56194675", "0.5404564", "0.5368507", "0.52721876", "0.5157866", "0.50252116", "0.50024897", "0.49790817", "0.49592012", "0.49435183", "0.48780602", "0.4846979", "0.48254502", "0.47996077", "0.46718708", "0.46257457", "0.45946336", "0.4593044", "0.45650542", "0...
0.700676
0
function that sets page to homepage
function loadHome() { app.innerHTML = nav + homepage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_home_page() {\n page = home_page;\n load_page();\n}", "function homepage()\n{\n window.location.href = '/';\n}", "function homePage() {\n window.location.href = initApi.homeUrl;\n //location.reload();\n }", "function loadHome(){\r\n switchToContent(\"pag...
[ "0.7465852", "0.72381514", "0.7149455", "0.69634235", "0.6876936", "0.67171496", "0.65555054", "0.65536964", "0.6534664", "0.65315646", "0.6530716", "0.65119815", "0.64897424", "0.64876705", "0.6478199", "0.6460957", "0.64606", "0.64464563", "0.643787", "0.64369375", "0.64284...
0.6657743
6
fucntion that sets page to about page
function loadAbout() { app.innerHTML = nav + about; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toAbout() {\r\n window.location.replace('/about');\r\n }", "function navToAbout() {\r\n location = \"about.html\"\r\n}", "function aboutPage() {\n location.href = \"about.html\"\n}", "function goToAboutPage () {\n window.location.href = \"about.html\"\n}", "function updateAboutPage(urlObj, opt...
[ "0.7394527", "0.727566", "0.7153666", "0.6941263", "0.69326866", "0.6881046", "0.68727916", "0.68418753", "0.68418753", "0.6720247", "0.6711964", "0.6683728", "0.6677873", "0.66585505", "0.6645836", "0.66351163", "0.65251905", "0.6488229", "0.63894325", "0.6367094", "0.636120...
0.6780121
9
Extend an existing object with a method from another
function augment(receivingClass, givingClass) { //only provide certain methods if (arguments[2]) { for (var i=2, len=arguments.length; i<len; i++) { receivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]]; } } // provide all methods else { for (var methodName in givingClass.prototype) { if (!Object.hasOwnProperty.call(receivingClass.prototype, methodName)) { receivingClass.prototype[methodName] = givingClass.prototype[methodName]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend() {}", "extend() {}", "function extendNode(source, target, avoid) {\n Object.getOwnPropertyNames(source).forEach(mymethod => {\n if (!avoid || !avoid.includes(mymethod)) {\n target[mymethod]=source[mymethod];\n }\n });\n }", "function ExtraMethods() {}", "function Extend(targ...
[ "0.673649", "0.673649", "0.6684899", "0.65976304", "0.6497918", "0.6474648", "0.643005", "0.6369684", "0.6351232", "0.63347876", "0.6291876", "0.628176", "0.6256702", "0.62486285", "0.62427306", "0.62427306", "0.62427306", "0.62391615", "0.62263936", "0.6223693", "0.6223693",...
0.0
-1
Populate's info panel with $this_element's information
function populate_info_panel(this_element){ $('#pregunta_info_name').html(this_element.name); $('#pregunta_info_type').html(convert_type(this_element.type)); if(this_element.type == 'MULTI' || this_element.type == 'CONDITIONAL'){ var answers_content = ''; $.each(connections_array, function(i){ if(this_element.connect_id == this.source){ var label_text; if(this_element.type == 'CONDITIONAL'){ //console.log(this.label.substring(0,2)) switch(this.label.substring(0,2)){ case 'lt': label_text = 'Menor que ' +this.label.substring(2); break; case 'gt': label_text = 'Mayor que ' +this.label.substring(2); break; case 'eq': label_text = 'Igual que ' +this.label.substring(2); break; case 'ne': label_text = 'No igual a ' +this.label.substring(2); break; case 'le': label_text = 'Menor o igual que ' +this.label.substring(2); break; case 'ge': label_text = 'Mayor o igual que ' +this.label.substring(2); break; case 'ra': label_text = 'En rango '+this.label.substring(2); break; case '!r': label_text = 'Afuera del rango'; break; default: label_text = 'ERROR: ha escrito condicion incorrectamente'; } } else { label_text = this.label; } answers_content += "<li class='list-group-item'>"+label_text+"</li>"; } }); $('#pregunta_info_responses').html(answers_content); $('#possible_answers').show(); } else { $('#possible_answers').hide(); } // set id values of info panel buttons $('#btn_edit_item').attr('data-id', this_element.id); $('#btn_delete_item').attr('data-id', this_element.id); $('#btn_delete_item').attr('source-id', this_element.connect_id); $('#btn_edit').attr('data-id', this_element.id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build_protein_info_panel(data, div) {\n div.empty();\n var protein = data.controller.get_current_protein();\n div.append(protein['description']);\n div.append(\"<br>----<br>\");\n div.append(dict_html(protein['attr']));\n}", "renderInformationAdditional() {\n document.getElementsByClassName(...
[ "0.68516606", "0.6616169", "0.6546088", "0.653402", "0.64927727", "0.64778954", "0.64655906", "0.6436454", "0.6373621", "0.6226559", "0.6214764", "0.6151009", "0.6143463", "0.6140021", "0.61026335", "0.60969007", "0.6077895", "0.60622436", "0.6056217", "0.6040273", "0.6028269...
0.68623334
0
check if labels for an element's connections have the same name
function check_equal_labels(element, the_label){ for(var j = 0; j< connections_array.length; j++){ if(element.connect_id == connections_array[j].source){ if(the_label == connections_array[j].label){ return false; } } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSameLabel(label){ \n // if already have label return false.\n return $(data.selectedDiv).has(label).length == 0;\n}", "function isLabeledBy(node, labelName) {\n for (var owner = node.parent; owner.kind === 214 /* LabeledStatement */; owner = owner.parent) {\n if (owner.label...
[ "0.6721919", "0.6202323", "0.60005915", "0.5977667", "0.596287", "0.5962072", "0.59042984", "0.5884175", "0.5784174", "0.5713267", "0.5676578", "0.5655946", "0.5605312", "0.5587715", "0.5550891", "0.5538444", "0.55327916", "0.5512373", "0.5485291", "0.5386358", "0.53746575", ...
0.7951297
0
gets first and end item ids from elements_array, if they exist
function check_for_endpoints(){ var first_item = -1 , end_item = -1; for(var i=0; i<elements_array.length; i++){ if(elements_array[i].type == 'START'){ for(var x=0; x<connections_array.length; x++){ if(elements_array[i].connect_id == connections_array[x].source){ first_item = connections_array[x].target; // 'START' item's target } } } else if(elements_array[i].type == 'END'){ /* for(var x=0; x<connections_array.length; x++){ if(elements_array[i].id == connections_array[x].target){ end_item = connections_array[x].source; } }*/ end_item = elements_array[i].id; // 'END' item } } return {first_id: first_item, end_id: end_item}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkIds(elements) {\r\n let len = elements ? elements.length : 0\r\n let ids = []\r\n for (let i = 0; i < len; i++) {\r\n const regexToSearchFor = /id=\".*\"/g;\r\n let id = elements[i].match(regexToSearchFor);\r\n if (id) {\r\n id = id[0]\r\n ...
[ "0.66241837", "0.63447386", "0.60591054", "0.6016531", "0.57674015", "0.5758919", "0.5662905", "0.5604465", "0.5570588", "0.5519695", "0.5519374", "0.5504044", "0.5468202", "0.5363117", "0.53249633", "0.5312236", "0.53068423", "0.53050715", "0.528641", "0.52692664", "0.525966...
0.5562735
9
Check item type == 'START' is a source in only one connection all items where type != 'END' || 'START' are a source in at least one connection and item type == 'END' is a target in at least one connection not used when user just saves a flowchart under construction
function check_item_connections(){ var start_count = 0; var end_count = 0; var valid_item_count = 0; var multi_count = 0; var this_element; var element_num; //substring(5) for(var i = 0; i < elements_array.length; i++){ this_element = elements_array[i]; multi_count = 0; for(var j = 0; j < connections_array.length; j++){ if(this_element.type == 'START'){ if(this_element.connect_id == connections_array[j].source){ start_count++; } } else if(this_element.type == 'END'){ if(this_element.id == connections_array[j].target){ end_count++; } } else { if(this_element.connect_id == connections_array[j].source){ if(this_element.type == 'MULTI' || this_element.type == 'CONDITIONAL'){ if(multi_count < 2){ if(multi_count < 1){ valid_item_count++; } multi_count++; } } else { valid_item_count++; } } } } console.log('Item type and multi count'); console.log(this_element.type); console.log(multi_count); if((this_element.type == 'CONDITIONAL' && multi_count !=2) || (this_element.type == 'MULTI' && multi_count <2) ){ return false; } } console.log(valid_item_count + ' - '+elements_array.length); if(start_count == 1 && end_count > 0 && (valid_item_count==elements_array.length-2)){ return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_for_endpoints(){\n \t\tvar first_item = -1\n \t\t\t, end_item = -1;\n \t\tfor(var i=0; i<elements_array.length; i++){\n \t\t\tif(elements_array[i].type == 'START'){\n \t\t\t\tfor(var x=0; x<connections_array.length; x++){\n \t\t\t\t\tif(elements_array[i].connect_id == connections_array[x].source){\n...
[ "0.5933772", "0.5715553", "0.56843007", "0.5162468", "0.5143154", "0.5106443", "0.5103366", "0.5038628", "0.4990879", "0.4868909", "0.48651686", "0.48592144", "0.4838532", "0.48267353", "0.48130965", "0.48036492", "0.4798051", "0.4791079", "0.47841564", "0.47574243", "0.47364...
0.66712964
0
starting Listen to the stream
function startStreamListener() { var streamListenerParams = { ip: self.streamingSource.sourceIP, port: self.streamingSource.sourcePort }; return self.streamListener.startListen(streamListenerParams) .then(function() { self.streamStatusTimer.setInterval(function() { self.streamingSourceDAL.notifySourceListening(self.streamingSource.sourceID); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start () {\n listen()\n}", "function start() {\n listen();\n}", "startListening() {\n\t\tthis.server.listen(this.port, () => {\n\t\t\tconsole.log('Server started listening on port', this.port);\n\t\t});\n\t}", "start() {\n this._.on('request', this.onRequest.bind(this));\n this._.on(...
[ "0.7836865", "0.77568483", "0.74000734", "0.73328316", "0.7128523", "0.6870402", "0.68618375", "0.6771315", "0.6771315", "0.6764348", "0.6750333", "0.6674343", "0.6624101", "0.66183174", "0.6602114", "0.66013116", "0.65961766", "0.65927386", "0.65927386", "0.6592643", "0.6564...
0.76290655
2
/ Helper Methods / Sets a keep alive status notifier
function StatusTimer() { var self = this; self.timer = undefined; self.setInterval = function(logic) { clearInterval(self.timer); self.timer = setInterval(function() { console.log(PROCESS_NAME + ' updating status....' + moment().format()); logic(); }, process.env.INTERVAL_TIME || 5000); }; self.clearInterval = function() { clearInterval(self.timer); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keepAlive () {\n this._debug('keep-alive')\n this._push(MESSAGE_KEEP_ALIVE)\n }", "keepAlive () {\n this._debug('keep-alive')\n this._push(MESSAGE_KEEP_ALIVE)\n }", "function keepAlive(){\n if(config.goPro.states.btIsConnected){\n if(config.goPro.debug){\n writeLo...
[ "0.70818067", "0.70818067", "0.64973027", "0.62764436", "0.6215074", "0.6156061", "0.61108315", "0.60774845", "0.60590804", "0.5965632", "0.58807564", "0.58602786", "0.58516806", "0.5770064", "0.5758256", "0.5744246", "0.57267475", "0.5680734", "0.56549466", "0.56378686", "0....
0.6176098
5
Stop the ffmpeg process
function stopFFmpegProcess(command) { if (command) { command.kill('SIGKILL'); } return Promise.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function KillFFMPEG() {}", "function stopFFmpegProcess(command, callBack) {\n\tif (command) {\n\t\tcommand.kill('SIGKILL');\n\t}\n\tif (callBack) {\n\t\tcallBack();\n\t}\n}", "stopDownload() {\n this.pauseDownload();\n // TODO also close down the child_process\n sendMessage({\n type: 'stop',\n ...
[ "0.7947673", "0.78819054", "0.74968666", "0.70088404", "0.67729497", "0.6588766", "0.6461295", "0.6461295", "0.64297754", "0.6427138", "0.64257956", "0.6357758", "0.6352739", "0.63090664", "0.6295381", "0.62878144", "0.62599164", "0.62579614", "0.6221325", "0.6200186", "0.618...
0.7672127
2
Send message to the next service.
function sendToJobQueue(params) { var message = { sourceId: params.streamingSource.sourceID, videoName: params.videoName, fileRelativePath: params.fileRelativePath, storagePath: params.storagePath, receivingMethod: { standard: params.streamingSource.streamingMethod.standard, version: params.streamingSource.streamingMethod.version }, startTime: params.startTime, endTime: params.endTime, duration: params.duration, sourceType: params.streamingSource.sourceType, transactionId: new mongoose.Types.ObjectId() }; return rabbit.produce('TransportStreamProcessingQueue', message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendNextMessage() {\n\n if (messages.length === 0) {\n return;\n }\n\n var message = messages.shift();\n Pebble.sendAppMessage(message, ack, nack);\n\n function ack() {\n sendNextMessage();\n }\n\n function nack() {\n messages.unshift(message);\n sendNextMessage();\n }\n\n}", "functi...
[ "0.6442721", "0.6365403", "0.6322822", "0.62296045", "0.6013765", "0.58336097", "0.5808982", "0.5791974", "0.57835656", "0.57725286", "0.575897", "0.5624304", "0.56158185", "0.5615164", "0.5578212", "0.5565591", "0.55626184", "0.5545951", "0.5539238", "0.5539238", "0.55251294...
0.0
-1
getText() function definition. This is the pdf reader function.
function getText(typedarray) { //PDFJS should be able to read this typedarray content var pdf = PDFJS.getDocument(typedarray); return pdf.then(function(pdf) { // get all pages text var maxPages = pdf.pdfInfo.numPages; var countPromises = []; // collecting all page promises for (var j = 1; j <= maxPages; j++) { var page = pdf.getPage(j); var txt = ""; countPromises.push(page.then(function(page) { // add page promise var textContent = page.getTextContent(); return textContent.then(function(text) { // return content promise return text.items.map(function(s) { return s.str; }).join(''); // value page text }); })); } // Wait for all pages and join text return Promise.all(countPromises).then(function(texts) { return texts.join(''); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTextContent() {}", "get text() {}", "get text() {}", "get richText() {}", "getText() { return this.text; }", "getText() {\r\n return this.getParsed(new TextParser());\r\n }", "retriveText() {\n let exactText;\n let currentElement;\n if (!isNullOrUndefined(this.currentC...
[ "0.7546426", "0.7202497", "0.7202497", "0.69531816", "0.68463546", "0.68114513", "0.67314905", "0.6698512", "0.6619906", "0.6591739", "0.65905195", "0.65711683", "0.6474766", "0.64540803", "0.64246804", "0.6400987", "0.6400413", "0.6400413", "0.63825047", "0.6376834", "0.6367...
0.7144465
3
Obtener los elementos del DOM
function sendMsg(e) { var event = e.originalEvent; console.log(event.keyCode); if (event.keyCode == 13) { if (!myName) { myName = $("#input").val(); socket.send(myName); } else { var txt = $("#input").val(); socket.send(myName, txt, myColor, new Date()); } $("#input").val(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }", "get elements() {\n retu...
[ "0.6786884", "0.6704521", "0.65489024", "0.6393473", "0.63381106", "0.63148445", "0.62871164", "0.6268687", "0.62674445", "0.62099886", "0.6190549", "0.61761427", "0.6168426", "0.616649", "0.616649", "0.6152311", "0.61339843", "0.61271375", "0.6087979", "0.6082071", "0.606406...
0.0
-1
permite somente valores numericos
function valCPF(e,campo){ var tecla=(window.event)?event.keyCode:e.which; if((tecla > 47 && tecla < 58 )){ mascara(campo, '###.###.###-##'); return true; } else{ if (tecla != 8 ) return false; else return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformInt() {\n for (let i = 0; i < ctmc.length; i++) {\n for (let j = 0; j < ctmc[i].length; j++) {\n ctmc[i][j] = parseFloat(ctmc[i][j]);\n }\n }\n}", "function number(numbers) { }", "function toNum(result) {\n var numResult = [];\n result.forEach(function (perm) {\n ...
[ "0.5909197", "0.5904456", "0.5852405", "0.584672", "0.57996047", "0.573682", "0.5629319", "0.56083274", "0.55588317", "0.55496305", "0.55267036", "0.5480462", "0.54790115", "0.546418", "0.5455055", "0.5451508", "0.54338056", "0.5421527", "0.5399548", "0.5389518", "0.5387216",...
0.0
-1
permite somente valores numericos
function valPHONE(e,campo){ var tecla=(window.event)?event.keyCode:e.which; if((tecla > 47 && tecla < 58 )){ mascara(campo, '(##)####-####'); return true; } else{ if (tecla != 8 ) return false; else return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformInt() {\n for (let i = 0; i < ctmc.length; i++) {\n for (let j = 0; j < ctmc[i].length; j++) {\n ctmc[i][j] = parseFloat(ctmc[i][j]);\n }\n }\n}", "function number(numbers) { }", "function toNum(result) {\n var numResult = [];\n result.forEach(function (perm) {\n ...
[ "0.59080625", "0.59049714", "0.5852714", "0.5846675", "0.5799497", "0.573698", "0.56282127", "0.5607934", "0.5558825", "0.5549639", "0.5525883", "0.54795027", "0.5478957", "0.54642093", "0.54571474", "0.5451614", "0.5434455", "0.5420768", "0.5399625", "0.5388181", "0.53860056...
0.0
-1
permite somente valores numericos
function valCEP(e,campo){ var tecla=(window.event)?event.keyCode:e.which; if((tecla > 47 && tecla < 58 )){ mascara(campo, '#####-###'); return true; } else{ if (tecla != 8 ) return false; else return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformInt() {\n for (let i = 0; i < ctmc.length; i++) {\n for (let j = 0; j < ctmc[i].length; j++) {\n ctmc[i][j] = parseFloat(ctmc[i][j]);\n }\n }\n}", "function number(numbers) { }", "function toNum(result) {\n var numResult = [];\n result.forEach(function (perm) {\n ...
[ "0.59080625", "0.59049714", "0.5852714", "0.5846675", "0.5799497", "0.573698", "0.56282127", "0.5607934", "0.5558825", "0.5549639", "0.5525883", "0.54795027", "0.5478957", "0.54642093", "0.54571474", "0.5451614", "0.5434455", "0.5420768", "0.5399625", "0.5388181", "0.53860056...
0.0
-1
NOTE: we are using structure of active panel as template for new one, currently we are replicating the structure of metadata fields
getTemplateFromCurrentPanel() { const currentIndex = this.getCurrentPanelIndex(); const firstPanel = this.getPanels()[currentIndex]; return { metadata: firstPanel .resolve('metadata') .map(metadataField => ({ type: MetadataField.type, name: metadataField.name, value: '' })), }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fmdf_initComponentMeta() {\n\t\n\t//all containers wrapper\n\tfmdmeta_prop = {};\n\n\t//icon path\n\tfmdmeta_prop.iconpath = \"/images/designer/prop/\";\n\n\t//properties grid configuration\n\tfmdmeta_prop.gridconf = {};\n\tfmdmeta_prop.gridconf.isTreeGrid = true;\n\t//fmdmeta_prop.gridconf.treeIconPath =...
[ "0.6136295", "0.61114705", "0.5857351", "0.5809938", "0.577988", "0.57367694", "0.5733026", "0.5688529", "0.56878614", "0.56536007", "0.5622596", "0.5618403", "0.5572465", "0.5551668", "0.55448836", "0.55206007", "0.55187744", "0.5518138", "0.5501968", "0.54950213", "0.547837...
0.708944
0
$Author: pallabib $ $Date: 20161223 12:20:54 $ xenos Dashboard business feed infrastructure Object
function xenos$DBD$SavedQuery(parent) { // inherit this.inherit = xenos$DBD$Content; this.inherit(parent, 'xenos$DBD$SavedQuery'); // self var self = this; // attributes self.parent.hasGraph = false; // feeds this.count = 0; this.feeds = {}; this.feedsOrder = {}; // has feeds this.hasFeeds = function() { return self.count != 0; }; this.feedByPk = function(pk) { return self.feeds[pk]; }; // preparation this.prepareActivity = function() { // reset first this.feeds = {}; this.feedsOrder = {}; jQuery.each(this.json.value[0].feeds, function(order, rawFeed) { var feed = { pk: rawFeed.pk, selector: self.parent.parent.pk + 'x' + self.parent.pk + 'x' + rawFeed.pk, name: rawFeed.name, originalName: rawFeed.name, order: order, maiden: true, viewUri: rawFeed.feedUrl }; // prepare self.count++; self.feeds[feed.pk] = feed; self.feedsOrder[order] = feed.pk; }); }; // rendition this.renderer = new xenos$DBD$SavedQuery$renderer(this); // other functions // content updater this.saveNames = function(update) { if (update) { self.updateNames(); } else { self.discardNames(); } }; // update content this.updateNames = function(callback, delegator) { jQuery.each(self.feeds, function(pk, feed) { self.updateName(pk, callback, delegator); }); }; // discard update this.discardNames = function() { jQuery.each(self.feeds, function(pk, feed) { feed.name = feed.originalName; feed.dirty = false; }); }; this.updateName = function(pk, callback, delegator, errorCallback) { var feed = self.feeds[pk]; if (feed.dirty) { var savedQryName = $.trim(feed.name); if(savedQryName==''){ xenos.postNotice(xenos.notice.type.error, xenos.i18n.utilcommonvalidationmessage.provide_criteria); return; } var maxLength = 30; if(savedQryName.length>maxLength){ xenos.postNotice(xenos.notice.type.error, xenos.utils.evaluateMessage(xenos.i18n.message.invalid_namelength,[maxLength])); return; } var data = '' + '{' + '"feedPk": [' + pk + '],' + '"workSpacePk": ' + self.parent.parent.pk + ',' + '"widgetPk": ' + self.parent.pk + ',' + '"feedName": "' + encodeURIComponent(savedQryName) + '",' + '"widgetType": "SAVED_QUERY"' + '}'; jQuery.ajax({ url: xenos.context.path + "/secure/ref/savedqueryfeed/edit.json", type: 'POST', contentType: 'application/json', data: data, success: function(content) { if(!content.success) { xenos.postNotice(xenos.notice.type.error, content.value[0]); if(errorCallback){ errorCallback.call(); } return; } feed.originalName = savedQryName; feed.dirty = false; xenos.postNotice(xenos.notice.type.info, savedQryName + xenos$DBD$i18n.saved_query.saved_query_renamed); if (callback) callback.call(delegator ? delegator : self, self); } }); } }; // edit name this.editName = function(pk, name, callback, delegator) { // fixed name if (!name || name == '') return false; // edited var feed = self.feeds[pk]; if (feed.name == name) return false; feed.name = name; feed.dirty = true; if (callback) callback.call(delegator ? delegator : self, feed); return true; }; // add feeds this.addFeeds = function(feedsPk, callback, delegator) { if (feedsPk.length == 0) return false; var uri = xenos.context.path + '/secure/ref/savedqueryfeed/addfeed.json'; var json = '' + '{' + '"feedPk": ' + '['; for (var p = 0, length = feedsPk.length, lengthMinus1 = feedsPk.length - 1; p < length; p++) { json += feedsPk[p].pk; if (p < lengthMinus1) json += ','; } json += '' + '],' + '"workSpacePk": ' + self.parent.parent.pk + ',' + '"widgetPk": ' + self.parent.pk + ',' + '"widgetType": "' + self.parent.widgetType + '"' + '}'; jQuery.ajax({ url: uri, type: 'POST', contentType: 'application/json', data: json, success: function(json) { var messages = []; if (!json.success) { if(json.value[0]) { messages.push(json.value[0]); } else { jQuery.each(feedsPk, function(p, pk) { var feed = self.parent.feeds[pk.displayRowNum]; messages.push(xenos$DBD$i18n.saved_query.saved_query_not_added + feed.name); }); } xenos.postNotice(xenos.notice.type.error, messages); return; } //updating the feeds after add to get the newly created custom_saved_query pk jQuery.getJSON(self.parent.contentUri, function(response) { if (!response.success) { if(response.value[0]) { messages.push(response.value[0]); } else { jQuery.each(feedsPk, function(p, pk) { var feed = self.parent.feeds[pk.displayRowNum]; messages.push(xenos$DBD$i18n.saved_query.saved_query_not_added + feed.name); }); } xenos.postNotice(xenos.notice.type.error, messages); return; } // prepare jQuery.each(feedsPk, function(p, pk) { var feed = self.parent.feeds[pk.displayRowNum]; // prepare feed.selector = self.parent.parent.pk + 'x' + self.parent.pk + 'x' + feed.pk; feed.order = self.count++; feed.maiden = true; feed.viewUri = response.value[0].feeds[feed.order].feedUrl; self.feeds[feed.pk] = feed; self.feedsOrder[feed.order] = feed.pk; messages.push(feed.name + xenos$DBD$i18n.saved_query.saved_query_added); }); xenos.postNotice(xenos.notice.type.info, messages); if (callback) callback.call(delegator ? delegator : self, feedsPk); }); } }); return true; }; // remove feed this.removeFeed = function(feedPk, callback, delegator) { var feed = self.feedByPk(feedPk); // First check the feed whether it is present. if (feed) { var uri = xenos.context.path + '/secure/ref/savedqueryfeed/remove/' + self.parent.parent.pk + '/' + self.parent.pk + '/' + feedPk + '.json'; jQuery.getJSON(uri, function(json) { if (!json.success) { console.log(json); xenos.postNotice(xenos.notice.type.error, xenos$DBD$i18n.saved_query.saved_query_not_removed + feed.name); return; } // remove from feeds self.removeAndReorderFeed(feedPk); xenos.postNotice(xenos.notice.type.info, feed.name + xenos$DBD$i18n.saved_query.saved_query_removed); if (callback) callback.call(delegator ? delegator : self, feed); }); } return true; }; /** * Remove a feed from the feed array and reorder the remaining feeds. */ this.removeAndReorderFeed = function(feedPk){ var feed = self.feedByPk(feedPk); self.count--; delete self.feeds[feedPk]; for (var newOrder = 0; newOrder < self.count; newOrder++) { if (newOrder >= feed.order) { self.feedsOrder[newOrder] = self.feedsOrder[newOrder + 1]; self.feeds[self.feedsOrder[newOrder]].order = newOrder; } } delete self.feedsOrder[self.count]; }; /** * Remove a saved query from widget only. */ this.removeDirtyFeed = function(feedPk, callback) { var feed = self.feedByPk(feedPk); self.removeAndReorderFeed(feedPk); if (callback) callback.call(self, feed); }; /** * Refresh a saved query widget. */ this.refresh = function() { var _func = function(row) { self.renderer.fixSaver(); $(row).remove(); }; var $widget = jQuery('#Widget' + self.parent.selector); $widget.find('.addFeed.contentArea').remove(); $widget.find('.addFeedButton').parent().parent().addClass('addButtonOpc'); jQuery.each($widget.find('.contentHolder').find('.row'), function(rowOrder, row){ self.removeDirtyFeed($(row).attr('pk'), _func(row)); }); $widget.find('.contentHolder').jScrollPane({showArrows: true}); self.prepareActivity(); self.renderer.render(true); if(!self.parent.parent.parent.editable){ $widget.find('.saveQuery-edit-ico-holder').hide(); $widget.find('.saveQuery-close-ico-holder').hide(); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xenos$DBD$BusinessFeed(parent) {\n // inherit\n this.inherit = xenos$DBD$Content;\n this.inherit(parent, 'xenos$DBD$BusinessFeed');\n // self\n var self = this;\n\n\n // attributes\n\n self.parent.hasGraph = true;\n\n\n // feeds\n this.count = 0;\n\n this.feeds = {};\n this.feedsOrder = {};\n\n...
[ "0.63348174", "0.54379946", "0.5367656", "0.52795196", "0.52003944", "0.5195895", "0.5131012", "0.51104456", "0.5095767", "0.5040104", "0.5009075", "0.5009075", "0.498304", "0.498304", "0.49781817", "0.49781817", "0.49781817", "0.49778026", "0.49778026", "0.49695635", "0.4966...
0.0
-1
utility method to get a value from json using key
function getValue(myJSON, test){ var str = ''; for (var key in myJSON) { if (myJSON.hasOwnProperty(key) && String(test) === String(key)) { str = myJSON[key]; } } return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getValue(key, jsonObj=this.config) {\n if(typeof(key) != 'string') return\n return key.split('.').reduce((p,c)=>p&&p[c]||null, jsonObj)\n }", "function getEntryValue(json,key){\n\tvar entry = json[ENTRY];\n\tif(entry != undefined){\n\t\tfor(var i = 0; i < entry.length; i++){\n\t\t\tif(entry[i][K...
[ "0.76459277", "0.75812715", "0.73374736", "0.7189652", "0.6905238", "0.6902459", "0.67366785", "0.6709172", "0.6602449", "0.65832", "0.6447544", "0.6441811", "0.64086366", "0.6374087", "0.63648623", "0.63648623", "0.6360102", "0.6334987", "0.6334987", "0.6334987", "0.6312089"...
0.65923405
9
set values in the localstorage json obj'z
function setValue(jsonID, test, value){ var myJSON = JSON.parse(localStorage[jsonID]); for (var key in myJSON) { if (myJSON.hasOwnProperty(key) && String(test) === String(key)) { myJSON[key] = value; } } localStorage[jsonID] = JSON.stringify(myJSON); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setJsonStorage (chave, valor){\n localStorage.setItem(chave,valor);\n}", "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}", "function setData(id, obj){...
[ "0.7622409", "0.74646574", "0.7352124", "0.729354", "0.7283864", "0.72609043", "0.716526", "0.70970756", "0.7091086", "0.7067295", "0.7057939", "0.7045395", "0.69681346", "0.6931148", "0.6924947", "0.69090265", "0.68853825", "0.68849415", "0.6863318", "0.68631524", "0.6856915...
0.7021132
12
Toggle populating of data autofilling on the tab the user is on
function doPaxClickEvt(jsonID, id, value) { chrome.tabs.getSelected(null, function (tab){ if(id.length){ chrome.tabs.sendRequest(tab.id, {data: getValue(JSON.parse(localStorage[jsonID]), id)}); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static expandData () {\n $('tbody#bindOutput tr:visible a.json-toggle.collapsed').click();\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "function activ...
[ "0.60708004", "0.602053", "0.59717333", "0.5875353", "0.5814023", "0.57533926", "0.5748533", "0.570951", "0.57019645", "0.56947684", "0.5630799", "0.56304824", "0.562682", "0.5615515", "0.55662537", "0.55248034", "0.55217755", "0.5504217", "0.54916185", "0.54766643", "0.54679...
0.0
-1
Using the httpGetAsync function, we make a call to the API
function getNameGender() { name = document.getElementById("BoyOrGirl").value; // Sets the value of name to what is currently in the text field let fullURL = baseURL + name; // Appends the name to the base URL httpGetAsync(fullURL, assignGender); // Returns the API's response to the function assignGender }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "async call(url) {\n let response ...
[ "0.71720654", "0.69026273", "0.67888665", "0.67399114", "0.6732096", "0.6583978", "0.6529626", "0.65093875", "0.64764583", "0.647266", "0.64715976", "0.64651954", "0.64473623", "0.6402314", "0.63828963", "0.63732713", "0.6365959", "0.63620025", "0.63422495", "0.63290656", "0....
0.0
-1
Makes an async call for JSON (Vanilla Javascript)
function httpGetAsync(theUrl, callback) { let xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp.send(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "function jsonGet(url, callback) {\r\n ...
[ "0.69577837", "0.6871555", "0.6697894", "0.6639638", "0.66031355", "0.6577278", "0.65710926", "0.65608686", "0.65596676", "0.6525416", "0.650286", "0.64965796", "0.64847726", "0.6478799", "0.64455163", "0.6435472", "0.64192384", "0.64064324", "0.6401296", "0.63964915", "0.636...
0.6388427
20
Analyzes the data of the JSON response, then sets the webpage text
function assignGender(data) { let dataJSON = JSON.parse(data); console.log(dataJSON); gender = dataJSON.gender; probability = dataJSON.probability; if(probability == 1) { probability = 100; } else { probability = probability * 100; } setText(name, gender, probability); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleResponse(response) {\n // the key of pages is a number so need to look for it\n if (\n typeof this.searchResponse !== typeof undefined &&\n this.searchResponse.query\n ) {\n for (var key in this.searchResponse.query.pages) {\n // skip anything that's prototype object\n i...
[ "0.6448625", "0.63172257", "0.62099475", "0.6195737", "0.6032959", "0.59932435", "0.59388494", "0.592739", "0.5917632", "0.5908263", "0.5878492", "0.5875593", "0.5871572", "0.5838862", "0.5823197", "0.5788406", "0.57790446", "0.57763577", "0.57739234", "0.5770813", "0.5767071...
0.0
-1
Replaces color and lives states with their corresponding next states Reset next states for colors and lives
goToNextState() { this.colors = this.nextStateColors this.lives = this.nextStateLives this.nextStateColors = new Array(COLS * ROWS).fill(COLOR.BLANK) this.nextStateLives = new Array(COLS * ROWS).fill(false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function color_fsm() {\n if (color_stage == 0) {\n if (lorenz_red >= 255) {\n color_stage = 1;\n } else {\n lorenz_red++;\n }\n } else if (color_stage == 1) {\n if (lorenz_green >= 255) {\n color_stage = 2;\n } else {\n lorenz_gre...
[ "0.6521679", "0.6233091", "0.61860305", "0.6176525", "0.6149748", "0.6134702", "0.6133651", "0.61126596", "0.6107905", "0.609987", "0.6096422", "0.6093109", "0.6082121", "0.60687214", "0.60281116", "0.6026596", "0.6013014", "0.599194", "0.5981862", "0.5972272", "0.59706837", ...
0.68152267
0
When a player disconnects
function disconnection() { playersOnline-- primus.forEach(spark => spark.emit(GAME_EVENT.PLAYERS_ONLINE, playersOnline)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClientDisconnect() {\r\n\tconsole.log(\"Client has disconnected: \"+this.id);\r\n\tvar nsp = url.parse(this.handshake.headers.origin).hostname;\r\n\t// Broadcast removed player to connected socket clients\r\n\tio.of(nsp).emit(\"userLeft\",{id: this.id});\r\n}", "async onPlayerRemoved(player) {}", "f...
[ "0.77410567", "0.76328975", "0.7587706", "0.74763983", "0.74763983", "0.74500006", "0.73989964", "0.7319388", "0.72578377", "0.7221466", "0.7197808", "0.7197808", "0.7197808", "0.7197808", "0.71698797", "0.7167089", "0.7140136", "0.70863324", "0.7080301", "0.7052136", "0.7042...
0.7418078
6
When player clicks on a pattern
function playerPattern(color, pattern) { const draw = { beehive: drawBeehive, toad: drawToad, lwss: drawLwss, glider: drawGlider, } if (draw[pattern]) { draw[pattern](color) primus.forEach(spark => spark.emit(GAME_EVENT.STATE, game.colors)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickButton(e) {\n click++;\n for(let i=0; i<buttonArray.length; i++) {\n if (buttonArray[i].name == e.target.id){\n let tBut = buttonArray[i];\n\n // IS IT RIGHT\n if (tBut == pattern[click-1]){\n tBut.highlight(true);\n } else {\n tBut.highlight(false);\n if...
[ "0.67241156", "0.67115504", "0.65197575", "0.65104765", "0.6507557", "0.6486095", "0.6462057", "0.64502066", "0.6405715", "0.6399276", "0.6349016", "0.6344962", "0.63189083", "0.630866", "0.6296425", "0.6259184", "0.6250643", "0.6241446", "0.62042123", "0.6201719", "0.6200987...
0.6195708
22
Runs Game of Life algorithm every X milliseconds Uses setTimeout to allow for dynamic interval logic e.g. pending timeout is reset and longer interval is applied when a player clicks on the game
function gameTick() { for (let y = 0; y < ROWS; y++) { for (let x = 0; x < COLS; x++) { const { count, colors } = countNeighbors(x, y) // Any live cell with fewer than two live neighbours dies, // as if caused by under-population. if (count < 2 && game.getLife(x, y)) { game.setNextStateColor(x, y, COLOR.BLANK) game.setNextStateLife(x, y, false) } // Any live cell with two or three live neighbours lives on to the next generation. if ((count === 2 || count === 3) && game.getLife(x, y)) { game.setNextStateColor(x, y, game.getColor(x, y)) game.setNextStateLife(x, y, true) } // Any live cell with more than three live neighbours dies, as if by overcrowding. if (count > 3 && game.getLife(x, y)) { game.setNextStateColor(x, y, COLOR.BLANK) game.setNextStateLife(x, y, false) } // Any dead cell with exactly three live neighbours becomes a live cell, // as if by reproduction. if (count === 3 && game.getLife(x, y) === false) { game.setNextStateColor(x, y, averageColor(colors)) game.setNextStateLife(x, y, true) } } } game.goToNextState() primus.forEach(spark => spark.emit(GAME_EVENT.STATE, game.colors)) gameTickTimeoutId = setTimeout(gameTick, GAME_TICK_INTERVAL.DEFAULT) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startGame() {\n this.interval = this.$interval(() => {\n this.loopCellMatrix();\n this.updateCellsFuture();\n this.iteration++;\n }, 300);\n }", "function runLifeGame() {\n gameLifeRunning = setInterval(nextGeneration, parseInt($(\"#input-board-time-between-generations\").val()));\n $...
[ "0.71145606", "0.6455918", "0.6368944", "0.6345281", "0.6343472", "0.63268125", "0.63065046", "0.62905174", "0.6288947", "0.6288491", "0.6271798", "0.6271258", "0.6206848", "0.6195654", "0.61904025", "0.61895394", "0.6187302", "0.61579275", "0.6148401", "0.6147209", "0.613571...
0.6970416
1
When an error occurs
function error(err) { console.error(err.stack) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onError() {}", "function OnErr() {\r\n}", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "onerror() {}", "onerror() {}", "error(error) {}", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "err...
[ "0.72318196", "0.7045342", "0.69672513", "0.6871869", "0.6871869", "0.68540317", "0.6835327", "0.6827477", "0.68122786", "0.68010694", "0.6767789", "0.6708222", "0.67029554", "0.66992927", "0.66774154", "0.6667396", "0.6632698", "0.66249675", "0.6624722", "0.6624722", "0.6613...
0.0
-1
Returns a random integer between min (inclusive) and max (inclusive)
function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randInt(min, max) { return Math.random() * (max - min) + min; }", "function randInt(min, max) { return Math.random() * (max - min) + min; }", "static randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "static randomInt(min, max) {\n return Math.floor(Math...
[ "0.91688913", "0.91688913", "0.9098652", "0.9098652", "0.9088164", "0.9072013", "0.9070401", "0.907029", "0.907029", "0.9065955", "0.90646225", "0.9064371", "0.90606767", "0.90605736", "0.9057691", "0.905767", "0.90568143", "0.9046989", "0.90434307", "0.9043087", "0.90397924"...
0.0
-1
tabContent array of contents where we need to highlight single one while clicking on aproppriate headliner info parent element of all headliners tab array of directly headliners
constructor(tabContent, info, tab) { this.tabContent = document.querySelectorAll(tabContent); this.info = document.querySelector(info); this.tab = document.querySelectorAll(tab); this.hideTabContent(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tabActivate( prmCanvasLoc, prmtabHdrLoc, prmtabCntLoc ) \n{\n var i, nChildCount;\n var strChildId;\n var oChild;\n\n //--- get the number of children in canvas\n nChildCount = prmCanvasLoc.children.length;\n \n //--- loop thru the child objects to manage CONTENT-TABS\n for( i = 0; i < nChildCount...
[ "0.59540534", "0.56489235", "0.56340986", "0.56049067", "0.5487487", "0.5484926", "0.54815036", "0.5443754", "0.54291767", "0.54273295", "0.54246753", "0.54069763", "0.53767556", "0.5370489", "0.5359896", "0.5335871", "0.53325075", "0.53235507", "0.53230447", "0.5320344", "0....
0.5251374
26
timerId directly id of your HTML timer deadline time point in future wich will be the end of some stoke/offer
constructor(timerId, deadline) { this.timerId = timerId; this.deadline = deadline; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTimer() {\n const time = getTimeDiff(endTime);\n\n days.textContent = `${addZero(time.days)}`;\n hours.textContent = `${addZero(time.hours)}`;\n minutes.textContent = `${addZero(time.minutes)}`;\n seconds.textContent = `${addZero(time.seconds)}`...
[ "0.70178294", "0.6563851", "0.6534657", "0.64944714", "0.646196", "0.63344854", "0.62769777", "0.6259683", "0.6190972", "0.61873555", "0.61490804", "0.6144597", "0.61356187", "0.6126994", "0.6050897", "0.6045961", "0.6030836", "0.5978928", "0.59745365", "0.59099877", "0.58996...
0.7397024
0
overlay directly overlay seeMore button "show info" closeOverlay cross "hidde info"
constructor(overlay, seeMore, closeOverlay){ this.overlay = document.querySelector(overlay); this.seeMore = document.querySelector(seeMore); this.closeOverlay = document.querySelector(closeOverlay); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewMoreFalcon() {\n var moreInfo = document.getElementById(\"falconHidden\");\n var buttonText = document.getElementById(\"falconMore\");\n if (moreInfo.style.display === \"none\") {\n moreInfo.style.display = \"block\";\n buttonText.textContent = \"VIEW LESS\"\n ...
[ "0.6611223", "0.6574282", "0.6565525", "0.65614545", "0.649946", "0.648657", "0.6478878", "0.6437157", "0.6414701", "0.64052093", "0.6360753", "0.6330158", "0.6325318", "0.63181925", "0.6298709", "0.62806916", "0.6241217", "0.61726886", "0.61504227", "0.6112824", "0.61088246"...
0.63589
11
your properties here, remember the constructor
constructor(newName,newLastName,newBirthDate){ this.name = newName; this.lastName = newLastName; this.birthDate = newBirthDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n\t this.properties = [];\n\t }", "constructor () {\r\n\t\t\r\n\t}", "function _construct()\n\t\t{;\n\t\t}", "constructor(props) {\n // TODO: add pitch\n super(props);\n this.init();\n }", "constructor(props)\n {\n super(props)\n\n }", ...
[ "0.7340601", "0.7231188", "0.71833366", "0.71735567", "0.7137835", "0.71242106", "0.70871973", "0.7083722", "0.7034825", "0.7022215", "0.70178336", "0.7006535", "0.69997036", "0.69972163", "0.6995877", "0.6995616", "0.6978119", "0.6957174", "0.6957174", "0.6940146", "0.693370...
0.0
-1
FCC first and third solutions:
function fearNotLetter(str) { for(let i = 0; i < str.length; i++) { if (str.charCodeAt(i) != str.charCodeAt(0) + i) { return String.fromCharCode(str.charCodeAt(i) - 1); } } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fpb(angka1, angka2) \n{\n console.log('\\n', 'case for - FPB', angka1, angka2, '\\n ------------------------------------');\n\n var factorAngkaSatu = []\n var factorAngkaDua = []\n\n\n for (var x = 1; x<=angka1; x++)\n {\n if( angka1 % x === 0)\n {\n factorAngkaSatu.push(x)\n ...
[ "0.614259", "0.5963369", "0.56967306", "0.56478345", "0.56116265", "0.5596889", "0.55865747", "0.5432951", "0.5354453", "0.53440905", "0.5309049", "0.5304373", "0.52926075", "0.52814436", "0.5281253", "0.52663386", "0.526267", "0.52441716", "0.5233243", "0.52302456", "0.52232...
0.0
-1
AJAX call to the include directory to delete an item from a package
function deletePackageItem() { $.ajax({ type: "GET", url: '../include/getPackageItems.php?action=deletePackageItem&packageID='+globalPackageID+'&categoryID='+globalCategoryID, success: function (data) { getPackageItems(globalPackageID); }, failure: function(data) { alert("Delete Failed."); }, dataType: "json" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteItemData() {\n var options = {\n url: \"http://localhost:3000/projects\" + \"/\" + Itemid,\n method: \"DELETE\",\n data: \"\",\n success: function() {\n deleteItem();\n },\n error: function(error) {\n console.log(\"error\",error);\n }\n }\n ajax(options);\n}", "fu...
[ "0.7104768", "0.6778447", "0.67659724", "0.66179925", "0.66160184", "0.65829587", "0.65274787", "0.6504329", "0.6479114", "0.6477967", "0.6452176", "0.64471936", "0.64339083", "0.6427579", "0.64122874", "0.6392828", "0.637997", "0.63762397", "0.6365855", "0.6365851", "0.63485...
0.77091926
0
Listing function for packages
function getPackageItems(packageID) { document.getElementById("packageItemsList" + packageID).innerHTML = ""; $.ajax({ type: "GET", url: '../include/getPackageItems.php?action=getOnePackageItems&packageID='+packageID, success: function (data) { if (data.length > 0) { for (var i = 0; i < data.length; i++) { deleteString = "<a class='deletePackageItem' data-packageID=" + data[i]['packageID'] + " data-categoryID=" + data[i]['pCategory'] + " title='Delete from package'><i class='zmdi zmdi-delete'></i><a>"; document.getElementById("packageItemsList" + packageID).innerHTML += '<li class="list-group-item">' + data[i]['pName']+ ", " + data[i]["pDescription"] + " " + deleteString + '</li>'; } } }, failure: function(data) { console.log("failure"); }, dataType: "json" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAll() {\n setPackageList(completeList);\n _setCurPackage(null);\n }", "async getPackages() {\n return [];\n }", "function getAllPackageNames() {\n return new Promise(function(resolve, reject) {\n exec('npm ls', {cwd: '.'},(error, stdout, stderr) => {\n var packages ...
[ "0.68251574", "0.6792283", "0.64070106", "0.61430895", "0.5931086", "0.57915926", "0.57597333", "0.5693645", "0.5690494", "0.56225806", "0.5613035", "0.5594061", "0.5540519", "0.55251276", "0.5511008", "0.5500252", "0.5499476", "0.54880375", "0.5484183", "0.54774046", "0.5475...
0.0
-1
Allow biometric usage on iOS if it isn't already accepted
allowIosBiometricUsage() { // See the wdio.shared.conf.js file in the `before` hook for what this property does if (!driver.isBioMetricAllowed) { // Wait for the alert try { this.iosAllowBiometry.waitForDisplayed({timeout: 3000}); this.allowBiometry.click(); } catch (e) { // This means that allow using touch/facID has already been accepted } // See the wdio.shared.conf.js file in the `before` hook for what this property does // Set it to accept driver.isBioMetricAllowed = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkiOS() {\n\t\treturn /iPad|iPhone|iPod/.test(navigator.userAgent) && ! window.MSStream;\n\t}", "function checkiOS() {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n }", "iOS():boolean {\n\n\t\treturn this.agent.match(/iPhone|iPad|iPod/i) ? true : false;\n\t}...
[ "0.5587254", "0.5523544", "0.54189044", "0.5293914", "0.52858055", "0.51660085", "0.51615787", "0.5161381", "0.5151987", "0.51505095", "0.5066032", "0.50423324", "0.5026151", "0.501396", "0.501396", "0.501396", "0.501396", "0.501396", "0.50037426", "0.5000443", "0.4967216", ...
0.73278826
0
fetch the users orders and items
function fetchMyOrders() { /* $.get('controller/app.php', { req : "fetch-my-orders", }, function(data) { console.log(data); $("#data-table").jsonTable({ head:["Order Number",'Item ID','Due Date','Quantity'], json:['order_number','item_id','due_date','quantity'], source:data }); }, "json");*/ $.ajax({ url : 'controller/app.php?req=fetch-my-orders', dataType : 'json', success : function(json) { dataTable = $('#data-table').columns({ data : json, schema : [{ "header" : "Order Number", "key" : "order_number" }, { "header" : "Item ID", "key" : "item_id" }, { "header" : "Due Date", "key" : "due_date" }, { "header" : "Quantity", "key" : "quantity" }] }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchOrdersList(user_id) {\r\n return axios.get(USER_API_BASE_URL + '/orders/' + user_id);\r\n }", "function get_users_items_normal(users) {\n var items = [];\n for (user of users) {\n for (order of user.orders) {\n for (item of order.items) {\n items.push(item);\...
[ "0.7409201", "0.69241416", "0.6918097", "0.6792871", "0.6756308", "0.6727229", "0.6671801", "0.667033", "0.66540277", "0.66072905", "0.64724755", "0.6466617", "0.6462575", "0.64583296", "0.6456917", "0.6400723", "0.6395485", "0.6376045", "0.6358382", "0.63574594", "0.63159496...
0.0
-1
Start a transition that interpolates the data based on year. svg.transition() .duration(30000) .ease("linear") .tween("year", tweenYear) .each("end", enableInteraction); Positions the dots based on data.
function position(dot) { dot .attr("cx", function(d) { return xScale(x(d)); }) .attr("cy", function(d) { return yScale(y(d)); }) .attr("r", function(d) { if (typeof(imageURL(d))=="undefined" || radius(d) == 0) {return radiusScale(radius(d)); } else if (key(d) == "Saturn+Rings") { return size(d)*1.1; } else { return size(d); } }) .attr("opacity", function(d) { if (typeof(imageURL(d))=="undefined") { return 0.7; } else { return 1.0; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate(){\n svg.transition()\n .duration(30000)\n .ease(d3.easeLinear)\n .tween(\"year\", tweenYear);\n }", "function tweenYear() {\n var curYear = $(\"#ci-years-selector\").val();\n if(curYear == endYear) curYear = startYear;\n va...
[ "0.7556511", "0.69782275", "0.6917286", "0.68596864", "0.68596864", "0.68596864", "0.68346024", "0.6830071", "0.6796774", "0.67512006", "0.6744672", "0.6722959", "0.6712583", "0.6712583", "0.6712583", "0.659057", "0.65314245", "0.6507085", "0.64613783", "0.64039415", "0.63982...
0.0
-1
Defines a sort order so that the smallest dots are drawn on top.
function order(a, b) { return radius(b) - radius(a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set sortingOrder(value) {}", "function setSortOrder() {\n\tif (sortOrder == \"high to low\") {\n\t\tsortOrder = \"low to high\";\n\t} else {\n\t\tsortOrder = \"high to low\";\n\t}\n}", "get sortingOrder() {}", "function simulateSorting() {\n for (let i = 0; i < values.length; i++) {\n stroke(100, 143, 14...
[ "0.70932597", "0.6748984", "0.65615803", "0.6527891", "0.65183043", "0.648535", "0.63484126", "0.63200426", "0.6301433", "0.6278715", "0.6212716", "0.62029046", "0.618244", "0.61444837", "0.6119178", "0.6102705", "0.6078246", "0.6061914", "0.60590714", "0.605402", "0.6027519"...
0.0
-1
After the transition finishes, you can mouseover to change the year.
function enableInteraction() { var yearScale = d3.scale.linear() .domain([1600, 1900]) .range([box.x + 10, box.x + box.width - 10]) .clamp(true); // Cancel the current transition, if any. svg.transition().duration(0); overlay .on("mouseover", mouseover) .on("mouseout", mouseout) .on("mousemove", mousemove) .on("touchmove", mousemove); function mouseover() { label.classed("active", true); } function mouseout() { label.classed("active", false); } function mousemove() { displayYear(yearScale.invert(d3.mouse(this)[0])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseOverHandle(){\n circle.transition().duration(200).attr('opacity',1);\n caption.transition().duration(200).attr('opacity',1);\n curYear.transition().duration(200).attr('opacity',1);\n d3.selectAll(\".x.axis\")\n .transition()\n .duration(500)\n ...
[ "0.7115008", "0.70984393", "0.7043693", "0.70283806", "0.70166534", "0.7011093", "0.7011093", "0.7011093", "0.6968958", "0.696625", "0.6958392", "0.68476284", "0.68476284", "0.68476284", "0.677184", "0.67223704", "0.6708116", "0.6690718", "0.6662201", "0.6662063", "0.66049767...
0.0
-1
Tweens the entire chart by first tweening the year, and then the data. For the interpolated data, the dots and label are redrawn.
function tweenYear() { var year = d3.interpolateNumber(1600, 1900); return function(t) { displayYear(year(t)); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tweenYear() {\n\t\t \tvar year = d3.interpolateNumber(1976,2014);\n\t\t return function(t) { updateChart(year(t)); };\n\t }", "function tweenYear() {\n var year = d3.interpolateNumber(2005, 2016);\n return function(t) {\n yearLabel.text(Math.round(year(t)));\n transitionYear((year...
[ "0.77247405", "0.74827653", "0.7420117", "0.7420117", "0.7420117", "0.7399845", "0.72967744", "0.72514355", "0.72514355", "0.72514355", "0.72077", "0.713376", "0.7099649", "0.67113674", "0.66833615", "0.6644465", "0.66187274", "0.6426622", "0.63636434", "0.6308051", "0.628011...
0.7283489
7
Updates the display to show the specified year.
function displayYear(year) { dot.data(interpolateData(Math.round(year)), key).call(position).sort(order); label.text(Math.round(year)); dotNames.data(interpolateData(Math.round(year)), key).call(showLabel); // Updates texts in sidebar. titles.data(interpolateTeleData(year), key).call(changeTitle); texts.data(interpolateTeleData(year), key).call(changeText); if ( year >= 1842 && year < 1847) { document.getElementById("description").style.height = "285px"; } else { document.getElementById("description").style.height = "350px"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateYear() {\n O('year-label').innerHTML = this.year;\n }", "function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}", "function displayYear(year) {\n d3.selectAll(\".dot\").data(interpolateData(year), key)\n .call(position)\n .sort(order);...
[ "0.77693564", "0.75446963", "0.72150356", "0.71750224", "0.7142512", "0.70484203", "0.70484203", "0.7007036", "0.7007036", "0.7007036", "0.6965553", "0.69503665", "0.69503665", "0.69503665", "0.6885591", "0.6857341", "0.67369026", "0.67194164", "0.66810894", "0.6652801", "0.6...
0.77194196
1
Interpolates the dataset for the given (fractional) year.
function interpolateData(year) { return testData.map(function(d) { return { xPos: d.xPos, yPos: d.yPos, name: d.name, size: d.size, region: d.region, number: interpolateValues(d.number, year), textLabel: setLabel(d.name, d.number, year), magnitude: d.magnitude, image: d.image, caption: d.caption }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolateData(year) {\n return data.map(function(d) {\n return {\n country: d.country,\n region: d.region,\n code: d.code,\n xVal: interpolateValues(d.x, year),\n yVal: interpolateValues(d.y, year),\n zVal: interpolateValues(d.z, year)\n };\n });...
[ "0.75805336", "0.7532873", "0.74065244", "0.731408", "0.7296949", "0.72798663", "0.72255176", "0.71993214", "0.71993214", "0.71993214", "0.7172246", "0.7163488", "0.7104056", "0.7104056", "0.7104056", "0.70994294", "0.7004463", "0.69604856", "0.691536", "0.6687981", "0.668798...
0.7617787
0
Finds (and possibly interpolates) the value for the specified year.
function interpolateValues(values, year) { var i = bisect.right(values, year, 0, values.length - 1), a = values[i]; if (i > 0) { var b = values[i - 1], t = (year - a[0]) / (b[0] - a[0]); if (b[1] == 0) { return 0; } else { return a[1] * (1 - t) + b[1] * t; } } return a[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolateValues(values, year) {\n for (i in values) {\n if (year == values[i][0] && null != values[i][1]) {\n return values[i][1]\n }\n }\n return null\n }", "function interpolateValues(values, year) {\n let i = bisect.left(values, year, 0, values.length -...
[ "0.7394559", "0.67821807", "0.6722554", "0.6722554", "0.6722554", "0.6698918", "0.6695649", "0.66823447", "0.66584456", "0.66584456", "0.66584456", "0.6650481", "0.6599824", "0.6586608", "0.6535596", "0.62672585", "0.6051055", "0.6016964", "0.5964394", "0.5964394", "0.5893825...
0.66540956
11
VERIFICA SE O USUARIO ESTA CONECTADO
function isOnlineLogin(){ //var page = prefix+"adx/mobile/professor/leitura/testeConecao.php"; //TESTE!! var page = prefix+unidade+"/mobile/professor/leitura/testeConecao.php"; //OFICIAL //var page = prefix+"/mobile/professor/leitura/testeConecao.php"; //teste basse de dados oficial var resultado = 0; $.ajax({ url: page, data: {}, dataType: "text", method: "post", async: false, }).done(function(dados){ resultado = dados; }).fail(function(a,b,c){ console.log(a); console.log(b); console.log(c); }); return resultado; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iniciarSesion(dataUsuario) {\n usuarioLogueado = new Usuario(dataUsuario.data._id, dataUsuario.data.nombre, dataUsuario.data.apellido, dataUsuario.data.email, dataUsuario.data.direccion, null);\n tokenGuardado = dataUsuario.data.token;\n localStorage.setItem(\"AppUsuarioToken\", tokenGuardado);\n...
[ "0.6406209", "0.6242268", "0.6239344", "0.62221223", "0.6219718", "0.6177213", "0.6155958", "0.61553663", "0.61300033", "0.611397", "0.61103666", "0.60612863", "0.6054931", "0.6033202", "0.60165095", "0.60002303", "0.5997748", "0.59918493", "0.59654176", "0.5947931", "0.59340...
0.0
-1
CRIA UM MODAL COM A ANIMACAO DE ESPERA
function esperaconectar(){ var load = "\ <div id='modalLogin' class='modal' style='color:rgba(84, 150, 252, 0.97); background: transparent; box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 0 0 0 rgba(0, 0, 0, 0); height: 30%;'>\ <div class='modal-content'>\ <div class='preloader-wrapper big active' style='margin-left: 40%;'>\ <div class='spinner-layer spinner-blue-only'>\ <div class='circle-clipper left'>\ <div class='circle'></div>\ </div><div class='gap-patch'>\ <div class='circle'></div>\ </div><div class='circle-clipper right'>\ <div class='circle'></div>\ </div>\ </div>\ </div>\ </div>\ </div>\ "; $("main").append(load); $('#modalLogin').openModal({ dismissible: false, opacity: .5, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClickGerarPersonagem(modo) {\n GeraPersonagem(modo);\n}", "function ClickGerarPontosDeVida(modo) {\n GeraPontosDeVida(modo);\n AtualizaGeral();\n}", "function ClickVisualizacaoModoMestre() {\n gEntradas.modo_mestre = Dom('input-modo-mestre').checked;\n AtualizaGeralSemLerEntradas();\n}", "funct...
[ "0.63150495", "0.63056695", "0.6178775", "0.60582364", "0.605514", "0.60519964", "0.6022779", "0.6020148", "0.5992247", "0.5986929", "0.59642833", "0.5946956", "0.5946167", "0.5915311", "0.589851", "0.58791566", "0.587016", "0.5854482", "0.5838816", "0.5838363", "0.5785085", ...
0.0
-1
workaround bug in FF 3.6
function token() { if (re.lastIndex >= text.length) return EOF; // special case: end of file if (eol) { eol = false; return EOL; } // special case: end of line // special case: quotes var j = re.lastIndex; if (text.charCodeAt(j) === 34) { var i = j; while (i++ < text.length) { if (text.charCodeAt(i) === 34) { if (text.charCodeAt(i + 1) !== 34) break; i++; } } re.lastIndex = i + 2; var c = text.charCodeAt(i + 1); if (c === 13) { eol = true; if (text.charCodeAt(i + 2) === 10) re.lastIndex++; } else if (c === 10) { eol = true; } return text.substring(j + 1, i).replace(/""/g, "\""); } // common case var m = re.exec(text); if (m) { eol = m[0].charCodeAt(0) !== 44; return text.substring(j, m.index); } re.lastIndex = text.length; return text.substring(j); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixIeBug(e){return browser.msie?e.length-e.replace(/\\r*/g,\"\").length:0}", "private internal function m248() {}", "function fixIESelect() {\n return false;\n }", "function StupidBug() {}", "protected internal function m252() {}", "function Ze(){if(ea)t.innerHTML=ha;else if(ia)t.inner...
[ "0.5764417", "0.57277346", "0.5568826", "0.5524992", "0.55239373", "0.55047923", "0.54650784", "0.5458367", "0.54365754", "0.53885704", "0.53885704", "0.5355408", "0.5353211", "0.53430164", "0.5336466", "0.5324651", "0.5320176", "0.5297509", "0.5296868", "0.5290672", "0.52633...
0.0
-1
create start function with listerners
function start(){ //create listener for the mouse being down document.addEventListener("mousedown", beginDrag, false); //create listener for the mouse button release document.addEventListener("mouseup", stopDrag, false); aImage = document.getElementById("pic"); zIndex = 0; mouseX = 0; mouseY = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startPoint()\n{\n\n}", "function createIncremontor(start) {\n return function () { // 1\n start++;\n return start\n }\n}", "set start(value) {}", "function makeStartingList(){\n for(var i = 0; i<1; i++){\n addListItem( {task: \"Make the list\"});\n addListItem( {task: \"Test the lis...
[ "0.6626864", "0.65649986", "0.6478278", "0.635719", "0.6303357", "0.6303357", "0.6161959", "0.6160001", "0.6154346", "0.5970895", "0.5966612", "0.5965385", "0.59398353", "0.5855967", "0.57817835", "0.5769968", "0.57034665", "0.567525", "0.567525", "0.567525", "0.56513834", ...
0.0
-1
uzdavinio esme kad vienu metu reikia sumuoti dvi reiksmes t.y. asmenu/vaiku counta/kieki ir amziaus counta
function averageAge(asmuo) { let childCount = 1; // vaiku kiekis = 1 , nes pedro jau yra 1 let childAgeSum = asmuo.age; // vaiku amziaus suma if (asmuo.children) { // jeigu vaiku yra, suskaiciuoti kiek for (let i = 0; i < asmuo.children.length; i++){ const child = asmuo.children[i]; // kiekvienas vaikas const childInfo = averageAge(child); childCount += childInfo.childCount; childAgeSum += childInfo.ageSum; } } return { childCount: childCount, ageSum: childAgeSum } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contadoresArgentina() {\n $('#provPymes').html('Argentina');\n var pymesCountUp = new CountUp(\"totalPymes\", totalPymes_var, totalPymes_ARG, 0, 0.5, options);\n pymesCountUp.start();\n\n var pymes_porCountUp = new CountUp(\"porcPymes\", porcPymes_var*100, porcPymes_ARG*100, 0, 0.5, options);\n pymes...
[ "0.63130164", "0.62169874", "0.61833024", "0.61737436", "0.6134403", "0.6064927", "0.60555124", "0.60259974", "0.59764886", "0.59751385", "0.5957782", "0.5929572", "0.59239525", "0.5910305", "0.59076947", "0.5887431", "0.58761317", "0.58727163", "0.5870127", "0.5848806", "0.5...
0.0
-1
Check if the given character code, or the character code at the first character, is a whitespace character.
function whitespace(character) { return re.test( typeof character === 'number' ? fromCode(character) : character.charAt(0) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_whitespace(char) {\n return \" \\t\\n\".indexOf(char) >= 0;\n }", "function isWhiteSpace(code) {\n return isNewline(code) || code === 0x0020 || code === 0x0009;\n}", "function isWhitespace(char) {\n\treturn /\\s/.test(char);\n}", "function sc_isCharWhitespace(c) {\n var tmp = c.va...
[ "0.7842182", "0.7834264", "0.7832752", "0.78228", "0.77745175", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7719465", "0.7682491", "0.76666844", "0.7659627", "0.76204914", "0.7570898", "0.7570898", ...
0.77966636
8
Check if the given character code, or the character code at the first character, is decimal.
function decimal(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return code >= 48 && code <= 57 /* 0-9 */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 48 && code <= 57; /* 0-9 */\n}", "function _isDecimalDigit(ch) {\n return ch >= 48 && ch <= 57; // 0...9\n }", "function isdecimal(num) {\n return (/^\\d+(\\.\\d+)?$/.te...
[ "0.79072535", "0.7269267", "0.67055756", "0.6648749", "0.6647464", "0.6595899", "0.65650105", "0.6528613", "0.6525254", "0.6490702", "0.6490702", "0.6467799", "0.6428777", "0.6407652", "0.6407652", "0.639504", "0.63804865", "0.6337335", "0.6335508", "0.6280799", "0.62789047",...
0.7950802
5
Wrap to ensure clean parameters are given to `parse`.
function parseEntities(value, options) { var settings = {} var option var key if (!options) { options = {} } for (key in defaults) { option = options[key] settings[key] = option === null || option === undefined ? defaults[key] : option } if (settings.position.indent || settings.position.start) { settings.indent = settings.position.indent || [] settings.position = settings.position.start } return parse(value, settings) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize( params, cb ){\n\n var clean = {};\n\n // ensure the input params are a valid object\n if( Object.prototype.toString.call( params ) !== '[object Object]' ){\n params = {};\n }\n\n // input text\n if('string' !== typeof params.input || !params.input.length){\n return cb( 'invalid param...
[ "0.5849934", "0.5465816", "0.5398534", "0.5267196", "0.5057463", "0.50056684", "0.4993291", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49829757", "0.49773252", "0.4934223", "0.49293447", "0.4920151", "0.4...
0.0
-1
Get character at position.
function at(position) { return value.charAt(position) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function at(position) {\n return value.charAt(position);\n }", "function getchar(position){\n return $(position).text();\n}", "function getCharFromPosition(pos) {\n\t\tvar index = pos.row * 5;\n\t\tindex = index + pos.col;\n\t\treturn keyPhrase.charAt(index);\n\t}", "function charAt (str='', position) {...
[ "0.80307126", "0.7923145", "0.7504489", "0.7345628", "0.72849643", "0.7173458", "0.71678835", "0.7005721", "0.69420445", "0.69145226", "0.69129384", "0.6879252", "0.6852267", "0.6845846", "0.6806128", "0.6754075", "0.6754075", "0.66977465", "0.6695774", "0.6644064", "0.661924...
0.7991142
4
Flush `queue` (normal text). Macro invoked before each entity and at the end of `value`. Does nothing when `queue` is empty.
function flush() { if (queue) { result.push(queue) if (handleText) { handleText.call(textContext, queue, {start: prev, end: now()}) } queue = '' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush () {\n flushing = true\n run(queue)\n run(userQueue)\n reset()\n}", "function flush() {\n if (queue) {\n ...
[ "0.7087387", "0.7087387", "0.7087387", "0.6971163", "0.69597924", "0.6915335", "0.6880378", "0.6880378", "0.65975094", "0.653583", "0.63974905", "0.6274862", "0.6236151", "0.62098926", "0.6177881", "0.6177881", "0.6177881", "0.6148284", "0.6148284", "0.6148284", "0.613334", ...
0.69163615
12
Check if `character` is outside the permissible unicode range.
function prohibited(code) { return (code >= 0xd800 && code <= 0xdfff) || code > 0x10ffff }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isRes...
[ "0.67489797", "0.6671416", "0.6548199", "0.6439609", "0.6376556", "0.636672", "0.6355649", "0.6336511", "0.61371344", "0.61371344", "0.61335915", "0.6131919", "0.6103784", "0.6095146", "0.60744405", "0.60734296", "0.6037238", "0.6001221", "0.59768313", "0.596549", "0.596392",...
0.0
-1
Check if `character` is disallowed.
function disallowed(code) { return ( (code >= 0x0001 && code <= 0x0008) || code === 0x000b || (code >= 0x000d && code <= 0x001f) || (code >= 0x007f && code <= 0x009f) || (code >= 0xfdd0 && code <= 0xfdef) || (code & 0xffff) === 0xffff || (code & 0xffff) === 0xfffe ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCharAndNotRestricted(c) {\n return (c === 0x9) ||\n (c === 0xA) ||\n (c === 0xD) ||\n (c > 0x1F && c < 0x7F) ||\n (c === 0x85) ||\n (c > 0x9F && c <= 0xD7FF) ||\n (c >= 0xE000 && c <= 0xFFFD) ||\n (c >= 0x10000 && c <= 0x10FFFF);\n}", "function isVal...
[ "0.7253733", "0.72172964", "0.70964015", "0.7084406", "0.69946593", "0.6974858", "0.6965145", "0.69241107", "0.6893851", "0.6864202", "0.6696537", "0.6636918", "0.66188204", "0.6596767", "0.6581353", "0.6559648", "0.65311134", "0.65260786", "0.6522246", "0.65065336", "0.64783...
0.0
-1
Remove final newline characters from `value`.
function trimTrailingLines(value) { var val = String(value) var index = val.length while (val.charAt(--index) === line) { /* Empty */ } return val.slice(0, index + 1) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trimTrailingLines(value) {\n return String(value).replace(/\\n+$/, '')\n}", "function trimTrailingLines(value) {\n var val = String(value);\n var index = val.length;\n\n while (val.charAt(--index) === line) { /* empty */ }\n\n return val.slice(0, index + 1);\n}", "function trimTrailingLines(value...
[ "0.79480493", "0.7229775", "0.7213269", "0.7213269", "0.7213269", "0.69982606", "0.6687853", "0.6399552", "0.63851583", "0.6329458", "0.6270205", "0.6220877", "0.6215881", "0.6215881", "0.62151474", "0.62026143", "0.6172999", "0.6161238", "0.61498433", "0.61375123", "0.613751...
0.7208231
6
Normalize an identifier. Collapses multiple white space characters into a single space, and removes casing.
function normalize(value) { return collapseWhiteSpace(value).toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalizeName(name) {\n s = name;\n var pos = 0;\n while (true)\n {\n pos = s.search(' ');\n if (pos...
[ "0.664014", "0.664014", "0.66295314", "0.65128195", "0.6494406", "0.6434182", "0.642196", "0.6413547", "0.63303286", "0.6327255", "0.63266134", "0.63184613", "0.63184613", "0.63148844", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321", "0.6298321",...
0.631888
14
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. resolves . and .. elements in a path array with directory names there must be no slashes, empty elements, or device names (c:\) in the array (so also no leading and trailing slashes it does not distinguish relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rationalizePaths(array){\n for(var i = 0, len = array.length; i < len; i++){\n //I know, this is very unneeded, but I like having it because of it's over bearing round-a-bout-ness\n array[i] = require.resolve(array[i]).split('\\\\').filter(function(o,i,a){ return (a.length-1) !== i; }).jo...
[ "0.62572104", "0.6090412", "0.5959142", "0.5926828", "0.59113187", "0.5872586", "0.58484083", "0.58189994", "0.5759454", "0.5741373", "0.5709317", "0.5640396", "0.55562675", "0.55114317", "0.5476231", "0.5438098", "0.5435966", "0.54343283", "0.5427441", "0.54015446", "0.53997...
0.0
-1
Check if the given character code, or the character code at the first character, is alphabetical.
function alphabetical(character) { var code = typeof character === 'string' ? character.charCodeAt(0) : character return ( (code >= 97 && code <= 122) /* a-z */ || (code >= 65 && code <= 90) /* A-Z */ ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 && code <= 122 /* a-z */ || code >= 65 && code <= 90 /* A-Z */;\n}", "function sc_isCharAlphabetic(c)\n { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||\n\t sc_isCharO...
[ "0.8075103", "0.8058104", "0.7876275", "0.78079677", "0.7781606", "0.7738573", "0.77375126", "0.7683825", "0.7683825", "0.7679425", "0.7608251", "0.7583648", "0.7579424", "0.75713086", "0.75505906", "0.74917066", "0.74879587", "0.74806297", "0.74661064", "0.7437811", "0.74378...
0.7922871
8
Gets indentation information for a line.
function indentation(value) { var index = 0; var indent = 0; var character = value.charAt(index); var stops = {}; var size; while (character in characters) { size = characters[character]; indent += size; if (size > 1) { indent = Math.floor(indent / size) * size; } stops[indent] = index; character = value.charAt(++index); } return {indent: indent, stops: stops}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndent (line) {\n return line.match(/^\\s*/)[0].length\n}", "getCurrentLineIndentation() {\n return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length;\n }", "function indentLevel(linea) {\n var level = 0;\n for ( i in linea ) {\n if ( linea[i] != ' ' ) { brea...
[ "0.7321178", "0.68024457", "0.673355", "0.6241265", "0.6205445", "0.6142215", "0.61237204", "0.5931858", "0.5885914", "0.58800983", "0.58800983", "0.58800983", "0.58800983", "0.58800983", "0.58320516", "0.57890755", "0.5771645", "0.57372", "0.5698956", "0.565636", "0.5610286"...
0.0
-1
wrapper for elt, which removes the elt from the accessibility tree
function eltP(tag, content, className, style) { var e = elt(tag, content, className, style); e.setAttribute("role", "presentation"); return e }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeElement() {\n this.el.parentNode.removeChild(this.el);\n }", "function removeElement(elem){ if (elem) elem.parentNode.removeChild(elem) }", "function removeElement(elem){ if (elem) elem.parentNode.removeChild(elem) }", "@chained\n\tremove() {\n\t\tlet parent = this.element.parentNode;\n\t\tpa...
[ "0.6625357", "0.66057837", "0.66057837", "0.6573982", "0.6454482", "0.63668096", "0.6310595", "0.6301675", "0.6279491", "0.6267398", "0.62233317", "0.6215944", "0.6156988", "0.6145581", "0.6128828", "0.61132556", "0.60445356", "0.6018156", "0.6015969", "0.6015648", "0.6008385...
0.0
-1
Counts the column offset in a string, taking tabs into account. Used mostly to find indentation.
function countColumn(string, end, tabSize, startIndex, startValue) { if (end == null) { end = string.search(/[^\s\u00a0]/); if (end == -1) { end = string.length; } } for (var i = startIndex || 0, n = startValue || 0;;) { var nextTab = string.indexOf("\t", i); if (nextTab < 0 || nextTab >= end) { return n + (end - i) } n += nextTab - i; n += tabSize - (n % tabSize); i = nextTab + 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countColumn(string, end, tabSize) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = 0, n = 0; i < end; ++i) {\n if (string.charAt(i) == \"\\t\") n += tabSize - (n % tabSize);\n else ++n;\n }\n return n...
[ "0.78494596", "0.78494596", "0.78494596", "0.78494596", "0.78494596", "0.78494596", "0.78313595", "0.78313595", "0.78313595", "0.77288246", "0.77288246", "0.77288246", "0.77288246", "0.7564648", "0.7547028", "0.7547028", "0.75413024", "0.7519291", "0.7494119", "0.7494119", "0...
0.7577807
26
The inverse of countColumn find the offset that corresponds to a particular column.
function findColumn(string, goal, tabSize) { for (var pos = 0, col = 0;;) { var nextTab = string.indexOf("\t", pos); if (nextTab == -1) { nextTab = string.length; } var skipped = nextTab - pos; if (nextTab == string.length || col + skipped >= goal) { return pos + Math.min(skipped, goal - col) } col += nextTab - pos; col += tabSize - (col % tabSize); pos = nextTab + 1; if (col >= goal) { return pos } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstInColumnLocation(col) {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar point = new Point(sets.columns[col],0);\r\n\t\tvar offset = getRelativePoint(point);\r\n\t\treturn offset.x;\r\n\t}", "function getRelativeColStart(col) {\r\n\t\tvar loc = new Point(sets.columns[col],0);\r\n\t\tvar offset = getR...
[ "0.70207864", "0.6774466", "0.6547042", "0.65317714", "0.6513608", "0.6411472", "0.64103985", "0.6358958", "0.63435084", "0.6293746", "0.62447125", "0.62313", "0.62138146", "0.62027305", "0.6194549", "0.6194549", "0.6194549", "0.6194549", "0.6194549", "0.6194549", "0.615899",...
0.6172878
32
Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
function skipExtendingChars(str, pos, dir) { while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } return pos }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStart (pos, len) {\n if (pos == null) return 0;\n return pos < 0 ? (len + (pos % len)) : Math.min(len, pos);\n}", "function getPosAsInt(str) {\n\treturn parseInt(str.substr(0, str.length - 2));\n}", "function collectDigits(input, pos) {\n\t\t'use strict';\n\t\twhile (pos < input.length && inp...
[ "0.6600404", "0.65358627", "0.61570245", "0.5993589", "0.57630634", "0.57247585", "0.5646826", "0.56274575", "0.5462163", "0.543008", "0.54007566", "0.53785247", "0.5377223", "0.5372194", "0.5372194", "0.5349353", "0.5318074", "0.5312245", "0.5266459", "0.526095", "0.5196307"...
0.49225366
78
Returns the value from the range [`from`; `to`] that satisfies `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`. Supports `from` being greater than `to`.
function findFirst(pred, from, to) { // At any point we are certain `to` satisfies `pred`, don't know // whether `from` does. var dir = from > to ? -1 : 1; for (;;) { if (from == to) { return from } var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); if (mid == from) { return pred(mid) ? from : to } if (pred(mid)) { to = mid; } else { from = mid + dir; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid =...
[ "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.72160196", "0.71898764", "0.71822035", "0.71509534", "0.70096433", "0.65164363", "0.60557735", "0.60172063", "0.60172063", "0.60172063", "0.60172063"...
0.71492475
27
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, input) { var d = this; this.input = input; // Covers bottom-right square when both scrollbars are present. d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); d.scrollbarFiller.setAttribute("cm-not-content", "true"); // Covers bottom of gutter when coverGutterNextToScrollbar is on // and h scrollbar is present. d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); d.gutterFiller.setAttribute("cm-not-content", "true"); // Will contain the actual code, positioned to cover the viewport. d.lineDiv = eltP("div", null, "CodeMirror-code"); // Elements are added to these to represent selection and cursors. d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); d.cursorDiv = elt("div", null, "CodeMirror-cursors"); // A visibility: hidden element used to find the size of things. d.measure = elt("div", null, "CodeMirror-measure"); // When lines outside of the viewport are measured, they are drawn in this. d.lineMeasure = elt("div", null, "CodeMirror-measure"); // Wraps everything that needs to exist inside the vertically-padded coordinate system d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], null, "position: relative; outline: none"); var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); // Moved around its parent to cover visible view. d.mover = elt("div", [lines], null, "position: relative"); // Set to the height of the document, allowing scrolling. d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); d.sizerWidth = null; // Behavior of elts with overflow: auto and padding is // inconsistent across browsers. This is used to ensure the // scrollable area is big enough. d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); // Will contain the gutters, if any. d.gutters = elt("div", null, "CodeMirror-gutters"); d.lineGutter = null; // Actual scrollable element. d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); d.scroller.setAttribute("tabIndex", "-1"); // The element in which the editor lives. d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } if (place) { if (place.appendChild) { place.appendChild(d.wrapper); } else { place(d.wrapper); } } // Current rendered range (may be bigger than the view window). d.viewFrom = d.viewTo = doc.first; d.reportedViewFrom = d.reportedViewTo = doc.first; // Information about the rendered lines. d.view = []; d.renderedView = null; // Holds info about a single rendered line when it was rendered // for measurement, while not in view. d.externalMeasured = null; // Empty space (in pixels) above the view d.viewOffset = 0; d.lastWrapHeight = d.lastWrapWidth = 0; d.updateLineNumbers = null; d.nativeBarWidth = d.barHeight = d.barWidth = 0; d.scrollbarsClipped = false; // Used to only resize the line number gutter when necessary (when // the amount of lines crosses a boundary that makes its width change) d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; // Set to true when a non-horizontal-scrolling line widget is // added. As an optimization, line widget aligning is skipped when // this is false. d.alignWidgets = false; d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; // Tracks the maximum line length so that the horizontal scrollbar // can be kept static when scrolling. d.maxLine = null; d.maxLineLength = 0; d.maxLineChanged = false; // Used for measuring wheel scrolling granularity d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; // True when shift is held down. d.shift = false; // Used to track whether anything happened since the context menu // was opened. d.selForContextMenu = null; d.activeTouch = null; input.init(d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayDOM(){\r\n\t\tvar str = '';\r\n\t\tcontainer.getChildren().each(function(item){\r\n\t\t\tstr += '<div style=\"' + item.style.cssText + '\">' + item.get('text') + '</div>\\n';\r\n\t\t});\r\n\t\tdocument.id('output').set('text', str);\r\n\t}", "displayScene() {\n\n //Process all component n...
[ "0.7111654", "0.6606583", "0.6553395", "0.62436736", "0.62331814", "0.62235034", "0.61459774", "0.6129759", "0.611871", "0.611871", "0.610078", "0.60716736", "0.60686475", "0.6026015", "0.60221195", "0.60136545", "0.60071284", "0.5978854", "0.58669174", "0.5864605", "0.579738...
0.0
-1
Find the line object corresponding to the given line number.
function getLine(doc, n) { n -= doc.first; if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } var chunk = doc; while (!chunk.lines) { for (var i = 0;; ++i) { var child = chunk.children[i], sz = child.chunkSize(); if (n < sz) { chunk = child; break } n -= sz; } } return chunk.lines[n] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function code_line(code, line) {\n return code.findIndex(l => l.line === line)\n}", "function getSourceLine(lineNo) {\n\t\tif ((lineNo >= 1) && (lineNo <= sourceList.length)) {\n\t\t\treturn sourceList[lineNo - 1];\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "getLine(x, y) {\n var cell = this.getC...
[ "0.6920249", "0.64912915", "0.6366571", "0.6360952", "0.6341226", "0.6221371", "0.62164265", "0.62164265", "0.6216259", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0.62154245", "0...
0.59749305
78
Get the part of a document between two positions, as an array of strings.
function getBetween(doc, start, end) { var out = [], n = start.line; doc.iter(start.line, end.line + 1, function (line) { var text = line.text; if (n == end.line) { text = text.slice(0, end.ch); } if (n == start.line) { text = text.slice(start.ch); } out.push(text); ++n; }); return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBetween(doc, start, end) {\n\t var out = [], n = start.line;\n\t doc.iter(start.line, end.line + 1, function(line) {\n\t var text = line.text;\n\t if (n == end.line) text = text.slice(0, end.ch);\n\t if (n == start.line) text = text.slice(start.ch);\n\t out.push(text);\n\t ...
[ "0.7319094", "0.7319094", "0.7319094", "0.7309015", "0.7309015", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7307082", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "0.7296952", "...
0.73343515
13
Get the lines between from and to, as array of strings.
function getLines(doc, from, to) { var out = []; doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }", "function getLines(doc...
[ "0.78904086", "0.78904086", "0.78904086", "0.78904086", "0.78904086", "0.78904086", "0.78513694", "0.7843995", "0.7843995", "0.7843995", "0.7803603", "0.77783775", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.7767557", "0.77675...
0.7850108
22
Update the height of a line, propagating the height change upwards to parent nodes.
function updateLineHeight(line, height) { var diff = height - line.height; if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.paren...
[ "0.8322016", "0.830631", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.8282418", "0.82768357", "0.82768357", "0.82768357", "0.8260964", "0.8210703", "0.8163414", "0.81575036", "0.81575036", "0.81119776", "0.81119776", "0.81119776", "0.811197...
0.82786244
25
Given a line object, find its line number by walking up through its parent links.
function lineNo(line) { if (line.parent == null) { return null } var cur = line.parent, no = indexOf(cur.lines, line); for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { for (var i = 0;; ++i) { if (chunk.children[i] == cur) { break } no += chunk.children[i].chunkSize(); } } return no + cur.first }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineNo(line) {\n\t\t if (line.parent == null) { return null }\n\t\t var cur = line.parent, no = indexOf(cur.lines, line);\n\t\t for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n\t\t for (var i = 0;; ++i) {\n\t\t if (chunk.children[i] == cur) { break }\n\t\t ...
[ "0.76442444", "0.7633338", "0.760459", "0.75937176", "0.75937176", "0.75937176", "0.75879866", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.75715834", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.7512249", "0.75...
0.7587738
23
Find the line at the given vertical position, using the height information in the document tree.
function lineAtHeight(chunk, h) { var n = chunk.first; outer: do { for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { var child = chunk.children[i$1], ch = child.height; if (h < ch) { chunk = child; continue outer } h -= ch; n += child.chunkSize(); } return n } while (!chunk.lines) var i = 0; for (; i < chunk.lines.length; ++i) { var line = chunk.lines[i], lh = line.height; if (h < lh) { break } h -= lh; } return n + i }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "lineBlockAtHeight(height) {\n this.readMeasu...
[ "0.65733033", "0.64114404", "0.63363874", "0.63363874", "0.63363874", "0.63167506", "0.6293391", "0.62653893", "0.6253694", "0.6222418", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.6202566", "0.61813724", "0.61696094", "0.61696094", "0.616...
0.62214965
25
A Pos instance represents a position within the text.
function Pos(line, ch, sticky) { if ( sticky === void 0 ) sticky = null; if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } this.line = line; this.ch = ch; this.sticky = sticky; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pos (line, ch) {\n if (!(this instanceof Pos)) { return new Pos(line, ch) }\n this.line = line; this.ch = ch\n}", "function Pos(x, y) {\n this.x = x; this.y = y;\n}", "function Pos(line, ch, sticky) {\n\t\t if ( sticky === void 0 ) sticky = null;\n\n\t\t if (!(this instanceof Pos)) { return n...
[ "0.7744325", "0.7327437", "0.73072433", "0.7230869", "0.71548593", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.71528506", "0.7148194", "0.7127105", "0.7103211", "0.6844026", "0....
0.72398067
16
Compare two positions, return 0 if they are the same, a negative number when a is less, and a positive number otherwise.
function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function posCompare(a, b) {\n const yDiff = a[1] - b[1];\n if (yDiff !== 0) return yDiff;\n return a[0] - b[0];\n}", "function compare(a,b) {\n if (a.x < b.x)\n return -1;\n if (a.x > b.x)\n return 1;\n return 0;\n }", "function compare (a, b) {\n return a > b ?...
[ "0.798942", "0.7316707", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7281275", "0.7240236", "0.7222929", "0.7222929", "0.7222929", "0.7222929", "0...
0.0
-1
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.5863681", "0.567558", "0.55955523", "0.5533016", "0.5504405", "0.5477774", "0.54361933", "0.53989476", "0.53916335", "0.5389024", "0.53696203", "0.53577834", "0.5323233", "0.5317081", "0.53043234", "0.5301511", "0.5299161", "0.52897173", "0.52891934", "0.5287068", "0.52860...
0.0
-1
Search an array of spans for a span matching the given marker.
function getMarkedSpanFor(spans, marker) { if (spans) { for (var i = 0; i < spans.length; ++i) { var span = spans[i]; if (span.marker == marker) { return span } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans...
[ "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7195285", "0.7165243", "0.7141147", "0.71237963", "0.7118984", "0.7118984", "0.7118984", "0.7104211", "0.7104211", "0.71036065", "0.70881194", "0.70881194", "0.70881194", "0.70881194", "0.7088119...
0.7182503
19