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
creating divs for each player
function makePlayerDivs() { document.getElementById('players').textContent = ''; for (var i = 0; i < players.length; i++) { var playerName = document.createElement('div'); var playerId = document.createElement('div'); var playersHand = document.createElement('div'); var playerPoints = document.creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playerLoop(player){\n\t\t\tplayer_div.className = 'player'\n\t\t\tplayer_div.dataset.number = player.number\n\t\t\tplayer_div.innerHTML = `<h3>\n \t${player.name} (<em>${player.nickname}</em>)\n \t\t</h3>\n \t\t\t<img src=\"${player.photo}\" alt=\"${player.name}\">`\n\t\t\tplayer_container.append(play...
[ "0.77433455", "0.7351959", "0.7336338", "0.72665524", "0.7201673", "0.7077115", "0.7010559", "0.6989146", "0.69610727", "0.6948809", "0.68967164", "0.6843681", "0.68188936", "0.680987", "0.6803487", "0.6774812", "0.6765667", "0.67459327", "0.67325264", "0.6726895", "0.6724076...
0.77289736
1
randomly select cards out of 1500; cuts the deck & Shuffle cards;
function randomCards() { for (var i = 0; i < 100; i++) { var cutHalf = Math.floor((Math.random() * deck.length)); var cutSecondHalf = Math.floor((Math.random() * deck.length)); var cutDeck = deck[cutHalf]; deck[cutHalf] = deck[cutSecondHalf]; deck[cutSecondHalf] = cutDeck; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickRandomCards() {\n\tvar counter = 1;\n\twhile (counter < 7) {\n\t\trandomNumber = getRandomInt(1,6);\n\t\tif(drawn_cards[randomNumber] == false){\n\t\t\tactive_cards[counter] = card_map[randomNumber];\n\t\t\tdrawn_cards[randomNumber] = true;\n\t\t\tcounter = counter + 1;\n\t\t}\n\t\telse {\n\t\t\tconti...
[ "0.7171648", "0.70855707", "0.6794993", "0.6791681", "0.6676867", "0.6673683", "0.6661494", "0.66539514", "0.663638", "0.6608902", "0.66013193", "0.6593926", "0.6582085", "0.65789455", "0.65751356", "0.65465885", "0.65013134", "0.64831054", "0.64740944", "0.6471908", "0.64471...
0.71900374
0
updates the amount of cards left in the deck prints the amount of cards left in the deck of 52;
function cardsLeft() { document.getElementById('deckcount').textContent = deck.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCount(card) {\n if (isNaN(Number(card)) || card === \"10\") {\n count -= 1;\n console.log(`${card} --> count -1 --> ${count}`);\n } else if (card < 7) {\n count += 1;\n console.log(`${card} --> count +1 --> ${count}`);\n } else if (card >= 7 && card <= 9) {\n console.log(`${card} -...
[ "0.7226479", "0.71691716", "0.69369805", "0.66106313", "0.65389895", "0.64835936", "0.6452114", "0.64469934", "0.6427797", "0.6327546", "0.6286395", "0.6278449", "0.62613773", "0.6258114", "0.6242243", "0.61989915", "0.61484325", "0.61324143", "0.61306673", "0.60972005", "0.6...
0.8054363
0
returns the total of card values that a player has in hand included Ace logic so that Ace is set back to '1' if the total points are over '21'
function totalValue(player) { var bool = false var points = 0; for (var i = 0; i < players[player].Hand.length; i++) { points += players[player].Hand[i].CardValue; if (players[player].Hand[i].Value === 'A') { bool = true; } } if (bool === true) { if (points > 21) points = points - 10 }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateTotal(hand, player) {\n\tvar total = 0;\n\tvar AcesCount = 0;\n\t// get the valuel of each element in the user's hand array\n\tfor(i=0;i < hand.length;i++) {\n\t\t// slice the letter of the array element\n\t\tvar cardValue = hand[i].slice(0, hand[i].indexOf(\"<\"));\n\n\t\t// check if card value ...
[ "0.8065346", "0.7952188", "0.79086596", "0.7739158", "0.7677923", "0.7674089", "0.7620351", "0.7580464", "0.75521004", "0.7548834", "0.7505419", "0.7503603", "0.74739814", "0.7459873", "0.7395964", "0.73950106", "0.738193", "0.73445374", "0.733855", "0.7331808", "0.7330769", ...
0.80857223
0
read the boundary from the contenttype header sent by the http client this value may be similar to: 'multipart/formdata; boundary=xYzZY',
function getBoundary() { var items = contentTypeHeader.split(';'); var boundary = ""; if (items) { for(i = 0; i < items.length; i++){ var item = (new String(items[i])).trim(); if (item.indexOf('boundary') >= 0){ var k = item.split('='); boundary = (new String(k[1])).trim(); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBoundary(contentTypeStr) {\n return EnigmailMime.getParameter(contentTypeStr, \"boundary\");\n }", "function MultiPart_parse(body, contentType) {\n // Examples for content types:\n // multipart/form-data; boundary=\"----7dd322351017c\"; ...\n // multipart/form-data; boundary=----7dd322351017c...
[ "0.6899825", "0.6817437", "0.6686228", "0.6229909", "0.6222359", "0.61683816", "0.58914554", "0.58865595", "0.5484992", "0.5484992", "0.5460446", "0.5439658", "0.5399188", "0.5386326", "0.5364601", "0.5356016", "0.5332075", "0.5323768", "0.5323768", "0.5323768", "0.5323768", ...
0.7837368
0
resetmenu active and fixed or not
function menuReset(){ //resetmenu active if ((scrollT + 40) >= $("#awards").offset().top) { _n=2; }else if ((scrollT + 40) >= $("#pokegame").offset().top) { _n=1; }else if ((scrollT + 40) >= $('h1').height()) { _n=0; } $navLi.removeClass('active').eq(_n).addClass('acti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearActive()\n{\n\t$(\"#btnOntbijt\").removeClass(\"menuActive\");\n\t$(\"#btnBrood\").removeClass(\"menuActive\");\n\t$(\"#btnHap\").removeClass(\"menuActive\");\n\t$(\"#btnMakelij\").removeClass(\"menuActive\");\n\t$(\"#btnSoep\").removeClass(\"menuActive\");\n\t$(\"#btnSalade\").removeClass(\"menuActi...
[ "0.70499504", "0.69077075", "0.6855751", "0.6824148", "0.6707717", "0.6705023", "0.6658813", "0.6656132", "0.661175", "0.65931314", "0.6569079", "0.6543781", "0.653025", "0.65074086", "0.6498557", "0.64888513", "0.64548147", "0.6422143", "0.6417907", "0.6387602", "0.63867885"...
0.82876617
0
======================================================================== HELPERS ======================================================================== Takes a document and returns the document with Dates serialized into ISO8601 strings. Currently this only serializes on the first level of the object, and will not se...
function SerializeDates(Doc) { return _.mapValues(Doc, function(v, k) { if (_.isDate(v)) return v.toISOString(); else return v; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serializeAllDates(obj) {\n\n // if it is a date, then return serialized version\n if (_.isDate(obj)) {\n return serializeDate(obj);\n }\n\n // if array or object, loop over it\n if (_.isArray(obj) || _.isObject(obj)) {\n _.forEach(obj, function (ite...
[ "0.619408", "0.5894287", "0.55439466", "0.5489778", "0.5477396", "0.5468706", "0.5384428", "0.53516465", "0.53148556", "0.5204797", "0.51657116", "0.51652616", "0.51571655", "0.51571655", "0.51571655", "0.51226735", "0.51141596", "0.50312537", "0.5000212", "0.5000212", "0.500...
0.75094736
0
Filter the repos languages
function languageFilter(language){ while (row.firstChild) row.removeChild(row.firstChild); fetch('https://api.github.com/users/' + search.value + '/starred') .then( (starred) => starred.json()) .then( (data) => { let arr = data.filter( (d) => { return d.language === language }); r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFilteredRepos() {\n let filteredRepos = this.state.listRepo;\n if (filteredRepos) {\n filteredRepos.sort((a, b) => {\n var delta = 0;\n if (a.full_name) {\n delta = a\n .full_name\n .localeCompare(b.full_name);\n }\n if (delta === 0 && a.full...
[ "0.67536324", "0.61341417", "0.60468936", "0.5973962", "0.5931539", "0.5706367", "0.57004434", "0.5683478", "0.5669549", "0.56560683", "0.5650422", "0.55666244", "0.55565125", "0.5521269", "0.5519289", "0.5514197", "0.5498833", "0.54985", "0.549263", "0.5478457", "0.54763585"...
0.6703927
1
PEScore Decoder End Generate Entity Matching Feature Begin
function GenerateEntityMatchingScore(entityList, matchData) { var entityMatchFeature = 0; var entityCount = entityList.length; var title = matchData.title; var wordFoundTitleArray = matchData.wordFoundTitleArray; var snippet = matchData.snippet; var wordFoundBodyArray = matchData.wordFoundBodyA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeBed(tokens, ignore) {\n\n var chr, start, end, id, name, tmp, idName, exonCount, exonSizes, exonStarts, exons, exon, feature,\n eStart, eEnd;\n\n if (tokens.length < 3) return undefined;\n\n chr = tokens[0];\n start = parseInt(tokens[1]);\n end = tokens....
[ "0.5570173", "0.55575335", "0.5335659", "0.5277255", "0.522508", "0.52098966", "0.51810735", "0.51134264", "0.50759166", "0.507133", "0.50497997", "0.5022866", "0.5009652", "0.49842867", "0.49584302", "0.49364847", "0.49330112", "0.48814347", "0.4849832", "0.4841415", "0.4834...
0.6080018
0
Function that checks if communication between the the front and backend code is possible. It will run the onFail function if communication is not possible. This function will be running recursively until communication is possible.
function communication_test(onFail, onSuccess, retryTimeMiliSeconds=500) { chrome.tabs.query({active:true, currentWindow:true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {todo:"comTest"}, function(response) { // The extension is opened on a page that it can't manipulate. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_if_deployed(e, attempt){\n\tif(e){\n\t\tconsole.log('! looks like a deploy error, holding off on the starting the socket\\n', e)\n\t}\n\telse if(attempt >= 15){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//tried many times, lets give up and pass an err msg\n\t\tconsole.log('[preflight check]', attempt, ': fai...
[ "0.5963152", "0.5931229", "0.564076", "0.55518645", "0.5546785", "0.54952276", "0.5481552", "0.5460137", "0.54360867", "0.5426951", "0.5415232", "0.5395883", "0.5356759", "0.53565943", "0.5354631", "0.53495175", "0.53299314", "0.53019184", "0.5287369", "0.5276726", "0.5265024...
0.6064405
0
Make the active window button look darker to make it the obvious open file.
make_button_active(filename) { let all_html_elements = document.getElementsByClassName("file-title-button"); let all_close_html_elements = document.getElementsByClassName("close-button"); Array.from(all_html_elements).forEach(function(element) { // Highlight the right but...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showStyleSwitcher() {\n if ($(window).scrollTop() > 800) {\n sBtn.addClass(icon).addClass('show-it i-close').removeClass(icon);\n sBody.addClass(active);\n }\n }", "function openSavePalette() {\n const popup = saveContainer....
[ "0.6083242", "0.581852", "0.5812686", "0.5779438", "0.57609344", "0.56995845", "0.56696904", "0.5668881", "0.56662256", "0.5651741", "0.56311107", "0.56085056", "0.558578", "0.5570517", "0.5560837", "0.5559099", "0.5555266", "0.555179", "0.5549514", "0.5537421", "0.5483903", ...
0.6606315
0
Changes the width of the open file buttons to fit the extension window.
resize_open_file_html_elements() { let all_html_elements = document.getElementsByClassName("file-title-button"); let editor_width_str = this.editor_element.style["min-width"]; let button_width = Math.round((parseInt(editor_width_str.substring(0, editor_width_str.length - 2)) - 20)/all_html_e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openActions() {\n document.getElementById(\"actions\").style.width = \"25%\";\n}", "static setWidth() {\n\t\tif (this.menu.classList.contains('open')) {\n\t\t\tthis.artist.style.width = '50%';\n\t\t\tthis.arrow.firstElementChild.innerText = 'keyboard_arrow_left';\n\t\t} else {\n\t\t\tthis.artist.styl...
[ "0.60795903", "0.6076112", "0.59773564", "0.5888057", "0.58205974", "0.56645477", "0.55814356", "0.55583423", "0.55188096", "0.5491741", "0.5491741", "0.5449635", "0.5429196", "0.5415099", "0.5393835", "0.5338276", "0.5326019", "0.5320269", "0.53139704", "0.5288076", "0.52638...
0.7472839
0
Hides the editor and the open files.
hide() { // Hide the editor element. this.editor_element.style.display = "none"; // Hide all open files. This basically closes all the files without saving. // So after reopening the extension, the files will be open again. let all_open_files = document.getElementsByClassNam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_hideEditor() {\n this.editor.hide();\n this.terminal.display();\n }", "hideEditor() {}", "toggleHide(e=false){\n if(! this.initial && e != false){\n this.hidden = ! this.hidden;\n }\n this.fieldClass.removeFile(this);\n this.render();\n }", "functio...
[ "0.73939985", "0.7120369", "0.6879003", "0.6675836", "0.6663516", "0.66361576", "0.65762115", "0.65161794", "0.65027153", "0.6499654", "0.6453235", "0.643938", "0.64277947", "0.6422194", "0.6417626", "0.64023674", "0.638185", "0.6377668", "0.63461846", "0.62910473", "0.629104...
0.83649975
0
Closes the editor of the file with the specified filename.
close_file(filename) { let all_open_files = document.getElementsByClassName("open-files-list-item"); // Set the file to being closed let index = this.navigator.get_nav_item_index_by_filename(filename); this.navigator.nav_items[index].open = false; this.save_file_by_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeFile() {\n mainWindow.webContents.send('close-file');\n logEvent(EVENTS.CLOSE);\n}", "function closeEditor() {\n\t\tcurrentlyEditing = null;\n\n\t\t\t\t$(\"#editor\").fadeOut(\"slow\",\n\t\t\t\t function() {\n\t\t\t\t\t $(\"#editor\").css(\"display\", \"none\");\n\t\t\t\t\t $(\"#contain...
[ "0.6339292", "0.6178524", "0.59620154", "0.58945787", "0.58181524", "0.5720277", "0.5703954", "0.56327456", "0.5575045", "0.5508873", "0.54161394", "0.53397363", "0.53319365", "0.5312179", "0.5300043", "0.52657825", "0.52469546", "0.5243057", "0.5222858", "0.520257", "0.51636...
0.6510097
0
Creates a file button for a file with the specified name.
create_file_button(filename) { let ul = document.getElementById("open-files-list"); let li = document.createElement("li"); let file_button = document.createElement("input"); let close_button = document.createElement("a"); li.className = "open-files-list-item"; clos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add_nav_button(filename)\n {\n let kind = filename_to_kind(filename);\n // make the html element for the File object.\n if(kind === \"JS\" || kind === \"CSS\" || kind === \"HTML\")\n {\n let input = document.createElement(\"input\");\n input.type = \"submit\";\n...
[ "0.74908966", "0.65219146", "0.64033496", "0.64019716", "0.63400424", "0.6336556", "0.6319886", "0.63078743", "0.6300997", "0.6198498", "0.6185321", "0.61623067", "0.61381215", "0.6104226", "0.60870796", "0.60728043", "0.60670567", "0.6004762", "0.5985622", "0.59589857", "0.5...
0.75198585
0
Creates an editor window for the file with the specified name and text.
create_window(filename, text) { let new_session = new this.EditSession(text); // Disable the info text on the left of the editor if it is an HTML file. if(filename_to_kind(filename) === "HTML") { new_session.setUseWorker(false); } // Set the editor to the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEditorWindow() {\n\twindow.createWindow('EditorWindow', {\n\t\tbackgroundColor: '#303030',\n\t\tparent: 'ConfigWindow',\n\t\tshow: false,\n\t\tdarkTheme: true,\n\t\twidth: 1920,\n\t\theight: 1080,\n\t\ttitle: \"Editor\",\n\t\ticon: path.join(__dirname, '/images/polylogix.jpg'),\n\t\twebPreferences: ...
[ "0.6376985", "0.6184644", "0.60208786", "0.5969268", "0.5925786", "0.58921754", "0.5878649", "0.58457357", "0.57864356", "0.5784007", "0.57624084", "0.5755551", "0.5751408", "0.57403004", "0.57155764", "0.571349", "0.56711257", "0.566554", "0.56576055", "0.56565976", "0.56372...
0.79257625
0
Returns the text of the current edit menu.
get_current_text() { let current_text = this.editor.session.getValue(); return current_text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCurrentMenuText() {\r\n menuContens[curMenu] = getBodyHtmlString();\r\n}", "function CLC_GetSelectedText(){\r\n var text = CLC_Window().getSelection().toString();\r\n return text;\r\n }", "function onContentMenu() {\n // get selected text\n let text = window.getSelection().toS...
[ "0.647291", "0.6154776", "0.6022307", "0.6017166", "0.5976527", "0.59437436", "0.58641565", "0.58389544", "0.58322495", "0.5794125", "0.5789682", "0.57332397", "0.5722939", "0.5722939", "0.57227975", "0.57055664", "0.5691061", "0.5690248", "0.56858665", "0.5683136", "0.563927...
0.6602143
0
Returns the the filetype in "FILEEXTENSION" format. "JS" for javascript. "CSS" for Cascading Style Sheets. "HTML" for HyperText Markup Language.
get_current_filetype() { if(this.active_file.endsWith(".js")){ return "JS"; } else if(this.active_file.endsWith(".css")){ return "CSS"; } else if(this.active_file.endsWith(".html")){ return "HTML"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileMimeType(){\n var type = fileSelected.type || '/';\n var fName = fileSelected.name;\n return type.split('/')[1] || fName.split('.')[fName.split('.').length - 1];\n }", "function getFileType(filename) {\n var ext = getFileNameExtension(filename);\n switch (ext.toLower...
[ "0.79467607", "0.78921014", "0.7631647", "0.7621897", "0.7510245", "0.74241984", "0.7399788", "0.7182831", "0.71714514", "0.7161657", "0.7113845", "0.7111163", "0.7046215", "0.70142096", "0.6999163", "0.6956985", "0.69513166", "0.69397926", "0.6929419", "0.69085526", "0.67461...
0.81444675
0
Deletes the currently active file from storage.
delete_current_file() { let filename = this.active_file; this.close_file(filename); chrome.storage.sync.remove(filename, function(){}); chrome.storage.local.remove(filename, function(){}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async deleteStorageFromDisk(){\n await fs.remove(`./.metaapi/${this._accountId}-${this._application}-config.bin`);\n await fs.remove(`./.metaapi/${this._accountId}-${this._application}-deals.bin`);\n await fs.remove(`./.metaapi/${this._accountId}-${this._application}-historyOrders.bin`);\n }", "destroy...
[ "0.6747733", "0.66992056", "0.6689295", "0.6657355", "0.6637717", "0.66293025", "0.6515299", "0.64664954", "0.6366702", "0.63277954", "0.6318726", "0.6266036", "0.6240189", "0.6231751", "0.62315255", "0.62174416", "0.620721", "0.61862206", "0.61636466", "0.6158865", "0.614216...
0.79361916
0
Whenever a different file is selected, the newly selected file should become the 'open' file. This method set the new file to the last opened file so that this file will be opened at restart.
update_last_open_file() { // Save all open files because '.last' can only be true on one, so the rest needs to be set to false. for(let element of this.files) { this.save_file_by_name(element[0]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fileOpen() {\r\n\t\t\t\tif (!unsavedChanges.confirmContinue()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tfileImport.chooseFile();\r\n\t\t\t}", "selectExistingFile(file) {\n this.set('selectedFile', file);\n }", "function newFile() {\n\tconsole.log('Open new file');\t// DBG\n\tfileEntry =...
[ "0.704156", "0.6936238", "0.6935724", "0.6587496", "0.64917284", "0.64836204", "0.6355176", "0.6261456", "0.61827767", "0.61490756", "0.60731804", "0.60572004", "0.5981495", "0.5957759", "0.5932819", "0.58830476", "0.58689505", "0.58543575", "0.5751003", "0.5751003", "0.57494...
0.70923156
0
binds the correct functions to the html_elements. This method should only be run once from inside of the constructor.
bind_html_elements() { // Bind the button that changes the name of the current file. this.change_filename_button.onclick = function() { this.change_filename_not_editing_div.style.display = "none"; this.change_filename_editing_div.style.display = "block"; t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SpecialElHandlers() {}", "initEvents() {\n for (let wodHTML of this.wodzHTML) {\n wodHTML.initEvents();\n }\n }", "bindElements() {\n this.submitBtn = document.querySelector('#event-submit');\n this.inputName = document.querySelector('#event-name');\n t...
[ "0.6545463", "0.61904407", "0.608949", "0.6023405", "0.6023405", "0.6003851", "0.59891653", "0.59805954", "0.59481734", "0.5939885", "0.59266514", "0.59264386", "0.5911423", "0.58616734", "0.58494115", "0.57903326", "0.5760861", "0.57253265", "0.57105166", "0.57096285", "0.56...
0.67939425
0
Changes the size of everything inside the extension when the zoom level is changed. The factor is the percentage100 so 300% would be factor 200.
set_zoom_factor(factor) { if(factor >= 0) { this.current_zoom_level = factor; localStorage["current_zoom_level"] = factor; let body_width = Math.round(600 + this.current_zoom_level*(2/3)); let body_height = Math.round(300 + this.current_zoom_level); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyZoom( level ) {\n\t\n\t$('.editor-preview').css({ \"font-size\": `${level/10}rem` })\n}", "updateScale() {\n this.scale = this.getDrawingScale();\n }", "function updateZoom(e) {\n\n\t/* Get the value of the zoom slider and \n\tchange the zoom property of the pixel canvas to the \n\tzoom value...
[ "0.6952136", "0.68533003", "0.68095815", "0.680496", "0.6803296", "0.67907286", "0.67653435", "0.67267466", "0.6723651", "0.6702644", "0.6663128", "0.66626686", "0.6646554", "0.6632791", "0.66271037", "0.6623845", "0.65988964", "0.6571133", "0.6522301", "0.65111667", "0.64980...
0.7646939
0
Creates a new navigation button for the specified filename.
add_nav_button(filename) { let kind = filename_to_kind(filename); // make the html element for the File object. if(kind === "JS" || kind === "CSS" || kind === "HTML") { let input = document.createElement("input"); input.type = "submit"; input.value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create_file_button(filename)\n { \n let ul = document.getElementById(\"open-files-list\");\n let li = document.createElement(\"li\");\n let file_button = document.createElement(\"input\");\n let close_button = document.createElement(\"a\");\n li.className = \"open-files-list...
[ "0.7031593", "0.6496241", "0.6403309", "0.6081835", "0.60514086", "0.591131", "0.5893597", "0.5846758", "0.5843208", "0.5842753", "0.583859", "0.5826942", "0.57087827", "0.569479", "0.5679608", "0.5635991", "0.563072", "0.5625035", "0.55893505", "0.5579688", "0.554592", "0....
0.8267674
0
Get the index of a file in 'this.nav_items'.
get_nav_item_index_by_filename(filename) { for(let i=0; i<this.nav_items.length; i++) { if(this.nav_items[i].filename === filename) { return i; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileForCurrentPage(){\n for (let index = 0; index < files.article.length; index++) {\n if (files.article[index].ID == currentPage) { // If any file's ID in JSON equals the currentPage Name\n currentPageID = index; // the index of said file will be the index to displa...
[ "0.6444671", "0.63502014", "0.6279422", "0.6240866", "0.6036889", "0.6010181", "0.5856022", "0.58512753", "0.5735318", "0.5725634", "0.5711178", "0.56637585", "0.56382567", "0.56382567", "0.56382567", "0.56046164", "0.55728054", "0.5492298", "0.5489712", "0.548922", "0.543253...
0.81642795
0
Disables the specified menu. options: "JS", "CSS", "HTML", "MAIN", "ERROR", "EDITOR", "NEW".
disable_menu_of_kind(kind) { switch(kind) { case "JS": case "CSS": case "HTML": this.back_div.style.display = "none"; let all_elements = document.getElementsByClassName("saved-" + kind.toLowerCase() + "-nav-button"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_delayed_hide_menu() {\r\n show_menu_exclusive(\"\");\r\n}", "function hideMenu(){\n return false;\n}", "function norightmenu(){\ndocument.oncontextmenu = function(){return false}\n}", "function norightmenu(){\ndocument.oncontextmenu = function(){return false}\n}", "function DisableNavUI(fDisa...
[ "0.6488757", "0.6477865", "0.64265376", "0.64265376", "0.6422786", "0.6368692", "0.62922496", "0.6282596", "0.62569255", "0.6253715", "0.61939716", "0.6151396", "0.61437815", "0.61281705", "0.61240697", "0.61094564", "0.6102128", "0.60955256", "0.6072325", "0.6071792", "0.606...
0.6852532
0
bitArrayToInt change bit array to Int
function bitArrayToInt(bitArr, callback) { let bitStr = ''; if (bitArr.length > 0 && bitArr.length < 64) { for (let i = 0; i < bitArr.length; i++){ bitStr = bitStr + bitArr[i].toString(); } num = parseInt(bitStr,2); callback(num); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bitsToNum(bitArray){\n\treturn bitArray.reduce(function(s, n) { return s * 2 + n; }, 0);\n}", "function binaryArrayToNumber(arr){\n return arr.reverse().map( (x,i) => x*Math.pow(2,i)).reduce((prev,next)=> prev+next,prev = 0);\n}", "function byteArrayToInt(byteArr, callback) {\n let bitArr = '';\n...
[ "0.75805396", "0.6981711", "0.6754247", "0.6631607", "0.6628551", "0.6628551", "0.6574385", "0.64760226", "0.64672154", "0.6396298", "0.63356143", "0.62114877", "0.619538", "0.6189249", "0.6189249", "0.6108151", "0.61058563", "0.6091525", "0.60898715", "0.6082339", "0.6055289...
0.79318565
0
byteArrayToInt change one byte array to Int
function byteArrayToInt(byteArr, callback) { let bitArr = ''; if (byteArr.length > 0 && byteArr.length < 5){ for (let i = 0; i < byteArr.length; i++){ bitArr = bitArr + (byteArr[i]).toString(2).padStart(8, '0'); } callback(parseInt(bitArr, 2)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twoByteArrayToInt(byteArr, callback) {\n let bitArr = '';\n if (byteArr.length > 0 && byteArr.length < 5){\n for (let i = 0; i < byteArr.length; i++){\n bitArr = bitArr + (byteArr[i]).toString(2).padStart(16, '0');\n }\n callback(parseInt(bitArr, 2));\n }\n}", "f...
[ "0.74678546", "0.6761502", "0.6669062", "0.66672075", "0.66634953", "0.65585804", "0.6501366", "0.64515233", "0.62951106", "0.62514883", "0.62324744", "0.62324744", "0.62291265", "0.6190116", "0.6158008", "0.6112173", "0.6088141", "0.6041313", "0.5993606", "0.5989391", "0.598...
0.7778758
0
twoByteArrayToInt change two byte array to Int
function twoByteArrayToInt(byteArr, callback) { let bitArr = ''; if (byteArr.length > 0 && byteArr.length < 5){ for (let i = 0; i < byteArr.length; i++){ bitArr = bitArr + (byteArr[i]).toString(2).padStart(16, '0'); } callback(parseInt(bitArr, 2)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function to_int(A, B) {\n return (((A & 0xFF) << 8) | (B & 0xFF));\n}", "function byteArrayToInt(byteArr, callback) {\n let bitArr = '';\n if (byteArr.length > 0 && byteArr.length < 5){\n for (let i = 0; i < byteArr.length; i++){\n bitArr = bitArr + (byteArr[i]).toString(2).padStart(8, '...
[ "0.7409614", "0.6849604", "0.6552323", "0.6552195", "0.6509493", "0.6404715", "0.6367466", "0.63524467", "0.6231685", "0.622867", "0.61694455", "0.59921163", "0.59752476", "0.59609914", "0.5960268", "0.5925558", "0.58925116", "0.58818847", "0.57628876", "0.57595944", "0.57470...
0.7949808
0
IntToByteArray change Int to byte array
function IntToByteArray(value, callback) { if ((value).toString(2).length > 32){ let cs1 = (value).toString(2).slice(0,(value).toString(2).length-32); let cs2 = (value).toString(2).slice((value).toString(2).length-32); Int32ToByte(parseInt(cs1, 2), (arr1)=>{ Int32ToByte(parseInt(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intsToBytes(ints) {\n const bArr = [];\n for (let i = 0; i < ints.length; i++) {\n bArr.push((ints[i] >> 24) & 0xFF);\n bArr.push((ints[i] >> 16) & 0xFF);\n bArr.push((ints[i] >> 8) & 0xFF);\n bArr.push(ints[i] & 0xFF);\n }\n return bArr;\n}", "function int64_to_b...
[ "0.7200298", "0.7110087", "0.7002353", "0.67654", "0.66910416", "0.65911", "0.6556388", "0.6489987", "0.63986766", "0.63891447", "0.6310035", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0.6287715", "0...
0.7759341
0
Int32ToByte change Int32 num to byte array
function Int32ToByte(value, callback) { let byteArr = []; for (let i = 16; i >= 0; i = i - 16) { if((value >> i & 0xffff) != 0) { byteArr.push(value >> i & 0xffff); } } callback(byteArr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toBytesInt32(num) {\n var arr = new ArrayBuffer(5); // an Int32 takes 4 bytes\n view = new DataView(arr);\n view.setUint32(0, num, false); // byteOffset = 0; litteEndian = false\n\n var int8View = new Int8Array(arr);\n console.log(int8View[0].toString(16) + ' ' + int8View[1].toString(16) + ...
[ "0.77856714", "0.7528638", "0.6984923", "0.6963689", "0.6863686", "0.6843209", "0.6803548", "0.6667799", "0.64308333", "0.6379488", "0.6375947", "0.63455206", "0.63381994", "0.6162661", "0.6100967", "0.6094112", "0.6091137", "0.59608126", "0.5956351", "0.5935549", "0.59312636...
0.79008996
0
switchRegister reverse the order of array
function switchRegister(data, callback) { let switchData = []; for (let i = 0; i < data.length/2; i++) { switchData[i] = data[data.length-i-1]; switchData[data.length-i-1] = data[i]; } callback(switchData) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setr(inA, inB, out) {\n this.registers[out] = this.registers[inA];\n }", "function setr(a, b, c, registers) {\n registers[c] = registers[a];\n return registers;\n}", "function setr(a, b, c, registers) {\n registers[c] = registers[a];\n return registers;\n}", "borr(inA, inB, out) {\n this.registers...
[ "0.58843285", "0.553985", "0.553985", "0.55129653", "0.54336905", "0.54083896", "0.5407831", "0.5407831", "0.5407831", "0.5407831", "0.5398618", "0.53812873", "0.5376942", "0.53688186", "0.53538185", "0.53347033", "0.52918726", "0.5290185", "0.5289332", "0.5283766", "0.527649...
0.70374984
0
switchByte exchange lower and higher byte value of two byte data
function switchByte(data, callback){ let switchData = []; let InternalData = []; for (let i = 0; i < data.length; i++){ InternalData[0] = data[i] & 0xff; InternalData[1] = data[i] >> 8 & 0xff; byteArrayToInt(InternalData, (bitarr)=>{ switchData[i] = bitarr; }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "flipEndianness() {\n this.flipped ^= true\n }", "function j(a,b){\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\na.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}", "function f(a,b){\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8))...
[ "0.6148929", "0.59600174", "0.5830867", "0.58113533", "0.57488227", "0.5682684", "0.5670231", "0.56117344", "0.55886", "0.5565317", "0.55491555", "0.55491555", "0.55491555", "0.5521709", "0.5492699", "0.54580003", "0.54334325", "0.5378233", "0.5378233", "0.5378233", "0.537490...
0.7037622
0
splits input into array of separate sentences
function splitSentences(input) { // regular expression is period, exclamation points, and question marks with any character after them // must include . after bracket or else one sentence returned will be an empty string var regEx = new RegExp("[\.\!\?]."); return input.split(regEx); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tokenizeSentences(list_of_sentences){\n\t\tlet new_array = new Array();\n\t\tnew_array = list_of_sentences\n\t\tlet result_list = [];\n\t\tfor (let i = 0; i<new_array.length; i++){\n\t\t\tresult_list = result_list.concat(new_array[i].split(\" \"));\n\t\t}\n\t\treturn result_list;\n\t}", "function sentences(input...
[ "0.756521", "0.71265614", "0.7009307", "0.6964089", "0.69323045", "0.6852197", "0.6795947", "0.6715303", "0.6617048", "0.65864855", "0.6544974", "0.6532275", "0.65091777", "0.6343455", "0.6340983", "0.62583154", "0.61915505", "0.61284727", "0.5943072", "0.594196", "0.5928561"...
0.78860456
0
print out all words in that sentence that are longer than 4 characters.
function longWord(string) { var wordsArray = string.split(" "); for(i in wordsArray) { // make sure word does not include punction var regEx = new RegExp("[\.\!\?\;]"); var cleanedWord = wordsArray[i].replace(regEx, ""); // if word is longer than 4 characters, print that word if(cleanedWord.leng...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordsLongerThanThree(string) {\n string.filter(function (word) {\n return words.length > 3;\n })\n}", "function removeShortWords(str){\nlet arr = str.split(\" \");\nlet result = [];\nfor(let i = 0; i < arr.length; i++){\nif(arr[i].length >= 4){\n result.push(arr[i])\n}\n}\nreturn result.join(\" ...
[ "0.72793967", "0.7237826", "0.71920913", "0.71140635", "0.700858", "0.68526125", "0.68477374", "0.68184954", "0.6781069", "0.67697453", "0.66047686", "0.65998304", "0.6591867", "0.6549867", "0.64413244", "0.6433452", "0.6399755", "0.6384612", "0.63729495", "0.6356193", "0.633...
0.76698005
0
Send the signed configuration (this.signature) to the given responseURL
sendSignature () { console.log(`Sending signed response to ${this.responseURL}`); let responseJson = { signature: this.signature, certificateMd5: this.certificateMd5, data: this.data }; return q.nfcall(request, { uri: this.responseURL, method: 'POST', json: true, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set certificateUrl(url)\n {\n this.payload['trustedform_cert_url'] = url;\n }", "sign (url, authorizationToken, payload) {\n // Their backend servers use Windows epoch timestamps, account for that. The server is very picky,\n // bad percision or wrong epoch may fail the request.\n const win...
[ "0.5343734", "0.5239481", "0.5095422", "0.5093043", "0.5075251", "0.5052398", "0.49046087", "0.4850599", "0.48061678", "0.47727156", "0.47284105", "0.47226202", "0.47111616", "0.46774018", "0.466592", "0.46266153", "0.46256283", "0.46188235", "0.46072027", "0.4583667", "0.456...
0.6752083
0
Replace this empty implementation with some pre signing actions and logic that you would like to do.
preSignHook () { console.log('Pre signing hook logic here'); return q.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "postSignHook () {\n console.log('Post signing hook logic here');\n return q.resolve();\n }", "function onSignatureStarted() {\n // Call signWithRestPki() on the Web PKI component passing the token received from the server and the certificate\n // selected by the user.\n pki.signWithRestPki({\n ...
[ "0.60039103", "0.5974619", "0.59544635", "0.5934236", "0.590149", "0.58364886", "0.57848746", "0.57729584", "0.5757964", "0.5735707", "0.5703123", "0.5583366", "0.5581402", "0.55781", "0.55736005", "0.55608773", "0.54719526", "0.5468141", "0.54582256", "0.5439904", "0.5421554...
0.6507621
0
Replace this empty implementation with some post signing actions and logic that you would like to do.
postSignHook () { console.log('Post signing hook logic here'); return q.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleSign() {\n this.logUserInput('security_log_dialog_sign');\n this.port.emit('sign-only', {\n signKeyFpr: this.state.signKey\n });\n }", "preSignHook () {\n console.log('Pre signing hook logic here');\n return q.resolve();\n }", "function sign() {\n\n\t// Block the UI while we perform...
[ "0.60066", "0.59660536", "0.5901776", "0.5733179", "0.56021696", "0.55804735", "0.5565292", "0.5550011", "0.55428874", "0.55382144", "0.5513855", "0.54785126", "0.5466306", "0.54558873", "0.536046", "0.5357286", "0.5342102", "0.53396916", "0.53240913", "0.5309676", "0.5296194...
0.6585162
0
Upload file from local web server to Azure Blob Storage, uniquely renaming file
async function uploadFileToBlobStorage(filePath, fileName, containerName) { const containerClient = blobServiceClient.getContainerClient(containerName); const blockBlobClient = containerClient.getBlockBlobClient(fileName); var continerExists = await containerClient.exists(); // if the target ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadAzureBlob(file, container, blobName, options, _) {\n var blobService = getBlobServiceClient(options);\n var specifiedContainerName = interaction.promptIfNotGiven($('Container name: '), container, _);\n var specifiedFileName = interaction.promptIfNotGiven($('File name: '), file, _);\n var...
[ "0.6770319", "0.6560072", "0.64815307", "0.6326387", "0.6254111", "0.6059127", "0.6005983", "0.5957015", "0.5923832", "0.59135413", "0.58110607", "0.580494", "0.5795209", "0.5791558", "0.5715468", "0.56985676", "0.56531376", "0.56530523", "0.5642427", "0.5629809", "0.5621164"...
0.664148
1
show the random movie div after certain time
function showRandomMovieDiv(){ $('#random-movie').css('display', 'block'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMovies() { // add code here\n const divEl = document.querySelector(\"#all-movies\");\n const numberMovies = document.querySelector(\"#movies-number\");\n numberMovies.innerText = `${\n movies.length\n }`;\n movies.forEach((movie) => {\n const movieInfo = document.createEle...
[ "0.68567646", "0.66137284", "0.64641565", "0.6418677", "0.6404619", "0.637167", "0.6350285", "0.6278566", "0.62760097", "0.62235475", "0.6174592", "0.616687", "0.61445075", "0.6094457", "0.60871005", "0.60787654", "0.6077727", "0.6061195", "0.6042629", "0.6036577", "0.6015873...
0.73030084
0
calls the function to create a gallery and push it to the portfolio section
function app(projects) { console.log('app - projects', projects) //creates the gallery function gallery(){ for(let i =0; i < projects.length; i++){ let $card = $(` <a href=${projects[i].url} target="_blank"> <div class = "pBox" style="background-image: url(${projects[i].image}); backgrou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "f_js_create_portfolio_photographes(aa_photographe){\n\n //AJOUT DU PORTFOLIO\n const portFolio = document.querySelector(\".portfolio\");\n \n //DOM LIGTHBOX\n const ligthBoxContent = document.querySelector(\".ligthbox-content\");\n \n //BOUCLE SUR LES MEDIAS\n aa_photographe[1].media.forEac...
[ "0.71939677", "0.6804195", "0.6789714", "0.6755373", "0.66583616", "0.6578554", "0.6508303", "0.6508014", "0.6498472", "0.6454361", "0.6447835", "0.6372407", "0.6362705", "0.63538194", "0.6350288", "0.6348599", "0.633602", "0.6330986", "0.6325576", "0.6282459", "0.6270168", ...
0.70757806
1
Returns array of values from a dictionary (or any object)
function dict_values(dict) { var result = []; for (var i in dict) result.push(dict[i]); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function values(o) {\n var ks = Object.keys(o),\n len = ks.length,\n result = new Array(len),\n i;\n for (i = 0; i < len; ++i) {\n result[i] = o[ks[i]];\n }\n return result;\n}", "function values(o) {\n var ks = Object.keys(o),\n len = ks.length,\n result = new Array(len),\n ...
[ "0.74142414", "0.74142414", "0.7353108", "0.7343487", "0.73273236", "0.73273236", "0.73273236", "0.73273236", "0.7323857", "0.72937936", "0.7287231", "0.7287231", "0.7280072", "0.7280072", "0.7280072", "0.72761834", "0.7266249", "0.7253427", "0.722537", "0.72178054", "0.72169...
0.8201867
0
Return the array of colors as an array of N arrays of length items_per_row
function get_colors_as_nested_array(colors, items_per_row) { var result = new Array(); for (var idx = 0; idx < colors.length; idx += items_per_row) { var row = new Array(); for (var subidx = 0; subidx < items_per_row && idx + subidx < colors.length; subidx++) { row.push(colors[idx +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeColorArray() {\n var arr = [];\n for (var i = 0; i < level; i++) {\n arr.push(\"rgb(\" + colorObj[0][i] + ', ' + colorObj[1][i] + ', ' + colorObj[2][i] + ')')\n }\n return arr;\n}", "function getColorArray(len) {\n\tlet colorArray = [];\n\tlet i = len;\n\twhile(i-- !=0){\n\t\tcolo...
[ "0.69786215", "0.6733179", "0.6708902", "0.6640034", "0.6499586", "0.63881415", "0.6350472", "0.63140523", "0.6268465", "0.62584794", "0.6237459", "0.6185325", "0.61416644", "0.6129154", "0.6101034", "0.60920876", "0.6059162", "0.6048035", "0.6021833", "0.5993831", "0.5969382...
0.8210866
0
Given an RGB color as a hex string, like FF0033, convert to HSL, apply the function to adjust its lightness, then return the new color as an RGB string
function adjust_lightness(color_str, func) { /* Hack to handle for example F00 */ if (color_str.length == 3) { color_str = color_str[0] + color_str[0] + color_str[1] + color_str[1] + color_str[2] + color_str[2] } /* More hacks */ if (color_str == 'black') color_str = '000000'; if (color...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function triangulateColour(hex){\n\n // Convert hex to rgb\n // Credit to Denis http://stackoverflow.com/a/36253499/4939630\n var rgb = 'rgb(' + (hex = hex.replace('#', '')).match(new RegExp('(.{' + hex.length/3 + '})', 'g')).map(function(l) { return parseInt(hex.length%2 ? l+l : l, 16); }).join(',') + ')...
[ "0.72896904", "0.7283867", "0.7249473", "0.7249141", "0.7159833", "0.71561813", "0.7146721", "0.7140775", "0.7085204", "0.69895715", "0.69701064", "0.69701064", "0.6959078", "0.6917979", "0.68888056", "0.6874556", "0.687002", "0.6868301", "0.68488693", "0.68202525", "0.681867...
0.8199939
0
Given a color, compute a "border color" for it that can show it selected
function border_color_for_color(color_str) { return adjust_lightness(color_str, function(lightness){ var adjust = .5 var new_lightness = lightness + adjust if (new_lightness > 1.0 || new_lightness < 0.0) { new_lightness -= 2 * adjust } return new_lightness }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SelectColor(l) {\n return (\n l == 46 ? ('#FFFFFF22') //isogrid outline\n :l == 47 ? ('#FFFFFF99') //isogrid fill\n :l == 45 ? ('#0088FF') //isogrid fill\n :l == 51 ? ('#880000') //isogrid fill\n : null\n );\n\n}", "function selectColor(el){\n for(var i=0;i<document.getElementsB...
[ "0.6394178", "0.6331664", "0.62931514", "0.60332114", "0.5911189", "0.5907028", "0.5890284", "0.5863922", "0.58535206", "0.58461845", "0.58389986", "0.5809087", "0.5793116", "0.5757264", "0.5699622", "0.5694278", "0.5683624", "0.5654026", "0.565396", "0.56472516", "0.5637709"...
0.73720753
0
Use this function to make a color that contrasts well with the given color
function text_color_for_color(color_str) { var adjust = .5 function compute_constrast(lightness){ var new_lightness = lightness + adjust if (new_lightness > 1.0 || new_lightness < 0.0) { new_lightness -= 2 * adjust } return new_lightness } return adjust_lightn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHighContrastColor(color) {\n var r = parseInt(color.substring(1, 3), 16);\n var g = parseInt(color.substring(3, 5), 16);\n var b = parseInt(color.substring(5, 7), 16);\n //var lightness = (r + g + b) / 3;\n var lightness = (0.3 * r + 0.59 * g + 0.11 * b); //luma\n return lightness < 140 ? '#fffff...
[ "0.70423234", "0.6846676", "0.67733234", "0.6714191", "0.6646393", "0.66293484", "0.6570748", "0.6530698", "0.65236", "0.6516471", "0.6492619", "0.6473445", "0.6450106", "0.64357436", "0.63883275", "0.63839376", "0.63339853", "0.6319633", "0.63055587", "0.6304682", "0.6303705...
0.6890293
1
Given a color, compute the master text color for it, by giving it a minimum brightness
function master_color_for_color(color_str) { return adjust_lightness(color_str, function(lightness){ if (lightness < .33) { lightness = .33 } return lightness }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function text_color_for_color(color_str) {\n var adjust = .5\n function compute_constrast(lightness){\n var new_lightness = lightness + adjust\n if (new_lightness > 1.0 || new_lightness < 0.0) {\n new_lightness -= 2 * adjust\n }\n return new_lightness\n }\n return...
[ "0.7857707", "0.71707803", "0.692283", "0.6819587", "0.678345", "0.672936", "0.670315", "0.6700938", "0.66550714", "0.6635289", "0.66031915", "0.658077", "0.657798", "0.65731096", "0.6547954", "0.65237886", "0.63639027", "0.63402003", "0.63358235", "0.63110614", "0.6294454", ...
0.7813019
1
Given a color name, like 'normal' or 'red' or 'FF00F0', return an RGB color string (or empty string)
function interpret_color(str) { str = str.toLowerCase() if (str == 'black') return '000000' if (str == 'red') return 'FF0000' if (str == 'green') return '00FF00' if (str == 'brown') return '725000' if (str == 'yellow') return 'FFFF00' if (str == 'blue') return '0000FF' if (str == 'magenta') return 'FF00FF' if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameToHex(color){if(typeof color!=='string')return color;var normalizedColorName=color.toLowerCase();return namedColorMap[normalizedColorName]?\"#\"+namedColorMap[normalizedColorName]:color;}", "function colorString(color) {\n return `rgb(${color[0]}, ${color[1]}, ${color[2]})`;\n}", "function colorO...
[ "0.73810154", "0.7300969", "0.71435136", "0.7088255", "0.7059565", "0.69795996", "0.6975835", "0.69606346", "0.69474834", "0.69333965", "0.69115263", "0.6910228", "0.690406", "0.6871747", "0.6854221", "0.6834732", "0.68008626", "0.6779741", "0.67696106", "0.6723611", "0.67072...
0.7339332
1
runMotor() does what it sounds like. Check to see if speed setting is rational, set to safe values. Check direction boolean and then... run for interval miliseconds
function runMotor(foo) { if(foo.err) { console.log('foo.err = ' + foo.err); return; } console.log('runMotor'); if(speed > max ) { speed = max; } else if (speed < min) { stopMotor(); console.log('speed hosed... getting out of here.'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _syncSpeedControl() {\n if(_sendSpeedControl) {\n if(roverCommand) {\n // rate limit to once per second\n const now = new Date();\n if(now.getTime() >= (_lastSendMs + 1000)) {\n const useSpeedControl = _state[0].getValue(\"u...
[ "0.66526604", "0.6469054", "0.6273424", "0.6227164", "0.60107106", "0.5988916", "0.5927909", "0.59247947", "0.5851876", "0.58278847", "0.57991964", "0.5795895", "0.5788519", "0.5784908", "0.573253", "0.57322776", "0.570748", "0.5705938", "0.56966084", "0.5690377", "0.5682448"...
0.7950249
0
Returns data at a specfic offset
get(offset) { validateOffset(offset); return this.data[offset / byteSize]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "offset( offset , cb ) {\n\t\tthis._readItem( offset , cb );\n\t}", "function getOffset(dataView, offset, offSize) {\n var v = 0;\n for (var i = 0; i < offSize; i += 1) {\n v <<= 8;\n v += dataView.getU...
[ "0.71465355", "0.66379076", "0.6610723", "0.6544428", "0.64115185", "0.63639605", "0.632977", "0.6247291", "0.62176543", "0.6108082", "0.6081794", "0.59536797", "0.5906408", "0.59061533", "0.5830509", "0.58149046", "0.57785404", "0.57783556", "0.5743513", "0.57079947", "0.568...
0.7407505
0
Set Blog data to state
[SET_BLOG] (state, blogs) { state.blogs = blogs }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeBlogPostData(data) {\n STORE = data;\n renderBlogPosts();\n}", "constructor(props) {\n super(props)\n this.state = {\n blog: {\n blogTitle: \"\",\n blogPreview: \"\",\n blogDesc: \"\",\n dateCreated: \"\",\n dateUpdated: \"\",\n },\n }\n }", ...
[ "0.7117012", "0.7007657", "0.6700846", "0.6628476", "0.6469234", "0.63675684", "0.63374466", "0.6328013", "0.6318215", "0.6293208", "0.61592716", "0.6120175", "0.60888195", "0.6078732", "0.6067075", "0.60660446", "0.60546196", "0.60359037", "0.60169405", "0.5998576", "0.59908...
0.75140727
0
Verify that two entries are not identical
function equal(entry1, entry2) { if (typeof entry2 === 'undefined') { return false } // Verify that there are no custom properties as differences if (!deepIs(Object.keys(entry1), Object.keys(entry2))) { // console.log('different keys', entry1, entry2) return false } const keys = Object.keys(entr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "systemModstampsAreDifferent(firstRecord,secondRecord){// treat systemModstamp being null/undefined as being present and different and thereby return true\n // entities like ContentNote(and may be a few more entities) do not have a systemModstamp and thereby the value will be null\n if((firstRecord.systemMods...
[ "0.6996507", "0.68842906", "0.677903", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6748251", "0.6698975", "0.6584062", "...
0.7250725
0
check cards ///////////////// //////////////// generate modal generateModal(nameProd,imgProd,tasteProd,flavorProd,roastProd,originProd,typeProd,workProd,acidProd,cafeProd,brandProduct);
function generateModal(priceProd,colorProd,nameProd,brandProd,imgProd,tasteProd,flavorProd,roastProd,originProd,typeProd,workProd,acidProd,cafeProd){ var rowToCompaA; var rowToCompaB; var rowToCompaC; modalCount += 1; htmToModal = '<div class="col-md-4 col-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generate_card() {\n let rand = Math.floor(Math.random() * 1000000)\n return `<div class=\"card listing-card\" type=\"button\" data-toggle=\"modal\" data-target=\"#exampleModal${rand}\">\n <div class=\"card-header\">${this.housing_type}: ${this.title}<div class=\"float-right price\">$${...
[ "0.72631896", "0.7009039", "0.6939981", "0.68486315", "0.67204666", "0.67186564", "0.6623209", "0.6579022", "0.65779775", "0.6548931", "0.65049475", "0.64925265", "0.6477687", "0.64734924", "0.64502954", "0.6449326", "0.6444022", "0.64286804", "0.64148057", "0.63591707", "0.6...
0.8120384
0
After selecting a job, present options (via buttons) for what the user wants to do with that job.
jobSelection({ message, jobName }) { this._log.debug('jobSelection being called...'); const { actions, message_ts } = message; const selectedJobName = jobName || actions[0].selected_options[0].value; // yikes const interactionBuilder = new InteractionBuilder(); const attachments = interactionBuilder...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectJob(job) {\n jobSelected = job;\n jobSelectedLastUdpate = new Date().getTime();\n updateJobDialog(job);\n}", "function showNewJob() {\n highlightMenuItem('new-job');\n document.location.hash = 'new-job';\n showJobForm();\n initJobForm();\n}", "function updateJobDialog(job) {\n if...
[ "0.7169938", "0.650462", "0.6459161", "0.6152599", "0.61297977", "0.59514385", "0.59425646", "0.59380025", "0.58186156", "0.5784695", "0.5704636", "0.56912816", "0.5626713", "0.5592688", "0.5568802", "0.55552685", "0.5550875", "0.5537771", "0.553312", "0.54938424", "0.5477099...
0.6826175
1
Write a function that takes an integer for length and builds/returns an array of strings of the given length Building array
function buildArray(length) { var array = []; for (var i = 0; i < length; i++) { array.push(randomWord()); } console.log(array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomArray(length) {\n var toReturn = [];\n var alphabet = \"abcdefghijklmnopqrstuvwxyz\".split(\"\");\n for (var i=0; i<length; i++) {\n wordLength = Math.floor(Math.random()*10+1);\n word = [];\n for (var k=0; k<wordLength; k++) {\n word.push(alphabet[Math.floor(Math.random()*alphabet....
[ "0.6772425", "0.67295843", "0.6515533", "0.6418286", "0.6212341", "0.6179994", "0.61734575", "0.6161069", "0.61565804", "0.6149896", "0.61292845", "0.61050576", "0.6090539", "0.6054927", "0.6035545", "0.60234636", "0.5996889", "0.5986016", "0.5982347", "0.59740967", "0.597235...
0.69726783
0
Generate a thumbnail list from image array. This assumes that a corresponding prefixed thumbnail exists for each image, with the configured prefix. NOTE: this method simply lists IMG tags for each image. It does NOT generate any arrays. This only happens when the popup is created. A dynamically generated javascript cal...
function getThumbs(category) { try { var out = ""; var tempArr = getTempArr(category); for(var a=0;a<tempArr.length;a++) { out += "<a onClick=\"javascript:showImage('" + a + "'," + category + ");return false;\" href=\"*\" title=\"" + tempArr[a].alt +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCodeThumbnails(){\n\t\tfor (var i= 0; i< code.length; i++){\n\t\t\tvar displaySquare = $(\"<div>\");\n\t\t\tdisplaySquare.addClass(\"codeThumbnails codeThumb\" + i);\n\t\t\tdisplaySquare.append(\"<div class='title'>\" + code[i].artType + \"</div>\");\n\t\t\tdisplaySquare.append(\"<img class='img' sr...
[ "0.6269155", "0.62093025", "0.61718374", "0.60267794", "0.58737224", "0.5855288", "0.5842698", "0.5785933", "0.57542217", "0.57396096", "0.5736575", "0.57309794", "0.5730713", "0.5725247", "0.57235897", "0.5720112", "0.57151955", "0.5710391", "0.5668329", "0.5650862", "0.5647...
0.66957766
0
return the image index ID and category ID from page URL params.
function getURLParams() { try { var location = window.location.toString(); var result = new Object(); if(location.indexOf("img=") != -1 && location.indexOf("category=") != -1) { var params = location.split("?")[1].split("&"); for(var a=0;a<para...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getURLParameter(sParam, location)\n{\n\t location = location || window.parent.location;\n var sPageURL =location.search.substring(1);\n var sURLVariables = sPageURL.split('&');\n var imgIds=[];\n for (var i = 0; i < sURLVariables.length; i++) \n {\n var sParameterName = sURLVariables...
[ "0.63378066", "0.5616558", "0.5596107", "0.55428106", "0.5454091", "0.54224753", "0.53987044", "0.53803325", "0.532254", "0.532254", "0.532254", "0.532254", "0.532254", "0.532254", "0.532254", "0.532254", "0.532254", "0.5280365", "0.5262493", "0.5262493", "0.5262493", "0.52...
0.5968315
1
example: array to sort: [5,6,9,3] pivot = arr[0] = 5 anything less than 5 will be in arr1 and anything greater than or equal to 5 will go to arr2: arr1 = [3] arr2 = [6,9] [5,6,9,3] [3] 5 [6,9] []6[9] end case is when the array's length is 1 or less once it starts returning, the arrays will concat and be sorted in the e...
function quickSort(arr) { if(arr.length<=1) return arr; // end case let pivot = arr[0]; let arr1 = []; // for values less than pivot let arr2 = []; // for values greater than or equal to pivot for(let i=1; i<arr.length; i++) { // iterate through arr and sort arr1 and arr2 if(arr[i]<pivot) { arr1.push(arr[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quickSort(arr) {\n\tif(arr.length < 2) return arr;\n\n\tlet pivot = arr[0];\n let lesser = [];\n let greater = [];\n\n for(let i = 1; i < arr.length; i++) {\n if(arr[i] < pivot) {\n lesser.push(arr[i]);\n } else {\n greater.push(arr[i]);\n }\n }\n\n return quickSort(lesser).concat(...
[ "0.76250243", "0.7465449", "0.74408776", "0.7403936", "0.73732", "0.73605484", "0.73536557", "0.73202336", "0.71905345", "0.7150262", "0.7148406", "0.7142072", "0.7098411", "0.7066662", "0.70480716", "0.7046377", "0.70360833", "0.7035316", "0.69751817", "0.69677365", "0.69479...
0.7515789
1
Export review data JSON to json file format. No cleanup is done on this export version
function exportJSON() { var dataStr = curDataStr(); var uri = 'data:application/json;charset=utf-8,'+ encodeURIComponent(dataStr); var fileName = 'review_data_' + moment().format('YYYY-MM-DD') + '.json' var linkEl = document.createElement('a'); linkEl.setAttribute('href', uri); linkEl.setAttribute('downloa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveDataToJsonFile(productData, reviews, questions) {\n FileUtil.saveDataToJsonFile(\n fileAndFolderNames.DATA_EXTRACTED_FOLDER,\n fileAndFolderNames.DATA_EXTRACTED_PRODUCT_FILE,\n productData\n );\n FileUtil.saveDataToJsonFile(\n fileAndFolderNames.DATA_EXTRACTED_FOLD...
[ "0.70870906", "0.64696276", "0.6361246", "0.63538116", "0.6237611", "0.6146452", "0.6144845", "0.59814835", "0.58898807", "0.5888245", "0.5872258", "0.5837152", "0.5806363", "0.5796871", "0.5790224", "0.5779692", "0.5708309", "0.5702354", "0.56982046", "0.5639369", "0.5616045...
0.74495125
0
Create a message ID starting from the local time
function createMessageId() { const logger = getLogger('utility.createMessageId') // Constants // Take the time and sum the time-offset with the server clock const time = new BigInteger((timeMod.getLocalTime()).toString()) // Divide the time by 1000 `result[0]` and take the fractional part `result[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateId() {\n var date = new Date();\n var components = [\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ];\n var id = components.join(\"\");\n return id;\n}", "static createId() ...
[ "0.6991191", "0.6969421", "0.6820735", "0.6793977", "0.67693853", "0.6757113", "0.67285126", "0.6606266", "0.65940833", "0.65012026", "0.6453514", "0.6416479", "0.6364945", "0.63619035", "0.6330007", "0.6320189", "0.6254183", "0.6247354", "0.6229614", "0.6218314", "0.62137794...
0.77197534
0
Create SHA1 hash starting from a buffer or an array of buffers
function createSHAHash(buffer, algorithm) { const logger = getLogger('utility.createSHA1Hash') const sha1sum = crypto.createHash(algorithm || 'sha1') if (util.isArray(buffer)) { logger.debug('It\'s an Array of buffers') buffer.forEach(b => sha1sum.update(b)) } else { logger.debug('It\'s only ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSHA1Hash(buffer) {\n var logger = require('../util/logger')('crypto.createSHA1Hash');\n var sha1sum = crypto.createHash('sha1');\n if (util.isArray(buffer)) {\n if (logger.isDebugEnabled()) logger.debug('It\\'s an Array of buffers');\n for (var i = 0; i < buffer.length; i++) {...
[ "0.8202307", "0.7634701", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.6888824", "0.68852353", "0.68835396", "0.68830395", "0.68763614", "0.68763614", "0.68763614...
0.771883
1
Xor op on buffers
function xor(buffer1, buffer2) { const length = Math.min(buffer1.length, buffer2.length) const retBuffer = new Buffer(length) for (let i = 0; i < length; i++) { retBuffer[i] = buffer1[i] ^ buffer2[i] } return retBuffer }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xorBuffer(buf, value) {\n for (var i = 0; i < buf.length; i++) {\n buf.writeInt8(buf.readInt8(i) ^ (+value), i);\n }\n return buf;\n}", "function op_xor(x,y){return x^y}", "function op_xor(x, y) { return x ^ y; }", "function op_xor(x, y) { return x ^ y; }", "function op_xor(x,y) { return x^y...
[ "0.78225154", "0.7051732", "0.7039739", "0.7039739", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", "0.6947556", ...
0.8008725
0
Convert a Buffer to a String using TL deserialization
function buffer2String(buffer) { return utility.buffer2StringValue(buffer) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buf2str(buffer, encoding) {\n return Buffer.from(buffer).toString(encoding);\n}", "function deserialize(buffer, options) {\n if (options === void 0) { options = {}; }\n return deserialize$1(buffer instanceof Buffer ? buffer : ensureBuffer(buffer), options);\n}", "function bufferToString(buffe...
[ "0.69392335", "0.6640204", "0.6546585", "0.6512558", "0.6512558", "0.6512558", "0.6512558", "0.64643925", "0.64555854", "0.6448387", "0.6439569", "0.63556725", "0.63266325", "0.6321985", "0.63114434", "0.62858224", "0.6273546", "0.6235786", "0.6227866", "0.62242603", "0.62181...
0.7664492
0
Extract Data from XML
function extract(xml) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractXMLData(result){\n\n var i=0,number=0,text,j=0,k=0;\n var timedText = new Array(2);\n timedText[0] = new Array(10000);\n timedText[1] = new Array(10000);\n\n let line = result.toLowerCase();\n\n while(i<line.length){\n if (line.indexOf('<',i)!=-1)\n {\n i=line.indexOf...
[ "0.68877906", "0.5953738", "0.59294724", "0.58307785", "0.58307785", "0.58307785", "0.58307785", "0.5821461", "0.5821461", "0.573398", "0.5683591", "0.56444395", "0.55399144", "0.5533699", "0.55048656", "0.5486282", "0.54641", "0.54119563", "0.5391121", "0.5382663", "0.534571...
0.7141464
0
An editor context mediates between the Xtext services and the Orion editor framework.
function OrionEditorContext(editor) { this._editor = editor; this._serverState = {}; this._serverStateListeners = []; this._highlightAnnotationTypes = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EditManager() {\n\n\tthis.mdEditor = undefined;\n\tthis.rtEditor = undefined;\n\tthis.context = undefined;\n\tthis.mode = ReactiveVar(undefined);\n\n\t/**\n\t * Function used to save the managers current context.\n\t */\n\tthis.save = function () {\n\n\t\tconsole.log('Saving...');\n\n\t if (this.contex...
[ "0.67355454", "0.62792784", "0.612122", "0.60168", "0.60107774", "0.60018235", "0.5924335", "0.59110445", "0.5903439", "0.58681613", "0.58665866", "0.5833382", "0.5806497", "0.5806497", "0.5762821", "0.5699281", "0.5690069", "0.56818676", "0.5674153", "0.56518936", "0.5651893...
0.75863636
0
gui for: generation using standard generation using gauge zoom, rotate pdf, image, show approx. size debug
constructor(debug = false) { // Create GUI // colorMode(RGB); // HSB gui_gen_standard = this.createGUIgenGauge('standard'); gui_gen_measure = this.createGUIgenGauge('measure'); // gui_gen_measure.hide(); // use_measure_gauge = false; gui_gen_standard....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "display(){\n fill(this.R, this.G, this.B);\n box(this.sizeXYZ);\n }", "function OnDrawGizmos () {\n\tGizmos.DrawIcon (transform.position, \"../Resources/Editor/FlowProbe.tga\");\n}", "generate() {\n const {\n textOptions: {\n size: textFontSize,\n font: {\n family: textFon...
[ "0.6340009", "0.6180849", "0.6136167", "0.6099122", "0.6010804", "0.59877306", "0.5964054", "0.590179", "0.59000045", "0.5895561", "0.5883058", "0.58785075", "0.5873598", "0.5866739", "0.58614045", "0.58287376", "0.582148", "0.5814515", "0.58085597", "0.5805723", "0.57885593"...
0.6392763
0
to display the css code of bg color CHOSEN on screen
function DisplayColor() { body.style.background = "linear-gradient(to right, " + color1.value + ", " + color2.value + ")"; csscodedisplay.textContent = body.style.background + ";"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get backgroundColor() {}", "function _7Jb19DyNcTqqawPUiKaN_bg() {}", "colorHex_(){\n var color = \"\";\n for(var index=0;index<6;index++){\n color= color + this.generar_();\n }\n return \"#\"+color;\n }", "function getSectionBg(color) {\n return Please.make_co...
[ "0.676949", "0.67162246", "0.6592145", "0.6590679", "0.657372", "0.6539156", "0.6514976", "0.6504994", "0.64811414", "0.6465592", "0.64132524", "0.641289", "0.64061064", "0.63780874", "0.6366318", "0.63597333", "0.634633", "0.6333922", "0.63127756", "0.6296566", "0.6294965", ...
0.71566516
0
card grid made here
function makeCardGrid(num) { // check if a value exists inside local storage and if there is one it inputs it insde score on screen if(localStorage.getItem('keepScore') !== null){ totalScore = parseInt(localStorage.getItem('keepScore')) score.innerText = parseInt(localStorage.getItem('keep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeCards(array) {\n var cardsPerRow = array.length / 6; //8\n // Create six rows\n for (var rows = 0; rows < 6; rows++) {\n var $row = $('<div class=\"card-row\"></div>');\n // Add cards to rows\n for (var cardItem = 0; cardItem < cardsPerRow; cardItem++) {\n // Add cards\n var ...
[ "0.7115873", "0.7041379", "0.7013836", "0.6871946", "0.68295556", "0.68276656", "0.6812325", "0.6794828", "0.6786091", "0.6759375", "0.6738785", "0.673576", "0.67262965", "0.6724056", "0.6718185", "0.66908103", "0.66876817", "0.66804034", "0.6677198", "0.6670721", "0.6646299"...
0.72795296
0
var unimportantFetchesThatDidNotFinish = []; Starts an unimportant fetch can be aborted at any time and resumed later
function unimportantFetch(request, options, resolveFunction, rejectFunction) { //First thing: if other important fetches are running, do not immediately start this unimportant one; queue it instead. if(activeImportantFetches.length) { queuedUnimportantFetches.push({request, options, resolve: resolveFunction, rej...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beforeUnload() {\n for (var index = 0; index < currentRequests.length; index++) {\n currentRequests[index].abort();\n }\n}", "abortAll() {\n const nodes = this.shadowRoot.querySelectorAll('request-panel');\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].loading) {\n ...
[ "0.6051689", "0.6034138", "0.5933709", "0.5829486", "0.58064497", "0.58064497", "0.5770967", "0.57270044", "0.5723686", "0.5720428", "0.5704378", "0.5703797", "0.56397134", "0.56317663", "0.5557837", "0.5544743", "0.5535655", "0.55236655", "0.54940236", "0.5471946", "0.544006...
0.72281086
0
Function to validate at least one checkbox under register for activites
function validateCheckBoxesForRegisterForActivities() { let foundCheckedBox = false; // Create an errorSpan let errorSpan = $("<span>"); // Set the errorSpan id to checkBoxErrorSpan errorSpan.attr("id", "checkBoxErrorSpan"); // Set the text of the error span to At least one check box activity must be se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateAcivityCheckboxes(){\n const activityLegend = document.querySelector(\".activities legend\");\n return validateCheckBoxesWithLabel(activityCheckboxes, activityLegend, 1,\n 'Register for Activities', 'At least one activity must be chosen');\n }", "function validateCheckb...
[ "0.7891726", "0.7278967", "0.70763993", "0.697846", "0.6911002", "0.6835987", "0.6812822", "0.65355533", "0.6527561", "0.650884", "0.6473431", "0.6463795", "0.64630336", "0.64441276", "0.639928", "0.6361219", "0.6359615", "0.6355559", "0.63226444", "0.6322071", "0.6249033", ...
0.7626405
1
Asynchronously initializes HTTP Server: Express used for static file serving and routing Socket.io used for passing data from client to server
async function initHTTPServer() { // Set up Express http.listen(portNum, () => console.log("Listening on ++1337 port!")); app.get("/getTraining", (req, resp) => getData(req, resp)); app.get("/getTesting", (req, resp) => getData(req, resp, true)); app.get("/sendImageData", gotDoodleData); app.use("/", expre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init()\n{\n app.use(express.json());\n app.use(express.urlencoded());\n app.use(express.static(__dirname + '/public'));\n\n /* Create server */\n server = http.createServer(app)\n server.listen(port, function () {\n console.log(\"SERVER RUNNING. Port: \" + port);\n });\n ser...
[ "0.7406458", "0.7314861", "0.7275052", "0.72468233", "0.7212917", "0.7060024", "0.6994876", "0.6939762", "0.689942", "0.6893927", "0.68086463", "0.6797241", "0.6782209", "0.6743542", "0.67402995", "0.6725866", "0.6690535", "0.6689774", "0.66275644", "0.66260797", "0.6616312",...
0.8335674
0
Asynchronously initialize Doodle Data NDJSON parses doodle json data from fs filestream pipe and pushes it to the specified doodleArray array
async function initDoodleData() { fs.createReadStream("./drawings/ant.ndjson") .pipe(ndjson.parse()) .on("data", ant => { doodleArray[0].push(ant.drawing); }) .on("end", () => { trainingBounds.push(Math.floor(doodleArray[1].length * trainingFraction)); }); fs.createReadStream("./dra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async createAndImportJson(dataset, javascriptObjectArray) {\n const createdDataset = await this.create(dataset)\n await this.importDataJson(createdDataset.id, javascriptObjectArray)\n return createdDataset\n }", "async function readMultiData() {\n\n var contentPodUrl1;\n var contentPodUrl2;\n var co...
[ "0.5293764", "0.50992805", "0.4997977", "0.49977285", "0.4978529", "0.4972493", "0.49505615", "0.4913252", "0.4884741", "0.48663932", "0.48326042", "0.480562", "0.47786704", "0.47691143", "0.47668", "0.47589678", "0.47542274", "0.47516346", "0.4745816", "0.47341934", "0.47313...
0.71791244
0
Compare player's choice and computer's result:
function compare_result(p_choice, c_choice){ console.log("Comparing...") winner.style.visibility="visible"; if (p_choice === c_choice){ tie(); return; } if (p_choice === 'rock'){ if (c_choice === 'scissors'){ player_win(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compare() {\n gamesPlayed++;\n convert(initialAnswer);\n let computerChoice = Math.floor(Math.random() * 3);\n if (initialAnswer === computerChoice) {\n youTie();\n } else if ((initialAnswer === 0 && computerChoice === 1) || (initialAnswer === 1 && computerChoice === 2) || (initialAnswer === 2 && ...
[ "0.7892791", "0.78645706", "0.78577906", "0.77492803", "0.7741962", "0.77250105", "0.7677794", "0.7582062", "0.75711006", "0.75568914", "0.75319755", "0.7525987", "0.74560815", "0.74543196", "0.7446399", "0.7426492", "0.7403684", "0.7399311", "0.73947537", "0.73626286", "0.73...
0.8240743
0
Create the youtube player object for a widget.
function createYtPlayer(widgetId) { if (!apiReady) { // Keep recursively checking to see if the api is ready. setTimeout(function() { createYtPlayer(widgetId); }, 1000); return; } player[widgetId] = new YT.Player('ytPlayer_' + widgetId, { height: '420', width: '640', // videoId: '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createYoutubePlayer() {\n player = new YT.Player('player', {\n height: '390',\n width: '640',\n videoId: '',\n events: {\n 'onReady': onPlayerReady,\n 'onStateChange': onPlayerStateChange\n }\n });\n}", "function getYoutubeDiv(widgetId) {\r\...
[ "0.7553182", "0.6729198", "0.65690327", "0.65551233", "0.6490488", "0.6490488", "0.6490303", "0.64146805", "0.63623595", "0.63441885", "0.6320639", "0.63017285", "0.6301604", "0.62391967", "0.6232679", "0.6197537", "0.6190087", "0.61584824", "0.6139447", "0.61272436", "0.6123...
0.77369815
0
Handle player error events.
function onPlayerError(event) { console.error(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPlayerError(errorCode) {}", "function onPlayerError( event ) {\n\t// This logs an error code, find the explanation of error codes here: https://developers.google.com/youtube/iframe_api_reference?hl=en#Events\n\tconsole.log( event.data );\n}", "function onytplayerError(error) {\n\tplayNextVideo()\n}"...
[ "0.8583309", "0.7831327", "0.7322337", "0.7168329", "0.7093539", "0.68197215", "0.6797203", "0.6735497", "0.65121776", "0.640593", "0.64006156", "0.6359993", "0.6265316", "0.6259971", "0.62517136", "0.6246247", "0.6193294", "0.61875325", "0.6151353", "0.61489064", "0.6142418"...
0.8313449
1
Helper functions. Get the jquery object for the current youtube widget.
function getYoutubeDiv(widgetId) { if (null == widgetId) widgetId = currentWidgetId; return $("#ytWidget_" + widgetId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_widget(id){\n \n // Get the HTMLWidgets object\n var htmlWidgetsObj = HTMLWidgets.find(\"#\" + id);\n \n // Use the getWidget method we created to get the underlying widget\n var widgetObj ;\n \n if (typeof htmlWidgetsObj != 'undefined') {\n widgetObj = htmlWidgetsObj.getWidget();\n }\n\n ...
[ "0.63812757", "0.62844646", "0.62604016", "0.60581106", "0.60334444", "0.5922578", "0.5890143", "0.58537966", "0.58537966", "0.58537966", "0.58537966", "0.58537966", "0.5818812", "0.581487", "0.57091504", "0.5690681", "0.5678127", "0.5667867", "0.5666615", "0.5666615", "0.566...
0.7921174
0
Toggle the search youtube section.
function toggleSearch(widgetId) { var widget = getYoutubeDiv(widgetId); widget.find("#ytPlaylist").hide(); widget.find("#ytVideo").hide(); widget.find("#ytSearch").show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleVideo(widgetId) {\r\n\tvar widget = getYoutubeDiv(widgetId);\r\n \twidget.find(\"#ytPlaylist\").hide();\r\n \twidget.find(\"#ytVideo\").show();\r\n \twidget.find(\"#ytSearch\").hide();\r\n}", "function onYouTubeApiLoad() {\n // This API key is intended for use only in this lesson.\n // See h...
[ "0.68381774", "0.67936665", "0.65591645", "0.63746244", "0.6139538", "0.6044762", "0.6020828", "0.6018847", "0.5968961", "0.59631366", "0.5958228", "0.59217256", "0.59036905", "0.5892876", "0.5887518", "0.58759415", "0.5856845", "0.58526546", "0.58396083", "0.57895833", "0.57...
0.7876369
0
Toggle the playlist section.
function togglePlaylist(widgetId) { var widget = getYoutubeDiv(widgetId); widget.find("#ytPlaylist").show(); widget.find("#ytVideo").hide(); widget.find("#ytSearch").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "togglePlay() {\n\t\t\n\t\t// cache it as changing it is asynch and want to stop/start scrolling\n\t\tvar newPlayState = !this.state.play\n\n\t\tconsole.log( \"toggling play to \" + newPlayState );\n\n\t\tif( newPlayState ) {\n\t\t\tconsole.log( \"playing \" + this.state.config.music_url )\n\t\t}\n\t\t\n\t\tthis.se...
[ "0.6727683", "0.66970986", "0.66380066", "0.6572161", "0.6510967", "0.65056074", "0.6473943", "0.6464613", "0.6404975", "0.6388744", "0.6380089", "0.637295", "0.63722557", "0.6315649", "0.6294657", "0.62883776", "0.6273079", "0.6238239", "0.6221817", "0.6221063", "0.61974335"...
0.6801786
0
Get the playlist for a widget from the server.
function getPlaylist(widgetId) { var widget = $("#ytWidget_" + widgetId); // Set default values. currentlyPlayingId[widgetId] = null; activeVideoIndex[widgetId] = 0; videoPlaying[widgetId] = false; autoPlayWhenReady[widgetId] = null; carouselSetup[widgetId] = false; // Fetch any existing playlist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPlaylist() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.requestPlaylist();\n });\n }", "function togglePlaylist(widgetId) {\r\n\tvar widget = getYoutubeDiv(widgetId);\r\n \twidget.find(\"#ytPlaylist\").show();\r\n \twidget.find(\"#ytVideo\").hide();\r\n \...
[ "0.7014219", "0.66084015", "0.63588417", "0.6237264", "0.6227516", "0.61544985", "0.61510134", "0.6123173", "0.6086724", "0.60437614", "0.6025162", "0.601242", "0.588107", "0.5876581", "0.58312005", "0.57667184", "0.5751798", "0.5720252", "0.5714843", "0.5712852", "0.57026285...
0.7384162
0
Render a playlist item to the carousel for that widget.
function renderPlaylistItem(widgetId, ytId, title, thumbnail, active) { var removeBtn = '<div style="position:absolute; top:20px; right:150px;"><a href="javascript:removeFromPlaylist(\'' + ytId + '\');"' + ' title="' + youtubeLocale.removeFromPlaylist + '"><img src="' + youtubeLocale.contentPath + 'cross.png"/></a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _render() {\n var id = 1;\n _allSongs.forEach(function(song) {\n song.render(_$PlayListElement, id);\n id++;\n }, this);\n }", "function Playlist(props) {\n\t// const {titulo, descripcion, lista} = props // --- playlist\n\treturn (\n\t\t<div className = \"Playlist\">\n\t\t\t{\n\t...
[ "0.6639948", "0.65562165", "0.6381359", "0.6322293", "0.6198928", "0.6156334", "0.61529356", "0.6070777", "0.6039012", "0.59649503", "0.5905067", "0.5897207", "0.58826286", "0.5857577", "0.5842721", "0.5831444", "0.5821114", "0.5779619", "0.5770452", "0.573551", "0.5705265", ...
0.73292
0
Video playing functions. Play the specified video in the specified widget.
function playVideo(ytId, widgetId) { if (!playlistConfig.canStreamMedia) return; if (null == widgetId) widgetId = currentWidgetId; videoPlaying[widgetId] = true; getYoutubeDiv(widgetId).find("#navVideo").show(); player[widgetId].loadVideoById(ytId); toggleVideo(widgetId); currentlyPlaying...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playVideo(){\n this.scheduleHideControls();\n this.videoElement.current.play();\n }", "function _playVideo(){\n\t$.videoPlayer.evalJS('player.playVideo()');\n}", "function videoControl(){\n $('.video').get(0).play();\n}", "function playVideo(event) {\n\n}", "function videoPlay()\n{\n executeComm...
[ "0.7338162", "0.7288076", "0.7057726", "0.70353734", "0.6893768", "0.68384606", "0.67438436", "0.67419124", "0.6734322", "0.6714165", "0.67112297", "0.6672934", "0.66701466", "0.6666933", "0.6663012", "0.6640156", "0.6629124", "0.6628787", "0.6618086", "0.661527", "0.6599519"...
0.7411158
0
Play the previous video in the widgets playlist.
function playPreviousVideo(widgetId) { if (null == widgetId) widgetId = currentWidgetId; if (playlistConfig[widgetId].shuffle) { var nextVideo = Math.floor(Math.random() * playlist[widgetId].length); // Don't play the same video twice in a row. if (nextVideo == activeVideoIndex[widgetId]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previous() { \n\tvar i = (current !== undefined)? playerPlaylist.indexOf(current) - 1 : 0;\n\tstop();\n\tif (i >= 0 && i < playerPlaylist.length) {\n\t\tplayAt(i);\n\t} else if (loops) {\n\t\tplayAt(playerPlaylist.length - 1);\n\t} else {\n\t\tcurrent = undefined;\n\t}\n}", "function prevSong() {\n v...
[ "0.76317954", "0.76078045", "0.7522437", "0.743015", "0.73293656", "0.7282983", "0.72350353", "0.7166761", "0.7145123", "0.7118409", "0.71066916", "0.7073453", "0.7065429", "0.703713", "0.7029777", "0.7019342", "0.7015431", "0.7000049", "0.697054", "0.6968388", "0.6963311", ...
0.78156936
0
Hide and clear the search error message display.
function hideSearchError() { var errorDisplay = getYoutubeDiv().find("#ytSearchError"); errorDisplay.hide(); errorDisplay.html(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSearchError() {\n toggleSearchMessage(true, \"An error occurred during your search.\");\n searchFieldElem.setAttribute(\"showSpinner\", false);\n }", "function displayError() {\n alert(\"search term can not be empty!\");\n }", "function hideError() {\n c...
[ "0.79688066", "0.6908149", "0.68339425", "0.6825249", "0.6780524", "0.6723203", "0.6659594", "0.6653118", "0.66438067", "0.664175", "0.6632259", "0.66227823", "0.6594742", "0.65911674", "0.65888125", "0.65807873", "0.6567365", "0.6565771", "0.6538287", "0.65109456", "0.650819...
0.7432528
1
function to update notes
function updateNote(k) { // create transaction var transaction = db.transaction("notesStore", "readwrite"); // Ask for ObejcetStore var store = transaction.objectStore("notesStore"); var updateName = $('#edit-name').val(); var updateSub = $('#edit-subject').val(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateNote() {\n var currentTime = new Date().getTime();\n tapNoteDB.update({\n 'title': title.value || title.placeholder,\n 'text': text.value,\n 'posterBlob': currentNote.posterBlob ? currentNote.posterBlob : '',\n 'timeStamp': currentNote.timeStamp ? currentNote.timeStamp : cu...
[ "0.8010109", "0.7490871", "0.71818244", "0.7174832", "0.70461917", "0.7034195", "0.7034195", "0.69966346", "0.69900995", "0.6981208", "0.6948251", "0.69421595", "0.6906387", "0.6905955", "0.69057006", "0.69009954", "0.6818556", "0.6783078", "0.6779989", "0.6779295", "0.676651...
0.7675153
1
=============== Tab Widget Function ===============
function tab_widget(selector) { $( selector + " .tab_content").hide(); $( selector + " ul.tabs li:first").addClass("active").show(); $( selector + " .tab_content:first").show(); $( selector + " ul.tabs li").click(function() { $( selector + " ul.tabs li").rem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tabcontent() {\r\n $('.menu .item').tab({\r\n cache: false,\r\n alwaysRefresh: true,\r\n history: true,\r\n historyType: 'hash',\r\n apiSettings: {\r\n loadingDuration : 1000,\r\n url: 'modules/{$tab}.html'\r\n }\r\n });\r\n}", "function Tab() {}", "tabs(tab, number) {\n\...
[ "0.71361", "0.70445365", "0.7028189", "0.7012021", "0.70017374", "0.69692767", "0.6884767", "0.6721908", "0.6721057", "0.6716563", "0.6713212", "0.6711861", "0.67028487", "0.66941106", "0.66889286", "0.66819876", "0.6675692", "0.66743064", "0.6670384", "0.6658515", "0.6648309...
0.73262995
0
funcao responsavel por recuperar a senha
async function recuperarSenha() { if (validaDadosCampo(['#login', '#pergunta', '#novaSenha'])) { const result = await requisicaoPOST( 'forgot', JSON.parse( `{"name":"${document.getElementById('login').value}","response":"${ document.getElementById('pergunta').value }","p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lembra_senha(){\n\t var tipo=\"\";\n\t\tif(form_5.tipo[0].checked){\n\t\t tipo=form_5.tipo[0].value;\n\t\t}\n\t\telse if(form_5.tipo[1].checked){\n\t\t tipo=form_5.tipo[1].value;\n\t\t}\n\t\t\n\t\tif (tipo==\"\"){\n\t\t\tif (form_5.l0.value==\"\"){\n\t\t\t alert(\"Digite o email de login e mar...
[ "0.6158447", "0.6151354", "0.5973234", "0.59302145", "0.58980125", "0.5892596", "0.58591425", "0.58089477", "0.58015776", "0.5778697", "0.5645513", "0.5603365", "0.55993885", "0.55943096", "0.5585885", "0.55577326", "0.5554999", "0.55297995", "0.5521822", "0.5501957", "0.5462...
0.6718461
0
funcao para autenticacao e liberacao de sessao
function autenticacaoLogin() { if (sessionStorage.getItem('login') == null) { mensagemDeErro('Usuário não autenticado!') return telaAutenticacao() } return sessionStorage.getItem('login') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificarAutenticacion(req, res, next){\n if(req.session.usuarioId){\n console.log(\"la sesion esta iniciada\");\n return next();\n }\n\telse{\n res.redirect(\"/\");\n //res.send(\"ERROR, ACCESO NO AUTORIZADO\");\n \n }\n \n}", "login(req, res) {\n ...
[ "0.65509105", "0.6405819", "0.6373166", "0.6363837", "0.63239825", "0.631505", "0.6212987", "0.620056", "0.61249256", "0.61220413", "0.61153793", "0.6114459", "0.6083656", "0.6043017", "0.6041832", "0.6029199", "0.6024159", "0.60191685", "0.59991455", "0.5996512", "0.59863365...
0.6914649
0
create a function that takes an array numbers it and sends it to the db.json
function packageAndStore(array) { for (let i = 0; i < array.length; i++) { array[i].id = i + 1; } fs.writeFileSync("db.json", JSON.stringify(array), function (err) { if (err) throw err; console.log("Saved!"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertIntoDb(db, array){\n\t\tif (array !== undefined && db !== undefined){\n\t\t\t\tvar format = '%s';\n\t\t\t\tfor (var i = 0; i<array.length -1; i++){\n\t\t\t\t\tformat = \"%s, \" + format;\n\t\t\t\t}\n\t\t\t\tconnection.query(connection.escape(sprintf(\"INSERT INTO %s VALUES \" + vsprintf(format, [nul...
[ "0.6224577", "0.5966293", "0.58444715", "0.58320236", "0.58278453", "0.5799494", "0.57519406", "0.57088536", "0.56899744", "0.5684959", "0.5675685", "0.5654553", "0.5648975", "0.5646062", "0.56424564", "0.5625656", "0.5603979", "0.55776936", "0.55452204", "0.5537536", "0.5537...
0.65981257
0
Save the given RenderTarget under the given name as PNG
function debugSaveRenderTarget( name, rt, format ) { var image=VG.Utils.renderTargetToImage( rt ); var params = {}; params.filename = name; params.content = VG.compressImage( image, format ); VG.downloadRequest("/api/download?binary=true", params, "POST"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveIMG(name) {\n\tvar ctx = renderer.domElement;\n\t\n var imgAsDataURL = ctx.toDataURL(\"image/png\");\n\n ctx.toBlob(function(blob) {\n\t saveAs(blob, name);\n\t});\n}", "function saveScreenShot(gl, name) {\n if (gl && gl.canvas instanceof HTMLCanvasElement) {\n gl.canvas.toB...
[ "0.75823015", "0.6518864", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737", "0.62529737",...
0.7580894
1
Deletes all projects from the Wordsmith account.
function siteClean() { cy.visit('https://wordsmith.automatedinsights.com/dashboard') cy.url() .should('include', '/dashboard') //all the project names cy.get('.table-row.clickable * .flex.flex-column.flex-center > span') .each(($el, index, $list) => { const projectName = $el.text() if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteOldProjects()\n{\n\t//get the list of projects\n\tSeS('Project_Retrieve').SetCredential(username, apiKey);\n\tSeS('Project_Retrieve').DoExecute();\n\tvar projects = SeS('Project_Retrieve').GetResponseBodyObject();\n\tTester.Message('Found ' + projects.length + ' project(s).');\n\tvar count = 0;\n\tf...
[ "0.68860424", "0.6135053", "0.6038461", "0.60376483", "0.60165083", "0.59856564", "0.5928391", "0.58891946", "0.58694583", "0.58572197", "0.5791256", "0.5736277", "0.5708845", "0.5630785", "0.56284904", "0.56130064", "0.5561415", "0.55491376", "0.5544736", "0.55108917", "0.54...
0.6259836
1
Update selected seats on the map
function updateSelectedSeats(e) { if(nb_seats==5 && (!e.target.classList.contains("selected"))){ toastr["error"]("Vous ne poivez pas réserver plus de 5 places."); return; } if (e.target.classList.contains("seat") && !e.target.classList.contains("occupied")) e.target.classList.toggle("selected"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSelectedCount(){\n const selectedSeats = document.querySelectorAll('.row .seat.selected'); \n\n /* bu noktada seçilmiş olan koltukları belirledik, bunları bir array içinde tutup bunu da bir storage a yollayıp orada tutmalıyız, çünkü şu anda tarayıcı refresh inde veya benzeri bir durumda bu ...
[ "0.71081704", "0.6906855", "0.6762877", "0.6751037", "0.6691791", "0.66482586", "0.66356254", "0.6562832", "0.6535737", "0.6487749", "0.6467999", "0.6433474", "0.6426851", "0.6405173", "0.64008063", "0.63973665", "0.63356036", "0.63154435", "0.63099515", "0.61846817", "0.6178...
0.74633974
0
Set initial occupied seats on the map
function setOccupiedSeats(ids_seats_occupied) { ids_seats_occupied.forEach(id_seat => { document.getElementById(id_seat).classList.toggle("occupied"); document.getElementById(id_seat).classList.remove("free"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetSeat()\n {\n setTempSeats(seats);\n setNewSeat(defaultSeat);\n setStatus({value: 'Available'});\n }", "function occupiedSeats(x, y, initialState) {\n let occupiedVisible = 0\n // top\n for (let row = x - 1; row >= 0; row--){\n if (initialState[row][y] === ...
[ "0.60778606", "0.58788306", "0.5789938", "0.57765436", "0.5775096", "0.5769926", "0.5702878", "0.56656414", "0.56472963", "0.5640832", "0.56034166", "0.56030285", "0.55991876", "0.55780613", "0.5575627", "0.5554897", "0.55358404", "0.55149066", "0.5499594", "0.5498429", "0.54...
0.6362421
0
Set initial non reservable seats on the map
function setNonReservableSeats(ids_non_reservable_seats) { ids_non_reservable_seats.forEach(id_seat => { document.getElementById(id_seat).classList.toggle("non-reservable"); document.getElementById(id_seat).classList.remove("free"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetSeat()\n {\n setTempSeats(seats);\n setNewSeat(defaultSeat);\n setStatus({value: 'Available'});\n }", "function setOccupiedSeats(ids_seats_occupied) {\n\tids_seats_occupied.forEach(id_seat => {\n\t\tdocument.getElementById(id_seat).classList.toggle(\"occupied\");\n\t\tdoc...
[ "0.6691738", "0.6039865", "0.58818865", "0.5841136", "0.5812859", "0.5495687", "0.5449596", "0.536049", "0.53547674", "0.5334318", "0.52649045", "0.52493334", "0.5240109", "0.5201668", "0.5184662", "0.5173912", "0.5167314", "0.51521236", "0.5151743", "0.51447254", "0.51433593...
0.6592296
1
Get the non reservable seats ids on the map in case of covid protocol
function getCovidNonReservablesSeats() { var array1=[2,5,7,10]; var array2=[]; for (let a = 1; a < 7; a++) { array1.forEach(num => { array2.push(num+11*a); }); } return array1.concat(array2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setNonReservableSeats(ids_non_reservable_seats) {\n\tids_non_reservable_seats.forEach(id_seat => {\n\t\tdocument.getElementById(id_seat).classList.toggle(\"non-reservable\");\n\t\tdocument.getElementById(id_seat).classList.remove(\"free\");\n\t});\n}", "function getIdsSeatsSelected() {\n\tconst selected...
[ "0.6333759", "0.6185328", "0.57426715", "0.55409205", "0.55373067", "0.55325514", "0.5510333", "0.5458452", "0.54355156", "0.53552574", "0.52579623", "0.52442926", "0.52437514", "0.5233021", "0.5226632", "0.518297", "0.5171267", "0.51431066", "0.51192397", "0.5087569", "0.508...
0.62180513
1
setup database helper function for deciding database request
function db_helper(req){ if (req.body.nlp_mode=='supervised'){ Product = Prod_sup; Loc = Loc_sup; Listing = Listing_sup; Listing_u = Listing_u_sup; } else if (req.body.nlp_mode=='unsupervised'){ Product = Prod_unsup; Loc = Loc_unsup; Listing = Listing_unsup; Listing_u = Listing_u_unsup; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupDatabases(callback) {\n context.directionsHelper = require('./directions-helper');\n context.directionsHelper.init(context, callback);\n\tcontext.locationDb = require('./location-database');\n\tcontext.locationDb.init(context, callback);\n context.userDb = require('./user-database');\n context.us...
[ "0.6564857", "0.6424505", "0.63937366", "0.6302359", "0.6274988", "0.61907005", "0.6174028", "0.6137062", "0.6134823", "0.60912764", "0.6086134", "0.6079593", "0.60781205", "0.60522616", "0.6027442", "0.60256046", "0.5997437", "0.59836423", "0.59828395", "0.5977933", "0.59756...
0.663476
0
this function submits the form to delete the current vendor it is only available if there are no items associated with the vendor
function deleteVendor(v){ // display and get the confirmation var confrimed = confirm("Delete this vendor?\nThis action is not reversable!"); // if confirmed submit the form if(confrimed){ window.location = "processVendorDelete.php?vendor_ID=" + v; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteVendor(){\n\t// Get the vendorID entered by the user\n\tvar vendorDetailsVendorID = $('#vendorDetailsVendorID').val();\n\t\n\t// Call the deleteVendor.php script only if there is a value in the\n\t// vendor ID textbox\n\tif(vendorDetailsVendorID != ''){\n\t\t$.ajax({\n\t\t\turl: 'model/vendor/delete...
[ "0.7054848", "0.64509434", "0.6086835", "0.6058292", "0.5905224", "0.5859573", "0.58370364", "0.57829744", "0.5766994", "0.5754087", "0.57435393", "0.57299817", "0.5705231", "0.5673303", "0.5660445", "0.56589264", "0.5647769", "0.5647485", "0.56465024", "0.56287104", "0.56279...
0.7204705
0
Initialize the weather app. Get the current latitude & longitude. Get the current Location name. Show weather status.
function initApp() { getCurrentLatitudeAndLongitude(function (latLng) { getCurrentLocationName(latLng.lat, latLng.lng) showWeather(latLng.lat, latLng.lng) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(position => {\n getWeather(position.coords.latitude, position.coords.longitude);\n });\n } else {\n loc.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function startUp() {\n\t\t\...
[ "0.7372606", "0.7063881", "0.7032873", "0.69807196", "0.69604063", "0.6867872", "0.686535", "0.6818218", "0.6791356", "0.6761824", "0.66603035", "0.66317064", "0.6628928", "0.6573113", "0.6557268", "0.65551245", "0.6547795", "0.6541997", "0.6539938", "0.65334857", "0.65163225...
0.7949395
0
Given a twodimensional array of integers, return the flattened version of the array with all the integers in the sorted (ascending) order. Example: Given [[3, 2, 1], [4, 6, 5], [], [9, 7, 8]], your function should return [1, 2, 3, 4, 5, 6, 7, 8, 9]. Addendum: Please, keep in mind, that JavaScript is by default sorting ...
function flattenAndSort(array) { // Good luck, brave code warrior! let flatArray = [] array.forEach(function(el){//for each for el.forEach(function(innerEl){ flatArray.push(innerEl)//pushing innerEl into the flatArray }) }) flatArray.sort(function(num1, num2){//sort is a comparison function ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flatten(arr) {\n var newarr = [];\n for(var i = 0; i < arr.length; i++) {\n if(Array.isArray(arr[i])) {\n var next = flatten(arr[i]);\n /*https://davidwalsh.name/merge-arrays-javascript*/\n Array.prototype.push.apply(newarr, next);\n } else {\n newarr.push(arr[i]);\n }\n }\...
[ "0.65166444", "0.64420676", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6344983", "0.6339456", "0.63175094", "0.63175094", "0.63043714", "0.6282536", "0.6265734", "0.6265516", "0.6261653"...
0.735709
0
Downloads any file with Chrome using the given async function `downloadFunc`. It then returns the name of the downloaded file, since it expects Chrome to place it in `downloadDir`. `isCancelledFunc` is an optional async function that returns true if this `waitForDownload` function should abort while waiting for the dow...
async function waitForDownload(downloadDir, name, downloadFunc, isCancelledFunc /* Optional async function, see explanation on the second line above */, page_ /* Optional. If provided, the `waitForDownload` function will abort/cancel if HTTP requests made by this `page_` refer to files that already exist in `downloadDi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function downloadURI(page, uri, name, downloadDir, skipIfDownloadedAlready /* Optional parameter; if true, it checks if a file named `name` + URI's file extension exists in `downloadDir` already, and returns without downloading anything if so. By default, it doesn't check for this or skip if downloaded alrea...
[ "0.57561284", "0.55576164", "0.5520349", "0.51228267", "0.50177515", "0.5013588", "0.48107255", "0.48086196", "0.4764646", "0.47375655", "0.47262737", "0.46261472", "0.45715848", "0.45279652", "0.45159417", "0.451092", "0.44520396", "0.43762943", "0.4359729", "0.43270206", "0...
0.58772343
0
Makes Chrome download to `downloadDir`
async function setDownloadPath(downloadDir, createBaseDirectory /* Optional parameter; if true, creates the last path component of `downloadDir` as a single folder. */, allowTempDownloadDir /* Optional parameter; if true, providing a `downloadDir` parameter that ends in "Temp" and is in the default `downloadPath` will ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static downlaodFile(url) {\n const file_name = url.split('/').pop();\n request(url)\n .pipe(fs.createWriteStream('./downloaded/' + file_name))\n .on('close', function () {\n return { path: '/downloaded/'+ file_name, downloaded: true }\n });\n }", "async function downloadURL_chromeWit...
[ "0.6554026", "0.63630164", "0.62624764", "0.6194638", "0.6156804", "0.61563736", "0.6123335", "0.60897374", "0.6084227", "0.60613316", "0.6060931", "0.6028787", "0.6017895", "0.60030997", "0.5963938", "0.59331536", "0.5881378", "0.58712745", "0.58586824", "0.58432263", "0.578...
0.6772041
0
Current state (i.e. stateIn) is now deemed good, even in case it wasn't considered good before. Make it the stateLastGood. If we were in a good situation, there is nothing to do.
function stateContinueFromHere() { stateLastGood.set(stateIn); tracingFailed = false; tracingStateReport(false); // Make numbers which are almost real totally real. This avoids // accumulating errors in the imaginary part. const n = stateLastGood.length; const abs = Math.abs; const epsI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setInsured() { this.currentState = goodState.INSURED; }", "prepareHumanState(validMoves) {\n this.gameOrchestrator.changeState(new ChoosingMoveState(this.gameOrchestrator, validMoves, this.previousPiece));\n }", "function reschedule_if_high_currents(state)\n{\n if ((state.name==\"Critical\" || sta...
[ "0.6218425", "0.57932913", "0.56066066", "0.5586066", "0.54794407", "0.54774505", "0.54720384", "0.5419331", "0.54062366", "0.5388077", "0.53569776", "0.5300031", "0.52976567", "0.52890515", "0.52882063", "0.5281022", "0.52733916", "0.5265887", "0.526249", "0.5252143", "0.524...
0.71348464
0