Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Construct a new output widget.
constructor(options) { super(); this._mimeType = options.mimeType; this.addClass(CLASS_NAME); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n super.render();\n this._outputView = new OutputArea({\n rendermime: renderMime,\n contentFactory: OutputArea.defaultContentFactory,\n model: this.model.outputs\n });\n this.pWidget.insertWidget(0, this._outputView);\n\n this.pWidget.a...
[ "0.67768365", "0.6772805", "0.6359571", "0.6200352", "0.6192105", "0.61329556", "0.6081498", "0.59399414", "0.59298456", "0.5900913", "0.5852638", "0.5851472", "0.58122605", "0.5797785", "0.5782519", "0.5685834", "0.5671845", "0.5671144", "0.56703246", "0.56368095", "0.553204...
0.0
-1
write function for submitting form information for update
componentDidMount() { this.props.getClientTransaction(this.props.id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSubmit(e) {\r\n // update to database\r\n }", "_submitForm() {\n\t\tconst { inputName, inputBio, inputLocation, inputImage } = this.state;\n\t\tconst { updateAbout, userId, getAbout, routeId } = this.props;\n\t\tupdateAbout(userId, inputName, inputBio, inputLocation, inputImage, (success) => {...
[ "0.75603795", "0.73446864", "0.7222969", "0.6985238", "0.6919241", "0.6910612", "0.68215144", "0.6764433", "0.6715771", "0.6685627", "0.66595894", "0.6655617", "0.6643616", "0.6632706", "0.66121453", "0.65757006", "0.65694755", "0.6561931", "0.6545851", "0.65364647", "0.65313...
0.0
-1
console.log(addExp(2, 2)) console.log(addArror(2, 2)) Function Declaration
function addDecl(a, b) { return a + b }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add1() {\r\n console.log(\"U R in Add1 Function \" + (2 + 2));\r\n}", "function ex1(){\n return 12+20\n }", "function add(a,b) {\n console.log(a+b)\n}", "function add(a,b){\r\nconsole.log(a+b);\r\n}", "function add(a,b){return a+b;}", "function add(a,b){\n console.log(a+b);\n}", "fun...
[ "0.74815756", "0.73205876", "0.72966623", "0.7292072", "0.7280775", "0.7234439", "0.7234439", "0.72180027", "0.7209003", "0.7160424", "0.7147357", "0.71123135", "0.7109483", "0.7104716", "0.71024853", "0.70937073", "0.7091475", "0.7091475", "0.70868194", "0.70702624", "0.7067...
0.0
-1
Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[15,7],[9,20],[3]] Example 2: Input: root = [1] Output: [[1]] Example 3: Input: root = [] Output: [] Constraints: The number of nodes in the tree is in the range [0, 2000]. 1000 <= Node.val <= 1000
function TreeNode(val, left, right) { this.val = val === undefined ? 0 : val this.left = left === undefined ? null : left this.right = right === undefined ? null : right }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function perLevel (root){\n var result = [];\n var queue = [];\n queue.push(root);\n queue.push(null);\n var i = 0;\n while (i< queue.length){\n var curr = queue[i];\n if(curr === null){\n if(i<queue.length-1){\n queue.push(null);\n }\n console.log(result);\n result = [];\n ...
[ "0.6659562", "0.62615305", "0.6256844", "0.6242175", "0.6153845", "0.59495765", "0.5928785", "0.59187716", "0.59029084", "0.58914906", "0.5874755", "0.586519", "0.58542377", "0.58169734", "0.5793382", "0.57660687", "0.5757567", "0.575363", "0.5730846", "0.5689569", "0.5688894...
0.0
-1
recalcualate sums / .each + .chidren have a bug, cannot use .children("something > somethingelse") !!
function recalculate_sums () { $(".dei-wrapper-has-leaf").reverse().each(function() { var user_sum = 0; $(this).children(".dei-wrapper").reverse().each(function() { /*$(this).children(".dei-user-value").children("div").children("input")*/ user_sum += $(this).children(".dei-user-value").children("div").children("input").parseNumber({format:"#,###", locale:"cz"}); }); $(this).children(".dei-user-value").children("div").children("input").val(user_sum); }); $("#user-sum-last").html($(".dei-wrapper-0:last > .dei-user-value > div > input").parseNumber({format:"#,###", locale:"cz"})); format_numbers(); chart2(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sumValues(){\n if(!this.root) return 0;\n \n let total = this.root.val;\n\n function sumHelper(node){\n // want to go through each child of a node \n for(let child of node.children){\n // grab the value and add it to the total\n total += child.val;\n // check for any chil...
[ "0.6565714", "0.63494813", "0.615436", "0.6125009", "0.60740876", "0.59847075", "0.5961949", "0.5908172", "0.58559495", "0.58556694", "0.58021724", "0.57900274", "0.5785652", "0.57645065", "0.56655437", "0.56619155", "0.56490856", "0.5622535", "0.5618352", "0.56039786", "0.55...
0.5502021
26
format numbers hardcoded to czech for now
function format_numbers () { var diff = Math.round($("#user-sum-last").parseNumber({format:"#,###", locale:"cz"})) - Math.round( $("#old-sum-last").parseNumber({format:"#,###", locale:"cz"})); if (diff < 0) { $("#diff-last-label").html("Ještě můžete rozdělit: "); $("#diff-last").html(-diff); $("#diff-last").formatNumber({format:"#,###", locale:"cz"}); $("#diff-last").removeClass("blue"); $("#diff-last").removeClass("red"); $("#diff-last").addClass("green"); } else { if (diff == 0) { $("#diff-last-label").html("Jste přesně na rozpočtu: "); $("#diff-last").html(diff); $("#diff-last").formatNumber({format:"#,###", locale:"cz"}); $("#diff-last").removeClass("red"); $("#diff-last").removeClass("green"); $("#diff-last").addClass("blue"); } else { $("#diff-last-label").html("Přesáhl/a jste rozpočet o: "); $("#diff-last").html(diff); $("#diff-last").formatNumber({format:"#,###", locale:"cz"}); $("#diff-last").removeClass("blue"); $("#diff-last").removeClass("green"); $("#diff-last").addClass("red"); } } $("#user-sum-last").formatNumber({format:"#,###", locale:"cz"}); $("#old-sum-last").formatNumber({format:"#,###", locale:"cz"}); $(".dei-user-value > div > input").each(function() { $(this).parseNumber({format:"#,###", locale:"cz"}); $(this).formatNumber({format:"#,###", locale:"cz"}); }); $(".dei-old-value > div > input").each(function() { $(this).parseNumber({format:"#,###", locale:"cz"}); $(this).formatNumber({format:"#,###", locale:"cz"}); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formateraPris(num) {\n return num.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1 ')\n }", "function formatPersian(num){\r\n var tmp = num;\r\n tmp = tmp.toString();\r\n \r\n for (var i = 0; i < 10; i++) {\r\n for (var z = 0; z < tmp.length; z++) \r\n tmp = tmp.replace(i, P...
[ "0.6893452", "0.68547255", "0.68460816", "0.6786331", "0.67832947", "0.6749866", "0.6727908", "0.67123175", "0.666231", "0.6658517", "0.66471237", "0.6602161", "0.6599567", "0.6595617", "0.65521336", "0.65443903", "0.6514849", "0.6506683", "0.65016955", "0.64872813", "0.64872...
0.6205215
75
function check leap year
function isLeapYear(year) { if (year % 400 === 0) return true; if (year % 100 === 0) return false; return year % 4 === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectleapyear(year){\n if (year % 4 !== 0) {\n return false;\n } else if (year % 100 !== 0) {\n return true;\n } else if (year % 400 !== 0) {\n return false;\n } else {\n return true;\n }\n }", "function is_leap_year(year){\n\n if(!(year % 400)) return true\n if(!(ye...
[ "0.85655606", "0.843599", "0.84166", "0.8388778", "0.8355047", "0.8333722", "0.8287203", "0.8262122", "0.81956345", "0.8171885", "0.81632143", "0.8160092", "0.8150975", "0.8142204", "0.8102767", "0.8100131", "0.8096111", "0.8095705", "0.80792105", "0.80747074", "0.8064547", ...
0.7777638
58
Sets the traits at the start of the dialog.
function setTraits(newOriginalTraits) { originalTraits = newOriginalTraits || {}; availableTraits = {}; $.each(originalTraits, function(key, val) { availableTraits[key] = val; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFeatTraits(e) {\n e.preventDefault();\n character.featTraits.features = document.getElementById('featsBlock').value;\n character.featTraits.traits = document.getElementById('traitsBlock').value;\n // character.loadFlags.\n}", "function setTraitsWithRefresh(newOriginalTraits) {\n se...
[ "0.52836066", "0.5144742", "0.5063738", "0.5015776", "0.50141656", "0.5004993", "0.49873108", "0.49592894", "0.49514854", "0.4944779", "0.49444044", "0.49307105", "0.4926017", "0.49033827", "0.4890387", "0.4875871", "0.4850413", "0.48429513", "0.48332816", "0.48003075", "0.47...
0.5414563
0
Set the traits and force a refresh
function setTraitsWithRefresh(newOriginalTraits) { setTraits(newOriginalTraits); updateListComponent(selectedTraitsList, availableTraits); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTraits(newOriginalTraits) {\n originalTraits = newOriginalTraits || {};\n availableTraits = {};\n $.each(originalTraits, function(key, val) {\n availableTraits[key] = val;\n });\n }", "update(deltaTime){\n this.traits.forEach(trait =>{\n tra...
[ "0.6567746", "0.6074036", "0.5978202", "0.5922549", "0.5717287", "0.5717287", "0.57041854", "0.56341517", "0.56341517", "0.55221367", "0.55221367", "0.5356077", "0.52841663", "0.52274597", "0.5191112", "0.5185487", "0.5184992", "0.5169904", "0.5103678", "0.5078893", "0.505737...
0.7275791
0
Update the options map with a new set of options, deleting old options.
function updateOptionsMap(newOptions) { var newOptionsMap = {}; $.each(newOptions, function(index, val) { // some feeds use name instead of title. if ( val.name && !val.title ) { val.title = val.name; } newOptionsMap[val.id] = val; }); return newOptionsMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateOptions(options)\n\t{\n\t\t_options = jQuery.extend(true, {}, _options, options);\n\t}", "manageOptions () {\n if (Utils.isFunction(this.data.options)) {\n if (!this.options) {\n this.options = new Map();\n }\n const newOptions = this.data.opt...
[ "0.725901", "0.69931424", "0.6819155", "0.6692694", "0.66829395", "0.6678282", "0.66562873", "0.66484565", "0.6487042", "0.6408885", "0.63650125", "0.63621527", "0.63261527", "0.6255394", "0.6233301", "0.621452", "0.615234", "0.61329186", "0.61297774", "0.61297774", "0.607013...
0.6066165
21
Update a list component.
function updateListComponent(listComponent, optionsMap) { var newOptions = []; $.each(optionsMap, function(key, val) { if (val) { // some feeds use name instead of title. if ( val.name && !val.title ) { val.title = val.name; } newOptions.push({ value : key, text : val.title, qtip : key }); } }); listComponent.setOptions(newOptions); return newOptions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleListUpdate() {\n\n // Add listeners for when the user makes a selection.\n this._$el.find('input.aims-layer-input')\n .click(this.handleChange.bind(this));\n }", "updateList() {\n console.warn( 'List could not be updated; it has not yet been initialized.' );\n }", "updateLis...
[ "0.6934649", "0.6654921", "0.6636257", "0.66322935", "0.65303916", "0.65062743", "0.6483229", "0.64452714", "0.6394976", "0.6368791", "0.63392353", "0.6327396", "0.63265055", "0.63200027", "0.6318037", "0.63035303", "0.630011", "0.630011", "0.630011", "0.62747866", "0.6231122...
0.5853668
50
Using the CQ server search for traits. This will after asynchronously calling the server.
function searchForTraits(field, newV, oldV, listToUpdate) { if (newV !== oldV) { listToUpdate.hide(); CQ.Ext.Msg.wait(CQ.I18n.getMessage("Searching....")); $.getJSON(traitLookupUrl, { q : newV }, function(result) { CQ.Ext.Msg.wait(CQ.I18n.getMessage("Searching....")).hide(); if (result.traits) { debug("Value set to " + JSON.stringify(result.traits)); listToUpdate.options = []; newOptionsMap = updateOptionsMap(result.traits); updateListComponent(listToUpdate, newOptionsMap); listToUpdate.show(); } }).error(function() { CQ.Ext.Msg.wait(CQ.I18n.getMessage("Search Failed, please contact support")).hide(); CQ.Ext.Msg.alert(CQ.I18n.getMessage('Error'), CQ.I18n.getMessage('Search Failed, please contact support')); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async search() {\n this.mixpanelTrack(\"Discover Stax Search Started\");\n if(this.state.catgorychoosen==Strings.discover_category_home)\n { \n await this.catWisestax(this.state.searchquery);\n }\n else\n { \n await this.categoryselected(\"\", this.state.catgor...
[ "0.5572301", "0.533536", "0.53045297", "0.5200799", "0.51753986", "0.5120888", "0.5072993", "0.5038474", "0.49999008", "0.49896803", "0.49675977", "0.4914877", "0.48986486", "0.4843904", "0.48144227", "0.4807042", "0.48006538", "0.47970924", "0.4783381", "0.47754252", "0.4774...
0.56625676
0
Create a lookup dialog. Constructor.
function newLookupDialog() { // build the list of possible traits to add with a listener on selection. newTraitsList = CQ.Util.build({ allowBlank : true, fieldLabel : CQ.I18n.getMessage('Traits to add'), fieldSubLabel : CQ.I18n.getMessage('select to add'), xtype : 'selection', type : 'checkbox', listeners : { selectionchanged : function(list, value, checked) { debug("Adding Trait " + value + " " + checked); if ( checked && value && newOptionsMap[value] ) { // add the new trait to the availableTraits availableTraits[value] = newOptionsMap[value]; newOptionsMap[value] = false; // remove from the newTraitsList updateListComponent(newTraitsList, newOptionsMap); // add to the current traits updateListComponent(selectedTraitsList, availableTraits); } } } }); // hide it till it has some contents. newTraitsList.hide(); // build a list of selected traits, and bind a to the checkbox click to allow removal. selectedTraitsList = CQ.Util.build({ allowBlank : true, fieldLabel : CQ.I18n.getMessage('Current traits'), fieldSubLabel : CQ.I18n.getMessage('select to remove'), xtype : 'selection', type : 'checkbox', listeners : { selectionchanged : function(list, value, checked) { debug("Removeing Trait " + value + " " + checked); if ( checked && value && availableTraits[value] ) { // add the new trait to the availableTraits newOptionsMap[value] = availableTraits[value]; availableTraits[value] = false; // remove from the newTraitsList updateListComponent(newTraitsList, newOptionsMap); // add to the current traits updateListComponent(selectedTraitsList, availableTraits); } } } }); // populate the list with the currently available traits (ie the original traits). updateListComponent(selectedTraitsList, availableTraits); var trait = null; var traitValue = null; // build a search box and bind blur and enter to performing the search. // we cant use a suggests box because the search is too slow to be usable, taking between 1s and 30s to respond. trait = CQ.Util.build({ allowBlank : true, fieldLabel : CQ.I18n.getMessage('Trait'), fieldSubLabel : CQ.I18n.getMessage('enter search'), url : traitLookupUrl, name : 'q', xtype : 'textfield', listeners : { change : function(field, newV, oldV) { searchForTraits(field, newV, oldV, newTraitsList); traitValue = newV; }, specialkey : function(field, e) { debug("Special key "); // e.HOME, e.END, e.PAGE_UP, e.PAGE_DOWN, // e.TAB, e.ESC, arrow keys: e.LEFT, e.RIGHT, e.UP, e.DOWN if (e.getKey() == e.ENTER) { var newV = trait.getValue(); searchForTraits(trait, newV, traitValue, newTraitsList); traitValue = newV; } } } }); var panels = CQ.Util.build({ "xtype" : 'panel', "layout" : 'column', "items" : [ { "xtype" : 'panel', bodyBorder : false, border : false, title : CQ.I18n.getMessage("Search Traits"), columnWidth: 0.5, items : [{ "xtype" : 'panel', layout : 'form', bodyBorder : false, border : false, items : [trait, newTraitsList] }] }, { "xtype" : 'panel', bodyBorder : false, border : false, title : CQ.I18n.getMessage("Selected Traits"), columnWidth: 0.5, items : [{ "xtype" : 'panel', layout : 'form', bodyBorder : false, border : false, items : [selectedTraitsList] }] } ] }); // wrap the components up in a dialog if ( container ) { // invoked by the client context, so insert ourselves into that panel // as there are no other hooks. container.removeAll(); container.add(panels); // add hooks in container.mon(container,{ 'beforesubmit' : function() { // save the state including full trait objects to the // traitsmanager. traitsManager.setAvailableTraits(availableTraits); // stop the container performing a reload, since we have already // saved and there is no need to reconfigure the control. // normally this would result in reloading all the js files and // the data from the server. This component doesnt need that. container.hide(); return false; } }); container.mon(container,{ 'loadcontent' : function() { // can't use the information from the dialog since that will // not contain all the information needed, so have to use // the data from the traitsManager. traitsManager.getAvailableTraits(setTraitsWithRefresh); } }); return { // empty }; } else { var searchDialog = new CQ.Dialog({ "height" : 200, "width" : 600, "title" : CQ.I18n.getMessage("Manage Traits"), "buttons" : [ { "text" : CQ.I18n.getMessage("OK"), "handler" : function() { debug("Saving "+JSON.stringify(availableTraits)); callback(availableTraits); } }, { "text" : CQ.I18n.getMessage("Cancel"), "handler" : function() { debug("Cancel "+JSON.stringify(originalTraits)); callback(originalTraits); } } ], items : [panels] }); // expose only the functions we want to. return { /** * Show the dialog. * @param currentAvailableTraits the available traits. * @param oncompleteCallback a callback function to save the selected traits. * called with a map of traits keyed by id callback(availableTraits) * @returns nothing. */ show : function(currentAvailableTraits, oncompleteCallback) { setTraits(currentAvailableTraits); setCallback(oncompleteCallback); searchDialog.show(); }, /** * hide the dialog, but dont dispose. * @returns */ hide : function() { searchDialog.hide(); } }; } } // end of constructor function.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showLookupDialog() {\n // Create new master & add to model.\n let master = this.get('store').createRecord('components-examples/flexberry-groupedit/shared/master', { text: 'Master text' });\n let deteils = this.get('model.details');\n\n deteils.forEach((item) => {\n item.set('master', mas...
[ "0.62095714", "0.5434648", "0.5432598", "0.53854954", "0.53664035", "0.533054", "0.5309781", "0.53031266", "0.5173451", "0.5169734", "0.5166936", "0.51602256", "0.5114037", "0.5097765", "0.5090484", "0.5049749", "0.50436854", "0.5040288", "0.50385433", "0.50182116", "0.499998...
0.621525
0
param line String returns Boolean: string contains keyWord from specified external JSON
function containsNote(line) { return Object.keys(keyWords).some(function(key) { return new RegExp(keyWords[key] + ':').test(line); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordMatch(word,offset) {\n if (offset==undefined) offset = -1;\n var i=0;\n for (;i<word.length && json.charAt(at+i+offset)==word.charAt(i);i++) {}\n if (i>=word.length) {\n at += offset+i;\n next();\n return true;\n ...
[ "0.60328686", "0.6013062", "0.599272", "0.56197226", "0.5590289", "0.5571183", "0.5509352", "0.55017835", "0.5480567", "0.54667753", "0.5461427", "0.5411303", "0.53907967", "0.539012", "0.5381956", "0.53554374", "0.53478897", "0.5344762", "0.5294137", "0.52891445", "0.5275567...
0.70894027
0
param file String returns Array of TODOs w/ line location & file name
function retrieveTodos(file) { return fs.readFileSync(file, 'utf8').split('\n').map(function(line, index) { // if line includes TODO, format it // check through keys in key-word object & make sure it is included in line (validate using regex) if (containsNote(line)) { return formatter.line(line, index + 1); } }).filter(function(line) { return line; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSpecFromTXT(spec_name, file){\n\t\tlet _this = this;\n\t\tlet lista = [];\n\t\tlet listb = [];\n\t\tlet reader = new FileReader;\n\n\t\treader.onload = function(){\n\t\t\t// parse into lists\n\t\t\tlet points = _this.getPointsFromTXTData(reader.result);\n\t\t\t_this.addSpec(spec_name, points);\n\t\t}\n\n\t\trea...
[ "0.5920355", "0.5824774", "0.5775709", "0.5775709", "0.5763578", "0.576206", "0.56777155", "0.5649373", "0.5537921", "0.5457418", "0.5415451", "0.539698", "0.5396593", "0.53776914", "0.5334655", "0.53229415", "0.5318498", "0.5301885", "0.52554345", "0.5255269", "0.5247932", ...
0.73825717
0
param dirOrFile String returns String of Files' header & TODOs in order
function allNotes(dirOrFile) { if (fs.lstatSync(dirOrFile).isFile() && containsNote(fs.readFileSync(formatter.path(dirOrFile)))) { // file header & formatted TODOs return formatter.header(dirOrFile) + '\n' + retrieveTodos(dirOrFile).join('\n'); } else if (fs.lstatSync(dirOrFile).isDirectory()) { // iterate through all dirs & call allNotes on each return formatter.notes(fs.readdirSync(dirOrFile).map(function(subDirOrFile) { return allNotes(dirOrFile + '/' + subDirOrFile); }).join('\n\n')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_formatFiles(files) {\n let fileList = [];\n if (files && files.length > 0) {\n for (let i = 0; i < files.length; i++) {\n let file = files[i];\n\n if (!file.tags || file.tags.indexOf('attachment') == -1) {\n fileList[i] = {\n ...
[ "0.5690915", "0.52839303", "0.52477074", "0.5210965", "0.5157513", "0.512165", "0.512165", "0.512165", "0.5116469", "0.5091762", "0.5079982", "0.50797236", "0.5073692", "0.5055232", "0.50483066", "0.50200987", "0.49554422", "0.49554422", "0.49554422", "0.49554422", "0.4955442...
0.5733579
0
Init the hiding state
init() { this.entity.component('direction').setFromVelocity(); this.entity.velocity.setX(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide({ state }) {\n state.visable = false;\n }", "hide() {\n this.isVisible = false;\n }", "function init(){\n $(\"#hide\").hide();\n $(\"#hide-button\").hide();\n $(\"#hide-go\").hide();\n }", "onBeforeHide() {\n this.is_shown_ = false;\n }", "onHide() {}", "onHid...
[ "0.73028725", "0.72744274", "0.72249", "0.72167724", "0.7179613", "0.7179613", "0.70578057", "0.7049285", "0.69326085", "0.6924409", "0.69049186", "0.68977106", "0.68871766", "0.6856245", "0.6855062", "0.6845779", "0.68087596", "0.67262805", "0.6710187", "0.6702831", "0.66906...
0.0
-1
Setup STATUS IDB local database
function updateStatusData() { var requestURL = 'comm/getStatus'; var method = 'POST'; var headers = { 'Accept': 'application/json', 'Content-Type': 'application/json' }; var body = { all: true } jsonBody = JSON.stringify(body); fetch(requestURL, { headers: headers, method: method, body: jsonBody }).then((response) => { if (parseInt(response.clone().status) < 400) { // fetch was successful, store it in the IDB. response.clone().json().then((result) => { for(var i in result.zoneStatus){ StatusIDBFuncSet.addData(StatusIDBSettings.tables[0].tableName, result.zoneStatus[i]); } }).catch((err) => { console.log(`[SW] ERROR in status json: ${err}`); console.log(response.clone().json()); }) } else { console.log('[SW] Server returned error for /comm/getStaus:', response.clone().status); } }).catch((err) => { console.log('[SW] Failed to get new status for loc: ', loc); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static setup() {\n this.dbPromise = idb.open('mws-db', 2, upgradeDb => {\n switch (upgradeDb.oldVersion) {\n case 0:\n upgradeDb.createObjectStore('restaurants', { keyPath: 'id' });\n console.log('created db v1');\n case 1:\n ...
[ "0.71222425", "0.6861194", "0.6827572", "0.6729933", "0.661395", "0.65165997", "0.6504145", "0.64295226", "0.6418474", "0.63928473", "0.6318075", "0.6273889", "0.62657875", "0.6228354", "0.620355", "0.6201112", "0.61809987", "0.61700416", "0.6164648", "0.61350024", "0.6132862...
0.0
-1
Setup REQUEST IDB local Database
function openRequestDatabase() { var indexedDBOpenRequest = indexedDB.open('request_storage'); indexedDBOpenRequest.onerror = (error) => { console.log("[SW] ERROR: An error occurred and the IDB database could not be made."); } indexedDBOpenRequest.onupgradeneeded = () => { // Executes if the database needs to update. indexedDBOpenRequest.result.createObjectStore('post_requests', { autoIncrement: true, keyPath: 'id' }); } indexedDBOpenRequest.onsuccess = () => { POST_db = indexedDBOpenRequest.result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async prepareDatabase() {\n this.db = await this.addService('db', new this.DatabaseTransport(this.options.db));\n }", "function initDB(){\n const db = new Localbase(\"TracerDB\");\n return db\n}", "static setup() {\n this.dbPromise = idb.open('mws-db', 2, upgradeDb => {\n switch...
[ "0.71693796", "0.70720214", "0.7011228", "0.6907685", "0.6780785", "0.6750302", "0.66815525", "0.66544", "0.6650793", "0.6624454", "0.6606718", "0.65839106", "0.6582567", "0.65699816", "0.65647614", "0.6508088", "0.6470886", "0.6435072", "0.6434898", "0.6380509", "0.63790095"...
0.6487227
16
Funtion to load all eventlisteners
function loadEventListeners() { container.addEventListener("click", (e) => { manageLikes(e); }); document.addEventListener("scroll", btnHandling); if(followBtn){ followBtn.forEach((btn) =>{ btn.addEventListener("click", e => { manageFollowers(e); }); }); } container.addEventListener("click", (e) => { showDeletePost(e); }); document.body.addEventListener("click", (e) => {hideDeletePost(e);}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadAllEventListeners() {\n // Buttons click event (Event Delegation)\n buttons.addEventListener(\"click\", calculate);\n}", "function loadEventListeners(){\n\n // get dom class names\n const DOM = UICtrl.getDOMStrings();\n //create event listener on add btn 'true icon'\n d...
[ "0.7413791", "0.7238713", "0.71397114", "0.70917124", "0.7012351", "0.6992451", "0.6962589", "0.69594514", "0.6947959", "0.69434154", "0.69426936", "0.6939615", "0.6939615", "0.6905178", "0.69008356", "0.68846613", "0.6883826", "0.6872579", "0.6852769", "0.6837041", "0.682194...
0.6657794
44
Function to hide/unhide follow/unfollow button in header section of a profile
function btnHandling() { // On same pages these buttons are not defined try { const userID = container.dataset.profile; const currentProfileID = document.querySelector(".post-actions").dataset.owner; if(userID !== currentProfileID) { const header = document.querySelector(".posts-header"); const topBtn = document.querySelector(".btn-follow.top"); const bottomBtn = document.querySelector(".btn-follow.bottom"); const position = bottomBtn.getBoundingClientRect().bottom; const height = header.offsetHeight; if(position < height) { topBtn.classList.add("active"); } else { topBtn.classList.remove("active"); } } } catch{return} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_unfollow(response) {\n\n $('#follow-button-' + response.user_id).hide();\n $('#unfollow-button-' + response.user_id).show();\n }", "function hideSocialButtons() {\n if (window.__peepCfg.socialButtonsEnabled == false) {\n var socialDisplay = document.querySelector('.social');\n socialD...
[ "0.7384302", "0.6683898", "0.6581218", "0.653117", "0.65264714", "0.64526916", "0.64358246", "0.6434558", "0.64217067", "0.63487047", "0.63080895", "0.62598777", "0.62343353", "0.6233094", "0.6226996", "0.6214376", "0.62107015", "0.61912006", "0.61804986", "0.61434495", "0.61...
0.5766144
81
Function to get csrf_token for asynchronous tasks
function getCookie(name) { let cookieValue = null; if (document.cookie && document.cookie !== '') { const cookies = document.cookie.split(';'); for (let i = 0; i < cookies.length; i++) { const cookie = cookies[i].trim(); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) === (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getCSRFToken() {\n let that = this;\n return that._request('GET', that._getUrl('simplecsrf/token.json'), {}, that.localHeaders)\n .then(function (res) {\n console.log(\"CSRF\",res.body);\n that.csrf = res.body.token;\n });\n }", "function getCSRFToken() {\r\n var csrfToken ...
[ "0.7773918", "0.7551454", "0.7381037", "0.72482896", "0.7230353", "0.7192408", "0.7077477", "0.70165306", "0.697019", "0.69395", "0.68292665", "0.67429423", "0.6725136", "0.66966116", "0.6677647", "0.6673098", "0.6567512", "0.65589386", "0.63769644", "0.6357348", "0.63002366"...
0.0
-1
ENDE Variable declaration / BEGINN function for setting input numbers to output function for setting numbers to output
function setNum (value) { if (!isSolved) { var n = value; switch (n) { case 1: setOutput(n); //if dirty then setNum2Array else setNum1Array if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 2: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 3: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 4: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 5: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 6: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 7: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 8: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 9: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; case 0: setOutput(n); if (!isDirty) { setNum1Array(n); } else { setNum2Array(n); } break; default: setOutput("NaN"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function num(n) {\n if (isOperator) {\n isOperator = false;\n clearOutput();\n }\n if (isSolved) clearAll();\n if (isStockPrice) clearAll();\n\n if (getOutput() === '0' && n != '.') {\n //set the out put to that number\n setOutput(n);\n (getEspression().length > 1)...
[ "0.59118056", "0.5868409", "0.57367545", "0.5736363", "0.5687773", "0.5636796", "0.5615355", "0.5609538", "0.5574496", "0.55688584", "0.5566671", "0.555782", "0.5547536", "0.55176485", "0.55077004", "0.5504282", "0.549468", "0.5443263", "0.54317623", "0.5413764", "0.5402314",...
0.5715489
4
function for tmp save number 1 input
function setNum1Array (value) { var tmpNum1 = value; if (arrNum1.length === 0) { arrNum1[0] = tmpNum1; } else { arrNum1.push(tmpNum1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save(num) {\n this.num = num;\n return `${num} is saved`;\n }", "function saveButton(num) { //Passing a number we're going to use to determine the time\n //console.log(this.siblings)\n let timestring = parseTime(num)\n var input = document.getElementById(\"TextField\" + timestring).valu...
[ "0.59157467", "0.5865384", "0.58022875", "0.5727074", "0.5688029", "0.56217825", "0.55977756", "0.5557753", "0.54987025", "0.5463991", "0.54501486", "0.544352", "0.54286367", "0.5424517", "0.5394896", "0.53825873", "0.5364576", "0.53623366", "0.5361872", "0.5357102", "0.53258...
0.0
-1
function for tmp save number 2 input
function setNum2Array (value) { var tmpNum2 = value; if (arrNum2.length === 0) { arrNum2[0] = tmpNum2; } else { arrNum2.push(tmpNum2); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ponerNumero(numero){\r\n if(num2 == 0 && num2 !== '0.')\r\n num2 = numero;\r\n else\r\n num2+= numero;\r\n actualizarValor2();\r\n}", "function ChangeNum() {\n\t// will get the input1 value.\n x = input1.value;\n\t// Reaplce Input1 value with input2\n if(input1.value !=input...
[ "0.5882392", "0.5810611", "0.57576376", "0.57568127", "0.5718008", "0.5690236", "0.56896704", "0.56280506", "0.561385", "0.55662405", "0.55632526", "0.5523862", "0.540065", "0.5398157", "0.5378305", "0.5355411", "0.5341444", "0.5317347", "0.53118825", "0.5299638", "0.5295141"...
0.5138436
46
function for setting comma to output
function addComma() { if (!isDirty) { setNum1Array('.'); } else { setNum2Array('.'); } setOutput(','); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addComma(str){\r\n return \", \"+str;\r\n}", "function addCommasToOutput(myParameter) {\n // Make sure the value is a number\n var myValue = Number(myParameter);\n // The toLocaleString() method with \"en\" automatically adds commas\n var formattedValue = myValue.toLocaleString(\"en\");\n ...
[ "0.72974604", "0.7042152", "0.6788334", "0.6788203", "0.6758212", "0.67350084", "0.66947234", "0.6693671", "0.66847587", "0.6664966", "0.66551447", "0.6605762", "0.6601754", "0.65940094", "0.65933067", "0.65933067", "0.6560402", "0.65560645", "0.65396667", "0.65396667", "0.65...
0.75444275
0
ENDE function for setting input numbers to output / BEGINN function for setting calculation operators to output function for setting operators to output
function calcOperation (value) { if (!isSolved) { var co = value; switch (co) { case '+': setOutput('&#10;'); setOutput(co); setOutput('\t'); operator = '+'; tmpOperator = operator; isDirty = true; break; case '-': setOutput('&#10;'); setOutput(co); setOutput('\t'); operator = '-'; tmpOperator = operator; isDirty = true; break; case '*': setOutput('&#10;'); setOutput(co); setOutput('\t'); operator = '*'; tmpOperator = operator; isDirty = true; break; case '/': setOutput('&#10;'); setOutput(co); setOutput('\t'); operator = '/'; tmpOperator = operator; isDirty = true; break; case 'w': setOutput('&#10;'); setOutput('&radic;'); setOutput('\t'); operator = 'w'; isDirty = true; break; case 'p2': setOutput('&#10;'); setOutput('^ &sup2;'); setOutput('\t'); operator = 'p2'; isDirty = true; break; case 'pn': setOutput('&#10;'); setOutput('^ \t'); operator = 'pn'; isDirty = true; break; case 'pr': setOutput(' %'); operator = 'pr'; isDirty = true; break; default: setOutput("Bad Operation Input"); isDirty = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function num(n) {\n if (isOperator) {\n isOperator = false;\n clearOutput();\n }\n if (isSolved) clearAll();\n if (isStockPrice) clearAll();\n\n if (getOutput() === '0' && n != '.') {\n //set the out put to that number\n setOutput(n);\n (getEspression().length > 1)...
[ "0.6481837", "0.647147", "0.6374842", "0.6188853", "0.6141611", "0.60849684", "0.6069809", "0.6018646", "0.5998055", "0.59850717", "0.59822613", "0.59701985", "0.59560865", "0.59488064", "0.59294146", "0.5928943", "0.5926912", "0.59242976", "0.5915823", "0.5903914", "0.590250...
0.57776946
28
ENDE function for setting calculation operators to output / BEGINN function for calculation and output the result function for solve Operation
function solveOperation () { num1 = parseFloat(arrNum1.join('')); num2 = parseFloat(arrNum2.join('')); op = operator; switch (op) { case '+': sol = add(num1, num2); setOutputEqual(); setOutput(sol); isSolved = true; break; case '-': sol = sub(num1, num2); setOutputEqual(); setOutput(sol); isSolved = true; break; case '*': sol = mul(num1, num2); setOutputEqual(); setOutput(sol); isSolved = true; break; case '/': sol = divi(num1, num2); setOutputEqual(); setOutput(sol); isSolved = true; break; case 'w': sol = wurzel(num1); setOutputEqual(); setOutput(sol); isSolved = true; break; case 'p2': sol = potenz2(num1); setOutputEqual(); setOutput(sol); isSolved = true; break; case 'pn': sol = potenzN(num1,num2); setOutputEqual(); setOutput(sol); isSolved = true; break; case 'pr': sol = prozent(num1,num2,tmpOperator); setOutputEqual(); setOutput(sol); isSolved = true; break; default: setOutput('no valid operation'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function operate(){\n\t\n\t// Triggers when second operator is '='\n\t// Call giveResult function which actually calculates formula\n\t// Write result into display\n\t// Set first number/operand as result for further calculations\n\t// Clear the rest of calculation object\n\tif (calculation['operator2'] == '='){\n...
[ "0.66153026", "0.65949017", "0.6538375", "0.64043945", "0.63990086", "0.6344214", "0.63358665", "0.6318865", "0.6310603", "0.63021016", "0.6299417", "0.6281133", "0.62713546", "0.6253239", "0.6236529", "0.6184201", "0.6179322", "0.6151244", "0.61304694", "0.61016136", "0.6097...
0.66706246
0
ENDE function for calculation and output the result / BEGINN function for clear, output, open help page, isEmpty clear all
function clearOutput () { num1 = null; num2 = null; tmpResult = sol; sol = null; arrNum1 = []; arrNum2 = []; operator = null; tmpOperator = null; isDirty = false; isSolved = false; output = null; document.getElementById("output").innerHTML = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clear() {\n\t//this function will clear all stored data for the following varible\n //allowing the user to start fresh and NOT conintue with the same 1st equation\n calDisplay.value = 0;\n\t\tnum1 = null;\n num2 = null;\n operator = undefined;\n}", "function clearCalc() {\n clearNum();\n ...
[ "0.6228773", "0.6134754", "0.6062725", "0.5913334", "0.590991", "0.590485", "0.58993244", "0.5867385", "0.58286226", "0.57826644", "0.5755729", "0.57432216", "0.56970865", "0.569255", "0.56900907", "0.5670844", "0.56518245", "0.5651802", "0.56433797", "0.5639654", "0.5613682"...
0.5927616
3
show input and output
function setOutput (value) { document.getElementById("output").innerHTML += value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOnScreen(input){\n output.html(input);\n }", "function info() {\n\tseperator();\n\tOutput('<span>>info:<span><br>');\n\tOutput('<span>Console simulator by Mario Duarte https://codepen.io/MarioDesigns/pen/JbOyqe</span></br>');\n}", "function showInputOutput() {\n \n var scen...
[ "0.7157762", "0.6588662", "0.6545561", "0.65094113", "0.6337902", "0.62927604", "0.62655973", "0.6115382", "0.6089773", "0.60716426", "0.60322785", "0.60144013", "0.59717387", "0.59571064", "0.5903995", "0.589619", "0.5878703", "0.5878675", "0.5839898", "0.5826057", "0.582348...
0.53507936
84
function for empty input check
function isEmpty(input) { if ( null === input || "" === input ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEmpty(input){\r\n //console.log(input.val());\r\n if(input.val().length==0){\r\n return true;\r\n }\r\n return false;\r\n}", "isValueEmpty(input) {\n return input ? true : false\n }", "function catchEmpty(input){\n\n if(input===\"\"){\n return \"Please enter required infor...
[ "0.8128158", "0.80027467", "0.79900634", "0.79847914", "0.79762715", "0.78433603", "0.77911586", "0.77440697", "0.77431625", "0.76623315", "0.7656966", "0.76416844", "0.7556", "0.7551334", "0.7519374", "0.7500147", "0.749107", "0.7488326", "0.7419869", "0.7413667", "0.7406108...
0.7887734
5
ENDE function for clear, output, open help page, isEmpty / RECHENOPERATIONEN / BEGINN GRUNDOPERATIONEN
function add(num1, num2) { if (!isEmpty(num1) && !isEmpty(num2)) { return num1 + num2; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(helpDoc);\r\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(HELP_DOC);\r\n}", "openHelpPage() {}", "function displayHelp()\n{\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function help() {\n\n}", "function displayHelp()\n{\n // Repla...
[ "0.63210905", "0.6296715", "0.6250398", "0.6151003", "0.6132021", "0.6129479", "0.60838753", "0.60838753", "0.6080509", "0.604698", "0.6003973", "0.5951888", "0.5903097", "0.57965827", "0.5731671", "0.5729222", "0.5729222", "0.5710521", "0.57015806", "0.56903875", "0.565769",...
0.0
-1
ENDE GRUNDOPERATIONEN / BEGINN ANDERE OPERATIONEN
function wurzel(num1) { if(!isEmpty(num1)) { if (num1 === 0) { return null; } else { return Math.sqrt(num1); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plus(){\r\n\tplusBois();\r\n\tplusOr();\r\n\tplusPierre();\r\n\tplusBébé();\r\n\tmaison();\r\n\thidden();\t\r\n\tevolutionPrixBois(); \r\n\tevolutionPrixPierre(); \r\n\tsauvegarder();\r\n\tbadge();\r\n\tkong();\r\n}", "function unDoIVAGastosVenta(IVAxGtos,costoDesProd,IVA) {\n\nvar nvoIVAGtosVenta;\n\n ...
[ "0.58387333", "0.54231703", "0.54087883", "0.5377706", "0.53156054", "0.52660596", "0.52427906", "0.5234454", "0.52323055", "0.5207246", "0.51723665", "0.5168103", "0.514728", "0.5144692", "0.5138479", "0.5115411", "0.50880647", "0.5088056", "0.50830066", "0.50815725", "0.507...
0.0
-1
! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody
function embed(parent, svg, target) { // if the target exists if (target) { // create a document fragment to hold the contents of the target var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute("viewBox") && target.getAttribute("viewBox"); // conditionally set the viewBox on the svg viewBox && svg.setAttribute("viewBox", viewBox); // copy the contents of the clone into the fragment for ( // clone the target var clone = target.cloneNode(!0); clone.childNodes.length;) { fragment.appendChild(clone.firstChild); } // append the fragment into the svg parent.appendChild(fragment); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawSvg() {\n \n\t}", "function SVGShape() {}", "_getSVGHandler(e){let root=this,temp=document.createElement(\"div\"),getID=function(element,alt){if(null===element.getAttribute(\"id\"))element.setAttribute(\"id\",alt);return element.getAttribute(\"id\")},setAriaLabelledBy=function(source,target,prefix){...
[ "0.68878067", "0.68526626", "0.68006694", "0.66039413", "0.6596661", "0.65535575", "0.65448385", "0.6496968", "0.64464116", "0.64464116", "0.64464116", "0.64464116", "0.64464116", "0.64464116", "0.6389111", "0.6365732", "0.626818", "0.62608904", "0.6228972", "0.62221515", "0....
0.0
-1
.product .quantity input .product .totalPrice span document.querySelector("body > div > div:nthchild(2) > div.cost > span")
function updatePrices() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePriceByProduct(product, productPrice){\n product.querySelector('.total-price span').innerHTML = productPrice;\n}", "function getPriceByProduct(product){\n var priceProduct = product.querySelector('.price-und span').innerHTML;\n var qtyProduct = product.querySelector('input[name=\"qty\"]').valu...
[ "0.7371879", "0.73413295", "0.7009806", "0.69839996", "0.6889335", "0.6844335", "0.66990316", "0.66662335", "0.66644996", "0.66211647", "0.65642226", "0.6562449", "0.65601677", "0.654794", "0.6543006", "0.65420675", "0.6537719", "0.65231043", "0.65187436", "0.648126", "0.6450...
0.0
-1
eslintdisable maxlinesperfunction /eslintdisable maxstatements
function setup() { //Let's center the board let width = 1200; let height = 1200; let x = (app.view.width / 2) - (width / 2) let y = (app.view.height / 2) - (height / 2) let board = new Board(x, y, width, height); board.render(app.stage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hello2() {\n const bye = \"bye\";\n\n /**\n * For disable the es-lint on the line\n * Please put the below comment\n * now instead of the error we will have the warning for below 2\n */\n // eslint-disable-next-line\n console.log(\"this is sample \", bye);\n\n /**\n * disabling a particular...
[ "0.569537", "0.5316345", "0.51030904", "0.5090205", "0.5078732", "0.50424623", "0.49940977", "0.4986772", "0.49858588", "0.49856603", "0.4954236", "0.49475524", "0.49291098", "0.4925887", "0.49216253", "0.49158207", "0.48956525", "0.48829505", "0.48724478", "0.48327827", "0.4...
0.0
-1
Add two parameters to this method: array and size. Within the method, write an if statement that checks to see if size is undefined. Within the if statement block, set size equal to 1. After the if statement, create a variable called arrayChunks and initialize it to an empty array. Write a for loop that loops through array and has a counter that increments by size each turn of the loop. Within the for loop, create a variable called arrayChunk and set it equal to the chunk of the array going from the current loop index to the current loop index plus size. You an use .slice() to accomplish this. Still within the for loop, add arrayChunk to the end of arrayChunks. You can use .push() to accomplish this. Finally, outside of the for loop, return arrayChunks from the method.
function chunk(array, size) { if(size === undefined) { size = 1; }; let arrayChunks = []; for(let i = 0; i < array.length; i++){ let arrayChunk = array.slice(i + size); arrayChunks.push(arrayChunk) } return arrayChunks }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "chunk(array, size){\r\n if ((size === '') || (size === undefined)){\r\n size = 1;\r\n }\r\n //declare array to hold the chunked elements of old array\r\n let arrayChunks = [];\r\n for (var i=0; i<array.length; i+=size)\r\n arrayChunks.push(array.slice(i,i+size));\r\n \r\n //console.l...
[ "0.8578089", "0.85448086", "0.8517", "0.8392595", "0.8384342", "0.83684766", "0.8350773", "0.83026415", "0.82707316", "0.82197315", "0.8207776", "0.8138904", "0.8138904", "0.81355995", "0.81328344", "0.810394", "0.8099595", "0.8086587", "0.80468583", "0.79989326", "0.79963964...
0.8721621
0
end of script for go to top button function to get scroll position
function logScroll() { let scroll = window.pageYOffset; return scroll; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTop(){\n $('topbtn').on('click', function(){\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0; \n });\n}", "function onScrollToTop() {\n ScrollToTop();\n}", "function _scrollTop ()\n{\n\tvar\tnBtnToTopWrap = document.getElementById('btn-to-top-wrap')...
[ "0.7848767", "0.7573619", "0.75705653", "0.7509776", "0.7497869", "0.74834436", "0.74411154", "0.7416896", "0.73929244", "0.730652", "0.72802967", "0.72791463", "0.7260694", "0.72594094", "0.7245466", "0.723786", "0.72182083", "0.720859", "0.71898454", "0.71806425", "0.717538...
0.0
-1
function to get radio value
function getRadioValue(radioInput) { let chosenRadio = ""; for (let i = 0; i < radioInput.length; i++) { if(radioInput[i].checked) { chosenRadio = radioInput[i].value; //only one radio can be checked, so we stop the loop once we've found the checked one break; } } if(!chosenRadio) { chosenRadio = "none"; } return chosenRadio; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRadioButtonValue (radio)\r\n{ for (var i = 0; i < radio.length; i++)\r\n { if (radio[i].checked) { break }\r\n }\r\n return radio[i].value\r\n}", "function getRadioButtonValue(radio)\r\n{\r\n if (radio.length == undefined && radio.checked)\r\n return radio.value;\r\n\r\n for...
[ "0.822092", "0.8090426", "0.80735326", "0.8049562", "0.79814744", "0.79814744", "0.7936885", "0.7928067", "0.79190886", "0.79133487", "0.7883326", "0.78417903", "0.77861077", "0.77731395", "0.77111745", "0.7706659", "0.76974136", "0.76838154", "0.7657381", "0.76370287", "0.76...
0.71748483
66
function to get text field value
function getTxtValue(txtInput) { let txt = ""; if(txtInput.value == "") { txt = "none"; } else { txt = txtInput.value; } return txt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTextValue( stField )\n{\n var oValue = getObject(stField); // document.getElementById(stField);\n if ( oValue != null )\n {\n if( oValue.value != null )\n {\n return oValue.value;\n }\n }\n return \"\";\n}", "function getInputTextValue(id){\n return document.getElementById(id).v...
[ "0.79089713", "0.7863534", "0.7816162", "0.7505046", "0.73860085", "0.7346934", "0.7313975", "0.7299224", "0.72616833", "0.7249067", "0.7249067", "0.7249067", "0.7246967", "0.72409916", "0.72208565", "0.72208565", "0.72208565", "0.72208565", "0.72208565", "0.72069573", "0.719...
0.74470633
4
function to get checkboxes value
function getCheckBoxesValue(checkboxNodeList) { let checkboxesArray = []; for (let i = 0; i < checkboxNodeList.length; i++) { if(checkboxNodeList[i].checked) { checkboxesArray.push(checkboxNodeList[i].value); } } //if nothing has been chosen if(checkboxesArray.length == 0) { checkboxesArray.push("none"); } return checkboxesArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCategory(){\n let value; \n category.forEach(e=>{\n if(e.checked){\n value = e.value\n }\n })\n return value\n}", "function getCheckboxValue(){\n\t\tif(go('selectValue').checked){\n\t\t\t\tselectValue= go('selectValue').value;\n\t\t\n\t\t\t}else{\n\t\t\tselectValue=\"No\"\n\t...
[ "0.7593254", "0.75281465", "0.7424744", "0.7411144", "0.7386198", "0.73710513", "0.7360456", "0.73398197", "0.7317255", "0.7317255", "0.7284685", "0.72720236", "0.72720236", "0.72720236", "0.72720236", "0.72720236", "0.72720236", "0.72720236", "0.72720236", "0.71353054", "0.7...
0.71406907
19
function to get the user's registration datas
function getAttendeeInfos() { // build the object that record every infos submitted by the attendee on registration const attendee = { "first-name" : getTxtValue(document.querySelector("#first-name-input")), "last-name" : getTxtValue(document.querySelector("#last-name-input")), "title" : getTxtValue(document.querySelector("#job-title-input")), "email" : getTxtValue(document.querySelector("#email-input")), "phone" : getTxtValue(document.querySelector("#phone-input")), "company-name" : getTxtValue(document.querySelector("#company-input")), "company-address" : getTxtValue(document.querySelector("#address-input")), "company-city" : getTxtValue(document.querySelector("#city-input")), "company-state" : getTxtValue(document.querySelector("#state-input")), "company-zip-code" : getTxtValue(document.querySelector("#zip-code-input")), "workshop-choice" : getRadioValue(document.querySelectorAll(".workshop-selection")), "topics-choice" : getCheckBoxesValue(document.querySelectorAll(".topic-selection")), "other-topics" : getTxtValue(document.querySelector("#other-topics-text")), "allergies" : getTxtValue(document.querySelector("#allergies-input")), "vegan" : getRadioValue(document.querySelectorAll(".vegan")), "comment" : getTxtValue(document.querySelector("#comment-input")) } return attendee; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRegisterInfo() {\n var user = {};\n user.userName = $(\"#userName\").val();\n user.chineseName = $(\"#chineseName\").val();\n user.gender = $(\"#gender\").val();\n user.roleType = $(\"#roleType\").val();\n user.phoneNumber = $(\"#phone\").val();\n user.email = $(\"#email\").val();\...
[ "0.7551778", "0.7016988", "0.69427466", "0.6770059", "0.67675924", "0.6767369", "0.6754925", "0.66999626", "0.6659718", "0.6657382", "0.6619234", "0.6593851", "0.657593", "0.654434", "0.6507345", "0.6491262", "0.6474972", "0.64733464", "0.6440749", "0.64085925", "0.63972276",...
0.0
-1
function to display error message
function errorMsg(containerClass, msg, classMsg, validField) { // get the class name for the error message HTML Element. We need it to handle its creation and display const msgSelector = "." + containerClass + "-field ." + classMsg; const containerField = document.querySelector("." + containerClass + "-field"); //if the field isn't valid and if the error message isn't already displayed : we create and display the error message if(!document.querySelector(msgSelector) && !validField) { //create the HTML Element for the error message const pElem = document.createElement("p"); const errorTxt = document.createTextNode(msg); pElem.setAttribute("class","error-msg " + classMsg); pElem.appendChild(errorTxt); containerField.appendChild(pElem); } //if the field is valid and the error message is displayed : remove the error message else if(document.querySelector(msgSelector) && validField) { containerField.removeChild(document.querySelector(msgSelector)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showError() {}", "function showError(type, text) {}", "function showErrorMessage(msg) { }", "function displayError(error) {\n displayMessage(error, true);\n\n}", "showErrorMessage() {}", "function displayError(errorText) {\r\n // log the msg for the user to see\r\n logError(errorText);\r\n}...
[ "0.8476412", "0.83366823", "0.8203904", "0.78395003", "0.78234875", "0.7798422", "0.7765945", "0.76657224", "0.75427586", "0.74765915", "0.7382675", "0.7363988", "0.73626983", "0.73500067", "0.7343604", "0.73412347", "0.73254097", "0.728997", "0.7282349", "0.7238153", "0.7236...
0.0
-1
function to check if the values respect the right format
function checkValueFormat(objProp, format) { const regEx = new RegExp(format); return regEx.test(objProp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validDataFormat(raw_data) {\n return true;\n }", "function looks_like_data_value(v) {\n if (vF.typeOf(v) === 'number') {\n return true;\n } else if (vF.typeOf(v) === 'string') {\n // !isNaN is the recommended way to test whether a string represents a valid number\...
[ "0.6829726", "0.63021976", "0.63021976", "0.61385405", "0.61205685", "0.60843515", "0.6078549", "0.5973023", "0.595962", "0.5945436", "0.5920624", "0.59053403", "0.5903739", "0.58756", "0.5815587", "0.5801931", "0.5799202", "0.5788957", "0.5788654", "0.5769363", "0.5748707", ...
0.6270261
3
function to check the submission
function checkSubmission(obj) { //list in the array, the object properties that stores required values const requiredFields = [ "first-name", "last-name", "title", "email", "phone", "company-name", "company-address", "company-city", "company-zip-code", "workshop-choice", "vegan" ]; // check if the required fields have values for (let i = 0; i< requiredFields.length; i++) { if (obj[requiredFields[i]] == "none") { errorMsg(requiredFields[i], "Please fill in this field.", "required", false); } else { errorMsg(requiredFields[i], "", "required", true); } } // Check if values with specific format are valid. if not : write on the form the errors to check // check email address // regex taken from https://regexlib.com/REDetails.aspx?regexp_id=174 const validMail = checkValueFormat(obj["email"], "^.+@[^\.].*\.[a-z]{2,}$"); if(!validMail) { errorMsg("email", "Please enter a valid email: example@email.com", "format", false); } else { errorMsg("email", "", "format", true); } // check phone number const validPhone = checkValueFormat(obj["phone"], "[0-9]{3}-[0-9]{3}-[0-9]{4}$"); if(!validPhone) { errorMsg("phone", "Please enter a valid phone number: 000-000-0000", "format", false); } else { errorMsg("phone", "", "format", true); } //check company zip code const validZipCode = checkValueFormat(obj["company-zip-code"], "^\\d{5}$"); if(!validZipCode) { errorMsg("company-zip-code", "Please enter a valid ZIP Code: 00000", "format", false); } else { errorMsg("company-zip-code", "", "format", true); } //check if there's any error detected in the form let getErrors = document.querySelectorAll("p[class^='error-msg']"); if(getErrors.length == 0) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submissionCheck(){\n\tif (emptyFormCheck()){\n\t\talert(\"Successful submission! All input is valid!\");\n\t}\n\telse{\n\t\talert(\"Error! A field is empty\");\n\t}\n}", "function submit(){\n if(verifyFields()){\n alert(\"Submitted\");\n } else {\n alert(\"Please fill out all fields!!\");\n }\...
[ "0.7705532", "0.7299996", "0.7160935", "0.7038282", "0.6985359", "0.6909883", "0.689355", "0.6853576", "0.68090343", "0.6741524", "0.67360705", "0.6735909", "0.6710231", "0.66869956", "0.6670007", "0.66396475", "0.6638462", "0.66288775", "0.66099215", "0.6607981", "0.6592752"...
0.6681606
14
eg. remove all of red.ilpdemo.
removeAll (id) { this._pairs = this._pairs.filter((p) => ( p[0].indexOf(id) !== 4 && p[1].indexOf(id) !== 4 )) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static RemoveAll() {}", "function m_removeall()\n{\n\twhile(c_alldata.length>0)\n\t{\n\t\tc_alldata[c_alldata.length-1].c_disp.innerHTML=\"\";\n\t\tc_alldata.pop();\n\t}\n\t ref_thumb();\n}", "remove () {\n // cleanup\n }", "function beginClean(done) {\n del([iconURL, graphicURL]);\n done();\n}",...
[ "0.6930279", "0.66311187", "0.65463465", "0.6402681", "0.6378271", "0.6378271", "0.634585", "0.6335848", "0.629611", "0.62260133", "0.621701", "0.62119865", "0.61955094", "0.6179353", "0.61666244", "0.6163555", "0.6139725", "0.61368936", "0.61276424", "0.61039466", "0.6080718...
0.0
-1
Connect to ChatBot websocket Automatically tries to reconnect on disconnection by recalling this method
function connectWebsocket() { //------------------------------------------- // Create WebSocket //------------------------------------------- var socket = new WebSocket("ws://127.0.0.1:3337/streamlabs"); //------------------------------------------- // Websocket Event: OnOpen //------------------------------------------- socket.onopen = function() { // AnkhBot Authentication Information var auth = { author: "SirPhilthyOwl", website: "twitch.tv/SirPhilthyOwl", api_key: API_Key, events: [ "EVENT_USERNAME" ] }; // Send authentication data to ChatBot ws server socket.send(JSON.stringify(auth)); }; //------------------------------------------- // Websocket Event: OnMessage //------------------------------------------- socket.onmessage = function (message) { // Parse message var socketMessage = JSON.parse(message.data); console.log(socketMessage); // EVENT_USERNAME if (socketMessage.event == "EVENT_USERNAME") { var eventData = JSON.parse(socketMessage.data); var outroVar Intro(eventData); } if (eventData.mode == "NoUsers") { outroVar = setTimeout(outroTransition, 3000); } else if (eventData.mode == "Start") { Start(eventData); } else if (eventData.mode == "End") { End(eventData); } else if (eventData.mode == "Win") { Win(eventData); } else if (eventData.mode == "Leaderboard") { Leaderboard(eventData, outroVar); } } function Intro(eventData) { $("#alert").queue(function() { $(this).removeClass(settings.OutTransition + "Out initialHide"); $("#alert").addClass(settings.InTransition + "In"); if (eventData.mode == "None") { $("#encrypt").html("Password Mini-game"); } $("#guess1").html(eventData.Guess1) $("#guess2").html(eventData.Guess2) $("#guess3").html(eventData.Guess3) $("#guess4").html(eventData.Guess4) $("#guess5").html(eventData.Guess5) document.getElementById('encrypt').style.color = settings.TextColor $("#logo").attr("src", "LockWhite.png"); $(this).dequeue(); }); } function Start(eventData) { $("#alert").queue(function() { $("#encrypt").stringChange(eventData.Encrypt, "encrypt"); changeGuess(eventData); $(this).dequeue(); }); } function End(eventData) { $("#alert").queue(function() { changeGuess(eventData); $("#encrypt").stringChange("The lock won't budge, better luck next time!", "encrypt") outroVar = setTimeout(outroTransition, 2000); $(this).dequeue(); }); } function Win(eventData) { $("#alert").queue(function() { changeGuess(eventData); $("#logo").changePicture("LockOpenWhite.png"); $("#encrypt").stringChange("The password has been cracked!", "encrypt"); outroVar = setTimeout(outroTransition, 2000); $(this).dequeue(); }); } function Leaderboard(eventData, outroVar) { $("#alert").queue(function() { if (outroVar != null) { clearTimeout(outroVar); $("#encrypt").fadeOut(function() { $("#encrypt").text("Leaderboard:"); }).fadeIn(); } if ($('#logo').attr('src') == "LockOpenWhite.png") { $("#encrypt").fadeOut(function() { $("#encrypt").text("Leaderboard:"); }).fadeIn(); } $("#encrypt").html("Leaderboard:"); changeGuess(eventData); outroVar = setTimeout(outroTransition, 9000); $(this).dequeue(); }); } function changeGuess(eventData) { var obj = { "guess1": eventData.Guess1, "guess2": eventData.Guess2, "guess3": eventData.Guess3, "guess4": eventData.Guess4, "guess5": eventData.Guess5 }; $.each(obj, function(key, value) { $("#" + key).fadeOut(function() { $("#" + key).text(value.String); }).fadeIn(); if (value.Color == "Positional") { document.getElementById(key).style.color = settings.PositionalColor; } else { document.getElementById(key).style.color = settings.GuessColor; } }); } $.fn.stringChange = function(text, div) { document.getElementById(div).style.color = settings.TextColor; $(this).fadeOut(function() { $(this).text(text); }).fadeIn(); } $.fn.changePicture = function(picture) { $(this).fadeOut(function() { $(this).attr("src", picture); }).fadeIn(); } function outroTransition() { var tempVal $("#guess5").fadeOut(); $("#guess4").fadeOut(); $("#guess3").fadeOut(); $("#guess2").fadeOut(); $("#guess1").fadeOut(); if ($("#encrypt").text() != "Password Mini-game") { $("#encrypt").stringChange("Password Mini-game", "encrypt"); } setTimeout(function() { $("#alert").addClass(settings.OutTransition + "Out"); $("#alert").removeClass(settings.InTransition + "In"); },1000); } function stopOutro(outroVar) { if (outroVar != False) { clearInterval(outroVar); } } //------------------------------------------- // Websocket Event: OnError //------------------------------------------- socket.onerror = function(error) { console.log("Error: " + error); } //------------------------------------------- // Websocket Event: OnClose //------------------------------------------- socket.onclose = function() { // Clear socket to avoid multiple ws objects and EventHandlings socket = null; // Try to reconnect every 5s setTimeout(function(){connectWebsocket()}, 5000); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connectWebSocket() {\n let protocol = 'wss://';\n // so it also works in 'http' (useful when testing)\n if (location.protocol === 'http:') {\n protocol = 'ws://';\n }\n SOCKET = new WebSocket(protocol + window.location.host + \"/chat\", \"chat\");\n SOCKET.onopen = socketReady;\n ...
[ "0.7595642", "0.7547987", "0.74712926", "0.7424484", "0.7269143", "0.71672624", "0.7162255", "0.70733136", "0.7057505", "0.70439076", "0.6972125", "0.69488686", "0.69335437", "0.6851577", "0.68210167", "0.6819855", "0.68138325", "0.68133795", "0.6799809", "0.6799387", "0.6792...
0.71615595
7
swap Field to another location
function swapField(from,to){ var columns = $(target).datagrid('options').columns; var cc = columns[0]; _swap(from,to); function _swap(fromfiled,tofiled){ var fromtemp; var totemp; var fromindex = 0; var toindex = 0; for(var i=0; i<cc.length; i++){ if (cc[i].field == fromfiled){ fromindex = i; fromtemp = cc[i]; } if(cc[i].field == tofiled){ toindex = i; totemp = cc[i]; } } //cc.splice(fromindex,1,totemp); cc.splice(toindex,0,fromtemp); if(fromindex>toindex) cc.splice(fromindex+1,1); else cc.splice(fromindex,1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function swapField(from, to) {\n\t\t\t\t\t\t\t\tvar columns = $(target).datagrid('options').columns;\n\t\t\t\t\t\t\t\tvar cc = columns[0];\n\t\t\t\t\t\t\t\t_swap(from, to);\n\t\t\t\t\t\t\t\tfunction _swap(fromfiled, tofiled) {\n\t\t\t\t\t\t\t\t\tvar fromtemp;\n\t\t\t\t\t\t\t\t\tvar totemp;\n\t\t\t\t\t\t\t\t\tvar f...
[ "0.74238986", "0.6998172", "0.65245533", "0.6374127", "0.6368099", "0.6188286", "0.5846365", "0.5803056", "0.5723435", "0.57226664", "0.5465184", "0.5448559", "0.5413537", "0.53947514", "0.5360728", "0.53565776", "0.5336171", "0.532523", "0.53208905", "0.5297956", "0.5296474"...
0.6781468
2
parse a date in yyyymmdd format
function parseDate(input) { var parts = input.match(/(\d+)/g); // new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]]) return new Date(parts[0], parts[1]-1, parts[2]); // months are 0-based }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseYearMonthDate(yyyymmdd) {\n const parts = yyyymmdd.match(\n /([0-9]{4})[\\-/ ]?([0-9]{2})[\\-/ ]?([0-9]{2})?/);\n return parts.splice(1,3);\n }", "function parseDate(date){\r\n var mmddyy = new Array();\r\n var i = 1;\r\n var index = date.indexOf('/');\r\n while (index != -1){\r\n ...
[ "0.7400757", "0.7302535", "0.72926515", "0.7166753", "0.7165479", "0.71504843", "0.71220964", "0.7115398", "0.70884573", "0.7047799", "0.70186794", "0.7012165", "0.6992792", "0.69905514", "0.69724214", "0.6913097", "0.68704456", "0.68684554", "0.68302906", "0.68287694", "0.68...
0.6799614
25
TODO: Add share button TODO: Add labels for inputs
render() { return ( <div className="home-content"> <main> <div className="home-wrapper"> <h1>Go Neutral</h1> <h2>Get personalized steps to slow climate change</h2> <h3> in just 10 minutes</h3> </div> <form className="home-calculate" onSubmit={this.goToSite}> <label for="zip" class="visually-hidden">Zip Code</label> <input type="text" name="zip" placeholder="My Zip Code" onChange={this.handleZipChange} /> <label for="household" class="visually-hidden">Household Size</label> <select type="text" name="household" onChange={this.handleSelectChange} > <option value="single">Just me</option> <option value="house">Household</option> </select> <button type="submit" className="go">Go</button> <a className="photo-credit" href="https://unsplash.com/@johnwestrock">Photo credit: John Westrock</a> </form> </main> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getParamsFromInputs() {\n return {\n url: this.url,\n title: this.title,\n description: this.description,\n image: this.image,\n tags: this.tags,\n via: this._share.config.twitterAccount,\n };\n }", "onChangeShareLink(e) {\n ...
[ "0.59075856", "0.58862585", "0.58685666", "0.58146006", "0.57883203", "0.57675284", "0.5663321", "0.5658928", "0.56546295", "0.565323", "0.564516", "0.5603066", "0.5579221", "0.5561252", "0.55428225", "0.55257225", "0.5518524", "0.5517434", "0.54909563", "0.54644424", "0.5456...
0.0
-1
Bump the bower version to match package.json
function version() { return gulp.src('./bower.json') .pipe($.bump({version: pkg.version})) .pipe(gulp.dest('./')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patchBump() {\n return gulp.src([\n './package.json',\n './bower.json'\n ]).pipe(bump({type: 'patch'}))\n .pipe(gulp.dest('./'));\n}", "function majorBump() {\n return gulp.src([\n './package.json',\n './bower.json'\n ]).pipe(bump({type: 'major'}))\n .pipe(gulp.dest('./'));\n}", ...
[ "0.73525643", "0.72979516", "0.7252684", "0.7224171", "0.70627433", "0.69573987", "0.68364245", "0.6723519", "0.66260415", "0.6574077", "0.6351256", "0.634813", "0.6300923", "0.6288072", "0.623432", "0.6174631", "0.6062411", "0.6010154", "0.60020375", "0.5975855", "0.5975855"...
0.7859752
0
Prepare files for docs
function docs() { return gulp.src([`${paths.dist}*`, 'package.json', 'CHANGELOG.md']) .pipe($.copy('_docs/additional/')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var files = fs.readdirSync(DOC_DIR);\n files.forEach(fileIterator);\n }", "prepare() {\n const self = this;\n const files = fs.readdirSync(this.options.dir)\n .filter(function removeWatched(file) {\n return __.isWatched(file);\n }).map(function addOptio...
[ "0.6275453", "0.62687886", "0.61880094", "0.6067617", "0.5983781", "0.5958119", "0.59427327", "0.5938658", "0.59316206", "0.5803396", "0.5795635", "0.5766452", "0.5725863", "0.56817466", "0.567241", "0.563629", "0.5583101", "0.5566332", "0.5547987", "0.55400217", "0.55326766"...
0.5619836
16
Create zip for github
function zipGithub() { return gulp.src(`${paths.dist}*`, {base: 'dist'}) .pipe($.zip(paths.zip)) .pipe(gulp.dest(paths.dist)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeZip() {\n const { filename, content } = fflateBuildZipContent()\n const [zipPromise, resolve, reject] = makePromise()\n\n fflate.zip(content, (err, data) => {\n if (err) {\n reject(err)\n return\n }\n resolve(data)\n })\n\n return zipPromise.then(makeBlob).then(blob => {\n s...
[ "0.7106486", "0.6791445", "0.6420847", "0.63584787", "0.6346671", "0.6317839", "0.616638", "0.6083874", "0.6068366", "0.6030364", "0.60189146", "0.5960048", "0.5958332", "0.59410495", "0.58699965", "0.58101684", "0.58006275", "0.5796894", "0.5794596", "0.5749246", "0.5721118"...
0.7636397
0
Publish release to github
function publishGithub(cb) { const github = new GithubApi({ version: '3.0.0', protocol: 'https' }); const tag_name = `v${pkg.version}`; const owner = 'CSNW'; const repo = 'd3.compose'; const name = `${pkg.name} ${tag_name}`; inquirer.prompt([{ type: 'input', name: 'token', message: 'Enter your GitHub token' }], (answers) => { const token = answers.token; if (!token) return cb(new Error('A GitHub token is required to publish')); github.authenticate({ type: 'oauth', token }); console.log(`Creating release: "${name}"`) github.releases.createRelease({ owner, repo, tag_name, name }, (err, response) => { if (err) return cb(err); console.log(`Uploading zip: "${paths.zip}"`); github.releases.uploadAsset({ owner, repo, id: response.id, name: paths.zip, filePath: path.join(__dirname, paths.dist, paths.zip) }, cb); }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function push() {\n\t\tRelease.chdir( Release.dir.dist );\n\n\t\tconsole.log( \"Pushing release to dist repo...\" );\n\t\tRelease.exec( \"git push \" + distRemote + \" master --tags\",\n\t\t\t\"Error pushing master and tags to git repo.\" );\n\n\t\t// Set repo for npm publish\n\t\tRelease.dir.origRepo = Release.di...
[ "0.7501289", "0.7163233", "0.71490604", "0.704463", "0.66778576", "0.66776776", "0.65120995", "0.62747097", "0.6233617", "0.621628", "0.61937445", "0.6168672", "0.6168672", "0.6159093", "0.6120924", "0.60996515", "0.6063931", "0.6033623", "0.6024788", "0.6001078", "0.60009104...
0.80250585
0
Get actions and pass them as props
function mapDispatchToProps(dispatch) { return bindActionCreators(actions, dispatch); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapActionToProps(dispatch) { return bindActionCreators({ GetActivityAction }, dispatch); }", "bindActions() {\n\t\t// @props\n\t\t// onComplete\n\t\t// buttons\n\t\t// cancelIndex\n\t\t// title\n\t\t// &\n\t\t// this will be an abstraction\n\t\t// so we don't have to worry about\n\t\t// changing props ...
[ "0.6972911", "0.67867565", "0.6657505", "0.6651963", "0.6633728", "0.6597175", "0.6513606", "0.65037733", "0.64985985", "0.64514714", "0.64415395", "0.6389254", "0.6334757", "0.62711716", "0.62539876", "0.62104404", "0.61999345", "0.6154635", "0.61273617", "0.61016124", "0.60...
0.57077813
62
TODO: Formatting and styling
render() { return ( <div className="centre"> <br/> <br/> <p> This tool allows you to select a stock from the US Market and gather 7 days worth of its' intraday prices down to the minute. This includes the open, close, high and low prices, as well as the volume of that stock traded. </p> <p> Currently there are no free tools that allow you access to this much information, and this is all real data. </p> <p> This was thrown together in a few days using React and Vercel to demonstrate rapid prototyping. </p> <p> As such, this is very much a WIP. It needs a whole lot of love in order to get it to a releasable state! </p> <br/> <br/> <p> Built by me - Benjamin Roe. </p> <a href="https://github.com/benjaminroe">GitHub</a> <br/> <a href="https://www.linkedin.com/in/benjamin-roe-626851100/">LinkedIn</a> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private public function m246() {}", "private internal function m248() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n ...
[ "0.5830531", "0.5643205", "0.5568509", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", "0.55482054", ...
0.0
-1
////////////////////////////////////// Geolocation 'error' function
function error(error) { alert("Error: getCurrentPosition: " + error) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function geolocError(){\n console.log(\"Error getting user's location :(\");\n}", "function geo_error(error) {\n switch (error.code) {\n case error.TIMEOUT:\n alert('Geolocation Timeout');\n break;\n case error.POSITION_UNAVAILABLE:\n ale...
[ "0.8411933", "0.820794", "0.8194018", "0.81207603", "0.80275947", "0.8003591", "0.79851246", "0.7978115", "0.79584783", "0.794215", "0.7913762", "0.78980076", "0.78583074", "0.7825887", "0.780662", "0.7771691", "0.77647716", "0.7729951", "0.7714284", "0.76825565", "0.7663555"...
0.0
-1
style or textareas don't accept HTML as content it's pointless to transform or analyze anything different from text there but it's worth checking for possible defined intents.
text(node) { let oldValue; const textContent = value => { if (oldValue !== value) { oldValue = value; const type = typeof value; if (type === 'object' && value) { if ('text' in value) { textContent(String(value.text)); } else if ('any' in value) { textContent(value.any); } else if ('html' in value) { textContent([].concat(value.html).join('')); } else if ('length' in value) { textContent(slice.call(value).join('')); } } else if (type === 'function') { textContent(value(node)); } else { node.textContent = value == null ? '' : value; } } }; return textContent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monitorText(event){\r\n\tvar frame = frames['editorText'];\r\n\tvar text = document.getElementById('htmlText');\r\n\r\n\tframe.srcdoc = \"<!DOCTYPE html><html><head><link href='editor/embedded.css' rel='stylesheet' type='text/css'></head><body><pre class='postTextPre'>\" + text.value + \"</pre></body></ht...
[ "0.58697075", "0.5862297", "0.581803", "0.5755014", "0.57032806", "0.5635177", "0.5607582", "0.56031406", "0.5525461", "0.5504641", "0.54989725", "0.5498372", "0.54904747", "0.54622394", "0.54413825", "0.5423711", "0.54175735", "0.5383842", "0.536305", "0.5358169", "0.5341705...
0.0
-1
separate to project specific js file or embed on index
function updateImages (level_key, asana) { // todo: test items and update only changes instead rebuild div from 0 //document.getElementById("flow").innerHTML = ""; var br = '<br />'; // <br /> asana_display //asana_display = asana.toUpperCase().replace(".JPG", ""); var searchMask = ".jpg"; var regEx = new RegExp(searchMask, "ig"); var replaceMask = ""; asana_display = asana.replace(regEx, replaceMask); return '<div class="col-md-3">' + '<img title="'+ asana_display +'" src="'+ level_key +'/'+ asana +'" class="img-responsive" />' + br + asana_display + br + '</div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static viewJs(formfactor) {\n let src;\n switch(formfactor) {\n case 'phone':\n case 'table':\n src = window.rootpath + 'sample/sample-view-phone.js';\n //src = window.rootpath + 'sample-view-desktop.js';\n break;\n case 'desktop':\n default:\n src = window.roo...
[ "0.66872036", "0.62358516", "0.62171", "0.6094435", "0.60572976", "0.6054468", "0.60328674", "0.6029534", "0.602851", "0.6028206", "0.6022162", "0.60156465", "0.5943905", "0.59407467", "0.59173757", "0.5907075", "0.5901451", "0.58710355", "0.58571446", "0.58103937", "0.579079...
0.0
-1
Shows all editing Buttons and lets the Creator edit all Content
function activateListEditing() { activateEditing(); createEditingElements("#list"); $("#list").on("click", "a", function(e){e.preventDefault();}); //disable the links $(".list_entry").find("p").addClass("editable"); $("#list").on("mouseenter", ".list_entry", showCloseButton).on("mouseleave", ".list_entry", hideCloseButton); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editMode() {\n name.html('<input value=\"' + name.html() + '\"></input>');\n details.html('<input value=\"' + details.html() + '\"></input>');\n actions.html('<button type=\"button\" class=\"btn btn-default btn-xs submit-btn\"><span title=\"Submit\" class=\"glyphicon glyphico...
[ "0.7083743", "0.6799995", "0.67624086", "0.66899246", "0.6672259", "0.66697115", "0.66154873", "0.660716", "0.65520513", "0.6548116", "0.65445817", "0.6539835", "0.6524632", "0.6509363", "0.6503334", "0.6468743", "0.64607865", "0.64575094", "0.64270973", "0.63960594", "0.6387...
0.5927829
82
Creates all the editing buttons
function createEditingElements(content) { $(content).append("<section id='add_button' class='color'></section>"); $(content).after("<section id='ok' class='color'>OK</section> " + "<section id='cancel' class='color_discreet'>Abbrechen</section>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editMode() {\n name.html('<input value=\"' + name.html() + '\"></input>');\n details.html('<input value=\"' + details.html() + '\"></input>');\n actions.html('<button type=\"button\" class=\"btn btn-default btn-xs submit-btn\"><span title=\"Submit\" class=\"glyphicon glyphico...
[ "0.71173334", "0.6822804", "0.6819673", "0.67684686", "0.6581039", "0.6550513", "0.65175205", "0.651235", "0.6502244", "0.6483966", "0.6466587", "0.64560014", "0.63586134", "0.6350971", "0.6345325", "0.6342421", "0.63414997", "0.63383543", "0.6314406", "0.6291723", "0.6271756...
0.61992896
26
Deletes all the editing buttons
function deactivateEditing() { $("#add_button").remove(); $("#ok").remove(); $("#cancel").remove(); $("#edit").toggleClass("color").toggleClass("color_discreet"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete() {\n let $self = $(`#${this.idDOM}`);\n if(this.commentSection !== undefined) {\n this.commentSection.delete();\n this.commentSection = undefined;\n }\n $self.remove();\n Object.keys(this.buttons).forEach(type => this.buttons[type].delete());\n }"...
[ "0.67942363", "0.6735046", "0.6660708", "0.6643881", "0.65631896", "0.65398955", "0.64643145", "0.6435768", "0.64321184", "0.634994", "0.6332706", "0.62450564", "0.6237518", "0.6223212", "0.62005925", "0.61547554", "0.6124555", "0.610372", "0.60992676", "0.6098958", "0.608532...
0.65540946
5
Cancels the editing process (reloads the page)
function editingCanceled() { location.reload(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function cancelEditOpp() {\n clearEditOppForm();\n}", "function cancelEdit() {\n resetForm();\n formTitle.innerHTML = 'Add Link';\n cancelButton.parentElement.removeChild(cancelButton);\n updateButton.p...
[ "0.7665697", "0.75253296", "0.7503541", "0.7387565", "0.73748785", "0.7352069", "0.7306743", "0.7243492", "0.724012", "0.71427625", "0.7140481", "0.7140481", "0.7137084", "0.7129002", "0.71221274", "0.7098921", "0.7094987", "0.7083689", "0.70516986", "0.7010669", "0.69900745"...
0.85241055
0
This function shows the close and upload button
function showIcons() { $(this).find(".upload_button").show(); $(this).find(".close_button").show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeUpload() {\n modal.setAttribute('style', 'display: none');\n uploadPanel.setAttribute('style', 'display: none');\n previewPanel.setAttribute('style', 'display: none');\n previewPanel.removeAttribute('src');\n}", "function closeUpload() {\n document.getElementById(\"uploadForm\").style.display ...
[ "0.73627514", "0.7225439", "0.7000192", "0.68709874", "0.6811232", "0.668938", "0.667643", "0.66034776", "0.65619755", "0.6535322", "0.65232843", "0.6517798", "0.64654034", "0.64225394", "0.6409213", "0.6399127", "0.6381303", "0.63795745", "0.6367217", "0.6367217", "0.6347031...
0.6609908
7
This function hides the close and upload button
function hideIcons() { $(this).find(".upload_button").hide(); $(this).find(".close_button").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeUpload() {\n modal.setAttribute('style', 'display: none');\n uploadPanel.setAttribute('style', 'display: none');\n previewPanel.setAttribute('style', 'display: none');\n previewPanel.removeAttribute('src');\n}", "function closeUpload() {\n document.getElementById(\"uploadForm\").style.display ...
[ "0.788047", "0.7779927", "0.75415784", "0.7433497", "0.7401044", "0.71126735", "0.70935726", "0.7030224", "0.7029323", "0.69899267", "0.6962588", "0.6944313", "0.6918102", "0.69105506", "0.69066995", "0.68887556", "0.6888672", "0.6877272", "0.68668526", "0.6850368", "0.684584...
0.735671
5
This function shows the close and upload button
function showCloseButton() { $(this).find(".close_button").show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeUpload() {\n modal.setAttribute('style', 'display: none');\n uploadPanel.setAttribute('style', 'display: none');\n previewPanel.setAttribute('style', 'display: none');\n previewPanel.removeAttribute('src');\n}", "function closeUpload() {\n document.getElementById(\"uploadForm\").style.display ...
[ "0.73627514", "0.7225439", "0.7000192", "0.68709874", "0.6811232", "0.668938", "0.667643", "0.6609908", "0.66034776", "0.65619755", "0.6535322", "0.65232843", "0.6517798", "0.64654034", "0.64225394", "0.6409213", "0.6399127", "0.6381303", "0.63795745", "0.6367217", "0.6367217...
0.6250497
25
This function hides the close and upload button
function hideCloseButton() { $(this).find(".close_button").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeUpload() {\n modal.setAttribute('style', 'display: none');\n uploadPanel.setAttribute('style', 'display: none');\n previewPanel.setAttribute('style', 'display: none');\n previewPanel.removeAttribute('src');\n}", "function closeUpload() {\n document.getElementById(\"uploadForm\").style.display ...
[ "0.78798574", "0.77799255", "0.75391525", "0.743251", "0.7399785", "0.7355753", "0.71131116", "0.709265", "0.7028427", "0.7026906", "0.6988686", "0.6963077", "0.69435686", "0.6918657", "0.69101584", "0.6906889", "0.6887903", "0.6887369", "0.6878456", "0.6866857", "0.6851095",...
0.673914
27
This function removes an answer entry.
function removeListEntry() { $(this).closest(".list_entry").remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeIt(docID) {\n this.assertDefined(docID);\n // remove the Answers associated with this question\n MentorAnswers.removeQuestion(docID);\n // OK, clear to delete.\n super.removeIt(docID);\n }", "function removeAnswer() {\n $(this).parent().closest(\".answer-row\").remove();\n}", "function...
[ "0.71038413", "0.70507246", "0.6950877", "0.68506503", "0.6833472", "0.6763043", "0.67035604", "0.6700536", "0.66741675", "0.66677207", "0.66478455", "0.66355175", "0.65766686", "0.65359163", "0.6509901", "0.64655435", "0.64513665", "0.6444106", "0.6435183", "0.64312774", "0....
0.0
-1
Create Extract Plugin SubMenu
function addExtractSubMenu() { // Check for Edit Plugin SubMenu if ( typeof pSubMenu == "undefined") { var pSubMenu = false; // If No Menu Item if (!pSubMenu) { pSubMenu = true; // Add Plug-in Menu Item app.addSubMenu( { cName:"EXTRACT:JSSubMenu", cUser: "Extract Plugin", cParent: "Edit", nPos: 0 } ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSubMenus(parentItem, isSubTree) { var submenuHtml = \"\"; if (parentItem.items != undefined && parentItem.items.length > 0) { if (parentItem.type == \"link-list-image\") { submenuHtml += \"<ul class=\\\"mm-product-list\\\">\"; jQueryBuddha.each(parentItem.items, function (pos, subitem) { var href = (su...
[ "0.62060493", "0.61910784", "0.61769605", "0.5972832", "0.5937031", "0.59156394", "0.59156394", "0.5877609", "0.58089405", "0.5802761", "0.5787569", "0.5763659", "0.5713603", "0.5711556", "0.57112366", "0.56760603", "0.56697416", "0.5656419", "0.5649816", "0.5623954", "0.5622...
0.78022295
0
Function used to collect all the posts into an array from firebase
async function collectPosts(){ posts = []; // reset posts to 0 / initialize to a list await firebase.database().ref('posts') .once('value', x => { x.forEach(data => { posts.push(data.val()); //push the data to the list }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPosts() {\n const postsList = [];\n this.postRef.get().then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n const { content, postedBy, postedById, date } = doc.data();\n postsList.push({\n key: doc.id,\n content,\n postedBy,\n postedById,\n ...
[ "0.77527994", "0.7518996", "0.74031943", "0.7331191", "0.700974", "0.6888145", "0.68377364", "0.67243683", "0.6721142", "0.6708976", "0.6621733", "0.6621308", "0.65550494", "0.65136486", "0.64747846", "0.6436656", "0.64004856", "0.63674897", "0.6354678", "0.635347", "0.635251...
0.85875756
0
Function used to collect all the comments into an array from firebase
async function collectComments(){ comments = []; // reset posts to 0 / initialize to a list await firebase.database().ref('comments') .once('value', x => { x.forEach(data => { comments.push(data.val()); //push the data to the list }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getComments() {\n var commentsRef = firebase.database().ref('Users/' + this.props.writer + '/published/' + this.props.post + '/comments'); //the chats in the channel\n commentsRef.on('value', (snapshot) => {\n var commentArray = []; //could also do this processing in render\n sn...
[ "0.74019784", "0.6929987", "0.6799255", "0.6783837", "0.6780865", "0.6735011", "0.6649387", "0.66305107", "0.65912926", "0.65741676", "0.6570657", "0.6546653", "0.6511906", "0.65060323", "0.6469847", "0.64610326", "0.6455573", "0.64367306", "0.6431949", "0.6370579", "0.635900...
0.8379838
0
Function used to collect all the comments into an array from firebase
async function collectReplies(){ replies = []; // reset posts to 0 / initialize to a list await firebase.database().ref('replies') .once('value', x => { x.forEach(data => { replies.push(data.val()); //push the data to the list }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function collectComments(){\n comments = []; // reset posts to 0 / initialize to a list\n await firebase.database().ref('comments')\n .once('value', x => {\n x.forEach(data => {\n comments.push(data.val()); //push the data to the list\n })\n });\n}", "getComments() {\n ...
[ "0.8379838", "0.74019784", "0.6799255", "0.6783837", "0.6780865", "0.6735011", "0.6649387", "0.66305107", "0.65912926", "0.65741676", "0.6570657", "0.6546653", "0.6511906", "0.65060323", "0.6469847", "0.64610326", "0.6455573", "0.64367306", "0.6431949", "0.6370579", "0.635900...
0.6929987
2
Function that updates the table that is displayed for the user based on the value of the checked radio
async function updateTable(){ let checked_value = document.getElementById('tableDisplay').value; if (checked_value == "createdPosts"){ displayCreatedPosts(); } else if (checked_value == "likedPosts") { await retrieveLikedPosts(); } else if (checked_value == "dislikedPosts"){ retrieveDislikedPosts(); } else if (checked_value == "comments"){ displayCommentsMade(); } else if (checked_value == "favouritePosts") { displayFavourtiePosts(); } else if (checked_value == "likedComments"){ retrieveLikedComments(); } else if(checked_value == "replies"){ displayReplies(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTableSingleEntry(index, zoneInfo){\n var ownerName = zoneInfo.zoneOwner\n var zoneName = zoneInfo.zoneName\n var amountOfItems = zoneInfo.amountOfItemTypes\n var amountOfStores = zoneInfo.amountOfStores\n var amountOfOrders = zoneInfo.amountOfOrders\n var averagePriceOfOrders = zon...
[ "0.6555448", "0.65519047", "0.64208174", "0.631339", "0.6257509", "0.6227144", "0.6153542", "0.61364317", "0.603012", "0.6017995", "0.6011641", "0.5983538", "0.5968131", "0.5955272", "0.5926599", "0.5913976", "0.58838886", "0.5866638", "0.5829053", "0.58038515", "0.5796899", ...
0.6768647
0
Function that displays the Table that is used to display the created posts by the user
function displayCreatedPosts(){ //outputing the rows of posts let display_table = document.getElementById("tableDisplayRow"); let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Post Id</th><th>Post Title</th><th>Post link</th></thead><tbody>"; for (let i = 0; i < created_posts.length; i++){ let post = created_posts[i]; output_rows += "<tr><td>" + post.id + "</td><td> " + post.title + " </td><td>"; output_rows += `<div> <button class='btn btn-primary' id='more_btn' onclick="transfer_admin_post('${post.id}');"> View More </button> </div>`; output_rows += "</td></tr>"; } output_rows += "</tbody></table>"; display_table.innerHTML = output_rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_allPost(e){\n\tif(!e === false){\n\t\te.preventDefault();\n\t}\n\n document.getElementById('input_id').value = \"\"\n\tconst table = document.getElementById('displaytable')\n\tconst all = document.getElementById('all')\n\tif (table != null) {\n\t\tall.removeChild(table)\n\t}\n\n\tconst form = doc...
[ "0.66406286", "0.64608777", "0.6377049", "0.63295925", "0.63011044", "0.6296435", "0.6287319", "0.62512684", "0.62111485", "0.6205541", "0.6191071", "0.61445177", "0.61237144", "0.6111922", "0.6110555", "0.60612524", "0.60273755", "0.6017682", "0.5984912", "0.5982883", "0.597...
0.6893565
0
Function that is used to collect a list of the liked posts based on their id
async function retrieveLikedPosts(){ let liked_posts = []; console.log(liked_posts_id.length); for(let i =0; i<liked_posts_id.length; i++){ let j=0; while (j < posts.length){ if(liked_posts_id[i] == posts[j].id){ liked_posts.push(posts[j]); break; } else { j++; } } } await displayLikedPosts(liked_posts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getAlllikes(_id) {\n return new Promise((resolve, reject) => {\n models.like.findAndCountAll({\n where: {\n postid: _id\n }\n })\n .then(vpst => {\n resolve(vpst);\n }, (error) => {\n reject(error);\n });\n });\n }", "function ...
[ "0.75636613", "0.73751897", "0.71088237", "0.7079694", "0.7042774", "0.6916886", "0.668297", "0.6678775", "0.6607681", "0.66026217", "0.65940577", "0.65458155", "0.65403795", "0.65211594", "0.6503426", "0.6427886", "0.6426726", "0.64134294", "0.6408564", "0.6344663", "0.63229...
0.7589787
0
Function that is used to collect a list of the disliked posts based on their id
function retrieveDislikedPosts(){ let disliked_posts = []; for(let i =0; i<disliked_posts_id.length; i++){ let j=0; while (j < posts.length){ if(disliked_posts_id[i] == posts[j].id){ disliked_posts.push(posts[j]); break; } else { j++; } } } displayDisikedPosts(disliked_posts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dislikepost() {\n setUnlike(true);\n const value = allpost;\n const updatedarray2 = value.filter(post => {\n const temp = {userId:post.userId,\n title:post.title,\n body:post.body};\n if(JSON.stringify(temp) !== JSON.stringify(user)){\n return post;\n }else {\n post.dislike...
[ "0.6790612", "0.6781932", "0.6662026", "0.6620874", "0.6545946", "0.6414881", "0.63794905", "0.63642395", "0.62440586", "0.6157001", "0.6139765", "0.61065006", "0.60712826", "0.60349923", "0.5937726", "0.5896745", "0.5878354", "0.58447486", "0.5776334", "0.56968516", "0.56849...
0.8190954
0
Funtion that displayes the table of comments made by the user
function displayCommentsMade(){ //outputing the rows of posts let display_table = document.getElementById("tableDisplayRow"); let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Comment content</th><th>Date made</th><th>No. of likes</th><th>Anonymous</th><th>Post link</th></thead><tbody>"; for(let i=0; i<comments_made.length; i++){ let comment = comments_made[i]; output_rows += "<tr><td>" + comment.content + "</td><td> " + comment.created + " </td><td>" + comment.likes + " </td><td>" + comment.anonymous + " </td><td>"; output_rows += `<div> <button class='btn btn-primary' id='more_btn' onclick="transfer_admin_post('${comment.postID}');"> View More </button> </div>`; output_rows += "</td></tr>"; } output_rows += "</tbody></table>"; display_table.innerHTML = output_rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayComments(){\n if(rData[tracker].taskComments.length === 0){\n document.getElementById(\"comments-cont\").innerHTML = `<p>No Comments yet</p>`;\n }\n else{\n document.getElementById(\"comments-cont\").innerHTML = \"\";\n for(let i = 0; i < rData[tracker].taskComments.le...
[ "0.6936455", "0.68821055", "0.67976665", "0.67136246", "0.66723955", "0.6660486", "0.66499037", "0.657815", "0.6572328", "0.6566288", "0.6514583", "0.64905536", "0.6487758", "0.6481046", "0.64698327", "0.63994026", "0.6397369", "0.635557", "0.6334769", "0.6313319", "0.6309014...
0.6957094
0
Function that displays the posts that were favourited by the user
function displayFavourtiePosts(){ //outputing the rows of posts let display_table = document.getElementById("tableDisplayRow"); let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Post Id</th><th>Post Title</th><th>Post link</th></thead><tbody>"; for (let i = 0; i < favourite_posts.length; i++){ let post = favourite_posts[i]; output_rows += "<tr><td>" + post.id + "</td><td> " + post.title + " </td><td>"; output_rows += `<div> <button class='btn btn-primary' id='more_btn' onclick="transfer_admin_post('${post.id}');"> View More </button> </div>`; output_rows += "</td></tr>"; } output_rows += "</tbody></table>"; display_table.innerHTML = output_rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFavs(favs, rposts) {\n var fposts = rposts;\n if (rposts.posts) {\n fposts = rposts.posts;\n }\n Object.keys(favs).forEach(function(fav) {\n if (favs[fav] === true) {\n if (fposts[fav]) {\n fposts[fav].favorited = true;\n } else {\n\n ...
[ "0.68851435", "0.66237044", "0.66163206", "0.6610683", "0.660802", "0.65856564", "0.65667135", "0.65439284", "0.6535616", "0.6529028", "0.6524799", "0.6518279", "0.6513595", "0.6501147", "0.6467139", "0.6416539", "0.6394349", "0.6375848", "0.63649976", "0.63360804", "0.631647...
0.56695116
92
Function that creates a list of all the comments liked by the user using their ids
function retrieveLikedComments(){ let liked_comments = []; for(let i =0; i<liked_comments_id.length; i++){ let j=0; while (j < comments.length){ if(liked_comments_id[i] == comments[j].id){ liked_comments.push(comments[j]); break; } else { j++; } } } displayLikedComments(liked_comments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async substantiate(ids) {\n let returnedList = []\n for (let id of ids) {\n let comment = await this.getCommentById(id)\n let user = await usersData.getUserById(comment.userId)\n comment.commenter =user.basicInfo.username\n returnedList.push(comment)\n }\n return returnedList\n }...
[ "0.6917719", "0.6472427", "0.6223054", "0.6191141", "0.61231697", "0.6097229", "0.60823756", "0.60197264", "0.59993947", "0.5974195", "0.5923261", "0.5883484", "0.58656716", "0.5865199", "0.5862507", "0.5861681", "0.5819139", "0.5802923", "0.5792645", "0.57637054", "0.5758500...
0.73276067
0
Function that displays the comments that were liked by the user
function displayLikedComments(liked_comments){ //outputing the rows of posts let display_table = document.getElementById("tableDisplayRow"); let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Comment content</th><th>Date made</th><th>No. of likes</th><th>Comment made by</th><th>Anonymous</th><th>Post link</th></thead><tbody>"; for(let i=0; i<liked_comments.length; i++){ let comment = liked_comments[i]; output_rows += "<tr><td>" + comment.content + "</td><td> " + comment.created + " </td><td>" + comment.likes + " </td><td>" + comment.username + " </td><td>" + comment.anonymous + " </td><td>"; output_rows += `<div> <button class='btn btn-primary' id='more_btn' onclick="transfer_admin_post('${comment.postID}');"> View More </button> </div>`; output_rows += "</td></tr>"; } output_rows += "</tbody></table>"; display_table.innerHTML = output_rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_like_to_comment(blogId, commentId, user) {\n Blog.findOne({\n id: blogId,\n }, function (err, result) {\n if (err) throw err;\n if (!result) return {\n status: false,\n message: \"Comment doesn't exists\"\n };\n else\n result.com...
[ "0.6931083", "0.69177526", "0.6915251", "0.6748819", "0.66150844", "0.66134566", "0.65817815", "0.65719664", "0.6553058", "0.64932555", "0.6425414", "0.64209324", "0.6412185", "0.6411477", "0.6377785", "0.63755566", "0.6367866", "0.6345177", "0.63291717", "0.6295614", "0.6280...
0.64819
10
Function that finds the comment or the reply using their id
function find_comment_reply(id){ // search in the comment section for (let i=0; i<comments.length; i++){ if(comments[i].id == id){ return comments[i]; } } // search in the reply section for (let i=0; i<replies.length; i++){ if(replies[i].id == id){ return replies[i]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findComment(cmntId) {\n\t\tlet found = null;\n\t\tfor(let i=0;i<this.posts.length;i++) {\n\t\t\tlet comments = this.posts[i].comments;\n\t\t\tfor(let j=0;j<comments.length;j++) {\n\t\t\t\tconsole.log(j);\n\t\t\t\tfound = this.findCommentRec(comments[j], cmntId);\n\t\t\t\tif(found != null) {\n\t\t\t\t\treturn found...
[ "0.67549676", "0.65965974", "0.6507963", "0.65074843", "0.64717424", "0.6460296", "0.6369283", "0.6326048", "0.62471026", "0.623213", "0.61644244", "0.6148989", "0.61166567", "0.61114043", "0.60989827", "0.6089911", "0.6089911", "0.60863084", "0.606387", "0.605053", "0.603838...
0.8728188
0
Function that displays the replies that were made by the user
function displayReplies(){ //outputing the rows of posts let display_table = document.getElementById("tableDisplayRow"); let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Reply content</th><th>Date made</th><th>Reply to comment/reply</th><th>Reply to user</th><th>Anonymous</th></thead><tbody>"; for(let i=0; i<replies_made.length; i++){ let reply = replies_made[i]; let parent = find_comment_reply(reply.reply_comment_parent); output_rows += "<tr><td>" + reply.content + "</td><td> " + reply.created + " </td><td>" + parent.content + " </td><td>" + parent.username + " </td><td>" + reply.anonymous + " </td>"; output_rows += "</tr>"; } output_rows += "</tbody></table>"; display_table.innerHTML = output_rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showReply() {\n let text = document.createElement(\"p\");\n text.innerHTML = this.reply[this.replyCount];\n this.replyCount++;\n this.main.appendChild(text);\n }", "function showReplies() {\n\t\tvar displayReplies = this.parentNode.nextElementSibling;\n\t\tif (displayReplies == nul...
[ "0.7647691", "0.7230234", "0.7128351", "0.71191406", "0.6752375", "0.66314787", "0.65993845", "0.65044796", "0.6502698", "0.64779997", "0.6454405", "0.6443196", "0.64304096", "0.642026", "0.639083", "0.629148", "0.62881863", "0.62829125", "0.6258695", "0.6236958", "0.6232308"...
0.7080795
4
private request (HttpRequest, URL, callback) Initializes a XMLHttpRequest to the provided URL, passing data to a callback function
function request(HttpRequest, URL, callback) { var req = new HttpRequest(); req.onload = function (e) { var response = JSON.parse(e.currentTarget.responseText); callback(response); }; req.open('GET', URL); req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doRequest(url, data, callback) {\n callback({ url, data });\n }", "function get_request(url,callback)\n{\n var xhttp = new XMLHttpRequest();\n // executed every time the status of the XMLHttpRequest object changes\n xhttp.onreadystatechange = function () {\n // readyState 4 == DONE\n...
[ "0.7494853", "0.7447633", "0.74115765", "0.7241448", "0.72312564", "0.71702", "0.71648246", "0.7107275", "0.70414555", "0.7018265", "0.6993106", "0.69841135", "0.696811", "0.69424087", "0.69336176", "0.6845587", "0.6824974", "0.6805681", "0.6799687", "0.67810285", "0.67713195...
0.7436923
2
Get the object specified by the index
get(index) { this.rangeCheck(index); return this.elementData[index]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function index(obj,i) {return obj[i]}", "function index(obj,i) {return obj[i];}", "get(index) {\n if(index < 0 || index >= this.length) {\n throw new Error('Index error')\n }\n return memory.get(this.ptr + index)\n }", "get(index) {\n if (index < 0 || index >= this.lengt...
[ "0.7683634", "0.76389277", "0.7194272", "0.71917945", "0.7184722", "0.70697695", "0.7046395", "0.70026994", "0.69991505", "0.69781935", "0.6976026", "0.6976026", "0.6976026", "0.6976026", "0.6976026", "0.6965227", "0.6849853", "0.6815155", "0.6815155", "0.6815155", "0.6747429...
0.64537144
27
Update the object at the specified index
update(index, Object) { this.rangeCheck(index); this.elementData[index] = Object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setIndex(index) {\n this.index = index;\n }", "updateItem(el, value, index) {}", "function updateIndex(index, item) {\n\t\t\treturn index;\n\t\t}", "setIndex(index) {\n this._index = index;\n }", "function updateIndex() {\n var i,\n orders = $scope.orders.filter(function...
[ "0.70286536", "0.70078546", "0.6884849", "0.6859178", "0.6804143", "0.67495924", "0.6729854", "0.668611", "0.66708857", "0.66524076", "0.6566252", "0.6554909", "0.65165794", "0.6477924", "0.64583904", "0.639185", "0.63877153", "0.6353237", "0.63526106", "0.63392323", "0.63347...
0.8276315
0
Clear all elements in the ArrayList.
clear() { for (let i = 0; i < this.sizeNum; i++) { this.remove(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Clear() {\n this.List.length = 0;\n }", "clear() {\n this._list.clear();\n }", "clear() {\n\t\tlet e = this.first();\n\t\twhile (e != 0) { this.delete(e); e = this.first(); }\n\t}", "clear() {\n while (this.items.length) {\n this.items.pop();\n }\n }", "clear() {\n...
[ "0.7693453", "0.76039326", "0.7382793", "0.73479587", "0.7184735", "0.7066299", "0.70279753", "0.7014048", "0.70081335", "0.6968628", "0.69299155", "0.6908462", "0.6908127", "0.68997705", "0.68783706", "0.68744063", "0.6867332", "0.68552166", "0.68322563", "0.6828323", "0.678...
0.75305426
2
Get the size of the ArrayList
size() { return this.sizeNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function length() {\n\treturn this.listSize;\n}", "sizeOfList() {\r\n\t\treturn this.size;\r\n\t}", "sizeOfList() {\n return this.size;\n }", "sizeOfList() {\n return this.size;\n }", "size() {\n\t\treturn this.items.length();\n\t}", "function size() {\n return this.toArray().lengt...
[ "0.81339365", "0.78373164", "0.7767978", "0.7767978", "0.7738498", "0.765846", "0.7628331", "0.7600569", "0.7598165", "0.7597357", "0.7584934", "0.7546354", "0.7510092", "0.748149", "0.7406526", "0.73986405", "0.7391962", "0.7358825", "0.7357879", "0.73376536", "0.7306294", ...
0.6810136
74
Check whether the index exceeds the capacity
rangeCheck(index) { if (index >= this.sizeNum || index < 0) { throw new Error("is no index--->" + index); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFull() {\n return (this.lastIndex === (this.capacity() - 1));\n }", "reachedCapacity(){\n return this.amount >= this.item.stackMax ;\n }", "function isBigEnough(element, index, array) {\n return element >= 10;\n }", "function checkBounds(index, len) {\n if (!(index >= 0 && index ...
[ "0.7060047", "0.70323336", "0.6888045", "0.66660094", "0.66206884", "0.6557922", "0.63724935", "0.63724935", "0.63541216", "0.62931526", "0.6269308", "0.6250565", "0.6209773", "0.61854845", "0.6094493", "0.6064989", "0.603673", "0.5959874", "0.5945899", "0.5926109", "0.592141...
0.6813175
3
Expand the capacity of the ArrayList to 1.5 times
ensureExplicitCapacity() { if (this.elementData.length < this.sizeNum + 1) { let oldCapacity = this.elementData.length; let newCapacity = oldCapacity + (oldCapacity >> 1); this.elementData.length = newCapacity; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "grow() {\n const size = this.size;\n const list = new Array(size * 2);\n for (var i = 0; i < size; i++) list[i] = this.shift();\n this.size = list.length;\n this.mask = this.size - 1;\n this.top = size;\n this.btm = 0;\n this.list = list;\n this.fill(size);\n }", "grow() {\n th...
[ "0.67417526", "0.651596", "0.62094223", "0.6014265", "0.5990168", "0.5938196", "0.58775336", "0.5861007", "0.5778369", "0.5760652", "0.55707103", "0.556874", "0.5558402", "0.55320096", "0.5490897", "0.54623324", "0.54542243", "0.5416391", "0.54039943", "0.5400132", "0.53735",...
0.5646119
10
This function requests activation with the REST in a loop, with a 1 second back off if a network/system error occurs to avoid draining resources when offline.
function activationRetry(err) { if (err) log.error('Failed activation', err); // not a http error so back off function checkError() { if (err && !err.message.match(/response code/)) { return when().delay(1000); // chill for a second } } // when the activation process completes we need to restart function quit() { log.info('Exiting now.'); process.nextTick(process.exit); } when() .then(checkError) .then(self.activate.bind(self)) .then(saveToken) .then(quit) .catch(activationRetry); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activate(){\n busy = queue[0]\n if(busy) fetch(busy.url,busy.options)\n .then(busy.onComplete,err=>false)\n .then(ok=>{\n if(ok || !busy.retry){\n queue = queue.filter(item=>item!==busy)\n activate()\n ...
[ "0.6032965", "0.5746238", "0.55505073", "0.5526911", "0.549358", "0.5468748", "0.5391503", "0.53600353", "0.5327947", "0.5292629", "0.52918947", "0.524319", "0.52412444", "0.5239561", "0.5233186", "0.5232279", "0.522469", "0.5155183", "0.5142878", "0.5123148", "0.512071", "...
0.66396797
0
not a http error so back off
function checkError() { if (err && !err.message.match(/response code/)) { return when().delay(1000); // chill for a second } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _failedReq() {\n\t\t\t\t\t\tif(idataObj.hasOwnProperty('socket')) {\n\t\t\t\t\t\t\tidataObj.socket = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//logger.error(JSON.stringify(idataObj));\n\t\t\t\t\t\tif(idataObj.offLineRequest == true) {\n\t\t\t\t\t\t\tdbStore.redisConnPub.publish('FAILURE_DAEMON', JSON.string...
[ "0.6418477", "0.63613176", "0.6330813", "0.63289154", "0.6306041", "0.613668", "0.61210066", "0.61133873", "0.60091805", "0.600368", "0.59727603", "0.59576994", "0.5952684", "0.59505504", "0.5947223", "0.5944915", "0.58677745", "0.58644634", "0.58644634", "0.5830938", "0.5820...
0.56769603
30
when the activation process completes we need to restart
function quit() { log.info('Exiting now.'); process.nextTick(process.exit); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "relaunch() {}", "function restart() {}", "function activationRetry(err) {\n if (err) log.error('Failed activation', err);\n\n // not a http error so back off\n function checkError() {\n if (err && !err.message.match(/response code/)) {\n return when().delay(1000);...
[ "0.7240134", "0.6914997", "0.68968546", "0.68551385", "0.6729995", "0.6680913", "0.62755734", "0.6254661", "0.62433815", "0.6231113", "0.6206949", "0.61732143", "0.61600304", "0.6131208", "0.61104673", "0.6106165", "0.60806656", "0.60636413", "0.6058048", "0.60421187", "0.599...
0.0
-1
componentHandler is an object in material.js (script for the Material Design Light framework) element is jquery element set or array, not a nodeList
function upgradeElements(elements) { if (!Array.isArray(elements)) { elements = elements.toArray(); } componentHandler.upgradeElements(elements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getComponent() {\n return this.querySelector(\"div\");\n }", "upgradeElements () {\n componentHandler.upgradeElements(this.$('[class*=\"mdl-js-\"]'))\n }", "function forEachComponent (handler) {\n \t\t\treturn LIB.Promise.all(Object.keys(components).map(function (componentId) {\n \t\t\t try {\...
[ "0.6365816", "0.62439334", "0.60299706", "0.59817785", "0.5897079", "0.588388", "0.5880153", "0.58054245", "0.5795525", "0.5750669", "0.5640284", "0.5638869", "0.5636096", "0.55993515", "0.55530363", "0.55268407", "0.55260867", "0.55206037", "0.5511518", "0.5511518", "0.54972...
0.0
-1
Build an array of elements that are the siblings of firstNode filters out nonHTMLElements componentHandler.upgrade/downgrade handles child elements, so we only need top level
function assembleNodes(firstNode) { var nodes = []; var node = firstNode; while(node) { if (node instanceof HTMLElement) nodes.push(node); node = node.nextSibling; } return nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildDomSequenceChildren(horizonal) {\n let domElt = this.buildDomElement();\n\n if (domElt) {\n return [domElt]\n }\n\n return []\n }", "_gatherParentComponents() {\n let node = this;\n const parents = [node];\n while (node.parentComponent) {\n nod...
[ "0.63280183", "0.58519894", "0.5837288", "0.5825753", "0.5825753", "0.5825753", "0.5825753", "0.57135165", "0.57040536", "0.5658802", "0.55858374", "0.55806226", "0.55806226", "0.55806226", "0.5568945", "0.5512227", "0.5509339", "0.5502161", "0.5502161", "0.54604524", "0.5448...
0.6501886
0
changeProduct() filters the data data by product and year (depending on user input) and sends the data to the updateChart() function
function changeProduct() { var selected_product = document.getElementById("product").value; var product_filtered = Object.keys(all_products_) .filter(key => selected_product.includes(key)) .reduce((obj, key) => { obj[key] = all_products_[key]; return obj; }, {}); var data_to_array = Object.values(product_filtered[selected_product]) var selected_year = document.getElementById("sales_chart").value; var selected_year = +selected_year console.log(selected_year) var data_filtered_by_year = data_to_array.map(x => x.filter(function (element) { return element.anio === selected_year })) console.log("data_filtered_by_year", data_filtered_by_year) updateChart(data_filtered_by_year) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateYear(year) {\n\t\tthis.year = year;\n\t\t/*this.chartData = this.allData[this.category]\n\t\t\t.filter(function(d) {\n\t\t\t\tif (d.yr === year) return d;\n\t\t\t});*/\n\t}", "function updateYear(year) {\n\t\t// First set the beggining and end dates\n\t\t/* Variables */\n\n\t\tvar yearStartDate = year + \"...
[ "0.6821138", "0.65695345", "0.64151573", "0.6342162", "0.6275517", "0.61378825", "0.6108181", "0.6093214", "0.6092276", "0.6082159", "0.60703164", "0.60666806", "0.60457385", "0.60053515", "0.6003175", "0.599622", "0.5967732", "0.5967043", "0.59573764", "0.5946504", "0.594596...
0.8057578
0
updateChart() function will plot the filered data // :
function updateChart(data) { var selected_year = document.getElementById("sales_chart").value; var data_filtered_by_year = data.map(x => x.filter(function (element) { return element.anio == selected_year })) var data_filtered_by_year = data_filtered_by_year[0] console.log(data_filtered_by_year) var bars = svg.selectAll(".bar") .remove() .exit() .data(data_filtered_by_year) bars.enter() .append("rect") .attr("class", "bar") .attr("x", function (d) { return x(d.mes.trim()); }) .attr("y", function (d) { return y(d.total); }) .attr("height", function (d) { return 700 - y(d.total); }) .attr("width", x.bandwidth()) .style("fill", "red") .style("opacity", 0.7) .on("mouseover", hover); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateChart() {\n removePreviousChart();\n emptyChartData(chart);\n filterCategoryInsertion();\n displayChart(chart);\n}", "updateChart () {\n \n }", "updateChart() {\n let xLabel = this.getChartX();\n let yLabel = this.getChartY();\n let t = this.getChartTargetArray();\n t...
[ "0.8090911", "0.7831468", "0.7811779", "0.7415933", "0.74116856", "0.7346491", "0.733474", "0.73082143", "0.7307327", "0.72835165", "0.7198124", "0.715471", "0.7148606", "0.7078928", "0.7021339", "0.6941309", "0.69376427", "0.69376427", "0.69262064", "0.69141436", "0.69137144...
0.0
-1
return 3D array by priority, state and list of defects
function countByPriorityAndState(defectResults) { var maxRow = defectResults.defectPriorities.length; var maxCol = defectResults.defectStates.length; initialize3DArray(maxRow, maxCol); // cycle through defects and increment the appropriate state/priority combo in the array var row, column; for (var i = 0; i < defectResults.defects.length; i++) { column = findIndex(defectResults.defects[i].State, defectResults.defectStates); row = findIndex(defectResults.defects[i].Priority, defectResults.defectPriorities); var defect = defectResults.defects[i]; addDefect(column, row, defect); addDefect(column, maxRow, defect); addDefect(maxCol, row, defect); addDefect(maxCol, maxRow, defect); setOwner(defect); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Array3d(x,y,z) {\n\t\t\tvar temp = [];\n\t\t\tfor (i = 0; i < x; i++) {\n\t\t\t\ttemp.push([]);\n\t\t\t}\n\t\t\tfor (i = 0; i < x; i++) {\n\t\t\t\tfor (j = 0; j < y; j++) {\n\t\t\t\t\ttemp[i].push([]);\t\t\t\n\t\t\t\t}\n\t\t \t}\n\t\t \tfor (i = 0; i < x; i++) {\n\t\t\t\tfor (j = 0; j < y; j++) {\n\t\t\t\...
[ "0.5811322", "0.5464439", "0.5338622", "0.51332456", "0.51076525", "0.508561", "0.5059518", "0.5059518", "0.50556695", "0.503029", "0.5029879", "0.4986717", "0.4985288", "0.4982675", "0.4982601", "0.4968422", "0.4940406", "0.4918485", "0.49064875", "0.48997504", "0.4871328", ...
0.63397706
0
Topics should not include the event signature
decodeEventLog(eventName: string, log: Object) { const abi = this.abi.find(abi => { return abi.type === 'event' && abi.name === eventName }) if (!abi) { throw new Error(`Event '${eventName}' not found in ABI`) } const inputs = [ { indexed: true, name: 'signature', type: 'string', }, ...abi.inputs, ] // Remove event sig topic as expected by decodeLog const topics = log.topics.slice(1) return Web3EthAbi.decodeLog(inputs, log.data, topics) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getEventTopic(eventFragment) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n return Object(_ethersproject_properties__WEBPACK_IMPORTED_MODULE_5__[/* getStatic */ \"e\"])(this.constructor, \"getEventTopic\")(eventFragment);\n ...
[ "0.59672225", "0.59650457", "0.59650457", "0.5954195", "0.5924135", "0.57818204", "0.5638559", "0.5598219", "0.5598219", "0.5544507", "0.54975533", "0.54708856", "0.54393023", "0.54256773", "0.540821", "0.53945106", "0.5390951", "0.53902364", "0.53769153", "0.53671086", "0.53...
0.0
-1
get random integer between 0 and max
function rndInt(max) { return Math.floor(Math.random() * (max + 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomInt(max) {return Math.floor(Math.random() * Math.floor(max));}", "_getRandomInt(max) {\n if (max === 0) {\n return 0;\n }\n return Math.floor(Math.random() * max);\n }", "function getRandomInt(max){\n return Math.floor(Math.random()*max);\n}", "function...
[ "0.89547235", "0.8789505", "0.8787596", "0.8771814", "0.8758108", "0.87454605", "0.87450063", "0.87450063", "0.87450063", "0.87375313", "0.87375313", "0.87375313", "0.87337416", "0.87254727", "0.8724991", "0.8724991", "0.8724628", "0.8724628", "0.87198204", "0.8717518", "0.87...
0.868298
31
get a random element from an array
function rndElement(array) { return array[rndInt(array.length - 1)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n }", "function randomElement(array) {\n\t\treturn array[Math.floor(Math.random() * array.length)];\n\t}", "function randomElement(array) {\n return array[randomInteger(array.length)];\n}", "function randomEleme...
[ "0.8683439", "0.8670983", "0.86489284", "0.86489284", "0.8627582", "0.8562825", "0.8562825", "0.85599774", "0.8552947", "0.85422385", "0.85422385", "0.8526297", "0.8520812", "0.85206217", "0.8520192", "0.8519579", "0.84855294", "0.8478061", "0.8476062", "0.84686375", "0.84660...
0.8095874
50