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
Set the width of the side navigation to 0 and the left margin of the page content to 0
function closeNav() { navigation.style.width = "0"; main.style.left = "0"; main.style.position = "static"; main.style.filter = "opacity(100%)"; triggered = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuOpenClicked() {\n document.getElementById('leftSideBar').style.left = \"0\";\n document.getElementById('emptyPage').style.left = \"0\";\n }", "function closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n document.getElementById(\"page-top\").style.marginLeft = \...
[ "0.6732244", "0.65784776", "0.6542038", "0.6463703", "0.6428192", "0.63462555", "0.63317776", "0.63291156", "0.63164407", "0.63146275", "0.6308091", "0.6303144", "0.62976974", "0.62976974", "0.62976974", "0.62976974", "0.62976974", "0.6291685", "0.62916666", "0.62916666", "0....
0.0
-1
This is a Greasemonkey user script. To install it, you need Greasemonkey 0.3 or later: Then restart Firefox and revisit this script. Under Tools, there will be a new menu item to "Install User Script". Accept the default configuration and install. To uninstall, go to Tools/Manage User Scripts, select "Remove Ambrosia",...
function getElementsByClass(node,searchClass,tag) { var classElements = new Array(); var els = node.getElementsByTagName(tag); // use "*" for all elements var pattern = new RegExp('\\b'+searchClass+'\\b'); for (var i = 0; i < els.length; i++) if ( pattern.test(els[i].className) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoUpdateFromUserscriptsDotOrg(SCRIPT) {\r\n \r\n // Update code from Junk Blocker: http://loonyone.livejournal.com/\r\n // usage example\r\n // autoUpdateFromUserscriptsDotOrg({\r\n // url: 'http://userscripts.org/scripts/source/688.user.js',\r\n // version: \"1.2\",\r\n // });\r\n\r\n try {...
[ "0.60837203", "0.59097445", "0.5830829", "0.58129704", "0.5731958", "0.5731958", "0.5687734", "0.5454211", "0.54484206", "0.54262656", "0.5418055", "0.5409261", "0.54020673", "0.5367743", "0.536529", "0.5346536", "0.53356117", "0.53194296", "0.53186715", "0.52580285", "0.5250...
0.0
-1
method to be executed when the scene preloads
preload() { this.load.image("playBG", "assets/img/Bouncy-play-bg.png"); this.load.image("score", "assets/img/Score.png") this.load.image("ground", "assets/img/ground.png"); this.load.image("ball", "assets/img/ball.png"); this.load.image("btn_next", "assets/img/NextLevel.png"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "preload(scene) {\n\n }", "function preload() {\n \n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload()\n{\n\t\n}", "function prelo...
[ "0.77408713", "0.73294914", "0.7319104", "0.7319104", "0.7319104", "0.7319104", "0.7319104", "0.7319104", "0.7319104", "0.7317578", "0.7296268", "0.72919655", "0.72489125", "0.72489125", "0.72489125", "0.72489125", "0.72489125", "0.72489125", "0.7196215", "0.71931285", "0.716...
0.0
-1
method to be executed once the scene has been created
create() { // this.events.on('transitionstart', function (fromScene, duration) { this.cameras.main.setZoom(0.001); }, this); this.events.on('transitioncomplete', function (fromScene, duration) { // this.cameras.main.zoomTo(1, 300); this.cameras.main.z...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCreate(scene, custom) {}", "initializeScene(){}", "prepareScene() {\n /* for example\n if (this.shouldShowObject) {\n this.pushToScene(this.obj);\n }\n */\n }", "create() {\n console.log('preload')\n this.scene.start('BoardView')\n \n \n //...
[ "0.75984246", "0.75901943", "0.72867495", "0.71860313", "0.7179152", "0.71727115", "0.716111", "0.7114791", "0.7104532", "0.7046133", "0.70216095", "0.7000977", "0.6996491", "0.6961534", "0.6927821", "0.6831509", "0.6824229", "0.6818092", "0.67678916", "0.6767652", "0.6752779...
0.6276458
86
method to be executed at each frame. Please notice the arguments.
update() { var isCollided = this.physics.overlap(this.platformGroup, this.ball, this.collision, null, this); this.checkGameOver(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beginFrame() { }", "function do_frame() {\n\t\t\tupdate_stats();\n\t\t\tif(!call_user_callbacks()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tdraw();\n\n\t\t\tmedeactx.frame_flags = 0;\n\t\t}", "function frame () {\n\tmap.frame();\n}", "frame() {\n throw new Error('Not implemented');\n }",...
[ "0.71851385", "0.6788062", "0.6781477", "0.67408514", "0.6663915", "0.6447706", "0.64271283", "0.6416869", "0.63900256", "0.63208497", "0.6315679", "0.63055205", "0.63055205", "0.6292895", "0.6284179", "0.62583196", "0.6213876", "0.61666316", "0.61666316", "0.61571014", "0.61...
0.0
-1
pure javascript to scale the game
function resize() { var canvas = document.querySelector("canvas"); var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; var windowRatio = windowWidth / windowHeight; var gameRatio = game.config.width / game.config.height; if (windowRatio < gameRatio) { canvas.style...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Scale () {}", "function tileScale() {\n var width = window.innerWidth * 0.15;\n var height = window.innerHeight * 0.2;\n var edge;\n\n //pick the smaller of relative height or width\n if(width < height) {\n edge = width;\n } else {\n edge =...
[ "0.743296", "0.71466416", "0.71261936", "0.71256554", "0.70506275", "0.6987447", "0.69595665", "0.69301206", "0.69113725", "0.6856296", "0.68131113", "0.674997", "0.6733888", "0.67163694", "0.6696239", "0.6694451", "0.6694226", "0.6664494", "0.6604224", "0.6602679", "0.659350...
0.63603467
41
this should route to and edit stats screen
render() { return ( <div className="gamefield hover-lightblue" onClick={() => { this.changeTarget({ type: 'game', id: this.props.data.id }); this.props.history.push({ pathname: '/creategame', state: { eventName: this.props.data.eventName, eventId: th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statsPage (req, res) {\n _renderWithCommonData(res, \"stats\", {\n recentlyUpdatedPackages: stats.getRecentlyUpdatedPackages(),\n recentlyRetrievedManifests: stats.getRecentlyRetrievedManifests(),\n recentlyUpdatedManifests: stats.getRecentlyUpdatedManifests()\n })\n}", "function renderShowRe...
[ "0.6216", "0.61176354", "0.5805126", "0.5741369", "0.56962985", "0.56778806", "0.56690145", "0.56325346", "0.56325346", "0.5599847", "0.5566354", "0.55550736", "0.55319446", "0.5531864", "0.55270606", "0.5509859", "0.5419094", "0.54189306", "0.53741413", "0.53735816", "0.5368...
0.0
-1
you're going to receive Vinyl files as chunks
function transform(file, cb) { gutil.log('Preprocessing:', file.path); // read and modify file contents var fileContents = String(file.contents); fileContents = fileContents.replace(/^\s*(import .*?)(?:;|$)/gm, function(str, group1) { return 'jsio("' + group1 + '");'; }); file.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readChunk(chunk) {\n // reder FLV header\n this._chunk = mergeBuffer(this._chunk, chunk);\n\n chunk = null;\n\n let tmpData, ab, view;\n\n this._bufferLen = this._chunk.byteLength;\n this._readLen = 0;\n\n\n while (this._bufferLen - this._readLen > 11) {\n\n\n ...
[ "0.6502095", "0.62703574", "0.61623466", "0.614145", "0.6083069", "0.605093", "0.605093", "0.60032696", "0.5945595", "0.5909005", "0.58173853", "0.5808928", "0.58074176", "0.5793694", "0.57865417", "0.57841164", "0.5781841", "0.5746427", "0.56981426", "0.569137", "0.5660805",...
0.0
-1
function to search for specific id
function myFunction(xml, sID) { var xmlDoc = xml.responseXML; //pick the tag var studEID = xmlDoc.getElementsByTagName('Stud_EID'); var termName, userName; //search for the tag for (i = 0; i < studEID.length; i++) { //cut off the useless data var numEID = studEID[i].getAttribut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchID(_id,list){\n for (let i = 0; i < list.length; i++){\n if (list[i]._id == _id){\n return list[i];\n }\n }\n return undefined;\n}", "function findById(source, id) {\n try {\n var resultObj = undefined;\n for (var i = 0; i < source.length; i++) {\n ...
[ "0.7531678", "0.7244657", "0.72221804", "0.7208471", "0.7139662", "0.7111526", "0.7044638", "0.6947894", "0.69171625", "0.6898184", "0.6885513", "0.68737304", "0.68439335", "0.68410623", "0.68224764", "0.680452", "0.6774079", "0.67533195", "0.67255926", "0.6725558", "0.669444...
0.0
-1
Works with node, but not the test. Why?
function recursiveBinarySearch(arr, element){ console.log(arr.length); let mid = Math.floor(arr.length / 2); let end = arr.length - 1; function helper(){ if (arr.length === 1 && arr[0] !== element) { console.log("value not found"); return -1; } if (arr[mid] === element) { console.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "test() {\n return true\n }", "function testNode() {\n return src(['test/test.js'], { read: false })\n .pipe(mocha({\n reporter: 'dot',\n exit: true,\n environment: 'node'\n }));\n}", "function test() {\n console.log(\"tested!\");\n}", "function ct_test() {\n retu...
[ "0.6492772", "0.6401908", "0.63983536", "0.63733065", "0.63652724", "0.623554", "0.61767185", "0.61309826", "0.6039295", "0.5972011", "0.5972011", "0.5949508", "0.58995044", "0.58651626", "0.5859128", "0.5851095", "0.5823079", "0.5776868", "0.5758978", "0.57248706", "0.570595...
0.0
-1
Get the preference value of type specified in PREFS
function getPref(key, aDefault) { // Cache the prefbranch after first use if (getPref.branch == null) getPref.branch = Services.prefs.getBranch(PREF_BRANCH); var prefType = getPref.branch.getPrefType(key); // underlying preferences object throws an exception if pref doesn't exist if (prefType ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPref(prefname, type){\n\treturn new Promise(function(resolve, reject) {\n\t\tvar branch = Services.prefs.getBranch(\"extensions.pagesigner.\");\n\t\tif (branch.prefHasUserValue(prefname)){\n\t\t\tif (type === 'bool'){\n\t\t\t\tresolve(branch.getBoolPref(prefname));\n\t\t\t}\n\t\t\telse if (type === 'st...
[ "0.7371419", "0.6284202", "0.62594277", "0.6191974", "0.6131054", "0.6126485", "0.6106813", "0.6071634", "0.60640633", "0.5937959", "0.5934746", "0.57862055", "0.5736354", "0.57089096", "0.56931514", "0.56545126", "0.5642929", "0.5642929", "0.56289977", "0.56109554", "0.56109...
0.61337996
4
Initialize default preferences specified in PREFS
function setDefaultPrefs() { console.debug("setDefaultPrefs CP1"); let branch = Services.prefs.getDefaultBranch(PREF_BRANCH); for (let key of Object.keys(PREFS)) { let val = PREFS[key]; console.debug("setDefaultPrefs CP2: key=" + key + " val=" + val); switch (typeof val) { case "boolean":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadDefaultPreferences() {\n \tfor (var key in defaultPreferences) {\n \t\t// Skip this ones.\n \t\tif (/firstrun|version|updatechecktime/.test(key))\n \t\t\tcontinue;\n\n \t\tpref.setPref(key, defaultPreferences[key]);\n \t}\n\n \tlog.info(\"prefs:\",\n \t\t\"Preferences are (re)setted to default...
[ "0.7718453", "0.64644045", "0.638662", "0.638662", "0.63146436", "0.6230216", "0.6230216", "0.6210272", "0.62054396", "0.6171967", "0.61111736", "0.6104633", "0.60745156", "0.59824306", "0.59704334", "0.5861557", "0.57969826", "0.57927054", "0.57920635", "0.5777696", "0.57274...
0.75871474
1
define video preview area
function definePreviewArea(media_preset_height, media_preset_widtht, fn) { var originalHeight = parseFloat(media_preset_height); var originalWidth = parseFloat(media_preset_widtht); // We customize image editor dimensions as real dimensions cant be shown. // on the page. Image di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function video() {\n\t\t$('#wrapper').fitVids();\n\t}", "function addVideo(x, y, size, video) {\n\tvar vid = new MultiWidgets.VideoWidget();\n\tvid.setWidth(size);\n\tvid.setHeight(size);\n\n\tif (vid.load(video)) {\n\t\tvid.addOperator(new MultiWidgets.StayInsideParentOperator());\n\t\t//vid.resizeToFit(new Nim...
[ "0.6701659", "0.6479938", "0.64300483", "0.6399042", "0.6395463", "0.6389428", "0.63594913", "0.6224044", "0.62061626", "0.613803", "0.6096348", "0.60880864", "0.6010033", "0.6008886", "0.6002573", "0.5989074", "0.5976506", "0.5975192", "0.597465", "0.59655344", "0.59605336",...
0.7323425
0
get text form data
function getTextFormData(obj){ var formData = {}; var genre = {}; var uploaded_thumb = {}; formData.fileName = obj.find('.favo-icon span.file-name').text(); formData.favourite = (obj.find('.favo-icon #favo').is(":checked")) ? 1 : 0; formData.title = obj....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_form_data() {\n var data = {};\n data[\"out\"] = $(\"#outcome-resp\").val();\n data[\"int\"] = $(\"#intervention-resp\").val();\n data[\"cmp\"] = $(\"#comparator-resp\").val();\n data[\"ans\"] = getCheckBoxSelection();\n data[\"res\"] = $(\"#reasoning-resp\").val();\n data[\"xml\"] = $(\"#reaso...
[ "0.62570626", "0.61936146", "0.61429167", "0.61429167", "0.6085766", "0.60720474", "0.60720474", "0.60720474", "0.5996752", "0.5996752", "0.59720933", "0.5966137", "0.594704", "0.59310853", "0.5929373", "0.5920713", "0.5911823", "0.5901626", "0.58593756", "0.58505666", "0.581...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.5275308", "0.5259251", "0.51914096", "0.51837224", "0.51258314", "0.5044666", "0.4894481", "0.4861732", "0.48405245", "0.48326182", "0.48245227", "0.48138928", "0.48060125", "0.4786252", "0.4785142", "0.47594094", "0.47513723", "0.47400674", "0.47274345", "0.4706265", "0.4...
0.0
-1
Tries to extend `availableOptions` with globals from config.
async beforeRun() { this._super.apply(this, arguments); // try to read global options from `config/crowdin.js` let configOptions = {}; let module = path.join(this.project.root, 'config', 'crowdin'); try { configOptions = require(module); if (typeof configOptions === 'function') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGlobalOptions(options) {\n if (typeof options !== 'object') {\n throw new TypeError('\"options\" argument needs to be an object!');\n }\n logSettings_1.logger.info('\"setGlobalOptions\" got called with', options);\n for (const key of Object.keys(options)) {\n data_1.globalOpti...
[ "0.5978611", "0.59215635", "0.5920889", "0.5920889", "0.5896164", "0.58843094", "0.5880014", "0.5880014", "0.5813602", "0.57240665", "0.56928253", "0.5592457", "0.5574795", "0.5548993", "0.5503961", "0.54357976", "0.54258054", "0.53982675", "0.537982", "0.5376453", "0.5349303...
0.0
-1
The view model for the main content view template
function loginContentViewModel(params) { var self = this; if (params){ var router = params.parentRouter; var parentViewModel = params.parent; } console.log('login page'); self.userName = ko.observable(); self.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function settingsContentViewModel() {\r\n var self = this;\r\n \r\n console.log('learning page');\r\n self.routeTo = function(data, event) {\r\n var id = event.currentTarget.id.toLowerCase();\r\n router.go(id);\r\n };\r\n \r\n self.logout = fun...
[ "0.71158373", "0.67503697", "0.66674316", "0.6665802", "0.65989715", "0.65345395", "0.63465166", "0.6331975", "0.63310724", "0.6251686", "0.6251686", "0.6251686", "0.6251686", "0.6251686", "0.6251686", "0.6251686", "0.6251686", "0.623621", "0.61638284", "0.6153544", "0.613398...
0.0
-1
Called for each vertex of tesselator output
function vertexCallback(data, polyVertArray) { if (tesselator.z != null) { polyVertArray.push([data[0], data[1], tesselator.z]); } else { polyVertArray.push([data[0], data[1]]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process_vertex(v){\n console.log(\"processed vertex \",v);\n}", "function mxVertexToolHandler(state) {\n mxVertexHandler.apply(this, arguments);\n }", "function list_vert()\n{\n var i, v; // local vars\n for (i=0; i < this.nv; i++)\n {\n v = this.vert[i];\n docume...
[ "0.6400669", "0.61237454", "0.5839593", "0.5723201", "0.57039607", "0.564503", "0.5614827", "0.5571359", "0.55227154", "0.5492472", "0.54854614", "0.54682744", "0.5446714", "0.5441967", "0.54204094", "0.53652847", "0.53621066", "0.53587073", "0.53587073", "0.53572744", "0.533...
0.6074759
2
Called when segments intersect and must be split
function combineCallback(coords, data, weight) { return coords; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inSegment(xP, yP) {\r\n }", "function segment(line, intersect1, intersect2) {\n this.line = line;\n this.intersect1 = intersect1;\n this.intersect2 = intersect2;\n }", "function __WEBPACK_DEFAULT_EXPORT__(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = ...
[ "0.68271095", "0.6430691", "0.6362841", "0.6362841", "0.6326505", "0.62750685", "0.6260522", "0.62164336", "0.618618", "0.61797285", "0.6149279", "0.614169", "0.61298203", "0.60514724", "0.6048949", "0.6030679", "0.60219526", "0.60206515", "0.6018837", "0.5975982", "0.5955972...
0.0
-1
Called when a vertex starts or stops a boundary edge of a polygon
function edgeCallback(flag) { // No-op callback to force simple triangle primitives (no triangle strips or fans). // See: http://www.glprogramming.com/red/chapter11.html // "Since edge flags make no sense in a triangle fan or triangle strip, if there is a callback // asso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PolygonEdge() {\n}", "function ShapeEdge(polygon, vertex1, vertex2) {\n this.init(polygon, vertex1, vertex2);\n}", "function polygonStart(){activeStream=bufferStream,segments=[],polygon=[],clean=true}", "function polygonStart() {\n\t activeStream = bufferStream, segments = [], polygon = []...
[ "0.68552554", "0.6632995", "0.6205987", "0.6015016", "0.6015016", "0.6015016", "0.5969547", "0.5969547", "0.5969547", "0.5969547", "0.5969547", "0.58993", "0.5891824", "0.5891824", "0.5891824", "0.5891824", "0.5891824", "0.5891824", "0.5891824", "0.5891824", "0.5891824", "0...
0.532606
78
Get user All Tasks
profile (state, getters) { return state.profile.filter(prof => { return prof.user === getters.user.id }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllTask() {\n\tlet tasks = [];\n\taxios.get('/tasks').then(response => {\n\t\ttasks = response.data.slice();\n\t} );\n\treturn tasks;\n}", "getTasks() {\n return this.client({\n path: this.urls[`${this.name}_list`](),\n method: 'GET',\n });\n }", "function getAllTasks(callback) {\n...
[ "0.7776672", "0.7513335", "0.74391663", "0.7232904", "0.7226699", "0.71886927", "0.71875024", "0.7132958", "0.7114605", "0.70973396", "0.70873225", "0.7078446", "0.69577086", "0.6950265", "0.69323385", "0.6833607", "0.67739034", "0.6763091", "0.6754393", "0.6746642", "0.67461...
0.0
-1
Normalize a port into a number, string, or false.
function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port)) { // named pipe return val; } if (port >= 0) { // port number return port; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalizePort(val){\n /**\n * Normalize a port into a number, string, or false.\n */\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port...
[ "0.8447829", "0.8434019", "0.84244335", "0.84021133", "0.839478", "0.8393871", "0.8387596", "0.83836704", "0.8378557", "0.8378557", "0.83705777", "0.83705777", "0.83705777", "0.83705777", "0.83705777", "0.83705777", "0.8369869", "0.8367452", "0.8359665", "0.8358353", "0.83579...
0.0
-1
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== "listen") { throw error; } var bind = typeof port === "string" ? "Pipe " + port : "Port " + port; // handle specific listen errors with friendly messages switch (error.code) { case "EACCES": console.error(bind + " requires elevated privileges"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + '...
[ "0.711881", "0.70566845", "0.70339173", "0.70245737", "0.6966677", "0.6882608", "0.68557006", "0.6831554", "0.6821302", "0.6810926", "0.67881936", "0.67819554", "0.6781313", "0.6769876", "0.6767184", "0.6751852", "0.6706936", "0.6702404", "0.6660371", "0.66565484", "0.6645408...
0.0
-1
Event listener for HTTP server "listening" event.
function onListening() { var addr = server.address(); var bind = typeof addr === "string" ? "pipe " + addr : "port " + addr.port; debug("Listening on " + bind); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' +...
[ "0.7853947", "0.7739898", "0.76331675", "0.7536398", "0.7531618", "0.73409474", "0.7333692", "0.73031056", "0.7302059", "0.7282745", "0.7271728", "0.7230515", "0.72269624", "0.716162", "0.7126002", "0.7120096", "0.71049017", "0.70975614", "0.7081675", "0.70730674", "0.7071937...
0.696101
49
Returns the number of orders that exist for the shop at baseUrl.
function getOrderCount (baseUrl, token) { const url = `${baseUrl}/admin/orders/count.json?&access_token=${token}`; return fetchJson(url) .then(data => data.count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrderItemsCount() {\n AppOrdersService\n .getItemOrderedCount()\n .then(count => {\n vm.ItemOrderedCounter = count;\n });\n }", "getProductsCount() {\n return this.$fetch('GET', 'catalog/products/count', { auth: 'tok...
[ "0.6154481", "0.5789688", "0.57558846", "0.5690409", "0.566922", "0.5641448", "0.5617066", "0.5591948", "0.5559031", "0.55300677", "0.5524032", "0.55076945", "0.5456228", "0.5455127", "0.5419473", "0.534676", "0.53392094", "0.530262", "0.52941567", "0.5289073", "0.527323", ...
0.7077561
0
Returns an array containing all the orders for the shop specified by baseUrl
function getOrders(baseUrl, token) { const ordersPerPage = 250; return getOrderCount(baseUrl, token) .then(numOrders => Math.ceil(numOrders/ordersPerPage)) .then(retrieveOrders); /** Returns an array containing all the orders in the first numPages pages at the /orders endpoint *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllOrders() {\n let dataURL = `${_environments_environment__WEBPACK_IMPORTED_MODULE_1__[\"environment\"].apiURL}/order/all`;\n return this.httpClient.get(dataURL).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"retry\"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError...
[ "0.64321476", "0.639127", "0.6256156", "0.6185286", "0.6083997", "0.59936696", "0.59926695", "0.5912071", "0.58778757", "0.57900244", "0.5774568", "0.5774459", "0.5748209", "0.5730409", "0.57158804", "0.5713351", "0.56969446", "0.5691198", "0.563711", "0.56236076", "0.5593169...
0.73047626
0
Returns an array containing all the orders in the first numPages pages at the /orders endpoint
function retrieveOrders(numPages) { const apiCalls = []; for(let pg = 1; pg <= numPages; pg++) { let url = `${baseUrl}/admin/orders.json?page=${pg}&limit=${ordersPerPage}&access_token=${token}`; apiCalls.push(fetchJson(url)); } return Promise....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orders(page = 1) {\n if(typeof page !== 'number') throw new TypeError(\"Parameter 'page' must be of type Number\")\n return this.#request(`Orders?page=${page}`, 'GET');\n }", "function getOrders(baseUrl, token)\n{\n const ordersPerPage = 250;\n return getOrderCount(baseUrl, token)\n ...
[ "0.75867784", "0.7037776", "0.6657518", "0.6589866", "0.6541475", "0.6343236", "0.61436", "0.6049799", "0.6032981", "0.59714544", "0.5933292", "0.58630824", "0.5844035", "0.58392674", "0.58232886", "0.57906413", "0.57427", "0.5702006", "0.5684494", "0.56498885", "0.56146187",...
0.80194575
0
Performs a GET request to a JSON endpoint
function fetchJson(url) { return fetch(url) .then(res => res.json()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsonGet(url, args, access_token, cb) {\n if (args != null) {\n url = url + '?' + stringify(args)\n }\n const req = request(\n url,\n {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ...
[ "0.7281366", "0.71191865", "0.7035289", "0.7008555", "0.700429", "0.690338", "0.68881404", "0.6877647", "0.6822189", "0.6811767", "0.68027174", "0.6735663", "0.6713828", "0.67118", "0.6708293", "0.6708293", "0.6708293", "0.6708293", "0.6708293", "0.6666848", "0.66411865", "...
0.0
-1
name, email, password, confirm password, signup button
render() { const style = { anchorOrigin: { vertical: "top", horizontal: "left" }, menuLabelStyle: { fontSize: "18px", color: "rgba(255,255,255,.8)" }, tab: { color: "white"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "signUp() {\n I.fillField(this.signupLocators.fullName, 'SignUpOrgAdmin');\n I.fillField(this.signupLocators.email, 'signup-admin@mail.com');\n I.fillField(this.signupLocators.password, 'SECRET123');\n I.fillField(this.signupLocators.confirmPassword, 'SECRET123');\n I.click(this.signupLocators.toggle...
[ "0.7038288", "0.70295244", "0.65888596", "0.65805477", "0.65487635", "0.6537264", "0.6504354", "0.650171", "0.650171", "0.6485345", "0.6438257", "0.64219624", "0.6416767", "0.6405762", "0.63915974", "0.63799405", "0.63608694", "0.63441664", "0.63440615", "0.6334762", "0.63224...
0.0
-1
Center the main slider
function centerSlider() { var mainSlider = jQuery("#main-slider"), imageSlider = jQuery("#image-slider"), imageHeight = imageSlider.height(), imageWidth = imageSlider.width(), sliderHeight = mainSlider.height(), sliderWidth = mainSlider.width(); mainSlider.css({ "left": imageWidth/2 - slid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centerSlideWhenZoomedIn() {\n $('.active').css({\n \"top\": ($(window).height() - $('.active').outerHeight()) / 2,\n \"left\": calculateEdgeWidth()\n });\n }", "centerSelected(event) {\n\t\tlet element = document.querySelector('.slide img#active')\n\t\tlet scrollMax = this.slider.scroll...
[ "0.7315643", "0.70670354", "0.6850917", "0.68502456", "0.6750638", "0.67451227", "0.6650998", "0.65727437", "0.6468164", "0.64610255", "0.6343418", "0.63190573", "0.6312208", "0.62919164", "0.6244352", "0.6222714", "0.6222714", "0.6222714", "0.62180704", "0.6212337", "0.61817...
0.84369993
0
Write a function that determines whether a given year is a leap year. If a year is divisible by four, it is a leap year, unless it is divisible by 100. However, if it is divisible by 400, then it is.
function leapYear(year) { //...divisible by four but not by 100 - leap year if(year % 4 == 0 && year % 100 !== 0) { console.log('Leap Year'); } //...divisible by 400 - leap year else if(year % 400 == 0) { console.log('Leap Year'); } else { console.log('Not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leapYear(year) {\n //leap year --> divisible by 4 but not 100 or is divisible by 400\n console.log((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\n}", "function isLeapYear(year){\n // return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0\n //divible by 4 it is\n //divisbl...
[ "0.88267916", "0.87388855", "0.86390984", "0.86235785", "0.86174667", "0.8612191", "0.8594522", "0.85632807", "0.8557138", "0.8508489", "0.84955585", "0.8484525", "0.84616315", "0.8445708", "0.84088165", "0.8404901", "0.8400713", "0.83980536", "0.83978885", "0.83843565", "0.8...
0.8743536
1
method to get users.
getUsers(){ axios.get('http://jsonplaceholder.typicode.com/posts') .then(response => { console.log('response:',response.data); this.setState({ employees: response.data }) }) .catch(error => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getUsers() {\n return await this.request('users/', 'get');\n }", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "function getUsers() {\r\n ...
[ "0.86342275", "0.8479529", "0.82516026", "0.8219634", "0.82154423", "0.81891274", "0.8178068", "0.8165653", "0.8139314", "0.813503", "0.8122656", "0.81152624", "0.81027263", "0.8098703", "0.8077418", "0.806811", "0.8050851", "0.8040918", "0.80316764", "0.80214125", "0.7998190...
0.0
-1
on load od component this method will be called.
componentDidMount() { this.getUsers(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onload() {\n this.init();\n }", "function onInit() {\n loadData();\n manageBag();\n}", "onComponentConstructed() {}", "onComponentConstructed() {}", "componentWillLoad() {\n this.base = new baseComponent_esm.BaseComponent(this, core.dxp);\n if (this.textList.length > 0...
[ "0.7047824", "0.6977611", "0.6871674", "0.6871674", "0.6858101", "0.6811359", "0.6635818", "0.66335946", "0.6619617", "0.660843", "0.65918434", "0.65353906", "0.641165", "0.6404184", "0.6396676", "0.6391722", "0.63886076", "0.63807744", "0.6379364", "0.63674676", "0.6359628",...
0.0
-1
! vuei18n v7.6.0 (c) 2018 kazuya kawaguchi Released under the MIT License.
function r(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function en(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&conso...
[ "0.74263257", "0.7372459", "0.7335513", "0.7335513", "0.7335513", "0.7335513", "0.7310968", "0.7310968", "0.72918266", "0.7247342", "0.72362447", "0.7227124", "0.7204521", "0.7195621", "0.7177685", "0.7177685", "0.7177685", "0.7172366", "0.7171141", "0.7168472", "0.71624774",...
0.6818309
62
Se ejecuta cuando todo esta cargado
function init() { console.debug("Document Load and Ready"); listener(); initGallery(); cargarAlumnos(); // mejor al mostrar la modal // cargarCursos(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ejecutarBusqueda(nuevotitulo)\n\t{\n\t\tconsole.log(\"entre a buscar\");\n\t\tBuscarPeliculas.invocarPeliculas(nuevotitulo,this.okBusquedaPeli,this.failBusqueda);\n\t\t\n\t}", "function ejecutar(){\n Concurrent.Thread.create(caballo,\"inputCaballo1\",\"metrosRecorridos1\",100000);\n Concurrent.Thread.c...
[ "0.6462407", "0.6460466", "0.6360554", "0.6360554", "0.6250294", "0.61797786", "0.6076816", "0.6076816", "0.60432464", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", "0.6035412", ...
0.0
-1
init Inicializamos los listener de index.hml 1) selector de sexo y busqueda por nombre 2) filtro de cursos 3) modal
function listener() { // 1 let selectorSexo = document.getElementById("selectorSexo"); let inputNombre = document.getElementById("inombre"); selectorSexo.addEventListener("change", filtro); inputNombre.addEventListener("keyup", filtro); // 2 filtro de cursos let filtroCursos = document.getElementById("f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n \n \n mostrarForm(false);\n listar();\n }", "function PopupFiltros(){\n\n this.$modal = $('#modal_filtro')\n this.$numero_empleado = $('#id_numero_empleado')\n this.$oficina = $('#id_oficina_empleado')\n this.$asunto = $('#id_asunto')\n this.$status = ...
[ "0.6849527", "0.6629811", "0.64632446", "0.6293968", "0.6293914", "0.6253622", "0.6250557", "0.62213594", "0.61506325", "0.6139554", "0.6139285", "0.6125255", "0.6121568", "0.6119068", "0.61182225", "0.61093885", "0.60938394", "0.60247344", "0.59610295", "0.59527016", "0.5945...
0.64975995
2
listener Filtra las personas cuando se buscan por sexo y nombre
function filtro() { let selectorSexo = document.getElementById("selectorSexo"); let inputNombre = document.getElementById("inombre"); const sexo = selectorSexo.value; const nombre = inputNombre.value.trim().toLowerCase(); console.trace(`filtro sexo=${sexo} nombre=${nombre}`); console.debug("personas %o", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userOnline(name, socket) {\n for (let index = 0; index < thongTinNguoiDung.length; index++) {\n if (thongTinNguoiDung[index].name === name) {\n thongTinNguoiDung[index].id = socket.id;\n socket.emit(\"nguoi-lien-he\", thongTinNguoiDung[index]);\n socket.emit(\n \"notify-request-f...
[ "0.61875385", "0.60485375", "0.6004113", "0.59288865", "0.58747274", "0.58692455", "0.58669555", "0.5808448", "0.5756679", "0.5749263", "0.5748598", "0.5725784", "0.5723665", "0.5696726", "0.56670547", "0.5638245", "0.5634309", "0.56311005", "0.5599795", "0.5595822", "0.55558...
0.5117592
98
cargarCursos Obtiene los datos del servicio rest y pinta la lista de Alumnos
function cargarAlumnos() { console.trace("cargarAlumnos"); const url = endpoint + "personas/"; const promesa = ajax("GET", url, undefined); promesa .then((data) => { console.trace("promesa resolve"); personas = data; maquetarLista(personas); }) .catch((error) => { console.war...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getTodosLosSensores() {\n var textoSQL = \"select * from Sensor\";\n console.log(\"logica: getTodosLosSensores\")\n return new Promise((resolver, rechazar) => {\n this.laConexion.all(textoSQL, {},\n (err, res) => {\n (err ? rechazar(err) : resolver(res))\n })\n })\n }...
[ "0.63855976", "0.6302893", "0.6291026", "0.62889063", "0.62347525", "0.62154007", "0.6187558", "0.61224014", "0.6112032", "0.61022234", "0.6091418", "0.6062924", "0.6062027", "0.6055973", "0.6038834", "0.60284764", "0.6017901", "0.5998938", "0.5976688", "0.5965708", "0.595976...
0.64514244
0
seleccionar Llama al servicio Rest para hacer un POST ( id == 0) o PUT ( id != 0 )
function guardar() { console.trace("click guardar"); let id = document.getElementById("inputId").value; let nombre = document.getElementById("inputNombre").value; let avatar = document.getElementById("inputAvatar").value; //sexo, si no esta marcado el de hombre, sera mujer let sexo = document.getElementByI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gravar(){\n \n if(id.value == \"\"){\n let msg \n fetch(URL_BASE, {\n method :'POST',\n body:'nome='+nome.value+'&email='+email.value+'&tipo='+tipo.value,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n...
[ "0.61154", "0.5987986", "0.59700125", "0.5944457", "0.5882341", "0.58574665", "0.57372224", "0.56955665", "0.5692096", "0.56853837", "0.56841934", "0.5676419", "0.564628", "0.56351966", "0.56224364", "0.5609213", "0.5605989", "0.56035537", "0.55932987", "0.5590259", "0.558028...
0.0
-1
guardar Carga todas las imagen de los avatares
function initGallery() { let divGallery = document.getElementById("gallery"); for (let i = 1; i <= 7; i++) { divGallery.innerHTML += `<img onclick="selectAvatar(event)" class="avatar" data-path="img/avatar${i}.png" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cambiarImagenes() { \n\n var arrayimagenesbatalla = new Array();\n arrayimagenesbatalla[0] = \"./assets/images/batallaindex.jpg\";\n arrayimagenesbatalla[1] = \"./assets/images/batallaindex2.jpg\";\n arrayimagenesbatalla[2] = \"./assets/images/batallaindex3.jpg\";\n arrayimagenesbatalla[3]...
[ "0.7271825", "0.70194566", "0.69824594", "0.69778675", "0.6919676", "0.6794326", "0.6792281", "0.66598254", "0.6625485", "0.6615905", "0.6608769", "0.6588634", "0.6586883", "0.65741235", "0.65489703", "0.6545836", "0.65394616", "0.6532719", "0.652316", "0.6504596", "0.6498811...
0.0
-1
DATATYPES HooverSheet. Topmost container.
function HooverSheet(title, user, language, shared, editable) { var me = this; this.title = title; this.owner = user; this.creationTime = new Date(); this.lastModifiedTime = new Date(); if (!language) { this.language = "en"; } else { this.language = language; } this.guid ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function section1LeftTop( placeholder )\n {\n var ph = placeholder || {};\n\n ph.stack = fmethods.initTopPaneCell( \"Summary\" );\n ph.stack[1] = {\n image: imagesRack.loadedImages[ 'summary-table00' ].dataURI\n //fit: [444.0, 333.0],\n ,width: 4...
[ "0.62287176", "0.5855119", "0.5855119", "0.58360124", "0.5650506", "0.56209993", "0.56037736", "0.55906963", "0.55357474", "0.5509673", "0.5508652", "0.5492654", "0.5464073", "0.5464073", "0.5453749", "0.54346484", "0.5422772", "0.54013765", "0.53738683", "0.53607345", "0.534...
0.0
-1
Registers events for minimizing, maximizing and removing a blip.
function registerMinMaxRemEvents(sheetId, pageId, noteId){ // Register events for page buttons Utils.log(0, "view.registerMinMaxRemEvents: " + sheetId + "|" + pageId + "|" + noteId); var debugOut = "view.registerMinMaxRemEvents: min > "; var idStr = Utils.assembleID(sheetId, pageId, noteId, MINI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addResizeListeners() {\n window.addEventListener('resize', deboucedResizeHandler);\n }", "function removeResizeListeners() {\n window.addEventListener('resize', deboucedResizeHandler);\n }", "_events() {\n $(window).on('resize.zf.interchange', Foundation.util.throttle(() => {\n ...
[ "0.6316694", "0.5920506", "0.5890393", "0.58164823", "0.5814827", "0.5796152", "0.57691073", "0.57461023", "0.57354075", "0.5731521", "0.5730938", "0.57235014", "0.57029754", "0.56549704", "0.5568936", "0.5560095", "0.5520658", "0.55061954", "0.55058444", "0.5469425", "0.5459...
0.546937
20
ENSURE functions Ensure functions make sure that a certain GUI element that is needed for further processing is present. Paints a page container for the tab in focus, if not there yet.
function ensurePageForFocusedTab (sheetId, pageId, pageUrl, pageTitle, isCheckNewPage){ // var url = Utils.getCurrentPageURL(); // var urlTitle = Utils.getCurrentPageTitle(); Utils.log(1, "view.ensurePageForFocusedTab: Ensuring page for " + pageUrl); // Get the HooverPage object for this URL. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareJavaTab(){\n bindRangeSlider()\n populateMemoryStatus()\n}", "function createAnnotationTabPages() {\n\n // Create a new cell for the tab page\n //var table_row = document\n // .getElementById(\"symbol_table\")\n // .getElementsByTagName(\"tbody\")[0]\n // .getElement...
[ "0.5764297", "0.570178", "0.5675239", "0.55707276", "0.55683875", "0.5521482", "0.54732686", "0.54700553", "0.5462457", "0.54367125", "0.5397413", "0.538867", "0.5382673", "0.53509766", "0.53423935", "0.5338977", "0.53375536", "0.5297509", "0.52868706", "0.5285858", "0.528435...
0.6280674
0
Creates a div corresponding to the new note and appends it to the slide bar.
function ensureNoteBlip (sheetId, pageId, note){ Utils.log(0, "ensureNoteBlip: " + note.noteGuid + ", type " + note.getType()); var htmlString = Utils.replaceIDsInHTMLStr(sheetId, pageId, note.noteGuid, NOTE_HTML); var imgStr = MOVE_LOGO; if (note.getType() == ANNOTATED_NOTE){ imgStr = A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNotes(){\n //i++;\n //var textfield=document.querySelector('.textfield');\n var noteslist=document.querySelector('.notesList');\n var textarea=document.querySelector('.textarea').value;\n var note=document.createElement('div');\n \n // note.id=\"div\"+i;\n var content=document.cr...
[ "0.71476215", "0.6977938", "0.69662994", "0.69601685", "0.6796725", "0.67805374", "0.67790383", "0.6758363", "0.6724086", "0.6697676", "0.66599846", "0.665737", "0.664689", "0.66143656", "0.6606672", "0.6597189", "0.65794957", "0.65705615", "0.65314114", "0.651001", "0.650923...
0.0
-1
MOVE, HIGHLIGHT, ANNOTATE Accepts text and html and creates a moved HooverNote.
function moveAsNote(text, html){ if (!text && !html){ Utils.log(3, "No valid text selected!"); } else { var url = Utils.getCurrentPageURL(); var urlTitle = Utils.getCurrentPageTitle(); hnCtrl.addNewNote(html, false, null, null, url, urlTitle, MOVED_NOTE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightAsNote(text, html){\n if (!text && !html){\n Utils.log(3, \"No valid text selected!\");\n } else {\n var url = Utils.getCurrentPageURL();\n var urlTitle = Utils.getCurrentPageTitle();\n hnCtrl.addNewNote(html, true, \"yellow\", null, url, urlTitle, HIGHLIGHTED_NOTE);\n ...
[ "0.6192145", "0.6184803", "0.6028841", "0.5830943", "0.57780266", "0.5767419", "0.56895447", "0.5636966", "0.5619429", "0.5579738", "0.5469045", "0.5448842", "0.5448128", "0.5402181", "0.539707", "0.5387327", "0.53858185", "0.53804487", "0.5345727", "0.5337359", "0.53338647",...
0.7282939
0
Accepts text and html and creates a highlighted HooverNote.
function highlightAsNote(text, html){ if (!text && !html){ Utils.log(3, "No valid text selected!"); } else { var url = Utils.getCurrentPageURL(); var urlTitle = Utils.getCurrentPageTitle(); hnCtrl.addNewNote(html, true, "yellow", null, url, urlTitle, HIGHLIGHTED_NOTE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function annotateAsNote(text, html){\n if (!html){\n Utils.log(3, \"No valid text selected!\");\n } else {\n var url = Utils.getCurrentPageURL();\n var urlTitle = Utils.getCurrentPageTitle();\n hnCtrl.addNewNote(html, false, null, text, url, urlTitle, ANNOTATED_NOTE);\n }\n }", "fun...
[ "0.69366455", "0.616027", "0.61197567", "0.60739905", "0.6051005", "0.6039872", "0.6026235", "0.6002661", "0.5991159", "0.59703785", "0.5945234", "0.59290725", "0.5928926", "0.5866301", "0.58567435", "0.5836592", "0.5820365", "0.5805085", "0.57899934", "0.5735957", "0.5735189...
0.79763824
0
Accepts text and html and creates an annotated HooverNote.
function annotateAsNote(text, html){ if (!html){ Utils.log(3, "No valid text selected!"); } else { var url = Utils.getCurrentPageURL(); var urlTitle = Utils.getCurrentPageTitle(); hnCtrl.addNewNote(html, false, null, text, url, urlTitle, ANNOTATED_NOTE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n /...
[ "0.6643301", "0.6616803", "0.6469289", "0.6429694", "0.6409119", "0.63513416", "0.62755495", "0.6264114", "0.6172108", "0.61498916", "0.60281706", "0.6021308", "0.60039777", "0.60001904", "0.59694266", "0.591237", "0.58797073", "0.5873375", "0.58706975", "0.5865204", "0.58118...
0.7520147
0
Handler to call on window resize
function handleResize() { // Set window width/height to state setWindowSize({ width: window.innerWidth, height: window.innerHeight, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onWindowResize() {\n\n\t\t\t}", "function onWindowResize() {\n updateSizes();\n }", "function onWindowResize() {\n\tonAggregateResize();\n}", "function edgtfOnWindowResize() {\n }", "onResize () {}", "onWindowResize() {\n\t\tthis.windowHeight = this.getWindowHeight();\n\t\tthis.updatePosi...
[ "0.87321997", "0.8683529", "0.83361626", "0.83318853", "0.8291285", "0.81736803", "0.81348217", "0.8123529", "0.810275", "0.80989", "0.80720466", "0.8034636", "0.7989424", "0.78245544", "0.7814024", "0.78111494", "0.7800373", "0.7796291", "0.7774407", "0.7746661", "0.76973426...
0.76107216
31
Principle 1 code example for Window Binding
function sayAge () { console.log(`My age is ${this.age}`) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenWindow() {\n this.initDefaultUI();\n this.initFastClick();\n this.setMoblie();\n }", "function Window() {}", "function windowbinding() {\n console.log(this);\n}", "onOpenedWindow() {\n throw new NotImplementedException();\n }", "function windowBind (param) {\n console.log(this);\n...
[ "0.6708435", "0.6286664", "0.62779236", "0.61939377", "0.61888003", "0.60452956", "0.6039229", "0.6009125", "0.5941998", "0.592551", "0.59144175", "0.58645284", "0.58612055", "0.58260834", "0.5783843", "0.5771466", "0.5730992", "0.57171625", "0.5713832", "0.57082963", "0.5684...
0.0
-1
Principle 3 code example for New Binding
function mrUser (name, age) { this.name = name this.age = age }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function NewBinding(message, name) {\nthis.name = name;\nthis.message = message;\nthis.say = function(){\n return `${this.name} has a message for you: ${this.message}.`\n}\n}", "function BindFactory(){}", "function moduleBinding(name, bindings){\n this.name =...
[ "0.698796", "0.6886641", "0.67846656", "0.6199463", "0.6164088", "0.6138222", "0.6113939", "0.6056126", "0.6036928", "0.6033827", "0.5981804", "0.5923785", "0.58911276", "0.58911276", "0.58724844", "0.58724844", "0.5850089", "0.5835462", "0.581962", "0.5773562", "0.5723497", ...
0.0
-1
Principle 4 code example for Explicit Binding
function greet() { console.log(`Hello, my name is ${this.name}`) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function Bind_A_A_A() {\r\n}", "function Bind_A_Oother() {\r\n}", "function Bind_A_Obound() {\r\n}", "function bindable(){\n\t\t\n\t}", "Bind(IDispatch, string, string) {\n\n }", "constructor() { \n autoBind(this); \n }", "function Bind_A_A_R() {\r\n}"...
[ "0.64452696", "0.6241764", "0.6148236", "0.61334085", "0.6116826", "0.60385936", "0.6022818", "0.59581673", "0.5939418", "0.5874121", "0.5871253", "0.5854111", "0.5762763", "0.5675331", "0.56727093", "0.56533575", "0.56533575", "0.56533575", "0.56172943", "0.5592227", "0.5536...
0.0
-1
default show and hide methods for the color picker. these functions are called in the context of the Colorpicker object.
function dfShow($items, defer) { var fulltime = $items.length * 40; _.each($items, function(item, index) { setTimeout(function() { $(item).animate({ opacity: 1 }, 450); }, index * 40); }); setTimeout(function() { defer.resolve(); }, fulltime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showColorPicker(){\n var self = $(this);\n cw.input(this);\n cw.onchange(function(){\n var color = self.val();\n self.css({color: color, 'background-color': color});\n });\n $('#color_popup').bPopup({modalColor: 'transparent'});\n}", "function init_ColorPicker() {\n\n\t\t\ti...
[ "0.6990289", "0.6530105", "0.652439", "0.6507564", "0.6430123", "0.6297", "0.6210175", "0.614122", "0.6106858", "0.60880375", "0.6068985", "0.6022691", "0.60218084", "0.59760565", "0.5921331", "0.5874708", "0.5823951", "0.5816934", "0.5816855", "0.58036923", "0.5751805", "0...
0.0
-1
Rewritten to ES5, changed case of variables, trimmed a bit. As released it doesn't work with webpack.
function validate(event, callback) { if (typeof event !== "string" || typeof callback !== "function") { throw new Error("Invalid Arguments"); } this.events[event] = this.events[event] || []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function es6(){\n return {\n name: 'ECMAScript (ES5)',\n release: 2009\n };\n}", "function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd) {\n\t return (`\\nimport { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue'\\n` +\n\t `const __injectCSSVars__ = () => {\\n${genCssVarsCode(...
[ "0.59285593", "0.56279707", "0.5606144", "0.55999416", "0.55999416", "0.55999416", "0.55999416", "0.55802673", "0.55264723", "0.54574275", "0.5437675", "0.5437675", "0.5333382", "0.5260328", "0.5239535", "0.5217166", "0.5182199", "0.51597106", "0.5151058", "0.51474714", "0.51...
0.0
-1
setup() set up all variables and make objects draggable when the game starts
function setup() { //assign all variables to objects $cow = $('#cow'); $info1 = $('#infoBox1'); $info2 = $('#infoBox2'); $info3 = $('#infoBox3'); $info4 = $('#infoBox4'); $info5 = $('#infoBox5'); $info6 = $('#infoBox6'); $cow.click(pet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup(){\n\tinitVars(); \n\tinitCanvas(); \n\tinitObjects(); \n\tinitListeners(); \n\n}", "function setup(){\n\tinitVars();\n\tinitCanvas();\n\tinitObjects();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n cursor(CROSS);\n \n // initial positions, use the mouse to move\n pl...
[ "0.72106403", "0.712362", "0.71088034", "0.70792115", "0.7023183", "0.700116", "0.6933462", "0.69328105", "0.68973285", "0.6891273", "0.6853804", "0.68492454", "0.6834571", "0.6831296", "0.67914724", "0.67809665", "0.6777983", "0.6777983", "0.6766547", "0.6754014", "0.6742233...
0.0
-1
pet() pet the animal <3
function pet() { clickNumber += 1; moo.play(); console.log("ready"); console.log(clickNumber); $('#numberBox').html("X " + milk); $cow.attr(`src`, `assets/cow1.gif`); if (clickNumber > 6) { $info6.css(`display`, `none`); clickNumber = 1; milk = milk + 1; return; } if (clickNumber ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pet(animal) {\n console.log(`My puppy's name is ${animal}!`)\n}", "function findShaggysPet(pet) {\n return pet.ownerName == \"Shaggy\";\n}", "function Pet(name,birthday,food,activities) {\r\n this.name = name;\r\n this.birthday = birthday;\r\n this.food = food;\r\n this.activities = activiti...
[ "0.63925844", "0.6305045", "0.62310946", "0.6210552", "0.6193657", "0.614843", "0.61283314", "0.6126435", "0.6104809", "0.6101631", "0.6073613", "0.60354424", "0.59864366", "0.5956092", "0.593453", "0.59262407", "0.5920502", "0.58799624", "0.5810256", "0.578564", "0.57722795"...
0.0
-1
store link of the redirected page
function getRelatedChevronDiagram(callback,element) { var checkName = $.trim(linkName); $.ajax({ type: "POST", url: "/designer/asts/chevron/apis/nameStore", data: { linkName: checkName, type: "POST" }, success: function() { call...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirectPage() {\n window.location = s.linkLocation;\n }", "function redirectPage () {\n\twindow.location = link;\n}", "function redirectByUrl() {\n location.href = u;\n }", "function e() {\n window.location = linkLocation;\n}", "redirect(e) {\n var cu...
[ "0.7416047", "0.6711441", "0.6657724", "0.65806943", "0.64219177", "0.6348449", "0.6336604", "0.6277657", "0.62174106", "0.615409", "0.61417633", "0.6129555", "0.61206734", "0.61206734", "0.61206734", "0.61206734", "0.61206734", "0.61206734", "0.61206734", "0.61206734", "0.61...
0.0
-1
`data` is plain object quick test
function isobj(data) { if (data == null) return false if (data.constructor && data.constructor.name != 'Object') return false return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }", "function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n ...
[ "0.70088345", "0.6997787", "0.6919384", "0.6803308", "0.6800389", "0.6770937", "0.67055744", "0.6658834", "0.6637872", "0.65411025", "0.650879", "0.63795364", "0.6354883", "0.63468474", "0.62551254", "0.6189316", "0.6175513", "0.61524916", "0.61433774", "0.614168", "0.6136517...
0.6257117
14
`data` is > 0 test
function ispositive(data) { return typeof data === 'number' && data === data && data > 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zero (data) {\n return data === 0;\n }", "function positive (data) {\n return number(data) && data > 0;\n }", "function positive (data) {\n return greater(data, 0);\n }", "function negative (data) {\n return number(data) && data < 0;\n }", "function negative (data) {\n ...
[ "0.8071669", "0.8026276", "0.7628333", "0.7589508", "0.67467344", "0.6546796", "0.65133214", "0.6503619", "0.6488167", "0.64732695", "0.6428464", "0.6383521", "0.6324921", "0.6302619", "0.62882525", "0.6234603", "0.62252814", "0.6198747", "0.61961174", "0.6188946", "0.6168840...
0.7612415
3
look into actual toggle functionality with BEM
function toggleNavBar() { if (window.getComputedStyle(homeNavBar).display === "flex") { searchBarElement.style.display = "flex"; homeNavBar.style.display = "none"; } else { searchBarElement.style.display = "none"; homeNavBar.style.display = "flex"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggle() {}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "handleToggle() {\n this.toggle.addEventListener(\"click\", (e) => {\n this.doToggle()\n })\n }", "toggle(){this.off=!this.off}", "function toggleModule( evnt ) {\n\t\t\t\t// we require jQuery for this not just jQLi...
[ "0.75565475", "0.7104265", "0.69245493", "0.6840071", "0.67653984", "0.6764821", "0.66781557", "0.66781557", "0.665642", "0.66234636", "0.66141903", "0.6610482", "0.65773475", "0.65617263", "0.65442574", "0.6518207", "0.65157646", "0.64781296", "0.6476048", "0.6471584", "0.64...
0.0
-1
endregion region log block functions
startBlock() { this.indent++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logBlock() {\n return __awaiter(this, void 0, void 0, function* () {\n // Hash the message then call Logger to log it into csv file\n return this.hashMessage().then((_) => (this.logger.writeNewBlock = this.mostRecentBlock));\n });\n }", "log() {}", "function Log() {}", ...
[ "0.6834754", "0.6603226", "0.6533494", "0.65309846", "0.6425377", "0.6397707", "0.6157668", "0.6146011", "0.61296564", "0.6109932", "0.602189", "0.60070026", "0.5977024", "0.59009206", "0.5854354", "0.5823573", "0.5781872", "0.5744216", "0.5728341", "0.5709429", "0.57058156",...
0.0
-1
Binary Search O(log n) faster than linear search. Eliminates half of elements at a time, Only works on sorted arrays. function accepts a sorted array and a value create two variables that act as pointers left and right left starts at the beginning of the array and right at the end loop while left comes before right che...
function binarySearch(arr, val) { let left = 0; let right = arr.length - 1; let middle = Math.floor((left + right) / 2); while (arr[middle] !== val && left <= right) { if (val < arr[middle]) right = middle - 1 else left = middle + 1; middle = Math.floor((left + right) / 2); } return arr[midd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binarySearch(array, value) {\n let left = 0;\n let right = array.length - 1;\n let middle = Math.round((left + right) / 2);\n while (array[middle] !== value && left <= right) {\n middle = Math.round((left + right) / 2);\n if (array[middle] > value) {\n right = middle - 1;\n } els...
[ "0.78222066", "0.7753506", "0.76569843", "0.7656966", "0.7597603", "0.7423571", "0.74182945", "0.7401893", "0.7392831", "0.7363033", "0.73510367", "0.7347115", "0.73392636", "0.72493386", "0.7237091", "0.72194403", "0.7201347", "0.7194044", "0.7176355", "0.71751106", "0.71608...
0.7431212
5
have container to toss shit from fxns second workspace makes abstracting more doable build function to take in objects from JSON data and push into new empty array
function newPeopleArray(array){ for (var i = 0; i < array.length; i++) { personArray.push(array[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obj2Arr(data) {\n var temp;\n\n if (!data.hasOwnProperty('folder')) {\n \tdata.folder = [];\n }\n\n // folder\n if (data.folder.constructor == Object) {\n temp = data.folder;\n delete data.folder;\n data.folder = [temp];\n }\n\n for (h = 0; h < data.folder.leng...
[ "0.581787", "0.58025366", "0.56873214", "0.5680355", "0.5666497", "0.56570196", "0.56563646", "0.5599032", "0.5587834", "0.5542674", "0.55271006", "0.55216235", "0.5501738", "0.54554933", "0.54300845", "0.5426395", "0.5420318", "0.54187787", "0.54121625", "0.5391409", "0.5381...
0.0
-1
Content div min height set
function resizeInnerDiv() { var height = $(window).height(); var header_height = $(".header").height(); var footer_height = $(".footer").height(); var setheight = height - header_height; var trueheight = setheight - footer_height; $(".content").css("min-height", trueheigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contentMinHeight(){\n \"use strict\";\n\n if($j('header .header_bottom').length || $j('header .bottom_header').length){\n if($j('header .header_bottom').length){ var headerColorString = $j('header .header_bottom').css('background-color'); }\n if($j('header .bottom_header').length){ var...
[ "0.73986804", "0.72134084", "0.70684296", "0.70605856", "0.70385826", "0.6834918", "0.680637", "0.6726905", "0.66207963", "0.66038156", "0.66038156", "0.64890796", "0.6469295", "0.643533", "0.64268464", "0.64004844", "0.63945985", "0.639325", "0.6382769", "0.6370565", "0.6359...
0.70096636
5
Take an input rgb array, return the closest colour matching filename
function getClosestThumbnail(targetColour, thumbnails){ // Chroma Color can take an array of rgb values let referenceColour = Chroma(targetColour); let closest = 999; let winner = ''; thumbnails.forEach(element => { let color = Chroma([element.red, element.green, ele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findRGB(c){\n if ((typeof c) == \"number\"){return c;}\n let rgb = [];\n if ((typeof c) == \"string\" && c.length == 7){\n rgb = [parseInt(c.substr(1, 2), 16), parseInt(c.substr(3, 2), 16), parseInt(c.substr(5, 2), 16)];\n }\n if (c instanceof Array){rgb = c;}\n if (!rgb.length){\n cons...
[ "0.6870935", "0.6436768", "0.60159975", "0.60159975", "0.58036464", "0.57750565", "0.57750565", "0.57221466", "0.56836325", "0.5645856", "0.5584382", "0.5543373", "0.5539046", "0.5531288", "0.54827374", "0.54409426", "0.54227877", "0.5414798", "0.5385122", "0.5363233", "0.535...
0.64115286
2
remove the `$ ` prefix and commas to get the dollar amount, convert to float
function valueOf(tag) { const dollars = $(tag).val().replace(/(\$\s|,)/g, ''); return parseFloat(dollars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unformatMoney(money) {\n return parseFloat(money.replace(/[$,]/g, \"\"));\n }", "function parseDollars(str) {\n return parseFloat(str.replace(\"$\", \"\").replace(\",\", \"\").replace(\"*\", \"\"));\n}", "function moneyTextToFloat(text) {\r\n\tvar cleanText = text.replace(\"R$ \", \"\").re...
[ "0.78372586", "0.75954384", "0.7536496", "0.7195473", "0.71067935", "0.70660055", "0.70521224", "0.70321655", "0.6978489", "0.6972212", "0.6936342", "0.69351745", "0.6931186", "0.68455815", "0.6836125", "0.6836034", "0.68284315", "0.68166816", "0.6802978", "0.6784128", "0.677...
0.6822994
17
add commas for every 3 digits
function addCommas(number) { let result = Number(Math.ceil(number)).toLocaleString(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertCommasInNumbers(number){\n var StringWithCommas = number.toString();\n var numOfCommasToInsert = Math.floor(number.length / 3 );\n\n if(StringWithCommas.length > 3){\n for(var count = 0; count < numOfCommasToInsert; count++){\n StringWithCommas = StringWithCommas.splic...
[ "0.7827929", "0.7730638", "0.76307327", "0.76268715", "0.76112086", "0.7569175", "0.7542055", "0.75324816", "0.7497023", "0.74733955", "0.7467281", "0.74590826", "0.7446224", "0.7446224", "0.7435954", "0.7434241", "0.7417697", "0.74173576", "0.74173576", "0.7414873", "0.74131...
0.0
-1
make on the calculations that depend on the montly expense
function standardCalculations() { // 1. has been populated for the first time, mark default checkboxes const perPhone = $( '#perPhone' ).prop('checked'); const perPhoneLongDistance = $( '#perPhoneLongDistance' ).prop('checked'); if (isCheckboxOff('#perPhone') && isCheckboxOff('#allPhones')) { $( '#perPhone'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instat() {\r\n // ********************************************************************\r\n // Initialize summation of variables\r\n // ********************************************************************\r\n fme[13] = 0.0;\r\n cgs[13] = 0.0;\r\n gp[13] = 0.0;\r\n pbt[13] = 0.0;\r\n pat[13] = 0.0;\...
[ "0.6438366", "0.623491", "0.62042606", "0.61978036", "0.61613125", "0.6153805", "0.61361367", "0.6086478", "0.6075408", "0.6036385", "0.6029776", "0.6002455", "0.59986573", "0.5980568", "0.59597874", "0.5955235", "0.59504986", "0.59287447", "0.59161234", "0.5915064", "0.58768...
0.62293726
2
Add $ in front of the amount written
function addDollarSignFor(element) { const elementTag = `#${element}`; const value = $(elementTag).val(); if (value.charAt(0) === '$') return; $(elementTag).val(`$ ${value}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatAmount(amount){\n return \"$\" + amount.toFixed(2);\n}", "function displayDollar(amount){\n\treturn \"$\" + (Math.round(amount*100)/100).toFixed(2).toString()\n}", "function dollarize(expr)\n{\n return \"$\" + format(expr,2);\n}", "function formatMoney(amount){\r\n return \"$\" + amou...
[ "0.7273139", "0.70788944", "0.6997279", "0.6855899", "0.6818103", "0.6756075", "0.6651984", "0.65925324", "0.65846723", "0.6563881", "0.65407974", "0.65226114", "0.65226114", "0.65003514", "0.6495192", "0.64832926", "0.6389739", "0.62975824", "0.6272523", "0.62661475", "0.626...
0.6312489
17
checks whether all fields necessary for calculation are valid?
function isCalculationsDue() { return $('#plansCount').val() && $('#monthlyPayment').val() && $('#longDistance').val(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateFields(){\n\tif(!getValue('nombreID')\n\t\t|| !getValue('contactoID') \n\t\t|| !getValue('estadoID')\n\t\t|| !getValue('ciudadID') \n\t\t|| !getValue('shortDesc') \n\t\t|| !getValue('longDesc')\n\t\t|| !isChecked('lblCheck'))\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}", "function validateFormAndCa...
[ "0.7088349", "0.66709167", "0.6605721", "0.6589363", "0.64643836", "0.64577717", "0.63954425", "0.63874656", "0.6385642", "0.6344439", "0.63413286", "0.6340369", "0.6335941", "0.6334746", "0.6325862", "0.62421435", "0.62344724", "0.6220233", "0.62022156", "0.6178367", "0.6176...
0.5999402
49
This is the JavaScript code for the function lab07whileKnownCountPart2() in "Lab 7: While Loop with Known Count" File: /unit4/labs/lab07whileKnownCount.html
function lab07whileKnownCountPart2() { // PART 2: YOUR CODE STARTS AFTER THIS LINE // Declare and assign variables var loopCounter = 1; var loopMaximum = 20; var baseMultiplier = 7; // Do all the looping! while(loopCounter <= loopMaximum) { var product; product = lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dojoCounting(){\n\tvar countdojo = 1;\n\n\twhile (countdojo < 101){\n\t\tif (countdojo % 5 == 0 && countdojo % 10 != 0){\n\t\t\tconsole.log(\"Coding\");\n\t\t}\n\n\t\tif (countdojo % 10 == 0){\n\t\t\tconsole.log(\"Dojo\");\n\t\t}\n\t\tconsole.log(countdojo);\n\t\tcountdojo++;\n\t}\n\n}", "function count...
[ "0.6241085", "0.60106516", "0.5795967", "0.5765923", "0.5728823", "0.5725549", "0.5681016", "0.55997854", "0.5599706", "0.5514981", "0.551093", "0.5510721", "0.54882157", "0.5487291", "0.54798985", "0.5456034", "0.5445634", "0.5432431", "0.5422339", "0.5410055", "0.539904", ...
0.6701799
0
now animate DHTML handlers
function getRefToDivNest(divName) { "use strict"; if (document.layers) { return document.layers[divName]; }//NS4 if (document[divName]) { return document[divName]; }//NS4 also if (document.getElementById) { return document.getE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_animate() {\n //Do the preview (IS THIS NEEDED?)\n if (AUTO_ANIM) {\n for (var i = 0; i < NODES.length; i++) {\n if (NODES[i].parent) {\n var r = Math.min(Math.max(parseFloat(atob(NODES[i].id)), 0.3), 0.7);\n NODES[i].th = NODES[i].th0 + Math.sin((new Date()).getTime() * 0.003...
[ "0.6427866", "0.6205003", "0.6179538", "0.61566097", "0.6123965", "0.6087667", "0.6048523", "0.60468477", "0.6045424", "0.59807104", "0.59105694", "0.5882336", "0.58582765", "0.5853259", "0.5847236", "0.5815929", "0.58137405", "0.58031684", "0.58012664", "0.57908845", "0.5759...
0.0
-1
function to build grid
function buildGrid() { return new Array(COLS).fill(null) .map(()=> new Array(ROWS).fill(null) .map(()=> Math.floor(Math.random()*2))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(width, height) {\n\n}", "function makeGrid() {\n\n\n}", "createGrids () {\n }", "createGrid(starti, startj, endi, endj, level, mapped) {\n for (let i = 0; i < this.rows; i++) {\n\n let rowgrid = [];\n for (let j = 0; j < this.columns; j++) {\n ...
[ "0.8032862", "0.8026471", "0.7792519", "0.7714944", "0.7678554", "0.76681405", "0.7607601", "0.756198", "0.75468266", "0.7545117", "0.7538164", "0.74926746", "0.74819386", "0.74520856", "0.7432", "0.7431502", "0.7421499", "0.74049836", "0.7364722", "0.7336576", "0.73294455", ...
0.697454
88
find next gen cells
function nextGen(grid){ const nextGen = grid.map( arr => [...arr]); for(let col = 0; col < grid.length; col++){ for(let row = 0; row < grid[col].length; row++){ const cell= grid[col][row]; let numNeighbour = 0; for(let i= -1; i < 2 ; i++){ for(let j= -1 ; j < 2 ; j++){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextGen(currentCells){\n var candidates={};\n var nextCells=[];\n for(var i=0; i<currentCells.length; i++){\n var cell = currentCells[i];\n var neighbors=getNeighbors(cell);\n for(var j=0; j<neighbors.length; j++){\n var neighbor = neighbors[j];\n if(candidates[neighb...
[ "0.70649356", "0.68846005", "0.6793512", "0.6780518", "0.6778107", "0.64429814", "0.6295567", "0.6186491", "0.6169631", "0.61358464", "0.59998983", "0.59236246", "0.59231126", "0.59045345", "0.589464", "0.58714604", "0.58585835", "0.5851096", "0.58232284", "0.5800695", "0.579...
0.6838993
2
2. Encuentre el promedio de los valores de la lista /sumAll:list>number Sumar todos los elementos de una lista function sumAll(list) sumAll([1,2,3])>6 sumAll([0,1])>1 sumAll([1,1])>0
function sumAll(list) { if(length(list) == 1) { return first(list); } else { return first(list) + sumAll(rest(list)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumAll(list) {\r\n if(length(list) == 1) {\r\n return first(list);\r\n } else {\r\n return first(list) + sumAll(rest(list));\r\n }\r\n}", "function sumAll( ) {\n let sum = 0;\n // TODO: loop to add items\n return sum;\n}", "function sumList(l) {\n\tlet sum = 0;\n\tfor (let i ...
[ "0.80195385", "0.7703631", "0.74816746", "0.74039495", "0.7210113", "0.7187354", "0.71297103", "0.7091099", "0.70798105", "0.70239913", "0.70129454", "0.69658434", "0.6904137", "0.6893986", "0.6875852", "0.68740416", "0.6855294", "0.6851809", "0.6831808", "0.6814718", "0.6808...
0.80204076
0
invert:list>list Invierte los elementos de una lista invert([1,2,3])>[3,2,1] invert([3,2,1])>[1,2,3]
function invert(list) { if(length(list)==0) { return []; } else { return cons(last(list),invert(pop(list))); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invert(list) {\r\n if(length(list)==0) {\r\n return [];\r\n } else {\r\n return cons(last(list),invert(pop(list)));\r\n }\r\n}", "function invertir(list) {\n if(longitud(list)==0){\n return [];\n } else {\n return cons(last(list),invertir(pop(list)));\n }\n}...
[ "0.80939907", "0.7971685", "0.79233974", "0.7007475", "0.6762999", "0.66895556", "0.6658276", "0.65991217", "0.6589252", "0.63947904", "0.6330675", "0.6258173", "0.6255762", "0.6229767", "0.6180633", "0.6165591", "0.6165591", "0.6165591", "0.6165591", "0.6165591", "0.6165591"...
0.8123306
0
toMinutes:number>number Saca la cantidad de minutos de una cantidad de segundos
function toMinutes(seconds) { return Math.floor(seconds / 60); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert(minutes) {\n return minutes*60\n}", "function time_conversion(minutes) {}", "function convert(minutes) {\n return minutes * 60;\n}", "function convertmin(minutes)\n{\n return minutes*60;\n}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function tur...
[ "0.79242015", "0.7803437", "0.78005993", "0.74461055", "0.73787516", "0.73787516", "0.73787516", "0.73787516", "0.73787516", "0.73787516", "0.73787516", "0.73551035", "0.73260653", "0.72408795", "0.7236375", "0.72134817", "0.72128266", "0.72080916", "0.720714", "0.7205586", "...
0.7441865
4
toSeconds:number>number Saca los segundos restantes de una cantidad grande de segundos
function toSeconds(seconds) { return seconds % 60; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toSeconds(min, sec){\n var totalSeconds;\n if (min === 0) {\n totalSeconds = sec\n return countDown(totalSeconds);\n }\n totalSeconds = (min*60)+sec;\n return countDown(totalSeconds);\n}", "function ms_seconds(x){ return x / 1000;}", "seconds(prevTime, curTime){\n let t...
[ "0.7525549", "0.73117065", "0.70099485", "0.6991596", "0.69835687", "0.6957128", "0.6954472", "0.6947574", "0.6944432", "0.69157267", "0.6908814", "0.68920445", "0.6820975", "0.6804596", "0.6791808", "0.6769122", "0.67640615", "0.675041", "0.67492163", "0.671072", "0.6706215"...
0.7649332
0
toHours:number>number Saca la cantidad de horas de una cantidad de segundos
function toHours(seconds) { return Math.floor(toMinutes(seconds) / 60); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toHours(value) {\n var minutes = totalMinutos;\n if (value != undefined) {\n minutes = value;\n }\n\n if (minutes < 0) {\n var temp = minutes * -1;\n var horas = 0;\n while (temp > 59) {\n horas++;\n temp -= 60;\n }\n return '-' +...
[ "0.75376", "0.7174738", "0.71558875", "0.71558875", "0.71558875", "0.71558875", "0.71558875", "0.71558875", "0.71558875", "0.71277905", "0.70424175", "0.6841707", "0.68126065", "0.67512923", "0.6714733", "0.6672204", "0.6667074", "0.6650033", "0.66397583", "0.6612716", "0.660...
0.7166518
2
searchByRating:list,number>list Devuelve las canciones con el rating ingresado
function searchByRating(list,rating) { if(isEmpty(list)) { return []; } else if(first(list).rating==rating) { return cons(first(list),searchByRating(rest(list),rating)); } else { return searchByRating(rest(list),rating); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortByRating(list) {\n // your code here..\n \n}", "filterByRating(event) {\n const rating = event.currentTarget.getAttribute('rating');\n const filters = createFilterObject(this.props.location.search);\n filters['rating'] = rating;\n this.props.filterBooks(filters, thi...
[ "0.59926677", "0.59773797", "0.5820468", "0.5737945", "0.56894666", "0.5660377", "0.5640114", "0.5582221", "0.55669725", "0.55380195", "0.55182034", "0.54709995", "0.5459763", "0.5448068", "0.5438652", "0.54324913", "0.5381296", "0.5347695", "0.53187567", "0.5284043", "0.5275...
0.7127374
0
deleteByRating:list,number>list Elimina todos los elementos de una lista que comparten un mismo rating
function deleteByRating(list,rating) { if(isEmpty(list)) { return []; } else if(first(list).rating==rating) { return deleteByRating(rest(list),rating); } else { return cons(first(list),deleteByRating(rest(list),rating)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eliminarPeorRating(misPeliculas){\n var puntaje;\n var index;\n for(i=0;i<misPeliculas.length;i++){ \n if(puntaje==null){\n puntaje=misPeliculas[i].rating; \n index=i;\n }else{\n if(puntaje>misPeliculas[i].rating){\n puntaje=misPeliculas[i].ra...
[ "0.6665979", "0.6447352", "0.64292306", "0.6052003", "0.57556033", "0.55594164", "0.55454403", "0.5504232", "0.54096067", "0.5401744", "0.539729", "0.53816146", "0.53697634", "0.5339129", "0.5324592", "0.5323506", "0.52964735", "0.5284734", "0.52769184", "0.52651256", "0.5261...
0.820136
0
! Vue.js v2.2.4 (c) 20142017 Evan You Released under the MIT License.
function n(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {...
[ "0.6960997", "0.6917958", "0.6893261", "0.6590628", "0.64785296", "0.63933355", "0.63933355", "0.63575125", "0.63337725", "0.63311535", "0.63113517", "0.6284483", "0.6259222", "0.62471944", "0.6246556", "0.62410396", "0.62247425", "0.6189091", "0.6189091", "0.6187022", "0.617...
0.0
-1
Get the interest when you know all the payments and their dates. Use this function when you have administration fees at the first payment and/or when payments are irregular.
static withSpecifiedPayments(principal, startDateString, payments, guess) { let values = [-1 * principal]; let days = [1]; let startDate = new Date(startDateString); Object.keys(payments).forEach(function (date) { values.push(payments[date]); days.push(1 + Math.ceil(Math.abs((new Date(date)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mortgageInterest() {\n var mortgage = plan.mortgage;\n // Create an amortization schedule. Takes four parameters: principle amount, months, interest rate (percent), start date (Date object).\n // Returns an array of payment objects { principle, interest, payment, paymentToPrincipal, paymentToInte...
[ "0.7176047", "0.6600102", "0.6463257", "0.6449202", "0.62282455", "0.6197396", "0.61965406", "0.61892956", "0.61432177", "0.60798496", "0.6045508", "0.6010371", "0.597372", "0.59657747", "0.5934302", "0.59267646", "0.59192294", "0.5852485", "0.5842829", "0.582058", "0.5775799...
0.54962015
32
Get the effective interest when the monthly payments are exactly the same.
static withEqualPayments(principal, payment, numberOfMonths, guess) { let fx = function (x) { return payment - payment * Math.pow(1 + x, -1 * numberOfMonths) - x * principal; }; let fdx = function (x) { return numberOfMonths * payment * Math.pow(1 + x, -1 * numberOfMonths - 1) - principal; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mortgageInterest() {\n var mortgage = plan.mortgage;\n // Create an amortization schedule. Takes four parameters: principle amount, months, interest rate (percent), start date (Date object).\n // Returns an array of payment objects { principle, interest, payment, paymentToPrincipal, paymentToInte...
[ "0.69108355", "0.6595409", "0.6560495", "0.6275725", "0.615275", "0.6065315", "0.6061372", "0.6027511", "0.5975546", "0.59183127", "0.5823027", "0.58129865", "0.57900745", "0.5713996", "0.5711402", "0.5710015", "0.565389", "0.56403685", "0.562816", "0.560772", "0.56002986", ...
0.49939373
68
letters from the alphabet, and determine if a 2x2 square composed entirely of vowels exists in the matrix. For example: strArr is ["abcd", "eikr", "oufj"] then this matrix looks like the following: a b c d e i k r o u f j Within this matrix there is a 2x2 square of vowels starting in the second row and first column, na...
function VowelSquare(strArr) { const regex = /[aeiou]/g; strArr = strArr.map((str) => { return str.replace(regex, '!'); }); let locs = []; for (let i = 0; i < strArr.length; i++) { let match; while ((match = regex.exec(strArr[i])) !== null) { locs.push([i, regex.lastIndex]); } } fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VowelSquare(strArr) { \n\n // code goes here \n var vowels=[\"a\",\"e\",\"i\",\"o\",\"u\"];\n for(var i=0;i<strArr.length;i++){\n for(var j=0;j<strArr[i].length;j++){\n if(vowels.indexOf(strArr[i][j])!==-1&&vowels.indexOf(strArr[i+1][j])!==-1&&vowels.indexOf(strArr[i][j+1])!==-...
[ "0.7601171", "0.7409295", "0.7242721", "0.6310251", "0.6184698", "0.6145276", "0.6102551", "0.6090328", "0.6068326", "0.6068182", "0.6043712", "0.6005004", "0.5990698", "0.5913502", "0.59112257", "0.5868334", "0.5814616", "0.57925266", "0.5745243", "0.5742897", "0.5736328", ...
0.75235534
1
Should only be called with a completely new client.
initializeNotificationStream() { return __awaiter(this, void 0, void 0, function* () { const clientId = this.apiClient.clientId; yield this.setLastEventDate(new Date(0)); const latestNotification = yield this.backend.getLastNotification(clientId); return this.setL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createNewClient() {\n if (this.client) {\n this.client.off(\"tokensUpdated\", this._onTokensUpdated);\n }\n this._onTokensUpdated = () => {\n this.updateTokens(this.client.accessToken, this.client.refreshToken, false);\n };\n this._client = new MyButtercupC...
[ "0.769493", "0.67251277", "0.6712264", "0.6702476", "0.66603893", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", "0.66563386", ...
0.0
-1
listen for when user submits login form and calls login with the credentials entered on the form
function listenLogin() { $('.login-form').submit(event => { event.preventDefault(); let userCreds = { username: $(".username").val().toLowerCase(), password: $(".password").val() }; login(userCreds); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hook_login_form() {\n console.log(\"hooking the login form\")\n \n\t$(\"#login-form\").submit(function(event) {\n\t\tevent.preventDefault();\n\t\tlogin_user();\n });\n}", "function loginEvent () {\r\n\tif (playerID.value.length && password.value.length) {\r\n // Update visual state\r\n\t...
[ "0.7801667", "0.7612556", "0.75839585", "0.7551147", "0.7508613", "0.74298775", "0.74239266", "0.74239266", "0.73455817", "0.7337213", "0.7335125", "0.73261756", "0.7323897", "0.72963244", "0.7279236", "0.72651255", "0.7263667", "0.7255931", "0.72409755", "0.72307533", "0.721...
0.7880951
0
when user clicks `View Demo` button on homepage, box with demo login creds will open.
function listenDemo() { $('.open-demo').on('click', event => { $('.demo-container').removeClass('hidden'); $('.open-demo').addClass('hidden'); closeDemo(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function watchDemoBtn() {\n $('#demo-login').click(event => {\n const userData = {\n username: 'demouser1124',\n password: 'demopassword1124'\n };\n\n HTTP.loginUser({\n userData,\n onSuccess: res => {\n const authUser = res.user;\n authUser.jwtToken = res.jwtToken;\n ...
[ "0.7084468", "0.6487282", "0.6437352", "0.6416396", "0.64090824", "0.6363718", "0.6341619", "0.63174856", "0.63051313", "0.6298244", "0.6250354", "0.6228212", "0.62094885", "0.6181924", "0.617906", "0.6176931", "0.6171598", "0.6142623", "0.6126402", "0.6081402", "0.6068158", ...
0.5892395
31
close Demo login creds box
function closeDemo() { $('.close-demo').on('click', event => { $('.demo-container').addClass('hidden'); $('.open-demo').removeClass('hidden'); listenDemo(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeDialog_() {\n // TODO(danan): call InlineLoginDialog's \"Close\"\n }", "closeLoginForm() {\n document.getElementById(\"showLoginForm\").checked = false;\n this.switchToLogin();\n updatePageTitle(\"Utforsk nye aktiviteter\");\n }", "function appLogOut()\n{\n\tfrmLogin.txtBoxLogi...
[ "0.71259815", "0.707043", "0.703822", "0.6867312", "0.68378586", "0.6809003", "0.68026966", "0.67960346", "0.67960346", "0.6776628", "0.67528117", "0.6647417", "0.66175514", "0.6558148", "0.6547423", "0.6495667", "0.6483023", "0.63839674", "0.6361906", "0.6354736", "0.6351117...
0.0
-1
If the user has no account yet, this button will take them to a Sign Up form
function listenSignupBtn() { $('.signup-button').on('click', event => { $('.signup-container').removeClass('hidden'); $('.login-container').addClass('hidden'); listenSigninBtn(); listenSignupForm(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSignUp(e) {\n setVisible(false);\n setSignUp('true');\n }", "function activateSignup() {\n activateNewAccount(true)\n\n }", "function signUp() {\n const signupForm = document.querySelector(\"#regtab\");\n signupForm.addEventListener(\"submit\", (e) => {\n e.preventDefault()...
[ "0.7663885", "0.7321645", "0.72896105", "0.7288508", "0.7150819", "0.7066917", "0.701027", "0.6987451", "0.69771796", "0.68408954", "0.6797255", "0.6786607", "0.6737346", "0.6730536", "0.67089856", "0.6705235", "0.6705235", "0.6699854", "0.6698374", "0.6641212", "0.6638054", ...
0.0
-1
On the Sign Up form page, there is a button for the user to go back to the log in form if they aready have an account (page reloads)
function listenSigninBtn() { $('.signin-button').on('click', event => { location.reload(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logInOrSignUp() {\n if (this.state.pageName === 'LOG IN') {\n this.sendFormToLogIn();\n } else {\n this.sendFormToSignUp();\n }\n }", "switchToRegister() {\n document.getElementById(\"login-form-container\").classList.add('right-panel-active');\n this.c...
[ "0.71621406", "0.6949327", "0.6929082", "0.68708134", "0.68628", "0.6820878", "0.6819679", "0.6815608", "0.67768437", "0.67357033", "0.6680012", "0.66412485", "0.66382605", "0.6612539", "0.6611434", "0.66092014", "0.6580231", "0.65646714", "0.6560234", "0.6553133", "0.6494109...
0.63453007
43
listens for when user submits signup form
function listenSignupForm() { $(".signup-form").on("submit", event => { event.preventDefault(); $(".passwarn").empty(); $(".userwarn").empty(); let password = $(".new-password").val(); let password2 = $(".new-password2").val(); let username = $(".new-username").val().toLowerCase(); //si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hook_signup_form() {\n console.log(\"hooking the signup form\")\n \n\t$(\"#signup-form\").submit(function(event) {\n\t\tevent.preventDefault();\n\t\tsignup_user();\n });\n}", "function submit() {\n\t\t\t// make sure the form is submitted,\n\t\t\t$('#signUp').on('submit', function() {\n\t\t\t\t/...
[ "0.77940875", "0.7751067", "0.7732784", "0.7631787", "0.75544524", "0.75285566", "0.7524133", "0.74937814", "0.7468507", "0.742483", "0.74208826", "0.7412697", "0.7385278", "0.7333789", "0.7333789", "0.73254293", "0.72489065", "0.7241305", "0.72389907", "0.7230945", "0.721166...
0.6959383
36
checks if string has white space
function hasWhiteSpace(string) { return string.indexOf(" ") >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasWhiteSpaces(string) {\n return string.indexOf(\" \") >= 0;\n}", "function isSpace(str) {\n return str.match(/\\s/) !== null;\n}", "function hasSpaces(string) {\n return string.indexOf(' ') !== -1;\n}", "function isWhitespace(str) { \r\n\tvar re = /[\\S]/g;\r\n\tif (re.test(str)) {\r\n\t\tr...
[ "0.8474966", "0.83596027", "0.8259749", "0.82078445", "0.82066286", "0.81916285", "0.79582006", "0.78569955", "0.78327674", "0.7827816", "0.781591", "0.77956253", "0.77759254", "0.7733858", "0.7713211", "0.77089876", "0.76961166", "0.76792103", "0.76756936", "0.76549", "0.761...
0.81428224
6
warn that username is already taken
function userDuplicate() { $('.userwarn').html('Username already taken'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usernameAlreadyExists(username){\n return false;\n }", "static async usernameCheck(username) {\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE UPPER(username) = UPPER($1)`,\n [username]\n );\n // returns true if username i...
[ "0.7832747", "0.7125917", "0.6994704", "0.69823754", "0.69595546", "0.68693936", "0.68012", "0.6714974", "0.6701958", "0.66399467", "0.6608324", "0.6574943", "0.65510315", "0.65154475", "0.6505789", "0.6487896", "0.6474412", "0.6474313", "0.64548355", "0.64473426", "0.6431593...
0.76589125
1
show welcome message with user's firstname
function greetNewUser(userCreds) { let userGreeting = userCreds.firstName; $('.signup-form').remove(); $('.new-user-text').html(userGreeting); $('.greeting-box').removeClass('hidden').addClass('border'); listenFirstLogin(userCreds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "fun...
[ "0.74806505", "0.74806505", "0.74806505", "0.74806505", "0.741998", "0.7257484", "0.724579", "0.71800673", "0.7141877", "0.709246", "0.70635664", "0.70317745", "0.70126396", "0.7007048", "0.7006841", "0.69998026", "0.69523776", "0.6868139", "0.6859475", "0.6805883", "0.678478...
0.65578526
34
listen for when new user logs in from success box
function listenFirstLogin(newUserCreds) { let userCreds = { username: newUserCreds.username, password: newUserCreds.password }; $('.new-signin').on("click", event => { event.preventDefault(); //call login, passing user's password and username credentials login(userCreds); $('.signup-contai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerSuccessFn() {\n\t\t\t\t\tAuthentication.login($scope.username, $scope.password)\n\t\t\t\t\t\t.then(function (response) {\n\t\t\t\t\t\t\tAuthentication.setAuthenticatedAccount(response.data);\n\t\t\t\t\t\t\twindow.location = '/#/users/' + response.data.username;\n\t\t\t\t\t\t\twindow.location.reloa...
[ "0.71434313", "0.7141553", "0.7073367", "0.70175415", "0.6844848", "0.6835158", "0.6728603", "0.66844684", "0.6650874", "0.6634141", "0.6619711", "0.6604646", "0.6594736", "0.65594715", "0.6546527", "0.65027684", "0.64709014", "0.64549273", "0.6426352", "0.64202696", "0.64125...
0.690819
4
sends POST request to api/auth/login
function login(userCreds) { console.log(userCreds); $.ajax({ url: "/auth/login", method: "POST", data: JSON.stringify(userCreds), crossDomain: true, contentType: "application/json", success: loginSuccess, error: loginFailMessage }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {\n const options = {\n method: 'POST',\n uri: `${config.apiUrl}/login`,\n body: {\n email: config.email,\n password: config.password,\n },\n json: true,\n jar: true,\n };\n return rp(options);\n}", "login(body) {\n this.setMethod('POST');\n this.setBody(body...
[ "0.74737513", "0.7323733", "0.7259769", "0.717401", "0.71421766", "0.708924", "0.70687693", "0.696185", "0.69543374", "0.6914468", "0.68962187", "0.6895133", "0.68376774", "0.6826383", "0.67833775", "0.6774339", "0.67125297", "0.6707974", "0.67077196", "0.6703057", "0.6702777...
0.6387017
68
if login fails, show warning
function loginFailMessage() { $(".loginwarn").html("Incorrect username or password."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cmisLoginFail() {\n login.loginFail();\n}", "function loginFailed(){\n}", "function loginFailed(err) {\n var message = '';\n message += 'An error occurred when try to login ';\n message += 'into your account, please try manually';\n\n Alert\n .display('...
[ "0.7218902", "0.7165144", "0.69316053", "0.6883112", "0.6854254", "0.6813074", "0.68006694", "0.6744378", "0.6659367", "0.65961933", "0.6510133", "0.6465904", "0.6453384", "0.6442936", "0.6441634", "0.64312243", "0.6428733", "0.64248455", "0.64119303", "0.638547", "0.6374838"...
0.7190706
1
if login succeeds, create token and call
function loginSuccess(response) { $('.login-and-demo').remove(); localStorage.setItem("TOKEN", response.authToken); localStorage.setItem("userId", response.userId); newToken(); showReservationList(); $('.logout-button').removeClass('hidden'); $('.join-class').removeClass('hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doLogin (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/login',\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\tcallback\n\t\t);\n\t}", "loginByToken({ commit }, obj) {\n commit(consts.LOGIN_SUCCESS, obj);\n }", "function login( token, cbSuccess, cbFail ){\n\t\tif (...
[ "0.7441286", "0.7344865", "0.7203202", "0.7201181", "0.718898", "0.7145407", "0.70702183", "0.70081246", "0.69907475", "0.6986574", "0.6981457", "0.6937894", "0.6900589", "0.6883311", "0.68262297", "0.6798709", "0.6784906", "0.67843306", "0.6758309", "0.6755321", "0.6751097",...
0.0
-1
listen for when user clicks "Log Out", removes JWT token from local storage, and reloads the page
function listenLogout() { $(".logout-button").on("click", event => { localStorage.removeItem("TOKEN"); location.reload(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logout() {\n authState.jwt_token = ''\n localStorage.setItem('token', '');\n window.location.reload()\n }", "onLogout() {\n\t\tlocalStorage.removeItem('userToken');\n\t}", "function handleLogOutButton() {\n $(\".main-area\").on(\"click\", \".js-logout-button\", function(e) {\n // stop fr...
[ "0.83914626", "0.8373679", "0.831596", "0.80233943", "0.80032533", "0.7990281", "0.79615766", "0.79591954", "0.79543", "0.7931717", "0.7917877", "0.78921735", "0.78841674", "0.78482926", "0.78437257", "0.78142637", "0.77740103", "0.77731514", "0.7771755", "0.77636355", "0.776...
0.830922
3
sets up token in header for ajax requests so user can access their account and data
function newToken() { $.ajaxSetup({ dataType: "json", contentType: "application/json", headers: { Authorization: "Bearer " + localStorage.getItem("TOKEN") } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_token($token){\n $.AMUI.utils.cookie.set('s_token',$token);\n set_headers();\n }", "setupAjax() {\n $.ajaxSetup({\n headers: {\n 'Authorization': 'Bearer ' + localStorage.getItem('userToken')\n }\n });\n }", "function getToken() {\n...
[ "0.73396826", "0.7294317", "0.71918535", "0.7112939", "0.7008646", "0.6923912", "0.6917428", "0.6912997", "0.68348396", "0.68208116", "0.6797078", "0.67793775", "0.67606723", "0.6743827", "0.6705581", "0.6703923", "0.66959774", "0.66609925", "0.66049796", "0.65933913", "0.657...
0.79650307
0