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
api method that interacts with the REST api Parameters are the path as a string the HTTP method to be sent to the REST api the body of the request for POST or PUT methods A boolean value decalring if authorization is required the credentials of user's email and password if authorization is required Returns a fetch meth...
api(path, method = 'GET', body = null, requiresAuth = false, credentials = null) { const url = config.apiBaseUrl + path; //creating the options for the header of the request const options = { method, headers: { 'Content-Type': 'application/json; charset=utf-8', }, }; //if t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "api(path, method = 'GET', body, requiresAuth = false, credentials = null) {\n const url = config.apiBaseUrl + path;\n const options = {\n method,\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n };\n\n\n if (bod...
[ "0.6916721", "0.6829132", "0.6823676", "0.6581397", "0.6539231", "0.65374875", "0.6468029", "0.6449505", "0.6370294", "0.63349754", "0.62877053", "0.6273532", "0.626077", "0.62483615", "0.6235612", "0.62297624", "0.62143856", "0.6089846", "0.6048349", "0.6013642", "0.60077554...
0.7426161
0
Open the tip dialog. 3 ways to use the open api: open(duration) open(confirmCallback) open(confirmCallback, cancelCallback)
open(...args) { let confirmCallback, cancelCallback, duration = this.duration; if (args.length > 0 && typeof args[0] === 'function') { confirmCallback = args.shift(); } if (args.length > 0 && typeof args[0] === 'function') { cancelCallback = args.shift(); } if (args.length > 0 && (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TipPopup(param)\n{\n\tthis.base = new Popup(param);\n\tSuryani.extend(this,this.base);\n this.config[\"autoClose\"]=param[\"autoClose\"]||0;\n\tthis.initContent();\n}", "function open(dialog) {\n\t\n}", "openInfoWindow() {}", "function openTooltip(url){\n window.open(url, '_blank');\n\n}", "...
[ "0.63148135", "0.6150512", "0.6015232", "0.59435254", "0.58170676", "0.5797331", "0.57026917", "0.5696776", "0.56516886", "0.5627113", "0.5612334", "0.55450904", "0.54980093", "0.5495468", "0.5495468", "0.54810035", "0.54665864", "0.5443949", "0.54209876", "0.54200214", "0.53...
0.66570324
0
HELPER FUNCTIONS USED IN ALL CIPHERS takes a string and gets rid of numbers, whitespace, and any other meta characters.
function processString(string) { string = string.replace(/[0-9]/g, ''); string = string.replace(/ /g, ''); string = string.replace(/\s|\W|\d/igm, ''); return string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeSpecialCharactersSepa(input)\n{\n return input.replace(/[^a-zA-Z0-9]/g, '');\n}", "static sanitize(string){\n return string.replace( /[^A-Za-z0-9 '-]/g, '' )\n }", "function decipherThis(str) {\n let arr = str.replace(/\\d+/g, (match)=>{return String.fromCharCode(match)}).split(' ')\n ...
[ "0.6834096", "0.68274146", "0.6807946", "0.67620945", "0.67394143", "0.6735664", "0.6722216", "0.67086065", "0.67004496", "0.66965884", "0.6689165", "0.6652818", "0.6639745", "0.663611", "0.6635796", "0.6601789", "0.6591309", "0.65580255", "0.6556738", "0.6517538", "0.6503647...
0.7990866
0
creates an empty matrix with the size depending on the parameter For example, if sizeOfMatrix is 5, then it makes an empty 5x5 matrix grid
function createEmptyMatrix(sizeOfMatrix) { var matrix = []; for(var i = 0; i < sizeOfMatrix; i++) { matrix.push([]); } return matrix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEmptyMatrix(){\n\t\n\t// save board's height and width\n\tvar height = gBoard.height;\n\tvar width = gBoard.width;\n\t\t \n\t//\tcreate the board's matrix\n\tvar resMatrix = new Array(height);\n\t\n\tfor (var i = 0; i < height; i++) {\n\n\t\tresMatrix[i] = new Array(width);\t\n\t}\n\t\n\t//update th...
[ "0.7753309", "0.7235895", "0.7178102", "0.6950075", "0.68530774", "0.68252426", "0.6773801", "0.6749667", "0.6735612", "0.66997945", "0.66997945", "0.66784245", "0.6632867", "0.6620903", "0.6575079", "0.6575079", "0.65540475", "0.6542136", "0.65339094", "0.65241176", "0.64795...
0.82374537
0
checks if user has inserted valid numeric key
function checkIfKeyAnInteger(key) { if(!Number.isInteger(key)) { alert("Key is not an integer! Enter Integer as key"); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidKey(key) {\n return key == null || typeof key === 'number' && key <= 0x10FFFF || typeof key === 'string' && key.length >= 0 && key.length <= 2;\n}", "function checkKey(n) {\n // if string isn't a number\n if(isNaN(parseFloat(n))) {\n // if string is one of the below\n if(n ==...
[ "0.6722183", "0.65985954", "0.656203", "0.6373562", "0.634644", "0.6324647", "0.63040024", "0.62817097", "0.6277875", "0.62761366", "0.6243068", "0.6214853", "0.617472", "0.617472", "0.60697806", "0.6056288", "0.604111", "0.60184234", "0.60136163", "0.5997638", "0.59929794", ...
0.7224544
0
output the encryption and key onto the decryption card textareas
function outputEncryption(cipher, key) { document.getElementById('encryptKey').value = ''; document.getElementById('decryptKey').value = key; document.getElementById('decryptInput').value = cipher; document.getElementById('encryptInput').value = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputDecryption(message, key)\n{\n document.getElementById('encryptKey').value = key;\n document.getElementById('decryptKey').value = '';\n document.getElementById('encryptInput').value = message;\n document.getElementById('decryptInput').value = '';\n}", "function display_secret_text(decrypted) {\...
[ "0.7372894", "0.7159936", "0.7092186", "0.6985045", "0.64513975", "0.62711716", "0.6232766", "0.6093491", "0.60814077", "0.6063259", "0.6043795", "0.6015824", "0.59879005", "0.5979806", "0.5966287", "0.59444064", "0.59438705", "0.5936807", "0.59347904", "0.593109", "0.5908531...
0.7573633
0
output the decryption and key onto the encryption card textareas
function outputDecryption(message, key) { document.getElementById('encryptKey').value = key; document.getElementById('decryptKey').value = ''; document.getElementById('encryptInput').value = message; document.getElementById('decryptInput').value = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outputEncryption(cipher, key)\n{\n document.getElementById('encryptKey').value = '';\n document.getElementById('decryptKey').value = key;\n document.getElementById('decryptInput').value = cipher;\n document.getElementById('encryptInput').value = '';\n}", "function display_secret_text(decrypted) {\n ...
[ "0.75127065", "0.71802026", "0.7079274", "0.6958041", "0.639613", "0.62279403", "0.6200258", "0.6106561", "0.6105082", "0.60729235", "0.60725266", "0.6044823", "0.60184723", "0.60038143", "0.5995371", "0.59768134", "0.5970767", "0.5925293", "0.591315", "0.58911496", "0.586794...
0.73788494
1
Playfair and simon wells exclusive ciphers. Find a position of a letter in a key matrix and return its row and column
function findPosition(keyMatrix, letter) { var x = 0; var y = 0; for(var i = 0; i < 5; i++) { for(var j = 0; j < 5; j++) { if(keyMatrix[i][j] == letter) { x = i; y = j; } } } return [x,y]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCharPosition(c) {\n var index =key.indexOf(c);\n var row = Math.floor(index / 5);\n var col = index % 5;\n return {\n row: row,\n col: col\n };\n}", "function encodedLetterPosition(letter, level){\r\n for (var i = 0; i < 26; i++) {\r\n if(polyalphabeticTable[level][i]...
[ "0.7007583", "0.64692515", "0.6288575", "0.62166387", "0.6115928", "0.6093524", "0.60414505", "0.6008241", "0.59838617", "0.5979355", "0.5960025", "0.59010476", "0.587369", "0.58556175", "0.57940775", "0.5787871", "0.5779153", "0.5767535", "0.5757766", "0.5742867", "0.5717911...
0.78937256
0
Takes a message and splits it into pairs of 2. The check parameter checks if this is called from the Simon Wells or Playfair cipher for in the simon wells cipher, it does not matter if the pair is the same letter, so there is no need to insert the letter 'x'
function processMatrixMessage(message, check) { var temp_message = []; var flag = false; var y = 0; var i = 0; var message_matrix = []; message = message.toLowerCase(); message = processString(message); message = message.replace(/j|J/g, 'i'); for(i = 0; i < message.length; i++) { flag = false...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitPairs(text) {\r\n let myArr = [];\r\n if (text.length % 2 == 0) { // even length\r\n for ( let i = 0; i < text.length; i + 2) {\r\n let pair = text[i] + text[i+1];\r\n myArr.push(pair);\r\n i += 2;\r\n } return myArr;\r\n } else { // odd length\r\n ...
[ "0.62116027", "0.57315385", "0.54958665", "0.5475382", "0.5394335", "0.536926", "0.53079396", "0.5295785", "0.5270011", "0.5264928", "0.5262736", "0.52512693", "0.52077276", "0.5175631", "0.5164737", "0.5156752", "0.51481766", "0.5135898", "0.51323247", "0.51084304", "0.50848...
0.60048187
1
creates a matrix from the key. Used in playfair and simon wells ciphers
function createKeyMatrix(key) { var tempMatrix = []; var finalMatrix = createEmptyMatrix(5); var alphabet = "abcdefghiklmnopqrstuvwxyz" key = processString(key); key = key.toLowerCase(); key = key.replace('j', 'i'); for(var i = 0; i < key.length; i++) { if(!tempMatrix.includes(key[i])) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateRoundKey(key){ \n // to byteArray\n var arr = [];\n for(var i = 0;i < key.length;i++){\n arr[i] = key.charCodeAt(i);\n }\n\n // count nRound\n var sum = 0;\n for(var i = 0;i < arr.length;i++){\n sum = (sum + arr[i]) % 8;\n }\n var nRound = 8 + sum;\n\n ...
[ "0.7019182", "0.65994644", "0.6551165", "0.6362361", "0.62151927", "0.612884", "0.60799575", "0.6073037", "0.59515476", "0.5949379", "0.5754479", "0.5729826", "0.5680933", "0.5680234", "0.5623973", "0.5623973", "0.5623973", "0.5623973", "0.5623973", "0.5623973", "0.5623973", ...
0.785035
0
rempli le tableau array avec la valeur de l'attribut 'name' des images
function init() { let images = document.querySelectorAll("img"); for (let i=0; i<16; i++) { array[i]=images[i].getAttribute("name"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameArrayChart() {\n var nameChart = [];\n for(var i = 0; i < allImages.length; i++) {\n nameChart.push(allImages[i].name);\n }\n return nameChart;\n}", "function allImages(name, src) {\n this.name = name;\n this.src = 'images/' + src;\n this.clicked = 0;\n this.shown = 0;\n allI...
[ "0.70442843", "0.67690986", "0.6640262", "0.65522856", "0.6425305", "0.6307285", "0.6302408", "0.6301894", "0.6301277", "0.6224383", "0.6184604", "0.61645913", "0.6110587", "0.60588133", "0.6045175", "0.6038151", "0.6035986", "0.60120386", "0.60071844", "0.5995056", "0.596030...
0.7269138
0
Display publication thumbnail where id is also id of DOM element (with 'id' prefix)
function display_publication_thumbnails(id) { $.getJSON("http://bionames.org/bionames-api/id/" + id + "?callback=?", function(data){ if (data.status == 200) { var element_id = 'id' + id; element_id = element_id.replace(/\//, '_'); show_publication_thumbnail(element_id, data); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_publication_thumbnails_data_id(id) {\n\t\n\tvar publication_id = $('#' + id).attr('data-id');\n\t\n\tif (publication_id) {\t\n\t\t$.getJSON(\"http://bionames.org/bionames-api/id/\" + publication_id + \"?callback=?\",\n\t\t\tfunction(data){\n\t\t\t\tif (data.status == 200)\n\t\t\t\t{\t\t\n\t\t\t\t\...
[ "0.7927665", "0.6891268", "0.68503314", "0.6537819", "0.65111375", "0.64382434", "0.64150167", "0.6323419", "0.63164777", "0.6250859", "0.6234751", "0.6163778", "0.61623913", "0.61476684", "0.61416113", "0.6124078", "0.6118493", "0.6098885", "0.6080573", "0.6058341", "0.60518...
0.80782473
0
Display publication thumbnail where id is also name of DOM element that has publication id as value of attribute dataid
function display_publication_thumbnails_data_id(id) { var publication_id = $('#' + id).attr('data-id'); if (publication_id) { $.getJSON("http://bionames.org/bionames-api/id/" + publication_id + "?callback=?", function(data){ if (data.status == 200) { show_publication_thumbnail(id, data); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_publication_thumbnails(id) {\n\t$.getJSON(\"http://bionames.org/bionames-api/id/\" + id + \"?callback=?\",\n\t\tfunction(data){\n\t\t\tif (data.status == 200)\n\t\t\t{\t\t\n\t\t\t\tvar element_id = 'id' + id;\n\t\t\t\telement_id = element_id.replace(/\\//, '_');\n\t\t\t\t\n\t\t\t\tshow_publication...
[ "0.76774144", "0.658436", "0.65603966", "0.6445964", "0.6273297", "0.62683153", "0.62534136", "0.6227257", "0.6162617", "0.61195636", "0.6112817", "0.60701704", "0.6056311", "0.6028411", "0.60129535", "0.59797287", "0.59783214", "0.59525764", "0.59260416", "0.59209776", "0.59...
0.82627153
0
internal SAT polygon conversion helper
function _arrayPolygonToSAT(srcPolygon) { return new sat.Polygon( new sat.Vector(), srcPolygon.map(pt => new sat.Vector(pt[0], pt[1])) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translatePolygon (polygon) {\n let script = 'createPolygon(['\n for (let vertex of polygon.vertices) {\n script += `${translateVertex(vertex)},`\n }\n script += `],${translateShared(polygon.shared)},${translatePlane(polygon.plane)})`\n return script\n}", "function b2PolygonShape() {\nthis.positi...
[ "0.6234401", "0.59899586", "0.5934603", "0.5926888", "0.59267426", "0.5912991", "0.59100574", "0.58264256", "0.5819711", "0.5807073", "0.57866293", "0.5782815", "0.57583857", "0.57382846", "0.57267267", "0.5718639", "0.5698778", "0.5698778", "0.5670637", "0.56656474", "0.5659...
0.6966093
0
filters mouse events so an event is fired only if the mouse moved. filters out mouse events that occur when mouse is stationary but the elements under the pointer are scrolled.
function installFilteredMouseMove(element) { element.bind("mousemove", function (e) { var lastpos = lastMousePosition; if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) { $(e.target).trigger("mousemove-filtered", e); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function installFilteredMouseMove(element) {\n element.bind(\"mousemove\", function (e) {\n var lastpos = lastMousePosition;\n if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {\n $(e.target).trigger(\"mousemove-filtered\", e);\n }\n ...
[ "0.71837556", "0.7165065", "0.7066497", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", "0.69766647", ...
0.72247076
0
Ensure nested inline helpers will always have this.parent set to the view containing the template
function getParent(parent) { // The `view` helper is a special case as it embeds // a view instead of creating a new one while (parent._helperName && parent._helperName !== 'view') { parent = parent.parent; } return parent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get parent() { return this.$parent; }", "render(section, parent) {\n }", "parent() {\n return super.parent();\n }", "get parent( ) { return this.m_parent; }", "get parent() {\n return this._parent\n }", "get _itemsParent() {\n return (0, _polymerDom.dom)((0, _polymerDom.dom)(thi...
[ "0.64717484", "0.5963194", "0.58326536", "0.5793813", "0.5750357", "0.57267576", "0.57258904", "0.5709945", "0.57043856", "0.57043856", "0.56933504", "0.56909883", "0.56790143", "0.56395805", "0.5634762", "0.5617216", "0.5597131", "0.55958635", "0.55860466", "0.5555255", "0.5...
0.65031284
0
Clones the helper options, dropping items that are known to change between rendering cycles as appropriate.
function cloneHelperOptions(options) { var ret = _.pick(options, 'fn', 'inverse', 'hash', 'data'); ret.data = _.omit(options.data, 'cid', 'view', 'yield'); return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetOptions(){\n\t \t \n\t\t g_options = jQuery.extend({}, g_temp.originalOptions);\n\t\t \n\t\t g_selectedItemIndex = -1;\n\t\t g_selectedItem = null;\n\t\t g_objSlider = undefined;\n\t\t g_objThumbs = undefined;\n\t\t g_objSlider = undefined; \n\t}", "resetDefaultOptions() {\n ImageHelper.fu...
[ "0.61415654", "0.5839357", "0.5636794", "0.5393338", "0.5345459", "0.52567434", "0.5253454", "0.5253454", "0.5248792", "0.5238713", "0.52282465", "0.52282465", "0.52185214", "0.52071", "0.52071", "0.519825", "0.51868653", "0.51714694", "0.51714694", "0.51714694", "0.51714694"...
0.72141975
0
Checks for basic equality between two sets of parameters for a helper view. Checked fields include: _helperName All args Hash Data Function and Invert (id based if possible) This method allows us to determine if the inputs to a given view are the same. If they are then we make the assumption that the rendering will be ...
function compareHelperOptions(a, b) { function compareValues(a, b) { return _.every(a, function(value, key) { return b[key] === value; }); } if (a._helperName !== b._helperName) { return false; } a = a._helperOptions; b = b._helperOptions; // Implements a first level depth comparison ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_diffViews(newViews, oldViews) {\n if (newViews.length !== oldViews.length) {\n return true;\n }\n\n return newViews.some((_, i) => !newViews[i].equals(oldViews[i]));\n }", "function equals$1(otherValueProvider){// ValueProviders are equivalent if they have the same parameters\n const p1=this.p...
[ "0.49119943", "0.47559252", "0.46306688", "0.46121392", "0.45673087", "0.45647013", "0.454787", "0.45344457", "0.45311692", "0.4527406", "0.44693887", "0.44659078", "0.44336784", "0.44220784", "0.43865654", "0.43761933", "0.43742", "0.43592036", "0.4356565", "0.43532524", "0....
0.56397355
0
Even if the view is not a CollectionView ensureRendered() to provide similar behavior to a model
function onSetCollection() { this.ensureRendered(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n this.views.forEach(view => {\n view.render(this.model);\n })\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function...
[ "0.6397304", "0.6379745", "0.6379745", "0.6379745", "0.6379745", "0.6379745", "0.6342064", "0.62933916", "0.62933916", "0.6248394", "0.6173471", "0.61450064", "0.6122142", "0.6093436", "0.6091054", "0.604851", "0.5984046", "0.5904379", "0.5892639", "0.5862718", "0.5832213", ...
0.66112494
0
Convenience factory to create with a bearer token.
static createWithBearerToken(defaultUrl, token, options) { let bearerHandler = getBearerHandler(token); return new this(defaultUrl, bearerHandler, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "auth(token) {\n this.headers['Authorization'] = `Bearer ${token}`;\n return this;\n }", "function withToken (callback) {\n debug('Getting a new access token')\n var reqOptions = {\n url: tokenURL,\n method: 'POST',\n form: {\n 'client_id': clientID,\n ...
[ "0.6102375", "0.60903084", "0.5963672", "0.5932974", "0.59202784", "0.59071213", "0.5889439", "0.58808684", "0.58382803", "0.5764261", "0.56811845", "0.56811845", "0.5646852", "0.5616728", "0.5602591", "0.5574358", "0.55501866", "0.5543649", "0.55335045", "0.5506037", "0.5471...
0.6897085
0
Returns an array of nationalities
function getNationalityArray() { return [ 'Singapore | Singaporean', 'Afghanistan | Afghan', 'Albania | Albanian', 'Algeria | Algerian', 'USA | American', 'Andorra | Andorran', 'Angola | Angolan', 'Antigua | Antiguans', 'Argentina | Argentinean...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get nationalities() {\n const url = this._endPoint + \"/nationalities\";\n return HTTP_REQUEST.get({target:url});\n }", "static getNomenclaturalCodes() {\n return [\n // Note: the unknown code needs to be the first one in this list.\n {\n iri: owlterms.UNKNOWN_CODE,\n ...
[ "0.78611684", "0.6335299", "0.5740849", "0.5645618", "0.5635125", "0.55963975", "0.55912745", "0.55070794", "0.5494313", "0.54901713", "0.548716", "0.5482592", "0.5480839", "0.5480839", "0.5443329", "0.5428757", "0.54052323", "0.54047143", "0.540257", "0.53886217", "0.5381096...
0.7293818
1
function for pages with charset windows1251 or ISO88595
function suche3(id) { var texto; var ordbogform; var o_text = document.ordbogform.texto.value; var i; var out=""; var debug=""; var oldchar; var newchar; for (i=0; i<o_text.length; i++) { oldchar = o_text.charCodeAt(i); newchar = win1251[oldchar]; if (newchar==undefined) { newchar = oldchar } out...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function suche3(id) {\n var texto;\n var ordbogform;\n var o_text = document.ordbogform.texto.value;\n var i;\n var out=\"\";\n var debug=\"\";\n var oldchar;\n var newchar;\n for (i=0; i<o_text.length; i++) {\n oldchar = o_text.charCodeAt(i);\n newchar = win1251[oldchar];\n if (newchar==undefine...
[ "0.5713044", "0.54355556", "0.52177817", "0.5135046", "0.51223046", "0.5092399", "0.506013", "0.50026876", "0.49592617", "0.49094465", "0.49076647", "0.4838037", "0.480872", "0.47740772", "0.47510394", "0.47392088", "0.47192955", "0.47091964", "0.4704626", "0.46986547", "0.46...
0.5600022
1
Execute func and in case of an error log it and update the GUI.
async function callAndCheckErrors(func) { try { await func(); } catch (e) { // Don't log disconnection errors if we closed the connection ourselves. if ( !(e instanceof frontpanelWs.FrontPanelError && e.code === frontpanelWs.ErrorCode.D...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ErrorFunc() {$('listado').innerHTML = 'Error al conectar con el php';\t}", "function ui_error(str)\n{\n err(str);\n}", "function showGeneralError() {\r\n showServerError(\"Error occurred. Please retry the operation later.\");\r\n}", "async function asyncHandler(fn) {\n try {\n await f...
[ "0.5811504", "0.5762183", "0.5720404", "0.56857055", "0.56581706", "0.5591467", "0.555978", "0.5492365", "0.5485742", "0.54803723", "0.54802036", "0.5472576", "0.5466497", "0.5466122", "0.54380894", "0.5414183", "0.53921753", "0.537968", "0.5353389", "0.53391105", "0.5323453"...
0.6536983
0
return a list of radio stations using dar fm api
function getStations() { // dar fm var apiKey = '4363387309'; // search stations based on city / state var darURL = 'http://api.dar.fm/darstations.php?callback=json&city=' + city + '&state=' + state + '&exact=1&partner_token=' + apiKey; var darURLEncoded = encodeURI(darURL); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initStationList() {\n\n // Setting the URL to an API that contains metadata about the stations\n\tvar url = \"https://rata.digitraffic.fi/api/v1/metadata/stations\";\n\tvar stationsData;\n\n\t// Establishing connection to the API\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\tdataType: \"json\",\n\t\turl: url,\n...
[ "0.63045084", "0.61958414", "0.5987551", "0.59736", "0.5898435", "0.5799235", "0.57769877", "0.5627552", "0.5500325", "0.5410602", "0.5410168", "0.540814", "0.5404453", "0.5333953", "0.53283244", "0.5301808", "0.52964336", "0.5292938", "0.5265849", "0.5258781", "0.52569634", ...
0.6612325
0
Updates classes for the bordered tiles.
function _updateTileClasses() { var topTile; var rightTile; var bottomTile; var leftTile; _resetTileClasses('topTile'); _resetTileClasses('bottomTile'); _resetTileClasses('leftTile'); _resetTileClasses('rightTile'); // update top and bottom tile ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doAfterTransition_setClasses(){\n\t\t\n\t\tif(g_temp.isTransInited == false)\n\t\t\treturn(false);\n\t\t\n\t\tg_objParent.removeClass(\"ug-tiles-transition-active\");\n\t\tg_objParent.addClass(\"ug-tiles-rest-mode\");\n\t}", "function update(className) {\n var r1, r2, c1, c2; // logical row and col\n...
[ "0.6405333", "0.61775523", "0.6105732", "0.59745157", "0.5933492", "0.5796199", "0.5752128", "0.57054514", "0.57043225", "0.5702377", "0.5693291", "0.5626757", "0.5623356", "0.56157625", "0.5598964", "0.55875266", "0.55875266", "0.55875266", "0.55875266", "0.55875266", "0.558...
0.7729783
0
Draws tiles in bordered left colum.
function _drawLeftTiles() { var documentFragment; var drawedTiles = []; var zoom = _layer.map.getZoom(); documentFragment = document.createDocumentFragment(); _showedTiles.leftTop.x--; for(var i = _showedTiles.leftTop.y; i <= _showedTiles.rightBottom.y; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LeftBorder() {\n\tvar self \t\t= this;\n\tself.x \t\t\t= 0;\n\tself.y \t\t\t= Canvas.topSlot;\n\tself.width \t\t= blocUnit / 9;\n\tself.height\t\t= blocUnit * 4;\n\tself.ctx = myGameArea.context;\n\tself.update \t= function() {\n\t\tctx \t\t\t= myGameArea.context;\n\t\tctx.fillStyle \t= COLOR.pulsers;\n\t...
[ "0.675475", "0.656136", "0.65414435", "0.63821983", "0.62704146", "0.62613755", "0.6259885", "0.6240584", "0.6191254", "0.6137914", "0.61100125", "0.6065491", "0.6062424", "0.60429424", "0.60248715", "0.60182524", "0.60015506", "0.5987261", "0.59853387", "0.596884", "0.595227...
0.7575163
0
Draws tiles in bordered right colum.
function _drawRightTiles() { var documentFragment; var drawedTiles = []; var zoom = _layer.map.getZoom(); documentFragment = document.createDocumentFragment(); _showedTiles.rightBottom.x++; for(var i = _showedTiles.leftTop.y; i <= _showedTiles.rightBottom.y; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveRight() {\r\n\t\tfor( var row = tableSize; row >= 1; row-- ) {\r\n\t\t\tfor( var column = tableSize; column >= 1; column-- ) {\r\n\t\t\t\tmoveTile( row, column, 0, 1 );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function RunRightA(x, y) {\n // shirt:\n setColor(td.shirtcolor);\n drawRect(x - td.blocksiz...
[ "0.64362824", "0.6196347", "0.6175212", "0.6154132", "0.61534256", "0.6125706", "0.6109275", "0.6091233", "0.6078828", "0.6077153", "0.6048338", "0.60352623", "0.60242987", "0.600908", "0.59968686", "0.59417", "0.59262127", "0.59018725", "0.5899829", "0.5891612", "0.589077", ...
0.76823324
0
Draws tiles in bordered top row.
function _drawTopTiles() { var documentFragment; var drawedTiles = []; var zoom = _layer.map.getZoom(); documentFragment = document.createDocumentFragment(); _showedTiles.leftTop.y--; for(var i = _showedTiles.leftTop.x; i <= _showedTiles.rightBottom.x; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createBorderTop(x,y,size, colSize, rowSize){\n \n context.beginPath();\n context.moveTo(x,y);\n context.lineTo(x+size/colSize,y);\n context.stroke();\n \n\n }", "function addRowToTopOfGrid(){\n for (var eachCol=0;eachCol<TILE_COLS;eachCol++){\n tetrisGrid.unshift...
[ "0.66375005", "0.653122", "0.6493978", "0.6475239", "0.6336428", "0.6336013", "0.6275117", "0.6253239", "0.61683667", "0.6070508", "0.6067291", "0.6061095", "0.60020393", "0.5990885", "0.59896094", "0.5989605", "0.59812623", "0.59051996", "0.5843632", "0.58363867", "0.5835051...
0.70652306
0
Draws tiles in bordered bottom row.
function _drawBottomTiles() { var documentFragment; var drawedTiles = []; var zoom = _layer.map.getZoom(); documentFragment = document.createDocumentFragment(); _showedTiles.rightBottom.y++; for(var i = _showedTiles.leftTop.x; i <= _showedTiles.rightBottom.x; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawGrid() {\n stroke(ht2Color);\n strokeWeight(2);\n\n for (let i = Math.floor(borders.xMin); i < Math.floor(borders.xMax) + 1; i++) {\n for (let j = Math.floor(borders.yMin); j < Math.floor(borders.yMax) + 1; j++) {\n if (i % gridSkip == 0 && j % gridSkip == 0) {\n let p = toScreenCoor...
[ "0.6737855", "0.6627961", "0.64945954", "0.6483925", "0.64643174", "0.64050627", "0.6306578", "0.62691987", "0.626775", "0.62552625", "0.617456", "0.61618257", "0.6125901", "0.6095862", "0.6092412", "0.60786885", "0.60680026", "0.6060897", "0.60576916", "0.6038493", "0.603597...
0.7325895
0
source code object, input source cde
function CSourceCode(str){ str = str || ""; this.original = str; this.lines = str.split("\n"); this.lineIter = 0; this.colIter = 0; this.alphabet = 'abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ'; this.numbers = '0123456789'; this.hexSymbols = '0123456789ABCDEFabcdef'; this.singleSymbols = '(){}#.,?:[]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bytecode(assembly_source) {\n\n const ciyam_spec = {\n op_code_table: [\n { op_code: 0xf0, name: \"blank\", size: 0, args_type: \"\", regex: /^\\s*$/ },\n { op_code: 0xf1, name: \"label\", size: 0, args_type: \"\", regex: /^\\s*(\\w+):\\s*$/ },\n ...
[ "0.65426725", "0.62720895", "0.62424254", "0.60868007", "0.6083466", "0.59884316", "0.5962596", "0.59224194", "0.59193444", "0.58724576", "0.58690584", "0.58635485", "0.58234787", "0.5769858", "0.57353616", "0.56954324", "0.56790745", "0.560717", "0.5578915", "0.55669844", "0...
0.6612833
0
interval to run countdown
function countdown() { intervalId = setInterval(displayTime, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countdown() {\n clearInterval(interval);\n interval = setInterval(function () {\n var timer = $(\".timer\").html();\n timer = timer.split(\":\");\n var minutes = timer[0];\n var seconds = timer[1];\n seconds -= 1;\n if (minutes < 0) return;\n else if (seconds < 0 &...
[ "0.7683274", "0.76431954", "0.75435644", "0.7344409", "0.73337334", "0.7329125", "0.7244482", "0.7208767", "0.72055286", "0.7205418", "0.7196892", "0.7126494", "0.7096709", "0.70598674", "0.70282567", "0.7014288", "0.6964958", "0.69421315", "0.69302624", "0.6901684", "0.68958...
0.76818365
1
question functionality displays question
function question() { $('.question').html(questions[index].question); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function questionDisplay (){\n\t\tseinfeld.data[count].postQuestAns();\n\t\tseinfeld.data[count].correctAnswer();\n\t\tseinfeld.data[count].incorrectAnswers();\n\t}", "function displayQuestion()\n{\n\tvar params = getParams();\n\tvar questionId = parseInt(params[\"questionId\"])\n\tgetAnswers(displayQuestion_cal...
[ "0.8266126", "0.7906978", "0.778399", "0.77679634", "0.7767114", "0.7759791", "0.7710048", "0.7702106", "0.76865125", "0.7645567", "0.7637448", "0.75920224", "0.75882584", "0.7588063", "0.75688165", "0.7561079", "0.7541321", "0.7538878", "0.75292856", "0.7528101", "0.75245225...
0.80529135
1
function used to display next question after 5 seconds
function displayNextQuestion() { setTimeout(nextQuestion, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayNextQuestion() {\n currentQuestion();\n qTimeOnScreen = setInterval(currentQuestion, 10000 * 3);\n}", "function nextQuestion() {\n if (questionCounter < questions.length) {\n time = 15;\n $(\"#gameScreen\").html(\n \"<p>You have <span id='timer'>\" + time + \"</span> sec...
[ "0.8432854", "0.82732934", "0.8136375", "0.8051393", "0.8047798", "0.8011653", "0.7991274", "0.7983966", "0.79499537", "0.7921714", "0.7916895", "0.7910438", "0.7859566", "0.7853355", "0.78325784", "0.78211445", "0.7811635", "0.7784051", "0.7779398", "0.7750663", "0.7742217",...
0.9167564
0
Replace all HTML5 video and audio tags in given selector with jPlayer equivalents
function jpUpdate(target) { var audios = $(target).find('audio'); audios.each(function(i){ if (!ie8_lower) { $(this).get(0).pause(); } initAudio($(this)); }); var videos = $(target).find('video'); videos.each(function(i){ if (!ie8_lower) { $(this).get(0).pause(); } initVideo($(this)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "convertMedia(html) {\n var cls = 'class=\"responsive-video\"';\n var frm = '<div class=\"responsive-container\"><iframe '+cls+' src=\"//_URL_\" frameborder=\"0\" allowfullscreen id=\"mediaplayer\"></iframe></div>';\n var converts = [\n {\n rx: /^(?:https?:)?\\/\\/(?:www\\.)?vimeo\\.com\\/([^\\...
[ "0.57659054", "0.57659054", "0.5579195", "0.5521811", "0.5517646", "0.54844564", "0.5475307", "0.5302662", "0.52613175", "0.5241018", "0.52379674", "0.5216689", "0.51811886", "0.5152989", "0.5094919", "0.50888664", "0.5084276", "0.50764364", "0.506993", "0.5063129", "0.505010...
0.587396
0
Insert a new audio jPlayer and controller with given ID into insert selectors. Return player element
function genAudio(id, insertControls, insertPlayer) { var player = genPlayer(id); if (insertControls) { var controls = genControls('audio'); $(controls).appendTo(insertControls); } return $(player).appendTo(insertPlayer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insertPlayer_() {\n\t\tthis.removePlayer_();\n\t\tconst wrapper = document.getElementById( this.CssIds_.CONTAINER );\n\t\tif (wrapper) {\n\t\t\tconst html = `\n\t\t\t\t<div id=\"audio_player\" class=\"sound\">\n\t\t\t\t\t<audio preload=\"metadata\" ${this.muted_ ? 'muted' : ''}></audio>\n\t\t\t\t\t<button id=\"tog...
[ "0.6082636", "0.5775603", "0.5640212", "0.5472321", "0.5419815", "0.5323208", "0.52992517", "0.5260418", "0.5243827", "0.5238865", "0.5233157", "0.5215085", "0.5213365", "0.51908207", "0.513434", "0.51187724", "0.5108131", "0.5090944", "0.5078815", "0.5059142", "0.5048496", ...
0.6130819
0
Insert a new video jPlayer and controller with given ID into insert selectors. Return player element
function genVideo(id, insertControls, insertPlayer) { var player = genPlayer(id); var controls = genControls('video'); var returner = $(player).appendTo(insertPlayer); $(controls).appendTo(insertControls); return returner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateVideoPlayer(element) {\n element.appendChild(this.videoElement);\n }", "function loadNextVideoAfterThisLoad(id){\n // It was called many times so I inclueded a validation to check if the element was already created\n if(id <= numVideos && !($('#current_video'+id).length > 0) ){\n var $di...
[ "0.5637464", "0.54820454", "0.5476199", "0.5424181", "0.540897", "0.5379674", "0.53179896", "0.5233991", "0.5220125", "0.52192044", "0.52189964", "0.52181", "0.5208878", "0.5205529", "0.5194242", "0.514152", "0.5086806", "0.50832456", "0.5045618", "0.5042421", "0.5038185", ...
0.63257766
0
wrap all functions on an object such that they return a promise instead of taking an event handler
function promisify(obj) { let wrapped = { unwrapped: obj }; for (let fn in obj) { let fun = obj[fn]; if (fun instanceof Function) { wrapped[fn] = (function () { let args = []; for (let i = 0; i < arguments.length; ++i) args[i] = arguments[i]; let promise = new Promise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapHandler(fn) {\r\n if (typeof fn !== 'function') return fn\r\n return function wrappedHandler(val) {\r\n if (!promise.__NR_wrapper) return fn.call(this, val)\r\n return promise.__NR_wrapper(this, fn, next, val)\r\n }\r\n }", "function makeHandledPromise(EPr...
[ "0.6499225", "0.64091814", "0.63150626", "0.6294052", "0.6229443", "0.6003684", "0.59679425", "0.59019303", "0.5901368", "0.58667606", "0.58428884", "0.5746634", "0.5722692", "0.5688672", "0.5668696", "0.5646605", "0.5645821", "0.5612417", "0.56046164", "0.5596108", "0.559610...
0.6752436
0
Set the compiler so that we can have separate compiler spaces per list of components
_setCompiler(compiler) { this._compiler = compiler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Compiler () {}", "function useCompiler() {\n\tthis.Compiler = toPreact;\n}", "static compile() {\n this.compileComponent()\n }", "function Compiler(){\n this._units = [];\n this._symTab = new SymTab();\n}", "function Compiler() {\n}", "compile() {\n const compiler = this.g...
[ "0.6355743", "0.62523496", "0.6171309", "0.60928005", "0.60680884", "0.57727283", "0.56883013", "0.56779695", "0.56009233", "0.56009233", "0.56009233", "0.56009233", "0.5577297", "0.5473223", "0.5433418", "0.5433418", "0.5362431", "0.5348967", "0.5318941", "0.5318941", "0.531...
0.6647823
0
prompt media stream, pass to video element and play
async function stream() { try{ const media = await navigator.mediaDevices.getDisplayMedia(); videoElement.srcObject = media; videoElement.onloadedmetadata = () => { videoElement.play(); } }catch (error){ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function selectMediaStream() { // this function will prompt user to select video source then play it\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getDisplayMedia(); // mediaStream will be assigned which window or screen the user will select to share\r\n videoElement.srcObje...
[ "0.74369687", "0.72246385", "0.7190643", "0.7068209", "0.7016645", "0.70086634", "0.697835", "0.6966682", "0.69442505", "0.69391274", "0.6917656", "0.69038236", "0.6899819", "0.6899313", "0.68990093", "0.68966615", "0.68894356", "0.6870745", "0.6862987", "0.68560886", "0.6853...
0.73463863
1
Apply link fix when we first mount the component...
componentDidMount() { this.applyLinkFixes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidUpdate() {\n this.applyLinkFixes();\n }", "componentDidMount() {\n this.checkResetLink();\n }", "onLink() {\n this.addLink = !this.addLink;\n }", "componentDidMount(): void {\n this.refs.Navigator.navigationContext.addListener('didfocus', this._handleNavigationEvent.bin...
[ "0.687259", "0.6209634", "0.61723846", "0.59132785", "0.58514017", "0.58362526", "0.57524157", "0.5750238", "0.56537557", "0.56470925", "0.5643888", "0.5607733", "0.55727494", "0.5569067", "0.5564052", "0.55559564", "0.5550757", "0.552624", "0.5514692", "0.55064064", "0.55049...
0.80758846
0
Function to delete last character from displayed value
function del (x) { let last = x.charAt(x.length - 1); //if only one character on screen display 0 else: replace last item with nothing return x = x.length === 1 ? x = '0' : x.replace(last, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get removeLastDigit(){\n\t\tlet textDisplay = this.labelDisplay;\n\n\t\treturn textDisplay.substr(0, textDisplay.length - 1);\n\t}", "function backspace(){\r\n display.value = display.value.slice(0, display.value.length -1)\r\n}", "function backspace(){\r\n var value = output.value;\r\n output.value = v...
[ "0.7865356", "0.7107022", "0.70725816", "0.6961379", "0.6883583", "0.68818164", "0.687594", "0.6871916", "0.6834299", "0.67943984", "0.6748658", "0.6721611", "0.66472286", "0.66392505", "0.65929407", "0.6555487", "0.6536303", "0.64622456", "0.6437072", "0.6378377", "0.6369788...
0.72213715
1
Create the tabs section assumes an empty element with 'tabs' id to put the data inside it
static createTabsSection() { try { let section = document.createElement("DIV"); section.id = "tabs-bar"; section.classList.add("tabs-bar"); document.getElementById("tabs").appendChild(section); } catch(error) { console.log("Error at Tabs.createTabsSection,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populate_tabs() {\n const menu_tabs = document.querySelector(\"#menu_tabs\");\n menu_tabs.append(tab_1);\n menu_tabs.append(tab_2);\n menu_tabs.append(tab_3);\n menu_tabs.append(tab_4);\n menu_tabs.append(tab_5);\n }", "function buildTabs(data, id) {\n let ul = getUlForData...
[ "0.775573", "0.772107", "0.74971867", "0.7301278", "0.72218525", "0.7193161", "0.7013939", "0.6966351", "0.6931595", "0.691609", "0.6901774", "0.6879716", "0.68317014", "0.6793713", "0.67828894", "0.6780317", "0.677351", "0.67656106", "0.67632914", "0.67432004", "0.67428964",...
0.7739739
1
You must write a function that takes 4 arguments. A start value An end value A callback to call if the number is divisible by 3 A callback to use if the number is divisible by 5
function myFunction(startVal, endVal, threeCallback, fifeCallback) { //Array Generation let myArray = []; let j = 0; if (startVal < endVal) { for (let i = startVal; i <= endVal; i++) { myArray[j] = i; j++; } } else if (endVal < startVal) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) {\n const values = [];\n // Add your code here\n//step 1: create a new function that starts from the start value to the end value, note stopIndex + 1 to include the last element\n for (var i = startIndex; i < stopIndex + 1; i++) {\n value...
[ "0.77093935", "0.7159682", "0.6918712", "0.6880639", "0.6833248", "0.67870694", "0.67155474", "0.66852343", "0.6661041", "0.665323", "0.6644484", "0.6613743", "0.6613476", "0.6575722", "0.6545254", "0.654203", "0.65381116", "0.6477737", "0.6446028", "0.63750774", "0.633265", ...
0.76666796
1
function to create fake home details in DB before running the tests
function seedHomeData(){ console.info("seed HOME db collection"); const seedData = []; for (let i = 1; i <= 5; i++) { seedData.push({ address: { streetAddress: faker.address.streetAddress(), city: faker.address.city(), state: faker.address....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupData() {\n let date = Date.now();\n let testUser = {};\n testUser.name = 'Test User 1';\n testUser.email = 'tester@test.com';\n testUser.username = 'testusername';\n testUser.password = 'abcdefg1!C';\n testUser.fridgeIngredients = [\"chicken\", \"cheese\"];\n testUser.createdDate = date;\n t...
[ "0.61922413", "0.6173045", "0.5885041", "0.58676964", "0.5800614", "0.57464623", "0.5674721", "0.5623952", "0.56170475", "0.5541912", "0.55125207", "0.55098975", "0.55022925", "0.54925084", "0.54073334", "0.54043037", "0.5395368", "0.5381424", "0.5374196", "0.5373464", "0.535...
0.6644639
0
Enable/disable toggle button depending on whether PiP availability.
function showPipButton() { togglePipButton.disabled = (video.readyState === 0) || !document.pictureInPictureEnabled || video.disablePictureInPicture; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function togglePvOnly() {\n var btn = document.querySelector('#pv-switch');\n if (btn) {\n if (btn.className.indexOf(' active') >= 0) {\n // show all thumbs\n btn.className = btn.className.replace(' active', ''); //?\n enableAllPvThumbs();\n ...
[ "0.71033245", "0.6505797", "0.64416885", "0.61696655", "0.6133247", "0.60927504", "0.6084497", "0.6068615", "0.6068557", "0.6050593", "0.6021319", "0.5997112", "0.599503", "0.5987673", "0.5987673", "0.5982321", "0.59811616", "0.5971586", "0.5958303", "0.59402585", "0.59382284...
0.67709786
1
core Algorithm how to use: 1, configuration 2, do insertionSort 3, do removeDuplicate 4, do lengthComparison, which will give the final result; parse data>Sort>remove duplicate>comparison>give result
function Algorithm(){ var self = this; self.data = null; self.sData = null; self.resultSet = []; self.sortedData = null; self.uniqueSortedData = null; self.lengthOfInput = 0; self.duplicate = { length : 0 }; self.specialResult = []; /** * configure the algo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortArray(length) {\n this.dataStore = [];\n this.length = length;\n this.setData = setData;\n this.toString = toString;\n this.swap = swap;\n this.bubbleSort = bubbleSort;\n this.selectionSort = selectionSort;\n this.insertionSort = insertionSort;\n \n for (var i = 0; i < this.length; i++) {\n ...
[ "0.63401985", "0.6286638", "0.62309825", "0.6059598", "0.602133", "0.594596", "0.58878446", "0.5882051", "0.5838774", "0.5785696", "0.5738169", "0.5703092", "0.57030857", "0.5680878", "0.5617711", "0.56173974", "0.5611685", "0.55840874", "0.556265", "0.5527715", "0.55244565",...
0.72614557
0
Restores the sortable order from a cookie
function restoreOrder(sortable, cookieName) { var list = $(sortable); if (!list) return; // fetch the saved cookie var cookie = $.cookie(cookieName); if (!cookie) return; // create array from cookie var IDs = cookie.split(","); // fetch current order var items = list.sortable("toA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreOrder() {\n var list = $(setSelector);\n if (list == null) return\n\n // fetch the cookie value (saved order)\n var cookie = $.cookie(setCookieName);\n if (!cookie) return;\n\n // make array from saved order\n var IDs = cookie.split(\",\");\n\n // fetch current order\n var items = list.sor...
[ "0.78915584", "0.7417648", "0.653464", "0.64814675", "0.6366259", "0.62962115", "0.62140024", "0.60394335", "0.5799197", "0.5722009", "0.5668561", "0.565669", "0.5650901", "0.55486935", "0.5545454", "0.55191064", "0.54842913", "0.5461421", "0.54607326", "0.54544735", "0.54442...
0.7965304
0
REVERSE TABLE Reverses a table ordering
function reverseTable() { /* for(var i = 1; i<trs.length; i++) { table.tBodies[0].insertBefore(trs[i], trs[0]); } */ for(var i = 0; i<trs.length/2; i++){ exchange(i,trs.length-1-i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverseTable()\n\t{\n\t\tfor(var i = 1; i<trs.length; i++)\n\t\t{\n\t\t\ttable.tBodies[0].insertBefore(trs[i], trs[0]);\n\t\t}\n\t}", "function reverse() {}", "function reverseRows(matrix) {\n for (i in matrix) {\n matrix[i] = matrix[i].reverse();\n }\n}", "function reverse(state) {\n\tlet reve...
[ "0.824942", "0.6686586", "0.66005546", "0.62993425", "0.6139042", "0.6121479", "0.6093485", "0.60596156", "0.6055936", "0.5983", "0.5976192", "0.59455633", "0.5845492", "0.58366", "0.5836061", "0.5836061", "0.581079", "0.5805163", "0.57959104", "0.57554746", "0.57362944", "...
0.8343109
0
helper function to format the array of burgers and their toppings to return back to the client
function formatBurgers(burgers){ for(var i = 0; i < burgers.length; i++){ burgers[i].dataValues.Toppings = formatToppings(burgers[i].dataValues.Toppings); burgers[i] = burgers[i].dataValues; } return burgers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatBurgers(burgersToppings){\n for(var i = 0; i < burgersToppings.length; i++){\n var toppings = burgersToppings[i].toppings;\n var toppingsArr = toppings.split(',');\n toppings = [];\n for(var j = 0; j < toppingsArr.length; j++){\n var toppingObj = {\n ...
[ "0.70606226", "0.6318488", "0.59062994", "0.58155966", "0.57897455", "0.5600992", "0.5584159", "0.5529648", "0.55101055", "0.54670686", "0.54587334", "0.5438467", "0.54184973", "0.54072696", "0.54031056", "0.53900796", "0.53617746", "0.53387034", "0.5330115", "0.5325646", "0....
0.7219807
0
helper function to format the Toppings
function formatToppings(toppings){ for(var i = 0; i < toppings.length; i++){ toppings[i] = toppings[i].dataValues; } return toppings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatBurgers(burgersToppings){\n for(var i = 0; i < burgersToppings.length; i++){\n var toppings = burgersToppings[i].toppings;\n var toppingsArr = toppings.split(',');\n toppings = [];\n for(var j = 0; j < toppingsArr.length; j++){\n var toppingObj = {\n ...
[ "0.6213537", "0.59431064", "0.5843802", "0.583722", "0.57755", "0.5688864", "0.566562", "0.5662416", "0.56370354", "0.5606338", "0.54985726", "0.5441842", "0.5433401", "0.5426476", "0.53998727", "0.5334366", "0.53073114", "0.5299541", "0.5275607", "0.5257654", "0.52351636", ...
0.72983605
0
3.2 You must write a function that takes 4 arguments. A start value An end value A callback to call if the number is divisible by 3 A callback to use if the number is divisible by 5 The function should first generate an array containing values from start value to end value (inclusive). Then the function should take the...
function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) { const values = []; // Add your code here //step 1: create a new function that starts from the start value to the end value, note stopIndex + 1 to include the last element for (var i = startIndex; i < stopIndex + 1; i++) { values.push(i);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myFunction(startVal, endVal, threeCallback, fifeCallback) {\n //Array Generation\n let myArray = [];\n let j = 0;\n if (startVal < endVal) {\n for (let i = startVal; i <= endVal; i++) {\n myArray[j] = i;\n j++;\n }\n } else if (endVal < sta...
[ "0.8493594", "0.7480378", "0.67656136", "0.67277294", "0.66652787", "0.6501159", "0.6426637", "0.6420295", "0.62929446", "0.62926286", "0.6238978", "0.6231914", "0.6228095", "0.61918074", "0.61858135", "0.61849284", "0.61474997", "0.61258143", "0.61239606", "0.61054116", "0.6...
0.8160962
1
check if notes textarea is valid
notesIsValid () { const notesValid = this.notes.trim() !== ""; return notesValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validTexArea() {\n if (jsValidTextArea.classList.contains('js-valid-textarea')) {\n if (jsValidTextArea.value === \"\" || jsValidTextArea.value === \" \") {\n errorValid(jsValidTextArea, errorMessage.notText)\n continu...
[ "0.73299104", "0.7044461", "0.6795868", "0.6728313", "0.6648532", "0.65469676", "0.6400733", "0.6397275", "0.63907874", "0.62292963", "0.61735517", "0.6172875", "0.61483926", "0.6139279", "0.6105183", "0.6094363", "0.6090034", "0.6056084", "0.60528505", "0.60258675", "0.59649...
0.7495706
0
check if form is valid date, phase, status, textarea are required
formIsValid () { const vaildForm = this.dateIsValid() && this.phaseIsValid() && this.statusIsValid() && this.notesIsValid(); return vaildForm; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateForm() {\n return header.length > 0 && details.length > 0;\n }", "function formIsValid() {\n //client side validation this is faster than the one in apiserver.js which is server sided\n const { title, plot, genre } = movie;\n const errors = {}; //make an error object\n\n //add in...
[ "0.73914737", "0.728479", "0.7256638", "0.72483444", "0.7225258", "0.72076684", "0.7170613", "0.7149752", "0.71343493", "0.71292037", "0.7094193", "0.7083921", "0.70762956", "0.7074038", "0.7074038", "0.70728844", "0.70422685", "0.70422", "0.70407325", "0.7039067", "0.7036528...
0.7686333
0
Returns the players sorted by the pointsWon in ascending order
getPlayersByPoints() { return [this.playerOne, this.playerTwo].sort((a, b) => a.pointsWon - b.pointsWon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPlayersByGames() {\n return [this.playerOne, this.playerTwo].sort((a, b) => a.gamesWon - b.gamesWon);\n }", "function sortPlayers(){\n parsedlclStrgObjArr.sort(function(a, b) {\n if (a.totalPoints === b.totalPoints) {\n return (b.percentWon) - (a.percentWon);\n } else {\n return (b.totalP...
[ "0.7908332", "0.78794277", "0.7001949", "0.685847", "0.68099177", "0.6551991", "0.6518253", "0.6380098", "0.6348932", "0.63459563", "0.62776333", "0.6195942", "0.61493826", "0.6120751", "0.611606", "0.6096417", "0.60827273", "0.6038169", "0.6036647", "0.598458", "0.5981079", ...
0.85463476
0
Returns the players sorted by the gamesWon in ascending order
getPlayersByGames() { return [this.playerOne, this.playerTwo].sort((a, b) => a.gamesWon - b.gamesWon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPlayersByPoints() {\n return [this.playerOne, this.playerTwo].sort((a, b) => a.pointsWon - b.pointsWon);\n }", "function sortPlayers(){\n parsedlclStrgObjArr.sort(function(a, b) {\n if (a.totalPoints === b.totalPoints) {\n return (b.percentWon) - (a.percentWon);\n } else {\n return (b.tot...
[ "0.7547394", "0.7484801", "0.74743944", "0.70660466", "0.68631047", "0.684731", "0.6536075", "0.64961493", "0.64184123", "0.6356601", "0.6302553", "0.629776", "0.62881434", "0.6281489", "0.62603366", "0.6233794", "0.62142", "0.61917776", "0.6189823", "0.61720544", "0.61617464...
0.8542897
0
This class defines a complete listener for a parse tree produced by YarnParser.
function YarnParserListener() { antlr4.tree.ParseTreeListener.call(this); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Listener() {\n\tantlr.tree.ParseTreeListener.call(this);\n this.nodeMap = {};\n this.nodeEdges = [];\n this.trivialRoot = null;\n this.crnt_id = -1;\n this.makeCytoNode = makeCytoNode;\n\treturn this;\n}", "function JavaParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\tre...
[ "0.6343357", "0.60443354", "0.6041594", "0.5970222", "0.58580244", "0.5821024", "0.580914", "0.5797676", "0.57707906", "0.5752238", "0.5736505", "0.5727883", "0.5727883", "0.56872046", "0.56795555", "0.561881", "0.5612179", "0.5591288", "0.55555505", "0.5551976", "0.5551976",...
0.81286144
0
A decision tree model based on 1000 previous inites which predict weather an order will arrive on time based on the following features: catalogNumber, supplyTime, length, hollidays, materialsInInventory.
function predictIsOnTime(catalogNumber, supplyTime, length, hollidays, materialsInInventory) { if (catalogNumber == null) { return "Probably"; } else if (catalogNumber > 2) { if (supplyTime == null) { return "Probably"; } else if (supplyTime > 2) { if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "train(){\n console.log(\"training...\");\n this.dt = new ml.DecisionTree({\n data : this.dataArray,\n result : this.resultArray\n });\n \n this.dt.build();\n\n }", "doYourThing(conversion, trainingData ) {\n alert(\"Run a decision tree: \" + convers...
[ "0.6005395", "0.53778076", "0.53579676", "0.5342296", "0.5322741", "0.5299015", "0.5263918", "0.525124", "0.51350456", "0.51057684", "0.50986934", "0.50522375", "0.50294733", "0.49964842", "0.4986605", "0.49799472", "0.49643424", "0.49341255", "0.4907638", "0.49060947", "0.49...
0.5749092
1
============================================================================================== ???? ???????. ip?? port?? object?? ??? flash?? server_connect?? ??????.
function Connect_Server() { try{ var conn=new Object(); conn.ip = "211.238.156.202"; conn.port =21002; conn.crossport = 21002; }catch(e){ alert("error, "+e); } thisMovie("FClient").connect(conn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connectToServer() {\n\t\n}", "connect () {}", "function connect() {\n php.server(conf.server.connect);\n}", "serve(o) {\n\t\t_.connect.server(o)\n\t}", "function client() {\r\n\r\n\tthis.id = 0;\r\n\tthis.socket = 0;\r\n\tthis.port = 0;\r\n\tthis.state=0;\r\n\tthis.c_mjpeg=0;\r\n\tthis.c_rtp=0;\r...
[ "0.6710709", "0.6408603", "0.63616717", "0.62854064", "0.6207904", "0.6187181", "0.61043304", "0.60859454", "0.60589385", "0.6038584", "0.6001089", "0.5953703", "0.59300226", "0.58696806", "0.58613884", "0.5856836", "0.58471364", "0.58204985", "0.58059573", "0.580392", "0.580...
0.74701244
0
Event: Click advanced. Routes to the JSON editor
onClickAdvanced() { location.hash = location.hash.replace('/forms/', '/forms/json/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeJsonClicks(e) {\n var params = builder.locator.create(e.target);\n if (isTypeOrClickInSamePlace(builder.getScript().getLastStep(), params)) {\n if (e.type == 'dblclick' &&\n { 'clickElement': 1, 'clickElementWithOffset': 1, 'doubleClickElement': 1 }[builder.getScript().getLastStep...
[ "0.6685994", "0.6054997", "0.58817154", "0.5860246", "0.58586484", "0.57831657", "0.57462484", "0.5719581", "0.56810164", "0.55243057", "0.5521766", "0.55151886", "0.5510677", "0.55047005", "0.5500803", "0.5468874", "0.54640347", "0.5463687", "0.54590833", "0.5450654", "0.544...
0.6088959
1
Event: Click add input
onClickAddInput() { if(!this.model.inputs['newinput']) { this.model.inputs['newinput'] = { type: 'text' }; } this.render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInput(e) {\n const input = document.createElement(\"input\");\n input.type = \"text\";\n input.id = e.id;\n input.size = \"10\";\n\n const container = document.querySelector('#list-container');\n const newDiv = document.createElement(\"div\");\n newDiv.className = \"word-input\";\n...
[ "0.6970022", "0.6939052", "0.6835337", "0.6795334", "0.6783906", "0.67687917", "0.66771764", "0.6676834", "0.6639781", "0.6633403", "0.6619826", "0.6600372", "0.65898603", "0.65648746", "0.6523227", "0.6513063", "0.650288", "0.64721805", "0.64515144", "0.64326745", "0.6386917...
0.7779828
0
displayRapperGifs function rerenders the HTML to display the appropriate content
function displayRapperGifs() { var rapper = $(this).attr("data-name"); var giphyURL = "https://api.giphy.com/v1/gifs/search?q=" + rapper + "&limit=10&rating=pg-13&api_key=dc6zaTOxFJmzC"; //"http://www.omdbapi.com/?t=" + rapper + "&y=&plot=short&apikey=40e9cece"; // Creates AJAX call f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayGifs(response) {\n\t\t// clears out any gifs that were on already display in the .gifs div, if applicable\n\t\t$('.gifs').html('');\n\n\t\t// Selects first 6 gifs from API and displays them to the screen\n\t\tfor (i = 0; i < 6; i++) {\n\t\t\t// store gif URL from API response into animatedGifURL va...
[ "0.7112866", "0.7045143", "0.69928586", "0.6965453", "0.69168466", "0.6896287", "0.6891432", "0.6886117", "0.68709785", "0.68705505", "0.6847421", "0.68369913", "0.6833177", "0.68191266", "0.6778564", "0.677337", "0.67693007", "0.67552245", "0.67439854", "0.67400485", "0.6735...
0.7533717
0
Determines if promiseOrValue is a promise or not. Uses the feature test from to determine if promiseOrValue is a promise. Parameters: promiseOrValue anything Return true if promiseOrValue is a promise.
function isPromise(promiseOrValue) { return promiseOrValue && typeof promiseOrValue.then === 'function'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}", "function isPromise(va...
[ "0.76041996", "0.76041996", "0.76041996", "0.76041996", "0.7520465", "0.74745435", "0.7310917", "0.72979295", "0.7208998", "0.7208998", "0.7208998", "0.71028453", "0.70313364", "0.6969815", "0.6969815", "0.6969815", "0.6969815", "0.67829114", "0.6755243", "0.6737798", "0.6737...
0.8324764
0
Register a handler for a promise or immediate value Parameters: promiseOrValue anything Returns a new promise that will resolve: 1. if promiseOrValue is a promise, when promiseOrValue resolves 2. if promiseOrValue is a value, immediately
function when(promiseOrValue, callback, errback, progressHandler) { var deferred, resolve, reject; deferred = defer(); resolve = callback ? callback : function(val) { return val; }; reject = errback ? errback : function(err) { return err; }; if(isPromise(promiseOrValue)) { // If it's a promise, ensur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHandler(promise, value, success) {\n return function(onFulfilled, onRejected) {\n var callback = success ? onFulfilled : onRejected,\n result;\n if (typeof callback !== func) {\n return promise;\n }\n execute(callback, value, result = createDeferred());\n re...
[ "0.6651127", "0.65909547", "0.648903", "0.6442073", "0.6135877", "0.61322874", "0.6125091", "0.60373425", "0.5846279", "0.58392984", "0.57853705", "0.56608933", "0.56459564", "0.5575847", "0.5515157", "0.54761165", "0.54520005", "0.54427475", "0.5421926", "0.5407483", "0.5387...
0.68484956
0
Return a promise that will resolve when howMany of the supplied promisesOrValues have resolved. The resolution value of the returned promise will be an array of length howMany containing the resolutions values of the triggering promisesOrValues.
function some(promisesOrValues, howMany, callback, errback, progressHandler) { var toResolve, results, ret, deferred, resolver, rejecter, handleProgress; toResolve = Math.max(0, Math.min(howMany, promisesOrValues.length)); results = []; deferred = defer(); ret = (callback || errback || progressHandler) ? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all(promisesOrValues, callback, errback, progressHandler) {\n\t\treturn some(promisesOrValues, promisesOrValues.length, callback, errback, progressHandler);\n\t}", "function any(promisesOrValues, callback, errback, progressHandler) {\n\t\treturn some(promisesOrValues, 1, callback, errback, progressHandl...
[ "0.6632578", "0.64165014", "0.5387751", "0.5327628", "0.5224615", "0.5181354", "0.5181354", "0.5181354", "0.5181354", "0.5151758", "0.5151758", "0.51141137", "0.5062978", "0.5047788", "0.5013433", "0.49972495", "0.49796137", "0.4927593", "0.4908495", "0.4908495", "0.48511383"...
0.6581831
1
Return a promise that will resolve only once all the supplied promisesOrValues have resolved. The resolution value of the returned promise will be an array containing the resolution values of each of the promisesOrValues.
function all(promisesOrValues, callback, errback, progressHandler) { return some(promisesOrValues, promisesOrValues.length, callback, errback, progressHandler); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function any(promisesOrValues, callback, errback, progressHandler) {\n\t\treturn some(promisesOrValues, 1, callback, errback, progressHandler);\n\t}", "function some(promisesOrValues, howMany, callback, errback, progressHandler) {\n\t\tvar toResolve, results, ret, deferred, resolver, rejecter, handleProgress;\n\...
[ "0.68573356", "0.6390334", "0.5922018", "0.58027095", "0.5684518", "0.5684518", "0.5684518", "0.5684518", "0.5676212", "0.56714094", "0.56714094", "0.556904", "0.5549157", "0.5401113", "0.5362587", "0.52841634", "0.52622706", "0.5216371", "0.5216371", "0.5106748", "0.50988775...
0.7070875
0
Return a promise that will resolve when any one of the supplied promisesOrValues has resolved. The resolution value of the returned promise will be the resolution value of the triggering promiseOrValue.
function any(promisesOrValues, callback, errback, progressHandler) { return some(promisesOrValues, 1, callback, errback, progressHandler); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all(promisesOrValues, callback, errback, progressHandler) {\n\t\treturn some(promisesOrValues, promisesOrValues.length, callback, errback, progressHandler);\n\t}", "function some(promisesOrValues, howMany, callback, errback, progressHandler) {\n\t\tvar toResolve, results, ret, deferred, resolver, reject...
[ "0.6239276", "0.61444545", "0.5763163", "0.5317711", "0.5181236", "0.5143111", "0.5072346", "0.50453556", "0.5037433", "0.499957", "0.49171808", "0.49074718", "0.49074718", "0.49074718", "0.49074718", "0.48993146", "0.48523244", "0.48523244", "0.48108813", "0.48108813", "0.48...
0.7035053
0
Ensure that resolution of promiseOrValue will complete resolver with the completion value of promiseOrValue, or instead with optionalValue if it is provided. Parameters: promiseOrValue Promise, that when completed, will trigger completion of resolver, or value that will trigger immediate resolution of resolver resolver...
function chain(promiseOrValue, resolver, resolveValue) { var inputPromise, initChain; inputPromise = when(promiseOrValue); // Check against args length instead of resolvedValue === undefined, since // undefined may be a valid resolution value. initChain = arguments.length > 2 ? function(resolver) { retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function when(promiseOrValue, callback, errback, progressHandler) {\n\t\tvar deferred, resolve, reject;\n\n\t\tdeferred = defer();\n\n\t\tresolve = callback ? callback : function(val) { return val; };\n\t\treject = errback ? errback : function(err) { return err; };\n\n\t\tif(isPromise(promiseOrValue)) {\n\t\t\t...
[ "0.62485266", "0.59768844", "0.57161623", "0.57076716", "0.55044764", "0.5452001", "0.5400689", "0.5378111", "0.5297034", "0.5264929", "0.526104", "0.5250208", "0.5184217", "0.51454425", "0.51271576", "0.5120758", "0.5120758", "0.511948", "0.5109041", "0.5109041", "0.5109041"...
0.680263
0
Internal chain helper that does not create a new deferred/promise Always returns it's 2nd arg. NOTE: deferred must be a when.js deferred, or a resolver whose functions can be called without their original context.
function _chain(promise, deferred, resolveValue) { promise.then( // If resolveValue was supplied, need to wrap up a new function // If not, can use deferred.resolve directly arguments.length > 2 ? function() { deferred.resolve(resolveValue) } : deferred.resolve, deferred.reject, deferred.progre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapWithDeferred(obj) {\n\t\t//if it is a deferred, then, trust it, return it.\n\t\tif (obj && $.isFunction(obj.promise)) {\n\t\t\treturn obj;\n\t\t} else {\n\t\t\tvar dfd = $.Deferred();\n\t\t\tdfd.resolve(obj);\n\t\t\treturn dfd;\n\t\t}\n\t}", "then(resolve,reject){return this._deferred.promise.then(r...
[ "0.62415564", "0.62211686", "0.61844945", "0.59999335", "0.5898173", "0.58236307", "0.58033264", "0.58033264", "0.57536083", "0.56995577", "0.5599654", "0.55823326", "0.5533156", "0.55240107", "0.54931104", "0.5489199", "0.54888445", "0.54888445", "0.54859436", "0.54859436", ...
0.6929223
0
Register a service provider with the application
register(serviceProvider) { this.serviceProviders.push(serviceProvider); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "registerService(service) {\n this.services.push(service);\n }", "registerServices() {\n app.logger.info(` - Registering ${Object.keys(app.service).length} services`);\n _.each(app.service, (Service, key) => {\n let ServiceProvider = new Service;\n\n if (!ServiceProvi...
[ "0.66163915", "0.62573415", "0.61358225", "0.59686124", "0.58411586", "0.57527715", "0.5700797", "0.5537677", "0.5479721", "0.5465177", "0.5464767", "0.5462988", "0.5458892", "0.5454674", "0.5442307", "0.5442307", "0.5439082", "0.5423815", "0.54127693", "0.53725564", "0.53723...
0.7879137
0
Boot the application. This should be called after all providers are registered
boot() { this.serviceProviders.forEach(serviceProvider => { serviceProvider.register(this); }); this.serviceProviders.forEach(serviceProvider => { serviceProvider.boot(this); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async bootProviders() {\n if (this.logger) {\n this.logger.trace('booting providers');\n }\n await this.registrar.boot();\n }", "function bootstrap() {\n\t\t_invokeBootstrappers();\n\t}", "function _boot() {\n // get Ajs config\n if (!(boot.getAjsConfig ...
[ "0.7184425", "0.7052225", "0.6666566", "0.65167516", "0.64954966", "0.6437269", "0.63467246", "0.6317614", "0.6236954", "0.6174842", "0.6104734", "0.6082901", "0.6034834", "0.60044914", "0.593975", "0.5937349", "0.5905789", "0.589372", "0.58880514", "0.585696", "0.5835232", ...
0.7458548
0
Add taskinview to tasks to make visible if in view (don't remove class to indicate it was previously viewed)
function updateInView() { var tasks = document.querySelectorAll(".task") for (var i = 0; i < tasks.length; ++i) { if (inView(tasks[i])) { tasks[i].classList.add("task--inview"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inView (el) {\n var containerPosition = document.getElementById(\"tasks\").getBoundingClientRect();\n var getTaskPosition = el.getBoundingClientRect();\n return containerPosition.height > getTaskPosition.top;\n }", "__changeTaskElementState(task, isHidden) {\n var taskElement;\n if (!tas...
[ "0.64168596", "0.61981744", "0.61378634", "0.6054357", "0.6027974", "0.6010512", "0.5918361", "0.59081674", "0.59013706", "0.58843", "0.58281106", "0.5822658", "0.5804669", "0.5789193", "0.5708236", "0.5703137", "0.56464416", "0.5625372", "0.56058365", "0.5603459", "0.5580752...
0.8467118
0
Sends query to operate.php to add article
function addArticle() { if (!checkAddInput()) { return; } $.get("dblp-tools/operate.php", { title: $("#add-title").val(), authors: $("#add-authors").val(), pyear: $("#add-year").val(), plink: $("#add-link").val(), keywords: $("#add-keywords").val(), do: "insert" }, funct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addArticle() {\n\t\tconsole.log(\"Adding new article...\");\n\t\tvm.showForm = true;\n\t\tvm.formObject.id = Date.now();\n\t\tvm.formObject.position = vm.articles.length;\n\n\t}", "function AddToHitory(article_id) {\n var xhttp;\n if (window.XMLHttpRequest) {\n // code for modern browsers\n...
[ "0.6261317", "0.6245099", "0.6154427", "0.6140037", "0.60241884", "0.5935475", "0.5848317", "0.5756894", "0.5747243", "0.57134813", "0.5712932", "0.5708241", "0.568216", "0.56734395", "0.56416553", "0.5633768", "0.56077534", "0.559807", "0.55960906", "0.5587161", "0.5581267",...
0.65268147
0
Chart helper functions Aroma selection helpers Update node selection in view from svg properties
function sync_node_selection_view() { update_selected_aroma_text(); svg.selectAll("path") .style("opacity", function(d) { if (d.selected || selected_aroma_ids.length === 0) { return 1; } return 0.2 }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatedots(selection) {\n selection.each(function(d) {\n const container = d3.select(this);\n\n // Transition location & opacity\n container.transition()\n .attr('transform', 'translate(' + d.x + ',' + d.y + ')')\n .attr('opacity', 1);\...
[ "0.6486763", "0.6477036", "0.6472165", "0.63644737", "0.63018334", "0.6288903", "0.6285811", "0.6271689", "0.61703944", "0.6162217", "0.61455184", "0.6142863", "0.6123038", "0.609648", "0.6068401", "0.6044371", "0.5991017", "0.5977568", "0.5958207", "0.5951266", "0.59130806",...
0.73784506
0
Update selected aromas in view (svg properties) from selected_aroma_ids array
function select_aromas_from_array(arr) { selected_aroma_ids = arr; svg.selectAll("path").each(function(d) { d.selected = (selected_aroma_ids.indexOf(d.aroma_id) > -1); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sync_aroma_selection() {\n\t\t\t\tsync_node_selection_view();\t\t\t\t\t// view\n\t\t\t\taromas.filterFunction(function(d) { \t\t// crossfilter\n\t\t\t\t\treturn selected_aroma_ids.indexOf(d) > -1; \n\t\t\t\t}); \n\t\t\t}", "_updateImage(){let values=this.originalInputValue;this.svg.querySelectorAll('pat...
[ "0.69867074", "0.6645268", "0.6625487", "0.63628995", "0.61777544", "0.5895492", "0.57514226", "0.54976", "0.5493287", "0.54697174", "0.5440179", "0.53804946", "0.5362226", "0.53561074", "0.5351293", "0.5321535", "0.531245", "0.5293218", "0.5281439", "0.52402896", "0.5220908"...
0.7469237
0
Update selected aroma text from svg properties
function update_selected_aroma_text() { var aroma_text = update_selected_aroma_text_helper(svg.data()[0]); d3.select("#aroma_selection").text(aroma_text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateTitleTextSVG(textSVG){\n this.titleTextSVG = textSVG\n }", "function changesvgtext(event) {\r\n\t\tvar nt = $(\"#\" + PAGE_OPTIONS.elemId).find(\"#textboxeditor input\").val();\r\n\t\tif (PAGE_DATA.seltext != 0) {\r\n\t\t\tPAGE_DATA.seltext.attr(\"text\", nt);\r\n\t\t}\r\n\t}", "updateYesTextSV...
[ "0.6778917", "0.67504853", "0.66529244", "0.6604052", "0.63329715", "0.6295834", "0.6242004", "0.6215871", "0.61530125", "0.6146704", "0.6092228", "0.6091087", "0.6085031", "0.59840584", "0.5919944", "0.5893024", "0.58874625", "0.5855034", "0.5840457", "0.58291745", "0.582361...
0.8230779
0
Set explanation on wheel mouseover
function wheel_mouseover(d) { d3.select("#aroma_hover").text(d.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onMouseWheel(evt) {\r\n evt.stopPropagation();\r\n }", "function mouseWheel(event) {\n yPointer -= event.delta * SCROLL_SPEED;\n}", "_patchWheelOverScrolling(){const selector=this._selector;selector.addEventListener(\"wheel\",e=>{const scroller=selector._scroller||selector.scrollTarget,scrolledToT...
[ "0.64363456", "0.642926", "0.63853025", "0.62190294", "0.6198266", "0.6170966", "0.617073", "0.61433977", "0.6114564", "0.6088883", "0.6066685", "0.6064348", "0.60538936", "0.6048278", "0.5972566", "0.5944822", "0.5933823", "0.59329766", "0.5927514", "0.59201187", "0.59097135...
0.66118366
0
Map selection helpers Update selected country text
function update_selected_country_text() { if (selected_country_ids.length == 0) { $("#region_hover").html("&nbsp"); } else { var selected_countries = remote_json.countries.filter(function (c) { return selected_country_ids.indexOf(c.id) > -1; }); selected_country_text = selected_cou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newCountrySelection(event)\n{\n displayCountryInfo(event.target.value);\n}", "function updateGeo(selectedValue) {\n \tresetMenu('floor');\n \tresetMenu('building');\n \tresetMenu('city');\n \tif (dijit.byId(\"state\")) resetMenu('state');\n \tresetMenu('country');\n \tresetMenu('geo');\n \t//var select...
[ "0.7096466", "0.70361143", "0.6895254", "0.6712719", "0.6710768", "0.6668001", "0.6511579", "0.64663595", "0.6454297", "0.64407134", "0.6427969", "0.6409068", "0.6305443", "0.6303845", "0.6301899", "0.62954324", "0.6275506", "0.62578934", "0.62536687", "0.6217752", "0.6181032...
0.78999543
0
Filter helper functions Return color name from given id
function getNameForId(array, id) { for (var i = 0; i < array.length; i++) { if (array[i].id === id) { return array[i].name.replace("color_", ""); } } return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorById(d) {\n return assignColor(d.fsa_group_id);\n }", "function colors({ $sectionColors, $id }) {\n\treturn $sectionColors[$id]\n}", "getColor(id) {\n return (this.state.selected === id || this.state.highlighted === id) ? '#ff0099' :'#000000';\n }", "function getLighterCo...
[ "0.6547243", "0.65023685", "0.645916", "0.6431826", "0.6424306", "0.6390234", "0.637562", "0.61555576", "0.61508745", "0.6144369", "0.6097456", "0.6089965", "0.60735124", "0.60462743", "0.60455006", "0.59650546", "0.5962881", "0.5958819", "0.59479225", "0.58821744", "0.587054...
0.7683988
0
Here's how to add a simple button with event listener 'sendMsg'
function addSimpleButtonAndClickEvent() { var elem = document.createElement('button'); elem.style.cssText = 'position:fixed; bottom: 5px; left: 5px; color: black'; elem.textContent = 'Click to Send test msg'; elem.id = 'myTestButton'; document.body.appendChild(elem); var btn = document.getElementById(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Boradcast(){\n socket.emit('BroadCastMessege', \"The Button Was Clicked !!\");\n}", "function handleSendButton() {\r\n var msg = {\r\n text: document.getElementById(\"text\").value,\r\n target: document.getElementById(\"user\").value,\r\n type: \"message\",\r\n id: clientID, \r\n dat...
[ "0.7044333", "0.6900865", "0.68154556", "0.6810118", "0.6796084", "0.66907436", "0.6681707", "0.6679161", "0.66786253", "0.6655096", "0.6639609", "0.6617158", "0.6601996", "0.6569879", "0.6557474", "0.65475005", "0.6542717", "0.6513999", "0.6491446", "0.6437819", "0.64267725"...
0.81195575
0
The function return an array of voltage variables
function _getVoltageVariables(){ return ["v","cai","casr","cass","nai","ki","sm","sh","sj","sxr1","sxr2","sxs","sr","ss","sd","sf","sf2","sfcass","srr"]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getVoltageVariables(){\n return [\"v\", \"xm\", \"xh1\", \"xh2\", \"xdl\", \"xfl1\", \"xfl2\", \"xr\",\n \"xs\", \"rsus\", \"ssus\", \"xn\", \"xpa\", \"ccai\", \"ccad\", \"ccaup\",\n \"ccarel\"];\n }", "function _getVoltageVariables(){\...
[ "0.81114125", "0.7956879", "0.78853863", "0.63797593", "0.6261287", "0.59685886", "0.59450567", "0.58569187", "0.57550305", "0.57165086", "0.5700079", "0.56984305", "0.5690196", "0.56271493", "0.5588594", "0.5588563", "0.5531675", "0.548502", "0.54480344", "0.5421537", "0.541...
0.8103679
1
helper function that reads a file, replaces a regex with a string, writes back the file
function fixFile(filename, fileRegex, newString) { var data = fs.readFileSync(filename, 'utf8'); var fixed = data.replace(fileRegex, newString); fs.writeFileSync(filename, fixed); console.log('fixed ' + filename); return fixed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "regularExpression(name, fullname, number, date) {\n var filestream = require('fs');\n try {\n var data = filestream.readFileSync(\"regex.txt\", 'utf8');\n data = data.replace(/<<name>>/g, name)\n data = data.replace(/ <<full name>>/g, fullname)\n data = dat...
[ "0.68754506", "0.6734485", "0.67185694", "0.6088678", "0.6039415", "0.59651965", "0.57274914", "0.57182896", "0.57083726", "0.5488272", "0.5340601", "0.53249335", "0.5194887", "0.5133452", "0.50821185", "0.5039076", "0.50031835", "0.4989576", "0.49840707", "0.49660182", "0.49...
0.76704603
0
If radio or podcast shortcut is present, writes the required background mode into extension's Info.plist file
function updateInfoPlist(appConfiguration) { if (!hasTrackPlayingShortcut(appConfiguration)) { return; } console.log( '[shoutem.audio] - Adding audio background mode to extension Info.plist', ); const plistPath = 'ios/Info.plist'; const currentPlistContents = parsePlist(plistPath); const backgro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onBackgroundMode() { \t\n\tapp_running_status=\"background\";\t\t\t\n}", "function getDefaultBackgroundImageTouchPanel() {\n xapi.Status.UserInterface.Extensions.Widget.get().then((widgets) => {\n for (const widget of widgets) {\n if (widget.WidgetId === 'swap_text_default_ba...
[ "0.59962183", "0.5414712", "0.53271943", "0.5289803", "0.5149109", "0.5106347", "0.49368027", "0.4909386", "0.48871875", "0.48756838", "0.48661792", "0.48575854", "0.48428142", "0.47975037", "0.4796282", "0.47837275", "0.47818998", "0.47803333", "0.4765393", "0.47586396", "0....
0.6400685
0
executed when a worker is created, each worker corresponds to a page we need to create communication channel, and to keep track of workers in Browser.workers to allow for main > page communication
function onWorkerAttach(worker) { worker.channel = createMessageChannel(this.contentScriptOptions, worker.port); worker.channel.onMessage.addListener(function(msg, sender, sendResponse) { // sender is always null, we set it to worker.tab.id return Browser.handleMessage(msg, worker.tab.id, sendResponse); });...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWorker()\n {\n var childWorkerId = workerPool.createWorkerFromUrl('js/'+WORKER_FILENAME);\n workerPool.sendMessage([\"3..2..\", 1, {helloWorld: \"Hello world!\"}], childWorkerId);\n }", "function initiateWorker () {\r\n\r\n // define callback\r\n let cb = (err, result) => {\r\n if (er...
[ "0.7129428", "0.6879721", "0.67575514", "0.6707871", "0.6694096", "0.6613351", "0.6581531", "0.6558736", "0.6549698", "0.6501692", "0.63968194", "0.62602663", "0.6236893", "0.6228554", "0.6179718", "0.6114773", "0.6114773", "0.60903484", "0.60764104", "0.605626", "0.60549474"...
0.6883444
1
loads a binary file from the data directory same as data.load, but data.load does string conversion, and fails for binary files. It's a slight modification of readURISync (which is used by data.load)
function load_binary(uri) { var data = require("sdk/self").data; var channel = NetUtil.newChannel(data.url(uri), null); var stream = channel.open(); var count = stream.available(); var data = NetUtil.readInputStreamToString(stream, count); stream.close(); return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_binary_resource(url) {\n\tvar req = new XMLHttpRequest();\n\treq.open('GET', url, false);\n\t// The following line says we want to receive data as Binary and not as Unicode\n\treq.overrideMimeType('text/plain; charset=x-user-defined');\n\treq.send(null);\n\t// when accessing local files, req.status w...
[ "0.6874969", "0.6761148", "0.6761148", "0.6761148", "0.6761148", "0.6761148", "0.6761148", "0.6761148", "0.6761148", "0.6759522", "0.6676378", "0.6407485", "0.640657", "0.63673", "0.6254049", "0.6130116", "0.6121163", "0.60737693", "0.607138", "0.5931838", "0.59287405", "0....
0.714444
0
Returns Azure sessions with subscription, tenant and token for each given account
getAccountSessions(account) { return __awaiter(this, void 0, void 0, function* () { return yield this._azureController.getAccountSessions(account); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getCreds({config}) {\n const tok = new token.MyTokenCache(config.credentialsStore)\n \n const loginOptions = { \n environment: AzureEnvironment[config.environmentName], \n tokenCache: tok\n };\n \n if ( config.devlogin && !tok.empty()) {\n loginOptions.username = token.userId;\n\n con...
[ "0.5903074", "0.57469773", "0.5621272", "0.55173355", "0.54959005", "0.5266955", "0.5196721", "0.51391983", "0.51303583", "0.5129801", "0.51020217", "0.5097453", "0.5085579", "0.5078147", "0.50628775", "0.4994342", "0.49800476", "0.4973528", "0.49521762", "0.4930326", "0.4928...
0.7823304
0
Load random nouns using the Wordnik API
function loadWord() { $.ajax({ url: 'http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=true&includePartOfSpeech=noun&minCorpusCount=0&maxCorpusCount=-1&minDictionaryCount=1&maxDictionaryCount=-1&minLength=4&maxLength=8&api_key=a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5', asy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNouns(count, callback) {\r\n console.log('requesting nouns');\r\n request.post(\r\n {\r\n url : \"http://www.desiquintans.com/articles/noungenerator.php\",\r\n form : {\r\n nouncount : count\r\n }\r\n },\r\n function(error, response, body) {\r\n if (!error && respo...
[ "0.6858879", "0.68542147", "0.683777", "0.66523045", "0.65367407", "0.634747", "0.634747", "0.6305167", "0.62754095", "0.6232503", "0.62270236", "0.62057143", "0.6197091", "0.61330104", "0.60937405", "0.6009129", "0.60039407", "0.5987899", "0.5981383", "0.59616876", "0.594343...
0.74003094
0
Creates a new perspective and returns ID.
function newPerspective(values) { var perspID = firebase.database().ref('perspectives/').push(values).getKey(); loadPerspective(perspID); return perspID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doCreate() {\n const { values, sendResource, isEditing, name } = this.props;\n const postObject = getStateDataOnly(this.state);\n\n if (!postObject.lenses.length) {\n this.showError('Please enter a valid lens.');\n } else if (!postObject.subjects.length) {\n this.showError('Please enter a val...
[ "0.6152772", "0.5706538", "0.5432494", "0.51229304", "0.50976825", "0.50465536", "0.5003972", "0.49897835", "0.49442622", "0.49189505", "0.4873926", "0.48465055", "0.48387727", "0.48178992", "0.4759908", "0.47325605", "0.47305763", "0.4721862", "0.46955252", "0.4691295", "0.4...
0.6916722
0
Creates frames from the file text
createFrames(needs_validate = false) { let frames = this.fileContents.split('\n') .map((row) => { return row.trim(); }); if (needs_validate) { frames = frames.filter(GCodeModel.validateFrame); } frames = frames.map((rowFrame) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFramesFromFile(file){\n //clear current frame\n frames=[];\n //read file\n var reader = new FileReader();\n reader.onload = function (progressEvent) {\n \n window.alert(this.result);\n frameM = [];\n var thetas = this.result.split(' ');\n\n for (var degree = 0; ...
[ "0.62023664", "0.5381205", "0.5343405", "0.5302932", "0.51994634", "0.5183147", "0.5132542", "0.5127042", "0.51214474", "0.50958693", "0.5083744", "0.50662005", "0.5025523", "0.5024011", "0.5023736", "0.50012565", "0.4985522", "0.49706796", "0.49402225", "0.49286523", "0.4908...
0.63883024
0
Additional JS functions here Function takes single keyword as argument, checks array of item objects and looks for substring matches between item.name and keyword, if matches are found calls isotope.filter() function on our collection.
function isotopeSearch(kwd) { log(kwd); // reset results arrays var matches = []; $('#noMatches').hide(); // ensure this is always hidden when we start a new query if ( (kwd != '') && (kwd.length >= 2) ) { // min 2 chars to execute query: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter(keywords){\n keywords = keywords.toLowerCase();\n var keywordArray = keywords.split(' ');\n if(keywordArray.length==1 && keywordArray[0].length<2){\n return;\n }\n\n $('.auction-item .card-title').each(function(){\n var remove = false;\n var i = 0;\n while(!remove...
[ "0.69604456", "0.65384924", "0.6482268", "0.63777024", "0.6364184", "0.63632464", "0.63569695", "0.62763053", "0.62595767", "0.6256802", "0.62561977", "0.62550616", "0.6254247", "0.6199123", "0.6196367", "0.61948735", "0.6178953", "0.6176955", "0.61637235", "0.6160539", "0.61...
0.7764461
0
Generates a random phrase
function generatePhrase() { var randomModAdj = modadj[getRandomNum(0, modadj.length-1)]; var randomAdj = adj[getRandomNum(0, adj.length-1)]; var randomTopic = topics[getRandomNum(0, topics.length-1)]; return randomModAdj + " " + randomAdj + " " + randomTopic; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePhrase() {\n\n const pronouns = ['My', 'His', 'Her', 'Its', 'Our', 'Their'];\n\n const pi = Math.floor(Math.random() * pronouns.length);\n const ni = Math.floor(Math.random() * nouns.length);\n const ai = Math.floor(Math.random() * adjectives.length);\n\n const phrase = pronouns[pi] + ' ' + n...
[ "0.8420674", "0.8127035", "0.8081885", "0.78842145", "0.7783449", "0.7783449", "0.7769972", "0.776601", "0.7733503", "0.7731312", "0.7730792", "0.77199054", "0.7706565", "0.7699809", "0.7690256", "0.7653709", "0.76426786", "0.76252854", "0.7593666", "0.7554893", "0.7495523", ...
0.8578918
0
STARTCOMBINED BASED LEADERBOARD METHODSSTART getCombinedBoard_ methods are used for the leaderboard from the portal screen
getCombinedBoard() { return this.axiosObject.get(this.apiBaseName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayLeaderBoard() {\n $(\".startScreen\").hide();\n \n $(\".back\").on(\"click\", function() {\n $(\".leaderBoardScreen\").hide();\n $(\".startScreen\").show();\n })\n\n sortArray(normalLeaderBoard);\n sortArray(hardLeaderBoard);\n ...
[ "0.5516639", "0.5359894", "0.5337483", "0.53250116", "0.5176326", "0.5061393", "0.50468194", "0.49939013", "0.49800664", "0.49473825", "0.49411574", "0.49229985", "0.49175975", "0.49067798", "0.4898097", "0.48858032", "0.48821172", "0.48540533", "0.48530024", "0.4833954", "0....
0.6626692
0
ENDCOMBINED BASED LEADERBOARD METHODSEND STARTPROJECT BASED LEADERBOARD METHODSSTART getProjectBoard_ methods are used for the leaderboard from within a project
getProjectBoard(projectId) { return this.axiosObject.get(this.apiBaseName + '/Project/' + projectId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getBoard(boardId) {\n return jira.agileRequest(`/board/${boardId}`)\n .then((res) => {\n const board = res;\n\n return board;\n })\n .catch((r) => {\n jira.showErrors(r);\n });\n }", "async function runNewProject(boardId) {\r\n \r\n \r\n // project name...
[ "0.5688643", "0.5645663", "0.5643909", "0.5599672", "0.5483352", "0.5394187", "0.53300685", "0.5276872", "0.5199976", "0.51756394", "0.51385427", "0.51131874", "0.5103596", "0.510224", "0.50762343", "0.5062752", "0.5050387", "0.5044313", "0.5037487", "0.5032511", "0.50311077"...
0.6834405
0
Return a `RegExp` object compiled from a pattern that is the disjunction of the patterns of the specified `regexes`. The "global" flag ("g") will be used.
function combinePatterns(...regexes) { const pattern = regexes.map(regex => `(${regex.source})`).join('|'); const flags = 'g'; return new RegExp(pattern, flags); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeated(...regexps) {\n return new RegExp(`${group(...regexps).source}+`);\n}", "function optional(...regexps) {\n return new RegExp(`${group(...regexps).source}?`);\n}", "static merge(rules, flags) {\n const sources = rules.map(rule => rule._pattern.source);\n return new RegExp(sources.j...
[ "0.641482", "0.6258537", "0.6160732", "0.61594087", "0.6110603", "0.5801189", "0.57940435", "0.57221293", "0.57208085", "0.5702858", "0.5530353", "0.5474135", "0.5470283", "0.5470283", "0.5470283", "0.5462626", "0.5456455", "0.5437891", "0.54334915", "0.5381766", "0.537633", ...
0.7095899
0
In a simpler world, selecting the value from a column would always look like: select `foo` from ... and the SQL driver would marshal the value into the corresponding type in the generated Go/Python/C++/etc. code. However, SQL drivers (and the libraries that wrap them) differ in how they handle certain types. For exampl...
function selector({columnName, fieldType}) { if (fieldType.builtin === '.google.protobuf.Timestamp') { // timestamp(6) → unix timestamp in microseconds return `floor(unix_timestamp(${quoteName(columnName)}) * 1000000)`; } else if (fieldType.builtin === '.google.type.Date') { // date ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SqlTypes () {\n const SQL_UNKNOWN_TYPE = 0\n const SQL_DECIMAL = 3\n // var SQL_INTERVAL = 10;\n // var SQL_TIMESTAMP = 11;\n const SQL_BINARY = -2\n // var SQL_WCHAR = -8;\n // var SQL_SS_VARIANT = -150;\n // var SQL_SS_UDT = -151;\n // var SQL_SS_XML = -152;\n const SQL_SS_...
[ "0.6407899", "0.5779997", "0.56784636", "0.5536901", "0.55311656", "0.5528055", "0.5484129", "0.5460812", "0.54363096", "0.5386725", "0.5336021", "0.532365", "0.5285889", "0.5256185", "0.52480763", "0.52476376", "0.5235472", "0.52285624", "0.52237046", "0.51818055", "0.517337...
0.6353498
1
Return a CRUD instruction for adding values into the specified `arrayTableName` from the specified `arrayField` of the message type having the specified `messageIdField`, where the `messageIdField` has the specified `messageIdFieldType` and the elements of the array field have the specified `arrayFieldType`. The return...
function instructionInsertArray({ arrayTableName, messageIdField, messageIdFieldType, arrayField, arrayFieldType }) { return { instruction: 'exec-with-tuples', condition: {included: arrayField}, // tuple is, e.g. "(?, ?, ?)" or "(?, ?, from_unixtime(...))" tuple: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instructionSelectArray({\n arrayTableName,\n arrayType, // type of the array itself, e.g. `{array: ...}`\n messageIdField,\n messageIdFieldType\n}) {\n // If `arrayType` refers to an actual array, then the type of its elements\n // is `arrayType.array`. However, if `arrayType` is a Field...
[ "0.69356793", "0.6594008", "0.57540333", "0.51873094", "0.51614124", "0.51336104", "0.51250815", "0.50430816", "0.48561728", "0.47666728", "0.47061473", "0.4702005", "0.46428168", "0.45935452", "0.45551538", "0.45239058", "0.45172238", "0.45044526", "0.4489759", "0.4470576", ...
0.77919877
0
Return a CRUD instruction for selecting rows from the specified `arrayTableName` representing an array of the specified `arrayType` in the message type having the specified `messageIdField` with the specified `messageIdFieldType`.
function instructionSelectArray({ arrayTableName, arrayType, // type of the array itself, e.g. `{array: ...}` messageIdField, messageIdFieldType }) { // If `arrayType` refers to an actual array, then the type of its elements // is `arrayType.array`. However, if `arrayType` is a FieldMask, then ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instructionDeleteArray({\n arrayTableName,\n messageIdField,\n messageIdFieldType,\n conditionField\n}) {\n return {\n instruction: 'exec',\n sql: sqline(`delete from ${quoteName(arrayTableName)}\n where ${quoteName('id')} = ${parameter(messageIdFieldType)};`),\...
[ "0.72204113", "0.6921679", "0.52192765", "0.51399237", "0.49969587", "0.4751774", "0.4717108", "0.47168154", "0.4647675", "0.4570591", "0.4538138", "0.44890472", "0.44582403", "0.44157428", "0.43956965", "0.43716577", "0.43486074", "0.4339633", "0.42871612", "0.42406413", "0....
0.84684587
0
Return a CRUD instruction that deletes all rows from the specified `arrayTableName` whose message ID column ("id") of the specified type `messageIdFieldType` has the same value as the specified `messageIdField` (`messageIdField` is the _name_ of the field whose value we're interested in). Optionally specify a `conditio...
function instructionDeleteArray({ arrayTableName, messageIdField, messageIdFieldType, conditionField }) { return { instruction: 'exec', sql: sqline(`delete from ${quoteName(arrayTableName)} where ${quoteName('id')} = ${parameter(messageIdFieldType)};`), parame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instructionsDeleteMessage({type, legend}) {\n const {\n scalarFieldSources,\n arrayFieldSources\n } = byMultiplicity(legend.fieldSources);\n\n const keyColumnName = scalarFieldSources\n .find(({fieldName}) => fieldName === type.idFieldName)\n .columnName;\n const fi...
[ "0.5796521", "0.5587241", "0.5363188", "0.5329403", "0.5311813", "0.48589924", "0.47753936", "0.4736401", "0.45958167", "0.4557278", "0.4493191", "0.4428446", "0.44171673", "0.4409468", "0.44084966", "0.43859774", "0.4371734", "0.43665996", "0.43457744", "0.43446353", "0.4334...
0.84263504
0
Return a CRUD instruction that selects the scalar fields of an instance of the specified `type` from the database. Use the specified `legend` to map message fields to table columns.
function instructionSelectMessage({type, legend}) { const {scalarFieldSources} = byMultiplicity(legend.fieldSources); const keyColumnName = scalarFieldSources .find(({fieldName}) => fieldName === type.idFieldName) .columnName; const fieldTypes = Object.fromEntries( type.fields.map(({...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instructionsCreateMessage({type, legend}) {\n const {\n scalarFieldSources,\n arrayFieldSources\n } = byMultiplicity(legend.fieldSources);\n\n const fieldTypes = Object.fromEntries(\n type.fields.map(({name, type}) => [name, type]));\n const scalarFieldInfos = scalarFieldS...
[ "0.6375371", "0.5976117", "0.5876057", "0.5801444", "0.5681084", "0.535403", "0.53361815", "0.5178383", "0.5141703", "0.5080601", "0.50706416", "0.49974537", "0.49949127", "0.4953411", "0.4936049", "0.47968665", "0.47614235", "0.4729178", "0.4703426", "0.46979094", "0.4676065...
0.69892323
0
Return an array of CRUD instructions that check whether there is a particular instance of the specified `type` in the database, and produces an error (by failing to read a result row) if there isn't. This mechanism is used by updates to verify that there is anything to update.
function instructionsMessageExists({type, legend}) { const keyColumnName = legend.fieldSources .find(({fieldName}) => fieldName === type.idFieldName) .columnName; const fieldTypes = Object.fromEntries( type.fields.map(({name, type}) => [name, type])); const idFieldType = fieldTypes[t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "allByType(type) {\n return db.load(`select * from ${TABLE_NAME} where Type = ${type}`);\n }", "function test_type(req, res, type) {\n\tMongoClient.connect(\n\t\turi + 'people',\n\t\t{ useNewUrlParser: true, useUnifiedTopology: true },\n\t\tfunction (err, db) {\n\t\t\tif (err) {\n\t\t\t\twarming(res, 2);\n\t\...
[ "0.6329026", "0.52057076", "0.5189124", "0.51272583", "0.51171815", "0.51073277", "0.508545", "0.508412", "0.50367093", "0.49941075", "0.49807647", "0.49529305", "0.49194562", "0.49130803", "0.49011293", "0.48312268", "0.47984514", "0.47892278", "0.47593346", "0.47591692", "0...
0.52990174
1
Return a snippet of SQL that sets the value at the specified `columnName` to either a parameterized value or to itself (a noop) depending on a parameterized boolean. The boolean says whether to update the column. The SQL snipped returned by this function is intended to be used as one of the "..." in "update foo set ......
function sqlClauseUpdateColumn({columnName, fieldType}) { const name = quoteName(columnName); // The first parameter will be bound to a predicate answering the question // of whether `columnName` should be updated. The second parameter will be // bound to the new value for `columnName`, or to anything ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n const updates = this._prepUpdate(this.single.update);\n const where = this.where();\n let { returning } = this.single;\n const sql = `update ${this.tableName}` +\n ' set ' + updates.join(', ') +\n (where ? ` ${where}` : '');\n\n if (!returning) {\n return sql;\n }\n\n ...
[ "0.5054344", "0.48670056", "0.4853642", "0.48069066", "0.4595215", "0.4479432", "0.44723842", "0.4465867", "0.4462902", "0.43776408", "0.43752682", "0.43589687", "0.43497342", "0.4337541", "0.4330245", "0.43086502", "0.4305828", "0.42470697", "0.42269003", "0.41957313", "0.41...
0.72495896
0