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
se inyecta el service userService en el controlador para que se tenga acceso
function userController(userService){ //binding del controlador con el html, solo en el controlador var vm = this; vm.btnadd = true; vm.btnedit = false; vm.getUsers ={}; vm.btnadd = true; vm.btnedit = false; loadUsers(); function loadUsers(){ userService.getUsers().then(fun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor( userService ) {\n\n\t\tthis._userService = userService;\n\n\t}", "constructor(userService) {\n this.userService = userService;\n }", "function UserService(){\n this._user = null;\n this._teamMembers = null;\n this._teamMemberHash = null;\n this._myChannels =...
[ "0.6931614", "0.6865851", "0.6809308", "0.6574526", "0.63400227", "0.6241768", "0.62259805", "0.61825377", "0.617396", "0.6089219", "0.6063498", "0.6060974", "0.59906185", "0.59853965", "0.5963784", "0.5960602", "0.5955993", "0.5848781", "0.5842202", "0.5836052", "0.5833177",...
0.0
-1
PATH FINDING SOLUTION UTILITY FUNCTIONS
function isSafe(x, y) { if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w')) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_path(path) {\n gdir.forEach(it =>{\n if (it.path == path) return it;\n })\n}", "resolveAsPath() { }", "function search_paths(thing_to_find, explicit_path, env_name)\n{\n\tvar i, found = false, place = false, file, env;\n\n\tSTDOUT.Write(\"Checking for \" + thing_to_find + \" ... \");\n\n\tth...
[ "0.678875", "0.66475016", "0.6599981", "0.6467697", "0.6325281", "0.6325281", "0.6325281", "0.63150996", "0.63035446", "0.63035446", "0.63035446", "0.63035446", "0.63035446", "0.62470496", "0.6227704", "0.61758745", "0.6175053", "0.6175053", "0.6175053", "0.6175053", "0.61750...
0.0
-1
populates the list of selectable pages, binds left and right arrow keys
function setupNav() { setupPageSelector(); setupRecipeSelector(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_pageDownKeyHandler(items) {\n const that = this;\n\n if (items.length === 0) {\n return;\n }\n\n let selectedItem = that._items[that.selectedIndexes[that.selectedIndexes.length - 1]];\n if (that.selectionMode === 'checkBox' || that.selectionMode === 'radioButton' || t...
[ "0.62902904", "0.5980301", "0.5952238", "0.59236085", "0.59136075", "0.5893289", "0.5869571", "0.5727391", "0.5709156", "0.56394076", "0.563156", "0.5612666", "0.5563152", "0.5561742", "0.5559075", "0.55450535", "0.5539738", "0.5535373", "0.5534586", "0.5516891", "0.5491114",...
0.0
-1
updates the image when the new page is selected
function goToPage() { var index = document.getElementById("page-select").value; setPage(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changePic() {\n\t\t\t\tif (active[0].complete) {\n\t\t\t\t\tgo();\n\t\t\t\t} else {\n\t\t\t\t\tactive.load(go);\n\t\t\t\t}\n\n\t\t\t\tfunction go() {\n\t\t\t\t\tvar l = active.offset().left - pc.offset().left - (w - active.width())/2;\n\n\t\t\t\t\tpics.removeClass('active');\n\t\t\t\t\tactive.addClass('ac...
[ "0.6561474", "0.65164953", "0.6236665", "0.62253636", "0.6218048", "0.6192383", "0.6180553", "0.6156408", "0.6141292", "0.6119783", "0.61119276", "0.61114395", "0.60984164", "0.60976243", "0.6081594", "0.6041386", "0.60325146", "0.6027812", "0.6023694", "0.6009566", "0.600486...
0.0
-1
moves to the next page
function nextPage() { var pageSelector = document.getElementById("page-select"); if (pageSelector.value < MAX_PAGE) { pageSelector.value++; goToPage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextPage(){\n if (page > 0)\n {\n setPage( page +1);\n }\n }", "function goToNextPage() {\n\t\tif ( canNextPage() ) {\n\t\t\tgoToPage( currentPage() + 1 );\n\t\t}\n\t}", "function goToNextPage() {\n updateCurrentPage((page) => page + 1);\n }", "function m...
[ "0.8286269", "0.81938106", "0.8174445", "0.8059553", "0.79495794", "0.7863814", "0.7845795", "0.78286576", "0.78050923", "0.7772839", "0.77267015", "0.7713606", "0.7697638", "0.76754385", "0.76542354", "0.75919574", "0.7553737", "0.7550201", "0.754454", "0.74886614", "0.74708...
0.0
-1
moves to the previous page
function previousPage() { var pageSelector = document.getElementById("page-select"); if (pageSelector.value > MIN_PAGE) { pageSelector.value--; goToPage(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previousPage(){\n if (page > 1)\n {\n setPage(page - 1);\n }\n else {\n // do nothing\n }\n }", "goToPrevious() {\n if (this.history.getPagesCount()) {\n this.transition = this.history.getCurrentPage().transition;\n ...
[ "0.87325746", "0.8708556", "0.86386013", "0.8582568", "0.8521822", "0.8494483", "0.8482488", "0.84575725", "0.8421222", "0.8325483", "0.83142096", "0.8232343", "0.8212379", "0.81850654", "0.81702614", "0.8154749", "0.8154749", "0.8143742", "0.811444", "0.80831075", "0.8067864...
0.71526676
92
Genetic Algorithm, Evolbing Shakespeare need to describe pseudoDNA For this example, a virtual organism's DNA is an array of characters Functionality: convert DNA into a string calculate DNA's 'fitness' mate DNA with another set of DNA mutate DNA generate a new character within the proper range of ASCI values
function newChar() { var c = floor(random(63, 122)) if (c == 63) c = 32; if (c == 64) c = 46; return String.fromCharCode(c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DNA(num) {\n this.genes = [];\n this.fitness = 0;\n\n for (var i = 0; i < num; i++) {\n this.genes[i] = newChar();\n }\n\n // converts genes array to string\n this.getPhrase = function() {\n return this.genes.join(\"\");\n }\n\n //Fitness function\n //returns: floating point percentage of c...
[ "0.7410392", "0.659812", "0.65123284", "0.636162", "0.63237715", "0.62390846", "0.62288696", "0.5978337", "0.59758407", "0.59683096", "0.5925095", "0.58526045", "0.5846255", "0.5834534", "0.5830244", "0.57819855", "0.5764968", "0.5764954", "0.57623315", "0.57372314", "0.57071...
0.0
-1
Constructor (make random DNA)
function DNA(num) { this.genes = []; this.fitness = 0; for (var i = 0; i < num; i++) { this.genes[i] = newChar(); } // converts genes array to string this.getPhrase = function() { return this.genes.join(""); } //Fitness function //returns: floating point percentage of correct characters t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DNA() {\n // DNA is random floating point values between 0 and 1 (!!)\n genes = new float[len];\n for (int i = 0; i < genes.length; i++) {\n genes[i] = random(0,1);\n }\n }", "newInstance(dna) {\n\n let newInd = new Individual(this.dnaLength, this.fitnessEvaluator);\n\n if (dna) {...
[ "0.7575269", "0.7436963", "0.7315295", "0.7065569", "0.69736093", "0.69685584", "0.6789824", "0.6544906", "0.65324193", "0.64406323", "0.6311245", "0.62901974", "0.61763567", "0.61757404", "0.61177367", "0.60723156", "0.60250056", "0.5982852", "0.5952094", "0.5944806", "0.592...
0.7364938
2
a constructor with initial set states
constructor(props){ super(props); // button display state var emptyArray = []; for (let i=0;i<7;i++) emptyArray[i] = {weekday:"",rain:"",temp:"",cloud_c :""}; this.setState( { daily : emptyArray }); //define everything in order to not get further errors in the components console....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializer () {\n this._state = \"dead\"\n this._num2state = []\n this._state2num = {}\n this._groups = []\n this.transitions([\n { state: \"dead\", enter: null, leave: null },\n { state: \"booted\", enter: \"boot\", leave: \"shutdown\...
[ "0.71831524", "0.7147491", "0.70717824", "0.6911041", "0.6869467", "0.67995924", "0.6786003", "0.6764576", "0.67166895", "0.6687431", "0.6583309", "0.6566986", "0.6562025", "0.6561802", "0.6561802", "0.6561802", "0.6561802", "0.6561802", "0.6561802", "0.6561802", "0.65488917"...
0.0
-1
Post a new tweet
postTweet(){ rl.question('Have a tweet in mind?: ', (answer) => { twi.post('statuses/update', { status: answer }, function(err, data, response) { console.log(data) }); rl.close(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTweet(mytweet) {\r\n\r\n console.log('Atttempting Tweet...');\r\n // .post takes an object as input\r\n var tweet = {\r\n status: mytweet\r\n\r\n };\r\n // if (tweet.status) {\r\n console.log(\"posting......\");\r\n console.log(\"status to be posted: \" + tweet.status);\...
[ "0.7792504", "0.76760966", "0.749763", "0.7432929", "0.7396335", "0.73760307", "0.7368896", "0.7364732", "0.72297233", "0.72031325", "0.7117982", "0.70900565", "0.70847607", "0.70619404", "0.7006358", "0.69586724", "0.6943105", "0.6942627", "0.6911418", "0.68629867", "0.68519...
0.7281273
8
Get followers of a particular user
getFollowers(){ rl.question('Input a twitter handle to get the followers of the respective user: ', (answer) => { twi.get('followers/id', { screen_name: answer }, function(err, data, response) { console.log(data) }); rl.close(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFollowersForUser(username){\n var deferred = q.defer();\n return Followers.findOne({\"username\": username}, function (error, response) {\n if(error)\n deferred.reject(error);\n else\n deferred.resolve(response);\n });\n re...
[ "0.79812974", "0.794279", "0.7832295", "0.77346206", "0.7608506", "0.75892377", "0.75542253", "0.7548107", "0.7448648", "0.7441564", "0.74001753", "0.7395615", "0.7348532", "0.7316925", "0.72858983", "0.7265759", "0.7239499", "0.72350955", "0.72257435", "0.7192311", "0.715980...
0.71793675
20
Pano2VR 6.1.10/18007 Filename: map.ggsk Generated 20210426T01:44:05
function pano2vrSkin(player,base) { player.addVariable('appear', 2, false); player.addVariable('open_tag', 0, ""); player.addVariable('close_nodes', 2, false); player.addVariable('category_visible', 2, false); player.addVariable('category_follow', 2, true); player.addVariable('vis_map', 2, true); player.addVaria...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMapData() {\n TIME && console.time(\"createMapData\");\n\n const date = new Date();\n const dateString = date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate();\n const license = \"File can be loaded in azgaar.github.io/Fantasy-Map-Generator\";\n const params = [version, licen...
[ "0.6127146", "0.60810655", "0.60735273", "0.60531527", "0.5839804", "0.5833477", "0.5803156", "0.58012915", "0.5794075", "0.5780153", "0.5767518", "0.57666206", "0.57666206", "0.5761928", "0.5757345", "0.575503", "0.57536465", "0.57487065", "0.57404727", "0.57384545", "0.5732...
0.0
-1
Initializes the particle system.
_initParticles() { this.particleSystem = ParticleHelper.CreateDefault(this.emitter); const noiseTexture = new NoiseProceduralTexture('perlin', 256, this.scene); noiseTexture.animationSpeedFactor = 5; noiseTexture.persistence = 2; noiseTexture.brightness = 0.5; noiseTexture.octaves = 5; thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n // create the particle system\n // this._ps = arbor.ParticleSystem(2000, 600, 0.5);\n this._ps = arbor.ParticleSystem({\n repulsion: 300,\n stiffness: 100,\n friction: 0.8,\n gravity: false,\n precision: 0.1\n });\n ...
[ "0.82625794", "0.7945603", "0.77174866", "0.7700926", "0.7538254", "0.7490843", "0.73518306", "0.7318591", "0.7236579", "0.7185333", "0.70615643", "0.7050185", "0.70317197", "0.6980145", "0.69656074", "0.6956201", "0.6918939", "0.68999267", "0.689449", "0.67757773", "0.676005...
0.72908306
8
it causes some flicker when reloading or navigating grid it may be possible to have some custom formatter to do this as the grid is being created to prevent this or go back to default browser checkbox styles for the grid
function styleCheckbox(table) { // // $(table).find('input:checkbox').addClass('ace') // .wrap('<label />') // .after('<span class="lbl align-top" />') // // // $('.ui-jqgrid-labels th[id*="_cb"]:first-child') // .find('input.cbox[type=checkbox]').addClass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function superCheckboxFormatter (cellValue, options) {\n\t \t var op = $.extend({}, $.jgrid.formatter.checkbox, options.colModel.formatoptions);\n\t \t if ($.fmatter.isEmpty(cellValue) || cellValue === undefined) {\n\t \t cellValue = $.fn.fmatter.defaultFormat(cellValue, op);\n\t \t }\n\t \t cellValue = ...
[ "0.64998055", "0.64721996", "0.6372296", "0.6372296", "0.63069594", "0.62940776", "0.628429", "0.62549555", "0.6213798", "0.6180616", "0.61690843", "0.6144689", "0.6074379", "0.605421", "0.6004794", "0.599926", "0.5991417", "0.5983378", "0.5929514", "0.5929514", "0.58710074",...
0.6339623
4
var random=false; var prev_position = new THREE.Vector3();
function MoveMissile() { //workflow is as follows.for each missile, move it towards its target, check for collision. for(i=0;i<Model.children.length;i++)//for every missile { //move towards target current_position = Model.children[i].position; prev_position=current_position.clone(); //calculate th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Start()\n{\n\tif (Enabled)\n\t{\n\t\ttransform.localPosition = Vector3(Random.Range(-1,2),Random.Range(-1,2),Random.Range(-1,2));\n\t\tif(transform.localPosition.x == 0)\n\t\t{\n\t\t\txT = false;\n\t\t}\n\t\tif(transform.localPosition.y == 0)\n\t\t{\n\t\t\tyT = false;\n\t\t}\n\t\tif(transform.localPositio...
[ "0.71546096", "0.6877669", "0.6810479", "0.66325814", "0.6629358", "0.66093755", "0.6525417", "0.6525417", "0.6521387", "0.6508836", "0.6502563", "0.64927715", "0.6463925", "0.6438476", "0.6423247", "0.6412712", "0.6397419", "0.63906306", "0.6370468", "0.6353247", "0.6337002"...
0.0
-1
Passing to joke to Speech RSS API
function tellMeTheJoke(joke){ VoiceRSS.speech({ key: myApiKey, src: joke, hl: 'en-us', v: 'Linda', r: 0, c: 'mp3', f: '44khz_16bit_stereo', ssml: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tellJoke(){\n VoiceRSS.speech({\n key: ttsKey,\n src: ttsText,\n hl: 'en-au',\n v: 'Isla',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false \n });\n}", "function tellMe(joke) {\n console.log(\"tell me:\", joke);\n VoiceRSS.spee...
[ "0.6840803", "0.66703016", "0.6548111", "0.5944141", "0.58900213", "0.5836894", "0.5807144", "0.5767292", "0.57666403", "0.5684609", "0.56813335", "0.56622195", "0.56609184", "0.5648582", "0.56401145", "0.56367505", "0.5625478", "0.5609449", "0.55985266", "0.5562859", "0.5534...
0.6842132
0
Get jokes from joke API
async function getJoke(){ toggleButton(); try { const res = await fetch(jokeURL); const data = await res.json(); let joke = ''; if ('setup' in data && 'delivery'){ joke = data.setup + ' ... ' + data.delivery; } else { joke = data.joke; } tellMeTheJoke(joke); } catch (err) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJokes() {\n $.ajax({\n method: 'GET',\n url: '/jokes',\n })\n .then(result => {\n console.log('GET /jokes', result);\n\n \n // send jokes list to the dom\n $('#allJokes').empty();\n for (let jokes of result) {\n\n $('#allJokes').append(`\...
[ "0.73292893", "0.72689706", "0.715446", "0.71330315", "0.71142554", "0.69025826", "0.68688405", "0.68509126", "0.67470413", "0.6646443", "0.66440934", "0.6629793", "0.65321475", "0.6452946", "0.6375124", "0.6306058", "0.62964636", "0.6296172", "0.6245104", "0.6237225", "0.622...
0.6011226
25
Disable and Enable Button element
function toggleButton(){ button.disabled = !button.disabled; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function btnDisable(button) {\n button.button('disable');\n button.button('refresh');\n}", "function enableButton ( button ){\n button.disabled = false;\n}", "function disableBtn() {\n // document.getElementById(idElement).disabled = true;\n $uWbuttonEdit.disabled = true;\n $uWbuttonEdi...
[ "0.80488175", "0.78004134", "0.7714082", "0.7626993", "0.7622682", "0.76199156", "0.7603043", "0.75771976", "0.75141704", "0.74795157", "0.746963", "0.74542373", "0.7453997", "0.74505246", "0.74417585", "0.74384075", "0.74019945", "0.73845553", "0.73673284", "0.7361207", "0.7...
0.761697
6
instance of Game splash
function buildSplash() { splashMain = buildDom(` <main> <h1>Up or Down<h1> <button>Start</button> </main> `); document.body.appendChild(splashMain); splashMain.querySelector('button').addEventListener('click',startGame) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_splash_screen() {\n\t// Splash screen load\n\tgame.load.image(\"logoGhost\",\"mlib/logo-ghost.png\");\n\tgame.load.image(\"logoWords\",\"mlib/logo-words.png\");\n\tgame.load.audio(\"splash\",\"sounds/splash.wav\");\n}", "function splash() {\n document.querySelector(\".splash\").classList.add(\"ani...
[ "0.69057953", "0.6795321", "0.6630153", "0.6519345", "0.64929885", "0.63703966", "0.63477874", "0.6333614", "0.63237166", "0.62937236", "0.62575144", "0.62440616", "0.62297744", "0.62024987", "0.6186611", "0.6183351", "0.6155391", "0.6153008", "0.61397016", "0.61388963", "0.6...
0.65398103
3
when admin user clicks 'delete' button to delete an existing listing, they are confirmed.
function ConfirmDeleteImage(listing_id,img_id,new_listing){ if(confirm('Are you sure you wish to delete this image?')){ // if confirmed, call deletion script and send provided 'listing_id' if(new_listing == 'TRUE'){ window.location.href='delete.php?new_listing=' + new_listin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initDelete() {\n\t\t\t$list.find('[aria-click=\"delete\"]').on('click', function () {\n\t\t\t\tvar $item = $(this).closest('.item');\n\n\t\t\t\tpopupPrompt({\n\t\t\t\t\ttitle: _t.form.confirm_title,\n\t\t\t\t\tcontent: _t.investor.view.manager.delete_confirm,\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tbuttons...
[ "0.73427", "0.6844235", "0.6839344", "0.68187314", "0.68048203", "0.6802416", "0.6770685", "0.6704825", "0.67038465", "0.66640794", "0.6643851", "0.6621775", "0.6617299", "0.66139954", "0.6608275", "0.6572669", "0.654716", "0.6539653", "0.6516616", "0.6500841", "0.6491672", ...
0.612244
70
when admin user clicks 'delete' button to delete an existing images, they are confirmed.
function ConfirmDelete(listing_id){ if(confirm('Warning: If you delete this listing, all images associated with it will also be deleted. Are you sure you wish to continue?')){ // if confirmed, call deletion script and send provided 'listing_id' window.location.href='delete.php?listing_id=' + listing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmDelete(){\r\n\t\tvar links = find(\"//img[contains(@src, 'del.gif')]\", XPList);\r\n\t\tfor (var i = 0; i < links.snapshotLength; i++){\r\n\t\t\tlinks.snapshotItem(i).setAttribute('onClick', 'javascript:return confirm(\"' + T('SEGURO') + '\");');\r\n\t\t}\r\n\t}", "function confirmDeleteEmail() {...
[ "0.73505056", "0.7154907", "0.7125974", "0.6904893", "0.68616456", "0.67767936", "0.675175", "0.6746853", "0.6685705", "0.6658984", "0.6644175", "0.6624414", "0.6595184", "0.65240294", "0.65072536", "0.6506419", "0.6501779", "0.6495363", "0.6477792", "0.645771", "0.64557064",...
0.62862325
36
import Profile from './Profile';
function App() { var info=Data.profiles; // ReactDom.render(<p>Hello </p>,document.getElementById('header')) // let array=['abc','adf',"asdfa","dsafd","erew","etrwaw"]; // let array2=["dteaf","derawe","ewrwwr","rewewwas","eretty","erwertw"] return ( <section> <BrowserRouter> <heade...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Profile() {\n _classCallCheck(this, Profile);\n\n Profile.initialize(this);\n }", "profile() {\n return this.hasOne('App/Models/Profile')\n }", "function Profile() {\n\t}", "static get table() {\n return 'profile';\n }", "function Profile() {\n return (\n <div>\n ...
[ "0.63977474", "0.6282286", "0.61902213", "0.60845137", "0.6077984", "0.58908457", "0.5853206", "0.5831238", "0.5828792", "0.5823965", "0.5823965", "0.58133155", "0.58072037", "0.5796108", "0.57790285", "0.5755934", "0.569935", "0.569637", "0.5651767", "0.56429577", "0.562991"...
0.0
-1
The route registering function:
function route (path, templateId) { routes[path] = {templateId: templateId}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "registerRoutes() {\n this.get(`/`, `version`);\n\n // Register routes for branch resources\n this.get(`/branches`, `branch-data`);\n this.get(`/branches/:id`, `branch-find`);\n this.post(`/branches`, `branch-create`);\n\n // Register routes for sales resource\n this.get(`/sales`, `sales-data`)...
[ "0.7404807", "0.7294004", "0.7227051", "0.7136497", "0.6994476", "0.6840534", "0.68400997", "0.6769793", "0.6748991", "0.6724563", "0.6687676", "0.66532266", "0.66428983", "0.66064906", "0.6555248", "0.6539281", "0.65020996", "0.6495237", "0.6487379", "0.6402853", "0.63700914...
0.58108765
91
Create a new function which calls .val on input change.
function createChangeHandler ( trigger ) { return function ( ignore, value ){ // Determine which array position to 'null' based on 'trigger'. $Target.val( [ trigger ? null : value, trigger ? value : null ], true ); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function v(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger(\"change\")}}", "function v(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger(\"change\")}}", "onChang...
[ "0.71654373", "0.71450627", "0.69299656", "0.69157845", "0.69065094", "0.69065094", "0.6887523", "0.68811125", "0.68323565", "0.68323565", "0.68323565", "0.68323565", "0.68323565", "0.68323565", "0.68323565", "0.68323565", "0.68218446", "0.67875654", "0.67875654", "0.67875654",...
0.0
-1
Called by libLink when it wants a set of links updated.
function linkUpdate ( flag ) { var trigger = $.inArray(flag, triggerPos); // The API might not have been set yet. if ( $Target[0].linkAPI && $Target[0].linkAPI[flag] ) { $Target[0].linkAPI[flag].change( $Values[trigger], $Handles[trigger].children(), $Target ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLinks()\n\t{\n\t\tconsole.log(\"All appended link text updated\");\n\t\t$(\"a.appended\").each(function()\n\t\t{\n\t\t\tif(savedTopics.hasOwnProperty(this.id))\n\t\t\t{\n\t\t\t\t$(this).text(\"x\");\n\t\t\t\t$(this).prev().css(\"font-style\", \"italic\");\n\t\t\t\tconsole.log(\"Found \" + this.id + ...
[ "0.6786777", "0.67369604", "0.668407", "0.66618705", "0.6616811", "0.66144043", "0.65965956", "0.65565187", "0.63854855", "0.6357836", "0.63117397", "0.63044065", "0.6299647", "0.62364334", "0.62187046", "0.6198232", "0.6190903", "0.6182945", "0.6181137", "0.6172298", "0.6165...
0.66877526
2
Called by libLink to append an element to the slider.
function linkConfirm ( flag, element ) { // Find the trigger for the passed flag. var trigger = $.inArray(flag, triggerPos); // If set, append the element to the handle it belongs to. if ( element ) { element.appendTo( $Handles[trigger].children() ); } // The public API is reversed for rtl s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendSlide(elem) {\n $conf.slides.push(elem);\n $conf.slider.appendChild(elem);\n $elems.dots = buildPager($conf.pager.wrap);\n alignToActiveSlide();\n }", "_spawn() {\n const parentElement = document.querySelector(this.parentSelector);\n parentElement.app...
[ "0.7195765", "0.64529365", "0.6101963", "0.5950092", "0.59060186", "0.59060186", "0.59060186", "0.59021723", "0.5848832", "0.581924", "0.5809723", "0.5801779", "0.5789639", "0.5787788", "0.57735515", "0.57638395", "0.57516086", "0.5729342", "0.57179165", "0.57179165", "0.5717...
0.0
-1
Place elements back on the slider.
function reAppendLink ( ) { var i, flag; // The API keeps a list of elements: we can re-append them on rebuild. for ( i = 0; i < triggerPos.length; i += 1 ) { if ( this.linkAPI && this.linkAPI[(flag = triggerPos[i])] ) { this.linkAPI[flag].reconfirm(flag); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveImgBack(){\n\tif (currentImg == 0){\n\t\t currentImg = imgList.length -1;\n\t}else {\n\t\tcurrentImg--;\n\t};\n\n\tpaneSlide();\n\t\n}", "function moveBack() {\n $slideContainer.css({'margin-left': '-='+width});\n --currentSlide;\n if (currentSlide === -$slides.length+2) {\n ...
[ "0.6407685", "0.63774407", "0.6338646", "0.6252188", "0.6111707", "0.6099853", "0.6034435", "0.60037655", "0.60012996", "0.5994763", "0.5966409", "0.5949187", "0.59307194", "0.58784026", "0.5865213", "0.583919", "0.5833935", "0.5810561", "0.577209", "0.5766988", "0.5721393", ...
0.0
-1
will only return renderComponent() if user and project in state are not empty
render() { return this.state.user && this.state.project ? (this.renderComponent()) : (null) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const { user, isLoading } = this.props.auth;\n\n if (isLoading) {\n return <h2>Loading...</h2>;\n }\n // If not logged in, or not an admin\n else if (!user || !user.admin) {\n return <h2>Access Denied</h2>\n }\n // If an admin, loa...
[ "0.69052917", "0.6794691", "0.65550876", "0.65221965", "0.6459171", "0.64046776", "0.63583696", "0.62141234", "0.6169709", "0.61350214", "0.60774046", "0.60668135", "0.6029844", "0.6024428", "0.60036284", "0.60029817", "0.6000732", "0.5994649", "0.5980764", "0.5979243", "0.59...
0.8589135
0
easily recognized function that performs ajax request to yelp
function updateYelpResults() { yelpAjax(searchFor(), searchNear()); // get all the needed info }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yelpAjax(searchFor, searchNear) {\n\n /*\n *\tKeys and other tokens needed to access the Yelp API via OAuth\n *\tIn a non-Udacious scenario this would have to be moved\n * to a server side script and therefore actually be \"secret\"\n */\n\n var auth = {\n consumerKey: \"2M-JW...
[ "0.80259824", "0.7259638", "0.71454036", "0.7136725", "0.6946509", "0.6932895", "0.6802767", "0.67177415", "0.667314", "0.6638775", "0.6633248", "0.6614379", "0.6594534", "0.65781236", "0.65308106", "0.6443712", "0.6391026", "0.6384631", "0.63841033", "0.63374674", "0.6321644...
0.73869216
1
The filter and functions
function filterInputField() { // ensure emtpy lists nameList = []; // for names filteredList = []; // for matches filterField(filterField().toLowerCase()); // force the case on the search for (var card in resultList()) { nameList.push({ 'index': card, // store index ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter() {\n\t}", "filter() {\n\t}", "function filter() {\n \n}", "function filterFunction() {\n \n}", "function filter(field, value)\n {\n \n }", "removeAllFilters() {}", "filterProducts() {\n // Crear copia\n let toFilter = [...this.productsArray];\n\n // Se pasa el ...
[ "0.83419424", "0.83419424", "0.83025974", "0.78336185", "0.67924076", "0.67912364", "0.66271085", "0.66101545", "0.65988916", "0.65926564", "0.6573111", "0.65627456", "0.65618825", "0.6508305", "0.650053", "0.650053", "0.6494922", "0.6458889", "0.6451131", "0.6450929", "0.644...
0.0
-1
The following functions handle requests to Yelp
function yelpAjax(searchFor, searchNear) { /* * Keys and other tokens needed to access the Yelp API via OAuth * In a non-Udacious scenario this would have to be moved * to a server side script and therefore actually be "secret" */ var auth = { consumerKey: "2M-JWI9l8UBCt3vm0R6vZg",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callYelp() {\r\n 'use strict';\r\n\r\n //Nonce generator to generate a random number.\r\n function nonce_generate() {\r\n return (Math.floor(Math.random() * 1e12).toString());\r\n }\r\n\r\n var yelp_url = 'https://api.yelp.com/v2/search';\r\n\r\n //Yelp parameters.\r\n var para...
[ "0.7760285", "0.75397253", "0.7328289", "0.7006755", "0.6989393", "0.6971666", "0.68842804", "0.681383", "0.6774153", "0.6740801", "0.6709426", "0.66633034", "0.66506684", "0.6645194", "0.663159", "0.66217446", "0.66199636", "0.6606548", "0.65979207", "0.6595956", "0.65945786...
0.72528106
3
Ajax OAuth method GETs data from Yelp API
function yJax(url, yData) { $.ajax({ 'timeout': 3000, 'type': 'GET', 'url': url, 'data': yData, 'dataType': 'jsonp', 'global': true, 'cache': true, 'jsonpCallback': 'cb', 'success': function(data) { makeYelpList(data); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yelpAjax(searchFor, searchNear) {\n\n /*\n *\tKeys and other tokens needed to access the Yelp API via OAuth\n *\tIn a non-Udacious scenario this would have to be moved\n * to a server side script and therefore actually be \"secret\"\n */\n\n var auth = {\n consumerKey: \"2M-JW...
[ "0.79215366", "0.76738", "0.73858505", "0.7275642", "0.7161303", "0.7150648", "0.70065266", "0.67143965", "0.6664854", "0.66376626", "0.66214263", "0.6541284", "0.6534723", "0.6533098", "0.65030205", "0.6490472", "0.647712", "0.644827", "0.64419335", "0.63834524", "0.63715106...
0.67342937
7
Changes out the resultList with a new yelp results
function makeYelpList(d) { response = d.businesses; // push ajax response to the global var 'response' /* --- Clean up the old lists --- */ resultList.removeAll(); // empty the resultList originalList.removeAll(); clearAllMarkers(); // clears marker array /* --- Display the search result...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateYelpResults() {\n yelpAjax(searchFor(), searchNear()); // get all the needed info\n}", "function displayYelpResults (responseJson) {\n console.log(responseJson);\n // if there are previous results, remove them\n $('#yelp-list').empty();\n // iterate through the foods array\n for ...
[ "0.7201718", "0.6893652", "0.63763183", "0.63328165", "0.63321316", "0.6291253", "0.61660683", "0.6154084", "0.6107276", "0.604572", "0.59728205", "0.596416", "0.5906155", "0.58831334", "0.5846018", "0.58459574", "0.583725", "0.5834318", "0.5830727", "0.5818472", "0.5805775",...
0.6860564
2
Loop through the markers, place them on the map with needed functionality
function setMarkers(map, points) { /* --- function needed for cleaning up infowindows --- */ function hideInfoWindowCloseControl() { // $(".gm-style-iw").next("div").css('display', 'none'); // this function gets rid of close btn in infowindows // udacity doesn't like it for this project so ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAllMarkers(){\n\tfor (var i = 0, len = mapLocations.length; i < len; i++){\n\t\tvar loc = mapLocations[i];\n\t\tvar marker = new google.maps.Marker({\n\t\t\tposition: loc.position,\n\t\t\tmap: map,\n\t\t\tscaledSize: new google.maps.Size(50, 50),\n\t\t\ticon: \"https://s3-us-west-2.amazonaws.com/andrew...
[ "0.77969074", "0.76185673", "0.7406473", "0.7384406", "0.738121", "0.73804015", "0.7366029", "0.731674", "0.73118925", "0.7289495", "0.7269237", "0.7258026", "0.72545576", "0.72480637", "0.72362506", "0.72345346", "0.722807", "0.7224576", "0.7220034", "0.72072786", "0.7205453...
0.70696497
64
function needed for cleaning up infowindows
function hideInfoWindowCloseControl() { // $(".gm-style-iw").next("div").css('display', 'none'); // this function gets rid of close btn in infowindows // udacity doesn't like it for this project so having an x is fine }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearInfoWindows() {\n infowindows.forEach((infowindow) => {infowindow.close();});\n infowindows = [];\n}", "function closeInfoWindow() {\r\n\t\t$('#infowindows').html('');\r\n\t\t$['mapsettings'].infoWindowLocation = [];\r\n\t\t$['mapsettings'].hasOpenInfoWindow = false;\r\n\t}", "function remove_a...
[ "0.7865012", "0.74943554", "0.7351682", "0.70951855", "0.704527", "0.702769", "0.70123565", "0.6932595", "0.6927487", "0.6820696", "0.6814423", "0.6765461", "0.67402315", "0.67402315", "0.67402315", "0.67402315", "0.6738779", "0.6728645", "0.66888505", "0.66692567", "0.665869...
0.67277724
18
function gives all markers resting icon and a base layering
function resetMarkerIcons() { for (var i = 0; i < currentMarkers.length; i++) { currentMarkers[i].setIcon(markerIcon.resting); currentMarkers[i].setZIndex(4); currentMarkers[i].setAnimation(null); // turn BOUNCE Animation off } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMarkerIcons() {\n\t\t\tvar markerIconDot = {\n\t\t\t\turl: '/assets/images/1x1-pixel.png',\n\t\t\t\tsize: new google.maps.Size(1, 1),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(4, 4),\n\t\t\t\tscaledSize: null\n\t\t\t};\n\n\t\t\tvar markerIconSmallRed = {\n\...
[ "0.71509564", "0.6849534", "0.66628927", "0.64706224", "0.64567053", "0.6419691", "0.63917", "0.63827056", "0.6375544", "0.63613665", "0.633783", "0.6330576", "0.6307822", "0.629982", "0.6281349", "0.6279704", "0.62711227", "0.6249962", "0.62062985", "0.61921316", "0.6175157"...
0.66628397
3
Section monitors the DOM scrolling and trigger events when appropriate / pull trigger for a specific marker
function OpenInfowindowForMarker(index) { google.maps.event.trigger(currentMarkers[index], 'dblclick'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listenForScrollEvent() {\n el = $('.tab-content .popular-course .links');\n el.on(\"scroll\", function () {\n el.trigger(\"custom-scroll\");\n });\n}", "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow...
[ "0.65740293", "0.65445024", "0.65445024", "0.65445024", "0.65445024", "0.6532901", "0.6501826", "0.6476131", "0.64375275", "0.640672", "0.6406147", "0.6394246", "0.6383426", "0.63698643", "0.63400567", "0.63040805", "0.63015485", "0.6299095", "0.6291468", "0.62696886", "0.626...
0.0
-1
zero on standard desktop view
function scrollingTriggersMarkers() { $(window).scroll(function() { // as user scrolls var pixelsScrolled = $(window).scrollTop() + scrollAdjustment; // store distance scrolled for (var resultCard in resultList()) { // for each placeCard var resultOffset = $(resultList()[resultCard].idSe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zero(){ return 0;}", "zero(){\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }", "zero() {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }", "function viewToDesktop_Browser() {\n // Remove slick\n $(\"#browserView\").slick(\"unslick\");\n $(\".sl...
[ "0.6295874", "0.610893", "0.60869455", "0.60835326", "0.596949", "0.59465384", "0.59176654", "0.5915808", "0.59084857", "0.5888643", "0.58620846", "0.58202755", "0.5709078", "0.57030773", "0.57027155", "0.5694154", "0.56662", "0.56560874", "0.56550694", "0.56494397", "0.56094...
0.0
-1
Handles changing mapShift vars in responsive manner using matchMedia
function reformatOnSize() { if (window.matchMedia("(min-width: 680px)").matches) { // for "big" screen mapShift = { right: 0.08, up: 0.04 }; scrollAdjustment = 0; map.setZoom(12); $('#map').removeClass("fixed"); } else if (window.matchMedia("(orien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setMapWidth() {\n\t\tlet windowWidth = window.innerWidth;\n\t\tswitch(true) {\n\t\t\tcase windowWidth >= 1200:\n\t\t\t\tthis.mapWidth = 950;\n\t\t\t\tthis.scale = 950;\n\t\t\t\treturn;\n\t\t\tcase windowWidth >= 992:\n\t\t\t\tthis.mapWidth = 850;\n\t\t\t\tthis.scale = 850;\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\...
[ "0.6471649", "0.6148041", "0.6101379", "0.601778", "0.57190514", "0.5696023", "0.56730974", "0.56509477", "0.56487", "0.56459767", "0.5623758", "0.56216943", "0.55983377", "0.5597752", "0.5582185", "0.55764437", "0.55618364", "0.5555578", "0.55130863", "0.5501862", "0.5493917...
0.61953574
1
force scroll the DOM to the top
function forceTop() { $('html, body').animate({ scrollTop: $('body').offset().top, }, 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scrollToTop() {\n document.documentElement.scrollTop = 500;\n }", "function scrollToTop() {\n\troot.scrollTo({\n\t\ttop: 0,\n\t\tbehavior: \"smooth\"\n\t});\n}", "function toTop(){\n document.body.scrollTop=0\n }", "toTop() {\n window.scrollTo(0,0);\n }", "function goToTop()...
[ "0.8119478", "0.80938685", "0.8083193", "0.80293417", "0.80012995", "0.7983722", "0.7934287", "0.7934008", "0.78765786", "0.7839427", "0.7823527", "0.782153", "0.7820804", "0.7810673", "0.7795514", "0.77936476", "0.77921766", "0.777931", "0.777533", "0.7771789", "0.7770195", ...
0.79327226
8
Number > Number > Vector2D
function Vector2D(x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vector2d(x, y) {\n this.x = x;\n this.y = y;\n}", "function Vector2d(x, y) {\r\n\tthis.x = parseInt(x);\r\n\tthis.y = parseInt(y);\r\n}", "function vec( n, n2=n ) { return {x: n, y: n2}; }", "multiply(number) {\r\n return new Vector(...new Array(this.getDimensions()).fill(undefined).map((e,...
[ "0.6807841", "0.6456737", "0.6297367", "0.61700237", "0.6151039", "0.6135621", "0.60162073", "0.5994563", "0.5946715", "0.5937384", "0.5920884", "0.59179926", "0.5897943", "0.5884586", "0.58784515", "0.58707947", "0.58660966", "0.5861763", "0.5861763", "0.5861763", "0.5853718...
0.62174696
3
console.log(collectionCopy); declare func and pass params, for ex. id, artist, Bon Jovi
function update(id, prop, value) { //test scope first var data = collection[2548].artist; // console.log("Testing a collectionvalue: " ,data); // for(id in collection){ if(value !== "" && prop !== "tracks"){ // console.log("* If value not empty and prop isn't tracks: ", value); // console.log("* prop is: "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToCollection( newTitle, newArtist, newYearPublished, newTracks ){ \n// - Create a new object having the above properties\n let album = {\n title : newTitle,\n artist : newArtist,\n year : newYearPublished,\n tracks : newTracks\n } //end object literal\n// - Add the new obj...
[ "0.58886296", "0.58565295", "0.58496225", "0.57698417", "0.5729608", "0.5716763", "0.56754804", "0.56599736", "0.5643525", "0.55946773", "0.55909413", "0.5575607", "0.5471764", "0.5432595", "0.54138976", "0.53556246", "0.5329556", "0.52674514", "0.52674514", "0.52674514", "0....
0.0
-1
function of other type difficult to
function firstName(person) { console.log(person.firstName + " " + person.lastName); console.log("name is ", person.firstName, person.lastName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion (){}", "function fun1(){} //toda a função de js retorna alguma coisa", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function an(){}", "function normal() {}", "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "function obj(objec...
[ "0.6497695", "0.62689036", "0.6259653", "0.6259653", "0.6259653", "0.594425", "0.5869559", "0.5869095", "0.58588666", "0.5808197", "0.576442", "0.5713568", "0.5655744", "0.5655744", "0.5649164", "0.5589708", "0.5589708", "0.5589708", "0.5589708", "0.55857617", "0.5561282", ...
0.0
-1
due to this we need to create interface
function firstName2(person) { console.log(person.firstname + " " + person.lastname); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "transient private protected internal function m182() {}", "obtain(){}", "private internal function m248() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "protected internal function m252() {}", "transient f...
[ "0.6552967", "0.6235893", "0.62136436", "0.61017567", "0.6072692", "0.60482913", "0.5939396", "0.5792815", "0.56968933", "0.5678984", "0.5678984", "0.5678984", "0.5611226", "0.5604285", "0.5600849", "0.55642205", "0.55285", "0.54824173", "0.5482108", "0.5447559", "0.5437771",...
0.0
-1
VALIDATION FOR USER NAME TO ACCEPT ONLY CHARACTERS START
function onlyAlphabets(e,t) { try { if (window.event) { var charCode = window.event.keyCode; } else if (e) { var charCode = e.which; } else { return true; } if ((charCod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidName(username) {\n return /^[A-z ]+$/.test(username);\n }", "function validUserName(txtUserName) {\n\tvar strUname = txtUserName.toString();\n\t/* changed regex pattern to allow space */\n\treturn /^[a-z\\d\\s]+$/i.test(strUname);\n}", "function usernameValidation() {\n return username.v...
[ "0.7764171", "0.77157384", "0.76993805", "0.7582384", "0.7579269", "0.7520978", "0.74986404", "0.7459219", "0.743678", "0.74288285", "0.73359865", "0.72984475", "0.72946995", "0.72838575", "0.72670686", "0.72621113", "0.7257523", "0.7255711", "0.721457", "0.7205192", "0.71868...
0.0
-1
VALIDATION FOR USER NAME TO ACCEPT ONLY CHARACTERS END / VALIDATION FOR PASSWORD NOT TO ACCEPT SPECIAL CHARACTERS START
function blockSpecialChar(e) { var k = e.keyCode; return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || (k >= 48 && k <= 57)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usernameValidation() {\n return username.value.match(onlyLettersAndNumsReg);\n}", "function validUserName(txtUserName) {\n\tvar strUname = txtUserName.toString();\n\t/* changed regex pattern to allow space */\n\treturn /^[a-z\\d\\s]+$/i.test(strUname);\n}", "function validarUserName(username){\n ...
[ "0.7859156", "0.7411783", "0.7392258", "0.73821765", "0.7379853", "0.7355144", "0.73474914", "0.73433566", "0.7329868", "0.7314813", "0.7275319", "0.7266879", "0.7213676", "0.7213015", "0.7210557", "0.7195019", "0.71829635", "0.71520054", "0.71161383", "0.7112514", "0.7085228...
0.0
-1
VALIDATION FOR PASSWORD NOT TO ACCEPT SPECIAL CHARACTERS END / VALIDATION FOR EMAIL ID FOR A SPECIFIC FORMAT START
function ValidateEmail(e){ var emailId = document.getElementById("email").value; var fields = emailId.split(/@/); var x = fields[0]; var y = fields[1]; var gmail = "gmail.com"; var yahoo = "yahoo.com"; var email = "email.com"; var ymail = "ymail.com"; var GMAIL = "GMAIL.COM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userPassCheck(str){\n var reason = \"\"\n var valid = true\n if (str.length < 6){\n valid = false\n reason = reason + \"Must be greater than 6 characters, \"\n }\n if (!str.includes(\"#\")){\n valid = false\n reason = reason + \"Must include a #, \"\n }\n if (!str.includes(\"$\")){\n ...
[ "0.65628535", "0.6561409", "0.6522556", "0.6443527", "0.63993496", "0.63540596", "0.63321435", "0.62934375", "0.6293414", "0.6271372", "0.6267052", "0.6253082", "0.6250903", "0.624797", "0.6242096", "0.62406665", "0.62326777", "0.6232452", "0.62317234", "0.6217743", "0.621126...
0.0
-1
VALIDATION FOR EMAIL ID FOR A SPECIFIC FORMAT END / VALIDATION FOR CONTACT NUMBER TO ACCEPT ONLY NUMBERS START
function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allnumeric_aadharno(aadharno, msgBox) {\n var num1 = /^\\d{4}\\s\\d{4}\\s\\d{4}$/;\n\n if (aadharno.value.match(num1)) {\n document.getElementById(msgBox).innerHTML = '';\n return true;\n } else {\n document.getElementById(msgBox).innerHTML = '<font style=\"color: red;\">Must...
[ "0.6675478", "0.6640252", "0.66027415", "0.65635127", "0.6554432", "0.65485954", "0.6542802", "0.65204483", "0.64331675", "0.64322525", "0.6351921", "0.6331332", "0.63215566", "0.6321268", "0.6308271", "0.6293923", "0.6288809", "0.6255231", "0.6254028", "0.62195295", "0.61961...
0.0
-1
the magical helper function (no longer necessary in GSAP 3.3.1 because it was added as ScrollTrigger.batch())...
function batch(targets, vars) { let varsCopy = {}, interval = vars.interval || 0.1, proxyCallback = (type, callback) => { let batch = [], delay = gsap.delayedCall(interval, () => {callback(batch); batch.length = 0;}).pause(); return sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throttledScrollEvents() {\n\n }", "function onScroll() {\r\n requestTick();\r\n}", "get [scrollTarget]() {\n return this[ids].grippedContent;\n }", "function mkdOnWindowScroll() {\n \n }", "OnBatchModified() { this.Trigger(\"BatchModified\", new tp.DataTableEventArgs()); }", ...
[ "0.63193184", "0.6062122", "0.6035587", "0.5993228", "0.59437275", "0.59001255", "0.59001255", "0.58774984", "0.58774984", "0.58609354", "0.58545446", "0.58199054", "0.58199054", "0.58199054", "0.58199054", "0.58199054", "0.58127123", "0.58052737", "0.5772822", "0.5761358", "...
0.66137916
0
selects items (in our case SVGs) to reveal on scroll
constructor(els, offset) { this.itemsToReveal = els; this.offsetPercentage = offset; this.hideInitially(); this.createWaypoints(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOnScroll() {\n var $showFigure = $('.show-figure-js');\n\n if ($showFigure.length) {\n ScrollReveal().reveal($showFigure, {\n duration: 900,\n distance: '100px',\n scale: 0.92,\n interval: 100,\n reset: false,\n // viewFactor: 0.1\n viewOffset: {\n bottom...
[ "0.61664367", "0.6068247", "0.5958858", "0.59275913", "0.5914469", "0.5883666", "0.58127874", "0.57819307", "0.57218087", "0.5689101", "0.56806755", "0.55761564", "0.55598074", "0.552552", "0.5514969", "0.5496108", "0.54765344", "0.54689485", "0.5452309", "0.5448476", "0.5448...
0.0
-1
In order to reveal, we need to hide the items intitally. Hence, hideInitially
hideInitially() { this.itemsToReveal.addClass("reveal-item"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hideInitially() {\n this.itemsToReveal.addClass('reveal-item');\n }", "hideInitially() { \n this.itemsToReveal.addClass(\"reveal-item\");\n }", "hideInitially() {\n \tthis.itemsToReveal.addClass(\"reveal-item\"); \n }", "hideOffscreenElements() {\n const startIndex = Math.floor(-(t...
[ "0.8195007", "0.810957", "0.810708", "0.6901322", "0.6866264", "0.67496663", "0.67422456", "0.67120814", "0.6707221", "0.666634", "0.66180766", "0.6616379", "0.6606463", "0.66037613", "0.6603125", "0.6598453", "0.65854293", "0.65812165", "0.6576137", "0.65582377", "0.65582377...
0.8259329
0
This is a library to create a point to initiate the reveal when scrolling down
createWaypoints() { //to be used to access offsetPercentage below var that = this; //runs four times, once for each item this.itemsToReveal.each(function() { //to be used to access itemsToReveal down below var currentItem = this; new Waypoint({ element: currentItem, handler: function() { $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showOnScroll() {\n var $showFigure = $('.show-figure-js');\n\n if ($showFigure.length) {\n ScrollReveal().reveal($showFigure, {\n duration: 900,\n distance: '100px',\n scale: 0.92,\n interval: 100,\n reset: false,\n // viewFactor: 0.1\n viewOffset: {\n bottom...
[ "0.76223934", "0.69320244", "0.64752007", "0.62724274", "0.61980015", "0.6155206", "0.6149233", "0.61460346", "0.6119907", "0.6119537", "0.6118713", "0.611524", "0.6097961", "0.6090442", "0.6090442", "0.60846233", "0.6074712", "0.6071996", "0.6070862", "0.605072", "0.6021595"...
0.0
-1
Service (business) methods for managing Configuration objects
function ConfigurationService(repository) { this._repository = repository; // //Expose CRUD operations from the repository // (except for 'save' which is extended) var methods = ['find', 'findById', 'count', 'remove']; methods.forEach(function(name) { this[name] = function() { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "configure(config) {\n this._connectionResolver.configure(config);\n this._maxKeySize = config.getAsIntegerWithDefault('options.max_key_size', this._maxKeySize);\n this._maxExpiration = config.getAsLongWithDefault('options.max_expiration', this._maxExpiration);\n this._maxValue = config....
[ "0.61953366", "0.61824375", "0.6179578", "0.61625993", "0.61218184", "0.6116961", "0.61028445", "0.6094872", "0.6082392", "0.6071588", "0.601267", "0.595566", "0.5953155", "0.5927944", "0.59223247", "0.59223247", "0.5870329", "0.58645236", "0.5831196", "0.5827349", "0.5814776...
0.6203163
0
a utility function to generate instances of a class
function construct(constructor, args) { var c = function () { return constructor.apply(this, args); }; c.prototype = constructor.prototype; return new c(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GeneratorClass () {}", "function Class() {\n return generator.newInstance(this, arguments);\n }", "getInstances() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static In...
[ "0.6999356", "0.6856208", "0.6275447", "0.62617826", "0.62617826", "0.62617826", "0.62617826", "0.62617826", "0.62617826", "0.6180269", "0.61424595", "0.60866773", "0.6066141", "0.6066141", "0.6066141", "0.60489446", "0.60447973", "0.60447973", "0.60407555", "0.5987112", "0.5...
0.0
-1
End of use strict
function updateSummary(summaries) { summaries.forEach(function(curSummary) { // console.log(curSummary); $('#services-container').append('\ <div class="col-md-4">\ <span class="fa-stack fa-4x">\ <i class="fa fa-circle fa-stack-2x text-primary"></i>\ <i class="fa ' + curSumma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strictly() {\n 'use strict';\n\n}", "transient private protected internal function m182() {}", "function strictMode() {\n 'use strict';\n\n //..\n //..\n }", "transient protected internal function m189() {}", "static transient final private internal function m43() {}", "transient priv...
[ "0.6751486", "0.6697779", "0.66280675", "0.66235316", "0.65359306", "0.65213853", "0.64448684", "0.6424859", "0.6421975", "0.6421123", "0.6383936", "0.6369395", "0.631593", "0.62950236", "0.6291042", "0.62865376", "0.6272056", "0.62363476", "0.6229284", "0.62065816", "0.61860...
0.0
-1
output: true or false ALGORITHM Scrub string of any non digits. reverse iterate, convert to num, double every other value and output to array. if value is >= 10, subtract 9. finally, sum all digits. if total mod 10 === 0. return true. Else, false.
function luhnRemainder(string) { var array, total; nums = string.replace(/\D/g, '').split('').reverse(); if (nums.length === 0) return false; total = nums.map(Number).reduce(function(sum, val, idx) { if (idx % 2 !== 0) { val *= 2; if (val >= 10) { val -= 9; } } return sum + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateCred (array){\n let finalSum = 0\n for(let i=array.length-1; i>=0; i--){\n let num = array[i]\n if((i-array.length)%2==0){\n num*=2\n if(num>9){\n num-=9\n }\n }\n finalSum= finalSum+num\n }\n const check = (fi...
[ "0.6644529", "0.6608124", "0.65810204", "0.65156543", "0.6513048", "0.6408474", "0.6396559", "0.6332918", "0.6290458", "0.62305176", "0.6218377", "0.6200407", "0.61892664", "0.61226445", "0.6103008", "0.6098515", "0.60881454", "0.60836524", "0.6081497", "0.60641384", "0.60633...
0.65209204
3
true Write a function that can add a 'check digit' to make an invalid number, a valid luhn number. input: string output: string + one char algorithm: first check if already a luhn number. Return string if true. IF not: append 0 and return luhnRemainder function. Subtract remainder from 10 use that number as the check.
function addCheck(string) { var check, remainder; if (luhn(string)) return string; remainder = luhnRemainder(string + '0'); check = 10 - remainder; return string + check; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeValidLuhn(string) {\n if (typeof string !== 'string' || (!string)) return false;\n\n if (luhn(string)) return string;\n string = string.replace(/\\D/g, '');\n string += '0';\n\n while (!luhn(string)) {\n string = string.split('').map(Number);\n string[string.length - 1] += 1;\n string = ...
[ "0.7908186", "0.78932077", "0.77553475", "0.7624451", "0.7589165", "0.75804675", "0.747386", "0.73762405", "0.7339043", "0.7315871", "0.7314682", "0.72844744", "0.72812366", "0.72812366", "0.7256185", "0.71417147", "0.7120658", "0.71036524", "0.70523024", "0.66744727", "0.662...
0.84438974
0
Write a recursive function that counts how many sheep jumps over the fence. Your program should take a number as an input. That number should be the number of sheep you have. The function should display the number along with the message "Another sheep jump over the fence" until no more sheep are left. Input: 3 Output: ...
function countSheep(sheep) { if (sheep === 0) { return; } console.log(`${sheep} - Another sheep jump over the fence`); countSheep(sheep - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countSheep(currentNumberSheep) {\n if (currentNumberSheep === 0) {\n console.log('All sheep jumped over the fence');\n return\n } else {\n console.log(currentNumberSheep + ' ' + '- Another sheep jumps over the fence');\n totalNumberSheep = currentNumberSheep -= 1;\n ...
[ "0.8239102", "0.81680954", "0.8166278", "0.8082292", "0.80744654", "0.8043827", "0.79709095", "0.78569835", "0.75755006", "0.74766695", "0.7347261", "0.71648145", "0.71572024", "0.7127057", "0.6986611", "0.69783145", "0.68566", "0.6822001", "0.64459085", "0.61891", "0.6044881...
0.8143642
3
This fuction is triggered by the event
function toggleMenu() { if (!showMenu) { menuBtn.classList.add("close"); // this adds a class value menu.classList.add("show"); menuBranding.classList.add("show"); menuNav.classList.add("show"); navItems.forEach(navItem => navItem.classList.add("show")); showMenu = true; } else { menuBtn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onEvent() {\n \n }", "onChanged(e){}", "updated(e){}", "firstUpdated(e){}", "function editEvent(){\n\t\n}", "callEvent(event) {\n trackEvent('Elections', 'clicked ' + event.currentTarget.id)\n }", "_evtChange(event) { }", "handleEvents() {\n }", "featureClickEventHandler(event) {\r\n ...
[ "0.75546587", "0.68144387", "0.6786254", "0.6599995", "0.6556824", "0.64991087", "0.64955175", "0.6482351", "0.64525425", "0.64340717", "0.6354238", "0.63010174", "0.62824917", "0.62621945", "0.62318546", "0.621786", "0.62172055", "0.62143546", "0.62097263", "0.6204826", "0.6...
0.0
-1
1 2 3 4 e a 5 1 5 6 7 8 > f b 6 2 a b c d > g c 7 3 e f g h h d 8 4 1(0,0) < e(3,0) < h(3,3) < 4(0,3) 2(0,1) < a(2,0) < g(3,2) < 8(1,3) Solution: Do it layer by layer. For each pixel in the layer, rotate 4 together each iteration.
function rotate(matrix) { let n = matrix.length; // iterate through layers (aka the squares). There're 2 in a 4x4 matrix for (let x = 0; x < n/2; x++) { // need to -1 because we don't need to rotate element at y=n-x. It's rotated with y=x for (let y = x; y < n - x - 1; y++) { let top = matrix[x][y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotateImage(a) { \n let len = a.length\n for (i = 0; i < len; i++, len--) { \n let end = len - 1; \n for ( j = i; j < end; j++) { \n let tail = a.length - j - 1; \n\n let temp = a[i][j]; \n a[i][j] = a[tail][i]; \n a[tail][i] = a[end][tail]; \n a[end][tail] =...
[ "0.70343316", "0.651586", "0.6397351", "0.6237829", "0.6226968", "0.6163556", "0.61477894", "0.6134421", "0.61145854", "0.60882944", "0.60759276", "0.60710603", "0.60678595", "0.606537", "0.6027852", "0.6010915", "0.59576553", "0.58569235", "0.5853839", "0.5814309", "0.580789...
0.65559876
1
Function to initilaze completion store
function initializeStore({ completions }) { const { completionStore } = self; let generatedCompletions = []; if (completions && completions.length) { for (var i = 0; i < completions.length; i++) { const itemOfCompletion = completions[i]; /** * If user skip task...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeStore({ completions, predictions }) {\n const cs = self.completionStore;\n cs.initRoot(self.config);\n\n // eslint breaks on some optional chaining https://github.com/eslint/eslint/issues/12822\n /* eslint-disable no-unused-expressions */\n predictions?.forEach(p => {\n ...
[ "0.6746584", "0.6413835", "0.6200534", "0.5876315", "0.58358663", "0.58286315", "0.58186936", "0.5818093", "0.5818093", "0.5805773", "0.56839013", "0.56818384", "0.56811106", "0.56766653", "0.5661163", "0.5655732", "0.5649185", "0.56266135", "0.56047136", "0.56047136", "0.558...
0.79691344
0
Write a function that returns true if an object is empty, and false otherwise. Examples
function isEmpty(obj) { return !Object.keys(obj).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEmpty(obj) {\n if (!obj) {\n return true\n } else if (obj.length == 0 || Object.keys(obj).length == 0) {\n return true\n } else {\n return false\n }\n}", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function isEmpty(obj) {\n return ...
[ "0.78000593", "0.7781515", "0.77792746", "0.7749803", "0.7718789", "0.7718789", "0.7717837", "0.7668534", "0.7640871", "0.7637968", "0.762099", "0.762099", "0.762099", "0.7616544", "0.7608095", "0.7602876", "0.7578737", "0.7542341", "0.7542341", "0.7542341", "0.7542341", "0...
0.7380711
85
This is the function for when a cell is clicked
function selectCell() { // If the game ends then none of the cells should be clickable if (clickDisabled) { return; } // This is a conditional to make sure that only one cell is highlighted at a time by reverting the previous selected cell back to normal if (selectedCell && !($(selectedCel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleHTMLCellClick(e) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget\n let idArray = e.currentTarget.id.split(\"-\");\n let row = Number(idArray[1]);\n let col = Number(idArray[2]);\n\n chess.handleCellSelected(row, col);\n}", "function cell_click(evt) {\n l...
[ "0.7875471", "0.7721438", "0.77070034", "0.7552904", "0.75396615", "0.7475997", "0.741275", "0.741275", "0.7391855", "0.73621166", "0.73043305", "0.7221879", "0.7193755", "0.71657044", "0.71532315", "0.71112186", "0.70973104", "0.7060106", "0.7046273", "0.70431757", "0.701346...
0.64391136
70
This is the function to allow the player to type in the selected cell
function writeCell(event) { // Starts the timer once the player types their first entry startTimer(); // Allows the player to delete their entries with backspace and keeps the player from inputing extraneous keys like the letter keys if (event.key == "Backspace") { selectedCell.textContent = "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCell() {\n let highlighting = false;\n\n // Allow player to place a token in a cell.\n OUTER: for (let row of grid) {\n for (let cell of row) {\n if (cell.highlight !== null) {\n highlighting = true;\n cell.highlight = null;\n cell.owner = playerTurn;\n\n if (c...
[ "0.65119404", "0.6465278", "0.6291497", "0.6275184", "0.6210165", "0.6157138", "0.614593", "0.6003313", "0.5975697", "0.5974436", "0.5893369", "0.5876473", "0.586638", "0.58629787", "0.5849246", "0.58461416", "0.5831539", "0.58177626", "0.5804896", "0.5764776", "0.57490695", ...
0.67068934
0
Function to check if the player's input is correct based on the current state of the board
function checkCorrect(playerNum) { var correct = true; // Variables to keep track of the current 3x3 box the player is in var boxRow = Math.floor(selectedRow / 3) * 3; var boxCol = Math.floor(selectedCol / 3) * 3; // For loop to check if there is any overlap in the current column for (var row ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWin(){\r\n var playerKey = Player+1\r\n const allEqual = arr => arr.every(val => val === playerKey);\r\n if (gameUpdateObj.xPos == null) return false;\r\n //Y Axis\r\n for (var y=0; y<6; y++) {\r\n if (y >= 0 && y <= 6-4){ //-4 as 4 need to be connected to win\r\n ...
[ "0.6976146", "0.6942169", "0.6909224", "0.6839424", "0.68042004", "0.6803577", "0.68001306", "0.678097", "0.67730707", "0.67730707", "0.6757206", "0.6755541", "0.67488223", "0.67274344", "0.6724862", "0.6708145", "0.6707371", "0.6702318", "0.66997004", "0.66666555", "0.666545...
0.6424987
77
Function to check if the player won
function winCheck() { // Traverses the entire grid and checks for any discrepancy between the current grid and the answer grid, if there is then the player has not won yet for (var row = 0; row < 9; row++) { for (var col = 0; col < 9; col++) { if (grid[row][col].textContent != answerGrid[ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWon() {\n isPlayerWon = playerGuess.value.toUpperCase() === computerBase;\n isComputerWon = computerGuess.value === playerBase;\n}", "gameWon() {\n if (this._gameBoard[0] == this._currentPlayer && this._gameBoard[1] == this._currentPlayer && this._gameBoard[2] == this._currentPlayer ||\n ...
[ "0.78256726", "0.7769323", "0.7711409", "0.7679786", "0.75871164", "0.75796545", "0.74839634", "0.7467969", "0.74617046", "0.74218136", "0.73918897", "0.7377211", "0.7370664", "0.73528934", "0.73492587", "0.7333409", "0.7307663", "0.7305142", "0.7301336", "0.72895926", "0.726...
0.0
-1
Function to start the timer
function startTimer() { if (stoptime) { stoptime = false; runClock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timerStart(){\n\t\n\t\t\n\t}", "start() {\n timer.start();\n }", "function startTimer() {\n status = 1;\n timer();\n }", "function startIntevall() {\r\n start = setInterval(function () {\r\n timer();\r\n }, 1000);\r\n }", "function startTimer(){\n t = ...
[ "0.8383084", "0.8321133", "0.82520145", "0.8108517", "0.7872017", "0.781921", "0.7779609", "0.77573866", "0.7730622", "0.77217996", "0.7701875", "0.76922953", "0.7681092", "0.7668472", "0.7668472", "0.7629426", "0.7612758", "0.7586919", "0.75786793", "0.75579154", "0.7544497"...
0.7611573
17
Function to stop the timer
function stopTimer() { if (!stoptime) { stoptime = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopTimer(){ clearInterval(interval)}", "function stopTimer(){\r\n clearInterval(timer);\r\n }", "function stopTimer(){\n clearInterval(timer);\n }", "function stop() {\n timer.stop();\n}", "function stopTimer() {clearTimeout(startTimer)}", "stopTimer() {\n\t\t\tclearInt...
[ "0.8656761", "0.85707074", "0.8531468", "0.85241675", "0.8499903", "0.84626013", "0.84263456", "0.84158456", "0.8414935", "0.83860433", "0.83628464", "0.8352758", "0.8351501", "0.83364385", "0.833249", "0.8331458", "0.83240193", "0.83178526", "0.82938653", "0.826027", "0.8209...
0.8097362
32
Function to calculate the time
function runClock() { // Reverts the second and minute variables back to ints so that they can be incremented sec = parseInt(sec); min = parseInt(min); // Checks if the clock should actually be running if (!stoptime) { // Increments the second by one every tick sec++ // I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateTime() {\n displayTime(Date.now() - startTime);\n}", "function CalculateTime(){\n now = Date.now();\n deltaTime = (now - lastUpdate) / 1000;\n lastUpdate = now;\n}", "function getTime(){\n \n hr = hour();\n mn = minute();\n sc = second();\n}", "get time() {\n ...
[ "0.78482366", "0.74891764", "0.747218", "0.74089235", "0.74087775", "0.7273142", "0.72274244", "0.7159958", "0.7159132", "0.70785004", "0.7077206", "0.70758665", "0.7064674", "0.70517856", "0.70230776", "0.7008177", "0.6983398", "0.6962169", "0.69522995", "0.6944054", "0.6922...
0.0
-1
Resets the timer and the second and minute variables
function resetTimer() { $("#timer").html = '00:00'; stoptime = true; sec = 0; min = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Reset() {\n Set_Minutes(Reset_Val)\n Set_Seconds(0)\n}", "resetTimer() {\n clearInterval(this._timer);\n this._seconds = 0;\n this._setTimerContext();\n this.startTimer();\n }", "function resetTimer() {\n app.second = 0;\n app.minute = 0;\n app.hour = 0;\n...
[ "0.8050639", "0.7970525", "0.79167503", "0.78881335", "0.78530556", "0.78179616", "0.78093946", "0.77928287", "0.7748524", "0.7684355", "0.7646508", "0.7638876", "0.76304287", "0.75972396", "0.7529331", "0.752296", "0.7517838", "0.7511917", "0.7511917", "0.7490284", "0.747214...
0.77610654
8
Will check if the database exists, if not create it based on the configuration file stored on each feature.
start(){ var self = this; this.allViews = []; return new Promise((resolve, reject)=>{ this._createDatabase(this.database) .then(()=>{ self.initialize(); self._fetchModules(); return Promise.all(self.allViews); }).then((result)=>{ self._insertTestToken(); /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkDatabase(){\n var query = `CREATE DATABASE IF NOT EXISTS ` + config.SQL_DATABASE\n this.db.run(query)\n }", "static dbExists() {\n return fileExists(`${config.database.path}/db-${config.production ? 'production' : 'testing'}.db`);\n }", "static createNewDatabase() {\n idb...
[ "0.76877075", "0.72865814", "0.7219097", "0.7039236", "0.6914722", "0.67895335", "0.67783433", "0.6734701", "0.67195857", "0.6717006", "0.6681182", "0.662761", "0.66150934", "0.652547", "0.6447937", "0.6436132", "0.6353212", "0.6348435", "0.6336486", "0.6333336", "0.6315547",...
0.0
-1
Based on the database host and name, initialize the database to be used.
initialize(){ this.db = Cloudant(this.database.url).use(this.database.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeDatabase(databaseName) {\n sql = `DROP DATABASE IF EXISTS ${databaseName};`\n queryReturn(sql, `${databaseName} Removed`)\n sql = `CREATE DATABASE ${databaseName};`\n queryReturn(sql, `${databaseName} Created`)\n sql = `USE ${databaseName};`\n queryReturn(sql, `${databaseName} ...
[ "0.7073356", "0.65937734", "0.6475255", "0.63976085", "0.63674206", "0.63281775", "0.6305559", "0.6298999", "0.6272959", "0.61993825", "0.61862105", "0.6177648", "0.6109302", "0.6106763", "0.60967624", "0.60928077", "0.60662997", "0.60650474", "0.6060639", "0.60499984", "0.60...
0.6392695
4
Will retrieve all features (it's directory) inside the folder features.
_fetchModules(){ var directories = fs.readdirSync('./features/'); for (let directory of directories){ if (!directory.includes('.')) { //means is a directory this._requireModules('./features/' + directory, directory); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFeatures() {\n let filesGlob = 'e2e/features/**/*.feature';\n let files = glob.sync(filesGlob);\n return _.sortedUniq(files);\n }", "function Features(baseUrl, path) {\n if (path === void 0) { path = \"features\"; }\n return _super.call(this, baseUrl, path) || this;\n }", "async f...
[ "0.6948308", "0.6406881", "0.59143454", "0.5875625", "0.5875625", "0.584231", "0.5812367", "0.5620149", "0.55529916", "0.5527651", "0.5497239", "0.5496281", "0.5475285", "0.5438347", "0.5433545", "0.54192626", "0.5404455", "0.53642446", "0.53452283", "0.5341213", "0.5338877",...
0.66896826
1
This method will provide a token for bdd tests (if it does not exists)
_insertTestToken(){ var self = this; if (!process.env.VCAP_SERVICES){ var doc = { type: "SESSION", cn: 'BDD - Mocha Test Automation', uid: "000000631", mail: "bddmocha@xx.ibm.com", expiration: moment().add(1, 'years').format(), cleanUp: moment().add(1, 'year...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateToken() {\n return null; // TODO: add a token generation\n}", "constructor(token) {\n this.token = token || null;\n }", "function getToken() {\n return token;\n }", "async generateFakeToken() {\n const tokenParams = {\n name: \"FakeSmartKey\",\n quantity: 100000 * Set...
[ "0.61370695", "0.6109818", "0.6096685", "0.6037566", "0.6010493", "0.59130096", "0.58821994", "0.58625156", "0.58464694", "0.5812465", "0.5762936", "0.57585067", "0.57368034", "0.57208526", "0.5668086", "0.56536937", "0.56443506", "0.5611281", "0.5583781", "0.55614454", "0.55...
0.0
-1
extract score from the RT page by parsing the responseText as a document
function parse_score_from_page(resp) { var parser = new DOMParser(); var doc = parser.parseFromString(resp, "text/html"); score = doc.getElementsByClassName(score_class_name); alert(score[0].innerText); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regex_score_from_page(resp) {\n var reg = /<span class=\"meter-value superPageFontColor\"><span>([0-9]+)<\\/span>%<\\/span>/;\n matches = resp.match(reg);\n if (matches) {\n // something was read\n return matches[1];\n } else {\n return null;\n }\n}", "function parseR...
[ "0.6602257", "0.5934881", "0.58977073", "0.58546126", "0.5853684", "0.57777536", "0.5749384", "0.5618302", "0.5531622", "0.55277014", "0.5490527", "0.54724354", "0.5417775", "0.5382771", "0.53827345", "0.5369796", "0.5356507", "0.5337116", "0.53354067", "0.5303587", "0.526821...
0.7336652
0
extract score from the RT page by using a regex directly on the responseText string
function regex_score_from_page(resp) { var reg = /<span class="meter-value superPageFontColor"><span>([0-9]+)<\/span>%<\/span>/; matches = resp.match(reg); if (matches) { // something was read return matches[1]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_score_from_page(resp) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(resp, \"text/html\");\n score = doc.getElementsByClassName(score_class_name);\n alert(score[0].innerText);\n}", "function cb(err,response,html){\n if(err){\n console.log(\"Error: \"+err);\n ...
[ "0.6781171", "0.57471776", "0.5534867", "0.54832387", "0.5479493", "0.5408177", "0.5329979", "0.5320748", "0.5273399", "0.52583045", "0.52325165", "0.52165055", "0.52106667", "0.51950043", "0.5164515", "0.5160843", "0.514278", "0.513841", "0.5128742", "0.51139593", "0.5082966...
0.7222925
0
transforms a netflix title to a form that can be recognized by Rotten Tomatoes i.e. all lowercase and underscores instead of spaces
function transform_title(title) { return title.toLowerCase().replace(/ /g, "_"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }", "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n ...
[ "0.76036656", "0.76036656", "0.7403169", "0.7398343", "0.73685473", "0.71056426", "0.7051153", "0.6883731", "0.6878643", "0.68730444", "0.6864358", "0.6853551", "0.6803316", "0.6795982", "0.6780726", "0.67515326", "0.6741295", "0.6737461", "0.6723154", "0.6712556", "0.668471"...
0.78623956
0
gets the title from a element
function get_title(overlay) { title = overlay.getElementsByClassName("bob-title"); if (title.length > 0) { return title[0].innerHTML; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTitle() {\n return document.getElementById( \"eow-title\" ).title;\n}", "function getElementTitle(elemID)\n{\n var elem = getElementTitleObj(elemID);\n \n if(elem != null)\n return elem.firstChild.nodeValue;\n \n return null;\n}", "function title() {\n var elm\n \n ...
[ "0.7789554", "0.7508065", "0.7491535", "0.7392357", "0.7356458", "0.7191203", "0.7103269", "0.7060952", "0.705065", "0.70072025", "0.6995395", "0.69399863", "0.69335914", "0.69226706", "0.691805", "0.6889259", "0.6856847", "0.6828293", "0.68066704", "0.6802883", "0.68012303",...
0.7252267
5
gets the score HTML elem from a boboverlay element
function get_score_elem(overlay) { score = overlay.getElementsByClassName("match-score"); if (score.length > 0) { return score[0]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_score_from_page(resp) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(resp, \"text/html\");\n score = doc.getElementsByClassName(score_class_name);\n alert(score[0].innerText);\n}", "function game_score(score) {\n var score_text = document.querySelector(\"#scor...
[ "0.6844799", "0.62210095", "0.6122035", "0.60941136", "0.6088753", "0.6002295", "0.5914622", "0.5889037", "0.58729726", "0.58698", "0.58690095", "0.5837149", "0.5828991", "0.5795911", "0.5795783", "0.5793955", "0.5789068", "0.57757604", "0.5750832", "0.5750774", "0.5749296", ...
0.7224918
0
gets the score for a titled work (i.e. a movie or a show)
function get_media_score(title) { httpGetAsyncWithBackup(base_movie_url + title, base_tv_url + title, regex_score_from_page); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function score_this_term(w) {\r\n\ttotalscore = 0;\r\n\t// note that while we allow words to contain hyphens, the job dictionary array cannot handle them\r\n\tfor(y=3;y<socREC[w].length;y++) { totalscore = totalscore + job_dictionary[socREC[w][y].replace(/[-]+/g,'')]; };\r\n\treturn (totalscore / (socREC[w].length...
[ "0.65808254", "0.6494726", "0.63412297", "0.6318446", "0.6280942", "0.62382644", "0.62242", "0.62164676", "0.6195038", "0.6120751", "0.6091222", "0.6069211", "0.60467744", "0.6033865", "0.6015299", "0.5947122", "0.5931375", "0.58898896", "0.5841647", "0.58406174", "0.5816109"...
0.6301809
4
Ajax sync script require sync aditional JS scripts, makes things modular ////////////////////////////////////////////////////////////////////////////// add required scripts in post (Not actually required can just add in html...)
function require(jsFilePath) { var js = document.createElement("script"); js.type = "text/javascript"; js.src = jsFilePath; document.body.appendChild(js); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadScripts() {\r\n\t\t\t\twindow._sf_endpt = (new Date()).getTime();\r\n\t\t\t\tvar cbDomain = ((\"https:\"==document.location.protocol)?\"https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/\":\"http://static.chartbeat.com/\");\r\n\t\t\t\tif(loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js...
[ "0.62715805", "0.6233539", "0.6222461", "0.6220024", "0.6207765", "0.61423105", "0.6140812", "0.6043715", "0.60374874", "0.5940494", "0.5930717", "0.5925215", "0.59093976", "0.5899497", "0.5859524", "0.58495665", "0.5847008", "0.58428633", "0.58154154", "0.5802853", "0.579584...
0.0
-1
function for get date from server and create page by this date
function ajaxGet(url) { let request = new XMLHttpRequest(); request.onreadystatechange = function () { if (request.readyState === 4) { let responseString = request.response; // get the string from the response let responsObject = JSON.parse(responseString); // convert it to an ob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_date(){\n var query = getQueryParams(document.location.search),\n date_num = query.date,\n today,\n year, day, month, divided, divided_2;\n\n if(date_num == '' || date_num == undefined){\n var today = new Date().toDateString();\n }else{\...
[ "0.6738669", "0.6681014", "0.65615445", "0.6250217", "0.6201182", "0.60084677", "0.5952636", "0.5919958", "0.58803165", "0.585419", "0.58519375", "0.58494693", "0.58410406", "0.5828988", "0.5828988", "0.5773622", "0.57640946", "0.57606095", "0.5759924", "0.5745572", "0.574204...
0.0
-1
this is our kitchen sink for runtime detection
function getBrowserInfo (browser) { // browser.runtime.getBrowserInfo is not available in Chromium-based browsers if (browser && browser.runtime && browser.runtime.getBrowserInfo) { return browser.runtime.getBrowserInfo() } return Promise.resolve({}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Runtime() {}", "static startDetecting() {}", "function runtime() {\n\t require(\"./runtime\");\n\t}", "inspectAll() {\n this.inspectContainer();\n this.inspectPlatform();\n this.inspectLinux();\n this.inspectMemory();\n this.inspectCPU();\n this.addTimeStam...
[ "0.6427791", "0.59849036", "0.59264344", "0.58525133", "0.58129233", "0.5807587", "0.5780381", "0.570474", "0.56607866", "0.54785043", "0.5404229", "0.53838736", "0.5381379", "0.53684026", "0.5364688", "0.5308227", "0.5292655", "0.5292655", "0.52862644", "0.52834785", "0.5280...
0.0
-1
Extras if advanced pricing no of customers has to be less than max
function pricing() { var _old = $('.old_price'); var _max = $('.max_coupons'); var _newp = $('.new_price'); var _basic = $('.basic_discount'); var _actual = $('.actual_discount'); var old_price = parseInt(_old.val() || 0); var max = parseInt(_max.val() || 0); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getsDiscount() {\n if ((productsBought > 2) || (membership = premium)); }", "increase() {\n //console.log('max:'+this.field.max+' value:'+ this.field.value)\n\n //check if the quantity increase is legal variable in template is {{ page.product.calculatedMaxPurchase }}\n if (p...
[ "0.61738205", "0.58958006", "0.58197725", "0.5792308", "0.5789846", "0.57696944", "0.5769498", "0.57262045", "0.56606114", "0.5652421", "0.56358355", "0.56220865", "0.5590736", "0.5578664", "0.555101", "0.55396616", "0.55269355", "0.55056924", "0.54826874", "0.5460975", "0.54...
0.57780355
5
Standard was complaining about having break after a return. It looks weird without the break though.
function showLevel (level) { switch (level) { case 'info': return true case 'error': return false default: return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Break() {}", "function breakToken() {\n\t\tvar lastSwitch = {\n\t\t\tblock: 0,\n\t\t\tlabe: 0\n\t\t};\n\t\tif (switchStack.length > 0) {\n\t\t\tlastSwitch = switchStack[switchStack.length - 1];\n\t\t\tasm.push(' JMP end_switch_' + lastSwitch.labe);\n\t\t} else\n\t\t\tputError(lineCount, 14, '');\n\t\t//...
[ "0.7726979", "0.6889071", "0.68725663", "0.646671", "0.6422813", "0.6421474", "0.63679373", "0.6241119", "0.6231465", "0.6231465", "0.62306243", "0.62138", "0.62138", "0.62138", "0.62138", "0.6211771", "0.6200111", "0.6199043", "0.6167557", "0.61324596", "0.61324596", "0.61...
0.0
-1
Do not touch anything below this line
function getData() { return new Promise(function(resolve, reject) { let t = Math.random() * 2000 + 1000; setTimeout(function() { resolve(JSON.stringify({ data: [ 'Sweden', 'Denmark', 'Norway', 'Finland' ] })); }, t); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.7011995", "0.68903977", "0.6746071", "0.6732506", "0.6578236", "0.65570855", "0.6536234", "0.62942135", "0.6279998", "0.627063", "0.6230207", "0.62154293", "0.6186576", "0.6132039", "0.60404336", "0.59922737", "0.5967726", "0.5965206", "0.59605664", "0.59589696", "0.593321...
0.0
-1
remove params from url
function removeURLParameter(url, parameter) { //prefer to use l.search if you have a location/link object var urlparts = url.split('?'); if (urlparts.length >= 2) { var prefix = encodeURIComponent(parameter) + '='; var pars = urlparts[1].split(/[&;]/g); //reverse iteration as may b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripInternalParams(url) {\n url.search = url.search.replace(/([?&])(_pjax|_)=[^&]*/g, '')\n return url.href.replace(/\\?($|#)/, '$1')\n }", "function stripInternalParams(url) {\n url.search = url.search.replace(/([?&])(_pjax|_)=[^&]*/g, '').replace(/^&/, '');\n return url.href.re...
[ "0.77300286", "0.7706872", "0.76609695", "0.76609695", "0.7589706", "0.7481737", "0.728987", "0.7210061", "0.71649736", "0.71148205", "0.71039253", "0.7103747", "0.71009415", "0.70602345", "0.7023504", "0.70103776", "0.6984044", "0.6959392", "0.6954322", "0.6853361", "0.68442...
0.6901151
19
the numth prime number. The range will be from 1 to 10^4. For example: if num is 16 the output should be 53 as 53 is the 16th prime number.
function primeMover( num ) { var primeCounter = 0, numCounter = 1; while ( primeCounter < num ) { numCounter++; // primeTime() is from primeTime.js if ( primeTime(numCounter) ) { primeCounter++; } } return numCounter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function euler003( num ) {\n // starting index (first prime)\n var i = 2;\n\n // while the number to process is greater than the index\n while ( num > i ) {\n // if the index is a factor of the number\n if ( num % i === 0 ) {\n // then divide by the index\n num = num...
[ "0.7282878", "0.71248364", "0.7111546", "0.71075314", "0.70946246", "0.6985431", "0.69840455", "0.6951526", "0.69152373", "0.6850002", "0.68459994", "0.6811153", "0.6798543", "0.67849714", "0.6688066", "0.66535544", "0.6653489", "0.66134006", "0.6610586", "0.65804756", "0.656...
0.6928115
8
The required type conversion methods.
getWeakType() { return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coercion(type) {\n var fn;\n\n switch (type) {\n case 'integer':\n case 'float':\n case 'long':\n case 'double':\n fn = function (data) {\n if (isNaN(data)) {\n return data;\n }\n return Number(dat...
[ "0.59676445", "0.5963308", "0.5933781", "0.5930913", "0.58239305", "0.5720129", "0.5707462", "0.5638996", "0.56261986", "0.560319", "0.55965024", "0.5581127", "0.5482314", "0.5481875", "0.545371", "0.5446992", "0.5441699", "0.5441699", "0.5433662", "0.5422862", "0.5413892", ...
0.0
-1
Returns the inner nullable variation of this type.
nullable() { return this.ofType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNullableType(type) {\n\t return type instanceof GraphQLNonNull ? type.ofType : type;\n\t}", "function nullable(S) {\n return new Struct({\n type: `${S.type} | null`,\n schema: S.schema,\n validator: (value, ctx) => {\n return value === null || ctx.check(value, S);\n }\n });\n}", ...
[ "0.55777466", "0.5364237", "0.5364237", "0.5360343", "0.5250729", "0.5250729", "0.5250729", "0.52478653", "0.52389145", "0.5202061", "0.51071477", "0.5099812", "0.5099812", "0.5082126", "0.5044347", "0.50037664", "0.5000987", "0.49891302", "0.49857545", "0.49708968", "0.49587...
0.65310913
0
The required type conversion methods.
getWeakType() { return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coercion(type) {\n var fn;\n\n switch (type) {\n case 'integer':\n case 'float':\n case 'long':\n case 'double':\n fn = function (data) {\n if (isNaN(data)) {\n return data;\n }\n return Number(dat...
[ "0.5965925", "0.59623545", "0.59330565", "0.592941", "0.58225757", "0.5721277", "0.57072836", "0.56389135", "0.56287885", "0.56027704", "0.5594936", "0.5580587", "0.5479905", "0.547935", "0.54529905", "0.5447988", "0.54406804", "0.54406804", "0.54344594", "0.54227614", "0.541...
0.0
-1
Complete the function below.
function maxXor(l, r) { var possibilities = [] for (var i = l; i <= r; i ++) { for (var j = l; j <= r; j++) { possibilities.push([i,j]) } } var results = [] for (var i = 0; i < possibilities.length; i++) { // console.log(possibilities[i]) results.push(poss...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "complete() {}", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n ...
[ "0.67816716", "0.67582", "0.67582", "0.67582", "0.67582", "0.6718839", "0.6656225", "0.6331708", "0.60500824", "0.6049132", "0.5952828", "0.5903742", "0.58880436", "0.58797926", "0.5873641", "0.5844233", "0.5839644", "0.58146936", "0.58117497", "0.58053505", "0.57816005", "...
0.0
-1
return [ relPath, link, root, fullPath ];
function parseUrlPath( urlPath ){ var relPath, link, root, fullPath; var mr= urlPath.match( /^\/([^\/\*]+\/\*)\/(.*)$/ ); if( !mr ){ relPath= decodeURIComponent( urlPath ); link=""; root= __dirname; fullPath= path.normalize( root+"/"+ relPath ); } else { link= mr[1]; if( !projectData[link] ) return E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get fullpath()\t{ return \"\" + this.prefix + this.path }", "get href(){return $href;}", "get href(){return $href;}", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"...
[ "0.62819606", "0.6246892", "0.6246892", "0.60245484", "0.5914918", "0.5851588", "0.5831832", "0.5810484", "0.5802259", "0.5709803", "0.56872046", "0.56817675", "0.56648386", "0.5637505", "0.56210774", "0.5606898", "0.5601961", "0.5558478", "0.551389", "0.5510573", "0.55085564...
0.53344405
36
Fetches games array from database
componentDidMount() { fetch('http://localhost:3000/game') .then(res => res.json()) .then(res => { this.props.getGames(res); this.props.searchGames(res); if (localStorage.getItem('gamesio')) { let newUser = this.props.use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchGameList(){\n\tfetch(\"https://rawg-video-games-database.p.rapidapi.com/games?page=1\", {\n\t\"method\": \"GET\",\n\t\"headers\": {\n\t\t\"x-rapidapi-host\": \"rawg-video-games-database.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": \"ba56e18dfbmsha0533de8919d27bp10d3dcjsn5229ce979bb3\"\n\t}\n\t})\n\t.th...
[ "0.7351573", "0.724474", "0.7069508", "0.70092386", "0.6968008", "0.69106674", "0.6894039", "0.68245816", "0.6788986", "0.67788315", "0.6775379", "0.6764847", "0.66569465", "0.6633889", "0.6591715", "0.6589859", "0.65495324", "0.6509901", "0.65023535", "0.64717805", "0.644743...
0.0
-1
Converts the current time to a hex color and then changes the background to that color every second
function displayHexClock() { // Get the current time var clock = new Date(), h = clock.getHours(), m = clock.getMinutes(), s = clock.getSeconds(); // Make sure that hours, minutes, and seconds are all 2 digits each if(h.toString().length < 2) { h = '0' + h; } if(m.toString()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function col() {\r\n var d = new Date();\r\n var index = d.getSeconds() % 10;\r\n\r\n document.getElementById(\"clock\").style.color = '#' + color_array[index];\r\n\r\n setTimeout('col()', 1000);\r\n}", "function hexClock(){\n\tvar time = new Date();\n\t//you can do time.getHours())%12 for pm and am\n\tvar h...
[ "0.75235486", "0.74505585", "0.7351917", "0.7335107", "0.7249277", "0.7058916", "0.701177", "0.6995274", "0.6989783", "0.6962226", "0.6932402", "0.68911785", "0.6847236", "0.68471813", "0.66215", "0.65975475", "0.6550979", "0.65497714", "0.6548475", "0.6517327", "0.650155", ...
0.6494736
21
recursive add all site data
function AddSiteDataRec(arr, i){ if(i >= arr.length) return; var d = arr[i]; var tDay = new Date(d.time); var date = tDay.getFullYear()+"_"+(tDay.getMonth()+1)+"_"+tDay.getDate(); var SensorData = mongoose.model('SensorData_'+date, SensorDataSchema); //沒這筆資料才加入 SensorData.findOne({'_id': d._id}, function...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddSiteRec(arr, i){\n\t\tif(i >= arr.length) return AddSiteDataRec(dataArray,0);\t//add site data after all site added\n\t\tvar site = arr[i];\n\t\tWeatherStation.findOneAndUpdate({ '_id': site._id}, {'$setOnInsert': site}, {upsert: true}, function(){\n\t\t\tAddSiteRec(arr, i+1);\n\t\t});\n\t}", "functi...
[ "0.64785624", "0.6382151", "0.58285034", "0.58135265", "0.56933355", "0.5542384", "0.54409045", "0.5310655", "0.52775383", "0.52691025", "0.52672845", "0.52454656", "0.52335244", "0.51875776", "0.518413", "0.5109049", "0.5103593", "0.5071137", "0.5059281", "0.50586885", "0.50...
0.5985926
2
recursive add all sites
function AddSiteRec(arr, i){ if(i >= arr.length) return AddSiteDataRec(dataArray,0); //add site data after all site added var site = arr[i]; SensorSite.findOneAndUpdate({ '_id': site._id}, {'$set': { 'lat': site.lat, 'lng': site.lng }, '$setOnInsert': site}, {upsert: true}, function(){ AddSiteRec(arr, i+1); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAll() {}", "function AddSiteRec(arr, i){\n\t\tif(i >= arr.length) return AddSiteDataRec(dataArray,0);\t//add site data after all site added\n\t\tvar site = arr[i];\n\t\tWeatherStation.findOneAndUpdate({ '_id': site._id}, {'$setOnInsert': site}, {upsert: true}, function(){\n\t\t\tAddSiteRec(arr, i+1);...
[ "0.598581", "0.59028655", "0.5475636", "0.54092544", "0.52430755", "0.52112955", "0.5178721", "0.51646996", "0.51457155", "0.5097964", "0.50721014", "0.5067919", "0.5063044", "0.50130963", "0.4997893", "0.4979793", "0.49714512", "0.4933651", "0.49198806", "0.48909092", "0.487...
0.58276397
2
recursive add all station data
function AddStationDataRec(arr, i){ if(i >= arr.length) return; var d = arr[i]; var tDay = new Date(d.time); var date = tDay.getFullYear()+"_"+(tDay.getMonth()+1)+"_"+tDay.getDate(); var PowerGen = mongoose.model('PowerGen_'+date, PowerGenSchema); PowerGen.findOneAndUpdate({ '_id': d._id}, {'$setOnInsert':...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddStationRec(arr, i){\n\t\tif(i >= arr.length) return AddStationDataRec(dataArray,0);\n\t\tvar station = arr[i];\n\t\tPowerStation.findOneAndUpdate({ '_id': station._id}, {'$setOnInsert': station}, {upsert: true}, function(){\n\t\t\tAddStationRec(arr, i+1);\n\t\t});\n\t}", "function addStationNames(){\...
[ "0.60072726", "0.58481765", "0.5746197", "0.5733427", "0.5698432", "0.567814", "0.55355567", "0.550788", "0.5486431", "0.5481462", "0.54410344", "0.5350375", "0.5339503", "0.53140485", "0.5307077", "0.52734774", "0.5178904", "0.5166515", "0.51193494", "0.511919", "0.5105172",...
0.58297
2
recursive add all station
function AddStationRec(arr, i){ if(i >= arr.length) return AddStationDataRec(dataArray,0); var station = arr[i]; PowerStation.findOneAndUpdate({ '_id': station._id}, {'$setOnInsert': station}, {upsert: true}, function(){ AddStationRec(arr, i+1); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAll() {}", "function addStationNames(){\n\n\tvar stations = getWMATAStations(getStationID);\n}", "addAll(items) {\n if (items.length == 0) throw new Error(green('No data provided when adding a new node! [from: addAll()]'))\n\n for (let i = 0; i < items.length; i++) {\n this.addNode(items...
[ "0.6013721", "0.5909386", "0.5846324", "0.58290803", "0.5708793", "0.5704133", "0.5518948", "0.54638314", "0.53950274", "0.536793", "0.53492403", "0.53479505", "0.5338488", "0.5211997", "0.5202065", "0.5154406", "0.5100737", "0.51006615", "0.50508976", "0.50264364", "0.502091...
0.6195411
0
recursive add all site data
function AddSiteDataRec(arr, i){ if(i >= arr.length) return; var d = arr[i]; var tDay = new Date(d.time); var date = tDay.getFullYear()+"_"+(tDay.getMonth()+1)+"_"+tDay.getDate(); var WeatherData = mongoose.model('WeatherData_'+date, WeatherDataSchema); WeatherData.findOneAndUpdate({ '_id': d._id}, {'$setO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddSiteRec(arr, i){\n\t\tif(i >= arr.length) return AddSiteDataRec(dataArray,0);\t//add site data after all site added\n\t\tvar site = arr[i];\n\t\tWeatherStation.findOneAndUpdate({ '_id': site._id}, {'$setOnInsert': site}, {upsert: true}, function(){\n\t\t\tAddSiteRec(arr, i+1);\n\t\t});\n\t}", "functi...
[ "0.64785624", "0.6382151", "0.5985926", "0.58135265", "0.56933355", "0.5542384", "0.54409045", "0.5310655", "0.52775383", "0.52691025", "0.52672845", "0.52454656", "0.52335244", "0.51875776", "0.518413", "0.5109049", "0.5103593", "0.5071137", "0.5059281", "0.50586885", "0.503...
0.58285034
3