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
============================================ Quote Generation ============================================
function generateQuote() { //Initialize Variables var genQuote = document.getElementById("generated-quote"); var colorChangeYes = document.getElementById("colorChangeYes"); var colorChangeNo = document.getElementById("colorChangeNo"); var storeYes = document.getElementById("storeYes"); var storeNo = document.getE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate_quotes(quotes){\n if(quotes.error){\n return \"\"\n }\n let head = \"<h1>Quotes</h1><div>\"\n let tail = \"</div>\"\n quotes.forEach( (quote, i) => {\n if(i >= 5) return;\n let char_quote = quote.quote.replace(\"\\n\", \"<br>\");\n let h2 = `<h2 class=\"...
[ "0.77035636", "0.7163401", "0.7160134", "0.70983446", "0.70882535", "0.7051186", "0.70431954", "0.7027067", "0.6979526", "0.6965679", "0.69542515", "0.6950523", "0.69504696", "0.69205564", "0.69185716", "0.6902182", "0.68955344", "0.68670404", "0.68561655", "0.6853247", "0.68...
0.0
-1
============================================ Conditional Accordion Functionality ============================================
function openAccordion(){ if ($('#storeYes').closest(".radio-inline").hasClass('active')) { $('#storeChildren').collapse('show'); } else if ($('#storeNo').closest(".radio-inline").hasClass('active')) { $('#storeChildren').collapse('hide'); } else { $('#storeChildren').collapse('hide'); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accordion() {\n\tif ($('.js-accordion').length) {\n\t\t$('.js-accordion').on('click', function () {\n\t\t\t$(this).toggleClass('is-closed');\n\t\t\t$(this).next().slideToggle();\n\t\t})\n\t}\n}", "expandAccordion(){\n\n this.cssClass = (this.cssClass.indexOf('slds-is-open') !== -1 ?'slds-section'...
[ "0.6663579", "0.6658945", "0.64846396", "0.6468844", "0.6416097", "0.64081573", "0.6406676", "0.6399967", "0.63772523", "0.6334152", "0.6287932", "0.6282532", "0.62319326", "0.62276256", "0.62082005", "0.6193962", "0.6172391", "0.6169847", "0.61679", "0.6167244", "0.6160567",...
0.6880481
0
TODO: Replace msg with error prop
_showError() { return <ErrorModal visible={this.state.hasError} msg={this.errorText} close={() => this.setState({ hasError: false }) } triggerOverlay={this.triggerErrorOverlay} /> }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkForError() {\n if (this.props.error) {\n return <p className=\"error-text\">{this.errorMessage}</p>;\n }\n }", "function Error(props)\n{\n let errMsg = \"No error message given.\";\n\n if (props.msg) {\n errMsg = props.msg;\n } else if (props.location.state && props.location.stat...
[ "0.71999836", "0.7115429", "0.67765534", "0.6757956", "0.66962194", "0.66812235", "0.66166824", "0.6575305", "0.6573793", "0.65669215", "0.6561659", "0.6542142", "0.65362847", "0.6522727", "0.6479023", "0.64707726", "0.6467179", "0.6464819", "0.6440518", "0.64339453", "0.6428...
0.6487975
14
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n...
[ "0.76421165", "0.75090915", "0.73141", "0.7307803", "0.7307803", "0.7307803", "0.7295824", "0.7285899", "0.7279349" ]
0.0
-1
console.log(randomColor, "random"); controls drawing of the grid on canvas.
function render(grid, context) { for (let row = 0; row < grid.length; row++) { for (let col = 0; col < grid[row].length; col++) { const cell = grid[row][col]; context.beginPath(); context.rect(col * cell_size, row * cell_size, cell_size, cell_size); if (cell === ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n \tconsole.log( grid.print() );\n }", "displayGrid(color) {\n rectMode(CORNER);\n strokeWeight(0);\n fill(color);\n if (this.wall) {\n fill(\"green\");\n }\n rect(this.x * cellWidth, this.y * cellHeight, cellWidth - 1, cellHeight - 1);\n }", "function draw() {\n...
[ "0.6898289", "0.6873675", "0.68065596", "0.6749007", "0.6728681", "0.67175823", "0.6708831", "0.670744", "0.67019665", "0.663681", "0.6611704", "0.6594197", "0.65825087", "0.6581611", "0.658036", "0.6578743", "0.6575751", "0.6571469", "0.6569714", "0.65666133", "0.656077", ...
0.7011995
0
Convert hex string e.g.'DA5252' to rgb array e.g.([218, 82, 82]) 0255
hexToRgb (hex) { var hexChars = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15}; var result = []; // Remove "#" hex = hex.toUpperCase().match(/.{1,2}/g); // Split the red, green, and blue var r = hex[0].split(''), g = hex[1].spli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertToRGB(hex) {\n var color = [];\n color[0] = parseInt((trim(hex)).substring(0, 2), 16);\n color[1] = parseInt((trim(hex)).substring(2, 4), 16);\n color[2] = parseInt((trim(hex)).substring(4, 6), 16);\n return color;\n }", "_convertToRGB...
[ "0.80968034", "0.8087612", "0.8059823", "0.8001425", "0.7983848", "0.7946587", "0.79432815", "0.794223", "0.7918224", "0.79166996", "0.78731257", "0.7860484", "0.783017", "0.7787468", "0.77503955", "0.7733333", "0.7717681", "0.7699241", "0.7696899", "0.7684549", "0.7678429", ...
0.77944845
13
Convert rgb array e.g.([218, 82, 82]) to hex e.g.'DA5252'
rgbToHex (array) { var hexChars = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'}; var result = ''; for (var i = 0; i < array.length; i++) { var d1 = parseInt(array[i] / 16); result += hexChars[d1]; var d2 = array[i] - (d1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _convertToHex(rgbArr) {\n if (rgbArr.toString() !== '[object Array]' && rgbArr.length != 3) {\n console.error('rgbArr should be an array with length equals to 3.');\n throw new Error('Invalid parameter');\n }\n var hex = _(rgbArr).map(_hex).reduce(function(prev, curr) {\n ret...
[ "0.8108483", "0.7978555", "0.7946929", "0.78632057", "0.78279936", "0.7744936", "0.7655016", "0.7614513", "0.7613923", "0.75687426", "0.7525628", "0.75216997", "0.7517405", "0.7517405", "0.75081694", "0.75044274", "0.74833196", "0.74302405", "0.73972064", "0.7392639", "0.7371...
0.8263723
0
Adds markers to map
function initMarkers(L, map){ $(document).ready(function() { $.ajax({"headers": {Accept: "application/json"}, "url":"http://159.203.111.95:8000/api/dev/", "data": {}, "success": function(result) { $.each(result, function(i, d){ var data = d; //console.log(data); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAllMarkers(){\n\tfor (var i = 0, len = mapLocations.length; i < len; i++){\n\t\tvar loc = mapLocations[i];\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: loc.position,\n\t\t\tmap: map,\n\t\t\tscaledSize: new google.maps.Size(50, 50),\n\t\t\ticon: \"https://s3-us-west-2.amazonaws.com/andrew...
[ "0.753255", "0.7320741", "0.7274396", "0.7202126", "0.7193403", "0.71771246", "0.71423614", "0.7126635", "0.710134", "0.70932305", "0.70911145", "0.7035006", "0.70329493", "0.7026018", "0.6997511", "0.6993382", "0.69922364", "0.69922364", "0.69922364", "0.6971745", "0.6959884...
0.0
-1
Autofills the drop downs in the filter
function populateAllFields(markerID){ $(document).ready(function() { $.ajax({"headers": {Accept: "application/json"}, "url":"http://159.203.111.95:8000/api/dev/", "data": {}, "success": function(result) { $.each(result, function(i, d){ var data = d; if(data.micros...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateDropdowns() {\n}", "function populateAll(){\n clear();\n // All filter drop downs will default to blank ('All), meaning no filters on data set\n filterData();\n}", "function fillFilterBy() {\n if (typeof pageProductType != 'undefined') {\n if (pageProductType.length != 0) {\n var ...
[ "0.6690207", "0.66278124", "0.65902525", "0.65639114", "0.64511806", "0.6411522", "0.63663", "0.63539946", "0.6302625", "0.6290154", "0.62787545", "0.6240296", "0.6237486", "0.6205466", "0.6203805", "0.62037253", "0.6192225", "0.6171087", "0.6167533", "0.6142333", "0.61160606...
0.0
-1
Make the auto filled filter fields inactive
function deactivateField(fieldName){ document.getElementById(fieldName).disabled=true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleFilter () {\n\t\tvar filterProp = Object.keys(vm.tp.filter());\n\t\tif (!$scope.showFilter && filterProp.length > 0) {\n\t\t\tvm.tp.filter({});\n\t\t}\n\t}", "setFilterToNone() {\n\t\tthis.props.setFilter(\"\", \"\");\n\t}", "getActiveFilters(){\n\t\treturn false;\n\t}", "function standardFilt...
[ "0.6544807", "0.6529587", "0.64384854", "0.6412457", "0.6396091", "0.6340457", "0.6337726", "0.6331445", "0.63059366", "0.62826395", "0.62761223", "0.62531847", "0.62470603", "0.6226974", "0.6206069", "0.6193501", "0.6193501", "0.6193501", "0.6193501", "0.6193501", "0.6193501...
0.0
-1
activate and reset the filter fields
function activateAndResetFields(){ initData(); document.getElementById('logger-type').disabled=false; document.getElementById('country').disabled=false; document.getElementById('state').disabled=false; document.getElementById('site').disabled=false; document.getElementById('wave').disabled=false...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "@task\n *resetFilters() {\n yield super.setupForm(...
[ "0.7538096", "0.7538096", "0.7538096", "0.7538096", "0.7538096", "0.7538096", "0.7538096", "0.7538096", "0.7538096", "0.7502747", "0.7460729", "0.74358135", "0.7423241", "0.73778796", "0.73778796", "0.73778796", "0.73656046", "0.73656046", "0.7345298", "0.7345298", "0.7345298...
0.0
-1
State contains: a) The user's choice of which hemisphere's cities to show (defaults to both) b) A reference to the Community to be displayed c) A flag controlling whether or not the modal is shown d) Amount input by user (via modal) for population change e) Index for the City whose population has been targeted for chan...
constructor() { super() this.state = { community: new Community(citiesData), hemisphereChoice: 'both', modalOpen: false, populationInput: '', cityIndex: '' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stateChange(state, expression) {\n let extent = getStateMapExtent(state);\n goToExtent(extent);\n countiesLyr.definitionExpression = expression;\n countiesLyr.visible = true;\n megaLyr.visible = true;\n urbanLyr.visible = true;\n statesLyr.visible = false;\n censusb...
[ "0.6042001", "0.591227", "0.5777058", "0.5763515", "0.5711941", "0.56800926", "0.5655866", "0.5652311", "0.56480426", "0.5628889", "0.5600747", "0.55939245", "0.55833346", "0.55687845", "0.55660313", "0.5565142", "0.5550851", "0.5528836", "0.55123043", "0.5486256", "0.5460491...
0.69514143
0
OUT WINDOW Represents a window to be displayed on the page //////////////////////////////////////////////////////////////////// OutWindow constructor
function OutWindow() { this.cssClass = null; this.x = 0; this.y = 0; this.jqObject = null; this.id = OUT_WINDOW_PREFIX + outWindowCount; outWindowCount++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisplayWindow() {\n // Call the parent constructor\n OutWindow.call(this);\n}", "function Window() {\n _super.call(this);\n /**\n * The mousedown event handler.\n */\n this.evtMouseDown = new porcelain.EventBinder(\"mousedown\", this.element());\n...
[ "0.7244694", "0.606483", "0.5972134", "0.5467157", "0.5403879", "0.5351654", "0.53271407", "0.53180283", "0.53052837", "0.5216228", "0.51826876", "0.5160189", "0.5122708", "0.5121994", "0.5113444", "0.51122403", "0.50991684", "0.5092343", "0.5090407", "0.5076757", "0.5074603"...
0.8569056
0
correct the constructor pointer because it points to CommandWindow WhiteOnBlackTerminal.prototype.constructor = WhiteOnBlackTerminal; //////////////////////////////////////////////////////////////////// DISPLAY WINDOW Represents a window to display text or images. (extends OutWindow) ///////////////////////////////////...
function DisplayWindow() { // Call the parent constructor OutWindow.call(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Window() {\n _super.call(this);\n /**\n * The mousedown event handler.\n */\n this.evtMouseDown = new porcelain.EventBinder(\"mousedown\", this.element());\n this._content = null;\n this._windowState = 0 /* Normal */;\n ...
[ "0.63761467", "0.6315541", "0.6031173", "0.6029499", "0.6012398", "0.5945043", "0.58627766", "0.58394027", "0.57980686", "0.57876205", "0.57215744", "0.57206815", "0.57058764", "0.5693662", "0.5685442", "0.5676108", "0.56673884", "0.56572264", "0.56225824", "0.56135", "0.5608...
0.7588809
0
Function that is called when the document is ready.
function initializePage() { //To prevent buttons from staying focused after press $(".btn").mouseup(function(){ $(this).blur(); }); $('.add-button').click(function(e) { $.get("/charities/add_my_cause", {'source':'charities', 'index_charity': id_cause}).done(function(data){ if (data['result'] == "full...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function initOnDomReady() {}", "function init() {\n documentReady(documentLoaded);\n}", "function DOMReady() {\n }", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideAre...
[ "0.80224776", "0.80073184", "0.795525", "0.7818498", "0.7702885", "0.75373137", "0.7520074", "0.7455579", "0.74492323", "0.74229956", "0.74138755", "0.7391876", "0.73816043", "0.73776627", "0.7251472", "0.7222114", "0.72136", "0.7208918", "0.7185666", "0.7170675", "0.7167523"...
0.0
-1
MongoDB Schema schema structure see BaseSchema that is shared by all objects
function BaseSchema () { mongoose.Schema.apply(this, arguments); this.add({ createdOn: {type: Date, required: true}, createdBy: {type: String, required: true}, updatedOn: {type: Date, required: true}, updatedBy: {type: String, required: true} }); this.pre('validate', function (next) { this....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get CoreSchema() {\r\n if (!_CoreSchema) {\r\n log.info(`Define the schema for ${MODEL_NAME}`);\r\n _CoreSchema = new mongoose.Schema({\r\n corename: String,\r\n corecode: Number,\r\n coreemail: String,\r\n dateCreated: { type: Date, default: Date.now },\r\n d...
[ "0.688775", "0.66214883", "0.6579703", "0.64957416", "0.64829", "0.6473249", "0.63755435", "0.636401", "0.6362377", "0.6343678", "0.6327615", "0.62696004", "0.623756", "0.6172581", "0.6149157", "0.611477", "0.6103761", "0.6102673", "0.61017984", "0.60957086", "0.60798734", ...
0.7433332
0
finds all twotes in the db, sorted by date so the most recent are on the top and uses populate to get the user object for the author. Next, find all the users and pass those to the handlebars template
function findAllTwotesAndUsers(dbUser, res){ Twote.find({}, null, {sort: {dateCreated: -1}}).populate('author').exec(function(err, twotes){ if (err){ res.sendStatus(500); console.log("Error: ", err); } else { User.find({}, function(err, users){ if (err){ res.sendStatus(500); console.log("Err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getUsers () {\n\t\tlet userIds = this.posts.reduce((accum, post) => {\n\t\t\taccum = [...accum, post.get('creatorId'), ...(post.get('mentionedUserIds') || [])];\n\t\t\treturn accum;\n\t\t}, []);\n\t\tuserIds = ArrayUtilities.unique(userIds);\n\n\t\tthis.users = await this.data.users.getByIds(userIds);\n\t}",...
[ "0.625114", "0.5924238", "0.5923949", "0.5874532", "0.5826529", "0.5804768", "0.57626843", "0.57348293", "0.5713629", "0.5711426", "0.57085675", "0.5704035", "0.5696429", "0.5678555", "0.5677512", "0.5655318", "0.5644789", "0.5633298", "0.56087935", "0.5573546", "0.5562057", ...
0.735825
0
Generate date key 'MMM dd'
function getDateKey(date) { var d = new Date(date.tsCriacao).getDate(); var m = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; return m[new Date(date.tsCriacao).getMonth()] + ' ' + ((d<10?'0':'') + d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "date_lisible_format(date){\n var day = date.substring(0, 2),\n month_number = date.substring(3, 5),\n year = date.substring(6, 10);\n\n const Date_Month_Key = new Map([[\"01\", \"Janvier\"], [\"02\", \"Fevrier\"], [\"03\", \"Mars\"], [\"04\", \"Avril\"], [\"05\", \"Mai\"], [\"06...
[ "0.676109", "0.6747396", "0.66253954", "0.65555704", "0.65382046", "0.6530728", "0.64632803", "0.6458725", "0.62408215", "0.62295395", "0.6192165", "0.61404496", "0.612579", "0.60887915", "0.6075505", "0.606418", "0.6061001", "0.60341245", "0.6021697", "0.6018813", "0.6016527...
0.70085603
0
listen on port 80 to redirect to https Normalize a port into a number, string, or false.
function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port)) { // named pipe return val; } if (port >= 0) { // port number return port; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onHttpsListening() {\n const addr = https_server.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port: ' + addr.port\n //打印log\n console.log(CGlobal.logLang('clothingshop:server HTTPS启动成功,{0} IP地址为:{1}', bind, ip || 'localhost'))\n console.timeEnd('HT...
[ "0.6620263", "0.66124105", "0.6604613", "0.64012325", "0.6335399", "0.62919074", "0.626774", "0.61805636", "0.61805636", "0.61805636", "0.61805636", "0.61805636", "0.61298287", "0.61298287", "0.6119738", "0.6074339", "0.60730404", "0.6004787", "0.5972797", "0.59472364", "0.59...
0.0
-1
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== 'listen') { throw error; } var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; // handle specific listen errors with friendly messages switch (error.code) { case 'EACCES': console.error(bind + ' requires elevated privil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + '...
[ "0.7118962", "0.70567393", "0.70339364", "0.70246124", "0.6965733", "0.6882446", "0.68554044", "0.68311316", "0.6821094", "0.68109226", "0.6788116", "0.6782291", "0.6781704", "0.67701316", "0.6766919", "0.6750681", "0.6706457", "0.67013055", "0.66602784", "0.66561115", "0.664...
0.0
-1
Event listener for HTTP server "listening" event.
function onListening() { var addr = server.address(); var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; debug('Listening on ' + bind); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' +...
[ "0.78544015", "0.7739864", "0.7633661", "0.7536681", "0.75315416", "0.73415786", "0.7334293", "0.7303103", "0.7302585", "0.7283272", "0.7272347", "0.72310024", "0.7227042", "0.7161825", "0.7126399", "0.7120529", "0.7105088", "0.7097603", "0.70819986", "0.7073328", "0.70719254...
0.0
-1
Terminal represents a terminal session.
function Terminal () {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Terminal(root) {\n this.root = root;\n\n this.clear();\n }", "open(parent) {\n if (!parent) {\n throw new Error('Terminal requires a parent element.');\n }\n if (!parent.isConnected) {\n this._logService.debug('Terminal.open was called on an element that...
[ "0.67894495", "0.63552076", "0.6308225", "0.6176628", "0.6052802", "0.6007177", "0.597864", "0.58863103", "0.58812505", "0.5879708", "0.5871144", "0.58228344", "0.58221483", "0.5717407", "0.5499201", "0.54875237", "0.54490125", "0.5390798", "0.5388534", "0.537556", "0.5368908...
0.7367062
0
We use them whenever we want one or more parameters of a functions to be preset ie: default values ES5 STYLE: constructor function that takes 4 parameters
function SmithPerson(firstName, yearOfBirth, lastName, nationality) { //defaulting parameters //if lastName is undefined //then let the lastName be Smith //else its simply lastName lastName === undefined ? lastName = 'Smith' : lastName = lastName; nationality === undefined ? nationalit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultParams() {\n console.log(es5Function());\n console.log(es5Function(5));\n console.log(es5Function(1, 2));\n console.log(\"-------------\");\n console.log(es6Function());\n console.log(es6Function(5));\n console.log(es6Function(1, 2));\n console.log(\"-------------\");\n c...
[ "0.71849394", "0.70908797", "0.70863795", "0.68863547", "0.6733996", "0.6688351", "0.66868484", "0.66757196", "0.6638246", "0.66378635", "0.6628251", "0.6617229", "0.66073704", "0.65590477", "0.6524279", "0.6505037", "0.64730436", "0.6432124", "0.6413738", "0.63908625", "0.63...
0.0
-1
this will override the default parameters ES6 STYLE:
function smithPerson(firstName, yearOfBirth, lastName="smith", nationality="american") { this.firstName = firstName; this.yearOfBirth = yearOfBirth; this.lastName = lastName; this.nationality = nationality; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "styles() { }", "set defaultStyle(style) {\n this._defaultStyle = style;\n }", "constructor(style = {}) {\n if (!style.sketchObject) {\n // eslint-disable-next-line no-param-reassign\n style = Object.assign({}, DEFAULT_STYLE, style)\n // eslint-disable-next-line no-param-reassign\n st...
[ "0.68134034", "0.6345613", "0.6176248", "0.6146945", "0.6141787", "0.61189395", "0.60354096", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", "0.60320914", ...
0.0
-1
! vuex v3.6.0 (c) 2020 Evan You
function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.pare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.6766381", "0.67123663", "0.6671056", "0.6323207", "0.6317285", "0.6251818", "0.6251818", "0.6251818", "0.6243542", "0.62405056", "0.6170715", "0.61369586", "0.60720664", "0.6063224", "0.6063224", "0.6063224", "0.6063224", "0.6063224", "0.6054401", "0.60474527", "0.60320264...
0.0
-1
! vuerouter v3.5.0 (c) 2021 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function version(){ return \"0.13.0\" }", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&...
[ "0.58739334", "0.5850367", "0.5718427", "0.56422824", "0.559075", "0.55725414", "0.55078423", "0.5463037", "0.54551584", "0.54329133", "0.54292077", "0.54246867", "0.54075813", "0.54075813", "0.54075813", "0.54075813", "0.54075813", "0.54075813", "0.54075813", "0.54075813", "...
0.0
-1
! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at THIS CODE IS PROVIDED ON AN AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITH...
function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function getClientVersion() { return '0.14.4'; }", "_getPageMetadata() {\n return undefined;\n }", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "function test_crosshair_op_azone_azure() {}"...
[ "0.50572354", "0.50261384", "0.49677286", "0.49642098", "0.49535963", "0.49464166", "0.48990956", "0.48890817", "0.48588523", "0.4817147", "0.4817147", "0.47847858", "0.47562033", "0.47473118", "0.47321713", "0.47313607", "0.47282395", "0.47183964", "0.47109774", "0.47109774", ...
0.0
-1
Randomize array element order inplace. Using Durstenfeld shuffle algorithm.
function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shuffleInplace (arr) {\n var j, tmp;\n for (var i = arr.length - 1; i > 0; i--) {\n j = baseRandInt(i + 1);\n tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n }", "fu...
[ "0.8201112", "0.8110052", "0.81032515", "0.77924633", "0.7742655", "0.774065", "0.77241755", "0.7702396", "0.7692658", "0.7680252", "0.7666301", "0.76567733", "0.76556474", "0.76524895", "0.7646548", "0.7641497", "0.76389015", "0.7638254", "0.7635412", "0.7632675", "0.7619333...
0.0
-1
in block; in block
function mysteryScoping2() { debugger const x = 'out of block'; if (true) { const x = 'in block'; console.log(x); } console.log(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enterBlock(ctx) {\n\t}", "function blk() {\n prev = -1;\n flag3 = 0;\n type = 4; // For block type is equal to four\n}", "function enterBlock(){\n blockContext = Object.create(blockContext)\n }", "function enterBlock(){\n blockContext = Object.create(blockContext)\n }", "function block(){\n ...
[ "0.6461427", "0.6144232", "0.6114151", "0.6114151", "0.60548615", "0.5992222", "0.5948695", "0.58931834", "0.5866102", "0.5774023", "0.57526416", "0.57498324", "0.57475877", "0.57088673", "0.56999975", "0.5674391", "0.56543475", "0.5654229", "0.56536174", "0.56060815", "0.558...
0.53368604
57
in block; out block
function mysteryScoping3() { const x = 'out of block'; if (true) { var x = 'in block'; console.log(x); } console.log(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blk() {\n prev = -1;\n flag3 = 0;\n type = 4; // For block type is equal to four\n}", "function block(){\n flag2=0;\nv=2;\n}", "function wire(block1, outVar, block2, inVar) {\n return { outBlock: block1\n , outVar: outVar\n , aout: block1 ? block1....
[ "0.58482593", "0.5722742", "0.5664377", "0.5660407", "0.56570655", "0.56570655", "0.5628851", "0.55688", "0.5562164", "0.5544924", "0.5544924", "0.5496258", "0.5486428", "0.5475896", "0.5459007", "0.5335032", "0.52999157", "0.5285355", "0.52791303", "0.5264998", "0.52600634",...
0.0
-1
in block; out block
function mysteryScoping5() { let x = 'out of block'; if (true) { let x = 'in block'; console.log(x); } let x = 'out of block again'; console.log(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blk() {\n prev = -1;\n flag3 = 0;\n type = 4; // For block type is equal to four\n}", "function block(){\n flag2=0;\nv=2;\n}", "function wire(block1, outVar, block2, inVar) {\n return { outBlock: block1\n , outVar: outVar\n , aout: block1 ? block1....
[ "0.58482593", "0.5722742", "0.5664377", "0.5660407", "0.56570655", "0.56570655", "0.5628851", "0.55688", "0.5562164", "0.5544924", "0.5544924", "0.5496258", "0.5486428", "0.5475896", "0.5459007", "0.5335032", "0.52999157", "0.5285355", "0.52791303", "0.5264998", "0.52600634",...
0.0
-1
Set initial blade view model values.
function ResourceBladeViewModel(container, initialState, dataContext) { var _this = this; _super.call(this); this.id = ko.observable(); this.subtitle(ClientResources.resourceBladeSubtitle); this._entityView = dataContext.resourceEntities.createView(container);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initViews() {\n this.views = this.generateViews();\n this.prepareViewsModelsFields();\n }", "set(obj) {\n validate(this.schema, obj);\n _.assign(this.template, obj);\n }", "getInitialValues() {\n const { model } = this.props;\n\n if (!model) {\n return {};\n }\n\n let v...
[ "0.5876248", "0.5843019", "0.58306175", "0.5773017", "0.57494694", "0.5719635", "0.57111704", "0.57111704", "0.5681444", "0.5594434", "0.55665725", "0.55429155", "0.5515244", "0.5511363", "0.5500667", "0.5493375", "0.54809844", "0.54638183", "0.5457344", "0.54270923", "0.5397...
0.0
-1
Removes all qTips from the DOM. Called when the policy is uninstalled or the graph is destroyed.
destroy() { //removing all qtip from DOM $('[id^="qtip"]').remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeAllTooltips() {\n if (!this.activeToolTips?.length) {\n return;\n }\n for (let i = this.activeToolTips.length - 1; i > -1; i--) {\n this.activeToolTips[i].destroy();\n this.activeToolTips.splice(i, 1);\n }\n }", "function removeOldTips() {\n // FIXME: I can't quite explain th...
[ "0.69459647", "0.672274", "0.66060024", "0.6478296", "0.6450821", "0.63867104", "0.63634574", "0.6119943", "0.60731345", "0.6061042", "0.604155", "0.6009124", "0.600367", "0.59732425", "0.5941777", "0.5870358", "0.58663577", "0.5853771", "0.5844564", "0.58305395", "0.5825522"...
0.75180763
0
Test order put and cancel
async function orderTest() { const order = await orderPut( userId, market, ORDER_SIDE_BID, ORDER_TYPE_LIMIT, /*amount*/ "10", /*price*/ "1.1", fee, fee ); console.log(order); const balance3 = await balanceQuery(userId); floatEqual(balance3.BTC.available, "89"); floatEqual(bal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelOrder(e) {\n e.preventDefault();\n const body = {\n cancelled: true,\n picked_up: false,\n completed: true,\n };\n axios.patch(url, body, config).catch((error) => console.error);\n }", "triggerOrder(order) {\n if (!(order instanceof ExchangeOrder)) {\n throw 'In...
[ "0.6095832", "0.5716356", "0.5716356", "0.5687721", "0.56046134", "0.5578155", "0.5578155", "0.55237836", "0.55037224", "0.54888415", "0.5477561", "0.54612696", "0.5435712", "0.54285324", "0.5427548", "0.5390968", "0.5352412", "0.53488433", "0.53423744", "0.53287405", "0.5321...
0.5228489
26
Check if the form is correctly completed
function checkForm() { let isValid = true; let errors_messages = []; // Check all input document.querySelectorAll("#password_form input").forEach(input => { if (!input.value) { errors_messages.push(input.name + " is missing."); isValid = false...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForm(){\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){\n btn.disabled = false; //enable submit btn if form filled correctly\n }else{\n btn.disabled = true;\n }\n }", "function checkForm...
[ "0.71453273", "0.71036494", "0.70191264", "0.69804204", "0.6955094", "0.6892948", "0.6762767", "0.6725673", "0.6725287", "0.67213917", "0.67184556", "0.6665703", "0.6659024", "0.6624429", "0.66134506", "0.65999126", "0.65465057", "0.65339327", "0.65253806", "0.64772683", "0.6...
0.6674497
11
Check the form and if everything is correct, change user password
function handleSubmit(event) { event.preventDefault(); if (!isLogin) { return false; } if (!checkForm()) { return false; } httpClient.post('users/' + AuthService.getCurrentUser().user_id + '/password', { old_password: oldpasswordInpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editUser(){\n\tconst opsw = document.getElementById(\"opsw\").value;\n\tconst npsw = document.getElementById(\"npsw\").value;\n\tconst cpsw = document.getElementById(\"cpsw\").value;\n\tif(opsw != user_psw){\n\t\talert(\"Wrong old password\");\n\t}\n\telse if(npsw==\"\"){\n\t\talert(\"Password can't be em...
[ "0.74837035", "0.7462801", "0.73894143", "0.71840197", "0.7128854", "0.70738465", "0.7046734", "0.70441395", "0.7024233", "0.6965058", "0.6960521", "0.6926643", "0.6922453", "0.6913407", "0.68749607", "0.68510073", "0.68446356", "0.68162405", "0.6815209", "0.6801748", "0.6783...
0.6480563
72
Drag Functionality Get Arrays from localStorage if available, set default values if not
function getSavedColumns() { if (localStorage.getItem("backlogItems")) { listArrays.forEach((item, i) => { listArrays[i] = JSON.parse(localStorage[`${arrNames[i]}Items`]); }); } else { listArrays[0] = ["Release the course", "Sit back and relax"]; listArrays[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAndRestore() {\n if (localStorage.length > 0) {\n itemsArray = JSON.parse(localStorage.getItem('itemsData'));\n }\n}", "function checkLocalStorage(){ \nif (localStorage.getItem('adjektiv') && localStorage.getItem('nomen')) \n { \n localStorArrayAdj = [];\n let localStorAdj = ...
[ "0.63170165", "0.62277836", "0.60929763", "0.6063381", "0.60277545", "0.6017522", "0.60062814", "0.5991748", "0.5973579", "0.59420407", "0.5939795", "0.5923903", "0.59118134", "0.59095293", "0.58931977", "0.58646923", "0.5855434", "0.581524", "0.5809339", "0.57932", "0.578659...
0.5796735
19
save to local storage
function saveColumns() { listArrays.forEach((item, i) => { localStorage.setItem(`${arrNames[i]}Items`, JSON.stringify(item)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save() {\n storage.write(filename, data);\n }", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function saveToStorage(){\n console.debug('saving settings', self);\n\n try {\n localStorage.setItem...
[ "0.80749756", "0.79707855", "0.7831552", "0.7771036", "0.77257013", "0.7688969", "0.76734364", "0.7668775", "0.75791126", "0.7540884", "0.7518306", "0.7505", "0.74925476", "0.7484223", "0.7434358", "0.74319977", "0.73869425", "0.7375147", "0.7370624", "0.73622483", "0.7355758...
0.0
-1
Create DOM Elements for each list item
function createItemEl(columnEl, column, item, index) { const listEl = document.createElement("li"); listEl.classList.add("drag-item"); listEl.textContent = item; listEl.draggable = true; listEl.setAttribute("ondragstart", "drag(event)"); //listEl.contentEditable = "true"; listEl.id = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemsToList($items, weather) {\n for (var i = 0; i < 5; i++) {\n var $li = document.createElement(\"li\");\n var $conditions = document.createElement(\"p\");\n var $icon_url = document.createElement(\"img\");\n var $title = document.createElement(\"p\");\n var $high = document.createElement(\"p\"...
[ "0.7139992", "0.7087585", "0.706202", "0.7008125", "0.69900376", "0.69726413", "0.6945149", "0.69345695", "0.6896308", "0.6844893", "0.68340373", "0.6808958", "0.68057084", "0.679263", "0.67698723", "0.67446095", "0.67395055", "0.67373925", "0.6735179", "0.67121047", "0.67057...
0.0
-1
Update Columns in DOM Reset HTML, Filter Array, Update localStorage
function updateDOM() { // Check localStorage once on first time if (!updatedOnLoad) { getSavedColumns(); } updatedOnLoad = true; // remove all childs <li ></li> from DOM columns, and re-create all of them based on data in arrays listArrays.forEach((arrItem, arrI) => { col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDOM() {\n // Check localStorage once\n if(!updatedOnLoad){\n getSavedColumns();\n }\n\n // Backlog Column\n backlogList.textContent='';\n backlogListArray.forEach((backlogItem,index)=>{\n createItemEl(backlogList,0,backlogItem,index);\n\n });\n backlogListArray=filterArray(backlogListA...
[ "0.7682579", "0.7681635", "0.7665122", "0.7650298", "0.761691", "0.71177477", "0.7068308", "0.704371", "0.6901564", "0.6708842", "0.64579713", "0.6427554", "0.6359216", "0.6276934", "0.6273842", "0.62450826", "0.6207739", "0.6200582", "0.6180711", "0.61014485", "0.6075782", ...
0.75995815
5
When item starts dragging
function drag(e) { //draggedItem = e.target; No need for a global variable here e.dataTransfer.setData("text", e.target.id); // set data in drag and drop event to dragged element's id dragging = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onDragStart() {\n this._isDragged = true;\n }", "function CdkDragEnter() {}", "function CdkDragEnter() {}", "function drag(e) {\n draggedItem = e.target\n dragging = true\n}", "function handleDragStart(){\n this.isMouseDown = true\n}", "onDragStarted(mousePosition) {\n }", "function dr...
[ "0.7858502", "0.7557031", "0.7557031", "0.7490271", "0.74830365", "0.7478663", "0.7450639", "0.7441564", "0.7438409", "0.7405554", "0.7370298", "0.7338451", "0.7310321", "0.729927", "0.72218096", "0.7217391", "0.720178", "0.7135186", "0.71338147", "0.7061223", "0.7058563", ...
0.0
-1
Col allows for item to drop
function allowDrop(e) { e.preventDefault(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drop(e) {\r\n e.preventDefault();\r\n const parent = listColumns[currentColumn];\r\n // Remove Background Color/Padding\r\n listColumns.forEach((column) => {\r\n column.classList.remove('over');\r\n });\r\n // Add item to Column\r\n parent.appendChild(draggedItem);\r\n // Dragging complete\r\n ...
[ "0.7857834", "0.77954704", "0.7637084", "0.760052", "0.7556374", "0.6939312", "0.68556625", "0.68412864", "0.6762778", "0.629262", "0.6282212", "0.6267999", "0.6264274", "0.6250325", "0.61668134", "0.61632997", "0.614254", "0.6081466", "0.6060606", "0.60500294", "0.60045683",...
0.0
-1
Drag enter. In HTML we specify which index is going to pass in columnIndex, so we will know in which element draggable was hovered to highlihgt it
function dragEnter(columnIndex) { // remove background color/ padding columns.forEach((column) => { column.classList.remove("over"); }); columns[columnIndex].classList.add("over"); // no need for global columnIndex variable :) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dragEnter(column) {\n const columnEl = columnElArray[arrayNames.indexOf(column)];\n columnEl.classList.add('over');\n currentColumnEl = columnEl;\n}", "function dragEnter(col) {\r\n itemLists[col].classList.add(\"over\");\r\n\r\n currentColumn = col;\r\n }", "function dragEnter(column) {\n ...
[ "0.7198523", "0.7150095", "0.71024007", "0.7076359", "0.7031356", "0.6921015", "0.6723461", "0.6723461", "0.6548529", "0.65422404", "0.6502257", "0.6416792", "0.6340232", "0.630256", "0.6284996", "0.6251989", "0.6251989", "0.6247653", "0.6242623", "0.62286794", "0.62286794", ...
0.70868134
3
Allow arrays to reflect changes
function updateArrays() { // Update arrays from DOM element's textContent listArrays.forEach((arrItem, index) => { listArrays[index] = [...columns[index].children].map( (i) => i.textContent ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alterArray (y) {\n y[1] = \"I have been set in alter function\"\n y.push(\"I have been added in alter function\")\n y = [9, 9, 9, 9]\n}", "function changeArr(arr) {\n arr[3] = 'MUTATED';\n}", "function testArray() {\n a = [1, 3, 2];\n modifyArray(a);\n console.log(a);\n}", "func...
[ "0.6954507", "0.6904253", "0.6796677", "0.6702103", "0.66970575", "0.66836417", "0.66341054", "0.66218984", "0.6360552", "0.6346351", "0.6340108", "0.61881196", "0.6179741", "0.6167451", "0.61569005", "0.61461365", "0.61257416", "0.61144793", "0.61060995", "0.60754746", "0.60...
0.56200755
95
Add text to a column
function hideInputBox(column) { addBtns[column].style.visibility = "visible"; saveItemBtns[column].style.display = "none"; addItemContainers[column].style.display = "none"; addToColumn(column); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_column(table, text) {\n let new_table = table.clone(true);\n\n const new_th = ((!exist_rows) ? table.find('th').first().clone(true) : table.find('th').last().clone(true));\n new_th.find('span.column_name').text(text);\n new_th.find('button').off('click'); // Dismiss whatev...
[ "0.6615755", "0.654334", "0.6536617", "0.65211433", "0.65041876", "0.6460036", "0.644517", "0.64243543", "0.64153343", "0.64086473", "0.63942724", "0.63376874", "0.62539756", "0.61349773", "0.6130768", "0.61215526", "0.6072579", "0.60586375", "0.59928095", "0.59765327", "0.59...
0.0
-1
Creating function to send data to Firebase Database
function sendData() { var key = firebase.database().ref(`messages`).push().key; let obj = { key: key, sender: name, msg: input.value, msgTime: time, }; firebase.database().ref(`messages/${key}`).set(obj); input.value = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendToFirebase() {\n dataRef.ref().push({\n\n trainName: trainName,\n destination: destination,\n firstTime: firstTime,\n frequency: frequency,\n tMinutesTillTrain: tMinutesTillTrain,\n nextTrainTime: nextTrainTime,\n date...
[ "0.818474", "0.7705112", "0.7384617", "0.73771745", "0.7332173", "0.7320555", "0.71150124", "0.7084774", "0.70789427", "0.7032955", "0.69764715", "0.6973921", "0.68677837", "0.68477887", "0.68372756", "0.6836009", "0.6832456", "0.6797356", "0.678967", "0.6779167", "0.66760015...
0.72635365
6
Create a cachebusting hash for static assets like `bundle.js` and `style.css`
function createHash (data) { return crypto.createHash('sha256') .update(data) .digest('base64') .slice(0, 20) .replace(/\+|\/|=/g, '') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hashAssets () {\n const unhashedDocsFilename = '00_build/docs.HASHME.json'\n const docsFileContents = grunt.file.read(unhashedDocsFilename)\n const docsHash = md5(docsFileContents).substr(0, hashLength)\n\n // update cheatsheet.min.js with docs hash\n const buildJsFilename = '00_build/js/ch...
[ "0.65662974", "0.618945", "0.6050131", "0.59341854", "0.5656427", "0.56291604", "0.5624221", "0.5600388", "0.55292016", "0.55183864", "0.5479873", "0.54550225", "0.5412863", "0.5394809", "0.5375416", "0.5367955", "0.5367019", "0.5362264", "0.5320517", "0.53083044", "0.5293706...
0.0
-1
calling api for colors
async function callGenApi() { let result = await axios.post( "http://colormind.io/api/", JSON.stringify(data) ); let colors = result.data.result; !color1.islocked && setColor1({ ...color1, color: rgbToHex(colors[0][0], colors[0][1], colors[0][2]), }); !color...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertColor() {\n var colorEntry = document.querySelector(\".convertValue\")\n var entryValue = colorEntry.value\n m\n .request({\n method: 'PUT',\n url: `http://localhost:8001/color/handle`,\n body: {\n \"val...
[ "0.7003246", "0.6861874", "0.66748595", "0.66736335", "0.66705495", "0.66573274", "0.66382134", "0.66220343", "0.6620573", "0.65809435", "0.654845", "0.6533005", "0.6505369", "0.64956194", "0.64929456", "0.648567", "0.64620024", "0.63961", "0.6390946", "0.63907397", "0.639003...
0.68342125
2
Function for converting the color to hex
function componentToHex(c) { var hex = c.toString(16); return hex.length === 1 ? "0" + hex : hex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toHexColor() {\n const R = this.R.toHex().valueOf();\n const G = this.G.toHex().valueOf();\n const B = this.B.toHex().valueOf();\n return new HexColor(`#${R}${G}${B}`);\n }", "function rgb2Hex(color) {\n // Converts a single value to two-character hexadecimal\n function value2Hex(val) {\n ...
[ "0.80520964", "0.79585373", "0.79288214", "0.77351123", "0.7732025", "0.768582", "0.76757693", "0.76109684", "0.7607873", "0.754903", "0.75395334", "0.7526506", "0.75237364", "0.7519839", "0.7517704", "0.75092554", "0.7452277", "0.74344164", "0.7411333", "0.7388507", "0.73565...
0.0
-1
Function for screen shot
function screenshot() { window.scrollTo(0, 0); html2canvas(document.querySelector("#colorcontainer"), { scrollX: 0, scrollY: 0, }).then(function (canvas) { console.log(canvas); var a = document.createElement("a"); // toDataURL defaults to png, so we need to request a jpeg, then...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Screenshot() {\n}", "function takeScreenShot(){\n console.log(\"take screenshot: \")\n // window.open('', document.getElementById('story').toDataURL());\n}", "function take_snapshot() {\n\t\t// toma la imagen\n\t\tvar data_uri = Webcam.snap();\n\n\t\t// injecta el resultado\n\t\t$('#results').ht...
[ "0.83699435", "0.73240036", "0.69449854", "0.68756", "0.6835947", "0.68160063", "0.6795234", "0.6755654", "0.674011", "0.6694026", "0.6687178", "0.6668852", "0.66532993", "0.66007197", "0.6554724", "0.65484387", "0.6518286", "0.6493493", "0.6480442", "0.6447371", "0.6420972",...
0.6303003
29
Takes the div that blockly will resize with as a parameter
function setupBlockly(blocklyArea){ //Blockly Resizing Stuff blocklyDiv = document.getElementById('blocklyDiv'); workspace = Blockly.inject(blocklyDiv, {toolbox: document.getElementById(toolboxId), zoom: {controls: true, wheel: true, startScale: 1.0, maxScale: 3, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resizeHandler() {\n const that = this;\n\n that.$.container.style.width = that.$.container.style.height = Math.min(that.offsetWidth, that.offsetHeight) + 'px';\n }", "function resizedw(){\n\t\n}", "function resize() {}", "function makeResizableDiv(element) {\n const resizers = element.qu...
[ "0.69647837", "0.69061655", "0.67624676", "0.66985697", "0.66700244", "0.66700244", "0.66700244", "0.66700244", "0.66700244", "0.6579939", "0.657048", "0.65567654", "0.6550919", "0.65088886", "0.6474104", "0.64340365", "0.6429268", "0.64147973", "0.6412252", "0.6408266", "0.6...
0.0
-1
data format: 1 data point = 8 bytes 1 coordinate value = 4 bytes 1 array val (color) = 2 bytes total: 2 bytes/val 4 vals/data data
function initTargets() { velocityData = new Uint16Array(2 * 4 * dataWidth * dataWidth); velocityTarget = new Target(gl, "velocityData", dataWidth, dataWidth, gl.RGBA16UI, gl.RGBA_INTEGER, gl.UNSIGNED_SHORT, velocityData); positionData = new Uint16Array(2 * 4 * dataWidth * dataWidth); // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function data() {\n\treturn {\n\t\tsize: 224,\n\t\tN: undefined,\n\t\tpos: undefined,\n\t\tylabels: undefined,\n\t\tdatasource: undefined\n\t};\n}", "static generateDataTexture (width, height, color) {\n\t\t\tlet size = width * height;\n\t\t\tlet data = new Uint8Array(4 * width * height);\n\n\t\t\tlet r = Math.f...
[ "0.6244907", "0.6135056", "0.605763", "0.6055457", "0.6055457", "0.59591645", "0.58297163", "0.58162063", "0.577148", "0.575093", "0.573273", "0.57249695", "0.571302", "0.5640784", "0.563093", "0.56013525", "0.5575168", "0.5572387", "0.55597466", "0.55517036", "0.5547953", ...
0.0
-1
Encode messages from driver
encodeHardwareInfo(hardwareInfo: HardwareInfo): Buffer { return this._encodeMessageFromDriver({hardwareInfo}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeAndSend() {\n let settings = getSettings();\n \n console.log(\"encoding data: \"+settings.codeString);\n console.log(\"at error correction level: \"+settings.errorCorrectionLevel);\n \n let codeGenerator = new QRCode({\n text : settings.codeString,\n correctLevel : settings...
[ "0.6317145", "0.630053", "0.630053", "0.6120175", "0.6087078", "0.57115084", "0.57075506", "0.56975967", "0.564665", "0.56356883", "0.56312585", "0.55876756", "0.55712086", "0.556173", "0.5549862", "0.5549862", "0.5549862", "0.5549862", "0.5549862", "0.5549862", "0.5549862", ...
0.68341595
0
Emcode messages to driver
encodeSetOutputs(setOutputs: SetOutputs): Buffer { return this._encodeMessageToDriver({setOutputs}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "send(msg) {\n if (this.connectionId < 0) {\n throw 'Invalid connection';\n }\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\n });\n }", "SendMessage() {}", "SendMessage() {}", "SendMessage() {}", "SendMessage() {}", "function sendMessage(){}",...
[ "0.6097729", "0.6039239", "0.6039239", "0.6039239", "0.6039239", "0.58017135", "0.577284", "0.5744422", "0.5718946", "0.5718946", "0.5673654", "0.56728107", "0.5669762", "0.5646173", "0.5636074", "0.56272894", "0.5625346", "0.5625346", "0.5625346", "0.5625346", "0.5625346", ...
0.0
-1
Yelp dom display function
function cb(data) { $(".yelpBusiness").empty(); for (i = 0; i < 5; i++) { var businessDiv = $('<div class="businessDiv card horizontal hoverable">'); var cardImage = $('<div class="card-image">'); var cardStacked = $('<div class="card-stacked">'); var cardContent = $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "display() {\n let o = {\n data: {},\n rawData: ''\n };\n this.getAllTrie(this.head, '', o, true);\n }", "function displayYelpResults (responseJson) {\n console.log(responseJson);\n // if there are previous results, remove them\n $('#yelp-list').empty();\n ...
[ "0.62372136", "0.6128766", "0.6049385", "0.602383", "0.6008777", "0.59936553", "0.5969091", "0.5968795", "0.5963548", "0.59404856", "0.59350044", "0.59350044", "0.5929035", "0.59266603", "0.59266603", "0.59266603", "0.5907608", "0.5901869", "0.58839345", "0.5880611", "0.58790...
0.0
-1
adds an item to the end linked list
push(val) { let newNode = new Node(val); if (!this.head) { this.head = newNode; this.tail = newNode; } else { this.tail.next = newNode; newNode.prev = this.tail; this.tail = newNode; } this.length++; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "append(item){\n // add new item to end of list\n var node = new Node(item);\n var current;\n // if 1st item in LL -> make it the head...\n if (this.head === null){\n this.head = node;\n } else {\n // start at front of LL...\n current = this.head;\n // need to find last item so...
[ "0.7652201", "0.71535903", "0.71124524", "0.7029101", "0.7017476", "0.69991875", "0.69501024", "0.69115424", "0.69002044", "0.68651015", "0.68603325", "0.67851967", "0.6745863", "0.672853", "0.67242616", "0.670891", "0.6708842", "0.6678726", "0.6627422", "0.66175663", "0.6595...
0.0
-1
removes the last item of the linked list
pop() { if (!this.head) return null; let cur = this.tail; if (this.length === 1) { this.head = null; this.tail = null; } else { this.tail = cur.prev; this.tail.next = null; cur.prev = null; } this.length--; return cur; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeLast() {\n if (!this.head) {\n return;\n }\n // Handles lists < 2 in lenghht\n if (!this.head.next) {\n this.head = null;\n return;\n }\n\n let node = this.head;\n let previous = node;\n\n while (node.next) {\n previous = node;\n node = node.next;\n }\n\n ...
[ "0.7902718", "0.77716947", "0.7577911", "0.75174844", "0.74453557", "0.7423834", "0.7417098", "0.74078655", "0.7397242", "0.7394992", "0.7357964", "0.7356137", "0.734839", "0.72969955", "0.7213682", "0.7197264", "0.7194307", "0.7187048", "0.7186816", "0.71686953", "0.7157043"...
0.6888737
70
removes the first item of the linked list
shift() { if (!this.head) return null; let cur = this.head; if (this.length === 1) { this.head = null; this.tail = null; } else { this.head = cur.next; this.head.prev = null; cur.next = null; } this.length--; return cur; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeFirst() {\n if (!this.head) {\n return;\n }\n\n this.head = this.head.next;\n }", "removeFirst() {\n if (this.count === 1) {\n this.clear()\n } else {\n let newHead = this.getHeadNode().next\n newHead.prev = null\n this.head = newHead\n }\n }", "removerFirst (...
[ "0.82696956", "0.80419606", "0.7986469", "0.79153955", "0.78277487", "0.7793729", "0.7791227", "0.7746463", "0.7719913", "0.77026075", "0.76992685", "0.7684893", "0.765962", "0.7501463", "0.7418307", "0.73623425", "0.7340072", "0.7334343", "0.7332414", "0.73214906", "0.726743...
0.0
-1
adds an item infront of the linked list
unShift(val) { let newNode = new Node(val); if (!this.head) { this.head = newNode; this.tail = newNode; } else { this.head.prev = newNode; newNode.next = this.head; this.head = newNode; } this.length++; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addToFront(node) {\n node.next = this.head; // set the new node's next to the head\n this.head = node; // move the head to the new node\n }", "prepend(value) {\n // if list is empty\n if (!this.head) {\n this.head = new Node(value);\n }\n let oldHead = this.head;\n this.head ...
[ "0.75873756", "0.741537", "0.7356351", "0.73338187", "0.7296693", "0.72092956", "0.71573293", "0.71473354", "0.7139882", "0.713158", "0.7131197", "0.7112954", "0.707384", "0.70607764", "0.7058045", "0.7054705", "0.70518506", "0.7042909", "0.704283", "0.70418507", "0.70394295"...
0.0
-1
sets the value of a node at an index of the linked list
set(index, val) { let cur = this.get(index); if (!cur) return false; cur.val = val; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setAt(idx, val) {\n if(idx >= this.length) {\n return undefined;\n }\n\n let currNode = this.head;\n\n for(let i = 0; i < idx; i++){\n currNode = currNode.next;\n }\n\n currNode.val = val;\n }", "setAt(idx, val) {\n let i = 0;\n let current = this.head;\n while (i !== idx) {...
[ "0.8296454", "0.81068724", "0.80999357", "0.8029769", "0.7930772", "0.7723271", "0.7709022", "0.7697922", "0.76479703", "0.7647911", "0.7500876", "0.74822825", "0.7465244", "0.74202526", "0.73771864", "0.7341583", "0.73291594", "0.73079896", "0.7295467", "0.726626", "0.723515...
0.62228507
54
deals the cards to dealer
dealCardToDealer() { let theCards = $(".dealerCard"); for (let i = 0; i < theCards.length; i++) { if ($(".dealerCard")[i].style.backgroundImage === "") { this.giveCard($(".dealerCard")[i], "dealer"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deal () {\n for (let i = 0; i < 2; i++) {\n this.dealPlayerCard();\n this.playerCardReveal();\n $(\".player-card-back\").attr(\"class\", \"card\");\n };\n this.dealDealerCard();\n this.dealerCardReveal();\n $(\".dealer-card-back\").eq(0).attr(\"cl...
[ "0.7111788", "0.70893073", "0.70471114", "0.70142233", "0.683687", "0.68179023", "0.67808515", "0.6779884", "0.6735517", "0.6720266", "0.6690214", "0.66878146", "0.6686123", "0.6684131", "0.6676857", "0.6664172", "0.66552466", "0.66519195", "0.66014344", "0.65158975", "0.6511...
0.5881669
82
deals cards to player
dealCardToPlayer() { let theCards = $(".playerCard"); for (let i = 0; i < theCards.length; i++) { if ($(".playerCard")[i].style.backgroundImage === "") { this.giveCard($(".playerCard")[i], "player"); //TODO: do the ace } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dealCards () {\n this.decks.player.deal(this.players)\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function dealCards() {\n dealToPlayer();\n dealToDealer();\n dealToPlayer();\n dealToDealer();\n}", "dea...
[ "0.77194995", "0.7308315", "0.72735715", "0.71840364", "0.71115804", "0.69884795", "0.6772834", "0.6760987", "0.67469656", "0.67407006", "0.67082334", "0.66710216", "0.6655369", "0.6650901", "0.6636693", "0.6634197", "0.66332716", "0.6628572", "0.66260034", "0.66238296", "0.6...
0.65441614
25
use this to for calculating total bets
calcBetAmount() { let total = this.chipTotalAmount.reduce((a, b) => { return a + b; }); return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateResults() {\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < bets.length; j++) {\n if (bets[j].colour == winners[i].name) {\n let winnings = 0;\n if (bets[j].type == \"Win\") {\n winnings = bets[j].amount * 2;\n ...
[ "0.7195076", "0.69999576", "0.68923557", "0.66942537", "0.66847485", "0.6682961", "0.66699463", "0.6637879", "0.65369284", "0.6515033", "0.6513274", "0.64849365", "0.64604264", "0.6454973", "0.6452903", "0.644649", "0.6441204", "0.6429215", "0.64283407", "0.64105207", "0.6400...
0.6495184
11
6 create a function called 'sayHi'. 'sayHi' should accept one argument called 'name' when 'sayHi' is invoked it should log the string 'Hello !' where is equal to the 'name' argument /code here
function sayHi(name) { console.log('Hello ' + name + '!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sayHi(name){\n console.log(name + \"says hi!!!\");\n}", "sayHi(name) {\n console.log(`hello i am ${name}`);\n }", "function sayHello1(name) {\n console.log(\"xin chao ban \" + name);\n}", "function greetArgs(name) {\n console.log(\"hello \"+name+ \" , i am from greet function\");\n}", "...
[ "0.7722954", "0.7672198", "0.7615582", "0.7571654", "0.7541878", "0.7512717", "0.74834377", "0.74796283", "0.74778086", "0.74050283", "0.74029195", "0.739762", "0.73325956", "0.7318091", "0.73166895", "0.7298184", "0.7254454", "0.7236163", "0.72283214", "0.7225594", "0.721918...
0.7397779
11
10 create a function called 'nFactorial(num)' 'nFactorial' should return the factorial of the 'num' argument note: the factorial of 5 is (5 4 3 2 1) > 120 try to solve this recursively /code here
function nFactorial(num) { if (num < 0) { return -1; } else if (num === 0) { return 1; } else { return (num * nFactorial(num - 1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nFactorial(num) {\nif (num > 1){\nreturn num * nFactorial(num - 1);\n}\nelse {\nreturn 1;\n}}", "function recursiveFactorial(n) {\n if (n <= 1){\n return 1;\n } else {\n return n * recursiveFactorial(n - 1);\n }\n}", "function recursiveFactorial(n) {\n //base case\n if(n == 0 || n == 1)...
[ "0.860552", "0.8343328", "0.8311132", "0.8282667", "0.8267238", "0.8264106", "0.82568175", "0.8222333", "0.8206669", "0.819795", "0.818716", "0.81659365", "0.8130652", "0.8127221", "0.8125158", "0.8125015", "0.8114195", "0.8113994", "0.8112999", "0.81080973", "0.81079364", ...
0.8295625
3
Functions to load when click button
function loadScene0() { chartarea(); d3.select("#b0").classed("active",true); //d3.selectAll("#selection").style("visibility","hidden"); d3.select("#chart-div").insert("div").classed("heading",true); d3.select(".heading").insert("h2").text("Summaries").style("text-anchor", "start"); d3.select("#chart-div").inser...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadButtons() {\n\tgetNumbers();\n getOperators();\n getExecuteOperationButton();\n\tgetClearButton();\n\tgetclearEverythingButton();\n\tgetRemoveLastButton();\n\tgetOpenParenthesesButton();\n\tgetCloseParenthesesButton();\n\tgetSquareButton();\n\tgetSquareRootButton();\n\tgetAnsButton();\n}", "fu...
[ "0.7008831", "0.68291605", "0.6779864", "0.67306376", "0.6716968", "0.6681548", "0.66429114", "0.662169", "0.65933913", "0.658141", "0.655444", "0.65502906", "0.64862645", "0.6473892", "0.6469528", "0.6466137", "0.6435398", "0.64339817", "0.63700473", "0.63688034", "0.6361915...
0.0
-1
this factory services to show contact form, centralize it and make background dimmed while active
function centralize(param){ var elementWidth, elementHeight; if(param == 'email'){ var elementHeight = 447; var div = document.getElementById("writePop"); } else if(param == 'call'){ var elementHeight = 318; var div = document.getElementById("callPop"); } var totalWidth = windo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contact() {\n\t\tif ($(\"#cform\").is(\":hidden\"))\n\t\t{\n\t\t\t$(\"#ribbon\").css({\"background\":\"url(../../../img/frontend/under_construction/ribbon.png) bottom left no-repeat\"});\n\t\t\t$(\"#home\").slideUp(\"fast\");\n\t\t\t$(\"#cform\").slideDown(\"slow\");\n\t\t}\n\t\telse{\n\t\t\t$(\"#ribbon\"...
[ "0.6833965", "0.6398184", "0.6232966", "0.6178694", "0.6175071", "0.6158508", "0.61247355", "0.6114195", "0.60486954", "0.59944475", "0.59336597", "0.5891304", "0.58376616", "0.5834783", "0.577018", "0.57636523", "0.5755863", "0.5729926", "0.5711193", "0.5702763", "0.5663289"...
0.0
-1
Calls the library function 'ajx' defined in 'ajx.js' file.
function load(filename) { ahah(filename,"showpage"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AJ(url,parameters,success_param='') { AJX(url,parameters,success_param);}", "function Xa(){}", "function Aa(e,t,n,i){xa.call(this,e,t,n,i)}", "jxon(){}", "function j(){}", "function j(){}", "function j(){}", "function anc() {\n\tjD._gLAA = function () {\n\t\treturn this.localAnchorA\n\t}\n\t...
[ "0.6264544", "0.57992405", "0.5612841", "0.55643094", "0.5393271", "0.5393271", "0.5393271", "0.52894026", "0.52298355", "0.52144706", "0.51832116", "0.51748025", "0.51722986", "0.5080229", "0.5034968", "0.5031036", "0.49845895", "0.49426717", "0.49101138", "0.4901024", "0.48...
0.0
-1
Render search results for Stack Overflow
function renderArticleResultsCards(results) { // Loop through the response for (var i = 0; i < 3; i++) { // Get data object data var question = results.items[i].title; var link = results.items[i].link; var answers = results.items[i].answer_count; var views = results.items[i].view_count; var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.clas...
[ "0.7096332", "0.69381344", "0.6915323", "0.66480553", "0.6505116", "0.64321196", "0.6410024", "0.63994724", "0.6393989", "0.6343237", "0.6327077", "0.6316573", "0.6312712", "0.6301638", "0.63009346", "0.63002884", "0.62321913", "0.6229856", "0.62290424", "0.6219695", "0.62085...
0.0
-1
When form is submited on this page, send search terms to the API call
function handleSearchFormSubmit(event) { event.preventDefault(); // Get input field contents var searchValue = $('#search-input').val(); // If input is empty, do nothing if (!searchValue) { return; } // Make API call searchApi(searchValue); searchVApi("coding" + searchValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSubmit() {\n //Take the search term string entered by the user in the input field, add it to the baseUrl, make a fetch request to that new url, and append the results of what we searched for to the DOM in the correct element, wrapped in li tags\n}", "function searchTerms(d){\n\t\n\tpayload = impl...
[ "0.7478734", "0.7389561", "0.69711965", "0.68787044", "0.68736917", "0.68304795", "0.6822152", "0.67989653", "0.6797368", "0.677262", "0.6765272", "0.67609346", "0.67408776", "0.6722161", "0.6718946", "0.670296", "0.6700969", "0.6666664", "0.6650605", "0.66351163", "0.6632618...
0.7036018
2
this method is called when your extension is deactivated
function deactivate() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivat...
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", ...
0.0
-1
Function to update the like status of the post
function updateOrDestroyLike (likeOrDislikeReaction, dataToUpdate) { // If user clicks on the same button as he already did (like or dislike) // the reaction is cancelled (the like/dislike is destroyed) if(likeOrDislikeReaction == true) { Likes.des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "likePost(postId) {\n let postUpdated = {} \n postUpdated = {...this.state.post, ...this.state.post.likes++}\n \n postApi.updatePost(postId, postUpdated).then(post => {\n this.setState({\n post: postUpdated\n })\n })\n }", "function likePost() {\n\tif(liked_array[index] != 'y...
[ "0.7721459", "0.7630062", "0.7371593", "0.72709686", "0.72671986", "0.72401285", "0.723431", "0.7051791", "0.6992547", "0.69051474", "0.68434405", "0.6825332", "0.6819146", "0.6814662", "0.6752164", "0.6747543", "0.67432755", "0.67246807", "0.67160356", "0.6684521", "0.666717...
0.6611647
24
detect beacon start, if scan is stopped then start scan
function startScan() { EngageModule.isScanOnGoing().then((isGoing) => { if (!isGoing) { EngageModule.startScan(); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _startScan() {\n SpecialBle.setConfig(config)\n SpecialBle.startBLEScan();\n }", "function scanStart() {\n if (radio.state === RADIO_STATE.PLAY) {\n radio.stop();\n }\n stationCount = 0;\n frequencyBeforeScan = getFrequency();\n...
[ "0.7248947", "0.69752413", "0.6912165", "0.6845459", "0.6816094", "0.63749367", "0.625201", "0.61110574", "0.6024018", "0.595792", "0.5949064", "0.59459734", "0.5917441", "0.58810437", "0.57507473", "0.5699835", "0.56061614", "0.55842227", "0.5583008", "0.55751544", "0.553915...
0.6816828
4
remove enter and exit listeners
function removeBeaconListener() { Object.values(subscription).forEach((subs) => subs?.remove()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n \n //we only have leave events on desktop, we manually cal...
[ "0.70734805", "0.7056701", "0.70514023", "0.70514023", "0.70217484", "0.68787205", "0.6857253", "0.683221", "0.6824136", "0.6786601", "0.67072576", "0.6702817", "0.6690316", "0.66830206", "0.66830206", "0.66830206", "0.6673455", "0.6659652", "0.6641996", "0.6640924", "0.65958...
0.0
-1
If your app is closed, you can check if it was opened by a notification being clicked / tapped / opened
async function getInitialNotification() { return await EngageModule.getInitialNotification(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_checkNotiWhenCloseApp() {\n PushNotification.popInitialNotification((notification) => {\n if (notification && !GlobalVariable.isOpenApp) {\n // console.log( '---- NOTIFICATION APP EXIT:', notification);\n \n // Click noti popup, statusBar (APP EXIT)\n...
[ "0.77026623", "0.687225", "0.6254383", "0.6244454", "0.6244331", "0.61657906", "0.59655", "0.59488404", "0.59113175", "0.58158237", "0.58032244", "0.5780035", "0.5773183", "0.5723992", "0.5682272", "0.56803167", "0.5673061", "0.566598", "0.565995", "0.565799", "0.5657765", ...
0.0
-1
addListeners for enterBeacon and exitBeacon
function addListener(evantName, listener) { subscription[evantName] = engageModule.addListener(evantName, (beaconInfo) => { const info = Platform.OS === 'ios' ? beaconInfo : JSON.parse(beaconInfo) listener(info); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDataReceived (cb) {\n dbg('data received')\n this.delegate.didRangeBeaconsInRegion = cb\n }", "beaconsDidRange(data) {\n // An attempt to stop the ranging if it gets out of control\n if (this.numRanged > 20) {\n this.stopRanging();\n return;\n }\n this.numRanged += 1;\n console....
[ "0.6137482", "0.60070413", "0.57842463", "0.56714696", "0.56301045", "0.5613314", "0.5601181", "0.5596049", "0.5581809", "0.55493546", "0.55459535", "0.55417", "0.5526025", "0.5514559", "0.55051243", "0.54778767", "0.5476224", "0.54634446", "0.5454468", "0.5441257", "0.542130...
0.52812713
34
start to calculate the width of text
function calcWidthOfText(text) { return text.split('').reduce((width, ch, index) => { const chCode = text.charCodeAt(index); const chLen = map[chCode]; /** 13px for the width of non-ascii characters */ return width += chLen ? chLen : (chCode >= 0 && chCode <= 127 ? 0 : 13); }, 0)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateTextWidth(text, rems) {\n if (typeof rems === \"undefined\") {\n rems = 1;\n }\n\n var $textDiv = $(\"<p>\").css({\n \"font-size\": convertRemToPixels(rems) + \"px\",\n \"position\": \"fixed\",\n \"right\": \"9999px\"\n });\n\n $(\"body\").append($textDi...
[ "0.7149258", "0.7137236", "0.7031835", "0.7031835", "0.7031835", "0.70147234", "0.7009941", "0.6904732", "0.6821222", "0.68211794", "0.68176764", "0.6757419", "0.673637", "0.6730394", "0.67264295", "0.6717173", "0.6696344", "0.66238254", "0.66238254", "0.66238254", "0.6579482...
0.6334265
56
console.log('app'); Initializes app Binds event handlers to pages, buttons, list items etc. Checks for unfinished game
function init() { //console.log('init'); // Hide the splashscreen navigator.splashscreen.hide(); // If trim() is not supported on the browser add the support if (!String.prototype.trim) { //console.log('Trim() not supported on this browser!'); String.prototype.trim = function () { return this.repl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeApp () {\n makeQuiz();\n eventHandlers();\n}", "function initializeApp() {\n //adding click functionality to the page\n addHandlers();\n}", "function initApp() {\n\tinitSounds();\n\tinitSensors();\n\tshowWelcome();\n}", "function initMain(){\n\tbuildGameButton();\n\tbuildGameStyle();\n...
[ "0.73806036", "0.70261663", "0.70161974", "0.6891721", "0.6758569", "0.6756382", "0.67482567", "0.6718914", "0.67187434", "0.66879296", "0.6635659", "0.6633372", "0.66329384", "0.6630249", "0.66159546", "0.66061574", "0.6587891", "0.6569551", "0.6504069", "0.6496727", "0.6483...
0.0
-1
The Fold Get All on Initialize
function _init() { vm.service.tncGetAll() .then(_tncGetAllSuccess, _tncGetAllError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get asFold() {\n return fold(this.reduce, this.toArray)\n }", "fold(empty) {\n return this.foldMap(x => x, empty)\n }", "function _foldAll() {\r\n var rows = _getAllRows();\r\n var lvls = _defaultOptions.reportLevels.concat();\r\n lvls.pop();\r\n var lvlReg = new RegExp(lvls.join('|'));\r\n...
[ "0.6339692", "0.6277668", "0.5984263", "0.5780808", "0.5780808", "0.5762379", "0.55244136", "0.54045606", "0.53890216", "0.5376881", "0.5322732", "0.5303527", "0.5295455", "0.5295455", "0.52926135", "0.52742124", "0.52742124", "0.52742124", "0.52742124", "0.52742124", "0.5274...
0.0
-1
Defining Main Obj Constructor Function
function MainObj(identity, health, mana, strength, intellect, dexterity, baseDamage) { this.identity = identity, this.health = health, this.mana = mana, this.strength = strength, this.intellect = intellect, this.dexterity = dexterity, this.baseDamage = baseDamage }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructur() {}", "function construct() { }", "function _construct()\n\t\t{;\n\t\t}", "function Ctor() {}", "function _ctor() {\n\t}", "function NewObj(){}", "consructor() {\n }", "static initialize(obj) {}...
[ "0.7333677", "0.7333677", "0.7333677", "0.7256799", "0.7237907", "0.7131525", "0.70996803", "0.6977471", "0.69044006", "0.68826795", "0.679818", "0.679818", "0.6759248", "0.6710159", "0.67074823", "0.6667993", "0.66255295", "0.6615286", "0.66127366", "0.66054827", "0.66021657...
0.66455346
16
Defining Sub Obj Constructor Functions PLAYER
function Player(identity, className, health, mana, strength, intellect, dexterity, baseDamage, skill1Name, skill2Name, exists) { MainObj.call(this, identity, health, mana, strength, intellect, dexterity, baseDamage); this.exists = exists; this.className = className; this.skill1Name = skill1Name; th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(name, type){\n super(name,type)\n // en el scope del constructor \n // invocamos con super el name y el \n // type de la clase player \n }", "function Player() {}", "function Player() { }", "constructor(player){\n this.player = player;\n }", "constructor(playe...
[ "0.74722", "0.73974633", "0.7346906", "0.7042741", "0.6936639", "0.67501163", "0.67256016", "0.6714051", "0.6689331", "0.6515398", "0.64577556", "0.64279014", "0.6421305", "0.63999563", "0.6392959", "0.6377686", "0.6358847", "0.6300568", "0.6292573", "0.6291695", "0.6290313",...
0.0
-1
won't be creating events
createEvent(text) { const id = Date.now(); // TODO not great this.events.push({ id, text, complete: false, }); this.emit("change"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constroiEventos(){}", "function InternalEvent() {}", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "onEvent() {\n \n }", "handleEvents() {\n }", "handleEvent() {}", "ha...
[ "0.69533914", "0.6879467", "0.68217564", "0.68217564", "0.68217564", "0.68217564", "0.68217564", "0.6820422", "0.67965555", "0.6728461", "0.6728461", "0.668609", "0.6584939", "0.646144", "0.64524525", "0.63739485", "0.63707626", "0.63707626", "0.6367241", "0.6366544", "0.6366...
0.638845
15
define reducer (todo function with switchcase actions inside it)
function todo( state = 0, action){ switch(action.type){ case 'INCREMENT': return state + 1; case 'DECREMENT': return state - 1; default: return state; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reducer(){\n\n}", "function reducer(state = {}, action){\n return state;\n}", "function reducer(state, action) {\n //b. create switch statement where each case is a possible action.type\n switch (action.type) {\n case 'ACTION_TYPE':\n return state.someMethod(action...
[ "0.75476915", "0.75326586", "0.7410138", "0.7378516", "0.7187919", "0.71615463", "0.71190387", "0.7037637", "0.70329845", "0.70329845", "0.70127094", "0.6982345", "0.6970849", "0.6957186", "0.6920906", "0.6903666", "0.6860734", "0.68452686", "0.6774905", "0.6771723", "0.67689...
0.0
-1
va contando las listas
function creaarLista(i) { var lista = document.createElement('div'); lista.setAttribute('onclick', 'iniciar(this)'); lista.setAttribute('id', i); lista.setAttribute('class', 'empezar'); lista.innerHTML= 'Añadir una lista...'; contenido.appendChild(lista); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listoKurimas() {\n divuiAte();\n pridedamVerteIMasyva();\n var divListui = document.createElement('div'); // sukuriam diva listui\n // divui id\n divListui.id = \"divoId\";\n // pridedam sukurta diva i body\n document.getElementsByTagName('body')[0].appendChild(divListui);\n // suk...
[ "0.6758872", "0.67231655", "0.66218543", "0.6587408", "0.65528923", "0.65440065", "0.65300345", "0.6515386", "0.6499285", "0.6470087", "0.6447653", "0.6437567", "0.6353569", "0.635075", "0.6323478", "0.6321215", "0.6314812", "0.63042", "0.6253053", "0.623588", "0.6210171", ...
0.0
-1
array con las tareas
function iniciar(e) { form(e,'texto',i,'Añadir una lista...', agregar); e.removeAttribute('onclick'); e.className='lista'; contenido.appendChild(e); i++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get listarTareas () {\n\n const arreglo = [];\n\n Object.keys(this._listado).forEach(indice => {\n arreglo.push(this._listado[indice]);\n })\n\n return arreglo;\n }", "function agregaElemento(arr,tarea){\n arr.push(tarea);\n}", "getCaminosArbol(t) {\n if(this.t...
[ "0.674329", "0.65930116", "0.63080317", "0.6145819", "0.60905725", "0.6090369", "0.60676676", "0.60295063", "0.60177976", "0.59777445", "0.5977517", "0.5929068", "0.59267", "0.58691496", "0.58577424", "0.5839553", "0.58186954", "0.57955253", "0.57395416", "0.5722656", "0.5685...
0.0
-1
If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n. Factorials are often represented with the shorthand notation n!
function factorialize(num) { var x = 1; for (i=1;i<=num;i++){ x=x*i; } return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorial(n){\n\tlet ans=1;\n\tfor(let i=1;i<=n;i++) ans*=i;\n\treturn ans;\n}", "function factorial(n) {\n var number = 1;\n for (var i = n; i >= 1; i--) {\n number *= i;\n }\n return number;\n}", "function factorial(n) {\n\n}", "function factorial(n){\n\tvar equation = n;\n\tif(n == 0){\n\t...
[ "0.81534666", "0.8126225", "0.8086881", "0.8077198", "0.8064967", "0.8058919", "0.8008651", "0.79946846", "0.7959466", "0.7957208", "0.7948359", "0.79311234", "0.7909547", "0.78807265", "0.78720057", "0.78694195", "0.78670794", "0.78599864", "0.7858782", "0.78542525", "0.7852...
0.0
-1
Parse arguments and options from message and pass the resulting object into the specified handleMessage function.
handleMessage(message = '', ...args) { const parsed = parseArgs(message, this.parseOptions); parsed.text = message; return super.handleMessage(parsed, ...args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleMessage(message) {\n if (closed)\n fail(new Error('Client cannot send messages after being closed'));\n\n //TODO for debugging purposes\n pubsub.emit('message', message);\n\n const commandName = message.command;\n delete message.c...
[ "0.645071", "0.63423115", "0.6276628", "0.6231605", "0.6225731", "0.6167147", "0.61558586", "0.613006", "0.6101936", "0.60961664", "0.6065699", "0.6063195", "0.6056826", "0.60513055", "0.60083985", "0.5987394", "0.5952287", "0.5941084", "0.59063476", "0.59045553", "0.59033597...
0.73579067
0
See for API details
function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // spe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "obtain(){}", "function API(){}", "function API(){}", "private internal function m248() {}", "transient private internal function m185() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "protected ...
[ "0.64539295", "0.628222", "0.6083875", "0.6083875", "0.58966196", "0.58931714", "0.5843906", "0.5807617", "0.56874675", "0.55977154", "0.55894995", "0.55894995", "0.5536012", "0.54927725", "0.547576", "0.5461862", "0.5457917", "0.54515964", "0.54515964", "0.54515964", "0.5451...
0.0
-1
Ads DBHandler Fetch ads data from db depending on osType
function getAdsData(osType,cb){ adsSchema.findOne({ad_networks_for_OS : osType}, function(err, queryOutput){ if (err) { cb(err,null); } else { cb(null,queryOutput); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "retreiveMeta() {\n\n //Get the meta data\n var _this = this;\n\n\n if (firebase.apps.length) {\n //firebase.database().ref(\"/saasapps/wgnKPcLZE1W1PJLBDD79JwBe9K42/antenna5exampleapp\").once('value').then(function(snapshot) {\n firebase.database().ref(appConfig.expo.extra.firebaseMetaPath).once(...
[ "0.5047164", "0.501273", "0.49948174", "0.49687886", "0.493832", "0.49332544", "0.49227682", "0.4920321", "0.48939478", "0.48896432", "0.48760188", "0.48577383", "0.48418897", "0.48223177", "0.48212156", "0.48022437", "0.47963646", "0.47880962", "0.47826046", "0.4767138", "0....
0.70799917
0
Privacy Settings DBHandler Fetch user's Privacy settings from the db
function fetchUserPrivacySettings(userid,cb) { user .findOne({_id: userid}, {privacy_policy: 1}, function (err, queryOutput) { if (err) { cb(err, null); } else { cb(null, queryOutput); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSettings() {\n return user.settings;\n }", "getUserSettings () {\n let option = this,\n userSettings = option.userSettings || {};\n \n return userSettings[ Meteor.userId() ] || {}\n }", "function getUserSettings() {\n\treturn setUIPanelSettings();\n}", "fu...
[ "0.6466428", "0.5812981", "0.5792029", "0.57568175", "0.57021046", "0.5667562", "0.5645058", "0.55981654", "0.5569612", "0.55484337", "0.55346787", "0.5531612", "0.55288625", "0.5504678", "0.5458626", "0.54560566", "0.544896", "0.53522295", "0.53361875", "0.5332313", "0.53316...
0.7324024
0
Random Pocket Play user(s) search DBHandler Fetch Random pocketplay users
function fetchRandomFriendsInfo(userid ,searchText,timeStamp, cb) { if (isNaN(searchText)) { var userArray = []; user .find({display_name: new RegExp(searchText, 'i')}) .select({_id: 1}) .exec(function (err, result) { if (err) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRandom(req,res){\n console.log(\"getRandom method executed\");\n\n // Get the count of all users\n Joke.count().exec((err, count) => {\n\n // Get a random entry\n var random = Math.floor(Math.random() * count)\n \n // Again query all users but only fetch one offset by ...
[ "0.7391119", "0.704189", "0.6900852", "0.6780681", "0.6732091", "0.6539127", "0.64187664", "0.63942266", "0.6378928", "0.63416463", "0.63356954", "0.63349414", "0.6334375", "0.6333892", "0.6329813", "0.63103694", "0.6295247", "0.6277684", "0.62257624", "0.6163146", "0.6156837...
0.6894698
3
Get compiled userobject for random friends info
function compileRandomFriendsInfoObject(userResult) { var userObj = {}; if (userResult._id) { userObj.UserId = userResult._id; userObj.PlayerLevel = userResult.level.toString(); userObj.PlayersCoin = userResult.balance.toString(); userObj.PlayerImageUrl = userResult.profile_pic_1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateUsers(userObj, friendBool){\n var str = '';\n str += '<div class=\"userTile\" id='+ userObj._id +'>';\n str += '<h3 class=\"userTileName\">'+ userObj.Username +'</h3>';\n //if they are not friends add a button to addFriend()\n if(friendBool != true){\n str += '<button class=\...
[ "0.6401874", "0.63278395", "0.6068892", "0.60136473", "0.59847665", "0.58738285", "0.5830437", "0.5804126", "0.5785455", "0.57255673", "0.5679487", "0.5670784", "0.566265", "0.56622183", "0.5640843", "0.56166476", "0.5599427", "0.55834717", "0.5579969", "0.55777085", "0.55587...
0.7203579
0
User's info bundled with pocketplay friends/buddies DBHandler
function fetchUserInfo(requestedBy , requestedFor , cb){ user .findOne({_id : requestedFor},{ display_name: 1, profile_pic_1: 1, profile_pic_2: 1, profile_status: 1, balance: 1, level: 1, country_id: 1, profile_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserInfo(DB, request, response) {\n\t\ttry {\n\t\t\tDB.get_user_info(request.params.auth_id).then((userData) => {\n\t\t\t\tif (userData[0]) response.status(200).send(userData[0]);\n\t\t\t\telse response.status(404).send('User Not Found...');\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tresponse.status(404).send(err);...
[ "0.6773671", "0.66007954", "0.6523382", "0.64675325", "0.6411019", "0.6325579", "0.63131267", "0.6230008", "0.6220461", "0.6170769", "0.6166748", "0.61560076", "0.6147076", "0.6146318", "0.6145465", "0.61383533", "0.60669863", "0.60328317", "0.6029892", "0.60015213", "0.59927...
0.57554674
60
public graph!: Graph; public cellController!: CellController; public eventController!: EventController;
constructor (graphOptions) { /** 创建X6画布实例 */ const defaultCfg = this.getDefaultCfg() this.graph = new Graph({ ...defaultCfg, ...graphOptions }) this.init() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Graph() {\n // Graph constructor\n\n}", "init( graph ) {\n this.graph = graph;\n }", "function Graph() {\r\n this.states = [];\r\n this.arrows = [];\r\n this.labels = [];\r\n}", "constructor() {\n // this.graphs = [];\n }", "function Graph() {\n this.edges = [];\n this.no...
[ "0.629845", "0.62707496", "0.6086887", "0.6074506", "0.60527337", "0.60168266", "0.60013646", "0.57769585", "0.57282233", "0.5614238", "0.5606563", "0.5601113", "0.5596564", "0.5544164", "0.5544164", "0.55234945", "0.5515291", "0.5501272", "0.5455739", "0.5447612", "0.5446111...
0.0
-1
Adds users Image to backstretch Array
function pushtoarray() { var x = $("input[name=image1]").val(); var pictureArray = x.split(","); console.log(pictureArray); var re = new RegExp('\\.[pngjif]+', 'g'); for (var i = 0; i < pictureArray.length; i++) { if (re.test(pictureArray[i].trim())) { document.getElementById("image").value = ""; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBidImageMetrix(bidMetrix){\n\tmodel.bidImageMetrix = [];\n\t_.each(bidMetrix, function(row){\n\t\tvar r;\n\t\tif(row.length > 1){\n\t\t\tr = _.map(row, function(a){\n\t\t\t\ta['image_url'] = './images/cards/'+ a.weight + a.suit + '.svg';\n\t\t\t\treturn a;\n\t\t\t}); \n\t\t\tmodel.bidImageMetrix.push(...
[ "0.6113405", "0.6110133", "0.60704714", "0.60127926", "0.5959698", "0.5858546", "0.58504266", "0.5761238", "0.57487035", "0.57266086", "0.5726488", "0.5721563", "0.57007533", "0.56874114", "0.56745684", "0.5672893", "0.56665", "0.5658962", "0.5657852", "0.56502235", "0.564880...
0.0
-1
create a circular doubly linked list from polygon points in the specified winding order
function linkedList(data, start, end, dim, clockwise) { var sum = 0, i, j, last; // calculate original winding order of a polygon ring for (i = start, j = end - dim; i < end; i += dim) { sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); j = i; } // link points into circ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linkedList(data, start, end, dim, clockwise) {\n var sum = 0,\n i, j, last;\n\n // calculate original winding order of a polygon ring\n for (i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n\n // li...
[ "0.7034403", "0.7002697", "0.60255665", "0.6008066", "0.5965749", "0.5937011", "0.59262156", "0.58375657", "0.5810802", "0.576217", "0.5672943", "0.5620377", "0.55794835", "0.55794835", "0.5578969", "0.55599344", "0.55568045", "0.5527074", "0.55238503", "0.55176246", "0.55125...
0.711862
0
eliminate colinear or duplicate points
function filterPoints(start, end) { if (!start) return start; if (!end) end = start; var p = start, again; do { again = false; if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { removeNode(p); p = end = p.prev; if (p === p....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeDuplicateDataPts(arr){ \n\n var hash = {};\n var returnArr = [];\n\n for(var i=0; i < arr.length; i++){\n var key = arr[i].dataPt.x + \".\" + arr[i].dataPt.y;\n if(hash[key]){ continue; };\n returnArr.push(arr[i]);\n hash[key] = 1;\n };\n\n return returnAr...
[ "0.646628", "0.64181733", "0.6248984", "0.6221099", "0.6184698", "0.59530324", "0.59270835", "0.5914647", "0.5890367", "0.58615535", "0.5856835", "0.58509976", "0.58368456", "0.58087873", "0.57974005", "0.5778808", "0.57763165", "0.57702863", "0.56843376", "0.56631213", "0.56...
0.0
-1
main ear slicing loop which triangulates a polygon (given as a linked list)
function earcutLinked(ear, triangles, dim, minX, minY, size, pass) { if (!ear) return; // interlink polygon nodes in z-order if (!pass && size) indexCurve(ear, minX, minY, size); var stop = ear, prev, next; // iterate through ears, slicing them one by one while (ear.prev !== ear.next) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) {\n\n\tif ( ! ear ) { return; }\n\n\t// interlink polygon nodes in z-order\n\n\tif ( ! pass && invSize ) { indexCurve( ear, minX, minY, invSize ); }\n\n\tvar stop = ear, prev, next;\n\n\t// iterate through ears, slicing them one by one\n\n\twh...
[ "0.7089179", "0.70755583", "0.7073695", "0.7073695", "0.70284784", "0.69459796", "0.69459796", "0.69459796", "0.69221306", "0.69221306", "0.69221306", "0.6911207", "0.6911207", "0.6911207", "0.6911207", "0.6892408", "0.6886788", "0.6884495", "0.6884495", "0.68817693", "0.6874...
0.6866768
30
check whether a polygon node forms a valid ear with adjacent nodes
function isEar(ear) { var a = ear.prev, b = ear, c = ear.next; if (area(a, b, c) >= 0) return false; // reflex, can't be an ear // now make sure we don't have other points inside the potential ear var p = ear.next.next; while (p !== ear.prev) { if (pointInTriangle(a.x, a.y, b.x, b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isEar(ear) {\n var a = ear.prev, b = ear, c = ear.next;\n if (GraphicsGeometry.area(a, b, c) >= 0) {\n return false;\n } // reflex, can't be an ear\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n while (p ...
[ "0.6683878", "0.6657208", "0.65597093", "0.6521833", "0.65111285", "0.65111285", "0.6501701", "0.64871925", "0.64871925", "0.64871925", "0.64655894", "0.64543766", "0.6427612", "0.6427612", "0.6427612", "0.63121074", "0.63121074", "0.630582", "0.630582", "0.630582", "0.630582...
0.6334701
15
go through all polygon nodes and cure small local selfintersections
function cureLocalIntersections(start, triangles, dim) { var p = start; do { var a = p.prev, b = p.next.next; // a self-intersection where edge (v[i-1],v[i]) intersects (v[i+1],v[i+2]) if (intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repairSelfIntersections(lyr, nodes) {\n var splitter = getSelfIntersectionSplitter(nodes);\n\n lyr.shapes = lyr.shapes.map(function(shp, i) {\n return cleanPolygon(shp);\n });\n\n function cleanPolygon(shp) {\n var cleanedPolygon = [];\n forEachShapePart(shp, function(ids) {\n ...
[ "0.6870693", "0.65157914", "0.62187034", "0.61870015", "0.61870015", "0.61869085", "0.61822003", "0.617842", "0.617842", "0.617842", "0.617842", "0.61687565", "0.61687565", "0.61687565", "0.6110527", "0.6070149", "0.60456073", "0.60456073", "0.60456073", "0.6010724", "0.60107...
0.6179469
7