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
Controller for the healthBamMain component.
function MainController( $log ) { var main = this; /** * A function for Jessica to make a change to. */ function jessica() { $log.debug("TODO"); } /** * A function for KP to make a change to. */ function kp() { $log.debug("TODO"); } /** * A function for John to make a change to. */ function john() { $log.debug("TODO"); } /** * This function only exists to prevent everyone from modifying the same area in code. * * TODO - remove this once everyone has submitted a code change */ function training() { jessica(); kp(); john(); } $log.debug("Main Controller loaded", main); training(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function healthController() {\n\n }", "function MainController() {\n\n }", "get health(){ return this._health}", "function Start() \n{\n\t\n\tguiHealth = GameObject.Find(\"GameManager\");\n healthBarScript = guiHealth.GetComponent(GuiDisplayJava) as GuiDisplayJava;\n \n // Set initial value of t...
[ "0.76854885", "0.6148833", "0.5985905", "0.5881076", "0.587341", "0.57857496", "0.56405616", "0.5608412", "0.5585611", "0.5532997", "0.55292207", "0.54681545", "0.5451594", "0.54449266", "0.54449266", "0.54331416", "0.5368403", "0.5357342", "0.5357302", "0.53568894", "0.53354...
0.4840684
78
A function for Jessica to make a change to.
function jessica() { $log.debug("TODO"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAChange(){\n contentPanel.SC.run(function(){\n contentPanel.MySystem.store.createRecord(contentPanel.MySystem.Node, { 'title': 'Test node ' + newNodeIndex, 'image': '/lightbulb_tn.png' });\n });\n newNodeIndex += 1;\n }", "change() { }", "function change(o) {\n\to.id = 2;\n}", "fu...
[ "0.64560956", "0.64371085", "0.632784", "0.6306832", "0.61692667", "0.60667247", "0.6062099", "0.60517526", "0.59841794", "0.598404", "0.59502995", "0.59480625", "0.5870167", "0.5866589", "0.58184123", "0.58091223", "0.57987654", "0.57867175", "0.57792807", "0.57792807", "0.5...
0.0
-1
A function for KP to make a change to.
function kp() { $log.debug("TODO"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "change() { }", "change() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return Changeable$M.change.apply(this, args);\n }", "function change(o) {\n\to.id = 2;\n}", "function makeAChange(){\n contentPanel...
[ "0.6550308", "0.62440735", "0.6223802", "0.6205822", "0.6136095", "0.60201323", "0.598303", "0.59753084", "0.5916637", "0.5912132", "0.5904388", "0.5875789", "0.5857539", "0.585589", "0.58298886", "0.5816654", "0.5807647", "0.57835245", "0.5775016", "0.5759714", "0.5749441", ...
0.0
-1
A function for John to make a change to.
function john() { $log.debug("TODO"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "change() { }", "function changeTodo() {\n\ttodos[0] = 'item updated';\n}", "function change(o) {\n\to.id = 2;\n}", "function changeName(obj) {\n obj.age = 20;\n}", "function changeName(obj) {\n\tobj.name = 'diffEllie';\n}", "function changeStudent(student) {\n student.name = \"Thang\";\n}", "change...
[ "0.63452595", "0.6336644", "0.6329708", "0.62742156", "0.6213752", "0.6199251", "0.6133659", "0.6082958", "0.6082958", "0.60604215", "0.6048877", "0.60407734", "0.6031565", "0.60243547", "0.60187066", "0.6013837", "0.6000386", "0.6000386", "0.6000386", "0.59711665", "0.596557...
0.0
-1
This function only exists to prevent everyone from modifying the same area in code. TODO remove this once everyone has submitted a code change
function training() { jessica(); kp(); john(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disallowEdit() {\n setAllowEdit(false);\n }", "function Protect() {\r\n}", "function lock() {\n clearAlertBox();\n // Lock the editors\n aceEditor.setReadOnly(true);\n\n // Disable the button and set checkCorrectness to true.\n $(\"#resetCode\").attr(\"disabled\", \"disabled\");\n ...
[ "0.61383396", "0.5948349", "0.5813972", "0.5626072", "0.5609636", "0.5604327", "0.55946994", "0.5594173", "0.552369", "0.55230194", "0.5521189", "0.5492849", "0.5438334", "0.543218", "0.5430754", "0.5371369", "0.5371239", "0.53694355", "0.5348208", "0.5327032", "0.52979136", ...
0.0
-1
TODO: Handle also "drag" event. First need to be able to specify the events that we want to listent to, via `this.data`. // If not specified listen to all `SOURCE_EVENTS` TODO: Consider to move some functions to the outer scope
function handleDrag(ev, broadcast) { // Ignore other events if (!isDragEvent(ev)) return; const data = this.data; const delegator = hg.Delegator(); const _target = ev.currentTarget; let listenersAdded = false; // TODO: Check if can remove this if (ev.type === 'dragstart') { const triggerDragstart = !listenersAdded; addListeners(); if (triggerDragstart) dragstart(ev); } // TODO: Check if can remove `target` from broadcasted data, // from all/some handlers function dragstart(e) { if (!isRootElementOfEvent(e)) return; const dataTransfer = e._rawEvent.dataTransfer; dataTransfer.effectAllowed = 'move'; broadcast(addData({ type: 'dragstart', target: e.target, dataTransfer, })); } function dragend(e) { if (!isRootElementOfEvent(e)) return; removeListeners(); broadcast(addData({ type: 'dragend', target: e.target, })); } function addData(additional) { return Object.assign({}, data, additional); } function isRootElementOfEvent(e) { return e.target === _target; } function addListeners() { if (listenersAdded) return; delegator.addGlobalEventListener('dragstart', dragstart); delegator.addGlobalEventListener('dragend', dragend); listenersAdded = true; } function removeListeners() { if (!listenersAdded) return; delegator.removeGlobalEventListener('dragstart', dragstart); delegator.removeGlobalEventListener('dragend', dragend); listenersAdded = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setEvents() {\n\n if (this.fileInputLinkEle) {\n //Show file reference dialog when clicking the \"Select File\" link\n this.fileInputLinkEle.addEventListener('click', evt => {\n this.fileInputEle.click();\n evt.preventDefault();\n });\n ...
[ "0.6100532", "0.6073405", "0.59625244", "0.59483385", "0.59252113", "0.591721", "0.5884206", "0.58506626", "0.58044666", "0.5775045", "0.57722443", "0.5729432", "0.56970394", "0.5687678", "0.5672379", "0.5656421", "0.56384003", "0.5634263", "0.561522", "0.56138086", "0.561241...
0.0
-1
TODO: Check if can remove `target` from broadcasted data, from all/some handlers
function dragstart(e) { if (!isRootElementOfEvent(e)) return; const dataTransfer = e._rawEvent.dataTransfer; dataTransfer.effectAllowed = 'move'; broadcast(addData({ type: 'dragstart', target: e.target, dataTransfer, })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAnnotationSend(target){\n socket.emit(\"post_remove_annotation\", {target: target});\n}", "setTarget(target) {\n const currentTarget = this._targetStream.value;\n if (target === currentTarget) {\n return;\n }\n // Clear the listeners from the pre-existing ta...
[ "0.6394324", "0.63056266", "0.6016593", "0.58996993", "0.5875666", "0.58462334", "0.58462334", "0.58422077", "0.5823778", "0.5728211", "0.5727897", "0.5705462", "0.5689707", "0.5669575", "0.56140935", "0.56056416", "0.5573051", "0.55537456", "0.5551862", "0.5537343", "0.55238...
0.0
-1
Call to the server
function activateTrygger(trygger){ var q= queryfyText(trygger); return postToServer ("activate?trygger=", q); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_server() {\n console.log(\"Calling the server\");\n if (self.vue.chosen_magic_word === null) {\n console.log(\"No magic word.\");\n setTimeout(call_server, call_interval);\n } else {\n // We can do a server call.\n // Add a bit of rando...
[ "0.6806835", "0.6331031", "0.63098043", "0.62808955", "0.619168", "0.61809826", "0.6159516", "0.6136136", "0.607894", "0.59980285", "0.5980644", "0.596972", "0.5954825", "0.59534323", "0.5856377", "0.58497566", "0.58357733", "0.58333987", "0.581585", "0.5814595", "0.5805203",...
0.0
-1
Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string. Examples capitalize('a short sentence') > 'A Short Sentence' capitalize('a lazy fox') > 'A Lazy Fox' capitalize('look, it is working!') > 'Look, It Is Working!'
function capitalize(str) { let result = '' const context = str.split(' ') for (let i = 0; i < context.length; i++) { if (context[i].trim().length > 0) { context[i] = context[i].charAt(0).toUpperCase() + context[i].substr(1, context[i].length) result += context[i] + " " } } return result.trim() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capitalizeWord(string) {\n \n // Should take a string of one word, and return the word with its first letter capitalized\n return string[0].toUpperCase() + string.substring(1, string.length);\n \n}", "function capitalize(string) {\n if (string.indexOf(\" \") !== -1) {\n var arr =...
[ "0.8285596", "0.82367736", "0.8222786", "0.8193245", "0.8186978", "0.81807446", "0.81706184", "0.81702155", "0.8147706", "0.8138574", "0.81328857", "0.81130725", "0.81125367", "0.8110441", "0.80967003", "0.80943406", "0.8091477", "0.8086929", "0.8069985", "0.8067257", "0.8061...
0.0
-1
added on 1212.1741 by jb
function addFav(e){ var url="http://www.ipeen.com.tw"; var title="iPeen 愛評網 - 美食消費經驗分享"; var nav = navigator.userAgent; if(document.all) { e.href = 'javascript:void(0);'; window.external.AddFavorite(url, title); return false; } else if(nav.indexOf("SeaMonkey") != -1) { e.href = 'javascript:void(0);'; window.sidebar.addPanel(title, url, ''); return false; } }
{ "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() {}", "static private internal function m121() {}", "transient private internal fun...
[ "0.6803819", "0.66182405", "0.6547029", "0.6184167", "0.6130519", "0.60575354", "0.6053293", "0.5939176", "0.5885846", "0.5810538", "0.57231903", "0.5704111", "0.5665902", "0.5650342", "0.56107825", "0.55738527", "0.5562895", "0.5531637", "0.5474779", "0.5412916", "0.5406572"...
0.0
-1
run start(true) to initiate a call
function start(isCaller) { console.log("start: isCaller=", isCaller); pc = new RTCPeerConnection(configuration); // send any ice candidates to the other peer pc.onicecandidate = function (evt) { console.log("onicecandidate: ", evt); if (evt.candidate) { sendMessage("candidate", evt.candidate); } }; // once remote stream arrives, show it in the remote video element pc.onaddstream = function (evt) { console.log("onaddstream: ", evt); setVideoStream(false, evt.stream); }; // get the local stream, show it in the local video element and send it console.log('Requesting getUserMedia...'); navigator.mediaDevices.getUserMedia({ "audio": true, "video": true }) .then(function (stream) { console.log("getUserMedia response: ", stream); setVideoStream(true, stream); pc.addStream(stream); if (isCaller) { pc.createOffer(offerOptions).then(gotDescription, (err) => { console.error("Error in createOffer: ", err); }); } else { pc.createAnswer().then(gotDescription, (err) => { console.error("Error in createAnswer: ", err); }); } }, (err) => { console.error("Error in getUserMedia: ", err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n this.do(\"start\")\n }", "start() {\n this.isStarted = true;\n this._startRequest();\n }", "function start() {\n init();\n run();\n }", "function startNewCall() {\n\n}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "star...
[ "0.7424616", "0.7422449", "0.7304944", "0.72663134", "0.7221257", "0.7221257", "0.7221257", "0.7221257", "0.7221257", "0.7221257", "0.7093629", "0.7089949", "0.70392376", "0.69070894", "0.6891396", "0.68910825", "0.688992", "0.68878704", "0.68583655", "0.68534404", "0.6829339...
0.0
-1
hook up event handlers
function register_event_handlers() { //Cambiamos de nombre del boton atras $(".button.backButton").html("ATRAS");//$.ui.popup('Hi there'); LOGIN.crearEnlaces(); ALUMNO.crearEnlaces(); PROFESOR.crearEnlaces(); /* button #idLogin */ $(document).on("click", "#idLogin", function(evt) { LOGIN.onClickLogin(); }); /* button #idEscogerAlumno */ $(document).on("click", "#idEscogerAlumno", function(evt) { ALUMNO.onClickEscogerAlumno(); }); /* button #idEscogerProfesor */ $(document).on("click", "#idEscogerProfesor", function(evt) { /* your code goes here */ PROFESOR.onClickEscogerProfesor(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function E...
[ "0.7516249", "0.7350204", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "0.7266262", "...
0.0
-1
Detect click on background to toggle selections
function handleToggleSelection(e) { if (e.target.classList.contains("canva")) { store.removeSelection(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleBackgroundSelect() {\n if (graphicsMode == '4') {\n document.getElementById('background-select-container').style.display = 'block';\n } else {\n document.getElementById('background-select-container').style.display = 'none';\n ...
[ "0.6826609", "0.6424835", "0.63468754", "0.63357145", "0.6323289", "0.6296135", "0.6235542", "0.6206825", "0.61120766", "0.60943407", "0.60400695", "0.6002417", "0.6001217", "0.59878427", "0.5977825", "0.5938097", "0.59321463", "0.5925092", "0.59235936", "0.5915533", "0.59118...
0.6191457
8
called before dom elements are mounted, to get current user
componentWillMount() { this.fetchBookmarks() this.fetchUsers() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRendered() {\n identifyUser();\n}", "function userget(){\n document.getElementById('current-user').innerHTML = current_user;\n }", "function loadCurrentUser() {\n UserService.GetCurrentUser()\n .then(function (response) {\n vm.user = response.data;\n...
[ "0.7169608", "0.653738", "0.6256027", "0.6204822", "0.6163895", "0.6155843", "0.61463946", "0.614299", "0.61405456", "0.61057454", "0.60398513", "0.60340655", "0.60302436", "0.60178447", "0.60121804", "0.60121804", "0.59895116", "0.5989473", "0.5978593", "0.5978593", "0.59656...
0.0
-1
Here we are using the same logic of counting in both the components. We are duplicating the code. We can use the concept of LIFTING THE STATE UP but that is only possible in the current scenario where ButtonCounter and HoverCounter have same parent Example But in other scenario where the components may not have the same parent we will use the concept of Higher Order Component as mentioned in the Example2
function Example() { return ( <div> <ButtonCounter /> <br /> <HoverCounter /> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Counter(props) {\n const count = props.parentCount;\n const setCount = props.parentSetCount;\n /* const [count, setCount] = useState(0); */ /* stateArray has two elements: stateArray[0] is the value we store, stateArray[1] is the function that we use to change the value \n it can the be destru...
[ "0.6973765", "0.6894091", "0.6801001", "0.678876", "0.675476", "0.67252487", "0.66865134", "0.66388065", "0.6595614", "0.65876096", "0.65853024", "0.6569971", "0.65233666", "0.6485844", "0.6483722", "0.64820516", "0.6445651", "0.6429833", "0.64071256", "0.6387333", "0.6327409...
0.7710295
0
True si es para actualizar atributos propios False para actualizar atributos de otro jugador
function actualizarAtributos(data,opt) { if(opt){ $( "#panel-nombre" ).text(jugador.nombre+" / "+data.raza); $( "#img1" ).attr('src', data.imagen); }else{ $( "#panel-nombre" ).text(data.nombre+" / "+data.raza); $( "#img1" ).attr('src', data.imagen); } //Ataque $( ".bar-ataque" ).attr('aria-valuenow', data.ataque); $( ".bar-ataque" ).css('width:', (data.ataque/6)*100); $( ".bar-ataque" ).text(data.ataque); //Destreza $( ".bar-destreza" ).attr('aria-valuenow', data.destreza); $( ".bar-destreza" ).css('width:', (data.destreza/6)*100); $( ".bar-destreza" ).text(data.destreza); //Dano $( ".bar-dano" ).attr('aria-valuenow', data.dano); $( ".bar-dano" ).css('width:', (data.dano/6)*100); $( ".bar-dano" ).text(data.dano); //Defensa $( ".bar-defensa" ).attr('aria-valuenow', data.defensa); $( ".bar-defensa" ).css('width:', (data.defensa/6)*100); $( ".bar-defensa" ).text(data.defensa); //Vida $( ".bar-vida" ).attr('aria-valuenow', data.vida); $( ".bar-vida" ).attr('aria-valuemax', data.vidaMax); $( ".bar-vida" ).css('width:', (data.vida/data.vidaMax)*100); $( ".bar-vida" ).text(data.vida); //Movimiento $( ".bar-movimiento" ).attr('aria-valuenow', data.movimiento); $( ".bar-movimiento" ).attr('aria-valuemax', data.movimientoMax); $( ".bar-movimiento" ).css('width:', (data.movimiento/data.movimientoMax)*100); $( ".bar-movimiento" ).text(data.movimiento); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function habilitarEdicion (){\n\t\t\t$scope.modificar = true;\n\t\t}", "editarFalse1() {\n this.activarPersonal = true;\n }", "isEdited() {\n return this._canvas.getObjects().length > 0;\n }", "function activarArrastradoPuntos(activar){\r\n if(activar){\r\n dragPuntosRuta.activa...
[ "0.5766059", "0.56830597", "0.5634316", "0.56236523", "0.5573855", "0.5496294", "0.5490309", "0.5478505", "0.54747117", "0.54638237", "0.5409179", "0.5380221", "0.53801924", "0.5348406", "0.53425497", "0.5336418", "0.53226966", "0.5322319", "0.53097516", "0.528444", "0.528047...
0.0
-1
Return the entity for a given id
getEntity(id, params) { return __awaiter(this, void 0, void 0, function* () { const entityService = this.entityService; const { entity } = this.configuration; debug('Getting entity', id); if (entityService === null) { throw new errors_1.NotAuthenticated(`Could not find entity service`); } const query = yield this.getEntityQuery(params); const getParams = Object.assign({}, omit_1.default(params, 'provider'), { query }); const result = yield entityService.get(id, getParams); if (!params.provider) { return result; } return entityService.get(id, Object.assign(Object.assign({}, params), { [entity]: result })); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEntityById(id) {\n return entities[id];\n}", "entity(id) {\n if (arguments.length === 0) {\n return new Entity(this);\n } else {\n return internal(this).entities.get(id);\n }\n }", "get(id) {\n return internal(this).idToEntity.get(id);\n }", ...
[ "0.8494383", "0.83086544", "0.8176823", "0.7675713", "0.74615425", "0.7335095", "0.72001046", "0.71879816", "0.71684396", "0.7135162", "0.71271557", "0.69847167", "0.69668895", "0.69495004", "0.6933067", "0.6859692", "0.68372744", "0.6806569", "0.6783508", "0.6777533", "0.676...
0.6671664
28
synth, or midi port you can pass the commands for write on a file or send to another midi sequencer, synth (for playing) or midi instrument some features are still undeveloped
function MidiObject(){ //this.tracks="00";//hay que cambiarlo this.chunk_header=[];//store the header chunk here// in the future we add a funtion to include the copyright this.total_tracks=0; //number of track stored in the array this.tracks_array=[];//store the tracks with their events in this array //metodos //getters & setters MidiObject.prototype.getTrack= function(id){ return this.tracks_array[id]; }; MidiObject.prototype.getNumberTracks= function(){ return this.total_tracks; }; /*function getHex(number){ return number.toString(16); } //propuesta de herramienta para ayudar al usuario de la lib */ MidiObject.prototype.setChunk = function(user_format, tracks, user_length, user_ticks){ var track_number="00";//default values var midi_format="01"; var length="06"; var ticks="10"; // b = typeof b !== 'undefined' ? b : 1; //its ok? // return a*b; // then do it //2 line for default parameters if (user_format){ if(user_format>-1&&user_format<4){ midi_format="0"+user_format.toString(); } else{ //error no es el formato correcto console.log(user_format+" Is a wrong midi format."); } } if(tracks){ track_number=tracks.toString(); } if (user_length){ length=user_length.toString(); } if(user_ticks){ ticks==user_ticks.toString(); } //call the property and asign the headr to the MidiSketch Object this.chunk_header=["4d", "54", "68", "64", "00", "00", "00", length,// weight of the midi header chunk Allways 6 by default "00", midi_format, // single-track format //0x01 multitrack "00", track_number, // one track for testing /more tracks=poliphony "00", ticks] // 16 ticks per quarter// m0x20 === 32 ticks played more quickly } MidiObject.prototype.addTrack= function(Track){ //add a track to the Sketch-- good for writing then into a file var _ceros; var _tracknum= this.chunk_header[11]; var _new_tracknum=parseInt(_tracknum, 16)+1; if(_new_tracknum<16){ _ceros="0"; } if(_new_tracknum>15){ _ceros=""; } this.chunk_header[11]=_ceros+ _new_tracknum.toString(16); //add the new track size to the array important be exact because it doesn't work instead //console.log(Track); this.tracks_array.push(Track); this.total_tracks+=1; } //track getter //track getter midiarray MidiObject.prototype.getTrack=function(id){ if (this.tracks_array[id-1] !==undefined){ return this.tracks_array[id-1]; } else{ console.log("there is nothing inside this "+(id+1) +"track"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_synth(){\n var bus_num = create_new_bus(context.destination);\n\tadd_osc(bus_num, \"sawtooth\");\n\tadd_osc(bus_num, \"square\");\n add_osc(bus_num, \"sawtooth\");\n \n\tadd_osc(bus_num, \"sine\");\n\tadd_convolution(bus_num, \"snd/imp/impulse.wav\");\n\tadd_ADHSR_env(bus_num, 0, 0.2, 0.05...
[ "0.632904", "0.6183572", "0.6147109", "0.6067324", "0.59835654", "0.5917651", "0.59020144", "0.5870789", "0.5868602", "0.58533233", "0.5818", "0.5776972", "0.57464194", "0.5691697", "0.5684632", "0.56511664", "0.56489295", "0.55789477", "0.55648226", "0.55604744", "0.55288064...
0.50105923
92
end of Track object class
function MidiMessage( event_name, data1, data2, user_delta, user_channel){ //user channel number from 0 to 15 no string, integer please this.hex; this.messageLength; var _delta="00"; var _channel="0"; var _data1def="3c";//default middle C decimal 60 var _data2def="7f"; //default velocity d 127 if(user_delta){ _delta=user_delta; } if(user_channel){ if(user_channel<0||user_channel>15){ console.log(user_channel+" Its not a correct channel (1-16"); } else{ _channel=(user_channel-1).toString(16); } } if(data1){ if(data1<0||data1>127){ console.log(data1+" It's not a correct note number 0-127// in decimal") } else{ _data1def=data1.toString(16); } } else{ console.log("please, define the data1 value"); } if(data2){ if(data2<0||data2>127){ console.log(data1+" It's not a correct velocity value number 0-127// in decimal") } else{ _data2def=data2.toString(16); } } else{ console.log("please, define the data2 value"); } //event executions if(event_name==="noteOn"){//noteOn midi message var _noteOn=_delta+"9"+_channel+_data1def+_data2def;//data1- note number this.hex=_noteOn;//data2- velocity this.messageLength=4;// this event is 4 byte long } if (event_name==="noteOff") {//noteOff midi message var _noteOff=_delta+"8"+_channel+_data1def+_data2def;//data1-note number this.hex=_noteOff; //ata2 -velocity of key release this.messageLength=4; } if (event_name==="endTrack"){ var _fin_track="01ff2f00"; this.hex=_fin_track; //ata2 -velocity of key release this.messageLength=4; } /*if (event_name==="key"){ var _key=_delta+"ff590200";//event name //control of the key signature-- in decimals 0 == no accidents // negative numbers, number of flats-- -2 === 2 flats //positive numbers, number of sharps in the equal tonal mode var _accidents= this.hex=_key+hex_accidents; //revisar con el pdf//////////////////////////// this.messageLength=6; } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Track() {}", "function MasterTrack() {}", "function Track(o)\r\n{\r\n\tthis.nodename = \"\"; //nodename\r\n\tthis.property = \"\"; //property\r\n\tthis.duration = 0; //length of the animation\r\n\tthis.value_size = 0; //how many numbers contains every sample of this property\r\n\tthis.data = null;\r\n...
[ "0.80746186", "0.69578147", "0.66246176", "0.65037555", "0.6486355", "0.63549525", "0.63521606", "0.6281663", "0.617277", "0.6158071", "0.61524516", "0.6124985", "0.60306877", "0.59384924", "0.5901742", "0.58975875", "0.58496034", "0.58457863", "0.5836015", "0.58100414", "0.5...
0.0
-1
add more midiEventsmessages >here the objective is to include all standard midi messages end of class object MidiMessage construction and send objects transforma los Sketchobjetos en strings de midi en hexadecimal
function MidiSketch(command, SketchObject){ if(command==="write"){ //console.log(SketchObject); if(SketchObject instanceof MidiMessage){ return SketchObject.hex; } if(SketchObject instanceof MidiTrack) { return SketchObject.track_chunk+ SketchObject.track_length+ SketchObject.midi_events_array; } if(SketchObject instanceof MidiObject){ //primero la cabecera var hexstring=""; var _array_ojt=SketchObject.tracks_array; //we run inside the headerchunk parameter, and extract all the values and store it into a hexadecimalstring for (i=0; i<SketchObject.chunk_header.length; i++){ hexstring+=SketchObject.chunk_header[i];//write the chunck header concatenated in one hexadecimal string } //thes same but now run inside the tracks array, where the stored tracks would be attached for (i=0; i<SketchObject.tracks_array.length; i++){ //use console log for debugg //console.log(i+ " y "+ hexstring+ "Y" + SketchObject.tracks_array[i]); hexstring+= SketchObject.tracks_array[i].track_chunk+ _array_ojt[i].track_length+ _array_ojt[i].midi_events_array; } return hexstring; // return all together into the hexadecimal string, ready for writting on a file or other staff } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MidiMessage( event_name, data1, data2, user_delta, user_channel){\n //user channel number from 0 to 15 no string, integer please\n this.hex;\n this.messageLength;\n var _delta=\"00\";\n var _channel=\"0\";\n var _data1def=\"3c\";//default middle C decimal 60\n ...
[ "0.70966196", "0.66593134", "0.6629907", "0.6185917", "0.59809494", "0.5954331", "0.5907878", "0.5839515", "0.582315", "0.5774265", "0.57725745", "0.5757983", "0.5757983", "0.5702442", "0.56684333", "0.5656926", "0.5638134", "0.56332827", "0.5630291", "0.56143975", "0.5603741...
0.5825209
8
functions for transforming opinion(s) to Html code
function opinion2html(opinion) { //in the case of Mustache, we must prepare data beforehand: opinion.createdDate = new Date(opinion.created).toDateString(); //get the template: const template = document.getElementById("mTmplOneOpinion").innerHTML; //use the Mustache: //const htmlWOp = Mustache.render(template,opinion); const htmlWOp = render(template, opinion); //delete the createdDate item as we created it only for the template rendering: delete opinion.createdDate; //return the rendered HTML: return htmlWOp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verse1() {\n let output = ''\n output = '<p>In the heart of Holy See</p>' +\n '<p>In the home of Christianity</p>' +\n '<p>The Seat of power is in danger</p>'\n\n return output\n}", "toHTML ( theMode, sigDigs , params) {}", "function OLover2HTMLshow(quo){\r\r\n var so=OLoverHTML...
[ "0.6306691", "0.6161154", "0.59423804", "0.59075797", "0.58257955", "0.5784069", "0.5768201", "0.57210326", "0.57195795", "0.56941193", "0.56693196", "0.5649801", "0.561515", "0.5606914", "0.5604092", "0.5603173", "0.5572509", "0.5561534", "0.5554751", "0.5542017", "0.5518682...
0.63442564
0
swagger_pointname: the endpoint of swagger (for specifying the schema within the swagger2 file) Uses Swagger v2 swagger_pointname example: '/businesscurrentaccounts',
function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) { let swaggerjson = swagger_filecontent; // validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname); // let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses', '200', 'schema']); // let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].schema; let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].content['application/json'].schema; return schema; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super();\n this.name = 'serverless-plugin-swagger-endpoints';\n }", "function hello(req, res) {\n // variables defined in the Swagger document can be referenced using req.swagger.params.{parameter_name}\n //var name = req.swagger.params.name.value || 'stranger';\n\n}", "onSwagg...
[ "0.6110735", "0.5859485", "0.5848763", "0.56770724", "0.5558211", "0.55102384", "0.5417477", "0.52908945", "0.5237259", "0.52311194", "0.52173626", "0.517776", "0.5167958", "0.51644236", "0.5094158", "0.5092385", "0.5081248", "0.5066106", "0.498042", "0.49226943", "0.49119768...
0.630345
0
old interface: Schema_from_swagger_yaml(require('./wellknown.swagger.yaml')); Schema_from_swagger_yaml(yaml_file_content)
function Schema_from_swagger(schema_content) { 'use strict'; // use new this.resolve = (input_json_obj) => { //const schema = getSwaggerV2Schema(schema_content, '/default_endpoint') const schema = schema_content; const ok = schemaValidator(schema, input_json_obj); if (ok) { return input_json_obj; } else { throw new Error('mismatch: The constraint aspect of template failed'); } }; this.generate = (obj) => this.resolve(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) {\n\n let swaggerjson = swagger_filecontent;\n // validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname);\n // let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses...
[ "0.6788131", "0.6291001", "0.627871", "0.6187575", "0.6134092", "0.5878334", "0.5633782", "0.5613062", "0.5537598", "0.5500399", "0.54908156", "0.5447068", "0.5434033", "0.5412732", "0.5399147", "0.5391997", "0.5381167", "0.53721017", "0.5370661", "0.53672606", "0.5301931", ...
0.7307377
0
grafana will call this function and pass a callback function. execute the callback with your dashboard once it's ready
function asyncGraph(callback) { var dashboard = {}; window.setTimeout(function() { callback(dashboard); }, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback(){\n console.log(\"Charts Data Executed\");\n}", "function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}", "function onWidgetInitialized(dashboard, args) {\n //\tHooking to ready/destroyed events\n ...
[ "0.66811186", "0.58476686", "0.5845754", "0.5784398", "0.567192", "0.5643497", "0.5628917", "0.5628917", "0.5628917", "0.5628917", "0.5628917", "0.55949146", "0.5519947", "0.5493057", "0.54734033", "0.5454622", "0.5405336", "0.53836596", "0.53830934", "0.53577733", "0.5350956...
0.6254712
1
this function to display question and options
function DisplayQues(quesarr, optarr, index) { document.querySelector(".questionNoBox").innerHTML = "Question no " + count; document.querySelector(".questionBox").innerHTML = quesarr[index]; document.querySelector("#opt1").innerHTML = optarr[index][0]; document.querySelector("#opt2").innerHTML = optarr[index][1]; document.querySelector("#opt3").innerHTML = optarr[index][2]; document.querySelector("#opt4").innerHTML = optarr[index][3]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayQuestion() {\n\t\t\tstartTime30();\t\n\t\t\t$(\"#question\").html(eachone[count].question);\n\t\t\t$(\"#option1\").html(eachone[count].option1.answer);\n\t\t\t$(\"#option2\").html(eachone[count].option2.answer);\n\t\t\t$(\"#option3\").html(eachone[count].option3.answer);\n\t\t\t$(\"#option4\").html...
[ "0.7839162", "0.7729639", "0.7702389", "0.7502837", "0.7470076", "0.74347293", "0.7391643", "0.7376265", "0.7345987", "0.7327849", "0.73261034", "0.7322166", "0.73218083", "0.7262212", "0.72584856", "0.724914", "0.72452974", "0.718478", "0.71621937", "0.7160063", "0.7139286",...
0.7123231
22
this checks the answer
function checkans(value) { if (game === " ") { alert("Select a game"); } if (game === "java") { if (value === JavaAns[qcount]) { curr_score++; } } if (game === "c") { if (value === CAns[qcount]) { curr_score++; } } if (game === "cplus") { if (value === CPlusAns[qcount]) { curr_score++; } } if (game === "python") { if (value === PythonAns[qcount]) { curr_score++; } } qcount++; seconds=30; DisplayScore(curr_score); Quiz(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAnswers() {\n\n}", "checkResult() {\n const MAX_ANSWERS_LENGTH = 10;\n if (this.model.isDead()) {\n this.loose();\n } else if (this.model.defineAnswersLength() === MAX_ANSWERS_LENGTH) {\n this.win();\n } else {\n this.startGame();\n }\n }", "function checkAnswers(an...
[ "0.6912821", "0.6823528", "0.6757113", "0.67390555", "0.6637274", "0.6632853", "0.6561223", "0.6522037", "0.6513745", "0.648443", "0.6465354", "0.64372724", "0.6409199", "0.6407746", "0.6391609", "0.63914615", "0.6371627", "0.6366948", "0.63581717", "0.6350234", "0.63434505",...
0.0
-1
Helper function for success alert
function Alert(props) { return <MuiAlert elevation={6} variant="filled" {...props} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "alertSuccess(content) {\n alert(\"success\", content)\n }", "function AlertSuccess(msg) {\n $(\"#alertSuccess\").css('display', 'block');\n var success = \"<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span><...
[ "0.79590094", "0.74244833", "0.7323266", "0.7313692", "0.72795856", "0.72465163", "0.72221565", "0.719848", "0.7189192", "0.71766734", "0.7141358", "0.712742", "0.7126327", "0.709392", "0.70542043", "0.70228773", "0.6974896", "0.6971931", "0.69339854", "0.6916426", "0.6915723...
0.0
-1
pass server response into an object
function getUsers(users) { const userList = JSON.parse(users); getRepos(userList); displayUser(userList) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getResponseObj(response, callback) {\n\tvar serverData = '';\n\tresponse.on('data', function(chunk) {\n\t\tserverData += chunk;\n\t});\n\n\tresponse.on('end', function() {\n\t\tif(callback != null)\n\t\t\tcallback(JSON.parse(serverData));\n\t});\n}", "function NWTIOResponse (request) {\n\tthis.request =...
[ "0.7067715", "0.690353", "0.68746305", "0.6598924", "0.65437895", "0.6533029", "0.65246516", "0.649672", "0.6442917", "0.64121", "0.6405134", "0.63961935", "0.63860685", "0.6385292", "0.6352331", "0.6351982", "0.6349718", "0.6349718", "0.63416886", "0.6317918", "0.6285735", ...
0.0
-1
send request to get all user repositories
function displayUser(users) { Promise.all(users.map(function(user) { const userDisplay = document.createElement('div'); userDisplay.className= "user" userDisplay.innerHTML = user.login; document.body.appendChild(userDisplay); })) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "repositories(username) {\n return this.request(`/users/${username}/repos`);\n }", "function getRepositories(username) {\n // console.log('Function called: getRepositories()');\n let urlRepository = `https://api.github.com/users/${username}/repos`;\n fetch(urlRepository).then((response) => {\n ...
[ "0.78215235", "0.7514822", "0.7474211", "0.746273", "0.70939463", "0.70924145", "0.7090029", "0.7062159", "0.70045006", "0.7002224", "0.695895", "0.6958748", "0.6957067", "0.69214356", "0.6881332", "0.68375385", "0.6797113", "0.6796072", "0.67531645", "0.6747702", "0.67408663...
0.0
-1
Exits the database connection via mongoose
function exit() { mongoose.disconnect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disconnect() {\n mongoose.connection.close();\n}", "function exit(){\n mongoose.disconnect();\n}", "function exit() {\n mongoose.disconnect();\n}", "function exit() {\r\n mongoose.disconnect();\r\n}", "disconnect() {\n mongoose.connection.close();\n this.connected = false;\n }", "di...
[ "0.7734291", "0.76625323", "0.7640811", "0.75648713", "0.74477345", "0.7317763", "0.72882223", "0.7280426", "0.7236973", "0.72127885", "0.72127885", "0.71561474", "0.7108676", "0.7026041", "0.6977602", "0.6873794", "0.68703586", "0.6864171", "0.6788023", "0.67015725", "0.6661...
0.7455724
4
read keys from key.json as an array
function getKeyInfo(keyJson){ var keyInfo = {}; keyInfo.arr = []; keyInfo.updateYear = keyJson[0].updateYear; keyInfo.updateMonth = keyJson[0].updateMonth; for(var i = 0; i<keyJson.length; i++){ if(keyJson[i].expire == "false"){ keyInfo.arr.push(keyJson[i].key); } } return keyInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyToArray(key) {\n if (!key) return [];\n if (typeof key != \"string\") return key;\n return key.split('.');\n }", "keys(key) {\n return state[`keys.${key}`] || [];\n }", "keys() {\n const keysArray = [];\n for (let i = 0; i < this.data.le...
[ "0.64732945", "0.6385631", "0.6296652", "0.6220346", "0.6126636", "0.6126636", "0.60790753", "0.6013503", "0.59854645", "0.59023184", "0.58518124", "0.5729408", "0.567515", "0.56726915", "0.56368244", "0.5603044", "0.5596861", "0.558372", "0.55745333", "0.55432165", "0.552862...
0.5379029
71
Calculate the time gap
function getTime(startTime){ endTime = new Date(); return (endTime-startTime)/1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function B(a){return a.clone().stripTime().diff(G.start,\"days\")}", "function main() {\n var testCases = nextInt();\n var AC, AJ, DC, JK, full, DCSUm, JKSum, res, gaps, gapsDC, gapsJK;\n\n for (var testCase = 1; testCase <= testCases; ++testCase) {\n res = 0;\n AC = nextInt();\n AJ = nextInt();\n\n ...
[ "0.6467856", "0.60338944", "0.5960126", "0.5890192", "0.58631605", "0.5702654", "0.5692202", "0.5681206", "0.5675939", "0.56543803", "0.565272", "0.55481726", "0.55466646", "0.5520459", "0.5510194", "0.54867524", "0.5478566", "0.5470181", "0.5461966", "0.5461962", "0.5457977"...
0.0
-1
Get the Api key from tinypng.com See
function getKey(arr){ keyIndex = Math.floor(Math.random()*arr.length); console.log(arr[keyIndex]); return arr[keyIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAPIKey(){\n\n}", "function returnAPIKey(){\r\n\treturn \"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\";\r\n}", "function getAPIKey(){\n\treturn $('#api-key-input').val();\n}", "function getAPIKey() {\n return ss.getRange(API_KEY).getValue();\n}", "async function GetAP...
[ "0.736854", "0.68941015", "0.64681", "0.6440716", "0.6202085", "0.6140758", "0.60869175", "0.60404205", "0.60404205", "0.59931517", "0.5981127", "0.59727716", "0.58256686", "0.5800005", "0.5774258", "0.5770642", "0.5770642", "0.57602453", "0.57327396", "0.56934637", "0.569107...
0.0
-1
Romove the useless api key from key file and draw a new key from it
function removeBadKey(keyIndex){ keyJson[keyIndex + 1].expire = "true"; fs.writeFile("key.json",JSON.stringify(keyJson)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewApikey() {\n var newApikey = \"\";\n var alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 16; i++) {\n newApikey += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n\n return newApikey;\n}", "function getNewApikey() {\...
[ "0.67026174", "0.6672109", "0.6672109", "0.66440326", "0.6391867", "0.61754555", "0.61346287", "0.59729135", "0.5920984", "0.5904363", "0.58595127", "0.5856597", "0.58514726", "0.58473736", "0.58209825", "0.57977927", "0.5777562", "0.5774666", "0.57547617", "0.57395816", "0.5...
0.5443478
41
reset the key file in the beginning of every month
function resetKeyFile(){ startTime = new Date(); var month = startTime.getMonth() + 1; var year = startTime.getFullYear(); var date = startTime.getDate(); if((month > keyInfo.updateMonth || year > keyInfo.updateYear) && date >1 ){ console.log("yes"); keyJson[0].updateYear = year; keyJson[0].updateMonth = month; for(var i = 1; i<keyJson.length; i++){ keyJson[i].expire = "false"; } fs.writeFile("key.json",JSON.stringify(keyJson)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetFile() {\n fs.writeFileSync(DATASTORE_FILENAME, JSON.stringify({\n 'users': {},\n 'notifications': {}\n }))\n}", "function resetWkbk() {\n workbook.revertAllAsync();\n }", "async reset () {\n let keys = await this.client.zRange(this.ZSET_KEY, 0, -1);\n await this.s...
[ "0.58668953", "0.561359", "0.5587326", "0.5567813", "0.5566154", "0.5477541", "0.5417211", "0.54039294", "0.5378549", "0.53601503", "0.5350594", "0.53137445", "0.5281797", "0.5107134", "0.50998724", "0.508927", "0.5067068", "0.5057745", "0.5057745", "0.50276", "0.5025315", ...
0.8331846
0
Global variable from html: stats phases port_plot_data_1 port_plot_data_2 ports_side_data ports_seg_data
function plot_phases(){ let data = []; let index = phases["index"]; let order = ["otg", "take_off", "landing", "climb", "descent", "hold", "cruise"]; for (let phase of order) { let fill = phase=="otg"?'tozeroy':'tonexty'; data.push({ y: phases[phase], x: index, name: phase, line: {shape: 'hv'}, fill: 'tozeroy', type: "scatter" }); } let layout = {height: 400, title: "Flight phases", xaxis: {title: "Time (s)"}, yaxis: {title: "Phase", range:[0,8]} }; Plotly.newPlot('plot_phases', data, layout, {displaylogo: false}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStats() {\n\tvar temp = event.data.replace(\"updateStats\", \"\");\n\ttemp = temp.split(\"#\");\n\tfor (var i = 0; i < temp.length; i++) {\n\t\ttemp[i] = temp[i].split(\";\");\n\t}\n\t// console.log(temp);\n\tdocument.getElementById('p1name').innerText = temp[0][0];\n\tdocument.getElementById('p2name')...
[ "0.5305533", "0.52872103", "0.51466143", "0.51402545", "0.49268374", "0.49146375", "0.48846808", "0.48846665", "0.48797426", "0.48766845", "0.48365775", "0.48317364", "0.48111144", "0.48028806", "0.4767581", "0.47230053", "0.4719395", "0.4690483", "0.46810418", "0.4678433", "...
0.0
-1
Complete initialization work that sould be done prior to DOMReady, like setting the page's zoom level.
function initializePreDomReady() { for (var i in settingsToLoad) { getSetting(settingsToLoad[i]); } var isEnabledForUrlPort = chrome.extension.connect({ name: "isEnabledForUrl" }); isEnabledForUrlPort.postMessage({ url: window.location.toString() }); var getZoomLevelPort = chrome.extension.connect({ name: "getZoomLevel" }); getZoomLevelPort.postMessage({ domain: window.location.host }); refreshCompletionKeys(); // Send the key to the key handler in the background page. keyPort = chrome.extension.connect({ name: "keyDown" }); if (navigator.userAgent.indexOf("Mac") != -1) platform = "Mac"; else if (navigator.userAgent.indexOf("Linux") != -1) platform = "Linux"; else platform = "Windows"; chrome.extension.onConnect.addListener(function(port, name) { if (port.name == "executePageCommand") { port.onMessage.addListener(function(args) { if (this[args.command]) { for (var i = 0; i < args.count; i++) { this[args.command].call(); } } refreshCompletionKeys(args.completionKeys); }); } else if (port.name == "getScrollPosition") { port.onMessage.addListener(function(args) { var scrollPort = chrome.extension.connect({ name: "returnScrollPosition" }); scrollPort.postMessage({ scrollX: window.scrollX, scrollY: window.scrollY, currentTab: args.currentTab }); }); } else if (port.name == "setScrollPosition") { port.onMessage.addListener(function(args) { if (args.scrollX > 0 || args.scrollY > 0) { window.scrollBy(args.scrollX, args.scrollY); } }); } else if (port.name == "returnCurrentTabUrl") { port.onMessage.addListener(function(args) { if (getCurrentUrlHandlers.length > 0) { getCurrentUrlHandlers.pop()(args.url); } }); } else if (port.name == "returnZoomLevel") { port.onMessage.addListener(function(args) { currentZoomLevel = args.zoomLevel; if (isEnabledForUrl) setPageZoomLevel(currentZoomLevel); }); } else if (port.name == "returnIsEnabledForUrl") { port.onMessage.addListener(function(args) { isEnabledForUrl = args.isEnabledForUrl; if (isEnabledForUrl) initializeWhenEnabled(); else if (HUD.isReady()) // Quickly hide any HUD we might already be showing, e.g. if we entered insertMode on page load. HUD.hide(); }); } else if (port.name == "returnSetting") { port.onMessage.addListener(setSetting); } else if (port.name == "refreshCompletionKeys") { port.onMessage.addListener(function (args) { refreshCompletionKeys(args.completionKeys); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function init() {\n documentReady(documentLoaded);\n}", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n ...
[ "0.7400017", "0.7186406", "0.70748883", "0.70723736", "0.70716417", "0.6862576", "0.6858729", "0.67703164", "0.66767764", "0.6649554", "0.66261065", "0.6603607", "0.6601508", "0.6596948", "0.65893227", "0.65818423", "0.65741175", "0.6574037", "0.65695924", "0.6562088", "0.653...
0.0
-1
This is called once the background page has told us that Vimium should be enabled for the current URL.
function initializeWhenEnabled() { document.addEventListener("keydown", onKeydown, true); document.addEventListener("focus", onFocusCapturePhase, true); document.addEventListener("blur", onBlurCapturePhase, true); enterInsertModeIfElementIsFocused(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monitorCurrentPage() {\n $('#monitor_page').addClass('inprogress');\n chrome.tabs.getSelected(null, function(tab) {\n initializePageModePickerPopup(tab);\n _gaq.push(['_trackEvent', tab.url, 'add']);\n\n chrome.tabs.getAllInWindow(null, function(tabs){\n var found = false;\n for (var i = ...
[ "0.60860986", "0.56952417", "0.5682569", "0.5679797", "0.56595945", "0.5634489", "0.5613012", "0.5492859", "0.54903316", "0.54325545", "0.5382275", "0.5376455", "0.5355305", "0.53291947", "0.53291947", "0.53291947", "0.5315835", "0.5305605", "0.528541", "0.52752507", "0.52623...
0.0
-1
Initialization tasks that must wait for the document to be ready.
function initializeOnDomReady() { if (isEnabledForUrl) enterInsertModeIfElementIsFocused(); // Tell the background page we're in the dom ready state. chrome.extension.connect({ name: "domReady" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function _Initialise(){\r\n\t\t\r...
[ "0.7358949", "0.69637525", "0.68384737", "0.67911154", "0.6759726", "0.6733014", "0.6672722", "0.6662465", "0.66331744", "0.6573661", "0.65724915", "0.6566025", "0.65472597", "0.65230215", "0.6488674", "0.6473985", "0.64668196", "0.6442883", "0.64143026", "0.63960403", "0.639...
0.0
-1
Checks the currently focused element of the document and will enter insert mode if that element is focusable.
function enterInsertModeIfElementIsFocused() { // Enter insert mode automatically if there's already a text box focused. // TODO(philc): Consider using document.activeElement here instead. var focusNode = window.getSelection().focusNode; var focusOffset = window.getSelection().focusOffset; if (focusNode && focusOffset && focusNode.children.length > focusOffset && isInputOrText(focusNode.children[focusOffset])) enterInsertMode(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "if (!node.contains(document.activeElement)) {\n node.focus();\n }", "hasFocus() {\n if (ie) {\n let node = this.root.activeElement;\n if (node == this.dom)\n return true;\n if (!node || !this.dom.contains(node))\n return false;\n while (node && this.dom != node && thi...
[ "0.6649512", "0.64950323", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6388412", "0.6274966", "0.62441874", "0.6206417", "0.620398", "0.6192266", "0.6175595", "0.6147924", "0.6128395", "0.6114575", "0.61063015", "0.60964894", "0.60964894",...
0.8227385
0
Asks the background page to persist the zoom level for the given domain to localStorage.
function saveZoomLevel(domain, zoomLevel) { if (!saveZoomLevelPort) saveZoomLevelPort = chrome.extension.connect({ name: "saveZoomLevel" }); saveZoomLevelPort.postMessage({ domain: domain, zoomLevel: zoomLevel }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreOptions(){\r\n chrome.storage.local.get({\r\n zoomFactor: 1.0\r\n }, function(items){\r\n document.getElementById('zoom-factor').value = parseFloat(items.zoomFactor.toFixed(2));\r\n document.getElementById(\"zoom-percentage\").innerHTML = Math.round(items.zoomFactor * 100...
[ "0.6347569", "0.60518104", "0.589043", "0.5695572", "0.56647485", "0.5611295", "0.5580931", "0.5572764", "0.5561502", "0.5559303", "0.5553714", "0.55410075", "0.54979324", "0.5477195", "0.5449793", "0.54494435", "0.5441498", "0.5437589", "0.54327095", "0.5404099", "0.5399655"...
0.7473462
0
Zoom in increments of 20%; this matches chrome's CMD+ and CMD keystrokes. Set the zoom style on documentElement because document.body does not exist prepage load.
function setPageZoomLevel(zoomLevel, showUINotification) { document.documentElement.style.zoom = zoomLevel + "%"; if (document.body) HUD.updatePageZoomLevel(zoomLevel); if (showUINotification) HUD.showForDuration("Zoom: " + currentZoomLevel + "%", 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setZoom() {\r\n zoom = 2.0;\r\n}", "function setZoom() {\r\n zoom = 2.0;\r\n}", "function Zoom() {\n var winHeight = $(window).height();\n var zoom = 1;\n var bodyMaxHeight = 1331;\n zoom = winHeight/bodyMaxHeight;\n /* Firefox */\n var winWidth = $(wind...
[ "0.7327614", "0.7327614", "0.7226405", "0.7171419", "0.6890248", "0.6853931", "0.67065376", "0.6682666", "0.65893877", "0.6543071", "0.653001", "0.6487431", "0.6479684", "0.6447626", "0.6445381", "0.6366776", "0.63504165", "0.6331688", "0.6328432", "0.6309554", "0.6305625", ...
0.63762826
15
Sends everything except i & ESC to the handler in background_page. i & ESC are special because they control insert mode which is local state to the page. The key will be are either a single ascii letter or a keymodifier pair, e.g. for control a. Note that some keys will only register keydown events and not keystroke events, e.g. ESC.
function onKeydown(event) { var keyChar = ""; if (linkHintsModeActivated) return; // Ignore modifier keys by themselves. if (event.keyCode > 31) { var keyIdentifier = event.keyIdentifier; // On Windows, the keyIdentifiers for non-letter keys are incorrect. See // https://bugs.webkit.org/show_bug.cgi?id=19906 for more details. if (platform == "Windows" || platform == "Linux") keyIdentifier = keyIdentifierCorrectionMap[keyIdentifier] || keyIdentifier; unicodeKeyInHex = "0x" + keyIdentifier.substring(2); keyChar = String.fromCharCode(parseInt(unicodeKeyInHex)).toLowerCase(); // Enter insert mode when the user enables the native find interface. if (keyChar == "f" && !event.shiftKey && ((platform == "Mac" && event.metaKey) || (platform != "Mac" && event.ctrlKey))) { enterInsertMode(); return; } if (event.shiftKey) keyChar = keyChar.toUpperCase(); if (event.ctrlKey) keyChar = "<c-" + keyChar + ">"; if (event.metaKey) keyChar = null; } if (insertMode && event.keyCode == keyCodes.ESC) { // Note that we can't programmatically blur out of Flash embeds from Javascript. if (event.srcElement.tagName != "EMBED") { // Remove focus so the user can't just get himself back into insert mode by typing in the same input box. if (isInputOrText(event.srcElement)) { event.srcElement.blur(); } exitInsertMode(); } } else if (findMode) { if (event.keyCode == keyCodes.ESC) exitFindMode(); else if (keyChar) { handleKeyCharForFindMode(keyChar); // Don't let the space scroll us if we're searching. if (event.keyCode == keyCodes.space) event.preventDefault(); } // Don't let backspace take us back in history. else if (event.keyCode == keyCodes.backspace || event.keyCode == keyCodes.deleteKey) { handleDeleteForFindMode(); event.preventDefault(); } else if (event.keyCode == keyCodes.enter) handleEnterForFindMode(); } else if (!insertMode && !findMode && keyChar) { if (currentCompletionKeys.indexOf(keyChar) != -1) { event.preventDefault(); event.stopPropagation(); } keyPort.postMessage(keyChar); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instructionScreenKeyHandler(key) \n{\n switch (key)\n {\n case \"Escape\":\n game.context = '0';\n game.levelNumber = 0;\n break;\n \n case \"ArrowLeft\":\n if (game.levelNumber > 0) game.levelNumber--;\n break;\n\n c...
[ "0.61679", "0.6142176", "0.61072046", "0.60505444", "0.60253537", "0.5940192", "0.59013516", "0.5836257", "0.57199824", "0.5689657", "0.56724274", "0.5653734", "0.56348175", "0.56214106", "0.5614806", "0.561061", "0.5602841", "0.5598244", "0.5595935", "0.5567917", "0.55560786...
0.0
-1
Returns true if the element is focusable. This includes embeds like Flash, which steal the keybaord focus.
function isFocusable(element) { return isInputOrText(element) || element.tagName == "EMBED"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusable(element) {\n\t\t\t\t\t// Use the defined focusable checker when possible\n\t\t\t\t\tif ($.expr[':'].focusable) {\n\t\t\t\t\t\treturn $.expr[':'].focusable;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tvar isTabIndexNotNaN = !isNaN($.attr(element, 'tabindex')),\n\t\t\t\t\t nodeName = element.nodeName && elemen...
[ "0.77805924", "0.77609503", "0.7703886", "0.7479171", "0.74658275", "0.732273", "0.7255446", "0.7227287", "0.72002697", "0.71984595", "0.71633047", "0.71633047", "0.71633047", "0.71633047", "0.7161074", "0.7154766", "0.7136588", "0.7121359", "0.7070783", "0.7070783", "0.70707...
0.84320706
0
Input or text elements are considered focusable and able to receieve their own keyboard events, and will enter enter mode if focused. Note: we used to discriminate for textonly inputs, but this is not accurate since all input fields can be controlled via the keyboard, particuarlly SELECT combo boxes.
function isInputOrText(target) { var focusableInputs = ["input", "textarea", "select", "button"]; return focusableInputs.indexOf(target.tagName.toLowerCase()) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n var isReadOnly = el.readOnly;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n ...
[ "0.66177005", "0.6552543", "0.6396089", "0.62923485", "0.6270373", "0.6253724", "0.620435", "0.6187073", "0.61057436", "0.60752434", "0.6061508", "0.6040187", "0.6040187", "0.6040073", "0.6029886", "0.6013559", "0.5984237", "0.5984237", "0.5968751", "0.5960234", "0.5944438", ...
0.5596671
76
We need this so that the find mode HUD doesn't match its own searches.
function insertSpaces(query) { var newQuery = ""; for (var i = 0; i < query.length; i++) { if (query[i] == " " || (i + 1 < query.length && query[i + 1] == " ")) newQuery = newQuery + query[i]; else newQuery = newQuery + query[i] + "<span style=\"font-size: 0px;\"> </span>"; } return newQuery; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doubleSearch () {}", "function _launchFind() {\n var editor = EditorManager.getFocusedEditor();\n if (editor) {\n var codeMirror = editor._codeMirror;\n\n // Bring up CodeMirror's existing search bar UI\n codeMirror.execCommand(\"find\");\n\n // ...
[ "0.6082028", "0.6027638", "0.600003", "0.5767678", "0.56559587", "0.5632707", "0.5623649", "0.55380046", "0.542557", "0.53851926", "0.53812", "0.5330543", "0.527344", "0.5178206", "0.5168843", "0.51355743", "0.5126327", "0.5125466", "0.51208574", "0.51127166", "0.5111031", ...
0.0
-1
Report info in console
function reportInfo(vars, showType = false) { if (showType === true) console.log(typeof vars); console.log(vars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function info() {\n\tseperator();\n\tOutput('<span>>info:<span><br>');\n\tOutput('<span>Console simulator by Mario Duarte https://codepen.io/MarioDesigns/pen/JbOyqe</span></br>');\n}", "function showInfoConsole(){\n var msg = clc.xterm(221);\n console.clear;\n console.info(\" ...
[ "0.74332", "0.69564277", "0.68985623", "0.6885694", "0.67392135", "0.67392135", "0.6701192", "0.663166", "0.6609604", "0.6606793", "0.6536496", "0.653191", "0.6507201", "0.6501332", "0.6458283", "0.6458283", "0.6446817", "0.64459467", "0.6441109", "0.6441109", "0.64379674", ...
0.0
-1
Set value via localStorage
function setValue(item, value) { window.localStorage[item] = (typeof value === 'string') ? value : JSON.stringify(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLS(key,value){\n window.localStorage.setItem(key, JSON.stringify(value));\n\n}", "function setLocalValue( key, value ) {\n\twindow.localStorage.setItem( key, value );\n\t/*console.log(\"key: \" + key + \", value: \" + value);\n\tconsole.log( getLocalValue( key ) );*/\n\twindow.location.href = \"pa...
[ "0.77329993", "0.76940364", "0.7648986", "0.76454145", "0.76193804", "0.7613673", "0.759538", "0.7592993", "0.757655", "0.7573321", "0.7558269", "0.75386804", "0.7531605", "0.75293916", "0.75293916", "0.75050634", "0.7476166", "0.7427593", "0.7425734", "0.73765206", "0.734024...
0.7550124
11
Get value via localStorage
function getValue(item, toJSON) { return (window.localStorage[item]) ? ((toJSON) ? JSON.parse(window.localStorage[item]) : window.localStorage[item]) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_value_from_local_storage(key)\n{\n\ttry\n\t{\n\t\treturn localStorage.getItem(key);\n\t} catch(e)\n\t{\n\t\treturn false;\n\t}\n}", "getStorage(arg1) {\n return window.localStorage.getItem(arg1);\n\n }", "get(key) {\n return localStorage.getItem(key);\n }", "get(key) {\n ...
[ "0.76647604", "0.7520878", "0.7473302", "0.7473302", "0.74034417", "0.73893595", "0.7374087", "0.7371265", "0.73617834", "0.7358599", "0.73564845", "0.7309971", "0.729305", "0.7292433", "0.72811455", "0.7243641", "0.7225212", "0.7213296", "0.72114694", "0.7208133", "0.7201163...
0.7051449
45
Sets the clicked on button in top nav to active
function setNavActive() { $('.nav-a.active').toggleClass('active'); $(this).toggleClass('active'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleActive() {\n // On first render\n if (element.find(\"a\").attr(\"href\").indexOf($location.path()) >= 0) {\n element.addClass(\"active\");\n }\n else {\n element.removeClass(\"active\");\n }\n }", "function...
[ "0.6968783", "0.6938113", "0.68505067", "0.6844241", "0.6789033", "0.6783069", "0.6775138", "0.67592806", "0.66775686", "0.6647133", "0.6647133", "0.6636395", "0.6616018", "0.65706956", "0.65584445", "0.6557393", "0.6556527", "0.65522313", "0.6543197", "0.6541593", "0.6526025...
0.7003854
0
Sets selected menu item to active
function setMenuActive() { $('.menu-li.active').toggleClass('active'); $(this).toggleClass('active'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentMenuItem() {\n var activePageId = $('.page.active').attr('id');\n // set default nav menu\n $('.vs-nav a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');\n }", "setActive(menuItem) {\n if (this.activeItem =...
[ "0.76044244", "0.7429572", "0.7429572", "0.7259269", "0.70615494", "0.7054481", "0.7020118", "0.6979382", "0.69325376", "0.6882961", "0.6882961", "0.6882961", "0.68644553", "0.68334115", "0.6811759", "0.6799273", "0.6761201", "0.6716108", "0.67077816", "0.6668017", "0.6642498...
0.7510343
1
Removes any additional added changes to menu and sets menu to right
function setMenuRight() { removeMenuChanges(); $('.menu').addClass('menu-right'); $('.window').addClass('window-menu-right'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeMenuChanges() {\n let menu = document.getElementById('resizable');\n\n if (menu.style.right) {\n menu.style.right = null;\n }\n if (menu.style.left) {\n menu.style.left = null;\n }\n\n $('.menu').removeClass('menu-left');\n $('.menu').removeClass('menu-right');\n $(...
[ "0.7147932", "0.7004216", "0.6714349", "0.6509055", "0.64456993", "0.640683", "0.6341509", "0.6341391", "0.6314558", "0.6283051", "0.6283051", "0.6283051", "0.62635094", "0.6233958", "0.6103202", "0.607581", "0.6064757", "0.6061353", "0.60591567", "0.60373396", "0.60236144", ...
0.8001773
0
Removes any prior added changes to the menu due to resizing or nav selection
function removeMenuChanges() { let menu = document.getElementById('resizable'); if (menu.style.right) { menu.style.right = null; } if (menu.style.left) { menu.style.left = null; } $('.menu').removeClass('menu-left'); $('.menu').removeClass('menu-right'); $('.window').removeClass('window-menu-right'); $('.menu-bottom').addClass('hidden'); $('.menu').removeClass('hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span>...
[ "0.66702044", "0.66484255", "0.6647768", "0.66096056", "0.66072303", "0.6554772", "0.65308267", "0.6492136", "0.6454294", "0.6343421", "0.6317668", "0.630887", "0.6273935", "0.6241688", "0.6180856", "0.6145567", "0.6072706", "0.6031134", "0.6022506", "0.6005267", "0.6003781",...
0.7978572
0
Sets menu to left side
function setMenuLeft() { removeMenuChanges(); $('.menu').addClass('menu-left'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOnLeftSubMenu() {\r\n\t\t\t\r\n\t\t\t// Show on left class for minimal styling.\r\n\t\t\t$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function () {\r\n\t\t\t\t\r\n\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\r\n\t\t\t\tif ($(this).offset().left + $(this).outerWidth()...
[ "0.739949", "0.7246403", "0.7057252", "0.7042962", "0.695572", "0.695572", "0.695572", "0.6851523", "0.67294085", "0.6717853", "0.6677837", "0.66075015", "0.65854055", "0.6577361", "0.6538951", "0.6534131", "0.65103406", "0.6505403", "0.65028065", "0.64169276", "0.6393186", ...
0.8560616
0
MENU BOTTOM Hides side menu
function hideSideMenu() { $('.menu').addClass('hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideOrShowMenus(){\n\tresizeSidebar(\"menu\");\n}", "function disableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" && typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"visible\";\r\n\treturn 0;\r\n}", "function menuHide() {\n ui.lan...
[ "0.6851475", "0.6823965", "0.6640691", "0.6632173", "0.6527594", "0.64515966", "0.6439914", "0.6384937", "0.6383023", "0.6374779", "0.63484186", "0.63368857", "0.6255914", "0.6218215", "0.62005925", "0.61936975", "0.6181428", "0.61752415", "0.61665326", "0.61537594", "0.61384...
0.69680154
0
Enables selecting a menu item in menu bottom
function setMenuBottomActive() { $('.menu-a-bottom.active').toggleClass('active'); $(this).toggleClass('active'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_menubuttonTap(e) {\n this.shadowRoot.querySelector(\"#listbox\").style.display = \"inherit\";\n if (this.resetOnSelect) {\n this.selected = \"\";\n }\n }", "function selectMenuItem(item) {\n self.selected = item;\n $state.go(item);\n self.t...
[ "0.69176525", "0.6873769", "0.67140114", "0.67008716", "0.6627248", "0.65748805", "0.64745903", "0.6410071", "0.6407965", "0.6396996", "0.6386956", "0.6386956", "0.63793784", "0.6365093", "0.6354581", "0.63404286", "0.6335578", "0.6332524", "0.632574", "0.6317218", "0.6306948...
0.0
-1
Strict equality (===) is the counterpart to the equality operator (==). Unlike the equality operator, strict equality tests both the data type and value of the compared elements. Examples In the second example, 3 is a Number type and '3' is a String type. Use the strict equality operator in the if statement so the function will return "Equal" when val is strictly equal to 7 Setup
function testStrict(val) { if (val===7) { // Change this line   return "Equal"; } return "Not Equal"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testStrict(val) {\n if (val === 7) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n if (val === 7) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n if (val === 7) {\n ...
[ "0.7602961", "0.7592505", "0.75663", "0.75502896", "0.7547867", "0.7545496", "0.74012995", "0.73176223", "0.69825166", "0.69384086", "0.69259346", "0.6925422", "0.68923634", "0.68684536", "0.68684536", "0.682787", "0.682787", "0.68186265", "0.67254347", "0.6722092", "0.670242...
0.7531131
6
add any needed code to ensure that the smurfs collection exists on state and it has data coming from the server Notice what your map function is looping over and returning inside of Smurfs. You'll need to make sure you have the right properties on state and pass them down to props.
componentDidMount() { this.getSmurfs() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n this.props.getSmurfs();\n }", "FetchSmurfs() {\n axios\n .get(`${baseUrl}`)\n .then(res => {\n this.setState({ smurfs: res.data });\n })\n .catch(err => {\n console.log(console.log(err));\n this.setState({ errorMessage: err.statusText });\n ...
[ "0.63221604", "0.6131576", "0.59023124", "0.5834316", "0.5821248", "0.57196486", "0.5716349", "0.5657892", "0.56429493", "0.56177115", "0.55641407", "0.5518442", "0.549542", "0.5489891", "0.548708", "0.5474417", "0.54593337", "0.5457613", "0.54330695", "0.5429547", "0.5425852...
0.629228
1
Helper Functions Dropdown Open
function dropdownOpen(object) { if(is_auto_align){ autoAlign(object); } if ((options.hover && !object.hasClass('active')) || (!options.hover && !object.hasClass('open'))){ if(!object.hasClass("active")){ object.addClass('active'); object.stop(true,false).slideDown({ duration: options.inDuration, easing: "easeOutQuart", queue: false, complete: function() { object.addClass('open'); $(this).css('height', ''); } }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "openDropdown() {\n $('#metroAreaDropdownButton').trigger('open');\n }", "_open() {\n this.$.dropdown.open();\n this.$.cursor.setCursorAtIndex(0);\n Polymer.dom.flush();\n this.$.cursor.target.focus();\n }", "open () {\n\t\t\tthis.el.classList.add('dropdown_open');\n\t\t this.t...
[ "0.7301799", "0.7111102", "0.70105845", "0.7008019", "0.7001923", "0.6990401", "0.698814", "0.6898997", "0.6882055", "0.6820082", "0.67546654", "0.67482877", "0.6734401", "0.673249", "0.67316073", "0.6683926", "0.66683596", "0.6629569", "0.66192245", "0.6616531", "0.66032064"...
0.70078427
4
START Fill Applicant Publications
function ApplicantPublications_GenerateButton(){ var clickEvent = function (e) { ApplicantPublications_FillForm(); } var inputBootstrap = createBootstrapButtonElement('GM Fill Form', 'NEWPortal_ApplicantExperience_FillButton'); inputBootstrap.onclick = clickEvent; insertAfter(document.getElementById('save'), inputBootstrap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takeSelectedApplicant() {\n\tofferToApplicant = getURLParameter(\"AID\");\n\n\tvar username = tmpApplicantUserName; // wird in function\n\t// markOfferSelected(id)\n\t// initialisiert\n\n\t// alert(\"username: \"+username);\n\n\tconnect(\"/hiwi/Provider/js/takeSelectedApplicant\", \"aid=\"\n\t\t\t+ offerT...
[ "0.5320105", "0.52702105", "0.5175638", "0.51134676", "0.51078737", "0.50882065", "0.5069123", "0.50587296", "0.50564486", "0.5038789", "0.5028549", "0.5018491", "0.5016163", "0.49958947", "0.49903733", "0.49903733", "0.49795118", "0.49791926", "0.49716425", "0.49691746", "0....
0.55660033
0
below function is for image validation
function check(file) { var filename=file.value; var ext=filename.substring(filename.lastIndexOf('.')+1); if(ext=="jpg" || ext=="png" || ext=="jpeg" || ext=="gif" || ext=="JPG" || ext=="PNG" || ext=="JPEG" || ext=="GIF") { document.getElementById("submit").disabled=false; document.getElementById("msg1").innerHTML=""; } else { document.getElementById("msg1").innerHTML="! Please upload only JPG , GIF , JPEG File"; document.getElementById("submit").disabled=true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateImg(ctrl) {\n var fileUpload = ctrl;\n var regex = new RegExp(\"([a-zA-Z0-9\\s_\\\\.\\-:])+(.jpeg|.jpg|.png|.gif)$\");\n if (regex.test(fileUpload.value.toLowerCase())) {\n if (typeof (fileUpload.files) != \"undefined\") {\n var reader = new FileReader();\n re...
[ "0.81135786", "0.79945785", "0.79666895", "0.7904438", "0.75314087", "0.7440538", "0.7417404", "0.7410234", "0.7363304", "0.7164638", "0.7158257", "0.7127481", "0.70516634", "0.700713", "0.6968656", "0.69049245", "0.68455446", "0.6762769", "0.67513007", "0.67327356", "0.66808...
0.0
-1
Below Function is or PDF file Validation
function check1(file) { var filename=file.value; var ext=filename.substring(filename.lastIndexOf('.')+1); if(ext=="pdf") { document.getElementById("submit").disabled=false; document.getElementById("msg1").innerHTML=""; } else { document.getElementById("msg1").innerHTML="! Please upload only Pdf File"; document.getElementById("submit").disabled=true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validatePDF() {\n if (this.hasExistingPDF()) {\n this.requiredPDF.check()\n return true\n } else if (this.primary_pdf_upload.hasFiles && this.onlyOnePdfAllowed() && this.isAPdf()) {\n this.requiredPDF.check()\n return true\n } else {\n this.requiredPDF.uncheck()\n return fals...
[ "0.75290984", "0.73973876", "0.7146534", "0.7021656", "0.6979149", "0.67986125", "0.6759464", "0.6586638", "0.6563994", "0.64976907", "0.6400455", "0.6348961", "0.63258517", "0.62632644", "0.6261901", "0.6231844", "0.62240165", "0.61931247", "0.61180466", "0.60936517", "0.608...
0.7045202
3
searchbtn() end search result output into displayData() area
function displayData(allData) { const data = allData.data console.log(data) let list =[] //put 10 data as object into list----------------------- for (let i = 0; i < 10; i++) { const item = { title: data[i].title, albumTitle: data[i].album.title, albumImage: data[i].album.cover_small, artistName: data[i].artist.name, artistPicture: data[i].artist.picture_small, albumDuration: data[i].duration, } list.push(item) console.log(list) } //*********** showing output result as html into displayResults area*************** let displayResults = document.getElementById("output") displayResults.innerHTML = "" displayResults.style.display = 'block' for (let i = 0; i < list.length; i++) { let {title, albumTitle, albumImage, artistName, artistPicture, albumDuration} = list[i]; displayResults.innerHTML += `<div class="single-result row align-items-center my-3 p-3"> <div class="col-md-6"> <h3 class="lyrics-name mb-3">${title}</h3> <p class="author lead">Artist: <span style="font-weight:600">${artistName}</span></p> <p style="margin-top: -15px;" class="author lead">Album: <span style="font-weight:600">${albumTitle}</span></p> <p style="margin-top: -15px;" class="author lead">Album duration: <span style="font-weight:600">${albumDuration}</span></p> </div> <div class="col-md-3"> <img src="${albumImage}" class="img-fluid rounded-circle"> <img src="${artistPicture}" class="img-fluid rounded-circle"> </div> <div class="col-md-3 text-md-right text-center"> <button onclick="getLyrics('${title}', '${artistName}', '${albumImage}', '${artistPicture}')" class="btn btn-success">Get Lyrics</button> </div> </div>` } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearSearchResults() {\n $(\"#output\").text(\"\");\n }", "function endSearch() {\n MicroModal.show(\"addresses-modal\");\n\n // Remove \"Searching...\" message\n $(\".find-address\").text(\"Find Address\");\n\n $(\".find-address\").prop(\"disabled\", false);\n }", "...
[ "0.6950369", "0.69364357", "0.67773074", "0.67766184", "0.67467004", "0.6722208", "0.6691302", "0.66685736", "0.66430646", "0.6617809", "0.65997803", "0.6557262", "0.6550048", "0.6538848", "0.65283865", "0.6527526", "0.65106696", "0.64950734", "0.64888", "0.6475366", "0.64566...
0.0
-1
functie die aangeroepen wordt wanneer gebruiker op de button klikt
function requestAccess() { DeviceOrientationEvent.requestPermission().then((response) => { if (response == "granted") { permissionGranted = true; background(46, 46, 45); } else { textSize(39); textAlign(CENTER, TOP); fill(214, 32, 32); text("Je hebt de toegang afgewezen! Sluit browser compleet af en probeer opnieuw", width/2-500/2, 650, [510]); } // haalt button weg na het klikken button.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myFunction() {\n //console.log('formuchangejsut mail');\n $( \".inputinsciption\" ).show();\n $( \"#boutonfacebook\" ).hide();\n $( \".titlesupr\" ).hide();\n $(\"#btninscription\").text(\"Sign up\");\n $(\"#btninscription\").attr('onclick','FunctionPostInsertUser...
[ "0.6457133", "0.64038706", "0.63845533", "0.63838714", "0.63149834", "0.62490803", "0.6248833", "0.62378776", "0.61632925", "0.61623", "0.61434615", "0.6129469", "0.6120418", "0.61201364", "0.6118974", "0.61156183", "0.610099", "0.60940266", "0.60909", "0.60779184", "0.607489...
0.0
-1
Functions should iterate thru elements and change them OR return a DOMNodeCollection instance
html(argHTML) { if (argHTML === undefined) return this.elementArray[0].innerHTML; this.each(ele => { ele.innerHTML = argHTML; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function manipulateelements(item){\n /*do soemthing to item*/\n}", "function ElementCollection(){\n\tthis.inState = 0;\n\tthis.placeHolder = document.createComment('ElementCollection');\n\tthis.children = [];\n\tthis.firstChild = null;\n\tthis.lastChild = null;\n\tthis.parentElement = null;\n\tthis.placeHolde...
[ "0.63356066", "0.5956346", "0.58293504", "0.5751801", "0.57017034", "0.56847286", "0.5682651", "0.56735563", "0.5668264", "0.56642616", "0.56423056", "0.56153494", "0.5580726", "0.557934", "0.5579089", "0.5572537", "0.5525278", "0.5513889", "0.55095214", "0.5501568", "0.54939...
0.0
-1
ShiftRegister Constructor size: the size of the register (size of the array).
function ShiftRegister(size) { var self = this; if(!(self instanceof ShiftRegister)){ return new ShiftRegister(size); } self.register = []; for(var i=0; i<size; i++){ self.register.push("*"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_op_neon_rshl_s8()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s8});\n}", "set size(value) {}", "function Stack(size) {\n this.array = new Array(size);\n this.index = 0;\n this.size = size;\n}", "function gen_op_neon_rshl_s64()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s64});\n}", "functio...
[ "0.49744785", "0.48931238", "0.48767668", "0.4842523", "0.4811722", "0.47866863", "0.47811702", "0.4776734", "0.476981", "0.4703187", "0.46999106", "0.46663585", "0.46489987", "0.4638917", "0.46156093", "0.45934215", "0.45885175", "0.45855165", "0.4582117", "0.45732978", "0.4...
0.77090603
0
Node Constructor label: a string for simple Node with no children or an object from which the root node of the tree will be derived provided lfn and cfn label and callbacck functions provided. lfn: the label callback function, which must return a string label. Ignored if label is a string cfn: the children callback function, which must return an array of children from which child nodes will be derived. Ignored if label is a string.
function Node(label, lfn, cfn){ var self = this; if(!(self instanceof Node)){ return new Node(label, lfn, cfn); } if(typeof label === 'string' && label.length > 0){ self.tedlabel = label; self.tedchildren = []; }else if(typeof label === 'object' && !! lfn && !! cfn){ self.tedlabel = lfn(label); self.tedchildren = []; if(typeof self.tedlabel === 'string'){ var kids = cfn(label); if(!! kids){ for(var i=0; i<kids.length; i++){ var n = new Node(kids[i],lfn,cfn); if(!! n && !! n.tedlabel){ self.addkid(n); } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tree(label, left, right) {\n this.label = label;\n this.left = left;\n this.right = right;\n}", "function NodeLabels (view)\r\n{\r\n if (arguments.length > 0) {\r\n\tthis.init(view);\r\n }\r\n}", "function componentLabeledNode () {\n\n /* Default Properties */\n var color = \"st...
[ "0.5902229", "0.58443695", "0.5790681", "0.5682147", "0.56478506", "0.5490255", "0.5396654", "0.53645897", "0.5319086", "0.5309116", "0.5309116", "0.5309116", "0.5309116", "0.53013283", "0.5296153", "0.52926195", "0.52926195", "0.52858377", "0.5273435", "0.5257659", "0.524771...
0.8305698
0
Profile Constructor root: the root Node p: the p value in the PQGram algorithm q: the q value in the PQGram algorithm
function Profile(root, p, q){ var self = this; if(!(self instanceof Profile)){ return new Profile(root, p, q); } p = p || 2; q = q || 3; var ancestors = new ShiftRegister(p); self.list = []; self.profile(root, p, q, ancestors); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tree_init(q) {\n\n // create tree object\n var tree = {};\n\n // initialize with vertex for given configuration\n tree.vertices = [];\n tree.vertices[0] = {};\n tree.vertices[0].vertex = q;\n tree.vertices[0].edges = [];\n\n // create rendering geometry for base location of vertex ...
[ "0.60794765", "0.57156295", "0.55959386", "0.55622625", "0.5356073", "0.5319002", "0.5309989", "0.52788013", "0.52269065", "0.52200717", "0.520604", "0.5194858", "0.515756", "0.51566315", "0.51359355", "0.5121302", "0.5121302", "0.5121302", "0.5074427", "0.498923", "0.4982330...
0.6848942
0
Checks if user exists
userExists(user) { return this.users.indexOf(user)!==-1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfUserExists (callback) { \n connection.query(`SELECT * FROM user WHERE userid=${connection.escape(id)}`, (err, res)=>{\n if (err) {message.channel.send(embeds.errorOccured(message, err));}\n callback(res[0] !== undefined); \n });\n }", "do...
[ "0.79690623", "0.75844246", "0.7557623", "0.74161494", "0.7377948", "0.73569006", "0.7304194", "0.7255781", "0.7238622", "0.71998715", "0.7175637", "0.7156744", "0.71453005", "0.7125911", "0.7112004", "0.7106464", "0.7099847", "0.7051613", "0.70508", "0.7044566", "0.70404834"...
0.7149536
12
Check if an user's password is equal to other one
checkPassword(user, password) { const index = this.users.indexOf(user); if(index!==-1) return this.passwords[index] === password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passwordMatch(password) {\n return password === admin.password;\n}", "checkPassword(password) {\n return password === this.password;\n }", "function passwordEqual(password, verify_password) {\n return password === verify_password;\n}", "function comparePasswords() {\n var validPassword = ...
[ "0.7993083", "0.7725003", "0.75892943", "0.7536197", "0.7526122", "0.7502932", "0.74807984", "0.74213004", "0.74120545", "0.73816967", "0.7310467", "0.7284708", "0.72674763", "0.72674763", "0.72674763", "0.7257321", "0.72466105", "0.7239797", "0.7224139", "0.71671844", "0.713...
0.7541683
3
Update a user's password if oldPassword correct
updatePassword(user, oldPassword, newPassword) { const index = this.users.indexOf(user); if (index!==-1) { if (this.checkPassword(user, oldPassword)) { this.passwords[index] = newPassword; return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateWithNewPassword() {\n if (this.compareOldPasswords() && this.compareNewPasswords()) {\n this.updateUser(this.state.newPassword);\n }\n }", "function updatePassword(req, res) {\n var User = mongoose.model('User');\n User.findOne({ _id: req.user._id }, function (err, user) {\n if (er...
[ "0.8578526", "0.8100662", "0.80044305", "0.78852594", "0.7716077", "0.75723225", "0.7542341", "0.752578", "0.75148785", "0.7506403", "0.74882436", "0.73823565", "0.73325926", "0.731935", "0.7284155", "0.7246132", "0.722099", "0.70926535", "0.70762515", "0.70733297", "0.706928...
0.804089
2
Add a user to session
login(user, password) { if(this.checkPassword(user, password)){ this.sessions.push(user); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser(req, res){ \t// request, response\n\treq.session.user = { \t// pushed onderstaande ingevulde data in req.session.user, zonder session, is het altijd geldig\n\t\temail: req.body.email,\n\t\tid: req.body.userName,\n\t\tpassword: req.body.password\n\t};\n\...
[ "0.7577944", "0.7225542", "0.71242", "0.70751405", "0.6982179", "0.69162214", "0.6889444", "0.6728965", "0.67114645", "0.6699833", "0.6627853", "0.66129285", "0.65930057", "0.65766394", "0.6514973", "0.6443293", "0.6434716", "0.6419496", "0.6407713", "0.6372069", "0.63461745"...
0.5998808
58
Step 2: Get city name
function getCity(coordinates) { var xhr = new XMLHttpRequest(); var lat = coordinates[0]; var lng = coordinates[1]; // Paste your LocationIQ token below. xhr.open('GET', "https://us1.locationiq.com/v1/reverse.php?key=pk.49fd5203799fe38a65295fec96174630&lat="+lat+"&lon="+lng+"&format=json", true); xhr.send(); xhr.onreadystatechange = processRequest; xhr.addEventListener("readystatechange", processRequest, false); function processRequest(e) { if (xhr.readyState == 4 && xhr.status == 200) { var response = JSON.parse(xhr.responseText); var city = response.address.city; setAddr(response.address); return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCityName() {\n cityNameValue = titleCase(cityName.value);\n weatherCurrentLocation.innerText = cityNameValue;\n cityName.value = ''; /* Clear placeholder */\n getWeatherData();\n}", "function returnCity() {\n\n}", "function getD1City(){\n return weatherObj.cityName\n}", "function get_curre...
[ "0.7910365", "0.75080913", "0.7418375", "0.72027516", "0.71152097", "0.70497406", "0.70489717", "0.6988971", "0.6970172", "0.6816711", "0.68163586", "0.6798283", "0.67380196", "0.6707313", "0.66852564", "0.66788787", "0.66734314", "0.66728", "0.66690534", "0.66648644", "0.664...
0.0
-1
Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds. They usually appear for dates that denote time before the timezones were introduced (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891 and GMT+01:00:00 after that date) DategetTimezoneOffset returns the offset in minutes and would return 57 for the example above, which would lead to incorrect calculations. This function returns the timezone offset in milliseconds that takes seconds in account.
function getTimezoneOffsetInMilliseconds(date) { var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); utcDate.setUTCFullYear(date.getFullYear()); return date.getTime() - utcDate.getTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "function getTimeZoneOffsetMinutes()\n{\n var offset = new Date().getTimezoneOffset();\n return offset;\n}", "function getTimezoneOffset(d, tz) {\...
[ "0.7557168", "0.7447146", "0.7216665", "0.7192961", "0.66518", "0.660281", "0.6577458", "0.65652114", "0.6525688", "0.6522826", "0.6516245", "0.6516245", "0.6516245", "0.6516245", "0.6516245", "0.6494224", "0.6472627", "0.6460252", "0.6460252", "0.6460252", "0.6460252", "0....
0.64295644
37
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCDayOfYear(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var timestamp = date.getTime(); date.setUTCMonth(0, 1); date.setUTCHours(0, 0, 0, 0); var startOfYearTimestamp = date.getTime(); var difference = timestamp - startOfYearTimestamp; return Math.floor(difference / MILLISECONDS_IN_DAY) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.6...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCISOWeek(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var diff = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(date).getTime() - (0,_startOfUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(date).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6818263", "0.66675735", "0.64038146", "0.6337222", "0.6309952", "0.6283027", "0.6283027", "0.6246817", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.6148351", "0.611605", "0.60867715", "0.6081826", "0.6070095", "0.60522497", "0.60522497", "0.6052...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCISOWeekYear(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var year = date.getUTCFullYear(); var fourthOfJanuaryOfNextYear = new Date(0); fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0); var startOfNextYear = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(fourthOfJanuaryOfNextYear); var fourthOfJanuaryOfThisYear = new Date(0); fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(fourthOfJanuaryOfThisYear); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816884", "0.6668099", "0.64008635", "0.6334278", "0.6309822", "0.62825024", "0.62825024", "0.62465477", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.6146614", "0.6116046", "0.6086091", "0.6082476", "0.60684556", "0.60521436", "0.60521436", "0.6...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCWeek(dirtyDate, options) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var diff = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(date, options).getTime() - (0,_startOfUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(date, options).getTime(); // Round the number of days to the nearest integer // because the number of milliseconds in a week is not constant // (e.g. it's different in the week of the daylight saving time clock shift) return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.6...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function getUTCWeekYear(dirtyDate, dirtyOptions) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate, dirtyOptions); var year = date.getUTCFullYear(); var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) { throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively'); } var firstWeekOfNextYear = new Date(0); firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setUTCHours(0, 0, 0, 0); var startOfNextYear = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(firstWeekOfNextYear, dirtyOptions); var firstWeekOfThisYear = new Date(0); firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setUTCHours(0, 0, 0, 0); var startOfThisYear = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(firstWeekOfThisYear, dirtyOptions); if (date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.6...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCISOWeek(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var weekStartsOn = 1; var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setUTCDate(date.getUTCDate() - diff); date.setUTCHours(0, 0, 0, 0); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6818263", "0.66675735", "0.64038146", "0.6337222", "0.6309952", "0.6283027", "0.6283027", "0.6246817", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.62177664", "0.6148351", "0.611605", "0.60867715", "0.6081826", "0.6070095", "0.60522497", "0.60522497", "0.6052...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCISOWeekYear(dirtyDate) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var year = (0,_getUTCISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(dirtyDate); var fourthOfJanuary = new Date(0); fourthOfJanuary.setUTCFullYear(year, 0, 4); fourthOfJanuary.setUTCHours(0, 0, 0, 0); var date = (0,_startOfUTCISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(fourthOfJanuary); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816884", "0.6668099", "0.64008635", "0.6334278", "0.6309822", "0.62825024", "0.62825024", "0.62465477", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.62178004", "0.6146614", "0.6116046", "0.6086091", "0.6082476", "0.60684556", "0.60521436", "0.60521436", "0.6...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCWeek(dirtyDate, dirtyOptions) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var options = dirtyOptions || {}; var locale = options.locale; var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn; var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(localeWeekStartsOn); var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) { throw new RangeError('weekStartsOn must be between 0 and 6 inclusively'); } var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(dirtyDate); var day = date.getUTCDay(); var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; date.setUTCDate(date.getUTCDate() - diff); date.setUTCHours(0, 0, 0, 0); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.6...
0.0
-1
This function will be a part of public API when UTC function will be implemented. See issue:
function startOfUTCWeekYear(dirtyDate, dirtyOptions) { (0,_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__.default)(1, arguments); var options = dirtyOptions || {}; var locale = options.locale; var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate; var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(localeFirstWeekContainsDate); var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : (0,_toInteger_index_js__WEBPACK_IMPORTED_MODULE_1__.default)(options.firstWeekContainsDate); var year = (0,_getUTCWeekYear_index_js__WEBPACK_IMPORTED_MODULE_2__.default)(dirtyDate, dirtyOptions); var firstWeek = new Date(0); firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate); firstWeek.setUTCHours(0, 0, 0, 0); var date = (0,_startOfUTCWeek_index_js__WEBPACK_IMPORTED_MODULE_3__.default)(firstWeek, dirtyOptions); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getUTCDateTime() {\n return new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '')\n }", "localTimeToUTC(localTime) {\r\n let dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIso...
[ "0.6816656", "0.6667735", "0.64011997", "0.63352793", "0.63092077", "0.62825274", "0.62825274", "0.62464386", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.6217214", "0.61458474", "0.61152273", "0.60858005", "0.6081637", "0.60687524", "0.60514134", "0.60514134", "0.6...
0.0
-1
! Chai jQuery plugin implementation.
function chaiJq(chai, utils) { "use strict"; // ------------------------------------------------------------------------ // Variables // ------------------------------------------------------------------------ var flag = utils.flag, toString = Object.prototype.toString; // ------------------------------------------------------------------------ // Helpers // ------------------------------------------------------------------------ /*! * Give a more useful element name. */ var _elName = function ($el) { var name = "", id = $el.attr("id"), cls = $el.attr("class") || ""; // Try CSS selector id. if (id) { name += "#" + id; } if (cls) { name += "." + cls.split(" ").join("."); } if (name) { return "'" + name + "'"; } // Give up. return $el; }; // ------------------------------------------------------------------------ // Type Inference // // (Inspired by Underscore) // ------------------------------------------------------------------------ var _isRegExp = function (val) { return toString.call(val) === "[object RegExp]"; }; // ------------------------------------------------------------------------ // Comparisons // ------------------------------------------------------------------------ var _equals = function (exp, act) { return exp === act; }; var _contains = function (exp, act) { return act.indexOf(exp) !== -1; }; var _exists = function (exp, act) { return act !== undefined; }; var _regExpMatch = function (expRe, act) { return expRe.exec(act); }; // ------------------------------------------------------------------------ // Assertions (Internal) // ------------------------------------------------------------------------ /*! * Wrap assert function and add properties. */ var _jqAssert = function (fn) { return function (exp, msg) { // Set properties. this._$el = flag(this, "object"); this._name = _elName(this._$el); // Flag message. if (msg) { flag(this, "message", msg); } // Invoke assertion function. fn.apply(this, arguments); }; }; /*! * Base for the boolean is("selector") method call. * * @see http://api.jquery.com/is/] * * @param {String} selector jQuery selector to match against */ var _isMethod = function (jqSelector) { // Make selector human readable. var selectorDesc = jqSelector.replace(/:/g, ""); // Return decorated assert. return _jqAssert(function () { this.assert( this._$el.is(jqSelector), "expected " + this._name + " to be " + selectorDesc, "expected " + this._name + " to not be " + selectorDesc ); }); }; /*! * Abstract base for a "containable" method call. * * @param {String} jQuery method name. * @param {Object} opts options * @param {String} opts.hasArg takes argument for method * @param {String} opts.isProperty switch assert context to property if no * expected val * @param {String} opts.hasContains is "contains" applicable * @param {String} opts.altGet alternate function to get value if none */ var _containMethod = function (jqMeth, opts) { // Unpack options. opts || (opts = {}); opts.hasArg = !!opts.hasArg; opts.isProperty = !!opts.isProperty; opts.hasContains = !!opts.hasContains; opts.defaultAct = undefined; // Return decorated assert. return _jqAssert(function () { // Arguments. var exp = arguments[opts.hasArg ? 1 : 0], arg = opts.hasArg ? arguments[0] : undefined, // Switch context to property / check mere presence. noExp = arguments.length === (opts.hasArg ? 1 : 0), isProp = opts.isProperty && noExp, // Method. act = (opts.hasArg ? this._$el[jqMeth](arg) : this._$el[jqMeth]()), meth = opts.hasArg ? jqMeth + "('" + arg + "')" : jqMeth, // Assertion type. contains = !isProp && opts.hasContains && flag(this, "contains"), have = contains ? "contain" : "have", comp = _equals; // Set comparison. if (isProp) { comp = _exists; } else if (contains) { comp = _contains; } // Second chance getter. if (opts.altGet && !act) { act = opts.altGet(this._$el, arg); } // Default actual value on undefined. if (typeof act === "undefined") { act = opts.defaultAct; } // Same context assertion. this.assert( comp(exp, act), "expected " + this._name + " to " + have + " " + meth + (isProp ? "" : " #{exp} but found #{act}"), "expected " + this._name + " not to " + have + " " + meth + (isProp ? "" : " #{exp}"), exp, act ); // Change context if property and not negated. if (isProp && !flag(this, "negate")) { flag(this, "object", act); } }); }; // ------------------------------------------------------------------------ // API // ------------------------------------------------------------------------ /** * Asserts that the element is visible. * * *Node.js/JsDom Note*: JsDom does not currently infer zero-sized or * hidden parent elements as hidden / visible appropriately. * * ```js * expect($("<div>&nbsp;</div>")) * .to.be.$visible; * ``` * * @see http://api.jquery.com/visible-selector/ * * @api public */ var $visible = _isMethod(":visible"); chai.Assertion.addProperty("$visible", $visible); /** * Asserts that the element is hidden. * * *Node.js/JsDom Note*: JsDom does not currently infer zero-sized or * hidden parent elements as hidden / visible appropriately. * * ```js * expect($("<div style=\"display: none\" />")) * .to.be.$hidden; * ``` * * @see http://api.jquery.com/hidden-selector/ * * @api public */ var $hidden = _isMethod(":hidden"); chai.Assertion.addProperty("$hidden", $hidden); /** * Asserts that the element value matches a string or regular expression. * * ```js * expect($("<input value='foo' />")) * .to.have.$val("foo").and * .to.have.$val(/^foo/); * ``` * * @see http://api.jquery.com/val/ * * @param {String|RegExp} expected value * @param {String} message failure message (_optional_) * @api public */ var $val = _jqAssert(function (exp) { var act = this._$el.val(), comp = _isRegExp(exp) ? _regExpMatch : _equals; this.assert( comp(exp, act), "expected " + this._name + " to have val #{exp} but found #{act}", "expected " + this._name + " not to have val #{exp}", exp, typeof act === "undefined" ? "undefined" : act ); }); chai.Assertion.addMethod("$val", $val); /** * Asserts that the element has a class match. * * ```js * expect($("<div class='foo bar' />")) * .to.have.$class("foo").and * .to.have.$class("bar"); * ``` * * @see http://api.jquery.com/hasClass/ * * @param {String} expected class name * @param {String} message failure message (_optional_) * @api public */ var $class = _jqAssert(function (exp) { var act = this._$el.attr("class") || ""; this.assert( this._$el.hasClass(exp), "expected " + this._name + " to have class #{exp} but found #{act}", "expected " + this._name + " not to have class #{exp}", exp, act ); }); chai.Assertion.addMethod("$class", $class); /** * Asserts that the target has exactly the given named attribute, or * asserts the target contains a subset of the attribute when using the * `include` or `contain` modifiers. * * ```js * expect($("<div id=\"hi\" foo=\"bar time\" />")) * .to.have.$attr("id", "hi").and * .to.contain.$attr("foo", "bar"); * ``` * * Changes context to attribute string *value* when no expected value is * provided: * * ```js * expect($("<div id=\"hi\" foo=\"bar time\" />")) * .to.have.$attr("foo").and * .to.equal("bar time").and * .to.match(/^b/); * ``` * * @see http://api.jquery.com/attr/ * * @param {String} name attribute name * @param {String} expected attribute content (_optional_) * @param {String} message failure message (_optional_) * @returns current object or attribute string value * @api public */ var $attr = _containMethod("attr", { hasArg: true, hasContains: true, isProperty: true }); chai.Assertion.addMethod("$attr", $attr); /** * Asserts that the target has exactly the given named * data-attribute, or asserts the target contains a subset * of the data-attribute when using the * `include` or `contain` modifiers. * * ```js * expect($("<div data-id=\"hi\" data-foo=\"bar time\" />")) * .to.have.$data("id", "hi").and * .to.contain.$data("foo", "bar"); * ``` * * Changes context to data-attribute string *value* when no * expected value is provided: * * ```js * expect($("<div data-id=\"hi\" data-foo=\"bar time\" />")) * .to.have.$data("foo").and * .to.equal("bar time").and * .to.match(/^b/); * ``` * * @see http://api.jquery.com/data/ * * @param {String} name data-attribute name * @param {String} expected data-attribute content (_optional_) * @param {String} message failure message (_optional_) * @returns current object or attribute string value * @api public */ var $data = _containMethod("data", { hasArg: true, hasContains: true, isProperty: true }); chai.Assertion.addMethod("$data", $data); /** * Asserts that the target has exactly the given named property. * * ```js * expect($("<input type=\"checkbox\" checked=\"checked\" />")) * .to.have.$prop("checked", true).and * .to.have.$prop("type", "checkbox"); * ``` * * Changes context to property string *value* when no expected value is * provided: * * ```js * expect($("<input type=\"checkbox\" checked=\"checked\" />")) * .to.have.$prop("type").and * .to.equal("checkbox").and * .to.match(/^c.*x$/); * ``` * * @see http://api.jquery.com/prop/ * * @param {String} name property name * @param {Object} expected property value (_optional_) * @param {String} message failure message (_optional_) * @returns current object or property string value * @api public */ var $prop = _containMethod("prop", { hasArg: true, isProperty: true }); chai.Assertion.addMethod("$prop", $prop); /** * Asserts that the target has exactly the given HTML, or * asserts the target contains a subset of the HTML when using the * `include` or `contain` modifiers. * * ```js * expect($("<div><span>foo</span></div>")) * .to.have.$html("<span>foo</span>").and * .to.contain.$html("foo"); * ``` * * @see http://api.jquery.com/html/ * * @param {String} expected HTML content * @param {String} message failure message (_optional_) * @api public */ var $html = _containMethod("html", { hasContains: true }); chai.Assertion.addMethod("$html", $html); /** * Asserts that the target has exactly the given text, or * asserts the target contains a subset of the text when using the * `include` or `contain` modifiers. * * ```js * expect($("<div><span>foo</span> bar</div>")) * .to.have.$text("foo bar").and * .to.contain.$text("foo"); * ``` * * @see http://api.jquery.com/text/ * * @name $text * @param {String} expected text content * @param {String} message failure message (_optional_) * @api public */ var $text = _containMethod("text", { hasContains: true }); chai.Assertion.addMethod("$text", $text); /** * Asserts that the target has exactly the given CSS property, or * asserts the target contains a subset of the CSS when using the * `include` or `contain` modifiers. * * *Node.js/JsDom Note*: Computed CSS properties are not correctly * inferred as of JsDom v0.8.8. Explicit ones should get matched exactly. * * *Browser Note*: Explicit CSS properties are sometimes not matched * (in contrast to Node.js), so the plugin performs an extra check against * explicit `style` properties for a match. May still have other wonky * corner cases. * * *PhantomJS Note*: PhantomJS also is fairly wonky and unpredictable with * respect to CSS / styles, especially those that come from CSS classes * and not explicity `style` attributes. * * ```js * expect($("<div style=\"width: 50px; border: 1px dotted black;\" />")) * .to.have.$css("width", "50px").and * .to.have.$css("border-top-style", "dotted"); * ``` * * @see http://api.jquery.com/css/ * * @name $css * @param {String} expected CSS property content * @param {String} message failure message (_optional_) * @api public */ var $css = _containMethod("css", { hasArg: true, hasContains: true, // Alternate Getter: If no match, go for explicit property. altGet: function ($el, prop) { return $el.prop("style")[prop]; } }); chai.Assertion.addMethod("$css", $css); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jQuery(arg1, arg2) {}", "function letsJQuery() {\r\n\tcreateOptionsMenu();\r\n\tpressthatButton();\r\n }", "function extendJQuery() {\n jQuery.extend(Object.create(null, {\n 'alert': { value: alert, configurable: true, enumerable: true, writable: true },\n 'confirm': { value: createSho...
[ "0.6655475", "0.6535609", "0.6201509", "0.61341715", "0.60110307", "0.5988286", "0.5922567", "0.58725655", "0.58725655", "0.5867902", "0.58612984", "0.5818488", "0.579289", "0.5791665", "0.5782357", "0.57613087", "0.57475364", "0.57458735", "0.5744094", "0.5741339", "0.571820...
0.5647664
30
! Wrap AMD, etc. using boilerplate.
function wrap(plugin) { "use strict"; /* global module:false, define:false */ if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { // NodeJS module.exports = plugin; } else if (typeof define === "function" && define.amd) { // AMD: Assumes importing `chai` and `jquery`. Returns a function to // inject with `chai.use()`. // // See: https://github.com/chaijs/chai-jquery/issues/27 define(["jquery"], function ($) { return function (chai, utils) { return plugin(chai, utils, $); }; }); } else { // Other environment (usually <script> tag): plug in to global chai // instance directly. root.chai.use(function (chai, utils) { return plugin(chai, utils, root.jQuery); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructAMD() {\n\n\t\t//create a library instance\n\t\treturn init();\n\n\t\t//spawns a library instance\n\t\tfunction init() {\n\t\t\tvar library;\n\t\t\tlibrary = factory('amd');\n\t\t\tlibrary.fork = init;\n\t\t\treturn library;\n\t\t}\n\t}", "function init() {\n\t\t\tvar library;\n\t\t\tlibrary = ...
[ "0.7107031", "0.67358977", "0.6678734", "0.6667636", "0.665947", "0.62834316", "0.6251298", "0.61878985", "0.612553", "0.6080921", "0.60479283", "0.60479283", "0.60479283", "0.60479283", "0.60479283", "0.60479283", "0.6014608", "0.6014608", "0.6007322", "0.60021186", "0.59774...
0.0
-1
value and returns the closest value to that target in the BST.
function findCLosestValInBST(tree, target) { const traverse = (tree, target, closest) => { if (tree === null) { return closest; } if (Math.abs(target - closest) > Math.abs(target - tree.value)) { closest = tree.value; } if (target < closest) { traverse(tree.left, target, closest); } else if (target > closest) { traverse(tree.right, target, closest); } else { return closest; } } return traverse(tree, target, tree.value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findClosestValueInBst(tree, target) {\r\n return findClosestValueInBstHelper(tree, target, Infinity);\r\n}", "function findClosestValueInBst(tree, target) {\nlet currentNode = tree;\nlet closest = Infinity;\nwhile(currentNode !== null){\n if(Math.abs(target-currentNode.value) < Math.abs(target-closest)...
[ "0.85533667", "0.85214084", "0.85127723", "0.85071725", "0.8410835", "0.8326483", "0.8198468", "0.8023728", "0.7982306", "0.7701382", "0.7350137", "0.684865", "0.6842396", "0.6823907", "0.6823907", "0.6816698", "0.6812664", "0.6810911", "0.6810911", "0.6810911", "0.6810911", ...
0.780807
9
let imgPath = "/images/";
function getRandom(){ do{ var getImage2 = imageArray[Math.floor(Math.random()*imageArray.length)]; } while(getImage1 == getImage2) console.log("getImage2 : "+getImage2); compareResult(imageArray.indexOf(getImage2)); return getImage2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static imageRootUrl() {\r\n return (`/dist/img/`);\r\n }", "function GetImageURL(imagePath) {\n// return URLUtility.VirtualPath + imagePath;\n return imagePath;\n}", "get imagePath(){\n return My_Resource +'/img/' + this.logoName;\n }", "makeImagePath(product) {\n return require(`../...
[ "0.77299327", "0.7654136", "0.72462916", "0.72104275", "0.7087227", "0.708234", "0.7048076", "0.7026005", "0.700661", "0.70017195", "0.69955456", "0.6915809", "0.68998396", "0.6869418", "0.6817347", "0.68095684", "0.67202955", "0.66891617", "0.6600167", "0.6600167", "0.659915...
0.0
-1
ComponentDidMount in Life cycle function be used
componentDidMount() { const token = localStorage.getItem("token"); this.setState({ token: token }); console.log("token", JSON.stringify(token)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componenetDidMount() { }", "componentDidMount() {\n\t\tthis.init();\n\t}", "componentDidMount()\n {\n\n }", "componentDidMount(){\n \n }", "componentDidMount() {\n \n }", "componentDidMount(){\n console.log(\"ComponentDidMount Execution\");\n\n }", "componentDidMo...
[ "0.8610029", "0.83641243", "0.832006", "0.83050275", "0.8277858", "0.82470846", "0.82434", "0.82434", "0.82317054", "0.8221666", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", "0.820409", ...
0.0
-1
reset Password Event Handler
resetPassword(event) { event.preventDefault(); let data = { password: this.state.password, confirmPassword: this.state.confirmPassword, }; //Calling the API using axios method resetPassword(data, this.state.token).then((response) => { if (response.status === 200) { this.setState({ message: "Password reset Successfully", }); } else { this.setState({ message: "Password is Not changed", snackbarmsg: " Make Sure that password & confirmPassword is correct", snackbaropen: true, }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onResetClicked() {\n let event = new Event(\"resetClicked\", this.passwordField.value);\n this.notifyAll(event);\n}", "function resetPassword(e) {\n e.preventDefault();\n\n axios\n .put(`${defaults.serverUrl}/account/change-credentials/${accountID}`, {\n security: questions,\n ...
[ "0.7635913", "0.7550288", "0.7385838", "0.71022207", "0.6977799", "0.6921072", "0.6905678", "0.689869", "0.688927", "0.6833997", "0.68336475", "0.6820165", "0.68005306", "0.67034423", "0.6696703", "0.6637141", "0.66166055", "0.6589568", "0.6585242", "0.65844136", "0.65661967"...
0.60963684
58
setState for confirm password field
onChangeConfirmPassword(event) { if (event.target.value.length > 2) { this.setState({ helperText: "", error: false, confirmPassword: event.target.value, }); } else { this.setState({ helperText: "Invalid format", error: true, confirmPassword: event.target.value, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleChangeConfirmPassword(e) {\n this.setState({ confirmPassword: e.target.value });\n }", "onupdateConfirmPassword(event) {\n this.password = event.target.value;\n this.passwordValidationState = '';\n }", "setConfirmPassword(newConfirmPassword) {\n this.setState({confirmPassword: newConfir...
[ "0.8042668", "0.80321753", "0.80039626", "0.7950488", "0.7546916", "0.7546359", "0.7483683", "0.7459078", "0.7431498", "0.7412072", "0.73574615", "0.73203635", "0.73006654", "0.7277289", "0.72759783", "0.72759783", "0.72451246", "0.7221198", "0.7186857", "0.7182852", "0.71731...
0.7127698
26
setState for password field
onChangePassword(event) { if (event.target.value.length > 7) { this.setState({ helperTextpassword: "", error: false, password: event.target.value, }); } else { this.setState({ helperTextpassword: "Password should be 7 letters", error: true, password: event.target.value, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_inputPass(password){\n this.setState({password:password})\n\n }", "onChangePassword(event) {\n this.setState({\n password: event.target.value\n });\n }", "onChangePassword(event) {\n this.setState({\n password: event.target.value\n });\n }", "passwordOnChange (e) {\n this.setS...
[ "0.82025504", "0.8120857", "0.8120857", "0.8119566", "0.80819756", "0.80666107", "0.80627006", "0.8045172", "0.8017677", "0.799424", "0.7985309", "0.7985173", "0.7974092", "0.7972368", "0.79651445", "0.7958896", "0.7938092", "0.7901792", "0.7893774", "0.78741026", "0.786789",...
0.7049971
47
Render function && User Interface for resetPassword
render() { return ( <MuiThemeProvider> <meta name="viewport" content="width=device-width, initial-scale=1.0" ></meta> <div className="containerReset"> <div className="loginstyleReset">{this.state.resetpassword}</div> <div className="borderReset"> <div className="loginFromReset"> <div className="inputFieldReset"> <TextField hintText="Password" floatingLabelText="Password" id="btnReset" variant="outlined" type="password" label="Password" helperText={this.state.helperTextpassword} onChange={this.onChangePassword.bind(this)} ></TextField> </div> <div className="inputFieldReset"> <TextField hintText="Confirm Password" floatingLabelText="Confirm Password" id="btnReset" variant="outlined" type="password" label="Confirm Password" helperText={this.state.helperText} onChange={this.onChangeConfirmPassword.bind(this)} ></TextField> </div> <div className="submitButtonReset"> <Button id="subbtnReset" onClick={(e) => this.resetPassword(e)}> SUBMIT </Button> </div> </div> <div className="loginstyle">{this.state.message}</div> </div> <Snackbar open={this.state.snackbaropen} autoHideDuration={6000} onClose={this.handleClose} message={<span>{this.state.snackbarmsg}</span>} action={[ <IconButton key="close" arial-label="close" coloe="inherit" onClick={this.handleClose} > x </IconButton>, ]} ></Snackbar> </div> </MuiThemeProvider> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async resetPassword({ view, params, antl }) {\n return view.render('user.password', {\n token: params.token,\n key: params.key,\n action: 'UserController.storeResetPassword',\n header_msg: antl.formatMessage('main.change_password'),\n button_msg: antl.formatMessage('main.change_password...
[ "0.7532324", "0.7391816", "0.7268369", "0.69392043", "0.6881498", "0.68759274", "0.66833407", "0.6670186", "0.643608", "0.6398368", "0.6392016", "0.6330296", "0.6229249", "0.62137234", "0.6189236", "0.61827064", "0.6123889", "0.61110353", "0.6103", "0.60892946", "0.606166", ...
0.5643229
74
function to retrieve list of users from database; (username, firstname, and lastname)
function getUsers(){ $.ajax({ type:'get', url: 'http://127.0.0.1/opinion/web/app_dev.php/ff/users', success: function (data) { var users = data.users, options_array = new Array(), //loop trought users getting username and name i = 0; users.forEach(function(user){ var username = user.username, key = i, pic = user.pic_path, name = user.firstname+' '+user.lastname, option = {'id':i, 'pic':pic, 'username':username, 'name':name}; options_array.push(option); i = i+1; }); var options = options_array; //stock users array in html element tag $('.fri-stk-data').attr('data-users', JSON.stringify(options_array)); var REGEX_EMAIL = '([a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@' + '(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)'; $('.nw-msg-recip').selectize({ persist: false, maxItems: null, valueField: 'username', labelField: 'name', searchField: ['name', 'username'], options: options, render: { item: function(item, escape) { return '<div class="selec-field">' + (item.name ? '<span class="selec-name">' + escape(item.name) + '</span><br/>' : '') + (item.pic ? '<span class="selec-pic" data-pic-url='+escape(item.pic)+'></span>':'') + '</div>'; }, option: function(item, escape) { var label = item.name || item.username; var caption = item.name ? item.username : null; return '<div class="selec-sugg">' + '<span class="label">' + escape(label) + '</span><br/>' + (caption ? '<span class="caption">' + escape(caption) + '</span>' : '') + '</div>'; } }, createFilter: function(input) { var match, regex; // username@address.com regex = new RegExp('^' + REGEX_EMAIL + '$', 'i'); match = input.match(regex); if (match) return !this.options.hasOwnProperty(match[0]); // name <username@address.com> regex = new RegExp('^([^<]*)\<' + REGEX_EMAIL + '\>$', 'i'); match = input.match(regex); if (match) return !this.options.hasOwnProperty(match[2]); return false; }, create: function(input) { if ((new RegExp('^' + REGEX_EMAIL + '$', 'i')).test(input)) { return {username: input}; } var match = input.match(new RegExp('^([^<]*)\<' + REGEX_EMAIL + '\>$', 'i')); if (match) { return { username : match[2], name : $.trim(match[1]) }; } alert('Invalid username address.'); return false; }, hideSelected: true, openOnFocus: false }); return true; }, failure: function(Error){ Error.bind(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsernameList() {\r\n\tvar userlist = getUsernames();\r\n\treturn userlist;\r\n}", "function getUsers() {\n return db(\"users\").select(\"users.*\");\n}", "function getUsers() {\n return db('users')\n .select('id', 'username')\n}", "allUsers() {\r\n this.log(`Getting list of users......
[ "0.766131", "0.7485325", "0.7483956", "0.7322115", "0.72785", "0.72737813", "0.7252683", "0.7250729", "0.71935713", "0.71739554", "0.715861", "0.71408314", "0.7139639", "0.71351534", "0.71033436", "0.7088729", "0.7068352", "0.7064861", "0.70611763", "0.70529026", "0.7050367",...
0.0
-1
Sets parameters that alter spatialization.
setAudioProperties(minDistance, maxDistance, rolloff, algorithm, transitionTime) { this.minDistance = minDistance; this.maxDistance = maxDistance; this.rolloff = rolloff; this.algorithm = algorithm; this.transitionTime = transitionTime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setParameters() {\n params.viscosity = 0.02;\n params.u0 = -amplitude;\n params.one36th = 1 / 36;\n params.one9th = 1 / 9;\n params.four9ths = 4 / 9;\n params.gridSize = 5;\n params.m = int(height / params.gridSize);\n params.n = int(width / params.gridSize);\n}", "setParameters () {\n if (ar...
[ "0.6579918", "0.6186937", "0.61332995", "0.59890825", "0.5856807", "0.5719159", "0.57059836", "0.570415", "0.5674817", "0.56528974", "0.56449145", "0.5638581", "0.5625705", "0.5624296", "0.5599042", "0.5576267", "0.55709195", "0.55701673", "0.55601704", "0.55513895", "0.55262...
0.0
-1
input two strings output number rules: return a number that represents how many times the first string appears in the second string algorithm: use match on the second string and return the length of the resulting array
function searchWord(word, text) { word = new RegExp(word, "gi"); return text.match(word).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matching_strings(stra1,stra2){\n var count = 0;\n for(var i = 0; i < stra1.length; i++){\n if(stra2.includes(stra1[i])){\n count++;\n }\n }\n return count;\n}", "function hamming(string_1, string_2) {\n if (string_1.length !== string_2.length) {\n return 0;\n } else {\n l...
[ "0.7708254", "0.74665195", "0.7178124", "0.7174277", "0.71487314", "0.70757943", "0.7068777", "0.70508534", "0.70226973", "0.7019197", "0.6988411", "0.697685", "0.6965461", "0.69650936", "0.69394314", "0.68370605", "0.68209517", "0.682034", "0.6814287", "0.68081325", "0.67771...
0.0
-1
enable Calendar cells to be clickable
function hoverableCells() { document.querySelectorAll('.hover').forEach(item => { item.addEventListener('click', () => { document.getElementById("timeButtons").innerHTML=""; // kill previous buttons document.getElementById("displayTableBody").innerHTML=""; // kill table rows //remove any bg-primary cells document.querySelectorAll('.hover').forEach(hoverable => { hoverable.classList.remove('bg-primary'); }); //set clicked cell to bg-primary item.classList.add('bg-primary'); //run function to show reports displayReports(item.innerHTML); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleEventTableClick() {\n\t \tvar center = $(this).attr('data-datetime');\n\t \tvar visible = app.chart.extentRange();\n\t \tvar start = app.chart.constrainToDomainMin(center-visible/2);\n\t\t\tvar stop = app.chart.constrainToDomainMax(start+visible);\n\t\t\tapp.chart.scrollTo(start,stop);\n\t\t\tret...
[ "0.6556007", "0.6360352", "0.6203196", "0.6168091", "0.60323596", "0.6012475", "0.5998993", "0.5949617", "0.59220207", "0.59154946", "0.59028995", "0.5900782", "0.58812726", "0.58762604", "0.58457005", "0.5833754", "0.58298236", "0.5810187", "0.58082515", "0.58016896", "0.580...
0.0
-1
Display report based on clicked date
function displayReports(displayDay) { let displayYear = selectYear.value; let displayMonth = parseInt(selectMonth.value) + 1; if(displayMonth < 10){ displayMonth = ("0" + displayMonth); } if(displayDay < 10){ displayDay = ("0" + displayDay); } let displayDate = (displayYear + "-" + displayMonth + "-" + displayDay); let URL = "http://localhost:3004/weather/"+displayYear+"/"+displayMonth+"/"+displayDay; let buttonDiv = document.getElementById("timeButtons"); $.get(URL, function(data){ let table = document.getElementById("reportWholeTable"); if(data.length==0){ // hide table table.style.display = 'none'; buttonDiv.innerHTML = "No hay informes meteorológicos disponibles hoy"; document.getElementById("displayTableAnnouncement").innerHTML = ''; } else{ table.style.display = ''; data.forEach(element => { let button = document.createElement("button"); let textnode = document.createTextNode(element.time); button.id=element.id; button.classList.add("btn"); button.classList.add("btn-outline-primary"); button.addEventListener("click", displayByTime); button.appendChild(textnode); buttonDiv.appendChild(button); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateReport(event) {\n \n cleanReport();\n \n // If the arrows where clicked, than update the arrows' timestamp\n updateTimeSpan(event);\n \n // extract report query from the DOM\n var reportQ = getReportQueryFromControlPanel();\n \n // write time span in human readable way\...
[ "0.6323206", "0.62055784", "0.61925775", "0.612576", "0.60780406", "0.60475826", "0.6026153", "0.60052466", "0.5973589", "0.59710073", "0.59308934", "0.59096736", "0.5907215", "0.5896339", "0.58938015", "0.5850293", "0.5849054", "0.5823883", "0.58233225", "0.58056915", "0.580...
0.5703291
34
Display Report Time options for date clicked requires query database
function displayByTime(){ let URL = "http://localhost:3004/weather/"+this.id; $.get(URL, function(data){ let tableBody = document.getElementById("displayTableBody"); tableBody.innerHTML=""; // clear to start let weatherInfo = JSON.parse(data[0].weatherinfo); let date = data[0].date; addRowContent(tableBody, "Fecha", date.substring(0, date.length-14)); addRowContent(tableBody, "Hora", data[0].time); for(const property in weatherInfo){ addRowContent(tableBody, property, weatherInfo[property]); } let announcementString = "<strong>Anuncio:</strong> "+data[0].announcement; document.getElementById("displayTableAnnouncement").innerHTML=announcementString; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateReport(event) {\n \n cleanReport();\n \n // If the arrows where clicked, than update the arrows' timestamp\n updateTimeSpan(event);\n \n // extract report query from the DOM\n var reportQ = getReportQueryFromControlPanel();\n \n // write time span in human readable way\...
[ "0.6561142", "0.63937986", "0.6244584", "0.6187581", "0.6133716", "0.6130026", "0.61165226", "0.6114177", "0.60631114", "0.6043068", "0.6029009", "0.595768", "0.5942639", "0.59237856", "0.59106547", "0.58960134", "0.5884342", "0.58626086", "0.5860346", "0.58336765", "0.582213...
0.0
-1
Imagine that I gave you 20 books to sort in alphabetical order. Express this as an algorithm and them implement your algorithm. ['a', 'ab', 'ccc'] ['def', 'ace']
function mergeStrArrays(arr1, arr2) { let arr1Idx = 0; let arr2Idx = 0; let result = []; while (arr1[arr1Idx] && arr2[arr2Idx]) { let str1 = arr1[arr1Idx].toLowerCase(); let str2 = arr2[arr2Idx].toLowerCase(); let str1Ptr = 0; let str2Ptr = 0; let compare = 0; while (str1[str1Ptr] && str2[str2Ptr]) { compare = str1[str1Ptr].localeCompare(str2[str2Ptr]); if (compare !== 0) { break; } else { str1Ptr++; str2Ptr++; } } if (compare === -1) { result.push(arr1[arr1Idx]); arr1Idx++; } else if (compare === 1) { result.push(arr2[arr2Idx]); arr2Idx++; } else { if (!str1[str1Ptr]) { // strings were tied but this word is shorter result.push(arr1[arr1Idx]); arr1Idx++; } else { result.push(arr2[arr2Idx]); arr2Idx++; } } } if (arr1[arr1Idx]) { result = result.concat(arr1.slice(arr1Idx)); } else if (arr2[arr2Idx]) { result = result.concat(arr2.slice(arr2Idx)); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "function orderAlphabetically() {}", "function orderAlphabetically(arr) {\n let sorted20s = [...arr]\n let finalList = []\n sorted20s = sorted20s.sort((a,b) =>{\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n ...
[ "0.70105124", "0.6857319", "0.675106", "0.6736326", "0.673103", "0.67084", "0.66918606", "0.6604332", "0.65888286", "0.65693635", "0.6567048", "0.65587556", "0.65186906", "0.65112525", "0.6510139", "0.64835376", "0.64709395", "0.6465834", "0.645842", "0.64557886", "0.6445624"...
0.0
-1
When the hamburger icon is clicked run this function to toggle nav menu.
function menuDrop() { // Create variable and assign the nav menu to the variable. const hiddenText = document.getElementById('hidden'); // If the class of nav is exactly "topnav" then add the class of responsive and return function. if (hiddenText.className === "topnav") { hiddenText.className += " responsive"; // If class name is not exactly "topnav", then make it "topnav" and return function. } else { hiddenText.className = "topnav"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleHamburgerMenu() {\n $('.hamburger-icon').click(event => {\n $('.main-menu-link').toggleClass('toggle-links');\n });\n}", "function toggleHamburgerMen...
[ "0.80133754", "0.80133754", "0.80133754", "0.79227173", "0.78491664", "0.7825522", "0.7754517", "0.7680551", "0.75981253", "0.75579923", "0.7549522", "0.7546149", "0.7533177", "0.7518053", "0.7498128", "0.7484153", "0.74762154", "0.7474002", "0.7461529", "0.74336207", "0.7418...
0.0
-1