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
GET heroes from the server
getHeroes() { return this.http.get(this.heroesUrl) .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(_ => this.log('fetched heroes')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(this.handleError('getHeroes', []))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeroes() {\n $http.get('/heroesroute').then(function(response) {\n console.log('data', response.data);\n $scope.heroes = response.data;\n });\n\n }", "getHeroes() {\r\n return this.http.get(this.heroesUrl)\r\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__...
[ "0.7439203", "0.6928053", "0.6861629", "0.678102", "0.66531086", "0.6599192", "0.64747846", "0.64695007", "0.6389584", "0.6366826", "0.6332734", "0.62699336", "0.6211099", "0.6189315", "0.6172522", "0.61437756", "0.61166877", "0.6105752", "0.6077767", "0.60582083", "0.5952502...
0.7703412
0
GET hero by id. Return `undefined` when id not found
getHeroNo404(id) { debugger; const url = `${this.heroesUrl}/?id=${id}`; return this.http.get(url) .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["map"])(heroes => heroes[0]), // returns a {0|1} element array Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHero(id) {\n const url = `${this.heroesUrl}/${id}`;\n return this.http.get(url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"tap\"])(_ => this.log(`fetched hero id=${id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"catchError\"])(this.handleError(`getHero id=${id}`)));\n ...
[ "0.8208686", "0.7431224", "0.742921", "0.71373564", "0.711004", "0.7081984", "0.7008505", "0.6931544", "0.69139385", "0.6566536", "0.6548683", "0.6409343", "0.6372737", "0.63498706", "0.6298603", "0.62887", "0.62529373", "0.6231405", "0.62243813", "0.622419", "0.62087756", ...
0.7514374
1
GET hero by id. Will 404 if id not found
getHero(id) { const url = `${this.heroesUrl}/${id}`; return this.http.get(url).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(_ => this.log(`fetched hero id=${id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(this.handleError(`getHero id=${id}`))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHeroNo404(id) {\n debugger;\n const url = `${this.heroesUrl}/?id=${id}`;\n return this.http.get(url)\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"map\"])(heroes => heroes[0]), // returns a {0|1} element array\n Object(rxjs_operators__WEBPACK_IMPORTED_MODULE...
[ "0.726377", "0.7262865", "0.72112244", "0.6972816", "0.69509536", "0.68778163", "0.68321246", "0.65268934", "0.65013367", "0.6432248", "0.64185643", "0.6299322", "0.6277393", "0.6254562", "0.6162406", "0.6144594", "0.6138127", "0.606688", "0.60156834", "0.5977954", "0.59298",...
0.81609684
0
GET heroes whose name contains search term
searchHeroes(term) { if (!term.trim()) { // if not search term, return empty hero array. return Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["of"])([]); } return this.http.get(`${this.heroesUrl}/?name=${term}`).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchHeroes(term) {\r\n if (!term.trim()) {\r\n // if not search term, return empty hero array.\r\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"of\"])([]);\r\n }\r\n return this.http.get(`${this.heroesUrl}/?name=${term}`).pipe(Object(rxjs_operators__WEBPACK_IMPORTE...
[ "0.7191172", "0.68797165", "0.66557175", "0.65292", "0.65153587", "0.6297532", "0.6242457", "0.6208602", "0.61704713", "0.61547834", "0.6095299", "0.6073668", "0.6060154", "0.6010645", "0.6009699", "0.6004904", "0.5913414", "0.59037286", "0.59", "0.5899745", "0.58096176", "...
0.7699307
0
Save methods ////////// POST: add a new hero to the server
addHero(hero) { return this.http.post(this.heroesUrl, hero, httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])((newHero) => this.log(`added hero w/ id=${newHero.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(this.handleError('addHero'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "postHero(req, res, next) {\n var db = new Hero(req.body);\n var response = {};\n db.save(function (err) {\n if (err) {\n response = { \"error\": true, \"message\": err };\n }\n else {\n response = { \"error\": false, \"message\": \...
[ "0.7296144", "0.6790454", "0.64102817", "0.6284545", "0.6277227", "0.6124729", "0.6073431", "0.6008925", "0.58524674", "0.58368", "0.5803894", "0.57782483", "0.57240903", "0.5718456", "0.5711832", "0.56843287", "0.56762046", "0.56703186", "0.56494576", "0.5637168", "0.562528"...
0.7102544
1
DELETE: delete the hero from the server
deleteHero(hero) { const id = typeof hero === 'number' ? hero : hero.id; const url = `${this.heroesUrl}/${id}`; return this.http.delete(url, httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(_ => this.log(`deleted hero id=${id}`)), Object(rxjs_operators__WEBPACK_IMPORT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteHero(id) {\r\n const url = `${this.heroesUrl}/${id}`;\r\n return this.http.delete(url, this.httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"tap\"])(_ => this.log(`删除序号为${id}的英雄`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError\"])(this.handleError('delet...
[ "0.71532923", "0.70728225", "0.699996", "0.6892634", "0.6872872", "0.6750544", "0.6670094", "0.6652327", "0.6625086", "0.65954417", "0.65931916", "0.65679276", "0.65179515", "0.6503365", "0.6501666", "0.6499485", "0.6473897", "0.6451169", "0.6433831", "0.64272255", "0.6376815...
0.7687098
0
PUT: update the hero on the server
updateHero(hero) { return this.http.put(this.heroesUrl, hero, httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["tap"])(_ => this.log(`updated hero id=${hero.id}`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(this.handleError('updateHero'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateHero(hero) {\r\n return this.http.put(this.heroesUrl, hero, this.httpOptions).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"tap\"])(_ => this.log(`修改成功序号为${hero.id}的英雄`)), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError\"])(this.handleError('updateHero')));\r\n }", "st...
[ "0.71154493", "0.6457548", "0.64169675", "0.5928861", "0.5857372", "0.5849617", "0.5847158", "0.5826115", "0.5766054", "0.5739595", "0.5711226", "0.5673376", "0.5643571", "0.5621413", "0.5587957", "0.5574273", "0.5551378", "0.5537263", "0.5518606", "0.55113935", "0.5508819", ...
0.7828284
0
Handle Http operation that failed. Let the app continue.
handleError(operation = 'operation', result) { return (error) => { // TODO: send the error to remote logging infrastructure console.error(error); // log to console instead // TODO: better job of transforming error for user consumption this.log(`${operation} failed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onRequestError(status, response) {\n /* Cancel the slow load timer */\n clearTimeout(this.loadTimer);\n clearTimeout(this.timeoutTimer);\n if (this.attempts <= 3 && status !== 404) {\n /* Up to 3 attempts, retry the loading process auto...
[ "0.65394515", "0.6503451", "0.6472573", "0.6400535", "0.6282658", "0.62568986", "0.61769605", "0.6176", "0.6168687", "0.61645085", "0.6146871", "0.613175", "0.61294776", "0.61149377", "0.60805106", "0.6075479", "0.6068365", "0.6065518", "0.6059029", "0.60306877", "0.6029287",...
0.0
-1
Log a HeroService message with the MessageService
log(message) { this.messageService.add(`HeroService: ${message}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(message) {\n this.messageService.add(`CommonService: ${message}`);\n }", "log(message) {\r\n this.messageService.add(`操作信息: ${message}`);\r\n }", "function onMessageHandler(target, context, msg, self) {\n console.log({ target, context, msg, self });\n app.service('messages').create({\...
[ "0.72399336", "0.69349384", "0.6233716", "0.60334206", "0.5969428", "0.5966994", "0.5884623", "0.5809702", "0.5784311", "0.57386875", "0.56412613", "0.5613244", "0.5601976", "0.5597095", "0.55933034", "0.55569154", "0.5544465", "0.5536444", "0.5533747", "0.55190253", "0.55186...
0.87249255
0
Overrides the genId method to ensure that a hero always has an id. If the heroes array is empty, the method below returns the initial number (11). if the heroes array is not empty, the method below returns the highest hero id + 1.
genId(heroes) { return heroes.length > 0 ? Math.max(...heroes.map(hero => hero.id)) + 1 : 11; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "genId(heroes) {\r\n return heroes.length > 0 ? Math.max(...heroes.map(hero => hero.id)) + 1 : 11;\r\n }", "function idToHeroName (heroes, heroId) {\n for (let i = 0; i < heroes.length; i++) {\n if (heroes[i].id == heroId) {\n return heroes[i].localized_name;\n }\n }\n return 'Unknown';\n}...
[ "0.88168794", "0.5826326", "0.57671696", "0.5730448", "0.566652", "0.56624997", "0.5616742", "0.56134546", "0.5607773", "0.54655147", "0.5456828", "0.54409456", "0.54379034", "0.54318434", "0.53956085", "0.53905135", "0.5390074", "0.538003", "0.53779274", "0.536006", "0.53412...
0.88014054
1
Hides all additional info except for the selected character
function hide(current) { if(current != "bagul") { var x = document.getElementById("bagul"); x.style.display = "none"; } if (current != "mick") { var y = document.getElementById("mick"); y.style.display = "none"; } if (current != "phillip") { var z = document.getElementById("phillip"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setHiddenAttText(active) {\n this.setRemoveColorText(active);\n this.setRemoveColorArrow(active);\n this.setRemoveDimmedBlock(active);\n }", "function hideDottedSelection() {\n\t\tdocument.getElementById(this.id).style.visibility = \"hidden\";\n\t}", "function hide_educational()\n{\n change_educat...
[ "0.67461234", "0.6370959", "0.63120466", "0.6230233", "0.6230233", "0.621525", "0.61911404", "0.61697257", "0.6159212", "0.6037662", "0.60229486", "0.60149556", "0.59882873", "0.5925874", "0.5908879", "0.5904817", "0.5897206", "0.5893196", "0.58805203", "0.5837135", "0.583276...
0.0
-1
By default, all additional info is hidden
function hideAll() { var x = document.getElementById("bagul"); x.style.display = "none"; var y = document.getElementById("mick"); y.style.display = "none"; var z = document.getElementById("phillip"); z.style.display = "none"; var a = document.getElementById("hair"); a.style.display = "none"; var b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canShowDetailedInfo() {\n return false;\n }", "function fnhideInformation()\r\n\t\t{\r\n\t\t\tmblnOnInfoWindow = false;\r\n\t\t}", "function _hidden() {}", "function setup_showInfo() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \...
[ "0.7331919", "0.7126645", "0.7009335", "0.6901267", "0.6863413", "0.67442405", "0.6725401", "0.6706218", "0.6590947", "0.65746653", "0.6453737", "0.6396842", "0.6395695", "0.6392866", "0.6379529", "0.6353447", "0.63514334", "0.6342743", "0.63311535", "0.63046217", "0.62840855...
0.0
-1
the backpointer to the store to enable mainly removel
constructor(goal, store) { this.desc = goal.desc; this.finished = goal.finished; this.id = goal.id; this.store = store; this.toggle = this.toggle.bind(this); this.remove = this.remove.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "store() {\n return (this._store);\n }", "function Store() {\n\n\t}", "function Store (){}", "function Store() {}", "function Store() {}", "function Store() {}", "Store() {\n\n }", "get store() {\n return super.store;\n }", "get store() {\n return super.store;\n }", "get store() {\n...
[ "0.7162953", "0.7021668", "0.6936336", "0.6884239", "0.6884239", "0.6884239", "0.6857663", "0.67838836", "0.67838836", "0.67000407", "0.6636228", "0.6636228", "0.6636228", "0.6636228", "0.6636228", "0.6636228", "0.6636228", "0.6636228", "0.6606292", "0.6561074", "0.6561074", ...
0.0
-1
temp solution, need change to msg
updateLayouts(data) { return this.http.put('/tenant/settings/layouts', data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "static private internal function m121() {}", "protected internal function m252() {}", "function solution(s) {\n\n}", "solutionToString () {}", "function answer(msg) {\n if(matches(msg, pattern_1)) {\n return \"Well, yes \" ...
[ "0.6126511", "0.5799735", "0.5768098", "0.57115936", "0.54317486", "0.5310435", "0.5295069", "0.52691746", "0.52454275", "0.5228732", "0.5194184", "0.519016", "0.5185426", "0.5183332", "0.5157044", "0.51291287", "0.5110147", "0.50904113", "0.50888014", "0.5077418", "0.5070689...
0.0
-1
function of reconnecting WebSocket
function ReconnectWebSocket(classObj, url, onmsg, timeInterval) { a(); b(); classObj.ws = new WebSocket(url); classObj.ws.onmessage = onmsg; classObj.ws.onclose = function (e) { console.log( 'Socket is closed. Reconnect will be attempted in 1 second.', e.reaso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reconnectTimer () {\n if (!ws || ws.readyState == WebSocket.CLOSED) {\n reallyConnect();\n }\n }", "reconnected () {\n window.location.reload() // This triggers another websocket disconnect/connect (!)\n }", "function reconnectWebSocket() {\n window.setTimeout(() => {\n ...
[ "0.8019544", "0.794509", "0.7929767", "0.79022753", "0.7896755", "0.7728187", "0.7693542", "0.74459213", "0.74126595", "0.73948205", "0.7324174", "0.7212706", "0.72060573", "0.7193234", "0.7171739", "0.7117022", "0.6998242", "0.6990899", "0.6984901", "0.69713527", "0.68962723...
0.74466395
7
This is the equivalent of our "getInitialState"
constructor(props) { // This super(props) line lets us access our parents properties as props. super(props); this.state = { searchTerm: "", starYear: "", endYear: "", results:[], Saved: [] }; this.setTerm = this.setTer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInitialState ()\n {\n return {};\n }", "function getInitialState ()\n {\n return {};\n }", "_getInitialState() {\n return {};\n }", "getInitialState() {\n return {\n\n }\n }", "getInitialState() {\n return {\n }\n }", "function getInitialS...
[ "0.8616526", "0.8616526", "0.85353154", "0.8419951", "0.80659264", "0.8009004", "0.8009004", "0.7937052", "0.7911003", "0.772327", "0.7717513", "0.7712017", "0.7588862", "0.75877506", "0.7544638", "0.752825", "0.73817843", "0.7355766", "0.7310375", "0.72329384", "0.7110852", ...
0.0
-1
The moment the page renders get the Saved
componentDidMount() { // Get the latest Saved. helpers.getSaved().then(function (response) { if (response !== this.state.Saved) { this.setState({Saved: response.data}); } }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSaved() {\n this.saved.raise();\n }", "onSaved() {\n if (this._saved) {\n this._saved.raise();\n }\n }", "function save() {\n $scope.broadcastFromRoot(addPageCtrl.constants.CC_PAGE_ADDED, { page: addPageCtrl.page });\n closeD...
[ "0.7085209", "0.693943", "0.6866597", "0.6726869", "0.65859026", "0.65012425", "0.6479907", "0.6467157", "0.64414304", "0.6435627", "0.6394908", "0.6371364", "0.6365246", "0.635603", "0.6352009", "0.6337345", "0.6337345", "0.6287604", "0.6283547", "0.6281727", "0.62390745", ...
0.0
-1
If the component changes (i.e. if a search is entered)...
componentDidUpdate(prevProps, prevState) { // Run the query for the Search if (prevState.searchTerm !== this.state.searchTerm) { //Clears the Results array if there is a new Search this.setState({results: []}); helpers.runQuery(this.state.searchTerm, this.state.starYe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onUpdateContent() {\n this.checkAutocomplete();\n\n if (!this.search) {\n this.emmitEvent('');\n }\n }", "componentDidUpdate(prevProps) {\n if (this.props.visible !== prevProps.visible && this.props.visible === true) {\n this.makeFullSearch();\n }\n }", "function trig...
[ "0.69665545", "0.657989", "0.65737665", "0.65711045", "0.6541166", "0.65186036", "0.6517562", "0.65108085", "0.65108085", "0.6484241", "0.6474793", "0.64741254", "0.6474003", "0.6456832", "0.6451018", "0.6448385", "0.6420189", "0.6412548", "0.64021105", "0.6397713", "0.638335...
0.0
-1
This function allows childrens to update the parent.
setTerm(term) { this.setState({searchTerm: term}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateParent(e) {\n var context = e.context;\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "function updateParent(e) {\n var context = e.context;\n\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "function ...
[ "0.75143605", "0.7514325", "0.7514325", "0.74905634", "0.7341967", "0.6986063", "0.6840786", "0.67825085", "0.67815095", "0.671045", "0.6704623", "0.6680671", "0.66509694", "0.66337764", "0.66137123", "0.65945226", "0.65266013", "0.6497643", "0.64924866", "0.6470807", "0.6470...
0.0
-1
Here we render the function
render() { return ( <div className="container"> <div className="row"> <div className="jumbotron"> <h2 className="text-center">Ny Time Article Scrubber</h2> <p className="text-center"> <em>...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "render() {}", "render() {}", "render() {}", "render() {\n\n\t}", "render() {\n\n\t}", "_render() {}", "function render() {\n\t\t\n\t}", "function render() {\n\n\t\t\t}", "function render() {\n\t\t\t}", "static rendered () {}", ...
[ "0.69027746", "0.69027746", "0.68995863", "0.68995863", "0.68995863", "0.683906", "0.683906", "0.6785138", "0.67782104", "0.6703463", "0.6679324", "0.66346437", "0.66346437", "0.660582", "0.6594986", "0.64746124", "0.6400315", "0.6392956", "0.6386282", "0.6306149", "0.6306149...
0.0
-1
Return a random quote object from randomQuotes and add a copy of it into usedQuotes array
function getRandomQuote() { var selector = Math.floor(Math.random() * randomQuotes.length); usedQuotes.push(randomQuotes[selector]); return randomQuotes[selector]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomQuote() {\n var randPos = Math.floor(Math.random() * quotes.length)\n var selectedQuote = quotes.splice(randPos, 1)\n\n //keep track of all used quotes\n usedQuotes.push(selectedQuote[0])\n return selectedQuote[0]\n}", "function getRandomQuote() {\n\tvar randNum = Math.floor...
[ "0.8150466", "0.81213295", "0.79255575", "0.78625655", "0.78431624", "0.7827867", "0.7779823", "0.7644974", "0.7634473", "0.7598824", "0.7584731", "0.7556568", "0.7551516", "0.7525547", "0.7520846", "0.75131446", "0.75057036", "0.75039744", "0.74917126", "0.746118", "0.744865...
0.7649992
7
Return a random color from randomColor and add a copy of it into usedColors array
function getRandomColor() { var randomNumber = Math.floor(Math.random() * randomColor.length); usedColors.push(randomColor[randomNumber]); return randomColor[randomNumber]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomColor() {\n // if almost all colors have been used, empty the colorsUsed array\n if (colorsUsed.length >= colors.length / 3 * 2) {\n colorsUsed = [];\n console.log(\"Colors emptied\")\n }\n // generate random index\n var index = Math.floor(Math.random() * colors.length);...
[ "0.82286894", "0.78674215", "0.77966124", "0.77875817", "0.77537215", "0.77527374", "0.7722874", "0.7706101", "0.76870036", "0.7679605", "0.7678008", "0.766101", "0.76572955", "0.76531774", "0.7653025", "0.76509184", "0.76492816", "0.7639481", "0.76368046", "0.76368046", "0.7...
0.84015167
0
Replace quote in quotebox div with a random quote and background color
function printQuote() { // Get a random quote and color, and store them in variables var selectedQuote = getRandomQuote(); var newColor = getRandomColor(); // Construct HTML string using different properties of quote object // The properties Citation, Year, and Tags are optional var quoteHTML = '<p class="quote">...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printQuote() {\n var selectedQuote = getRandomQuote();\n var randomColor = getRandomColor();\n var fullQuote = '<p class=\"quote\">' + selectedQuote.quote + '</p>';\n fullQuote += '<p class=\"source\">' + selectedQuote.source + '</p>';\n fullQuote += '<p class=tags>' + selectedQuote.tags + ...
[ "0.75970083", "0.75845647", "0.7500101", "0.7475992", "0.7430084", "0.74291855", "0.742908", "0.74218017", "0.73790914", "0.7374005", "0.7350274", "0.7333947", "0.73230666", "0.7287161", "0.7282758", "0.7251677", "0.724827", "0.7241139", "0.71362", "0.713517", "0.712523", "...
0.6966491
33
var id = 0;
function createData(sym, wgt, reg1, vol1, price1,price2,vol2,reg2) { // id += 1; return { sym, wgt, reg1, vol1, price1,price2,vol2,reg2} ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getID() {}", "function setid(v){\n id = v;\n}", "function resetId(){\n\n\t\tID = 0;\n\n\t}", "getID() {\n this.id = userID;\n userID++;\n }", "get id(){\n let id = this.data.id;\n if (id === undefined){\n id = this._id = (this._id || ++idCounter);\n }\n ...
[ "0.75285494", "0.7511788", "0.73568505", "0.7316069", "0.70756984", "0.7055165", "0.7046157", "0.7045943", "0.7027863", "0.7007791", "0.69651467", "0.6941856", "0.6939641", "0.6933414", "0.6933414", "0.6933414", "0.6931565", "0.69248605", "0.6912302", "0.68957245", "0.68932",...
0.0
-1
Reset the loader, allows running a new program on the same session.
function resetLoader() { program = compilerHost = AOTMode = undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.program = null;\n this.shader = null;\n }", "function resetInterpreter() {\n myInterpreter = null;\n}", "resetProgram() {\n this.checkForIntervalId();\n this.stateHistory.reset();\n }", "function reset() {\n frc = false;\n load(DEFAULT_POSITIO...
[ "0.6656404", "0.66077435", "0.655302", "0.6524751", "0.6353216", "0.63334304", "0.6225523", "0.606473", "0.60344875", "0.60344875", "0.6004261", "0.59252495", "0.5921826", "0.5909691", "0.59066206", "0.58779246", "0.5873154", "0.5864569", "0.5836878", "0.5832084", "0.5831993"...
0.7638936
0
Implementation of fetch call to fetch all reservations
async function fetchReservations() { try{ let response = await fetch(config.backendEndpoint + '/reservations/'); response = await response.json(); return response; } catch(err){ return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchReservations() {\n // TODO: MODULE_RESERVATIONS\n // 1. Fetch Reservations by invoking the REST API and return them\n let reservations = null;\n try {\n reservations = await (\n await fetch(`${config.backendEndpoint}/reservations/`)\n ).json();\n } catch (err) {\n console.log...
[ "0.72750235", "0.704601", "0.704601", "0.70294636", "0.69481564", "0.6642697", "0.63810533", "0.62724054", "0.61319584", "0.6120181", "0.6064601", "0.60634035", "0.60448015", "0.6025744", "0.5969934", "0.5875663", "0.5807864", "0.5790552", "0.578664", "0.5767759", "0.57334363...
0.73150325
0
Function to add reservations to the table. Also; in case of no reservations, display the noreservationbanner, else hide it.
function addReservationToTable(reservations) { reservations.forEach((reserve) => { let row = document.createElement('tr'); let nDate = new Date(reserve.date); //reserve.date is in string format,so convert it to date format. let bookedDate = nDate.toLocaleDateString('en-IN'); l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addReservationToTable(reservations) {\n // TODO: MODULE_RESERVATIONS\n // 1. Add the Reservations to the HTML DOM so that they show up in the table\n //Conditionally render the no-reservation-banner and reservation-table-parent\n /*\n Iterating over reservations, adding it to table (into div with c...
[ "0.79747725", "0.6035689", "0.5979101", "0.5847232", "0.5827422", "0.58217466", "0.57137924", "0.56877816", "0.565428", "0.56529504", "0.5647453", "0.56187695", "0.5606142", "0.5597479", "0.5581494", "0.55758995", "0.55694723", "0.55665416", "0.5543419", "0.5539142", "0.55368...
0.7353595
1
cssstyle in html einfuegen
function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_css$4(){var style=element(\"style\");style.id=\"svelte-82cst2-style\";style.textContent=\"span.svelte-82cst2{font-size:inherit;font-family:inherit}\";append(document.head,style)}", "static get styles () {\n return css`${unsafeCSS(style)}`\n }", "function add_css$3(){var style=element(\"style\"...
[ "0.7254452", "0.71993005", "0.71771455", "0.71644056", "0.70466727", "0.7044724", "0.69831806", "0.69800335", "0.6948316", "0.69371575", "0.69295806", "0.69118845", "0.6888225", "0.68815815", "0.68373185", "0.6776775", "0.6772822", "0.675107", "0.67046845", "0.6695195", "0.66...
0.0
-1
Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function myFunction() { if (window.pageYOffset >= sticky) { navbar.classList.add("sticky") } else { navbar.classList.remove("sticky"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stickyScroll() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function navfixedScroll() {\n if (window.pageYOffset > sticky+200) {\n navbar.classList.add...
[ "0.8961812", "0.8700885", "0.8651204", "0.8564356", "0.8528811", "0.8515311", "0.8434928", "0.8410805", "0.84086275", "0.836913", "0.8313619", "0.82871675", "0.8273877", "0.82669383", "0.8266156", "0.8255041", "0.8248186", "0.822463", "0.822463", "0.822463", "0.8221415", "0...
0.8214946
42
(EDIT) Prepare getter methods to call from processing.js To use javascript variables in processing.js you have to call by getter methods
function getEnoshimaShirasuAmount() { return EnoshimaSensorInfo.amount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function value() { }", "static get properties() { return {\n _variables: {type:Object} \n}}", "get value() {}", "get value() {}", "function SoloValue() {}", "static get properties(){return{}}", "static get properties(){return{}}", "get Custom() {}", "get x() {}", "get Automatic() {}", "get pro...
[ "0.6029371", "0.5798106", "0.5685547", "0.5685547", "0.5678948", "0.56770945", "0.56770945", "0.5664773", "0.56251204", "0.561441", "0.55598587", "0.55426604", "0.5531978", "0.5531978", "0.55263364", "0.55208814", "0.55204356", "0.55041116", "0.54765975", "0.5473194", "0.5458...
0.0
-1
Called when received sensor data
function eventListener(device, transducer) { var today = getToday(); // (EDIT) check if the DEVICE name is the one you want if(device=="しらすの入荷情報湘南") { /* * (EDIT) change below statements depending on * which TRANSDUCER & what VALUE you want to use */ if (typeof tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readSensorData() {\n \t bme280.readSensorData()\n .then((data) => {\n // temperature_C, pressure_hPa, and humidity are returned by default.\n temperature = data.temperature_C + 273.15;\n pressure = data.pressure_hPa * 100;\n humidity = data.humidity / 100;\n d...
[ "0.69094944", "0.6787376", "0.6760626", "0.6754044", "0.6714231", "0.6703391", "0.6702396", "0.6666317", "0.6641659", "0.65972143", "0.6563255", "0.6563255", "0.6563255", "0.6479222", "0.6464411", "0.64317024", "0.64121157", "0.64115155", "0.6411194", "0.6366791", "0.6342371"...
0.595992
58
Displays a subset of a dropdown's options
function displayOptionItemsByClass(selectElement, className) { if (!selectElement.backup) { selectElement.backup = selectElement.cloneNode(true); } var options = selectElement.getElementsByTagName("option"); for(var i=0, length=options.length; i<length; i++) { selectElement.removeChild(o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAllAccountOption()\n{\n var select_el = $(\"ul.criteria-container select#account\");\n var allaccounts_el = select_el.children(\"option.all_accounts\");\n allaccounts_el.removeAttr(\"disabled\");\n allaccounts_el.show();\n\n select_el.formSelect();\n}", "function populateDropdown...
[ "0.65136296", "0.6373335", "0.63626885", "0.6301352", "0.62942225", "0.62750524", "0.6264851", "0.6253647", "0.6247315", "0.62351495", "0.6201316", "0.6180798", "0.614123", "0.6123606", "0.61198413", "0.60919416", "0.606178", "0.60615885", "0.60615706", "0.605435", "0.6044917...
0.0
-1
Applies cascading behavior for the specified dropdowns
function applyCascadingDropdown_optgp(sourceId, targetId) { var source = document.getElementById(sourceId); var target = document.getElementById(targetId); if (source && target) { source.onchange = function() { displayOptionItemsByClassn_optgp(target, source.value); } dis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CascadingDropDownSample() {\n this.resetCascadingDropDowns = function () {\n this.resetModels();\n this.resetColors();\n };\n\n this.getSampleModelsSuccess = function (data) {\n //binding JSON data received to HTML select control\n $.each(data, function (key, textValue...
[ "0.66675985", "0.6122993", "0.6082655", "0.5969195", "0.59310967", "0.58855003", "0.58743435", "0.57790333", "0.57558155", "0.57119143", "0.56033117", "0.54955405", "0.5474611", "0.5463947", "0.5458412", "0.54438305", "0.53940076", "0.53638184", "0.5353595", "0.53196275", "0....
0.6018694
3
Displays a subset of a dropdown's options
function displayOptionItemsByClassn_optgp(selectElement, className) { if (!selectElement.backup) { selectElement.backup = selectElement.cloneNode(true); } var options = selectElement.getElementsByTagName("optgroup"); for(var i=0, length=options.length; i<length; i++) { selectElement.remo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAllAccountOption()\n{\n var select_el = $(\"ul.criteria-container select#account\");\n var allaccounts_el = select_el.children(\"option.all_accounts\");\n allaccounts_el.removeAttr(\"disabled\");\n allaccounts_el.show();\n\n select_el.formSelect();\n}", "function populateDropdown...
[ "0.6515262", "0.63743305", "0.63626283", "0.6302513", "0.62944216", "0.62771136", "0.6265539", "0.6254042", "0.6247621", "0.6235434", "0.6202274", "0.618088", "0.6141662", "0.6124337", "0.61204505", "0.60933226", "0.6062511", "0.6062471", "0.6061964", "0.6054315", "0.6046219"...
0.0
-1
import functions from other local files.
function require(locationInProject) { var imported = document.createElement('script'); imported.src = locationInProject; document.head.appendChild(imported); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "import() {\n }", "function myImport() {\n\tvar args = Array.prototype.slice.call(arguments);\n var filename = args.shift();\n if (typeof(filename) == typeof(undefined)) {\n return;\n }\n var preImport = function(args){myImport.apply(null, args);};\n var next = function(){preImport(args);...
[ "0.6888287", "0.6312631", "0.6238396", "0.623793", "0.61426306", "0.604545", "0.604545", "0.60370773", "0.5946124", "0.57809794", "0.5706517", "0.5664092", "0.5606768", "0.55909467", "0.5532041", "0.5477508", "0.5437514", "0.54056513", "0.5386859", "0.53337544", "0.5331608", ...
0.0
-1
onclick for clear button it resets screen on canvas
function reset() { removeForm(); addApplicationTitle(); drawBackground(); if (click == 2){ path = new Pathway(); wall = new Wall(); pathway = path; } click = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearCanvas() {\n}", "function clear(){\n\t\n\t$(\"#clearButton\").bind( \"click\", function(){\n\t\t\n\t\tcontext.clearRect( 0, 0, 280, 280 );\n\t\tcontext.fillStyle=\"white\";\n\t\tcontext.fillRect(0,0,canvas.width,canvas.height);\n\n\t});\n}", "function clearScreen(){\n\tcontext.clearRect(0,0,canva...
[ "0.8707693", "0.8604561", "0.8550543", "0.84862226", "0.8471953", "0.8463707", "0.8462216", "0.84598625", "0.8453056", "0.8450724", "0.84231305", "0.84214634", "0.84128296", "0.83994305", "0.8397353", "0.8393776", "0.8392059", "0.8365679", "0.83647543", "0.83612317", "0.83542...
0.0
-1
function to test if click was within grid called in onclick handler below
function invalidPoint(p) { if (p.x < XMIN || p.y < YMIN || p.y > SCREEN_HEIGHT || p.x > window.innerWidth) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidClick(numberOnCell) {\n var emptyRow = getRowNumber(NUMBER_ON_EMPTY_CELL), emptyCol = getColumnNumber(NUMBER_ON_EMPTY_CELL);\n var clickRow = getRowNumber(numberOnCell), clickCol = getColumnNumber(numberOnCell);\n // console.log(\"number on cell: \" + numberOnCell ...
[ "0.7072777", "0.6556749", "0.6425627", "0.63037956", "0.62706655", "0.62202966", "0.6201978", "0.6187423", "0.6165252", "0.6144222", "0.61441934", "0.61333114", "0.61016", "0.6100286", "0.6099954", "0.6095688", "0.60941315", "0.6089391", "0.60893434", "0.60803014", "0.6080301...
0.0
-1
main entry point of the program
function start() { var path = new Pathway(); wall = new Wall(); pathway = path; click = 0; drawBackground(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n return _main.apply(this, arguments);\n}", "function main() {\n\tvar docs;\n\n\tdebug( 'Generating REPL help documentation.' );\n\tcreateHelp();\n\n\tdebug( 'Loading REPL help documentation.' );\n\tdocs = require( HELP_OUTPUT );\n\n\tdebug( 'Generating REPL examples.' );\n\tcreateExamples( do...
[ "0.7652832", "0.74509025", "0.7449274", "0.7437219", "0.7343955", "0.73038965", "0.7288413", "0.7278752", "0.72024494", "0.71848875", "0.7131984", "0.7109105", "0.70372576", "0.7002972", "0.6990972", "0.69902873", "0.6975081", "0.6961999", "0.6958489", "0.68572205", "0.685360...
0.0
-1
Handle HTTP errors since fetch won't.
function handleErrors(response) { if (!response.ok) { throw Error(response.statusText); } return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleFetchErrors(response) {\n // \"clone\" so we can still read the original `response` downstream)\n return response.clone().text()\n .then(bodyTxt => {\n if (!response.ok) {\n console.error(\"Fetch response wasn't OK\");\n throw new Error(`status: \"${response.status}\", body: ...
[ "0.74301404", "0.70337486", "0.6903284", "0.6510197", "0.6494188", "0.64738214", "0.63793975", "0.63562024", "0.6327584", "0.6234705", "0.62299573", "0.6203106", "0.61723304", "0.6155043", "0.6136561", "0.61218405", "0.6107685", "0.6063942", "0.6031494", "0.6005256", "0.59981...
0.554096
97
Source: DESCRIPTION: Write a function that, given a string of text (possibly with punctuation and linebreaks), returns an array of the top3 most occurring words, in descending order of the number of occurrences. Assumptions: A word is a string of letters (A to Z) optionally containing one or more apostrophes (') in ASC...
function topThreeWords(text) { let allWordsArray = text.toLowerCase().match(/[a-z]+'?[a-z]*/g); if (!allWordsArray) return []; let uniqueWordsObj = {}; for (let word of allWordsArray) { if (uniqueWordsObj[word]) uniqueWordsObj[word]++; else uniqueWordsObj[word] = 1; } let uniqu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function topThreeWords(text) {\n let regExp = /[a-z]+/i;\n let words = text.trim().split(\" \");\n words = words\n .filter((word) => regExp.test(word))\n .map((word) => word.toLowerCase().replace(/[^a-z']/g, \"\"));\n\n let counts = {};\n words.forEach((word) => {\n // if(!Object.keys(counts).i...
[ "0.87237436", "0.7385758", "0.7189482", "0.6627841", "0.662723", "0.6548022", "0.6532769", "0.6526386", "0.6522927", "0.6467625", "0.6325308", "0.6324403", "0.6320117", "0.6288966", "0.62771547", "0.6256474", "0.6186111", "0.6106456", "0.6043657", "0.60213894", "0.60122234", ...
0.8511136
1
Start screen render runs when screenDisplay === true
function startScreen() { // make lines slightly thicker ctx.lineWidth = 2; ctx.clearRect(0, 0, gameWidth, gameHeight + 300); ctx.strokeStyle = 'white'; ctx.fillStyle = 'white'; ctx.font = "56px 'Press Start 2P'"; ctx.strokeRect(0, 0, gameWidth, gameHeight); // Score ctx.textAlign = 'center'; ctx.fillText(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startScreen() {\n mainContainer.append(startButton)\n }", "function startScreen() {\n\tdraw();\n\tif(usuario_id !== -1)\n\t\tstartBtn.draw();\n}", "render() { this.screen.render() }", "function startScreen() {\n\tdraw();\n\tstartBtn.draw();\n}", "function render() {\n if (!willRende...
[ "0.729679", "0.71960706", "0.71587896", "0.71161413", "0.70962065", "0.7059375", "0.6945451", "0.69113344", "0.68914545", "0.68384165", "0.68322265", "0.67801327", "0.67168766", "0.6664979", "0.66546756", "0.66469234", "0.6646691", "0.6629076", "0.6613351", "0.66026515", "0.6...
0.6822675
11
Draw the tail of the player
function drawPrevFrames() {; for (let i = player.prevPosition.length - 1; i >= 0; i--) { ctx.globalAlpha = (0.3 / i) + 0.1; if (i % 3 === 2) { ctx.strokeRect(player.prevPosition[i].x, player.prevPosition[i].y, player.width, player.height); } if (i > 0) { player.prevPosition[i].x = player.prevPosition[i -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawTail() {\n penColor(rgb(76,219,255,0.7));\n penWidth(15);\n turnTo(305);\n arcLeft(30,300);\n penUp();\n}", "render() {\n\t\tlet color_red = gameSettings['snake_head_color_red'];\n\t\tlet color_green = gameSettings['snake_head_color_green'];\n\t\tlet color_blue = gameSettings['snake_head_color_...
[ "0.7906745", "0.65956855", "0.6373669", "0.63461626", "0.6302295", "0.626764", "0.6237142", "0.62360567", "0.6154413", "0.6053268", "0.6048066", "0.6046615", "0.6040367", "0.60375464", "0.6028196", "0.6025163", "0.6020765", "0.6016256", "0.6006666", "0.59880275", "0.5968217",...
0.0
-1
Draw score, level title etc.
function bottomText() { // Clear last & set color ctx.clearRect(0, gameHeight, gameWidth, 300); const levelTitle = levelText(); ctx.fillStyle = levelTitle.color; ctx.font = "24px 'Press Start 2P'"; // Level title ctx.textAlign = 'left'; ctx.fillText(levelTitle.text, 10, gameHeight + 50); // Score ctx.text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawScore() {\n\t\tthis.ctx.font = '500 16px Noto Sans JP';\n\t\tthis.ctx.fillStyle = 'white';\n\t\tthis.ctx.fillText(`Score : ${this.score}`, 10, 30);\n\t\tthis.ctx.fillText(`Highest Score : ${this.highestScore}`, 150, 30);\n\t}", "function renderScore() {\n ctx.font = '20px Time New Roman';\n\n // Draws the ...
[ "0.80667686", "0.7831586", "0.77883774", "0.76827085", "0.76596445", "0.76385695", "0.7589473", "0.7573285", "0.7558487", "0.7553042", "0.75485176", "0.7533794", "0.7511396", "0.7483275", "0.7472325", "0.74692583", "0.74654436", "0.74629664", "0.74454224", "0.744174", "0.7427...
0.0
-1
Draw the arrows between sections
function arrowShape(offsetX, offsetY, height, arrowColor) { ctx.strokeStyle = arrowColor; ctx.beginPath(); ctx.moveTo(0 + offsetX, 0 + offsetY); ctx.lineTo((height / 4) + offsetX, (height / 2) + offsetY); ctx.lineTo(0 + offsetX, height + offsetY); ctx.lineTo((height / 4) + offsetX, height + offsetY); ctx.lineTo(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSlideArrows(section) {\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if (options.controlArrowColor !== '#fff')...
[ "0.73699373", "0.73578906", "0.73578906", "0.73578906", "0.73439044", "0.73439044", "0.73369277", "0.72088695", "0.7168685", "0.7168685", "0.7168685", "0.7168685", "0.7168685", "0.7149574", "0.7149574", "0.7149574", "0.70079637", "0.69084316", "0.6647788", "0.6436342", "0.641...
0.5923047
34
rewrite level text (doesn't draw on ctx)
function levelText() { if (-scrollDistance < (gameWidth * 2)) { return {text: "1. Platforming", color: '#12B4E9'} } else if (-scrollDistance < (gameWidth * 5)) { return { text: "2. Watch Out!", color: 'red' } } else if (-scrollDistance < (gameWidth * 8)) { return { text: "3. Anti Grav", color: 'green' } } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLevel(){\r\n ctx.font = fontType;\r\n ctx.fillStyle = \"#009547\";\r\n ctx.fillText(\"Level \"+level, canvas.width/2 - 30, 20);\r\n}", "function renderLevel() {\n ctx.save();\n\n ctx.font = '25px Exo';\n ctx.textAlign = 'center';\n\n ctx.strokeStyle = '#00f';\n ...
[ "0.75288105", "0.72753805", "0.68576497", "0.67398155", "0.66472083", "0.6627146", "0.65343213", "0.65291184", "0.65010965", "0.6498147", "0.64365035", "0.6336588", "0.6327019", "0.6248016", "0.62409383", "0.6240931", "0.6223318", "0.6223144", "0.6199829", "0.619537", "0.6141...
0.6752184
3
Collision check coins credit to
function coinCheck(player, coin) { // get the vectors to check against const vX = (player.x + (player.width / 2)) - (plusScrollDistance(coin) + (coin.width / 2)); const vY = (player.y + (player.height / 2)) - (coin.y + (coin.height / 2)); // add the half widths and half heights of the objects const hWidths = (play...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coinCollision() {\n\tif (!(playerX + playerWidth < coinX || coinX + coinWidth < playerX || playerY + playerHeight < coinY || coinY + coinHeight < playerY)) {\n\t\tcoinSound.play();\n\t\taddScore();\n\t\tnewCoin();\n\t}\n}", "function checkCoins() {\n // Checks if player has a higher x coordinate than...
[ "0.7689432", "0.69206655", "0.6682375", "0.6626394", "0.65199596", "0.6506621", "0.64685076", "0.64024156", "0.6308297", "0.6300531", "0.62755895", "0.62693065", "0.62634265", "0.62475467", "0.6245651", "0.62436783", "0.6232562", "0.6226092", "0.6223901", "0.6212841", "0.6207...
0.7040049
1
Collision check platforms credit to
function collisionCheck(shapeA, shapeB) { // get the vectors to check against const vX = (shapeA.x + (shapeA.width / 2)) - (plusScrollDistance(shapeB) + (shapeB.width / 2)); const vY = (shapeA.y + (shapeA.height / 2)) - (shapeB.y + (shapeB.height / 2)); // add the half widths and half heights of the objects const ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collidesWith(player) {\n //this function returns true if the the rectangles overlap\n // console.log('this.collidesWith')\n const _overlap = (platform, object) => {\n // console.log('_overlap')\n // check that they don't overlap in the x axis\n const objLeftOnPlat = object.left <= platform....
[ "0.7806823", "0.75840485", "0.7371716", "0.73642164", "0.735295", "0.73484695", "0.73324394", "0.725187", "0.7245917", "0.7224433", "0.71984744", "0.7188371", "0.71695274", "0.71645397", "0.7135325", "0.7106023", "0.71035", "0.70975775", "0.7044402", "0.7042254", "0.70109797"...
0.0
-1
return platform.x coordinate for canvas bounds, return platform.x coordinate PLUS scroll distance for platforms nice little function to keep logic clean ^_^
function plusScrollDistance(platform) { return (platform.bound) ? platform.x : platform.x + scrollDistance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function platformCalc() {\r\n var subs = platform_broken_substitute;\r\n\r\n platforms.forEach(function(p, i) {\r\n if (p.type == 2) {\r\n if (p.x < 0 || p.x + p.width > width) p.vx *= -1;\r\n\r\n p.x += p.vx;\r\n }\r\n\r\n if (p.flag == 1 && subs.appearance === false && jumpCoun...
[ "0.65706474", "0.65007496", "0.62574214", "0.6207009", "0.6179295", "0.61593527", "0.6073925", "0.6049932", "0.60335356", "0.60335356", "0.60335356", "0.60335356", "0.6017914", "0.60035926", "0.60012794", "0.59785414", "0.59532785", "0.5948802", "0.594262", "0.59314805", "0.5...
0.7900041
0
Motion functions respond to keypresses
function horizontalMove(direction) { // If player is moving in the opposite direction and their feet are on the ground, stop them if ((player.xVelocity * direction) < 0 && !player.jumping) { player.xVelocity = 0; } // If the player is in midair, give less horizontal control if (player.jumping) { player.xVeloci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyup(evt) {\r\n // Get the key code\r\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\r\n\r\n switch (keyCode) {\r\n case \"A\".charCodeAt(0):\r\n if (player.motion == motionType.LEFT) player.motion = motionType.NONE;\r\n break;\r\n\r\n case \"D...
[ "0.74006397", "0.74006397", "0.7352105", "0.73273057", "0.72623277", "0.723722", "0.72357094", "0.72016865", "0.71954226", "0.7157685", "0.71043336", "0.7098252", "0.70828825", "0.7065255", "0.70525384", "0.70483935", "0.6988492", "0.6984363", "0.697531", "0.69599307", "0.695...
0.0
-1
Jump function activated by up arrow or spacebar
function jump() { // If the player's feet are on the ground, have them jump if (!player.jumping && player.grounded) { player.jumping = true; player.grounded = false; player.yVelocity = -(player.jumpSpeed * gravityDirection); } else if (player.canExtendJump > 0 && (keys[38] || keys[32])) { // Allow player to ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jump() {\n\t\t// \n\t}", "function control(e) {\n if (e.keyCode == \"38\" || e.keyCode == \"32\") {\n if (!isJump) {\n isJump = true;\n jump();\n }\n }\n }", "jump()\n {\n let yDistance = this.yPos - this.jumpSize;\n this.yPos -= this.jumpSpeed * yDistance;\n }", "funct...
[ "0.76468396", "0.7521203", "0.7354605", "0.734596", "0.7253801", "0.7245402", "0.71509963", "0.71442765", "0.71222854", "0.7042276", "0.7036892", "0.7016131", "0.70082796", "0.7007472", "0.7003568", "0.6982843", "0.69580764", "0.6902555", "0.689801", "0.68929636", "0.6875974"...
0.6944454
17
Shoot function activated by D key
function shoot() { if (bulletDelay < 0) { projectiles.push({ x: player.x + (player.width / 2) - scrollDistance, y: player.y + (player.height / 2) - (coinSize / 2) }) bulletDelay = 30; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shoot (event) {\n\t\tlet laserId = null;\n\t\tlet currentLaserIndex = currentShooterIndex;\n\n\t\tfunction moveLaser () {\n\t\t\tsquares[currentLaserIndex].classList.remove('laser');\n\t\t\tcurrentLaserIndex -= width;\n\t\t\tsquares[currentLaserIndex].classList.add('laser');\n\t\t\tif (squares[currentLase...
[ "0.7035325", "0.6820571", "0.67891484", "0.67805487", "0.66992325", "0.6639023", "0.6614938", "0.66114056", "0.66099846", "0.65790766", "0.65495515", "0.6514269", "0.64755434", "0.64610386", "0.6443097", "0.64274544", "0.64151984", "0.63743633", "0.6372989", "0.6368318", "0.6...
0.0
-1
Hat function draw hat after player collects 5 coins
function drawHat() { ctx.strokeStyle = 'yellow'; ctx.strokeRect(player.x, player.y, player.width, player.height / 3); ctx.strokeRect(player.x - 5, player.y + (player.height / 3), player.width + 10, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function punch() {\n if (Player.health <= 0) {\n return;\n }\n Player.health -= 5 - (5 * Player.addMods());\n Player.damageMods();\n document.getElementById(\"armor-message\").innerText = \"\"\n //this is to keep the health bars current\n Player.hits++;\n update();\n}", "DrawBigHat...
[ "0.62147826", "0.61897", "0.61873716", "0.618595", "0.5997745", "0.5980567", "0.595271", "0.5937185", "0.593411", "0.5920241", "0.58959717", "0.5866727", "0.5839585", "0.5822589", "0.57485294", "0.57364106", "0.57320786", "0.573172", "0.5724762", "0.5723642", "0.5715715", "...
0.72705144
0
Animate the player dying
function deathAnimation() { ctx.clearRect(0, 0, gameWidth, gameHeight); // draw enemies ctx.strokeStyle = 'red'; enemies.forEach(enemy => { if (enemy.alive) { ctx.strokeRect(enemy.x + scrollDistance, enemy.y, playerSize, playerSize); } }) // draw platforms ctx.strokeStyle = 'white'; platforms.forEach(pla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "death()\n {\n this.anims.play('death', false);\n //No usamos el this.input.keyboard.shutdown();ya que no nos ejecuta las animaciones de muerte.\n this.playerController.canMove = false;\n }", "dies () {\n this.body.setVelocity(0)\n\n // This isDead flag is to prevent multiple calls(?) for the code b...
[ "0.71688443", "0.7088042", "0.6666413", "0.6436671", "0.63799375", "0.6331505", "0.6284141", "0.62660855", "0.62289804", "0.6197965", "0.618608", "0.61818486", "0.6161637", "0.6154756", "0.61504936", "0.6142651", "0.6107276", "0.60945666", "0.6053774", "0.6053774", "0.6049169...
0.5962884
30
Cancels the task instance. Has no effect if the task instance has already been canceled or has already finished running.
cancel() { if (this.isCanceled || this.isFinished) { return; } if (this._debugCallback) { this._debugCallback({ type: 'cancel', taskInstance: this, task: this.task, }); } let error = new Error("TaskCancelation"); error.name = TASK_CANCELATION_NAME; error.tas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancel() {\n if (this._requestTask && typeof this._requestTask.abort === 'function') {\n this._requestTask.abort();\n }\n\n this._requestTask = null;\n }", "cancelTask (cmdInv) {\n\t\tconst task = this.taskMap[cmdInv.params.taskId];\n\t\tif (task == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst pos = t...
[ "0.72683424", "0.71905655", "0.71310043", "0.701302", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.6966412", "0.69401884", "0.69337153", "0.69337153", "0.6875226", "0.68678135", "0.6857551...
0.80159307
0
1. Get all files in the source directory 2. Filter out files which are audio files 3. Filter out files which have not changed between source and target 4. Process files which are new or changed 5. Remove from target those files which are not in source
function getTargetPathsFor(genre, config, filePath) { //TODO: optimize, using cache if (Array.isArray(genre)) { genre = genre.join('/'); } const splitters = [',', ';', '/']; let genres = []; for (let index = 0; index < splitters.length; index++) { const splitter = splitters[index]; if (genre.ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process(source, destination, callback) {\n /* TODO: plugable file extensions */\n var fileregex = '.+\\.js';\n copytree(source, destination, function(err) {\n if (err) {\n callback(err);\n return;\n }\n fsu.getMatchingFiles(destination, fileregex, true, function(err, files) {\n ...
[ "0.5970337", "0.59681875", "0.58715904", "0.5839145", "0.57641834", "0.57475567", "0.5620138", "0.55969816", "0.5424347", "0.5419115", "0.53989846", "0.53788507", "0.53280747", "0.53230274", "0.5306587", "0.5292922", "0.5279632", "0.5261742", "0.52579844", "0.52403873", "0.52...
0.0
-1
creates a new 'table' with a reservation_id property
async function create(req, res) { const data = await tablesService.create(req.body.data); res.status(201).json({ data }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async create(req, res, next) {\n try {\n let data = checkValidations(req)\n let table = await Table.findOne({where:{id:data.table_id, deleted:false}})\n if(!table){\n return next(apiError(404,\"Table isn't found\"))\n }\n else if(table.av...
[ "0.7050549", "0.67252797", "0.64840627", "0.6304036", "0.62982905", "0.62936324", "0.62643284", "0.61877656", "0.6002285", "0.59823155", "0.5977826", "0.59685624", "0.5933343", "0.5912572", "0.583404", "0.5822989", "0.5816406", "0.58136594", "0.5806101", "0.578756", "0.576892...
0.54332525
62
checks if the table capacity can seat the number of people on the reservation
function tableHasSufficientCapacity(req, res, next) { const { people } = res.locals.reservation; const { capacity } = res.locals.table; if (capacity >= people) return next(); next({ status: 400, message: `Table does not have sufficient capacity.`, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function hasCapacity(req, res, next) {\n const table = res.locals.table;\n const { reservation_id } = req.body.data;\n const reservation = await reservationService.read(reservation_id);\n if (table.capacity >= reservation.people) {\n return next();\n }\n next({\n status: 400,\n message: `This ...
[ "0.76818997", "0.7504367", "0.7316653", "0.6557185", "0.653418", "0.63358134", "0.6275132", "0.6257093", "0.6252842", "0.62049174", "0.62033945", "0.61443007", "0.61134803", "0.610952", "0.60945904", "0.59298295", "0.5875658", "0.58237636", "0.58194923", "0.58084446", "0.5796...
0.7330713
2
Global cookie function set For use with Demo Panel Dropdown Remove for prod package
function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCookie() {\n\t\tvar currentBaseMap = map.baseLayer.name;\n\t\tcookietext = cookiename+\"=\"+currentBaseMap+\"|\"+lastUser+\"|\"+lastCollection;\n\t\tif (expiredays) {\n\t\t var exdate=new Date();\n\t\t exdate.setDate(exdate.getDate()+expiredays);\n\t\t cookietext += \";expires=\"+exdate.toGMTString(...
[ "0.7051703", "0.6876895", "0.6787709", "0.67563725", "0.6697705", "0.66452676", "0.66174525", "0.6584559", "0.6567881", "0.65619403", "0.65606886", "0.65375704", "0.6458725", "0.64397824", "0.6437411", "0.6425435", "0.6406147", "0.63776267", "0.63746846", "0.63677776", "0.636...
0.0
-1
Show active section link in menu move line above active link and change line's width
function addLine () { const linksCoords = this.getBoundingClientRect(); line.style.width = `${linksCoords.width}px`; line.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`; line.style.opacity = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeActive () {\n\tlinks.forEach(link => link.classList.remove('active'));\n\tthis.classList.add('active');\n\tthis.setAttribute('aria-current', 'page');\n\tif (window.innerWidth >= 920) {\n\t\taddLine.call(this);\n\t}\t\n}", "function addActive() {\n sections.forEach(section => {\n const bounding...
[ "0.67231846", "0.6316584", "0.62870866", "0.62331194", "0.62308097", "0.6140974", "0.60959464", "0.59744155", "0.59695846", "0.59619176", "0.59355265", "0.58821285", "0.5875376", "0.5847175", "0.58331674", "0.5827861", "0.58230585", "0.5820025", "0.5816", "0.58151674", "0.580...
0.5562195
45
add active class to current link
function changeActive () { links.forEach(link => link.classList.remove('active')); this.classList.add('active'); this.setAttribute('aria-current', 'page'); if (window.innerWidth >= 920) { addLine.call(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addactiveclass() {\n $(\"nav ul li a\").each(function () {\n var scrollPos = $(document).scrollTop();\n var currLink = $(this);\n var refElement = $(currLink.data(\"scroll\"));\n if (\n refElement.position().top <= scrollPos &&\n refElement.position().top + refElement....
[ "0.8097332", "0.7654432", "0.7645702", "0.7624945", "0.7570665", "0.75292057", "0.7525294", "0.74284774", "0.73721725", "0.73555756", "0.7352963", "0.7264884", "0.7241051", "0.7233236", "0.7226005", "0.72150576", "0.72026813", "0.7151451", "0.71044993", "0.7059007", "0.705839...
0.68874305
27
Object that helps odd calculation
function CityCalc() { // the last is the discard pile this.deck = []; this.cdeck = []; this.Copy = function () { var cc = new CityCalc(); cc.deck = this.deck.slice(); cc.cdeck = this.cdeck.slice(); return cc; }; this.SingleEventOdds = function (event, times) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function impliedOdds (){\r\n}", "get modul(){ return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);}", "sumOfHalvesEqual() {}", "function returnsNonSmi(){ return 0.25; }", "constructor() {\n super();\n this.coeffs = [];\n this.wasOddOnly = null;\n }", "function evenOddSums() {}", "obli...
[ "0.61159086", "0.5912656", "0.57021415", "0.559572", "0.55941254", "0.55578995", "0.5508595", "0.54034966", "0.5372881", "0.53339607", "0.5332871", "0.5282958", "0.5281556", "0.5269809", "0.52615476", "0.52556175", "0.52523106", "0.5239866", "0.5233631", "0.5228773", "0.52274...
0.502886
50
Global state of the game
function State(cities) { // initialization var i, j; this.discard = []; this.deck = [[]]; this.infectCards = 0; this.cities = []; this.playerDeck = []; this.infectRate = [2, 2, 2, 3, 3, 4, 4, 5, 5]; this.isThereEpidemic = true; this.toInfect = 9; for (i = 0; i < cities.length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GameState() {\n}", "function gsINFO(){\r\n gameState= INFO\r\n}", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function gameWinState() {\n crazySpace.update();\n }", "function _makeState ( ...
[ "0.76863664", "0.7440714", "0.71455944", "0.71357507", "0.7049824", "0.7044662", "0.69860846", "0.69397134", "0.6936625", "0.69266", "0.69216746", "0.6907569", "0.6900617", "0.6888113", "0.6871204", "0.6835053", "0.68297493", "0.6797182", "0.6777799", "0.67494124", "0.6748302...
0.0
-1
Initi function for the 'pandemic' angular app data should contain the city cards description in the infection rate
function InitData($scope,data) { $scope.cities = data; // global game state $scope.state = new State($scope.cities); // game state history $scope.hist = []; // if the next clicked city means "epidemic" $scope.epidemic = false; // if the next clicked city means "inoculate" $scope.inoc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize() {\n getData('LionelNanchen');\n getData('onicoleheig');\n getData('wasadigi');\n getData('paulnta');\n getData('edri');\n getData('mraheigvd');\n getData('kamkill01011');\n getData('onicole');\n }", "function init() {\n $scope.countrieObjs = count...
[ "0.60240376", "0.58432335", "0.5817734", "0.57995933", "0.57804716", "0.5769822", "0.57531846", "0.5750836", "0.5709968", "0.56933993", "0.56832063", "0.5668115", "0.56612355", "0.56562287", "0.56506765", "0.56192374", "0.5599528", "0.55980915", "0.55862963", "0.55862963", "0...
0.5599104
17
Has it moved offscreen?
offscreen() { if (this.x < -this.w) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "offscreen() {\n if (this.xpos < -this.width) {\n return true;\n } else {\n return false;\n }\n }", "offscreen() {\n if (this.x < -this.width) {\n return true;\n }\n return false;\n }", "offscreen() {\n if (this.xSky < -this.w) {\n return true;\n } else {\n ...
[ "0.80143493", "0.7787646", "0.7619672", "0.7553372", "0.74152184", "0.70837677", "0.70175225", "0.69432116", "0.6752019", "0.674231", "0.6667834", "0.65503883", "0.6370137", "0.6345575", "0.6328268", "0.6326275", "0.63065284", "0.6298883", "0.62849444", "0.626135", "0.6219728...
0.7936811
1
Create a function that configures a new constraint.
function addConstraint(name, image, defaultValue) { panel.add(ui.Label('Filter by ' + name + ':')); var subpanel = ui.Panel({layout: ui.Panel.Layout.flow('horizontal')}); // Create a greater-than / less-than selector. var mode = ui.Select({ items: [GREATER_THAN, LESS_THAN], value: GREATER_THAN, onCh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constraint(/*config*/) {\n\tConstraint.superclass.constructor.apply(this, arguments);\n}", "setConstraintFactory(fn) {\n\t\tthis.#fc = fn;\n\t}", "installConstraint(el, constraintFn, priority = DEFAULT_PRIORITY) {\n if (!el.manipulatorConstraints) el.manipulatorConstraints = new Map()\n let prio...
[ "0.6421722", "0.6404406", "0.62089807", "0.59188515", "0.5808644", "0.5794619", "0.57231027", "0.5561391", "0.5452925", "0.54379404", "0.527501", "0.5237599", "0.51957", "0.51622856", "0.514976", "0.5108148", "0.5067002", "0.50566477", "0.50482523", "0.4990498", "0.49653113",...
0.4999704
19
Create a function that adds a constraint of the requested type.
function selectConstraint(name) { if (name == POPULATION) { addConstraint(name, pop, 50); } else if (name == ELEVATION) { addConstraint(name, elevation, 100); } else if (name == SLOPE) { addConstraint(name, slope, 3); } constraint.setValue(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "installConstraint(el, constraintFn, priority = DEFAULT_PRIORITY) {\n if (!el.manipulatorConstraints) el.manipulatorConstraints = new Map()\n let priorityList = el.manipulatorConstraints.get(priority)\n if (!priorityList) {\n priorityList = []\n el.manipulatorConstraints.set(priority, priorityLis...
[ "0.5856675", "0.5393813", "0.533627", "0.5171314", "0.50843626", "0.5083694", "0.49835166", "0.49756178", "0.49698666", "0.48885208", "0.4878173", "0.4826452", "0.4766213", "0.4766213", "0.47291324", "0.47168842", "0.47146717", "0.47046545", "0.47044268", "0.4665262", "0.4636...
0.0
-1
Create a function to render a map layer configured by the user inputs.
function redraw() { map.layers().reset(); var layer = select.getValue(); var image; if (layer == ELEVATION) { image = elevationVis; } else if (layer == SLOPE) { image = slopeVis; } else if (layer == POPULATION) { image = popVis; } for (var i = 0; i < constraints.length; ++i) { var constr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (map...
[ "0.60860026", "0.60849917", "0.59890544", "0.5982579", "0.59591025", "0.58958143", "0.589542", "0.5894468", "0.5865776", "0.5846159", "0.5831818", "0.578465", "0.57732445", "0.57652736", "0.57502717", "0.5732524", "0.57216275", "0.5715754", "0.57121015", "0.5709518", "0.57033...
0.0
-1
Repeat string n times
function repeat(str, n){ var result = ''; str = toString(str); n = toInt(n); if (n < 1) { return ''; } while (n > 0) { if (n % 2) { result += str; } n = Math.floor(n / 2); str += str; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeatStringNTimes(string, repCount) {\n let result = string.repeat(repCount);\n console.log(result);\n}", "function repeatStr (n, s) {\n //input is a string\n // output string n times\n let repeat = s.repeat(n)\n return repeat;\n }", "function repeatNtimes(str, num) {\n\t//code her...
[ "0.8751014", "0.86990994", "0.8665446", "0.86611784", "0.8618826", "0.8593952", "0.8585394", "0.8533833", "0.8529687", "0.8524021", "0.8524021", "0.8524021", "0.85159117", "0.84957784", "0.84677166", "0.84542114", "0.84262925", "0.84261984", "0.8357186", "0.8308674", "0.83062...
0.8227939
26
"Convert" value into an 32bit integer.
function toInt(val){ // doesn't break the functionality return ~~val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ToInt32(v) { return v >> 0; }", "function int32(x) {\n return x | 0;\n }", "function fourCCToInt32(value) {\n return value.charCodeAt(0) +\n (value.charCodeAt(1) << 8) +\n (value.charCodeAt(2) << 16) +\n (value.charCodeAt(3) << 24);\n}", "function convToUInt32(value...
[ "0.8060195", "0.76082623", "0.7399437", "0.73147225", "0.7283392", "0.70803005", "0.69334203", "0.6869962", "0.68659526", "0.68428516", "0.6758224", "0.6748928", "0.67189753", "0.67146164", "0.67146164", "0.67146164", "0.6613276", "0.6613276", "0.6613276", "0.6613276", "0.661...
0.6223942
80
Called when a map tile is clicked.
function mapTile(x, y) { whichButton = "mapTile-" + x + "-" + y if (gameData.diseaseControlFinished == 0) { if (gameData.diseaseArray[x][y] == 0 && gameData.civiliansPlaced < gameData.civiliansTotal) { gameData.diseaseArray[x][y] = 1 gameData.civiliansPlaced += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tileClick() {\n\tmoveOneTile(this);\n}", "_onMapClicked() {\n if(this._listener) {\n this._listener.mapClicked();\n }\n }", "function click_tile_callback(tile_info){\n console.log('tile callback');\n console.log('clicking on ' + tile_info.row + ' row and ' + tile_...
[ "0.788792", "0.7348572", "0.73484004", "0.72410446", "0.7238833", "0.7199716", "0.71432704", "0.71432704", "0.69726574", "0.69522905", "0.69394916", "0.6921228", "0.6915752", "0.6859353", "0.6855075", "0.68318176", "0.6772649", "0.675805", "0.672465", "0.6714866", "0.6667895"...
0.61479
47
Returns an HTTP request object
function getRequestObject() { if (window.XMLHttpRequest) { return (new XMLHttpRequest()); } else if (window.ActiveXObject) { // For very old IE browsers (optional) return (new ActiveXObject("Microsoft.XMLHTTP")); } else { global.alert("Ajax is not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRequestObject() {\n \n httpRequest = new XMLHttpRequest();\n return httpRequest;\n}", "static request(method, url, config = {}) {\n return Request.make(method, url, config);\n }", "function getRequestObject() {\n if (window.XMLHttpRequest) {\n return(new XMLHttpRequest());\n ...
[ "0.74727315", "0.742109", "0.72862583", "0.71857244", "0.7156858", "0.7150643", "0.7148356", "0.71234494", "0.71139634", "0.7101872", "0.7077365", "0.70451653", "0.7020686", "0.70193213", "0.69816357", "0.6976457", "0.69688827", "0.6952332", "0.6936997", "0.69094414", "0.6886...
0.7158813
4
Only calls user provided 'responseHandler' function if response is ready and not an error
function handleResponse(request, responseHandler, isJsonResponse) { if ((request.readyState == 4) && (request.status == 200)) { // Default to isJsonResponse = true if (isJsonResponse == undefined) { isJsonResponse = true; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleResponse(request,\n responseHandler) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n responseHandler(request);\n }\n}", "function handleResponse(request,\n responseHandler) {\n if ((request.readyState == 4) &&\n (reque...
[ "0.7506077", "0.7506077", "0.697535", "0.6954118", "0.6917737", "0.6867439", "0.67752117", "0.6691067", "0.65356153", "0.6533345", "0.6500958", "0.64395624", "0.6263676", "0.62281317", "0.62277514", "0.62204146", "0.6217472", "0.6209075", "0.61942124", "0.6151647", "0.6145762...
0.6684593
8
ExpandContent for DIV Menus
function expandContent(menuoption) { var obj = document.getElementById (menuoption) obj.style.display = 'block'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "expandMenu() {\r\n\t}", "function expand() {\n const showContent = document.getElementById(this.dataset.target)\n //Er wordt in de HTML gekeken voor een id dataset.target\n\n if (showContent.classList.contains('expand-active')) {\n this.innerHTML=this.dataset.showtext\n } \...
[ "0.7375576", "0.70066124", "0.698265", "0.6672012", "0.6505645", "0.64622694", "0.6444715", "0.6407044", "0.6405768", "0.64030707", "0.6386054", "0.63772327", "0.6355773", "0.6353538", "0.63455296", "0.63444746", "0.6308102", "0.6307317", "0.6303675", "0.6302161", "0.62766767...
0.7212491
1
Collapse Contest for DIV Menus
function collapseContent(menuoption) { var obj = document.getElementById (menuoption) obj.style.display = 'none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collapseMenu() {\r\n\t}", "collapseButtonClickCallback() {\n let activeSpans = document.getElementsByClassName('folder-down');\n while(activeSpans.length > 0) {\n activeSpans[0].classList.remove('folder-down');\n }\n let openNests = document.getElementsByClassName('nested a...
[ "0.7080714", "0.6868141", "0.6805386", "0.6693148", "0.66574866", "0.66053617", "0.6597624", "0.659711", "0.6551155", "0.65354735", "0.65312165", "0.64979094", "0.64822024", "0.6458217", "0.64518094", "0.6451091", "0.6432129", "0.6414689", "0.64133143", "0.6410527", "0.640456...
0.62957275
26
color_g, color_r, color_b, summary, start, end, allDay, calendar, location
function updateCalendar(calendar){ var pluginKey = "calendar"; var newItems = false; var previous = calendarDIV.data("previous"); if(!calendar || !calendar.events){ if(previous){ calendar = previous; }else{ return false; } } else { newItems = gotNewItems(calendar.events, previous ? previous.events ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDemoEvents() {\n // Date for the calendar events (dummy data)\n var date = new Date();\n var d = date.getDate(),\n m = date.getMonth(),\n y = date.getFullYear();\n\n return [\n {\n title: 'All Day Event',\n start: new Date(y, ...
[ "0.6390983", "0.61031795", "0.60584265", "0.6055615", "0.58434576", "0.5805672", "0.58004254", "0.5791361", "0.57661915", "0.5762901", "0.56932575", "0.56593746", "0.56054443", "0.55892175", "0.5529121", "0.54964", "0.54161316", "0.5382905", "0.5333906", "0.5327548", "0.53198...
0.0
-1
given arr & target, find which two out of the array add up to the target
function checkTarget(arr, targ){ let box = {} arr.forEach((x, index)=>{ box[x] = index }) // hash of numbers and their indexes for(let i =0; i<arr.length;i++){ let currentDifference = targ - arr[i] if(box[currentDifference]){ return [box[currentDifference], i] }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function targetSum(arr, sumTarget){\n \n}", "function twoSum(arr, target) {\n for (let outerIdx = 0; outerIdx < arr.length; outerIdx += 1) {\n for (let innerIdx = outerIdx + 1; innerIdx < arr.length; innerIdx += 1) {\n if (arr[outerIdx] + arr[innerIdx] === target) return [outerIdx, innerIdx];\n }\...
[ "0.80485344", "0.78003675", "0.77718365", "0.7770395", "0.7676772", "0.7663702", "0.7650768", "0.7630632", "0.7562384", "0.7540225", "0.7466338", "0.7440909", "0.7437598", "0.74356574", "0.74272054", "0.7421553", "0.7396255", "0.73385763", "0.732706", "0.73186827", "0.7303943...
0.68230337
52
3 PIPELINE process block
function createOrderedList(link) { return link.index+'. '+link.url }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(state, next){\n const pipeline = state.pipelineHandler;\n if(state.lastCode !== 0){\n const process = pipeline.clone({process: state.config.lastFailed});\n return process.execute(state, next);\n }\n const process = pipeline.clone({process: state.config.lastSucceeded});\n return pro...
[ "0.5828832", "0.57156533", "0.56376374", "0.56376374", "0.5559947", "0.55001575", "0.5442648", "0.543383", "0.54123944", "0.54019326", "0.538289", "0.5337005", "0.53107005", "0.52635443", "0.5259346", "0.5201408", "0.5191423", "0.51750624", "0.5162315", "0.5148406", "0.512430...
0.0
-1
1 PIPELINE init book
function filterPages(page) { return page !== undefined }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstLoadInitialize(){\r\n addBookToLibrary(\"1984\", \"George Orwell\", 328, true);\r\n addBookToLibrary(\"Fahrenheit 451\", \"Ray Bradbury\", 256, true);\r\n addBookToLibrary(\"Dune\", \"Frank Herbert\", 412, true);\r\n addBookToLibrary(\"War and Peace\", \"Leo Tolstoy\", 1225, false);\r\n}"...
[ "0.6626952", "0.6180493", "0.6161261", "0.6135416", "0.6123334", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "...
0.0
-1
1 PIPELINE init book
function getLinks(file) { var page = this.getPageByPath(file), links = getPageLinks(page) if(!links.length) return return { title: page.title, level: page.level, links: links } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstLoadInitialize(){\r\n addBookToLibrary(\"1984\", \"George Orwell\", 328, true);\r\n addBookToLibrary(\"Fahrenheit 451\", \"Ray Bradbury\", 256, true);\r\n addBookToLibrary(\"Dune\", \"Frank Herbert\", 412, true);\r\n addBookToLibrary(\"War and Peace\", \"Leo Tolstoy\", 1225, false);\r\n}"...
[ "0.6626952", "0.6180493", "0.6161261", "0.6135416", "0.6123334", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "...
0.0
-1
1 PIPELINE init book
function setPages(pageLinks) { pages = pageLinks.filter(filterPages).sort(sortPages) // Check duplicated links pages.forEach(function(page) { page.links.forEach(function(link) { var url = link.url var level = this[url] if(level) return console.warn(url,'from',page.level,'alr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstLoadInitialize(){\r\n addBookToLibrary(\"1984\", \"George Orwell\", 328, true);\r\n addBookToLibrary(\"Fahrenheit 451\", \"Ray Bradbury\", 256, true);\r\n addBookToLibrary(\"Dune\", \"Frank Herbert\", 412, true);\r\n addBookToLibrary(\"War and Peace\", \"Leo Tolstoy\", 1225, false);\r\n}"...
[ "0.6626952", "0.6180493", "0.6161261", "0.6135416", "0.6123334", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "...
0.0
-1
1 PIPELINE init book
function sortPages(a, b) { a = a.level.split('.') b = b.level.split('.') while(a[0] != null && b[0] != null) { var result = a.shift() - b.shift() if(result) return result } return a.length - b.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstLoadInitialize(){\r\n addBookToLibrary(\"1984\", \"George Orwell\", 328, true);\r\n addBookToLibrary(\"Fahrenheit 451\", \"Ray Bradbury\", 256, true);\r\n addBookToLibrary(\"Dune\", \"Frank Herbert\", 412, true);\r\n addBookToLibrary(\"War and Peace\", \"Leo Tolstoy\", 1225, false);\r\n}"...
[ "0.6626952", "0.6180493", "0.6161261", "0.6135416", "0.6123334", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.61149025", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "0.60430294", "...
0.0
-1
Public API / 1 PIPELINE init book
function init() { if(!externalLinksAreReferences(this)) return if(this.output.name !== 'ebook') return var pageLinks = Object.keys(this.navigation).map(getLinks, this) return setPages(pageLinks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstLoadInitialize(){\r\n addBookToLibrary(\"1984\", \"George Orwell\", 328, true);\r\n addBookToLibrary(\"Fahrenheit 451\", \"Ray Bradbury\", 256, true);\r\n addBookToLibrary(\"Dune\", \"Frank Herbert\", 412, true);\r\n addBookToLibrary(\"War and Peace\", \"Leo Tolstoy\", 1225, false);\r\n}"...
[ "0.69322705", "0.65834135", "0.64823496", "0.6396341", "0.63728046", "0.61907727", "0.6178028", "0.6171674", "0.61629283", "0.6155826", "0.6110839", "0.6109713", "0.60913295", "0.60876614", "0.60481864", "0.60329235", "0.60199976", "0.59814376", "0.59766114", "0.5970691", "0....
0.0
-1
3 PIPELINE process block
function processBlock(block) { var listOfReferences = pages.map(createPageReferences).join('\n\n') return this.renderBlock('markdown', block.body+'\n\n'+listOfReferences) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(state, next){\n const pipeline = state.pipelineHandler;\n if(state.lastCode !== 0){\n const process = pipeline.clone({process: state.config.lastFailed});\n return process.execute(state, next);\n }\n const process = pipeline.clone({process: state.config.lastSucceeded});\n return pro...
[ "0.5828832", "0.57156533", "0.56376374", "0.56376374", "0.5559947", "0.55001575", "0.5442648", "0.543383", "0.54123944", "0.54019326", "0.538289", "0.5337005", "0.53107005", "0.52635443", "0.5259346", "0.5201408", "0.5191423", "0.51750624", "0.5162315", "0.5148406", "0.512430...
0.0
-1
Loads a single item from database by ID and pass it to the callback function
findById(id, cb) { this.db.get(id, { revs_info: false}, (err, itemBody) => { if (err) { return cb('Item findById: Error loading item with ID: ' + id + "\n" + err, null) } return cb(null, itemBody) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchItem(id, callback) {\n\t\tvar item = checkStorage('fetchItem_' + id, 'en');\n\t\t\n\t\tif (item) {\n\t\t\tconsole.log('fetchItem ' + id + ': fetched from local storage');\n\t\t\twindow.setTimeout(function() { callback(item); }, 0);\n\t\t} else {\n\t\t\t$.ajax(API_ITEM_DETAILS, {\n\t\t\t\tdataType: 'j...
[ "0.7593039", "0.70884204", "0.688661", "0.67929167", "0.66711444", "0.66109276", "0.66076005", "0.6536734", "0.65261716", "0.65252733", "0.65129733", "0.65105605", "0.6474619", "0.6466674", "0.64245826", "0.6414249", "0.64086396", "0.63976246", "0.6393348", "0.6391711", "0.63...
0.682719
3
Loads a single item from the database by name and pass it to the callback function WARNING: if multiple items are found with the same name, only the first will be selected
findByName(name, cb) { this.db.view('item', 'by_name', {key: name}, (err, itemByName) => { if (err) { console.error(err) return cb(err, null) } if (itemByName.rows.length > 0) { return this.foundItem(itemByName, name, cb) } else { return cb(null, null) // No item found } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findOne(groceryListId, itemName, callback) {\n GroceryItem.findOne({where: {groceryListID: groceryListId, name: itemName}})\n .then((item) => {\n callback(null, item);\n })\n .catch((err) => {\n callback(err);\n })\n }", "fetchByName(name) {\n // Nam...
[ "0.6799729", "0.64783674", "0.64468503", "0.63077736", "0.6224667", "0.6213317", "0.61973", "0.6118937", "0.61102456", "0.60231704", "0.59419256", "0.58941525", "0.58734757", "0.5870765", "0.5865943", "0.5841275", "0.58331746", "0.57647", "0.5761815", "0.57613885", "0.5736840...
0.68595445
0
related record is only passed when we have a multiselect option
_viewRelationship(field, relatedRecord){ let selectionEvent = new CustomEvent('relationship-view-requested', { detail: {field: field, documentId: relatedRecord}, bubbles: true }); this.dispatchEvent(selectionEvent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleOnSelect(event) {\n let slectedRecord = event.detail;\n console.log(JSON.stringify(slectedRecord));\n if(slectedRecord.recordId !== '' && slectedRecord.recordId !== null && slectedRecord.recordId !== undefined){\n this.requestedId = slectedRecord.recordId;\n this.is...
[ "0.5899916", "0.5846515", "0.5846515", "0.5846515", "0.57865393", "0.57528234", "0.5621973", "0.55913717", "0.55600053", "0.5543493", "0.5541968", "0.5537133", "0.5519126", "0.55089074", "0.5500035", "0.5449694", "0.54220176", "0.5416986", "0.54167426", "0.5391861", "0.538796...
0.0
-1
________________ Requests handler Create an https request given specific parameters
function httpsRequest(params, postData) { // Use promise to asynchronously receive response return new Promise(function (resolve, reject) { // Create https request var req = https.request(params, function (res) { // Return no result on error code if (res.statusCode < 20...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeRequest(method, resource, params, callback) { console.log(params)\n if (typeof(method) === 'undefined') { \n method = \"GET\";\n resource += '/?' + params;\n }\n const ascendant = this;\n let requestID = uuid()\n var req = https.request({ \n h...
[ "0.6520724", "0.6443841", "0.62387115", "0.597606", "0.5903743", "0.5900377", "0.57946104", "0.5781549", "0.5781001", "0.5760421", "0.57424957", "0.5714324", "0.57069683", "0.5685029", "0.56841904", "0.5653081", "0.5622275", "0.5603454", "0.56031376", "0.5593985", "0.55899334...
0.6548121
0
TODO : Scroll horizontally in planner proper and adding/deleting days.
function populateEverything(allAttractions,distanceArray) { $("#container").empty(); for(var oneDay in allAttractions) { // Assuming one lunch and one tea break everyday. var lunchTaken = false; var teaTaken = false; var lunchbreak = document.createElement("i"); // $(lun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_navigateDays(event) {\n const that = this;\n let iterations = event.key === 'ArrowUp' || event.key === 'ArrowDown' ? 7 : 1,\n coefficient = event.key === 'ArrowUp' || event.key === 'ArrowLeft' || event.key === 'PageUp' ? -1 : 1;\n\n switch (event.key) {\n case 'ArrowUp':...
[ "0.63801944", "0.61956453", "0.6178723", "0.6085493", "0.6016312", "0.60039103", "0.59977806", "0.599481", "0.59492207", "0.59490985", "0.5948915", "0.59410185", "0.59193635", "0.59192103", "0.5894953", "0.5853769", "0.583599", "0.5804675", "0.57935673", "0.57902056", "0.5778...
0.0
-1
NB! Forutsetter at shaderne finnes i .html fila:
init(vertexShaderName, fragmentShaderName, textureName1) { let vertexShaderSource = document.getElementById(vertexShaderName).innerHTML; let fragmentShaderSource = document.getElementById(fragmentShaderName).innerHTML; this.shaderProgram = createProgram(this.gl, vertexShaderSource, fragmentShade...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fs() {\n return \"\\n precision highp float;\\n uniform sampler2D uSampler;\\n varying vec4 vColor;\\n varying vec2 vTexCoord;\\n void main(void) {\\n vec4 color = texture2D( uSampler, vec2( vTexCoord.s, vTexCoord.t ) ) * vec4( vColor.rgb, 1.0 );\\n \\tif ( color.a < 0.1 ) discard;\\n \\tgl_Fra...
[ "0.66653925", "0.62847334", "0.6173519", "0.6123478", "0.6101246", "0.60697466", "0.6049308", "0.60419464", "0.6025314", "0.5971909", "0.59601414", "0.5958931", "0.59554595", "0.59342057", "0.5926584", "0.59168476", "0.5910706", "0.5910486", "0.59094805", "0.5901966", "0.5898...
0.5771227
43
Helper function for creating graphs
function createGraph(canvasID, labels, unit, labelDivID, intervalSize, maxVal, vlines=false, timestamps=false, scalesteps=5, linecolor="#f0e68c") { /* Create valueIDs for each label */ valueIDs = [] for(var i = 0; i < labels.length; i++) { valueIDs[i] = canvasID + labels[i].replace(" ", "") + "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGraph()\n\t{\n\t\tgraph = that.add('graph', {\n\t\t\tw: that.size,\n\t\t\th: that.size,\n\t\t\tinputCount: that.inputCount,\n\t\t\teq: [{eq:that.eq.eq, color: style.eqColor}],\n\t\t\txRange: that.axis.x,\n\t\t\tyRange: that.axis.y,\n\t\t\tlabelSkip: that.axis.skip,\n\t\t\tusePiLabels: that.axis.useP...
[ "0.76116437", "0.70367455", "0.6937538", "0.6933181", "0.69201124", "0.67951894", "0.66681784", "0.6648734", "0.6611266", "0.65688807", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544", "0.6550544...
0.6595624
9
Helper function to take a value value and return ycoordinate for the canvas
function scaleInvert(value, maxVal, height) { return (1 - value/maxVal) * height; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getYForValue(val) {\n var h = rotated ? width : height;\n\n return h - (h * ((val - range[0]) / (range[1] - range[0])));\n }", "function getYPixel(val) {\n return can.height() - (((can.height() - yPadding) / getMaxY()) * val) - yPadding;\n }", "function getYPixel(val) {\n return ca...
[ "0.7631919", "0.7587208", "0.75385016", "0.74360234", "0.74016035", "0.7313644", "0.7077747", "0.6866319", "0.6716748", "0.6672819", "0.6646627", "0.6611417", "0.6604318", "0.6542675", "0.6540159", "0.6530196", "0.64956623", "0.6488529", "0.6461344", "0.64387083", "0.64356387...
0.0
-1
Helper function that shifts the contents of row to left
function shiftArrayRowLeft(array, row, ncols, newVal) { for(var i = 0; i < ncols-1; i++) { array[row][i] = array[row][i+1]; } array[row][ncols-1] = newVal; return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unshift(row) {\n while (row.length != 4) {\n row.unshift(0)\n }\n return row;\n}", "shiftLeft() {\n for (let line of this.cells) {\n for (let i = 0; i < line.length - 1; i++) {\n line[i].setType(line[i + 1].type);\n }\n line[line.length - 1].s...
[ "0.7587149", "0.69083095", "0.6811837", "0.6686887", "0.6569335", "0.64312047", "0.6376921", "0.63392", "0.6336792", "0.6328544", "0.63206774", "0.62982315", "0.62647945", "0.62631077", "0.6248961", "0.6243158", "0.621351", "0.6211944", "0.6196934", "0.61653113", "0.6155745",...
0.7468042
1
Helper function to create an empty
function emptyArray(nrows, ncols, fill=0) { var arr = []; for(var i = 0; i < nrows; i++) { arr[i] = []; for(var j = 0; j < ncols; j++) { arr[i][j] = fill; } } return arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeEmptyObject() {\n return new Object();\n}", "@action(\"create <List>\", { types: [ List ], returns: List })\n\tstatic create_empty(list) {\n\t\tif (!(list instanceof List)) return false\n\t\treturn new (list.constructor)()\n\t}", "function empty() {\n\treturn Object.create(null);\n}", "functi...
[ "0.75201815", "0.69787747", "0.6905171", "0.68890643", "0.68890643", "0.68890643", "0.68226534", "0.68226534", "0.68226534", "0.68226534", "0.68226534", "0.67835325", "0.67835325", "0.67835325", "0.67835325", "0.67835325", "0.67835325", "0.67835325", "0.67835325", "0.67835325",...
0.0
-1
Helper function to create array of colors
function colorArray(len) { var colorArray = []; for(var i = 0; i < len; i++) { colorArray[i] = colors[i%colors.length]; } return colorArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createColorArray (int) {\n\tCOLORS = [];\n\tlet xCOLORS = [];\n\tif (int === 10) {\n\t\tCOLORS = [ 'red', 'red', 'blue', 'blue', 'limegreen', 'limegreen', 'yellow', 'yellow', 'purple', 'purple' ];\n\t}\n\tif (int === 20) {\n\t\tCOLORS = [\n\t\t\t'red',\n\t\t\t'red',\n\t\t\t'blue',\n\t\t\t'blue',\n\t\t\t'l...
[ "0.8074848", "0.805152", "0.7898489", "0.78670865", "0.7830867", "0.7829569", "0.767229", "0.7657671", "0.7657163", "0.76464546", "0.7641949", "0.7574949", "0.7544288", "0.75143754", "0.74607396", "0.74583626", "0.74328816", "0.7430286", "0.7415901", "0.72922385", "0.72919744...
0.7605743
11
notes: local storage total = of sets to do, NEVER changes count starts at total and goes towards 0
function getInfo() { var core = document.getElementById("core").checked; var cardio = document.getElementById("cardio").checked; var arms = document.getElementById("arms").checked; var legs = document.getElementById("legs").checked; var back = document.getElementById("back").checked; var map = {}; map["core"] = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count_sets(arr, total){\n\n\n}", "addTotalFetched() { this.totalFetched.value++; this.updateStatNav(this.totalFetched); }", "static setsIndexTotalPlusOne() {\n let total = this.getIndexTotal();\n total += 1;\n localStorage.setItem('index', JSON.stringify(total));\n }", "getNumberOfSets() {...
[ "0.67992353", "0.6379278", "0.6314089", "0.6218707", "0.59298766", "0.5899417", "0.5886073", "0.5858979", "0.5794111", "0.5790489", "0.57660645", "0.57603633", "0.57376814", "0.5708017", "0.5699633", "0.5691814", "0.568924", "0.56657946", "0.5646376", "0.5640454", "0.5632124"...
0.0
-1
gets a random workout from list
function getWorkout() { var list = JSON.parse(localStorage.exercises); // parsed list of exercises var index = (localStorage.total - count) % list.length; var workoutType = list[index]; // current exercise type var ex = Workout.instances[workoutType]; // list of corresponding exercises return ex[getRandomInt(0, ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickRandomFrom(list) {\n return list[Math.floor(Math.random()*list.length)];\n}", "function random(list) {\n var index = Math.ceil( Math.random() * 10 );\n var mot = list[index];\n return mot;\n }", "function getRandom(list) {\n return list[Math.floor(Math.random() * list.len...
[ "0.6838863", "0.679449", "0.6558142", "0.64515924", "0.64378977", "0.64367837", "0.64083725", "0.6394925", "0.637488", "0.63599676", "0.6329205", "0.6319993", "0.6315042", "0.62450963", "0.6238548", "0.6231999", "0.61876917", "0.6163358", "0.61410964", "0.6128327", "0.6119499...
0.690027
0
Valida los campos seleccionado
function validaFormulario() { var valor = 1; var forms = document.querySelectorAll('.needs-validation'); Array.prototype.slice.call(forms).forEach(function (form) { if (!form.checkValidity()) { form.classList.add('was-validated'); valor = 0; } }); return valor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validaCampoVacio(Nombre, _G_ID_) {\n /* Es de tipo select */\n if ($(_G_ID_ + '_txt_' + Nombre).is('select')) {\n if ($(_G_ID_ + '_txt_' + Nombre).val() == -1) {\n redLabel_Space(Nombre, 'Este campo es obligatorio', _G_ID_);\n ShowAlertM(_G_ID_, null, null, true);\n ...
[ "0.6782011", "0.67678493", "0.66979456", "0.6697769", "0.66760397", "0.66573894", "0.66218084", "0.661511", "0.6605002", "0.6603758", "0.65823025", "0.6571537", "0.6566598", "0.65541136", "0.65312177", "0.65312177", "0.6499037", "0.6488136", "0.64237773", "0.64028996", "0.640...
0.0
-1
Limpia datos en modal
function LimpiaModal() { $('#NomPuesto').val(''); $('#IdPuesto').val(''); $('#DesPuesto').val(''); $('#titulo').text('Nuevo Puesto'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modalCreate() {\n id = null\n // limpiamos el div q contiene la imagen\n $(\"#image\").empty();\n $(\"#imagen\").val('');\n document.getElementById('titulo').value = \"\"\n document.getElementById('categorias').value = \"\"\n document.getElementById('descripcion').value = \"\"\n do...
[ "0.69948673", "0.6976813", "0.6949943", "0.68878204", "0.686059", "0.68581635", "0.68369687", "0.6784433", "0.6717998", "0.66763043", "0.66756964", "0.6633653", "0.663262", "0.662287", "0.6574505", "0.6571421", "0.6557065", "0.6546834", "0.65373677", "0.65318763", "0.6503769"...
0.74605936
0
obtiene la informacion de tabla Proveedores
function getPuestoTable() { var location = 'Puestos/GetPuestos'; $('#PuestoTable').DataTable().destroy(); $('#tablaPuestoRow').html(''); $.ajax({ type: 'POST', dataType: 'JSON', url: location, _success: function (respuesta) { var renglon = ''; res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostrarProveedor(req, res) {\n var id = req.params.id;\n var pro = Proveedor.find();\n if (id) pro = Proveedor.findById(id);\n pro.populate('fk_usuario prov_modificado').exec((error, response) => {\n if (error)\n return res.status(500).send({ Message: 'Error al ejectuar la pe...
[ "0.6511435", "0.64451617", "0.6396753", "0.6009358", "0.5854242", "0.58500224", "0.58411443", "0.5833691", "0.58325297", "0.5830151", "0.5807796", "0.57983613", "0.57715404", "0.5730427", "0.5705153", "0.57007104", "0.5692549", "0.56878245", "0.5686602", "0.56822044", "0.5664...
0.56549513
23
Firebase Config Module //
function firebaseConfigModule(firebase){ //firebase cfg const config = { apiKey: "AIzaSyC0G_puVkQgwqL1wICl4TuQigccVJ2u7xw", authDomain: "scakapo-2f1c6.firebaseapp.com", databaseURL: "https://scakapo-2f1c6.firebaseio.com", storageBucket: "scakapo-2f1c6.appspot.com", messa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getConfig() {\n return {\n apiKey: Firebase.apiKey,\n appId: Firebase.appId,\n authDomain: Firebase.authDomain,\n databaseURL: Firebase.databaseURL,\n projectId: Firebase.projectId,\n messagingSenderId: Firebase.messagingSenderId,\n };\n }", "function FirebaseConfig(ur...
[ "0.7896601", "0.7291999", "0.7167828", "0.69992495", "0.6901818", "0.68741053", "0.6713611", "0.6638668", "0.6588836", "0.6560403", "0.6560403", "0.6534546", "0.64675665", "0.6467223", "0.6435635", "0.64318156", "0.6388193", "0.6328451", "0.632232", "0.62971455", "0.62804615"...
0.85226953
0