Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Unlink the selected entry from the current entry for a Reciprocal Association.
function deleteReciprocalAssociation(field, recip_obj_id) { var type = jQuery('#entry_form input[name=_type]').val(); jQuery.get( CMSScriptURI + '?__mode=unlink_reciprocal', { 'recip_field_basename': field, 'recip_entry_id': recip_obj_id, 'cur_entry_id': jQuery('input[name=id]').val(), 'recip_obj_type': type }, function(data) { jQuery('#'+field+'_status').html(data.message).show(500); // The association was successfully deleted from the database, // so delete the visible data. if (data.status == 1) { jQuery('input#'+field).val(''); jQuery('ul#custom-field-reciprocal-'+field).children().remove(); setTimeout(function() { jQuery('#'+field+'_status').hide(1000) }, 7000); } }, 'json' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unlink(kcLink) {\n let i = this.kcLinks.indexOf(kcLink);\n this.kcLinks.splice(i,1);\n if (this === kcLink.outPoint) {\n // this is a required docking point and someone just removed the link :(\n this.courseObject.requiredWasUnlinked(this);\n }\n }", "unlink(c...
[ "0.5946615", "0.57622755", "0.55962974", "0.5592985", "0.5504511", "0.54269713", "0.5403657", "0.536653", "0.53381896", "0.5303855", "0.52463424", "0.5215935", "0.52037936", "0.5190934", "0.51818377", "0.5181754", "0.5165549", "0.5155353", "0.5128827", "0.5123988", "0.5067149...
0.58791316
1
Create the timestamp for the Timestamped Textarea CF.
function createDate() { var d = new Date(); var year = d.getFullYear(); var month = d.getMonth() + 1; if (month < 10) { month = 0 + month.toString(); } var date = d.getDate(); if (date < 10) { date = 0 + date.toString(); } var hours = d.getHours(); if (hours < 10) { hours = 0 + hours.toString(); } var min = d.getMinutes(); if (min < 10) { min = 0 + min.toString(); } var sec = d.getSeconds(); if (sec < 10) { sec = 0 + sec.toString(); } var ts = year.toString() + month.toString() + date.toString() + hours.toString() + min.toString() + sec.toString(); return ts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TimeStamp() {}", "function TimeStamp() {}", "_renderCardTimestamp() {\n if (this.card_timestamp && this.timestampLayer) {\n this.timestampLayer.innerHTML = localDatetime(new Date().toISOString())\n }\n }", "_renderCardTimestamp() {\n if (this.card_timestamp && this...
[ "0.6479102", "0.6479102", "0.617965", "0.617965", "0.6027368", "0.59835774", "0.5972732", "0.5959247", "0.5950676", "0.591248", "0.5899696", "0.5898191", "0.5874724", "0.5860661", "0.57271403", "0.57209414", "0.571951", "0.5700783", "0.56880176", "0.56764305", "0.5623398", ...
0.0
-1
MultiUse SingleLine Text Group
function addSingleLineTextGroup(parent,field_name) { var num = jQuery('#' + parent + ' ul').size(); jQuery('#'+field_name+'_multiusesinglelinetextgroupcf_invisible-field').clone().appendTo('#' + parent); // Switch to display:block so that the field is visible. jQuery('#' + parent + ' .cf-text-group').css('display', 'block'); // The text input field has "_invisible" appended so that it isn't // inadvertently saved. Remove that trailing identifier so that the // field can be properly used. jQuery('#' + parent + ' ul.cf-text-group input[type=text]').each(function(index) { var name = jQuery(this).attr('name'); name = name.replace(/_invisible$/, ''); var name = jQuery(this).attr('name', name); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addGroupText() {\n\tif (groupText) { groupText.destroy(); }\n\tgroupText = game.add.group();\n\treturn groupText;\n}", "function multiLineText(text, x, y, width, height) {\n return '<switch>\\n' +\n '<foreignObject x=\"' + x + '\" y=\"' + y + '\" width=\"' + width + '\" height=\"' + height + '\">\\n...
[ "0.6478826", "0.6269797", "0.62565714", "0.5962304", "0.5921791", "0.57596415", "0.57466376", "0.5706988", "0.5638568", "0.56331825", "0.5615477", "0.5566478", "0.55554104", "0.5538422", "0.5508039", "0.5506424", "0.5506424", "0.5470638", "0.5463635", "0.5440184", "0.54318166...
0.6793016
0
160000 = 1 minute => 246060000 = 1 day
function getCategories(success, fail) { var key = 'ow-news-lists', target = 'categories', cache = cacheFactory.check({key:key,target:target,lifetime:lifetime}); if(!cache) { newsFactory.categories().then(function (data) { if(cacheFactory.set({key:key,target:target,value:data,method:'override'})) { success(data); } }, fail); } else { success(cacheFactory.get({key:key,target:target})); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTimeStamp8pm(){\n let today = new Date();\n \n var ms = today.getTime();\n var msPerDay = 86400 * 1000;\n var msto8pm = 72000000;\n let eightPMToday = ms - (ms % msPerDay) + msto8pm;\n return eightPMToday; \n }", "function gigase...
[ "0.6154012", "0.6112224", "0.6008657", "0.6002835", "0.5970197", "0.5941444", "0.5928127", "0.59280276", "0.5884373", "0.5884373", "0.5884373", "0.5884373", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.5858...
0.0
-1
SOLO PERMITE NUMEROS Y LETRAS
function soloNumerosYLetras(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras="0123456789aábcdeéfghiíjklmnñoópqrstuúvwxyz"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prueba (cuenta){\n\tlet count = cuenta\n\tfor (let i = 0; i < Math.floor(count/2); i++){\n\t\tconsole.log(i)\n\t}\n}", "static calcularPersonas(num){\n for (let i = 0; i < num; i++) {\n personas[i] = new Persona();\n personas[i].getNumero(i + 1);\n }\n }", "funct...
[ "0.6312876", "0.6282274", "0.6221495", "0.6188213", "0.61739534", "0.6153155", "0.61523765", "0.61437905", "0.61432016", "0.61420697", "0.61256427", "0.6095237", "0.60733646", "0.6068727", "0.60428715", "0.60334027", "0.5999061", "0.59936327", "0.5982467", "0.5975057", "0.595...
0.0
-1
SOLO PERMITE LETRAS CON ESPACIOS
function letrasYEspacios(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras=" aábcdeéfghiíjklmnñoópqrstuúvwxyz"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quitaEspacios(mensaje){\n mensaje = mensaje.toUpperCase();//hacemos que nuestra frase solo este en mayusculas\n let mensajeSinESpacio = \"\";\n for (letra of mensaje){//recorremos todo nuestro string\n if (letra !== \" \") {//si el caracter en esa iteracion no es un espacio en blanco \n ...
[ "0.6574808", "0.6530099", "0.6444351", "0.6123187", "0.6042969", "0.5998561", "0.59914553", "0.5956192", "0.59134245", "0.58650947", "0.5848309", "0.5848309", "0.58188474", "0.5801435", "0.57717395", "0.57565117", "0.57544017", "0.5710903", "0.5710903", "0.56141084", "0.56066...
0.0
-1
SOLO PERMITE NUMEROS, lETRAS Y ESPACIOS
function soloNumerosLetrasYEspacios(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras=" .,-_*/aábcdeéfghiíjklmnñoópqrstuúvwxyz0123456789"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arreglar(numero){\n var numeroo=\"\";\n numero=\"\"+numero;\n partes=numero.split(separadorDecimalesInicial);\n entero=partes[0];\n if(partes.length>1)\n {\n decimal=partes[1];\n }\n cifras=entero.length;\n cifras2=cifras\n for(a=0;a<cifras;a++){\n cifras2-=1;\n ...
[ "0.6941278", "0.69173896", "0.6682775", "0.6546764", "0.64804053", "0.64278364", "0.64190567", "0.6409729", "0.63893515", "0.6347284", "0.63382107", "0.63155377", "0.6299086", "0.62860584", "0.62399644", "0.61815965", "0.6119917", "0.611513", "0.60884166", "0.6086822", "0.606...
0.0
-1
SOLO PERMITE NUMEROS, lETRAS Y ESPACIOS
function contrasenas(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras=".-~^_/\|abcdefghijklmnoñpqrstuvwxyz0123456789()[]{}*+<>"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arreglar(numero){\n var numeroo=\"\";\n numero=\"\"+numero;\n partes=numero.split(separadorDecimalesInicial);\n entero=partes[0];\n if(partes.length>1)\n {\n decimal=partes[1];\n }\n cifras=entero.length;\n cifras2=cifras\n for(a=0;a<cifras;a++){\n cifras2-=1;\n ...
[ "0.6941278", "0.69173896", "0.6682775", "0.6546764", "0.64804053", "0.64278364", "0.64190567", "0.6409729", "0.63893515", "0.6347284", "0.63382107", "0.63155377", "0.6299086", "0.62860584", "0.62399644", "0.61815965", "0.6119917", "0.611513", "0.60884166", "0.6086822", "0.606...
0.0
-1
Method for adding a track to the playlist on the right / below
addTrack(track) { let tracks = this.state.playlistTracks; // Don't let users add a song more than once. if (!tracks.includes(track)) { tracks.push(track); this.setState({playlistTracks: tracks}); } else { console.log('Duplicate. Track not added.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTrack(track) {\n\t\tconst addingTrack = (track) => this.setState({playlistTracks: [...this.state.playlistTracks, track]});\n\t\taddingTrack(track);\n\t\tthis.removeTrack(track, false);\n\t}", "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePl...
[ "0.74449885", "0.72289485", "0.7224767", "0.7193722", "0.71851355", "0.7162063", "0.71615535", "0.7152372", "0.7052449", "0.7032878", "0.7029627", "0.69909394", "0.69847685", "0.69845486", "0.6900456", "0.6865774", "0.68341404", "0.68079543", "0.67920667", "0.67663676", "0.67...
0.63476396
46
Method for removing a track.
removeTrack(track) { // Remove the track instance from the playlistTracks array by filtering the ID. let trackList = this.state.playlistTracks.filter(playlistTrack => { return playlistTrack.id !== track.id; }) this.setState({playlistTracks: trackList}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeTrack() {\n\t\tthis.props.onRemove(this.props.track, true);\n\t}", "removeTrack() {\n this.props.onRemove(this.props.track);\n }", "removeTrack() {\n this.props.onRemove(this.props.track);\n }", "removeTrackId(id){\r\n const index = this.getTracks().findIndex((track) => track.id === id...
[ "0.78392756", "0.7643007", "0.74788874", "0.72723264", "0.7204533", "0.7147144", "0.70424175", "0.70037615", "0.6995839", "0.6778167", "0.6740914", "0.6702746", "0.66788083", "0.66759473", "0.66730416", "0.66646606", "0.66269594", "0.6589125", "0.65661496", "0.6537951", "0.65...
0.6659781
16
Method for setting the playlist name
updatePlaylistName(name) { this.setState({playlistName: name}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "updatePlaylistName(name) {\n\t\tthis.setState({playlistName: name});\n\t}", "function setPlayl...
[ "0.77863026", "0.7558173", "0.7423637", "0.71672237", "0.71672237", "0.7146054", "0.6977724", "0.6953739", "0.6706719", "0.6686497", "0.66017616", "0.6514253", "0.649085", "0.6451153", "0.644364", "0.64109504", "0.63495296", "0.6328236", "0.6325498", "0.62932813", "0.62670344...
0.707359
6
Method for searching the spotify library. See util/Spotify.js
search(term) { // search is Promise based (thenable), set the state when the Promise is fulfilled Spotify.search(term).then(results => { this.setState({searchResults: results}); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchSpotify (input) {\n // If nothing is searched, The Sign will be used\n if (input == \"\") {\n input = \"The Sign Ace of Base\"\n };\n // Searching Spotify for track information\n spotify.search({type: \"track\", query: input}, function(error, data) {\n if (error) {\n ...
[ "0.7590375", "0.7489351", "0.74626887", "0.741358", "0.73905444", "0.72338945", "0.7231475", "0.7206957", "0.7177629", "0.7127097", "0.7125345", "0.70811284", "0.70621544", "0.7041589", "0.7036563", "0.7027181", "0.7010469", "0.70030034", "0.6990089", "0.6984239", "0.69663167...
0.0
-1
Method for saving the playlist to spotify. See util/Spotify.js
savePlaylist() { // Get a list of track URIs provided by Spotify, these are needed for defining the playlist let tracks = this.state.playlistTracks.map(track => track.uri); // savePlaylist is Promise based. Once the playlist is saved, reset the application state. Spotify.savePlaylist(this.state.playlistName, tracks).then(() => { //Reset the state when done saving. this.setState({ searchResults: [], playlistTracks: [] }) // Set the playlist name to empty. document.getElementsByClassName("Playlist-name")[0].value = 'New Playlist'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "savePlaylist() {\n\t\tlet trackURIs = [];\n\t\tfor(let i = 0; i < this.state.playlistTracks.length; i++) {\n\t\t\ttrackURIs.push(this.state.playlistTracks[i].uri);\n\t\t}\n\t\tSpotify.savePlaylist(this.state.playlistName, trackURIs);\n\t\tthis.setState({playlistName: 'New Playlist', playlistTracks: []});\n\t}", ...
[ "0.81201774", "0.74345654", "0.7272796", "0.72552574", "0.7216011", "0.7179581", "0.6931424", "0.6923377", "0.6922792", "0.6836265", "0.68291163", "0.67468446", "0.66890347", "0.66640407", "0.66563326", "0.6606905", "0.65823245", "0.652154", "0.64808947", "0.6383788", "0.6337...
0.73485094
2
Jaden Smith Case Make a `jadenCase` function that takes a string as parameter and return the string with each words capitilized. Example : "How are you ?" > "How Are You ?"
function jadenCase(stringToUp){ let recupTable =[]; recupTable = stringToUp.split(' '); for(let i = 0; i< recupTable.length; i++){ recupTable[i] = recupTable[i].charAt(0).toUpperCase() + recupTable[i].slice(1); } return recupTable.join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jadenCase(s) {\n let arr = s.toLowerCase().split(' ');\n\n for (let i = 0; i < arr.length; i++) {\n let word = arr[i].split(\"\");\n word[0] = word[0].toUpperCase();\n arr[i] = word.join(\"\");\n }\n return arr.join(\" \");\n}", "function jadenCase(string) {\n let array...
[ "0.76919526", "0.75028086", "0.7464632", "0.7378544", "0.73091507", "0.72941816", "0.71504396", "0.71504396", "0.7107428", "0.7106955", "0.7092398", "0.70483035", "0.70457613", "0.7027449", "0.70124775", "0.69962806", "0.69912964", "0.6988485", "0.6967147", "0.69617444", "0.6...
0.7361831
4
Add all cities to the list console.log(CITIES[0]);
function appendCity(city, resultDate, result, resultShorthand) { let cityHTML = ` <tr class="${result === 'Clear' ? 'positive' : 'negative'}"> <td> ${resultShorthand ? `<img src="https://www.metaweather.com/static/img/weather/${resultShorthand}.svg" class="ui mini centered image">` : '' } </td> <td data-label="City">${city.name}</td> <td data-label="City ID">${city.cityId}</td> <td data-label="Weather State" class="result">${result === 'Clear' ? 'Sunny' : result}</td> <td data-label="Weather Date">${resultDate}</td> </tr> `; // Update progress $('#load-status').text(`Loading ${city.cityIndex+1}/${city.total}`) if (city.cityIndex >= city.total-2) { $('#load-status').text('') } // Add the city result $('#city-list').append(cityHTML); // sort the table sortTable(3, 'text'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCitiesList() {\n var self = this\n var cities = indianCitiesDatabase.cities\n self.json(cities)\n}", "function getCities(){\n //if there are items in a stored 'cities' key, grab them and push to cities arr\n if (localStorage.getItem(\"cities\")) {\n const savedCities = JSON.parse(localS...
[ "0.7094029", "0.6942377", "0.66305536", "0.6439533", "0.6439533", "0.63984233", "0.6382852", "0.63291824", "0.6323746", "0.6309452", "0.6309452", "0.6309452", "0.6309452", "0.627969", "0.62707734", "0.62682", "0.6246773", "0.62356347", "0.62152857", "0.6206136", "0.613385", ...
0.0
-1
from cities.js // Sort Table
function sortTable(column, type) { //Sort the table $('.table tbody tr').sort(function(a, b) { // a and b are the 2 parameters being compared. // Since you are sorting rows, a and b are <tr> //Find the <td> using the column number and get the text value. //Now, the a and b are the text of the <td> a = $(a).find('td:eq(' + column + ')').text(); b = $(b).find('td:eq(' + column + ')').text(); switch (type) { case 'text': //Proper way to compare text in js is using localeCompare //If order is ascending you can - a.localeCompare(b) //If order is descending you can - b.localeCompare(a); return b.localeCompare(a); break; case 'number': //You can use deduct to compare if number. //If order is ascending you can -> a - b. //Which means if a is bigger. It will return a positive number. b will be positioned first //If b is bigger, it will return a negative number. a will be positioned first return b - a; break; } }).appendTo('.table tbody'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortCountry(n) {\n var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;\n table = document.querySelector(\".tbl-list\");\n switching = true;\n dir = \"asc\"; \n while (switching) {\n switching = false;\n rows = table.rows;\n for (i = 1; i < (rows.length - 1); i++) {\n ...
[ "0.66447794", "0.66079265", "0.65423095", "0.65228385", "0.6452466", "0.64207315", "0.63531286", "0.6342895", "0.6316144", "0.6256683", "0.62367994", "0.6231205", "0.62276167", "0.6062672", "0.60544074", "0.60519296", "0.6036094", "0.60267305", "0.59951866", "0.59783036", "0....
0.0
-1
Decamelizes a string with/without a custom separator (hyphen by default). from:
function decamelize(str, separator = '-') { return str .replace(/([a-z\d])([A-Z])/g, '$1' + separator + '$2') .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + separator + '$2') .toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _dasherize(str){return _decamelize(str).replace(/[ _]/g, '-')}", "function unhyphenate(str){\n\t str = toString(str);\n\t return str.replace(/(\\w)(-)(\\w)/g, '$1 $3');\n\t }", "function toHyphenDelimited (string) {\n return string.replace(/([a-z][A-Z])/g, function (g) {\n return ...
[ "0.7354994", "0.68960834", "0.65580666", "0.65105164", "0.65105164", "0.6434672", "0.63976294", "0.63621306", "0.63453674", "0.63419646", "0.6294325", "0.6270401", "0.62457764", "0.6242554", "0.6231834", "0.6231834", "0.6231834", "0.6231834", "0.6231834", "0.6231834", "0.6225...
0.7090734
1
remember me filesystem error callback
function errorCB(error) { console.log('An error occurred during media capture'); console.log('An error occurred during media capture: ' + error.code); var msg = 'An error occurred during media capture: ' + error.code; // Display notification if this is a real error and user did not just exit without recordihng anything if ( error.code != 3 ) { navigator.notification.alert(msg, null, 'Capture error'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onError(e) {\n console.log(`Filer filesystem error: ${e}`);\n }", "function onFileSystemFail(err) {\n console.log('deleteFileFromPersistentStorage file system fail: ' + fileName);\n console.log('error code = ' + err.code);\n }", "function onFileSystemFail(error) {\n co...
[ "0.72554994", "0.7226927", "0.66934705", "0.6610243", "0.65259564", "0.6524504", "0.6513491", "0.6513491", "0.6494794", "0.6473751", "0.63636255", "0.6363519", "0.63607943", "0.63425595", "0.6320642", "0.6320642", "0.6320642", "0.6320471", "0.62975293", "0.6293553", "0.625891...
0.0
-1
file copy error callback
function onFileSystemFail(error) { console.log('moveFileToPersistentStorage file system fail code ' + error.code); var msg = 'An error occurred during file copy: ' + error.code; navigator.notification.alert(msg, null, 'File copy error in moveFileToPersistentStorage()'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCopyError(err, fileId, file){\n console.error(`ufs: cannot copy file \"${ fileId }\" (${ err.message })`);\n }", "function postProcess(fullPath, err, callback) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log(fullPath + \" :: \" + err);\r\n\t\t\tstats.notCopied++;\r\n\t\t} else {\r\n\t\t\tstats.copied++;\r\n\t\t}\...
[ "0.8021209", "0.69921285", "0.6665508", "0.65991473", "0.648742", "0.6280451", "0.62238395", "0.62135863", "0.61942846", "0.6138471", "0.59483486", "0.59406954", "0.59406954", "0.59406954", "0.59281695", "0.59281695", "0.5923248", "0.5918593", "0.5889227", "0.58815074", "0.58...
0.6478855
5
show image as icon on button
function showImageOnButton(uri) { //me.getAddImageButtonRef().setHtml('<div class="addPhotoButtonHolder"><img src="' + uri + '" class="addPhotoButtonImage"/></div>'); me.getAddImageButtonRef().setHtml('<div class="addPhotoButtonHolder" style="background:url(' + uri + '); background-size:cover; background-repeat:no-repeat; background-position:center;">&nbsp;</div>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function penguinIcon() {\n iconType = image[0];\n $('#status').html(\"Selected place icon is \"+'<img src=\"'+iconType+'\">');\n}", "function displayIcon(id, imgSrc){\n var elem = document.getElementById(id);\n if (elem) \n elem.src = imgSrc;\n }", "function createButton(icon)...
[ "0.703531", "0.6779759", "0.6743075", "0.6592491", "0.6543792", "0.65394133", "0.6497033", "0.64916337", "0.6489585", "0.6455797", "0.641277", "0.62939835", "0.62808466", "0.62791866", "0.62377536", "0.62253857", "0.6222732", "0.6217703", "0.62109554", "0.6205579", "0.6176818...
0.7310389
0
copy photo from gallery to tfs (for iOS)
function copyPhoto(fileEntry) { window.resolveLocalFileSystemURL( Sencha.app.getImagesFolder(), function(fspDestDir) { fileEntry.copyTo( fspDestDir, null, setImageURL, function (err) { console.log('fail'); console.log('error code: ' + err.code); } ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseFromGallery(){\n navigator.camera.getPicture(videoTakenFromGallerySuccess,videoTakenFromGalleryFailed,{ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,\n mediaType:navigator.camera.MediaType.ALLMEDIA,allowEdit:true,\n });\n}", "...
[ "0.561532", "0.55945224", "0.5586316", "0.544252", "0.53647995", "0.53227454", "0.5286344", "0.52729326", "0.52709943", "0.52616906", "0.52192575", "0.51363444", "0.51013196", "0.5085947", "0.50716823", "0.5056637", "0.5042237", "0.50379175", "0.503484", "0.50297225", "0.5026...
0.64179885
0
file copy error callback
function onFileSystemFail(err) { console.log('deleteFileFromPersistentStorage file system fail: ' + fileName); console.log('error code = ' + err.code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCopyError(err, fileId, file){\n console.error(`ufs: cannot copy file \"${ fileId }\" (${ err.message })`);\n }", "function postProcess(fullPath, err, callback) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log(fullPath + \" :: \" + err);\r\n\t\t\tstats.notCopied++;\r\n\t\t} else {\r\n\t\t\tstats.copied++;\r\n\t\t}\...
[ "0.8021209", "0.69921285", "0.6665508", "0.65991473", "0.648742", "0.6478855", "0.6280451", "0.62238395", "0.62135863", "0.61942846", "0.6138471", "0.59483486", "0.59406954", "0.59406954", "0.59406954", "0.59281695", "0.59281695", "0.5923248", "0.5918593", "0.5889227", "0.588...
0.5724476
27
Valid if it exists, and is not an autoadded Storybook element i.e. It is not dependent on Storybook's Preview implementation, so it'll work in JSDom (Jest)
function isValidTargetElement(targetElement) { return (0, _typeGuards.isNotNil)(targetElement) && targetElement !== _storybook.A11yElement.Root && targetElement !== _storybook.A11yElement.Component; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_assertElementExists(matchElement, element) {\n const elName = element.name.replace(/^:xhtml:/, '');\n if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n let errorMsg = `'${elName}' is not a known element:\\n`;\n errorMsg += `1. If '${elName}' is a...
[ "0.61298835", "0.61298835", "0.61205226", "0.61205226", "0.60724515", "0.5960004", "0.5713902", "0.57050514", "0.5687601", "0.56861067", "0.567351", "0.5665304", "0.5644558", "0.5642582", "0.5637174", "0.55661213", "0.5520047", "0.5512397", "0.5487254", "0.5466414", "0.546066...
0.63711554
0
endregion Generates Jest a11y tests for all stories in a module Note: `colorcontrast` rule is NOT checked, and it is not likely to be fixed soon. Verify it is/isn't checked with a `console.log(results)` below
async function generateA11yStoryTests(storyModule) { var _storyModule$default$, _storyModule$default$2; const storiesTargetElement = (_storyModule$default$ = storyModule.default.parameters) === null || _storyModule$default$ === void 0 ? void 0 : (_storyModule$default$2 = _storyModule$default$.a11y) === null || _storyModule$default$2 === void 0 ? void 0 : _storyModule$default$2.element; Object.entries(storyModule).filter(isA11yStoryEntry).forEach(([storyName, story]) => { it(`${storyName} story is accessible`, async () => { var _story$parameters$a, _story$parameters, _story$parameters$a2, _baseElement$querySel; const targetElement = (_story$parameters$a = (_story$parameters = story.parameters) === null || _story$parameters === void 0 ? void 0 : (_story$parameters$a2 = _story$parameters.a11y) === null || _story$parameters$a2 === void 0 ? void 0 : _story$parameters$a2.element) !== null && _story$parameters$a !== void 0 ? _story$parameters$a : storiesTargetElement; const { baseElement, container } = (0, _render.renderStory)(story); const results = isValidTargetElement(targetElement) ? await axe((_baseElement$querySel = baseElement.querySelector(targetElement)) !== null && _baseElement$querySel !== void 0 ? _baseElement$querySel : baseElement) : await axe(container); expect(results).toHaveNoViolations(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportT...
[ "0.57294434", "0.5580079", "0.5499903", "0.543109", "0.53744584", "0.53662854", "0.5349277", "0.5311394", "0.5297236", "0.5289699", "0.5285793", "0.5285352", "0.5285352", "0.5285352", "0.5278204", "0.5275723", "0.52538955", "0.52538955", "0.51994085", "0.51746184", "0.5172395...
0.66634655
0
Public Functions / changeTagValueType update data when tag value type change
function changeTagValueType() { // Update the model value type vm.tagModel.valType = vm.tagValueTypeDropdown.selectedTagValueType.value; if (vm.tagModel.valType === 'P') { // Trigger a blur to update the input formatting $timeout(function() { $('#tag-percent-input').blur(); }, 0); } else { // Trigger a blur to update the input formatting $timeout(function() { $('#tag-currency-input').blur(); }, 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTagValue() {\n\n\t\tif (!isUpdateValid()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Start processing animation\n\t\tvm.tagModel.processing = true;\n\n\t\t// Allow the animation to complete before closing\n\t\t$timeout(function() {\n\n\t\t\t// Update the tag values by reference\n\t\t\tvm.initTagData.valType ...
[ "0.6505273", "0.6376833", "0.6187452", "0.6109588", "0.6109588", "0.6109588", "0.6109588", "0.6048532", "0.5974636", "0.59192455", "0.5913044", "0.58147687", "0.5695044", "0.5641808", "0.56093323", "0.5592057", "0.558667", "0.55201674", "0.5517151", "0.55169946", "0.5466293",...
0.7618515
0
isUpdateValid is the tag value form valid?
function isUpdateValid() { var modelNum, maxNum; if (vm.tagModel.valType === 'P') { modelNum = Number(vm.percentSlider.model); maxNum = 100; } else { modelNum = Number(vm.currencySlider.model); maxNum = Number(vm.currencySlider.options.max); } return modelNum > 0 && modelNum <= maxNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _formUpdateValid(){\n \tif ($scope.updateuser.$valid){\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t\t}\n }", "check_update(value) { return (this.value != value); }", "validateBeforeUpdate (id, newData, prevData) { return true }", "function isObsFormValid(){\t \n va...
[ "0.6944741", "0.63028544", "0.6260635", "0.6087864", "0.6078639", "0.6070235", "0.60670257", "0.58582544", "0.58548623", "0.57840073", "0.57627743", "0.5752816", "0.57387906", "0.571443", "0.56738544", "0.5644522", "0.5641344", "0.56112695", "0.55955", "0.5535345", "0.5534027...
0.7146377
0
updateTagValue update the value of the tag
function updateTagValue() { if (!isUpdateValid()) { return; } // Start processing animation vm.tagModel.processing = true; // Allow the animation to complete before closing $timeout(function() { // Update the tag values by reference vm.initTagData.valType = vm.tagModel.valType; vm.initTagData.valAmount = vm.tagModel.valType === 'P' ? vm.percentSlider.model : vm.currencySlider.model; $scope.close(); }, 250); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "updateValueByDOMTags(){\n this.value.length = 0;\n\n [].forEach.call(this.getTagElms(), node => {\n if( node.classList.contains(this.settings.classNames.tagNotAllowed.split(' ')[0]) ) return\n ...
[ "0.6492815", "0.6492815", "0.6492815", "0.6492815", "0.6103223", "0.6081969", "0.596684", "0.596684", "0.596684", "0.59585774", "0.5846785", "0.5839426", "0.5806268", "0.5747082", "0.57427496", "0.5638813", "0.5456899", "0.54544014", "0.5444481", "0.54350126", "0.54139423", ...
0.7507505
0
Private Functions / percentSliderStop when the slider stops, blur the input to get the proper formatting
function percentSliderStop() { $('#tag-percent-input').blur(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }", "onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }", "_blur(event) {\n // Depending on support for input[type=range],\n // the event.target could be either the handle or its child input.\n // Use closes...
[ "0.7218121", "0.7218121", "0.6938819", "0.6700834", "0.6666914", "0.6539147", "0.6391279", "0.6296303", "0.6296303", "0.62397665", "0.62397665", "0.6190092", "0.6147399", "0.61416197", "0.6138224", "0.6138224", "0.61041045", "0.6077673", "0.6045355", "0.6036651", "0.6036568",...
0.8401178
0
currencySliderStop when the slider stops, blur the input to get the proper formatting
function currencySliderStop() { $('#tag-currency-input').blur(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function percentSliderStop() {\n\n\t\t$('#tag-percent-input').blur();\n\t}", "registerConvert() {\n\t\tlet fields = this.container.find('.js-currencyc_value');\n\t\tfields.on('keyup focusout', (e) => {\n\t\t\tlet value = App.Fields.Double.formatToDb(e.currentTarget.value);\n\t\t\tlet currentCurrencyData = $(e.cu...
[ "0.7104866", "0.63198334", "0.63052547", "0.63052547", "0.6225074", "0.61850816", "0.6126309", "0.60301", "0.5933545", "0.57518923", "0.56433153", "0.56074816", "0.56014985", "0.56014985", "0.5597195", "0.55478835", "0.5537766", "0.5528481", "0.5506492", "0.54987305", "0.5498...
0.87058455
0
This class defines a complete generic visitor for a parse tree produced by PythonLikeParser.
function PythonLikeVisitor() { antlr4.tree.ParseTreeVisitor.call(this); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitNode(node) { }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\...
[ "0.65919274", "0.60482764", "0.60482764", "0.5950813", "0.58122927", "0.58122927", "0.58122927", "0.577187", "0.5699212", "0.56250006", "0.56055236", "0.55747366", "0.55630654", "0.5482851", "0.5422624", "0.5421316", "0.5384845", "0.53826153", "0.538102", "0.5351745", "0.5320...
0.7582853
0
use for get current file info used by file_on_mouse_down, open_new_dir.
function get_cur_file_info_by_id(id){ file_to_operate_id = id; element_to_operate = document.getElementById(id); switch(cur_dir_path){ case 'root': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).type; break; case 'root/Pictures': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).filename; break; case 'root/Contacts': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name; break; case 'root/Videos': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name; break; } //element_to_operate.innerHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_current_code_path(){\n\tvar id = $(\"#file_name_nav\").find(\"span.selected\").attr(\"id\");\n\tid = id.replace(\"t_\", \"\");\n\treturn full_path($(\"#\"+id));\n}", "get info() {\n return this.project.getFileInfo(this.path)\n }", "function showFileInfo(file){\n console.log(\"name : \" ...
[ "0.64498436", "0.6211815", "0.5877517", "0.58511686", "0.58344495", "0.5813102", "0.5813102", "0.56974804", "0.56627387", "0.5660691", "0.55960137", "0.55346304", "0.55316913", "0.5522157", "0.54973036", "0.5495355", "0.5493738", "0.54894185", "0.5487194", "0.5457002", "0.539...
0.6290701
1
for event: 1. mouse move 2. long press 3. right click
function file_on_mouse_down(event){ get_cur_file_info_by_id(this.id); //console.log('event.button' + event.button); // if(2 == event.button){ // return false; // }else{ // close_rmenu(); // } // guess function state. var func_state = -1; var state_mouse_move = 0; var state_left_click = 1; var state_left_long_press = 2; var state_right_click = 3; switch(event.button) { case 0: func_state = state_left_click; break; case 2: func_state = state_right_click; //popup_rmenu(event); //return false; break; } elementToDrag = this; // The initial mouse position, converted to document coordinates var scroll = getScrollOffsets(); // A utility function from elsewhere var startX = event.clientX + scroll.x; var startY = event.clientY + scroll.y; // The original position (in document coordinates) of the element // that is going to be dragged. Since elementToDrag is absolutely // positioned, we assume that its offsetParent is the document body. var origX = elementToDrag.offsetLeft; var origY = elementToDrag.offsetTop; // Compute the distance between the mouse down event and the upper-left // corner of the element. We'll maintain this distance as the mouse moves. var deltaX = startX - origX; var deltaY = startY - origY; //console.log('in (file on mouse down) event:' + event); //console.log('start: %s - %s', startX, startY); //console.log('origin: %s - %s', origX, origY); //console.log('delta: %s - %s', deltaX, deltaY); // start time count var time_cnt = 0; timer = setInterval(function() { time_cnt += 10; if (time_cnt >= 250) { clearInterval(timer); popup_rmenu(event); func_state = state_left_long_press; //alert('time out'); } }, 10) // Register the event handlers that will respond to the mousemove events // and the mouseup event that follow this mousedown event. if (document.addEventListener) { // Standard event model // Register capturing event handlers on the document document.addEventListener("mousemove", moveHandler, true); document.addEventListener("mouseup", upHandler, true); } else if (document.attachEvent) { // IE Event Model for IE5-8 // In the IE event model, we capture events by calling // setCapture() on the element to capture them. elementToDrag.setCapture(); elementToDrag.attachEvent("onmousemove", moveHandler); elementToDrag.attachEvent("onmouseup", upHandler); // Treat loss of mouse capture as a mouseup event. elementToDrag.attachEvent("onlosecapture", upHandler); } // We've handled this event. Don't let anybody else see it. if (event.stopPropagation) event.stopPropagation(); // Standard model else event.cancelBubble = true; // IE // Now prevent any default action. if (event.preventDefault) event.preventDefault(); // Standard model else event.returnValue = false; // IE function out_of_content_row(left, top){ var right = left + file_width; var bottom = top + file_height; var out_of_range = false; if((right < content_row_left) || (left > content_row_right) || (top > content_row_bottom) || (bottom < content_row_top)){ out_of_range = true; } return out_of_range; } /** * This is the handler that captures mousemove events when an element * is being dragged. It is responsible for moving the element. **/ function moveHandler(e) { func_state = state_mouse_move; if (!e) e = window.event; // IE event Model // Move the element to the current mouse position, adjusted by the // position of the scrollbars and the offset of the initial click. var scroll = getScrollOffsets(); var left = (e.clientX + scroll.x - deltaX); var top = (e.clientY + scroll.y - deltaY); elementToDrag.style.left = left + "px"; elementToDrag.style.top = top + "px"; console.log('in moveHandler: %d - %d', left, top); //console.log('element position: %s - %s', elementToDrag.style.left, elementToDrag.style.top); if(out_of_content_row(left, top)){ //left = origX; //top = origY; delete_file(); upHandler(e); } // And don't let anyone else see this event. if (e.stopPropagation) e.stopPropagation(); // Standard else e.cancelBubble = true; // IE clearInterval(timer); } /** * This is the handler that captures the final mouseup event that * occurs at the end of a drag. **/ function upHandler(e) { if (!e) e = window.event; // IE Event Model // Unregister the capturing event handlers. if (document.removeEventListener) { // DOM event model document.removeEventListener("mouseup", upHandler, true); document.removeEventListener("mousemove", moveHandler, true); } else if (document.detachEvent) { // IE 5+ Event Model elementToDrag.detachEvent("onlosecapture", upHandler); elementToDrag.detachEvent("onmouseup", upHandler); elementToDrag.detachEvent("onmousemove", moveHandler); elementToDrag.releaseCapture(); } // And don't let the event propagate any further. if (e.stopPropagation) e.stopPropagation(); // Standard model else e.cancelBubble = true; // IE // clearInterval(timer); // refresh_content(); switch(func_state) { case state_left_click: clearInterval(timer); open_new_dir(); break; case state_right_click: case state_left_long_press: clearInterval(timer); refresh_content(); break; case state_mouse_move: clearInterval(timer); refresh_content(); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onMouseDown(e) {\n\t\t var cm = this, display = cm.display;\n\t\t if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n\t\t display.input.ensurePolled();\n\t\t display.shift = e.shiftKey;\n\n\t\t if (eventInWidget(display, e)) {\n\t\t if (!webk...
[ "0.7261054", "0.7226753", "0.722626", "0.722626", "0.71976715", "0.71976715", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "...
0.0
-1
This is the handler that captures mousemove events when an element is being dragged. It is responsible for moving the element.
function moveHandler(e) { func_state = state_mouse_move; if (!e) e = window.event; // IE event Model // Move the element to the current mouse position, adjusted by the // position of the scrollbars and the offset of the initial click. var scroll = getScrollOffsets(); var left = (e.clientX + scroll.x - deltaX); var top = (e.clientY + scroll.y - deltaY); elementToDrag.style.left = left + "px"; elementToDrag.style.top = top + "px"; console.log('in moveHandler: %d - %d', left, top); //console.log('element position: %s - %s', elementToDrag.style.left, elementToDrag.style.top); if(out_of_content_row(left, top)){ //left = origX; //top = origY; delete_file(); upHandler(e); } // And don't let anyone else see this event. if (e.stopPropagation) e.stopPropagation(); // Standard else e.cancelBubble = true; // IE clearInterval(timer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveHandler(e) {\n if (!e) e = window.event; // IE event Model\n\n // Move the element to the current mouse position, adjusted by the\n // position of the scrollbars and the offset of the initial click.\n var scroll = lion.getScrollOffsets();\n elementToDrag.style.left ...
[ "0.7829178", "0.75963956", "0.75963956", "0.75552905", "0.75467914", "0.74622387", "0.7408157", "0.7294221", "0.72456145", "0.7178884", "0.71744835", "0.70877546", "0.70258254", "0.7008248", "0.6947241", "0.687514", "0.6863924", "0.6841702", "0.6828741", "0.6769443", "0.67639...
0.7636558
1
This is the handler that captures the final mouseup event that occurs at the end of a drag.
function upHandler(e) { if (!e) e = window.event; // IE Event Model // Unregister the capturing event handlers. if (document.removeEventListener) { // DOM event model document.removeEventListener("mouseup", upHandler, true); document.removeEventListener("mousemove", moveHandler, true); } else if (document.detachEvent) { // IE 5+ Event Model elementToDrag.detachEvent("onlosecapture", upHandler); elementToDrag.detachEvent("onmouseup", upHandler); elementToDrag.detachEvent("onmousemove", moveHandler); elementToDrag.releaseCapture(); } // And don't let the event propagate any further. if (e.stopPropagation) e.stopPropagation(); // Standard model else e.cancelBubble = true; // IE // clearInterval(timer); // refresh_content(); switch(func_state) { case state_left_click: clearInterval(timer); open_new_dir(); break; case state_right_click: case state_left_long_press: clearInterval(timer); refresh_content(); break; case state_mouse_move: clearInterval(timer); refresh_content(); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseUp(e) {\n removeMoveListener();\n removeUpListener();\n _callbacks.end.forEach(function(callback) {\n callback.call();\n });\n }", "onMouseUp(e) {\n // we have finished dragging\n this.isMouseDown = false;\n\n // remove specific styles\n thi...
[ "0.7608333", "0.7530356", "0.73980874", "0.73980874", "0.7257201", "0.725184", "0.7097712", "0.70804566", "0.6971638", "0.6957199", "0.6954656", "0.69436604", "0.6917587", "0.6896842", "0.6880018", "0.6880018", "0.6866899", "0.6849868", "0.6834869", "0.68327224", "0.6828433",...
0.6913578
13
notice: difference between refresh_content_by_path and refresh_content 1. path is not provided, content_json should comment; 2. path_str is replaced by cur_dir_path;
function refresh_content(){ var content_ele = document.getElementById("id_content"); var content_width = content_ele.clientWidth; //content_json = file_arch_json[path_str]; if(content_json == null){ return null; } //console.log("in function refresh element element:" + file_arch_json); //console.log("in function refresh element element:" + path_str + "\n" + JSON.stringify(content_json)); var content_row = document.getElementById("id_content_row"); if(content_row != null){ content_ele.removeChild(content_row); } content_row = document.createElement("div"); content_row.id = "id_content_row"; content_row.className = "style_content_row"; var file; for(var i=0;i<content_json.length;i++){ file = create_div_by_path(cur_dir_path, content_json[i]); content_row.appendChild(file); } content_ele.appendChild(content_row); function getValue(str){ return parseInt(str.substring(0, str.length-2)) } file_style = window.getComputedStyle(file); file_margin_right = getValue(file_style.marginLeft); file_extral_space = file_margin_right * 2 + getValue(file_style.borderLeftWidth) + getValue(file_style.borderRightWidth); file_width = getValue(file_style.width); file_height = getValue(file_style.height); file_offset_width = file_width + file_extral_space; file_offset_height = file_height + file_extral_space; content_row_style = window.getComputedStyle(content_row); //console.log('content_row_style:%r', content_row_style); content_row_width_extral = getValue(content_row_style.paddingLeft); var cols_per_row = parseInt( (content_width - content_row_width_extral) / file_offset_width ); content_row_width = cols_per_row * file_offset_width + content_row_width_extral; content_row_height = (parseInt(content_json.length/cols_per_row) + 1) * (file_offset_height) + content_row_width_extral; content_row.style.width = content_row_width + "px"; content_row.style.height = content_row_height + "px"; //notice: correct value get must after content_row_width is set. content_row_left = content_row.offsetLeft;//content_row_style.left; content_row_top = content_row.offsetTop;//content_row_style.top; content_row_right = content_row_left + content_row_width; content_row_bottom = content_row_top + content_row_height; var child = null; var row_cnt = 0; var col_cnt = 0; var pos_cnt = 0; for(child = content_row.firstElementChild; child != null; child = child.nextElementSibling, pos_cnt++){ row_cnt = parseInt(pos_cnt / cols_per_row); col_cnt = pos_cnt % cols_per_row; file_left = content_row_left + content_row_width_extral + file_margin_right + file_offset_width * col_cnt; file_top = content_row_top + content_row_width_extral + file_margin_right + file_offset_height * row_cnt; child.style.left = file_left + 'px'; child.style.top = file_top + 'px'; //console.log('child' + pos_cnt + ': ' + file_left + ' - ' + file_top); } return content_ele; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDirContent(path) {\n\t\tshowLoading();\n\t\tcontext_element = {};\n\t\tpath = HTMLDecode(path || cur_path);\n\t\tsendXMLHttpReq(req_url, {\n\t\t\tmode: 'POST',\n\t\t\tparameters: 'cmd=list&src=' + encodeURIComponent(path),\n\t\t\tonsuccess: function (req) {\n\t\t\t\tupdate(req.responseXML);\n\t\t\t\thi...
[ "0.6158273", "0.6051624", "0.563377", "0.56292254", "0.5614095", "0.55910856", "0.55402964", "0.5521351", "0.5485968", "0.54563063", "0.5317053", "0.5308717", "0.5299543", "0.5291411", "0.5266777", "0.526408", "0.52381295", "0.52331513", "0.5193688", "0.5185586", "0.51588213"...
0.55837774
6
Create a reducing function iterating left or right.
function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; } return function(obj, iteratee, memo, context) { iteratee = optimizeCb(iteratee, context, 4); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; // Determine the initial value if none is provided. if (arguments.length < 3) { memo = obj[keys ? keys[index] : index]; index += dir; } return iterator(obj, iteratee, memo, keys, index, length); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static *reduceRight$e(thiz, args, s) {\n\t\tlet l = yield * getLength(thiz);\n\t\tlet acc;\n\t\tlet fx = args[0];\n\n\t\tif ( args.length < 1 || !fx.isCallable ) {\n\t\t\treturn yield CompletionRecord.makeTypeError(s.realm, 'First argument to reduceRight must be a function.');\n\t\t}\n\n\t\tif ( args.length > 1 ) ...
[ "0.69307965", "0.68434834", "0.67686254", "0.62968653", "0.6292559", "0.62247425", "0.6172193", "0.6078777", "0.607583", "0.6016731", "0.60144776", "0.60141987", "0.5947723", "0.59183216", "0.59162104", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.58714...
0.0
-1
Optimized iterator function as using arguments.length in the main function will deoptimize the, see 1991.
function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestAssignmentToIterator2() {\n var i = 0;\n arguments.__defineGetter__('callee', function(){});\n arguments.__defineGetter__('length', function(){ return 1 });\n arguments[Symbol.iterator] = [].entries;\n for (var entry of arguments) {\n assertEquals([i, arguments[i]], entry);\n i++;\n }\n\n ...
[ "0.6528015", "0.60660607", "0.5998979", "0.59139353", "0.5854361", "0.58020836", "0.57688564", "0.57576233", "0.57464075", "0.574258", "0.57326597", "0.5720234", "0.570122", "0.56448364", "0.5634669", "0.5603158", "0.5603055", "0.56021297", "0.55884683", "0.5584208", "0.55814...
0.0
-1
Generator function to create the findIndex and findLastIndex functions
function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "location(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index) return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }", "function createIndexFinder(dir,predicateFind,sortedIndex){return function(array,item,idx){var i=0,length=getLength...
[ "0.6169708", "0.61012435", "0.60185516", "0.60123676", "0.60123676", "0.60076076", "0.59661746", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5907632", "0.58996195", "0.5897573", "0.58974653", "0.58974...
0.0
-1
Generator function to create the indexOf and lastIndexOf functions
function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; } } else if (sortedIndex && idx && length) { idx = sortedIndex(array, item); return array[idx] === item ? idx : -1; } if (item !== item) { idx = predicateFind(slice.call(array, i, length), _.isNaN); return idx >= 0 ? idx + i : -1; } for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { if (array[idx] === item) return idx; } return -1; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LastIndexOf() {\n\n }", "IndexOf() {\n\n }", "indexOf(val) {}", "function myIndexOf2(source, searchValue, startIdx=0) {\n for (let i = startIdx; i <= source.length - searchValue.length; i++) {\n let substring = source.slice(i, i + searchValue.length);\n \n if (substring === searchValue) {...
[ "0.6704978", "0.61552393", "0.60958135", "0.5932218", "0.5810419", "0.5789355", "0.5777259", "0.5732596", "0.56094474", "0.55971", "0.5525533", "0.55069697", "0.5505558", "0.5496774", "0.5481369", "0.5341538", "0.53364044", "0.53041726", "0.52636915", "0.5210988", "0.5210491"...
0.0
-1
Generated by PEG.js 0.8.0.
function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { super(new GeneratorParser(true)) }", "static definition() {\n return 'A tree is a perennial plant with an elongated stem, or trunk, supporting branches and leaves.'\n }", "function generate (p) {\n // Type\n if (typeof p === 'string' && node.type === null) {\n node.type = p.repla...
[ "0.61950994", "0.5627876", "0.56192935", "0.560038", "0.5565909", "0.5449063", "0.5415006", "0.5353297", "0.53442514", "0.53437316", "0.53218937", "0.52902955", "0.5279069", "0.5254386", "0.5252234", "0.52399904", "0.5229311", "0.52138877", "0.5208072", "0.5205691", "0.520526...
0.0
-1
Function For Add Link
function addHotLink(link){ var style = document.createElement('style'); var css = ".new_player #actions #hotlink {background-position: 3px -97px;}" + "\n"; style.textContent= css; var head = document.getElementsByTagName('head')[0]; head.appendChild(style); var a = document.createElement('a'); a.href = link; a.target = "_blank"; a.innerHTML = 'HotLink' a.className = 'radius_3'; a.id = 'hotlink'; var li = document.createElement('li'); li.appendChild(a); var ul_actions = document.getElementById('actions'); ul_actions.appendChild(li); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLink() {\n SC.RunLoop.begin();\n Nodelink.store.createRecord(Nodelink.Link, { guid: 'node2', startNode: 'node1', endNode: 'node2' } );\n SC.RunLoop.end();\n}", "function AddLink(thetype) {\n\tAddTag(\"[\" + thetype + \"]\", \"[/\" + thetype + \"]\", '');\n}", "function addLink (target, link) {\n...
[ "0.73390245", "0.7222045", "0.7190175", "0.7144045", "0.7133425", "0.71167755", "0.7107103", "0.69758093", "0.69573075", "0.6913089", "0.68788207", "0.68554854", "0.68406504", "0.6840541", "0.6838247", "0.6837062", "0.68068236", "0.6756413", "0.6743228", "0.674088", "0.672942...
0.64295596
45
This component is showing if the API is not responding on requests.
render() { return ( <Row className="show-grid"> <Col md={12}> <div className="header"> <h2> APIet svarer ikke </h2> </div> <div className="test row-info" style={{marginTop: '2em'}}> <p>APIet svarte dessverre ikke på forespørselen. Vennligst prøv å <a onClick={() => window.location.reload(true)}>oppdater siden.</a></p> <p>Hvis ikke det fungerte, vennligst gi beskjed til administrator.</p> <p>Er du en <b>utvikler</b>? Har du husket å starte APIet?</p> </div> </Col> </Row> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function errorMessagePullingDataFromAPI(){\n\t\t$errorLoadingAPI.text(\"Error pulling all the data from the API\");\n\t}", "handleAPIFailure(requestedLocation) {\n this.showingWeatherForRef.current.innerHTML = requestedLocation + \" was not found\";\n }", "function handleRequestError() {\n qs(\"ma...
[ "0.6657675", "0.65178144", "0.64637446", "0.63949186", "0.62572837", "0.62231547", "0.6139637", "0.61231196", "0.6115831", "0.6066946", "0.6059462", "0.6044216", "0.60037094", "0.6001247", "0.5971857", "0.59173656", "0.58732873", "0.58609915", "0.5851991", "0.5835516", "0.582...
0.0
-1
eslintdisable noempty / eslintdisable strict
function max(num) { if (num.length === 0){ return undefined; } else{ let max = num[0]; let i=0; while (i < num.length) { if (max < num[i]){ max = num[i]; } i++; } return max; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noop() { } // tslint:disable-line:no-empty", "function removeEmpty (noop) {\n return noop !== undefined\n}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty()...
[ "0.65947914", "0.63063747", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.61087763", "0.61087763",...
0.0
-1
Helper method to genearate fake events. Needed for some javascript heavy forms that won't work unles these events are triggered. Taken from passff
function createFakeEvent(typeArg) { if (['keydown', 'keyup', 'keypress'].includes(typeArg)) { return new KeyboardEvent(typeArg, { 'key': ' ', 'code': ' ', 'charCode': ' '.charCodeAt(0), 'keyCode': ' '.charCodeAt(0), 'which': ' '.charCodeAt(0), 'bubbles': true, 'composed': true, 'cancelable': true }); } else if (['input', 'change'].includes(typeArg)) { return new InputEvent(typeArg, { 'bubbles': true, 'composed': true, 'cancelable': true }); } else if (['focus', 'blur'].includes(typeArg)) { return new FocusEvent(typeArg, { 'bubbles': true, 'composed': true, 'cancelable': true }); } else { log.error("createFakeEvent: Unknown event type: " + typeArg); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fakeEvent(){\n const event = document.createEvent(\"HTMLEvents\")\n event.initEvent(\"change\",false,true)\n document.getElementById(\"choixTypeMedia\").dispatchEvent(event)\n}", "function fakeEvent(el, type) {\n var event;\n\n if (document.createEvent) {\n event = docu...
[ "0.6547445", "0.6182105", "0.59836423", "0.59764826", "0.5953555", "0.58859825", "0.58859825", "0.58859825", "0.58859825", "0.58624244", "0.58088124", "0.5769422", "0.5767997", "0.5732902", "0.5732902", "0.5732902", "0.5732902", "0.5732902", "0.54864055", "0.54685295", "0.546...
0.54062307
23
Helper method to copy the password to clipboard.
function copyToClipboard(txt) { const input = document.createElement('input'); input.style.position = 'fixed'; input.style.opacity = 0; input.value = txt; document.body.appendChild(input); input.select(); document.execCommand('copy'); document.body.removeChild(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyPassword() {\n passwordFinal.select();\n document.execCommand(\"Copy\");\n }", "function copy() {\n var copyText = password; // **** FIX ****\n copyText.select();\n document.execCommand(\"copy\");\n }", "function copyPassword() {\n let passwordText = document.querySelector(\"#passwo...
[ "0.84887815", "0.84697306", "0.8465393", "0.8461217", "0.8416384", "0.8352243", "0.83304685", "0.83140326", "0.82927716", "0.82902014", "0.826596", "0.8232225", "0.8223142", "0.8218113", "0.82166606", "0.8212652", "0.8157275", "0.8143088", "0.81380314", "0.8129", "0.8107624",...
0.671253
65
Heavy work function that finds login forms and fills them with the credentials.
function fillForm(path, user, pass) { copyToClipboard(pass); if(document.baseURI.includes("signin.aws.amazon.com")) { fillAwsLoginForm(path, user, pass); } else if(document.baseURI.includes("amazon")) { fillAmazonLoginForm(user, pass); } else if(document.baseURI.includes("idmsa.apple.com")) { fillAppleDeveloperForms(user, pass); } else { fillDefaultForm(user, pass); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories & custom logged in info\n $all...
[ "0.71068174", "0.70831144", "0.70727664", "0.705191", "0.6945985", "0.68821186", "0.68821186", "0.68735254", "0.68104607", "0.67728907", "0.65103406", "0.65035194", "0.64629877", "0.6454861", "0.6429596", "0.64158803", "0.6347176", "0.6327344", "0.63093513", "0.6286776", "0.6...
0.6300012
19
Proxy factory for class methods
function proxyFactory( col, method ) { return function() { // Save arguments var args = arguments; // Things that will be done: // - Wait for resolved collection instance // - Call the proxied method return col.then( function( colInstance ) { return method( colInstance, args ); } ); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Proxy(){}", "function Proxy(){}", "function ProxyClass(runtime, scope, instanceConstructor, baseClass) {\n function ProxyConstructor() {\n somewhatImplemented(\"Proxy\");\n }\n var c = new Class(\"Proxy\", ProxyConstructor, ApplicationDomain.coerceCallable(ProxyConstructor));\n c.extendBuiltin(...
[ "0.7071681", "0.7071681", "0.63713616", "0.63627934", "0.62179136", "0.61736554", "0.61304075", "0.6119467", "0.6095978", "0.6093134", "0.6093134", "0.60640657", "0.60640657", "0.60640657", "0.60633", "0.60633", "0.60593104", "0.60593104", "0.60407186", "0.60090125", "0.59890...
0.55544186
76
TODO: Think about sensible links
function getPersonen(req, res) { var person = { vorname: 'Elon', name: 'Musk', geburtsdatum: '1971-06-28', ermaessigung: 'halbtax' }; res.json(person); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get anchor() {}", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\t\t\n this._built = this._sbolDocument.lookupURI(this._built);\t\t\n }", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "function atLinks() {\n linkl...
[ "0.6098567", "0.60367835", "0.59262234", "0.59258676", "0.5920313", "0.5920313", "0.5904969", "0.57829535", "0.5705335", "0.5705112", "0.56949604", "0.56861275", "0.56860304", "0.5681934", "0.56725335", "0.5669609", "0.56680095", "0.5665643", "0.5645112", "0.5643068", "0.5637...
0.0
-1
Current blob size limit is around 500MB for browsers
function downloadResource(url, filename) { if (!filename) filename = url.split("\\").pop().split("/").pop(); fetch(url, { headers: new Headers({ Origin: location.origin, }), mode: "cors", }) .then((response) => response.blob()) .then((blob) => { let blobUrl = window.URL.createObjectURL(blob); forceDownload(blobUrl, filename); }) .catch((e) => console.error(e)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMaxMessageSize() {\r\n\treturn 700;\r\n}", "function getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}", "function getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}", "function gh_file_size(bytes) {\r\n if (bytes >= (1 << 20)) {\r\n var f = (bytes / (1 ...
[ "0.6489028", "0.6455937", "0.6455937", "0.59789675", "0.59687823", "0.5964286", "0.5948781", "0.5891616", "0.5877945", "0.5788265", "0.5784631", "0.5749555", "0.5734975", "0.56905955", "0.5679625", "0.56767523", "0.5663668", "0.56633586", "0.56625634", "0.56442404", "0.562081...
0.0
-1
check if a divisor exists for each number
function checkDivisor (j) { return i % j === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function es_divisor(dividendo, divisor) {\n return dividendo % divisor == 0\n}", "function diviserator(num) {\r\n var counter = 0;\r\n for (var i = 1; i < Math.sqrt(num); i++) {\r\n if (num % i === 0) {\r\n counter += 2;\r\n }\r\n }\r\n if (counter > 1000) {\r\n return true;\r\n }\r\n}", ...
[ "0.7635661", "0.7465979", "0.72767377", "0.7244849", "0.723067", "0.71670336", "0.7164065", "0.7159016", "0.7096347", "0.7023351", "0.7022092", "0.69836926", "0.69595975", "0.6951323", "0.6948818", "0.6930906", "0.69269496", "0.69004357", "0.6874983", "0.6869298", "0.6849694"...
0.71182585
8
return a serial number
serialNumber() { return `${this.getSNString()}${(this.increament++).toString().padStart(this.padCount, '0')}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSerialId() {\n if (!this.serialid) {\n let id = this.getId();\n if (id) {\n id = id.replace(/(.+?)\\/(.+?)\\/(.*)/, '$2');\n this.serialid = id.replace(/(.+)-(.+)/, '$2');\n }\n }\n return this.serialid;\n }", "function SerialNum()\n{\n var num = 1;\n}", "async func...
[ "0.76606715", "0.71967834", "0.7139077", "0.6988839", "0.66305053", "0.6586764", "0.6361851", "0.62254936", "0.6079622", "0.6056119", "0.6008889", "0.5999183", "0.594697", "0.58675075", "0.5865588", "0.5862116", "0.5846896", "0.5840436", "0.58371073", "0.5819352", "0.58148134...
0.846465
0
pushing an array to an array so I can get data loop through the array and place the data
function RedcomDatabaseTableConfigAdd() { var val; for (var i = 0; i < RedcomDatabaseTableConfigArr.length; i++) { val += "<tr>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][0]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][1]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][2]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][3]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][4]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][5]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][6]; val += "</td>"; val += "</tr>"; } return val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArr(arr, data) {\n arr.push(data);\n}", "addToArray(data){\n\t\tthis.userData.push(data);\n\t\tconsole.log(this.userData)\n\t}", "push(item){\n\n //Le indicamos a la data la longitud que estamos agregando ya que \n //Estamos creando un nuevo elemento por lo tanto nuestro array es mas largo\n ...
[ "0.70350814", "0.6666215", "0.6659681", "0.66447824", "0.66323644", "0.65076447", "0.6484907", "0.64477545", "0.64082146", "0.63930756", "0.63782895", "0.6371372", "0.6360576", "0.6322531", "0.63140213", "0.62929016", "0.6281351", "0.62523925", "0.62463075", "0.6218679", "0.6...
0.0
-1
> import as Util from './coba.js'; const Util = await import('./coba.js'); Util.DashAgentOnline();
function chekct() { const btn = document.querySelector("input[name=cek]:checked"); console.log(btn.getAttribute('data-reply')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function bajar() {\n await importar();\n inicializar();\n obtener();\n}", "import() {\n }", "async function run() {\n const land = require('./land_mark.js');\n // const data = await huy();\n // console.log(data); // will print your data\n // return data;\n return\n}", "async function s...
[ "0.6039556", "0.59561646", "0.5772149", "0.57351685", "0.5691303", "0.56279176", "0.5558858", "0.55173546", "0.54928666", "0.54893166", "0.5434012", "0.5426698", "0.53705776", "0.53503287", "0.53398967", "0.5312685", "0.53049105", "0.5304451", "0.52452546", "0.52430433", "0.5...
0.0
-1
'hello world' / FUNCTIONS Functions are a subtype of objects (like arrays) typeof called on a function returns function this means functions are a main type and can have properties, but these are rarely used
function foo(){ return 42; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functionName() { console.log('I am a function') }", "function MyFunction () {\n console.log('I am a simple function');\n console.log(typeof MyFunction);//function\n}", "function fun() {\n console.log('this is a function');\n}", "function fun() {\n console.log('this is a function');\n}", ...
[ "0.7015621", "0.6972105", "0.6746577", "0.6746577", "0.6746577", "0.6746577", "0.6746577", "0.66794217", "0.66137934", "0.66137934", "0.65807974", "0.65807974", "0.6580622", "0.65781444", "0.65731376", "0.6556182", "0.6549542", "0.65273756", "0.652699", "0.64335656", "0.64284...
0.0
-1
works because `foo()` declaration is "hoisted"
function foo() { a = 3; console.log( a ); // 3 var a; // declaration is "hoisted" // to the top of `foo()` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo() {\n a = 3;\n console.log(a); // 3\n var a; // declaration is \"hoisted\"\n // to the top of `foo()`\n }", "function foo() {\n\ta = 3;\n\n\t//console.log( a );\t// 3\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\"\n // to the top of `foo()`\n}", "function hois...
[ "0.7138954", "0.6699694", "0.66906977", "0.6648686", "0.66448283", "0.6612035", "0.65252864", "0.63808525", "0.63808525", "0.63530105", "0.63388586", "0.63320214", "0.6240493", "0.6238319", "0.62230074", "0.6218568", "0.61838096", "0.61318815", "0.6126758", "0.61168116", "0.6...
0.66899204
3
2 Nested scopes / When you declare a variable, it is available anywhere in that scope, as well as any lower/inner scopes
function foo() { var a = 1; function bar() { var b = 2; function baz() { var c = 3; console.log( a, b, c ); // 1 2 3 } baz(); console.log( a, b ); // 1 2 } bar(); console.log( a ); // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkscope2() {\n\t var scope = \"Local\";\n\t function nested() {\n\t\t var scope = \"nested\";\n\t\t return scope;\n\t }\n\t return nested();\n }", "function scoper() {\n // let cat = 'Toby';\n console.log('cat inside scoper ', cat);\n function innerScope() {\n console.log('cat inside innerScope...
[ "0.76544344", "0.7270625", "0.7256985", "0.722848", "0.71966076", "0.71315575", "0.7130623", "0.71063185", "0.7074613", "0.7024565", "0.70072925", "0.69608", "0.69323444", "0.69112444", "0.6875424", "0.6871827", "0.6853142", "0.68499553", "0.68455184", "0.6843117", "0.6836166...
0.66616935
38
when not in 'strict mode' :
function foo() { a = 1; // `a` not formally declared }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __strict(x) {return x}", "function __strict(x) {return x}", "function strictMode() {\n 'use strict';\n\n //..\n //..\n }", "function strictly() {\n 'use strict';\n\n}", "function bar() {\n // this code is also strict mode.\n }", "function nonStrictMode() {\n let x = 34;\n\n //....
[ "0.7492471", "0.7492471", "0.7320771", "0.69628084", "0.69416744", "0.6888165", "0.6563585", "0.6302177", "0.6302177", "0.6285991", "0.62569", "0.62050265", "0.6067217", "0.60577697", "0.605221", "0.6025659", "0.597594", "0.597594", "0.59648573", "0.5874168", "0.5848781", "...
0.0
-1
42 / CLOSURES (in detail later)
function makeAdder(x) { // parameter `x` is an inner variable // inner function `add()` uses `x`, so // it has a "closure" over it function add(y) { return y + x; }; return add; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function StupidBug() {}", "static transient final private internal function m43() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "static transient final private public internal function m42() {}", "sharpen(){cov_14q771vu2z.f[3]++;cov_14q77...
[ "0.6362332", "0.61362815", "0.61112845", "0.604126", "0.60141814", "0.5952975", "0.59190834", "0.58674467", "0.5839824", "0.57828873", "0.5724699", "0.57164484", "0.57126486", "0.5683798", "0.5667226", "0.56649315", "0.5653329", "0.5641034", "0.56388104", "0.56264496", "0.561...
0.0
-1
parameter `x` is an inner variable inner function `add()` uses `x`, so it has a "closure" over it
function add(y) { return y + x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(x) {\n // Add your code below this line - done\n return function(y) {\n return function(z) {\n return x+y+z;\n }\n }\n // Add your code above this line\n}", "function add(x) {\n return function(y) {\n return x + y;\n };\n }", "function add(x) {\n // Add your code below ...
[ "0.78979313", "0.78437227", "0.78434503", "0.78150105", "0.777378", "0.7771953", "0.7706601", "0.761374", "0.756176", "0.7557953", "0.7373579", "0.7358242", "0.72124434", "0.7152574", "0.7115261", "0.70607173", "0.70409715", "0.70261705", "0.70261705", "0.7019564", "0.7009581...
0.6194325
78
23 < 10 + 13 / this
function foo() { console.log( this.bar ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function r(a){return a%100==11?!0:a%10!=1}", "function e(A){return A%100===11||A%10!==1}", "function t(r){return r%100==11?!0:r%10!=1}", "function a(e){return e%100===11||e%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100=...
[ "0.6753631", "0.6742874", "0.66258883", "0.658666", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "...
0.0
-1
gets newest record from database
function fetchNewContent() { $(".sidebar").animate({scrollTop: 0}, "swing"); $("#sidebar-content").prepend("<div class='sidebarItem placeholderItem' id=''><a class='placeholderLink' href=''><h3 class='placeholderTitle'>/</h3></a><h4 class='placeholderDate'>/</h4><a class='placeholderLink' href=''><div class='thumbnail placeholderImg' style='background-color:black;'></div></a>"); $(".placeholderItem").css("animation", "heightAnimation 1.5s ease forwards"); $.ajax({ type: "GET", url: "fetchNewContent.php", dataType: "html", success: function(response){ loadNewContent(response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getLatest() {\n const result = await this.ctx.model.Card.findOne({\n order: [[\"CreateTime\", 'DESC']]\n });\n return result;\n }", "function getLastRecord(req, res) {\n return RecordModel.find().sort({ $natural: -1 }).limit(1)\n .exec((err, record) => {\n if (er...
[ "0.695814", "0.6841868", "0.6453296", "0.6411854", "0.6222688", "0.6184051", "0.6151477", "0.61503494", "0.6147966", "0.6135215", "0.5998405", "0.5934384", "0.59209126", "0.591576", "0.5885137", "0.58658177", "0.58613366", "0.5837094", "0.57800215", "0.57719374", "0.5724068",...
0.0
-1
fills placeholder with new record
function loadNewContent(newData) { let objectData = newData.split(/;/); let link = objectData[0]; let id = objectData[1]; let title = objectData[2]; let thumbnail = "https://" + objectData[3]; let date = objectData[4]; $(".placeholderTitle").html(title); $(".placeholderTitle").removeClass('placeholderTitle'); $(".placeholderImg").css("background-image", "url(" + thumbnail + ")"); $(".placeholderImg").removeClass('placeholderImg'); $(".placeholderDate").html(date); $(".placeholderDate").removeClass('placeholderDate'); $(".placeholderLink").attr('href', link); $(".placeholderLink").removeClass('placeholderLink'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillUpTable() {\r\n\tgetInstantValues();\r\n}", "function populateDataFields() {}", "updatePlaceholder() {\n if (!this.node.placeholder) {\n const placeholder = this.getDateFormat()\n .replace('d', 'dd')\n .replace('m', 'mm')\n .replace('Y...
[ "0.5605594", "0.5537786", "0.54996616", "0.54048246", "0.5395914", "0.5335924", "0.52758217", "0.52037007", "0.5146376", "0.5143354", "0.50987476", "0.50902665", "0.5085616", "0.5080329", "0.50761133", "0.5073867", "0.5061471", "0.5054735", "0.50472766", "0.50450575", "0.5036...
0.47048903
91
animates loading screen logo with random glitch animation
function animateLogo() { let random; random = Math.floor((Math.random() * 3)+ 1); $('#wave').css("animation", "glitch" + random + " 2s ease infinite"); setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#erase').css("animation", "glitch" + random + " 2s ease infinite"); setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#blur').css("animation", "glitch" + random + " 2s ease infinite"); }, 40);}, 40); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runLogoAnimation() {\n for (const path of svgDrawingPaths) {\n path.style.strokeDashoffset = \"0px\";\n }\n for (const cPath of svgCirclePaths) {\n cPath.style.cssText = \"stroke-dashoffset: 0; transition-delay: 1200ms;\";\n }\n svgVerve.style.cssText =\n \"transform:translateX(0px); transit...
[ "0.7409085", "0.7091233", "0.69012314", "0.68325716", "0.6708544", "0.6704111", "0.66919994", "0.66762847", "0.6619367", "0.66165656", "0.65011317", "0.64985526", "0.64854777", "0.6482383", "0.64663875", "0.64638346", "0.6448776", "0.6436602", "0.634412", "0.63065964", "0.629...
0.7591164
0
retrieves title from datanase using video ID
function getTitleFromId(id) { $.ajax({ type: "GET", url: "getTitle.php", dataType: "html", data: { id: id }, success: function(response){ $('#songtitle').html(response); document.title = "SESH | " + response; }, error: function(response){ return "error"; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTitle(videoId) {\n return fetch (VIDEO_ENDPOINT + videoId)\n .then(response => response.json())\n .catch (error => \n console.error(error)\n )\n }", "function get_yt_title(ytid, i) {\n $.get('https://gdata.youtube.com/feeds/api/videos/' + ytid + '?v=2', function (xml) {\n var s = $(x...
[ "0.76891255", "0.70275337", "0.686119", "0.6732792", "0.6624442", "0.66096175", "0.6608902", "0.65187985", "0.6360742", "0.63518316", "0.62893456", "0.6288887", "0.62715304", "0.62631404", "0.62460274", "0.62446684", "0.6227898", "0.62263274", "0.62187237", "0.6192467", "0.61...
0.6110708
32
retrieves rows from database
function loadSidebar() { $.ajax({ type: "GET", url: "loadvideos.php", dataType: "html", success: function(response){ sidebarContent(response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "function getAllTheData() {\n var render = function (tx, rs) {\n // rs contains our SQLite recordset, at this point you can do anything with...
[ "0.6745723", "0.6741756", "0.6535017", "0.6535017", "0.6524347", "0.65178925", "0.6433052", "0.6394506", "0.63472915", "0.62963235", "0.6295872", "0.6279278", "0.6259826", "0.6236188", "0.6209221", "0.6206124", "0.6192317", "0.6137701", "0.61191607", "0.60458326", "0.60213697...
0.0
-1
stops logo animation :)
function stopLogo() { clearInterval(logo); $('#wave').css("display", "none"); $('#blur').css("display", "none"); $('#erase').css("display", "none"); $('#glitch1').css("display", "block"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopLogoAnimation() {\n if (typeof window.showlogo_iv !== 'undefined') {\n window.ncka = window.lgss = window.lga = 1;\n clearInterval(window.showlogo_iv);\n showLogo(true);\n ...
[ "0.86108387", "0.7080638", "0.70496047", "0.70471853", "0.6957593", "0.6907867", "0.6819871", "0.6818485", "0.67659694", "0.67659694", "0.67659694", "0.67310756", "0.67289686", "0.6680569", "0.6631503", "0.6617334", "0.65762746", "0.6566484", "0.6548353", "0.65399414", "0.653...
0.8123087
1
loads the full page content
function loadPage() { getRandomVideo(false); setTimeout(function() { loadSidebar(); stopLogo(); loadScreen(); }, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadContent() {\n $.ajax({\n url: 'ajax-get-page-content',\n type: 'GET',\n data: $data,\n beforeSend: function() {},\n success: function(response) {\n $('div#main-content').html(response);\n location.hash = $data.page || '';\n },\n complete: function(re...
[ "0.76424915", "0.75014704", "0.7368423", "0.7292615", "0.7292615", "0.7173784", "0.69401383", "0.68732727", "0.6820539", "0.6791587", "0.67512095", "0.6724946", "0.66861457", "0.66814", "0.6652175", "0.6623395", "0.6582385", "0.65757805", "0.657302", "0.656681", "0.65354306",...
0.0
-1
fades in main screen
function loadScreen() { if(window.matchMedia('(max-width: 768px)').matches) { $('#borgar').css('display', 'block'); $('#cancel').css('display', 'block'); } else { $('#text-toggle').css('display', 'block'); } $('.main').css("animation", "changeBg 1s ease"); $('#main-title').css("animation", "fadeEffectIn 1s ease"); $('#password').css("animation", "fadeEffectOut 1s ease"); $('#link-form').css("animation", "fadeEffectIn 1s ease"); $('#glitch1').css("animation", "fadeEffectOut 1s ease"); $('#videoPlayer').show(); $('#videoPlayer').css("animation", "fadeEffectIn 1s ease"); $('#videoPlayer').animate({maxHeight: "800px"}, 1000); $('#link-form').css("animation", "fadeEffectIn 1s ease"); $('#link-form').animate({maxHeight: "800px"}, 1000); $('#link-form').css('display', 'flex'); setTimeout(function(){ $('.main').css("background-color", "rgba(0,0,0,0)"); $('#main-title').css("opacity", "1"); $('#main-title').css("animation", ""); $('#password').css("display", "none"); $('#link-form').css("opacity", "1"); $('#link-form').css("animation", ""); $('#link').focus(); $('#glitch1').css("opacity", "0"); $('#videoPlayer').css("animation", ""); $('#videoPlayer').css("opacity", "1"); $('#glitch1').css("animation", ""); }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnToMain(){\n teleMode = false;\n console.log('reutrn to main');\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('startScreen');\n }, this);\n}", "function unlockScreen() {\r\n\t\tvar del = function () {\r\n\t\t\t$(\"#lockScreen\").remove();\r\n\t\t};\r...
[ "0.7103427", "0.6596101", "0.6466205", "0.6418885", "0.6393926", "0.6377566", "0.63383716", "0.6335676", "0.63202995", "0.63202995", "0.63202995", "0.6299804", "0.62531453", "0.623728", "0.62296945", "0.6213353", "0.62061083", "0.61543113", "0.6142346", "0.6140613", "0.612900...
0.0
-1
checks everything needed before posting data (input validation, extracting data from API)
function postData(videoLink) { let id; let title; let link; let thumb; if (checkLink(videoLink)) { if ((id = getID(videoLink)) != false) { $.ajax({ type: 'GET', url: 'https://www.googleapis.com/youtube/v3/videos?part=snippet&id=' + id, data: { key: apiPublicKey, type: 'video', videoEmbeddable: true, }, success: function(response){ if(response.items.length > 0) { thumb = getThumbnail(id); link = "https://www.youtube.com/watch?v=" + id; title = response.items[0].snippet.title; insertData(link, id, thumb, title); } else { $('#message').html('Video does not exist.'); } }, error: function(response){ return "error"; } }); } else { $('#message').html('Error in link ID.'); } } else { $('#message').html('Please enter a YouTube link.'); } $('#message').css('animation', 'message 3s ease forwards'); $('#link').val(''); setTimeout(function() { $('#message').css("animation", ""); $('#message').css("opacity", "0"); }, 3000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateResponse (data) {\n\t\t// verify we got the right post, and that there are no attributes we don't want the client to see\n\t\tthis.validateMatchingObject(this.post.id, data.post, 'post');\n\t\tthis.validateSanitized(data.post, PostTestConstants.UNSANITIZED_ATTRIBUTES);\n\t}", "validatePostObjects () { \n...
[ "0.6860662", "0.6748037", "0.6680339", "0.6604848", "0.6531904", "0.6427622", "0.62712157", "0.62333924", "0.6172173", "0.61717445", "0.6135642", "0.61161", "0.61148125", "0.61086714", "0.61070997", "0.609814", "0.6085867", "0.607086", "0.6066166", "0.60585475", "0.60429525",...
0.0
-1
inserts new link into database
function insertData(videoLink, videoId, videoThumb, videoTitle) { $.ajax({ url: "checkId.php", type: "GET", data: { id: videoId, }, cache: false, success: function(data) { if (!data) { $.ajax({ url: "insertData.php", type: "POST", data: { link: videoLink, id: videoId, thumbnail: videoThumb, title: videoTitle, }, cache: false, success: function(response) { //fetchNewContent(); $('#message').html('Schefke!'); }, error: function() { $('#message').html(''); } }); } else { $('#message').html('Duplicate content.'); } }, error: function() { $('#message').html('Error'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertLink(title, url) {\n Links.insert({ title, url, createdAt: new Date() });\n}", "function addBrainLink() {\n\t\tvar sourceKey = $('#sourceName').val();\n\t\tvar targetKey = $('#targetName').val();\n\t\tvar notes = $('[name=\"linkNotes\"]').val();\n\t\tvar attrKey = $('#attrName').val();\n\t\tvar a...
[ "0.7579566", "0.68103844", "0.6620342", "0.65243953", "0.6367809", "0.6301004", "0.62965924", "0.6150396", "0.614586", "0.6100345", "0.6071228", "0.59861547", "0.5968305", "0.5958615", "0.59352934", "0.5931534", "0.5900341", "0.5896153", "0.5890896", "0.588566", "0.58463544",...
0.0
-1
checks whether input is a youtube link
function checkLink(videoLink) { if(videoLink.indexOf("youtube.com/watch?v=") >= 0 || videoLink.indexOf("youtu.be/") >= 0) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckYoutube() {\n var reYoutube = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/,\n match = strLink.match(reYoutube);\n\n if( match && match[2].length == 11 ) {\n videoID = match[2];\n ...
[ "0.78308886", "0.7762298", "0.7744283", "0.752153", "0.74826366", "0.7392106", "0.7311745", "0.7308245", "0.7287603", "0.7287603", "0.70862347", "0.70455575", "0.70181274", "0.6788224", "0.67319727", "0.67042863", "0.66059035", "0.637388", "0.63737077", "0.63477594", "0.63180...
0.76011705
3
animates toggling the featured video
function toggleVideo() { if($('#featured').hasClass('toggled')) { $('#form-overlay-wrapper').animate({maxHeight: 0}, 500); $('#link-form').animate({opacity: 0}, 200); $('#featured').css('animation', 'toggleFeaturedOn 1s ease forwards'); $('#main-title-wrapper').animate({maxHeight: 0}, 500); $('#main-title').animate({opacity: 0}, 200); setTimeout(function() { $('#featured').css('max-height', 'inherit'); $('#featured').css('opacity', '1'); $('#featured').css('margin-bottom', '20px'); setTimeout(function() { $('#featured').css("animation", "none"); }, 50); }, 1000); $('#featured').removeClass('toggled'); } else { $('#form-overlay-wrapper').animate({maxHeight: 200}, 500); $('#link-form').animate({opacity: 1}, 500); $('#featured').css('animation', 'toggleFeaturedOff 1s ease forwards'); $('#main-title-wrapper').animate({maxHeight: "200px"}, 500); setTimeout(function() { $('#main-title').animate({opacity: 1}, 500); }, 300); setTimeout(function() { $('#featured').css("animation", "none"); $('#featured').css('max-height', '0'); $('#featured').css('opacity', '0'); $('#featured').css('margin-bottom', '0'); }, 1000); $('#featured').addClass('toggled'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }", "function toggle() {\n var trailer = document.querySelector('#onetra');\n var video = document.querySelector('video');\n onetra.classList.toggle('active')\n ...
[ "0.6483139", "0.6390514", "0.6388819", "0.63766366", "0.63230723", "0.6285341", "0.6250968", "0.62208354", "0.62047714", "0.6186793", "0.6175213", "0.61472607", "0.61271334", "0.6116968", "0.61030436", "0.60870284", "0.6034762", "0.60342544", "0.6033538", "0.6010624", "0.6006...
0.7665488
0
gets video ID from link
function getID(videoLink) { let id; if(videoLink.indexOf("youtube.com/watch?v=") >= 0) { id = videoLink.substr(videoLink.indexOf("=")+1, 11); } else { id = videoLink.substr(videoLink.indexOf("be/")+3, 11); } if (id.length != 11 || !id.match(/^[a-z0-9\-_]+$/i)) { id = false; } return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVideoIDfromLink(url)\n{\n\t\tvar regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\t\tvar match = url.match(regExp);\n\t\tif (match&&match[2].length==11){\n\t\t\t\treturn match[2];\n\t\t}else{\n\t\t\t\t//error\n\t\t}\n}", "function get_videoID()\r\n{\r\n\tv_id_pa...
[ "0.838077", "0.8225289", "0.7916893", "0.79025304", "0.78823805", "0.78571314", "0.7816603", "0.7528662", "0.75042427", "0.74323887", "0.73632336", "0.7345737", "0.7319435", "0.7308683", "0.72747004", "0.72747004", "0.72066253", "0.717138", "0.71424085", "0.71382487", "0.7127...
0.79088914
3
converts id into thumbnail link
function getThumbnail(videoId) { let thumbnail = "i3.ytimg.com/vi/" + videoId + "/hqdefault.jpg"; return thumbnail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadThumbnail(id){\n return '<img class=\"youtube-thumb\" src=\"//i.ytimg.com/vi/' + id + '/hqdefault.jpg\"><div class=\"play-button\"></div>';\n }", "function thumbnail(id, info)\n{\n // caption, usually contains date\n let cap = document.createElement('span');\n cap.classList.add('cap');\...
[ "0.71271473", "0.6994172", "0.6871036", "0.67597437", "0.67197126", "0.6678806", "0.6488973", "0.64361376", "0.63798875", "0.63322514", "0.6279063", "0.62736666", "0.6228342", "0.6114875", "0.6111203", "0.6075586", "0.6015214", "0.59424716", "0.5837447", "0.58181804", "0.5815...
0.61305654
13
play or loads a new random video from database
function getRandomVideo(isAutoplay) { let id; $.ajax({ type: "GET", url: "loadrandom.php", dataType: "html", success: function(response){ let objectData = response.split(/;/); let link = objectData[0]; id = objectData[1]; let title = objectData[2]; let thumbnail = "https://" + objectData[3]; let date = objectData[4]; if (isAutoplay) { player.loadVideoById(id); switchBg(id); } else { player.cueVideoByUrl("http://www.youtube.com/v/"+id+"?version=3", 0); $(".underlay").css('background', 'linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 1)), url("https://'+ getThumbnail(id) +'") no-repeat'); $(".underlay").css('background-size', 'cover'); $(".underlay").css('background-position', 'center'); $(".underlay").css('background-repeat', 'no-repeat'); } getTitleFromId(id); }, error: function(response){ return "error"; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playRandomVideo() {\n var $urls = $('[href^=\"/watch\"]');\n var i = Math.floor(Math.random() * $urls.length);\n\n var href = $urls[Math.floor(Math.random() * $urls.length)].href;\n var id = /[?&]v=([^&]+)(?:&|$)/.exec(href)[1];\n\n starting = true;\n\n player.loa...
[ "0.80678636", "0.74212265", "0.70521593", "0.7022632", "0.69177896", "0.6802676", "0.6769939", "0.6706158", "0.6604302", "0.65690494", "0.6548848", "0.6524858", "0.6448494", "0.64463836", "0.64373994", "0.6415446", "0.6414211", "0.64039516", "0.6397536", "0.6356651", "0.62783...
0.66577464
8
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Predicates & Assertions These are all of the possible kinds of types.
function isType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType || type instanceof GraphQLList || type instanceof GraphQLNonNull; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Predicate() {}", "function Predicate() {}", "function Predicate() {}", "function Predicate() { }", "function Predicate() { }", "function Predicate () {}", "function Predicate(){}", "function getPredicate(type) {\n switch (type) {\n case \"hasAuthor\": return (dcterms + \"creator\");\n ...
[ "0.5866655", "0.5866655", "0.5866655", "0.5820951", "0.5820951", "0.5795426", "0.5722482", "0.5583928", "0.55798143", "0.5499321", "0.5457561", "0.543557", "0.5372373", "0.5355828", "0.5293186", "0.52839994", "0.52601355", "0.5240247", "0.5233151", "0.52094966", "0.5199523", ...
0.0
-1
These types may be used as input types for arguments and directives.
function isInputType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType || type instanceof GraphQLNonNull && isInputType(type.ofType) || type instanceof GraphQLList && isInputType(type.ofType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, octal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] =...
[ "0.6682957", "0.66636664", "0.6487981", "0.6388074", "0.6260115", "0.6208433", "0.60848624", "0.6079036", "0.6065855", "0.6058644", "0.60189766", "0.5977005", "0.591053", "0.5902122", "0.58727914", "0.58521783", "0.58514625", "0.5794315", "0.5785371", "0.5756656", "0.5756656"...
0.0
-1
These types may be used as output types as the result of fields.
function isOutputType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLNonNull && isOutputType(type.ofType) || type instanceof GraphQLList && isOutputType(type.ofType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printFieldTypesForHelper(prefix, fields) {\r\n return fields.map(p => {\r\n var name = p.name;\r\n var compiledName = \"\";\r\n if (!p.emit && isArrayType(p.type)) {\r\n compiledName = '[<CompiledName(\"' + name + '\")>] ';\r\n name += \"A\";\r\n }\r\n ...
[ "0.5662988", "0.56603956", "0.55651844", "0.55100775", "0.54723364", "0.5378661", "0.5357482", "0.53436714", "0.5340024", "0.53394103", "0.5334371", "0.53326994", "0.5330229", "0.5322059", "0.5296827", "0.52539337", "0.52539337", "0.52539337", "0.52426416", "0.52426416", "0.5...
0.5196147
29
These types may describe types which may be leaf values.
function isLeafType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLEnumType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) ...
[ "0.67198116", "0.67198116", "0.67198116", "0.67198116", "0.67198116", "0.67198116", "0.66049165", "0.6446718", "0.5676705", "0.5676705", "0.566094", "0.5643042", "0.55962384", "0.54404646", "0.5433714", "0.5405661", "0.53743917", "0.5326172", "0.52857906", "0.5275447", "0.527...
0.64766103
9
These types may describe the parent context of a selection set.
function isCompositeType(type) { return type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parent(type) {\n var parent = this; // check for parent\n\n if (!parent.node.parentNode) return null; // get parent element\n\n parent = adopt(parent.node.parentNode);\n if (!type) return parent; // loop trough ancestors if type is given\n\n while (parent) {\n if (typeof type === 'string' ? par...
[ "0.55696577", "0.5463014", "0.5387697", "0.5263181", "0.5241093", "0.52376723", "0.5092069", "0.505945", "0.5046041", "0.5045512", "0.5039047", "0.50370127", "0.50316375", "0.49602005", "0.49430433", "0.49418372", "0.49408984", "0.49408984", "0.49408984", "0.49251118", "0.491...
0.0
-1
These types may describe the parent context of a selection set.
function isAbstractType(type) { return type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parent(type) {\n var parent = this; // check for parent\n\n if (!parent.node.parentNode) return null; // get parent element\n\n parent = adopt(parent.node.parentNode);\n if (!type) return parent; // loop trough ancestors if type is given\n\n while (parent) {\n if (typeof type === 'string' ? par...
[ "0.55689836", "0.54625463", "0.53899294", "0.5262049", "0.5241027", "0.5237543", "0.5089366", "0.5059023", "0.50468224", "0.5042407", "0.5038982", "0.50358033", "0.5032824", "0.49612266", "0.49425656", "0.49404562", "0.4937875", "0.4937875", "0.4937875", "0.49253392", "0.4914...
0.0
-1
These types can all accept null as a value.
function getNullableType(type) { return type instanceof GraphQLNonNull ? type.ofType : type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNullOrUndefined(value){return value===null||value===undefined;}", "function isNone(value) { return value === null || value === undefined; }", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "static nonNull<T>(value: ?T): T {\n if (value === null) {\...
[ "0.67271715", "0.6582149", "0.65085024", "0.65085024", "0.65085024", "0.65085024", "0.6483589", "0.64313513", "0.64006245", "0.6350447", "0.6350447", "0.6350447", "0.6350447", "0.6287215", "0.62045217", "0.6204463", "0.619998", "0.61980546", "0.6198012", "0.61957824", "0.6141...
0.0
-1
These named types do not include modifiers like List or NonNull.
function isNamedType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListType(){\n\tthis.astObject = ListExpression;\n\t\t\n\tthis.toString = function(){\n\t\treturn 'list'\n\t}\n}", "function StructType() {}", "function getNamedType(type) {\n\t var unmodifiedType = type;\n\t while (unmodifiedType instanceof GraphQLList || unmodifiedType instanceof GraphQLNonNull) {\...
[ "0.59333193", "0.57858473", "0.5781263", "0.56293404", "0.56011945", "0.5581936", "0.549693", "0.5489745", "0.5477343", "0.5477343", "0.5425125", "0.54042286", "0.5375345", "0.5349533", "0.5318691", "0.5301327", "0.5300126", "0.5298626", "0.52268475", "0.522573", "0.5174429",...
0.0
-1
Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions.
function resolveThunk(thunk) { return typeof thunk === 'function' ? thunk() : thunk; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceType(type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isListType\"])(type)) {\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLList\"](replaceType(type.ofType));\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isNo...
[ "0.61868656", "0.61661416", "0.614029", "0.58797175", "0.58797175", "0.5694197", "0.5694197", "0.56778127", "0.5660304", "0.5571152", "0.5571152", "0.5522279", "0.54350364", "0.5418595", "0.53999513", "0.53901434", "0.53627455", "0.5254645", "0.52300286", "0.52292705", "0.522...
0.0
-1
If a resolver is defined, it must be a function.
function isValidResolver(resolver) { return resolver == null || typeof resolver === 'function'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolve(value) {\n\t\t\treturn typeof value === 'function' ? value() : value;\n\t\t}", "function isTypeResolver(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfn) {\n // 1. A type provider must be a function\n if (typeof fn !== 'function')\n return false;\n // 2. A cla...
[ "0.60108536", "0.5983928", "0.57119197", "0.556918", "0.5547538", "0.55399346", "0.55316556", "0.54889995", "0.5416304", "0.5416304", "0.54119635", "0.5396087", "0.53853196", "0.53853196", "0.53354096", "0.5296625", "0.5274366", "0.52573806", "0.5207318", "0.5182532", "0.5179...
0.78889376
1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function invariant(condition, message) { if (!condition) { throw new Error(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.5974469", "0.57186145", "0.5716361", "0.5612574", "0.56004953", "0.55447197", "0.54876053", "0.54517573", "0.5409206", "0.5384836", "0.5377717", "0.53758943", "0.5368928", "0.53428334", "0.53198874", "0.53054833", "0.5304589", "0.5263201", "0.52544636", "0.52544636", "0.51...
0.0
-1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Returns true if a value is null, undefined, or NaN.
function isNullish(value) { return value === null || value === undefined || value !== value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value...
[ "0.7814775", "0.7798803", "0.7798803", "0.7798803", "0.7798803", "0.7798803", "0.7798803", "0.77748394", "0.7767827", "0.7767827", "0.7767827", "0.7695085", "0.7647322", "0.763671", "0.75818706", "0.7580747", "0.7580189", "0.7528958", "0.74373966", "0.7384704", "0.73025537", ...
0.73236006
22
Produces a JavaScript value given a GraphQL Value AST. A GraphQL type must be provided, which will be used to interpret different GraphQL Value literals. Returns `undefined` when the value could not be validly coerced according to the provided type. | GraphQL Value | JSON Value | | | | | Input Object | Object | | List | Array | | Boolean | Boolean | | String | String | | Int / Float | Number | | Enum Value | Mixed | | NullValue | null | Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function valueFromAST(valueNode, type, variables) { if (!valueNode) { // When there is no node, then there is also no value. // Importantly, this is different from returning the value null. return; } if (type instanceof _definition.GraphQLNonNull) { if (valueNode.kind === Kind.NULL) { return; // Invalid: intentionally return no value. } return valueFromAST(valueNode, type.ofType, variables); } if (valueNode.kind === Kind.NULL) { // This is explicitly returning the value null. return null; } if (valueNode.kind === Kind.VARIABLE) { var variableName = valueNode.name.value; if (!variables || (0, _isInvalid2.default)(variables[variableName])) { // No valid return value. return; } // Note: we're not doing any checking that this variable is correct. We're // assuming that this query has been validated and the variable usage here // is of the correct type. return variables[variableName]; } if (type instanceof _definition.GraphQLList) { var itemType = type.ofType; if (valueNode.kind === Kind.LIST) { var coercedValues = []; var itemNodes = valueNode.values; for (var i = 0; i < itemNodes.length; i++) { if (isMissingVariable(itemNodes[i], variables)) { // If an array contains a missing variable, it is either coerced to // null or if the item type is non-null, it considered invalid. if (itemType instanceof _definition.GraphQLNonNull) { return; // Invalid: intentionally return no value. } coercedValues.push(null); } else { var itemValue = valueFromAST(itemNodes[i], itemType, variables); if ((0, _isInvalid2.default)(itemValue)) { return; // Invalid: intentionally return no value. } coercedValues.push(itemValue); } } return coercedValues; } var coercedValue = valueFromAST(valueNode, itemType, variables); if ((0, _isInvalid2.default)(coercedValue)) { return; // Invalid: intentionally return no value. } return [coercedValue]; } if (type instanceof _definition.GraphQLInputObjectType) { if (valueNode.kind !== Kind.OBJECT) { return; // Invalid: intentionally return no value. } var coercedObj = Object.create(null); var fields = type.getFields(); var fieldNodes = (0, _keyMap2.default)(valueNode.fields, function (field) { return field.name.value; }); var fieldNames = Object.keys(fields); for (var _i = 0; _i < fieldNames.length; _i++) { var fieldName = fieldNames[_i]; var field = fields[fieldName]; var fieldNode = fieldNodes[fieldName]; if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { if (!(0, _isInvalid2.default)(field.defaultValue)) { coercedObj[fieldName] = field.defaultValue; } else if (field.type instanceof _definition.GraphQLNonNull) { return; // Invalid: intentionally return no value. } continue; } var fieldValue = valueFromAST(fieldNode.value, field.type, variables); if ((0, _isInvalid2.default)(fieldValue)) { return; // Invalid: intentionally return no value. } coercedObj[fieldName] = fieldValue; } return coercedObj; } !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0; var parsed = type.parseLiteral(valueNode); if ((0, _isNullish2.default)(parsed) && !type.isValidLiteral(valueNode)) { // Invalid values represent a failure to parse correctly, in which case // no value is returned. return; } return parsed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n ca...
[ "0.7224206", "0.7224206", "0.6986272", "0.68704295", "0.68704295", "0.6868633", "0.682958", "0.682958", "0.68180215", "0.6725093", "0.67110455", "0.67110455", "0.662672", "0.66241294", "0.6601047", "0.6600547", "0.6590681", "0.6531839", "0.64394385", "0.64394385", "0.64241266...
0.6531839
19
Returns true if the provided valueNode is a variable which is not defined in the set of variables.
function isMissingVariable(valueNode, variables) { return valueNode.kind === Kind.VARIABLE && (!variables || (0, _isInvalid2.default)(variables[valueNode.name.value])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMissingVariable(valueNode, variables) {\n return valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE && (!variables || Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(variables[valueNode.name.value]));\n}", "function isMissingVariable(valueNode, var...
[ "0.7585486", "0.7506564", "0.7506564", "0.74943405", "0.74943405", "0.65721583", "0.6398217", "0.6277338", "0.6277338", "0.62046826", "0.62046826", "0.6160192", "0.61580646", "0.61210066", "0.61210066", "0.60618746", "0.6023324", "0.5985507", "0.5955709", "0.5879482", "0.5853...
0.7465998
6
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Returns true if a value is undefined, or NaN.
function isInvalid(value) { return value === undefined || value !== value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUndefined(value) { return typeof value === \"undefined\"; }", "function isUndefined (value) {\n return value === undefined;\n}", "function isUndefined(value){return typeof value === 'undefined';}", "function isUndefined(value) {\n\n}", "function isUndefined (value) {\nreturn typeof value === ...
[ "0.7582717", "0.7551259", "0.7535791", "0.747478", "0.745579", "0.7376539", "0.73757905", "0.73757905", "0.73680633", "0.73463696", "0.7346058", "0.7323705", "0.73208964", "0.73208964", "0.73208964", "0.73208964", "0.73208964", "0.73208964", "0.73084396", "0.73084396", "0.730...
0.0
-1
Converts an AST into a string, using one set of reasonable formatting rules.
function print(ast) { return (0, _visitor.visit)(ast, { leave: printDocASTReducer }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatAst(ast) {\n return (0, _language.visit)(ast, { leave: printDocASTReducer });\n}", "function church_ast_to_string(ast) {\n\tif (util.is_leaf(ast)) {\n\t\treturn ast.text;\n\t} else {\n\t\treturn \"(\" + ast.children.map(function(x) {return church_ast_to_string(x)}).join(\" \") + \")\"\n\t}\n}", ...
[ "0.6907318", "0.6658709", "0.64763826", "0.57551503", "0.57519037", "0.57148486", "0.55270946", "0.5510983", "0.5510983", "0.5510983", "0.5489868", "0.5480407", "0.5476735", "0.54718816", "0.5463142", "0.54609615", "0.5440716", "0.5437396", "0.5419792", "0.5419664", "0.541232...
0.5303283
43
Given maybeArray, print an empty string if it is null or empty, otherwise print all items together separated by separator if provided
function join(maybeArray, separator) { return maybeArray ? maybeArray.filter(function (x) { return x; }).join(separator || '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '...
[ "0.7627064", "0.7627064", "0.75829023", "0.7526939", "0.7526939", "0.7526939", "0.7340967", "0.7279731", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.68798125", "0.6615136", "0.6...
0.7437981
23
If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.
function wrap(start, maybeString, end) { return maybeString ? start + maybeString + (end || '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n }", "function wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n }", "function wrap(start, maybeString, end) {\n\t\t return maybeString ? star...
[ "0.8298625", "0.8298625", "0.8257017", "0.82172704", "0.82172704", "0.82172704", "0.8134717", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7959051", "0.7959051", "0.7959051", "0.7959051", "0.5566828", "0.54099494", "0.52980316", "0.5291635"...
0.8177886
23
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.5823202", "0.5634932", "0.5555008", "0.5488867", "0.5398993", "0.53844786", "0.53628343", "0.53275305", "0.5322014", "0.53156894", "0.53156894", "0.5292984", "0.52669924", "0.5217245", "0.5198362", "0.5191516", "0.51914394", "0.5156171", "0.51405835", "0.51322055", "0.5125...
0.0
-1
Initial version was copypasted from
function observeStore(store) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } var onChange = args.pop(); var selectors = args; var currentState; function handleChange() { var nextState = __WEBPACK_IMPORTED_MODULE_0_lodash__["map"](selectors, function (f) { return f(store.getState()); }); var stateChanged = __WEBPACK_IMPORTED_MODULE_0_lodash__(nextState) .zip(currentState) .some(function (_a) { var x = _a[0], y = _a[1]; return x !== y; }); if (stateChanged) { currentState = nextState; onChange.apply(void 0, currentState); } } var unsubscribe = store.subscribe(handleChange); handleChange(); return unsubscribe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.6945402", "0.6915607", "0.6737507", "0.6553435", "0.64923275", "0.6438237", "0.6408469", "0.62795377", "0.62056017", "0.6098049", "0.60613483", "0.60351604", "0.602154", "0.60162294", "0.59840363", "0.5978798", "0.59396875", "0.5893842", "0.5866488", "0.57921016", "0.57071...
0.0
-1
Upholds the spec rules about naming.
function assertValidName(name, isIntrospection) { if (!name || typeof name !== 'string') { throw new Error('Must be named. Unexpected name: ' + name + '.'); } if (!isIntrospection && !hasWarnedAboutDunder && !noNameWarning && name.slice(0, 2) === '__') { hasWarnedAboutDunder = true; /* eslint-disable no-console */ if (console && console.warn) { var error = new Error('Name "' + name + '" must not begin with "__", which is reserved by ' + 'GraphQL introspection. In a future release of graphql this will ' + 'become a hard error.'); console.warn(formatWarning(error)); } /* eslint-enable no-console */ } if (!NAME_RX.test(name)) { throw new Error('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "' + name + '" does not.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateName() {\n // Do not delete this internal method.\n this.name = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n }", "correctName() {\n\t\tthis.name = this.stringCorrector.getMon(this.name);\n\t}", "setName(name) { }", "function normalizeName(name) {\n return name\n .toUpperCase()\n ...
[ "0.72742933", "0.71357465", "0.6350764", "0.6319526", "0.62354445", "0.6111867", "0.6104084", "0.60775584", "0.60544574", "0.6054408", "0.6042745", "0.60326207", "0.60326207", "0.6029542", "0.60262007", "0.602019", "0.60103446", "0.6005225", "0.5969766", "0.5968321", "0.59683...
0.59453356
24
Produces a GraphQL Value AST given a JavaScript value. A GraphQL type must be provided, which will be used to interpret different JavaScript values. | JSON Value | GraphQL Value | | | | | Object | Input Object | | Array | List | | Boolean | Boolean | | String | String / Enum Value | | Number | Int / Float | | Mixed | Enum Value | | null | NullValue |
function astFromValue(value, type) { // Ensure flow knows that we treat function params as const. var _value = value; if (type instanceof _definition.GraphQLNonNull) { var astValue = astFromValue(_value, type.ofType); if (astValue && astValue.kind === Kind.NULL) { return null; } return astValue; } // only explicit null, not undefined, NaN if (_value === null) { return { kind: Kind.NULL }; } // undefined, NaN if ((0, _isInvalid2.default)(_value)) { return null; } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but // the value is not an array, convert the value using the list's item type. if (type instanceof _definition.GraphQLList) { var itemType = type.ofType; if ((0, _iterall.isCollection)(_value)) { var valuesNodes = []; (0, _iterall.forEach)(_value, function (item) { var itemNode = astFromValue(item, itemType); if (itemNode) { valuesNodes.push(itemNode); } }); return { kind: Kind.LIST, values: valuesNodes }; } return astFromValue(_value, itemType); } // Populate the fields of the input object by creating ASTs from each value // in the JavaScript object according to the fields in the input type. if (type instanceof _definition.GraphQLInputObjectType) { if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') { return null; } var fields = type.getFields(); var fieldNodes = []; Object.keys(fields).forEach(function (fieldName) { var fieldType = fields[fieldName].type; var fieldValue = astFromValue(_value[fieldName], fieldType); if (fieldValue) { fieldNodes.push({ kind: Kind.OBJECT_FIELD, name: { kind: Kind.NAME, value: fieldName }, value: fieldValue }); } }); return { kind: Kind.OBJECT, fields: fieldNodes }; } !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0; // Since value is an internally represented value, it must be serialized // to an externally represented value before converting into an AST. var serialized = type.serialize(_value); if ((0, _isNullish2.default)(serialized)) { return null; } // Others serialize based on their corresponding JavaScript scalar types. if (typeof serialized === 'boolean') { return { kind: Kind.BOOLEAN, value: serialized }; } // JavaScript numbers can be Int or Float values. if (typeof serialized === 'number') { var stringNum = String(serialized); return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum } ); } if (typeof serialized === 'string') { // Enum types use Enum literals. if (type instanceof _definition.GraphQLEnumType) { return { kind: Kind.ENUM, value: serialized }; } // ID types can use Int literals. if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) { return { kind: Kind.INT, value: serialized }; } // Use JSON stringify, which uses the same string encoding as GraphQL, // then remove the quotes. return { kind: Kind.STRING, value: JSON.stringify(serialized).slice(1, -1) }; } throw new TypeError('Cannot convert value to AST: ' + String(serialized)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseJSValue(value) {\n let val;\n if (isNodeCollection(value)) {\n val = value.get().value;\n } else if (isNode(value)) {\n val = value;\n } else {\n switch (typeof value) {\n case 'object':\n val = object(value);\n break;\n ...
[ "0.70470744", "0.69767505", "0.6862705", "0.6862705", "0.6852368", "0.6780472", "0.66964674", "0.66904795", "0.66605663", "0.65895486", "0.65895486", "0.65102434", "0.65062976", "0.65062976", "0.64933676", "0.6456218", "0.6343909", "0.62815255", "0.62152064", "0.62152064", "0...
0.69768363
2
When the object provided to `createIterator` is not Iterable but is Arraylike, this simple Iterator is created.
function ArrayLikeIterator(obj) { this._o = obj this._i = 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArrayLikeIterator (obj) {\n\t this._o = obj\n\t this._i = 0\n\t}", "function CreateArrayIterator(array, kind) {\n var o = ToObject(array);\n var iterator = new ArrayIterator;\n set_internal(iterator, '[[IteratedObject]]', o);\n set_internal(iterator, '[[ArrayIteratorNextIndex]]', 0);\n ...
[ "0.70463395", "0.68771654", "0.67490155", "0.6685187", "0.6685187", "0.66562265", "0.66562265", "0.66562265", "0.65765977", "0.6571398", "0.6514193", "0.6514193", "0.63881713", "0.63206476", "0.6308758", "0.6295623", "0.6274428", "0.62515825", "0.6242841", "0.6179238", "0.615...
0.7115799
3
When the object provided to `createAsyncIterator` is not AsyncIterable but is sync Iterable, this simple wrapper is created.
function AsyncFromSyncIterator(iterator) { this._i = iterator }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[Symbol.asyncIterator]() {\n return __asyncGenerator(this, arguments, function* _a() {\n yield __await(yield* __asyncDelegator(__asyncValues(this.iterate())));\n });\n }", "function mapAsyncIterator(iterable, callback) {\n var iterator = (0, _iterall.getAsyncIterator)...
[ "0.74373925", "0.7015094", "0.6998571", "0.6935101", "0.6935101", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.67940116", "0.6651916", ...
0.8003384
3
Creates a new visitor instance which delegates to many visitors to run in parallel. Each visitor will be visited for each node before moving on. If a prior visitor edits a node, no following visitors will see that node.
function visitInParallel(visitors) { var skipping = new Array(visitors.length); return { enter: function enter(node) { for (var i = 0; i < visitors.length; i++) { if (!skipping[i]) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === false) { skipping[i] = node; } else if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined) { return result; } } } } }, leave: function leave(node) { for (var i = 0; i < visitors.length; i++) { if (!skipping[i]) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined && result !== false) { return result; } } } else if (skipping[i] === node) { skipping[i] = null; } } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visitInParallel(visitors) {\n\t\t var skipping = new Array(visitors.length);\n\n\t\t return {\n\t\t enter: function enter(node) {\n\t\t for (var i = 0; i < visitors.length; i++) {\n\t\t if (!skipping[i]) {\n\t\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n...
[ "0.64227366", "0.638854", "0.638854", "0.638854", "0.63746333", "0.63746333", "0.63746333", "0.63746333", "0.63746333", "0.63746333", "0.63717467", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584"...
0.6444636
12