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
2. Create a constructor function called `Dog` that sets a property on itself within the constructor. The property should be called `says` and the value should be `life is ruff` DONE
function Dog(){ this.says = 'life is ruff' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Dog () {\n this.legs = 4;\n this.bark = function() {\n return 'arf arf;;\n }\n }", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog (breed) {\n this.breed = breed;\n}", "function Dog (breed) {\n this.breed = breed;\n}", "f...
[ "0.74398655", "0.7401345", "0.73636514", "0.73636514", "0.73636514", "0.73636514", "0.72722626", "0.7203767", "0.7194559", "0.7180483", "0.7175434", "0.7175424", "0.7175424", "0.717116", "0.71687704", "0.7153247", "0.714996", "0.7149823", "0.7143825", "0.71397036", "0.7120623...
0.8282548
0
3. Create a constructor function called `Cat` that has a method on it's prototype called `growl` that returns the string `meow`; create an instance of this called `cat` DONE
function Cat(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newCat(name) {\n\tconsole.log(this); // this refers to the global-object i.e. Window\n\treturn {\n\t\tname : name,\n\t\ttalk : function() {\n\t\t\tconsole.log(this); // this refers to the object containing the \"talk\" method\n\t\t\tconsole.log(this.name + \" says Meoow\");\n\t\t},\n\t};\n}", "function ...
[ "0.7306775", "0.72485834", "0.72485834", "0.7077942", "0.7065386", "0.7018846", "0.6913897", "0.69030786", "0.6879301", "0.6879301", "0.6851107", "0.6769632", "0.6761657", "0.674306", "0.6735571", "0.66676795", "0.66676795", "0.66676795", "0.66666317", "0.6658805", "0.6637040...
0.6656884
21
4. Create a constructor called `KeepSecret`. The constructor function itself should accept a parameter called `secret` it should store this in a private variable (use a closure). Add a method to the prototype that is called `squeal` that returns the secret string. DONE
function KeepSecret(secret) { this.secret = secret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makesecret() {\n secret = makerandword(); }", "function createSecretHolder(secret) {\n let secr = secret;\n let obj = {\n getSecret: function() {\n return secr;\n },\n setSecret: function(s) {\n secr = s;\n }\n }\n\n return obj;\n}", "function createSecr...
[ "0.77774686", "0.7397415", "0.7242398", "0.7206933", "0.7100086", "0.6714597", "0.6598306", "0.64396524", "0.62731177", "0.6253335", "0.6126397", "0.6120165", "0.605057", "0.5921582", "0.5865497", "0.58446383", "0.5805677", "0.57992554", "0.5787509", "0.577822", "0.57578784",...
0.81052107
0
5. Create a constructor called `Key`. Create another constructor called `Safe`. Make the Safe constructor take 2 arguments. The first argument can be any piece if data to keep safe. This must be stored using a private variable like you did with KeepSecret. The 2nd param to the `Safe` constructor needs to be an instance of `Key` you need to store it privately as well. Add a function to the Safe prototype called `unlock` that accepts a key. If the key matches the key that was used to create the Safe; then return the secret data. DONE
function Key(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function KeepSecret(secret) {\n this.secret = secret;\n }", "function createSecretHolder(secret) {\n var secretObject = {\n secretValue: secret,\n getSecret: function() {\n return this.secretValue;\n },\n setSecret: function(newSecretValue) {\n this.secretValue = newSecretValue;\n }\n...
[ "0.7004947", "0.6468158", "0.6461388", "0.63240784", "0.6282125", "0.6166142", "0.60906196", "0.6063269", "0.60191566", "0.59833264", "0.5963176", "0.5954877", "0.58581156", "0.5850836", "0.57865334", "0.5706168", "0.56646407", "0.56621164", "0.55816835", "0.55759335", "0.555...
0.0
-1
On Change event handler
onChange(e) { this.setState({ [e.target.name]: e.target.value }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onchange() {}", "function onChange() {\n\t\t__debug_452( 'Received a change event.' );\n\t\tself.render();\n\t}", "function onChange() {\n\t\t__debug_330( 'Received a change event.' );\n\t\tself.render();\n\t}", "onChanged(e){}", "function onChange() {\n if (input.get.call(element, valueField) !== o...
[ "0.7940083", "0.766246", "0.76455235", "0.76388896", "0.75334346", "0.74983007", "0.74983007", "0.74853224", "0.7462203", "0.74598056", "0.74476886", "0.7440492", "0.74304813", "0.74270743", "0.74258375", "0.7424743", "0.7422155", "0.7422155", "0.7418929", "0.74176645", "0.74...
0.0
-1
Signin form submit event handler
onSubmit(e) { e.preventDefault(); const userData = { email: this.state.email, password: this.state.password, }; this.props.loginUser(userData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSubmit(event){\n setButton(false);\n console.log(\"Submitted\");\n event.preventDefault();\n console.log(email,password);\n SignIn(email,password,props,setButton);\n\n }", "async function handleSubmit(event) {\n event.preventDefault();\n \n tr...
[ "0.7436543", "0.7362524", "0.7323471", "0.7234756", "0.7013094", "0.69072306", "0.6892302", "0.6876701", "0.68308496", "0.6826685", "0.6781521", "0.67598933", "0.6754125", "0.67462677", "0.6744551", "0.6705269", "0.66970354", "0.6656132", "0.66442454", "0.66210264", "0.661776...
0.0
-1
threeline2d normalizes the dashposition along lines based on point index, not geometric distance. this overwrites that behavior.
function _fixLine2DDistances (lineGeom) { const distAttr = lineGeom.getAttribute("lineDistance"); if (distAttr) { const posArr = lineGeom.getAttribute("position").array; const distArr = distAttr.array; let totalDist = 0; const tmpA = new Vector3(); const tmpB = new Vector3(); for (let ai=1; ai<distArr.length; ai++) { tmpA.fromArray(posArr, ai * 3 - 3); tmpB.fromArray(posArr, ai * 3); tmpB.sub(tmpA); totalDist += tmpB.length(); distArr[ai] = totalDist; } } return lineGeom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalToLine(line){\r\n var vec = sub(line.p2, line.p1);\r\n var newVec = normalTo(vec);\r\n return normalize(newVec);\r\n}", "function makeNormalizedLine(p0, p1) {\n var a, b, c, toString;\n a = p1.y - p0.y;\n b = p0.x - p1.x;\n c = a*p1.x + b*p1.y;\n \n toString ...
[ "0.57762873", "0.55524695", "0.55094326", "0.54340774", "0.53997064", "0.5353648", "0.5349044", "0.5273151", "0.5259148", "0.52504265", "0.5246135", "0.524062", "0.52261645", "0.5208733", "0.52063787", "0.52063787", "0.5196581", "0.5195464", "0.5155396", "0.514865", "0.513194...
0.6270585
0
recursive disposal for meshes not materials, since they are reused
function _disposeMesh (mesh) { if (mesh.children) { mesh.children.forEach(_disposeMesh); } if (mesh.geometry && mesh.geometry.dispose) { mesh.geometry.dispose(); } if (mesh.dispose) { mesh.dispose(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispose() {\n\n\t\tconst materials = this.materials;\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0; i < materials.length; i ++ ) {\n\n\t\t\tmaterials[ i ].dispose();\n\n\t\t}\n\n\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\tconst child = children[ i ];\n\n\t\t\tif ( child.isMesh ) child...
[ "0.78554034", "0.7314414", "0.72481173", "0.6943704", "0.69227177", "0.6670877", "0.65561336", "0.65320575", "0.64877605", "0.64852387", "0.6392635", "0.6387809", "0.6384026", "0.63688844", "0.6366915", "0.63023466", "0.6242657", "0.6163794", "0.6153872", "0.614207", "0.61085...
0.7056994
3
TODO: layers; maintaining a seperate selection set is a pain, would much rather just store state changes on scene entities directly and either compound, override, or just sepeately maintain the set of static stuff and pending changes so that they could be more efficiently redrawn as changes occurred.
constructor ({ colorScheme = null, onAsyncLoadFinished } = {}) { this.scene = new Scene(); this.clearColor = defaultTheme.background; this.textureLoader = new TextureLoader(); this.sceneEntityMap = {}; this.maintainPointRefCounts = true; this.onAsyncLoadFinished = onAsyncLoadFinished ? onAsyncLoadFinished : () => {}; this._latestFloorState = null; this._latestCombinedFloorEntities = null; this._latestSelectionSet = null; this._numRemoves = 0; this._latestColorScheme = null; [this.materials, this.matLoadPromise] = generateMaterials(1); this._font = null; this._fontMaterial = null; this._idsPendingFontLoad = []; if (colorScheme) { this.syncColorScheme(colorScheme); } this._pointRadius = 4; this._lineThicknessDefaults = getLineThicknessDefaults(this.materials); this._pointRefCounts = {}; this.loadTextAssets(); this.matLoadPromise.then(() => this.onAsyncLoadFinished()); this._snapGuides = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sync_vdata_selstate(ctx) {\r\n for (let k in this.vertex_animdata) {\r\n let vd = this.vertex_animdata[k];\r\n \r\n if (!vd) {\r\n continue;\r\n }\r\n \r\n vd.animflag &= ~VDAnimFlags.OWNER_IS_EDITABLE;\r\n }\r\n\r\n for (let i=0; i<2; i++) {\r\n let list = i ? th...
[ "0.6264448", "0.6035584", "0.6006884", "0.5998101", "0.59950674", "0.59950674", "0.5933034", "0.5927648", "0.58956325", "0.58551466", "0.58531266", "0.58335435", "0.5807125", "0.57960033", "0.5748867", "0.5742959", "0.5739818", "0.5736569", "0.5704179", "0.5704048", "0.570345...
0.0
-1
define our controller actions (functions) AKA router middleware
function index(req, res) { res.render('index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_routes() {\n\n // Check your current user and roles\n app.get( '/status/:id', function( request, response ) {\n acl.userRoles( request.params.id || false, function( error, roles ){\n response.json( {'User': request.user ,\"Roles\": roles });\n });\n });\n\n // On...
[ "0.6964572", "0.6805262", "0.64788353", "0.644326", "0.64190686", "0.637253", "0.63364655", "0.6270464", "0.6206107", "0.6199991", "0.61869925", "0.6167403", "0.6141563", "0.6139946", "0.6119526", "0.6117217", "0.60917133", "0.6086891", "0.60454565", "0.604518", "0.6026071", ...
0.0
-1
Read all Object names sequentially, that do not have aliases
async function readAllNames(ids) { for (let i = 0; i < ids.length; i++) { const obj = await adapter.getForeignObjectAsync(ids[i]); await updateStateSettings(ids[i], obj); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllObjectNames() {\n var objNameList = [];\n appInstance.scene.traverse(function (obj) {\n if (notIgnoredObj(obj)) objNameList.push(obj.name);\n });\n return objNameList;\n }", "function getAllObjectNames() {\n var objNameList = [];\n appInstance.scene.traverse(fun...
[ "0.69463766", "0.6889968", "0.6595303", "0.6542297", "0.62997997", "0.59456205", "0.59136266", "0.58243036", "0.5760578", "0.5734781", "0.5717844", "0.5699025", "0.56614965", "0.5632451", "0.56161517", "0.55903566", "0.5588703", "0.5556608", "0.5542931", "0.5506107", "0.54973...
0.55092984
19
Read as "blank x" (verb, noun) meaning "set x to undefined"
function __(x) { x = undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set normal(value) {}", "set normal(value) {}", "set Normal(value) {}", "function ruleEmpty(meta, lex) {\n meta.transcript = (meta.transcript === '') ? '' : meta.transcript || lex\n}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set force(value) {}", "...
[ "0.6475919", "0.6475919", "0.5928419", "0.58958673", "0.5758426", "0.5758426", "0.5758426", "0.5758426", "0.55832267", "0.5498183", "0.54376215", "0.53393984", "0.5333855", "0.53226423", "0.5313265", "0.52907926", "0.52664465", "0.52548796", "0.52299476", "0.52027375", "0.516...
0.5489486
10
Specify a proxy that is already open to us. Called by the stash.
function activateProxy(args, info) { return util_1.createMethod(Object.assign({ method: { args, name: 'activateProxy', pallet: 'democracy' } }, info)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setProxyWs(incoming) {\n if (incoming.get(\"ws\") && incoming.get(\"mode\") === \"proxy\") {\n return incoming.setIn([\"proxy\", \"ws\"], true);\n }\n return incoming;\n}", "SetProxy(short, bool, int, string, string) {\n\n }", "registerProxy(proxy) {\n proxy.initializeNotifier(th...
[ "0.6090196", "0.5978869", "0.58043545", "0.54435056", "0.5435811", "0.5435811", "0.5368981", "0.5316783", "0.52316004", "0.52316004", "0.52275294", "0.52275294", "0.52275294", "0.52275294", "0.52275294", "0.52275294", "0.52275294", "0.52275294", "0.5208669", "0.5197916", "0.5...
0.4766005
43
Extend tty.Server to override middleware setup
function MyServer() { this.canonical = options.canonical; return TTYServer.apply(this, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MiddleMan() {\n this._server = http.createServer(this._onRequest.bind(this));\n this._proxyServer = httpProxy.createProxyServer({});\n this._handlers = [];\n}", "__prepareServer () {\n\n\t\tthis.server.inject(`sharedLogger`, sharedLogger);\n\n\t\tthis.server.mount(`/health-check`, (req, res) => res.r...
[ "0.6300785", "0.6186253", "0.6150104", "0.61436576", "0.6127923", "0.60946846", "0.6089851", "0.60636204", "0.60511065", "0.60152376", "0.5985307", "0.5980225", "0.5950251", "0.5947655", "0.5933516", "0.593279", "0.5930175", "0.59157693", "0.59107006", "0.5880162", "0.5877274...
0.67672527
0
get_List() is used to Display the entire users list Input : A reference to the response object Output: A json object which contains userdetails is sent as response
function get_List(request,response) { // If the session is not active then // Send the api-status as false // and set msg as'login_error' if(!(request.session.userName)) { var responseToSend={}; responseToSend.apiStatus=false; responseToSend.msg='login_error'; // Append the same to the log file fs.appendFile('log',"\nAPI:get_List\nOUTPUT:\n" ,function() { fs.appendFile('log',"response:"+JSON.stringify(responseToSend)+"\n------------------------------------------------------------------------------",function(){console.log("OUTPUT from get_List Written to log file"); // Send the response to the server response.send(responseToSend);}); }); } else { // Data before sending to the server fs.appendFile('log',"\n URL :/get_List - API NAME :get_List METHOD TYPE : GET" ,function() { // Once the API's details are logged now append the input and output information for the same file fs.appendFile('log',"\nINPUT:\n" ,function() { fs.appendFile('log',"request.session.userName:"+request.session.userName,function() { // Connect to the DB and extract all the details of logged-in users connection.query('select * from project.customer WHERE mobilenumber='+connection.escape(request.session.userName) ,function(err, rows,result) { if(err) { // Send 0 if unable to connect response.send(new Boolean(0)); response.end(); } else { // If there is no error in connecting to DB // create a json object of the result and // send the same as response var row=rows[0]; // Once the API's details are logged now append the input and output information for the same file fs.appendFile('log',"\nOUTPUT:\n" ,function() { fs.appendFile('log',"response:"+JSON.stringify(row)+"\n------------------------------------------------------------------------------",function(){console.log("OUTPUT from get_List Written to log file");}); }); response.send(row); } }); }); }); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getList(){\n\t\t// call ajax\n\t\tlet url = 'https://final-project-sekyunoh.herokuapp.com/get-user';\n\t\tfetch(url)\n\t\t.then(checkStatus)\n\t\t.then(function(responseText) {\n\t\t\tlet res = JSON.parse(responseText);\n\t\t\tlet people = res['people'];\n\t\t\tdisplayList(people);\n\t\t})\n\t\t.catch(fun...
[ "0.82468927", "0.7713392", "0.7444244", "0.73564297", "0.7301959", "0.7292181", "0.7290893", "0.7246679", "0.72433275", "0.72378504", "0.7207516", "0.7146974", "0.709022", "0.70833784", "0.70727235", "0.70722336", "0.70362", "0.70357305", "0.702062", "0.7007316", "0.6979749",...
0.0
-1
[END apps_script_slides_image_add_image] [START apps_script_slides_image_main] Adds images to a slides presentation.
function main() { var images = [ 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', 'http://www.google.com/services/images/phone-animation-results_2x.png', 'http://www.google.com/services/images/section-work-card-img_2x.jpg', 'http://gsuite.google.com/img/icons/product-lockup.png', 'http://gsuite.google.com/img/home-hero_2x.jpg' ]; var [title, subtitle] = deck.getSlides()[0].getPageElements(); title.asShape().getText().setText(NAME); subtitle.asShape().getText().setText('Google Apps Script\nSlides Service demo'); images.forEach(addImageSlide); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRemainingImageSlides(imageArray) {\n imageArray.forEach(src => {\n const img = `<img src=\"${src}\" alt=\"Photo from the 2021 KCC Foundation scholarship reception\">`;\n // Insert additional slides into both slider-instances\n $('#galleryTrack').slick('slickAdd', img); // The `...slick('slick...
[ "0.6982767", "0.6752146", "0.6639319", "0.6127675", "0.6099954", "0.6085157", "0.59212434", "0.5917827", "0.5899497", "0.5898721", "0.5837645", "0.58013916", "0.5795272", "0.5741586", "0.5716087", "0.57125163", "0.56856376", "0.5669663", "0.5610368", "0.56024754", "0.5598941"...
0.6363399
3
The driver application features an array of image URLs, setting of the main title & subtitle, and creation of individual slides for each image.
function main() { var images = [ 'http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', 'http://www.google.com/services/images/phone-animation-results_2x.png', 'http://www.google.com/services/images/section-work-card-img_2x.jpg', 'http://gsuite.google.com/img/icons/product-lockup.png', 'http://gsuite.google.com/img/home-hero_2x.jpg' ]; var [title, subtitle] = presentation.getSlides()[0].getPageElements(); title.asShape().getText().setText(NAME); subtitle.asShape().getText().setText('Google Apps Script\nSlides Service demo'); images.forEach(addImageSlide); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var images = [\n 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',\n 'http://www.google.com/services/images/phone-animation-results_2x.png',\n 'http://www.google.com/services/images/section-work-card-img_2x.jpg',\n 'http://gsuite.google.com/img/i...
[ "0.7255615", "0.6701538", "0.6493436", "0.62895447", "0.627597", "0.6230609", "0.61865693", "0.6151827", "0.60887355", "0.601292", "0.5989343", "0.5983578", "0.59632605", "0.5953698", "0.5951431", "0.5932212", "0.59025717", "0.58852196", "0.58429545", "0.5817123", "0.58061314...
0.74116576
0
HTTP Upload Appender for ngLogCustom module Uploads the logs that have a log level >= minLevel to postUrl in the specified interval. No uploads happen if no suitable logs have been produced.
function CatHttpLogAppender($http, $interval, $log, config, HTTP_LOGGER_NAME, LOG_LEVEL_ORDER) { var logger = $log.Logger(HTTP_LOGGER_NAME); if (typeof config.postUrl === 'undefined') { throw new Error('catHttpLogAppenderProvider requires definition of postUrl'); } var logs = []; this.report = function (level, group, message, memorySizes) { logs.push({ level: level, group: group, message: typeof message === 'string' ? message : message.toString(), memorySizes: memorySizes, timestamp: new Date().getTime() }); }; this.flush = function () { var minLevelOrder = LOG_LEVEL_ORDER[config.minLevel]; var logsToSend = []; angular.forEach(logs, function (logEntry) { if (LOG_LEVEL_ORDER[logEntry.level] >= minLevelOrder) { logsToSend.push(logEntry); } }); logs.length = 0; if (logsToSend.length > 0) { return $http.post(config.postUrl, logsToSend, config) .success(function () { logger.debug('Successfully uploaded logs.'); }) .error(function (data, status, headers, config, statusText) { logger.debug('Error uploading logs: ' + status + ' ' + statusText); }); } else { logger.debug('No logs to upload - skipping upload request.'); } }; $interval(this.flush, config.intervalInSeconds * 1000, 0, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _writeLogsToServer(logLevel, loggingUrl) {\n var dataToSend;\n\n dataToSend = {\n logLevel: logLevel\n , logData : app.cache.logData\n };\n app.cache.logData = [];\n $.ajax({\n type: 'POST'\n , url: loggingUrl\n , data: dataToSend\n });\...
[ "0.54674697", "0.51025254", "0.49999103", "0.49235183", "0.47931123", "0.47719052", "0.4761062", "0.47472373", "0.46536362", "0.4648227", "0.46080893", "0.455697", "0.45363548", "0.45363548", "0.45363548", "0.4526551", "0.44752958", "0.44590628", "0.44590628", "0.44584626", "...
0.71909446
0
Rimuovere le persone sotto 1,50 di altezza
function rimuovi(){ var j = 0; // Per ogni elemento controllo la condizione // Se è idoneo, copio elemento in J for(var i = 0; i<persone.length; i++){ if(persone[i].altezza > 1.5) { persone[j++] = persone[i]; } } // Aggiorno array con valori nuovi messi in J persone.length = j; // Visualizzo visualizzaPersone(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ordina(){\n\n\tfor (var i = 0; i<persone.length; i++){\n\t\tvar minimoFinOra = i; \n\n\t\tfor(var j=i+1; j<persone.length; j++){\n\n\t\t\tif(persone[j].altezza<persone[minimoFinOra].altezza){\n\n\t\t\t\tminimoFinOra = j;\n\t\t\t}\n\t\t}\n\t\t// Salvo il valore minimo\n\t\tvar tmp = persone[i];\n\t\tperson...
[ "0.64422095", "0.61768454", "0.61179996", "0.5892089", "0.5804307", "0.5803588", "0.5788157", "0.5760647", "0.5747325", "0.5740767", "0.57371205", "0.57371205", "0.57371205", "0.57371205", "0.57325304", "0.5719989", "0.5711199", "0.5709437", "0.570328", "0.5696191", "0.569617...
0.5878641
4
gestire ordine in base ai valori
function ordina(){ for (var i = 0; i<persone.length; i++){ var minimoFinOra = i; for(var j=i+1; j<persone.length; j++){ if(persone[j].altezza<persone[minimoFinOra].altezza){ minimoFinOra = j; } } // Salvo il valore minimo var tmp = persone[i]; persone[i] = persone[minimoFinOra]; persone[minimoFinOra] = tmp; } //Visualizzo visualizzaPersone(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n va...
[ "0.55788004", "0.54666215", "0.54242295", "0.5423678", "0.5421097", "0.53369373", "0.5245887", "0.52254087", "0.5220401", "0.5202418", "0.51871294", "0.51262957", "0.512494", "0.5070953", "0.5052998", "0.5047292", "0.5030834", "0.50111616", "0.49746653", "0.4942044", "0.49388...
0.5561543
1
Used only with promisify. Transform callback to promise result.
function translateError(err, result) { if (!err) { return this.resolve(result); } if (typeof err === 'object') { if (err instanceof Error) { return this.reject(ret); } return this.reject(Object.assign(new Error(err.message), { errCode: err.errCode })); } else if (typeof err === 'string') { return this.reject(new Error(err)); } this.reject(Object.assign(new Error(), { origin: err })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promisify () {\n\t var callback;\n\t var promise = new Promise(function (resolve, reject) {\n\t callback = function callback (err, value) {\n\t if (err) reject(err);\n\t else resolve(value);\n\t };\n\t });\n\t callback.promise = promise;\n\t return callback\n\t}", "function promisif...
[ "0.7245928", "0.6800695", "0.63663805", "0.63389796", "0.6273299", "0.6189637", "0.61894166", "0.6179876", "0.6132731", "0.61184716", "0.61184716", "0.61184716", "0.6102181", "0.6102181", "0.60698295", "0.60670626", "0.6028015", "0.59939146", "0.59934825", "0.59591895", "0.59...
0.0
-1
Display Voucher with Item From localStroage
function vouchertable() { var localstorageitem = localStorage.getItem('cart'); // var notes = note; if (localstorageitem) { var localstorageitem = JSON.parse(localstorageitem); var mycart = localstorageitem.mycart; var tbodytable =''; var foottable=''; var subtotal =0; var total=0; var tax=25; var total_tax =0; var shipping = 2500; var j=1; $.each(mycart,function (i,v) { if (v) { var id = v.id; var name = v.name; var price = v.price; var photo = v.image; var qty = v.qty; console.log("voucherqty - "+qty); var eachtotal = price * qty; tbodytable +='<tr>'+ '<td>'+j+'</td>'+ '<td>'+name+'</td>'+ '<td>'+price+'</td>'+ '<td>'+qty +'</td>'+ '<td>'+eachtotal+'</td>'+ '</tr>'; subtotal += (price*qty); total_tax = parseInt(subtotal) + parseInt(tax); j++; } }) total += total_tax; console.log(total); foottable +='<tr>'+ '<td colspan="2" rowspan="4">'+ '<p> NOTES : </p>'+ '<p> '+note+' </p>'+ '</td>'+ '<td colspan="2">'+ '<p> Subtotal </p>'+ '</td>'+ '<td colspan="2">'+ '<p> '+subtotal+' </p>'+ '</td>'+ '</tr>'; foottable +='<tr>'+ '<td colspan="2"> Tax </td>'+ '<td> 5% </td>'+ '</tr>'; foottable +='<tr>'+ '<td colspan="2" style="color: red; font-size:20px;"> Total Amount:</td>'+ '<td>'+total+'</td>'+ '</tr>'; $('#voucher_tbody').html(tbodytable); $('tfoot').html(foottable); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayInventory() {\n\tqueryStr = 'SELECT * FROM bamazondb.products';\n\tconnection.query(queryStr, function(err, data) {\n\t\tif(err) throw err;\n\n\t\tconsole.log(\"Current Inventory: \");\n\t\tconsole.log(\"..................................................................................................
[ "0.5848599", "0.5817837", "0.5817837", "0.5817837", "0.5817837", "0.5817837", "0.5817837", "0.5790922", "0.57839847", "0.576355", "0.57463163", "0.5733274", "0.5714628", "0.5688417", "0.56780815", "0.562454", "0.56078476", "0.56077284", "0.5576948", "0.55680764", "0.556762", ...
0.51944053
79
getEmailFromLocalStorage function gets the user email from local storage, it returns false if value is not found in local storage. email is stored as email in local storage
function getEmailFromLocalStorage() { if (localStorage.getItem("email")) { return localStorage.getItem("email"); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_user_email(){ return localStorage['logged_in_as']; }", "function checkAccount() {\n console.log(localStorage);\n if (localStorage.getItem(\"email\") === null) {\n\n } else {\n existingAccount = true;\n }\n}", "function isEmailUnique() {\n\n var email = document.getElementById(\...
[ "0.7614653", "0.7370305", "0.7315754", "0.67491454", "0.6708699", "0.66201174", "0.6543067", "0.652607", "0.64364916", "0.64181274", "0.640039", "0.63077223", "0.6306384", "0.6305968", "0.6297027", "0.62538064", "0.62161314", "0.6205636", "0.61839736", "0.61826116", "0.617723...
0.88203657
0
getRecipesFromLocalStorage function gets the saved recipes from local storage, it returns false if value is not found in local storage. recipe is stored as recipe in local storage
function getRecipesFromLocalStorage() { if (localStorage.getItem("recipes")) { recipes = localStorage.getItem("recipes"); return JSON.parse(recipes); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getData() {\n var data = [];\n if (typeof(Storage) !== \"undefined\") {\n data = localStorage.getItem(\"recipes\");\n if (data !== null) {\n data = JSON.parse(data);\n } else {\n data = mockData;\n }\n } else {\n console.log(\"WARNING: no local storage, cannot save r...
[ "0.7369242", "0.70015085", "0.685982", "0.6499887", "0.6338447", "0.6327309", "0.62800825", "0.6271402", "0.62226397", "0.6222276", "0.62205327", "0.6188178", "0.61537135", "0.61517423", "0.61320984", "0.6112645", "0.6092996", "0.6090652", "0.60802317", "0.60758847", "0.60276...
0.88765395
0
setUserLocalStorage function sets the username, email values to local storage
function setUserLocalStorage(username, email) { localStorage.setItem("username", username); localStorage.setItem("email", email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }", "function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token...
[ "0.7715453", "0.7715453", "0.7715453", "0.7715453", "0.7715453", "0.7715453", "0.7651826", "0.76277274", "0.76040643", "0.75565594", "0.75184935", "0.7391666", "0.73473936", "0.73104584", "0.7219108", "0.72054136", "0.71536237", "0.70849776", "0.7067868", "0.7016784", "0.7010...
0.89102155
0
Stores recipes and length in the local storage
function setRecipeFromLocalStorage(recipe) { var recipes = localStorage.getItem("recipes"); recipes = JSON.parse(recipes); console.log(recipes); console.log(recipe + " to be added"); if (recipes == null) { var recipes = []; recipes[0] = recipe; console.log(recipes); var index = 1; localStorage.setItem("length", index); } else { var index = localStorage.getItem("length"); recipes[index++] = recipe; console.log(recipes); console.log(index); localStorage.setItem("length", index); } localStorage.setItem("recipes", JSON.stringify(recipes)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveNewRecipe() {\n if (this.state.newestRecipe.recipeName && this.state.newestRecipe.ingredients) {\n let recipes = this\n .state\n .recipes\n .slice();\n recipes.push({recipeName: this.state.newestRecipe.recipeName, ingredients: this.state.newestRecipe.ingredients});\n loca...
[ "0.681646", "0.6704981", "0.6697677", "0.63790077", "0.6320328", "0.63082176", "0.6302978", "0.6230274", "0.6208092", "0.61903894", "0.6142571", "0.612609", "0.6118722", "0.6106649", "0.6089457", "0.60274816", "0.6006594", "0.5909437", "0.5909046", "0.5908755", "0.5895762", ...
0.72961426
0
FIXME This is a workaround for If we exit immediately winston does not get a chance to write the last log message. So we wait a short time before exiting.
function exitWithStatus(exitStatus) { logger.info( "Exiting with status " + exitStatus ); setTimeout( function() { process.exit(exitStatus); }, 500 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gracefulShutdown() {\n winston.log('info','Received kill signal, shutting down gracefully.');\n server.close(function() {\n winston.log('Closed out remaining connections.');\n process.exit();\n });\n\n // if after\n setTimeout(function() {\n winston.log('error','Could n...
[ "0.615669", "0.57047313", "0.56274146", "0.5616755", "0.5528896", "0.5430029", "0.53931326", "0.5348744", "0.5301851", "0.5294547", "0.5290841", "0.5235755", "0.5185641", "0.5180669", "0.5176925", "0.51713663", "0.5159321", "0.5150351", "0.5141504", "0.51240903", "0.51159567"...
0.0
-1
get the list of ports:
function printList(portList) { // portList is an array of serial port names for (var i = 0; i < portList.length; i++) { // Display the list the console: console.log(i + " " + portList[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listPorts() {\n dataPort = [];\n SerialPort.list().then(\n ports => {\n ports.forEach(port => {\n dataPort.push(port.path + \"\");\n // console.log(\"burak\");\n // console.log(port.path);\n })\n },\n err => {\n console.error('Error ...
[ "0.7853014", "0.75441885", "0.74799854", "0.7265588", "0.71404546", "0.71372634", "0.69666374", "0.65937644", "0.65558815", "0.6530326", "0.6418495", "0.6373536", "0.6326681", "0.62959504", "0.6288749", "0.6274038", "0.626407", "0.6226336", "0.6221951", "0.6214548", "0.620607...
0.6384153
12
Start function to create new pvid
function replaceAdParam(srcStr, pName, pValue) { var paramRegEx = new RegExp("\\b" + pName + "=[^&#\"']*"); srcStr = srcStr.replace(paramRegEx, pName + "=" + pValue); return srcStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makevid(preformer){\r\n\r\n// image\r\n\tprefimg='<img class=\"png\" width=\"180\" height=\"148\" src=\"http://cdn-i.highwebmedia.com/roomimage/'+preformer+'.jpg\" img style=\"float:right;margin-right:100px;margin-top:10px;border-width:5px;border-style:double; \">';\r\n\tFversion=readCookie(\"CBversion\")...
[ "0.61306745", "0.5994796", "0.59340876", "0.59247714", "0.58977413", "0.58869493", "0.5836164", "0.5828873", "0.5799598", "0.57475215", "0.5691742", "0.56917155", "0.5624253", "0.5618819", "0.56136113", "0.55715996", "0.55389524", "0.55300015", "0.5529355", "0.5518904", "0.55...
0.0
-1
Random Num Generator for pvid
function randomNum() { var randomNumber = Math.round(999999999 * Math.random()); return randomNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomNumGen() {\n return Math.floor(Math.random() * 102) + 19;\n }", "function getRandomNumber () {}", "function rand() {\r\n if(!gnt--) {\r\n prng(); gnt = 255;\r\n }\r\n return r[gnt];\r\n }", "random(): number {\n let u: number = (prng.random(): any);\n retur...
[ "0.72758335", "0.7219318", "0.7172872", "0.71435195", "0.7057339", "0.7038372", "0.70312816", "0.6980145", "0.6977365", "0.69728273", "0.69627815", "0.69466364", "0.69245386", "0.69245386", "0.6923437", "0.6915384", "0.69142437", "0.69129294", "0.6910269", "0.69099253", "0.69...
0.6594815
87
Remove first and last character
function removeChar(str) { //You got this! let arr = str.split('') arr.pop() arr.shift() let s = arr.join('') return s }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeChar(str){\n var str = str.split('');\n var removedLastChar = str.pop();\n var removedFirstChar = str.shift();\n var str = str.join(''); \n return str;\n}", "function removeFirstAndLast (str) {\n let value = str.slice(1, str.length - 1);\n return value;\n}", "function removeLastChar(t...
[ "0.72691405", "0.6929681", "0.68435603", "0.68313366", "0.68193316", "0.67914224", "0.6725234", "0.6719821", "0.66925335", "0.6624974", "0.66161114", "0.65817165", "0.6571325", "0.6555372", "0.6555372", "0.6551751", "0.65439194", "0.65239716", "0.6498269", "0.643453", "0.6422...
0.6428404
20
Add all index of an array
function positiveSum(arr) { let sum = 0 arr.map( num => num > 0 ? sum += num : null) return sum }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAllToArray(items,arr){for(var i=0;i<items.length;i++){arr.push(items[i]);}}", "calAllIndex() {\n for (let i = 0; i < this.length; i++) {\n for (let j = 0; j < this.breath; j++) {\n let index = i + \"-\" + j;\n this.indexes.push(index);\n }\n ...
[ "0.6395287", "0.63486606", "0.63447315", "0.6324168", "0.63031083", "0.63031083", "0.62665117", "0.61701673", "0.6124362", "0.61149746", "0.6105366", "0.60850364", "0.60814285", "0.6022867", "0.59830815", "0.5974806", "0.5946294", "0.59406817", "0.5907516", "0.58966327", "0.5...
0.0
-1
Mathematical Operations Take three values (operator as a string, num1, num2) return the result
function basicOp(operation, value1, value2) { if (operation == '+') { return value1 + value2 } else if (operation == '-') { return value1 - value2 } else if (operation == '*') { return value1 * value2 } else if (operation == '/') { return value1 / value2 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function operate(num1, num2, operator)\n{\n let ans;\n if(operator == '+')\n ans = add(num1,num2);\n else if (operator == '-')\n ans = sub(num1,num2);\n else if ( operator == \"/\")\n ans = div(num1,num2);\n else \n ans = mul(num1,num2);\n return ans;\n}", "function ...
[ "0.8473871", "0.8417985", "0.8371187", "0.8349881", "0.8339949", "0.83288884", "0.83181113", "0.82958806", "0.8201051", "0.81657624", "0.8145202", "0.8034015", "0.8008417", "0.7982836", "0.7966775", "0.78906846", "0.7878468", "0.7877396", "0.78534144", "0.7851636", "0.7843367...
0.7821531
23
Basic Hello World function
function greet(){ return "hello world!" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sayHello() {\n console.log('Hello, ' + name);\n }", "function greet (name) {\n console.log ('Hello World')\n}", "function sayHello() {\n console.log(\"Hello World!!\");\n}", "function sayhello(){\nconsole.log('Hello World!')\n}", "function helloWorld() {\n\tconsole.log('Hello, World!...
[ "0.76628757", "0.7622883", "0.7593462", "0.7556521", "0.7513592", "0.75128376", "0.7504352", "0.745953", "0.7444117", "0.74412364", "0.74350256", "0.7434837", "0.7425533", "0.7418798", "0.7405245", "0.74043167", "0.73732007", "0.736835", "0.73586845", "0.7320423", "0.73132557...
0.6990889
96
Check to see if number is even or odd
function even_or_odd(number) { if (number % 2 === 0) { return "Even" } else { return "Odd" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function oddChecker(num){\n\treturn num % 2 !== 0\n}", "function checkEven(number) {\n return +number % 2 === 0;\n }", "function evenIs(num){\n\treturn num % 2 == 0;\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n...
[ "0.84871453", "0.8484009", "0.8453357", "0.84017587", "0.84017587", "0.8394394", "0.8365725", "0.8348935", "0.8285799", "0.8272562", "0.8261641", "0.8251474", "0.82507724", "0.8250133", "0.8243307", "0.8234787", "0.8230105", "0.82252955", "0.82113045", "0.820456", "0.82021", ...
0.0
-1
given camelCasing string, return with spaces
function solution(string) { let arr = string.split('') let arr2 = [] for (i = 0; i < arr.length; i++) { if (arr[i] === arr[i].toUpperCase()) { arr2.push(' ', arr[i]) } else { arr2.push(arr[i]) } } console.log(arr2.join("")) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function camelCasizza(s) {\r\r\n s = s.toLowerCase()\r\r\n var c = s[0].toUpperCase();\r\r\n return c + s.substring(1, s.length);\r\r\n}", "function camelCase(text){\n let words = text.split(\" \");\n var ans=\"\";\n for(var j=0;j<words.length;j++){\n ans += words[j].substr(0,1).toUpperC...
[ "0.7649266", "0.7571316", "0.75013405", "0.73361933", "0.73210734", "0.73018503", "0.7289684", "0.7285795", "0.7251961", "0.72507143", "0.7249815", "0.7240875", "0.7238265", "0.7237325", "0.72169477", "0.7215706", "0.7215706", "0.7200037", "0.7195006", "0.71870553", "0.718505...
0.0
-1
return longest string with only 2 unique letters
function string(p1) { let string = p1.split("") let sub = [] let sub2 = [] let count = 0 for (i = 0; i < string.length; i++) { if (!sub.includes(string[i]) && count === 2) { if (sub2.length < sub.length) { sub2 = sub } count = 0 sub = [] let pos = 1 let start = string[i - 1] for (j = i-1; j > 0; j--) { if (string[j] == start) { pos++ } else { break; } } i = i - pos; } else if (sub.includes(string[i])) { sub.push(string[i]) } else if (count < 2) { sub.push(string[i]) count++ } } return sub2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestPossible(s1, s2) {\n const all = (s1 + s2).split('')\n const uniqueSortedLetters = [...new Set(all)].sort()\n return uniqueSortedLetters.join('')\n}", "function longestString(strings) {\n\n}", "function longestString(longStr){\n var mostAmntOfCharacters = longStr.reduce((x,y) => x.length ...
[ "0.7652051", "0.7617659", "0.75543123", "0.7379306", "0.7368392", "0.7354283", "0.73222154", "0.73021054", "0.73021054", "0.7274617", "0.72505206", "0.7194048", "0.71587837", "0.7139319", "0.71073025", "0.71041304", "0.7097804", "0.7094539", "0.7089854", "0.7087168", "0.70838...
0.0
-1
solution2("To crop or not to crop", 21) solution2("Codility We test coders", 14)
function solution3(A) { count = 0; for (i = 0; i < A.length; i++) { if (i + 1 > A.length || i + 2 > A.length) { } else if (A[i] - A[i + 1] == A[i + 1] - A[i + 2]) { count += 1; let newA = A.slice(i + 2) let dist = A[i] - A[i + 1] for (j = 0; j < newA.length; j++) { if (j + 1 >= A.length) { console.log("No more new array!") } else if (newA[j] - newA[j + 1] == dist) { count += 1; } } } } // console.log(count) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function C012_AfterClass_Jennifer_ConfiscateCrop() {\n\tPlayerRemoveInventory(\"Crop\", 99);\n\tGameLogAdd(\"HasCrop\");\n\tC012_AfterClass_Jennifer_SetPose();\n\tC012_AfterClass_Jennifer_AllowLeave();\n}", "function image_clipping(){\n\tvar top \t= (man_settings.man_cropper.offsetTop<=0) ? (-1*man_settings.man_...
[ "0.62119865", "0.5658088", "0.56347024", "0.5539704", "0.5496342", "0.5487966", "0.54491174", "0.54458094", "0.5435846", "0.543056", "0.5404392", "0.5380468", "0.5343816", "0.5332424", "0.5328485", "0.5324252", "0.53133583", "0.5275224", "0.5255005", "0.5250793", "0.5250793",...
0.0
-1
given two strings, determine if the first string ends with the second string
function solution(str, ending){ return str.endsWith(ending) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endOther(string1, string2){\n string1 = string1.toLowerCase();\n string2 = string2.toLowerCase();\n if(string1.endsWith(string2) || string2.endsWith(string1)){\n return true;\n }else{\n return false;\n }\n}", "function endsWith(a, b) {\n if (a.length < b.length) { return ...
[ "0.8507432", "0.8217708", "0.7524355", "0.73843324", "0.72632766", "0.7217883", "0.71901774", "0.71891886", "0.71859145", "0.71859145", "0.7176736", "0.7166842", "0.7125076", "0.70127064", "0.70106536", "0.69919944", "0.69919944", "0.69919944", "0.69919944", "0.69919944", "0....
0.7175202
11
count amount of characters in string
function count (string) { var count = {}; string.split('').forEach(function(s) { count[s] ? count[s]++ : count[s] = 1; }); return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count(str) {\n return str.length;\n}", "function stringCount(str) {\n return str.length\n}", "function countChars(txt) {\n return txt.length;\n}", "function numChars(str1){\n return str1.length\n}", "function count(str,char) {\n\tvar re = new RegExp(char,\"gi\");\n\treturn (str.match(re) || ...
[ "0.8247284", "0.819294", "0.80376357", "0.79851925", "0.7916394", "0.7881483", "0.7865591", "0.78522545", "0.7838028", "0.7838028", "0.7838028", "0.7838028", "0.7816918", "0.78112334", "0.77909994", "0.77909994", "0.77909994", "0.77909994", "0.77909994", "0.7771662", "0.77413...
0.0
-1
'this' is a reference to an object that represents the current execution scope
function sayHi() { console.log("HI"); console.log(this); // will print the window object }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contextOfThis(){\n return this\n}", "function doSomethingElse() {\n console.log(this, 'normal function, this has its own context here');\n console.log(self, 'normal function with a workaround to use this storing it in a variable called self');\n }", "function thisExampl...
[ "0.7430529", "0.72209483", "0.7047724", "0.7002351", "0.6924332", "0.68703294", "0.68342733", "0.6818696", "0.6809573", "0.6760662", "0.67591065", "0.6720123", "0.67157316", "0.6705324", "0.6703768", "0.66869605", "0.6669496", "0.6666427", "0.6646928", "0.6641873", "0.6639027...
0.0
-1
'this' in arrow functions refers to the same object as 'this' in its parent function
start2() { this.timerId = setInterval(() => { console.log(this.pickPhrase()); // 'this' refers to annoyer object }, 3000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo() {\n // console.log(this);\n return () => {\n console.log(\"In arrow function:\", this.a);\n };\n}", "function contextOfThis(){\n return this\n}", "function callMeMaybe() {\r\n return () => { console.log('arrow function: ', this)}\r\n}", "function foo() {\n console.log(this.bar);\n}"...
[ "0.7275097", "0.69523966", "0.69335866", "0.6865415", "0.6853091", "0.6851767", "0.6844596", "0.68111867", "0.68111867", "0.67866653", "0.6780214", "0.67790794", "0.67765754", "0.67743975", "0.6729302", "0.66929823", "0.6655402", "0.6652875", "0.6652875", "0.66292596", "0.662...
0.0
-1
this method should be supported in RXJS 2 public patients: Observable> = this._patients.asObservable();
constructor(patientBackendService) { this.patientBackendService = patientBackendService; this._patients = new Rx_1.BehaviorSubject(immutable_1.List([])); this._patientFormPage = new Rx_1.BehaviorSubject(PatientFormPage.Details); this._showCardView = new Rx_1.BehaviorSubject(true); this._startIndex = new Rx_1.BehaviorSubject(0); this._endIndex = new Rx_1.BehaviorSubject(3); this._patientsSize = new Rx_1.BehaviorSubject(0); this.loadInitialData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get patients () {\n\t\treturn this._patients;\n\t}", "getObservable()\n {\n return this.subject.asObservable();\n }", "function Observable() {\n\t/**\n\t * Lista di osservatori che richiedono di essere notificati ad un cambiamento di stato.\n\t * @type {Array.<Observer>}\n\t * @private\n\t */\n\tthis.obse...
[ "0.69550824", "0.61484927", "0.5973468", "0.583888", "0.5726242", "0.56862605", "0.56724006", "0.5556667", "0.541952", "0.5415404", "0.53977174", "0.52335817", "0.51911044", "0.518723", "0.51717466", "0.51546496", "0.5144299", "0.514183", "0.514183", "0.514183", "0.514183", ...
0.6391625
1
Pagination properties getter and setter
get startIndex() { return asObservable_1.asObservable(this._startIndex); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get pageSize() { return this._pageSize; }", "get currentPagination() {\n return this._currentPagination;\n }", "get pageSizeOptions() { return this._pageSizeOptions; }", "get paginator() { return this._paginator; }", "function Pagination(props) {\r\n var _this = _super.call(this, props) ||...
[ "0.74893063", "0.7349393", "0.7203362", "0.716896", "0.71516776", "0.71486986", "0.7138119", "0.7101385", "0.70203567", "0.70171416", "0.6896033", "0.6882311", "0.68740004", "0.6873007", "0.6853512", "0.681756", "0.68156886", "0.68156886", "0.68156886", "0.6754232", "0.672696...
0.0
-1
Formats the contact info
function formatItem(contact) { return contact.Name + ' [' + contact.Alias + '] | ' + contact.Team + ' | Hobbies: '+ contact.Hobbies; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertContactToString(item) {\n objString += '|{';\n objString += '\"type\": \"' + item.type + '\",';\n objString += '\"id\": \"' + item.id + '\",';\n objString += '\"firstName\": \"' + item.firstName + '\",';\n objString += '\"lastName\": \"' + item.lastName + '\",';\n...
[ "0.63130903", "0.62241745", "0.6199052", "0.6186122", "0.6171605", "0.58700246", "0.58234555", "0.5822236", "0.5800665", "0.57151634", "0.5708914", "0.5675894", "0.5675191", "0.5667201", "0.56052315", "0.55989873", "0.5587502", "0.55674446", "0.55618584", "0.5540813", "0.5538...
0.7048042
0
get the list of contacts (each index is an entry)
function getContacts() { return contacts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getContacts() {\n return contacts;\n }", "contactList() {\n\t if (Session.get(\"searchName\") != \"\") {\n\t\tvar searchString = Session.get(\"searchName\");\n\t\treturn Template.contacts.__helpers[\" findContact\"](searchString);\n\t }\n\t else\n\t\treturn Contacts.fi...
[ "0.83700484", "0.79109913", "0.76827186", "0.7411142", "0.7411142", "0.73865044", "0.72450215", "0.71513414", "0.71374464", "0.7053995", "0.70517385", "0.7032372", "0.7021278", "0.69623154", "0.6917967", "0.68560165", "0.6765175", "0.6759798", "0.6744462", "0.6718358", "0.670...
0.8267165
1
SEARCHES FOR THE CONTACT WITH THE ALIAS ENTERED
function find() { console.log(getContacts()); var alias = $('#contactAlias').val(); //if valid alias if (alias && alias != '' && alias != undefined) { $.getJSON(uri + '/' + alias) .done(function (data) { $('#contact').text(formatItem(data)); }) .fail(function (jqXHR, textStatus, err) { $('#contact').text('Error: ' + err); }); } //if INVALID value for alias, output error message else { $('#contact').text('Error: Cannot search for invalid or no alias.') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchName(name){\n var nameABC = change_alias(name).toLowerCase();\n for(let contact of listContact)\n {\n if(change_alias(contact.Name).toLowerCase().indexOf(nameABC)!== -1)\n console.log(contact);\n }\n}", "function searchContact(ev) {\n setContacts(contacts.filter((_) => _.name.t...
[ "0.75710016", "0.66473806", "0.65937567", "0.63445574", "0.626788", "0.62500834", "0.6249178", "0.6212356", "0.6195517", "0.6131622", "0.61005646", "0.59662116", "0.5903321", "0.5887522", "0.58268905", "0.5822486", "0.58189625", "0.58171904", "0.5798874", "0.5792916", "0.5787...
0.5978027
11
searches the existing list of contacts in a static setting (no actual querying of data is done)
function query() { //reset text area $('#searchResults').text(""); contacts = getContacts(); //get existing list of contacts var searchCat = $('#selectSearch').val(); //search category (ie. Name) var query = $('#selectQuery').val().toLowerCase(); //user query var temp = 0; //counter to indicate if matches found if (query && query != '' && query != undefined) { for (var i = 0; i < contacts.length; i++) { var contact = contacts[i][searchCat]; //go through each contact if (contact.toLowerCase().indexOf(query) >= 0) { $('<ul>', { text: formatItem(contacts[i]) }).appendTo($('#searchResults')); temp++; } //end of loop } if (temp == 0) { $('#searchResults').text("No matches found"); } } else { $('#searchResults').text('ERROR: query not valid.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contactList() {\n\t if (Session.get(\"searchName\") != \"\") {\n\t\tvar searchString = Session.get(\"searchName\");\n\t\treturn Template.contacts.__helpers[\" findContact\"](searchString);\n\t }\n\t else\n\t\treturn Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t}", "function searchContacts() {\n c...
[ "0.74078786", "0.6876069", "0.6838361", "0.67402154", "0.667373", "0.66549456", "0.6642438", "0.6420536", "0.641671", "0.63855106", "0.6385502", "0.6376897", "0.63427997", "0.6310897", "0.6303494", "0.62839806", "0.6268982", "0.6189789", "0.61882216", "0.61677134", "0.6161765...
0.62141
17
ADDS A CONTACT TO THE CONTACT LIST (NAME, ALIAS, TEAM, HOBBIES)
function add() { //get contact information from page var values = $('#addForm :input'); //an array of all inputs var inputs = $('#addForm').serialize(); //serialized version of the inputs //get each part of the contact var name = values[0].value; var alias = values[1].value; //alias = key var team = values[2].value; var hobbies = values[3].value; if (name && alias && team) { console.log($("#addForm").serialize()); //add contact $.post(uri, inputs, "json"); $('#addContact').text("Added " + name + " [ " + alias + " ] to the database."); $('#refresh').show(); //refresh the page to show the updated contact list } else { $('#addContact').text("To add a contact, you need NAME, ALIAS and TEAM."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addContact(){\n var name = readLineSync.question('name: ');\n var phoneNum = readLineSync.question('phone: ');\n var contact = {\n Name: name,\n Phone: phoneNum\n };\n listContact.push(contact);\n save();\n console.log(\"\\nthem thanh cong nhe!\");\n}", "function addContact(){\n let lastNa...
[ "0.67208964", "0.65374756", "0.64308107", "0.6419675", "0.62732035", "0.6248838", "0.61312896", "0.6107906", "0.6101962", "0.60928035", "0.608859", "0.6036398", "0.60298723", "0.60163015", "0.600878", "0.59914905", "0.594995", "0.591299", "0.58910793", "0.5880461", "0.5874919...
0.0
-1
DELETES A CONTACT FROM THE CONTACT LIST (BASED ON ALIAS)
function deleteContact() { var alias = $('#deleteAlias').val(); //store the alias provided by user $.ajax({ url: uri + '/' + alias, type: 'DELETE', success: function(result) { //done $('#deleteContact').text('Contact [ ' + alias + ' ] has been deleted from list.'); } }) .fail(function () { $('#deleteContact').text("Invalid alias. Check the alias and try again."); }) $('#refresh2').show(); //refresh the page to show the updated contact list //console.log("deleted successfully"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteContact(){\n var id = readLineSync.question(\"Lua chon id contact can xoa: \");\n listContact.splice(id,1);\n save();\n console.log(\"\\nXoa thanh cong nhe!\")\n\n}", "function deleteContact() {\n app.f7.actions([[{\n text: 'Delete Contact',\n red: true,\n onClick: fu...
[ "0.6580841", "0.64672863", "0.64549804", "0.64067894", "0.6198085", "0.61663175", "0.6137476", "0.613246", "0.6119947", "0.61086005", "0.604236", "0.6016374", "0.6003497", "0.5986705", "0.59671557", "0.5945955", "0.59337527", "0.58832395", "0.58733827", "0.58339447", "0.58208...
0.60610366
10
Function that would park a vehicle to the nearest entry point. accepts a vehicle object as a paramater. returns a List of where the vehicles is parked (A,B,C) and the parking slot object
park_vehicle(vehicle) { //Initial Loop through the list of parking slots for(var i=0 ; i<this.sizes.length; i++) { //check if the slot is occupied and if the vehicle size is SMALL //Small vehicles can park either of the three, Small, Medium, Large Parking Slot if(vehicle.vehicle_size === 'S' && !this.sizes[i].occupied) { //check if where would be the vehicle coming from entry point 1; if(vehicle.entry_point === 1) { // calculate for the closest distance from where the vehicle is coming from var currDistance = Math.abs(1 - this.map[0].entry_point1); var newDistance = Math.abs(1 - this.map[i].entry_point1); // check if the new distance is less than the curr distance if so park the vehicle // else park the vehicle with the lowest distance from the entry point of the vehicle if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } //check if where would be the vehicle coming from entry point 2; else if(vehicle.entry_point == 2) { // calculate for the closest distance from where the vehicle is coming from var currDistance = Math.abs(1 - this.map[0].entry_point2); var newDistance = Math.abs(1 - this.map[i].entry_point2); // check if the new distance is less than the curr distance if so park the vehicle // else park the vehicle with the lowest distance from the entry point of the vehicle if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } //check if where would be the vehicle coming from entry point 3; else if(vehicle.entry_point == 3) { // calculate for the closest distance from where the vehicle is coming from var currDistance = Math.abs(1 - this.map[0].entry_point3); var newDistance = Math.abs(1 - this.map[i].entry_point3); // check if the new distance is less than the curr distance if so park the vehicle // else park the vehicle with the lowest distance from the entry point of the vehicle if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } } //check the size of the vehicle and if the parking slot is occupied else if (vehicle.vehicle_size === 'M' && !this.sizes[i].occupied) { //if the vehicle size is medium it can only be parked at medium slot and large slot if(this.sizes[i].slot_size === MEDIUM_SLOT || this.sizes[i].slot_size === LARGE_SLOT) { if(vehicle.entry_point === 1) { var currDistance = Math.abs(1 - this.map[0].entry_point1); var newDistance = Math.abs(1 - this.map[i].entry_point1); if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } else if(vehicle.entry_point == 2) { var currDistance = Math.abs(1 - this.map[0].entry_point2); var newDistance = Math.abs(1 - this.map[i].entry_point2); if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } else if(vehicle.entry_point == 3) { var currDistance = Math.abs(1 - this.map[0].entry_point3); var newDistance = Math.abs(1 - this.map[i].entry_point3); if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() return [this.map[i], this.sizes[i]] } } // if there is no more available slot for the vehicle to parked // return no avaialable parking slot } else { return 'No available Parking Slot' } } //checks if the vehicle size is Large and if the parking slot is occupied //Large vehicles can only be parked at Large Parking Slot else if (vehicle.vehicle_size === 'L' && !this.sizes[i].occupied) { if(this.sizes[i].slot_size === LARGE_SLOT) { if(vehicle.entry_point === 1) { var currDistance = Math.abs(1 - this.map[0].entry_point1); var newDistance = Math.abs(1 - this.map[i].entry_point1); if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } else if(vehicle.entry_point == 2) { var currDistance = Math.abs(1 - this.map[0].entry_point2); var newDistance = Math.abs(1 - this.map[i].entry_point2); if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } else if(vehicle.entry_point == 3) { var currDistance = Math.abs(1 - this.map[0].entry_point3); var newDistance = Math.abs(1 - this.map[i].entry_point3); if(newDistance < currDistance) { currDistance = newDistance; this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } else { this.sizes[i].occupied = true; this.sizes[i].charge = 40; this.sizes[i].time_in = new Date() this.sizes[i].vehicle = vehicle; return [this.map[i], this.sizes[i]] } } } else { return 'No available Parking Slot' } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nearestParcel(place, parcels) {\n let routes = {};\n for (let parcelIndex in parcels) {\n routes[parcelIndex] = findRoute(roadGraph, place, parcels[parcelIndex].place)\n }\n\n let shortestRoute;\n for(let x in routes) {\n if(shortestRoute == undefined || routes[x].length < routes[shortestRoute]...
[ "0.64993197", "0.6336433", "0.55648494", "0.5564525", "0.54301274", "0.5417086", "0.53659356", "0.52854806", "0.5267247", "0.52330995", "0.5229277", "0.5125344", "0.5106067", "0.50674766", "0.50449854", "0.5040505", "0.49897933", "0.49877164", "0.49752247", "0.49747247", "0.4...
0.75456023
0
Function that would unpark a vehicle. accepts a vehicle object as a paramater. returns the total parking fee amount for how long the vehicle stayed at the parking slot.
unpack_vehicle(vehicle) { //Loops through the parking slots. for(var i = 0; i < this.sizes.length; i++) { //check if the parking slot is occupied and there is a vehicle parked. if(this.sizes[i].occupied && this.sizes[i].vehicle !== undefined) { //check if the vehicle provided in the parameter is the same with the vehicle parked in the parking slot. if(this.sizes[i].vehicle.plate_number === vehicle.plate_number) { //checks if the vehicle size is in a small parking slot. if(this.sizes[i].slot_size === SMALL_SLOT) { //calculate the total amount of parking fee the vehicle consumed. // small parking slot cause a 20/hour rate. // and every exceeding 24 hours the vehicles is charge for 5000 PHP. let total_charge = this.sizes[i].charge let time_out = new Date().getHours() let time_difference = Math.ceil(Math.abs(parseInt(this.sizes[i].time_in.getHours()) - parseInt(time_out))) while(time_difference > 24) { if(time_difference > 24) { total_charge += this.sizes[i].charge + 5000 time_difference -= 24; } } total_charge = total_charge + (20 * time_difference) this.sizes[i].occupied = false; this.sizes[i].vehicle = null; this.sizes[i].time_in = null; return `Total Parking Charge is: ${total_charge} PHP for vehicle ${vehicle.plate_number}` } //checks if the vehicle size is in a medium parking slot. else if (this.sizes[i].slot_size === MEDIUM_SLOT) { //calculate the total amount of parking fee the vehicle consumed. // medium parking slot cause a 60/hour rate. // and every exceeding 24 hours the vehicles are charged for 5000 PHP. let total_charge = this.sizes[i].charge; let time_out = new Date().getHours() let time_difference = Math.ceil(Math.abs(parseInt(this.sizes[i].time_in.getHours()) - parseInt(time_out))) while(time_difference > 24) { if(time_difference > 24) { total_charge += this.sizes[i].charge + 5000 time_difference -= 24; } } total_charge = total_charge + (60 * time_difference) this.sizes[i].occupied = false; this.sizes[i].vehicle = null; this.sizes[i].time_in = null; return `Total Parking Charge is: ${total_charge} PHP for vehicle ${vehicle.plate_number}` } //checks if the vehicle size is in a medium parking slot. else if (this.sizes[i].slot_size === LARGE_SLOT) { // calculate the total amount of parking fee the vehicle consumed. // large parking slot cause a 60/hour rate. // and every exceeding 24 hours the vehicles are charged for 5000 PHP. let total_charge = this.sizes[i].charge; let time_out = new Date().getHours() let time_difference = Math.ceil(Math.abs(parseInt(this.sizes[i].time_in.getHours()) - parseInt(time_out))) while(time_difference > 24) { if(time_difference > 24) { total_charge += this.sizes[i].charge + 5000 time_difference -= 24; // console.log(total_charge) } } total_charge = total_charge + (100 * time_difference) this.sizes[i].occupied = false; this.sizes[i].vehicle = null; this.sizes[i].time_in = null; return `Total Parking Charge is: ${total_charge} PHP for vehicle ${vehicle.plate_number}` } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unPark(){\n setDetail(selected, 'lat', 0);\n setDetail(selected, 'lng', 0);\n setDetail(selected, 'adress', '');\n clearMarkers();\n }", "function carLeaving(car){\n car.timeRemaining--;\n if (car.remainingElectricity <= 0){ //car is fully fuelled\n //Prevents cars th...
[ "0.5062176", "0.4862876", "0.48605102", "0.4858638", "0.48046634", "0.47867355", "0.47271547", "0.47139263", "0.46507627", "0.44915405", "0.44779438", "0.4468146", "0.43742844", "0.4372816", "0.4326032", "0.4316641", "0.43007958", "0.4283456", "0.42807347", "0.4271828", "0.42...
0.5479308
0
Create a string representation of the date.
function formatDate(date) { return date.getFullYear() + "/" + months[date.getMonth()] + "/" + check_zero(date.getDate()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toString()\n {\n /// UC13 -- Adding the date in short representation\n const options = { year: 'numeric', month: 'long', day: 'numeric'};\n const emplpyeeStartDate = this.startDate == undefined ? \"Undefined\" : this.startDate.toLocaleDateString(\"en-US\", options);\n return `\\n ID ...
[ "0.75973916", "0.758846", "0.75825757", "0.75206596", "0.74422365", "0.74422365", "0.7434667", "0.7341156", "0.7329712", "0.7311691", "0.72395635", "0.71936864", "0.7193564", "0.71796143", "0.7157693", "0.7152163", "0.7072284", "0.7033385", "0.70333123", "0.7027442", "0.69415...
0.0
-1
20160421 fetch data after startdate or enddate is changed
function resignData(data) { if (data.d === 'undefined') { console.log('un'); } var results = JSON.parse(data.d); Object.keys(results).map(function (k) { var datefliter = results[k].sickdate; var city_name = results[k].city_name; var town_name = results[k].town_name; var lat = results[k].lat; var lng = results[k].lng; var loccnt = results[k].count; var latlngarr = [lng, lat, loccnt]; //var marker = L.marker(new L.LatLng(lat, lng), { time: datefliter }); //marker_list.push(marker); if (lat != null && lng != null) { //alert(lat + ", " + lng) geojson.features.push({ "type": "Feature", "properties": { "sickdate": datefliter, // "time": datefliter "city": city_name, "town": town_name }, "geometry": { "type": "Point", "coordinates": latlngarr } }); } }); // 20160410 update several operations // due to javascript core, the function setmarkers() must be after all cases put into the map setmarkers(); resetslider(); reloadmarker(); $('#MapLoader1').hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ListDate(start = 0) {\r\n let end = start + (12 * 3600 * 1000);\r\n return new Promise((res, rej) => {\r\n this.db.query(\"SELECT C.* FROM \" + this.db.DatabaseName + \"._WSMK_Calendario AS C \" +\r\n \" LEFT JOIN \" + this.db.DatabaseName + \"._User as U on U.id = C.created...
[ "0.64892733", "0.64662874", "0.6211523", "0.6206695", "0.6142456", "0.6107244", "0.60717344", "0.60375684", "0.59969956", "0.5981756", "0.5945079", "0.5932486", "0.5901057", "0.59004486", "0.58930755", "0.58885026", "0.5852746", "0.5838475", "0.5776359", "0.5761849", "0.57523...
0.0
-1
The string returned by the "getNodeValue()" method for an Element Node is null.
function hc_nodeelementnodevalue() { var success; var doc; var elementNode; var elementValue; doc = load("hc_staff"); elementNode = doc.documentElement; elementValue = elementNode.nodeValue; assertNull("elementNodeValue",elementValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }", "function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\"...
[ "0.6444224", "0.6444224", "0.6444224", "0.6444224", "0.6444224", "0.6444224", "0.6393919", "0.6361848", "0.61373246", "0.6120681", "0.6119781", "0.6024086", "0.5964991", "0.5961994", "0.5906481", "0.5892821", "0.58725256", "0.58251286", "0.5750651", "0.575056", "0.575056", ...
0.6501883
0
populate the drop down list with ids from sample set
function populateDropDown() { // select the panel to put data var dropdown = d3.select('#selDataset'); jsonData.names.forEach((name) => { dropdown.append('option').text(name).property('value', name); }); // set 940 as place holder ID populatedemographics(jsonData.names[0]); visuals(jsonData.names[0]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeIDPulldown() {\n samples_data.names.forEach((val, index) => {\n let selDataset = d3.select(\"#selDataset\");\n let option = selDataset.append(\"option\");\n option.property(\"text\", val);\n option.property(\"value\", index);\n console.log(samples_data.names);\n })\n}", "funct...
[ "0.72692955", "0.66110945", "0.6570161", "0.6537719", "0.6521654", "0.64871025", "0.6406948", "0.6396835", "0.6368716", "0.6303995", "0.6301479", "0.6278536", "0.6274078", "0.62712055", "0.6250328", "0.62456286", "0.6237694", "0.6230388", "0.6219206", "0.62164885", "0.620469"...
0.59408414
55
set a function for working with demgraphic info panel
function populatedemographics(id) { //filter data with id, select the demographic info with appropriate id var filterMetaData= jsonData.metadata.filter(meta => meta.id.toString() === id)[0]; // select the panel to put data var demographicInfo = d3.select("#sample-metadata"); // empty the demographic info panel each time before getting new id info demographicInfo.html(""); // grab the necessary demographic data data for the id and append the info to the panel Object.entries(filterMetaData).forEach((key) => { demographicInfo.append("h5").text(key[0].toUpperCase() + ": " + key[1] + "\n"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disp_info(d) {\n //console.log(d);\n materialInfo.html(getMaterialInfo(d))\n .attr(\"class\", \"panel_on\");\n }", "function drawExtraDecalsFn() {\n }", "function drawExtraDecalsFn() {\n }", "function InfoBox() {\n}", "funct...
[ "0.6486069", "0.63386065", "0.63386065", "0.60748994", "0.6049459", "0.5824524", "0.57694054", "0.5757857", "0.5685926", "0.56495374", "0.56013", "0.55910856", "0.55881536", "0.55745596", "0.5559892", "0.5559312", "0.5532589", "0.5532413", "0.5529554", "0.5506044", "0.5505488...
0.52752507
56
Checks to see if player has revealed all of the letters in the active phrase
checkForWin() { const shown = document.getElementsByClassName('letter'); const shownArr = [...shown]; for (let show of shownArr) { if (show.classList.contains('hide')) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkForWin() {\r\n return this.activePhrase.phrase.split(\"\")\r\n // if any letter in the phrase hasn't been guessed, allLettersGuessed\r\n // will be false from that point on, and false will be returned.\r\n // if all letters of the phrase have been guessed, they'll all b...
[ "0.7196467", "0.71727264", "0.71602255", "0.71580786", "0.7141586", "0.70473367", "0.699682", "0.69952816", "0.69315636", "0.69069725", "0.6887574", "0.68518746", "0.678878", "0.6781155", "0.6747107", "0.662387", "0.65888125", "0.65854025", "0.6561763", "0.65555155", "0.65284...
0.0
-1
If player loses 5 lives, game ends
gameOver(gameWon) { const startScreen = document.getElementById('overlay'); startScreen.style.display = 'block'; const gameEndMessage = document.getElementById('game-over-message'); const gameEndOverlay = document.getElementById('overlay'); if (gameWon) { gameEndMessage.textContent = 'Good Work, You Won!'; gameEndOverlay.classList.replace('start', 'win'); } else { gameEndMessage.textContent = 'You Lost... Beter Luck Next Time!'; gameEndOverlay.classList.replace('start', 'lose'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loseLife() {\n\n lives--;\n\n if (lives <= 0) {\n gameView = VIEW_MAIN_MENU;\n\n // Go to leaderboard submission\n if (score > 0) {\n submitScore();\n }\n\n if (sndMusic) {\n sndMusic.stop();\n }\n }\n}", "function livesDecrease() ...
[ "0.744876", "0.72901064", "0.7182619", "0.71585816", "0.7095602", "0.70593554", "0.6994691", "0.697262", "0.6950658", "0.6918213", "0.6916512", "0.68931323", "0.6870362", "0.6862543", "0.6860329", "0.6825252", "0.6821924", "0.6817644", "0.68064684", "0.67798775", "0.67669076"...
0.0
-1
Removes a life if player is wrong
removeLife() { let heart = document.getElementsByTagName('img'); heart[this.missed].setAttribute('src', 'images/lostHeart.png'); this.missed += 1; if (this.missed === 5) { this.gameOver(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeLife() {\r\n const scoreboard = document.getElementsByClassName('tries');\r\n // Replace last heart with empty heart.\r\n scoreboard[scoreboard.length-this.missed-1].getElementsByTagName('img')[0].src = 'images/lostHeart.png'\r\n // count up missed property\r\n this.missed ...
[ "0.748021", "0.7457874", "0.7362768", "0.73250383", "0.72790605", "0.7277616", "0.726063", "0.72018504", "0.7181556", "0.7088839", "0.70352113", "0.7019711", "0.6970146", "0.6924143", "0.6897564", "0.68833065", "0.6873854", "0.68714863", "0.6869394", "0.6844467", "0.6839018",...
0.6510468
54
Disable selected letter's onscreen keyboard button If phrase dosent include guessed letter , add wrong (CSS class) If phrase includes the right letter, add correct (CSS class)
handleInteraction(keyButton) { const keys = document.getElementsByClassName('key'); for (let key of keys) { if (key.textContent === keyButton.textContent) { key.setAttribute('disabled', 'disabled'); } } const isMatched = this.activePhrase.checkLetter(keyButton.textContent); if (isMatched) { keyButton.classList.add('chosen'); this.activePhrase.showMatchedLetter(keyButton.textContent); if (this.checkForWin()) { this.gameOver(this.checkForWin()); } } else { keyButton.classList.add('wrong'); this.removeLife(); } console.log(keyButton); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function correctLetter(letter) {\n for (let key of keyboard) {\n if (key.textContent == letter) {\n key.classList.add(\"chosen\");\n key.disabled = true;\n }\n }\n}", "function incorrectLetter(letter) {\n for (let key of keyboard) {\n if (key.textContent == letter) {\n key.classList.ad...
[ "0.78025806", "0.77837574", "0.7417684", "0.71316534", "0.7118393", "0.7112934", "0.7112548", "0.7035374", "0.70206225", "0.7018149", "0.69472027", "0.6926001", "0.69098306", "0.688545", "0.68395984", "0.6836015", "0.68318504", "0.681902", "0.6814238", "0.6789591", "0.6764357...
0.7060315
7
TODO remove password field from serialiser or make read only
componentDidMount() { const context = this.context; fetch("http://localhost:8000/api/profile", { method: "GET", headers: { Authorization: `JWT ${localStorage.getItem("token")}` } }) .then(res => auth.checkLoginstatus(res)) .then(res => res.json()) .then(data => { this.setState({ user: data, loading: false }); context.updateValue("user", this.state.user); localStorage.setItem("user", JSON.stringify(data)); // localStorage.setItem("user", this.state.user); // console.log('user',context) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toJSON() {\n let userData = this.get() //.get built into get hte user we are working with\n delete userData.password //this removes the password so when we are passing around user info that the pw isnt a parto f that user object that gets passed between the backend and frontend..but does not remove it f...
[ "0.6969645", "0.6958941", "0.6932058", "0.6832797", "0.6495088", "0.64840424", "0.6396698", "0.6340693", "0.63017774", "0.6293822", "0.6247987", "0.62286043", "0.6185693", "0.61272347", "0.612679", "0.610655", "0.6045102", "0.60082656", "0.5996749", "0.5970258", "0.59666544",...
0.0
-1
static ballCount = 0;
constructor (position, speed, radius, color) { this.position = position; this.speed = speed; this.radius = radius; this.color = color; this.imgX = this.position.x - this.radius; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initBallList()\r\n\t{\r\n\t\tlet iterations = 0;\r\n\t\twhile (iterations < this.MAX_BALLS) {\r\n\t\t \tlet digit = Math.floor(Math.random() * this.MAX_BALLS) + 1;\r\n\r\n\t\t\tif (this.drawnBalls.indexOf(digit) < 0) {\r\n\t\t\t\tthis.drawnBalls.push(\r\n\t\t\t\t\tnew Ball(\r\n\t\t\t\t\t\twindow.innerWidth / 2 - 1...
[ "0.68659145", "0.664891", "0.66295743", "0.6608874", "0.6597889", "0.6588052", "0.6557229", "0.65261436", "0.64753914", "0.6460155", "0.6428755", "0.64130485", "0.63775074", "0.63549125", "0.6314341", "0.62728345", "0.6265309", "0.62562776", "0.6252278", "0.623935", "0.623153...
0.0
-1
draws a circle with correct position, color and radius
draw () { let context = canvas.getContext("2d"); context.beginPath(); context.arc( this.position.x, this.position.y, this.radius, 0, 2 * Math.PI ); context.fillStyle = this.color; context.fill(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCircle(x,y,radius,color)\r\n{\r\n\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\r\n}", "function drawCircle(center, radius, color) {\n context.beginPath();\n context.arc(center.x * 4800, center.y * 4800, 2 * .0025 * canvas.width, 2 * Math.PI, false);\n context.closePath();\n ...
[ "0.85059416", "0.8297965", "0.82682586", "0.8167714", "0.81101", "0.7985849", "0.79795027", "0.7961323", "0.7936154", "0.79239553", "0.78811926", "0.7826837", "0.781301", "0.7810477", "0.77944493", "0.7764531", "0.7756918", "0.77124274", "0.76867104", "0.7683053", "0.7678049"...
0.7573548
27
move circle and reverse direction if circle collides with border
move () { this.position.x += this.speed.x; this.position.y += this.speed.y; if( this.position.x + this.radius > canvas.width || this.position.x - this.radius < 0 ) this.speed.x *= -1; if( this.position.y + this.radius > canvas.height || this.position.y - this.radius < 0 ) this.speed.y *= -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustPosition(circle) {\n if (circle.x + circle.radius + circle.velocityX > cWidth\n || circle.x - circle.radius + circle.velocityX < 0) {\n circle.velocityX = -circle.velocityX;\n }\n\n if (circle.y + circle.radius + circle.velocityY > cHeight\n || circle.y - circle.radius ...
[ "0.6880175", "0.6743808", "0.66726935", "0.6667265", "0.6661963", "0.65212256", "0.6485141", "0.64675665", "0.64594316", "0.6438658", "0.6372675", "0.6301188", "0.6300236", "0.6289286", "0.6287253", "0.62800753", "0.62685823", "0.62571645", "0.6256001", "0.62412816", "0.62404...
0.64430106
9
Get selected text on Title button click
function getSelectedText1() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection) { text = document.selection.createRange().text; } if (tFlag === 0) { var a = String('<title id="' + text + '">'); data_arr.push(a); tFlag = 1; } else { if (mpFlag === 0) { data_arr.push(String('</title>')); tFlag = 0; var a = String('<title id="' + text + '">'); data_arr.push(a); tFlag = 1; } else { data_arr.push(String('</mp>')); data_arr.push(String('</title>')); tFlag = 0; mpFlag = 0; var a = String('<title id="' + text + '">'); data_arr.push(a); tFlag = 1; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSelectedText() {\n return window.getSelection().toString();\n }", "function getSelectedText() {\n return getSelectedTextAndRange()[0];\n}", "function getSelectedText() {\n var text = \"\";\n if (typeof window.getSelection != \"undefined\") {\n text = window.getSelection().toStr...
[ "0.7160881", "0.69038504", "0.68798363", "0.6838814", "0.6703329", "0.6686906", "0.6686906", "0.65892845", "0.6555423", "0.65261877", "0.6504765", "0.6497718", "0.6451045", "0.6429562", "0.64286363", "0.6407339", "0.6403446", "0.6402466", "0.6397058", "0.6316844", "0.6309171"...
0.7067919
1
Get selected text on Main Point button click
function getSelectedText2() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection) { text = document.selection.createRange().text; } if (mpFlag === 0) { var a = String('<mp id="' + text + '">'); data_arr.push(a); mpFlag = 1; } else { data_arr.push(String('</mp>')); mpFlag = 0; var a = String('<mp id="' + text + '">'); data_arr.push(a); mpFlag = 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSelectedText() {\n return window.getSelection().toString();\n }", "function getSelectedText() {\n return getSelectedTextAndRange()[0];\n}", "function getSelectedText() {\n var text = \"\";\n if (typeof window.getSelection != \"undefined\") {\n text = window.getSelection().toStr...
[ "0.7392748", "0.7247428", "0.7093416", "0.6959516", "0.68941975", "0.68923473", "0.68259126", "0.67985296", "0.67747056", "0.67375016", "0.6694859", "0.6693119", "0.6634629", "0.6574312", "0.6568881", "0.653621", "0.6507076", "0.6485507", "0.64854485", "0.6483102", "0.6428770...
0.6211039
42
Get selected text on Sub Point button click
function getSelectedText3() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection) { text = document.selection.createRange().text; } var a = String('<sp>' + text + '</sp>'); data_arr.push(a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSelectedText() {\n return window.getSelection().toString();\n }", "function getSelectedText() {\n return getSelectedTextAndRange()[0];\n}", "function getSelectedText() {\n var text = \"\";\n if (typeof window.getSelection != \"undefined\") {\n text = window.getSelection().toStr...
[ "0.73353237", "0.71102285", "0.70235944", "0.6944137", "0.6935864", "0.691551", "0.6827972", "0.6819054", "0.6806455", "0.6716165", "0.6712815", "0.66891825", "0.6683969", "0.66208017", "0.659375", "0.65929246", "0.6589905", "0.6586066", "0.65468585", "0.65317166", "0.6514218...
0.6707061
11
INSERT CODE HERE TO EXECUJE Definimos la Promise
function resolveAfter2Seconds() { return new Promise(resolve => { setTimeout(() => { resolve(`El nombre del empleado con id ${id}, es ${employees.find(x => x.id === id).name} y su salario es de ${salaries.find(x => x.id === id).salary}`); }, 2000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fullPromise(param) {\n\t//PLACE YOUR CODE HERE:\n}", "function ITSAPluginPromise() {}", "runPromise(self) {\n const context = this.fiberContext(self);\n return new Promise((res, rej) => {\n context.runAsync(exit => {\n switch (exit._tag) {\n case \"Success\":\n {\...
[ "0.7062459", "0.664492", "0.65898395", "0.6557439", "0.6523006", "0.64700747", "0.644596", "0.6423541", "0.6390327", "0.6390327", "0.63475287", "0.6312212", "0.6250894", "0.62361705", "0.62361705", "0.62306494", "0.6223985", "0.62182105", "0.62127733", "0.62115204", "0.619042...
0.0
-1
Called when the user types a character into the status update box.
handleChange(e) { // Prevent the event from "bubbling" up the DOM tree. e.preventDefault(); this.setState({value: e.target.value}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTypingIndicator() {\n\t\t\t\tvar typingIndicationMessage='Typing: ';\n\t\t\t\t\n\t\t\t\tvar names = Array.from(typingMembers).slice(0,3);\n\t\t\t\t\n\t\t\t\tif (typingMembers.length) {\n\t\t\t\t\ttypingIndicationMessage += names.join(', ');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (typingMembers.size > 3) {...
[ "0.6371094", "0.6303216", "0.6293244", "0.6291071", "0.61866933", "0.60885304", "0.6064244", "0.6064244", "0.6064244", "0.6064244", "0.6064244", "0.59940857", "0.5934922", "0.59086096", "0.58761764", "0.5856744", "0.58140546", "0.5798186", "0.57946247", "0.5767547", "0.576048...
0.0
-1
looks great! PROBLEM 2
function multiply(c, d) { // console.log('The product of ' + c + ' and ' + d + ' is ' + (c * d)); return c * d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "private public function m246() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient final protected inte...
[ "0.6651187", "0.6621415", "0.63667965", "0.6026865", "0.6017517", "0.58875245", "0.5820209", "0.57608175", "0.57564634", "0.5750279", "0.56594867", "0.5656668", "0.5492502", "0.54693794", "0.54257405", "0.53996444", "0.5360115", "0.5332175", "0.53163266", "0.5309554", "0.5290...
0.0
-1
get user by id
getUser(){ Axios.get('/users/'+this.state.userId) .then(res => { this.setState({user: res.data}); this.getProfilePicture() }) .catch(error => { // console.log(error) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser(id) {\n // return the one user with that id\n const user = users.find(user => user.id === id);\n return user;\n}", "function getUserById(id) {\n return getUserByProperty('id', id);\n}", "function getUserFromId(id) {\n let users = getUsers();\n if(users === null) return null;\n return us...
[ "0.8661759", "0.86072797", "0.8395371", "0.836435", "0.8360832", "0.82106304", "0.8157742", "0.81005263", "0.80803895", "0.8056137", "0.80060387", "0.79996574", "0.7998038", "0.7998009", "0.7985676", "0.7968348", "0.7964207", "0.7955948", "0.7938107", "0.79178125", "0.7895169...
0.0
-1
get users profile picture
getProfilePicture(){ Axios.get('/users/' + this.state.userId + '/picture', { method: 'GET', responseType: 'blob' }).then(res => { const file = new Blob([res.data]); const fileURL = URL.createObjectURL(file); this.setState({profileImageUrl: fileURL}); }) .catch(error => { //console.log(error); //alert('Error occured please try again!'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProfileFacebookImage(){\n var obj =getFacebookUserLocal();\n return getFacebookImage(obj);\n \n }", "function getProfilePic(username){\n ClientAccountService.getProfilePic(username)\n .then(\n function(d) {\n vm.userProfilePic =d;\...
[ "0.81914055", "0.8116384", "0.7892072", "0.78855824", "0.7751536", "0.77508944", "0.7722199", "0.7655805", "0.7655805", "0.7655805", "0.7655805", "0.7655805", "0.7655805", "0.7655805", "0.7655805", "0.7655805", "0.7647456", "0.762509", "0.7617208", "0.7606125", "0.7603479", ...
0.6587117
64
Gets video items from feed api endpoint
async function getFeed() { const updates = await appApi.getFeed(); setFeed(updates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getLatestVideos(upId, vidCount){\n const getReqTemp = `https://www.googleapis.com/youtube/v3/playlistItems?playlistId=${upId}&key=${keys.apiKey}&part=snippet,contentDetails&maxResults=${vidCount}`\n\n const response = await fetch(getReqTemp)\n const data = await response.json()\n const v...
[ "0.7199131", "0.70443773", "0.6975768", "0.69152796", "0.6838443", "0.67857677", "0.6727161", "0.6698886", "0.6675401", "0.6667701", "0.66495323", "0.6588118", "0.6536126", "0.6533393", "0.6518241", "0.65137565", "0.6513169", "0.64575183", "0.6422255", "0.6392056", "0.6365505...
0.0
-1
Renders the correct button for the payment screen depending on what kind of user is using the button (non registered, registered but not premium, registered and premium)
renderButton(planName) { if (this.props.user) { // If the user is already premium let them know! if (!isNil(this.props.user.plan)) return <button onClick={() => { this.props.pushAlert('info', 'Already Subscribed', 'You are already subscribed to this plan!'); ReactGA.modalview('/pricing#already-subscribed'); }} className="Plan-button common-UppercaseText common-Link--arrow"> Join free for 7 days </button>; else // Else show them the payment form return <button onClick={() => { this.setState({selectedPlan: this.state.plans[planName]}); ReactGA.modalview('/pricing#successful'); }} data-toggle="modal" data-target="#payment-modal" className="Plan-button common-Link--arrow"> Join free for 7 days </button> } // User is not signed in prompt them to signup return <button onClick={() => { this.props.history.push('/signup'); ReactGA.modalview('/pricing#signup'); }} className="Plan-button common-UppercaseText common-Link--arrow"> Join free for 7 days </button>; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reviewButtonDisplay() {\n // Check user type\n console.log(\"isBusinessOwner()\", isBusinessOwner);\n if (isBusinessOwner == \"true\") {\n console.log(\"is a business owner\");\n hideElement(\"review-button\");\n } else {\n // Set saved ratings for the pop up and click open if it is a user \n...
[ "0.6542581", "0.63429713", "0.6242841", "0.62422943", "0.62125885", "0.6202621", "0.6165143", "0.61620194", "0.6141722", "0.61381066", "0.6030694", "0.59838", "0.59441376", "0.5930966", "0.5884081", "0.58815604", "0.5863927", "0.58572143", "0.58392096", "0.5814357", "0.581182...
0.74037564
0
this function takes the temperature from the dataHandler and displays the temperature according to the correct temperature unit, and colors the temperature hot or cold.
function formatTemperature(kelvin) { var clicked = false; var fahr = ((kelvin * 9 / 5) - 459.67).toFixed(0); var cels = (kelvin - 273.15).toFixed(1); //initial temperature display $tempText.html(fahr); var firstClick = false; //click handler to update the temperature unit of measurement. $tempMode.off("click").on("click", function() { firstClick = true; console.log(clicked); clicked === false ? clicked = true : clicked = false; clicked === true ? $tempMode.html("C&deg") : $tempMode.html("F&deg"); if (clicked) { $tempText.html(cels); } else $tempText.html(fahr); }); if (cels > 24) { $("#temp-text").css("color", "red"); } else if (cels < 18) { $("#temp-text").css("color", "blue"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTemperature(response) {\n let temperatureElement = document.querySelector(\".current-temperature\");\n let cityElement = document.querySelector(\".current-city\");\n let descriptionElement = document.querySelector(\".description\");\n let minimumTemperature = document.querySelector(\".min-temp\");...
[ "0.67374784", "0.6587126", "0.6560444", "0.6556977", "0.653037", "0.651968", "0.64888483", "0.6462624", "0.6448585", "0.6423811", "0.6419197", "0.64175874", "0.64174104", "0.6394439", "0.6383886", "0.6378228", "0.63521916", "0.63307303", "0.63204944", "0.62951875", "0.6284284...
0.6191725
26
handles response data and formats it accordingly since it is an asynchronous response object all data handling and formatting must be done within this function.
function dataHandler(data) { dataString = JSON.stringify(data); console.log(data.main.temp); formatTemperature(data.main.temp); if (data.main.temp && data.sys) { // display icon if (data.weather) { var imgURL = "http://openweathermap.org/img/w/" + data.weather[0].icon + ".png"; $("#weatherImg").attr("src", imgURL); $("#weather-text").html(data.weather[0].description); } // display wind speed if (data.wind) { var knots = data.wind.speed * 1.9438445; $windText.html(knots.toFixed(1) + " Knots"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// return customized response data to New Relic\n\t\tthis.responseData = {\n\t\t\tpost: Utils.ToNewRelic(this.codeError, this.post, this.users)\n\t\t};\n\t\treturn super.handleResponse();\n\t}", "async handleR...
[ "0.6804455", "0.67501444", "0.6715168", "0.6626038", "0.66049457", "0.6534635", "0.6480883", "0.6446233", "0.64378303", "0.641549", "0.6364803", "0.63436383", "0.6339988", "0.62782764", "0.62723976", "0.6267327", "0.62149894", "0.621362", "0.61977434", "0.619102", "0.61782974...
0.0
-1
This calls the api with the correct coordinates provided by the getLocation function
function getWeather(locdata) { console.log("getWeather has been called.") var lat = locdata.lat; var lon = locdata.lon; var apiURI = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&appid=6c788c55fe75c1f415d3cfdc814d0218"; if (locdata){ console.log("success"); $("#city-text").html(locdata.city + ", " + locdata.region); } else { console.log("fail"); } //call weather api for weather data console.log("success getWeather"); console.log(apiURI); return $.ajax({ url: apiURI, dataType: "json", type: "GET", async: "true", }).done(dataHandler); // display location name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateLocation() {\n this.api.exec('getLocation');\n }", "function getLocation() {\n var currentLon = \"\";\n var currentLat = \"lat=\";\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(loc) {\n //set currentLon & currentLat\n currentLon += loc.co...
[ "0.7399205", "0.73102677", "0.7000668", "0.69905716", "0.69310445", "0.6811851", "0.6776365", "0.6757845", "0.6723161", "0.6683847", "0.6683749", "0.66799676", "0.66645867", "0.6647183", "0.66125035", "0.6608227", "0.6607157", "0.6599003", "0.65953654", "0.6591343", "0.657217...
0.0
-1
a variable that used to record the starting temperature during an automatic heating process ///////////////////////////// A basic device
function Device(listen_port) { //a basic device. Many functions are stubs and or return dummy values //listen_port: listen for http requests on this port // HEL.call(this,'cmd',listen_port); //init device info this.port = listen_port; this.status = "ready"; //other options are "logging" this.state = "none"; //no other state for such a simple device this.uuid = this.computeUUID(); //some device state this.logging_timer = null; this.manager_port = null; this.manager_IP = null; //standard events this.addEventHandler('getCode',this.getCodeEvent); this.addEventHandler('getHTML',this.getHTMLEvent); this.addEventHandler('info',this.info); this.addEventHandler('ping',this.info); this.addEventHandler('acquire',this.acquire); //implementation specific events //TODO: REPLACE THESE TWO EVENTS WITH YOUR OWN this.addEventHandler('startLog',this.startLogging); this.addEventHandler('stopLog',this.stopLogging); this.addEventHandler('heatOn',this.heaton); this.addEventHandler('heatOff',this.heatoff); this.addEventHandler('heatAutomatic',this.heatpwm); this.addEventHandler('heatAutomaticEnd', this.heatAutomaticEnd); this.addEventHandler('desiredTemp',this.desiredTemp); this.addEventHandler('cellphoneNumber',this.cellphoneNumber); //manually attach to manager. this.manager_IP = 'bioturk.ee.washington.edu'; this.manager_port = 9090; this.my_IP = OS.networkInterfaces().eth0[0].address; this.sendAction('addDevice', {port: listen_port, addr: this.my_IP}, function(){}); //advertise that i'm here every 10 seconds until i'm aquired /*var this_device = this; this.advert_timer = setInterval(function(){ this_device.advertise('224.250.67.238',17768); },10000);*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function temp_sensor() {\r\n var celsius = temp.value();\r\n var fahrenheit = celsius * 9.0/5.0 + 32.0;\r\n console.log(celsius + \" degrees Celsius, or \" +\r\n Math.round(fahrenheit) + \" degrees Fahrenheit\");\r\n\r\n deviceClient.publish(\"status\",\"json\",'{\"d\" : { \"temp...
[ "0.71547145", "0.7054884", "0.677058", "0.6705686", "0.6502982", "0.6482067", "0.64513284", "0.64264846", "0.64019406", "0.6393715", "0.63694876", "0.61801463", "0.61778504", "0.6173274", "0.61507916", "0.6123816", "0.61215544", "0.6097975", "0.6069061", "0.6034358", "0.59775...
0.55299413
61
Database URL. Change this to restaurants.json file location on your server.
static get DATABASE_URL() { const port = 8000 // Change this to your server port return `http://localhost:${port}/data/restaurants.json`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get DATABASE_URL() {\r\n\t\tconst port = 8000; // Change this to your server port\r\n\t\treturn `http://localhost:${port}/data/restaurants.json`;\r\n\t}", "static get DATABASE_URL () {\r\n const port = 1337 // Change this to your server port\r\n return `http://localhost:${port}/data/restaurants.json...
[ "0.84931445", "0.8413371", "0.84057564", "0.84032124", "0.8136033", "0.8113079", "0.8041698", "0.7935423", "0.7849609", "0.7781188", "0.76253206", "0.7554343", "0.7554343", "0.7554343", "0.7554343", "0.7554343", "0.75531036", "0.75486785", "0.75486785", "0.7546189", "0.753006...
0.8273619
4
Fetch a restaurant by its ID.
static fetchRestaurantById(id, callback) { // fetch all restaurants with proper error handling. DBHelper.fetchRestaurants((error, restaurants) => { if (error) { callback(error, null); } else { const restaurant = restaurants.find(r => r.id == id); if (restaurant) { // Got the restaurant callback(null, restaurant); } else { // Restaurant does not exist in the database callback('Restaurant does not exist', null); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchRestaurantById(id) {\r\n // fetch all restaurants with proper error handling.\r\n return fetch(DBHelper.DATABASE_URL_ID(id))\r\n .then( response => {\r\n if (response.ok){\r\n return response.json();\r\n }\r\n }).catch(function(err){\r\n console.log('Fetch error', err)...
[ "0.84540904", "0.84215057", "0.83600545", "0.8234782", "0.82138604", "0.8033051", "0.7830975", "0.78258544", "0.77985275", "0.777047", "0.77702683", "0.77023655", "0.77004296", "0.76958853", "0.75834715", "0.75834715", "0.75834715", "0.75834715", "0.75834715", "0.7575404", "0...
0.75293285
34
Fetch restaurants by a cuisine type with proper error handling.
static fetchRestaurantByCuisine(cuisine, callback) { // Fetch all restaurants with proper error handling DBHelper.fetchRestaurants((error, restaurants) => { if (error) { callback(error, null); } else { // Filter restaurants to have only given cuisine type const results = restaurants.filter(r => r.cuisine_type == cuisine); callback(null, results); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchRestaurantByCuisine(cuisine) {\n // Fetch all restaurants with proper error handling\n return this.fetchRestaurants().then(restaurants => restaurants.filter(restaurant => restaurant.cuisine_type === cuisine));\n }", "static fetchRestaurantByCuisine (cuisine) {\r\n return DBHelper.fetchRestaurants...
[ "0.79653025", "0.794189", "0.7750687", "0.7699828", "0.769169", "0.769169", "0.769169", "0.769169", "0.769169", "0.769169", "0.769169", "0.769169", "0.769169", "0.76915866", "0.7669903", "0.76631", "0.76631", "0.76492435", "0.764008", "0.7607431", "0.76051086", "0.7603229",...
0.76632255
26
Fetch restaurants by a neighborhood with proper error handling.
static fetchRestaurantByNeighborhood(neighborhood, callback) { // Fetch all restaurants DBHelper.fetchRestaurants((error, restaurants) => { if (error) { callback(error, null); } else { // Filter restaurants to have only given neighborhood const results = restaurants.filter(r => r.neighborhood == neighborhood); callback(null, results); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchRestaurantByNeighborhood(cb) {\n DBHelper.fetchRestaurants((error, restaurants) => {\n if (error) {\n cb(error, null);\n } else {\n const results = restaurants.filter(r => r.neighborhood == neighborhood);\n cb(null, results);\n }\n });\n }", "fetchRestaurant...
[ "0.8068655", "0.80564713", "0.79725736", "0.7930988", "0.7930988", "0.7930988", "0.7930988", "0.7930988", "0.7930988", "0.7930988", "0.7930988", "0.7930988", "0.7910176", "0.7910176", "0.788401", "0.78660226", "0.7813408", "0.7812883", "0.7812393", "0.78097826", "0.78097826",...
0.7901411
24
Fetch restaurants by a cuisine and a neighborhood with proper error handling.
static fetchRestaurantByCuisineAndNeighborhood(cuisine, neighborhood, callback) { // Fetch all restaurants DBHelper.fetchRestaurants((error, restaurants) => { if (error) { callback(error, null); } else { let results = restaurants if (cuisine != 'all') { // filter by cuisine results = results.filter(r => r.cuisine_type == cuisine); } if (neighborhood != 'all') { // filter by neighborhood results = results.filter(r => r.neighborhood == neighborhood); } callback(null, results); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchRestaurantByCuisineAndNeighborhood(cuisine, neighborhood) {\r\n // Fetch all restaurants\r\n return DBHelper.fetchRestaurants()\r\n .then(res => {\r\n \r\n let results = res;\r\n\r\n if (cuisine != 'all') { // filter by cuisine\r\n results = results.filter(r => r.c...
[ "0.84062105", "0.84022444", "0.831087", "0.8243038", "0.81832695", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.8116345", "0.8116345", "0.8112629", "0.8112629", "0.8104913", "0.8099702", "0.80821717", "0.80770075", "0.80...
0.8121277
21
Fetch all neighborhoods with proper error handling.
static fetchNeighborhoods(callback) { // Fetch all restaurants DBHelper.fetchRestaurants((error, restaurants) => { if (error) { callback(error, null); } else { // Get all neighborhoods from all restaurants const neighborhoods = restaurants.map((v, i) => restaurants[i].neighborhood) // Remove duplicates from neighborhoods const uniqueNeighborhoods = neighborhoods.filter((v, i) => neighborhoods.indexOf(v) == i) callback(null, uniqueNeighborhoods); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchNeighborhoods() {\n DBHelper.fetchNeighborhoods((error, neighborhoods) => { // eslint-disable-line no-undef\n if (error) { // Got an error\n console.error(error);\n } else {\n main.neighborhoods = neighborhoods;\n IndexDBHelper.storeNeighborhoods(neig...
[ "0.7945284", "0.7055915", "0.69890165", "0.69833696", "0.69833696", "0.6965614", "0.6949113", "0.6919723", "0.69066477", "0.69066477", "0.69066477", "0.69066477", "0.69066477", "0.69066477", "0.69066477", "0.6904565", "0.68913037", "0.6867803", "0.6862686", "0.6862686", "0.68...
0.68441343
37
Fetch all cuisines with proper error handling.
static fetchCuisines(callback) { // Fetch all restaurants DBHelper.fetchRestaurants((error, restaurants) => { if (error) { callback(error, null); } else { // Get all cuisines from all restaurants const cuisines = restaurants.map((v, i) => restaurants[i].cuisine_type) // Remove duplicates from cuisines const uniqueCuisines = cuisines.filter((v, i) => cuisines.indexOf(v) == i) callback(null, uniqueCuisines); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchCuisines() {\n DBHelper.fetchCuisines((error, cuisines) => { // eslint-disable-line no-undef\n if (error) { // Got an error!\n console.error(error);\n } else {\n main.cuisines = cuisines;\n IndexDBHelper.storeCuisines(cuisines); // eslint-disable-line...
[ "0.7879858", "0.7223122", "0.7173168", "0.7173168", "0.71661013", "0.7154812", "0.71521324", "0.7096084", "0.706611", "0.706611", "0.706611", "0.706611", "0.706611", "0.706611", "0.706611", "0.7060444", "0.7043844", "0.7043844", "0.7041222", "0.7041222", "0.70409405", "0.70...
0.7034309
32
Map marker for a restaurant.
static mapMarkerForRestaurant(restaurant, map) { const marker = new google.maps.Marker({ position: restaurant.latlng, title: restaurant.name, url: DBHelper.urlForRestaurant(restaurant), map: map, animation: google.maps.Animation.DROP } ); return marker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static mapMarkerForRestaurant(restaurant, map) {\r\n // https://leafletjs.com/reference-1.3.0.html#marker\r\n const marker = new L.marker([restaurant.latlng.lat, restaurant.latlng.lng], {\r\n title: restaurant.name,\r\n alt: restaurant.name,\r\n url: DBHelper.urlForRestaurant(restaurant)\r\n ...
[ "0.8293048", "0.82430345", "0.8241308", "0.82409847", "0.82373875", "0.8237239", "0.8237239", "0.8235075", "0.82349753", "0.8233382", "0.8220988", "0.8219706", "0.8219706", "0.8217531", "0.82174104", "0.8216146", "0.8216146", "0.8216146", "0.8216146", "0.8216146", "0.8216146"...
0.82158864
22
FUNZIONI DI CONVALIDA E INVIO DEL MODULO INPUT
function validaParametri(handleFrase, handleVelocita) { frase = handleFrase.value; velocita = handleVelocita.value; if (frase == "") { alert("Inserire almeno un carattere"); handleFrase.focus(); return false; } if (frase == "") { alert("Inserire almeno un carattere"); handleFrase.focus(); return false; } if (frase.match(/[\|%]/)) // NON FUNZIONA { alert("I caratteri \, | e % non sono ammessi"); handleFrase.focus(); return false(); } if (isNaN(velocita) || velocita <= 0) { alert("La velocita' e' una quantita' intera positiva non nulla"); handleVelocita.value="120"; handleVelocita.focus(); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validNumber(obj){\n\tvar formObj = document.getElementById(obj.id);\n var filter = /^([0-9\\.])+$/;\n if (!filter.test(formObj.value)) {\n// \talert(\"Please input number !\");\n \tComShowCodeMessage('COM12178');\n \tformObj.value=\"\";\n }\n return true;\n}", "function seNaoIntRese...
[ "0.5763435", "0.5737794", "0.5683836", "0.5661459", "0.5640382", "0.56215405", "0.5608176", "0.5550166", "0.5526072", "0.55046415", "0.5495679", "0.5492356", "0.54776305", "0.54776305", "0.54729456", "0.54717577", "0.5460662", "0.545548", "0.5453171", "0.5432027", "0.54206365...
0.0
-1
FUNZIONE PER OTTENERE DURATE VISEMI
function ottieni_durate() { var MAX_INT=9007199254740992; parametri="fileRichiesto=durate&randomizer="+THREE.Math.randInt(-MAX_INT, MAX_INT); xmlhttp_durate=creaConnessioneXMLHTTP_POST("/ServerWebGl/MandaJSON",parametri.length); xmlhttp_durate.onreadystatechange=function(){ //passiamo alla funzione riempi_campi la risp della servlet if(xmlhttp_durate.readyState==4 && xmlhttp_durate.status==200){ risposta = xmlhttp_durate.responseText; window.opener.durate_visemi=JSON.parse(risposta); window.opener.aggiorna_render(); } //4 significa richiesta completata - 200 significa richiesta http andata a buon fine }; if(parametri!="") { xmlhttp.send(parametri); //manda la richiesta HTTP e attendiamo che si verifichi l'evento onreadystatechange } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n va...
[ "0.6130146", "0.6073634", "0.6020267", "0.6007445", "0.59536994", "0.5925734", "0.59139097", "0.58795923", "0.5870959", "0.5862134", "0.58434796", "0.5808702", "0.58043987", "0.5781277", "0.5774835", "0.57675636", "0.5759565", "0.5758692", "0.5752386", "0.57417756", "0.571959...
0.0
-1
Resets sorting criterias to defaults
function switchSortCriterias(qDef){ qDef.qSortCriterias.forEach((sortCrit, i) => { qDef.qSortCriterias[i].qSortByStateCheck = false; qDef.qSortCriterias[i].qSortByState = 0; qDef.qSortByState = 0; qDef.qSortByStateCheck = false; qDef.qSortCriterias[i].qSortByLoadOrderCheck = true; qDef.qSortCriterias[i].qSortByLoadOrder = 1; qDef.qSortByLoadOrder = 1; qDef.qSortByLoadOrderCheck = true; qDef.qSortCriterias[i].qSortByAsciiCheck = true; qDef.qSortCriterias[i].qSortByAscii = 1; qDef.qSortByAscii = 1; qDef.qSortByAsciiCheck = true; qDef.qSortCriterias[i].qSortByNumericCheck = false; qDef.qSortCriterias[i].qSortByNumeric = 0; qDef.qSortByNumeric = 0; qDef.qSortByNumericCheck = false; qDef.qSortCriterias[i].qSortByFrequencyCheck = false; qDef.qSortCriterias[i].qSortByFrequency = 0; qDef.qSortByFrequency = 0; qDef.qSortByFrequencyCheck = false; qDef.qSortCriterias[i].qSortByExpressionCheck = false; qDef.qSortCriterias[i].qExpression = { qv: ''}; qDef.qExpression = { qv: ''}; qDef.qSortByExpressionCheck = false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetSorting() {\n this.sortBy = undefined;\n this.sortDir = 0;\n }", "clearSort() {\r\n this.sortBy(null);\r\n }", "set overrideSorting(value) {}", "resetSorting() {\n this.sortings = [];\n }", "resetSortState() {\n this.props.dispatch(couponsActions.toggleSort(fals...
[ "0.7344761", "0.70686644", "0.70344", "0.70155954", "0.6895858", "0.6495198", "0.6495198", "0.6469161", "0.6437964", "0.6394476", "0.6322835", "0.6287263", "0.6264788", "0.62606126", "0.62386173", "0.62311274", "0.62137145", "0.61662626", "0.615922", "0.6152911", "0.6124684",...
0.68768775
5
A `React.Ref` that keeps track of the passed `value`.
function useLiveRef(value) { var ref = React.useRef(value); useIsomorphicEffect.useIsomorphicEffect(function () { ref.current = value; }); return ref; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useUpdatedRef(value) {\n var valueRef = react.useRef(value);\n valueRef.current = value;\n return valueRef;\n}", "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n }", "function useUpdatedRef(value) {\...
[ "0.72959656", "0.7232126", "0.72302204", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", "0.7175179", ...
0.6786521
30
this.props.sounds is a dictionary of action => Expo.Audio.Sound object see loadSounds() in App.js to see what actions are possible
playSound(action) { try { this.props.sounds[action].playAsync(); this.props.sounds[action].setPositionAsync(0); } catch (err) { console.log("Could not play", action) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadDefaultSounds() {\n Object.keys(this.defaultSounds).forEach((key) => {\n this.loadSound(key, this.defaultSounds[key]);\n });\n }", "handleMusicButtonClicked(musicButtonId){\n let buttons = [...this.state.buttons];\n\n\n if(this.props.mappingSound){\n buttons[musicButtonId...
[ "0.7028121", "0.6894463", "0.66668814", "0.66233325", "0.6544734", "0.643667", "0.6420641", "0.6401536", "0.6377672", "0.6365446", "0.63530886", "0.63278306", "0.6322497", "0.6277754", "0.6257085", "0.6210725", "0.6206442", "0.61829025", "0.6148332", "0.61385065", "0.6084578"...
0.76544875
0
/////// Render Function /////////
renderScreen(status) { let path, onPress, accLabel; switch (status) { case 'intro': path=require('../resources/screens/intro.png') onPress=(() => this.setState({ gameStatus: 'started', stageIdx: 0, currentCommands: [] })) accLabel = "Hello, I am Cody. Today, let's play a game that would teach us the basics of computer science. I look forward to it. Would you like to touch the screen to start?" break case 'fail': this.playSound('fail') path=require('../resources/screens/failed.jpg') onPress=(() => this.setState({ gameStatus: 'started', currentCommands: [] })) accLabel = "Touch the screen to try again." break case 'success': this.playSound('success') path=require('../resources/screens/success.jpg') onPress=(() => { this.setState({ gameStatus: 'started', stageIdx: this.state.stageIdx+1, currentCommands: [] })}) accLabel = "Good job, touch the screen to move to the next stage" break; case 'finished': // reset the game this.playSound('success') path=require('../resources/screens/final.jpg') onPress=(() => this.setState({gameStatus: 'intro'})) accLabel = "You finished all the stage." break; default: throw ("Unrecognizable game status: " + this.gameStatus) } return ( <TouchableHighlight style={styles.wholeWrapper} onPress={onPress} accesible={true} accessibilityLabel={accLabel}> <Image style={styles.screenWrapper} source={path}/> </TouchableHighlight> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n\n\t\t\t}", "function render() {\n\t\t\n\t}", "function render() {\n\t\t\t}", "function render() {\n\t}", "render() {}", "render() {}", "render() {}", "_render() {}", "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "render() {\n\n\t}", "render() {\n\n\t}",...
[ "0.856444", "0.85036945", "0.84957767", "0.832847", "0.8283171", "0.8283171", "0.8283171", "0.80956876", "0.8049319", "0.8049319", "0.8036819", "0.8036819", "0.8010243", "0.778271", "0.778271", "0.77696085", "0.7707004", "0.7707004", "0.7696035", "0.76866335", "0.76533616", ...
0.0
-1
fungsi untuk menghapus suffix seperti ku, mu, kah, dsb
function Del_Inflection_Suffixes(kata,selesai){ var kataAsal = kata; if(kata.match(/([km]u|nya|[kl]ah|pun)$/i)){ // Cek Inflection Suffixes var __kata = kata.replace(/([km]u|nya|[kl]ah|pun)$/i,''); selesai(__kata); }else{ selesai(kataAsal); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Del_Derivation_Suffixes(kata,selesai){\n\tvar kataAsal = kata;\n\tvar sam=kata\n\tif(kata.match(/(i|an)$/i)){ // Cek Suffixes\n\t\n\tvar __kata = sam.replace(/(i|an)$/i,'');\n\t\tcekKamus(__kata,function(bool){\n\t\t\tif(bool){\n\t\t\t\t\n\t\t\t\tselesai(__kata)\t\n\t\t\t}else if(kata.match(/(kan)$/i)){\n...
[ "0.6774202", "0.63700324", "0.62904674", "0.6241091", "0.6215754", "0.61038715", "0.60492355", "0.6048907", "0.5952882", "0.58750904", "0.58620465", "0.58020526", "0.57999474", "0.5745012", "0.57399106", "0.573591", "0.5735891", "0.567243", "0.5658479", "0.56445414", "0.55860...
0.68171924
0
Cek Prefix Disallowed Sufixes (Kombinasi Awalan dan Akhiran yang tidak diizinkan)
function Cek_Prefix_Disallowed_Sufixes(kata){ if(kata.match(/^(be)[a-zA-Z]+(i)/)){ // be- dan -i return true; } if(kata.match(/^(se)[a-zA-Z]+(i|kan)/)){ // se- dan -i,-kan return true; } if(kata.match(/^(di)[a-zA-Z]+(an)/)){ // di- dan -an return true; } if(kata.match(/^(me)[a-zA-Z]+(an)/)){ // me- dan -an return true; } if(kata.match(/^(ke)[a-zA-Z]+(i|kan)/)){ // ke- dan -i,-kan return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanPrefix(prefix) {\n if (!prefix) {\n return this;\n }\n this.input = this.input.replace(new RegExp(`^${prefix}[-_]?`, 'i'), '');\n return this;\n }", "startsWith(c){ return false }", "startsWith(c){ return false }", "getPrefixCode() {\n return \"\";\n }", "...
[ "0.62969595", "0.58671004", "0.58671004", "0.57943285", "0.5714892", "0.564559", "0.55580175", "0.5534085", "0.5529474", "0.5527311", "0.5524464", "0.5518711", "0.5513337", "0.55102795", "0.5503454", "0.5497291", "0.5481376", "0.54566014", "0.5450117", "0.5434705", "0.5426948...
0.74927485
0
Hapus Derivation Suffixes ("i", "an" atau "kan")
function Del_Derivation_Suffixes(kata,selesai){ var kataAsal = kata; var sam=kata if(kata.match(/(i|an)$/i)){ // Cek Suffixes var __kata = sam.replace(/(i|an)$/i,''); cekKamus(__kata,function(bool){ if(bool){ selesai(__kata) }else if(kata.match(/(kan)$/i)){ __kata=sam.replace(/(kan)$/i,'') cekKamus(__kata,function(kan){ if(kan){ selesai(__kata) }else{ selesai(kataAsal) } }) }else{ selesai(kataAsal) } }) }else{ selesai(kataAsal) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Del_Derivation_Prefix(kata,selesai){\n\tvar kataAsal = kata;\nvar __kata,__kata__=\"\"\n\t/* —— Tentukan Tipe Awalan ————*/\nif(kata.match(/^(di|[ks]e)/)){ // Jika di-,ke-,se-\n __kata = kata.replace(/^(di|[ks]e)/,'');\n \n cekKamus(__kata,function(data){\n\t if(data){\n\t\tselesai(__kata)\n\t }e...
[ "0.61835456", "0.6115167", "0.58595675", "0.57735646", "0.5762797", "0.5756832", "0.5739361", "0.57145274", "0.55978703", "0.5582833", "0.553381", "0.55188006", "0.5515095", "0.5513158", "0.5513158", "0.5513158", "0.55076826", "0.55005306", "0.5477976", "0.5473025", "0.544467...
0.67878103
0
Hapus Derivation Prefix ("di", "ke", "se", "te", "be", "me", atau "pe")
function Del_Derivation_Prefix(kata,selesai){ var kataAsal = kata; var __kata,__kata__="" /* —— Tentukan Tipe Awalan ————*/ if(kata.match(/^(di|[ks]e)/)){ // Jika di-,ke-,se- __kata = kata.replace(/^(di|[ks]e)/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__=data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else if(kata.match(/^(diper)/)){ //diper- __kata = kata.replace(/^(diper)/,''); Del_Derivation_Suffixes(__kata,function(data){ __kata__=data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) }); }else if(kata.match(/^(ke[bt]er)/)){ //keber- dan keter- __kata = kata.replace(/^(ke[bt]er)/,''); Del_Derivation_Suffixes(__kata,function(data){ __kata__=data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) }); } else{ selesai(kata.replace(/^(di|[ks]e)/,'')) } }) }) } }) }else if(kata.match(/^([bt]e)/)){ //Jika awalannya adalah "te-","ter-", "be-","ber-" __kata = kata.replace(/^([bt]e)/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ __kata = kata.replace(/^([bt]e[lr])/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__=data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) })} })} }); }else if(kata.match(/^([mp]e)/)){ __kata = kata.replace(/^([mp]e)/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else Del_Derivation_Suffixes(__kata,function(data){ __kata__=data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else if(kata.match(/^(memper)/)){ __kata = kata.replace(/^(memper)/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__=data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) })} }) }else if(kata.match(/^([mp]eng)/)){ __kata = kata.replace(/^([mp]eng)/,''); cekKamus(__kata,function(data1){ if(data1){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data2){ __kata__=data2 cekKamus(__kata__,function(data3){ if(data3){ selesai(__kata__) }else{ __kata = kata.replace(/^([mp]eng)/,'k'); cekKamus(__kata,function(data4){ if(data4){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data5){ __kata__ =data5 cekKamus(__kata__,function(data6){ if(data6){ selesai(__kata__) }else{ __kata = kata.replace(/^([mp]enge)/,'');//menge- dan penge- cekKamus(__kata,function(data4){ if(data4){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data5){ __kata__ =data5 cekKamus(__kata__,function(data6){ if(data6){ selesai(__kata__) }else{ selesai(kataAsal) } }) }); } }) } }) }); } }) } }) });} }) }else if(kata.match(/^([mp]eny)/)){ __kata = kata.replace(/^([mp]eny)/,'s'); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__ =data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) });} }) }else if(kata.match(/^([mp]e[lr])/)){ __kata = kata.replace(/^([mp]e[lr])/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__ =data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) })} }) }else if(kata.match(/^([mp]en)/)){ __kata = kata.replace(/^([mp]en)/,'t'); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__ =data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ __kata = kata.replace(/^([mp]en)/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else { Del_Derivation_Suffixes(__kata,function(data){ __kata__ = data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) });} })} }) });} }) }else if(kata.match(/^([mp]em)/)){ __kata = kata.replace(/^([mp]em)/,''); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__ = data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ __kata = kata.replace(/^([mp]em)/,'p'); cekKamus(__kata,function(data){ if(data){ selesai(__kata) }else{ Del_Derivation_Suffixes(__kata,function(data){ __kata__ = data cekKamus(__kata__,function(data){ if(data){ selesai(__kata__) }else{ selesai(kataAsal) } }) });} })} }) });} }) } }) }); }) }else{ selesai(kataAsal) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDerivacaoAFND(der, terminal){\n while(der.charAt(0) != \"}\"){\n /**\n * IGUAL AO FND\n */\n var regra = \"([a-zA-Z]|[0-9]|_)\\\\:\\\\[\";\n var reg = new RegExp(regra);\n var letra = der.match(reg);\n if(letra[1] == \"_\") letra[1] = \"\";\n ...
[ "0.6107145", "0.5719765", "0.5620241", "0.5559519", "0.5518969", "0.55171746", "0.55019695", "0.55002034", "0.54467845", "0.5441924", "0.54122806", "0.54108983", "0.53885466", "0.5377489", "0.5347215", "0.53189534", "0.531698", "0.52942127", "0.52942127", "0.5292685", "0.5285...
0.6622089
0
fungsi pencarian akar kata
function stemming(kata,selesai){ var kataAsal = kata; var sam=kata var cekKata ="" cekKamus(kata,function(data6){ cekKata=data6 if(cekKata == true){ // Cek Kamus selesai(kata); // Jika Ada maka kata tersebut adalah kata dasar }else { //jika tidak ada dalam kamus maka dilakukan stemming Del_Inflection_Suffixes(sam,function(data){ sam = data cekKamus(sam,function(data1){ if(data1){ selesai(sam) }else{ Del_Derivation_Suffixes(sam,function(data2){ sam = data2 cekKamus(sam,function(data3){ if(data3){ selesai(sam) }else{ Del_Derivation_Prefix(sam,function(data4){ sam = data4 cekKamus(sam,function(data5){ if(data5){ selesai(sam) }else{ selesai(kataAsal) } }) });} }) });} }) }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fuctionPanier(){\n\n}", "function cargarpista1 (){\n \n}", "function lalalala() {\n\n}", "function kalkulasi(a, b) {\n return {\n tambah: a + b,\n kurang: a - b,\n kali: a * b,\n bagi: a / b\n }\n}", "function PlcGeral(){\r\n}", "function hitungLuasPersegiPan...
[ "0.68615425", "0.6587972", "0.6524697", "0.6462105", "0.6457918", "0.6417833", "0.64163977", "0.6383044", "0.6322294", "0.63193476", "0.63102686", "0.63033897", "0.62999547", "0.62942857", "0.62810725", "0.62797815", "0.6272681", "0.6272681", "0.6272681", "0.6261768", "0.6253...
0.0
-1
The whole page has loaded, including all dependent resources such as stylesheets and images.
function _pageLoaded() { window.removeEventListener( 'load', _pageLoaded ); refresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageFullyLoaded () {}", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function pageReady() {\n legacySupport();\n initSliders();\n }", "function pageLoaded(){\t\n\tconsole.log(\"Page loaded.\");\n\tconsole.log(\"Loading jQuery...\");\t\n\tl...
[ "0.73301554", "0.7009687", "0.68653196", "0.68193144", "0.6792291", "0.67457306", "0.67425376", "0.6723652", "0.668899", "0.66843516", "0.6672045", "0.66604257", "0.6651822", "0.6651822", "0.6651822", "0.6651822", "0.6621475", "0.660283", "0.6555931", "0.65452135", "0.6507007...
0.62963146
30
Handle the end of a transition.
function _transitionComplete() { this.dispatchEvent( BaseTransition.END_EVENT, { target: this } ); if ( element.scrollHeight > previousHeight ) { element.style.maxHeight = element.scrollHeight + 'px'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "endTransitionHandler(e) {\n if (this.active === true) {\n this.changeToDeactive();\n } else if (this.active === false) {\n this.transitionEndListenerOff();\n }\n }", "transitionCompleted() {\n // implement if needed\n }", "function finished(ev) {\...
[ "0.76843834", "0.7508275", "0.74288833", "0.73918307", "0.73918307", "0.7374426", "0.7352981", "0.7350636", "0.7350636", "0.7218734", "0.7193805", "0.70266", "0.70214474", "0.69857705", "0.69857705", "0.696578", "0.696578", "0.696578", "0.696578", "0.696578", "0.696578", "0...
0.7106824
11