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
Adds a new item of the given type to the currently edited menu (or to the menu overview).
_addDefaultItem(type) { const config = ItemRegistry.createDefaultConfig(type); // Assign a new ID for top-level items. if (this._menuPath.length == 0) { config.id = this._getNewID(); config.shortcut = ''; } else { config.angle = -1; } // Append to the current item list....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItem(type, index) {\n inventory[type].push(itemList[type][index]);\n save()\n}", "function addItem() {}", "function addMenu(data) {\n console.log(` Adding: ${data.menuItemName}`);\n Menu.insert(data);\n}", "function append(menu, item){\n if(item.checked && menu.selectedItem == null){\...
[ "0.6916491", "0.685179", "0.6713588", "0.6670753", "0.6507832", "0.647837", "0.64750355", "0.64148724", "0.6404132", "0.63570434", "0.6307342", "0.6246253", "0.6217439", "0.6215497", "0.6156097", "0.6154689", "0.6148901", "0.61469537", "0.61365527", "0.6133463", "0.61065865",...
0.73273736
0
Adds an item based on the given config at the specified index to the menu editor. It will be the selected item; the sidebar widgets will be updated to reflect the item configuration. Its fixed angle is reset to prevent invalid configurations.
_addItem(config, where) { config.angle = -1; this._editor.addItem(config, where); this._selectedItem = config; this._getCurrentConfigs().splice(where, 0, config); this._updateSidebar(); this._saveMenuConfiguration(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addItemAsChild(config, where) {\n config.angle = -1;\n const parent = this._getCurrentConfigs()[where];\n parent.children.push(config);\n this._selectedItem = parent;\n this._updateSidebar();\n this._saveMenuConfiguration();\n }", "_gotoMenuPathIndex(index) {\n if (index + 1 >= this._menuP...
[ "0.650281", "0.5760093", "0.5723964", "0.5643599", "0.54033124", "0.52024484", "0.5139419", "0.50321716", "0.50186455", "0.498111", "0.4972175", "0.49700963", "0.49635196", "0.49555027", "0.49376976", "0.49277484", "0.4923858", "0.49153265", "0.48887518", "0.48681182", "0.485...
0.7841348
0
Adds an item based on the given config as child of the item at the specified index. The parent item will be the selected item; the sidebar widgets will be updated to reflect the item configuration. Its fixed angle is reset to prevent invalid configurations.
_addItemAsChild(config, where) { config.angle = -1; const parent = this._getCurrentConfigs()[where]; parent.children.push(config); this._selectedItem = parent; this._updateSidebar(); this._saveMenuConfiguration(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addItem(config, where) {\n config.angle = -1;\n this._editor.addItem(config, where);\n this._selectedItem = config;\n this._getCurrentConfigs().splice(where, 0, config);\n this._updateSidebar();\n this._saveMenuConfiguration();\n }", "addChildAt(child, index) {\n const numChildren = this._...
[ "0.6586805", "0.57656276", "0.537319", "0.53460205", "0.5324167", "0.5295237", "0.5172955", "0.5107991", "0.51062334", "0.50721735", "0.5012872", "0.5000514", "0.49805415", "0.49742404", "0.49733478", "0.48852167", "0.4865293", "0.48620477", "0.48313144", "0.48301712", "0.482...
0.76327115
0
Returns the configurations of the items which are currently displayed in the menu editor.
_getCurrentConfigs() { if (this._menuPath.length == 0) { return this._menuConfigs; } return this._menuPath[this._menuPath.length - 1].children; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_loadMenuConfiguration() {\n\n // Clear any previous selection.\n this._menuPath = [];\n\n // Load the menu configuration in the JSON format.\n this._menuConfigs = JSON.parse(this._settings.get_string('menu-configuration'));\n\n for (let i = 0; i < this._menuConfigs.length; i++) {\n\n // Make s...
[ "0.65470725", "0.6378662", "0.63214225", "0.6227243", "0.619207", "0.619207", "0.6143397", "0.59497976", "0.5802475", "0.5747497", "0.572085", "0.5648372", "0.5642216", "0.56184566", "0.56124705", "0.56113595", "0.5574313", "0.5527154", "0.5510722", "0.54395854", "0.5432966",...
0.73043567
0
Computes the angle of the current center item relative to its parent menu.
_getCurrentParentAngle() { if (this._menuPath.length <= 1) { return undefined; } let itemAngles = utils.computeItemAngles(this._menuPath[0].children); // Iterate through the menu path from start to end. for (let i = 1; i < this._menuPath.length; i++) { let parentAngle = itemA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "absoluteAngle() {\n if (this.parentTransform == null) {\n return this.angle\n } else {\n return this.angleAdd(this.angle, this.parentTransform.absoluteAngle())\n }\n }", "static angle (initialPoint, currentPoint) {\n let [a, b] = Ballistics.getSides(initialPoint, currentPoint)\n\n retur...
[ "0.65398216", "0.651042", "0.62405163", "0.61781144", "0.6163185", "0.6115271", "0.6063515", "0.6023679", "0.6017631", "0.6015278", "0.6011321", "0.59598404", "0.5948555", "0.59422314", "0.59085226", "0.5903305", "0.586404", "0.58503485", "0.5846379", "0.57930267", "0.5793026...
0.7448765
0
This returns an integer > 0 which is not used as menu ID currently.
_getNewID() { let newID = -1; let isInUse = false; do { ++newID; isInUse = false; for (let i = 0; i < this._menuConfigs.length; i++) { if (this._menuConfigs[i].id != undefined && this._menuConfigs[i].id == newID) { isInUse = true; break; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getID() {\n return this._menuID;\n }", "function getCurrentId()\n{\n\treturn parseInt($('section').filter(function(){ return $(this).css('display') != 'none'; }).attr('id').substring(8));\n}", "function GetMenuId (Index)\n{\n var MenuId = \"\";\n switch(Index)\n {\n case 0:\n Men...
[ "0.67031074", "0.63963836", "0.62129253", "0.6061529", "0.6013329", "0.5989406", "0.58516383", "0.5762941", "0.5730787", "0.5730293", "0.5708821", "0.5678476", "0.5568337", "0.5565742", "0.55564296", "0.5549726", "0.54929245", "0.5490966", "0.54750484", "0.54730177", "0.54682...
0.6998396
0
This is called once initially and loads the JSON menu configuration from the settings key "menuconfiguration". This may throw an exception if the currently stored menu configuration is invalid.
_loadMenuConfiguration() { // Clear any previous selection. this._menuPath = []; // Load the menu configuration in the JSON format. this._menuConfigs = JSON.parse(this._settings.get_string('menu-configuration')); for (let i = 0; i < this._menuConfigs.length; i++) { // Make sure that all fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_saveMenuConfiguration() {\n\n // The configuration changed again. Cancel any pending save tasks...\n if (this._saveSettingsTimeout != null) {\n GLib.source_remove(this._saveSettingsTimeout);\n this._saveSettingsTimeout = null;\n }\n\n // ... and launch a new one.\n this._saveSettingsTimeo...
[ "0.6605736", "0.63995767", "0.6392303", "0.6263259", "0.6235861", "0.619584", "0.6140195", "0.5978404", "0.5932776", "0.5924227", "0.58448374", "0.5828924", "0.57446635", "0.57428056", "0.57361", "0.573349", "0.57171303", "0.5709413", "0.5692608", "0.56873304", "0.564003", ...
0.84776014
0
This is called once initially and loads the JSON item configurations from the settings key "stasheditems". This may throw an exception if the stored item configuration is invalid.
_loadStashConfiguration() { // Load the menu configuration in the JSON format. this._stashedConfigs = JSON.parse(this._settings.get_string('stashed-items')); // And all stashed items to the stash widget. for (let i = 0; i < this._stashedConfigs.length; i++) { this._addStashWidget(this._stashedCo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_saveStashConfiguration() {\n\n // The configuration changed again. Cancel any pending save tasks...\n if (this._saveStashTimeout != null) {\n GLib.source_remove(this._saveStashTimeout);\n this._saveStashTimeout = null;\n }\n\n // ... and launch a new one.\n this._saveStashTimeout = GLib.t...
[ "0.62059677", "0.5685752", "0.55424905", "0.54603976", "0.544743", "0.537046", "0.5287151", "0.52821136", "0.52742106", "0.5269157", "0.5237399", "0.5229813", "0.5195673", "0.5193923", "0.51858443", "0.5180638", "0.51744384", "0.5150094", "0.51204574", "0.5111337", "0.5109747...
0.7331766
0
This stores a JSON representation of the current configuration in the "menuconfiguration" key of the application settings. This is called whenever something is changed in the sidebar. It does not update the settings instantaneously, it rather waits a few milliseconds for any additional changes.
_saveMenuConfiguration() { // The configuration changed again. Cancel any pending save tasks... if (this._saveSettingsTimeout != null) { GLib.source_remove(this._saveSettingsTimeout); this._saveSettingsTimeout = null; } // ... and launch a new one. this._saveSettingsTimeout = GLib.time...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_loadMenuConfiguration() {\n\n // Clear any previous selection.\n this._menuPath = [];\n\n // Load the menu configuration in the JSON format.\n this._menuConfigs = JSON.parse(this._settings.get_string('menu-configuration'));\n\n for (let i = 0; i < this._menuConfigs.length; i++) {\n\n // Make s...
[ "0.6666447", "0.6234935", "0.6174283", "0.5993949", "0.5962126", "0.57550156", "0.5753314", "0.56819797", "0.5664512", "0.5652312", "0.56483114", "0.55862963", "0.5578997", "0.55739605", "0.5557219", "0.5552604", "0.55495465", "0.55472887", "0.553136", "0.55296105", "0.551647...
0.7363596
0
This stores a JSON representation of the currently stashed items in the "stasheditems" key of the application settings. It does not update the settings instantaneously, it rather waits a few milliseconds for any additional changes.
_saveStashConfiguration() { // The configuration changed again. Cancel any pending save tasks... if (this._saveStashTimeout != null) { GLib.source_remove(this._saveStashTimeout); this._saveStashTimeout = null; } // ... and launch a new one. this._saveStashTimeout = GLib.timeout_add(GLi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function put() {\n \t\tlocalStorage.setItem(STORAGE_ID, JSON.stringify(items));\n \t}", "function updateStorage(){\n const stringifiedItems = JSON.stringify(Item.allItems); //turn the thing i Want to store into a string\n localStorage.setItem('items', stringifiedItems);//set the item into storage with a...
[ "0.68284535", "0.65511036", "0.6442151", "0.64327216", "0.6389379", "0.6338587", "0.6099616", "0.60789645", "0.6066047", "0.60425967", "0.6026083", "0.5994749", "0.59222776", "0.5922026", "0.5915423", "0.58921945", "0.58884674", "0.5851826", "0.5841305", "0.5834365", "0.58280...
0.71731406
0
Shows an inapp notification with the given text.
_showNotification(text) { this._builder.get_object('notification-revealer').reveal_child = true; this._builder.get_object('notification-label').label = text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNotification(title, text, onActiviation, onDismissal) {\n \n var toastXml = new xml.XmlDocument();\n toastXml.loadXml(util.format(msgTemplate, title, text));\n var toast = new notifications.ToastNotification(toastXml);\n \n toast.on(\"activated\", function (sender, eventArgs) {\n onActiviatio...
[ "0.6906627", "0.6637462", "0.64661175", "0.64653563", "0.6461911", "0.6413312", "0.64010453", "0.63985485", "0.63839173", "0.63442445", "0.63222367", "0.63218594", "0.63218594", "0.63218594", "0.63218594", "0.63019115", "0.63019115", "0.63019115", "0.63019115", "0.63019115", ...
0.69392043
0
Listen for incoming web requests on the port specified in process.env.PORT
function listen() { app.listen(process.env.PORT, () => { console.log(`Node app is running on port`, process.env.PORT); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listen() {\r\n app.listen(config.port, () => {\r\n const {port,env} = config\r\n console.log(`API server started: ${port}, ${env}`)\r\n });\r\n}", "function listen() {\n app.listen(port);\n console.log(`Listening on port ${port}.`);\n}", "listen() {\r\n this.app.listen(this.httpPo...
[ "0.76277107", "0.7575168", "0.7499933", "0.7452824", "0.7446041", "0.7331824", "0.72682637", "0.7263484", "0.7256582", "0.72482723", "0.72437423", "0.7227095", "0.71611905", "0.716021", "0.7069795", "0.70639217", "0.70516723", "0.7043228", "0.70381296", "0.70381296", "0.70381...
0.7892651
0
Update the soundState with current selection of radio buttons
function updateSoundState(selectedId) { // uncheck the last selected one last = soundState.findOne({checked: true}); if (last) soundState.update(last._id, {$set: {checked:false}}); // check the newly selected one soundState.update(selectedId, {$set: {checked:true, session:Meteor.default_connection._lastSes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeSound(e){\n const selectionName = e.target.name;\n const selectionValue = e.target.value;\n switch(selectionName){\n case \"kick-select\":\n this.kickAudio.src = selectionValue;\n break;\n case \"snare-select\":\n this.snareAudio.src = s...
[ "0.6602274", "0.65167546", "0.6418371", "0.6225653", "0.622145", "0.6175478", "0.61593115", "0.61590904", "0.6140089", "0.6029762", "0.599284", "0.5991402", "0.59904456", "0.59754235", "0.59457886", "0.5922449", "0.590944", "0.5905885", "0.58961374", "0.5890427", "0.58885825"...
0.6860315
0
Play a sound on the server side using mplayer.
function playServerSound(soundName) { // find filename associated with this sound type element = soundState.findOne({name: soundName}); path = getPath() + "/public/"; // command to execute cmd = "mplayer -quiet " + path + element.file; exec = Npm.require('child_process').exec; child = exec(cmd, fu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "play() {\n this.log('client called play()');\n RNFMAudioPlayer.play();\n }", "function play() {\n player.play();\n }", "function playAudio() {\n audioPlayer.play()\n }", "play() {\n\n\t\t// Mute?\n\t\tif(window.mute){\n\t\t\tthis.player.volume = 0;\n\t\t}\n\n\t\t// Looping things\n...
[ "0.71090835", "0.6914849", "0.6855162", "0.68457305", "0.68444026", "0.6796727", "0.67724043", "0.6751703", "0.670064", "0.66626096", "0.6654242", "0.66532385", "0.66464955", "0.66350687", "0.66078734", "0.66058826", "0.657933", "0.65777296", "0.6528004", "0.65272105", "0.652...
0.7968486
0
function that sorts the list of records by header text if there is 0 or 1 records then no sorting takes place
function sortByText(){ var listOfRecords = store.records.sort(sortByHeaderText); var boxes = store.boxes; if(boxes.length <= 1){ console.log("No need to sort, there are " + boxes.length + " box(es)"); } else{ var i = 0; boxes.forEach(function(box){ box.title.value = listOfRecords[i].title; bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortTable(id, index, is_first_header, is_ascending){\n var tbl = document.getElementById(id).tBodies[0];\n var store = [];\n var i = is_first_header ? 1 : 0;\n var len;\n for(len = tbl.rows.length; i < len; i++){\n var row = tbl.rows[i];\n var sortnr = row.cells[index].textCon...
[ "0.65169144", "0.64745677", "0.64578557", "0.6323748", "0.625386", "0.6219996", "0.6200931", "0.6178179", "0.6164299", "0.61601216", "0.61411893", "0.60447866", "0.60382664", "0.6022611", "0.6011122", "0.5962878", "0.596026", "0.5956151", "0.5956151", "0.59486294", "0.5938278...
0.707271
0
respond to web GET requests for the receive page:
function getReceivePage(request, response) { response.sendFile(__dirname + '/receive.html'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndexPage (request, response) {\n\tresponse.writeHead(200, {'Content-Type': 'text/html'}); \n\tresponse.write(\"<a href=\\\"/receive\\\">receive</a><br>\");\n\tresponse.write(\"<a href=\\\"/send\\\">send</a><br>\");\n\tresponse.end();\n}", "function getNewPage(page) {\n function callback(responseTe...
[ "0.7200996", "0.6575647", "0.64466363", "0.6349043", "0.63419217", "0.6293602", "0.6292383", "0.62778574", "0.6236487", "0.6203435", "0.61856097", "0.6184923", "0.61537606", "0.6148208", "0.6136877", "0.6099722", "0.6086187", "0.604704", "0.5982182", "0.5945314", "0.5927217",...
0.7012933
1
Does a shallow clone of an environment (environments don't need a deep clone)
function cloneEnvironment (env) { var clonedEnv = {} for (var key in env) { if (env.hasOwnProperty(key)) { clonedEnv[key] = env[key] } } return clonedEnv }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clone (to, from) {\n for (var key in to) {\n // Don't erase NODE_ENV. Fixes #12024\n if (key !== 'NODE_ENV') {\n delete to[key]\n }\n }\n\n Object.assign(to, from)\n}", "function deepCopy(state) {\n return JSON.parse(JSON.stringify(state));\n}", "function deepClone(state) {\n var ...
[ "0.6797836", "0.6202782", "0.6054875", "0.6043622", "0.60139817", "0.58903396", "0.58903396", "0.5881266", "0.58795375", "0.5870776", "0.58168364", "0.58075476", "0.5788356", "0.5782814", "0.57718045", "0.57677865", "0.57555", "0.57555", "0.57555", "0.57555", "0.5739534", "...
0.7906525
0
Returns true if the value matches the pattern and false otherwise value: the evaluated value of the expression like a number or a data constructor pattern: an AST object describing the pattern env: a mutable environment that will bind variables with a Var pattern
function matchesPattern (value, pattern, env) { if (pattern instanceof Val) { return pattern.eval() === value } else if (pattern instanceof Wildcard) { return true } else if (pattern instanceof Var) { // assign the variable the value env[pattern.x] = value return true } else if (pattern inst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPatternMatch(value, pat){\n if(pat === \"wildcard\")\n return true;\n else if(pat === value)\n return true;\n else if( pat instanceof Array){ //for predicate pattern\n if(pat[0] === \"whenWhen\")\n\t\t return pat[1].call(this,value);\n }//end of else if(pat instance of Array) \n if((v...
[ "0.6150631", "0.61483747", "0.61305475", "0.6072108", "0.5982262", "0.58753616", "0.5864906", "0.585898", "0.5819616", "0.5817724", "0.5797432", "0.57834506", "0.57603574", "0.57402474", "0.5727402", "0.57062227", "0.56966174", "0.56966174", "0.56847185", "0.56612295", "0.560...
0.81779903
0
Applies an expression on a list comprehension, filtering by predicate expr: the expression to apply to each element of the list pred: the predicate to filter the expressions by x: the name of the variable binding to apply to the expression datum: a list represented by a datum with Cons and Nil env: the environment to a...
function mapList (expr, pred, x, datum, env) { if (datum.C !== 'Cons' && datum.C !== 'Nil') { throw new EvalError('Datum is not a list') } if (datum.C === 'Cons') { var first = datum.es[0] var rest = datum.es[1] var matchesPredicate = true if (typeof pred !== 'undefined') { var tempEnv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter(pred, iter) {\n return (x for (x of iter) if (pred(x)));\n}", "function filter(list, predicate){\n\tvar result = [];\n\tfor(var i=0;i<list.length;i++){\n\t\tvar item = list[i];\n\t\tif (predicate(item) )\n\t\t\tresult.push(item);\n\t}\n\treturn result;\n}", "function filter(elems, predicate)...
[ "0.5801249", "0.56567454", "0.56554395", "0.5584455", "0.5541081", "0.55346394", "0.5487406", "0.5377499", "0.53250223", "0.53250223", "0.525543", "0.525543", "0.525543", "0.525543", "0.525543", "0.5232848", "0.5230922", "0.52185506", "0.52185506", "0.5208863", "0.51931846", ...
0.6822656
0
updating particle position, velocity, and alpha
function updateParticles() { let part; for (let i = 0; i < particles.length; i++) { part = particles[i]; // update velocity with friction part.velocity.x = part.velocity.x * friction; part.velocity.y = part.velocity.y * friction; // update velocity with gravity part.velocity.y += gra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function particleUpdate() {\n if (this.bFixed == false) {\n this.vx *= this.damping;\n this.vy *= this.damping;\n \n this.limitVelocities();\n this.handleBoundaries();\n this.px += this.vx;\n this.py += this.vy;\n }\n}", "update() {\r\n this.draw(); // call dra...
[ "0.7900165", "0.74482477", "0.7353152", "0.7335527", "0.7272908", "0.7265874", "0.7265522", "0.7264306", "0.7245766", "0.7188355", "0.71520543", "0.7127108", "0.7125611", "0.71121734", "0.70721924", "0.7040753", "0.7029333", "0.7027513", "0.7016082", "0.7013903", "0.7004276",...
0.77028275
1
this returns your recipes in an accordion list
function showRecipe(recipes) { if (!method || recipes[0] === undefined) { return <div></div> } else { return <Accordion>{(recipes.map((element, idx) => <Card {... { style: { backgroundColor: "#84A98C" } }} key={idx}> <Accordion.Toggle {...{ style: { textAlign: "ce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "recipesLoader(){\r\n var recipes = this.state.recipeJSON;\r\n var html = [];\r\n var i = 0;\r\n if(recipes)\r\n {\r\n if(this.state.recipesVisibility && Object.keys(recipes).length !== 0){\r\n for(var drink in recipes)\r\n {\r\n ...
[ "0.64195096", "0.6236426", "0.61940926", "0.607562", "0.6048512", "0.6006481", "0.59822905", "0.5945353", "0.5925084", "0.590682", "0.59061605", "0.58984154", "0.5894781", "0.58667815", "0.58096707", "0.579185", "0.57851523", "0.5758188", "0.5754386", "0.56705356", "0.566437"...
0.73864555
0
getRange using A1 notation getRange using row, column, rowAmount, columnAmount
getRange(rangeRowParameter, columnParameter, rowAmountParameter, columnAmountParameter) { let start, end, startRow, startColumn, endRow, endColumn; // Is A1 or row, column or row, column, rowAmount, columnAmount if (!columnParameter) { // A1 [start, end] = rangeRowParameter.split(":"); sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRangeValue_(row, column, sheetObject) {\n var range = sheetObject.getRange(row, column);\n var returnVar = range.getValues();\n return returnVar[0][0];\n}", "function getRangeFromA1Notation(A1Notation) {\n try {\n var sheet = SpreadsheetApp.getActiveSheet();\n return sheet.getRange(A1Notati...
[ "0.6410366", "0.63737524", "0.63229924", "0.6240349", "0.6211679", "0.6101174", "0.6021876", "0.59654325", "0.5890027", "0.5881872", "0.5840886", "0.58140785", "0.5708144", "0.57026434", "0.5673342", "0.56622636", "0.56510365", "0.5650121", "0.5581681", "0.5556182", "0.549236...
0.8099592
0
clean the feed element on map and feed page
function cleanFeed(){ $('#newsfeed').html(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearFeedOrganizer() {\r\n\r\n var old_organizer = document.getElementById(\"feed_organizer\");\r\n if (old_organizer == null) return alert(\"Old Feed Organizer Not Found!\");\r\n old_organizer.id = \"old_feed_organizer\";\r\n \r\n var organizer = document.createElement(\"div\");\r\n org...
[ "0.6125373", "0.6082477", "0.5953123", "0.5892504", "0.5811146", "0.57726574", "0.574821", "0.5656616", "0.56305003", "0.56236655", "0.5615806", "0.56151724", "0.56151724", "0.56151724", "0.55916363", "0.5582362", "0.5580346", "0.55756384", "0.5575596", "0.5565038", "0.556503...
0.68818474
0
Similar to `useState`, except the setter function is debounced by the specified delay. ```ts const [value, setValue] = useDebouncedState('test', 500) setValue('test2') ```
function useDebouncedState(initialState, delay) { const [state, setState] = (0, _react.useState)(initialState); const debouncedSetState = (0, _useDebouncedCallback.default)(setState, delay); return [state, debouncedSetState]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useDebounce(value, delay) {\n\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, ...
[ "0.8014831", "0.77425855", "0.67191714", "0.65908265", "0.6474691", "0.6265988", "0.62054735", "0.6159209", "0.61535096", "0.61497873", "0.60744154", "0.60555875", "0.6053068", "0.60523516", "0.6008835", "0.60032046", "0.5969375", "0.5956352", "0.5950707", "0.5945261", "0.594...
0.79730546
1
inject instagram embed script
injectScript() { const protocolToUse = 'https:'; const s = document.createElement('script'); s.async = s.defer = true; s.src = `${protocolToUse}//platform.instagram.com/en_US/embeds.js`; s.id = 'vue-instagram-embed-script'; const body = document.body; if (body) { body.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function embedInstagram() {\n\t\tvar instagrams = replacementArea.querySelectorAll('.postcontent a[href*=\"instagr.am/p\"],.postcontent a[href*=\"instagram.com/p\"]');\n\t\tif (instagrams.length > 0) {\n\t\t\tinstagrams.forEach(function eachInstagramLink(instagramLink) {\n\t\t\t\tvar url = instagramLink.getA('href...
[ "0.85564506", "0.6953895", "0.6456069", "0.6402365", "0.61764485", "0.61514896", "0.61407393", "0.6051429", "0.6040309", "0.6030487", "0.5967425", "0.5879408", "0.5852305", "0.58493775", "0.57994807", "0.5740895", "0.57219124", "0.5703409", "0.5688946", "0.5688946", "0.565313...
0.76580447
1
ProfileController.$inject = ['$scope', '$route'];
function ProfileController($scope, $route) { var vm = this; // api.getRestaurants() // .then(function(data) { // vm.profile = data; // }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function profileController() {\n\n }", "function MyProfileController($rootScope, $http, $location, appCacheService, siteInfo, $scope) {\n this.$rootScope = $rootScope;\n this.$http = $http;\n this.$location = $location;\n this.appCacheService = appCacheService;\n ...
[ "0.7258016", "0.6892757", "0.65645766", "0.61549324", "0.6122204", "0.61043483", "0.60820055", "0.6054394", "0.60404605", "0.5987645", "0.59472996", "0.5937759", "0.59087795", "0.58929616", "0.5870443", "0.5851377", "0.581509", "0.5802893", "0.5792706", "0.5784772", "0.575090...
0.8151048
0
getRandomSpeeds(geometry) get a speed based on the shape of the object note: this was added because it was crazy having text rotating around
function getSpeeds(geometry) { if(geometry instanceof THREE.TextGeometry) { return { x: 0, y: 0, z: 0 }; } else { return { x: getRandomSpeed(), y: getRandomSpeed(), z: getRandomSpeed() }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPetals() {\n // draw petals\n let petalMaterial = new THREE.MeshPhongMaterial( { shininess: 0, flatShading: false, transparent: true, opacity: 0, color: colors[0]} );\n for (let i = 0; i < numPetals; i++) { \n let petal = new THREE.Mesh(petalGeom, petalMaterial);\n petal.rotat...
[ "0.6144514", "0.6127523", "0.60191005", "0.60175455", "0.60122156", "0.5933916", "0.58948356", "0.58555704", "0.58408844", "0.5793248", "0.5789509", "0.57805824", "0.5776351", "0.5758752", "0.57581556", "0.5751078", "0.57508564", "0.57446134", "0.5735076", "0.56959224", "0.56...
0.7545337
0
getGeometry() provides the geometry based on the idx the first index, we use the original shape ekse, we use a random shape
function getGeometry(i) { if(i === 0) { return getBoxGeometry(); } else { return getRandomGeometry(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getGeometry(index){\n this.index = index;\n return this.geometry;\n }", "function generateGeometry() {\n let areas = [];\n let clips = clipRects_.slice();\n\n _.each(clips, (clip)=> {\n areas.push(clip.min);\n areas.push(clip.max);\n...
[ "0.7469639", "0.6161304", "0.58678323", "0.5751937", "0.57303363", "0.5649155", "0.56350446", "0.5619803", "0.56066287", "0.5563576", "0.55543166", "0.5477851", "0.54569983", "0.5366156", "0.5342048", "0.5340266", "0.5337147", "0.53182364", "0.52906525", "0.52878964", "0.5277...
0.74367714
1
When moving the map has ended. Fires also on zoom changes.
function onLeafletMoveEnd() { if (vm.mapCenter.zoom > vm.mapMinimumZoom) { getMarkers(); } else { // Otherwise hide the markers... /* eslint-disable new-cap */ vm.pruneCluster.RemoveMarkers(); vm.pruneCluster.ProcessView(); /* eslint-enable new-cap */ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onMoveEnd(e) {\n\t\tif (this.currentZoom != this.olMap.getView().getZoom()) {\n\t this.currentZoom = this.olMap.getView().getZoom();\n\t this.tgRoads.updateDisplayedRoadType(this.currentZoom);\n\t this.requestLocations = true;\n\t console.log('zoomEnd');\n\n\t this.tgLocs.initLocations();\n\t }\n\t...
[ "0.81253445", "0.7057691", "0.7046574", "0.6908876", "0.68912446", "0.6816312", "0.6770468", "0.67244893", "0.67061687", "0.6560257", "0.65506977", "0.64954704", "0.6442803", "0.6438169", "0.6409515", "0.64064", "0.62980354", "0.6278537", "0.6131113", "0.61109334", "0.6071908...
0.72265124
1
When Leaflet base layer changes
function onBaseLayerChange(event, layer) { $analytics.eventTrack('baselayerchange', { category: 'search.map', label: layer.leafletEvent.name }); // Determine currently selected baselayer style 'TRStyle' has to be // set when defining layers. Possible values are: street, satellite...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initBaseLayerControl() {\n // Change the currently visible base map\n $('.js-base-map-layers').change(function(e) {\n if (!e.target.value) return;\n\n // Get current map and layers\n var mapOptions = window.lokp_maps[getMapIdFromElement(e.target)];\n var layer = mapOption...
[ "0.74519175", "0.68476075", "0.68396974", "0.6791461", "0.67854184", "0.66433704", "0.6593505", "0.6590682", "0.64999783", "0.64924693", "0.6490012", "0.64899755", "0.6472165", "0.6472165", "0.64583004", "0.64013577", "0.63985044", "0.6359291", "0.63365287", "0.6319859", "0.6...
0.76337856
0
Converts the specified speed factor into the exact static enter duration.
function convertSpeedFactorToDuration(factor) { // Based on the numeric speed factor value that only affected the `enterDuration` we can // now calculate the exact `enterDuration`. 450ms is the enter duration without factor. return 450 / (factor || 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function speedCalculator(speed) {\n switch (speed) {\n case \"slow\":\n return 120;\n case \"normal\":\n return 180;\n case \"fast\":\n return 240;\n }\n}", "function getDuration(distance, speed) {\n const mins = (distance / speed) * 60;\n return new ...
[ "0.5661255", "0.5627026", "0.5603424", "0.5597697", "0.5557385", "0.5507928", "0.5393516", "0.53693205", "0.53667307", "0.536131", "0.53414094", "0.53349096", "0.53227055", "0.5279842", "0.5277979", "0.52499896", "0.5237204", "0.52343106", "0.52314067", "0.5225655", "0.522329...
0.79839104
0
Creates a runtime TypeScript expression that can be used in order to calculate the duration from the speed factor expression that couldn't be statically analyzed.
function createSpeedFactorConvertExpression(speedFactorValue) { // To be sure that the speed factor value expression is calculated properly, we need to add // the according parenthesis. return `450 / (${speedFactorValue})`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "evalExpression(expr) {\n return math.eval(expr, this.scope);\n }", "function calculateRuntime(point1, point2, unitType) {\r\n var runtime;\r\n var x1 = getXY(point1, \"x\");\r\n var y1 = getXY(point1, \"y\");\r\n var x2 = getXY(point2, \"x\");\r\n var y2 = getXY(point2, \"y\");\r\n\r\n ...
[ "0.51364774", "0.50368154", "0.5005312", "0.50028586", "0.49972242", "0.49774808", "0.49703473", "0.4950479", "0.49499255", "0.49350134", "0.49130586", "0.488953", "0.4887372", "0.48761535", "0.48296288", "0.48131", "0.4786441", "0.47560793", "0.47234327", "0.47167256", "0.47...
0.5774209
0
returns a parenthesized expression followed by a symbol examples: (001), (1010)+, etc. with a random length in [1, maxLength]
function parenExp (maxLength) { if (maxLength < 2) { return ['', 100 * maxLength]; } var length = Math.floor(randomInRange(2, maxLength)); var str = '('; for (var i = 1; i < length + 1; i++) { if (str[i - 1] in numbers && !(str[i - 1] in parens)) { str += randomNumberOrSymbol(); } else { str += rando...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberSymbolString (maxLength) {\n\tvar length = Math.floor(Math.random() * (maxLength - 1)) + 1;\n\n\tvar str = randomNumber();\n\tfor (var i = 1; i < length; i++) {\n\t\tif (str[i - 1] in numbers) {\n\t\t\tstr += randomNumberOrSymbol();\n\t\t} else {\n\t\t\tstr += randomNumber();\n\t\t}\n\t}\n\n\treturn...
[ "0.673284", "0.664218", "0.6631409", "0.646744", "0.61238027", "0.59541583", "0.5931187", "0.5877413", "0.5860247", "0.5833036", "0.57962084", "0.57925874", "0.57890147", "0.57869047", "0.578328", "0.5752323", "0.57315844", "0.5727788", "0.5719944", "0.5712363", "0.56966686",...
0.78451824
0
returns a string consisting of only numbers and symbols (no parentheses) with a random length in [1, maxLength]
function numberSymbolString (maxLength) { var length = Math.floor(Math.random() * (maxLength - 1)) + 1; var str = randomNumber(); for (var i = 1; i < length; i++) { if (str[i - 1] in numbers) { str += randomNumberOrSymbol(); } else { str += randomNumber(); } } return [str, length]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parenExp (maxLength) {\n\tif (maxLength < 2) {\n\t\treturn ['', 100 * maxLength];\n\t}\n\n\tvar length = Math.floor(randomInRange(2, maxLength));\n\n\tvar str = '(';\n\tfor (var i = 1; i < length + 1; i++) {\n\t\tif (str[i - 1] in numbers && !(str[i - 1] in parens)) {\n\t\t\tstr += randomNumberOrSymbol();...
[ "0.77693236", "0.76022726", "0.73260576", "0.72473776", "0.70017874", "0.6989164", "0.69743276", "0.6957933", "0.6948804", "0.69260275", "0.6911168", "0.6909518", "0.6903561", "0.69013894", "0.68897855", "0.68893945", "0.6879653", "0.687144", "0.6860152", "0.6853177", "0.6846...
0.7937799
0
Establish circle color for each magnitude darker are more intense
function circleColor(magnitude) { if (magnitude < 1) { return "#FAC9BA" // pink like } else if (magnitude < 2) { return "#FFFF00" // yellow } else if (magnitude < 3) { return "#00FF00" // lime } else if (magnitude < 4) { return "#FF5733" // dark orange } e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function circleColor(magnitude) {\n\t\tif (magnitude < 1) {\n\t\t\treturn \"#ccff33\"\n\t\t}\n\t\telse if (magnitude < 2) {\n\t\t\treturn \"#ffff33\"\n\t\t}\n\t\telse if (magnitude < 3) {\n\t\t\treturn \"#ffcc33\"\n\t\t}\n\t\telse if (magnitude < 4) {\n\t\t\treturn \"#ff9933\"\n\t\t}\n\t\telse if (magnitude < 5) {...
[ "0.8045702", "0.7915276", "0.77493286", "0.76444536", "0.73427916", "0.68019885", "0.6757631", "0.6742977", "0.6665628", "0.66635853", "0.6654025", "0.66374385", "0.66228384", "0.66217744", "0.66090536", "0.65970623", "0.6540347", "0.65205365", "0.6475859", "0.64669573", "0.6...
0.8236996
0
Defines the integration response that passes the result on success, or the error on failure, from the synchronous execution to the caller.
function integrationResponse() { const errorResponse = [ { /** * Specifies the regular expression (regex) pattern used to choose * an integration response based on the response from the back end. * In this case it will match all '4XX' HTTP Errors ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _response(e, result) {\n \n if (e) {\n if (request.id) {\n _send_response.apply(self, [{\n jsonrpc: \"2.0\",\n error: {\n code: e.code || -32603,\n me...
[ "0.63830847", "0.5936514", "0.5849525", "0.5828595", "0.5800092", "0.5798398", "0.57461584", "0.5736687", "0.5685146", "0.5573702", "0.55193704", "0.55108035", "0.54869986", "0.54414165", "0.5422727", "0.54217863", "0.53797394", "0.53484637", "0.5343976", "0.5343645", "0.5321...
0.6724777
0
Defines the request template that will be used for the integration
function requestTemplates(stateMachine, options) { const templateStr = templateString(stateMachine, options); const requestTemplate = { 'application/json': templateStr, }; return requestTemplate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TemplateInstantiationRequest() {\n}", "tcTemplate (request) {\n return this._dashboardRequest('get', '/api/tc-templates/' + request.templateId, request)\n }", "function buildRequest(options) {var\n\n spec =\n\n\n\n\n\n\n\n\n\n\n\n\n\n options.spec,operationId = options.operationId,securities = o...
[ "0.70016295", "0.64600945", "0.6103978", "0.60917753", "0.5889627", "0.5857222", "0.56428516", "0.5622082", "0.5576295", "0.5571812", "0.5562218", "0.5550346", "0.55491626", "0.5490765", "0.5469978", "0.5460986", "0.5451269", "0.5450891", "0.5411331", "0.5411331", "0.54106283...
0.6575625
1
would going to the next connection mean switching lines?
function switchingLines(pathNode, connection) { if (pathNode.connection === undefined) { return false; } if (pathNode.connection.line === connection.line) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function next() {\n\t\t\tif (viewer.scrollToLine(line) !== false) {\n\t\t\t\tline += 22;\n\t\t\t\tsyncTimeout(next, delay);\n\t\t\t}\n\t\t}", "setNextLine() {\n const isLineBeginning = this.charsWritten === 0;\n const isLineEnd = this.charsWritten === this.currentLine.length;\n const isLastL...
[ "0.60759574", "0.6021122", "0.5760669", "0.57261884", "0.568739", "0.56830364", "0.56830364", "0.56684434", "0.5662416", "0.56482124", "0.56482124", "0.5645723", "0.55960494", "0.5583365", "0.5567595", "0.55404097", "0.55218345", "0.55077547", "0.55064356", "0.5498112", "0.54...
0.67345214
0
START Reflection object. Creates a reflection for underneath an image. IE uses an image with IE specific filter properties, other browsers use the Canvas tag. The position and size of the reflection gets updated by updateAll() in Controller.
function Reflection(img, reflHeight, opacity) { var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent; parent = $(img.parentNode); if ($.browser.msie) { this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Reflection(img, reflHeight, opacity){\r\n\t\tvar\treflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent ;\t\r\n\t\tparent = $(img.parentNode) ;\r\n\t\tthis.element = reflection = parent.append(\"<canvas class='reflection' style='position:absolute'/>\").find(':last')[0] ;\r\n ...
[ "0.6783667", "0.65814495", "0.5510277", "0.5466333", "0.5407644", "0.5386993", "0.53599536", "0.53417903", "0.5316861", "0.52986705", "0.5298356", "0.5289768", "0.5275994", "0.5275328", "0.5255471", "0.52131385", "0.520301", "0.5201979", "0.50867033", "0.5047128", "0.5035754"...
0.6776981
1
Function string_p Is the given `subject' a `String'? string? :: Any > Bool
function string_p(subject) { return class_of.call(subject) == '[object String]' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ValidString(\r\n something\r\n){\r\n \r\n return (typeof something === \"string\" && something.length > 0);\r\n \r\n}", "function is_string(string) {\n if (typeof string === \"string\") {\n return true;\n }\n return false;\n}", "function isString$1(s) {\n return typeof s === 'string' ||...
[ "0.6405386", "0.5949839", "0.59494156", "0.59442157", "0.59089166", "0.5869433", "0.5815878", "0.5806881", "0.58034706", "0.5774253", "0.5762699", "0.57569194", "0.5730269", "0.5725036", "0.57184225", "0.57125086", "0.5700158", "0.5684925", "0.5680633", "0.56694365", "0.56694...
0.7816604
0
Function searchable_p Tests if an object implements an `indexOf' method. searchable? :: Any > Bool
function searchable_p(subject) { return subject && typeof subject.indexOf == 'function' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static contains(indexOfAble, match) {\n if (!indexOfAble)\n return false;\n return indexOfAble.indexOf(match) !== -1;\n }", "function contains(obj, item, fromIndex, guard) {\n if (!(0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) obj = (0,_values_js__WEBPACK_IMPORT...
[ "0.57631415", "0.5700354", "0.5675058", "0.5675058", "0.5653796", "0.56536216", "0.5648761", "0.55606693", "0.55606693", "0.55606693", "0.55606693", "0.5530131", "0.55078465", "0.54984593", "0.54345256", "0.5363136", "0.5322148", "0.5318771", "0.53187114", "0.5316791", "0.531...
0.7444704
0
Function muted_p Tests if the eventful object is muted. muted? :: Any > Bool
function muted_p(subject) { return subject.muteness && subject.muteness.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get muted() {\n return Boolean(this.media.muted);\n }", "get muted() { return this._muted; }", "get muted() {\n return this._gainNode.gain.value === 0;\n }", "get muted() {\n return this._muted;\n }", "get muted() {\n return this._solo.muted || this.mute;\n }", "...
[ "0.7363953", "0.7154478", "0.71265703", "0.7094612", "0.69966686", "0.69684136", "0.691526", "0.67956096", "0.67502874", "0.6603014", "0.62757164", "0.6216898", "0.6213833", "0.6151975", "0.61186504", "0.61061716", "0.60936654", "0.5986298", "0.5984455", "0.59680617", "0.5957...
0.7194043
1
Function make_handler Constructs or initialises a Handler. makehandler :: a:Handler > a makehandler :: Fun, Filter > Handler
function make_handler(fun, filter) { return fun.exec? Handler.init.call(fun, fun.fun, filter) : /* otherwise */ Handler.make(fun, filter) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createHandler(input, options = {}) {\n const metadata = this.createHandlerMetadata(input, options);\n this.buildPipe(metadata);\n return this.createRawHandler(metadata);\n }", "function makeHandler(type, args) {\n return function() {\n var result = { type: type };\n for (var i = 0; i < args.leng...
[ "0.6443988", "0.6176454", "0.61447227", "0.59397364", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.58775705", "0.5665075", "0.5597657", "0.55401796", "0.54311824", ...
0.80155456
0
Function make_event Constructs or initialises an Event. makeevent :: a:Event > a makeevent :: String, Eventful > Event
function make_event(event, target) { return string_p(event)? Event.make(event, target) : /* otherwise */ event }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async createNewEvent(event){\n return await Event.create(event);\n }", "function constructEvent(OriginalEvent, name, type, options) {\n if (supportsEventConstructors)\n return new OriginalEvent(type, unwrapOptions(options));\n\n // Create the arguments from the default dictionary.\n var e...
[ "0.6816522", "0.6626736", "0.6337496", "0.63107926", "0.608921", "0.6081094", "0.6075151", "0.60536486", "0.6049038", "0.6049038", "0.6049038", "0.6049038", "0.6049038", "0.60004455", "0.5980973", "0.5932724", "0.5917106", "0.5914902", "0.57789856", "0.5708722", "0.57062936",...
0.76269644
0
Function listeners Returns a list of listeners for the given event type. If the event type isn't defined yet, it's also initialised to an empty array. listeners! :: Eventful, String > [Handler]
function listeners(eventful, type) { return eventful.listeners[type] || (eventful.listeners[type] = []) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchListeners(idr) {\n var r = url.parse(idr);\n var types = [];\n // we're back-porting to the type system for now too\n var oldType = r.protocol.substr(0,r.protocol.length-1);\n types.push(oldType);\n oldType += '/' + r.host;\n types.push(oldType);\n if (r.pathname && r.pathname.length > 1) {\n...
[ "0.6228782", "0.6182109", "0.6152524", "0.59723675", "0.5965251", "0.59201145", "0.5908936", "0.5901877", "0.5830681", "0.58034855", "0.5768077", "0.5729876", "0.57028365", "0.57028365", "0.57028365", "0.57024336", "0.56512827", "0.564997", "0.5618355", "0.5602408", "0.558708...
0.7951367
0
== Core Implementation ============================================ // Function with_silence Runs a block of code within an silenced environment. That is, the `subject' will never send event notifications within this environment. withsilence! :: subject:Eventful, Fun > subject
function with_silence(subject, code) { var id = subject.mute() code.call(subject) subject.unmute(id) return subject }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function silenceEvents() {\n _silenceEvents = true;\n}", "silence() {\n silenceCoreApi();\n Logger.silence();\n }", "function silentNote() {\n silence = acx.createOscillator();\n silenceGain = acx.createGain();\n silence.connect(silenceGain);\n silenceGain.connect(mainDest);\n silenceGain.g...
[ "0.69802547", "0.66076785", "0.60954535", "0.58934176", "0.5846985", "0.57617825", "0.54636526", "0.5453884", "0.53944486", "0.5175666", "0.5167948", "0.5118122", "0.50731224", "0.5068674", "0.5045151", "0.5033523", "0.50135565", "0.4966552", "0.49645063", "0.49249032", "0.49...
0.7136063
0
====================================================================== Streets Collection ======================================================================
function buildStreetsCollection() { let json_str = null; if (isNotModified("streets")) { json_str = localStorage.getItem("bluestreets_streets"); } if (json_str == null) { // Either table has been changed or did not exist in localStorage //noinspection JSUnresolvedVariable,JSUnresolvedFunction ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAddresses(streets,cities,counties){\n var newAddresses=[];\n for (var i = 0; i <= streets.length; i++) {\n var newAddress=new Address(streets[i],cities[i],counties[i]);\n\n newAddresses.push(newAddress);\n\n }\n return newAddresses;\n}", "get addresses () {\n\t\treturn this._addresses;\n\t}"...
[ "0.6535157", "0.61554366", "0.5910194", "0.582801", "0.57684064", "0.5724473", "0.5658628", "0.5649922", "0.5630746", "0.5484411", "0.5462841", "0.545479", "0.5440234", "0.5429881", "0.5421834", "0.5374296", "0.5352558", "0.5336977", "0.53360045", "0.53051627", "0.5276278", ...
0.6947522
0
====================================================================== City and Zipcode Collections ======================================================================
function buildCityZips() { DB.zipcodes = DB.streets().distinct("zipcode").sort(); DB.cities = DB.streets().distinct("city").sort(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCities(zips, callback){\n cities =[];\n zips.forEach(function(zip, index){\n if(index===0){\n // ADD HOME CITY\n cities.push(req.user.cityname);\n } else{\n db.city.find({\n where: {\n zip: zip\n }\n }).then(function(city){\n ...
[ "0.6759024", "0.6541336", "0.6526593", "0.6493021", "0.64013726", "0.63890135", "0.63687474", "0.6305143", "0.62838167", "0.61590296", "0.61582285", "0.6153316", "0.6077032", "0.607607", "0.6039328", "0.60294867", "0.5939306", "0.59144485", "0.5868492", "0.5853883", "0.585290...
0.74390507
0
On change for color toolbar switch
function colored_toolbar_change() { if ($(this).is(':checked')) localStorage.setItem("colored_toolbar", "yes"); else localStorage.setItem("colored_toolbar", "no"); enableTheme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "callbackColorChange(){\n this.setTint(this.naturalTint);\n }", "function changeAboutRedSwitch(){\n vm.aboutRedSwitch = true;/*RED*/\n vm.aboutGreenSwitch = false;/*SHADOW*/\n }", "function colorChange(){\n if (color == '#7f3'){\n color = '#f80';\n }else{\n ...
[ "0.7112837", "0.6841018", "0.6829685", "0.6782568", "0.678095", "0.6708728", "0.66929203", "0.66849536", "0.6676648", "0.6548313", "0.6421291", "0.64087194", "0.6399432", "0.6359875", "0.63304657", "0.6290438", "0.62762433", "0.62597287", "0.6254235", "0.62468785", "0.6217676...
0.7592619
0
Create dom settings entry
function createSetting(title, value) { var $retval = $("<div></div>").addClass("item"); var $title = $("<div></div>").addClass(textClass) .html(title); var $value = $("<div></div>").addClass("mdl-color-text--grey-600") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSettingsList(){\n\t\tvar settingsList = \"<div id='ANDI508-settingsList' role='application'>\"+\n\t\t\t\"<a rel='help' href='\"+ help_url + \"howtouse.html#AdvancedSettings' aria-label='Advanced Settings Help' target='_blank'>Advanced Settings:</a>\"+\n\t\t\t\"<button id='ANDI508-button-highlights' a...
[ "0.6406863", "0.6317218", "0.62494713", "0.6105031", "0.6076856", "0.6076856", "0.60223514", "0.59955615", "0.5980047", "0.5907091", "0.58595663", "0.58581465", "0.58311355", "0.5783089", "0.5758922", "0.57446444", "0.57260627", "0.57143915", "0.56913793", "0.5662386", "0.565...
0.64132017
0
Test whether a string matches a URL pattern
function isURL (url: string): boolean { return URL_PATTERN.test(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findifValidURL(testString) {\n return testString.search(URL_REGEX);\n\n}", "function isURL(str) {\n return str.match(/[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/);\n}", "function isURL(str) {\n return str.match(/[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b(...
[ "0.74985766", "0.7422593", "0.7422593", "0.72652304", "0.7220918", "0.7210807", "0.7200223", "0.71713364", "0.7160971", "0.71575934", "0.7107336", "0.7105965", "0.7104889", "0.70878905", "0.7071455", "0.7049692", "0.7038058", "0.7033607", "0.7018162", "0.70158046", "0.7015804...
0.7643929
0
turns the input into a 64length value
function to64(val) { return pad(val, 64); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coerceTo64Bit(str) {\n if (str.length <= 16) {\n return str;\n } else {\n return str.substr(str.length - 16);\n }\n}", "function toApprox64(val)\n{\n\tif (val === undefined)\n\t\tthrow (new Error('missing required arg: value'));\n\n\tif (!Array.isArray(val))\n\t\tthrow (new Error('value must be...
[ "0.6524263", "0.6423218", "0.6423218", "0.6423218", "0.6423218", "0.6423218", "0.6423218", "0.6377274", "0.6377274", "0.6268175", "0.623806", "0.62088114", "0.6203827", "0.6119742", "0.61181825", "0.60494334", "0.6030873", "0.60218066", "0.6007303", "0.5988839", "0.5988839", ...
0.6503855
1
Function creates a column containing the asteroid's name.
function makeName(asteroid, row) { var column = $("<div></div").addClass("col-md-4"); var name = $("<h3></h3>").html(asteroid.name); $(column).append(name); $(row).append(column); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAsteroidHandler(){\n let xPos = Math.floor(Math.random() * WIDTH);\n let yPos = 0;\n let asteroidName = ASTEROID_NAMES[Math.floor(Math.random() * ASTEROID_NAMES.length)]; \n let asteroid = asteroids.create(xPos, yPos, asteroidName);\n // The offset is for users to be able to se...
[ "0.5687889", "0.54134536", "0.53363085", "0.5326841", "0.5306669", "0.5259086", "0.519737", "0.51522905", "0.51325095", "0.50885093", "0.5010996", "0.49882382", "0.49882382", "0.49882382", "0.49601874", "0.49577442", "0.4947924", "0.4945611", "0.4945118", "0.4942438", "0.4920...
0.7144313
0
This function is used to create the third column, which contains close approach data about this asteroid.
function makeClose(asteroid, row){ var column = $("<div></div>").addClass("col-md-4"); var speed = $("<h4></h4>").html(asteroid.close_approach_data[0].relative_velocity.miles_per_hour); var distance = $("<h4></h4>").html(asteroid.close_approach_data[0]); var hazard = $("<h4></h4>"); if (asteroid.is_potential...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get third_interval() {\n switch (this.chord_type) {\n case 'major_triad':\n case 'augmented_triad':\n case 'major_seventh':\n case 'dominant_seventh':\n case 'augmented_major_seventh':\n case 'augmented_dominant_seventh':\n ret...
[ "0.5527659", "0.5499719", "0.5367917", "0.5303823", "0.52483994", "0.509074", "0.5074198", "0.49873763", "0.49865264", "0.49777505", "0.4919554", "0.4912399", "0.489123", "0.48689282", "0.4863518", "0.48545572", "0.48532677", "0.4843187", "0.48255467", "0.48176163", "0.481491...
0.56321937
0
calcul the space between item
calculspace(){ this.sizeSpace= (this.item[1].offsetTop)-(this.item[0].offsetTop+this.item[0].offsetHeight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function carouselItemSpaceConvert(){\n if(carouselItemSpace == 'css'){\n carouselItemSpace = parseInt($carouselItem.first().css('margin-right'), 10);\n }\n }", "space(spacing) {\n return this.options.stave.space * spacing;\n }", "function xspace(i...
[ "0.7020698", "0.6554308", "0.6501584", "0.6445446", "0.63396966", "0.62670255", "0.6167008", "0.61255515", "0.6117358", "0.6102621", "0.6095581", "0.6081701", "0.6052702", "0.603164", "0.60097355", "0.59706223", "0.59289396", "0.5908521", "0.58937365", "0.58903193", "0.588792...
0.8176259
0
method to calcul how item shows
calcItemShow(){ this.itemShow=0; this.Array.forEach((item, i) => { if(item<this.parent.offsetHeight) this.itemShow++; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "divItems()\n {\n this.modifyItems(function(item, index) {\n item.nb /= this.nb;\n });\n }", "function calcItems(){\r\n \r\n //To remove the additon item\r\n activeItems -= itemsToShow;\r\n //for responsive\r\n\t\t\tif($(window).width() <=...
[ "0.6312911", "0.6202922", "0.6172704", "0.58983153", "0.5896376", "0.58446366", "0.58384645", "0.5759173", "0.5725154", "0.5706402", "0.57013154", "0.56489354", "0.5648627", "0.5642291", "0.5630444", "0.56052595", "0.5576725", "0.5549002", "0.55415964", "0.5527016", "0.551056...
0.6487657
0
Function reset guessedRight and guessedWrong
function resetGuesses () { guessedRightText.innerHTML = []; state.guessedRight.length = 0; guessedWrongText.innerHTML = []; state.guessedWrong.length = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n\tguesses = 9;\n\tguessesLeft = 9;\n\tguessedLetters = [];\n\tupdateletterComp();\n\tupdateGuessesLeft();\n\tupdateSoFar();\n}", "function reset() {\n guessesRemaining = 5;\n wrongGuess = [];\n blanksAndCorrect = [];\n Game()\n}", "function resetGame() {\n _setSecret(get_rand);...
[ "0.7585152", "0.7549042", "0.7444002", "0.7390889", "0.73495775", "0.7312527", "0.7304011", "0.72718906", "0.7167239", "0.71264327", "0.7104345", "0.7076214", "0.7071807", "0.70456994", "0.7032046", "0.7031421", "0.7010615", "0.6956787", "0.6956173", "0.69454795", "0.6894132"...
0.79409665
0
Function create answer spaces
function showAnswerSpaces() { state.answerName = state.characterNames[Math.floor(Math.random() * state.characterNames.length)]; state.answerNameSplit = state.answerName.split(""); for (i = 0; i < state.answerNameSplit.length; i++) { // console.log(i); state.answerSpaces.push("_"); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGameBoard(){\n for (var i = 0; i < arrayAnswer.length; i++){\n //if word/phrase has a space, gameboard will create a space\n if (answer[i] == ' '){\n arrayFinal.push(' ');\n }\n //else, gameboard will create a dash (-)\n else{\n arrayFinal.push('-');\n }\n }\n finalAns...
[ "0.6486289", "0.6205166", "0.61277074", "0.60165536", "0.60095805", "0.59543467", "0.58285236", "0.58086157", "0.580116", "0.5799286", "0.5790105", "0.57608014", "0.5757353", "0.5745576", "0.5743542", "0.57426804", "0.57362676", "0.5697442", "0.56954426", "0.567961", "0.56794...
0.65502
0
this function update the contact by Id from information
async function updateContact(contactId, { name, email, phone }) { try { const updateContact = await getContactById(contactId); if (!updateContact) { return { message: "contact not found" }; } await Contacts.updateOne(updateContact._id, { name: name || updateContact.name, email: ema...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateContact(newContact){\nlet index = contactIndex(newContact.cid);\ncache[index] = newContact;\ndocument.getElementById(newContact.cid).innerHTML = newContact.firstname;\nopenContact(newContact);\n}", "updateContact(contact) {\n ContactActions.updateContact(contact); \n }", "updateContact(req, ...
[ "0.6773249", "0.66778696", "0.6533214", "0.6531153", "0.6455551", "0.6426871", "0.63690597", "0.6365007", "0.63624", "0.63600767", "0.6295628", "0.6248713", "0.62277746", "0.6208248", "0.6156242", "0.6079496", "0.60778105", "0.6073658", "0.6010985", "0.59938663", "0.5990958",...
0.6958652
0
Displays primary key values for all records selected by the user.
function showSelectedRecords() { var grid = Ab.view.View.getControl('', 'reportGridMultiselectButtons_grid'); var rows = grid.getPrimaryKeysForAllSelectedRows(); var message = 'Primary Keys of Selected Rows ('+rows.length+'):\n\n'; for (var i = 0; i < rows.length; i++) { var row = rows[i]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ShowAllRecords() {\n this.ShowView();\n Object.keys(this.store.data).forEach(recIdx => this.CreateRecordView(this.store, Number(recIdx), true, false));\n }", "getPrimaryKeysFields() {\n const results = [];\n Object.entries(this.Model.prototype.schema.tree).forEach(entry => {\n ...
[ "0.56757253", "0.56541127", "0.5582121", "0.55242455", "0.543978", "0.536938", "0.53390515", "0.52319986", "0.52315867", "0.5209073", "0.5200194", "0.5153166", "0.50933576", "0.50725806", "0.50546837", "0.50442576", "0.5020637", "0.5014766", "0.5012012", "0.49935645", "0.4992...
0.6556762
0
Adds missing users to database Updates players mmr entry correctly
function addMissingUsers(players, data, callback){ //console.log('DEBUG: @addMissingUsers, Insert the mmr from data: ', players); var allGameModes = player_js.getAllModes(); for(var i = 0; i < players.length; i++){ // Check database for this data var existingUser = -1; data.forEach(function(oneData){ if(pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addUser(playerName) { // A new users state is strored in a user variable which is then added to the list of users.\n var user = {\n name: playerName,\n score: 0\n }\n this.gUsers.push(user);\n\n this.updateUsers();\n }", "function addEmptyUser(users) {\n ...
[ "0.62272596", "0.611714", "0.6114411", "0.61108595", "0.60332644", "0.58863264", "0.5878027", "0.58490235", "0.58482534", "0.58358467", "0.5827342", "0.5813424", "0.577739", "0.5774848", "0.57603383", "0.57530344", "0.57230246", "0.57165754", "0.5681702", "0.56744736", "0.563...
0.8076661
0
Render method that renders the Setup component with the appropriate properties. If the isTournamentStarted state is false it render the Player componenet, and when the state is changed to true, then the players info will be hidden and the Bracket component will be shown on screen. The InitiateTournament component will ...
render() { return ( <div> <div> <Setup onGeneratePlayer={this.generatePlayer}></Setup> </div> {!this.state.isTournamentStarted && this.renderPlayers()} {this.state.players.length !== 0 && ( <InitiateTournament isTournamentStarted={this.state.isTo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h1>\n\t\t\t\t\tJohn Horton Conway's <br />\n\t\t\t\t\tGame of Life\n\t\t\t\t</h1>\n\t\t\t\t<div className=\"controls\">\n\t\t\t\t\t<Buttons\n\t\t\t\t\t\tplayButton={this.playButton}\n\t\t\t\t\t\tpauseButton={this.pauseButton}\n\t\t\t\t\t\tslow={this.slow}\n\t\t\t\t\t...
[ "0.6240631", "0.6124302", "0.6100633", "0.5997561", "0.5894775", "0.5759195", "0.57027847", "0.5692774", "0.564536", "0.5637909", "0.5616758", "0.5610146", "0.55890435", "0.5578902", "0.55787796", "0.5560763", "0.5551564", "0.55366564", "0.5523642", "0.5523642", "0.5507924", ...
0.76757413
0
The plot window is closed.
function plotWindowClosedSlot() { plottimer.stop(); plotWindow1.setAutoUpdateEnabled(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClosed() {\n\t// Dereference the window\n\t// for multiple windows store them in an array\n\tmainWindow = null;\n}", "function btnExitChartProps_click() {\r\n\twindow.returnValue=null;\r\n\twindow.close();\r\n}", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "fu...
[ "0.7130658", "0.7053312", "0.6957312", "0.6955254", "0.69354814", "0.6839916", "0.68323165", "0.6809972", "0.6809972", "0.6803903", "0.6698632", "0.66960025", "0.6679604", "0.6678899", "0.6678899", "0.666629", "0.66477233", "0.66477233", "0.6637462", "0.663567", "0.6593153", ...
0.79824716
0
Is called if the user clicks on the plot in window 1.
function plotWindowMousePress(xValue, yValue, button) { scriptThread.appendTextToConsole('plotWindowMousePress: ' + xValue + ", " + yValue + ", " + button); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plotWindow2MousePress(xValue, yValue, button)\r\n{\r\n\tscriptThread.appendTextToConsole('plotWindow2MousePress: ' + xValue + \", \" + yValue + \", \" + button);\r\n}", "function plotclick(event, pos, item) {\n if (! that.clickmode) {\n // it is the click activating the clickti...
[ "0.71117765", "0.6937132", "0.6937132", "0.6937132", "0.6800511", "0.6574672", "0.65309536", "0.65134585", "0.6495886", "0.64043236", "0.6322897", "0.63215786", "0.6304694", "0.6283732", "0.62495494", "0.61722094", "0.61588854", "0.61550057", "0.6126976", "0.611216", "0.60940...
0.71204954
0
Is called if the user clicks on the plot in window 2.
function plotWindow2MousePress(xValue, yValue, button) { scriptThread.appendTextToConsole('plotWindow2MousePress: ' + xValue + ", " + yValue + ", " + button); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plotWindowMousePress(xValue, yValue, button)\r\n{\r\n\tscriptThread.appendTextToConsole('plotWindowMousePress: ' + xValue + \", \" + yValue + \", \" + button);\r\n}", "function plotclick(event, pos, item) {\n if (! that.clickmode) {\n // it is the click activating the clicktip\...
[ "0.6804835", "0.67572033", "0.67572033", "0.67572033", "0.6606757", "0.65365803", "0.6375194", "0.6319582", "0.6218065", "0.61978006", "0.6161481", "0.6150411", "0.61239636", "0.61189866", "0.61026174", "0.60951746", "0.6070099", "0.6052484", "0.6052218", "0.6032594", "0.5995...
0.71931255
0
Adjust the width of the right column, so that all columns fit in the complete table.
function adjustTableColmnWidth() { var verticalScrollBarWidth = 0; if(UI_tableWidget.isVerticalScrollBarVisible()) { verticalScrollBarWidth = UI_tableWidget.verticalScrollBarWidth(); } var columnWidth = (UI_tableWidget.width() - (2 * UI_tableWidget.frameWidth() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setColumnWidths() {\n var currColHeader,\n columnCells,\n cellData,\n headerWidth,\n cellWidth,\n cellDataWidth = 0;\n\n\n _.each(scope.tableColumns, function(value, index) {\n ...
[ "0.650623", "0.6376768", "0.6339296", "0.63310766", "0.6102924", "0.6054194", "0.6046207", "0.6010045", "0.6007657", "0.60041285", "0.5969968", "0.59604466", "0.5854058", "0.5827952", "0.58162427", "0.5807171", "0.57935476", "0.5717702", "0.57174915", "0.5714139", "0.5704717"...
0.66469926
0
Get the account Get the network Get smart contract >ABI:hash.abi >Address:networkData.address Get Hash value of image
async loadBlockchainData() { const web3 = window.web3 // Load account const accounts = await web3.eth.getAccounts() this.setState({account:accounts[0]}) const networkid= await web3.eth.net.getId() const networkData= ihash.networks[networkid] if(networkData) { //fetch code c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchAccountData() {\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const c...
[ "0.60241544", "0.5996748", "0.59518397", "0.5862683", "0.5862278", "0.58569837", "0.5775363", "0.57558376", "0.57002616", "0.56692404", "0.5662558", "0.5605347", "0.5596881", "0.5536136", "0.5528825", "0.5518633", "0.5510938", "0.54927945", "0.5481191", "0.54775465", "0.54730...
0.6117848
0
Function for upload a multimedia content and obtain a download URL
async function uploadMediaAndGetDownloadURL(uri, pathMedia){ var downloadURL = ""; const response = await fetch(uri); const blob = await response.blob(); var ref = storageRef.child(pathMedia); // Upload file and metadata to the object var uploadTask= ref.put(blob); // Listen for state cha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function download_media(url, callback) {\n request.get(url, function(err, response, body) {\n if(err) {\n callback(err, null)\n }\n else {\n var image = new Buffer(body).toString('base64')\n callback(null, image)\n }\n })\n}", "function post_phot...
[ "0.62742704", "0.6014435", "0.599535", "0.57903165", "0.5766303", "0.5711053", "0.5700968", "0.5699041", "0.5676782", "0.56614465", "0.5639713", "0.5632489", "0.5567192", "0.5534764", "0.5534764", "0.55052507", "0.54684174", "0.54617214", "0.5454008", "0.54507667", "0.5435744...
0.6386623
1
sample busyTimesArray ['09:00 to 12:30', '13:15 to 16:00', '18:00 to 20:00']
function calcFreeTime(busyTimesArray) { let freeTime = [0, 1440]; for(let i = 0; i < busyTimesArray.length; i++) { let busyTime = busyTimesArray[i].split(" to "); let startBusy = toSeconds(busyTime[0]); let endBusy = toSeconds(busyTime[1]); for(let j = 0; j < freeTime.length; j++) { if (free...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTimeArray(){\n var timeArray = [];\n for(var i = 8; i <= 20; i++){\n for(var a = 0; a <= 3; a++){\n var string = \"\";\n if(a == 0){\n string = i+\":00\";\n } else {\n string = i+\":\"+(a*15);\n }\n tim...
[ "0.6370388", "0.62650764", "0.6203019", "0.6122819", "0.61170644", "0.6034168", "0.59685916", "0.5965266", "0.5963896", "0.5895282", "0.58833456", "0.5882479", "0.58794266", "0.58309776", "0.58292115", "0.5809023", "0.58030605", "0.5797028", "0.5795923", "0.5790446", "0.57903...
0.7142055
0
Resident Alien selected based on Country of Citizenship
function updateResidentAlien() { if (vm.uidata != null) { if (vm.uidata.countryOfCitizenship == 'US') { vm.uidata.residentAlien = 'N'; vm.isResidentAlienInd = false; } else { vm.uidata.residentAlien =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCountry(ufo) {\n return ufo.country == inputValueCountry;\n}", "getAlpha(country) {\n for(var i = 0; i < this.countryCode.length; i++){\n if(this.countryCode[i][\"country-code\"] == country) {\n return this.countryCode[i][\"alpha-2\"];\n }\n }\n }", "function country (...
[ "0.6174357", "0.5893746", "0.583905", "0.57769233", "0.57078546", "0.5598271", "0.5595709", "0.5589558", "0.5575723", "0.5569718", "0.556759", "0.553437", "0.54856795", "0.5484755", "0.5480993", "0.545253", "0.5422132", "0.5414908", "0.54132855", "0.5381741", "0.53641504", ...
0.66773164
0
fitness computes the fitness score for each vehicle in this population.
fitness() { for (let i = 0; i < this.size; i++) { this.vehicles[i].fitness(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateFitness(){\n\n this.fitness = this.score * this.score;\n \n }", "calcFitness()\n {\n for(let i=0; i< this.population.length; i++)\n {\n this.population[i].calculateFitness(this.target); \n }\n }", "calcFitness() {\n const d = p5.Vect...
[ "0.7163054", "0.70520955", "0.6801092", "0.66365534", "0.65784544", "0.6447963", "0.6429354", "0.6377077", "0.6350068", "0.6210162", "0.6207687", "0.61687404", "0.59948975", "0.59684616", "0.59228873", "0.5843535", "0.58433175", "0.5776616", "0.5583126", "0.5549599", "0.55251...
0.8313867
0
Start tracking of specified device
function startTracking($device) { console.log('start tracking'); $scope.device = {}; $device.$bindTo($scope, 'device'); $scope.deviceKey = $device.$id; // Keep it to unbund later $scope.$device = $device; // BackgroundGeolocationService.start($device.$id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTracking() {\n browser\n .execute(ga.run, 'create', 'UA-XXXXX-Y', 'auto')\n .execute(ga.trackHitData);\n}", "startTrack() {\n this.initTracking();\n this.saveChanges();\n }", "startTracking () {\n if (this.#watcherId !== undefined) {\n console.warn(`location tracking is ...
[ "0.7279911", "0.66112244", "0.6147952", "0.60744745", "0.6071104", "0.60505044", "0.6008963", "0.60079974", "0.59853387", "0.5952883", "0.5948518", "0.5875079", "0.5873882", "0.5845122", "0.5840785", "0.5825982", "0.5806455", "0.58008283", "0.57823014", "0.5776236", "0.576073...
0.7955594
0
Pipe this object out to the specified destination
pipe(dest, options) { return this.stream(options).pipe(dest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pipe(source, destination) {\n source.pipe(destination)\n source.on('error', function(e){\n destination.emit(e)\n })\n return destination\n}", "function pipe(dest, options) {\n var settings = options || {}\n var onend = once(onended)\n\n emitter.on('data', ondata)\n emitter...
[ "0.6658748", "0.63273835", "0.6117121", "0.6087458", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", "0.60557336", ...
0.7263732
0
given a class id, this will return all spans with that class id
function getSpansWithHighlight(classId) { return document.querySelectorAll("span." + classId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get spans() {\n return [];\n }", "function elems_for_class(str) {\n return document.getElementsByClassName(str);\n }", "function elementsByClass(elementClass) {\n return document.getElementsByClassName(elementClass);\n}", "function getElementsByClassName(className, tag, elm){\r\n var testCl...
[ "0.60444146", "0.5986003", "0.59014696", "0.58397275", "0.5824692", "0.58205384", "0.5734961", "0.5720533", "0.5707326", "0.57012933", "0.5650769", "0.5643501", "0.5632436", "0.5631894", "0.5627051", "0.56182516", "0.5602056", "0.55986387", "0.5591191", "0.55868673", "0.55842...
0.8079625
0
Changes the src of the iframe
function changeIFrameSrc(path){ document.getElementById('content').src = path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateSrc() {\n this.getIframe().src = this.model.get('src');\n }", "function setSrc(val) {\n iframe.src = `${val}?output=embed`;\n}", "function iframeReload() {\n var iframe = document.getElementsByTagName('iframe');\n iframe[0].src = iframe[0].src;\n }", "function set_cont...
[ "0.81148404", "0.7743403", "0.7616061", "0.7296683", "0.727426", "0.70748305", "0.66761917", "0.6584576", "0.6551926", "0.6526981", "0.649587", "0.6416679", "0.640375", "0.63817763", "0.6349145", "0.63062644", "0.6285478", "0.6235011", "0.6209812", "0.6195164", "0.61940855", ...
0.8160541
0
add a word to canvas
function addWord(wordData, CanvasDraw, CanvasTry){ var size = Math.ceil(SIZEMAX * wordData.weight); var word = Word.createNew(wordData.text, size, CanvasTry); var pos0 = initialPosition(CanvasDraw, word); var pos = Position.createNew(pos0.x, pos0.y); circle = 0;// initialize circle to 0 while(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addText(){\n\t// Declare and set variables\n\tvar userText = document.getElementById(\"textCanvas\").value;\n\tvar canvas = document.getElementById(\"addedText\").getContext(\"2d\");\n\t\n\t// Now add the text to the canvas\n\tcanvas.fillText(userText, 25, 50);\n}", "function Addtext() { \n var t...
[ "0.7528474", "0.7146299", "0.70573235", "0.70117736", "0.69205385", "0.6906848", "0.6905736", "0.68654174", "0.68019027", "0.6730478", "0.6721", "0.6697897", "0.6692518", "0.66673195", "0.665777", "0.66530526", "0.66464704", "0.66433805", "0.66092867", "0.66042614", "0.659114...
0.76885575
0
check whether beyond canvas's bounds
function checkBounds(rect, Canvas){ if((rect.x + rect.width) <= Canvas.width && (rect.y + rect.height) <= Canvas.height && rect.x >= 0 && rect.y >= 0){ return true; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "outofbounds() {\r\n return(this.y == -this.height);\r\n }", "function inCanvasBounds( posX, posY )\n {\n var left = 0;\n\tvar top = 0;\n var right = canvasSize.width;\n\tvar bottom = canvasSize.height;\n\n\treturn ( posX >= left && posX <= right && \n\t\t posY >= top && posY <= bottom);\n ...
[ "0.779444", "0.7624912", "0.7559473", "0.75542897", "0.7542589", "0.75420576", "0.74652207", "0.73333526", "0.73193794", "0.73060167", "0.7247701", "0.7208456", "0.719819", "0.71975434", "0.7193521", "0.71582764", "0.71460086", "0.7145678", "0.71145815", "0.71094453", "0.7098...
0.81099105
0
loads all the data into the arrays but running through the dataset and adding the state to the categories and pushing it to the arrays. For example, the first one would run through looking for "AlabamaAverage Cost per Pack" (the 6th column and push the value (8thcolumn) to the perPack array. Then the loaddata function ...
function loadData(state,perPack,perFedStatePercent,perConsumption,perState,perGrossTax,perFedStatePack){ var cigDataRowCount = table.getRowCount(); perPack;//"Average Cost per pack " perFedStatePercent;//"Federal and State tax as a Percentage of Retail Price " perConsumption;//"Cigarette Consumption (Pack Sales...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "testDatasetLoader(dataset) {\n\n switch(dataset) {\n case \"fisher_petal_dataset\": {\n // set test data to true for appending correct iris name in opticsAlgo\n this.store.testDataset = true;\n // array for iterating over all three datasets\n ...
[ "0.59176636", "0.5913102", "0.58217573", "0.57520604", "0.57507235", "0.57231516", "0.56541413", "0.564355", "0.5632615", "0.56158835", "0.5612198", "0.55883145", "0.5588094", "0.5579465", "0.5565808", "0.55652004", "0.5564463", "0.5564351", "0.5551449", "0.55346", "0.5504034...
0.65001875
0
The drawLines function take the data for each state and draw the lines. There is a specific function for each category because they all have different minimum and maximum values. This means that each state line is drawn on scale with other state lines. For example, a state with low conumption will have a line closer to...
function drawLinesPerPack(data,xPosition,yPosition,xLength,str){ noFill(); colorMode(RGB); strokeWeight(sparkLineWeight); stroke(str); beginShape(); for (var i = 0; i < data.length; i++) { var x = map(i, 0, data.length-1, xPosition,xPosition + xLength); var y = map(data[i], min(0.287), max(10.376), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineGraph() {\n // Transparent rect behind graph\n fill(0, 127);\n noStroke();\n rect(0, 25, hist.length, 150);\n\n // Plot history of each state\n noFill();\n strokeWeight(2);\n for (let i = 0; i < COLORS.length; i++) {\n stroke(COLORS[i]);\n beginShape();\n f...
[ "0.63456273", "0.60600096", "0.6040244", "0.590088", "0.5885054", "0.5781532", "0.5779251", "0.57249177", "0.5716481", "0.5644919", "0.56386423", "0.5618402", "0.5583441", "0.55833215", "0.55808437", "0.5577723", "0.5569118", "0.5567809", "0.5554236", "0.55529517", "0.5550478...
0.62019575
1
new code checkout payment section
function worldPay(form){ //$("#paymentSection").find('img').show(); make_prominent_buttons(); Worldpay.useTemplateForm({ 'clientKey':$('#WP_Public_KEY').val(), 'form':form, 'saveButton':false, 'reusable':true, 'templateOptions': {images:{enabled:false},dimensions:{wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function payment() {\r\n try {\r\n paymentMode = ['credit', 'debit'],\r\n index = readlineSync.keyInSelect(paymentMode, 'How do yoy like to pay?');\r\n payment = helper.payment(index + 1, paymentMode[index]);\r\n } catch (e) {\r\n throw e;\r\n }\r\n}", "function cryptoPay...
[ "0.6534736", "0.65007854", "0.63684666", "0.632141", "0.6283391", "0.625546", "0.6219232", "0.61723787", "0.61615866", "0.61615866", "0.6141725", "0.6074346", "0.60410315", "0.60409635", "0.6029575", "0.59752816", "0.59736633", "0.59721863", "0.5942671", "0.5935913", "0.59156...
0.65426826
0
Get an auth object for authenticated users
function getAuthentication(){ // If the user isn't currently authenticated if(!AuthService.getAuth().authenticated){ // Fetch user from server RestService.getUser() // create an auth .then(function(data){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAuth() {\n return auth.$getAuth();\n }", "getAuthUser() {\n if (this.isLoggedIn()) {\n this.setAuthUser();\n }\n return this.authUser;\n }", "function authenticate (args) {\n var realm = args[0];\n var authid = args[1];\n var details = args[2];\n\n console.log(\"authentic...
[ "0.7277577", "0.705731", "0.6788813", "0.6618065", "0.6525214", "0.6405886", "0.63562274", "0.631849", "0.6307148", "0.6286473", "0.6284681", "0.626798", "0.6253611", "0.6241192", "0.62404525", "0.621219", "0.62072843", "0.6206248", "0.617136", "0.6116687", "0.6079809", "0....
0.7118184
1
create a simple pannel widget parent (string): parent selector name (string): name used for the panel, this will create two div named name_PanelHead,name_Panelcontent header (string): name of header content (function): a callback function to display contente of the panel
function createPanelwidget(parent, name, header, content) { $(parent).append($('<div id="' + name + 'Panelhead" class="' + panelHeaderClass + '">')); $("#" + name + "Panelhead").click(toggleme); $("#" + name + "Panelhead").hover(hoverInPanel, hoverOutPanel); $("#" + name + "Panelhead").append(header); $(parent).a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create() {\n //Adding Header Panel \n addHeader();\n //Adding body Part\n addMain();\n //Adding Footer Panel\n addFooter();\n //Setting data to the elements\n setData(data);\n}", "function panelcreate() {\n\n// Create an intro panel with labels.\nvar intro = ui.Panel([\n ui.L...
[ "0.66983813", "0.665236", "0.6651015", "0.6634646", "0.65160674", "0.6447534", "0.64272904", "0.6392753", "0.63638294", "0.6351182", "0.627562", "0.62656814", "0.6261859", "0.6227214", "0.6202934", "0.6127721", "0.61114603", "0.6087197", "0.6078776", "0.60599905", "0.6056867"...
0.85593146
0
create a input value dialog box widget parent (string): parent selector in form "parent" title (string): title string for the dialog value (string): the current value for the input field f_onchange(function): function what to do when value is ok f_oncancel(function): function what to do when dialog is canceld ismod(boo...
function inputDialogWidget(parent, title, value, f_onchange, f_oncancel, ismodal) { $(parent).append('<div id="Inputdialog" title="' + title + '">'); $("#Inputdialog").append('<input id="value" value="' + value + '">'); $("#Inputdialog").dialog({ modal : ismodal, buttons : { "Change" : function() { f_onch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openDlgFunc() {\n var tempTitle = $('#titleVal').val();\n var tempDesc = $('#descVal').val();\n\n $('#title').val(tempTitle);\n $('#description').val(tempDesc);\n\n\n $(\"#dialog-form\").dialog(\"open\");\n //Title box\n var addBoxes = \"<label for='titleVal' style='color:white'>Title</label><br>\"...
[ "0.66485476", "0.6145031", "0.6118401", "0.61060524", "0.6103683", "0.5941943", "0.5900058", "0.58686215", "0.57928413", "0.5778885", "0.57677853", "0.5740475", "0.5735994", "0.5726867", "0.5714606", "0.5713519", "0.5709333", "0.56941223", "0.5659018", "0.5647579", "0.5599457...
0.85155034
0
create a simple table parent: parent selector name: name of the table header: array of header object: array of object f_cell; dipslay cell content viewH: if header need to be displayed f_displayrow: function returning if row need to be displayed.
function createTable(parent, name, header, objects, f_cell, viewH, f_displayrow) { if(viewH == null) { viewH = true; } if(f_displayrow == null) { f_displayrow = function(index, obj) { return true; }; } $("#" + name).remove(); $(parent).append('<table id="' + name + '" class="' + tableBorder + '">'); i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startNewTableRow(parent,headerContent) {\n //Need both Table Row AND Table Header for each detail line\n var trEl = document.createElement('tr');\n parent.appendChild(trEl);\n\n //Insert table row header as child\n var thEl = document.createElement('th');\n thEl.textContent = headerContent;\n paren...
[ "0.63810325", "0.6355849", "0.62499934", "0.6146681", "0.6138236", "0.6080378", "0.60294217", "0.60107785", "0.59196746", "0.5914179", "0.5885661", "0.58622235", "0.5827967", "0.58129144", "0.5812865", "0.5807703", "0.57971054", "0.57967675", "0.57919866", "0.5787267", "0.578...
0.7887001
0
This function can destroy a projectile based on it's ID.
function destroyProjectile (id) { const projectiles = gameData.projectiles; for (let i = 0; i < projectiles.length; i++) { const projectileData = projectiles[i]; if (projectileData.id == id) { delete projectileData.id; break; } } io.sockets.emit("onSyncPro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(id) {}", "remove(id){\n let removedGob = null\n this.obstacles = this.obstacles.filter( (gob) => {\n return gob.id !== id\n })\n this.gobs = this.gobs.filter( (gob) => {\n if(gob.id === id){\n removedGob = gob\n return false\n } else {\n return true\n }...
[ "0.6351524", "0.62637824", "0.61544794", "0.6142765", "0.5965715", "0.5933264", "0.5908336", "0.5864024", "0.5864024", "0.5819638", "0.5769028", "0.5760561", "0.5757326", "0.5728324", "0.5723791", "0.57154894", "0.5706707", "0.5674308", "0.56558186", "0.5645553", "0.5634067",...
0.82386285
0
Magic number of Recorder.js.
static get MAGIC() { return 0x4b72; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMagic() { return this.protoData.Magic; }", "function getMagicString(dataView) {\n return `\\\n${String.fromCharCode(dataView.getUint8(0))}\\\n${String.fromCharCode(dataView.getUint8(1))}\\\n${String.fromCharCode(dataView.getUint8(2))}\\\n${String.fromCharCode(dataView.getUint8(3))}`;\n}", "function getMagi...
[ "0.5531527", "0.52582306", "0.52582306", "0.5203338", "0.5199103", "0.51781756", "0.51767474", "0.51767474", "0.517225", "0.51599497", "0.51255816", "0.51073444", "0.51073444", "0.5069553", "0.50689614", "0.50299436", "0.501865", "0.501865", "0.50091213", "0.49952126", "0.499...
0.61236364
0
Craziest component so far. We've had scrolling, we had buttons'n'text. Now it's time for some freakin WINDOWS! It's actually crazy simple, to be honest. Prelude to draggable windows. Only SIMULATES Windows UI, is NOT a JFRAME except in look. TITLE BAR MENU BUTTONS MENU BAR TOOL BAR STATUS BAR
function UIWindow(x,y,width,height,title = "",draggable = false, menuButton = false) { UIElement.call(this,x,y,width,height,"window"); // title this.title_bar = new UITitleBar(title,draggable,menuButton); UIElement.prototype.addSubElement.call(this,this.title_bar,0,0); this.title_bar.attach(this); // co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UITitleBar(text = \"\",draggable,menuButton = false)\r\n{\r\n\tUIElement.call(this,0,0,0,0,\"title_bar\");\r\n\tthis.text = text;\r\n\tthis.draggable = draggable;\r\n\tthis.attached = null;\r\n\t\r\n\tthis.title = new UILabel(text,\"center\");\r\n\tthis.title.font_colour = this.font_colour;\r\n\tthis.addS...
[ "0.64087266", "0.6079925", "0.60733944", "0.59473836", "0.5910214", "0.57932377", "0.5785102", "0.5781764", "0.5752413", "0.57463604", "0.57369775", "0.5732266", "0.572537", "0.57165504", "0.5691324", "0.5686424", "0.5685134", "0.5680113", "0.567001", "0.5668704", "0.5641754"...
0.6412868
0
Returns an associative arrow of mime types by extension If an extenstion has multiple mime types they will be returned
getMimeTypesByExtension(){ return { 'ai' : 'application/postscript', 'aif' : 'audio/x-aiff', 'aifc' : 'audio/x-aiff', 'aiff' : 'audio/x-aiff', 'asc' : 'text/plain', 'atom' : 'application/atom+xml', 'atom' : 'application/atom+xml', 'au' : 'audio/basic', 'avi' : 'video/x-msvideo', 'bcpio' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getExtensionMimeType() {\n return [\n {\n \"extension\": \"svg\",\n \"mimeType\": \"image/svg+xml\"\n },\n {\n \"extension\": \"gif\",\n \"mimeType\": \"image/gif\"\n },\n {\n \"extension\": \"jpeg\",\n \"mimeType\...
[ "0.73794544", "0.6505493", "0.64981645", "0.64424866", "0.64424866", "0.64424866", "0.64163375", "0.6350755", "0.6303644", "0.63016677", "0.62728727", "0.6272004", "0.62579715", "0.62579715", "0.6235799", "0.6215188", "0.61510384", "0.61408883", "0.6075558", "0.60542995", "0....
0.7631915
0
returns all reviews w/ critics data where movie_id = input
function list(movieId) { return knex("reviews as r") .join("critics as c", "r.critic_id", "c.critic_id") .select("*") .where("movie_id", movieId) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMovieReview (movieID) {\n\n // Get review data for movie based on 'movieID' variable\n var requestUrl = `https://imdb8.p.rapidapi.com/title/get-reviews?tconst=${movieID}&currentCountry=CA&purchaseCountry=CA` \n var metaScore;\n var imbdRating;\n\n fetch(requestUrl, {\n\t \"method\": \...
[ "0.65138286", "0.64385784", "0.6216395", "0.609585", "0.60176027", "0.59454477", "0.5876633", "0.58703023", "0.5870105", "0.58133906", "0.5805826", "0.57943237", "0.57601106", "0.57554114", "0.5750039", "0.569744", "0.5689451", "0.5684192", "0.56791246", "0.5668596", "0.56534...
0.73938787
0
returns first review w/ critics where review_id = input
function getReviewAndCritic(reviewId) { return knex("reviews as r") .select("*") .join("critics as c", "r.critic_id", "c.critic_id") .where("review_id", reviewId) .first() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getReview(submissionid, reviewid) {\n var sub = {}\n var index = -1;\n submissions.forEach(s => {\n index++;\n if (s.id == submissionid) {\n sub = s;\n }\n });\n var reviews = sub.reviews;\n var review = {}\n var indexr = -1;\n reviews.forEach(r => {...
[ "0.6612592", "0.62169653", "0.61976594", "0.59690803", "0.57781035", "0.5699766", "0.5571786", "0.5487008", "0.54119617", "0.5371968", "0.53295416", "0.5291564", "0.5272989", "0.52683043", "0.5230928", "0.5181176", "0.51274663", "0.5120052", "0.5086838", "0.5075029", "0.50683...
0.6546892
1
Add names to the gameboard through form
function addNamestoBoard() { const player1Name = document.querySelector("#player1").value; const player2Name = document.querySelector("#player2").value; playerOne.textContent = `${player1Name}`; playerTwo.textContent = `${player2Name}`; playerForm.reset(); document.querySelector(".players").classList.add("s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static insertPlayerNamesInChooseDreamForm() {\n let players = Utils.initialPlayersInfo();\n\n for (let i = 0; i < players.length; i++) {\n let nameArea = document.querySelector(`.js-choose-dream--p${i+1}__name`);\n let jobArea = document.querySelector(`.js-player-info--p${i+1}__job`);\n let sa...
[ "0.6797278", "0.66559553", "0.6449663", "0.64219904", "0.6416358", "0.6359633", "0.63339865", "0.6332744", "0.6288741", "0.62610686", "0.6231419", "0.62042344", "0.6196509", "0.6149202", "0.61340964", "0.61277497", "0.6123888", "0.60463345", "0.60412496", "0.6037872", "0.6017...
0.7200431
0
Function for getting latest ratea
function getLatestRates(){ rates.getLatestRates() .then(res =>{ console.log(res); console.log(res.conversion_rates); console.log(res.conversion_rates.AED); console.log(res.base); ui.render(res); }) .catch(err =>{ console.log(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLatestRates() {\n switch (this.state.api) {\n case 'coincap':\n this.getLatestRatesCoinCap();\n break;\n case 'poloniex':\n this.getLatestRatesPoloniex();\n break;\n case 'kraken':\n this.getLatestRatesKraken();\n break;\n case 'wex':\n thi...
[ "0.63462543", "0.6295466", "0.62457114", "0.61379445", "0.61173636", "0.611451", "0.6112362", "0.61065316", "0.60886294", "0.6072057", "0.60078955", "0.595804", "0.5927992", "0.5923382", "0.59106183", "0.5884419", "0.5884345", "0.5882042", "0.58529615", "0.5846582", "0.583346...
0.68885875
0
Iterate over the left side
function iteratorLeft () { ++frame_left; for (var i=0,len=obj.left.length; i<len; i+=1) { if (frame_left > opt.startFrames_left[i]) { var isNull = RG.isNull(obj.left[i]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function l(e){for(c=1;e=o.shift();)e()}", "function iterationLeftShift(){\r\n\tvar leftshifts = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];\r\n\treturn leftshifts;\r\n}", "msbRightIterator(count, fn) {\n for (let i = 0; i < count; i++) {\n fn(i);\n }\n }", "function zipLeft_(self, that) {\n...
[ "0.6580698", "0.6376864", "0.60379165", "0.5990204", "0.57053715", "0.5659654", "0.56332994", "0.5616915", "0.5599054", "0.55922306", "0.5565374", "0.5565094", "0.55482763", "0.55124897", "0.5507818", "0.5478114", "0.5475151", "0.5475151", "0.5466433", "0.5447036", "0.5437727...
0.65077573
1
Iterate over the right side
function iteratorRight () { ++frame_right; for (var i=0,len=obj.right.length; i<len; i+=1) { if (frame_right > opt.startFrames_right[i]) { var isNull = RG.isNull(obj.right[i]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "msbRightIterator(count, fn) {\n for (let i = 0; i < count; i++) {\n fn(i);\n }\n }", "function forEachRight(collection, iteratee) {\n const func = Array.isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, iteratee);\n}", "cloneItensInRight(){\r\n for (const item...
[ "0.6250427", "0.6088084", "0.590511", "0.58884454", "0.58022135", "0.57508594", "0.57446265", "0.57149476", "0.57146543", "0.56926906", "0.56783754", "0.56762326", "0.5670484", "0.5655917", "0.5643382", "0.5563597", "0.5547286", "0.55299616", "0.55243415", "0.5515065", "0.547...
0.6428964
0
Creates allItems object that collects all listItems from context grouped by PM name Formats each list item as [Project Name] [Advisor Name] and pushes to an array which is then joined to create a string containing the body of the PM update email
formatEmailUpdate(listItems) { const allItems = {} listItems.forEach(item => { const itemPmName = item.pm_name; allItems[itemPmName] ? allItems[itemPmName].push(item) : allItems[itemPmName] = [item]; }) const updateArray = [] for (let [key, value] of Obj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatUpdateEmailAddresses(listItems) {\n const pmEmails = []\n listItems && listItems.forEach(item => !pmEmails.includes(item.pm_email) && pmEmails.push(item.pm_email))\n return pmEmails.join('; ')\n }", "function decorateDeliveryItems(items) {\n angular.forEach(items, functio...
[ "0.6208491", "0.5427773", "0.52941185", "0.5226685", "0.5204329", "0.51797974", "0.5158305", "0.5101003", "0.50453436", "0.50278246", "0.5011078", "0.49944603", "0.4983742", "0.49771023", "0.49769258", "0.49648175", "0.4956072", "0.49523517", "0.49455002", "0.4905578", "0.488...
0.67197007
0
Gets all the email addresses of all PMs with current list items and joins into a string of emails to be supplied to the mailto
formatUpdateEmailAddresses(listItems) { const pmEmails = [] listItems && listItems.forEach(item => !pmEmails.includes(item.pm_email) && pmEmails.push(item.pm_email)) return pmEmails.join('; ') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatEmailUpdate(listItems) {\n const allItems = {}\n listItems.forEach(item => {\n const itemPmName = item.pm_name;\n allItems[itemPmName] ? allItems[itemPmName].push(item) : allItems[itemPmName] = [item];\n })\n\n const updateArray = []\n\n for (let [key,...
[ "0.6656009", "0.6335624", "0.61050814", "0.6007623", "0.5934875", "0.5932559", "0.59163713", "0.5862804", "0.58315593", "0.5771715", "0.5690298", "0.56474525", "0.56351775", "0.55823964", "0.5576562", "0.55629474", "0.552771", "0.55252147", "0.54873854", "0.5472486", "0.54640...
0.7627189
0
Resolve a builder. This needs to be a string which will be used in a dynamic `import()` clause. This should throw if no builder can be found. The dynamic import will throw if it is unsupported.
resolveBuilder(builderStr) { const [packageName, builderName] = builderStr.split(':', 2); if (!builderName) { throw new Error('No builder name specified.'); } const packageJsonPath = require.resolve(packageName + '/package.json', { paths: [this._root], });...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Builder() {}", "function Builder() {}", "function Builder() {}", "function getComponentBuilder(componentName) {\n if (isRegisteredJSComponent(componentName)) {\n return componentBuilders.jsComponentBuilder;\n } else {\n return componentBuilders.nativeComponentBuilder;\n }\n}",...
[ "0.4848961", "0.4848961", "0.4848961", "0.46337855", "0.46319407", "0.46262068", "0.4552197", "0.4480802", "0.4479025", "0.4469699", "0.44325668", "0.44047955", "0.43961564", "0.43845102", "0.43842593", "0.42989463", "0.42930102", "0.4281792", "0.42693487", "0.42661715", "0.4...
0.80400574
0
This uses a dynamic import to load a module which may be ESM. CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript will currently, unconditionally downlevel dynamic import into a require call. require calls cannot load ESM code and will result in a runtime error. To workaround this, a Functio...
function loadEsmModule(modulePath) { return new Function('modulePath', `return import(modulePath);`)(modulePath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "import(moduleInstanceObject) {\n throw Error('Not implemented');\n }", "async load () {\n throw (new TypeError(`Module ${this.constructor.name} should have a load() method`));\n // Do whatever you want here :)\n }", "async loadEsmModule(modulePath, query = '') {\n const cacheKey = modulePath + qu...
[ "0.59937394", "0.59440047", "0.57529294", "0.57262486", "0.5674013", "0.5661669", "0.55969423", "0.55861235", "0.55603135", "0.55485266", "0.5436806", "0.543586", "0.5434256", "0.543021", "0.543021", "0.5413118", "0.54042774", "0.5400042", "0.5400042", "0.5383574", "0.5359847...
0.654323
1
Reap: Deal 1 D to a creature.
setupCardAbilities(ability) { this.reap({ target: { cardType: 'creature', gameAction: ability.actions.dealDamage({ amount: 1 }) } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deal() {\n\tvar randCard = deck.getCards()[Math.floor(Math.random() * 52)];\n\treturn randCard;\n}", "function died(event) {\n//retrieve an itemizer item\nvar item = itemService.fetch(\"1\")//fetches an item from the itemizer item pool string of pool ID\n //Instanciate the item at the location where th...
[ "0.5581759", "0.5551629", "0.5515049", "0.5512568", "0.55095613", "0.54962194", "0.5485072", "0.5389812", "0.5342009", "0.5336533", "0.5301991", "0.5292023", "0.5276826", "0.5260757", "0.52427274", "0.5242692", "0.5238229", "0.52236795", "0.51976794", "0.5195967", "0.5192082"...
0.55757815
1
clicking an element will initiate scroll to top of page style: if false, will not reformat CSS cursor
function scrollToTop(element, speed, style) { if (style != false) $(element).css("cursor", "pointer"); $(element).on("click", function() { $("html, body").animate({scrollTop: 0}, speed); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollToTop() {\n DOCUMENT_ELE.scrollTo({ top: 0, behavior: 'smooth' });\n}", "function scrollToTop(e) {\n e.preventDefault();\n setOpen(false);\n scroll.scrollToTop();\n }", "function toTheTopButton() {\n window.scrollTo({\n top: 0,\n behavior: \"smooth\",\n });\n }", ...
[ "0.7145774", "0.69171524", "0.6862554", "0.6859161", "0.68067575", "0.6767775", "0.6738368", "0.67109954", "0.6692288", "0.6674977", "0.6672669", "0.665747", "0.6622114", "0.66192013", "0.66073954", "0.65894014", "0.6586567", "0.656479", "0.6557411", "0.65515727", "0.6541371"...
0.7588987
0