query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
()()()()() LOOPING OVER DATA ()()()()()\\ Create a loop to iterate over the sale data from store3. Use this loop to return an array of dates contained in the sale data.
function loopingData1() { //create a variable named 'saleDates' which should be initialized as an empty array. let saleDates = []; //write a for loop to iterate over sales data for store3, and uses the .push() method to add the value stored in the [date] key for each index of the array to our 'saleDates' variabl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accessesingData1() {\n let bananaSaleDates = [];\n for (var i = 0; i < store2['sale dates']['Banana Bunches'].length; i++) {\n bananaSaleDates.push(store2['sale dates']['Banana Bunches'][i]);\n } return bananaSaleDates;\n}", "function loopingData2() {\nvar total = 0;\nvar date = store1[\"2015-01-1...
[ "0.7441041", "0.730745", "0.70649403", "0.69350314", "0.6896017", "0.6625227", "0.6549153", "0.6531657", "0.6430722", "0.6349955", "0.6152882", "0.6015109", "0.60122937", "0.5986194", "0.5979042", "0.5969262", "0.59619945", "0.5951076", "0.5932733", "0.59225065", "0.5922005",...
0.84241545
0
Create a loop to iterate over the whole store3 variable to find out how many Peanut Butter Buttered Peanuts were sold over all dates. Return the result.
function loopingData3() { let result = 0; //use for loop to iterate over each index in the array of dates, and access the quantity of PBBP sold on that dates for (let i = 0; i < store3.length; i++) { result = result + store3[i]['inventory sold']['Peanut Butter Buttered Peanuts']['quantity']; } r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loopingData4() {\n// var candies = dates[i][2]\nvar total = 0;\nvar dates = Object.keys(store1)\nfor (var i = 0; i < dates.length; i++) {\nfor (var j = 0; j < store1[dates[i]].length; j++){\ntotal += store1[dates[i]][j][2]\n}\n}\nreturn total\n}", "function loopingData2() {\nvar total = 0;\nvar date = s...
[ "0.7097113", "0.68472904", "0.67203075", "0.66022986", "0.6438543", "0.6326576", "0.62429893", "0.62308496", "0.6223792", "0.6090417", "0.5985745", "0.58862346", "0.58796537", "0.58432436", "0.58206356", "0.5775601", "0.5712088", "0.5702391", "0.5698128", "0.56812626", "0.567...
0.80133665
0
Stores the specified room data in the IndexedDB
async function storeRoomData(data){ if (!db) await initIDB(); if (db) { try{ let tx = await db.transaction(STORE_NAME, 'readwrite'); let store = await tx.objectStore(STORE_NAME); await store.put(data, data.roomID); await tx.complete; } cat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeToIndexedDB(resourceType, uid, dataObject) {\n\tif (iDB == null) {\n\t\tlog('iDB not available');\n\t\treturn;\n\t}\n\t\n\tvar useStorage = resourceType.substring(0, resourceType.length - 1) + 'Storage';\n\tvar dbTransactions = iDB.transaction([useStorage], 'readwrite');\n\tvar dbStorage = dbTransact...
[ "0.69717324", "0.665847", "0.6436731", "0.63697696", "0.6175504", "0.6058931", "0.60511476", "0.6048639", "0.6035937", "0.60163456", "0.60099345", "0.5891637", "0.5847299", "0.58376694", "0.58376694", "0.58331174", "0.58205044", "0.5801151", "0.5783097", "0.57596964", "0.5742...
0.7876549
0
Fetching all the room data associated with the specified username from IndexedDB
async function getAllRoomData(name) { if(!db) { console.log("There is no data in the IndexedDB"); } if(db) { try { console.log('fetching: all room data'); let tx = await db.transaction(STORE_NAME, 'readonly'); let store = await tx.objectStore(STORE_NAME);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getAll( username ){\n const result = await db.query(\n `SELECT id,\n description,\n name\n FROM encounters\n WHERE username=$1`\n , [username]);\n return result.rows;\n }", "function getUsersInRoom(roomname) {\n ...
[ "0.67281413", "0.66834813", "0.6578504", "0.63537455", "0.6285604", "0.61047983", "0.6075142", "0.6072916", "0.5973296", "0.59723115", "0.5928128", "0.59205717", "0.5864683", "0.5863755", "0.5859479", "0.5837827", "0.58118165", "0.5805475", "0.5803224", "0.5790218", "0.578451...
0.7581825
0
Updates the specified field in the rooms store
async function updateField(roomid, field, newValue) { if(!db){ initIDB(); } if(db){ try{ let tx = await db.transaction(STORE_NAME, 'readwrite'); let store = await tx.objectStore(STORE_NAME); let index = await store.index('rooms'); //Change fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function updateRoom (roomID) {\n const newDate = new Date(Date.now())\n await RoomSchema.updateOne({ roomID: roomID }, { updated: newDate }).exec()\n}", "async function updateRoom(req, res, next) {\n try {\n const room = await models.room.findById(req.params.roomId);\n room.capacity = req.body.cap...
[ "0.62937343", "0.62039036", "0.61326885", "0.61326885", "0.61326885", "0.6067569", "0.6055664", "0.59981745", "0.5970415", "0.5937239", "0.59121543", "0.58790535", "0.5854929", "0.58498514", "0.58430177", "0.5839862", "0.58229023", "0.58161956", "0.5788037", "0.57879835", "0....
0.7344777
0
Clears all annotations from IndexedDB
async function clearAnnotations(roomid){ if(!db){ initIDB(); } if(db){ try{ let tx = await db.transaction(KG_ANNOTATION_STORE, 'readwrite'); let store = await tx.objectStore(KG_ANNOTATION_STORE); store.delete(roomid); await tx.complete; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearAnnotations() {\n this.setAnnotations([]);\n }", "function clearAll(){\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\tdelete this.datastore[key];\r\n\t});\t\r\n}", "reset() {\n this.entities().forEach(e => e.delete());\n }", "clear() {\n for (const key of Obj...
[ "0.74375653", "0.7184972", "0.7082548", "0.6976303", "0.6831153", "0.6685766", "0.6593481", "0.65187746", "0.64858115", "0.6483662", "0.6466657", "0.64402074", "0.63964504", "0.63519377", "0.6344663", "0.628897", "0.62231153", "0.620088", "0.6171687", "0.61532205", "0.6141923...
0.73270446
1
Private methods / Create the cell matrix. Sets _matrix to an n x m array with all values initialized to 0
_initializeMatrix() { const row = Array(this.width).fill(0); this.matrix = Array(this.height).fill(row.slice(0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initMatrix() {\n this._matrix = {};\n\n for (let i = 0; i < this._y; i++) {\n this._matrix[i] = {};\n for (let j = 0; j < this._x; j++) {\n this._matrix[i][j] = j;\n }\n }\n }", "initializeMatrix() {\n\t\tthis.matrix = new Array(this.height)...
[ "0.732431", "0.7188478", "0.7158654", "0.69971025", "0.6971048", "0.6970477", "0.6964313", "0.6953534", "0.6945616", "0.6931185", "0.68727267", "0.67306995", "0.6715036", "0.66475", "0.65288574", "0.6490819", "0.648809", "0.64841515", "0.6468891", "0.64532816", "0.64496195", ...
0.77160996
0
Update undoredo broadcasters. Note that the dirty stuff should normally be handled by the EditorPageBinding. This may cause substantial misery.
function updateUndoBroadcasters () { var undo = bindingMap.broadcasterCanUndo; var redo = bindingMap.broadcasterCanRedo; if ( actionList.hasEntries ()) { if ( undo.isDisabled ()) { undo.dispatchAction ( EditorPageBinding.ACTION_DIRTY ); } undo.enable (); } else { undo.disable ()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n for( let sName in this.oInstances ){\n this[sName].webContents.send('es-window-update', this.oIdMap);\n }\n }", "function updateAllWidgets() {\n\tduplicateRemovedEvents = removeDuplicateEvents(allEvents);\n\tupdateMarkers(duplicateRemovedEvents);\n\tupdate...
[ "0.571193", "0.5664378", "0.56412065", "0.5633698", "0.5547954", "0.5546518", "0.5531503", "0.5508307", "0.54982007", "0.54708904", "0.54413944", "0.5392771", "0.53731585", "0.5371272", "0.5367223", "0.5354011", "0.5339983", "0.5337598", "0.53374135", "0.53329206", "0.5325418...
0.7590303
0
A function for handling what happens when the a new recipe is saved via "Save" button
function handleRecipeSave(res) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveRecipeOfTheDay() {\n if (this.articleSaveRecipeOfTheDayButton.waitForExist()) {\n this.recipeOfTheDayID = this.getRecipeOfTheDayID();\n this.articleSaveRecipeOfTheDayButton.click();\n }\n }", "function handleSave(oldRecipe: ?string, newRecipe: string, newIngredients: st...
[ "0.74449724", "0.7114441", "0.7034786", "0.6901464", "0.67803675", "0.67684793", "0.67122144", "0.66969067", "0.66824925", "0.65929693", "0.6588805", "0.6511748", "0.6509901", "0.6505251", "0.64875305", "0.64875305", "0.6456911", "0.64397365", "0.6412648", "0.64015347", "0.63...
0.7476018
0
Submits a saved recipe
function submitPost(recipe) { $.post("/api/savedRecipes", recipe, function () { }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function presb_commitRecipe() {\n\tvar name = document.getElementById(\"recipeNameText\").value.trim();\n\tvar tags = $('#recipeTagsText').tagEditor('getTags')[0].tags;\n\tif (name.length == 0) {\n\t\talert(\"You must enter a name\");\n\t\treturn;\n\t}\n\tvar colors = presb_getColorsInBuilder();\n\tcpr_modifyRecip...
[ "0.738216", "0.71901166", "0.7140947", "0.6987146", "0.6798498", "0.66580117", "0.66483104", "0.6625615", "0.6569078", "0.6415438", "0.6370078", "0.63604826", "0.62903845", "0.6277324", "0.62508106", "0.6149261", "0.6091614", "0.60337096", "0.60079503", "0.5994371", "0.598109...
0.73146
1
Add someone to "Follow" page. localStorage.setItem('key','value' ) //localStorage.getItem('key') //localStorage.removeItem('key')
function addToFollowPage(id) { const list = JSON.parse(localStorage.getItem('followPage')) || [] const user = users.find((user) => user.id === id) if (list.some((user) => user.id === id)) { return alert("Already followed.") } list.push(user) localStorage.setItem('followPage', JSON.stringify(list)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveNickName() {\n localStorage.setItem('receivedNickName', userNickName); //1st argument is a keyword to get the info, 2nd argument - info that has to be rememeber \n userNickName = localStorage.getItem('receivedNickName');\n}", "function setFollowingButto...
[ "0.65834457", "0.6545332", "0.63138264", "0.63002914", "0.62157446", "0.61886", "0.6178381", "0.6165634", "0.6131294", "0.61177796", "0.61073565", "0.6106797", "0.6069334", "0.6068458", "0.6059078", "0.6056223", "0.605222", "0.60186094", "0.60142034", "0.6013802", "0.6012856"...
0.7489472
0
This example has been borrowed from the Next.Js Issue you have to keep it in sync with the Next.js's Document Head component original source code
render() { const { head, styles } = this.context._documentProps; // console.log(process.cwd()); let children = this.props.children; // show a warning if Head contains <title> (only in development) if (process.env.NODE_ENV !== "production") { children = React.Children.map(children, child => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Head(props){return/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_helmet__WEBPACK_IMPORTED_MODULE_1__[/* Helmet */ \"a\"],props);}", "render () {\n return (\n <html {...this.helmetHtmlAttrComponents}>\n <head>\n <meta name...
[ "0.718956", "0.7085308", "0.69961226", "0.6995429", "0.68733114", "0.6558715", "0.6340714", "0.6334602", "0.6334602", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6240455", "0.6215763", "0.6215763", ...
0.7708241
0
Email function to pass string and send through to email provided
function notify(string) { // Construct email template for notifications // Must have to, subject, htmlBody var emailTemplate = { to: emailForNotify, subject: accountName, htmlBody: "<h1>Comporium Media Services Automation Scripts</h1>" + "<br>" + "<p>This account has encountered an i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendTextEmail() {\n email([EMAIL], null, null, null, this.state.text);\n }", "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "function notify(string) {\n // Construct email template for notifications\n // Must have to, subject, htmlBody\n var emailTemplate = {\...
[ "0.7346491", "0.7264321", "0.71377265", "0.68906456", "0.67131245", "0.66901225", "0.6689702", "0.66199124", "0.6569134", "0.652267", "0.64946437", "0.6494284", "0.6482158", "0.6477283", "0.6469757", "0.64688104", "0.6461714", "0.645878", "0.6449689", "0.64443517", "0.6415211...
0.73250914
1
returns the transaction we're suggesting for the customer based off the JSON this function is fed. inputJSON == json string for processing why: ID: want to know the id of whoever predict: what are we predicting? (acctA, acctB, $ value) acctList: list of accounts for editing value regular: how often (i.e. weekly, fortni...
function getJSON(input, why){ //var input = jQuery.parseJSON(inputJSON); if(why == "validate"){ return input.result.error; } if(why == "id"){ return input.result.friendlyName; } if(why == "predict"){ var proposed = new Array(5); proposed[0] = "Predicted transaction"; proposed[1] = input.resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transactionItemizer(json) {\n assert(json.hash);\n var index = hash_256_1.Hash256.from(json.hash);\n var item = {\n hashPrefix: function () {\n return hash_prefixes_1.HashPrefix.transaction;\n },\n toBytesSink: function (sink) {\n var serializer = new bi...
[ "0.5187639", "0.5049471", "0.5047772", "0.4913873", "0.48795626", "0.48553485", "0.48521352", "0.48076004", "0.4754478", "0.47309107", "0.47260568", "0.4710403", "0.47049937", "0.47004172", "0.46514648", "0.46348605", "0.46287876", "0.4559363", "0.45558777", "0.45454955", "0....
0.6521713
0
Called when the episode airs.
onAir() { this.nextEpisode++; this.lastUpdated = util.getUnixTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateAircraft() {\n this.emit('aircraft', {});\n }", "forecastEvent () {\n // Eeeesh :/\n }", "on() {\n\t\tthis._lamps.on();\n\t}", "async function onEpisodes(event) {\n event.preventDefault();\n let showId = $(event.target).closest(\"[data-show-id]\").attr(\"data-show-id\");\n let episod...
[ "0.5734962", "0.55118686", "0.5493935", "0.54540396", "0.53471524", "0.53128827", "0.5301176", "0.5281334", "0.52603984", "0.5241648", "0.52092165", "0.52079153", "0.5148572", "0.5120922", "0.511059", "0.5103196", "0.50987595", "0.5095232", "0.5092792", "0.5092015", "0.507292...
0.7250053
0
an example showing how to manipulate Studio/tml widget locations using the Matrix/Vector maths lib
function positionwidget(name,params) { var wd = $scope.view.wdg[name]; var cd = new Vector4().Set3(wd.x,wd.y,wd.z) // set location .Transform(params.transform); // and transform it to the pose given by the helper app var ef = new Matrix4().Rota...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getViewMatrix() {\n ...\n }", "function onManipulatorXYZChangedHandler(sender, args) {\r\n\r\n var xyzDelta = manipulatorData.getTrait(\"ManipulatorTraitXYZ\").value;\r\n var dx = xyzDelta[0];\r\n var dy = xyzDelta[1];\r\n var dz = xyzDelta[2];\r\n\r\n coreTranslate(dx, dy, dz);\r\n}",...
[ "0.60886866", "0.59332716", "0.5891549", "0.55661213", "0.55583143", "0.5523717", "0.5508053", "0.5478653", "0.54733264", "0.5464714", "0.5464497", "0.54637235", "0.5441926", "0.54237413", "0.5415142", "0.5386963", "0.5375732", "0.536022", "0.53493834", "0.53369325", "0.53346...
0.6506272
0
Clear note form after submission
function clearForm() { document.getElementById("note").value="" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetform()\n{\n\t\t\t$('#note_title').val('');\n\t\t\t$('#note_text').val('');\n\t\t\t$('#note_quotes').val('');\n\t\t\tdocument.getElementById('note_quotes').focus();\n\t\t\tdocument.getElementById('note_text').focus();\n\t\t\tdocument.getElementById('note_title').focus();\n\t\t\t$('#warning').html('');...
[ "0.76395166", "0.75886893", "0.7574626", "0.7475211", "0.74054044", "0.7220007", "0.7075549", "0.70398206", "0.69775766", "0.69394", "0.6913777", "0.6910371", "0.6864403", "0.68637955", "0.68574303", "0.6852188", "0.68520474", "0.6766155", "0.6755192", "0.67428786", "0.673764...
0.8293183
0
Get notes that exist in localStorage currently
function getExistingNotes() { let notes = localStorage.getItem('notes') if (!notes) { return null } return JSON.parse(notes) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getItemsFromLocalStorage() {\r\n notesCount = localStorage.getItem(\"count\");\r\n notesFromLocalStorage = JSON.parse(localStorage.getItem(\"notes\"));\r\n }", "function getNotesFromLocalStorage(){\n\t var note = localStorage.getItem(\"notes\"); \n\t noteArray = JS...
[ "0.79528177", "0.7862381", "0.77785826", "0.7664941", "0.7473686", "0.73528004", "0.73327506", "0.73278075", "0.7250124", "0.71677876", "0.7146624", "0.71020997", "0.70322317", "0.7014692", "0.698964", "0.6932167", "0.6750371", "0.6744064", "0.6743088", "0.67218965", "0.67156...
0.84222996
0
Displays message on the notes page telling user there are no notes
function noNotesMessage() { const message = document.createElement('h3') message.innerHTML = "No notes to display! Click the 'Back' button to add new notes." document.body.append(message) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNoteList(notes) {\n\tif(notes.length === 0) return \"You don\\'t have notes yet...\"\n\tlet result = '';\n\tnotes.map((note)=>{\n\t\tresult += `Title: ${note.title} Body: ${note.body}\\n`;\n\t});\n\treturn result;\n}", "function checkNotes() {\n let noteContent = localStorage.getItem(\"note\");\n...
[ "0.6745767", "0.66570306", "0.66538274", "0.6536291", "0.6503179", "0.64647925", "0.6453812", "0.6439164", "0.6328242", "0.62565815", "0.6244502", "0.6244274", "0.62425435", "0.62322414", "0.61815745", "0.61198664", "0.6118601", "0.60994285", "0.60910404", "0.6089235", "0.607...
0.7758626
0
getFullList (): Gets all the characters info from API
getFullList () { $.ajax({ url : this.BASE_URL + "/characters", method : "GET", success : displayCharacterCards, error : handleError, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFullList() {\n \n return this.axios\n .get('/characters')\n \n }", "function showAllCharac() {\n charactersAPI.getFullList()\n .then(allCharac => {\n \n let html = \"\"\n allCharac.data.forEach(elm => {\n html += `<div class=\"character-info\">\n <div class=...
[ "0.76348764", "0.6948362", "0.68969226", "0.6609645", "0.6306189", "0.6277798", "0.6135089", "0.6026758", "0.60262823", "0.59877527", "0.59484756", "0.5944995", "0.59384525", "0.59326077", "0.5914609", "0.5777496", "0.57429385", "0.5691723", "0.56747746", "0.5628428", "0.5607...
0.7353144
1
getOneRegister () : Get a single character info from API
getOneRegister (id) { $.ajax({ url : this.BASE_URL + "/characters/" + id, method : "GET", success : displayOneCharacter, error : handleError, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getOneRegister(id) {\n \n return this.axios\n .get(`/characters/${id}`)\n \n }", "createOneRegister (character) {\n\n return this.axios\n .post('/characters', character)\n \n \n }", "function showOneCharac(characterId) {\n charactersAPI.getOneRegister(characterId)\n .then(o...
[ "0.7985885", "0.6377714", "0.63266164", "0.59317476", "0.57676804", "0.5742738", "0.57423687", "0.5742295", "0.5674858", "0.56531554", "0.56343955", "0.55934155", "0.55895185", "0.5495155", "0.5427439", "0.54260314", "0.54189914", "0.54143965", "0.54132545", "0.5370355", "0.5...
0.7485074
1
createOneRegister () : Create a single character info from API
createOneRegister (characterInfo) { console.log(characterInfo); $.ajax({ url : this.BASE_URL + "/characters", data : characterInfo, method : "POST", // pass two parameters to the CB on success && error success : (response) => { showFeedback( respon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createOneRegister (character) {\n\n return this.axios\n .post('/characters', character)\n \n \n }", "function createOneCharac(characterInfo) {\n charactersAPI.createOneRegister(characterInfo)\n .then(() => document.getElementById(\"send-data-create\").classList.add('active')) //Set the button ...
[ "0.7538036", "0.69030094", "0.652811", "0.63698244", "0.6114342", "0.6030001", "0.60138166", "0.60125303", "0.5992992", "0.59552586", "0.5897861", "0.58643156", "0.5862636", "0.584617", "0.584346", "0.58433783", "0.5835732", "0.5809171", "0.58020955", "0.5746365", "0.574186",...
0.7048929
1
updateOneRegister () : Edit a single character through his id
updateOneRegister (characterInfo) { console.log(characterInfo); $.ajax({ url : this.BASE_URL + "/characters/" + characterInfo.id, data : characterInfo, method : "PATCH", // pass two parameters to the CB on success && error success : (response) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateOneRegister(id, newUpdate) {\n\n return this.axios \n .put(`/characters/${id}`, newUpdate)\n\n }", "function editCharacter(characterId, characterInfo) {\n charactersAPI.updateOneRegister(characterId, characterInfo) \n .then(() => {\n showOneCharac(characterId)\n document.querySelector...
[ "0.7128281", "0.6766472", "0.6577703", "0.6220224", "0.6067885", "0.5964214", "0.5751879", "0.5744974", "0.5722831", "0.5665303", "0.56347746", "0.56345046", "0.56016934", "0.5583891", "0.5573338", "0.556098", "0.5552635", "0.5536349", "0.55257595", "0.5523536", "0.55083644",...
0.6827839
1
deleteOneRegister () : Delete a single character through his id
deleteOneRegister (id) { console.log(id); $.ajax({ url : this.BASE_URL + "/characters/" + id, method : "DELETE", // pass two parameters to the CB on success && error success : (response) => { showFeedback( response, 'delete'); }, erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteOneRegister(id) {\n \n return this.axios\n .delete(`/characters/${id}`)\n\n }", "function deleteCharacterFromDB( id ) {\n return $.ajax({\n dataType: \"json\",\n type: \"delete\",\n url: \"/characters/\" + id\n });\n }", "function deleteCharacter(id) {\n let options = {...
[ "0.77713394", "0.6717877", "0.6106014", "0.594252", "0.5865661", "0.57731324", "0.5748274", "0.57352436", "0.5699034", "0.56865436", "0.56808877", "0.5644321", "0.5637831", "0.56199414", "0.56198764", "0.5603462", "0.55202556", "0.55063933", "0.55009645", "0.54982615", "0.549...
0.72264194
1
FUNCTIONS here ... displayCharacterCards() display all characters from the API
function displayCharacterCards(postResponse) { // first empty any append html so get ready to display charcaters clearCards(); //$('.characters-container').empty(); postResponse.forEach( (character, index) => { // define the html to append for each character var htmlToAppend = "<div cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAllCharac() {\n charactersAPI.getFullList()\n .then(allCharac => {\n \n let html = \"\"\n allCharac.data.forEach(elm => {\n html += `<div class=\"character-info\">\n <div class=\"name\">Character Name: <span>${elm.name}</span></div>\n <div class=\"occupation...
[ "0.75661594", "0.75011444", "0.73051685", "0.7131988", "0.707117", "0.6743705", "0.67080563", "0.6677312", "0.6660881", "0.66447866", "0.6627731", "0.66067743", "0.6595776", "0.6561132", "0.6487056", "0.6434895", "0.63716847", "0.6301417", "0.6290216", "0.6271756", "0.624069"...
0.7843882
0
clearCards() remove html appended when displaying characters so the cards are not overwrite
function clearCards() { $('.characters-container').empty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAllCards() {\n document.querySelector(\"#observation-cards\").innerHTML = \"\";\n}", "_clearRenderedCards() {\n this._cardsContainer.querySelectorAll('.card').forEach(el => el.remove());\n }", "function deleteCards(){\n\tdocument.getElementById(\"card-holder\").innerHTML = \" \";\n\t\n...
[ "0.7700366", "0.76815057", "0.7524571", "0.74752665", "0.724914", "0.72469956", "0.7212833", "0.71725696", "0.71176827", "0.7097903", "0.7069433", "0.7058494", "0.7010722", "0.70039546", "0.6980416", "0.6962868", "0.6887047", "0.68716055", "0.6866822", "0.6862632", "0.6848615...
0.81693435
0
Creates an expression parser to handle "listtype" expressions. These are expressions separated by COMMAs and terminated by some symbol. For instance, listExpr(RBRACKET, "array"), will handle expressions like, "a,b,c]". This was created to aggregate the 2 very similar cases of argument lists and array literals, which di...
function listExpr(termSym, cb) { return (function() { var length, next = parser(), list = parser(); next.on(",", function() { topLevelExpr(); length += 1; next(); }) .on(termSym, function() { cb(length);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListType(){\n\tthis.astObject = ListExpression;\n\t\t\n\tthis.toString = function(){\n\t\treturn 'list'\n\t}\n}", "function parseList(parser, isConst) {\n var start = parser.token.start;\n var item = isConst ? parseConstValue : parseValueValue;\n return {\n kind: _kinds.LIST,\n values: any(pars...
[ "0.65271807", "0.6488639", "0.64650136", "0.6438312", "0.64115167", "0.64074033", "0.64074033", "0.6400071", "0.6400071", "0.63944745", "0.63944745", "0.63944745", "0.63944745", "0.63944745", "0.63944745", "0.6348601", "0.6344657", "0.6344657", "0.6344657", "0.6344657", "0.63...
0.6760418
0
Close corresponding explain section
function closeExplain(id){ var explain = document.getElementById(id + "_explain"); if(!explain.classList.contains('hidden')) { explain.classList.add('hidden'); explain.classList.remove('bounce'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroyAllExplain() {\n\t\tlet heading = document.querySelector(\".heading\");\n\t\tlet fight = document.querySelector(\".fight\");\n\t\tlet companions = document.querySelector(\".companions\");\n\t\tlet upgrades = document.querySelector(\".upgrades\");\n\t\tlet stats = document.querySelector(\".stats\");\n\n\t\th...
[ "0.6093241", "0.53163785", "0.52473074", "0.5047931", "0.49879813", "0.49814138", "0.49702236", "0.4948826", "0.48870867", "0.48785308", "0.48429778", "0.4812923", "0.47151953", "0.4706759", "0.4698994", "0.4690179", "0.46678013", "0.4667592", "0.46477312", "0.46475804", "0.4...
0.60403347
1
Get information about a channel
function channelInfo(query) { return __awaiter(this, void 0, void 0, function* () { return api_1.get('channels.info', query, true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChannel(channel) {\n gapi.client.youtube.channels\n .list({\n part: 'snippet,contentDetails,statistics',\n id: channel\n })\n .then(response => {\n console.log(response);\n const channel = response.result.items[0];\n\n const playlistId = channel.contentDetails.related...
[ "0.7194704", "0.7127859", "0.7008146", "0.69547945", "0.69383854", "0.6842508", "0.6775204", "0.676022", "0.67562133", "0.6720613", "0.67149276", "0.6691514", "0.66651297", "0.66590065", "0.6521418", "0.6487327", "0.64664", "0.6422551", "0.64179593", "0.64013875", "0.6384606"...
0.8104593
0
Get information about a private group
function privateInfo(query) { return __awaiter(this, void 0, void 0, function* () { return api_1.get('groups.info', query, true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGroup() { return group; }", "function get_groups(groups){\n\tvar list = $(\".private_list\");\n\tfor(var i = 0; i < list.length ;i++){\n\t\tvar gid = list.eq(i).attr(\"gid\");\n\t\tif(gid != undefined){\n\t\t\tvar gname = list.eq(i).find('.name').children('a').text();\n\t\t\tvar group = {\"gid\":gid,...
[ "0.7068911", "0.6891983", "0.68268", "0.6569706", "0.6454866", "0.6397358", "0.62458813", "0.6245516", "0.6222359", "0.62029773", "0.61929643", "0.6167424", "0.60745037", "0.6033548", "0.60024166", "0.60024166", "0.60024166", "0.5982323", "0.59696406", "0.59627515", "0.595124...
0.73674244
0
Get the last messages sent to a channel (in last 10 minutes)
function lastMessages(roomId, count = 1) { return __awaiter(this, void 0, void 0, function* () { const now = new Date(); const latest = now.toISOString(); const oldest = new Date(now.setMinutes(now.getMinutes() - 10)).toISOString(); return (yield api_1.get('channels.history', { roomI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getOldMessages(channel) {\n this.rcm.redisLrange(channel, 0, 2000)\n .then(reply => {\n reply.forEach(element => {\n this.broadcastToSockets(channel, element);\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "function getLatestMessages(profile) {...
[ "0.7322482", "0.70394313", "0.6761505", "0.6746955", "0.6735324", "0.6645435", "0.63477594", "0.63421685", "0.62971056", "0.62506783", "0.621797", "0.6137599", "0.6136447", "0.60959804", "0.6071136", "0.6061758", "0.60424924", "0.59972805", "0.5970529", "0.5836426", "0.582743...
0.7201658
1
Send message from mock user to channel for tests to listen and respond
function sendFromUser(payload) { return __awaiter(this, void 0, void 0, function* () { const user = yield api_1.login({ username: config_1.mockUser.username, password: config_1.mockUser.password }); const endpoint = (payload.roomId && payload.roomId.indexOf(user.data.userId) !== -1) ? 'd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userClick(user) {\n if (store.get('profile').user_id == user.user_id) {\n return;\n }\n logger.info('[TEST] Messaging ' + (user.name || user.nickname));\n }", "function send(){\n if (client) {\n client.send(channel, \"Triggering a push notificat...
[ "0.6329344", "0.6253157", "0.62038726", "0.6172782", "0.61515164", "0.61362755", "0.6124832", "0.6103205", "0.6093378", "0.600198", "0.59727585", "0.59384245", "0.58945763", "0.5882243", "0.58800834", "0.5873436", "0.58551735", "0.58333904", "0.5798816", "0.5790701", "0.57746...
0.66465217
0
Create a direct message session with the mock user
function setupDirectFromUser() { return __awaiter(this, void 0, void 0, function* () { yield api_1.login({ username: config_1.mockUser.username, password: config_1.mockUser.password }); return api_1.post('im.create', { username: config_1.botUser.username }, true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSession() {}", "async session(session, user) {\n //setting id on session\n session.id = user.sub;\n\n return session;\n }", "function constructSession(user) {\n // Return promise\n return new Promise(function(resolve, reject) {\n ...
[ "0.6360545", "0.5889928", "0.58683246", "0.57813144", "0.5769514", "0.57209027", "0.56491035", "0.5629936", "0.5590281", "0.5556279", "0.5523422", "0.55168575", "0.54980636", "0.5431795", "0.5393719", "0.53810227", "0.5370249", "0.53576434", "0.53130186", "0.53008103", "0.529...
0.638418
0
Check if snake is at any of the current foods, then remove that food
function checkIsSnakeEating() { for(var i = 0; i < currentFoodItems.length; i++) { if(s.eat(currentFoodItems[i])) { currentFoodItems.splice(i, 1); pics.splice(i, 1); // i = currentFoodItems.length; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snake_food_intersects(snake, food) {\n for (var i = 0; i < food.length; i++) {\n for (var j = 0; j < snake.length; j ++) {\n if (JSON.stringify(food[i]) === JSON.stringify(snake[j])) {\n return food.splice(i, 1);\n }\n }\n }\n return null;\n}", ...
[ "0.6957262", "0.6934845", "0.69280446", "0.6786763", "0.6667125", "0.66670686", "0.6653797", "0.65624154", "0.6550843", "0.6543502", "0.64060277", "0.6387666", "0.63371", "0.63133377", "0.62887", "0.6257448", "0.62409264", "0.6187652", "0.61702704", "0.6160043", "0.6153076", ...
0.723909
0
Clears current food, ads new foods at random locations and adds to array, also sets pics array
function generateFood(count) { var cols = floor(width/scl); var rows = floor(height/scl); for(var i = currentFoodItems.length; i < count; i++) { currentFoodItems.push(new createVector(floor(random(cols)), floor(random(rows)))); currentFoodItems[i].mult(scl); pics[i] = new Pic(currentFoodItems[i].x, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetFood() {\n\tfood.div.remove();\n\tfood = undefined;\n\temptiness = Math.floor(Math.random() * EMPTY_MAX);\n}", "function makeFood(){\n for(var i=0; i < foodAmount; i++){\n var randomX = Math.floor(Math.random()*playfield.width);\n var randomY = Math.floor(Math.random()*playfield.height...
[ "0.6979477", "0.6834729", "0.6764203", "0.66705626", "0.65683824", "0.6562125", "0.6522554", "0.6512433", "0.65054613", "0.6503792", "0.64976645", "0.64633656", "0.6455125", "0.64493966", "0.6425615", "0.6397004", "0.6361413", "0.6267", "0.62633073", "0.6246615", "0.6210999",...
0.6924902
1
when the component mounts, grab a single journalist as well as the details of the articles contained within journalist, set state to include this journalist to be passed down
componentDidMount(){ let request = new Request() const url = '/api/journalists/' + this.props.id + '?projection=embedArticle'; request.get(url).then((data) => { this.setState({journalist: data}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(){\n if(!this.state.journalist){\n return null;\n }\n if(!this.state.articles){\n return(\n <div className=\"single-journalist-container\">\n <JournalistDetails id={this.props.id} journalist = {this.state.journalist} articles={null} handleDelete = {this.handleDelete} handleEdi...
[ "0.7204934", "0.62263566", "0.6202548", "0.6192056", "0.6167372", "0.6094774", "0.607375", "0.6067214", "0.60215324", "0.5967045", "0.59389967", "0.592955", "0.5922428", "0.59177345", "0.59129256", "0.58921707", "0.5887856", "0.58761054", "0.58748424", "0.58653957", "0.578648...
0.68002164
1
this function will be passed down to journalistdetail component for rendering there make a request to back end api to delete journalist based on id, then return to /journalists route (journlalistListContainer)
handleDelete(id){ const request = new Request(); const url = '/api/journalists/' + id; request.delete(url).then(() => { window.location = '/journalists' }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleDelete(id) {\n var restId = id;\n const url = this.props.URL + '/rest/' + restId;\n const requestOptions = {\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json' }\n };\n\n fetch(url, requestOptions)\n .then(response => respon...
[ "0.6437404", "0.6424102", "0.6394888", "0.6322027", "0.623077", "0.6142235", "0.61347353", "0.6114788", "0.6112671", "0.6103414", "0.60642844", "0.6041937", "0.60327065", "0.6006466", "0.60014623", "0.5996713", "0.59964556", "0.59919107", "0.5984352", "0.59705514", "0.5952456...
0.7499013
0
compulsory React render function it has to return something so in the event there is no journalist return nothing to save console.error() else return the journalistdetails component feed it props of the whole journalist object the embedded articles and the two functions above to be used to edit/delete from articleDetai...
render(){ if(!this.state.journalist){ return null; } if(!this.state.articles){ return( <div className="single-journalist-container"> <JournalistDetails id={this.props.id} journalist = {this.state.journalist} articles={null} handleDelete = {this.handleDelete} handleEdit={this.handle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n // If we have no articles, we will return this.renderEmpty() which in turn returns some HTML\n if (!this.state.savedArticles) {\n return this.renderEmpty();\n }\n // If we have articles, return this.renderContainer() which in turn returns all saves articles\n return this.renderCont...
[ "0.673157", "0.65869296", "0.6522336", "0.65114194", "0.6422285", "0.63215476", "0.6287002", "0.61693686", "0.61110055", "0.6006414", "0.5972259", "0.59529334", "0.5882098", "0.58357525", "0.58256257", "0.58235645", "0.5813332", "0.579836", "0.5786105", "0.577595", "0.574343"...
0.87188673
0
Save the current _session to localStorage
_addSessionToStorage() { localStorage.setItem(STORAGE_KEY, JSON.stringify(this._session)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static saveSession() {\n if (typeof window === 'undefined') return\n window.sessionStorage.idCacheByUserId = JSON.stringify(idCacheByUserId)\n window.sessionStorage.itemCacheByUserId = JSON.stringify(itemCacheByUserId)\n window.sessionStorage.userCache = JSON.stringify(userCache)\n }", "function sav...
[ "0.7969179", "0.7947222", "0.790661", "0.7845669", "0.7841815", "0.7800186", "0.7800186", "0.76172477", "0.7609337", "0.7581967", "0.7509892", "0.7486773", "0.74834925", "0.743209", "0.73979956", "0.7369258", "0.73092854", "0.7250863", "0.72390795", "0.72344726", "0.72220415"...
0.8598298
0
Clear any session data currently in cache or storage
clearSession() { this._clearSessionInStorage(); this._session = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _clear() {\n $window.sessionStorage.clear();\n }", "clear() {\n sessionStorage.clear()\n localStorage.clear()\n }", "function clearSessionItems() {\n\tsessionStorage.clear();\t\n}", "static clearSession() {\n localStorage.removeItem(KEY.ACCESS_TOKEN);\n ...
[ "0.83070874", "0.8298073", "0.81828463", "0.81725", "0.8150694", "0.81414896", "0.81311464", "0.7986886", "0.7846584", "0.76330507", "0.75893056", "0.75751674", "0.7559745", "0.7555658", "0.75446093", "0.7542862", "0.75135916", "0.746601", "0.7463995", "0.74329007", "0.741049...
0.83387136
0
add word to DOM
function addWordToDOM() { randomWord = getRandomWord(); word.innerHTML = randomWord; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addWordToDOM() {\n randomWord = getRandomWord();\n word.innerText = randomWord;\n}", "function addWordToDOM() {\r\n randomWord = getRandomWord();\r\n word.innerHTML = randomWord;\r\n}", "function addWordtoDOM() {\n randomWord=getRandomWord();\n word.innerHTML=`<h1 id=\"word\">Type \"${ra...
[ "0.7707695", "0.7601197", "0.7589894", "0.7489977", "0.727855", "0.7196381", "0.71656066", "0.7124667", "0.7075898", "0.67734396", "0.6487376", "0.637499", "0.6349276", "0.6349276", "0.633582", "0.6314087", "0.6304305", "0.6289973", "0.627617", "0.6265377", "0.6262247", "0....
0.7727165
1
set random cpu play
cpuPlay(){ switch (Math.floor(Math.random() * 3)) { case 0: return "rock"; case 1: return "paper"; case 2: return "scissors"; default: return "rock"; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computerPlay() {\n\t\toplay = Math.floor((Math.random() * 9) +1);\n\t\treturn oplay;\n\t}", "function cpuPick(){\n switch (getRandomInt(3)){\n case 0:\n return \"rock\";\n case 1:\n return \"paper\";\n default:\n return \"scissors\";\n }\n}", ...
[ "0.7021207", "0.696858", "0.695971", "0.69499904", "0.68451214", "0.672156", "0.6656398", "0.6619089", "0.66163105", "0.66051936", "0.65853906", "0.6583721", "0.6580956", "0.65748376", "0.653008", "0.6525492", "0.65055186", "0.6480597", "0.64673", "0.64455765", "0.6443894", ...
0.7262531
0
xxxxxxxxxx Hide edit profile form xxxxxxxxxx
function hideEditProfileForm(){ document.getElementById("profileSection").style.display = "block"; document.getElementById("editProfileForm").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function turnOffProfileEditMode()\r\n {\r\n let timeout = Q(\".feedback\") ? 375 : 0;\r\n\r\n setTimeout(() => \r\n {\r\n for (let i = 0; i < allProfileInputs.length; i++)\r\n {\r\n allProfileInputs[i].style.display = \"none\";\r\n if (allProfileValues[i])\r\n allProfileV...
[ "0.7347597", "0.7319204", "0.72147316", "0.72021866", "0.71767235", "0.71587175", "0.7106617", "0.70715433", "0.7063367", "0.6839125", "0.6815444", "0.6811172", "0.6788299", "0.67805696", "0.6778849", "0.6778849", "0.67788434", "0.67747283", "0.67228323", "0.6707652", "0.6707...
0.7803073
1
31) Get element with ID "container" from the page
function getContainerElement(){ cl(document.getElementById("container")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getContainer(p) {\n var container = document;\n if (typeof p === 'string' && p[0] === '#') {\n p = p.slice(1);\n container = document.getElementById(p) || document;\n } else if (p instanceof _main.default.Element) {\n container = p.el...
[ "0.72741395", "0.7143748", "0.7016446", "0.6993745", "0.6993745", "0.6993745", "0.6993745", "0.6993745", "0.6993745", "0.6993745", "0.6993745", "0.69819933", "0.67502993", "0.6740386", "0.6656873", "0.6552106", "0.652404", "0.6441787", "0.6441787", "0.64242923", "0.6394073", ...
0.776457
0
32) Get every "td" from the page
function allTd(){ cl(document.querySelectorAll("td")); //document.getElementsByTagName('td') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTableData(){\r\n\tlet cells = document.querySelectorAll('#emailTable td');\t\r\n\tlet data = [];\r\n\r\n\tcells.forEach(function(cell){\r\n\t\tdata.push(cell.innerHTML);\r\n\t})\r\n\r\n\treturn data;\r\n}", "_parseHTML(htmlString) {\n //current xpath is body.div[i].table.tbody.tr[j].td[1-5]\n ...
[ "0.63712496", "0.6360187", "0.63005805", "0.621337", "0.61135495", "0.60671014", "0.60091805", "0.5945949", "0.5914252", "0.5902228", "0.58748627", "0.5843857", "0.5827865", "0.5821949", "0.5796796", "0.5796796", "0.5796796", "0.5796796", "0.5796796", "0.57925946", "0.5773732...
0.6385542
0
34) Write a function to change the heading of the page
function HeadingChange(){ cl(document.title = "This is new title") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function change_heading() {\n let heading = document.getElementById('heading');\n heading.innerHTML = \"Learning Javascrtipt is Fun!!! - Changed the heading\"\n}", "function changeH1() {\n let newH1 = document.querySelector(\"h1\")\n newH1.innerText = \"Now we changed the heading\"\n}", "function setPa...
[ "0.729477", "0.69746214", "0.6892993", "0.6777812", "0.6705101", "0.65905285", "0.65905285", "0.6582107", "0.6577469", "0.65429854", "0.65425265", "0.6521981", "0.650361", "0.6500996", "0.6490377", "0.64902717", "0.64702946", "0.6438519", "0.6405491", "0.63968366", "0.6395727...
0.75095606
0
35) Write a function to add an extra row to the table
function addExtraRow(){ var table = document.getElementById("tbl1") cl(table.insertRow(0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRow() {\n}", "function addRow(table) {\n row = table.insertRow(-1)\n cell1 = row.insertCell(0)\n cell1.style = \"border:solid\"\n cell2 = row.insertCell(1)\n cell2.style=\"border:solid\"\n cell3 = row.insertCell(2)\n cell3.style=\"border:solid\"\n cell4 = row.insertCell(3)\n ...
[ "0.790529", "0.75404537", "0.7534461", "0.73791856", "0.72607094", "0.7238683", "0.71512413", "0.71370924", "0.71204567", "0.70914084", "0.70850855", "0.7073197", "0.7070675", "0.7069539", "0.70479745", "0.7046021", "0.70454854", "0.70411026", "0.7019037", "0.69808596", "0.69...
0.8316257
0
36) Write a function to add the class "test" to reach row in the table
function addClassTest(){ var rows = document.getElementsByTagName('tr') for(var i=1; i<rows.length; i++) { rows[i].classList.add("test"); } cl(document.getElementsByClassName("test")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignTableClasses(hook){\n t = $(hook);\n t.each(function(){\n $(this).addClass('edit');\n $(this).bind('contextmenu', async function(e) {\n // parse the remaining count from the table cell content\n let remainingCount = parseInt(e.target.textContent);\n ...
[ "0.68932354", "0.6588865", "0.65876085", "0.6525552", "0.6457058", "0.6338216", "0.62841225", "0.62466466", "0.62415946", "0.6239909", "0.6237871", "0.6166324", "0.61650026", "0.6127938", "0.6109943", "0.60404485", "0.59958225", "0.59834653", "0.5970482", "0.59704095", "0.595...
0.82231206
0
37) Write a function to add a red background to every link in the page
function addBackgroundToLink(){ var x = document.getElementsByTagName('a'); for (var i = 0; i < x.length; i++) { x[i].style.color = 'red'; } cl(document.querySelectorAll('a').style.color); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorLinks(hex)\n {\n var links = document.getElementsByTagName(\"a\");\n for(var i=0;i<links.length;i++)\n {\n if(links[i].href)\n {\n links[i].style.color = hex; \n }\n } \n }", "function linkcolorchange(step){\n ...
[ "0.7530278", "0.6971994", "0.6638697", "0.6526552", "0.65055877", "0.6306751", "0.62653965", "0.6245498", "0.62233293", "0.6193849", "0.6168363", "0.60938334", "0.6072547", "0.5998817", "0.5988893", "0.5931886", "0.59256405", "0.5919703", "0.59101707", "0.5895887", "0.5886344...
0.8396624
0
39) Write a function to add new items to a UL
function addNewItemsUL(){ var Ul1 = document.querySelector("ul") var li = document.createElement("li") var textNode = document.createTextNode("New Item") li.appendChild(textNode) Ul1.appendChild(li) cl(document.querySelector("ul").innerHTML); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToListItem (){\n // Capture value of this input field\n var newListItem = $('.new-list-item').val();\n \n // Render DOM element to the page with the above value\n $(\"#todo\").append(`<li class=\"list-item\">\n <span>${newListItem}</span>\n ...
[ "0.7707422", "0.7694254", "0.7635389", "0.7607173", "0.74053353", "0.729771", "0.723155", "0.72312146", "0.7176209", "0.71642137", "0.71466374", "0.7143974", "0.71293974", "0.7125737", "0.71101326", "0.70701206", "0.7069946", "0.7043132", "0.7022123", "0.7021796", "0.7015252"...
0.8010596
0
do the cTable fills ... arrays expected [rgb, description] ...
function cTable(title, baseColor, action, cArray) { var tiny = tinycolor(baseColor); var aList; var rowLimit = 10; var x; switch (action) { case ("triadryb"): aList = rybcolor.rybtriad(tiny); aList = aList.map(function(rgb) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_color_table()\n\t{\n\t\tcolor_table = new Uint32Array(256);\n\t\tcolor_table_canvas = [];\t\t\t\t// String array\n\t\t\n\t\tfor (var i = 0; i < 256; i++)\n\t\t{\n\t\t\tcolor_table[i] = make_color(i);\n\t\t\tcolor_table_canvas[i] = make_canvas_color(i);\n\t\t}\n\t}", "function initTable() {\r\nvar...
[ "0.643942", "0.63890463", "0.634279", "0.61495775", "0.5819011", "0.5807244", "0.579548", "0.5784515", "0.5749471", "0.5711077", "0.5661327", "0.5659003", "0.5635877", "0.5605824", "0.55720025", "0.55585724", "0.555808", "0.551349", "0.55017054", "0.5459928", "0.5431392", "...
0.70780945
0
calculate closest color based on material color design: just primaries or all...
function calcColor(c) { c = tinycolor(c); var diff = Number.MAX_VALUE; var tDiff, closest, obj, key, tint, anRGB; for (key in mdColors.md) { if (mdColors.md.hasOwnProperty(key)) { obj = mdColors.md[key]; for (tint in obj) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchColors(r, g, b) {\n var nearestColor = -1;\n var distance = 10000000;\n for (var i = 0; i < 100; i++) {\n\tvar color = getcolor(i);\n var r1 = parseInt(color[2].substr(1, 2), 16);\n var g1 = parseInt(color[2].substr(3, 2), 16);\n var b1 = parseInt(color[2].substr(5, 2),...
[ "0.670246", "0.6606293", "0.6521646", "0.6505017", "0.6484049", "0.6484049", "0.63453716", "0.6265339", "0.6255232", "0.62429756", "0.6229821", "0.6216258", "0.6119909", "0.61060584", "0.6104886", "0.6088422", "0.6000462", "0.59695137", "0.59657717", "0.59652317", "0.59641707...
0.7629934
0
if this sun uses live radii addition private vars
function Start () { // //if live radii in this scene then untag this sun chain circle // if (!LiveRadiiAddition && Camera.main.transform.Find("SunRadiiController").GetComponent(SunRadiiCombine).combine) // { // transform.Find("SunChainCircle").tag = "Untagged"; // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function re(b){this.radius=b}", "function sunTrue() {\n sunNow = true;\n rainingNow = false;\n}", "function te(b){this.radius=b}", "function ne(a){this.radius=a}", "function init() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}", "function init() {\n //this.R = 6370997; //Radius of ...
[ "0.6232849", "0.5988395", "0.5941707", "0.594103", "0.5899624", "0.5899624", "0.5800349", "0.57612216", "0.57609314", "0.5756384", "0.5732318", "0.5717385", "0.56728405", "0.56645197", "0.565656", "0.56243765", "0.56027627", "0.5596331", "0.5596331", "0.55543274", "0.5537299"...
0.6459842
0
analyze line /line eg: 4373:[123.150.182.202] [] [31/May/2013:00:17:12 +0800] [GET /group?frm=one_page HTTP/1.1] [200] [14888] [ [UNTRUSTED/1.0/AJSC/1.5] [] [MEILISHUO_GLOBAL_KEY=ab3bf25040d1b643c13053022385307c; SEASHELL=fMqQCFGnZH2aBkReBRyPAg==; PHPSESSID=q0vuh42bq96mvv1gqk3g6bk202; santorini_mm=411bebf3c708fcdca1b2d...
function analyzeLine(line) { var arr = line.split('] ['); if (arr.length == 1) { return false; } var ret = {}; try{ ret['uid'] = arr[9].split('santorini_mm=')[1].split(';')[0].split('%3b')[0]; //userId }catch(e){ console.log('Error:', line, arr, arr[9]) } getCata(arr[3], ret); //type & catalog & method r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseLine(line){\n var broken = (' '+line).split(/\\s+/);// pad with space, and then split on space\n if(broken[1] == 'top'){ // We've completed a cycle, and can send the data out\n\treturn {trigger:true};\n }else if(broken[1].match(/[0-9]+/)){ // If the first line is an integer, it's new data\n\...
[ "0.6235028", "0.58609605", "0.5694013", "0.56688", "0.56233823", "0.5622608", "0.55916286", "0.5568494", "0.55236346", "0.54829204", "0.5448317", "0.53678334", "0.53388244", "0.52450585", "0.52345484", "0.5212011", "0.5205192", "0.52025235", "0.5186884", "0.51772815", "0.5159...
0.7539748
0
Author: [A.A] Name: _bindDataTypeConnector Description: Binding list connectors Params: None Return: None
function _bindDataTypeConnector() { WinJS.UI.setOptions(lvTypeConnector.winControl, { itemDataSource: new WinJS.Binding.List(DataSourcesHelper.listConnectorsType).dataSource, oniteminvoked: _lvTypeConnectorItemInvoked }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function BindToData() {\n //TableData to hold the sample data\n var sampleDataTable = new Office.TableData();\n //Sample headers\n sampleDataTable.headers = [[\"From Address\", \"To Address\", \"Distance Field\"]];\n //Sample data rows\n sampleDataTable...
[ "0.5929644", "0.55265665", "0.54782283", "0.5338325", "0.532017", "0.5315064", "0.5214082", "0.50698054", "0.50600886", "0.5004025", "0.4944855", "0.49379006", "0.49308583", "0.49169022", "0.4889784", "0.48470792", "0.4844784", "0.4844576", "0.4818254", "0.4803177", "0.478972...
0.81044024
0
Author: [A.A] Name: _lvTypeConnectorItemInvoked Description: click on list connectors Params: Evt click Return: No one
function _lvTypeConnectorItemInvoked(e) { var typeConnector = DataSourcesHelper.listConnectorsType[e.detail.itemIndex].type; var listDoneConnectors = DataSourcesHelper.getDoneConnectors(typeConnector); if (listDoneConnectors.length > 0) { graphInfo.connectorType = typeConnector; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _bindDataTypeConnector() {\n WinJS.UI.setOptions(lvTypeConnector.winControl, {\n itemDataSource: new WinJS.Binding.List(DataSourcesHelper.listConnectorsType).dataSource,\n oniteminvoked: _lvTypeConnectorItemInvoked\n });\n }", "visitElementClicked() {\r\n th...
[ "0.6484457", "0.55194104", "0.5490711", "0.54789853", "0.5474108", "0.526906", "0.5169915", "0.5148395", "0.5116295", "0.5087656", "0.5085373", "0.50732774", "0.50601166", "0.50469077", "0.5039901", "0.5028117", "0.5023653", "0.5000764", "0.4990314", "0.49891654", "0.49717587...
0.79462945
0
Read and reverse content of the text files
async function readReverseWrite(file) { try { const read = await readFileAsync(join(inbox, file), "utf8"); const reverse = await reverseText(read); await writeFileAsync(join(outbox, file), reverse); } catch (error) { throw Error(error); } finally { console.log(`${file} has been processed`); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readFiles() {\n\twordCounter = 0;\n\tfileCounter = 0;\n\tenglish = [];\n\tjapanese = [];\n\tvar reader = new FileReader();\n\t\n\treader.onload = function(e) {\n\t\tvar text = reader.result;\n\t\tvar strings = text.split(\"\\r\");\n\t\tfor (var i = 0; i < strings.length / 2; i++) {\n\t\t\tenglish[wordCoun...
[ "0.5672924", "0.53471625", "0.5329997", "0.52929926", "0.5277092", "0.5171027", "0.51583445", "0.51511574", "0.51343757", "0.50949216", "0.50739825", "0.5054428", "0.5054428", "0.5054428", "0.5054428", "0.5054428", "0.5054428", "0.5054428", "0.5054428", "0.5054428", "0.505395...
0.6196092
0
this function handles the file stl file input using filereader
function handleStlFile(files) { file = files[0] window.stl_reader = {}; if (file) { // check if file is stl file var fileName = file.name; if (fileName.substring(fileName.length - 4,fileName.length) === ".stl") { // read as text -> if file starts with solid, it is ascii format otherwise it is binary va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleTheFile(event) {\n event.preventDefault();\n if (this.inputFile.current.files[0] === undefined) { return; }\n\n // Confirm file extension and read the data as text\n console.log('Reading the file...');\n let fileName = this.inputFile.current.files[0].name;\n if (!fil...
[ "0.69821626", "0.63662726", "0.6329403", "0.6323535", "0.63045996", "0.6273781", "0.61755985", "0.603615", "0.5971503", "0.59656566", "0.5962483", "0.59376526", "0.59162545", "0.59140384", "0.58394563", "0.58332485", "0.58218634", "0.5818848", "0.5810871", "0.5807551", "0.579...
0.67187697
1
} / RID relay. Omit links starting with "javascript", "mailto" get all URL parameters and relay them to all links on the page
function relay_parameters () { parameters = getURLParameters(); $('a[href]:not(a[href^="javascript"]):not(a[href^="mailto"])').each( function () { for (var name in parameters) { var hash = $(this).attr('href').split('#')[1] ? ( '#' + $(this).attr('href').split('#')[1] ) : ''; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function requirement5() {\n var links = document.querySelectorAll(\"div#bottom>a\");\n for (let i = 0; i < links.length; ++i) {\n if (containsLink(links[i], \"http://nhl.com\")) {\n\n links[i].onclick = function (event) {\n event.preventDefault();\n }\n }\n ...
[ "0.6045836", "0.6027682", "0.59733033", "0.5903133", "0.5848907", "0.5833041", "0.58245647", "0.5823972", "0.58147657", "0.5771248", "0.5738219", "0.57293993", "0.570038", "0.56995106", "0.56788546", "0.5665331", "0.56530064", "0.56489265", "0.5648265", "0.5644035", "0.563949...
0.7370682
0
We need to be careful when inserting the closeparen after a function call, since an incorrectlyplaced closeparen can cause a parsing error in the MainStage due to subtle indentation rules in the CoffeeScript parser. In particular, we prefer to place the close paren after an existing } or ], or before an existing ), if ...
insertImplicitCloseParen() { let argListCode = this.slice( this.args[0].contentStart, this.args[this.args.length - 1].contentEnd); let isArgListMultiline = argListCode.indexOf('\n') !== -1; let lastTokenType = this.lastToken().type; if (!isArgListMultiline || lastTokenType === SourceType.RBRACE ||...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendParenTrail(result) {\n var opener = result.parenStack.pop();\n var closeCh = PARENS[opener.ch];\n\n result.maxIndent = opener.x;\n insertWithinLine(result, result.parenTrail.lineNo, result.parenTrail.endX, closeCh);\n result.parenTrail.endX++;\n}", "\n ({\n }) {\n // body\n }"...
[ "0.56993735", "0.5605737", "0.5452262", "0.5347931", "0.53437626", "0.5319262", "0.5285746", "0.5285746", "0.5285746", "0.5285746", "0.5285746", "0.52853984", "0.52814794", "0.5209075", "0.5189992", "0.5164235", "0.5150809", "0.51353586", "0.5123287", "0.5121411", "0.51003754...
0.6397891
0
Get the source index after the function and the question mark, if any. This is the start of the region to insert an openparen if necessary
getFuncEnd() { if (this.node.type === 'SoakedFunctionApplication') { let questionMarkTokenIndex = this.indexOfSourceTokenAfterSourceTokenIndex( this.fn.outerEndTokenIndex, SourceType.EXISTENCE); let questionMarkToken = this.sourceTokenAtIndex(questionMarkTokenIndex); return questionMarkTok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startOfLinePrecedingIndexWithOnlySpaces(source: string, index: number): ?number {\n for (let i = index - 1; i >= 0; i--) {\n switch (source[i]) {\n case ' ':\n case '\\t':\n break;\n\n case '\\n':\n case '\\r':\n return i + 1;\n\n default:\n return null;\n...
[ "0.60354805", "0.5991397", "0.5954803", "0.5951576", "0.58422244", "0.58118904", "0.57751685", "0.57751685", "0.57751685", "0.57751685", "0.57751685", "0.5765492", "0.56588876", "0.5648106", "0.5640499", "0.56361216", "0.56361216", "0.5604777", "0.5592825", "0.54647255", "0.5...
0.60142654
1
if gameCycle is needed in php or other program, then gives it var gameCycle=281100000; // 6506 days, 22:40 (tick in every 100ms)
function getGameCycle(callback) { var request = require("request"); request.post({url:'http://api.ryzom.com/time.php'}, function(err,httpResponse,body){ // console.log("---------------Error--------------" + err); // console.log("---------------Body---------------" + body); // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameProgression() {\n return 1 + (Date.now() - start) / (60 * 1000);\n}", "function getNextTick(){tick = tick +1;return tick;}", "function loop() {\n\tconst time = new Date();\n\tconsole.log(\n\t\t(time.getHours() >>> 0).toString(2).toBit(6), // calc hours\n\t\t(time.getMinutes() >>> 0).toString(2).t...
[ "0.6578598", "0.65701556", "0.63785255", "0.6342928", "0.63265765", "0.62422484", "0.6225959", "0.6149453", "0.6081303", "0.60670435", "0.60663587", "0.6063654", "0.60522276", "0.60438347", "0.6042193", "0.60090613", "0.6005333", "0.6003668", "0.5991447", "0.5954799", "0.5953...
0.67022437
0
Clean up remnents of previous query, then execute next query based on userinput dropdown selection
function setQuery(val) { noerror(); document.getElementById("execute").disabled=true; // try to get handle to a query-specific form we created var paramForm = document.getElementById("form1"); // if it exists, remove it before the next query if (typeof(paramForm) != 'undefined'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setQuery() \n{ \n clearAllDynamicElements();\n \n clearAllEventListeners();\n \n outputElm.innerHTML = \"Results will be displayed here\"; // clear output\n \n var selectedQuery = queryDropdown.options[queryDropdown.selectedIndex].id; \n \n switch(selectedQuery)\n {\n ...
[ "0.61875916", "0.600338", "0.5945451", "0.58962905", "0.57838017", "0.5751795", "0.57081926", "0.557033", "0.5565585", "0.5493962", "0.54837364", "0.5463934", "0.54424363", "0.5409504", "0.5395897", "0.5351715", "0.5348605", "0.5346627", "0.5338039", "0.5325637", "0.5313062",...
0.6614823
0
Retrieves userinput parameter, executes query, and disables the execute button.
function query4() { var param = document.getElementById("form1").elements[0].value; execute("SELECT * FROM Major WHERE MajorID=\"" + param + "\""); // document.getElementById("execute").disabled=true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onQueryTextChange() {\n var queryString = $('#dataBrowserQueryText').val();\n if (!isEmpty(queryString)) {\n enableExecuteBtn(true);\n } else {\n enableExecuteBtn(false);\n }\n}", "function executeQuery() \n {\n var inputs = document.getElementById('Tinput')\n var ...
[ "0.6507909", "0.61985207", "0.59669536", "0.57579213", "0.54252476", "0.5391434", "0.5375775", "0.53440005", "0.5319978", "0.5256128", "0.52076834", "0.5202388", "0.516485", "0.51603734", "0.51116955", "0.5099536", "0.5066053", "0.50407237", "0.5037087", "0.50328344", "0.5025...
0.6645739
0
Create form element for user to input query parameters
function getParam() { // create form element var form = document.createElement("form"); form.setAttribute('id', "form1"); // add text label form.appendChild(document.createElement("br")); var text = document.createElement("strong"); text.innerHTML = "Enter major ID: "; form.appendChild(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function querystring () {\n setFormFields();\n setBookmarkURL();\n form.bookmark.on(\"click focus mouseenter\", setBookmarkURL);\n}", "function addElement(name,value){\r\n\tvar newElement = document.createElement('input');\r\n\tnewElement.setAttribute('type','hidden');\r\n\tnewElement.setAttribute('value',val...
[ "0.6283727", "0.6263288", "0.6220744", "0.61013746", "0.5984991", "0.5979787", "0.595844", "0.5934349", "0.59239584", "0.59079456", "0.5815413", "0.57802", "0.5776328", "0.57500297", "0.57485646", "0.57474685", "0.574328", "0.5730353", "0.57125396", "0.56941974", "0.5672329",...
0.6400845
0
Find LINE Things device using requestDevice()
async function findDevice() { const device = await liff.bluetooth.requestDevice().catch(e => { flashSDKError(e); onScreenLog(`ERROR on requestDevice: ${e}`); throw e; }); // onScreenLog('detect: ' + device.id); try { if (!deviceUUIDSet.has(device.id)) { devic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function describeDevice(yourLine, device) {\n\t\t\tvar typology = device.type + (device.arch? ', ' + '<strong>' + device.arch + '</strong>' : '');\n\t\t\tvar chipDetail = '<em>' + device.chip.replace(\"(tm)\", \"\\u2122\") + '</em>'; // + ' (0x' + device.vendorID.toString(16) + ')';\n\t\t\tvar chipPower = device.c...
[ "0.6309988", "0.6020818", "0.5752192", "0.57103455", "0.56586903", "0.5513269", "0.55087894", "0.5493489", "0.5480155", "0.5462501", "0.5451066", "0.5409506", "0.53895515", "0.53439087", "0.52972317", "0.52751774", "0.5268107", "0.5229603", "0.5224679", "0.5224679", "0.522025...
0.60220325
1
Add device to found device list
function addDeviceToList(device) { onScreenLog('Device found: ' + device.name); const deviceList = document.getElementById('device-list'); const deviceItem = document.getElementById('device-list-item').cloneNode(true); deviceItem.setAttribute('id', device.id); deviceItem.querySelector(".device-id")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDeviceToList(device) {\n onScreenLog('Device found: ' + device.name);\n\n const deviceList = document.getElementById('device-list');\n const deviceItem = document.getElementById('device-list-item').cloneNode(true);\n deviceItem.setAttribute('id', device.id);\n deviceItem.querySelector(\".device-id...
[ "0.7576775", "0.73788965", "0.7253805", "0.71660024", "0.7010141", "0.69242066", "0.6820492", "0.6714192", "0.6529019", "0.6420462", "0.63971627", "0.6354546", "0.62530214", "0.6233765", "0.62004715", "0.61320305", "0.61213136", "0.6078935", "0.607204", "0.60385466", "0.60012...
0.7543056
1
Setup device information card
function initializeCardForDevice(device) { const template = document.getElementById('device-template').cloneNode(true); const cardId = 'device-' + device.id; template.style.display = 'block'; template.setAttribute('id', cardId); template.querySelector('.card > .card-header > .device-name').innerTex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _collectDeviceInfo() {\n _device.deviceClass = \"Handset\";\n _device.id = DeviceInfo.getUniqueID(); // Installation ID\n _device.model = DeviceInfo.getModel();\n }", "function SetupAccountInfoCard(domNode, mode, args) {\n this.domNode = domNode;\...
[ "0.694781", "0.6427494", "0.6382357", "0.6373912", "0.6343925", "0.6343925", "0.6343925", "0.6343925", "0.6343925", "0.6343925", "0.6211107", "0.6069095", "0.6062886", "0.60208", "0.59966075", "0.5982356", "0.59653664", "0.59395504", "0.5928494", "0.59090686", "0.5908261", ...
0.6719614
1
Make your own Swagalerts Title, Text, Button value, (img url), theme color Theme icons from:
function swagAlert (text) { var alertText = text; new SwagIt( 'Alert!', alertText, 'Ok', 'https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/128/bell.png', '#7793C1' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prettyDefault(title, text, html, icon, className) {\n swal({\n title: title,\n text: text,\n content: html,\n icon: icon,\n className: className\n }).then(value => {});\n}", "tag(){return\"simple-colors-shared-styles\"}", "function getButtonTemplate(btnText){va...
[ "0.5989399", "0.5906314", "0.5894785", "0.5867683", "0.586298", "0.5853586", "0.57615435", "0.56757915", "0.5674686", "0.56480587", "0.5646774", "0.5598725", "0.5585433", "0.558367", "0.5569515", "0.5549367", "0.5538626", "0.55323595", "0.5523601", "0.5520879", "0.5511717", ...
0.60896826
0
This method validates that the "Promotion" page is rendered
validatePromotionPage() { return this .assert.urlContains('promotion', '[STEP] - User should be on the promotions page'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePage(){\n\tif(controller == 'shop/'){\n\t$.valid = true;\n\t\t$('div.addressSection').children('div').each(function(){\n\t\t\t$(this).trigger('validate');\n//\t\t\talert('$.valid is '+$.valid);\n\t\t\tif($.valid == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t})\n\t\treturn true;\n\t}\n}", "func...
[ "0.6283204", "0.56253695", "0.5625367", "0.5599215", "0.55765486", "0.5558893", "0.54918283", "0.5464244", "0.54371804", "0.5410163", "0.53990126", "0.5322577", "0.5308278", "0.5293341", "0.5267535", "0.52301335", "0.5221604", "0.5215613", "0.5185265", "0.516043", "0.51238436...
0.69239205
0
Remove the completed post from the queue and send the next one
function postSendComplete() { postQueue.shift(); sendNextPostInQueue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendNextPostInQueue() {\n const nextPostAction = postQueue[0];\n if (nextPostAction) {\n nextPostAction();\n }\n}", "function sendFirstPostInQueue() {\n if (postQueue.length === 1) {\n sendNextPostInQueue();\n }\n}", "function deQueue () {\n var message = qu...
[ "0.7546426", "0.7281861", "0.7202799", "0.7065822", "0.66545504", "0.6552963", "0.65115345", "0.6511022", "0.64827436", "0.64475", "0.6433923", "0.6406788", "0.6358748", "0.63423663", "0.63064694", "0.63064694", "0.63064694", "0.63064694", "0.6292689", "0.6262147", "0.6248104...
0.8651177
0
Start sending posts if a new queue has started
function sendFirstPostInQueue() { if (postQueue.length === 1) { sendNextPostInQueue(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postSendComplete() {\n postQueue.shift();\n sendNextPostInQueue();\n}", "function sendNextPostInQueue() {\n const nextPostAction = postQueue[0];\n if (nextPostAction) {\n nextPostAction();\n }\n}", "async start() {\n if (this.status == QueueStatus.running)\n ret...
[ "0.6928966", "0.68675524", "0.67981184", "0.6560946", "0.6549595", "0.6328108", "0.63202184", "0.6313824", "0.63087225", "0.630513", "0.62074214", "0.62074214", "0.61558825", "0.61056876", "0.6100087", "0.60532767", "0.6020954", "0.59974396", "0.5993072", "0.59927815", "0.598...
0.7487947
0
Send the next post in the queue if there is one
function sendNextPostInQueue() { const nextPostAction = postQueue[0]; if (nextPostAction) { nextPostAction(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendFirstPostInQueue() {\n if (postQueue.length === 1) {\n sendNextPostInQueue();\n }\n}", "function postSendComplete() {\n postQueue.shift();\n sendNextPostInQueue();\n}", "function nextInQueue() {\n if (!processing) {\n processing = true;\n rsmq.popMessage({ qname: name }, ...
[ "0.85527515", "0.7916916", "0.7268176", "0.67254734", "0.6604901", "0.6561227", "0.6515352", "0.63909745", "0.6321988", "0.6240836", "0.6231612", "0.6096114", "0.6089102", "0.6083373", "0.60705537", "0.5980607", "0.59770864", "0.5972891", "0.59127355", "0.59102446", "0.589725...
0.8834721
0
Get category id with all subcategories ids
getAllIds() { return [this.id, ...this.subCategories.map(cat => cat.getAllIds()) .reduce((res, idsList)=>res.concat(idsList), [])]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCategoryIds() {\n let ids = [];\n categories.forEach(cat => ids.push(cat.id));\n\n return ids;\n}", "async getCatToSub(_, { categoryId }) {\n try {\n const subcategories = await Subcategory.find({ category: categoryId });\n return subcategories;\n } catch (error) {\n ...
[ "0.67230016", "0.64371824", "0.64174145", "0.62415", "0.62203026", "0.61800516", "0.61737776", "0.6138923", "0.6122704", "0.59784305", "0.5909625", "0.59075046", "0.5889706", "0.5833037", "0.5826646", "0.5806057", "0.57939506", "0.57921547", "0.5752873", "0.5696591", "0.56959...
0.7671645
0
function to create database connection and return promises for close and query methods
function makeDb() { const connection = mysql.createConnection(config); console.log('Connection successful at ' + config.port); return { query(sql, args) { return util.promisify(connection.query) .call(connection, sql, args); }, close() { retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDb() {\n const connection = mysql.createConnection(config);\n return {\n query(sql, args) {\n return util.promisify(connection.query).call(connection, sql, args);\n },\n close() {\n return util.promisify(connection.end).call(connection);\n },\n };\n}", "function getConnectio...
[ "0.76982796", "0.7478715", "0.7472248", "0.74195", "0.7390315", "0.7300002", "0.7285556", "0.72839427", "0.72825944", "0.7138681", "0.7135128", "0.71265", "0.7096758", "0.70617545", "0.70457685", "0.6957735", "0.6945698", "0.69305104", "0.69246584", "0.6872215", "0.6851814", ...
0.7830178
0
Constructs a new MatchScoreBreakdown2017Alliance.
constructor() { MatchScoreBreakdown2017Alliance.initialize(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(teamNumber, matchNumber, alliance, games=null) {\n\t\tthis.teamNumber = teamNumber;\n\t\tthis.matchNumber = matchNumber;\n\t\tthis.alliance = alliance;\n\t\tthis.games = games;\n\t}", "constructor() { \n \n MatchTimeseries2018.initialize(this);\n }", "static createInstance(owner, p...
[ "0.5408584", "0.5396425", "0.49520248", "0.49387345", "0.4685454", "0.46339446", "0.45297503", "0.452194", "0.45123848", "0.4507484", "0.44900793", "0.44746584", "0.44733468", "0.44629392", "0.44068643", "0.43693557", "0.43660337", "0.4361187", "0.4338409", "0.43291634", "0.4...
0.7654218
0
set the background color and opacity
background(color, alpha = 1.0) { this.bgLayout['fill'] = color; this.bgLayout['fill-opacity'] = alpha; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "MainBackgroundColor(r, g, b, alpha) {\n this._r = r;\n this._g = g;\n this._b = b;\n this._alpha = alpha;\n }", "function set_background (r, g, b) {\r\n red = r;\r\n green = g;\r\n blue = b;\r\n}", "set backgroundColor(value) {}", "function colorBackground() {\r\n\t\r\n\t\t/...
[ "0.71526074", "0.7086608", "0.6968575", "0.6927445", "0.6832487", "0.6806461", "0.677345", "0.67693466", "0.6747951", "0.6667763", "0.6667763", "0.66392946", "0.66383904", "0.66303694", "0.66064674", "0.6604366", "0.65861434", "0.6579417", "0.6574172", "0.6535015", "0.6532459...
0.7227677
0
This is needed since the default functionality of a check box is triggered with the space bar
function ARIA_Checkbox_Key(event) { if(event.keyCode == 32){ toggleState(event.target) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SpaceToggle() {\n return (\n <input type=\"checkbox\" name=\"name\" id=\"id\" onClick={() => console.log(\"switch!\")}/>\n)\n}", "relocation_tickCheckBox() {\n return relocationCheckBox.click();\n }", "function checkBox(checkbox){\r\n\t\tcheckbox.checked=true;\r\n\t\ttriggerEvent(checkbo...
[ "0.6555162", "0.64107025", "0.6404488", "0.63782895", "0.63077897", "0.6281235", "0.62805855", "0.6252823", "0.6252823", "0.6236091", "0.61766756", "0.6132592", "0.6132063", "0.61277837", "0.6115808", "0.61106724", "0.61083657", "0.6094079", "0.6082066", "0.6048308", "0.60411...
0.65489274
1
The checks should be done very fast and efficiently. There is throttling mechanism to check only every 'interval' milliseconds where a watchdog event is set about 1/2 of the period to check if something happened while we have been skipping the events. If the resize or scroll event comes back it clears the timer. There ...
function check (event ){ clearTimeout(timer); var nowTS = new Date().getTime(), window_height = $window.height(), t; if( event && event.type == 'resize' ){ lastWindowHeight = lastScrollTop = 0; // new window size. check check timer = setTimeout( ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function softPoll() {\n var readyState = page.evaluate(function () {\n return document.readyState;\n });\n\n if (readyState === \"complete\") {\n process();\n } else {\n setTimeout(softPoll);\n }\n }", "function throttledScrollEvents() {\n\n }", "function onPageChange(page) {\...
[ "0.57200533", "0.5719546", "0.56978023", "0.5654917", "0.5653222", "0.56340533", "0.54967105", "0.54797226", "0.54523355", "0.5425625", "0.5418305", "0.5417918", "0.53948885", "0.5375198", "0.5367233", "0.5358055", "0.5353152", "0.5337246", "0.5294382", "0.5288327", "0.528808...
0.7696017
0
Featherlight Uses element selector to apply given content, so that element clicked triggers content lightbox
function applyFeatherlight(element, content) { // $('.myElement').featherlight($content, configuration); //console.log( `featherlight trigger: ${ element }, ${ content }` ); $(element).featherlight(content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function news_photo() {\n\n\t$(\".canhcam-news-photo-1 .box-zoom\").lightGallery({\n\t\tthumbnail: true,\n\t\tselector: 'a'\n\t});\n\n\t// $('.canhcam-news-photo-1 .wrapper-gallery').each(function() {\n\t// \t$(this).click(function() {\n\t// \t\t$(this).find('.hidden a:first-child').trigger('click')\n\t// \t})\n\...
[ "0.60946757", "0.5660406", "0.5593626", "0.5560889", "0.55466634", "0.5370539", "0.5336215", "0.5299095", "0.5268131", "0.5264784", "0.5261631", "0.52128345", "0.521201", "0.521082", "0.52092284", "0.5187441", "0.51857907", "0.5174097", "0.51640606", "0.5153438", "0.5147954",...
0.75941294
0
init video lightbox within glide gallery. Slide must contain selector '.videolauncher'
function initVideoLightbox() { var videoSlides = $('.video-launcher'); if (videoSlides.length > 0) { for (var i = 0; i < videoSlides.length; i++) { var slide = $(videoSlides[i]); var videoUrl = slide.attr('data-video'); var videoHtml = "<div class=\"lightbox-content\">\n\t\t\t\t<video id=\"vi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startLightBox() {\n $('img').click(function(event){\n \n //grab videoID of video\n var theVideoIDcurrent = $(this).attr('value');\n console.log(theVideoIDcurrent);\n \n //cue up lightbox container and background\n var lbBg = document.getElementById(\"lig...
[ "0.65422344", "0.6531272", "0.64736986", "0.62274086", "0.62245655", "0.6153425", "0.6143487", "0.611022", "0.6106654", "0.6104712", "0.604099", "0.60295355", "0.6026369", "0.6025398", "0.6015223", "0.601198", "0.5998497", "0.5975734", "0.59722036", "0.59533954", "0.59490705"...
0.78341407
0
build the cart item to create order
function BuildCartItemToCreateOrder(props) { return ( { 'item_id': props.item.id , 'price':parseInt(props.item.price) , 'quantity': props.quantity } ) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemToCart() {}", "function addItemToCart() {}", "function _generateNewOrder() {\n var products = _($scope.items).map(function (k, v) {\n return { id: k.Product.Id, qty: k.Qty };\n });\n\n var result = {\n salutation: $scope.title,\n firstname: ...
[ "0.6692592", "0.6692592", "0.6608167", "0.6522407", "0.64253217", "0.6360524", "0.6307738", "0.62884384", "0.6274677", "0.6265268", "0.6243615", "0.62200624", "0.6189824", "0.617874", "0.61733633", "0.6154671", "0.6144479", "0.6140342", "0.6129103", "0.6128202", "0.6107679", ...
0.78512675
0
prints out "Hi, my name is Sophia Sangervasi"
function myName(){ var Sophia = "Hi, my name is Sophia Sangervasi"; console.log(Sophia); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function demoName(name){\n\n console.log(\"Name is : \", name);\n console.log(`\n Hello there!!!, ${name}...\n\n How are you?\n It's been a long while since I have seen you ${name}\n `);\n}", "function greeting(name){\n\treturn \"sup fam \" + name\n}", "function sayName(name) {\n console.log...
[ "0.71053565", "0.701893", "0.6918932", "0.690441", "0.6901058", "0.6869614", "0.68250644", "0.68162805", "0.6788191", "0.6776381", "0.6776381", "0.6776381", "0.6776381", "0.6759884", "0.6759186", "0.67466336", "0.6746272", "0.67430204", "0.67384887", "0.67355806", "0.6732171"...
0.73009706
0
When redactor's content updates, we have to change the model
function syncModel() { //if the change was caused by us syncing to redactor, we dont need to trigger another sync if (scope.$$phase) { return; } redactorSync = true; scope.$apply(function() { var markdown = rem.render(red.get()); ngModel.$setViewValue(markdown); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateContentsModel(model) {\n const newModel = {\n path: model.path,\n name: model.name,\n type: model.type,\n content: undefined,\n writable: model.writable,\n created: model.created,\n last_modified: model.last_modified,\n ...
[ "0.6631325", "0.65774816", "0.65640044", "0.6522582", "0.6373117", "0.635485", "0.6352036", "0.62295026", "0.6215536", "0.6178579", "0.611568", "0.6102893", "0.60967696", "0.6095759", "0.6059966", "0.60396004", "0.6015308", "0.6003319", "0.6000698", "0.6000698", "0.6000698", ...
0.6879434
0
Map over dominoes and render a Domino component for each domino object
render() { return ( <Wrapper> <Title message={ this.state.message } score={ this.state.score } topScore={ this.state.topScore }>Domino Memory Challenge </Title> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderMonsters(monsters){\n const monsterContainer = document.getElementById(\"monster-container\")\n \n monsters.forEach(monster => {\n const monsterDiv = document.createElement(\"div\")\n monsterDiv.innerHTML = \n `<h2>Name: ${monster.name}</h2>\n <h4>Age: ${monster.age}</...
[ "0.5822228", "0.57884777", "0.57562536", "0.5675809", "0.5656147", "0.5640759", "0.56394756", "0.5623779", "0.5617434", "0.5559354", "0.5558566", "0.55310595", "0.5506687", "0.54945374", "0.54925674", "0.5460782", "0.5457362", "0.5449459", "0.54245365", "0.5421998", "0.540660...
0.6339228
0
get dot color based on win
function getDotColor(data) { if (1 === data["win"]) { return dot_win_color; } return dot_lose_color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDotHoverColor(data) {\n if (1 === data[\"win\"]) {\n return dot_win_color_brighter;\n }\n return dot_lose_color_brighter;\n }", "static get INACTIVE_COLOR() { return [128, 128, 128, 100]; }", "selectColor(x, y, wd, ht){\n this.colorSec =...
[ "0.7544976", "0.63759214", "0.58775574", "0.5800551", "0.57561547", "0.57389295", "0.57378316", "0.5708834", "0.57069093", "0.56738645", "0.5672383", "0.5642844", "0.56376165", "0.5615995", "0.5610761", "0.56002605", "0.5600014", "0.5575707", "0.55753136", "0.55458015", "0.55...
0.82516533
0
get dot hover color based on win
function getDotHoverColor(data) { if (1 === data["win"]) { return dot_win_color_brighter; } return dot_lose_color_brighter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDotColor(data) {\n if (1 === data[\"win\"]) {\n return dot_win_color;\n }\n return dot_lose_color;\n }", "function _getHoverStyle() {\n return {\n weight: 2,\n fillOpacity: 0.2\n };\n }", "getHovered() {}", "getHove...
[ "0.7702106", "0.604379", "0.5862133", "0.581501", "0.58095247", "0.57690257", "0.5738496", "0.5721008", "0.57198286", "0.57173353", "0.56890327", "0.5681418", "0.5675103", "0.5649182", "0.5612488", "0.5582088", "0.5518315", "0.5518315", "0.5506554", "0.5502277", "0.54794544",...
0.834481
0
Cloes the webview, kill the port, dispose the terminal.
function bug_report_stop(){ if(panel!=null){ panel.dispose();//CLose this webview. panel = null;//Reset the panel. let terminal = this.get_terminal("bug_report");//Get or Create a terminal terminal.show(true);//Show commands in the terminal terminal.dispose();//Dispose this t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _close(){\n $.webview.url = \"\";\n $.win.close();\n}", "destroy() {\n this.disposables.dispose();\n this.controlView.destroy();\n this.extensionView.destroy();\n this.fileView.destroy();\n this.contentView.destroy();\n this.element.remove();\n // Do not stop external process.\n ...
[ "0.7003507", "0.6512217", "0.6442009", "0.636577", "0.6207521", "0.6188826", "0.6142087", "0.6038587", "0.603513", "0.59205973", "0.5915028", "0.590074", "0.5893992", "0.58700395", "0.58676857", "0.5853674", "0.58518714", "0.5833336", "0.5789503", "0.578168", "0.5723639", "...
0.6648408
1
Moviment Elements Funcio encarregada d'assignar una nova direccio a un fantasma Comprova les direccions a les que pot anar un fantasma En cas d'estar a una cruilla tria una direccio que no sigui l'actual a la inversa En el cas d'una paret, que trii qualsevol
function novaDireccioFantasma(fantasma) { var trobada = false; var novaDir; var aux; var numDir = 0; comprovarDireccions(fantasma, direccions); //calculem el numero de direccions possibles for (var i = 1; i < 5; i++) { if (direccions[i] == 1) numDir++; } //en el cas d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copiafyv(principal, copia) {\n try {\n /*Analizo primero el root principal */\n principal.lista_Nodo.forEach(function (element) {\n if (element.tipo == \"Clase\") {\n MYFPrincipal = [];\n MYFfCopia = [];\n /*por cada calse encontrada...
[ "0.6738551", "0.6690493", "0.6607357", "0.6323743", "0.63063115", "0.6306307", "0.6164285", "0.61340857", "0.6079179", "0.6056559", "0.6034036", "0.6029198", "0.60243624", "0.598334", "0.59075445", "0.5889915", "0.58690095", "0.58512425", "0.5836209", "0.58350027", "0.5829034...
0.68106025
0
Funcio encarregada de comprovar totes les direccions a les que pot anar un element Per a cada direccio, comprova si la seguent posicio es valida i, per tant, la direccio en la que se situa aquella posicio respecte l'element Retorna l'array direccions completat
function comprovarDireccions(element, direccions){ var x = element[2]; var y = element[1]; //comprovem si podem anar a cada una de les direccions if (comprobarPosicio(x + 1, y) != 0) direccions[1] = 1; else direccions[1] = 0; if (comprobarPosicio(x, y + 1) != 0) direccions[2] = 1; else dire...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function novaDireccioFantasma(fantasma) {\n var trobada = false;\r\n var novaDir;\r\n var aux;\r\n var numDir = 0;\r\n\r\n comprovarDireccions(fantasma, direccions);\n\n //calculem el numero de direccions possibles\n for (var i = 1; i < 5; i++) {\n if (direccions[i] == 1) numDir++;\n ...
[ "0.6512088", "0.6470447", "0.6311924", "0.6281096", "0.61856645", "0.59214234", "0.58562875", "0.58410704", "0.56609845", "0.5644196", "0.56424904", "0.56258273", "0.56159735", "0.56082416", "0.55962265", "0.5555072", "0.55352885", "0.54904556", "0.54746246", "0.5469702", "0....
0.7333629
0
Funcio encarregada de moure el jugador Comprovar que la direccio introduida sigui valida i assignarla al jugador En el cas de que no sigui valida, seguira en la mateixa direccio o es quedara quiet contra la paret.
function novaDireccioJugador(jugador){ comprovarDireccions(jugador, direccions); if(direccions[keyPress] == 1){ jugador[3] = keyPress; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moureJugador(jugador) {\n novaDireccioJugador(jugador);\n\n if (jugador[3] == 1 && tauler[jugador[2] + 1][jugador[1]] != 0) {\n tauler[jugador[2]][jugador[1]] = 1;\n //guardem les posicions antigues per comprovar colisions\n jugador[5] = jugador[1];\n jugador[6] = jugador...
[ "0.57809687", "0.56881535", "0.56881535", "0.5559768", "0.55559796", "0.55068374", "0.5487747", "0.54469675", "0.5433077", "0.5401445", "0.5370887", "0.5343567", "0.5339945", "0.531664", "0.5315409", "0.53053373", "0.530335", "0.52960926", "0.5295139", "0.529337", "0.5289093"...
0.61267537
0
End Game Funcio encarregada d'acabar el joc si se supera el temps limit Quan el temps passa un cert valor es marca guanyat com a true
function comprovarTemps(tempsJoc) { if (tempsJoc >= 600) { clearTimeout(iterar); document.getElementById("resultat").innerHTML = "You win!"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endGame(){\n if (parties == maxParties){\n hasFinished = true;\n document.getElementById(\"score\").innerText = \"score :\" + points + \"/20\";\n if (points<=8) {\n document.getElementById(\"phrasescore\").innerText = \"T'es un noob !\";\n }\n if ((points>=9) && (points<=16)...
[ "0.6389912", "0.63472426", "0.63370323", "0.629321", "0.6193241", "0.6167422", "0.6126847", "0.61015105", "0.6099374", "0.60739934", "0.60649157", "0.60605496", "0.6059915", "0.6058857", "0.6054557", "0.60192674", "0.601665", "0.5987977", "0.5985582", "0.598056", "0.5971672",...
0.64448845
0
Funcio encarregada d'acabar el joc si es produeix una colisio Acaba el joc quan un jugador i un fantasma estan a la mateixa casella TODO: Acaba el joc quan un jugador i un fantasma es creuen
function comprovarColisio(fantasma) { var perdut = false; //Fantasma i jugador en una diferencia imparella de posicions de distancia if (tauler[fantasma[2]][fantasma[1] + 1] == 2) { clearTimeout(iterar); perdut = true; } if (tauler[fantasma[2]][fantasma[1] - 1] == 2) { clearT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comprobarCajas() {\n\n for (let i = 2, posCaja = 0; i < mapa.length; i += 3)\n for (let j = 1; j < mapa[0].length; j += 4, posCaja++)\n if (!cajasDescubiertas[posCaja] && mapa[i][j].classList.contains('caja'))\n if (cajaRodeada(i, j)) {\n\n cajasDescu...
[ "0.6808905", "0.6581893", "0.6576472", "0.6492633", "0.6409425", "0.6389364", "0.63884115", "0.6356975", "0.6355862", "0.63091797", "0.6286105", "0.62824154", "0.6281471", "0.62668574", "0.62443674", "0.62424445", "0.6221585", "0.61896545", "0.6182592", "0.61782634", "0.61680...
0.6829704
0
adds nearest beat to the array
function add (beat = songManager.getNearestBeat()) { if ( !editor.beatArray.includes(beat) ) editor.beatArray.push(beat) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateNearest() {\n this._sources = this._sources.sort((a, b) => {\n return ( this.p.dist(this.pos.x, this.pos.y, a.pos.x, a.pos.y) - this.p.dist(this.pos.x, this.pos.y, b.pos.x, b.pos.y));\n });\n \n if (this.nearest != this._sources[0]) {\n this.nearest = this._sources[0];\n }\n }", "...
[ "0.63159776", "0.58573616", "0.557353", "0.55731684", "0.5408947", "0.5368931", "0.5353575", "0.5350959", "0.5247897", "0.524445", "0.5228253", "0.5162166", "0.5144648", "0.5143813", "0.51400477", "0.51224506", "0.5119593", "0.5112059", "0.50730026", "0.5069781", "0.5064844",...
0.62443316
1
bezierclass takes in 4 points and calculates the exact coordinates for the idx adapted from Bezier formulas shown on this page
function Bezier(idx, p0, p1, p2, p3){ var cX = 3 * (p1.x - p0.x); var bX = 3 * (p2.x - p1.x) - cX; var aX = p3.x - p0.x - cX - bX; var cY = 3 * (p1.y - p0.y); var bY = 3 * (p2.y - p1.y) - cY; var aY = p3.y - p0.y - cY - bY; //x(t) = axt3 + bxt2 + cxt + x0 this.x = (aX * Math.pow(idx, 3)) + (bX * Math.po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bezier() {\n\n ctx = this;\n ctx.lineWidth = this.curve_thickness;\n ctx.strokeStyle = this.bezier_color;\n /**check for correct number of arguments*/\n if (arguments.length % 2 != 0 || arguments.length < 4) {\n throw \"Incorrect number of points \" + arguments.length;\n }\n\n ...
[ "0.7020775", "0.6918806", "0.6890063", "0.66896147", "0.6620978", "0.6554794", "0.65440035", "0.6527247", "0.64931816", "0.6404813", "0.6396375", "0.6374201", "0.6324657", "0.63170594", "0.6256384", "0.62527376", "0.6236807", "0.6181221", "0.6154341", "0.6132404", "0.61236143...
0.7853001
0
Set current "circuit" to that of some "gate" and update the interface for the new circuit.
editCircuit(gate) { this.circuit = gate.circuit; this.editor.resize(gate.circuit.nqubits, this.editor.length); document.querySelector('#nqubits > span').innerHTML = 'Qubits: ' + this.circuit.nqubits; if (gate.input) { this.editor.input = gate.input; } this.edi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setWireFromGateToGate(gate, start, end, pluginNum) {\n\t\tstart = start.getPoints()[1];\t\t\t\t\t\t\t\t\t\t// the end point of the start line\n\t\tend = end.getPoints()[0];\t\t\t\t\t\t\t\t\t\t\t// the start point of the end line\n\t\tpoints = getWirePoints(start, end);\t\t\t\t\t\t\t\t\t// compute the wire...
[ "0.62800074", "0.6227573", "0.6084165", "0.55650634", "0.52121824", "0.49277806", "0.4911111", "0.49057782", "0.4871005", "0.4855844", "0.4830726", "0.47858068", "0.47419757", "0.47208747", "0.46999273", "0.4596491", "0.45829085", "0.45796287", "0.45776856", "0.45601863", "0....
0.6737873
0
Add a button for a gate to the toolbar. "type" should be either "std" or "user" (where "std" is a standard gate and "user" is a usercreated gate) "name" is the name of the gate used by the workspace "title" is a humanreadable name for the gate
addToolbarButton(type, name, title) { const canvas = document.createElement('canvas'); const draw = new Draw(canvas, 1, 1); const tool = document.createElement('div'); tool.dataset.type = name; tool.className = "gate"; tool.title = title || ''; draw.clear(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createButton (action, name) {\n var button = document.createElement('button');\n button.innerHTML = name;\n button.setAttribute('id', action);\n document.getElementById('visualizer').appendChild(button);\n}", "function createToolbarButton(options, enableActions, enableTooltips, shortcuts, markup, pa...
[ "0.64439106", "0.6113257", "0.6102649", "0.60061264", "0.59605366", "0.5944772", "0.5876669", "0.58588725", "0.58444315", "0.5834751", "0.58177084", "0.5750279", "0.5717784", "0.5677806", "0.5628852", "0.5619973", "0.5614126", "0.5605021", "0.55873823", "0.55779487", "0.55726...
0.7939539
0
Return object representation of workspace capable of being exported to JSON.
exportWorkspace() { const workspace = this.workspace; this.circuit.gates.sort((a, b) => a.time - b.time); const gates = []; for (let key in workspace.gates) { const gate = workspace.gates[key]; if (gate.std) { continue; } ga...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJSON() {\n const result = toJSONImpl(this.root, true);\n result.dimensions = this.dimensions;\n return result;\n }", "toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n ...
[ "0.6320396", "0.6206941", "0.6206941", "0.620247", "0.6188783", "0.6184959", "0.6018251", "0.601134", "0.6011163", "0.5966134", "0.58933127", "0.5888431", "0.5878052", "0.58455473", "0.58399856", "0.58223104", "0.57947505", "0.5781814", "0.5781814", "0.57510084", "0.57276386"...
0.7125915
0
Asynchronously compile every user defined gate in the workspace.
compileAll() { const app = this; const todo = []; const workspace = this.workspace; document.querySelectorAll('#toolbar .user div.gate').forEach(el => { const type = workspace.gates[el.dataset.type]; if (!type.matrix) { todo.push(type); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async compileAll() {\n await this.init();\n\n this.collectedComponents = new Map;\n this.componentsList = this.components.componentsList;\n this.attributesList = this.attributes.attributesList;\n this.bulkAttributesList = this.attributes.bulkAttributesList;\n\n for (let se...
[ "0.6835307", "0.6097486", "0.5414212", "0.5380007", "0.5215216", "0.52148795", "0.5202443", "0.5122592", "0.51202065", "0.5111723", "0.51059234", "0.5077956", "0.50388694", "0.5026905", "0.5007665", "0.49367583", "0.4930916", "0.49198905", "0.48890862", "0.4868543", "0.485257...
0.7601143
0
renders the list of potentials as well contains an onClick even listener
renderPotentials() { const { potentials } = this.state; if (potentials.length === 0) { return null; } return ( <ul className="suggested-list"> {potentials.map(potential => ( <li className="suggested-list-item" onClick={() => this.handleOnClick(potent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <ul>\n {this.props.models &&\n this.props.models.map((model, i) => (\n <li\n key={`models-${i}`}\n onClick={() => {\n this.selectModel(model);\n }}\n >\n <span style={styles.clic...
[ "0.64658463", "0.6373884", "0.63131225", "0.62746584", "0.6163264", "0.61385304", "0.6082443", "0.6068814", "0.60658675", "0.6059885", "0.60543585", "0.6039285", "0.59732616", "0.5964234", "0.59570605", "0.5954592", "0.5938636", "0.59278715", "0.5915679", "0.5891857", "0.5891...
0.79772335
0