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
Functions that closes note drop down from addBooksToNote when clicked outside
function closeOnClickOutside(obj, dropDownContent) { document.addEventListener("click", (event) => { let target = event.target; do { if (obj.noteElement == target) { return; } target = target.parentNode; } while (target); dropDownContent.style.display = "none"; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editNotes2(notesID){\n\tvar notesEditID = \"edit_\" + notesID;\n\t\n\tvar notes = document.getElementById(notesEditID);\n\n\t\n\tdocument.getElementById(\"PopUpText\").style.display = \"none\";\n\t\n\t//new method\n\tvar el, x, y;\n\n\tel = document.getElementById(notesEditID);\n\tif (window.event) {\n\t\...
[ "0.7146953", "0.66156006", "0.62357813", "0.62262654", "0.62246716", "0.621565", "0.621047", "0.61434036", "0.6141205", "0.61378044", "0.61318266", "0.6112014", "0.6067245", "0.60459834", "0.5998085", "0.5996259", "0.5959486", "0.5955136", "0.5945292", "0.59433615", "0.594057...
0.7001082
1
Clears list of notebooks in dropdwon menue
function clearNoteDropDown() { document.querySelectorAll(".close-btn-dropdown").forEach((e) => e.remove()); document.querySelectorAll(".dropdown-li").forEach((e) => e.remove()); document.querySelectorAll(".dropdown-btn").forEach((e) => e.remove()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearList() {\n this.selection.owner.editorModule.onApplyList(undefined);\n }", "function _clearList() {\n gWizardSelection$.empty();\n } // _clearList", "_clearWorkspaceHistory() {\n const menu = this.getWorkspaceHistoryMenu();\n const items = Array.from(menu.items);\n men...
[ "0.67099893", "0.6588118", "0.6557251", "0.6386474", "0.6240973", "0.6177146", "0.6121783", "0.6121783", "0.6088707", "0.60417324", "0.60135263", "0.5933987", "0.5917622", "0.5909287", "0.58787847", "0.58679485", "0.58675385", "0.58654743", "0.58634925", "0.58562917", "0.5836...
0.6308505
4
moves selected element to new notebook
function moveSelected(bool) { allNotes.forEach((element) => { element.checkBoxVisible(bool); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveSelection(){\n this.selected = this.model.document.selection.getSelectedElement()\n }", "function moveSelected(delta) {\n setSelectedIndex(selectedIndex + delta);\n }", "cut() {\n if (this.owner.isReadOnlyMode || this.selection.isEmpty) {\n return;\n }\n this.s...
[ "0.61918193", "0.6040371", "0.59730476", "0.59305125", "0.5909598", "0.5900147", "0.57845205", "0.5715536", "0.5629956", "0.5621173", "0.5570904", "0.55244106", "0.5521908", "0.55180603", "0.5505224", "0.54956293", "0.5474131", "0.54533577", "0.54486907", "0.54098624", "0.540...
0.51527345
76
le joueur qui doit jouer
get numTurn() { return this.game.numTurn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gereTourCombat() {\r\n // SI tourJoueur1 = 0 au départ TOUR JOUEUR 1\r\n if(tourJoueur1 < 1) { // tourJoueur1 vaut 0 au début\r\n joueur2.passeSonTourAu(joueur1); // Change le texte de MON TOUR dans l'ATH des joueurs en OUI ou NON\r\n AttaqueOuDefense(); // Demande au joueur 2 de choisir si il at...
[ "0.6614742", "0.6451529", "0.6320746", "0.6200295", "0.61889833", "0.61619127", "0.6142601", "0.6127024", "0.6046276", "0.6030192", "0.6013633", "0.59922534", "0.5938457", "0.59370524", "0.5901252", "0.5884959", "0.58441204", "0.5836453", "0.5822388", "0.5816511", "0.57858616...
0.0
-1
Returns the file URL
getFileURL(fileId) { var file = this.collection.findOne(fileId, { fields: { name: 1 } }); return file && `${ this.getURL() }/${ fileId }/${ encodeURIComponent(file.name) }`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileURL() {\n return urlVars['file'];\n}", "getFileUrl(path) { return this.engine.getFileUrl(path); }", "getUrl() {\n return this.folder.url()+\"/\"+this.file;\n }", "getUrl() {\n if (this.state != remote_file) {\n return undefined;\n }\n let [ssName, stora...
[ "0.82360595", "0.7762329", "0.766285", "0.7458001", "0.6870835", "0.6793945", "0.67141217", "0.66483116", "0.6628964", "0.6626512", "0.6605265", "0.6604359", "0.65741473", "0.65130454", "0.65062124", "0.6477804", "0.6470602", "0.6464735", "0.64506483", "0.6438313", "0.6400756...
0.730003
4
Returns the store URL
getURL() { return Meteor.absoluteUrl(`${ UploadFS.config.storesPath }/${ this.name }`, { secure: UploadFS.config.https }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUrl() {\n if (this.state != remote_file) {\n return undefined;\n }\n let [ssName, storageService] = getStorageService();\n return storageService.getUrl(this._obj.location);\n }", "getIdentityServerLocation() {\r\n let state = this.store.getState();\r\n ...
[ "0.6729006", "0.65537775", "0.6216503", "0.61543435", "0.61543435", "0.61481875", "0.6136984", "0.61096394", "0.60626924", "0.59989744", "0.59989744", "0.5959447", "0.5912353", "0.59075546", "0.5897455", "0.58910745", "0.5841176", "0.5823954", "0.5823954", "0.5823954", "0.582...
0.7293854
0
Deletes a file async
delete(fileId, callback){ throw new Error('delete is not implemented'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function deleteFile(fileID) {\n var path = await getActualPath(fileID);\n // remove from disk\n fs.unlink(path, function (error) {\n if (error) {\n console.error(error.stack);\n return;\n }\n });\n // remove from db\n db.deleteData('file', { id: fileID })...
[ "0.8009833", "0.7737287", "0.72994", "0.72517425", "0.7250498", "0.7243745", "0.7128696", "0.71257883", "0.7059612", "0.70147574", "0.69944185", "0.69655865", "0.69079703", "0.69013846", "0.6900348", "0.6871706", "0.6844681", "0.6799858", "0.6780524", "0.6764071", "0.6712863"...
0.6498454
29
Returns the file read stream
getReadStream(fileId, file){ throw new Error('getReadStream is not implemented'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "function streamFile(program) {\n var fs = require('fs');\n var filename = program.args[0];\n\n return fs.createReadStream(filename);\n}", "async read (filepath, options = {}) {\n try {\n let buffer = await this._readFile(f...
[ "0.67907476", "0.6402451", "0.63839144", "0.63830537", "0.6381577", "0.6302236", "0.6301271", "0.62967515", "0.6291615", "0.6247552", "0.61855", "0.6158669", "0.61394274", "0.61394274", "0.61339694", "0.6121578", "0.6098678", "0.6093285", "0.606923", "0.606923", "0.6064092", ...
0.6570476
1
Returns the file write stream
getWriteStream(fileId, file){ throw new Error('getWriteStream is not implemented'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "open() {\n this.close()\n\n const file = path.normalize(this._filename)\n const opts = {\n flags: this._append ? 'a' : 'w',\n encoding: 'utf8',\n }\n\n ensureDirectoryExistence(file)\n this._writer = fs.createWriteStream(file, opts)\n }", "_createOutStream() {\n if (!this.hasStrea...
[ "0.6360994", "0.6210932", "0.61252856", "0.6092391", "0.58507514", "0.58320844", "0.5828932", "0.5808182", "0.57836926", "0.5736391", "0.5716696", "0.5663722", "0.565289", "0.56365263", "0.56234866", "0.5584767", "0.5509402", "0.548889", "0.547568", "0.5467163", "0.54494834",...
0.6208416
2
Callback for copy errors
onCopyError(err, fileId, file){ console.error(`ufs: cannot copy file "${ fileId }" (${ err.message })`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postProcess(fullPath, err, callback) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log(fullPath + \" :: \" + err);\r\n\t\t\tstats.notCopied++;\r\n\t\t} else {\r\n\t\t\tstats.copied++;\r\n\t\t}\r\n\t\tcallback(err);\r\n\t\treturn;\r\n\t}", "function copyDone (error)\n {\n if (!done) {\n done ...
[ "0.6858871", "0.68560594", "0.6420028", "0.6375872", "0.6355617", "0.6355617", "0.6355617", "0.63297385", "0.6305677", "0.6233977", "0.61602783", "0.6146487", "0.610055", "0.60528654", "0.60014653", "0.5951298", "0.5923801", "0.5850735", "0.58132696", "0.5800898", "0.57916665...
0.7448584
0
Called when a file is read from the store
onRead(fileId, file, request, response){ return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n // Start discovery before emitting 'ready'\n this._startDiscovery()\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case ...
[ "0.6754213", "0.6754213", "0.65707797", "0.6428382", "0.6393701", "0.62228674", "0.62119097", "0.61160326", "0.6099794", "0.6090277", "0.6021261", "0.59931135", "0.5972818", "0.5927376", "0.5921357", "0.59107727", "0.58832765", "0.5825979", "0.5816929", "0.58009094", "0.57940...
0.5881963
17
Callback for read errors
onReadError(err, fileId, file) { console.error(`ufs: cannot read file "${ fileId }" (${ err.message })`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fileReadFail(data){\n console.log(data);\n}", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"functi...
[ "0.7105714", "0.7103131", "0.7103131", "0.69294596", "0.6727306", "0.6637834", "0.6377284", "0.6305189", "0.6263204", "0.62251", "0.62251", "0.62251", "0.60787624", "0.6074641", "0.6053294", "0.60219383", "0.5984488", "0.5977155", "0.5969369", "0.5969369", "0.5965281", "0.5...
0.7006149
3
Callback for write errors
onWriteError(err, fileId, file) { console.error(`ufs: cannot write file "${ fileId }" (${ err.message })`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onWritten(writeErr) {\n var flags = fo.getFlags({\n overwrite: optResolver.resolve('overwrite', file),\n append: optResolver.resolve('append', file),\n });\n if (fo.isFatalOverwriteError(writeErr, flags)) {\n return callback(writeErr);\n }\n\n callback(null, f...
[ "0.6833985", "0.6832367", "0.67041546", "0.66737586", "0.6602585", "0.65970075", "0.65970075", "0.65970075", "0.6572105", "0.65528", "0.64744234", "0.643789", "0.6408611", "0.6408611", "0.624716", "0.6241803", "0.6182299", "0.61691356", "0.6083998", "0.606086", "0.60443527", ...
0.7415983
0
Get a list of the mns and request IP information from freegeopip.net.
function stringToAsciiByteArray(str) { var bytes = []; for (var i = 0; i < str.length; ++i) { var charCode = str.charCodeAt(i); if (charCode > 0xFF) // char > 1 byte since charCodeAt returns the UTF-16 value { throw new Error('Character ' + String.fromCharCode(charCode) + ' can\'t be represented by a US-ASCII byte.'); } bytes.push(charCode); } return bytes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smtpListIP(callback) {\n sendRequest('smtp/ips', 'GET', {}, true, callback);\n}", "function getGIP(ip, cb){\n\t\t\tgetJson('http://freegeoip.net/json/'+ip, function(err, response) {\n\t\t if (err) return console.log(err);\n\t\t burstData['ipInfo'] = response;\n\t\t cb();\n\t\t ...
[ "0.6273315", "0.6260975", "0.61501795", "0.6050293", "0.5896995", "0.5868202", "0.58319694", "0.5825227", "0.5737163", "0.5702264", "0.56971157", "0.5691566", "0.56155974", "0.5601853", "0.5597437", "0.5583499", "0.5567668", "0.55572575", "0.55418086", "0.5530812", "0.5490783...
0.0
-1
Transforms the player sprite, animating it.
static flap() { this.rotation = -0.4 this.velocity.y = -8 this.ddy = 0.4 this.playAnimation('flap') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "animate() {\n this._drawSprite(\n this.image, \n this.width * this.frameX, \n this.height * this.frameY,\n this.width, \n this.height, \n this.x,\n this.y, \n this.width, \n this.height\n )\n this.movePlayer()\n this.playerFrame() \n }", "animate() {\n...
[ "0.6978748", "0.6916832", "0.6885301", "0.6354462", "0.63019145", "0.6283818", "0.6275907", "0.5963863", "0.59549636", "0.5908835", "0.5887318", "0.5852894", "0.5836383", "0.58278877", "0.58272254", "0.5820986", "0.5820587", "0.5806747", "0.5799025", "0.5794417", "0.5786787",...
0.0
-1
Initialization to run after Vue element is mounted.
afterMount() { const $menu = $('#menu'); $menu.find('a[data-show-menu-item]').click((ev) => { // ugly hack, closing bootstrap's drop-down @TODO implement properly this._app.ui.$body.trigger('click'); const itemIdClicked = $(ev.target).attr('data-show-menu-item'); this.openMenuItem(itemIdClicked); return false; }); $menu.find('#menu_add_'+ ActionTypes.FILE.uid +' form').submit((ev) => { this._createAction(ev, data => { // remove empty arguments if (Variable.hasKey(data, 'arguments') && Variable.isArray(data.arguments) && !Variable.isEmpty(data.arguments)) { // trim each argument data.arguments.forEach(arg => { arg = arg.trim(); }); // and remove empty ones data.arguments = data.arguments.filter( arg => arg.length > 0 ); } return data; }); }); $menu.find('#menu_add_'+ ActionTypes.CLI.uid +' form').submit((ev) => { this._createAction(ev, data => data); }); for (const [itemId, item] of this.items) { if (!item.open) { this._app.ui.hide('#'+ itemId); } else { if (this.openItemId !== '') { throw new AppException( 'There are more then 1 item marked as open in the '+ 'menu config. map. There should be only one.' ); } this.openItemId = itemId; } } this._menuAddFileArguments = new DynamicInputComponent($menu); this._menuAddFileArguments.init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n this.initialize()\n }", "created() {\n this.__initEvents();\n }", "ready() {\n this.vue = createVUE(this[\"$mainDiv\"]);\n Editor.log(\"ConvertHelper view ready\");\n }", "function init() {\n if (app) { return; }\n\n app = new Vue({\n el ...
[ "0.7773843", "0.7097027", "0.70323855", "0.6949809", "0.6865894", "0.6722506", "0.6520785", "0.6455678", "0.6398997", "0.6387348", "0.6382065", "0.63811827", "0.6375909", "0.6375683", "0.63650894", "0.6336181", "0.63258755", "0.63233715", "0.6318046", "0.63053024", "0.6275885...
0.0
-1
51015 gSchool homework FIBONACCI
function fib(i){ var v1 = 1; var v2 = 1; var v3 = v1 + v2; console.log(v1); console.log(v2); while(v3 < i){ console.log(v3); v1 = v2; v2 = v3; v3 = v1 + v2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnal()\r\n{\r\n //invocking exam and crsmark, assigning parameters to variable with name fmark.\r\n //solving for fmark \r\nlet fmark = exam(75)+crsmark(40)\r\n//posting the fmark results to the browser's console\r\nconsole.log(fmark)\r\n\r\n}", "function fnal()\r\n {\r\n let fmark = exam(75)+crsmark(...
[ "0.58460474", "0.58380336", "0.5822746", "0.5810773", "0.572069", "0.5718671", "0.5699783", "0.5668609", "0.5652258", "0.5631147", "0.5576185", "0.55600184", "0.5554135", "0.55209225", "0.55174804", "0.546221", "0.54585326", "0.5452326", "0.5451209", "0.5444154", "0.5421957",...
0.0
-1
Radio function to record radio values selected on the Form with switch cases Michael Johnson
radiosetter(event){ console.log(event.target.value) switch (event.target.value) { case "TRUE": window.$attend = event.target.value break; case "FALSE": window.$attend = event.target.value break; case "Public": window.$classi = event.target.value break; case "Private": window.$classi = event.target.value break; case "Confidential": window.$classi = event.target.value break; case "3": window.$prio = event.target.value break; case "2": window.$prio = event.target.value break; case "1": window.$prio = event.target.value break; case "reTRUE": window.$reoccur = true break; case "reFALSE": window.$reoccur = false break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleOnChangeRadioCaptain(event)\n {\n var name=event.target.name;\n var val=event.target.value;\n \n \n setRadioVal(val);\n setMatchFormCaptain((prev)=>(\n {\n ...prev,\n [name]:val\n }\n ));\n if(val==\"individual\")\n {\n s...
[ "0.7195596", "0.6848786", "0.6802154", "0.6779773", "0.6540873", "0.65375733", "0.64778376", "0.6475562", "0.6474227", "0.643661", "0.6417002", "0.64150864", "0.6349353", "0.63360363", "0.63324636", "0.6325937", "0.6321981", "0.62917274", "0.62848204", "0.6283167", "0.6256738...
0.7622347
0
Function to find Geo Location Micahel Johnson
componentDidMount() { navigator.geolocation.getCurrentPosition(function(position) { window.$geolat = position.coords.latitude; window.$geolong = position.coords.longitude; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMe() {\n // try geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var homeMarker = new google.maps.Marker(...
[ "0.6421538", "0.64006156", "0.63834393", "0.62928313", "0.6247939", "0.6246115", "0.6222314", "0.6103186", "0.6096831", "0.6084145", "0.60389656", "0.5998104", "0.5979597", "0.59778184", "0.59683686", "0.5966911", "0.5961547", "0.59586334", "0.59461194", "0.5944628", "0.59291...
0.0
-1
Function to change the state ER
handleChange(event) { this.setState({value: event.target.value}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeState() {\n const newState = this.machineTable[this.state][this.lastRead].state;\n\n this.state = parseInt(newState, 10);\n }", "changeState(state)\r\n {\r\n if(state==\"hungry\"||state==\"busy\"||state==\"normal\"||state==\"sleeping\")\r\n {\r\n this.usteps.push(this.ini...
[ "0.72892815", "0.70337635", "0.66504353", "0.6645738", "0.65609807", "0.65090865", "0.6444135", "0.64076346", "0.6374096", "0.63366234", "0.63261634", "0.63032967", "0.62786627", "0.6260211", "0.6250374", "0.6233582", "0.6196118", "0.6187513", "0.6187003", "0.6171216", "0.616...
0.0
-1
Rendering of the Form itself Michael Johnson
render() { return ( <Container textAlign="left"> <Header as='h1' textAlign="center" text="bold">Please This Form Out For Your Event!</Header> <Grid> <Grid.Row left> <Grid.Column width={12}> <Form class="ui form"> <div class="field"> <label>Please Enter Start Date For Event</label> <Input id='beginDate' type='date' onChange={this.handleChange} onkeydown="return false" placeholder="e.g MM/DD/YYYY" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please Enter Start Time For Event</label> <Input id='beginTime' type='time' placeholder="e.g HH:MM" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please Enter End Date For Event</label> <input id='endDate' type='date' min={this.state.value} onkeydown="return false" placeholder="e.g MM/DD/YYYY" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please Enter End Time For Event</label> <Input id='endTime' type='time' labelPosition='right' placeholder="e.g HH:MM" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please Enter Description For Event</label> <input id='summ' placeholder="Please Enter the Description For the Event" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please Enter Location For Event</label> <input id={'loc'} placeholder="Please Enter the Location For the Event" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please list the items you're going to bring</label> <input id='items' placeholder="e.g shoes,basketball,phone,etc"/> </div> </Form> <Form class="ui form"> <div class="field"> <label>Invite any Guest to The Event</label> <input id='guest' placeholder="Please Enter the Guest Email" /> </div> </Form> <Form> <div className="ui form"> <div className="groupedfields"> <label>Priority of Event</label> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "3" name="example2"/> <label>Low</label> </div> </div> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "2" name="example2"/> <label>Medium</label> </div> </div> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "1" name="example2"/> <label>High</label> </div> </div> </div> </div> </Form> <Form> <div className="ui form"> <div className="groupedfields"> <label>Would you like to RSVP?</label> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "FALSE" name="example2"/> <label>Yes</label> </div> </div> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "TRUE" name="example2"/> <label>No</label> </div> </div> </div> </div> </Form> <Form> <div className="ui form"> <div className="groupedfields"> <label>Would you like to make this Event Public, Private, or Confidential?</label> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "Public" name="example3"/> <label>Public</label> </div> </div> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "Private" name="example3"/> <label>Private</label> </div> </div> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "Confidential" name="example3"/> <label>Confidential</label> </div> </div> </div> </div> </Form> <Form class="ui success form"> <div class="field"> <label>Please enter your Email</label> <div class="ui input"><input id='email' placeholder="e.g joe@schmoe.com" /></div> </div> </Form> <Form> <div className="ui form"> <div className="groupedfields"> <label>Would you like this Event to be reoccurring? </label> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "reTRUE" name="example2"/> <label>Yes</label> </div> </div> <div className="field"> <div className="ui radio checkbox" onChange={this.radiosetter.bind(this)}> <input type="radio" value = "reFALSE" name="example2"/> <label>No</label> </div> </div> </div> </div> </Form> <Form class="ui form"> <div class="field"> <label>Please Enter a Day For the Event to ReOccur</label> <input id='again' placeholder="Please Enter a number between 1-31" /> </div> </Form> <Form class="ui form"> <div class="field"> <label>Which Months You would like this event to occur on "Leave blank if you want every month"</label> <input id='againm' placeholder="Please Enter Months Numbers Seperated by commas" /> </div> </Form> <div id='submit' class='buttons'> <button class="ui button" onClick={this.downloadIcsFile}>Submit</button> </div> </Grid.Column> </Grid.Row> </Grid> </Container> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\r\n return(ViewsiteFormJSX.call(this));\r\n }", "render() {\n this.formElement.setAttribute(\"id\", this._id);\n this.formElement.setAttribute(\"method\", this._method);\n if (this._acceptFiles) {\n this.formElement.setAttribute(\"enctype\", \"multipart-form-data\");\n }\n\n //...
[ "0.70941657", "0.69905084", "0.6926282", "0.6909466", "0.67197365", "0.65790254", "0.6564476", "0.6509903", "0.6506521", "0.65054274", "0.64998835", "0.64559776", "0.6448297", "0.6407893", "0.64074963", "0.6400425", "0.6389717", "0.6389292", "0.6384271", "0.63695705", "0.6356...
0.0
-1
Form Handler method for saving user Comments. Form submitted from main.
function submit_comment() { if (!this.allow_comments) { return this.notfound(); } if (req.data.comment_type == "OpenID") { var identity = req.data.openid_identifier; var identity_server; var identity_delegation; try { var openid_info = this.get_openid_info(identity); identity_server = openid_info.server; identity_delegate = openid_info.delegate; } catch(e) { res.redirect(this.getURI("?submit_failed=true")); } var unique_string = session._id + "-" + new Date().valueOf(); var comment = req.data.comment; if (typeof session.data.pending_comments == "undefined") { session.data.pending_comments = {}; } session.data.pending_comments[unique_string] = {}; session.data.pending_comments[unique_string].identity = identity; session.data.pending_comments[unique_string].identity_server = identity_server; session.data.pending_comments[unique_string].body = comment; if (identity_delegate) { identity = identity_delegate; } app.log("ID/Delegate: " + identity); res.redirect(identity_server + "?openid.mode=checkid_setup&openid.identity=" + escape(identity) + "&openid.return_to=" + escape("http://" + req.data.http_host + this.getURI("submit_comment?comment_id=" + unique_string))); } if (req.data["openid.mode"] == "id_res") { app.log(req.data.toSource()); var server = session.data.pending_comments[req.data.comment_id].identity_server; var identity = session.data.pending_comments[req.data.comment_id].identity; var body = session.data.pending_comments[req.data.comment_id].body; var signed_params = req.data["openid.signed"].split(","); var params = {}; for (var i = 0; i < signed_params.length; i++) { var current_param = signed_params[i]; params["openid." + current_param] = req.data["openid." + current_param]; } params["openid.mode"] = "check_authentication"; params["openid.signed"] = req.data["openid.signed"]; params["openid.assoc_handle"] = req.data["openid.assoc_handle"]; params["openid.sig"] = req.data["openid.sig"]; // Curl Command for verification var postbody = []; for (var p in params) { postbody.push(p + "=" + escape(params[p])); } app.log("curl -d \"" + postbody.join("&") + "\" "+server); // End try { var client = new org.apache.commons.httpclient.HttpClient(); var method = new org.apache.commons.httpclient.methods.PostMethod(server); for (var j in params) { method.addParameter(j, params[j]); } var statusCode = client.executeMethod(method); var result = ""; if (statusCode != -1) { result = method.getResponseBodyAsString(); } method.releaseConnection(); } catch (e) { app.log("Error Posting Verification: " + e.message); res.redirect(this.getURI("?submit_failed=true")); return; } if (result.match(/is_valid:true/g)) { var whitelisted = get_home_page().openid_whitelist.contains(identity); var data = {}; data.name = null; data.email = null; data.openid_identifier = identity; data.comment_type = "OpenID"; data.body = new XMLList(body.replace(/\&(?!amp;)/g, "&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br/>")); data.approved = whitelisted; this.add_comment(data); delete session.data.pending_comments[req.data.comment_id]; if (check_setting('comment_notifications',true)) { var mailer = new Mail(); var admin = app.getObjects("User",{username:"admin"})[0]; var hp = get_home_page(); mailer.setFrom(admin.email, admin.fullname); var author = this.author.getTarget(); mailer.setSubject("Axiom Blog - Comment Notification"); mailer.setTo(author.email); mailer.addText(author.fullname+",\n\nYour Post, \"" + this.title + "\" has received a new comment.\n\nPlease visit http://"+req.data.http_host+hp.getURI('manage_postings')+" to Manage Posts."); mailer.send(); } if (whitelisted) { res.redirect(this.getURI("?submitted_whitelist=true")); } else { res.redirect(this.getURI("?submitted=true")); } return; } else { res.redirect(this.getURI("?submit_failed=true")); return; } } if (req.data.comment_type == "Anonymous") { var data = {}; data.name = req.data.name; data.email = req.data.email; data.openid_identifier = null; data.comment_type = req.data.comment_type; data.body = new XMLList(req.data.comment.replace(/\&(?!amp;)/g, "&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br/>")); data.approved = false; this.add_comment(data); if (check_setting('comment_notifications',true)) { var mailer = new Mail(); var admin = app.getObjects("User",{username:"admin"})[0]; var hp = get_home_page(); mailer.setFrom(admin.email, admin.fullname); var author = this.author.getTarget(); mailer.setSubject("Axiom Blog - Comment Notification"); mailer.setTo(author.email); mailer.addText(author.fullname+",\n\nYour Post, \"" + this.title + "\" has received a new comment.\n\nPlease visit http://"+req.data.http_host+hp.getURI('manage_postings')+" to Manage Posts."); mailer.send(); } res.redirect(this.getURI("?submitted=true")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formHandler(event) {\n\t// prevent page refresh\n\tevent.preventDefault();\n\t// construct a new comment and POST to backend\n\tconst name = event.target.name.value;\n\tconst content = event.target.content.value;\n\tif (name !== \"\" && content !== \"\") {\n\t\tpostComment(event, {\n\t\t\tname: name,\n\t\...
[ "0.7121137", "0.711983", "0.7106537", "0.6931129", "0.68315953", "0.6738372", "0.6551232", "0.6541084", "0.65084565", "0.64588594", "0.63915026", "0.63717484", "0.6348002", "0.6343803", "0.6333585", "0.63263977", "0.6319194", "0.6318107", "0.63123345", "0.62974095", "0.626122...
0.61246794
28
Grabs an OpenID Profile and returns the openid.server Address.
function get_openid_info(id) { var client = new org.apache.commons.httpclient.HttpClient(); var method = new org.apache.commons.httpclient.methods.GetMethod(id); var statusCode = client.executeMethod(method); var result = ""; if (statusCode != -1) { result = method.getResponseBodyAsString(); } method.releaseConnection(); var tidy = new Packages.org.w3c.tidy.Tidy(); tidy.setQuiet(true); tidy.setShowWarnings(false); tidy.setHideComments(true); tidy.setFixUri(true); tidy.setNumEntities(true); tidy.setXHTML(true); tidy.setDocType("omit"); var baos = new Packages.java.io.ByteArrayOutputStream(); var str = new Packages.java.lang.String(result.toString()); var ios = new Packages.java.io.ByteArrayInputStream(str.getBytes("UTF-8")); tidy.parse(ios,baos); var xml = new XMLList(baos.toString().replace(/xmlns="[^"]+"/g,"")); var obj = {}; obj.server = xml..link.(@rel=="openid.server").@href.toString(); obj.delegate = xml..link.(@rel=="openid.delegate").@href.toString(); return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProfile(res, callback) {\n var data = querystring.stringify({\n 'schema' : 'openid',\n\t'access_token' : access_token\n });\n\n post(PROFILE_ENDPOINT, data, function(status, body) {\n callback(status, body);\n }); \n}", "getProfile() {\n\t\treturn decode(this.getToken());\n\t}", "getProfi...
[ "0.5602584", "0.5444956", "0.53795326", "0.53470194", "0.5299025", "0.5282743", "0.5257924", "0.5231829", "0.51716214", "0.5152446", "0.51335514", "0.51325315", "0.5100429", "0.5091683", "0.505408", "0.5043195", "0.50252885", "0.50085896", "0.49872497", "0.49705845", "0.49700...
0.4881453
26
Add a new comment to the post. Parameters: data: Object with properties: name (String): Name of commenter. email (String): Email address of commenter. openid_identifier (String): OpenID Identifier of commenter. comment_type (String): Type of Commenter Authentication body (XML): Body of comment. approved (Boolean): True only if it is an OpenID Comment and the author is whitelisted. Return: new Comment object
function add_comment(data){ data = (data || req.data); var comment = new Comment(); comment.edit({ name: data.name, email: data.email, openid_identifier: data.openid_identifier, comment_type: data.comment_type, body: data.body, date: new Date(), approved: data.approved }) this.add(comment); return comment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(info) {\r\n if (typeof info === \"string\") {\r\n info = { text: info };\r\n }\r\n const postBody = jsS(extend(metadata(\"Microsoft.SharePoint.Comments.comment\"), info));\r\n return this.clone(Replies_1, null).postCore({ body: postBody }).then(d => {\r\n retur...
[ "0.5972021", "0.59300447", "0.5929609", "0.5679981", "0.56744295", "0.55608624", "0.5463548", "0.5320504", "0.5259151", "0.5256423", "0.5236916", "0.5230423", "0.52283365", "0.51845914", "0.5172566", "0.5163379", "0.5160917", "0.515933", "0.51495856", "0.514935", "0.51209515"...
0.77222997
0
Get all the approved Comments on this post. Return: Array of Comment objects.
function approved_comments(){ return this.getChildren('Comment',{'approved':'true'},{sort:{date:'asc'}}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function approved_comments_count() {\r\n\treturn this.getChildCount('Comment',{'approved':'true'});\r\n}", "async getAllComments() {\n const commentCollection = await comments();\n const commentList = await commentCollection.find({}).toArray();\n if (!commentList) throw 'No comments in system!';\n re...
[ "0.6102615", "0.59205925", "0.5705834", "0.568295", "0.5633726", "0.5630987", "0.55688477", "0.5471384", "0.5435051", "0.542694", "0.5377437", "0.53609544", "0.5326957", "0.53234905", "0.5319555", "0.52545244", "0.5242726", "0.52309483", "0.5212486", "0.51856387", "0.5156752"...
0.69977313
0
Get all comments on this post, approved and unapproved. Return: Array of Comment objects.
function all_comments(){ return this.getChildren('Comment',{},{sort:{date:'asc'}}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAllComments() {\n const commentCollection = await comments();\n const commentList = await commentCollection.find({}).toArray();\n if (!commentList) throw 'No comments in system!';\n return commentList;\n }", "async getComments() {\n try {\n if (!this.API || !this.issue || ...
[ "0.68191123", "0.6246339", "0.62149006", "0.61482036", "0.6082357", "0.607265", "0.6065568", "0.5965983", "0.595799", "0.5954693", "0.59393984", "0.5918093", "0.5914873", "0.5874622", "0.58115524", "0.5729036", "0.56720185", "0.56687325", "0.56672513", "0.55822325", "0.556657...
0.6246031
2
Get the total number of approved comments on this post. Return: Integer total.
function approved_comments_count() { return this.getChildCount('Comment',{'approved':'true'}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function approved_comments(){\r\n\treturn this.getChildren('Comment',{'approved':'true'},{sort:{date:'asc'}});\r\n}", "function all_comments_count() {\r\n\treturn this.getChildCount('Comment');\r\n}", "function getComments(post_id){\n\tvar commentsURL = fbBaseURL + post_id + \"/comments?summary=true&access_tok...
[ "0.5818066", "0.5814031", "0.5627246", "0.5577434", "0.5525386", "0.5481292", "0.5457009", "0.5337349", "0.5260051", "0.52075946", "0.518304", "0.5151788", "0.50492823", "0.5038955", "0.49654782", "0.49506906", "0.49292675", "0.49233058", "0.4882727", "0.48730376", "0.4832817...
0.8012341
0
Get the total number of approved comments on this post. Return: Integer total.
function all_comments_count() { return this.getChildCount('Comment'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function approved_comments_count() {\r\n\treturn this.getChildCount('Comment',{'approved':'true'});\r\n}", "function approved_comments(){\r\n\treturn this.getChildren('Comment',{'approved':'true'},{sort:{date:'asc'}});\r\n}", "function getComments(post_id){\n\tvar commentsURL = fbBaseURL + post_id + \"/comment...
[ "0.8013441", "0.58193487", "0.5630849", "0.55797416", "0.55296946", "0.548269", "0.5459699", "0.53406626", "0.5263418", "0.52079964", "0.51862407", "0.51546055", "0.50517917", "0.5038349", "0.49657887", "0.49516806", "0.49316606", "0.4925264", "0.48830742", "0.48757875", "0.4...
0.58176184
2
Get all categories associated with this post. Return: Array of Category objects
function get_categories(){ var cats = []; if (this.categories != null) { for (var i = 0; i < this.categories.length; i++) { cats.push(this.categories[i].getTarget()); } } return cats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n }", "async categories() {\n return await this.fetch(\"/categories/list\");\n }", "getCategories() {\n if (this._categories && this._categories.length > 0) return this._categories;\n return ...
[ "0.687837", "0.68249744", "0.66589063", "0.6603288", "0.6559442", "0.6401961", "0.63099825", "0.6263015", "0.6036076", "0.5957091", "0.59294176", "0.58153427", "0.576833", "0.5745085", "0.5719241", "0.5655395", "0.56550354", "0.56341344", "0.562505", "0.5616262", "0.5604106",...
0.6036557
8
Get all categories associated with this post in a nice format for posts Return: XMLList Object with comma seperated links to each Category
function get_categories_view() { var cats = this.get_categories().map(function(obj) { var str = '<a href="' + obj.getURI() + '">' + obj.title + '</a>'; return str.replace(/&(?!\w+;)/g, '&amp;') }).join(', '); return this.categories != null ? new XMLList(cats) : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async categories() {\n return await this.fetch(\"/categories/list\");\n }", "function getWPCategories(xml) {\n if (!xml.rss.channel) {\n console.log('No rss channel found in categories xml');\n return [];\n }\n var categories=xml.rss.channel[0]['wp:category'];\n var catref=[];...
[ "0.6806335", "0.6777671", "0.66868407", "0.6651785", "0.639815", "0.63537943", "0.63431793", "0.63156295", "0.6290408", "0.62513036", "0.62465155", "0.62393993", "0.6196344", "0.6188861", "0.61800474", "0.6131613", "0.6125114", "0.60707283", "0.60175323", "0.6017332", "0.5985...
0.7034298
0
Get the author's name. Handles error if the author has been deleted.
function get_author_name() { if (this.author != null) { return this.author.getTarget().fullname; } return "Unknown"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_author_username() {\r\n\tif (this.author != null) {\r\n\t\treturn this.author.getTarget().username;\r\n\t}\r\n\treturn \"Unknown (Author removed)\";\r\n}", "getAuthor(author) {\n // Remove email from returned author - only return users name\n const start = author.indexOf('\"');\n const name...
[ "0.82831985", "0.7547311", "0.6499334", "0.6476434", "0.6455295", "0.6455295", "0.6455295", "0.63883114", "0.63801336", "0.63689816", "0.63534397", "0.63516796", "0.62818336", "0.61833984", "0.6174835", "0.61392933", "0.6128569", "0.6054493", "0.60192716", "0.6000587", "0.599...
0.8112286
1
Get the author's username. Handles error if the author has been deleted.
function get_author_username() { if (this.author != null) { return this.author.getTarget().username; } return "Unknown (Author removed)"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_author_name() {\r\n\tif (this.author != null) {\r\n\t\treturn this.author.getTarget().fullname;\r\n\t}\r\n\treturn \"Unknown\";\r\n}", "getAuthor(author) {\n // Remove email from returned author - only return users name\n const start = author.indexOf('\"');\n const name = author.slice(start...
[ "0.73662704", "0.7046348", "0.64650893", "0.6430996", "0.6279665", "0.6254656", "0.6254656", "0.6254656", "0.616023", "0.6118218", "0.610542", "0.60356665", "0.6023738", "0.6014604", "0.59906024", "0.5973528", "0.5955309", "0.59215873", "0.58995855", "0.58483577", "0.58450055...
0.8561189
0
Get the author's email. Handles error if the author has been deleted.
function get_author_email() { if (this.author != null) { return this.author.getTarget().email; } return app.getObjects("User",{username: "admin"})[0].email; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_author_username() {\r\n\tif (this.author != null) {\r\n\t\treturn this.author.getTarget().username;\r\n\t}\r\n\treturn \"Unknown (Author removed)\";\r\n}", "getAuthor(author) {\n // Remove email from returned author - only return users name\n const start = author.indexOf('\"');\n const name...
[ "0.71114933", "0.6884515", "0.6486024", "0.6468802", "0.6269925", "0.6227137", "0.6201179", "0.6201179", "0.6201179", "0.61180735", "0.61139846", "0.60526365", "0.602287", "0.60219723", "0.577541", "0.57725364", "0.5760797", "0.57485825", "0.57426536", "0.5736332", "0.5680112...
0.8386806
0
Template logic function that determines if the date should be shown when iterating over posts. Return: Boolean, true if date should be shown.
function show_date(index, posts) { if (index == 0) { return true; } if (posts[index].date.toLocaleDateString() == posts[index - 1].date.toLocaleDateString()) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDateFilter(quickFilter) {\n return utils.isNotEmptyVal(quickFilter) && quickFilter.value == 'Custom dates';\n }", "renderUpcomingEvents() {\n var text = [];\n var email = Profiles.findOne({ accountId: Meteor.user()._id }).email.toString();\n let postsToDisplay = Post...
[ "0.6329059", "0.6179085", "0.6027633", "0.59871954", "0.5946345", "0.5937714", "0.57691777", "0.572359", "0.5547303", "0.5547303", "0.5503039", "0.5503039", "0.5498904", "0.54947126", "0.54786396", "0.54612195", "0.544287", "0.54188657", "0.5400119", "0.53639555", "0.53409666...
0.7517295
0
get the medain of an array
function median(values) { values.sort(); var half = Math.floor(values.length/2); if(values.length % 2) return values[half]; else return (values[half-1] + values[half]) / 2.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mediana(array) {\n\t\t\tarray = ordenar(array);\n\t\t\t// Separamos los casos\n\t\t\tif (array.length % 2 == 0) { // Para pares\n\t\t\t\tlet number1 = array[array.length/2];\n\t\t\t\tlet number2 = array[array.length/2 - 1];\n\t\t\t\tlet mediana = (number1 + number2)/2;\n\t\t\t\treturn mediana;\n\t\t\t}\n\...
[ "0.67337173", "0.6632182", "0.65721864", "0.6541169", "0.6347913", "0.6301469", "0.622115", "0.620125", "0.6077073", "0.5928145", "0.59142154", "0.58927035", "0.58790416", "0.58655584", "0.58403885", "0.57822716", "0.57804316", "0.576877", "0.57573307", "0.5750688", "0.570927...
0.0
-1
la navigazione attraverso le pagine va fatta esclusivamente da cui
componentWillMount() { if(localStorage.getItem('userToken') == 'NaN'){ //console.log(localStorage.getItem('userToken')); if(this.props.location.pathname != '/'){ this.redirectToLogin(); } }else{ if(this.props.location.pathname == '/auth'){ //return this.setUser(); if(localStorage.getItem('userRole') == "Fornitore"){ return browserHistory.push('/profilo-fornitore'); // reindirizzo alla home page } if(localStorage.getItem('userRole') == "Banditore"){ return browserHistory.push('/banditore-pannel'); // reindirizzo alla home page } if(localStorage.getItem('userRole') == "Supervisore"){ return browserHistory.push('/admin-pannel'); // reindirizzo alla home page } } } //listener per gli eventi che si possono verificare nell'applicazio eventBus.on('logout', () => this.onLogout()); eventBus.on('toLogin', () => this.redirectToLogin()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagfun() {\n if ($scope.currentPage != $scope.paging.current) {\n $scope.currentPage = $scope.paging.current;\n $scope.receiptFilter.Page = $scope.currentPage;\n getpagedPagedReceipts();\n }\n }", "function paginationOnClick() {\n $(\".page\").eac...
[ "0.6600536", "0.6516225", "0.63527614", "0.62921333", "0.62886137", "0.6266813", "0.62250113", "0.6223648", "0.620794", "0.620589", "0.6175903", "0.6156059", "0.6155777", "0.61349684", "0.61145675", "0.6098048", "0.60937256", "0.6091005", "0.6085422", "0.60840553", "0.6076254...
0.0
-1
sort transaction objects by date
function compare_date( a, b ) { if ( a.date < b.date){ return -1; } if ( a.date > b.date ){ return 1; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSortedTransactions(data) {\n const sortedTransactions = data.transactions.sort((a, b) => {\n let dateA = new Date(a.startDate),\n dateB = new Date(b.startDate);\n return dateA - dateB;\n });\n\n return sortedTransactions;\n}", "function sortListsByDate() {\r\n\t\treturn getItems().sort(...
[ "0.760752", "0.72287154", "0.72163606", "0.6952941", "0.6944496", "0.6911185", "0.6895763", "0.6795771", "0.67186797", "0.66677874", "0.66629845", "0.6638949", "0.66123164", "0.65517336", "0.6537962", "0.64797956", "0.64319927", "0.63688153", "0.6368294", "0.63253075", "0.632...
0.5773388
65
constructor of the class
constructor(props) { super(props); this.state = { fname : '', username : '', email : '', password : '' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "constructor (){}", "consructor() {\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "function _construct()\n\t\t{;\n\t\t}", "constructor( ) {}", "function Constructor() {}", "fun...
[ "0.8792433", "0.8675499", "0.8564481", "0.8529945", "0.8529945", "0.8529945", "0.8529945", "0.8529945", "0.8529945", "0.8529945", "0.8467768", "0.8379354", "0.82282287", "0.82282287", "0.82282287", "0.8197513", "0.8191107", "0.8155933", "0.81251675", "0.8093668", "0.8040219",...
0.0
-1
Copied from facebook/react build setup Based on deepfreeze by substack (public domain)
function deepFreeze(o) { Object.freeze(o); Object.getOwnPropertyNames(o).forEach(function(prop) { if ( o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop]) ) { deepFreeze(o[prop]); } }); return o; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildApp(){\n var idAlias={};\n //idAlias[__dirname + \"/node_modules/react/react.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/react-v0.12.2.min.js\"] = \"react\";\n idAlias[__dirname + \"/src/js/vendor/jquery.js\"] = \"jquery\";\n\n /**\n * We want to expose our core modul...
[ "0.65263927", "0.56374985", "0.5615138", "0.5604688", "0.5511884", "0.5495517", "0.54453856", "0.5422614", "0.54026014", "0.53725135", "0.53501874", "0.5322882", "0.5320823", "0.52783734", "0.5270768", "0.52587056", "0.52587056", "0.52554107", "0.52476853", "0.5237248", "0.52...
0.0
-1
Multiple matcher Object. It tries to find a set of Contacts that match at least one of the targets passed as parameters ptargets: They are the targets (telephone numbers, emails) we want to find in the Contacts DB mmatchingOptions: are the matching options to be passed to the mozContacts API. Particularly filterBy and filterOp MultipleMatcher.onmatch is called when there is at least one matching MultipleMatcher.onmismatch is called when there are no matches
function MultipleMatcher(ptargets, pmatchingOptions) { var next = 0; var self = this; var targets = ptargets; var matchingOptions = pmatchingOptions; var finalMatchings = {}; function doMatchBy(target, callbacks) { var options = { filterValue: target, filterBy: matchingOptions.filterBy, filterOp: matchingOptions.filterOp }; var req = navigator.mozContacts.find(options); req.onsuccess = function() { var matchings = req.result.filter(function(aResult) { return filterFacebook(aResult, matchingOptions.linkParams); }); var filterBy = options.filterBy; matchings.forEach(function(aMatching) { if (matchingOptions.selfContactId === aMatching.id) { return; } var values = aMatching[options.filterBy[0]]; var matchedValue; values.forEach(function(aValue) { var type = aValue.type; var value = aValue.value; if (value === target || value.indexOf(target) !== -1 || target.indexOf(value) !== -1) { matchedValue = value; } finalMatchings[aMatching.id] = { target: target, fields: filterBy, matchedValues: [matchedValue], matchingContact: aMatching }; }); }); // matchings.forEach carryOn(); }; // onsuccess req.onerror = function(e) { window.console.error('Error while trying to do the matching', e.target.error.name); notifyMismatch(self); }; } function carryOn() { next++; if (next < targets.length) { doMatchBy(targets[next], callbacks); } else if (Object.keys(finalMatchings).length > 0) { notifyMatch(self, finalMatchings); } else { notifyMismatch(self); } } function matched(contacts) { carryOn(); } var callbacks = { onmatch: matched, onmismatch: carryOn }; this.start = function() { doMatchBy(targets[0], callbacks); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchBy(aContact, field, filterOper, callbacks, poptions) {\n var options = poptions || {};\n var values = [];\n\n if (Array.isArray(aContact[field])) {\n aContact[field].forEach(function(aField) {\n if (typeof aField.value === 'string') {\n values.push(aField.value.trim());\...
[ "0.5838128", "0.5774612", "0.5255151", "0.5148839", "0.49840382", "0.4919277", "0.4919277", "0.49125096", "0.4879127", "0.4870318", "0.48661682", "0.48654768", "0.48581672", "0.48003384", "0.473786", "0.473203", "0.46648726", "0.4652279", "0.4652279", "0.4652279", "0.4652279"...
0.86418617
0
Match a Contact by the field and filter specified as parameters Callbacks is an object that declares onmatch and onmismatch callbacks
function matchBy(aContact, field, filterOper, callbacks, poptions) { var options = poptions || {}; var values = []; if (Array.isArray(aContact[field])) { aContact[field].forEach(function(aField) { if (typeof aField.value === 'string') { values.push(aField.value.trim()); } }); } if (values.length > 0) { var matcher = new MultipleMatcher(values, { filterBy: [field], filterOp: filterOper, selfContactId: aContact.id, linkParams: options }); matcher.onmatch = callbacks.onmatch; matcher.onmismatch = callbacks.onmismatch; matcher.start(); } else { notifyMismatch(callbacks); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doMatchPassive(aContact, callbacks) {\n if (!hasName(aContact)) {\n notifyMismatch(callbacks);\n return;\n }\n\n var matchingsFound = {};\n\n var localCbs = {\n onmatch: function(results) {\n // Results will contain contacts that match by tel or email\n // Normaliz...
[ "0.6872277", "0.6604658", "0.6512204", "0.61193866", "0.6071128", "0.58820045", "0.5773177", "0.5730098", "0.5688053", "0.5515812", "0.5500917", "0.5445211", "0.53851014", "0.53029686", "0.52436954", "0.5223762", "0.52205473", "0.5157658", "0.51518303", "0.5151771", "0.515177...
0.8070069
0
Performs a matching for an incoming contact 'aContact' and the mode ['active', passive'] specified as parameter. Callbacks is an object with the onmatch and onmismatch functions that will be called after the matching process has finished
function doMatch(aContact, mode, callbacks) { if (mode === 'passive') { doMatchPassive(aContact, callbacks); } else if (mode === 'active') { doMatchActive(aContact, callbacks); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doMatchPassive(aContact, callbacks) {\n if (!hasName(aContact)) {\n notifyMismatch(callbacks);\n return;\n }\n\n var matchingsFound = {};\n\n var localCbs = {\n onmatch: function(results) {\n // Results will contain contacts that match by tel or email\n // Normaliz...
[ "0.7951348", "0.6859358", "0.6476708", "0.5981424", "0.53602374", "0.5288022", "0.5119896", "0.46549693", "0.45636374", "0.45361337", "0.45223886", "0.4443181", "0.4434629", "0.44343573", "0.44242692", "0.44133064", "0.44089344", "0.43859547", "0.43701506", "0.4352006", "0.43...
0.83492684
0
Implements the active mode 'matching'
function doMatchTelAndEmail(aContact, callbacks, options) { var localCbs = { onmatch: function(telMatches) { var matchCbs = { onmatch: function(mailMatches) { // Have a unique set of matches var allMatches = telMatches; Object.keys(mailMatches).forEach(function(aMatch) { if (!allMatches[aMatch]) { allMatches[aMatch] = mailMatches[aMatch]; } else { allMatches[aMatch].fields.push('email'); allMatches[aMatch].matchedValues.push( mailMatches[aMatch].matchedValues[0]); } }); notifyMatch(callbacks, allMatches); }, onmismatch: function() { notifyMatch(callbacks, telMatches); } }; matchByEmail(aContact, matchCbs, options); }, onmismatch: function() { matchByEmail(aContact, callbacks, options); } }; matchByTel(aContact, localCbs, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchingEngine() {\n updateScoreBoard();\n if (selectedElements[0][0].firstChild.className == selectedElements[1][0].firstChild.className) {\n $(selectedElements[1]).addClass('open show match');\n $(selectedElements[0]).addClass('match');\n $(selectedElements[1]).off('click');\n...
[ "0.6715476", "0.6561661", "0.64591795", "0.62072444", "0.61714727", "0.6028058", "0.5941136", "0.5766531", "0.57649195", "0.5720899", "0.5694597", "0.5655817", "0.56517446", "0.5641875", "0.56260973", "0.56108814", "0.5606493", "0.56062055", "0.56062055", "0.56062055", "0.560...
0.0
-1
Implements the silent mode matching
function doMatchPassive(aContact, callbacks) { if (!hasName(aContact)) { notifyMismatch(callbacks); return; } var matchingsFound = {}; var localCbs = { onmatch: function(results) { // Results will contain contacts that match by tel or email // Normalizing the strings var names = []; Object.keys(results).forEach(function(aResultId) { var mContact = results[aResultId].matchingContact; if (!hasName(mContact)) { return; } // As the number of candidates here will be short a normal search // will be conducted var targetFN = null; if (!isEmptyStr(aContact.familyName)) { targetFN = Normalizer.toAscii( aContact.familyName[0].trim().toLowerCase()). replace(blankRegExp, ''); } var targetGN = null; if (!isEmptyStr(aContact.givenName)) { targetGN = Normalizer.toAscii( aContact.givenName[0].trim().toLowerCase()). replace(blankRegExp, ''); } // To support seamless matching of SIM contacts var targetName = (targetGN || '') + (targetFN || ''); var mFamilyName = null; var mGivenName = null; if (!isEmptyStr(mContact.familyName)) { mFamilyName = Normalizer.toAscii( mContact.familyName[0].trim().toLowerCase()). replace(blankRegExp, ''); } if (!isEmptyStr(mContact.givenName)) { mGivenName = Normalizer.toAscii( mContact.givenName[0].trim().toLowerCase()). replace(blankRegExp, ''); } // To support seamless matching of SIM contacts var mName = (mGivenName || '') + (mFamilyName || ''); names.push({ contact: mContact, familyName: mFamilyName, givenName: mGivenName, name: mName }); var matchingList = names.filter(function(obj) { return ((obj.familyName === targetFN && obj.givenName === targetGN) || (obj.name && obj.name === targetName) && ( !Array.isArray(obj.contact.category) || obj.contact.category.indexOf(FB_CATEGORY) === -1)); }); matchingList.forEach(function(aMatching) { var contact = aMatching.contact; matchingsFound[contact.id] = { matchingContact: contact }; }); }); reconcileResults(aContact, matchingsFound, results, callbacks); }, onmismatch: function() { notifyMismatch(callbacks); } }; // Matching by email and phone number, then match by names doMatchTelAndEmail(aContact, localCbs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseSilent(event) {\n if (event.detail.needAddBase && this.baseUrl.length) {\n let evPath = event.detail.path;\n if (evPath[0] === \"/\")\n evPath = evPath.substring(1);\n evPath = this.baseUrl + evPath;\n event.detail.path = evPath;\n }\n ...
[ "0.5195979", "0.51513416", "0.51513416", "0.5120939", "0.50550246", "0.50411546", "0.49722338", "0.49106178", "0.49045828", "0.4866577", "0.485489", "0.48337755", "0.48156074", "0.48021492", "0.4773124", "0.47602376", "0.47436357", "0.47421786", "0.47106096", "0.4692055", "0....
0.0
-1
Used for the active mode. Performs matching by familyName and givenName
function matchByName(aContact, callbacks, options) { // First we try to find by familyName // Afterwards we search by givenName var isSimContact = (Array.isArray(aContact.category) && aContact.category.indexOf('sim') !== -1); if ((isEmptyStr(aContact.familyName) || isEmptyStr(aContact.givenName)) && !isSimContact) { notifyMismatch(callbacks); return; } var finalResult = {}; var resultsByName = null; if (!isEmptyStr(aContact.name)) { var reqName = navigator.mozContacts.find({ filterValue: aContact.name[0].trim(), filterBy: ['name'], filterOp: 'equals' }); reqName.onsuccess = function() { resultsByName = reqName.result.filter(function(aResult) { return filterFacebook(aResult, options); }); notifyFindNameReady(); if (isEmptyStr(aContact.familyName)) { processByNameEnd(finalResult, resultsByName, callbacks); } }; reqName.onerror = function(e) { window.console.error('Error while trying to find by name: ', e.target.error.name); resultsByName = []; notifyFindNameReady(); if (isEmptyStr(aContact.familyName)) { processByNameEnd(finalResult, resultsByName, callbacks); } }; } else { resultsByName = []; notifyFindNameReady(); } if (!isEmptyStr(aContact.familyName)) { var reqFamilyName = navigator.mozContacts.find({ filterValue: aContact.familyName[0].trim(), filterBy: ['familyName'], filterOp: 'equals' }); reqFamilyName.onsuccess = function() { var results = reqFamilyName.result; var givenNames = []; var targetGN = Normalizer.toAscii( aContact.givenName[0].trim().toLowerCase()). replace(blankRegExp, ''); results.forEach(function(mContact) { if (mContact.id === aContact.id || isEmptyStr(mContact.givenName)) { return; } givenNames.push({ contact: mContact, givenName: Normalizer.toAscii( mContact.givenName[0].trim().toLowerCase()). replace(blankRegExp, '') }); }); var finalMatchings = givenNames.filter(function(obj) { var gn = obj.givenName; return ((gn === targetGN || targetGN.startsWith(gn) || gn.startsWith(targetGN)) && filterFacebook(obj.contact, options)); }); finalMatchings.forEach(function(aMatching) { finalResult[aMatching.contact.id] = { matchingContact: aMatching.contact }; }); if (resultsByName) { processByNameEnd(finalResult, resultsByName, callbacks); } else { document.addEventListener('by_name_ready', function nameReady() { document.removeEventListener('by_name_ready', nameReady); processByNameEnd(finalResult, resultsByName, callbacks); }); } }; reqFamilyName.onerror = function(e) { window.console.error('Error while trying to find by familyName: ', e.target.error.name); notifyMismatch(callbacks); }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doMatchPassive(aContact, callbacks) {\n if (!hasName(aContact)) {\n notifyMismatch(callbacks);\n return;\n }\n\n var matchingsFound = {};\n\n var localCbs = {\n onmatch: function(results) {\n // Results will contain contacts that match by tel or email\n // Normaliz...
[ "0.6191179", "0.60478085", "0.5961747", "0.55659485", "0.54730356", "0.5405267", "0.5376768", "0.52698195", "0.52603346", "0.5188872", "0.50190306", "0.4995887", "0.49869987", "0.49711284", "0.49700275", "0.49350566", "0.4931034", "0.49259922", "0.4902067", "0.48958352", "0.4...
0.61597574
1
[] input: string output: array includes a string rules: if the in the middle, return [] repeated , count the last if chars after is not letters, return [] algo: split up, convert the string into array initialize result = [] iterate thru the array for each word if the word includes anything that is not letters, return [] otherwise if (word start with ) get the chars after to result otherwise, do nothing end loop return the result
function getHashtags(string) { let result = []; string.split(' ').forEach(word => { if (!word.match(/[a-z]/ig)) return result; if (word[0] === "#") result.push((word.slice(1)).replace(/#/g, '')); }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LetterCountI(str){\n // remove special characters from string\n str = str.replace(/[&\\!/\\\\#,+()$~%.:*?<>{}]/g, '');\n var strNew = [];\n // str to array\n var strArray = str.split(' ');\n // loop through each word of array\n for (var x = 0; x < strArray.length; x++) {\n var newWord = \"\";\n ...
[ "0.73581815", "0.6968203", "0.6675318", "0.66569054", "0.65975934", "0.648018", "0.64354426", "0.64331645", "0.63927615", "0.63887644", "0.6384408", "0.63594073", "0.63525593", "0.63499576", "0.62963337", "0.629565", "0.62865984", "0.6278229", "0.6275176", "0.6267247", "0.626...
0.0
-1
3 dashes or more will be converted in a divider
divider(str) { return str.replace(new RegExp('-{3,}', 'g'), '<hr>') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tambahDash(str) {\n var string = \"\";\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] % 2 == 1 && str[i - 1] % 2 == 1) {\n string += \"-\" + str[i];\n } else {\n string += str[i];\n }\n }\n\n return string;\n}", "function insertDash(num) {\n //code me\n var result = [...
[ "0.7128013", "0.6972813", "0.6897738", "0.6805184", "0.6800019", "0.65764976", "0.65193063", "0.6450259", "0.6239438", "0.6223105", "0.6221625", "0.614771", "0.6054872", "0.59519964", "0.5928563", "0.5898527", "0.58984596", "0.5884457", "0.5875157", "0.58545774", "0.58139783"...
0.76601315
0
SessionEndedRequest notifies that a session was ended. This handler will be triggered when a currently open session is closed for one of the following reasons: 1) The user says "exit" or "quit". 2) The user does not respond or says something that does not match an intent defined in your voice model. 3) An error occurs
canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'SessionEndedRequest'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEn...
[ "0.7869333", "0.78649646", "0.78629607", "0.7855893", "0.7854745", "0.7840299", "0.7840299", "0.7840299", "0.78277594", "0.78277594", "0.7661801", "0.76541567", "0.7639594", "0.763551", "0.763551", "0.76287675", "0.76248366", "0.7618477", "0.7618477", "0.7618477", "0.761541",...
0.6500113
70
The intent reflector is used for interaction model testing and debugging. It will simply repeat the intent the user said. You can create custom handlers for your intents by defining them above, then also adding them to the request handler chain below
canHandle(handlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handle(intent, inputData) {\n const handlers = this.intentHandlers\n .filter(ih => ih.intent.getName() === intent.getName())\n .map(ih => ih.handler);\n\n if (handlers.length > 0) {\n return handlers[0](inputData);\n } else {\n return this.fallbackHa...
[ "0.6552671", "0.6458448", "0.64021754", "0.63996756", "0.63520426", "0.63233846", "0.6301449", "0.62838256", "0.62346625", "0.6230204", "0.61998564", "0.6195971", "0.61757505", "0.61613905", "0.61506814", "0.61436325", "0.6130257", "0.61020124", "0.6045225", "0.6006884", "0.5...
0.552385
74
Generic error handling to capture any syntax or routing errors. If you receive an error stating the request handler chain is not found, you have not implemented a handler for the intent being invoked or included it in the skill builder below
canHandle() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ErrorHandler() {}", "setOnErrorHandler(handler) { return; }", "function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId +\n \", sessionId=\" + session.sessionId + \"intentRequest.intent.name::\" + intentRequest.intent.name\n ...
[ "0.59108657", "0.57902044", "0.56794614", "0.5624642", "0.55839473", "0.5553161", "0.5455033", "0.54520476", "0.5379853", "0.5366283", "0.53626984", "0.53561103", "0.5347337", "0.53352064", "0.5324741", "0.53075886", "0.52877396", "0.5280945", "0.5273376", "0.5271762", "0.526...
0.0
-1
get information about your screen h w
function chromeos(){ var activity = new Activity("folderview") activity.name = i18n("ChromeOs Activity") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function client_info() {\n let tinggi = document.body.clientHeight;\n let lebar = document.body.clientWidth;\n let screen_height = screen.height;\n let screen_width = screen.width;\n document.getElementById('tinggi').innerHTML = tinggi;\n document.getElementById('lebar').innerHTML = lebar;\n d...
[ "0.7360455", "0.73351836", "0.7116216", "0.7115808", "0.70434624", "0.68992215", "0.68839175", "0.6827246", "0.6791219", "0.67797697", "0.67669517", "0.6735326", "0.6726118", "0.66675454", "0.6638644", "0.6610911", "0.6599221", "0.65952075", "0.6557264", "0.65570456", "0.6556...
0.0
-1
Callback for the recordingdiscarding checkbox.
function discardCallback(recordingIndex, event) { const checkbox = event.srcElement; if (checkbox.checked) { if (discardIndices.indexOf(recordingIndex) === -1) { discardIndices.push(recordingIndex); } } else { if (discardIndices.indexOf(recordingIndex) !== -1) { discardIndices.splice(discardIndices.indexOf(recordingIndex), 1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function audioDebugRecordingsFileSelectionCancelled() {\n dumpCreator.clearAudioDebugRecordingsCheckbox();\n}", "function eventLogRecordingsFileSelectionCancelled() {\n dumpCreator.clearEventLogRecordingsCheckbox();\n}", "function stopRecording() {\n console.log(\"STOPPING RECORDING\");\n setRe...
[ "0.6659343", "0.6172833", "0.6055211", "0.591321", "0.5887122", "0.58734834", "0.5847291", "0.57877606", "0.5657687", "0.5640765", "0.56359595", "0.5615518", "0.5580743", "0.55798745", "0.55761975", "0.5528934", "0.54707813", "0.546747", "0.54032284", "0.539122", "0.53810817"...
0.78732574
0
Pop the last element out from `outputArrays`. Used during the handling of a frozen conversion.
function popLastElementFromOutputArrays() { outputArrays.pop(outputArrays.length - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destructivelyRemoveElementFromEndOfArray(array){\n array.pop();\n return array;\n }", "function destructivelyRemoveElementFromEndOfArray(array){\n array.pop();\n return array;\n}", "function destructivelyRemoveElementFromEndOfArray(array){\n array.pop()\n return array\n}", "function destr...
[ "0.71505433", "0.69864374", "0.69591874", "0.69461125", "0.69372696", "0.69124836", "0.6842462", "0.66399086", "0.66262054", "0.6579002", "0.6559964", "0.65381926", "0.6509404", "0.6474457", "0.64361185", "0.64156795", "0.6415026", "0.6414121", "0.640724", "0.6365293", "0.636...
0.8890623
0
Opens a sidebar in the document containing the addon's user interface.
function showSidebar() { var ui = HtmlService.createHtmlOutputFromFile('Sidebar') .setTitle('Kirby Export') .setSandboxMode(HtmlService.SandboxMode.IFRAME); DocumentApp.getUi().showSidebar(ui); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onOpen(e) {\n DocumentApp.getUi().createAddonMenu()\n .addItem('Start', 'showSidebar')\n .addToUi();\n}", "function onOpen() {\n SpreadsheetApp.getUi()\n .createAddonMenu() // Add a new option in the Google Docs Add-ons Menu\n .addItem(\"Call the Book Hound\", \"showSidebar\")\n //.showSi...
[ "0.78074807", "0.7791956", "0.74522203", "0.74028146", "0.7391196", "0.7248743", "0.7234399", "0.72172916", "0.72172916", "0.71594596", "0.7088858", "0.707996", "0.6980334", "0.692569", "0.6891381", "0.6857213", "0.68002427", "0.67895705", "0.67701495", "0.6762819", "0.672436...
0.71712005
9
Conversation to get the number by asking for 3 sequences containing 3 digits, instead of trying to get the whole number at once
START() { this.$session.$data.COMPONENT_PHONE_NUMBER.phoneNumberSequenceCount = 0; this.$session.$data.COMPONENT_PHONE_NUMBER.phoneNumberRaw = ''; this.$speech.t('component-phone-number.sequence-start'); return this.ask(this.$speech); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function threeNumber(number) {\n\tlet text = number.toString().split(\"\").reverse();\n\tlet temp = [];\n\tif (text.length > 3) {\n\t\tfor (let i = text.length -1; i >= 0; i--)\n\t\t\tif ((i)%3 === 0 & i>0) {\n\t\t\t\ttemp.push(text[i]);\n\t\t\t\ttemp.push(\",\");\n\t\t\t} else {\n\t\t\t\ttemp.push(text[i])\n\t\t\...
[ "0.680516", "0.6527364", "0.63692224", "0.636052", "0.6276418", "0.606014", "0.595565", "0.5936601", "0.5902202", "0.5894819", "0.5894576", "0.5880759", "0.58763754", "0.5835966", "0.5825741", "0.57893425", "0.57801497", "0.5762228", "0.5750134", "0.57087064", "0.57025564", ...
0.0
-1
this is the little box that shows up when you hover over currentLi
function showActions(elem){ if(elem instanceof HTMLLIElement){ console.dir(elem); if(actionBox == null){ actionBox = document.getElementById("itemActions") } actionBox.style.display = 'block'; currentLi = elem; currentLi.appendChild(actionBox) var ul = elem.querySelector('ul'); if(ul){ } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hoverStart()\n\t\t{\n\t\t\t\tvar $hoverLi = $( \".tree_cat>ul>li\" );\n\t\t\t\t$hoverLi.hover(\n\t\t\t\t function() {\n\t\t\t\t\t\t\tvar id = $(this).attr('id');\n\t\t\t\t\t\t\t$('.activeButtons').hide();\n\t\t\t\t\t\t\t$('#buttom_plus_trash_' + id).show();\n\t\t\t\t }, function() {\n\t\t\t\t\t\t$('.act...
[ "0.6549657", "0.63620996", "0.62505466", "0.6249732", "0.6221256", "0.62168413", "0.62132704", "0.6070556", "0.60639757", "0.59650254", "0.59216195", "0.59002924", "0.5858895", "0.58588237", "0.5857298", "0.5838161", "0.5800166", "0.5793266", "0.57831323", "0.57730925", "0.57...
0.5495354
54
todo add modules todo DI
function Log() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Module(){}", "function Module(){}", "function ModuleWithProviders(){}", "function ModuleWithProviders() { }", "function ModuleWithProviders() { }", "constructor() {\n super();\n\n this.generateModules();\n }", "function ModuleWithProviders() {}", "function ModuleWithProvider...
[ "0.6943172", "0.6943172", "0.69312286", "0.69110143", "0.69110143", "0.68670434", "0.68189156", "0.68189156", "0.68189156", "0.66544944", "0.6550296", "0.64654076", "0.6455087", "0.64177054", "0.64177054", "0.64177054", "0.64177054", "0.64177054", "0.64177054", "0.6358617", "...
0.0
-1
Freeze any potential transitions
freeze() { let el = this.$(); if (!el) { return; } el.css({ transition: 'none' }); el.height(); // Force-apply styles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "preventTransitions() {\n const now = Date.now;\n Date.now = () => Infinity;\n d3.timer.flush();\n Date.now = now;\n }", "function unFreeze(node){\n node.fixed = false;\n for( var i = 0; i < node.get('transitions').length; i++ ) {\n v...
[ "0.7031896", "0.68651575", "0.6611969", "0.63928944", "0.6262308", "0.6102206", "0.6021546", "0.5852243", "0.5761341", "0.5751835", "0.57413554", "0.57411313", "0.5738433", "0.5735646", "0.57004285", "0.5692978", "0.5692978", "0.5686981", "0.56756604", "0.5673297", "0.5655242...
0.0
-1
Reset positioning of object
reset() { let el = this.$(); if (!el) { return; } delete this._y; delete this._x; el.css({ transform: '' }); el.height(); // Force-apply styles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset(position) {\n this.x = this.x0;\n this.y = this.y0;\n }", "reset() {\n this.x = this.originX;\n this.y = this.originY;\n }", "resetPos(){\n this.addX(this.getX());\n this.addY(this.getY());\n }", "Reset()\n {\n this._position = 0;\n }", "resetPosi...
[ "0.7994613", "0.7976023", "0.79547405", "0.79307693", "0.7733465", "0.7706272", "0.7589169", "0.75155747", "0.7513696", "0.7508164", "0.74937224", "0.74332064", "0.7348931", "0.72528267", "0.7199513", "0.71872044", "0.71405876", "0.7104521", "0.7099408", "0.7080623", "0.70429...
0.655352
55
Make transitions allowed again.
thaw() { let el = this.$(); if (!el) { return; } el.css({ transition: '' }); el.height(); // Force-apply styles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allowTransitions(){$('body').find('#transitions-remove').remove();}", "preventTransitions() {\n const now = Date.now;\n Date.now = () => Infinity;\n d3.timer.flush();\n Date.now = now;\n }", "stateTransition(){return}", "function deTrigger()\n{\n setState( StatesEnu...
[ "0.6769783", "0.6414761", "0.60298467", "0.59953994", "0.59552866", "0.5803998", "0.5780902", "0.5765346", "0.5691352", "0.5663924", "0.5644796", "0.55913657", "0.5582871", "0.5568375", "0.5557955", "0.5553874", "0.5553874", "0.5550499", "0.554871", "0.5539268", "0.5539268", ...
0.0
-1
Set transform position of the item
_applyPosition() { if (!this.element || !this.$()) { return; } const groupDirection = this.get('group.direction'); if (groupDirection === 'x') { let x = this.get('x'); let dx = x - this.element.offsetLeft + parseFloat(this.$().css('margin-left')); this.$().css({ transform: `translateX(${dx}px)` }); } if (groupDirection === 'y') { let y = this.get('y'); let dy = y - this.element.offsetTop; this.$().css({ transform: `translateY(${dy}px)` }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTransformObject(item, x, y) {\n const transformBase = item.transform.baseVal;\n const transform = transformBase.getItem(0);\n\n transform.setTranslate(x, y);\n }", "function setTransform() {\n items.style.transform = 'translate3d(' + (-pos * 480) + 'px,0,0)';\n}", "function setTrans...
[ "0.8083582", "0.7822351", "0.7403983", "0.69266754", "0.6924993", "0.6912493", "0.6829386", "0.6819118", "0.67214483", "0.6631897", "0.6627107", "0.6625067", "0.65564805", "0.6485011", "0.63666433", "0.6361034", "0.63100123", "0.6285727", "0.6280921", "0.62789804", "0.6278088...
0.68394566
6
Handle cleanup on item drop
_drop() { if (!this.element || !this.$()) { return; } let element = this.get('handle') ? this.$(this.get('handle')) : this.$(); this._preventClick(element); this.set('isDragging', false); this.set('isDropping', true); this._tellGroup('update'); this._waitForTransition() .then(run.bind(this, '_complete')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropCleanup() {\n\n /////\n // Remove the class from the current element.\n /////\n element.removeClass('sp-form-builder-container-selected');\n\n spFormBuilderService.destroyInsertIndicator();\n spFormBuilderService...
[ "0.7053317", "0.69530547", "0.6924211", "0.6795843", "0.6466874", "0.6463648", "0.6454852", "0.6409486", "0.6355501", "0.6344796", "0.6333615", "0.62426054", "0.6221756", "0.6205136", "0.6182327", "0.6182327", "0.61658937", "0.6125969", "0.6125969", "0.6125969", "0.6125969", ...
0.643424
7
Returns a promise that resolves when the transition duration has occurred.
_waitForTransition() { return new Promise(resolve => { run.next(() => { let duration = 0; if (this.get('isAnimated')) { duration = this.get('transitionDuration'); } run.later(this, resolve, duration); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeout(duration) { // Thanks joews\n return new Promise(function(resolve) {\n setTimeout(resolve, duration);\n });\n}", "function transitionEndPromise(element) {\n return new Promise(resolve => {\n element.addEventListener('transitionend', function f() {\n element.removeEventListener('tra...
[ "0.60020393", "0.5771563", "0.5758737", "0.5583756", "0.5569297", "0.5560716", "0.5315747", "0.51752746", "0.51475215", "0.51470256", "0.5134068", "0.5117909", "0.5114058", "0.50927055", "0.5075746", "0.5061385", "0.5060269", "0.5047402", "0.4998744", "0.4965697", "0.49034533...
0.73328835
0
Final method called on cleanup. Commits the result of the drag & drop to the group
_complete() { if(this.get('isDestroyed') || this.get('isDestroying')){ return; } invokeAction(this, 'onDragStop', this.get('model')); this.set('isDropping', false); this.set('wasDropped', true); this._tellGroup('commit'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_drop() {\n if (!this.element || !this.$()) { return; }\n\n let element = this.get('handle') ? this.$(this.get('handle')) : this.$();\n this._preventClick(element);\n\n this.set('isDragging', false);\n this.set('isDropping', true);\n\n this._tellGroup('update');\n\n this._waitForTransition()\n...
[ "0.6801707", "0.6308849", "0.6235138", "0.6226928", "0.6212423", "0.61593574", "0.6150372", "0.61401093", "0.6102672", "0.60044956", "0.5985802", "0.5985802", "0.5984058", "0.5984058", "0.5921967", "0.59125626", "0.5912348", "0.5904105", "0.58970696", "0.5865442", "0.5859649"...
0.719516
0
+ ' ' + sr + ' ' + sf;
function icons() { var arr = [], style = 'style="width:18px"'; if (iconMapper.map(link)) add(iconMapper.map(link)); if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type)); if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper.map(reg)); if (detail.contains('email')) add(iconMapper.map('email')); if (detail.contains('SMS')) add(iconMapper.map('sms')); //make sure there is exactly 2 icons arr.first(2); while (arr.length < 2) { arr.push('icon-blank'); } if (arr.length) { return '<i ' + style + ' class="' + arr.join(' icon-large muted disp-ib"></i> <i ' + style + ' class="') + ' icon-large muted disp-ib"></i> '; } else { return ''; } function add(i) { if (!arr.contains(i)) arr.push(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(st) {\n\n let o = \"\\n\\t╔═══╦═══╦═══╗\\n\\t║\";\n for (let i = 0; i < 9; i++) {\n if (st.xs[i] == 1) {\n o += \" X \";\n } else if (st.os[i] == 1) {\n o += \" O \";\n } else {\n o += \" \";\n }\n if (i != 8) {\n ...
[ "0.57703304", "0.57703304", "0.56941384", "0.5626429", "0.549456", "0.54170287", "0.54017913", "0.5401682", "0.53876424", "0.5372545", "0.53714985", "0.53651124", "0.5364063", "0.53191304", "0.5308425", "0.5303894", "0.5303401", "0.53008443", "0.53008443", "0.5294", "0.528777...
0.0
-1
Handler AJAX requests timeout.
function timeoutHandler() { timeoutId = null; // Something went wrong with the current request: Alert the user // Further AJAX requests won't be executed since this one will forever stay in the queue libsysmsg.error(L10N.server_communication_error); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_xhrOnTimeout() {\n var xhr = this.xhr;\n this.abort(ResourceLoader.reqType(xhr) + ' Request timed out.');\n }", "function timeoutHandler(settings, xhr) {\r\n errorHandler(settings, xhr);\r\n }", "function defHandleReqTimeout (req, res)\n{\n var str = \"Request timed out: URL::\" + ...
[ "0.7454027", "0.73556155", "0.6682755", "0.6682755", "0.6648003", "0.65934944", "0.6483955", "0.6353879", "0.62788075", "0.6276324", "0.6219562", "0.6218204", "0.611746", "0.610353", "0.5995615", "0.5969046", "0.5914235", "0.58991146", "0.5865231", "0.5864093", "0.5826256", ...
0.8121382
0
Perform the next AJAX request.
function next() { var params = queue[0]; // Replace or add the handler if(params.hasOwnProperty("success")) callback = params.success; else callback = null; params.success = success; // Manage request timeout timeoutId = setTimeout(timeoutHandler, TIMEOUT); // Now we can perform the request $.ajax(params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doRequest( next ) {\n\t jqXHR = $.ajax( ajaxOpts )\n\t .done( dfd.resolve )\n\t .fail( dfd.reject )\n\t .then( next, next );\n\t }", "function nextResponse() {\n $.ajax({\n url: nextUrl,\n method: \"GET\",\n success: func...
[ "0.66984403", "0.66602427", "0.6656814", "0.64759797", "0.6300406", "0.62888914", "0.62507033", "0.62109894", "0.6146935", "0.60467803", "0.6026021", "0.59692293", "0.5957496", "0.5945474", "0.5939998", "0.5913702", "0.58795387", "0.58678335", "0.58559144", "0.5847956", "0.58...
0.7644629
0
Internal callback for successful AJAX requests.
function success(output) { // If the timeout is no longer running, something bad happened and we // should stop handling further AJAX requests if(timeoutId == null) return; clearTimeout(timeoutId); queue.shift(); // Call the actual handler, if any if(callback != null) callback(output); // Next request? if(queue.length > 0) next(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function successHandler() {\n if (response.get_statusCode() == 200)\n onSuccess(response.get_body());\n else\n onError(response.get_body());\n }", "function onSuccess(data, status, xhr) {\n if ('json' == requestFormat) {\n $.each(data, ...
[ "0.6848772", "0.6731245", "0.6724821", "0.6696631", "0.6582187", "0.6574338", "0.65606356", "0.6559371", "0.6471852", "0.6461721", "0.64316684", "0.641484", "0.64064413", "0.63858944", "0.63678443", "0.63576883", "0.6338786", "0.6299782", "0.6296267", "0.62758285", "0.6275828...
0.5874516
70
Create the problem type checkboxes that allow users to customize what types of problems they get to practice.
function createProblemTypeCheckboxes() { // create checkboxes for the user to be able to customize problem types that they practice ALL_PROBLEM_TYPES.forEach(problemType => { // create list item element const li = document.createElement("li"); // create a checkbox element const input = document.createElement("input"); input.type = "checkbox"; input.id = problemType; input.name = problemType; input.value = problemType; input.checked = true; // define click action to add/remove problem type from selected problem types input.onclick = () => { // get the value of the input element const val = input.value; // if the input is checked, add to list of selected problem types if (input.checked) { selectedProblemTypes.push(val); } // if input is unchecked, remove it from the list of selected problem types else { selectedProblemTypes.splice(selectedProblemTypes.indexOf(val), 1); } // update prompt promptText = generateProblem(); updatePrompt(promptText); } // create label for checkbox input const label = document.createElement("label"); label.htmlFor = problemType; label.innerText = problemType; // add checkbox and label to list item li.appendChild(input); li.appendChild(label); // add list item to the problem types list element document.getElementById("problemTypes").appendChild(li); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createProblemTypeCheckboxes() {\n // create checkboxes for the user to be able to customize problem types that they practice\n ALL_PROBLEM_TYPES.forEach(problemType => {\n // create list item element\n const li = document.createElement(\"li\");\n\n // create a checkbox element\n...
[ "0.83204335", "0.6238875", "0.59924614", "0.5989266", "0.5977072", "0.5859039", "0.5854318", "0.56584644", "0.561562", "0.5589119", "0.5573147", "0.5572433", "0.54697806", "0.54682124", "0.54670304", "0.545457", "0.54490936", "0.54340863", "0.5385665", "0.52992463", "0.528309...
0.8311871
1
Check the answer that the user gives.
function checkAnswer() { // show the notification alert const notif = document.getElementById("notification"); notif.style.display = ""; // get the user's answer const val = document.getElementById("answer").value.trim(); // if the user's answer is correct if (val == answer) { // give the user feedback that they're right notif.innerHTML = "That's right!"; notif.className = "success"; // add points to the user's score setScore(10); // clear the user's answer document.getElementById("answer").value = ""; // generate a new problem generateProblem(); } else { // give the user feedback that they're right notif.innerHTML = "That's incorrect."; notif.className = "failure"; // take away points from the user's score setScore(-5); } // hide the notification alert after 1 second setTimeout(() => notif.style.display = "none", 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAnswer(){\n trueAnswer = returnCorrectAnswer();\n userAnswer = getInput();\n// this if statement is stating if user inputs the right answer what happens and if not what happens\n if(userAnswer === trueAnswer){\n var messageCorrect = array[global_index].messageCorrect;\...
[ "0.75802964", "0.7568786", "0.74150515", "0.73617536", "0.7351307", "0.7255457", "0.723331", "0.7225912", "0.7183913", "0.7170424", "0.7155543", "0.7113753", "0.71081895", "0.71057826", "0.7093447", "0.7046783", "0.70311016", "0.7025759", "0.70174366", "0.7015613", "0.7014133...
0.0
-1
Makes the alert appear when the instructions button in HTML (below the canvas on screen, above the in code) is pressed
function instructions(){ // \n for a new line in the text, extra lines are concatenated on the end with "+" alert("Choose your name, then click start, then click on the planet/moon you want to go to or press a number from 1 to 8\n\n"+ "Arrow keys or WASD to move\nT to toggle force arrow visibility\nR to restart\nM to go to the menu screen\nNever gonna press Q key\n"+ "In free flight mode you can press '+' or '-' to increase or decrease the gravity\n\n"+ "Remember to land the lander gently\nLand on the blue landing zone for extra points\nDon't let your fuel get to 0, or you'll crash!\n\n"+ "Go to https://doc.co/ys85jg for the User Guide\n\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instruction(){\n alert(\"Click on the button to see what is available\")\n}", "function showMsg() {\n\tokButton.textContent = 'OK';\n\talertPre.textContent = demo_msgs;\n\talertArea.style.display = 'block';\n}", "function instruction() {\n fill(255);\n textSize(20);\n text(\"Press [s] to go back t...
[ "0.7289894", "0.6524252", "0.6413277", "0.6366919", "0.63475627", "0.634268", "0.6326331", "0.6305311", "0.6298844", "0.62966025", "0.6295317", "0.6231875", "0.6227501", "0.620681", "0.61811364", "0.6163837", "0.61625737", "0.61463165", "0.6139986", "0.61266506", "0.61223906"...
0.6839113
1
read when keys are pressed
function keyDownHandler(e) { if (crashed == false && landed == false && fuelout == false){ //38 is up, 87 is w //UP if(e.keyCode == 38 || e.keyCode == 87) { upPressed = true; } //39 is right, 68 is d //RIGHT if(e.keyCode == 39 || e.keyCode == 68) { rightPressed = true; } //37 is left, 65 is a //LEFT if(e.keyCode == 37 || e.keyCode == 65) { leftPressed = true; } } if (levelnum == 0){ //increase gravity (+key) if(e.keyCode == 107 || e.keyCode == 187 || e.keyCode == 61) { freeflightgravity++; } //decrease gravity (-key) if(e.keyCode == 109 || e.keyCode == 189 || e.keyCode == 173) { freeflightgravity--; } } //74 is j //DEBUG MODE if(e.keyCode == 74) { if (debugMode == true){ debugMode = false; } else{ debugMode = true; } } //82 is r //Reset the game if(e.keyCode == 82) { x = 200; dx = 1; y = 200; dy = 1; fuel = 5000; landed = false; crashed = false; fuelout = false; gameTimer = 0; bonus = 0; } //77 is m //Restart - go to menu (not restart the entire game) if(e.keyCode == 77) { gotoMenu(); } //84 is t //Toggle the force arrows if(e.keyCode == 84) { if (arrowvisible == true){ arrowvisible = false; } else{ arrowvisible = true; } } //13 is ENTER //Start the game (alternative to pressing start button) if(e.keyCode == 13) { levelselect = true; } //Press keyboard numbers rather than clicking buttons //49 is "1" //Go to Mercury if(e.keyCode == 49 && levelnum ==-1) { alert("You're going to land on Mercury\n"+ "Mercury takes 88 days to orbit the sun\n"+ "Closest planet to the sun\n"+ "Named after the Roman messenger of the gods"); levelnum = 1; gamestart = true; } //50 is "2" //Go to Venus if(e.keyCode == 50 && levelnum ==-1) { alert("You're going to land on Venus\n"+ "Second closest planet to the sun\n"+ "Similar size and mass to Earth\n"+ "Dense atmosphere of 96% Carbon Dioxide"); levelnum = 2; gamestart = true; } //51 is "3" //Go to Moon if(e.keyCode == 51 && levelnum ==-1) { alert("You're going to land on the Moon\n"+ "1/4 of the size of the Earth\n"+ "1/6 of Earth's gravity\n"+ "It takes around 29 days for the Moon to orbit the Earth\n"+ "Only 12 astronauts have ever been to the Moon"); levelnum = 3; gamestart = true; } //52 is "4" //Go to Mars if(e.keyCode == 52 && levelnum ==-1) { alert("You're going to land on Mars\n"+ "Named after the Roman god of war\n"+ "Has a thin atmosphere\n"+ "It is red because there is lots of iron on the surface"); levelnum = 4; gamestart = true; } //53 is "5" //Go to Ganymede if(e.keyCode == 53 && levelnum ==-1) { alert("You're going to land on Ganymede\n"+ "Moon of Jupiter\n"+ "Discovered in 1610 by Galileo\n"+ "Named after a character from a Greek myth\n"+ "Has a thin oxygen atmosphere\n"+ "Jupiter has 67 moons\n"+ "Jupiter is a gas giant"); levelnum = 5; gamestart = true; } //54 is "6" //Go to Titan if(e.keyCode == 54 && levelnum ==-1) { alert("You're going to land on Titan\n"+ "Moon of Saturn\n"+ "Saturn has 62 moons\n"+ "Saturn is a gas giant\n"+ "Titan has methane as a solid, liquid and gas"); levelnum = 6; gamestart = true; } //55 is "7" //Go to Uranus if(e.keyCode == 55 && levelnum ==-1) { alert("You're going to land on Uranus\n"+ "Named after the Greek god of the sky\n"+ "It takes 84 Earth years for Uranus to get around the sun"); levelnum = 7; gamestart = true; } //56 is "8" //Go to Neptune if(e.keyCode == 56 && levelnum ==-1) { alert("You're going to land on Neptune\n"+ "Named after the Roman God of the Sea\n"+ "Discovered on 23rd September 1846"); levelnum = 8; gamestart = true; } //57 is "9" //Go to Black Hole if(e.keyCode == 57 && levelnum ==-1) { alert("The gravity of a black hole is so high it even sucks in light!\n"+ "The acceleration is really 6 * 10 ^16 m/s^2, but the game can't cope with this..."); levelnum = 9; gamestart = true; } //81 is Q //RICKROLLING MODE if(e.keyCode == 81) { window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ","_blank"); alert("Why would you even?"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleKeyDown(event) {\r\n // storing the pressed state for individual key\r\n currentlyPressedKeys[event.keyCode] = true;\r\n}", "function keyPressed() {\n if (handler.active === handler.nameplate) {\n doorbell.keyPressed();\n }\n}", "keyDown(_keycode) {}", "function keyIsDown(event) {\n...
[ "0.7630035", "0.7564446", "0.75060743", "0.74253136", "0.742393", "0.740614", "0.740614", "0.73979723", "0.73686737", "0.7358613", "0.7331192", "0.7306469", "0.7305653", "0.7290377", "0.72569185", "0.72552437", "0.7249115", "0.72460276", "0.7241942", "0.7229903", "0.7213958",...
0.0
-1
read when keys are released
function keyUpHandler(e) { //38 is up, 87 is w if(e.keyCode == 38 ||e.keyCode == 87) { upPressed = false; } //39 is right, 68 is d if(e.keyCode == 39 ||e.keyCode == 68) { rightPressed = false; } //37 is left, 65 is a if(e.keyCode == 37 ||e.keyCode == 65) { leftPressed = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keysReleased(e){\n //mark keys that are keysReleased\n keys[e.keyCode] = false;\n }", "function keyReleased() {\n\n}", "function releaseKey(event) {\n currentKey = null;\n}", "keyReleased({keyReleased, keyCode}){\n let key = keyCode + '';\n delete this.keysCurrentlyPressed[key];\n }",...
[ "0.711742", "0.68591523", "0.6838539", "0.65530604", "0.65350115", "0.64992565", "0.64922214", "0.6207575", "0.62024957", "0.6171009", "0.6133236", "0.6104482", "0.609596", "0.60797507", "0.5998766", "0.59970504", "0.59879965", "0.59872675", "0.59641933", "0.5949683", "0.5948...
0.0
-1
Draw the lander and the fire animation beneath the lander Gas bursts NOT drawn here, this is controlled by left/right pressed
function drawLander(){ if (crashed == false){ //Draw the lander's flame animation - three different images each drawn in turn if (fuelout == false){ if (fireCount == 1){ ctx.drawImage(fire1, x+21, y+55, 14, thrustCount); fireCount = 2; }else if(fireCount == 2){ ctx.drawImage(fire2, x+21, y+55, 14, thrustCount); fireCount = 3; }else if(fireCount == 3){ ctx.drawImage(fire3, x+21, y+55, 14, thrustCount); fireCount = 1; } } //Draw the lander //name, x position, y position, width, height ctx.drawImage(lander, x, y, 57, 60); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n // background(0);\n image(img,0,0,width,height);\n stroke(255)\n ship.render();\n ship.turn();\n ship.update();\n ship.edges();\n let imortalframeDif = frameCount - imortalframe;\n let ants = floor(levels * 1.5);\n if (deads) {\n menu.render();\n } else {...
[ "0.64751273", "0.6456753", "0.64092803", "0.638403", "0.6313916", "0.62335783", "0.6209301", "0.62087137", "0.61930764", "0.61798596", "0.6172659", "0.6153506", "0.61304444", "0.6120677", "0.61191225", "0.6109743", "0.60994357", "0.60859644", "0.60818636", "0.60816884", "0.60...
0.73830193
0
debug menu with useful information about the game for testing purposes
function drawDebug() { ctx.font = "11px monospace"; ctx.fillStyle = "#777777"; //text, x position, y position ctx.fillText("DEBUG MODE", 10, 15); ctx.fillText("upPressed: "+upPressed, 15, 30); ctx.fillText("leftPressed: "+leftPressed, 15, 45); ctx.fillText("rightPressed: "+rightPressed, 15, 60); ctx.fillText("x: "+x, 15, 75); ctx.fillText("dx: "+dx, 15, 90); ctx.fillText("y: "+y, 15, 105); ctx.fillText("dy: "+dy, 15, 120); ctx.fillText("fuelout: "+fuelout, 15, 135); ctx.fillText("landed: "+landed, 15, 150); ctx.fillText("crashed: "+crashed, 15, 165); ctx.fillText("landedVelocityY: "+landedVelocityY, 15, 180); ctx.fillText("landedVelocityX: "+landedVelocityX, 15, 195); ctx.fillText("thrustArrow: "+thrustArrow, 15, 210); if (thrustArrow > gravity){ ctx.fillText("Thrust is greater than gravity", 15, 225); }else{ ctx.fillText("Thrust less than gravity", 15, 225); } ctx.fillText("MouseX = " + canvas_x, 15, 240); ctx.fillText("MouseY = " + canvas_y, 15, 255); ctx.fillText("WindowHeight = " + window.innerHeight, 15, 270); ctx.fillText("WindowWidth = " + window.innerWidth, 15, 285); ctx.fillText("levelnum = " + levelnum, 15, 300); ctx.fillText("fuel= " + fuel, 15, 315); ctx.fillText("shadowsize= " + shadowsize, 15, 330); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function turnOnDebug(){\n userProp.setProperty(g_debug_key, 'true');\n loadMenu(userProp.getProperty(g_debug_key));\n}", "debug() {\n\t\tthis.log(\"GameMode - \" + this.name + \" | Version: \" + this.version);\n\t\tthis.log(\"Number of Resources - \" + this.resources.size);\n\t\tthis.log(\"Number of Stages - \...
[ "0.67346674", "0.6673282", "0.664735", "0.64175886", "0.63904434", "0.63716054", "0.6341017", "0.633798", "0.6335011", "0.6259147", "0.62187475", "0.61563224", "0.6142562", "0.61417717", "0.6070381", "0.60465133", "0.6022021", "0.6007036", "0.6000149", "0.59983873", "0.599666...
0.5822633
38
Draw the crashed lander and the "You Crashed" message when the lander crashes
function drawCrashed(){ if (levelnum != 9){ ctx.font = "30px Molengo"; ctx.fillStyle = "#FF0000"; ctx.fillText("You Crashed", x - 50, y - 25); ctx.drawImage(landercrash, x, y, 56, 60); } else{ //draw flat image if you crash in the black hole ctx.drawImage(landerblackhole, x, y, 56, 60); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function failScreen() {\n image(introScreenBackground, 0, 0);\n\n push();\n noStroke();\n noFill();\n rect(275, 310, 340, 75);\n pop();\n\n rainRun();\n\n lightningGenerator();\n\n animation(huntAgainAnim, 450, 350);\n\n animation(brokenMaskAnim, 450, 170);\n}", "getWallCrash() {\n let up = this...
[ "0.7004362", "0.6653389", "0.65959287", "0.650765", "0.6222927", "0.6115513", "0.6042378", "0.603318", "0.599537", "0.59080356", "0.58687854", "0.57795227", "0.5743265", "0.57090276", "0.57067364", "0.56954575", "0.5678868", "0.5658664", "0.5650789", "0.56153315", "0.56075907...
0.72178656
0
Draw the "You Landed" message when the lander lands
function drawLanded(){ ctx.font = "30px Molengo"; ctx.fillStyle = "#00FF00"; ctx.fillText("You Landed", x - 50, y - 25); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLander(){\n if (crashed == false){\n //Draw the lander's flame animation - three different images each drawn in turn\n if (fuelout == false){\n if (fireCount == 1){\n ctx.drawImage(fire1, x+21, y+55, 14, thrustCount);\n fireCount = 2;\n ...
[ "0.6768724", "0.62230045", "0.6080378", "0.59369445", "0.5877971", "0.5874489", "0.58524776", "0.5845822", "0.5788755", "0.57799584", "0.57065165", "0.5659729", "0.5654521", "0.56493086", "0.5643215", "0.56342703", "0.5633882", "0.5628808", "0.562785", "0.5624426", "0.5618225...
0.70355934
0
Draw the shadow of the lander on the ground underneath the lander
function drawShadow(){ shadowsize = (y/11); //x size is roughly double y size, hence shadowsize is halved for y ctx.drawImage(landershadow, x+2, canvas.height-25, shadowsize, (shadowsize/2.25)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shadow() {\n // Moving mouse changes light direction\n let dirX = (mouseX / width - 0.5);\n let dirY = (mouseY / height - 0.5);\n\n // Adding directional light\n directionalLight(250, 250, 250, -dirX, -dirY, -1); // white\n}", "function drawShadow(item) {\r\n\tvar lightTransformed = mult(inverse4(m...
[ "0.67509496", "0.672112", "0.6625686", "0.6487955", "0.6455656", "0.64359605", "0.6392374", "0.6388298", "0.6364647", "0.6356406", "0.6301118", "0.6263204", "0.62324715", "0.6224622", "0.6145647", "0.6131706", "0.6104038", "0.6092735", "0.609134", "0.6081661", "0.60153615", ...
0.7077831
0
draw the background, a different ground and the bonus zone for each level
function drawBackground(){ ctx.drawImage(space, 0, 0, canvas.width, canvas.height); switch(levelnum){ case 0: //Free Flight ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25); break; case 1: //Mercury ctx.drawImage(mercuryground, 0,canvas.height-25,canvas.width,25); break; case 2: //Venus ctx.drawImage(venusground, 0,canvas.height-25,canvas.width,25); break; case 3: //Moon ctx.drawImage(moonground, 0,canvas.height-25,canvas.width,25); break; case 4: //Mars ctx.drawImage(marsground, 0,canvas.height-25,canvas.width,25); break; case 5: //Ganymede ctx.drawImage(ganymedeground, 0,canvas.height-25,canvas.width,25); break; case 6: //Titan ctx.drawImage(titanground, 0,canvas.height-25,canvas.width,25); break; case 7: //Uranus ctx.drawImage(uranusground, 0,canvas.height-25,canvas.width,25); break; case 8: //Neptune ctx.drawImage(neptuneground, 0,canvas.height-25,canvas.width,25); break; case 9: //Black Hole break; default: //Not recognised ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25); break; } //bonus landing area if (levelnum != 0 && levelnum != 9){ ctx.fillStyle = "#00F"; ctx.fillRect(800,(canvas.height/2)+300, 100, 10); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawBG() {\n\tsetBG('#00B2EE');\n\tdrawGrid(16);\n\tlet i;\n\tfor (i = 0; i < levelWidth; i++) {\n\t\tdrawTile(tiles[0], i * 16, canvas.height - 16, 0);\n\t}\n\tdecorateBG();\n}", "function drawGround() {\n //ctx.fillStyle = '#FFE699'; //old ground layer\n //ctx.fillRect(0, 375, canvas.width, can...
[ "0.7499574", "0.7379825", "0.72698027", "0.70595914", "0.6894458", "0.686768", "0.68316364", "0.6814594", "0.6679436", "0.66363406", "0.66351354", "0.6611833", "0.6597816", "0.65856653", "0.6581852", "0.6570014", "0.65273464", "0.6524267", "0.6522273", "0.6514002", "0.6512561...
0.7790163
0
Draw the stats in the top right of the screen
function drawUI(){ //This part calculates the score score = (fuel + (500*gravity)) - (gameTimer*100)+bonus; //This part draws the UI (text in top right) ctx.font = "20px Molengo"; ctx.fillStyle = "#9999FF"; //while not in black hole mode if (levelnum !=9){ ctx.fillText("Gravity: "+ gravity+ "m/s\u00B2", canvas.width - 150, 60); } else{ ctx.fillText("Gravity: X m/s\u00B2", canvas.width - 150, 60); } ctx.fillText("Time taken: "+ gameTimer, canvas.width - 150, 90); //Only display these when not in freeflight mode if (levelnum !=0){ ctx.fillText("Fuel: " + fuel, canvas.width - 150, 120); //draw the fuel bar //fuel background ctx.beginPath(); ctx.rect(canvas.width - 155, 130, 110, 15); ctx.fillStyle = "#333"; ctx.fill(); ctx.closePath(); //glass container of fuel liquid ctx.beginPath(); ctx.rect(canvas.width - 150, 135, 100, 5); ctx.fillStyle = "#777"; ctx.fill(); ctx.closePath(); //fuel level ctx.beginPath(); ctx.rect(canvas.width - 150, 135, fuel/50, 5); ctx.fillStyle = "#990"; ctx.fill(); ctx.closePath(); //set the colour back to before so text below still looks normal ctx.fillStyle = "#9999FF"; ctx.fillText("Score: " + score, canvas.width - 150, 200); if (fuel<1000 && fuel >0){ ctx.fillStyle = "#FF0000"; ctx.fillText("LOW FUEL", canvas.width - 150, 165); } if (fuel == 0){ ctx.fillStyle = "#FF0000"; ctx.fillText("NO FUEL!", canvas.width - 150, 165); } } //Find the planet name to use from the levelnum //Also pick the gravity value (m/s^2) //Mercury, Venus, Moon, Mars, Ganymede, Titan, Uranus, Neptune //Add small extra bit to UI if on moon switch(levelnum){ case 0: planetname = "Free Flight"; gravity = freeflightgravity; //Normal gravity break; case 1: planetname = "Mercury"; gravity = 3.7; break; case 2: planetname = "Venus"; gravity = 8.9; break; case 3: planetname = "The Moon"; ctx.fillStyle = "#9999FF"; ctx.fillText("Moon of Earth", 800, 30); gravity = 1.6; break; case 4: planetname = "Mars"; gravity = 3.7; break; case 5: planetname = "Ganymede"; ctx.fillText("Moon of Jupiter", 800, 30); gravity = 1.4; break; case 6: planetname = "Titan"; ctx.fillText("Moon of Saturn", 800, 30); gravity = 1.4; break; case 7: planetname = "Uranus"; gravity = 8.7; break; case 8: planetname = "Neptune"; gravity = 11.2; break; case 9: planetname = "Black Hole"; gravity = 50; break; default: //Not Recognised planetname = "?"; gravity = 5; break; } ctx.fillStyle = "#33FF33"; ctx.font = "bold 20px Molengo"; ctx.fillText(planetname, canvas.width - 150, 30); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTop() {\n ctx.fillStyle = \"#333\";\n ctx.fillRect(0, 0, gameWidth, 50);\n\n renderLifeRemains();\n renderScore();\n renderTime();\n}", "function drawStats() {\n\t\tterm.terminal.saveCursor();\n\t\tif (startIndex === 0) var scrollText = \"Scroll: 0% \";\n\t\telse var scrollText = \"...
[ "0.74258137", "0.7200473", "0.7145169", "0.7133443", "0.69425994", "0.69425994", "0.69425994", "0.69118965", "0.691174", "0.6896391", "0.6896391", "0.66716516", "0.6660941", "0.6660941", "0.6634781", "0.66204387", "0.6597775", "0.6587691", "0.65751725", "0.65626156", "0.65250...
0.0
-1
Create the level select screen, with different planet, background, buttons, and make all elements clickable
function drawLevelSelect(){ //Level Numbers: //-1 = no level selected // 0 = free flight // 1 = Mercury // 2 = Venus // 3 = Moon //Background ctx.drawImage(orbits, 0, 0, canvas.width, canvas.height); //Planets ctx.font = "15px Molengo"; ctx.fillStyle = "#00FF00"; //Mercury ctx.fillText("Mercury", 685, 275); ctx.drawImage(mercury, (canvas.width/2)+123, (canvas.height/2)-40, 15, 15); //Venus ctx.fillText("Venus", 780, 295); ctx.drawImage(venus, (canvas.width/2)+200, (canvas.height/2)-20, 25, 25); //Moon ctx.fillText("Moon", 860, 340); ctx.drawImage(moon, (canvas.width/2)+290, (canvas.height/2)+22, 10, 10); //No Fly Planets ctx.font = "12px Molengo"; ctx.fillStyle = "#FF0000"; //Earth ctx.fillText("Earth", 825, 335); ctx.drawImage(earth, (canvas.width/2)+260, (canvas.height/2)+20, 25, 25); //Free Flight ctx.fillStyle = "#00AA00"; //half way, minus half of the x and y of the shape size ctx.fillRect((canvas.width/2)+315,(canvas.height/2)+215, 200, 50); ctx.font = "30px Molengo"; ctx.fillStyle = "#FFFF00"; ctx.fillText("Free Flight", (canvas.width/2)+350,(canvas.height/2)+250); //Instructions ctx.fillStyle = "#00AA00"; //half way, minus half of the x and y of the shape size ctx.fillRect((canvas.width/2)-515,(canvas.height/2)+215, 200, 50); ctx.font = "30px Molengo"; ctx.fillStyle = "#FFFF00"; ctx.fillText("How to Play", (canvas.width/2)-490,(canvas.height/2)+250); ctx.font = "15px Molengo"; ctx.fillStyle = "#FFFF00"; ctx.fillText("Press number keys 1 to 8 to pick your planet or moon", (canvas.width/2)-150,(canvas.height/2)-250); //This uses the size of the canvas for y axis, and size of window for x axis (as the canvas is centralised) //This controls the button for the instructions if (canvas_x > (window.innerWidth/2)-515 && canvas_x < (window.innerWidth/2)-315 && canvas_y > (canvas.height/2)+245 && canvas_y < (canvas.height/2)+295){ // \n for a new line in the text, "+" for concatentation to get over multiple line problem alert("Click on the planet/moon you want to go to or press a number from 1 to 8\n\n"+ "Arrow keys or WASD to move\nT to toggle force arrow visibility\nR to restart\nM to go to the menu screen\nNever gonna press Q key\n\n"+ "In free flight mode you can press '+' or '-' to increase or decrease the gravity\n\n"+ "Remember to land the lander gently\nLand on the blue landing zone for extra points\nDon't let your fuel get to 0, or you'll crash!\n\n"+ "If you accidentially tick 'Do not show alerts', then you must close the tab and then reopen it"); canvas_x=0; //This is because you want to return to the menu afterwards, otherwise it thinks you keep clicking the button whenever you return //This controls the button to enter free flight mode }else if (canvas_x > (window.innerWidth/2)+315 && canvas_x < (window.innerWidth/2)+515 && canvas_y > (canvas.height/2)+245 && canvas_y < (canvas.height/2)+295){ levelnum = 0; gamestart = true; freeflightgravity = prompt("Enter how much gravity you want. Try numbers between 0 and 50 to see what happens!", "10"); //control the errors and error correction for this value if (isNaN(freeflightgravity) == true ) { gamestart = false; alert("Please only enter numbers for the gravity value!"); }else if(freeflightgravity>50){ gamestart = false; alert("Please enter numbers less than 50 for the gravity value!"); }else if(freeflightgravity<0){ gamestart = false; alert("Please enter positive numbers for the gravity value!"); }else if(freeflightgravity == ""){ freeflightgravity = 0; }else if(freeflightgravity == null){ gamestart = false; canvas_x = 0; } //This controls the Sun //This forms a rough square in the Sun area, THIS IS NOT PERFECT! //y = 100px, x = 100px }else if (canvas_x > (window.innerWidth/2)-50 && canvas_x < (window.innerWidth/2)+50 && canvas_y > (canvas.height/2)-25 && canvas_y < (canvas.height/2)+75){ alert("You wanted to land on the Sun\nExcept you can't, because it's way too hot there...\nThe sun is a star\nThe sun uses nuclear fusion to turn hydrogen into helium"); canvas_x=0; //This is because you want to return to the menu afterwards, otherwise it thinks you keep clicking the button whenever you return //This controls Mercury }else if (canvas_x > (window.innerWidth/2)+123 && canvas_x < (window.innerWidth/2)+138 && canvas_y > (canvas.height/2)-15 && canvas_y < (canvas.height/2)-0){ alert("You're going to land on Mercury\n"+ "Mercury takes 88 days to orbit the sun\n"+ "Closest planet to the sun\n"+ "Named after the Roman messenger of the gods"); levelnum = 1; gamestart = true; //This controls Venus //Not really sure why the y values are exactly as they are, but it wouldn't work any other way... }else if (canvas_x > (window.innerWidth/2)+200 && canvas_x < (window.innerWidth/2)+225 && canvas_y > (canvas.height/2)+10 && canvas_y < (canvas.height/2)+35){ alert("You're going to land on Venus\n"+ "Second closest planet to the sun\n"+ "Similar size and mass to Earth\n"+ "Dense atmosphere of 96% Carbon Dioxide"); levelnum = 2; gamestart = true; //This controls Earth/Moon //Not really sure why the y values are exactly as they are, but it wouldn't work any other way... }else if (canvas_x > (window.innerWidth/2)+260 && canvas_x < (window.innerWidth/2)+300 && canvas_y > (canvas.height/2)+50 && canvas_y < (canvas.height/2)+75){ alert("You're going to land on the Moon\n"+ "1/4 of the size of the Earth\n"+ "1/6 of Earth's gravity\n"+ "It takes around 29 days for the Moon to orbit the Earth\n"+ "Only 12 astronauts have ever been to the Moon"); levelnum = 3; gamestart = true; //This controls the black hole! //Will appear in top left corner }else if (canvas_x > (window.innerWidth/2)-568 && canvas_x < (window.innerWidth/2)-468 && canvas_y > 0 && canvas_y < 100){ alert("The gravity of a black hole is so high it even sucks in light!\n The gravity is really 6 * 10 ^16 m/s^2, but the game can't cope with this..."); levelnum = 9; gamestart = true; //When a button isn't pressed }else{ levelnum = -1; gamestart = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(scene, x, y, buttonWidth, buttonHeight, levelCount, selectableLevels, optionSelectedCallback)\n {\n super(scene, 0, 0);\n // Add this container to the scene\n scene.add.existing(this);\n this.thisScene = scene;\n\n this.popupX = x;\n this.popupY = y;\n ...
[ "0.7234053", "0.7074019", "0.6771522", "0.6699481", "0.6553443", "0.6516272", "0.6486994", "0.6475296", "0.63362116", "0.6321725", "0.62934065", "0.6280006", "0.6266794", "0.62482256", "0.62298304", "0.62003064", "0.6179539", "0.61717707", "0.6159989", "0.6157639", "0.6135051...
0.6575649
4
This draws the very first screen when you start the game
function drawFirstScreen(){ ctx.drawImage(titleart, 0, 0, canvas.width, canvas.height); //Player name in the bottom right ctx.font = "20px Molengo"; ctx.fillStyle = "#9999FF"; ctx.fillText("Hi there " + playername +"!", 30, canvas.height - 30); ctx.fillStyle = "#00AA00"; //half way, minus half of the x and y of the shape size ctx.fillRect((canvas.width/2)-125,(canvas.height/2)+110, 250 ,75); ctx.font = "50px Molengo"; ctx.fillStyle = "#FFFF00"; ctx.fillText("START", (canvas.width/2)-70,(canvas.height/2)+165); //This uses the size of the canvas for y axis, and size of window for x axis (as the canvas is centralised) //This could be rewritten to be more like the level select code, but there is no real advantage to this (Unless you need to add more buttons, in which case it would be essential) if (canvas_x < (window.innerWidth/2)-125 || canvas_x > (window.innerWidth/2)+125 || canvas_y < (canvas.height/2)+135 || canvas_y > (canvas.height/2)+210){ levelselect = false; } else{ levelselect = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startScreen() {\n\t// make lines slightly thicker\n\tctx.lineWidth = 2;\n\n\tctx.clearRect(0, 0, gameWidth, gameHeight + 300);\n\n\tctx.strokeStyle = 'white';\n\tctx.fillStyle = 'white';\n\tctx.font = \"56px 'Press Start 2P'\";\n\n\tctx.strokeRect(0, 0, gameWidth, gameHeight);\n\n\t// Score\n\tctx.textAli...
[ "0.77800727", "0.76466244", "0.75151956", "0.7465133", "0.7464988", "0.74422354", "0.73608714", "0.73532206", "0.73500365", "0.7339661", "0.73286986", "0.72937703", "0.7281617", "0.7261747", "0.72486085", "0.7226408", "0.71977556", "0.71784157", "0.71711546", "0.7160717", "0....
0.7074062
23
modified values to send them off to the PHP so it can be read by MySQL
function sendScores(){ if (landed == false){ landedstore = 0; }else if (landed == true && bonus == 5000){ landedstore = 2; }else{ landedstore = 1; } //send the score and other info to PHP in the URL so it can go to the MySQL database window.location.href = "highscores.php?pn="+playername+"&ln="+levelnum+"&s="+score+"&l="+landedstore; //Go back to the menu after 0.5 seconds - this is only useful in Firefox so that when you press back to go to the game menu. Chrome setTimeout(gotoMenu, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setProfilePlayerDataFromValues(){\n \tgameData.data.player.profile.name = $(\"#name\").val();\n \tgameData.data.player.profile.surname = $(\"#surname\").val();\n \tgameData.data.player.profile.sex = $(\"#sex\").val();\n \tgameData.data.player.profile.age = $(\"#age\").val(); \n \tgameDat...
[ "0.54927546", "0.53916", "0.5387974", "0.5333304", "0.5331166", "0.5294662", "0.52875143", "0.52871925", "0.52233994", "0.5209032", "0.5188268", "0.514574", "0.5142382", "0.5104957", "0.5102228", "0.50949496", "0.5085115", "0.5075317", "0.50735915", "0.5066631", "0.5058163", ...
0.0
-1
Resets the game and sends you to the menu screen
function gotoMenu(){ x = 200; dx = 1; y = 200; dy = 1; fuel = 5000; landed = false; crashed = false; fuelout = false; gameTimer = 0; canvas_x=0; gamestart = false; levelselect = true; bonus = 0; score = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGame() {\n toggleMenu(Menu.MAIN);\n $('#statsOutput').hide();\n $('#ammoBarsContainer').hide();\n scene.stopMusic();\n renderer.clear(false, true, true);\n scene = new TheScene(renderer.domElement);\n}", "function resetGame() {\n clearGame();\n levelSpace.innerHTML = \"Press Sta...
[ "0.80080044", "0.7990072", "0.7821493", "0.77412367", "0.7694642", "0.75868154", "0.7579037", "0.75383854", "0.751486", "0.75102556", "0.75037915", "0.74975556", "0.7496509", "0.7491704", "0.7458559", "0.7456982", "0.7451617", "0.7443164", "0.742378", "0.7388902", "0.73741394...
0.0
-1
Calculate values for and draw the force arrows in the game
function drawForces(){ //Thrust if (upPressed == true && thrustCount<80 ){ thrustCount += 0.5; } else if (thrustCount>1){ thrustCount -= 0.5; } if (arrowvisible == true){ //Gravitational Potential Energy //4.15 is basically just the number that worked so that the arrows are the right lengths to show the forces correctly if (gravity>0){ ctx.drawImage(bluedownarrow, x-10, y, 9, (gravity*4.15)); } else{ ctx.drawImage(blueuparrow, x-10, y, 9, -(gravity*4.15)); } thrustArrow = thrustCount; ctx.drawImage(reduparrow, x-20, y,9,thrustArrow ); //Left leftArrow = (-dx) *10; if (dx>0){ leftArrow = 0; } ctx.drawImage(greenleftarrow, x, y-20, leftArrow,9 ); //Right rightArrow = dx*10; if (dx<0){ rightArrow = 0; } ctx.drawImage(greenrightarrow, x, y-20, rightArrow,9 ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display() {\n wrapEdges();\n background(255);\n textSize(12);\n textStyle(NORMAL);\n\n if (showarrows) {\n textSize(20);\n strokeWeight(0);\n fill(255, 0, 0);\n text(\"Velocity\", 0.8 * width, 0.8 * height + 75);\n /*\n fill(0,0,255);\n text(\"Force\",0.8*width,0.8*he...
[ "0.66403574", "0.64477307", "0.6167709", "0.59947044", "0.5948404", "0.5901575", "0.5891611", "0.5868896", "0.5849939", "0.5830742", "0.57967454", "0.5731543", "0.57275176", "0.5691953", "0.5674353", "0.5673451", "0.5633972", "0.56201", "0.5603058", "0.5591742", "0.5587126", ...
0.6812548
0
main part, calls all the other functions (this is itself called every 10ms)
function draw(){ //clear canvas so everything appears to move rather ctx.clearRect(0, 0, canvas.width, canvas.height); //run these functions drawBackground(); if (gamestart == false && levelselect == false){ //when gamestart and menuselect are both false you must be in start menu drawFirstScreen(); }else if (gamestart == false && levelselect ==true){ //must be in menuselect drawLevelSelect(); }else{ //must be in game, so draw shadow, lander, forces, UI etc drawShadow(); drawForces(); drawLander(); drawUI(); if (crashed == true){ drawCrashed(); } if (landed == true){ drawLanded(); } } if (debugMode == true){ drawDebug(); } //Stop when the lander hits left/right if(x + dx > canvas.width - 56 || x + dx < 0) { dx = 0; } //Stop when the lander hits the top if(y + dy < 0){ dy = 0; } //Stop when the lander hits the bottom if(y + dy > (canvas.height-60)-15){ if (landed == false && crashed == false && levelnum !=0){ landedVelocityY = dy; landedVelocityX = dx; //if going faster than 0.4 in y then crash, otherwise land //if going faster that 0.4 or -0.4 in x then crash, otherwise land if (levelnum == 9){ //lose 70000 points in black hole mode so it doesn't affect the high scores crashed = true; bonus = -70000; }else if (landedVelocityY > 0.4 || landedVelocityX > 0.4 || landedVelocityX < -0.4){ //lose 5000 points if you crash crashed = true; bonus = -5000; } else{ //bonus of 2500 points for landing landed = true; bonus = 2500; //(57 is the width of the lander) if (x>800 && x<(900-57)){ //bonus of 5000 points for landing in the bonus area bonus = 5000; } } //disable controls after you hit the ground rightPressed = false; upPressed = false; leftPressed = false; //Go to the high scores after 2 seconds setTimeout(sendScores, 2000); } dy = 0; dx = dx /1.05; //this line is friction } //X and Y acceleration controls x += dx; y += dy; //Keyboard to lander direction/acceleration if(rightPressed && leftPressed){ //forces cancel so nothing happens! ctx.drawImage(gasright, x-12, y+5, 20, 10); ctx.drawImage(gasleft, x+49, y+5, 20, 10); fuel -= 2; } else if(rightPressed) { //move right and draw left gas burst ctx.drawImage(gasright, x-12, y+5, 20, 10); dx += 0.01; fuel -= 1; } else if(leftPressed) { //move left and draw right gas burst ctx.drawImage(gasleft, x+49, y+5, 20, 10); dx -= 0.01; fuel -= 1; } if(upPressed) { //move up dy -= 0.02; fuel -= 3; } //This is not an if so it happens all the time //this means the lander is pulled down by gravity dy += gravity/1000; if(fuel<1 && levelnum != 0){ fuel = 0; fuelout = true; rightPressed = false; upPressed = false; leftPressed = false; } if (gamestart == false || levelselect == false){ x = 200; dx = 1; y = 200; dy = 1; } //redraw each part of the canvas when necessary //could reimplement this, but it didn't work very well in VM at the time //requestAnimationFrame(draw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run(){\n // Polling request to server\n const sleep = time => new Promise(resolve => setTimeout(resolve, time))\n const poll = (promiseFn, time) => promiseFn().then(\n sleep(time).then(() => poll(promiseFn, time)))\n\n // polling with callback function which updates the view\...
[ "0.6767319", "0.66968566", "0.66959", "0.66959", "0.6677437", "0.6672038", "0.66581446", "0.6654818", "0.6638659", "0.662638", "0.662638", "0.662638", "0.662638", "0.6599868", "0.6599868", "0.65789765", "0.65281373", "0.6513805", "0.651055", "0.6485298", "0.6459479", "0.643...
0.0
-1
Component to render whole UI of Home page
function Settings() { const classes = useStyles(); const [value, setValue] = React.useState(localStorage.getItem("language")); const [error, setError] = React.useState(false); /* istanbul ignore next */ const handleRadioChange = (event) => { setValue(event.target.value); setError(false); }; /** * Handles Submit button click * @param {*} event event */ /* istanbul ignore next */ const handleSubmit = (event) => { event.preventDefault(); localStorage.setItem("language", value) window.location.reload(true); }; return ( <form onSubmit={handleSubmit}> <div className="settingBanner"> <FormControl component="fieldset" error={error} className={classes.formControl}> <FormLabel component="legend">{Locale.print("Select Language")}</FormLabel> <RadioGroup aria-label="quiz" name="quiz" value={value} onChange={handleRadioChange}> <FormControlLabel style={{color:'black'}} value="en" control={<Radio color="primary"/>} label="English" /> <FormControlLabel style={{color:'black'}} value="es" control={<Radio color="primary"/>} label="Spanish" /> <FormControlLabel style={{color:'black'}} value="de" control={<Radio color="primary"/>} label="German" /> <FormControlLabel style={{color:'black'}} value="pt" control={<Radio color="primary"/>} label="Portuguese" /> </RadioGroup> <Button type="submit" variant="outlined" color="primary" className={classes.button}> {Locale.print("Submit")} </Button> </FormControl> </div> </form> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\t// preserve context\n\t\tconst _this = this;\n\n\n\t\treturn (\n\t\t\t<div>\n\t\t\t\tHome App\n\t\t\t</div>\n\t\t);\n\t}", "render(){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2> Our Current Clients Page </h2>\n\t\t\t\t<ClientLogos/>\n\t\t\t\t<ClientDescription/> \n\t\t\t</div>\n\t\t)\n\t}", "render...
[ "0.75236946", "0.727462", "0.7178601", "0.7174904", "0.71092665", "0.7037176", "0.6975897", "0.69114447", "0.6908207", "0.6889208", "0.6885636", "0.68442804", "0.68308514", "0.680622", "0.6800664", "0.67904323", "0.67781913", "0.67780846", "0.6775026", "0.677073", "0.67651457...
0.0
-1
get width of container and resize svg to fit it
function resize() { var targetWidth = parseInt(container.style("width")); svg.attr("width", targetWidth); svg.attr("height", Math.round(targetWidth / aspect)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\r\n var targetWidth = parseInt(container.style(\"width\"));\r\n svg.attr(\"width\", targetWidth);\r\n svg.attr(\"height\", Math.round(targetWidth / aspect));\r\n }", "function resize() {\n let targetWidth = parseInt(container.style(\"width\"));\n svg.attr(\"width...
[ "0.8328143", "0.8326342", "0.8312327", "0.8312327", "0.8306979", "0.8306979", "0.82915497", "0.8256269", "0.8236155", "0.8236155", "0.8179068", "0.8144525", "0.7784457", "0.77145046", "0.74716645", "0.7432957", "0.734283", "0.72580904", "0.7254493", "0.7222054", "0.71336585",...
0.8262772
10
Query the oracle database, and call output_actors on the results res = HTTP result object sent back to the client userid = Name to query for
function query_db(req,res,userid,password) { oracle.connect(connectData, function(err, connection) { if ( err ) { console.log(err); } else { // selecting rows connection.execute("SELECT * FROM USERS U WHERE U.U_ID = " + "'" + userid + "'", [], function(err, results) { if ( err ) { console.log(err); } else { var bcrypt = require('bcrypt') var salt = bcrypt.genSaltSync(10); // Hash the password with the salt var hash = bcrypt.hashSync(password, salt) + ""; //determines if the hashes are equal or for legacy if DEFAULT_PASSWORD is used var equalsPassword = bcrypt.compareSync(password, results[0].PASSWORD_HASH) || (password == "DEFAULT_PASSWORD" && results[0].PASSWORD_HASH == "DEFAULT_PASSWORD"); // true //console.log(equalsPassword); //console.log(bcrypt.compareSync("hello", hash)); //if no query returned or wrong password if (results.length < 1 || !equalsPassword){ connection.close(); console.log("Wrong Username or Password"); res.render('index.jade', { title: 'Wrong Username or Password' }); } //else correct password else{ //Saves the user. Nish said to do this though //thought it doesn't work. //note dont save results[0] since this is not done //in signup.js req.session.user = userid; connection.close(); // done with the connection //THIS IS WHERE YOU SHOULD CALL YOUR FUNCTION //YOU CAN REMOVE LINE OF CODE BELOW res.redirect('/newsfeed/'); } } }); // end connection.execute } }); // end oracle.connect }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query_db(req, res, username) {\n \toracle.connect(connectData, function(err, connection) {\n\t if ( err ) {\n\t \tconsole.log(err);\n\t } else {\n\t \t// console.log(username + \", \", password);\n\t\t \t// selecting rows\n\t\t \tconnection.execute(construct_query_get_tripName(username), \n...
[ "0.64046377", "0.5768015", "0.5685657", "0.567238", "0.5622958", "0.56044996", "0.5592255", "0.5564321", "0.55560595", "0.55148816", "0.549711", "0.5487333", "0.54862815", "0.54708546", "0.5429194", "0.5406893", "0.5405412", "0.5397097", "0.53496706", "0.53432345", "0.5322093...
0.49379638
83
Creates new instance of Environment class. Includes calling spawn() for chat.
static spawn() { const env = new Environment(); const chat = require('./chat').spawn({ code: 'Global' }); env.set('code', 'Global'); env.set('games', 1); env.set('onMaintenance', false); env.set('discordWebhookURL', '/'); env.set('ipBlacklist', require('../security/databases/untrusted-ips')); env.set('emailWhitelist', require('../security/databases/trusted-emails')); env.set('chat', chat); return env; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setupEnvironment() {}", "function lisp_make_env(parent) {\n lisp_assert((parent === null) || lisp_is_instance(parent, Lisp_Env));\n var env = lisp_make_instance(Lisp_Env);\n env.lisp_parent = parent;\n env.lisp_bindings = Object.create(null);\n return env;\n}", "function createFreshEnv() {\n re...
[ "0.603774", "0.6003259", "0.5901574", "0.584852", "0.5835657", "0.5832477", "0.56513524", "0.5514286", "0.54897386", "0.54422134", "0.5417716", "0.5415538", "0.54097724", "0.53803325", "0.53304493", "0.53185475", "0.5309401", "0.5303213", "0.52845985", "0.5256714", "0.5229669...
0.8043313
0
Async metho used to get current Environment settings from the server
static async getGlobal() { const envQ = new Parse.Query('Environment'); return await envQ.first({ useMasterKey: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getRuntimeEnv () {\n\n return http.get(endpoints.uiconfig, {}, function (err, results) {\n if (err) {\n Mojo.publishException(_component, err.message);\n }\n else {\n\n CONFIG.isProd = (results.env == 'production');\n CONFIG.env = results.env;\n ...
[ "0.734798", "0.68788165", "0.6875445", "0.6726438", "0.66857946", "0.6663759", "0.66316557", "0.6424007", "0.63902396", "0.6389873", "0.6384897", "0.63783133", "0.6357662", "0.6327678", "0.6253525", "0.62458175", "0.62301844", "0.6226142", "0.6217396", "0.6217396", "0.6217049...
0.67337483
3
Method called when switching maintance mode on/off
toggleMaintenance() { const onMaintenance = this.get('onMaintenance'); this.set('onMaintenance', !onMaintenance); this.save({}, { useMasterKey: true, context: { global: true } }); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "function changeMode(){ \n if(IslightMode)\n darkMode();\n else\n lightMode();\n}", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n ...
[ "0.6901983", "0.6792095", "0.6652028", "0.65776587", "0.64828473", "0.64630306", "0.6451953", "0.64280254", "0.64151216", "0.63053066", "0.6280663", "0.6215491", "0.6209282", "0.6204161", "0.61880434", "0.61685866", "0.6146683", "0.6125561", "0.60803246", "0.6072381", "0.6067...
0.6105801
18
Method called when switching lockdown mode on/off
toggleLockdown() { const onLockdown = this.get('onLockdown'); this.set('onLockdown', !onLockdown); this.save({}, { useMasterKey: true }); return !onLockdown; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleLock() {\n $(\"[data-button='lock']\").find(\"i\").toggleClass(\"fa-unlock fa-lock\");\n $(\".container > .menu\").toggleClass(\"draggable\");\n\n var configLock = !config.get(\"window.locked\");\n\n config.set(\"window.locked\", configLock);\n }", "_initializeLock() {\n if(config.get(\"win...
[ "0.68638706", "0.68291026", "0.6619997", "0.64607424", "0.6453212", "0.6410828", "0.6407102", "0.6407102", "0.6407102", "0.63603324", "0.63573116", "0.63049364", "0.6302649", "0.62933546", "0.6254917", "0.6252317", "0.6217817", "0.621601", "0.62138885", "0.62056345", "0.62054...
0.6620561
2
Method used to update/set up discord hooks
setDiscordHook() { const hooks = this.get('discordHooks') || {}; discordReports.setHooks(hooks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async setup() {\n this.hooks = await this.github.genHooks();\n this.is_setup = true;\n }", "bindHooks() {\n //\n }", "addHook (hook) {\n this.hooks.push(hook)\n }", "async registerWebhooks() {\n this.webhookSecret = \"chance_webhook_secret\";\n\n console.log('registering webhooks')\n ...
[ "0.64734715", "0.64162713", "0.6277969", "0.6142959", "0.6044679", "0.5990378", "0.59738463", "0.5930648", "0.5928075", "0.5928075", "0.59106535", "0.5905197", "0.5890787", "0.58461565", "0.58461565", "0.58461565", "0.58461565", "0.5804942", "0.57870835", "0.57701784", "0.571...
0.736404
0
should be in the room
function queryEntry(uid, callback) { var route = 'gate.gateHandler.queryEntry'; pomelo.init({ host: '127.0.0.1', port: 3014, log: true }, function() { pomelo.request(route, { uid: uid }, function(data) { pomelo.disconnect(); if(data.code === 500) { showError(LOGIN_ERROR); return; } callback(data.host, data.port); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function partingFromRoom( room ) {\n}", "isRoomEnterable() {\n\n const isSelfInRoom = () => {\n\n if (this.selfSkylinkId === null) return false;\n\n for (let user of this.props.users)\n {\n if (user.skylinkId == this.selfSkylinkId) return true;\n ...
[ "0.6860039", "0.67295057", "0.64347404", "0.641349", "0.6252874", "0.624774", "0.61825836", "0.6095766", "0.5955478", "0.5900862", "0.5900114", "0.57685494", "0.5757625", "0.57471544", "0.5725507", "0.57236874", "0.57223314", "0.5708633", "0.5701468", "0.57008916", "0.5699716...
0.0
-1
Starting with Chrome 50, this property also takes a FederatedCredential instance or a PasswordCredential instance.
onSubmit(event) { event.preventDefault(); const stateJson = this.state; fetch('/login', { method: 'POST', body: JSON.stringify(stateJson), headers: new Headers({ 'Content-Type': 'application/json' }), }) .then(res => res.json()) .catch(error => console.error('Error:', error)) .then(response => this.props.updateState({ tagName: "Setting" })); // this.props.changePage('Main'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createCredential() {\n return new Credential(this);\n }", "get credentials () {\n\t // The credentials getter steps are to return this’s request’s credentials mode.\n\t return this[kState].credentials\n\t }", "getCredentials() {\r\n let credentials = \"same-origin\";\r\n if (this.cre...
[ "0.66535634", "0.5793766", "0.57571536", "0.5637781", "0.5599419", "0.5599419", "0.5532533", "0.5509263", "0.5480873", "0.5478068", "0.54087734", "0.54039156", "0.54039156", "0.54039156", "0.54039156", "0.54039156", "0.5349349", "0.53431463", "0.5303498", "0.5298532", "0.5286...
0.0
-1
Exercise 5 Write a function countCharacters that, when given a string as an argument, returns an object containing counts of the ocurrences of each character in the string
function countCharacters(string){ const temp = {} const tempStringArray = string.split(""); tempStringArray.forEach((item) =>{ temp.hasOwnProperty(item) ? temp[item] += 1 : temp[item] = 1; }) return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countChars(str) {\n var result = {\n };\n Array.from(str).forEach(function(char) {\n var curVal = result[char];\n if (curVal) result[char] += 1;\n else result[char] = 1;\n });\n return result;\n}", "function charCounting(string) {\n const result = {};\n for (let...
[ "0.79609895", "0.7955019", "0.78608036", "0.7842753", "0.782803", "0.7822205", "0.7821085", "0.77994317", "0.7775031", "0.7775031", "0.7775031", "0.7775031", "0.7775031", "0.7753002", "0.7749084", "0.77461374", "0.7731574", "0.7722871", "0.7722866", "0.7722866", "0.7722866", ...
0.797268
0
Method to load the basket in to html table
function loadBasket() { const basket = SDK.Storage.load("basket") || []; let total = 0; basket.forEach(entry => { let subtotal = entry.item.itemPrice * entry.count; total += subtotal; $modalTbody.append(` <tr> <td></td> <td>${entry.item.itemName}</td> <td>${entry.count}</td> <td>kr. ${entry.item.itemPrice}</td> <td>kr. ${subtotal}</td> </tr> `); }); $modalTbody.append(` <tr> <td colspan="3"></td> <td><b>Total</b></td> <td>kr. ${total}</td> </tr> `); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ViewBasketItem(){\n let locationid = localStorage.getItem('locationId');\n let customerid = localStorage.getItem('customerId');\n let url = 'https://localhost:5001/Location/get/order/' + locationid + '/' + customerid;\n fetch(url)\n .then(result => result.json())\n .then(result => {\n ...
[ "0.7140392", "0.67842126", "0.6694973", "0.6591064", "0.6528385", "0.6438264", "0.6424603", "0.640549", "0.6363035", "0.6335898", "0.6299305", "0.6224797", "0.62244904", "0.6212517", "0.62047434", "0.6201535", "0.61945295", "0.61590445", "0.61563635", "0.61458236", "0.6140886...
0.7807517
0
return input layers sorted by order defined in project settings
function layersInDrawingOrder(layers) { var layerDrawingOrder = wmsLoader.projectSettings.capability.layerDrawingOrder; if (layerOrderPanel != null) { // override project settings (after first load) if (enableWmtsBaseLayers) { // prepend ordered WMTS layers var orderedLayers = layerOrderPanel.orderedLayers(); var wmtsLayers = []; for (var i = 0; i < layerDrawingOrder.length; i++) { var layer = layerDrawingOrder[i]; if (orderedLayers.indexOf(layer) == -1) { wmtsLayers.push(layer); } } layerDrawingOrder = wmtsLayers.concat(orderedLayers); } else { layerDrawingOrder = layerOrderPanel.orderedLayers(); } } if (layerDrawingOrder != null) { var orderedLayers = []; for (var i = 0; i < layerDrawingOrder.length; i++) { var layer = layerDrawingOrder[i]; if (layers.indexOf(layer) != -1) { orderedLayers.push(layer); } } return orderedLayers; } else { return layers.reverse(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orderLayers() {\n this.layersHerald_.orderLayers();\n }", "_sortFeaturesZIndex(layer) {\n\t\t// First, lines\n\t\tlayer.eachLayer(l => {\n\t\t\tif(l.feature && l instanceof Polyline && !(l instanceof Polygon)) {\n\t\t\t\tl.bringToFront();\n\t\t\t}\n\t\t});\n\t\t// Last, nodes\n\t\tlayer.eachLayer(l => {\n\t\...
[ "0.698263", "0.62614304", "0.5902821", "0.5895149", "0.5816681", "0.5727386", "0.5727386", "0.5727386", "0.5675939", "0.56617117", "0.56612676", "0.56552607", "0.5626892", "0.5607131", "0.56008023", "0.5600474", "0.55394375", "0.5520954", "0.5510628", "0.55020136", "0.5493253...
0.6744863
1
return layer opacities sorted by input layers order
function layerOpacities(layers) { var opacities = Array(); for (var i=0; i<layers.length; i++) { opacities.push(wmsLoader.layerProperties[layers[i]].opacity); } return opacities; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orderLayers() {\n this.layersHerald_.orderLayers();\n }", "function order(g){var maxRank=util.maxRank(g),downLayerGraphs=buildLayerGraphs(g,_.range(1,maxRank+1),\"inEdges\"),upLayerGraphs=buildLayerGraphs(g,_.range(maxRank-1,-1,-1),\"outEdges\");var layering=initOrder(g);assignOrder(g,layering);var bestCC=Nu...
[ "0.64907384", "0.616296", "0.5954182", "0.5871023", "0.5855566", "0.5855566", "0.5855566", "0.5850513", "0.58478594", "0.58478594", "0.58421993", "0.57809806", "0.57556045", "0.5703445", "0.5698482", "0.5693413", "0.56632346", "0.5652137", "0.5652137", "0.5652137", "0.5636009...
0.59200764
3