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
Navigate to Tutorial split
function onSplitTap() { const frame = getFrameById("topframe"); frame.navigate("views/intro-table-split/intro-table-split-page"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tutBack() {\n setMode('showtutorials');\n }", "function gotoTutorial(){\n\ttitleMusic.stop();\n\tgame.state.start('Tutorial');\t\n}", "function go() {\n\tinit();\n\twelcome_tutorial();\n\n}", "function GoMouseTutorial()\n{\n var bReturnValue = false;\n \n if (!StatusObj.get_...
[ "0.6306162", "0.5949851", "0.57887733", "0.56403583", "0.5615074", "0.5604488", "0.5552461", "0.55254066", "0.54911095", "0.5484491", "0.5482031", "0.54709584", "0.5449642", "0.54385906", "0.5438113", "0.54238015", "0.5414304", "0.53949684", "0.53891176", "0.5376213", "0.5369...
0.59521616
1
Activar geocoder de Google Maps
function initMap(){ var geocoder = new google.maps.Geocoder(); // Hago geocoding de la dirección buscada geocodeAddress(geocoder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: {lat: -34.397, lng: 150.644}\n });\n var geocoder = new google.maps.Geocoder();\n\n // Address to Codes\n geocodeAddress(geocoder, map);\n \n ...
[ "0.7419067", "0.7291398", "0.71971166", "0.71815825", "0.70897526", "0.70735204", "0.6973582", "0.69343925", "0.6917048", "0.6868721", "0.6851003", "0.6848925", "0.6830653", "0.6814942", "0.68006873", "0.6777607", "0.6752824", "0.6751834", "0.67433774", "0.67131495", "0.67129...
0.77814865
0
Dar funcionalidad a geocoder (buscar)
function geocodeAddress(geocoder) { var address = direccion; // Busco por address y filtro por región (país) Argentina geocoder.geocode({ 'address': address, 'region': 'AR' }, function(results, status) { // Si está todo ok guardo los resultados en una variable if (status === google.maps.Geocod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Geocoder() {\n}", "function codeAddress(tipo)\n{ \n var address = '';\n var addressSalida = document.getElementById(\"direccionsalida\").value + \", Bogot\\u00e1, Cundinamarca, Colombia\";\n var addressLlegada = document.getElementById(\"direccionllegada\").value + \", Bogot\\u00e1, Cundinamarca, Col...
[ "0.76703674", "0.75310045", "0.73266476", "0.73201567", "0.7291772", "0.7266418", "0.7110634", "0.70876557", "0.70544106", "0.7051542", "0.70405257", "0.7024166", "0.70149714", "0.69970644", "0.6995543", "0.6977532", "0.6928653", "0.6924327", "0.6922987", "0.6915432", "0.6894...
0.79106116
0
Test single RAML type from file.
function testType (filepath, ramlData, typeName) { dt2js.dt2js(ramlData, typeName, function (err, schema) { console.log('\nTesting', filepath, 'Type:', typeName) if (err) { console.log('FAIL (script):', '\n-', err.message) return } try { var valid = validate(schema) if (!valid)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testFile (filepath) {\n try {\n var ramlData = fs.readFileSync(filepath).toString()\n var ctx = getRAMLContext(ramlData)\n } catch (error) {\n console.log('\\nLoading', filepath)\n console.log('FAIL (RAML parsing):', '\\n-', error.message)\n return\n }\n for (var typeName in ctx) {\n ...
[ "0.7528906", "0.5487709", "0.5220457", "0.5128343", "0.5118387", "0.5065998", "0.5029193", "0.50237745", "0.49301723", "0.4914979", "0.48630267", "0.48531413", "0.48491237", "0.48359096", "0.48079345", "0.4803036", "0.47893628", "0.47842583", "0.4784214", "0.4780571", "0.4778...
0.6948343
1
Log JSON validation errors.
function logValidationError () { var sep = '||' var errorsText = ajv.errorsText(validate.errors, {'separator': sep}) var errors = errorsText.split(sep) console.log('FAIL (JSON validation):') errors.forEach(function (el) { console.log('-', el) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateJSON (object, schema) {\n let ajv = new Ajv({ allErrors: true });\n if (ajv.validate(schema, object)) {\n return;\n }\n let validationErrors = ajv.errors.map(function (error) {\n return { message: error.message, path: error.dataPath };\n });\n\n ...
[ "0.6887746", "0.65267", "0.6457994", "0.6128999", "0.60246754", "0.59851074", "0.5984832", "0.59778583", "0.5929498", "0.58977133", "0.5881771", "0.5868643", "0.5811552", "0.5801664", "0.5731166", "0.57088405", "0.56982625", "0.5651139", "0.56380814", "0.56282175", "0.5621711...
0.78459615
0
BarrettMu, a class for performing Barrett modular reduction computations in JavaScript. Requires BigInt.js. Copyright 20042005 David Shapiro. You may use, reuse, abuse, copy, and modify this code to your liking, but please keep this header. Thanks! Dave Shapiro
function BarrettMu(m) { this.modulus = biCopy(m); this.k = biHighIndex(this.modulus) + 1; var b2k = new BigInt(); b2k.digits[2 * this.k] = 1; // b2k = b^(2k) this.mu = biDivide(b2k, this.modulus); this.bkplus1 = new BigInt(); this.bkplus1.digits[this.k + 1] = 1; // bkplus1 = b^(k+1) this.modulo = Barret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BarrettMu(m)\r\r\n{\r\r\n\tthis.modulus = biCopy(m);\r\r\n\tthis.k = biHighIndex(this.modulus) + 1;\r\r\n\tvar b2k = new BigInt();\r\r\n\tb2k.digits[2 * this.k] = 1; // b2k = b^(2k)\r\r\n\tthis.mu = biDivide(b2k, this.modulus);\r\r\n\tthis.bkplus1 = new BigInt();\r\r\n\tthis.bkplus1.digits[this.k + 1] = 1...
[ "0.7635766", "0.68876284", "0.65993327", "0.6582029", "0.6563022", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.6469074", "0.64123875", "0.6274369", "0.6257936", "0.6106016", "0.6103989", "0.6080145", ...
0.7622224
1
vim:ts=8: / binary.js Tools for creating, modifying binary data including base64encoding, base64decoding , utf8encoding and utf8decoding See binary.readme.txt for further information. Copyright(c) 2009 Atsushi Oka [ ] This script file is distributed under the LGPL
function initBinary(packageRoot) { if (packageRoot.__PACKAGE_ENABLED) { __Crypto.__unit("binary.js"); } var i2a = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var v0 = [];\n var v4 = Duktape.dec(\"base64\",v0);\n var v5 = CBOR.encode(v4);\n}", "function Base64x(){}", "function base64() {\n\n // private property\n var _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n // public method for encoding...
[ "0.7025803", "0.6522793", "0.61757004", "0.61636305", "0.6111752", "0.6111752", "0.60772496", "0.60622317", "0.60401887", "0.6023582", "0.6017091", "0.59998196", "0.59967065", "0.5993111", "0.5983925", "0.594516", "0.594516", "0.594516", "0.594516", "0.594516", "0.594516", ...
0.6988655
1
Cipher.js A blockcipher algorithm implementation on JavaScript See Cipher.readme.txt for further information. Copyright(c) 2009 Atsushi Oka [ ] This script file is distributed under the LGPL ACKNOWLEDGMENT The main subroutines are written by Michiel van Everdingen. Michiel van Everdingen All rights for these routines a...
function initBlockCipher(packageRoot) { __Crypto.__unit("Cipher.js"); __Crypto.__uses("packages.js"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Math //////////////////////////////////////////////////////////////////////////////...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _updateBlock(w,input,output,decrypt){/*\n Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)])\n begin\n byte state[4,Nb]\n state = in\n AddRoundKey(state, w[0, Nb-1])\n for round = 1 step 1 to Nr–1\n SubBytes(state)\n ShiftRows(state)\n ...
[ "0.67321205", "0.6697649", "0.6685854", "0.6685854", "0.6685854", "0.6685854", "0.6685854", "0.6677217", "0.6677217", "0.6677217", "0.6677217", "0.6677217", "0.6525898", "0.65031534", "0.6393609", "0.6337476", "0.6307686", "0.62008995", "0.61291766", "0.61291766", "0.61291766...
0.7988521
0
Funcion que redirecciona a la pagina de inicio
function redireccionar() { window.location.replace("index.html"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reiniciar(){\r\n \tlocation.reload();\r\n }", "function redireccionar() {\n window.location.replace(\"protIndex.html\");\n}", "function redireccionRegistrar(){\r\n location.href= pagina + '/registro';\r\n}", "function redireccionar() {\n location.reload();\n}", ...
[ "0.6661067", "0.6539498", "0.65156657", "0.6493096", "0.6290877", "0.6280745", "0.6202635", "0.61810046", "0.6180154", "0.6088974", "0.60746837", "0.60672504", "0.6062753", "0.6060219", "0.60369015", "0.60351837", "0.6009948", "0.6003444", "0.59859335", "0.59849375", "0.59807...
0.6626015
1
Create Cards Elements in Container Body element
render() { for (const card of this.cards) { // Create card element - card const cardEl = document.createElement('div'); cardEl.className = 'card'; // Assing unique ID to card element cardEl.id = 'card-' + card.uuid; // Create card element - front side const cardFrontEl = document.createElement(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeCards(arr, container) {\n\t\tcontainer = document.getElementById(container);\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tlet card = makeCardElement(Object.assign({}, arr[i]), false);\n\n\t\t\tcontainer.appendChild(card);\n\t\t}\n\t}", "function runOnLoad(){ // Create a container for us ...
[ "0.70177877", "0.6940952", "0.68593466", "0.6783175", "0.6748239", "0.6742245", "0.6718069", "0.667528", "0.663067", "0.6626122", "0.6607127", "0.6561773", "0.6548168", "0.65207213", "0.6517768", "0.6504266", "0.64733875", "0.64715713", "0.645188", "0.6448559", "0.64464086", ...
0.7252072
0
Helper fn, that adds cardrevealed class to card matching element
revealCard(card) { const el = document.getElementById('card-' + card.uuid); if (!el) { return; } el.classList.add('card-revealed'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function revealCard(card){\n\tcard.classList.add(\"show\");\n}", "function match(card) {\n card.classList.add(\"match\");\n}", "function showCard(card) {\n $(card).addClass(\"open show\");\n}", "function displayCard(card) {\n $(card).addClass('show');\n $(card).addClass('open');\n}", "function ...
[ "0.7460379", "0.73775", "0.72756135", "0.7267755", "0.7012162", "0.69518274", "0.69246393", "0.6923093", "0.69205725", "0.689429", "0.68038803", "0.6802738", "0.6775546", "0.6727572", "0.6636253", "0.6632243", "0.66285527", "0.65543115", "0.6553157", "0.65135825", "0.65129936...
0.7414834
1
Helper fn, that adds cardmatched class to card matching element
matchCard(card) { const el = document.getElementById('card-' + card.uuid); if (!el) { return; } el.classList.add('card-matched'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function match(card) {\n card.classList.add(\"match\");\n}", "matchComplete() {\n\t\tthis.$card.classList.add('matched');\n\t}", "function markMatch(cardClass) {\n for (const card of open) {\n if (card.card == cardClass) {\n card.match = true;\n }\n }\n\n $('.' + cardClass....
[ "0.8601067", "0.8089155", "0.80352867", "0.7891885", "0.77688843", "0.77220994", "0.76562375", "0.7605392", "0.75329393", "0.7484292", "0.7465051", "0.74176747", "0.7385953", "0.729664", "0.7253717", "0.7224634", "0.7223187", "0.7188793", "0.71825975", "0.7180064", "0.7132219...
0.834481
1
Take all revealed cards and mark them as matched
markRevealedAsMatched() { // Mark cards as matched for (const card of this.revealedCards) { this.matchCard(card); } // Store cards as matched this.matchedCards.push(...this.revealedCards); // Reset revealed cards this.revealedCards = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchedCards() {\n matches = matches.concat(guessedCards);\n if (matches.length === cards.length) {\n stopTimer();\n clearguessedCards();\n showYouWonModal();\n }\n clearguessedCards();\n}", "function matched() {\n \n function setAttr(item) {\n item.clas...
[ "0.78410417", "0.75472236", "0.7279647", "0.7245912", "0.7189448", "0.7183812", "0.7162305", "0.7159969", "0.71290296", "0.7107505", "0.71033907", "0.7059111", "0.70080656", "0.6983524", "0.6974026", "0.69721067", "0.6970887", "0.69433945", "0.6941843", "0.69353974", "0.69091...
0.86641175
0
Mark Restaurant as Favourite Function
function markAsFavourite() { let restaurantId = parseInt(this.dataset.id); function putInStore(bool) { // Update local Database dbPromise .then(db => { let store = db.transaction('restaurants-store', 'readwrite').objectStore('restaurants-store'); return store.get(restaurantId).then(restaurant => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFavoriteRestaurant(restaurant, isFavorite) {\r\n DBHelper.setFavoriteRestaurant(restaurant.id, isFavorite);\r\n window.alert(`${restaurant.name} is now your new favorite restaurant`);\r\n}", "static isRestaurantFavorite(btn , restaurant) {\n if (restaurant.is_favorite == 'true') {\n btn...
[ "0.75335866", "0.72064555", "0.71681726", "0.70632875", "0.6962091", "0.6960002", "0.6951221", "0.69320273", "0.68938404", "0.6853793", "0.68004674", "0.67801136", "0.66780126", "0.6649641", "0.6638801", "0.66119415", "0.6605388", "0.6604086", "0.6597331", "0.6556132", "0.653...
0.7651104
0
AJAX rendering Activate All Accounts form:
function ajax_activateAllAccounts() { var arr = getAllElementsArr(); var json_string = JSON.stringify( arr ); // Changing ajax settings: var as = ajax_settings(); as.url = "/adm/users/ajax-activate-all-accounts"; as.data = { client_request : json_string, csrfmiddlewaretok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activateUser(event) {\n var data = event.data;\n var userObj = {\"AccountSummary\":{\"email\":data.account, \"action\":\"Activate\"}};\n $.PercMembershipService.activateUser(siteName,userObj, function(status, data){\n if(status == $.PercServi...
[ "0.59895825", "0.5955881", "0.59534025", "0.59338456", "0.59331954", "0.5926977", "0.5923007", "0.59033597", "0.5786474", "0.5751387", "0.56386656", "0.5619099", "0.561483", "0.56064004", "0.55669546", "0.5532056", "0.5481382", "0.5459125", "0.5454673", "0.54421765", "0.54201...
0.74542606
0
AJAX rendering Single Account forms:
function ajax_recognizeAccount() { var arr = getSelElementArr(); var json_string = JSON.stringify( arr ); // Changing ajax settings: var as = ajax_settings(); as.url = "/adm/users/ajax-recognize-account"; as.data = { client_request : json_string, csrfmiddlewaretoken: csrf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitHelper(event) {\n event.preventDefault()\n const firstName = $(\"#firstName\").val()\n const lastName = $(\"#lastName\").val()\n const firstDeposit = $(\"#firstDeposit\").val()\n\n myBankAccount = new BankAccount(firstName, lastName, firstDeposit)\n console.log(myBankAccount)\n // hide the re...
[ "0.6355605", "0.5946561", "0.58775204", "0.5863628", "0.5816723", "0.581238", "0.57991284", "0.57950157", "0.57862115", "0.5742728", "0.5738559", "0.5721585", "0.5709794", "0.570961", "0.56945693", "0.56733584", "0.5668021", "0.56490636", "0.5647135", "0.5637748", "0.56343436...
0.6036911
1
Draw the snake body and head
function drawSnake() { // Drawing the body of the snake for(var i = 0; i < tail.length; i++) { context.beginPath(); context.rect(tail[i].xCoord, tail[i].yCoord, pixelSize, pixelSize); context.fillStyle = "#FFF"; context.fill(); context.closePath(); } // Draw the head of the snake context.b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderSnake() {\n // var path = snake.head;\n var path = snake.bodyLocation[0]; // tail\n\n for (var i = 0; i < snake.anglePosition.length; i++) {\n _drawLine(path, snake.anglePosition[i]);\n path = snake.anglePosition[i];\n }\n\n _drawLine(path, snake.head);\n }", "function dr...
[ "0.8308309", "0.80361795", "0.7740611", "0.77291024", "0.7725783", "0.76744705", "0.75455904", "0.7434438", "0.7427651", "0.7425768", "0.74237347", "0.7409751", "0.73985183", "0.73783666", "0.73697263", "0.7335531", "0.7314119", "0.7287152", "0.72580785", "0.7251368", "0.7241...
0.82854337
1
Replaces navigate panel to different places depending on display width.
function navigatePanel() { if ($('#container-width').width() < SIZE_LINE) { $('#small-page-nav').css('display', 'block'); $('#page-nav-bar').css('display', 'none'); } else { $('#small-page-nav').css('display', 'none'); $('#page-nav-bar').css('display', 'block'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openNav() {\n document.getElementById(\"configurationPanel\").style.width = \"auto\";\n }", "function forceExpandPanel() {\n $(\"#ad-hoc-panel\").width(geometry.getPanelWidth());\n $(\"#ad-hoc-panel\").height(geometry.getPanelHeight());\n onPanelExpanded();\n }", "_positionFARPane...
[ "0.6223721", "0.61848086", "0.60056", "0.5999326", "0.59297633", "0.59231645", "0.5922987", "0.591366", "0.5904301", "0.59018296", "0.5897031", "0.58677036", "0.58668786", "0.5853168", "0.58242756", "0.58094174", "0.5792816", "0.5773752", "0.57527447", "0.5717489", "0.5714347...
0.73107874
0
Changes page to page in input of button on big screens.
function goToPageBig() { var pageNum = $('#big-page-num').val(); validateNumberAndChangePage(pageNum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToPageSmall() {\n var pageNum = $('#small-page-num').val();\n validateNumberAndChangePage(pageNum);\n}", "function gotoPage() {\n\t\t// Handle Edit buttons\n\t\t$('.bcchf-btn-edit').click(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar href = $(this).attr('href');\n\t\t\tvar href_pos = Math.r...
[ "0.6535992", "0.64338964", "0.629503", "0.62777066", "0.62591624", "0.6243213", "0.61494297", "0.60896605", "0.6070854", "0.6047707", "0.60351825", "0.60319656", "0.6031379", "0.5940409", "0.5939223", "0.5908655", "0.5902602", "0.58832365", "0.5864314", "0.58609813", "0.58370...
0.657044
0
Changes page to page in input of button on small screens.
function goToPageSmall() { var pageNum = $('#small-page-num').val(); validateNumberAndChangePage(pageNum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToPage(){\n\tlet selected = $('#nthpage').val();\n\n\t$(`.page${currentPage}`).toggleClass('hidden');\n\t$(`.page${selected}`).toggleClass('hidden');\n\tcurrentPage = selected;\n}", "function gotoPage() {\n\t\t// Handle Edit buttons\n\t\t$('.bcchf-btn-edit').click(function(e){\n\t\t\te.preventDefault(...
[ "0.6404397", "0.6395356", "0.6312879", "0.6268322", "0.62098265", "0.6203864", "0.6090126", "0.6086777", "0.6083337", "0.59981114", "0.5996993", "0.5990228", "0.59291565", "0.5927878", "0.59228235", "0.59120303", "0.5882669", "0.58768505", "0.58491886", "0.58394927", "0.58359...
0.67937726
0
Validates the page number and changes page offset and current page.
function validateNumberAndChangePage(pageNum) { if (pageNum > 0 && pageNum < PDF_DOCUMENT.numPages + 1) { setCurrentPage(pageNum); setOffset(pageNum); } else { alert('Нет такого номера страницы.\nВведите от 1 до ' + PDF_DOCUMENT.numPages); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforePageChange(currentPage, nextPage) {\n const errors = this.validatePage();\n if (Object.keys(errors).length <= 0 || nextPage >= 0 && nextPage < currentPage) {\n this.setIndex(nextPage);\n return true;\n }\n return false;\n }", "function updatePage() {\n ctrl.page = ctrl.pag...
[ "0.6792677", "0.6724314", "0.62863", "0.62789804", "0.6252561", "0.62362087", "0.6230751", "0.62304795", "0.6210628", "0.612768", "0.60950595", "0.6062829", "0.6058238", "0.60349447", "0.59675235", "0.59219086", "0.591713", "0.5910011", "0.5898484", "0.5898484", "0.5895019", ...
0.76827496
0
CREATE DOM ELEMENTS // create dom elements for advanced search based on noDouplicateArrays and search topic
function createAdvancedSearchOptions(array, topic) { // let domParent = topic; let domParent; if (topic === "ingredients") { domParent = ingredientsSearchOptions; } else if (topic === "appliance") { domParent = applianceSearchOptions; } else if (topic === "ustensils") { domParent = ustensilsSearch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToDOM(data){\n // results of search is response object\n var searchResults = data.response.results;\n // console.log(searchResults[0].webUrl);\n // var articleInfo = {\n // id: [],\n // url: [],\n // }\n\n var title = \"abc\";\n var sectionTitleName = \"abc\";\n // var template = `<articl...
[ "0.63481605", "0.6149621", "0.6040475", "0.603998", "0.60279155", "0.60096425", "0.60001415", "0.5990801", "0.5974935", "0.59669363", "0.596499", "0.59127015", "0.59088695", "0.58331186", "0.5810095", "0.5790263", "0.5788361", "0.57428765", "0.57409686", "0.5694746", "0.56566...
0.6744213
0
UPDATE ADVANCED SEARCH OPTIONS
function updateAdvancedSearchOptions(searchResults) { // remove duplicate ingredients, appliances and ustensils from search results removeDuplicateValues(Array.from(searchResults)); // fill advanced search fields with values matching the results of the search query createAdvancedSearchOptions(ingredientsArrayN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateAdanvceSearch(){\n if(typeof searchPnt != \"undefined\"){\n whereClause = searchFilters.buildWhereClause();\n findOptimalSearchRadius(providerFS,searchPnt,whereClause)\n }\n }", "function updateAdvancedSearch() {\n if (!advancedSearch...
[ "0.7158479", "0.66985303", "0.64426255", "0.6384572", "0.6348834", "0.6198962", "0.6075111", "0.5955823", "0.59144443", "0.58960474", "0.5881349", "0.5813813", "0.57769746", "0.57418704", "0.56895226", "0.5688223", "0.5665469", "0.56557137", "0.5650102", "0.5634967", "0.56105...
0.7517174
0
The following VCard parser is copied from MIT License Copyright (c) 2018 Aleksandr Kitov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights...
function parseVcard(string) { var PREFIX = 'BEGIN:VCARD', POSTFIX = 'END:VCARD'; /** * Return json representation of vCard * @param {string} string raw vCard * @returns {*} */ function parse(string) { var result = {}, lines = string.split(/\r\n|\r|\n/), count...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseCard(re) {\n //Remove for tag (only first instance)\n re = re.replace(\"\\n\", \"\");\n re = re.replace(\"BEGIN:VCARD\", \"\");\n re = re.replace(\"END:VCARD\", \"\");\n\n var next = re.indexOf(\"N\");\n var version = re.substring(0, next + 1);\n\n re = re.replace(version, \"\");\n\n var next...
[ "0.66491085", "0.66491085", "0.5792887", "0.5570373", "0.552", "0.5473605", "0.5459696", "0.5459696", "0.5459696", "0.5459696", "0.5459696", "0.5421756", "0.5419209", "0.54164684", "0.5414383", "0.54031754", "0.54031754", "0.54031754", "0.54031754", "0.54031754", "0.54031754"...
0.75137657
0
Check bust(playerSum greater than 21)
function checkBust(){ if(playerSum > 21){ outcome.innerHTML = "Bust! You Lose!"; resetGame(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForBust() {\n var playerPoints = calculatesPoints(playerHand);\n var dealerPoints = calculatesPoints(dealerHand);\n\n if(playerPoints > 21){\n $(\"#messages\").text('Player busted. Dealer Wins');\n return true;\n }\n\n if(dealerPoints > 21){\n $(\"#messages\").text('Dealer busted. Playe...
[ "0.75173855", "0.74959356", "0.7476516", "0.7448545", "0.7225637", "0.70483696", "0.7031081", "0.6813713", "0.6813698", "0.66636086", "0.66081", "0.64841807", "0.64075166", "0.64020145", "0.6390446", "0.636117", "0.6290371", "0.6272253", "0.62620735", "0.6254219", "0.6164405"...
0.7700686
0
Displays suggestions for the search
function displaySuggestions() { // Don't rerender if it's the same search term if (lastSearchTerm === searchBox.value) { return; } lastSearchTerm = searchBox.value; // Don#t display suggestions for empty search terms if (searchBox.value === '') { return removeSuggestions(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displaySuggestions(data) {\n if (data && data.status) {\n // if getting suggestions successfully\n // display suggested words\n var words = data.words;\n var len = words.length;\n var i = 0;\n var html = '';\n\n for(i = 0; i < len; i++) {\n html += getSuggestionItem(wor...
[ "0.72754776", "0.72265947", "0.70991176", "0.6999688", "0.6993632", "0.6993632", "0.6981328", "0.6945923", "0.69371045", "0.6908322", "0.68383527", "0.68283737", "0.6794072", "0.6777585", "0.6775179", "0.6706089", "0.66801363", "0.66536814", "0.65954274", "0.65908855", "0.658...
0.75518084
0
Search for wiki articles and return an array with html elements
function searchWikiArticles(search) { let searchResults = []; let counter = 0; for (let i = 0; i < wikiJson.length; i++) { const searchLowerCase = search.toLowerCase(); const keywords = wikiJson[0].keywords; let found = false; for (let j = 0; j < keywords.length; j++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArticles(searchTerm) {\n $.ajax({\n url: \"https://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=\" + searchTerm,\n // Notice that the dataType is jsonp\n dataType: \"jsonp\",\n method: 'get',\n success: function(r...
[ "0.7198167", "0.6897336", "0.6633815", "0.6515056", "0.6498128", "0.64761627", "0.64563024", "0.64219034", "0.6404085", "0.63887584", "0.6383225", "0.6316173", "0.6222694", "0.62009156", "0.6150623", "0.6100439", "0.6055711", "0.60516185", "0.6043309", "0.5984276", "0.5977042...
0.7232246
0
preloads images starting with the index provided
function runImagePreloading(index){ if(index < postData.length){ if(canPreload){ var newImage = document.createElement(postData[index].type); //load the next image after this one loads newImage.onload = function(){ runImagePreloading(index+1); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preloadImagesAroundIndex(index) {\n\t[(index - 1), index, (index + 1)].forEach(function(item, index) {\n\t\tlazyloadSelectedImageAtIndex(item, function() { });\n\t});\n}", "function preload(index){\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tshowImage(index);\n\t\t\t}, 1000);\n\t\t}", "function preloadIm...
[ "0.781135", "0.72282976", "0.6877594", "0.6854177", "0.68124104", "0.6742505", "0.6735859", "0.6710055", "0.66827655", "0.66318905", "0.6624965", "0.6613862", "0.654246", "0.65167904", "0.6470414", "0.6458881", "0.6445797", "0.64377314", "0.6429243", "0.64085495", "0.63660586...
0.766246
1
Fits image to screen height
function fitHeightToScreen(){ //sets the changeable properties to the image's real size var height = mainImg.naturalHeight; mainImg.style.maxHeight = height + 'px'; //actually tests if it is too high including padding var heightDiff = (mainImg.clientHeight > height)? mainImg.client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setImgHeightEvent(){\n\t\tvar widthImg = $(\".singleMovieBlock img\").width();\n\t\t$(\".singleMovieBlock .imgWrap\").height(widthImg*1.53);\n}", "fitToScreen() {\n const container = this.elementRef.nativeElement;\n const min = {\n width: container.offsetWidth,\n heig...
[ "0.63303334", "0.6053927", "0.593642", "0.59270364", "0.5874604", "0.5870167", "0.5868247", "0.5867547", "0.58409214", "0.5836658", "0.5833523", "0.58325714", "0.58143276", "0.5781754", "0.5779945", "0.57776994", "0.5755354", "0.5748235", "0.57285637", "0.5717008", "0.5702132...
0.71163046
0
We are setting the initial state of this.state.movie to ''.
constructor(props) { super(props); this.state = { movie: '', }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prepareMovieState() {\n this.gameOrchestrator.interface3D.setCurrentMenu(MENUS.InGameMenu);\n this.gameOrchestrator.changeState(new MovieState(this.gameOrchestrator));\n }", "constructor(props) {\n super(props);\n this.state = {\n movieQuery: \"\"\n }\n }", "...
[ "0.6738644", "0.66780084", "0.66528547", "0.66030574", "0.6448625", "0.64218545", "0.6311471", "0.63059616", "0.63028866", "0.6266014", "0.62559164", "0.6222414", "0.61353076", "0.6071087", "0.60703105", "0.6047392", "0.60327363", "0.5993965", "0.5981112", "0.59306806", "0.59...
0.74389935
0
finds all urls that match 'regex'
function find(regex) { // initialize matches var matches = {}; for (var i = 0; i < urls.length; i++) { // all urls var url = urls[i]; // try to match var parts = regex.exec(url); if (parts) { // there is a match // match is the 1st capturing ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchUrl(url) {\n\t\t\turl = expandUrl(url);\n\t\t\treturn (urlParser.exec(url) || []);\n\t\t}", "function pageMatch(regexArray) {\n var regex = null;\n for( regex of regexArray ) {\n if( location.href.match( regex ) ) {\n return true;\n }\n }\n return false;\n}", "function search(reg...
[ "0.69849294", "0.6580712", "0.60898614", "0.6085723", "0.6054361", "0.604458", "0.60286933", "0.59650975", "0.5943319", "0.59404397", "0.59089684", "0.5882415", "0.58776045", "0.58224005", "0.5794025", "0.57881284", "0.5727004", "0.56773496", "0.56612045", "0.5660728", "0.564...
0.7395798
0
set the duration back to original
function reset_duration_att () { power_duration = -1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set duration(value) {}", "set duration(newDuration) {\n if (newDuration === -1) {\n this._canExpire = false;\n }\n\n this._duration = newDuration;\n }", "set overridedDuration(duration) {\n this._durationOverrided = true;\n this._duration = duration;\n this._mediaInfo.durati...
[ "0.7452527", "0.7193749", "0.6869087", "0.6632094", "0.66014904", "0.648246", "0.6451221", "0.64214814", "0.64060354", "0.64060354", "0.6345147", "0.6260982", "0.624828", "0.624828", "0.62052137", "0.61496305", "0.61239135", "0.61239135", "0.6024614", "0.60141724", "0.601052"...
0.7395646
1
This functions adds the members to a the selector element
function addMembers(membersData, membersKey, selector){ // Required members data var requiredMembers = []; // Get required members for(i=0;i<membersData.length;i++){ if(membersData[i]["id"] === membersKey){ requiredMembers = membersData[i]; } } var elements = ""; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(selector, options){\n\tlet _nodes = document.querySelectorAll(selector);\n\t_nodes = Array.prototype.slice.call(_nodes)\n\tfor(i in _nodes) load(_nodes[i], options)\n\tnodes = nodes.concat(_nodes)\n}", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n co...
[ "0.6230063", "0.5962683", "0.5962683", "0.5891004", "0.58243775", "0.5812079", "0.5727773", "0.5649434", "0.5649434", "0.5649434", "0.5510983", "0.5510983", "0.54849946", "0.54710734", "0.54710734", "0.5462158", "0.545284", "0.54399425", "0.5407027", "0.5364097", "0.5357763",...
0.6448311
0
This function makes AND statement Check that element contains all classes it need to show. return true or false.
function containsAllClasses (classesToShow, allElementClasses){ return classesToShow.every(function(val) { return allElementClasses.indexOf(val) !== -1; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_show() {\n if (!$(\"#Female\").hasClass(\"no_appear\") || !$(\"#Male\").hasClass(\"no_appear\") || !$(\"#Other\").hasClass(\"no_appear\"))\n return true;\n return false;\n}", "function condition(clicked) {\n var memberOf = clicked.className.split(/\\s+/);\n for (var i = 0; i < m...
[ "0.6587759", "0.6373056", "0.63563484", "0.6326106", "0.6312557", "0.6301331", "0.6265543", "0.62534815", "0.6201902", "0.61874205", "0.61850005", "0.6171861", "0.6155335", "0.61066115", "0.60626984", "0.6051747", "0.6044532", "0.60424405", "0.60188955", "0.59938824", "0.5976...
0.75311035
0
Toggle confirm changes button disable/enable depending on the changed settings.
toggleConfirmChangesButton() { if ( ! this.props.isEditing ) { return; } let settingsMapping = { selectedContainer: 'containerID', selectedContainerAMP: 'ampContainerID', selectedAccount: 'accountID', useSnippet: 'useSnippet', }; // Disable the confirmation button if necessary conditions are ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "confirmToggle() {\n const prevState = this.state.checked;\n const newState = !prevState;\n\n this.setState({ checked: newState }, () => {\n this._emitCheckedChange(newState);\n });\n\n // update state of the other buttons in the group\n if (this.group) {\n this.group.onChecked(this, new...
[ "0.6616863", "0.65593046", "0.646582", "0.6463532", "0.6422324", "0.6343838", "0.63032013", "0.6299828", "0.6219839", "0.61910886", "0.61821127", "0.6163229", "0.613828", "0.6059473", "0.6046926", "0.60156757", "0.6011528", "0.5985426", "0.59727794", "0.59616554", "0.5958478"...
0.7696049
0
Request Tag Manager accounts.
async requestTagManagerAccounts() { try { const { selectedAccount, } = this.state; const accounts = await data.get( TYPE_MODULES, 'tagmanager', 'accounts' ); this.validateAccounts( accounts, selectedAccount ); this.setState( { isLoading: false, accounts, } ); } catch ( err ) { th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function requestAccount() {\n await window.ethereum.request({ method: 'eth_requestAccounts' });\n }", "async function requestAccount() {\n await window.ethereum.request({ method: \"eth_requestAccounts\" });\n }", "async function requestAccount() {\r\n await window.ethereum.request({ method: 'e...
[ "0.67150784", "0.67144716", "0.6683533", "0.6535257", "0.648496", "0.6302522", "0.6268516", "0.62604004", "0.61052626", "0.580448", "0.54321957", "0.53842497", "0.5376515", "0.53573394", "0.5345175", "0.5260376", "0.52403456", "0.52403456", "0.51876605", "0.516099", "0.513635...
0.80256397
0
Request Tag Manager accounts and containers.
async requestTagManagerAccountsContainers() { try { const { selectedAccount, usageContext, } = this.state; let { selectedContainer, selectedContainerAMP, } = this.state; const queryArgs = { accountID: selectedAccount, usageContext, }; const { accounts, containers } = awa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async requestTagManagerAccounts() {\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tselectedAccount,\n\t\t\t} = this.state;\n\n\t\t\tconst accounts = await data.get( TYPE_MODULES, 'tagmanager', 'accounts' );\n\n\t\t\tthis.validateAccounts( accounts, selectedAccount );\n\n\t\t\tthis.setState( {\n\t\t\t\tisLoading: false,\n\t\t\...
[ "0.72780323", "0.5385464", "0.5317874", "0.5314508", "0.52921087", "0.5268416", "0.5259613", "0.5221079", "0.5188199", "0.50269157", "0.50269157", "0.49469927", "0.49365863", "0.49162906", "0.49082893", "0.4885997", "0.48119962", "0.48119962", "0.4784863", "0.4770653", "0.476...
0.7648412
0
CLASSROOMS to update the classroom table from another javascript class (component)
updateClassroomsTable() { this.connectedCallbackC(); refreshApex(this.classroom); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updated(changedProperties) {\n $(\"#txtTableSearch\").val(\"\");\n const adminUser = $(\"#hdnViewerAttId\").val();\n if (this.table) {\n this.table = null;\n }\n if (this.derivation) {\n const DerivedClass = (await import(`./derivations/${$('#hdnAppNam...
[ "0.6075766", "0.59379476", "0.58878165", "0.58420116", "0.5833856", "0.58222264", "0.5700928", "0.5608537", "0.55394334", "0.55282557", "0.55145943", "0.5507495", "0.5500657", "0.5409368", "0.54084426", "0.5405166", "0.53917885", "0.5369254", "0.5355339", "0.53289574", "0.532...
0.80191237
0
Calls the Bart API and returns all of the eta's and whatnot based on the destination entered by the user
function getBartTimes(bart_station = "POWL") { const bart_url = `https://api.bart.gov/api/etd.aspx?cmd=etd&orig=${bart_station}&key=${bart_api_key}&json=y`; $.get(bart_url, function(data) { destinations = data.root.station["0"].etd; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getBusLocations(){\r\n\tconst url = 'https://api-v3.mbta.com/vehicles?filter[route]=1&include=trip';\r\n\tconst response = await fetch(url);\r\n\tconst json = await response.json();\r\n\treturn json.data;\r\n}", "async function getBusLocations(){\n\tconst url = 'https://api-v3.mbta.com/vehicle...
[ "0.6083544", "0.6034662", "0.5863971", "0.58088213", "0.5685233", "0.5650379", "0.56479555", "0.56299055", "0.55699736", "0.5568652", "0.5568599", "0.55413836", "0.5531895", "0.5530699", "0.55289876", "0.552081", "0.55165905", "0.5480892", "0.54777926", "0.54746544", "0.54663...
0.6210312
0
takes in the stats object from a successful compilation and returns a manifest object that characterizes the results of the compilation for CSS/JS loading and integrity checking. the manifest has the following entries: jsChunksByName: an object that maps chunk names to their JS entrypoint file. cssChunksByName: an obje...
function statsToManifest(stats) { const jsChunksByName = {}; const cssChunksByName = {}; const jsChunksById = {}; for (const chunk of stats.compilation.chunks) { if (chunk.name) { jsChunksByName[chunk.name] = chunk.files[0]; for (let i = 1; i < chunk.files.length; i++) { if (/\.css$/.test(chunk.files[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createManifest(props){var color,hero,manifest={},hl=props.heroes.length,cl=props.colors.length;for(hero=0;hero<hl;hero++)for(color=0;color<cl;color++){var id=heroes[hero]+colors[color],src=props.transformMethod(\"/Content/gfx/LNK_AvatarShield_\"+heroes[hero]+\"_\"+colors[color]+\".png\");manifest[id]=src}...
[ "0.564037", "0.56020546", "0.55980814", "0.55927265", "0.54402715", "0.53820497", "0.5337199", "0.5330459", "0.5311181", "0.5285295", "0.5218401", "0.5166917", "0.5152368", "0.5147003", "0.5040172", "0.5031224", "0.5012209", "0.4985432", "0.49823186", "0.49804", "0.49542648",...
0.8134778
0
the page value for routes.routes["SomeRoute"] can either be a string for the default module name or an object mapping format names to module names. This method normalizes the value to an object.
function normalizeRoutesPage(page) { if (typeof page === "string") { return {default: page}; } return page; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stringifyRoute(route) {\r\n return Router.objectToRouteString(route)\r\n }", "parseRoute(routeString) {\r\n return Router.routeStringToObject(routeString)\r\n }", "_normalizeRoutes(value, key){\n\t\t//let route, name, callback;\n\t\tlet context;\n\t\tif (_.isString(value)) {\n\t\t\tcontext = { \n\t\t\t...
[ "0.5368762", "0.528503", "0.5216547", "0.4915199", "0.48997194", "0.4691593", "0.46159494", "0.45363304", "0.44759214", "0.4470934", "0.44689032", "0.44583446", "0.44438148", "0.4440949", "0.44322518", "0.4414796", "0.44030154", "0.43920267", "0.43820763", "0.438008", "0.4345...
0.71618944
0
writes out a bootstrap file for the client which in turn includes the client routes file. note that outputDir must be the same directory as the client routes file, which must be named "routes_client".
function writeClientBootstrapFile(outputDir, opts) { var outputFile = outputDir + "/entry.js"; fs.writeFileSync(outputFile, ` if (typeof window !== "undefined") { window.__setReactServerBase = function(path) { // according to http://webpack.github.io/docs/configuration.html#output-publicpath // we should...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFileRoute (fileRoute, express) {\r\n var path = './client';\r\n path += (fileRoute.path) ? fileRoute.path : fileRoute.route + '.html';\r\n express.get(fileRoute.route, function (req, res) { \r\n res.sendfile(path);\r\n });\r\n}", "postProcess (renderedRoute) {\n c...
[ "0.55728716", "0.5438632", "0.52320415", "0.52150285", "0.5135999", "0.5046718", "0.5010603", "0.4988649", "0.49591288", "0.49026754", "0.48974457", "0.48904222", "0.4889831", "0.48550695", "0.48433852", "0.48424006", "0.48218316", "0.4807829", "0.48008466", "0.47943243", "0....
0.719821
0
Return the number of slots needed for a single appointment
function getNumberOfAdjacentSlots() { return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countSpots (dayObj, appointments) {\n let spotsCounter = 0;\n\n for (const id of dayObj.appointments) {\n const appointment = appointments[id];\n if (!appointment.interview) {\n spotsCounter++;\n };\n };\n return spotsCounter;\n}", "function _haveFreeSlot() {\n var res = $ro...
[ "0.6068148", "0.5568037", "0.5509302", "0.54744107", "0.5459821", "0.5455786", "0.5432203", "0.5415382", "0.53869104", "0.5377591", "0.53765726", "0.5336891", "0.53359646", "0.5323226", "0.5256267", "0.51788306", "0.51671654", "0.5164576", "0.51578915", "0.51444227", "0.51188...
0.64590865
0
Helper functions follow: hilite changes the highlighting of elements corresponding to specified src.
function hilite(src, on) { if (on) { matches.add(src); } else { matches.delete(src); } toggleClass(src, 'hilite', on); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addElem(src, elem) {\n let list = elems.get(src);\n if (!list) {\n list = [];\n elems.set(src, list);\n }\n list.push(elem);\n elem.classList.toggle('hilite', matches.has(src));\n }", "function _highlightSource() {\n const srcLanguage = (selected.id === 'css') ? 'css' : 'jav...
[ "0.64088583", "0.59243745", "0.54158807", "0.5368707", "0.5304281", "0.52705693", "0.5267541", "0.52641153", "0.5260741", "0.52198964", "0.5207588", "0.52028435", "0.51462966", "0.5131468", "0.5105596", "0.5095516", "0.5065506", "0.5062503", "0.50483924", "0.50256515", "0.501...
0.726204
0
Display action menu (triggered by rightclick on a frame)
function showActionMenu(e, box) { if (box.src == 0) return; // No action menu for root e.preventDefault(); // Disable browser context menu const src = stacks.Sources[box.src]; actionTitle.innerText = src.Display[src.Display.length-1]; const menu = actions; menu.style.display = 'block'; // Co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuRightClick(){\r\n\r\n\tvar menu = new gui.Menu();\r\n\t\r\n\tmenu.append(new gui.MenuItem({ label: 'Item A' }));\r\n\tmenu.append(new gui.MenuItem({ label: 'Item B' }));\r\n\tmenu.append(new gui.MenuItem({ type: 'separator' }));\r\n\tmenu.append(new gui.MenuItem({ label: 'Item C' }));\r\n\t\r\n\t// Po...
[ "0.7487", "0.69040835", "0.69028795", "0.67762583", "0.67526466", "0.6713261", "0.66482085", "0.6459881", "0.64526796", "0.6426501", "0.6394609", "0.6350713", "0.630373", "0.62919986", "0.6280651", "0.6280651", "0.6263818", "0.6198213", "0.6154095", "0.61164856", "0.61086535"...
0.7189364
1
setHrefParam updates the specified parameter in the href of an element to make it operate on the specified src.
function setHrefParam(id, param, src) { const elem = document.getElementById(id); if (!elem) return; let url = new URL(elem.href); url.hash = ''; // Copy params from this page's URL. const params = url.searchParams; for (const p of new URLSearchParams(window.location.search)) { param...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addURLParam(element, newParam) {\n var originalSrc = getAttr(element, 'src');\n element.setAttribute('src', originalSrc + getUrlParamSign(originalSrc) + newParam);\n }", "function addURLParam(element, newParam){\n var originalSrc = element.getAttribute('src');\n elemen...
[ "0.70622337", "0.70510745", "0.70510745", "0.70258707", "0.698428", "0.698428", "0.698428", "0.6964859", "0.6964859", "0.69527435", "0.63815683", "0.5701208", "0.5469509", "0.5458197", "0.54420894", "0.5410838", "0.53317076", "0.5311982", "0.5311982", "0.53036803", "0.5293529...
0.76142126
0
Return list of sources that match the regexp given by the 'p' URL parameter.
function urlPivots() { const pivots = []; const params = (new URL(document.URL)).searchParams; const val = params.get('p'); if (val !== null && val != '') { try { const re = new RegExp(val); for (let i = 0; i < stacks.Sources.length; i++) { const src = stacks.Sources[i]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchUrl(url) {\n\t\t\turl = expandUrl(url);\n\t\t\treturn (urlParser.exec(url) || []);\n\t\t}", "function checkPT() {\n var ptc = document.getElementById(\"pt_copy\").value, u, pturls, pttext;\n pturls = ptc.match(/http.*$/gmi);\n pttext = ptc.match(/(^.*\\s)http/gmi);\n filtLinks = [];\n for (u =...
[ "0.57434326", "0.5447503", "0.5373338", "0.52165174", "0.5091123", "0.50519955", "0.50426555", "0.5026474", "0.5000301", "0.49791667", "0.49786425", "0.4957991", "0.49555364", "0.493796", "0.49284926", "0.49169233", "0.49060273", "0.49060273", "0.49060273", "0.48886448", "0.4...
0.61748594
0
render regenerates the stack display.
function render() { pivots = urlPivots(); // Get places where pivots occur. let places = []; for (let pivot of pivots) { const src = stacks.Sources[pivot]; for (let p of src.Places) { places.push(p); } } const width = chart.clientWidth; elems.clear(); actionTa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n render(interpreter[0], $(\"#stack_display\"));\n }", "render() {\n\t\treturn (<Root><RootStack /></Root>);\n\t}", "function render() {}", "function render() {}", "render() {\n }", "render() {\n this.renderLevel();\n this.renderEntities();\n this.renderM...
[ "0.7740668", "0.7050245", "0.7016463", "0.7016463", "0.7010273", "0.6947645", "0.6934484", "0.6925223", "0.69207406", "0.68652344", "0.6820097", "0.68000805", "0.67972803", "0.67972803", "0.67972803", "0.67972803", "0.67972803", "0.67972803", "0.67972803", "0.67972803", "0.67...
0.7562614
1
renderStacks creates boxes with topleft at x,y with children drawn as nested stacks (below or above based on the sign of direction). Returns the largest y coordinate filled.
function renderStacks(depth, xscale, x, y, places, direction) { // Example: suppose we are drawing the following stacks: // a->b->c // a->b->d // a->e->f // After rendering a, we will call renderStacks, with places pointing to // the preceding stacks. // // We first group all place...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stackViewer(stacks, nodes) {\n 'use strict';\n\n // Constants used in rendering.\n const ROW = 20;\n const PADDING = 2;\n const MIN_WIDTH = 4;\n const MIN_TEXT_WIDTH = 16;\n const TEXT_MARGIN = 2;\n const FONT_SIZE = 12;\n const MIN_FONT_SIZE = 8;\n\n // Mapping from unit to a list of display sc...
[ "0.60597706", "0.5765671", "0.56855625", "0.5636613", "0.5596649", "0.55042297", "0.54082435", "0.53946006", "0.5364244", "0.5351621", "0.52052915", "0.51501864", "0.514623", "0.51240957", "0.51157737", "0.50359434", "0.49976552", "0.49723747", "0.4962452", "0.49553943", "0.4...
0.694708
0
partitionPlaces partitions a set of places into groups where each group contains places with the same source. If a stack occurs multiple times in places, only the outermost occurrence is kept.
function partitionPlaces(places) { // Find outer-most slot per stack (used later to elide duplicate stacks). const stackMap = new Map(); // Map from stack index to outer-most slot# for (const place of places) { const prevSlot = stackMap.get(place.Stack); if (prevSlot && prevSlot <= place.Pos) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderStacks(depth, xscale, x, y, places, direction) {\n // Example: suppose we are drawing the following stacks:\n // a->b->c\n // a->b->d\n // a->e->f\n // After rendering a, we will call renderStacks, with places pointing to\n // the preceding stacks.\n //\n // We first gr...
[ "0.53646314", "0.52706707", "0.5262801", "0.5150215", "0.5024382", "0.496426", "0.48951334", "0.48789045", "0.47883382", "0.4779956", "0.4769669", "0.47600305", "0.46828485", "0.4672646", "0.45973703", "0.458991", "0.45465598", "0.4535777", "0.44805455", "0.44532415", "0.4441...
0.8395168
0
addElem registers an element that belongs to the specified src.
function addElem(src, elem) { let list = elems.get(src); if (!list) { list = []; elems.set(src, list); } list.push(elem); elem.classList.toggle('hilite', matches.has(src)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSource(elem, path) {\n $('<source />').attr('src', path).appendTo(elem);\n }", "addImage(src) {\n try {\n let myImage = new Element(IMAGE, src, this.idGenerator);\n let imageHTML = myImage.getHTMLElement();\n this.elements.push(imageHTML);\n this.div.appendChild(image...
[ "0.6579473", "0.63944656", "0.62074935", "0.61462104", "0.5994047", "0.59023225", "0.5728602", "0.5674231", "0.5587602", "0.5423873", "0.5423873", "0.54233056", "0.53580755", "0.53434557", "0.5302933", "0.528878", "0.528878", "0.528878", "0.52537876", "0.52324396", "0.5226381...
0.7532827
0
Adds or removes cl from classList of all elements for the specified source.
function toggleClass(src, cl, value) { const list = elems.get(src); if (list) { for (const elem of list) { elem.classList.toggle(cl, value); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_add_classlist(obj, rm_c, add_c){\n // console.log(obj);\n // console.log(rm_c);\n // console.log(add_c);\n rm_c.map(e => obj.classList.remove(e));\n obj.classList.add(add_c);\n}", "function handleNewSource(classList){\n var editor = document.getElementById(\"editorText\");\n ...
[ "0.5537005", "0.53784204", "0.52912974", "0.51776326", "0.5136234", "0.5063565", "0.5053864", "0.50360304", "0.50360304", "0.50360304", "0.5029576", "0.5029576", "0.50007564", "0.49886298", "0.49765584", "0.49654442", "0.4907667", "0.49042255", "0.48730472", "0.48518953", "0....
0.5760687
0
fitText sets text and fontsize clipped to the specified width w.
function fitText(t, avail, textList) { // Find first entry in textList that fits. let width = avail; textContext.font = FONT_SIZE + 'pt Arial'; for (let i = 0; i < textList.length; i++) { let text = textList[i]; width = textContext.measureText(text).width; if (width <= avail) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "textQ34(text, w, h) {\n text.setWidthAndHeight(\"100%\", \"40%\");\n text.move(0, \"60%\");\n }", "function truncate(text, width) {\n\ttext.each(function () {\n\t\tvar parent = this.parentNode, $d3parent = d3.select(parent);\n\t\tvar gw = $d3parent.node().getBBox();\n\t\tvar x = (Math.min(gw.wid...
[ "0.66199785", "0.6474795", "0.6462963", "0.6456586", "0.6427346", "0.6277312", "0.6272592", "0.61974376", "0.6186979", "0.6096945", "0.60893047", "0.60834306", "0.6052713", "0.6028611", "0.6012586", "0.6001664", "0.5999153", "0.59935606", "0.598692", "0.59823745", "0.5975191"...
0.7097942
0
totalValue returns the positive and negative sums of the Values of stacks listed in places.
function totalValue(places) { const seen = new Set(); let pos = 0; let neg = 0; for (const place of places) { if (seen.has(place.Stack)) continue; // Do not double-count stacks seen.add(place.Stack); const stack = stacks.Stacks[place.Stack]; if (stack.Value < 0) { neg += -stack....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sumValues() {\n if (!this.root) return 0;\n const nodeStack = [this.root];\n let total = 0;\n while (nodeStack.length) {\n const currVal = nodeStack.pop();\n total += currVal.val;\n for (let child of currVal.children) {\n nodeStack.push(child);\n }\n }\n return total;\n...
[ "0.69046175", "0.67344856", "0.65125644", "0.6234182", "0.6215761", "0.6201214", "0.6113534", "0.6073716", "0.6066279", "0.60371387", "0.6008469", "0.60071373", "0.5848608", "0.5845657", "0.5843115", "0.5837113", "0.5823223", "0.5813521", "0.57883716", "0.5784327", "0.5771698...
0.77313656
0
percentText returns text that displays v in appropriate units alongside its percentange.
function percentText(v) { function percent(v, total) { return Number(((100.0 * v) / total).toFixed(1)) + '%'; } return unitText(v) + " (" + percent(v, stacks.Total) + ")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function text_percent(x) {\n\n return \"\" + (x*100).toFixed(0);\n\n}", "function pt(t){return t+\"%\"}", "function pt(t){return t+\"%\"}", "probStr(v) {\n return v.toString() + \"%\";\n }", "probStr(v) {\n return v.toString() + \"%\";\n }", "function V(e){return e+\"%\"}", "function p...
[ "0.78335464", "0.7098532", "0.7098532", "0.70137763", "0.70137763", "0.69219995", "0.67572904", "0.6756669", "0.65903676", "0.65585047", "0.6490847", "0.63895136", "0.6378093", "0.63563395", "0.62764215", "0.6263298", "0.62416965", "0.6235792", "0.6235792", "0.62142146", "0.6...
0.8859996
0
unitText returns a formatted string to display for value.
function unitText(value) { const sign = (value < 0) ? "-" : ""; let v = Math.abs(value) * stacks.Scale; // Rescale to appropriate display unit. let unit = stacks.Unit; const list = UNITS.get(unit); if (list) { // Find first entry in list that is not too small. for (const [name, scale...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unitToText(unit) {\n\tif (unit instanceof Atom) {\n\t\treturn unit.text;\n\t}\n\telse {\n\t\tvar t=\"\";\n\t\tfor (var i=0; i<unit.units.length; i++) {\n\t\t\tt+=unitToText(unit.units[i]);\n\t\t}\n\t\treturn t;\n\t}\n}", "function getMoneyUnitsText(amount)\n{\n return MONEY_UNIT + amount;\n}", "fun...
[ "0.6593703", "0.65133053", "0.62818116", "0.5892283", "0.58549124", "0.5851011", "0.58480346", "0.5824013", "0.57770026", "0.5762633", "0.57131475", "0.5650724", "0.5648776", "0.562807", "0.56166863", "0.5603012", "0.5573933", "0.5570125", "0.5550903", "0.54939574", "0.547808...
0.7060545
0
Draw a rectangle with a color based on its state
function rect(x, y, w, h, state) { if (state == 's') { ctx.fillStyle = '#00FF00'; // Green = Start } else if (state == 'f') { ctx.fillStyle = '#FF0000'; // Red = Finish } else if (state == 'e') { ctx.fillStyle = '#AAAAAA'; // Gray = Empty } else if (state == 'w') { ctx.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rect(x,y,w,h,state) {\n if (state == 's') {\n ctx.fillStyle = '#00FF00'; // RGB \n } else if (state == 'f') {\n ctx.fillStyle = '#FF0000'; // RGB \n } else if (state == 'e') {\n ctx.fillStyle = '#808080'; // RGB \n } else if (state == 'w') {\n ctx.fillStyle = '#0000...
[ "0.79406506", "0.730682", "0.719641", "0.7187991", "0.7153854", "0.7112154", "0.70559007", "0.7012891", "0.700095", "0.6981709", "0.69389075", "0.6926957", "0.6909673", "0.6886418", "0.6879469", "0.68720627", "0.6866381", "0.68551373", "0.68505883", "0.68276143", "0.68237156"...
0.7660578
1
Solve the maze. This is accomplished by exploring neighboring tiles and marking them with a direction. Tiles explored are stored in a queue. If a neighboring tile is marked with f a path has been found. If a path is found or the tile queue becomes empty with no path found, the final output is shown.
function solve() { xLoc = xQueue.shift(); yLoc = yQueue.shift(); // Check if finished if (xLoc > 0) { if (tiles[xLoc - 1][yLoc].state == 'f') { pathFound = true; } } if (xLoc < tileColumnCount - 1) { if (tiles[xLoc + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "solveMaze(options) {\r\n let mapping = { \"L\": 0, \"R\": 1, \"B\": 2, \"T\": 3 };\r\n var path = [this.startNode];\r\n while (path.length > 0) {\r\n var node = path[path.length - 1];\r\n node.visit();\r\n if (path.includes(node)) {\r\n path.spli...
[ "0.6961618", "0.68660396", "0.684585", "0.6764617", "0.66667485", "0.64936614", "0.64142203", "0.64056563", "0.6371273", "0.62633675", "0.62171304", "0.61976284", "0.6195337", "0.6162678", "0.6158096", "0.61579037", "0.6120286", "0.6114321", "0.60629505", "0.6042105", "0.5978...
0.79736364
0
loadPlugin first, then loadConfig
loadConfig() { this.loadPlugin(); super.loadConfig(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadPlugins() {\n\t\tEvent.plugins();\n }", "load() {\n const logger = this.application.logger;\n const plugins = this.plugins.length\n ? this.resolvePluginPaths(this.plugins)\n : this.discoverNpmPlugins();\n if (plugins.some((plugin) => plugin.toLowerCase()...
[ "0.64541936", "0.6375312", "0.6338907", "0.633451", "0.63261795", "0.6325642", "0.619334", "0.61744934", "0.6154974", "0.61542505", "0.61324656", "0.60565853", "0.6046929", "0.60143477", "0.6009018", "0.59841835", "0.59829944", "0.59806794", "0.59767413", "0.59376115", "0.591...
0.8536314
0
function genderChart displays the gender comparisson graph param legislature String indicating the current legislature of the data that will be displayed
function genderChart(legislature) { let genderChartResponse = JSON.parse(localStorage.getItem('genderResponse')); Highcharts.chart('genderChart', { plotOptions: { column: { events: { legendItemClick: function () { return false; // <== ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGenderBarGraph(data) {\n const fields = data.map(passenger => passenger.fields);\n let numMales = 0;\n let numFems = 0;\n let numOther = 0;\n\n fields.forEach(({ sex }) => {\n if (sex === \"male\") {\n numMales += 1;\n } else if (sex === \"female\") {\n numFems += 1;\n } else...
[ "0.68997383", "0.6428348", "0.63799906", "0.6283569", "0.627468", "0.6268805", "0.6251442", "0.62131417", "0.608128", "0.59635025", "0.5911734", "0.5875596", "0.582591", "0.5758107", "0.5747105", "0.57356375", "0.57319456", "0.5682509", "0.568245", "0.566047", "0.56537944", ...
0.651194
1
Set the values for ICE contacts, both in local and in the datastore
function setICEContact(id, pos, active, cb) { active = active || false; // Save locally localIceContacts[pos] = { id: id, active: active }; window.asyncStorage.setItem(ICE_CONTACTS_KEY, localIceContacts); // Save in the datastore modifyICEInDS(); setButtonsState(localIceCont...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifyICEInDS() {\n var contacts = [];\n localIceContacts.forEach(function(iceContact) {\n if (iceContact.id && iceContact.active) {\n contacts.push(iceContact.id);\n }\n });\n\n return ICEStore.setContacts(contacts);\n }", "function setNewContacts(new_contact){ \n s...
[ "0.66294783", "0.639847", "0.63975674", "0.6304003", "0.6276277", "0.6011023", "0.5961602", "0.58474404", "0.5830236", "0.581874", "0.57520366", "0.57243085", "0.5666279", "0.5663693", "0.56135786", "0.5555019", "0.5532316", "0.55114603", "0.5477919", "0.54719245", "0.5464372...
0.6672368
0
Clone the current local ice contacts into the datastore, considering the active flag.
function modifyICEInDS() { var contacts = []; localIceContacts.forEach(function(iceContact) { if (iceContact.id && iceContact.active) { contacts.push(iceContact.id); } }); return ICEStore.setContacts(contacts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getContactsFromLocal() {\n var restoredContacts = JSON.parse(localStorage.getItem('contacts'));\n //restoredContacts.push(contact);\n return restoredContacts;\n}", "function saveContacts() {\n\n // `angular.copy()` gets rid of all of Angular's internal hashes and keys.\n storage.set('...
[ "0.6114272", "0.5999208", "0.5961323", "0.5914147", "0.5491139", "0.54652774", "0.5402436", "0.53857136", "0.5364933", "0.53150123", "0.52939475", "0.5219819", "0.518899", "0.5182459", "0.5134704", "0.5125181", "0.5091814", "0.5079225", "0.5066682", "0.50663817", "0.5049925",...
0.72626245
0
abstract classes may define an interface and implement it only partially sub classes must implement the missing methods
testAbstractClass() { qx.Interface.define("qx.test.i.IJuhu", { members: { sayJuhu() {}, sayKinners() {} } }); // should not raise an exception qx.Class.define("qx.test.i.AbstractJuhu1", { extend: qx.core.Object, implement: qx.test.i.IJuhu, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Interface(){}", "function Interface () {}", "function _implement(that, $$interface, caller)\n {\n if (!that._interfaces) {\n Object.defineProperty(that, \"_interfaces\", {\n value: [],\n writable: false,\n configurable: false,\n ...
[ "0.6602668", "0.6524322", "0.62953997", "0.6248546", "0.60836595", "0.60817146", "0.6061397", "0.5949382", "0.5949382", "0.59264386", "0.5904478", "0.58343655", "0.5759985", "0.56719166", "0.56416553", "0.5506659", "0.54888564", "0.54757", "0.5444219", "0.5405696", "0.5401183...
0.6865606
0
The PluginWrapper wraps a set of nsIPluginTags to provide the data visible to public callers through the API.
function PluginWrapper(aId, aName, aDescription, aTags) { let safedesc = aDescription.replace(/<\/?[a-z][^>]*>/gi, " "); let homepageURL = null; if (/<A\s+HREF=[^>]*>/i.test(aDescription)) homepageURL = /<A\s+HREF=["']?([^>"'\s]*)/i.exec(aDescription)[1]; this.__defineGetter__("id", function() aId); this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IPlugin() {}", "function registerWrapper(wrapper) {\n registry.push(wrapper);\n}", "static plugin(p1, ...p2) {\n var _a;\n\n if (p1 instanceof Array) {\n console.warn([\"Passing an array of plugins to Octokit.plugin() has been deprecated.\", \"Instead of:\", \" Octokit.plugin([plugin1, pl...
[ "0.574495", "0.5222379", "0.5194423", "0.5194423", "0.5194423", "0.5194423", "0.5164633", "0.5138405", "0.50966674", "0.5092685", "0.5057116", "0.5057116", "0.5057116", "0.5057116", "0.502659", "0.50137866", "0.49760896", "0.49708587", "0.49330267", "0.49119464", "0.48842865"...
0.62373304
0
Shows an element and refreshs its content
function showElementByIdAndRefreshContent(elementId, data, contentAppender, length = 500) { const element = $(elementId); element.show(length); contentAppender(element, data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "switchDisplay() {\n this.display = !this.display;\n let elem = document.getElementById(this.htmlId);\n if (null != elem) {\n elem.innerHTML = this.displayWodContent();\n }\n }", "show() {\n this.elementViewScreen.innerHTML = this.html;\n return this;\n }", "show...
[ "0.662562", "0.65164346", "0.6407321", "0.6384153", "0.6375083", "0.636575", "0.63528466", "0.6317825", "0.6296916", "0.628441", "0.628441", "0.62702274", "0.6251236", "0.6195791", "0.61715966", "0.6164238", "0.61630875", "0.61572915", "0.61432356", "0.61340874", "0.6122515",...
0.72332263
0
gets the average episodes per season, floated with max one decimal
function getAverageEpisodesPerSeason(episodes) { let seasons = episodes.map(x => x.season); // list of episodes season numbers let numOfSeasons = Math.max(...seasons); // highest number of season available var sum = 0; for (let i = 1; i < numOfSeasons; i++) { let ep = episodes.filter(x => x.sea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcAverageEpisodeLength(episodes) {\n let totalSeconds = 0;\n episodes.forEach(episode => {\n totalSeconds += episode.audio_length_sec;\n });\n\n return Math.floor((totalSeconds / episodes.length) / 60);\n }", "function averageWeeksAtNumberOne(arrSongs) {\n\tvar sum = a...
[ "0.7381284", "0.64760876", "0.6399586", "0.6335936", "0.6304478", "0.63007224", "0.62314475", "0.62274975", "0.6206373", "0.61361986", "0.61359847", "0.6124769", "0.6123488", "0.6123242", "0.61146504", "0.610946", "0.61066586", "0.61025053", "0.6094894", "0.6053187", "0.60477...
0.86418706
0
cuts off some of the extra text from an episodes title. Then, returns the string
function getEpisodeTitle(episode) { let title = episode.name ? episode.name.substring(episode.name.indexOf(':') + 2) : 'N/A'; return title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeMovieTitle(movietitle) {\n\tvar thereturn = movietitle;\n\tthereturn = thereturn.trim();\n\tthereturn = strip3D(stripYears(thereturn));\n\n\tthereturn = thereturn.replace(/(\\s*(\\(|\\[).*(director|unrated|extended).*?(\\)|\\])|\\s*(\\[)(dubbed|subtitled)(\\]))/gi, '');\n\n\t//if it ends on a rig...
[ "0.6926159", "0.6616744", "0.6559502", "0.65275633", "0.6415475", "0.6277981", "0.6273667", "0.62567645", "0.6172994", "0.6109262", "0.6086032", "0.60758334", "0.60511804", "0.59570235", "0.5941452", "0.5923404", "0.5893907", "0.58146995", "0.5813221", "0.5803525", "0.5797404...
0.7203981
0
function to write created flash card to log.txt
function appendCard (cardEntry) { fs.appendFile('log.txt', cardEntry, function (error) { if (error) { console.log(error); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveBasic(flashcard){\n\tfs.appendFile(\"output.txt\", `Front: ${flashcard.front} Back: ${flashcard.back} \\n`, \"UTF-8\", function(error){\n\t\tif (error) throw error;\n\t});\n}", "function saveCloze(flashcard){\n\tfs.appendFile(\"output.txt\", `Cloze: ${flashcard.cloze} Question: ${flashcard.question}...
[ "0.7264247", "0.6563031", "0.59742093", "0.5914928", "0.5870388", "0.5868402", "0.5755826", "0.5746382", "0.5740485", "0.56448424", "0.5639862", "0.5605779", "0.5600739", "0.5585129", "0.55636245", "0.55451405", "0.5542191", "0.55420166", "0.5528197", "0.5520681", "0.5497479"...
0.72970504
0
inquirer prompt to create basic card
function newBasicCard(){ inquirer.prompt([ { type: "input", name: "basicQuestion", message: "Type the question that you would like an answer to.", }, { type: "input", name: "basicAnswer", message: "What is the answer to your question?", }, ]).the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function basic() {\n console.log('basic');\n inquirer.prompt([{\n type: 'input',\n message: 'What is the title or name of this flashcard? (Ex: parrotsQuestion):',\n name: 'title'},\n {\n type: 'input',\n message: 'What is the question for the front of the card?',\n ...
[ "0.8221427", "0.7948702", "0.78109396", "0.76133025", "0.75586367", "0.75360113", "0.73973393", "0.73657554", "0.7345137", "0.72406393", "0.71374977", "0.71182644", "0.7048374", "0.70083326", "0.6986721", "0.6957493", "0.6922051", "0.69209826", "0.69076467", "0.68738776", "0....
0.8408341
0
Based on the answer from the prompt it will create a new cloze card
function newClozeCard(){ inquirer.prompt([ { type: "input", name: "text", message: "What question or statemente would you like to ask?", }, { type: "input", name: "cloze", message: "Please, type the answer to your question", }, //create cloze car...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloze() {\n console.log('cloze');\n inquirer.prompt([{\n type: 'input',\n message: 'What is the title of this flashcard?',\n name: 'title'},\n {\n type: 'input',\n message: 'What is the full text for the flashcard?',\n name: 'fullText'},\n {\n ...
[ "0.7875581", "0.76619965", "0.7597682", "0.7543748", "0.74250335", "0.73528016", "0.7295318", "0.7285205", "0.7150966", "0.7055389", "0.70033514", "0.69103956", "0.67857134", "0.6762806", "0.6699999", "0.66310936", "0.6608514", "0.65670455", "0.65458816", "0.65456903", "0.652...
0.8437808
0
TODO: make this function to be more extensible once the initial set of elections are over. Returns a ballot object built from the user's input.
function getBallot() { var ballot = {} ballot['election_id'] = $('#election-information').attr('data-election-id'); ballot['positions'] = []; /* For each position, get the position and the data. */ $('.position').each(function(i, obj) { var write_in = false; var name = $(this)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ballot() {\n var bal = {},\n // Settable options\n container,\n candidates = [],\n votes = [],\n title = 'Example ballot card',\n withCard = false,\n showCard = false,\n shouldFadeIn = {\n candida...
[ "0.68646", "0.6229487", "0.5880116", "0.547975", "0.5355467", "0.50503147", "0.50019085", "0.49983853", "0.49873948", "0.496487", "0.48492345", "0.4849119", "0.46615463", "0.46547258", "0.46546647", "0.46422642", "0.4635326", "0.46064597", "0.457728", "0.45563632", "0.451215"...
0.6635045
1
Function that verifies a cummulative position is valid.
function verifyCummulativePosition(position) { var id = position['id'] var name = position['name'] var type = position['type'] var candidates = position['candidate_points'] var available_points = position['available_points']; var write_in = false; var sum = 0; $.each(candidates, fu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPositionValid(board, position) {\n const validBlockSigns = ['1','B','X'];\n for (let block of position) {\n if (block[0] < 0 || block[1] < 0 || block[0] >= board.length || block[1] >= board[0].length || validBlockSigns.indexOf(board[block[0]][block[1]]) === -1) {\n return false;\n }\n }\n ...
[ "0.62487954", "0.61182994", "0.6116218", "0.60417014", "0.6003758", "0.5910914", "0.59037167", "0.5795641", "0.5790789", "0.57033616", "0.56885046", "0.5688314", "0.5680571", "0.5672147", "0.5647913", "0.56067383", "0.55794287", "0.5571143", "0.5571143", "0.5571143", "0.55711...
0.6703243
0
Given an array of objects (e.g. [ obs, obs, ... ]), and an associated model, return a compact, unique array of the foreign_keys for that model e.g. Model.belongsToIDs([ obs, ...], User) returns an array of unique values from all obs.user_id and obs.user.id
static belongsToIDs( objects, model, options ) { options = options || { }; const attrName = options.attrName || model.modelName; if ( !options.idFields ) { var modelID = options.foreignKey || model.modelName + "_id"; options.idFields = { }; options.idFields[ modelID ] = attrName; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeArrayDuplicateObjectByIdentity(array) {\r\n let unique = []\r\n array.forEach(item => {\r\n if (!unique.some(i => i.identity == item.identity)) unique.push(item)\r\n })\r\n return unique\r\n}", "function uniteUnique(arr) {\n \"use strict\";\n var values = [].concat.apply([], Array.from(ar...
[ "0.5431536", "0.5417581", "0.53746897", "0.5367041", "0.53496784", "0.52952397", "0.5292369", "0.52601796", "0.52577686", "0.5245386", "0.5222099", "0.5213725", "0.5195905", "0.5171516", "0.5171035", "0.5160341", "0.51397735", "0.5101809", "0.50975454", "0.50975454", "0.50975...
0.69798326
0
hides the sun image in the middle
function hide() { $("#imageSun").css("opacity", "0"); $("#imageSun").css("transition", "opacity 4s"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleSun(){\n\tif(sun.intensity === 1)\n\t\tsun.intensity = 0;\n\telse\n\t\tsun.intensity = 1;\n}", "function sun() {\n stroke(0);\t\t\t\t\t\t\t\t\t\t\t// give sun black outline\n fill(0);\t\t\t\t\t\t\t\t\t\t\t\t// give sun black fill\n ellipse(0, 0, 50, 50);\t\t\t\t\t// draw ellipse representing su...
[ "0.64560205", "0.645287", "0.61690396", "0.61127424", "0.6008024", "0.6007517", "0.59452134", "0.5944484", "0.5840033", "0.58336836", "0.58256894", "0.5822654", "0.57989323", "0.5790092", "0.5788805", "0.57874084", "0.5783884", "0.5761054", "0.5745629", "0.5738747", "0.573796...
0.64693695
0
Check to see if enough time has passed
hasExpired() { return (new Date().getTime() - this._startTime) >= this._delay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTimeUp_(start) {\n var now = new Date();\n return now.getTime() - start.getTime() > timeOut;\n}", "timeExceedsThreshold(time) {\n const dt = Math.abs(time - this.getCurrentTime())\n return dt > (playerSettings.seekThreshold || 0)\n }", "function istimeout(seentime,timelimit) {\n...
[ "0.7000029", "0.6809605", "0.67740095", "0.67273295", "0.6650811", "0.6617051", "0.65763694", "0.65707886", "0.6538917", "0.65259004", "0.6431729", "0.64231294", "0.63725513", "0.63536245", "0.6340782", "0.633681", "0.6320102", "0.6312842", "0.62703764", "0.62510455", "0.6246...
0.7198056
0
Validation du code de cours
function validCodeCours(theChamp, obligatoire, decl) { var val = theChamp.value; if (strip(val) == '') { if (obligatoire) { window.alert("Le code de déclinaison est obligatoire !"); theChamp.focus(); return (false); } else { return (true); } } if (decl) { if (val.inde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_valid_input(code) {\n var ctr = Number(code[0]);\n if (ctr === 0 && code.length === 3) {\n return true;\n }\n if (ctr >= 1 && ctr <= 3 && code.length === 7) {\n return true;\n }\n if (ctr >= 4 && ctr <= 7) {\n return true;\n }\n return false;\n }", "function va...
[ "0.67989814", "0.6679375", "0.66493964", "0.6636122", "0.6588896", "0.65440214", "0.6506423", "0.6475337", "0.6475337", "0.6475337", "0.64361733", "0.64130235", "0.6250699", "0.62494457", "0.6229382", "0.6169157", "0.61130816", "0.6067009", "0.6059777", "0.60351896", "0.60203...
0.80559427
0
moves the word at (pageX, pageY) coordinates taking initial shifts into account
function moveAt(pageX, pageY) { charItem.style.left = pageX - shiftX + 'px'; charItem.style.top = pageY - shiftY + 'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveAt(pageX, pageY) {\n containerContent.style.left = pageX - shiftX + 'px';\n containerContent.style.top = pageY - shiftY + 'px';\n }", "function moveAt(pageX, pageY) {\n item.style.left = pageX - shiftX + 'px';\n item.style.top = pageY - shiftY + 'px';\n }", "fun...
[ "0.70949274", "0.70159155", "0.6854633", "0.6809186", "0.6718637", "0.6718637", "0.6714427", "0.6704564", "0.65015477", "0.64873266", "0.64004636", "0.6393157", "0.6294548", "0.61252594", "0.6065681", "0.60601616", "0.6036486", "0.59133524", "0.5902901", "0.5886372", "0.58796...
0.77283
0
loops through the language specific examples within the examples.yml file and calls the cb function with each individual example
function iterateCodeExamples(language, cb) { var examples = yaml.safeLoad(fs.readFileSync('./examples/' + language + '.yml', 'utf8')); if (examples) { for (var framework in examples) { for (var example in examples[framework]) { cb(framework, example, examples[framework][example]); } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testExamples(examples, callback) {\n Bluebird.map(examples, testExample, { concurrency: concurrency }).asCallback(callback);\n}", "function runThroughExamples(examples, i, lastAnswer) {\n var header = $(\"<div/>\");\n header.html(\"<b>TUTORIAL \"+(i+1)+\"/\"+(examples.length+1)+\":</b><br...
[ "0.60210043", "0.5818506", "0.57979363", "0.5791004", "0.5685627", "0.56200945", "0.55266225", "0.5504084", "0.5464405", "0.54549545", "0.5436453", "0.5416254", "0.53586674", "0.5312466", "0.52768993", "0.52557063", "0.5205653", "0.5184225", "0.51262844", "0.5113557", "0.5016...
0.8000047
0
Adjusts the number of element of this set
function adjustNumberOfElements(numberOfElements) { // keep original settings for the new elements var name = self.getName ? self.getName() : "unnamed"; numberOfElements = Math.max(1,numberOfElements); var diff = mElementList.length-numberOfElements; if (diff > 0) { mLastElementList = mElementL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "manger() {\n this.size++;\n }", "extend(size) {\n this.range[1] += size;\n }", "expand() {\n let oldBuckets = this.buckets;\n this.bucketCount *= 2;\n this.bucketsUsed = 0;\n this.buckets = [];\n\n oldBuckets.forEach(bucket => {\n bucket.forEach(entry => ...
[ "0.60100496", "0.59921044", "0.5796225", "0.57935494", "0.57460016", "0.57296544", "0.5715494", "0.56973815", "0.56532127", "0.56488657", "0.5646653", "0.56309146", "0.56309146", "0.56080955", "0.56080955", "0.5606533", "0.5572061", "0.55691016", "0.54635125", "0.5453703", "0...
0.6157574
1
text for tick in position (x,y) with font and mode
function tickText (x, y, text, font, horizontal) { mContext.save(); var font = mElement.getFont(); var fondtxt = ""; fondtxt += (font.getFontStyle() != 'none')? font.getFontStyle() + ' ':''; fondtxt += (font.getFontWeight() != 'none')? font.getFontWeight() + ' ':''; fondtxt += font.getFontSizeString()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tickText (group, x, y, text, font, horizontal) {\n\t // create SVG element group\n\t var mTxtGroup = document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"); \n\t group.appendChild(mTxtGroup);\t \n\t // create text element\n\t var mText = document.createElementNS(\"http://www.w3.o...
[ "0.6966291", "0.6727432", "0.6630727", "0.66269445", "0.6618287", "0.65882653", "0.65244955", "0.64841694", "0.641049", "0.64031816", "0.63962275", "0.63059646", "0.6301735", "0.6300762", "0.62932414", "0.6281087", "0.62529975", "0.6238193", "0.6214136", "0.6209768", "0.61982...
0.73388815
0
adds a segment to the trail
function addSegment(points,num,style,pX,pY,sX,sY) { if (num<=0) return; // Nothing to add mContext.beginPath(); for (var i=0; i<num; i++) { var point = points[i]; var xx = pX + point[0]*sX; var yy = pY + point[1]*sY; var type = point[2]; if ((i==0) || (type == 0)) // 0 is NOT CONNECTION...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSegment(board, initVal) {\n\tvar x = initVal.x;\n\tvar y = initVal.y;\n\n\tvar pt1 = board.create('point', [x,y]); \n\tvar pt2 = board.create('point', [x+1,y+1]); \n\tvar obj = board.create('segment', [pt1,pt2]); \n}", "function addNewSegment (transcript,segment,index,speaker) {\n transcript.se...
[ "0.7011764", "0.6847063", "0.66596806", "0.64198214", "0.6314263", "0.62319326", "0.6202419", "0.6145348", "0.61333215", "0.5902052", "0.58836883", "0.58186996", "0.57829916", "0.57071096", "0.5694046", "0.5646316", "0.5625747", "0.5614593", "0.5614593", "0.55974793", "0.5596...
0.6948152
1
generates path for analyticCurve
function pathForanalyticCurve(points, x, y, sx, sy) { var path = ""; for(var i=0; i<points.length; i++) { var point = points[i]; var xx = x + point[0]*sx; var yy = y + point[1]*sy; var type = point[2]; if ((i==0) || (type == 0)) // 0 is NOT CONNECTION path += " M " + xx + " " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildCurvePath(width, height, thickness, dx, dy, direction){\n let curve = this.buildCurve(width, height, thickness, dx, dy, direction);\n let path = this.curveToPath(curve);\n\n let curve2 = this.buildCurve(width, height, thickness, dx, dy+thickness, this.nextDirection[direction]);\n path += ` L ${cur...
[ "0.6860661", "0.61854434", "0.6008888", "0.5901227", "0.58916646", "0.58916646", "0.5875134", "0.57947034", "0.57873863", "0.575096", "0.5710698", "0.5707282", "0.5696422", "0.56949466", "0.5677754", "0.56513095", "0.56513095", "0.56513095", "0.56513095", "0.56513095", "0.560...
0.7616773
0
text for tick in position (x,y) with font and mode
function tickText (group, x, y, text, font, horizontal) { // create SVG element group var mTxtGroup = document.createElementNS("http://www.w3.org/2000/svg","g"); group.appendChild(mTxtGroup); // create text element var mText = document.createElementNS("http://www.w3.org/2000/svg","text");...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tickText (x, y, text, font, horizontal) {\n\t\tmContext.save();\n\n\t \tvar font = mElement.getFont();\n\t \tvar fondtxt = \"\";\n\t \tfondtxt += (font.getFontStyle() != 'none')? font.getFontStyle() + ' ':'';\n\t \tfondtxt += (font.getFontWeight() != 'none')? font.getFontWeight() + ' ':'';\n\t \tfondtxt +...
[ "0.73388815", "0.6727432", "0.6630727", "0.66269445", "0.6618287", "0.65882653", "0.65244955", "0.64841694", "0.641049", "0.64031816", "0.63962275", "0.63059646", "0.6301735", "0.6300762", "0.62932414", "0.6281087", "0.62529975", "0.6238193", "0.6214136", "0.6209768", "0.6198...
0.6966291
1
generates path for trail
function pathForTrail(points, x, y, sx, sy) { var path = ""; for(var i=0; i<points.length; i++) { var point = points[i]; var xx = x + point[0]*sx; var yy = y + point[1]*sy; var type = point[2]; if ((i==0) || (type == 0)) // 0 is NOT CONNECTION path += " M " + xx + " " + yy; /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shapeTrail() {\n beginShape();\n strokeWeight(pos);\n stroke(0);\n\n //this part of code uses the shapes stored coordinates to create the trail\n for(i=0; i < trail.length; i++) {\n let pos = trail[i];\n noFill();\n vertex(pos.x,pos.y);\n endShape();\n }\n \n if (trail.length > 50) {\n...
[ "0.6385318", "0.63783723", "0.63638395", "0.6229918", "0.6139381", "0.605592", "0.5872585", "0.58506125", "0.5833172", "0.5808118", "0.576058", "0.5719856", "0.5661981", "0.56530356", "0.5626222", "0.5625248", "0.56051147", "0.5603668", "0.5599358", "0.5574073", "0.5571254", ...
0.7212062
0
Adjusts the number of element of this set
function adjustNumberOfElements(numberOfElements) { // keep original settings for the new elements var name = self.getName ? self.getName() : "unnamed"; numberOfElements = Math.max(1,numberOfElements); var diff = mElementList.length-numberOfElements; if (diff > 0) { mLastElementList = mElementL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "manger() {\n this.size++;\n }", "extend(size) {\n this.range[1] += size;\n }", "expand() {\n let oldBuckets = this.buckets;\n this.bucketCount *= 2;\n this.bucketsUsed = 0;\n this.buckets = [];\n\n oldBuckets.forEach(bucket => {\n bucket.forEach(entry => ...
[ "0.60100496", "0.59921044", "0.5796225", "0.57935494", "0.57460016", "0.57296544", "0.5715494", "0.56973815", "0.56532127", "0.56488657", "0.5646653", "0.56309146", "0.56309146", "0.56080955", "0.56080955", "0.5606533", "0.5572061", "0.55691016", "0.54635125", "0.5453703", "0...
0.6157574
0
new GL.Matrix([elements]) This constructor takes 9 or 16 arguments in rowmajor order, which can be passed individually, as a list, or even as four lists, one for each row. If the arguments are omitted then the identity matrix is constructed instead.
function Matrix() { var m = Array.prototype.concat.apply([], arguments); if (!m.length) { m = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; } else if (m.length == 9) { m = [ m[0], m[3], m[6], 0, m[1], m[4], m[7], 0, m[2], m[5], m[8], 0, 0, 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Matrix() {\n\t\tvar m = Array.prototype.concat.apply([], arguments);\n\t\tif (!m.length) {\n\t\t\tm = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t\t}\n\t\tthis.m = hasFloat32Array ? new Float32Array(m) : m;\n\t}", "function Matrix() {\n\tvar args = Array.prototype.slice.call(arguments);\n\t// c...
[ "0.73092395", "0.6949333", "0.68455625", "0.6717096", "0.6492181", "0.6462314", "0.6418646", "0.6357056", "0.63378924", "0.6251221", "0.6173251", "0.6161444", "0.61257946", "0.60938877", "0.60472107", "0.60341394", "0.6026089", "0.6020074", "0.60156494", "0.60022616", "0.5966...
0.758593
0
The `gl_` prefix must be substituted for something else to avoid compile errors, since it's a reserved prefix. This prefixes all reserved names with `_`. The header is inserted after any extensions, since those must come first.
function fix(header, source) { var replaced = {}; var match = /^((\s*\/\/.*\n|\s*#extension.*\n)+)[^]*$/.exec(source); source = match ? match[1] + header + source.substr(match[1].length) : header + source; EJSS_WEBGLGRAPHICS.Utils.regexMap(/\bgl_\w+\b/g, header, function(result) { if (!(result in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fix(header, source) {\n\t\t\tvar replaced = {};\n\t\t\tvar match = /^((\\s*\\/\\/.*\\n|\\s*#extension.*\\n)+)\\^*$/.exec(source);\n\t\t\tsource = match ? match[1] + header + source.substr(match[1].length) : header + source;\n\t\t\tregexMap(/\\bgl_\\w+\\b/g, header, function (result) {\n\t\t\t\tif (!(resul...
[ "0.6365302", "0.5980812", "0.5283986", "0.50644416", "0.50613034", "0.5020304", "0.4999657", "0.4989532", "0.49862817", "0.49809068", "0.49737126", "0.49559522", "0.49559522", "0.48701012", "0.48631966", "0.484288", "0.4842161", "0.48221922", "0.48044124", "0.48028165", "0.48...
0.64334047
0
For internal use only. Processed tasks that have been signaled to be run only when the model is not doing any calculation.
function processSafeTasks() { // call this when the model computation won't be affected if (mPendingTasks.length==0) return false; var tasks = mPendingTasks.slice(); // In case a task modifies the pending tasks mPendingTasks = []; for (var i=0; i<tasks.length; i++) tasks[i](); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__prepareTaskDeletion(model) {\n if (this.removedTasks === undefined) {\n this.removedTasks = [];\n }\n if (this.task !== undefined) {\n this.__deleteTask(this.task);\n }\n this.set('task', model.task);\n\n this.removedTasks.push(model.task);\n\n this.timerId = setTimeout(() => this....
[ "0.5689133", "0.5678355", "0.5636208", "0.56358725", "0.55914515", "0.5552745", "0.552122", "0.54837656", "0.54762655", "0.5406996", "0.53917897", "0.53839564", "0.537844", "0.53690827", "0.5358917", "0.53587234", "0.5358481", "0.53416735", "0.53374726", "0.53346705", "0.5324...
0.69784254
0
Private functions Does the interpolation at the prescribed time.
function doTheInterpolation(time, state) { if (mUseBestInterpolation) mSolverEngine.bestInterpolate(time, state); else mSolverEngine.interpolate(time, state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolate(start,end,date)\n{\n //console.log((date.getTime() - start.getTime()) +\" / \"+(end.getTime()-start.getTime()));\n return ( (date.getTime() - start.getTime()) / (end.getTime()-start.getTime()) );\n //return (date.getTime() - times.sunrise.getTime()) / (midSun.getTime()-times.sunrise.getTime...
[ "0.67790204", "0.67164457", "0.6658505", "0.6658505", "0.6531678", "0.6531678", "0.6531678", "0.6531678", "0.65081626", "0.6459179", "0.6255538", "0.6209839", "0.60000753", "0.59668183", "0.5863509", "0.5857566", "0.5841742", "0.5841619", "0.5828401", "0.5724136", "0.57197154...
0.71116996
0
Steps the ODE when there are no events
function stepWithoutEvents() { var state = mODE.getState(); // Check for a 0 rate for time var rate = mSolverEngine.getCurrentRate(); var tBegin = state[mTimeIndex]; if (tBegin+rate[mTimeIndex]==tBegin) return 0; var tEnd = state[mTimeIndex] + mStepSize; var max_t = mSolverEngine.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stepWithEvents() {\n var state = mODE.getState();\n if (mZenoMaximumAllowedTimes>0 && mZenoCounter>mZenoMaximumAllowedTimes) {\n if (callZenoAction(state)) return 0;\n }\n\n var tBegin = state[mTimeIndex];\n\n // Check for a 0 rate for time\n var rate = mSolverEngine.getCurrentRate(...
[ "0.7148138", "0.67312443", "0.5963856", "0.5872054", "0.5662988", "0.56429", "0.55990374", "0.555022", "0.547375", "0.54141825", "0.5313833", "0.5313421", "0.5294258", "0.5292928", "0.5269651", "0.52456355", "0.52433085", "0.5234403", "0.5215397", "0.5195522", "0.51859087", ...
0.7423074
0
Steps the ODE with events
function stepWithEvents() { var state = mODE.getState(); if (mZenoMaximumAllowedTimes>0 && mZenoCounter>mZenoMaximumAllowedTimes) { if (callZenoAction(state)) return 0; } var tBegin = state[mTimeIndex]; // Check for a 0 rate for time var rate = mSolverEngine.getCurrentRate(); if (tBe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stepWithoutEvents() {\n var state = mODE.getState();\n \n // Check for a 0 rate for time\n var rate = mSolverEngine.getCurrentRate();\n var tBegin = state[mTimeIndex];\n if (tBegin+rate[mTimeIndex]==tBegin) return 0;\n \n var tEnd = state[mTimeIndex] + mStepSize;\n var max_t = m...
[ "0.6526598", "0.6237386", "0.6057784", "0.60536253", "0.5721176", "0.57130706", "0.5652449", "0.561097", "0.5509053", "0.5488439", "0.5433544", "0.5428271", "0.5427725", "0.5382218", "0.5372835", "0.53491664", "0.53459877", "0.53409296", "0.533636", "0.53227246", "0.5304687",...
0.692651
0
A Zeno effect has been detected. Call the listeners. If there are no listeners registered, then an error is issued, including possibly throwing an exception
function callZenoAction(state) { if (mZenoList.length<=0) { self.error (EJSS_ODE_SOLVERS.ERROR.ZENO_EFFECT,"A Zeno-like effect has been detected.\nLast event was "+ mLastEventData.getProblem() +" which took place at "+mLastEventDataTime); return true; } var returnAtZeno = false; va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "if (hook.isDependenciesChanged) {\n effectHandler(hook);\n }", "function notify() {\n\t// iterate through the array and call the listen callback function\n\t\tfor (var i = 0; i < listeners.length; i++) {\n\t\t\t// call the function\n\t\t\tlisteners[i](pixel);\n\t\t}\n\t}", "function callback123() {...
[ "0.57339936", "0.5624702", "0.5581037", "0.54682565", "0.54475886", "0.5174133", "0.5161059", "0.5105325", "0.50840104", "0.5067107", "0.50138664", "0.5000953", "0.49912924", "0.49821213", "0.49788335", "0.49673304", "0.49673304", "0.49574524", "0.49540594", "0.49537936", "0....
0.68305814
0
The first point where events estimate the crossing takes place
function nextPointToCheck (list, t1, t2) { var i, length = list.length; var hB, tFirst = t2, dt = (t2 - t1), tMiddle = (t1+t2)/2; if (mRunsForwards) { for (i=0; i<length; i++) { var eventData = list[i]; switch (eventData.getEvent().getRootFindingMethod()) { default : ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bezierPoint(pt, prev, next) {\n const x = this.normalizeVal(pt.x, 0, 1, prev.x, next.x);\n const y = this.normalizeVal(pt.y, 0, 1, prev.y, next.y);\n return {x, y};\n }", "initialPoint()\r\n {\r\n return this.transformedPoints[0];\r\n }", "get initialPoint()\r\n {\r\n return this.cPoints[0];...
[ "0.62147164", "0.6181626", "0.6046227", "0.59754866", "0.5962307", "0.59006274", "0.588941", "0.58140695", "0.57963145", "0.5774043", "0.57438445", "0.5708763", "0.5690353", "0.5681436", "0.5672942", "0.56688875", "0.56498265", "0.5637053", "0.5629926", "0.56100535", "0.55829...
0.62196815
0
Makes sure the intended step does not exceed the maximum step
function limitStepSize(intendedStep) { var ode = self.getODE(); var delays; var i, length; if (intendedStep>=0) { if (ode.getDelays) { // Don't step more than half the minimum delay delays = ode.getDelays(self.getInitialState()); length = delays.length; for (i=0; i<length; i++) intende...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStep (d) { return !(d < 0 || d > 6) }", "function cap (value, max, step) {\n step = step || 1;\n if (value >= max)\n return max - step;\n return value;\n }", "function determineStepSize(min, max, unit, capacity) {\r\n\tvar range = max - min;\r\n\tvar interval = INT...
[ "0.6739113", "0.67024094", "0.63004905", "0.63004905", "0.62082607", "0.62082607", "0.62082607", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677", "0.6206677...
0.68718255
0
Utils Steps the ode with a positive stepsize.
function plus() { // positive step size var tol = mODEEngine.getTolerance(); var remainder = mFixedStepSize; // track the remaining step if((mODEEngine.getStepSize()<=0)||( // is the stepsize postive? mODEEngine.getStepSize()>mFixedStepSize)||( // is the st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minus() { // negative step size\n var tol = mODEEngine.getTolerance();\n var remainder = mFixedStepSize; // track the remaining step\n if ((mODEEngine.getStepSize()>=0)||( // is the step negative?\n mODEEngine.getStepSize()<mFixedStepSize)||( // is the s...
[ "0.6710416", "0.6019258", "0.55441356", "0.5511569", "0.5470781", "0.544892", "0.5435636", "0.5374814", "0.5360139", "0.5340886", "0.52935797", "0.5231035", "0.52157867", "0.51900107", "0.5174063", "0.51701635", "0.5147127", "0.5056373", "0.502879", "0.5025865", "0.4994903", ...
0.63480884
1
Steps the ode with a negative stepsize.
function minus() { // negative step size var tol = mODEEngine.getTolerance(); var remainder = mFixedStepSize; // track the remaining step if ((mODEEngine.getStepSize()>=0)||( // is the step negative? mODEEngine.getStepSize()<mFixedStepSize)||( // is the stepsize l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stepWithoutEvents() {\n var state = mODE.getState();\n \n // Check for a 0 rate for time\n var rate = mSolverEngine.getCurrentRate();\n var tBegin = state[mTimeIndex];\n if (tBegin+rate[mTimeIndex]==tBegin) return 0;\n \n var tEnd = state[mTimeIndex] + mStepSize;\n var max_t = m...
[ "0.65648246", "0.57659876", "0.5505428", "0.5498679", "0.5489538", "0.5433235", "0.5305181", "0.51552767", "0.51302016", "0.5103028", "0.5095304", "0.50385034", "0.4989661", "0.4957033", "0.49374548", "0.49315214", "0.48659822", "0.48653042", "0.48634467", "0.48480067", "0.48...
0.7053279
0
That function is not in use right now, but it's purpose is to copy every style that is applied on one element to another.
function copyCssStyle(sourceNode, targetNode) { var computedStyle = window.getComputedStyle(sourceNode); Array.from(computedStyle).forEach(function(key) { return targetNode.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyComputedStyle(element) {\n let computed = getComputedStyle(element);\n let output = Object.create(null);\n for (let property of COPIED_CSS_PROPERTIES) {\n output[property] = computed[property];\n }\n return output;\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.k...
[ "0.70960736", "0.7088513", "0.7061989", "0.7061515", "0.70271945", "0.70271945", "0.69868845", "0.69868845", "0.69571525", "0.69571525", "0.69571525", "0.69571525", "0.69436324", "0.69436324", "0.69209564", "0.68742716", "0.686467", "0.686467", "0.686467", "0.686467", "0.6864...
0.7181752
0
recursive function to convert all document images to Base64
function convertAllUrlImagesToBase64(docu){ var allImgDoc = docu.getElementsByTagName("img"); var allImg = []; var i=0; for( var j=0; j< allImgDoc.length; j++ ){ var url = allImgDoc[j].src; if ( url.match(/.(jpg|jpeg|png|gif|svg)/gi) ) allImg.push(allImgDoc[j]); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertImagesToBase64 (element) {\n\n var regularImages = $(element).find('img');\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n [].forEach.call(regularImages, function (imgElement) {\n\t// preparing canvas for drawing\n\tctx.clearRect(0, 0, canvas.width, canva...
[ "0.63110673", "0.59727645", "0.57440186", "0.57341707", "0.5598998", "0.55470854", "0.55070853", "0.54954666", "0.54919595", "0.54897976", "0.5485995", "0.54575926", "0.5455236", "0.54496366", "0.5448871", "0.5401074", "0.5355043", "0.5350549", "0.53261894", "0.5325443", "0.5...
0.762109
0
set a filter type: "All", "Active" or "Inactive"
@action setFilterType(filterType) { this.filterType = filterType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeSearchType(newFilter) {\n this.trelloDataStore.changeFilter(newFilter);\n this.selectedType = trelloDataStore.pageData.selectedType;\n }", "function filterChange(type)\n {\n\n vm.listType = type;\n\n if ( type === 'all' )\n {\n ...
[ "0.7044541", "0.69968843", "0.697295", "0.6952264", "0.6946732", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6931722", "0.6901091", "0.6901091", "0.6901091", "0.6901091", "0.6901091", "...
0.76135325
0
make colors in range
function makeColorsInRange(startHue,startSat,startLig,endHue,endSat,endLig,num) { var hueList = breakRange(startHue, endHue, num); var satList = breakRange(startSat, endSat, num); var ligList = breakRange(startLig, endLig, num); //console.log("The hues: " + hueList); //console.log("The saturations: " + satList); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBlackAndWhiteColors(startLig,endLig,num){\n\tvar ligList = breakRange(startLig, endLig, num);\n\tvar list = [];\n\tfor (var i = 0; i < num; i++) {\n\t\tvar hex=Math.floor(ligList[i]).toString(16);\n\t\tvar theColor='#'+hex+hex+hex;\n\t\t//var theColor = \"hsl(0,0,\"+ligList[i]+\"%)\";\n\t\t//console.l...
[ "0.73075", "0.6962822", "0.6926984", "0.69163996", "0.6721414", "0.67201895", "0.66679144", "0.66329104", "0.6613898", "0.661005", "0.6547443", "0.6542131", "0.6510656", "0.64728284", "0.6452999", "0.64308053", "0.64229935", "0.63723963", "0.63716704", "0.63716704", "0.635592...
0.7627012
0