query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
dog movement set up
function setup() { createCanvas(1400, 800); dog1.y = random(randomDogSpawn.min, randomDogSpawn.max); dog1.vx = dog1.speed; dog2.y = random(randomDogSpawn.min, randomDogSpawn.max); dog2.vx = dog2.speed; dog3.y = random(randomDogSpawn.min, randomDogSpawn.max); dog3.vx = dog3.speed; dog4.y = random(ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Movement() { }", "function move(d) {\n d.x += d.vx;\n d.y += d.vy;\n\n d.vx *= d.drag;\n d.vy *= d.drag;\n\n d.theta += get_random_number( -0.5, 0.5 ) * d.wander;\n d.vx += Math.sin( d.theta ) * 0.5;\n d.vy += Math.cos( d.theta ) * 0.5;\n\n d.radius *= d.age;\n d.alive = d.rad...
[ "0.68536574", "0.6758777", "0.6635522", "0.6510436", "0.6510426", "0.64899236", "0.6444853", "0.64403546", "0.64356345", "0.64316857", "0.643047", "0.6401533", "0.6388288", "0.63692546", "0.6364099", "0.6354502", "0.63476163", "0.6333297", "0.63321954", "0.63305074", "0.63231...
0.68411005
1
create a func called generatePlayerCard that takes 3 args (name,age,height) have that function return html that looks like this: / NAME AGE Height: HEIGHT age in dog years: AGE7
function generatePlayerCard(name,age,height) { let div = document.createElement("div") div.classList.add('player-card') div.innerHTML = `<h2>${name} - ${age}</h2> <p>Height: ${height}</br> age in dog years: ${age*7}</p>` console.log( div ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePlayerCard(name, age, height) {\n const card = document.createElement('div');\n card.innerHTML = `\n <div class=\"playerCard\">\n <h2>${name.toUpperCase()} - ${age}</h2>\n <p>They are ${height} and ${age} years old. In Dog years would be ${age *\n 7}. That would be a tall dog!</p>\n ...
[ "0.7706916", "0.68648463", "0.67307854", "0.6709441", "0.6666195", "0.6652726", "0.659688", "0.6595929", "0.6578845", "0.6519443", "0.6415529", "0.64138186", "0.6397648", "0.63916796", "0.63849777", "0.63813686", "0.6361795", "0.6346868", "0.63465875", "0.63266146", "0.630811...
0.7469498
1
Get permalinks from human readable terms
function _mapTerms(doc, taxonomy) { if (!doc[taxonomy] || !doc[taxonomy].length) { return []; } return doc[taxonomy].map((name) => ({ name, url: `/${taxonomy}/${slug(name)}`, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function composeTermUrl(term, page) {\n return PROPERTY_API.baseUrl + '&page=' + page + '&place_name=' + term;\n }", "function extractSearchTerms(ref, o) {\n var terms = \"\";\n\n $.each(o.referrerPatterns, function () {\n var pattern = new RegExp(this, \"i\"),\n unsafe;\n\n ...
[ "0.6046872", "0.5783398", "0.5517328", "0.54915094", "0.53672457", "0.5333859", "0.53232026", "0.5315901", "0.52837527", "0.5207639", "0.5194808", "0.5132628", "0.5114603", "0.5075706", "0.50513124", "0.50257", "0.50172496", "0.50137943", "0.4929008", "0.49206054", "0.4895958...
0.60335964
1
Rough excerpt from main content
function _getExcerpt(content) { if (content.length <= (config.excerptChars + config.excerptFuzz)) { return content; } return content.substr(0, config.excerptChars) // trim to max length .split(/\s/) // split by whitespace .slice(0, -1) // remove last element in case it's a partial word .concat(['....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_html_excerpt( $str, $count, $more = null ) {\n if ( null === $more )\n $more = '';\n $str = wp_strip_all_tags( $str, true );\n $excerpt = mb_substr( $str, 0, $count );\n // remove part of an entity at the end\n $excerpt = preg_replace( '/&[^;\\s]{...
[ "0.6499188", "0.6071916", "0.60005885", "0.60000986", "0.5967121", "0.59032565", "0.58937603", "0.5892987", "0.5876121", "0.5853113", "0.58490616", "0.5842185", "0.57913214", "0.576762", "0.573424", "0.57289207", "0.57174724", "0.56945455", "0.56301314", "0.56214315", "0.5612...
0.6770853
0
detect a valid character for a key's value
function isValueCharacter(char) { let invalid_characters = '[]{}":,'; return !invalid_characters.includes(char); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validKey (key) {\r\n\r\n // Regex expression parsing, accept alphanumerics 'A', 'B', 'C' or 'D' and their lower cases only\r\n if (!/^[AaBbCcDd]*$/g.test(key)) {\r\n console.log(\"validKey() - invalid character [\" + key + \"]\");\r\n return false;\r\n }\r\n\r\n...
[ "0.74065286", "0.7142387", "0.7142387", "0.7142387", "0.6964989", "0.6911611", "0.67780983", "0.6717684", "0.6476624", "0.64532495", "0.6436462", "0.6426766", "0.6425575", "0.6419074", "0.6406152", "0.64009523", "0.63856524", "0.6366094", "0.62632704", "0.6212524", "0.6204973...
0.7767609
0
scan for available gamepads, used on events as well as polling
scanForGamePads() { this.hasGamePads = false; let foundpads = navigator.getGamepads ? navigator.getGamepads() : []; // loop through the pads, if any are not null, then note that we have gamepads! // the foundpads might be an object, so we cant use foreach for(let i=0; i<foundpad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pollGamepads() {\n var gp = [];\n var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads : []);\n for (var i = 0; i < gamepads.length; i++) {\n if (gamepads[i])\n gp.push(gamepads[i]);\n }\n return gp;\n}", "pollGamepads()...
[ "0.8053712", "0.7288554", "0.718974", "0.68960917", "0.6778557", "0.6700768", "0.66997033", "0.6584338", "0.65478927", "0.6431324", "0.64086205", "0.6379333", "0.6340323", "0.62080663", "0.6206513", "0.61934096", "0.6103035", "0.6027003", "0.5989823", "0.5981813", "0.59499604...
0.8214153
0
sort comparators for unix timestamps
function asorterTimestamp(a, b) { return a - b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nowSort(a, b) { return a.time < b.time ? -1 : a.time > b.time ? 1 : 0 }", "function sortTxs(unsortedTxs) {\n unsortedTxs.sort((a,b) => {\n \treturn b.unix - a.unix;\n })\n}", "function custom_sort(a, b) {\n return new Date(b.date).getTime() > new Date(a.date).getTime() ? 1 : -1\n }"...
[ "0.7126112", "0.70640516", "0.6828571", "0.6718709", "0.66656715", "0.6657169", "0.66562873", "0.6613935", "0.6572818", "0.6535502", "0.6528067", "0.64819145", "0.64762866", "0.6428427", "0.6366987", "0.6337439", "0.63280606", "0.6321045", "0.6317614", "0.631604", "0.63077664...
0.74420935
0
because of how processed tags work in lit (illegal) we have to specialized way of rendering so that the playlist element is empty for a second and then we template stamp it into placee
renderPlayListTemplate() { let template = document.createElement("template"); render( html`${this.results.map( (item) => html` ${this.params.displayOf === "blocks" ? mediaKeys.map((key) => item.media && item.media[key] && typeof...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _drawPlaylist() {\n let template = \"\"\n ProxyState.playlist.forEach(p => template += p.playlistTemplate)\n document.getElementById(\"playlistId\").innerHTML = template\n}", "function Playlist(props) {\n return (\n <div>Empty Playlist</div>\n )\n}", "function renderPlaylist() {\n // ...
[ "0.6328793", "0.62584454", "0.62566835", "0.6225915", "0.6131531", "0.60509026", "0.60425365", "0.599927", "0.59945595", "0.5957843", "0.5845078", "0.58040243", "0.5787396", "0.5750141", "0.57144225", "0.5711147", "0.5699709", "0.5695432", "0.5674138", "0.5653535", "0.5640285...
0.70977545
0
gpio should be int of GPIO pin value is either false or true
function updateGPIO(gpio, value) { $('.gpio' + gpio).prop('checked', value).change(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function on3() {\n gpio.write(3, true, function(err) {\n if (err) throw err;\n console.log('Pin 3 on!');\n });\n}", "function GPIO() {\n}", "function pirTiggerEvent(gpio) {\n var now = new Date();\n\n // get today's sunlight times for my location\n // use 'https://www.g...
[ "0.6475084", "0.620931", "0.603376", "0.5991463", "0.5990416", "0.5977941", "0.59598017", "0.5745875", "0.5738259", "0.57065403", "0.5692187", "0.5672472", "0.5634706", "0.5619635", "0.5498063", "0.5495077", "0.5421144", "0.5418516", "0.5413423", "0.5388134", "0.538638", "0...
0.6694349
0
generate schema from value
async function retrieveSchemaFromValue (value) { let type = getValueType(value, true) if (type === 'Object') type = 'object' return await retrieveSchemaByName(type) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setSchema(schema) {\n let errorList = this.validate(schema, this.value);\n return this.createRoot({schema, errorList});\n }", "function Schema() {}", "static get schema () { return schema }", "getMemberSchema(value) {\n let question = getQuestion(value);\n // TODO this is a quirk of the ...
[ "0.62314683", "0.62073165", "0.62013346", "0.60735434", "0.59364283", "0.5906898", "0.5903982", "0.5883084", "0.58413696", "0.58391917", "0.57969517", "0.57969517", "0.57969517", "0.57969517", "0.57969517", "0.5791844", "0.57107973", "0.5640564", "0.56195235", "0.5619289", "0...
0.6271495
0
generate default value from schema
function generateDefault (schema) { let d = null switch (schema.type) { case 'string': d = '' break case 'integer': case 'number': d = 0 break case 'boolean': d = false break case 'object': d = {} break case 'array': d = [] break ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "schemaDefault(key, schema, schemaItem, schemaItemType) {\n\n let schemaKey = schema[key]\n\n if(typeof schemaKey.default == schemaItemType) {\n\n var defaultValue = null\n\n if(schemaItemType == 'date') {\n\n defaultValue = Date.now()\n\n }\n\n else {\n\n defaultValue = sche...
[ "0.7555846", "0.6893925", "0.64433825", "0.6428403", "0.61657894", "0.60845286", "0.60737723", "0.60691935", "0.59948474", "0.5977686", "0.5892538", "0.5838332", "0.57834685", "0.5734247", "0.57140803", "0.5708681", "0.5708136", "0.57051814", "0.56581604", "0.56252205", "0.56...
0.7943006
0
attach functions to schema
function attachFuncsToSchema (schema, nodeList) { if (typeof nodeList === 'undefined') { nodeList = [] } // check & attach before enumeration process if (typeof schema['@beforeEnum'] === 'string' && typeof schemaFunctions[schema['@beforeEnum']] === 'function') { schema['@beforeEnumProc'] = schemaFunctio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createSchema() {\r\n this.schema = this.extensionManager.schema;\r\n }", "function Schema() {}", "createSchema() {\n this.entities.forEach((entity) => {\n this.registerSchema(entity);\n });\n }", "registerSchema(config) {\n if (_.isFunction(config)) {\n this....
[ "0.6462818", "0.6208695", "0.60233456", "0.5891634", "0.5755747", "0.57222843", "0.57101935", "0.5630591", "0.5611559", "0.5538242", "0.553233", "0.5501556", "0.5475896", "0.54469633", "0.53893685", "0.5377695", "0.52868193", "0.525778", "0.5239329", "0.5237033", "0.52345973"...
0.67995507
0
return schema of specific child
async function retrieveChildSchema (schema, childName, childValue) { if (!childName) return await retrieveSchemaFromValue(childValue) if (typeof schema === 'undefined' || schema === null) return await retrieveSchemaFromValue(childValue) if (schema.type === 'object') { if (schema.properties && schema.propertie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get schema () { return schema }", "static get schema() {\n\t\tif (this._SCHEMA) {\n\t\t\treturn this._SCHEMA;\n\t\t}\n\n\t\tconst properties = jsonSchemaPropertiesFromClassHierarchy(this);\n\t\tconst spec = this._schema();\n\n\t\tlet result;\n\n\t\tif (\n\t\t\t!spec ||\n\t\t\tspec.description ||\n\t\t\tsp...
[ "0.61631334", "0.6148078", "0.5946286", "0.579501", "0.5789978", "0.5788399", "0.57858413", "0.5779871", "0.571531", "0.56952393", "0.56770223", "0.56259084", "0.55415934", "0.5536714", "0.55250776", "0.5489155", "0.5439841", "0.54382145", "0.54285634", "0.54095167", "0.53474...
0.7082216
0
Insert two copies of each vertex after every other existing vertex, starting with vertex 1. This doubles the total number of vertices so that we can animate between a regular polygon with N vertices to one with N2 vertices.
function insertDuplicateVertices(vertices) { for (var i = vertices.length - 1; i > 0; i -= 2) vertices.splice(i, 0, vertices[i], vertices[i]); return vertices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twistVertices(vertices, twistAmount) {\n for(var i = 0; i < vertices.length; i++) {\n vertices[i] = twistVertex(vertices[i], twistAmount);\n }\n}", "addVertex(vertex, index = this.vertices.length) {\n const edge = new Line2_1.Line2(vertex, vertex);\n this.vertices.splice(index, 0,...
[ "0.62108785", "0.57436424", "0.5741628", "0.5569622", "0.5517625", "0.5510469", "0.54545385", "0.5389026", "0.534269", "0.53327096", "0.53327096", "0.53327096", "0.53327096", "0.5320295", "0.53108776", "0.5308976", "0.5282414", "0.5256632", "0.52544594", "0.5249747", "0.52267...
0.7310658
0
balances de la cuenta con dni == DNI
function getBalance(dni){ return new Promise(function(resolve, reject) { Contrato.getBalance(dni,function(error, response) { if(error){ reject(error); }else { resolve(response); } }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getNoiaBalanceBN(who) {\n return await this.instances.tokenContract.balanceOf.call(who);\n }", "async getNoiaBalance(who) {\n const balance = await this.getNoiaBalanceBN(who);\n return balance.dividedBy(common.noiaTokenDecimals).toNumber();\n }", "function calculateBalance() {\n const calcu...
[ "0.6542462", "0.6475759", "0.6462329", "0.6393578", "0.638411", "0.63750434", "0.6237872", "0.62108064", "0.61559474", "0.6071658", "0.60474586", "0.6034807", "0.59944105", "0.59919405", "0.5991629", "0.59896815", "0.5980521", "0.5968197", "0.59583825", "0.59572476", "0.59534...
0.68873763
0
cargar fondos a una cuenta
function cargarFondos(dni,monto){ return new Promise(function(resolve, reject) { Contrato.cargarFondos(dni,{value:monto},function(error, response) { if(error){ reject(error); }else { resolve(response); } }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarFondo(){\n elMapa.cargaOk = true;\n dibujar();\n}", "function cargarFondo()\n{\n fondo.cargaOK = true;\n dibujar();\n}", "function chargerChanteur()\n\t{\n\t\t$.getJSON('chanteurs.json', function(data)\n\t\t{\n\t\t\t$.each(data, function(key, val){\n\t\t\t\tvar tmp = \"albums_\"+val['nom'];\...
[ "0.6837026", "0.6716985", "0.6543256", "0.6474617", "0.6399506", "0.6396951", "0.63706344", "0.62624884", "0.6101512", "0.6058271", "0.6038958", "0.6030595", "0.600969", "0.5996484", "0.5993933", "0.5992872", "0.598119", "0.59687465", "0.5967334", "0.59648186", "0.59250903", ...
0.6784957
1
bindActionCreators() takes an action and dispatch the action to all the reducers the first selectItem in the arguments list is the key and 2nd one is the value. first one will be available as props in this class, 2nd one is the actual action
function mapDispatchToProps(dispatch){ return bindActionCreators({selectItem:selectItem}, dispatch); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapDispathToProps(dispatch) {\n//whenever the selectBook is called,the result should be passed to all of our reducers\n return bindActionCreators({\n selectBook:selectBook,\n },dispatch);\n }", "function mapDispatchToProps(dis...
[ "0.72178036", "0.71018976", "0.7070656", "0.7064222", "0.70501953", "0.7045841", "0.70335746", "0.7027133", "0.7022425", "0.7013844", "0.6992574", "0.6957005", "0.693616", "0.6932908", "0.6930367", "0.6930367", "0.69222873", "0.6905542", "0.6899381", "0.6880955", "0.6879043",...
0.7793738
0
Show toggled content for control
function showToggledContent ($control, $content) { // Show content if ($content.hasClass('js-hidden')) { $content.removeClass('js-hidden') $content.attr('aria-hidden', 'false') // If the controlling input, update aria-expanded if ($control.attr('aria-controls')) { $control.attr('aria-expanded...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showToggledContent ($control, $content) {\n // Show content\n if ($content.hasClass('js-hidden')) {\n $content.removeClass('js-hidden')\n $content.attr('aria-hidden', 'false')\n\n // If the controlling input, update aria-expanded\n if ($control.attr('aria-controls')) ...
[ "0.77542424", "0.7236453", "0.70272315", "0.700244", "0.6999587", "0.6809969", "0.6806259", "0.6804159", "0.67916065", "0.6791039", "0.67884517", "0.6771382", "0.6771382", "0.6738045", "0.67169034", "0.67089385", "0.666462", "0.6648638", "0.6635255", "0.6635255", "0.6635255",...
0.7696857
1
Hide toggled content for control
function hideToggledContent ($control, $content) { $content = $content || getToggledContent($control) // Hide content if (!$content.hasClass('js-hidden')) { $content.addClass('js-hidden') $content.attr('aria-hidden', 'true') // If the controlling input, update aria-expanded if ($control.attr('ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideToggledContent ($control, $content) {\n $content = $content || getToggledContent($control)\n\n // Hide content\n if (!$content.hasClass('js-hidden')) {\n $content.addClass('js-hidden')\n $content.attr('aria-hidden', 'true')\n\n // If the controlling input, update ar...
[ "0.76647514", "0.72614044", "0.7235785", "0.71991694", "0.70963335", "0.7079582", "0.69217306", "0.69212794", "0.6853625", "0.6817972", "0.6807863", "0.67881626", "0.67868584", "0.6758209", "0.6747271", "0.67295414", "0.6728797", "0.6727515", "0.6707693", "0.6707693", "0.6707...
0.7606003
1
Checks if the screen dimension information has changed
hasChanged () { return window.innerWidth !== this.dimension.width || window.innerHeight !== this.dimension.height }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function screenchanged(w, h){\n\t\t// $('#feedback').val('iH: '+window.innerHeight+', width: '+stored_width+', height: '+stored_height);\n\t\t// $('#feedback').val($('#background').css('top'));\n\t\t// $('#feedback').val(stored_width+':'+stored_height);\n//\t\ts = ' '+window.innerHeight;\n//\t\t$('#feedback').val...
[ "0.7568281", "0.70667076", "0.70134544", "0.65175396", "0.6484772", "0.64695233", "0.64196247", "0.6408954", "0.6329368", "0.63144743", "0.62841946", "0.6281381", "0.6260106", "0.62561494", "0.61785394", "0.61765456", "0.614533", "0.61374485", "0.61361545", "0.6104113", "0.60...
0.7685742
0
Updates the dimension information for the screen
updateInfo () { this.dimension.width = window.innerWidth this.dimension.height = window.innerHeight }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshDimensions(){\n screenHeight = jQuery(window).height();\n screenWidth = jQuery(window).width();\n canvasHeight = html.interface.screen.appContainer.height();\n canvasWidth = html.interface.screen.appContainer.width(); \n }", "function dimension() {\n const { inne...
[ "0.74729663", "0.73233104", "0.71454865", "0.7127349", "0.70772374", "0.698879", "0.69438255", "0.69329524", "0.6892567", "0.6755337", "0.6730358", "0.6695832", "0.6640098", "0.6571147", "0.65380716", "0.6519391", "0.65118986", "0.64852816", "0.6467144", "0.6456698", "0.6408"...
0.770147
0
Delete all disconnected students
cleanUpStudents() { logger.log('info', `Clean up Students`); this.studentSockets.forEach((studentS, studentId) => { if (studentS.disconnected) { Student.removeStudentFromSession(this.session.id, studentId).then( (result) => { if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanUpStudentS() {\n this.studentSockets.forEach((studendS, studentId) => {\n if (studendS.disconnected == true) {\n this.studentSockets.delete(studentId);\n }\n })\n }", "function onWebsocketStudentDel ( data ) {\r\n for ( var i=0; i < workspace.students.l...
[ "0.7475878", "0.6669038", "0.63190633", "0.6192892", "0.60859156", "0.60457563", "0.6039184", "0.58835953", "0.58385915", "0.5815701", "0.5809322", "0.5803733", "0.57679677", "0.5764108", "0.5742635", "0.57335097", "0.5727415", "0.5704528", "0.5696998", "0.5672981", "0.564007...
0.71325976
1
remove all disconnected student sockets
cleanUpStudentS() { this.studentSockets.forEach((studendS, studentId) => { if (studendS.disconnected == true) { this.studentSockets.delete(studentId); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanUpStudents() {\n logger.log('info', `Clean up Students`);\n\n\n this.studentSockets.forEach((studentS, studentId) => {\n if (studentS.disconnected) {\n Student.removeStudentFromSession(this.session.id, studentId).then(\n (result) => {\n ...
[ "0.74513423", "0.73226655", "0.72281766", "0.6960963", "0.6938165", "0.69180673", "0.6903496", "0.684663", "0.68185407", "0.679579", "0.6779997", "0.6741601", "0.67035824", "0.66536653", "0.66355187", "0.66276735", "0.6605283", "0.6582031", "0.6578843", "0.6572381", "0.654535...
0.8262608
0
Emit a Message with title and message to all connected presenters
emitToPresenters(title, message) { this.presenterSockets.forEach((presenterS) => { presenterS.emit(title, message); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_sendToPlayers(msg) {\n this._players.forEach((player) => player.emit('message', msg));\n }", "emitToStudents(title, message) {\n this.studentSockets.forEach((studentS, studentId) => {\n // console.log(`Emitting: ${title} to student ${studentId}`)\n studentS.emit(title, message);...
[ "0.6504369", "0.6209834", "0.5978024", "0.5898787", "0.5841252", "0.5726485", "0.5655686", "0.5650691", "0.5650354", "0.55426896", "0.5490164", "0.54845995", "0.5479942", "0.54798794", "0.5477324", "0.5472768", "0.5426971", "0.5425809", "0.5414778", "0.5396081", "0.53921586",...
0.7991663
0
Emit a Message with title and message to all connected students
emitToStudents(title, message) { this.studentSockets.forEach((studentS, studentId) => { // console.log(`Emitting: ${title} to student ${studentId}`) studentS.emit(title, message); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function messageWs(evt) {\n if (evt.data.indexOf(\"Student\") !=-1){\n studentId.push(evt.data.slice(8));\n generatePeerConnection(studentId[countStudent]);\n countStudent = countStudent + 1;\n startCall();\n }\n else {\n processSignalingMessage(evt);\n }\n}", "func...
[ "0.6466807", "0.60385394", "0.60010886", "0.59566814", "0.5926217", "0.5908897", "0.59055454", "0.5883927", "0.5875356", "0.5828682", "0.58226395", "0.5767334", "0.5680707", "0.567492", "0.5662172", "0.5654921", "0.56230223", "0.5610757", "0.5599345", "0.5595913", "0.5582384"...
0.8101812
0
apply smoothness algorithm to data in heatmap
async function applySmoothness(){ await plotData(siteName,"heatmap","RdBu","fast"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeHermiteSmoothedData(gd){var t,s,h1,h2,h3,h4,TiX,TiY,Ti1X,Ti1Y,pX,pY,p,min,max,stretch,scale,shift,smooth=this.renderer.smooth,tension=this.renderer.tension,dim=this.canvas.getWidth(),xp=this._xaxis.series_p2u,yp=this._yaxis.series_p2u,steps=null,a=null,a1=null,a2=null,slope=null,slope2=null,temp=nu...
[ "0.69054174", "0.65850407", "0.6365913", "0.634235", "0.6263727", "0.6011018", "0.5853906", "0.5823942", "0.5806516", "0.5792018", "0.5720063", "0.57187384", "0.57116026", "0.56805915", "0.5591552", "0.5575031", "0.5570648", "0.5520877", "0.5499148", "0.54987603", "0.5498591"...
0.72077554
0
Helper function that calculates a tax for a given bracket
function taxBracket(income, bracket, percentage, addOn) { var taxOnExcess = (income - bracket) * percentage; return taxOnExcess + addOn }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tax() {\n var GST = 0.05;\n return this.subtotal() * GST;\n }", "function calTax(){\r\n return calSubTotal()*taxRate;\r\n}", "function tax(salary, rate, constant){\n return ((salary * rate) + constant).toFixed(2);\n}", "get tax() {\n return 0.09 * this.subtotal;\n }", "function calcTax...
[ "0.73746693", "0.7193076", "0.7045687", "0.6971833", "0.6920676", "0.6864538", "0.6858873", "0.6850036", "0.68204325", "0.68168885", "0.6766462", "0.66748184", "0.66699535", "0.661626", "0.6493765", "0.6483501", "0.64533436", "0.6424328", "0.6415648", "0.63876086", "0.6311865...
0.7971955
0
================== RFID PROMISE ==================// // Promise: Check for correct agent RFID
function rfid_promise(agentTag, recencyInMS) { var resolveFunc; var errFunc; p = new Promise(function (resolve, reject) { resolveFunc = resolve; errFunc = reject; }).then(function (resolveval) { FLAGS.RFIDGeneratorCreated = 0; if (CANVAS.headsupfraction > 0) { //button on headsupdisplay to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rfid_promise(agentTag,recencyInMS){\n\tvar resolveFunc\n\tvar errFunc\n\tp = new Promise(function(resolve,reject){\n\t\tresolveFunc = resolve;\n\t\terrFunc = reject;\n\t}).then(function(resolveval){\n\t\tFLAGS.RFIDGeneratorCreated = 0\n\t\tif (CANVAS.headsupfraction > 0){ //button on headsupdisplay to pre...
[ "0.6168695", "0.5932586", "0.54327863", "0.53061306", "0.51567805", "0.51231396", "0.5088962", "0.50299126", "0.5017913", "0.49769557", "0.49652958", "0.4944841", "0.49300027", "0.49182025", "0.4890516", "0.48858294", "0.48767704", "0.4856639", "0.48515028", "0.48461923", "0....
0.6341081
0
A Pos instance represents a position within the text.
function Pos (line, ch) { if (!(this instanceof Pos)) { return new Pos(line, ch) } this.line = line; this.ch = ch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pos(x,y) {\r\n this.x = x;\r\n this.y = y;\r\n}", "function Pos(line, ch, sticky) {\n\t if ( sticky === void 0 ) sticky = null;\n\n\t if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n\t this.line = line\n\t this.ch = ch\n\t this.sticky = sticky\n\t}", "function Pos(line, ch, st...
[ "0.7352504", "0.72539306", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.72398067", "0.7235338", "0.72166526", "0.72166526", "0.7213136", ...
0.7744325
0
Selection objects are immutable. A new one is created every time the selection changes. A selection is one or more nonoverlapping (and nontouching) ranges, sorted, and an integer that indicates which one is the primary selection (the one that's scrolled into view, that getCursor returns, etc).
function Selection(ranges, primIndex) { this.ranges = ranges this.primIndex = primIndex }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Selection(ranges,primIndex){this.ranges=ranges;this.primIndex=primIndex;}", "function SelectionRange(selection) {\n this.anchorNode = selection && selection.anchorNode || null;\n this.anchorOffset = selection && selection.anchorOffset || 0;\n this.focusNode = selection && selection.focusNode || ...
[ "0.7262549", "0.726153", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7078656", "0.7023075", "0.6814319", "0.67374134", "0.66961986", "0.6647635", "0.6641964", "0.6592584", ...
0.73115456
0
Create a history change event from an updateDocstyle change object.
function historyChangeFromChange(doc, change) { var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)} attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1) linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, chan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histCh...
[ "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.6925201", "0.69209933", "0.69100183", "0.69100183", "0.69100183", "0.69100183", "0.69100183", "0.6910018...
0.69333
1
SHARED TEXTMARKERS A shared marker spans multiple linked documents. It is implemented as a metamarkerobject controlling multiple normal markers.
function SharedTextMarker(markers, primary) { var this$1 = this; this.markers = markers this.primary = primary for (var i = 0; i < markers.length; ++i) { markers[i].parent = this$1 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _markText(doc,from,to,options,type){ // Shared markers (across linked documents) are handled separately\n// (markTextShared will call out to this again, once per\n// document).\nif(options&&options.shared)return markTextShared(doc,from,to,options,type); // Ensure we are in an operation.\nif(doc.cm&&!doc.c...
[ "0.5998054", "0.5599989", "0.55204463", "0.5517476", "0.54879534", "0.54879534", "0.54879534", "0.54573756", "0.54573756", "0.543867", "0.5401711", "0.539508", "0.53919524", "0.53919524", "0.53919524", "0.53919524", "0.53919524", "0.53919524", "0.53919524", "0.53919524", "0.5...
0.7626295
0
When the user changes the markdown in the editor.
function onChangeHandler() { const value = editor.codemirror.getValue(); unsavedChanges.setHasChanges(value !== settings.getDefaultValue("documentContent")); // Render the Markdown to the viewer. viewer.render(value, function() { // Sync to the linked scrollbars to match the new content. scrollSync....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateMarkdown(markdown) {\n this.onChange(markdown);\n }", "function Preview(article) {\n // set the textarea\n if (Editor) Editor.save();\n article.Markdown($('#codemirror_editor').val());\n\n // check if changed\n if (!MarkdownDidChange) return;\n MarkdownDidChange = false;\n ...
[ "0.80800027", "0.68050987", "0.677017", "0.6632537", "0.6555699", "0.6523524", "0.6494712", "0.642554", "0.64105797", "0.63266057", "0.6300224", "0.6272506", "0.62702686", "0.62702686", "0.61675596", "0.60787046", "0.6077384", "0.605826", "0.60252345", "0.6011973", "0.5990404...
0.7755458
1
Load the user's preferences and apply them to the codemirror config.
function loadUserSettings() { const indentSize = settingsHelper.getSetting("editorIndentSize"); if (indentSize) { codemirrorConfig.indentUnit = indentSize; codemirrorConfig.tabSize = indentSize; } const theme = settingsHelper.getSetting("editorTheme"); if (theme) { codemirrorConfig.theme = th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPrefs(event) {\n var newPrefs = {};\n\n definitonKeys.forEach(function (id) {\n var isEnabled = definitionCheckboxes[id].prop(\"checked\");\n\n if (!definitionPrefs[id]) {\n // definition has no custom prefs\n newPrefs[id] = isEnabled;\n...
[ "0.6971482", "0.61630106", "0.60925263", "0.60796475", "0.6019416", "0.5982623", "0.5888098", "0.5876522", "0.58008313", "0.5737987", "0.56997097", "0.5698266", "0.5682608", "0.56463623", "0.56061107", "0.555299", "0.55447495", "0.55035645", "0.5487655", "0.547903", "0.545705...
0.7260231
0
Save the current markdown document to the user's computer
fileSave() { if (codemirror) { const content = codemirror.getValue(); const title = documentTitle.getTitle(); const type = ".md"; fileExport.saveFile(content, title, type); unsavedChanges.setHasChanges(false); settings.setSetting("documentTitle", settings.getDefaultValue("docume...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save() {\n if (!ide) return;\n\n var code = ide.getValue();\n var blob = new Blob([code], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, docName + \".\" + doc.ext);\n }", "function save () {\n\n\t\tif (filepath !== null) {\n\n\t\t\tvar data = editor.getContent();\n\...
[ "0.7209846", "0.700615", "0.6841442", "0.67763376", "0.6705777", "0.66679734", "0.6565688", "0.6525441", "0.65168196", "0.65026367", "0.6465173", "0.64633", "0.6419577", "0.64119214", "0.63991517", "0.6364271", "0.63375765", "0.63186103", "0.6314986", "0.630872", "0.63065445"...
0.7625994
0
Convert the current markdown to HTML and export it to the user's local drive
fileExportHtml() { if (codemirror) { const content = exportHtml(codemirror.getValue()); const title = documentTitle.getTitle(); const type = ".html"; fileExport.saveFile(content, title, type); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function md2Html(mdFile, tempFile,targetFile){\n console.log('Start to convert: ' + mdFile);\n var data = fs.readFileSync(mdFile,'utf-8');\n var html = markdown.toHTML(data);\n console.log('Convert ' + mdFile + ' complete!');\n makePage(html,tempFile,targetFile);\n}", "function mkdown(){\n var ...
[ "0.71174014", "0.70654345", "0.68913156", "0.6852826", "0.6838322", "0.68013644", "0.6600112", "0.65819114", "0.65634924", "0.64595765", "0.633353", "0.6333353", "0.6323407", "0.63184875", "0.62920284", "0.6220112", "0.621268", "0.6178324", "0.6166088", "0.613963", "0.6129355...
0.72190964
0
Set the focus on the input box for renaming the document
fileRename() { documentTitle.focus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameFocus () {\n document.getElementById('name').focus();\n}", "function nameFocus() {\n document.getElementById('name').focus();\n}", "function focus() {\r\n\t\t$input.focus();\r\n\t}", "function set_input_field_focus()\n{\n\tinobj.focus();\n}", "function focusOnInput() {\n document.getEleme...
[ "0.7246292", "0.722812", "0.7148874", "0.71331716", "0.71048415", "0.689146", "0.689146", "0.68633777", "0.68544245", "0.68029004", "0.6762131", "0.6762131", "0.6762131", "0.6762131", "0.672066", "0.6639181", "0.66327953", "0.6621903", "0.6618333", "0.6608223", "0.66054094", ...
0.7682527
0
Insert the syntax for a link in the editor and move the cursor inside the brackets for the url
insertLink() { textInserter.insertText(codemirror, "[]()", 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "link() {\n this.insertAroundCursor('[', '](https://)')\n }", "function editLink() {\n\t\tvar href = $('[name=href]', editor.legend);\n\t\tvar path = getNodePath(editor.node);\n\t\tvar text = prompt('Edit link of [' + path + ']:', href.length ? href.html() : 'http://');\n\t\tif (text) {\n\t\t\thref.html(text)...
[ "0.7602248", "0.68040085", "0.65960455", "0.64759845", "0.644169", "0.64385504", "0.63477814", "0.6322877", "0.6250314", "0.6176966", "0.61290234", "0.6122961", "0.5971038", "0.59703267", "0.5954204", "0.59103394", "0.5898414", "0.58524776", "0.58317494", "0.58258754", "0.578...
0.77576613
0
Insert the syntax for an image in the editor and move the cursor inside the brackets for the url
insertImage() { textInserter.insertText(codemirror, "![]()", 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawImage(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.image);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.image, options....
[ "0.6583009", "0.650549", "0.64323616", "0.6352885", "0.6347266", "0.60344076", "0.60046035", "0.5985291", "0.5969487", "0.5943833", "0.5888982", "0.58147186", "0.5751493", "0.5711085", "0.5711085", "0.5678442", "0.5642582", "0.5629175", "0.5608111", "0.5604922", "0.55891275",...
0.7955514
0
Insert the syntax for a math euqation in the editor and move the cursor between the dollarsigns.
insertEquation() { textInserter.insertText(codemirror, "$$$$", 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEquation() {\n\n //Focus on editor, insert line\n document.getElementById('editor').focus();\n var tag = document.getElementById('editor');\n\n //Create new math block element\n const mathBlock = new MathfieldElement();\n\n //Set initial value and options. Chan...
[ "0.6897484", "0.66125345", "0.6255335", "0.59712464", "0.5775136", "0.5607527", "0.55607134", "0.5457773", "0.5442922", "0.5378453", "0.5359817", "0.53385633", "0.5337988", "0.53191876", "0.52563536", "0.5244134", "0.5239097", "0.52235055", "0.52018344", "0.5190693", "0.51779...
0.76999015
0
Insert the syntax for bold text on both sides of the selected text. If no text is selected, insert it anyway and move the cursor into the middle.
formatBold() { textInserter.handleEmphasis(codemirror, "**"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bold() {\n this.insertAroundCursor('**', '**')\n }", "function hwEditorBold(){\n console.log(\"bolding\");\n // References\n let hwEditor = document.getElementById(\"hw_editor_content_editor\");\n let hwEditorSelectedSpanText = currentSelectedText.parent.innerHTML;\n\n let tempHtml = ``;\n\n ...
[ "0.77988625", "0.7223087", "0.6866442", "0.64028096", "0.6320619", "0.6292351", "0.6233928", "0.61997914", "0.6188962", "0.6172002", "0.616536", "0.61052155", "0.6096044", "0.6065962", "0.6047077", "0.6028608", "0.6024507", "0.60216945", "0.5955976", "0.59421706", "0.59421706...
0.7287298
1
Insert the syntax for italic text on both sides of the selected text. If no text is selected, insert it anyway and move the cursor into the middle.
formatItalic() { textInserter.handleEmphasis(codemirror, "*"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "italic() {\n this.insertAroundCursor('*', '*')\n }", "function toggleItalic() {\n document.execCommand(\"italic\", false, null);\n\n cur_contentdiv.focus(); // return focus back to editing field\n }", "function insertText(target,text,off){\n var pos=target.selectionStart;\n ...
[ "0.7432642", "0.64859617", "0.62843424", "0.6237729", "0.6196574", "0.6178552", "0.6170068", "0.61299396", "0.60982424", "0.60686356", "0.6053756", "0.60319096", "0.5969859", "0.59589344", "0.5933163", "0.59305906", "0.59290636", "0.5908226", "0.5894429", "0.5894429", "0.5894...
0.7071596
1
Insert the syntax for strikethrough text on both sides of the selected text. If no text is selected, insert it anyway and move the cursor into the middle.
formatStrikethrough() { textInserter.handleEmphasis(codemirror, "~~"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "strikethrough() {\n this.insertAroundCursor('~~', '~~')\n }", "function strikeThrough() {\r\n if ($(this).parent().css('textDecoration') == 'line-through') {\r\n $(this).parent().css('textDecoration', 'none');\r\n } else {\r\n $(this).parent().css('textDecoration', 'line-through');\r\n }\r...
[ "0.78517866", "0.65762764", "0.63998824", "0.63688904", "0.6331858", "0.6271114", "0.6260975", "0.62492037", "0.6234954", "0.6122976", "0.6051924", "0.60252947", "0.6023303", "0.59365165", "0.593193", "0.5920023", "0.5890611", "0.58677584", "0.5695438", "0.56663775", "0.56609...
0.7549399
1
Mirror the text of the visble input to the hidden input. This is used to resize the input width dynamically.
function mirrorWidth($input, $mirror) { $mirror.text($input.val()); let width = parseInt($mirror.css("width")); if (!isNaN(width)) { width += extraWidth; width = Math.min(maxWidth, width); $input.css("width", width + "px"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mirrorInputs(e) {\n // Mirror the number entered in the input\n const inputMirror = document.querySelector(\"#gridSizeMirror\");\n // Don't allow any numbers in the hundreds\n if (e.target.value.length > 2) {\n e.target.value = e.target.value.slice(0, 2);\n }\n // Mirror the enabled input\n inpu...
[ "0.59827936", "0.5944357", "0.59379196", "0.5774001", "0.5595462", "0.5506255", "0.54978675", "0.5468324", "0.5366015", "0.5320673", "0.52884233", "0.5274254", "0.52655673", "0.5220901", "0.5196289", "0.5166975", "0.51493293", "0.5146916", "0.5112343", "0.51012576", "0.509007...
0.6151485
0
Handle some exception or error message. Will print the console to the console, if debug mode is enabled. The error will also be logged to the server.
function handle(exception) { // Todo: Send to server. if (debug) { console.error("Error handler cought an exception:", exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleError(msg) {\n console.error(msg);\n logger.info(msg);\n }", "static errorHandling(message) {\n console.log(`Error Handeling Called\\n${message}`);\n }", "function errorHandling(error) {\n console.info(error)\n }", "function handleError(err) {\n console.log(\"ERROR: \", e...
[ "0.6944994", "0.6530482", "0.6435293", "0.6397071", "0.6343804", "0.63050044", "0.629851", "0.6288777", "0.6275888", "0.62604964", "0.62281036", "0.62260425", "0.6204038", "0.61849487", "0.617273", "0.61672336", "0.61589205", "0.61526537", "0.6101081", "0.60722065", "0.607107...
0.722346
0
Set up a gloval error listener, capturing all erros on the page.
function setUpListener() { window.addEventListener("error", function(e) { handle(e.error.toString()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledreject...
[ "0.62466073", "0.62466073", "0.6227217", "0.6227217", "0.6105001", "0.60298145", "0.59524417", "0.58834815", "0.5827199", "0.58171684", "0.58112806", "0.58068323", "0.57852656", "0.576935", "0.5762487", "0.5761837", "0.5716779", "0.5703436", "0.5698339", "0.5671715", "0.56678...
0.69983447
0
Convert some data to a file and save it to the user's local drive with the speficied filename and extension.
function saveFile(data, filename, extension) { const file = new Blob([data]); if (window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(file, filename + extension); } else { const url = URL.createObjectURL(file); const a = document.createElement("a"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeToFile(filename, data) {}", "function writeTofile(fileName, data) {}", "function saveAs (data,filename,dataType) {\n if (!(data instanceof Array)) { data = [data]; }\n var file = new Blob(data, {type: dataType});\n var objectURL = URL.createObjectURL(file);\n\n var link = document.createEleme...
[ "0.66741395", "0.6603868", "0.65856266", "0.6551376", "0.6551376", "0.6551376", "0.6551376", "0.6551376", "0.6551376", "0.6551376", "0.6551376", "0.65437305", "0.64978737", "0.6440768", "0.64278316", "0.64278316", "0.640215", "0.63576883", "0.63576883", "0.63576883", "0.63576...
0.6737624
0
Test if potential opening or closing delimieter Assumes that there is a "$" at state.src[pos]
function isValidDelim(state, pos) { var prevChar, nextChar, max = state.posMax, can_open = true, can_close = true; prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1; nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1; // Check non-whitespace conditions for opening and closi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidDelim(state, pos) {\n var prevChar, nextChar,\n max = state.posMax,\n can_open = true,\n can_close = true;\n\n prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;\n nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;\n\n // Check non-whitespace cond...
[ "0.58320725", "0.58320725", "0.58320725", "0.5742789", "0.5742789", "0.5742789", "0.56443465", "0.55977154", "0.55915606", "0.55915606", "0.55915606", "0.5565012", "0.55571485", "0.5522996", "0.5441218", "0.5399578", "0.53423774", "0.5224415", "0.51945555", "0.51917464", "0.5...
0.603722
0
Populate the modal's input fields with the users editor settings.
function loadEditorSettings() { $("#settings-editor-font-family").val(settingsHelper.getSetting("editorFontFamily")); $("#settings-editor-font-size").val(settingsHelper.getSetting("editorFontSize")); $("#settings-editor-indent-size").val(settingsHelper.getSetting("editorIndentSize")); $("#settings-editor-us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadEditorValues() {\n\t\t\t$('#' + messageAndUIBinder.parentContainerID).find('[isEditor=\"true\"]').each(function() {\n\t\t\t\tvar editor = $(this);\n\t\t\t\tvar editorFragment = $(this).find(\"[uiRole='editor']\")[0];\n\n\t\t\t\tif (editorFragment) {\n\t\t\t\t\tvar editorType = editor.attr(\"editorType...
[ "0.66977537", "0.65560496", "0.6331372", "0.6246824", "0.6204787", "0.61965644", "0.60449475", "0.6023253", "0.5955652", "0.59516037", "0.58985704", "0.58931005", "0.58726376", "0.5839564", "0.58376473", "0.5820068", "0.5818657", "0.58157396", "0.57766896", "0.57749367", "0.5...
0.680151
0
Populate the modal's input fields with the users viewer settings.
function loadViewerSettings() { $("#settings-viewer-theme").val(settingsHelper.getSetting("viewerTheme")); $("#settings-viewer-font-family").val(settingsHelper.getSetting("viewerFontFamily")); $("#settings-viewer-font-size").val(settingsHelper.getSetting("viewerFontSize")); $("#settings-viewer-hljs-theme")....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setModalInfo() {\n if (firstLoad) {\n $(\"#eventDetailsForm\").trigger(\"reset\");\n\n const $eventDate = $(\"#eventDate\");\n datepicker();\n $eventDate.data('daterangepicker').setStartDate(new Date($.now()));\n $eventDate.data('daterangepicker').setEndDate(new Date(...
[ "0.6179239", "0.605458", "0.5985686", "0.5918376", "0.5871399", "0.5871331", "0.5792421", "0.5759083", "0.57190204", "0.5714805", "0.5703725", "0.5691859", "0.56812185", "0.56688213", "0.56678265", "0.5662493", "0.56399184", "0.5587928", "0.5584087", "0.55788094", "0.5557557"...
0.69648564
0
Save the values of the input fields for the user's general settings.
function saveGeneralSettings() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveUserOptions() {\n\tchrome.storage.local.set({\n\t\tfixedOrPercentage: $(\"input[name='fixedOrPercentage']:checked\").val(),\n\t\tfixedNumberOfExercises: $(\"#wertiview-fixed-number-of-exercises-value\").val(),\n\t\tproportionOfExercises: $(\"#wertiview-proportion-of-exercises-value\").val(),\n\t\tchoi...
[ "0.7106915", "0.6880772", "0.66795564", "0.6673666", "0.66061723", "0.6595735", "0.6521356", "0.65161145", "0.6514509", "0.65136975", "0.6510075", "0.6496896", "0.6444768", "0.6381601", "0.6366569", "0.63471526", "0.6344752", "0.63311017", "0.63275844", "0.63149256", "0.62755...
0.71654826
0
Save the values of the input fields for the user's editor settings.
function saveEditorSettings() { settingsHelper.setSetting("editorFontFamily", $("#settings-editor-font-family").val()); settingsHelper.setSetting("editorFontSize", parseInt($("#settings-editor-font-size").val(), 10)); settingsHelper.setSetting("editorIndentSize", parseInt($("#settings-editor-indent-size").val(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveOptions() {\n // If the value is unchanged from the default, delete the preference from localStorage; this gives us\n // the freedom to change the defaults in the future.\n for (var i = 0; i < editableFields.length; i++) {\n var fieldName = editableFields[i];\n var field = $(fieldName);\n\n ...
[ "0.72790396", "0.7086986", "0.6919961", "0.6914944", "0.6914563", "0.68105507", "0.67050713", "0.6702427", "0.66893107", "0.66077965", "0.65749586", "0.65107435", "0.65001404", "0.6454577", "0.6443303", "0.6431596", "0.64107114", "0.64013726", "0.6389883", "0.63649344", "0.63...
0.78850466
0
Save the values of the input fields for the user's viewer settings.
function saveViewerSettings() { settingsHelper.setSetting("viewerTheme", $("#settings-viewer-theme").val()); settingsHelper.setSetting("viewerFontFamily", $("#settings-viewer-font-family").val()); settingsHelper.setSetting("viewerFontSize", parseInt($("#settings-viewer-font-size").val(), 10)); settingsHelpe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveUserOptions() {\n\tchrome.storage.local.set({\n\t\tfixedOrPercentage: $(\"input[name='fixedOrPercentage']:checked\").val(),\n\t\tfixedNumberOfExercises: $(\"#wertiview-fixed-number-of-exercises-value\").val(),\n\t\tproportionOfExercises: $(\"#wertiview-proportion-of-exercises-value\").val(),\n\t\tchoi...
[ "0.6956518", "0.6736635", "0.672478", "0.67155623", "0.65503573", "0.6546733", "0.64135426", "0.63699245", "0.6358384", "0.6345648", "0.63444716", "0.63189936", "0.63022804", "0.62542087", "0.6248741", "0.62257963", "0.62227494", "0.62186795", "0.62039495", "0.6203241", "0.61...
0.78080475
0
Save all the user's settings.
function saveSettings() { saveGeneralSettings(); saveEditorSettings(); saveViewerSettings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveUserSettings(settings){\n store.storage.setValue(\"user-settings\",JSON.stringify(settings));\n}", "function saveUserPreferences() {\n let settingsData = JSON.stringify(userPreferences, null, 2);\n\n fs.writeFile(\"settings.json\", settingsData, (err) => {\n if (err) console.log(err);\n i...
[ "0.759549", "0.75627625", "0.7473447", "0.7389322", "0.7330248", "0.7243741", "0.71632063", "0.71473944", "0.7107022", "0.7101965", "0.7099358", "0.70318955", "0.69984055", "0.6929976", "0.69270015", "0.6917421", "0.68964225", "0.6879125", "0.68605113", "0.681377", "0.6786017...
0.77860695
0
Close all open dropdowns from the navbar.
function closeDropdowns() { $(".navbar-dropdown .dropdown-content").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeAll() {\n // Find all the dropdown toggles and convert them to an array\n var allDropdownToggles =\n Array.prototype.slice.call(\n document.querySelectorAll('[' + TOGGLE_ATTR + ']')\n );\n\n // Find all the dropdown menus and convert them to an array\n var allDropdownMenu...
[ "0.80110663", "0.7992483", "0.7651027", "0.7507901", "0.72337705", "0.7150884", "0.7145151", "0.7135177", "0.7040314", "0.6949945", "0.6781547", "0.67629427", "0.6759647", "0.6734234", "0.6691343", "0.6672651", "0.66662467", "0.6651933", "0.66467184", "0.6646065", "0.6629752"...
0.8577562
0
Set the icon of "Display Editor" and "Display Preview" navbar items.
function setNavbarIconVisibility() { navbar.setVisibilityIcon("view-editor", editorPanePercentage !== 0); navbar.setVisibilityIcon("view-preview", viewerPanePercentage !== 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_editModeChanged(newValue) {\n if (newValue) {\n this.__editIcon = \"icons:check\";\n } else {\n this.__editIcon = \"icons:create\";\n }\n }", "function initEditorIcons() {\n // ------------------------------------------------------------------------\n // Locate each element that has a ...
[ "0.64001685", "0.63516784", "0.63382214", "0.6251146", "0.61594146", "0.61545473", "0.61342", "0.6112515", "0.60584503", "0.6045397", "0.597632", "0.59606403", "0.5958484", "0.59250295", "0.5922382", "0.5888752", "0.58765614", "0.5863497", "0.5859067", "0.58545345", "0.582770...
0.72759724
0
Resize the two panes to percentage sizes.
function resizePanesToPercentage(newEditorPanePercentage, newViewerPanePercentage) { // Make sure the percentages add up to 100% total. if (Math.abs(newEditorPanePercentage + newViewerPanePercentage - 100) > 0.1) { console.warn("Error resizing panes, percentages don't add up. Resetting to 50% split."); ed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPaneDimensions() {\n pane_width = element.width();\n panes.each(function() {\n $(this).width(pane_width);\n });\n container.width(pane_width*pane_count);\n }", "function updatePaneSize(){\n var $listPane ...
[ "0.62249815", "0.6014823", "0.5885266", "0.5882417", "0.5815901", "0.5802542", "0.57579803", "0.5744563", "0.57392347", "0.5729183", "0.5727124", "0.5723801", "0.5702273", "0.57003313", "0.5697056", "0.56921697", "0.56393665", "0.5634649", "0.56204325", "0.56101906", "0.56057...
0.7189709
0
Set the positions, specifically the horizontal positions, of the two collapse buttons. This is done so they won't overlap with the scrollbars.
function setCollapseButtonPositions() { if ($editorPane.width() === 0) { $viewerCollapseButton.show(); } else { $viewerCollapseButton.hide(); } if ($viewerPane.width() === 0) { $editorCollapseButton.show(); } else { $editorCollapseButton.hide(); } const leftPaneHasScrollbar = $edito...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collapse() {\n if (this.isCollapsed) {\n return;\n }\n if (this.orientation == \"vertical\") {\n this.parentNode.style.setProperty(`--${this.id}-height`, \"0\");\n } else {\n this.parentNode.style.setProperty(`--${this.id}-width`, \"0\");\n }\n this._adjacent.styl...
[ "0.5717491", "0.56431675", "0.5606356", "0.55734676", "0.546336", "0.54620606", "0.5449373", "0.54302555", "0.54058295", "0.533991", "0.5333621", "0.5328045", "0.532276", "0.5314941", "0.53145534", "0.5291016", "0.52819264", "0.5258731", "0.51750034", "0.51726305", "0.5156911...
0.78930366
0
Toggle the visibility of the editor pane
function toggleEditor() { if (editorPanePercentage === 0) { if ($paneContainer.width() >= minPaneWidth * 2) { editorPanePercentage = oldEditorPanePercentage; viewerPanePercentage = oldViewerPanePercentage; } else { editorPanePercentage = 100; viewerPanePercentage = 0; } } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle () {\n\t\tif (this.view) {\n\t\t\tatom.workspace.toggle(this.view)\n\t\t} else {\n\t\t\tthis.show()\n\t\t}\n\t}", "showHideEditor() {\n\t\t//Editor is showing, have button\n\t\tif(this.state.status) {\n\t\t\tthis.setState({status:false});\n\t\t} else {\n\t\t\tthis.setState({status:true});\n\t\t}\n\t}", ...
[ "0.74684227", "0.73777133", "0.73777133", "0.732406", "0.7321073", "0.7155646", "0.7129092", "0.7116914", "0.7100202", "0.7054624", "0.702038", "0.70159256", "0.7007799", "0.69712454", "0.6927046", "0.6879208", "0.6836215", "0.68296516", "0.6823864", "0.6805751", "0.67425865"...
0.78464776
0
Toggle the visibility of the viewer pane
function toggleViewer() { if (viewerPanePercentage === 0) { if ($paneContainer.width() >= minPaneWidth * 2) { editorPanePercentage = oldEditorPanePercentage; viewerPanePercentage = oldViewerPanePercentage; } else { editorPanePercentage = 0; viewerPanePercentage = 100; } } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle () {\n\t\tif (this.view) {\n\t\t\tatom.workspace.toggle(this.view)\n\t\t} else {\n\t\t\tthis.show()\n\t\t}\n\t}", "function toggleVisible()\n {\n if (thisApp.updVis) getNotes();\n thisApp.updVis = !thisApp.updVis;\n }", "toggleVisibility() {\n if (this.__isShown == true) {\n ...
[ "0.76774055", "0.74603593", "0.7402601", "0.7216879", "0.71605426", "0.71383953", "0.71186286", "0.70383275", "0.69380224", "0.688253", "0.6856584", "0.6847148", "0.6845245", "0.6830138", "0.6819873", "0.68032515", "0.6757929", "0.6754898", "0.67409587", "0.67163485", "0.6695...
0.781842
0
Get the setting with the specified key. If the setting is null, use the default value.
function getSetting(key) { let setting; try { setting = JSON.parse(localStorage.getItem(prefix+key)); } catch (exception) { // Ignored } if (!setting || setting == "") { setting = getDefaultValue(key); setSetting(key, setting); } return setting; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSetting(key) {\n if (typeof this.settings[key] !== 'undefined') {\n return this.settings[key];\n } else if (typeof DefaultSettings[key] !== 'undefined') {\n return DefaultSettings[key];\n } else {\n return null;\n }\n }", "get(key) {\n\t\tif (!th...
[ "0.7710249", "0.70868754", "0.70736486", "0.6657992", "0.65644556", "0.6479642", "0.644382", "0.6413341", "0.63819325", "0.6292559", "0.6261819", "0.6212899", "0.6190696", "0.6105906", "0.6105906", "0.6105906", "0.6085296", "0.60815346", "0.6055297", "0.6002748", "0.59192085"...
0.710476
1
Set the setting with the specified key to the specified value.
function setSetting(key, value) { if (!value) { value = getDefaultValue(key); } try { localStorage.setItem(prefix+key, JSON.stringify(value)); } catch (exception) { console.error(`Error saving setting.\nKey: ${key}\nValue: ${value}\n`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setSetting(key, value) {\n this.settings[key] = value;\n\n fs.writeFileSync(this.settingsPath, JSON.stringify(this.settings));\n }", "static async set(key, value) {\n debug(`Setting (${key}) = (${value})`);\n const row = (await this.findOrBuild({ where: { key: key } }))[0];\n row.value ...
[ "0.7156915", "0.7136806", "0.7020995", "0.7002444", "0.6886121", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.68849474", "0.679592", "0.67620605", "0.6630445", "0.6598517", "0.6596946", "0.658...
0.75502765
0
Get the default value of the setting with the specified key.
function getDefaultValue(key) { if (key in defaultValues) { return defaultValues[key]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSetting(key) {\n if (typeof this.settings[key] !== 'undefined') {\n return this.settings[key];\n } else if (typeof DefaultSettings[key] !== 'undefined') {\n return DefaultSettings[key];\n } else {\n return null;\n }\n }", "getDefault(key) {\n ...
[ "0.71102726", "0.6936888", "0.6677381", "0.6539541", "0.6519256", "0.6519256", "0.6519256", "0.6519256", "0.6519256", "0.6519256", "0.6519256", "0.6519256", "0.6519256", "0.6500834", "0.64951074", "0.6427583", "0.63539803", "0.63539803", "0.63539803", "0.63539803", "0.6353980...
0.7660142
0
Reset all the settings to their default values.
function reset() { for (let key in defaultValues) { setSetting(key, getDefaultValue(key)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetAll () {\n for (var key in Config.defaults) {\n if (Config.defaults.hasOwnProperty(key))\n reset(key);\n }\n }", "reset() {\n this.loadConfig(this.DEFAULTS);\n this.setFields();\n this.app.message('Settings reset');...
[ "0.8366211", "0.81421673", "0.7844894", "0.7761653", "0.7756734", "0.73175", "0.72268665", "0.7178346", "0.7159994", "0.71550405", "0.7152716", "0.7065315", "0.70043904", "0.69695306", "0.6931552", "0.6883832", "0.68338454", "0.6830763", "0.6797957", "0.67688376", "0.67577374...
0.8758148
0
Handler function for all keypress events the user makes. Will convert the keycombination to a string and compare it to existing shortcut bindings. If the binding is found, call the appropriate function.
function handleKeypress(event) { const keys = [event.key.toLowerCase()]; if (event.shiftKey) { keys.push("shift"); } if ((event.ctrlKey || event.metaKey)) { keys.push("ctrl"); } if (event.altKey) { keys.push("alt"); } for (let key in bindings) { if (keysEqual(key.split("+"), keys...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleKeypress(event) {\n\t\tconst keys = [event.key.toLowerCase()];\n\t\tif (event.shiftKey) {\n\t\t\tkeys.push(\"shift\");\n\t\t}\n\t\tif ((event.ctrlKey || event.metaKey)) {\n\t\t\tkeys.push(\"ctrl\");\n\t\t}\n\t\tif (event.altKey) {\n\t\t\tkeys.push(\"alt\");\n\t\t}\n\t\tfor (let key in bindings) {\n\...
[ "0.7024121", "0.6881553", "0.6754406", "0.64095587", "0.6372753", "0.6357533", "0.6338559", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.6312459", "0.63095695", ...
0.69826835
1
Add a keyboard binding to the list. Shortcut is a string formatted like this: "ctrl+shift+v" Callback is the function to call when the shortcut is pressed.
function addBinding(shortcut, callback) { bindings[shortcut.toLowerCase()] = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addBinding(shortcut, callback) {\n\t\tbindings[shortcut.toLowerCase()] = callback;\n\t}", "bind(shortcut) {\n\n const action = global.display.grab_accelerator(shortcut, Meta.KeyBindingFlags.NONE);\n\n if (action == Meta.KeyBindingAction.NONE) {\n utils.debug('Unable to grab shortcut ' + short...
[ "0.7061047", "0.70074815", "0.6980492", "0.6482814", "0.63888747", "0.6150494", "0.60086584", "0.595039", "0.5950351", "0.5772685", "0.57720196", "0.5729104", "0.5688309", "0.56596076", "0.5636857", "0.55708957", "0.5549407", "0.5548297", "0.553815", "0.54702723", "0.5452026"...
0.7099194
0
Add an array of bindings to the list.
function addBindings(newBindings) { for (let binding in newBindings) { bindings[binding.toLowerCase()] = newBindings[binding]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "appendBinding(binding) { this.bindings.add(binding); }", "function addBindings(newBindings) {\n\t\tfor (let binding in newBindings) {\n\t\t\tbindings[binding.toLowerCase()] = newBindings[binding];\n\t\t}\n\t}", "appendBinding(binding) {\n this.bindings.add(binding);\n }", "function bindEventListene...
[ "0.65747076", "0.62451184", "0.6237754", "0.61579067", "0.5485719", "0.5456978", "0.54518557", "0.54223347", "0.54061615", "0.54061604", "0.5298703", "0.52564096", "0.52460796", "0.5239613", "0.5211028", "0.5154676", "0.514906", "0.5127836", "0.5056661", "0.49960622", "0.4989...
0.62668204
1
Check if two arrays of keys are equal.
function keysEqual(keys1, keys2) { if (!keys1 || !keys2) { return false; } if (keys1.length !== keys2.length) { return false; } keys1.sort(); keys2.sort(); for (let i = 0; i < keys1.length; i++) { if (keys1[i] instanceof Array && keys2[i] instanceof Array) { if (!keys1[i].equals(ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keysEqual(keys1, keys2) {\n\t\tif (!keys1 || !keys2) {\n\t\t\treturn false;\n\t\t}\n\t\tif (keys1.length !== keys2.length) {\n\t\t\treturn false;\n\t\t}\n\t\tkeys1.sort();\n\t\tkeys2.sort();\n\t\tfor (let i = 0; i < keys1.length; i++) {\n\t\t\tif (keys1[i] instanceof Array && keys2[i] instanceof Array) {\...
[ "0.79108834", "0.74255943", "0.7411831", "0.73855877", "0.73853284", "0.7341953", "0.7317242", "0.7317242", "0.7317242", "0.7317242", "0.7317242", "0.7317242", "0.7315681", "0.73072594", "0.73056716", "0.7299864", "0.72867954", "0.72818965", "0.72818965", "0.72818965", "0.728...
0.7905456
1
Add some emphasis, like bold () or underscore (~~) to the selected text. If no text is selected insert the emphasis affixes and move to cursor between them.
function handleEmphasis(codemirror, emphasisString) { if (codemirror) { if (codemirror.somethingSelected()) { const newString = `${emphasisString}${codemirror.getSelection()}${emphasisString}`; codemirror.replaceSelection(newString); } else { insertText(codemirror, emphasisString + emphasisStr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emphasis(text) {\n return text ? '<strong>' + text + '</strong>' : '';\n }", "formatBold() {\r\n\t\t\t\ttextInserter.handleEmphasis(codemirror, \"**\");\r\n\t\t\t}", "function onEmphasis() {\n text.ignore = text.hoverIgnore;\n }", "function onEmphasis() {\n\t labelLine.ignore = la...
[ "0.7291869", "0.69960016", "0.6972194", "0.6774603", "0.6774603", "0.6774603", "0.67359924", "0.672946", "0.67287344", "0.67287344", "0.67287344", "0.6588996", "0.6371016", "0.6371016", "0.6347656", "0.6347656", "0.6347656", "0.6347656", "0.6338416", "0.6338416", "0.6338416",...
0.7889597
0
Insert some text in the editor at the current cursor position. The cursorOffset is optional and can be used to shift the cursor a number of characters from the right. For example, if cursorOffset is 2 and the inserted text is "Hello", the cursor will end up between the two l's, like "Hel|lo".
function insertText(codemirror, text, cursorOffset) { if (codemirror) { const cursorPosition = codemirror.getCursor(); codemirror.replaceSelection(text); codemirror.setCursor({ line: cursorPosition.line, ch: cursorPosition.ch + text.length - (cursorOffset || 0), }); codemirror.focus(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertTextAtCursor( text ) {\n\t\n\tlet note = easymde.codemirror.getDoc()\n\tlet cursor = note.getCursor()\n\tnote.replaceRange(text, cursor)\n}", "function tinymce_insertAtCaret(val) {\n\ttinymce.activeEditor.execCommand('mceInsertContent', false, val);\n}", "insert_selection(insert_text) {\n // ...
[ "0.7361854", "0.6696141", "0.65681815", "0.62885445", "0.6253268", "0.62090874", "0.6192539", "0.61432445", "0.613567", "0.6124836", "0.6124836", "0.60725844", "0.60650337", "0.6020637", "0.60184866", "0.6013588", "0.60074115", "0.60074115", "0.60074115", "0.60074115", "0.600...
0.8196457
0
Setter method for hasChanges.
function setHasChanges(value) { hasChanges = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHasChanges() {\r\n\t\treturn hasChanges;\r\n\t}", "get changed() {\n return this._changed;\n }", "get changed() {\n return this._changed;\n }", "get changed() {\n return this._changed;\n }", "get hasChangedBy() {\n return this.__hasChangedBy.get();\n ...
[ "0.7697465", "0.65856194", "0.65856194", "0.65856194", "0.6512102", "0.64505357", "0.64505357", "0.6445464", "0.6234311", "0.6174946", "0.6151883", "0.61126286", "0.61032915", "0.60977906", "0.60441566", "0.5972631", "0.5964504", "0.59344614", "0.58835995", "0.58835995", "0.5...
0.84014994
0
Render the specified Markdown and insert the resulting HTML into the viewer.
function render(markdownString, callback) { const result = markdownIt.render(markdownString || ""); viewer.innerHTML = result; if (mathjaxReady) { MathJax.Hub.Queue(["Typeset", MathJax.Hub, viewer]); } $("#viewer pre code").each(function(i, block) { hljs.highlightBlock(block); }); if (callb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderMarkdown(markdown) {\n \n editor.innerHTML += md.render(markdown)\n}", "function renderMarkdown(markdown, options) {\n if (options === void 0) { options = {}; }\n var element = createElement(options);\n var _uriMassage = function (part) {\n var data;\n try {\n d...
[ "0.788163", "0.72844905", "0.72620416", "0.7142669", "0.69874877", "0.6877613", "0.686566", "0.6624997", "0.66176367", "0.66095775", "0.6571733", "0.6533615", "0.64779586", "0.64047265", "0.6401984", "0.6325008", "0.62691295", "0.61278903", "0.6123078", "0.6105564", "0.605452...
0.79066885
0
Guess the current timezone from the MCC/MNC tuple
function getDefaultTimezoneID(callback) { if (!callback) return; // Worst case scenario: default to New York (which is just as good or // bad as anything else -- we used to default to Pago Pago) var tzDefault = 'America/New_York'; // retrieve MCC/MNC: use the current network codes when avail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchTimezone() {\r\n var localclock = new Date(),\r\n // returns negative offset from GMT in minutes\r\n tzRaw = localclock.getTimezoneOffset(),\r\n tzHour = Math.floor(Math.abs(tzRaw) / 60),\r\n tzMin = Math.abs(tzRaw) % 60;\r\n return ((tzRaw >= 0) ? \"-\" : \"\") + ((tzHo...
[ "0.64584297", "0.64243394", "0.62690866", "0.6200749", "0.6112317", "0.6100179", "0.594192", "0.5923329", "0.5900815", "0.58646894", "0.58159673", "0.5735918", "0.57107556", "0.5708885", "0.5695728", "0.56478393", "0.5646411", "0.5625211", "0.5611358", "0.5584152", "0.5557811...
0.66087455
0
Class Responsable for the construction of the tracks in the SVG Panel It will receive the elements from the Web Service and build the images in canvas.
function TrackBuilder() { // The SVG panel that will be used to build the rail this.svgPrincipal = $("#svgPrincipal"); // The segments that was received from the WS this.Elements = {}; // The space that will be used between the shapes this.spacer = mainConfig.size.separator; // Receive a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(){\n super();\n this.attachShadow({mode: \"open\"});\n const template = document.querySelector(\"#packet-visualization\");\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n this._slidingView = this.shadowRoot.querySelector(\"#sliding-view\");\n ...
[ "0.6635433", "0.6348017", "0.6330753", "0.6248375", "0.6147455", "0.6133832", "0.60609853", "0.6011316", "0.6010813", "0.5933726", "0.5901487", "0.5894954", "0.58828884", "0.58824176", "0.5876401", "0.5822843", "0.5811691", "0.57892156", "0.57543415", "0.5742762", "0.5705782"...
0.6770461
0
Returns pdfmake table body
function buildTableBody(data, columns, tableHeader, total = 0) { logger.debug('buildTableBody'); let body = []; if (!tableHeader) { tableHeader = columns; } body.push(tableHeader); data.forEach(row => { let dataRow = []; columns.forEach(column => { const dataRowObject = {}; dataRow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_table_body(get_values) {\n\tlet temp = ``;\n\tfor (let i in get_values) {\n\t\ttemp += `<tr>`;\n\t\tfor (let j of get_values[i]) {\n\t\t\ttemp += `<td>${j}</td>`;\n\t\t}\n\t\ttemp += `</tr>`;\n\t}\n\treturn temp;\n}", "function getTableBody() {\n if (filteredRows.length > 0) {\n return filt...
[ "0.65269595", "0.64703864", "0.6432237", "0.6409899", "0.6351977", "0.6348128", "0.63358366", "0.6248978", "0.6234352", "0.6209068", "0.613643", "0.6128372", "0.61091065", "0.61083233", "0.61060596", "0.60965717", "0.6076007", "0.6075111", "0.6038733", "0.60299164", "0.602750...
0.65617925
0
Change the names for real social network brand
function brandNames(aNetwork){ // array of real names by brand const normalizedNames = { 'facebook':'Facebook', 'twitter':'Twitter', 'gplus':'Google +' } return aNetwork in normalizedNames ? normalizedNames[aNetwork] : aNetwork }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapHybridNames() {\n $(\"[itemprop='model']\").each(function() {\n $(this).html($(this).html().replace(\"HYBRID\", \"<span class='hybrid-name'>HYBRID</span>\"));\n });\n }", "setBrand(brand) {\n let logo = '';\n switch (brand) {\n case 'Motorola': lo...
[ "0.6516598", "0.64092493", "0.61530864", "0.6027384", "0.59922576", "0.5991571", "0.5827205", "0.5780216", "0.5763563", "0.57312906", "0.57260734", "0.5719914", "0.571509", "0.5706732", "0.5625816", "0.5625448", "0.55715525", "0.5542793", "0.55306286", "0.55103725", "0.550443...
0.74235034
0
write your buildWinningHand function here
function buildWinningHand() { // *We need to be quick so our ruse isn’t spotted. // Make sure you use a nested for loop and the break statement in the inner loop when you find a match in the deck. // *When you find a card in the deck that matches one in win_hand add it to the handArray. Then break and search for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForWin() {\n/* ------------------------------------------ */\n/* Checks the hand for winning combinations. */\n/* Need to find a way to return a message as */\n/* well to tell the play what cause the win! */\n/* ------------------------------------------ */\n\n// First set all win types to false!\...
[ "0.6824795", "0.6634004", "0.662447", "0.6453828", "0.63576245", "0.63377297", "0.6258796", "0.62526685", "0.62495154", "0.6248039", "0.6238713", "0.6181357", "0.6155554", "0.6151958", "0.61338764", "0.6133715", "0.6130621", "0.6130428", "0.6119001", "0.6112818", "0.61126393"...
0.7321081
0
write your shuffleSeed() function here.
function shuffleSeed() { // it needs to return an array of 52 random integers but set the random value to start at 0 and end at 67. // *Make sure you use the push method to add values to your array and the round function to convert your random values to integers. // *Call shuffleSeed in setup and use the return v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shuffle() {\n}", "function reShuffle(){}", "function shuffleDeck(shuffleSeed) {\n //shuffle the deck by rotating the cards location with the values in\n //shuffleSeed. Repeat this a random number of times between 20 and 50\n var shuffleIterations = parseInt(random(20, 50));\n for (var i = 0; i < s...
[ "0.79806256", "0.7768608", "0.7449342", "0.7337769", "0.7186054", "0.6983087", "0.6983087", "0.6927685", "0.69259864", "0.6906631", "0.6895354", "0.6874706", "0.6866382", "0.6861256", "0.6843976", "0.679533", "0.67625654", "0.67174214", "0.6697955", "0.66909283", "0.6687287",...
0.79604125
1
Add index to the end of a path.
function addToPath (path, keyPath, i) { var endPath = keyPath.concat(i) endPath.root = path.root endPath.target = path.target return endPath }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendToIndex(data){\n fs.appendFile(\n 'index.mjs',\n data,\n () => {}\n )\n}", "function incrementIndex() {\n index += 1;\n}", "function increment() {\n if($index === getLastIndex())\n $index = 0;\n else\n $index++;\n }", "func...
[ "0.59571505", "0.56325835", "0.5627315", "0.5478107", "0.5439018", "0.5405958", "0.5352668", "0.52513486", "0.52348983", "0.52067167", "0.51297", "0.51242113", "0.51218194", "0.50895363", "0.508289", "0.5069921", "0.50638825", "0.506321", "0.5060992", "0.5057789", "0.50541395...
0.70207006
0
Creates a new instance of Color from an r, g, b, a
function Color(r, g, b, a) { this.r = r; this.g = g; this.b = b; this.a = a != null ? a : 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fromARGB(a, r, g, b) {\n let c = new Color();\n c.constructorName = \"fromARGB\";\n\n c.a = a;\n c.r = r;\n c.g = g;\n c.b = b;\n return c;\n\n }", "function Color(r, g, b, a) {\n if (a === void 0) { a = 1; }\n // NaN is treated as 0.\n ...
[ "0.84533244", "0.8288797", "0.8285681", "0.8281819", "0.8234696", "0.81425947", "0.80577517", "0.80410767", "0.79983664", "0.783456", "0.7829979", "0.77622193", "0.77622193", "0.77590686", "0.775612", "0.77175003", "0.7686301", "0.75721", "0.75591147", "0.7449769", "0.7394131...
0.83165807
1
Generate the table var reviewsOfCurrentCleaner = getReviewsForCurrentCleaner()
function generateReviewTable() { d3.select("#table2") .selectAll("tr").remove(); var rows = d3.select("#table2") .selectAll("tr") .data(getReviewsForCurrentCleaner()) .enter().append("tr") .selectAll("td") .data(function(row, i) { var cleaningDate = new Date(Date.parse(row["Cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createReviews() {\nlet reviews = [ {\n review:\"In Tanzania, around 19 million people access the internet through mobile devices each year. The Tanzania Telecommunications Corporation (TTCL Corporation) looked to increase that number even further by offering their GSM services to rural and remote parts o...
[ "0.61251837", "0.6047579", "0.6042134", "0.59519756", "0.5905588", "0.5872132", "0.5857661", "0.5848414", "0.58325773", "0.58221734", "0.581715", "0.5814579", "0.58129466", "0.579608", "0.578592", "0.5761853", "0.5761374", "0.57577527", "0.57379067", "0.5737369", "0.57368016"...
0.7801759
0
fetchAllData(); Task 2 sorting based on price
async function getPricesAndSort() { const data = await Course .find({ isPublished: true, tags: { $in: ['backend', 'frontend'] } }) .lean() .sort({ price: -1 }) .select({ name: 1, author: 1 }); console.log('Sorted Prices: ', data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortByPrice() {\n // 1. Get list of Books & sort, save the sorted books array inside the library.\n myLibrary.books = myLibrary.sortByPrice();\n // 2. Display the result on the page. \n displayResult(myLibrary);\n }", "sortByPrice (data, sortval) {\n ...
[ "0.6988239", "0.69140565", "0.6618452", "0.6509107", "0.64083135", "0.639543", "0.63801223", "0.6378564", "0.6378299", "0.6347187", "0.63323206", "0.6303284", "0.6287255", "0.6258834", "0.62419915", "0.62352324", "0.62336993", "0.62127227", "0.6197675", "0.6197245", "0.619263...
0.7229068
0
To request a proof
static REQUEST_PROOF () { return new GoalCodes('request-proof', 'To request a proof') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckCredReq(CredRequest, ipk ) {\n\tlet Nym = CredRequest.Nym\n\tlet IssuerNonce = CredRequest.IssuerNonce\n\tlet ProofC = CredRequest.ProofC\n\tlet ProofS = CredRequest.ProofS\n\n\tlet HSk = ipk.HSk\n/*\n\tif Nym == nil || IssuerNonce == nil || ProofC == nil || ProofS == nil {\n\t\treturn errors.Error...
[ "0.62534624", "0.6166483", "0.59228456", "0.5915583", "0.5821103", "0.56947047", "0.56439996", "0.54985917", "0.5434856", "0.54148585", "0.5414692", "0.5407761", "0.5395512", "0.536625", "0.53466123", "0.53202903", "0.5272877", "0.5224217", "0.52127296", "0.5185182", "0.51799...
0.75814337
0
To create an account with a service
static CREATE_ACCOUNT () { return new GoalCodes('create-account', 'To create an account with a service') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createAccount(){\n\t\tAppDispatcher.dispatch({\n\t\t\ttype: constants.CREATED_ACCOUNT,\n\t\t\tammount: 0\n\t\t});\n\t}", "function BasicCreateAccount() {\n var entityType = \"accounts\";\n var clientURL = Xrm.Page.context.getClientUrl();\n\n var account = {};\n account[\"name\"] = \"Basic Create Samp...
[ "0.6798104", "0.67943513", "0.6762924", "0.6757907", "0.66456014", "0.6456024", "0.6359377", "0.63569754", "0.63550943", "0.63548726", "0.63537484", "0.63485074", "0.6309485", "0.6287118", "0.62542456", "0.62082297", "0.61909896", "0.6180411", "0.61655885", "0.612732", "0.612...
0.76730543
0
To establish a peertopeer messaging relationship
static P2P_MESSAGING () { return new GoalCodes('p2p-messaging', 'To establish a peer-to-peer messaging relationship') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MakePeer() {\n console.log(\"MAKE PEER\")\n client.gotAnswer = false\n let peer = InitPeer('init')\n peer.on('signal', function (data) {\n\t\t\tconsole.log(\"makepeer signal\")\n\t\t\tif (!client.gotAnswer) {\n\t\t\t\tdata.token = localStorage.getItem(\"token\").split(\" \")[1];\n\t\t\t\tdata....
[ "0.67823863", "0.6771952", "0.66108054", "0.65632695", "0.6431228", "0.6402355", "0.6334499", "0.627046", "0.62574124", "0.6232439", "0.6221973", "0.62007535", "0.61875296", "0.61829317", "0.61656564", "0.6161696", "0.61398554", "0.60720134", "0.60716724", "0.6059891", "0.604...
0.7081287
0
handlebars helper to make a centered, responsive img.
function centered_figure(name, alt_text, width) { return ['<img class="img-fluid center-block"', 'style="width: ' + width + '; height: auto;"', 'alt="' + alt_text + '"', 'src="/assets/images/figures/' + name + '">'].join(" "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "center(img){\n\t\timg.x = (Ramu.width / 2) - (img.width / 2);\n\t\timg.y = (Ramu.height / 2) - (img.height / 2);\n\t}", "render() {\n return h(\"img\", { src: getAssetPath(\"/assets/carta2.png\") });\n }", "display(){\n imageMode(CENTER);\n image(astroide[0],this.x, this.y, this.size, this.size...
[ "0.60952425", "0.5867092", "0.5673603", "0.55607355", "0.54753155", "0.5341364", "0.5334292", "0.5317177", "0.52892756", "0.52545273", "0.52515644", "0.52503294", "0.5241305", "0.521533", "0.51695895", "0.50691247", "0.50486577", "0.5042439", "0.5042439", "0.5037985", "0.5037...
0.6695706
0
plugin to set basename to filename w/o extension
function basename() { return function(files) { Object.keys(files).forEach(file => { const parts = path.parse(file); files[file].basename = parts.name; }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set basename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname || '', basename)\n }", "set extname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.dirname, 'extname')\n\...
[ "0.681661", "0.6455914", "0.6271411", "0.62604845", "0.62559724", "0.61774284", "0.61624783", "0.6162028", "0.6092307", "0.60648763", "0.6062905", "0.6012935", "0.60083294", "0.59983826", "0.59744704", "0.5963054", "0.59626514", "0.59376967", "0.591443", "0.5909043", "0.58894...
0.7222932
0
plugin to add ms metadata for handlebars use
function add_metadata() { return (files, metalsmith) => { Object.keys(files).forEach(file => { files[file].meta = metalsmith._metadata; }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Meta() {\n}", "seoMeta() {\n\n var self = this;\n\n ///////////////////////////////////////////////////\n\n var pieces = [];\n\n ///////////////////////////////////////////////////\n\n //Get the page title\n var title = _.compact([\n ...
[ "0.64052916", "0.5983364", "0.5935959", "0.5924388", "0.58651483", "0.58346504", "0.56918365", "0.56572145", "0.56097203", "0.5581098", "0.55757743", "0.55544156", "0.5521886", "0.5482163", "0.547536", "0.54642946", "0.5450628", "0.54399365", "0.54399365", "0.54399365", "0.54...
0.62315667
1
Sends HTTP search for best deals
function getBestDeals() { var searchURL = "https://www.cheapshark.com/api/1.0/deals?pageSize=5&sortBy=Savings&steamRating=90&metacritic=90&lowerPrice=5"; var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search() {\n let keyword = encodeURIComponent($(\"#search\").val()).replace(/%20/g, \"+\");\n createRequest(keyword, base_sort);\n }", "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='ht...
[ "0.6408405", "0.6216212", "0.62108874", "0.62108874", "0.62108874", "0.62108874", "0.62108874", "0.62108874", "0.61878896", "0.6181456", "0.6136285", "0.60973525", "0.6075573", "0.6075573", "0.6060729", "0.6039046", "0.6035171", "0.60327625", "0.6022109", "0.6022109", "0.6022...
0.63183945
1
Sends HTTP search for new games
function getNewGames() { var searchURL = "https://www.cheapshark.com/api/1.0/deals?pageSize=5&sortBy=release"; var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { displayNewGames(xmlHttp.responseText); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameSearch() {\n var searchGame = window.location.search;\n var gameId = searchGame.slice(8);\n\n var searchURL = \"https://www.cheapshark.com/api/1.0/games?id=\" + gameId;\n\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState =...
[ "0.7350821", "0.64704233", "0.63054335", "0.62420183", "0.61815095", "0.6136048", "0.6132279", "0.6085552", "0.6053841", "0.60498804", "0.59555995", "0.59130406", "0.59035754", "0.58199203", "0.58146346", "0.58115304", "0.57572466", "0.5730275", "0.57283664", "0.5719299", "0....
0.6588131
1
Sends HTTP search for free games
function getFreeGames() { var searchURL = "https://www.cheapshark.com/api/1.0/deals?&sortBy=price&upperPrice=0"; var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { displayFreeGames(xmlHttp.responseText)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameSearch() {\n var searchGame = window.location.search;\n var gameId = searchGame.slice(8);\n\n var searchURL = \"https://www.cheapshark.com/api/1.0/games?id=\" + gameId;\n\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState =...
[ "0.73808163", "0.6479686", "0.6298598", "0.61492836", "0.6082616", "0.60690385", "0.604494", "0.60223216", "0.594927", "0.5932407", "0.5890513", "0.58642757", "0.5854282", "0.5850751", "0.5840264", "0.58284265", "0.5799658", "0.57707447", "0.57554454", "0.57534105", "0.574666...
0.66237354
1
Isolates just the image from a JSON of game data
function getImage(J) { var gameInfo = JSON.parse(J); image = gameInfo.info.thumb }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processImage(json) {\n return json.data.images.original.url;\n}", "function getGameImageUrlCallback(data) {\n\n //It's possible that there is more than result\n //If so loop through each entry until we find an exact game name match and use that entry\n //Otherwise just use the only entry retur...
[ "0.6751306", "0.6289487", "0.6171618", "0.6119707", "0.6117102", "0.6093897", "0.6064781", "0.6014407", "0.5986933", "0.5958974", "0.5954844", "0.5954429", "0.5948579", "0.59297574", "0.591013", "0.5895518", "0.5844016", "0.5833245", "0.58296055", "0.5804932", "0.57919556", ...
0.74917823
0
Isolates just the store's image from a JSON of store data
function getStoreImage() { storeImage = 'https://www.cheapshark.com' + storesInfo[gameArray[i].storeID - 1].images.logo }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processImage(json) {\n return json.data.images.original.url;\n}", "function getImage(J) {\n var gameInfo = JSON.parse(J);\n image = gameInfo.info.thumb\n}", "function Image(data) {\n const main = data.main;\n const views = data.views;\n\n var output = {\n '_type': 'Image',\n 'alt': mai...
[ "0.6380797", "0.60650945", "0.5979076", "0.5975153", "0.5937973", "0.5806559", "0.58007145", "0.5794636", "0.5674737", "0.5671066", "0.5611167", "0.55982393", "0.55879056", "0.5539218", "0.5529776", "0.5489072", "0.54877704", "0.5485648", "0.54662013", "0.54654574", "0.544220...
0.6570297
0
default setting to Last30Days
function defaultDateSetting() { var day = new Date(getUpdateTime()); day.setDate(day.getDate() - 30); $("#from").datepicker("setDate", day); $("#to").datepicker("setDate", new Date(getUpdateTime())); pressToggle(document.getElementById("btnLastThirty")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_last_30_days_dates() {\n let date = new Date();\n date.setDate(date.getDate() - 30);\n return [format_date(new Date()), format_date(date)];\n}", "function calcLastDay() {\n calcLastHours(24, 'd');\n }", "function for30days(){\n\tvar value = 0.1;\n\tfor (var i = 0; i < 30; i++){\n\t\tv...
[ "0.63053364", "0.5682452", "0.5548439", "0.53221124", "0.5288392", "0.5279094", "0.50428605", "0.50428605", "0.5036528", "0.5030049", "0.50267124", "0.5001341", "0.49961674", "0.49691248", "0.49582446", "0.4908654", "0.49065658", "0.49014688", "0.48752213", "0.48748207", "0.4...
0.6154634
1
Constructor initializes the page and creates an instance of the LoginService for use in the page
constructor(){ super(); this.loginService = new LoginService(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LoginService(http) {\n this.http = http;\n }", "function SimpleLoginService(url){\r\n this.url = url;\r\n}", "function LoginPage(remote) {\n this.remote = remote;\n }", "function LoginPage(remote) {\n this.remote = remote;\n }", "function Logi...
[ "0.6775975", "0.6626816", "0.6471768", "0.6471768", "0.64602077", "0.6453941", "0.6428422", "0.6286332", "0.62838703", "0.6269892", "0.6077072", "0.5992518", "0.59776294", "0.5953894", "0.5909366", "0.5903702", "0.5903586", "0.58921194", "0.5878578", "0.5753772", "0.5751984",...
0.71465474
0
base64 encode function / parameters: s (string to be encoded) eol (optional character to be used as / endofline character when breaking the encoded string into / 76character lines as specified in the RFC. Default is '\n'.
function encode_base64(s,eol) { var binVal, start, rs, encStr, ii; binVal = new String(); // concat binary values into one string for (ii=0; ii < s.length; ii++) { binVal += _convert_binary(s.charCodeAt(ii),8); } start = 0; rs = ""; while ( start + 24 <= binVal.length ) { rs += _encode_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function base64encode(s){\n//\t\tif (window.btoa){\n//\t\t\treturn btoa(s);\n//\t\t}else{\n\t\t\tvar base64list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\t\t\tvar t = '', p = -6, a = 0, i = 0, v = 0, c;\n\t\t\twhile ( (i < s.length) || (p > -6) ) {\n\t\t\t\tif ( p < 0 ) {\n\t\t\t\t\t...
[ "0.7121723", "0.70776325", "0.7051534", "0.691694", "0.6712662", "0.65608263", "0.649846", "0.6402231", "0.6336895", "0.63270074", "0.63270074", "0.6310535", "0.6260447", "0.6256382", "0.62517846", "0.62360835", "0.62014496", "0.6080462", "0.60742146", "0.60628694", "0.602564...
0.8425571
0
function accepts an integer and returns an binary string of p bits
function _convert_binary(n,p) { var bin = n.toString(2); // pad left side (high order) with 0's while ( bin.length < p ) { bin = '0'+bin; } return bin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binaryRep(input) {\n if(input <= 0) {\n return ''\n }\n let binary = Math.floor(input % 2);\n return binaryRep(Math.floor(input / 2)) + binary;\n}", "function bitRep(number) {\n if(typeof number !== 'number') {\n console.log(\"Oops, you did not send in a number.\");\n return;\n }\n \n ...
[ "0.71766806", "0.717118", "0.71375275", "0.7067936", "0.7022782", "0.69807935", "0.6962727", "0.6962727", "0.6946362", "0.6898707", "0.68708926", "0.6858094", "0.6854629", "0.6824092", "0.6813988", "0.6813988", "0.6813988", "0.6813988", "0.6813988", "0.6813988", "0.6813988", ...
0.77392685
0
funciton will encode a base 64 quantum of multiple of 6 bits
function _encode_quantum(q) { var str, ss; str = ""; for(ss = 0; ss < q.length; ss = ss + 6) { str += b64alpha.charAt(_convert_binstr(q.substring(ss,ss+6))); } return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Base64Encode() {}", "function encode64(input) {\r\n\r\n var keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n //remove null characters from end of output\r\n input = input.replace(/\\0*$/g, '');\r\n \r\n var output = \"\";\r\n var chr1, chr2, chr3 = \"\";\r\n ...
[ "0.6896692", "0.68216985", "0.6815209", "0.6781157", "0.67542326", "0.67268866", "0.6721441", "0.6693297", "0.66872585", "0.6604114", "0.6572543", "0.65402514", "0.65035635", "0.64599794", "0.64460117", "0.6426004", "0.64064753", "0.64059097", "0.6404759", "0.6379895", "0.634...
0.7157717
0
Draw chart at frameRate
function drawChart(chart) { var streaming = chart.streaming; var frameRate = chart.options.plugins.streaming.frameRate; var frameDuration = 1000 / (Math.max(frameRate, 0) || 30); var next = streaming.lastDrawn + frameDuration || 0; var now = Date.now(); var lastMouseEvent = streaming.lastMouseEvent; if (next <=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderChart() {\n\n\n requestAnimationFrame(renderChart);\n\n // Copy frequency data to frequencyData array.\n analyser.getByteFrequencyData(frequencyData);\n \n }", "function renderChart() {\r\n\t requestAnimationFrame(renderChart);\r\n\r\n\t // Copy frequency data to frequencyData ...
[ "0.69918597", "0.6875532", "0.68589133", "0.67145014", "0.66627467", "0.6653146", "0.6599902", "0.65634847", "0.65320265", "0.6515997", "0.65116906", "0.64861673", "0.6479353", "0.6466314", "0.639395", "0.636677", "0.6332999", "0.6307753", "0.62884915", "0.6247544", "0.622760...
0.6970095
1
Retrieve a list of all the Lambdas
function listLambdas(nextMarker){ var params = { Marker: nextMarker }; lambda.listFunctions(params, function(err, data) { if (err) console.log(err, err.stack); // an error occurred else { for(var x = 0; x < data.Functions.length; x++){ //To reduce the API rate limits, a timeout is set to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getLambda() {\n return [];\n }", "get funcs() {\n const self = this;\n return (0, _Array.iter)(function* () {\n // export const foo = () => {}\n for (const vd of self.sf.getVariableDeclarations()) {\n if (vd.isExported()) {\n const init = vd.getInitializerIfKind(ts...
[ "0.7150032", "0.6166976", "0.59684116", "0.58638054", "0.58608663", "0.5808126", "0.56647193", "0.56366205", "0.5615835", "0.56147456", "0.55584216", "0.5456181", "0.53669214", "0.5360567", "0.5331152", "0.5312672", "0.53108174", "0.530217", "0.52926046", "0.52504903", "0.524...
0.70420116
1