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
Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror handlers to resolve / reject the PersistencePromise as appropriate.
function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result);};request.onerror=function(event){reject(event.target.error);};});}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapRequest(request) {\n return new __WEBPACK_IMPORTED_MODULE_2__persistence_promise__[\"a\" /* PersistencePromise */](function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.o...
[ "0.7094169", "0.7094169", "0.7094169", "0.70420825", "0.70091957", "0.70091957", "0.70091957", "0.694663", "0.69094634", "0.69094634", "0.6599156", "0.5721129", "0.55928385", "0.5543858", "0.5541489", "0.5522081", "0.5433046", "0.54326516", "0.54326516", "0.54237807", "0.5259...
0.749298
0
Helper to get a typed SimpleDbStore for the mutations object store.
function mutationsStore(txn){return SimpleDb.getStore(txn,DbMutationBatch.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mutationsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationBatch.store);\n }", "function mutationsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationBatch.store);\n}", "function mutationsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationB...
[ "0.7262566", "0.7254679", "0.7254679", "0.7241354", "0.7234136", "0.7188179", "0.7188179", "0.7188179", "0.69904435", "0.6979045", "0.6959792", "0.6956837", "0.6956837", "0.6919272", "0.6883476", "0.6883476", "0.6883476", "0.686031", "0.686031", "0.6852942", "0.6832839", "0...
0.7238545
4
Helper to get a typed SimpleDbStore for the mutationQueues object store.
function documentMutationsStore(txn){return SimpleDb.getStore(txn,DbDocumentMutation.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.store);\n }", "function mutationQueuesStore(txn){return SimpleDb.getStore(txn,DbMutationQueue.store);}", "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.stor...
[ "0.7988988", "0.7953138", "0.79106045", "0.790254", "0.790254", "0.7896655", "0.7845955", "0.7845955", "0.7845955", "0.75671995", "0.7545005", "0.7545005", "0.6665019", "0.648099", "0.6426391", "0.6396744", "0.63719195", "0.63719195", "0.63608813", "0.634689", "0.634689", "...
0.62911105
22
Helper to get a typed SimpleDbStore for the mutationQueues object store.
function mutationQueuesStore(txn){return SimpleDb.getStore(txn,DbMutationQueue.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.store);\n }", "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.store);\n}", "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn...
[ "0.7988988", "0.79106045", "0.790254", "0.790254", "0.7896655", "0.7845955", "0.7845955", "0.7845955", "0.75671995", "0.7545005", "0.7545005", "0.6665019", "0.648099", "0.6426391", "0.6396744", "0.63719195", "0.63719195", "0.63608813", "0.634689", "0.634689", "0.634689", "0...
0.7953138
1
Helper to get a typed SimpleDbStore for the queries object store.
function targetsStore(txn){return SimpleDb.getStore(txn,DbTarget.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "query(store, type, query) {\n return this.findQuery(store, type, query);\n }", "function getStore$1(txn, store) {\n if (txn instanceof SimpleDbTransaction) {\n return txn.store(store);\n }\n else {\n return fail('Invalid transaction object provided!');\n }\n}", "function getStore(...
[ "0.6100532", "0.60333943", "0.59863836", "0.587447", "0.5815213", "0.5795527", "0.5773469", "0.5770243", "0.57691234", "0.57525134", "0.57441217", "0.57433414", "0.57347363", "0.57143736", "0.57027566", "0.57013625", "0.57013625", "0.5697619", "0.5697619", "0.56926125", "0.56...
0.53117037
73
Helper to get a typed SimpleDbStore for the target globals object store.
function globalTargetStore(txn){return SimpleDb.getStore(txn,DbTargetGlobal.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function globalTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetGlobal.store);\n}", "function globalTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetGlobal.store);\n}", "function globalTargetStore(txn) {\n return getStore$1(txn, DbTargetGlobal.store);\n}", ...
[ "0.69850075", "0.69850075", "0.6980083", "0.6976426", "0.6976426", "0.6976426", "0.69383746", "0.68707025", "0.65998733", "0.6578231", "0.6578231", "0.63839406", "0.6356714", "0.6229351", "0.62149465", "0.61830366", "0.6102292", "0.6063662", "0.59995806", "0.5984562", "0.5961...
0.72722685
0
Helper to get a typed SimpleDbStore for the document target object store.
function documentTargetStore(txn){return SimpleDb.getStore(txn,DbTargetDocument.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function documentTargetStore(txn) {\n return getStore$1(txn, DbTargetDocument.store);\n}", "function documentTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetDocument.store);\n}", "function documentTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetDocument.st...
[ "0.76761186", "0.75246686", "0.75246686", "0.75097156", "0.7476392", "0.7468964", "0.7468964", "0.7468964", "0.71240205", "0.71240205", "0.70817405", "0.67005974", "0.67005974", "0.6679762", "0.66677654", "0.6663487", "0.6663487", "0.6663487", "0.6607927", "0.6536626", "0.647...
0.7612641
1
Helper to get a typed SimpleDbStore for the remoteDocuments object store.
function remoteDocumentsStore(txn){return SimpleDb.getStore(txn,DbRemoteDocument.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remoteDocumentsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbRemoteDocument.store);\n}", "function remoteDocumentsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbRemoteDocument.store);\n}", "function remoteDocumentsStore(txn) {\n return IndexedDbPersistence.getStore(txn,...
[ "0.7420841", "0.7420841", "0.73864543", "0.7382824", "0.7382824", "0.7382824", "0.73813045", "0.712501", "0.7060696", "0.695434", "0.695434", "0.64717996", "0.6201942", "0.6130535", "0.6130535", "0.6085094", "0.6085094", "0.6085094", "0.60642767", "0.6031356", "0.59799445", ...
0.75756115
0
A helper function for figuring out what kind of query has been stored.
function isDocumentQuery(dbQuery){return dbQuery.documents!==undefined;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryType(sql) {\n var ast = sqliteParser(sql)\n if (!(ast && ast.statement)) return null\n if (ast.statement.length !== 1) return null // only one SQL statement per SQL object\n return ast.statement[0].variant.toLowerCase()\n}", "get queryInputType() { return this._type; }", "function collect_que...
[ "0.65475506", "0.6108017", "0.58830816", "0.56711864", "0.56190723", "0.5608354", "0.55026174", "0.549569", "0.54744995", "0.544487", "0.5414351", "0.5402262", "0.53715384", "0.53588694", "0.5346877", "0.5302521", "0.5302521", "0.5302521", "0.5278363", "0.52398473", "0.523984...
0.53748435
12
Builds a CredentialsProvider depending on the type of the credentials passed in.
function makeCredentialsProvider(credentials){if(!credentials){return new EmptyCredentialsProvider();}switch(credentials.type){case'gapi':return new FirstPartyCredentialsProvider(credentials.client,credentials.sessionIndex||'0');case'provider':return credentials.client;default:throw new index_esm_FirestoreError(Code.IN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeCredentialsProvider(credentials) {\n if (!credentials) {\n return new EmptyCredentialsProvider();\n }\n switch (credentials.type) {\n case 'google-auth':\n return new GoogleCredentialsProvider(credentials.client);\n case 'gapi':\n return new FirstPar...
[ "0.7694981", "0.7694119", "0.75377667", "0.74954623", "0.74954623", "0.74954623", "0.74113137", "0.73126507", "0.7267975", "0.7267494", "0.7267494", "0.5322675", "0.53139275", "0.4993688", "0.49795586", "0.48332006", "0.48332006", "0.47852653", "0.46350285", "0.46337956", "0....
0.6814537
11
Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS I...
function isPartialObserver(obj){return implementsAnyMethods$1(obj,['next','error','complete']);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.57512176", "0.5345903", "0.52893716", "0.5242048", "0.5074461", "0.50543845", "0.50521696", "0.5051502", "0.5051502", "0.5027637", "0.4989611", "0.498545", "0.49730507", "0.49567991", "0.4916299", "0.48886392", "0.4876151", "0.48606881", "0.48606881", "0.48490617", "0.4849...
0.0
-1
Returns true if obj is an object and contains at least one of the specified methods.
function implementsAnyMethods$1(obj,methods){if(typeof obj!=='object'||obj===null){return false;}var object=obj;for(var _i=0,methods_1=methods;_i<methods_1.length;_i++){var method=methods_1[_i];if(method in object&&typeof object[method]==='function'){return true;}}return false;}/** * Copyright 2017 Google Inc. * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function implementsAnyMethods(obj, methods) {\r\n if (typeof obj !== 'object' || obj === null) {\r\n return false;\r\n }\r\n for (const method of methods) {\r\n if (method in obj && typeof obj[method] === 'function') {\r\n return true;\r\n }\r\n }\r\n return false;\r\...
[ "0.8071181", "0.80450475", "0.80450475", "0.80450475", "0.80445945", "0.80445945", "0.80445945", "0.80445945", "0.803563", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80104864", "0.80097085", ...
0.0
-1
Initializes a ParseContext with the given source and path.
function ParseContext(dataSource,methodName,path,arrayElement,fieldTransforms,fieldMask){this.dataSource=dataSource;this.methodName=methodName;this.path=path;this.arrayElement=arrayElement;// Minor hack: If fieldTransforms is undefined, we assume this is an // external call and we need to validate the entire path. if(f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }", "function ParseContext(dataSource, methodName, path, fieldTransforms...
[ "0.57478917", "0.5470267", "0.5456823", "0.54400456", "0.5319433", "0.5294155", "0.528039", "0.5265975", "0.52425516", "0.52216965", "0.52216965", "0.52216965", "0.52216965", "0.52216965", "0.52216965", "0.52216965", "0.52216965", "0.52216965", "0.52186733", "0.5217294", "0.5...
0.49333325
47
Checks whether an object looks like a JSON object that should be converted into a struct. Normal class/prototype instances are considered to look like JSON objects since they should be converted to a struct value. Arrays, Dates, GeoPoints, etc. are not considered to look like JSON objects since they map to specific Fie...
function looksLikeJsonObject(input){return typeof input==='object'&&input!==null&&!(input instanceof Array)&&!(input instanceof Date)&&!(input instanceof Timestamp)&&!(input instanceof GeoPoint)&&!(input instanceof Blob)&&!(input instanceof DocumentKeyReference)&&!(input instanceof FieldValueImpl);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isJSONContainer(obj) {\n if (!obj) { return false; }\n if (obj.RECORD___ === obj) { return true; }\n var constr = directConstructor(obj);\n if (constr === void 0) { return false; }\n var typeTag = constr.typeTag___;\n if (typeTag !== 'Object' && typeTag !== 'Array') { return false; }\n ...
[ "0.70478886", "0.690076", "0.6877085", "0.6822039", "0.6737699", "0.6737699", "0.6737699", "0.67257696", "0.67257696", "0.671834", "0.6669784", "0.65451586", "0.6487071", "0.64797443", "0.6475275", "0.6463843", "0.6461636", "0.644003", "0.644003", "0.63575494", "0.6276503", ...
0.717352
0
Helper that calls fromDotSeparatedString() but wraps any error thrown.
function fieldPathFromArgument(methodName,path){if(path instanceof FieldPath$1){return path._internalPath;}else if(typeof path==='string'){return fieldPathFromDotSeparatedString(methodName,path);}else{var message='Field path arguments must be of type string or FieldPath.';throw new index_esm_FirestoreError(Code.INVALID...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fromDotSeparatedString(path) {\n var found = path.search(RESERVED);\n if (found >= 0) {\n throw new __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* FirestoreError */](__WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT, \"Invalid field path (\" + path + \"). Paths ...
[ "0.6113351", "0.6113351", "0.60802096", "0.5968342", "0.5908675", "0.5908675", "0.58591676", "0.58591676", "0.58591676", "0.58097744", "0.5794948", "0.5687447", "0.52799267", "0.5135127", "0.5135127", "0.51215273", "0.50789124", "0.50789124", "0.50789124", "0.50610167", "0.50...
0.0
-1
Wraps fromDotSeparatedString with an error message about the method that was thrown.
function fieldPathFromDotSeparatedString(methodName,path){try{return fromDotSeparatedString(path)._internalPath;}catch(e){var message=errorMessage(e);throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,"Function "+methodName+"() called with invalid data. "+message);}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fieldPathFromDotSeparatedString(methodName, path) {\n try {\n return Object(__WEBPACK_IMPORTED_MODULE_12__field_path__[\"b\" /* fromDotSeparatedString */])(path)._internalPath;\n }\n catch (e) {\n var message = errorMessage(e);\n throw new __WEBPACK_IMPORTED_MODULE_5__util_er...
[ "0.55404127", "0.5535818", "0.5535818", "0.54476184", "0.544033", "0.544033", "0.544033", "0.5408289", "0.540814", "0.540814", "0.540814", "0.53779423", "0.532357", "0.52187175", "0.520455", "0.5187823", "0.518635", "0.518081", "0.51455814", "0.5142097", "0.50914276", "0.50...
0.52892023
13
TODO(2018/11/01): As of 2018/04/17 we're changing docChanges from an array into a method. Because this is a runtime breaking change and somewhat subtle (both Array and Function have a .length, etc.), we'll replace commonlyused properties (including Symbol.iterator) to throw a custom error message. In ~6 months we can d...
function throwDocChangesMethodError(){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,'QuerySnapshot.docChanges has been changed from a property into a '+'method, so usages like "querySnapshot.docChanges" should become '+'"querySnapshot.docChanges()"');}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throwDocChangesMethodError() {\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'QuerySnapshot.docChanges has been changed from a property into a ' + 'method, so usages like \"querySnapshot.docChanges\" should become ' + '\"querySnapshot.docChanges()\"');\n }", "function throwDocChangesMethodEr...
[ "0.73009336", "0.72349805", "0.7195611", "0.7195611", "0.7166976", "0.7166976", "0.7166976", "0.57884866", "0.54631996", "0.53587776", "0.5337766", "0.52802134", "0.52802134", "0.52700585", "0.52391666", "0.5113136", "0.5103486", "0.5094628", "0.507601", "0.50735646", "0.5073...
0.74256736
0
Calculates the array of firestore.DocumentChange's for a given ViewSnapshot. Exported for testing.
function changesFromSnapshot(firestore,includeMetadataChanges,snapshot){if(snapshot.oldDocs.isEmpty()){// Special case the first snapshot because index calculation is easy and // fast var lastDoc_1;var index_1=0;return snapshot.docChanges.map(function(change){var doc=new index_esm_QueryDocumentSnapshot(firestore,change...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changesFromSnapshot(firestore, snapshot) {\n if (snapshot.oldDocs.isEmpty()) {\n // Special case the first snapshot because index calculation is easy and\n // fast\n var lastDoc_1;\n var index_1 = 0;\n return snapshot.docChanges.map(function (change) {\n va...
[ "0.68647707", "0.68630606", "0.68630606", "0.673613", "0.63643783", "0.6356479", "0.6356479", "0.63383365", "0.63383365", "0.6289973", "0.62876195", "0.5635551", "0.54318357", "0.5415221", "0.5406787", "0.5406787", "0.540614", "0.528469", "0.5258782", "0.5249162", "0.52283615...
0.6690844
4
Configures Firestore as part of the Firebase SDK by calling registerService.
function configureForFirebase(firebase$$1){firebase$$1.INTERNAL.registerService('firestore',function(app){return new index_esm_Firestore(app);},shallowCopy(firestoreNamespace));}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerFirestore(instance){configureForFirebase(instance);}", "function configureForFirebase(firebase) {\n firebase.INTERNAL.registerService('firestore', function (app) { return new Firestore(app); }, shallowCopy(firestoreNamespace));\n}", "function configureForFirebase(firebase) {\r\n firebase...
[ "0.8120072", "0.78001773", "0.77622277", "0.77622277", "0.7745563", "0.76116765", "0.76116765", "0.75143313", "0.75143313", "0.75143313", "0.7459621", "0.74163455", "0.7367059", "0.7367059", "0.72925097", "0.6937962", "0.69327384", "0.69327384", "0.66773844", "0.6113555", "0....
0.7786346
2
Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS I...
function registerFirestore(instance){configureForFirebase(instance);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.57512176", "0.5345903", "0.52893716", "0.5242048", "0.5074461", "0.50543845", "0.50521696", "0.5051502", "0.5051502", "0.5027637", "0.4989611", "0.498545", "0.49730507", "0.49567991", "0.4916299", "0.48886392", "0.4876151", "0.48606881", "0.48606881", "0.48490617", "0.4849...
0.0
-1
"off" means `display: none;`, as opposed to "hidden", which means `visibility: hidden;`. getComputedStyle accurately reflects visiblity in context but not "off" state, so we need to recursively check parents.
function isOff(node, nodeComputedStyle) { if (node === elementDocument.documentElement) return false; // Find the cached node (Array.prototype.find not available in IE9) for (var i = 0, length = isOffCache.length; i < length; i++) { if (isOffCache[i][0] === node) return isOffCache[i][1]; } n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOff(node, nodeComputedStyle) {\n if (node === document.documentElement) return false;\n\n // Find the cached node (Array.prototype.find not available in IE9)\n for (var i = 0, length = isOffCache.length; i < length; i++) {\n if (isOffCache[i][0] === node) return isOffCache[i][1];\n }\n\...
[ "0.6937995", "0.6845413", "0.65879923", "0.6131329", "0.60554206", "0.60554206", "0.60554206", "0.5934719", "0.5715506", "0.5696938", "0.56792223", "0.56587917", "0.5654031", "0.56177247", "0.55592096", "0.553895", "0.551403", "0.5508968", "0.5508968", "0.5508968", "0.5508968...
0.6900937
3
Remap touch events to pointer events, if the browser doesn't support touch events.
function remapEvent(eventName) { var globalObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window; if (!('ontouchstart' in globalObj.document)) { switch (eventName) { case 'touchstart': return 'pointerdown'; case 'touchmove': return 'pointermove'; cas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usePointerEvent(){ // TODO\n // pointermove event dont trigger when using finger.\n // We may figger it out latter.\n return false; // return env.pointerEventsSupported\n // In no-touch device we dont use pointer evnets but just\n // use mouse event for avoiding problems.\n // && window.navigator.ma...
[ "0.73415434", "0.68891567", "0.6790321", "0.6669735", "0.6660753", "0.66408986", "0.6598859", "0.6598859", "0.6546387", "0.6529521", "0.65277207", "0.65174687", "0.65174687", "0.65174687", "0.6510102", "0.6507102", "0.6498997", "0.64864516", "0.6477503", "0.6437029", "0.64297...
0.62038547
58
Choose the correct transform property to use on the current browser.
function getTransformPropertyName() { var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (storedTransformPropertyName_ === undefined || forceRefresh) { var el = globalObj....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectTransformProperty() {\n var transformProperty = 'transform',\n safariPropertyHack = 'webkitTransform';\n if (typeof document.body.style[transformProperty] !== 'undefined') {\n\n ['webkit', 'moz', 'o', 'ms'].every(function (prefix) {...
[ "0.76651937", "0.7623907", "0.71992314", "0.7189445", "0.7189445", "0.7156891", "0.68114096", "0.67538077", "0.67418593", "0.6720166", "0.66730136", "0.6490674", "0.64602256", "0.6443263", "0.64069873", "0.6356389", "0.6317209", "0.6317209", "0.63117766", "0.63117766", "0.631...
0.6318661
18
Determine whether the current browser supports CSS properties.
function supportsCssCustomProperties() { var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; if ('CSS' in globalObj) { return globalObj.CSS.supports('(--color: red)'); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isSupported() {\n const isSupported = CSS.supports(\"--custom-properties\", \"custom\");\n if (!isSupported && this.debug) {\n console.warn(\"Your browser does not support custom CSS properties.\");\n }\n return isSupported;\n }", "function supportsProperty(props) {\n for (var i in props) {\...
[ "0.79372835", "0.730472", "0.71594816", "0.71594816", "0.71409774", "0.705191", "0.6992248", "0.6936028", "0.6675497", "0.6590115", "0.6363524", "0.63524354", "0.6348435", "0.62681884", "0.6239606", "0.6217491", "0.612748", "0.60975635", "0.6061565", "0.6055758", "0.6026991",...
0.7267587
3
Determine whether the current browser supports passive event listeners, and if so, use them.
function applyPassive() { var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (supportsPassive_ === undefined || forceRefresh) { var isSupported = false; try { gl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsPassiveEventListeners() {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n }\n ...
[ "0.85111904", "0.85111904", "0.85000587", "0.8482704", "0.82928735", "0.8228379", "0.8173452", "0.79817176", "0.794401", "0.794401", "0.794401", "0.794401", "0.7824472", "0.7824472", "0.78019863", "0.71393776", "0.7094613", "0.7094613", "0.6954576", "0.68344545", "0.6763579",...
0.73151404
16
Save the tab state for an element.
function saveElementTabState(el) { if (el.hasAttribute('tabindex')) { el.setAttribute(TAB_DATA, el.getAttribute('tabindex')); } el.setAttribute(TAB_DATA_HANDLED, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveElementTabState(el) {\n if (el.hasAttribute(\"tabindex\")) {\n el.setAttribute(TAB_DATA, el.getAttribute(\"tabindex\"));\n }\n el.setAttribute(TAB_DATA_HANDLED, true);\n}", "function saveTab(e) {\n\n var currentTabId = $(e.target).attr('href'),\n stateObject = {\n ...
[ "0.8104532", "0.68847257", "0.685849", "0.66187537", "0.6336098", "0.6336098", "0.6336098", "0.6336098", "0.6336098", "0.6285907", "0.6154319", "0.6047495", "0.6019238", "0.6017233", "0.5972284", "0.59678423", "0.5955725", "0.59455085", "0.59101593", "0.58185434", "0.58170676...
0.81277484
2
Restore the tab state for an element, if it was saved.
function restoreElementTabState(el) { // Only modify elements we've already handled, in case anything was dynamically added since we saved state. if (el.hasAttribute(TAB_DATA_HANDLED)) { if (el.hasAttribute(TAB_DATA)) { el.setAttribute('tabindex', el.getAttribute(TAB_DATA)); el.removeAttribute(TAB_D...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreElementTabState(el) {\n // Only modify elements we've already handled, in case anything was dynamically added since we saved state.\n if (el.hasAttribute(TAB_DATA_HANDLED)) {\n if (el.hasAttribute(TAB_DATA)) {\n el.setAttribute(\"tabindex\", el.getAttribute(TAB_DATA));\n ...
[ "0.734178", "0.6888347", "0.67601126", "0.67601126", "0.65665567", "0.65665567", "0.65665567", "0.65665567", "0.65665567", "0.65353525", "0.6367769", "0.6099249", "0.6099249", "0.60756177", "0.6047672", "0.585227", "0.5851256", "0.579988", "0.5799556", "0.57557887", "0.574085...
0.73726946
2
This needs to be done on mousedown and touchstart instead of click so that it precedes the focus event
function checkPointerDown(e) { if (config.clickOutsideDeactivates && !container.contains(e.target)) { deactivate({ returnFocus: false }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onFocus() {\r\n // Stub\r\n }", "focus() {}", "focus() {}", "function focus(){}", "focus() { }", "onFocusIn() {\n this.updateFocused(true);\n }", "function mousedown(event) {\r\n\t\t\t\tactiveElement = event.target;\r\n\t\t\t}", "focus() {\n this.setFocus(0, 1);\n }", ...
[ "0.7413799", "0.7409705", "0.7409705", "0.74048483", "0.72700703", "0.71302277", "0.71284723", "0.7115476", "0.70502996", "0.7038039", "0.70332074", "0.6975959", "0.696073", "0.6958957", "0.6958957", "0.69474006", "0.69470346", "0.6903066", "0.68763006", "0.68763006", "0.6871...
0.0
-1
Function to add declarative opening/closing to drawer
function toggleDrawer(oldprops, newprops, drawer) { if ('open' in oldprops && 'open' in newprops && oldprops.open !== newprops.open) { drawer.open = newprops.open; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleDrawerClose() {\n setOpen(true);\n }", "function handleDrawerOpen() {\n setOpen(true);\n }", "_handleDrawer () {\n this.drawerIsOpen = !this.drawerIsOpen\n }", "open() {\n this.isOpen = true;\n if (this.__isFloating) {\n const drawer = this.shadowRoot.getElementById('dra...
[ "0.694324", "0.6920997", "0.6607745", "0.65974975", "0.64773864", "0.62230724", "0.6222998", "0.61897856", "0.6173693", "0.61709476", "0.6131666", "0.61242294", "0.6110677", "0.60980356", "0.6058406", "0.60550934", "0.6003932", "0.5983764", "0.5965606", "0.5949149", "0.591656...
0.64519614
5
event adapters Start the data collection by sending the collection command to the active content script
function startDataCollection(event){ console.log("starting"); sendMessage({command: "start", target: tabs[0], mode: event.srcElement.id}); logUserAction("Start Visiting"); window.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enterCollection(ctx) {\n\t}", "function main() {\n\tapi.getItems()\n\t\t.then((items) => {\n\t\t\titems.forEach((obj) => store.addItem(obj));\n\t\t});\n\tevents.initEvents();\n\tlist.render();\n}", "setupDataListener(){\n PubSub.subscribe('Items:item-data-loaded',(evt)=>{this.initiliaze(evt.detail)});\n }"...
[ "0.59915084", "0.5624836", "0.56185335", "0.5534386", "0.55321693", "0.5431491", "0.54296833", "0.54017216", "0.53511846", "0.5343947", "0.5335546", "0.5291495", "0.5265165", "0.52422214", "0.52291954", "0.5228302", "0.5226666", "0.5212098", "0.5204061", "0.51739436", "0.5171...
0.7230036
0
when there's a match, emit the chat message event
callback(version) { omegga.emit('version', version); omegga.version = version; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleChat(text) {\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }", "async handle(text, senderId, chatId) {}", "function joinRoom(roomName){\n //SEND THIS ROOM NAME TO THE SERVER, SO THE SERVER CAN JOIN IT\n nsSocket.emit('joinRoom', roomName, (num...
[ "0.6433349", "0.63636315", "0.6303844", "0.6273286", "0.62396187", "0.61153334", "0.6055164", "0.60517836", "0.60078084", "0.59888405", "0.5986973", "0.5949048", "0.5934245", "0.592288", "0.59116715", "0.58969444", "0.5893675", "0.5885406", "0.58424604", "0.5832634", "0.58178...
0.0
-1
Load user and append to req.
function load(req, res, next, id) { User.get(id) .then(user => { req.user = user; // eslint-disable-line no-param-reassign return next(); }) .error(e => next(e)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadUser(req, res, next) {\n User.findOne({ _id: req.session.user_id }, function(err, user) {\n if (err) { throw err; }\n req.user = user;\n next();\n });\n}", "function loadUser(req, res, next) {\n if (!req.session.user_id) { return next(); }\n\n User.findOne({ _id: req.session.user_id }, ...
[ "0.7231059", "0.71140105", "0.69069964", "0.6899686", "0.6899686", "0.6899686", "0.6892056", "0.68401", "0.6833907", "0.68269306", "0.6702646", "0.66035783", "0.65964496", "0.6462951", "0.6237058", "0.62016886", "0.6200355", "0.6180543", "0.6146391", "0.6130654", "0.6112877",...
0.69190633
2
This function calls when user clicks on submit button On submit validation
function webAccessFilterValidation () { var txtValidArray = new Array(); txtValidArray[0] = "tf1_webAccName,"+LANG_LOCALE['12064']; txtValidArray[1] = "tf1_singleIpAddr,"+LANG_LOCALE['30345']; if (txtFieldArrayCheck(txtValidArray) == false) return false; if (alphaNumericValueCheck ("tf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateAndSubmit() {\r\n var isValid = false;\r\n isValid = validateForm();\r\n if (isValid == true) {\r\n disableButtons() // make sure you can only press the submit button once\r\n document.getElementById('evaluationForm').submit();\r\n }\r\n }", "...
[ "0.7558469", "0.74842143", "0.7458519", "0.7330588", "0.7247194", "0.7228648", "0.70883733", "0.7088339", "0.7011356", "0.69660735", "0.6956194", "0.69403124", "0.6879619", "0.68770814", "0.6871057", "0.6861277", "0.6859714", "0.68432117", "0.68337804", "0.68327683", "0.68302...
0.0
-1
compruebo alert (id); preparo enlace a datos partido
function ir_a_mi_partido() { location.href = "mi_partido.html?id=" + id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function definirInsumo(id) {\n $.post(SITE_PATH + '/tarefas/carregar-para-comprar', {id: id}, function (retorno) {\n if (retorno == false) {\n swal({\n title: \"Ops!\",\n text: \"Não existe nenhum insumo disponivel para compra.\",\n ...
[ "0.641289", "0.62307733", "0.6218423", "0.6176905", "0.5985368", "0.59506863", "0.5848294", "0.58292097", "0.5822716", "0.58141214", "0.5799005", "0.5799005", "0.5778186", "0.5769629", "0.5748214", "0.5743933", "0.57412827", "0.57410175", "0.5724286", "0.5722064", "0.5704598"...
0.5357251
75
invoca por medio de ajax la lista de temas
function cargarTemas() { __app.ajax('/temas/todos', null, onCargarTemasCompleto); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTaskList(){\n\t$.ajax({\n\t\tmethod: 'GET',\n\t\turl : 'http://localhost:8080/task',\n\t\tsuccess: function(result){\n\t\t\t$('#todo-list').empty();\n\t\t\t$('#completed-list').empty();\n\t\t\tfor(i = 0; i < result.length; i++){\n\t\t\t\taddTaskList(result[i]);\n\t\t\t}\n\t\t}\n\t})\n}", "function li...
[ "0.6725584", "0.66058636", "0.65997976", "0.6570963", "0.65564823", "0.6507359", "0.6498004", "0.6489252", "0.64495796", "0.64340883", "0.6433673", "0.64297277", "0.64282286", "0.64084625", "0.6398792", "0.63877296", "0.6387373", "0.63798267", "0.63782865", "0.6376303", "0.63...
0.7209536
0
import FormInfo from "./components/forminfo/FormInfo";
function App() { const [show, setShow] = useState(false); const [hash, setHash] = useState(window.location.hash); // const [showForm, setShowForm] = useState(false); return ( <div className="App"> <Router basename="/"> {/* <FormInfo showForm={showForm} setShowForm={se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div> {/* Empty App */}\n<h2>Form</h2>\n {/* <Employee></Employee> */}\n <Form></Form>\n\n {/* <BrowserRouter>\n <Switch>\n <Route exact path=\"/\" componet={Form}/>\n <Route path=\"/success\" componet={Success} />\n </Switch>\n </Brow...
[ "0.57171744", "0.56458974", "0.5635337", "0.5551721", "0.55036587", "0.5480348", "0.5443297", "0.5419765", "0.5405652", "0.53397197", "0.52976054", "0.5281672", "0.52743", "0.5255024", "0.5225648", "0.52158046", "0.5207739", "0.51756215", "0.51739705", "0.5149635", "0.5140593...
0.0
-1
Functionality that updates the modal content with premade templates
function updateModalContent(newContent) { // First: delete all innerHTML removeModalContent(); // Then: update the content with the selected template modalOverlay.insertAdjacentHTML('beforeEnd', newContent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "modalContentTemplate(filmData) {\n return `<div class=\"modal__main-info\">\n <div class=\"modal__main-left\">\n <div class=\"poster\">\n <div class=\"poster__inner\">\n <img class=\"poster__img\" src=\"${fil...
[ "0.68122894", "0.67050624", "0.67024547", "0.66720647", "0.6560409", "0.65508664", "0.64878786", "0.64785606", "0.64720786", "0.63921726", "0.6330385", "0.6325704", "0.630869", "0.63057894", "0.62903494", "0.62740266", "0.6249398", "0.6246186", "0.6221414", "0.61940926", "0.6...
0.75898516
0
Functionality that shows the modal
function showModal() { // Unhide modal overlay's display style modalOverlay.parentNode.style.visibility = "visible"; // Change the modal overlay's opacity from 0 to 1, with a 200ms fade modalOverlay.style.opacity = "1"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show(){\n\t\tthis.modalShadow.show();\n\t\tthis.modalBody.show();\n\t}", "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "function modalShown(o){\n\t\t/*\n\t\tif(o.template){\n\t\t\t//show spinner dialogue\n\t\t\t//render o.template into o.target here\n\t\t}\n\t\t*/\n\...
[ "0.8209411", "0.8041627", "0.79360896", "0.7926383", "0.78889936", "0.78629327", "0.78408813", "0.7840299", "0.78308916", "0.7819795", "0.78188664", "0.7808793", "0.7794308", "0.7794308", "0.77550703", "0.77547204", "0.7741876", "0.77219975", "0.76551217", "0.76531994", "0.76...
0.0
-1
Functionality that closes the selected modal
function closeModal() { // Change the modal overlay's opacity from 1 to 0, with a 200ms fade modalOverlay.style.opacity = "0"; // Use a timeout to change the 'visibility' after the 200ms. Also: delete its contents. setTimeout(function() { modalOverlay.parentNode.style.visibility = "hidden"; removeModal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeModal() {\n this.close();\n }", "closeModal() {\n this.closeModal();\n }", "closemodal() {\n this.modalCtr.dismiss(this.items);\n }", "function closeModal() {\n if (modalController) {\n modalController.close();\n }\n }", ...
[ "0.82950926", "0.81940645", "0.81274265", "0.8096225", "0.80855566", "0.80139875", "0.79280305", "0.78620106", "0.7856269", "0.78257746", "0.7810536", "0.78028226", "0.7780857", "0.7767234", "0.7767234", "0.7767234", "0.77576745", "0.7750627", "0.7739232", "0.7709592", "0.767...
0.0
-1
throughout the SPA call actions for asynchronous operations (see actions call mutations call getters call state.
updateUser({ commit }, userID) { commit("updateUser", userID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getActions(a, p, o) {\n return eos.getActions(a, p, o)\n .then(response => procResponse(response, a)) \n .catch(error => console.error(error));\n}", "async asyncActions({dispatch, commit}, actions){\n for(var index in actions)\n await dispatch(action...
[ "0.6055142", "0.59723526", "0.5773352", "0.568842", "0.56497127", "0.56109655", "0.55870485", "0.55561733", "0.5451844", "0.5406095", "0.53923833", "0.53552276", "0.5350013", "0.5336182", "0.5334204", "0.5312343", "0.5287405", "0.5261285", "0.52535903", "0.5232396", "0.521648...
0.0
-1
Show order details popup
showOrderDetailsPopup(order, event) { event.preventDefault(); this.setState({ active_order: order, order_details_popup_status: !this.state.order_details_popup_status }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderViewFullDetails(orderid){\n\t\t\n\t\t//myPopupWindowOpen('#orderViewFullDetailsPop','#maska');\n $('#msg').hide();\n\t\t$('.pagination').hide();\n\t\t$('.ownerStaticContainer').hide();\n\t\t$('#rest_myorder').hide();\n\t\t$('#rest_fullorder').show();\n\t\t$('#rest_fullorder').html('<div class=...
[ "0.7481893", "0.7023413", "0.7007606", "0.6848041", "0.678313", "0.67602956", "0.66901714", "0.6659677", "0.6641066", "0.6605719", "0.6430071", "0.64161444", "0.6328122", "0.63279116", "0.6318469", "0.6312908", "0.6213558", "0.6167939", "0.6141929", "0.61068815", "0.6066151",...
0.68300855
4
Create table to show searched data
function renderTable(search_data) { $tbody.innerHTML = ""; for (var i = 0; i < search_data.length; i++) { var sighting = search_data[i]; var fields = Object.keys(sighting); var $row = $tbody.insertRow(i); for (var j = 0; j < fields.length; j++) { var field = fields[j]; var $ce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_table() {\n \n/* $(\".userdata_search\").html(\"\"); */\n $(\".userdata_search tbody\").html(\"\");\n \n var tbl = $('<table></table>').attr({ class: \"userdata_search\" });\n var row2 = $('<thead></thead>').attr({ class: [\"class5\"].join(' ') }).appendTo(tbl);\n var row = $('<tr></tr>')....
[ "0.743672", "0.70650834", "0.6980636", "0.69630826", "0.6943558", "0.69313043", "0.6914891", "0.688134", "0.6859331", "0.67941797", "0.6748846", "0.6745292", "0.67311084", "0.663569", "0.66026706", "0.65962064", "0.65385216", "0.650936", "0.65050286", "0.649297", "0.6486279",...
0.7709293
0
Create search function based on what the user enters in the search fields
function handleSearchButtonClick() { var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); var filterCity = $cityInput.value.trim().toLowerCase(); var filterState = $stateInput.value.trim().toLowerCase(); var filterCountry = $countryInput.value.trim().toLowerCase(); var filterShape = $shapeInput....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function searchHelper() {\r\n let searchValue = searchField.value;\r\n if (searchValue.length) search(searchValue);\r\n else getAll();\r\n }", "function search() {\n\t\n}", "function s...
[ "0.7971002", "0.7590758", "0.75191045", "0.7473071", "0.7234476", "0.7157352", "0.705679", "0.7045577", "0.6978877", "0.6913621", "0.68970305", "0.6886799", "0.68666226", "0.68655246", "0.68519086", "0.6848697", "0.68356663", "0.6817789", "0.6813587", "0.67663354", "0.6761402...
0.0
-1
Checks actuality of project migrations
check() { var dbMigrations = this.dbMigrations_, fsMigrations = this.fsMigrations_; if (lodash.difference(fsMigrations, dbMigrations).length) { this.throwError_(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _migrationsCheck(cb) {\n\t\tvar query = connection.query('SELECT COUNT(*) FROM ??', ['_migrations'], function(err, rows, fields) {\n\t\t\tif(err) {\n\t\t\t\tcb(new Error('The _migrations table does not exist.'));\n\t\t\t} else {\n\t\t\t\tcb();\n\t\t\t}\n\t\t});\n\n\t}", "function _migrationsCheck(cb) {\...
[ "0.670538", "0.670538", "0.670538", "0.670538", "0.670538", "0.6652473", "0.64209396", "0.64209396", "0.64209396", "0.64209396", "0.64209396", "0.63572294", "0.63440716", "0.633074", "0.6190342", "0.5864363", "0.5864363", "0.58604336", "0.58235604", "0.5782804", "0.5782804", ...
0.75518733
0
On click on the delete link, delete its parent.
function deleteItem(link){ $(link).parent().remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function del (e) {\r\n var parent = $(e.target).parent();\r\n var id = parent.attr('id');\r\n parent.remove();\r\n $.ajax({\r\n url: \"core/delete.php\",\r\n type: \"POST\",\r\n dataType: \"text\",\r\n data: \"id=\" + id\r\n });\r\n}", "function deleteItem(){ \n $(this).parent().remove();\n...
[ "0.74066085", "0.7222667", "0.7190076", "0.7089944", "0.6914718", "0.6873346", "0.6860425", "0.6724399", "0.6719916", "0.66979235", "0.6637335", "0.6600134", "0.6595735", "0.6579235", "0.65606236", "0.6547376", "0.6546643", "0.65332353", "0.653033", "0.6521029", "0.6466569", ...
0.72982764
1
should be used for screen transitions
function clearText(){ game.innerText = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onActiveScreenChanged_() {}", "function menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box...
[ "0.7228065", "0.68756604", "0.66280717", "0.65813714", "0.6488404", "0.6467372", "0.63804454", "0.63777447", "0.63670814", "0.635821", "0.635145", "0.6349439", "0.6342494", "0.6310967", "0.6285092", "0.6263857", "0.6247979", "0.622968", "0.62223476", "0.619578", "0.6182944", ...
0.0
-1
function to start Game
function setGame(){ // Set title color var newColor = rgb(); $("#title").html(newColor); var rightSquare = makeRanNum(0, numSquares -1); $(".col").each(function(square){ // If rightSquare -> rightColor if(square === rightSquare) { changeBackground($(this), newColor); // add cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame() { }", "function startGame() {\n init();\n}", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function startGame(){\n initialiseGame();\n}", "function start(){\n\t\t //Initialize this Game. \n newG...
[ "0.9150866", "0.86591357", "0.8507101", "0.8457657", "0.8429983", "0.8288381", "0.8282496", "0.8248471", "0.8237043", "0.82207835", "0.8194638", "0.8182284", "0.8077813", "0.80566156", "0.80235064", "0.80219465", "0.80149245", "0.7984115", "0.7973747", "0.7964471", "0.7941669...
0.0
-1
Checks form value and set furigana.
checkValue() { let newInput; newInput = this.elName.value; if (newInput === '') { this.initializeValues(); this.setFurigana(); } else { newInput = this.removeString(newInput); if (this.input === newInput) return; // no changes this.input = newInput; if (this.isCon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFormValue(field, value){\r\n\tvar i=0;\r\n\tif (field.type == \"select-one\"){\r\n\t\tfor(i=0; i< field.options.length; i++){\r\n\t\t\tif (field.options[i].text == value)\r\n\t\t\t\tfield.options[i].selected=true;\r\n\t\t\telse field.options[i],selected=false;\r\n\t\t}//for\r\n\t} else if (field.type =...
[ "0.598715", "0.598715", "0.5978625", "0.594276", "0.5938196", "0.58861965", "0.58861965", "0.58377993", "0.5763753", "0.569352", "0.56747633", "0.56617063", "0.5653031", "0.5559196", "0.55565095", "0.5542895", "0.5527802", "0.5513095", "0.55099326", "0.550913", "0.5497843", ...
0.6742357
0
handlers : flex box grid
function chunkArray(myArray, chunk_size) { let index = 0; const arrayLength = myArray.length; const tempArray = []; for (index = 0; index < arrayLength; index += chunk_size) { let myChunk = myArray.slice(index, index + chunk_size); tempArray.push(myChunk); } return tempArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createGrids () {\n }", "_resizeHandler() {\n\n\t\tconst bounds= this.getBoundingClientRect();\n\n\t\tthis._dimens.width= bounds.width;\n\t\tthis._dimens.height= bounds.width;\n\n\t\tthis._root.querySelector('.wrapper').style.height= `${this._dimens.height}px`;\n\n\t\tfor(let row of this._grid) {\n\n\t\t\tfor(le...
[ "0.64756095", "0.64339733", "0.6404272", "0.6381941", "0.63145596", "0.625547", "0.62475514", "0.6220626", "0.6202054", "0.6182024", "0.61632854", "0.61545014", "0.6123108", "0.6119058", "0.6117883", "0.60896647", "0.6065565", "0.6062991", "0.60616195", "0.60548025", "0.60345...
0.0
-1
Constructor: create new object
constructor(level) { this.fields = []; this.level = level; this.score = 0; this.levelSettings = [ {id: 0, xWidth: 0, yWidth: 1, Ystart: 0, speed: 0, lines: 0}, {id: 1, xWidth: 10, yWidth: 10, Ystart: 7, speed: 500, lines: 10}, {id: 2, xWidth: 16, yWi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor (){}", "function construct() { }", "constructor() {\n copy(this, create());\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "const...
[ "0.8215886", "0.7869028", "0.7869028", "0.7869028", "0.7735315", "0.76863563", "0.7643994", "0.7638926", "0.7638926", "0.7638926", "0.7638926", "0.7638926", "0.7638926", "0.7638926", "0.7543506", "0.7535734", "0.7437763", "0.74086356", "0.7402952", "0.7357677", "0.7318883", ...
0.0
-1
Fill fields random cubes
START_LEVEL(level) { this.level = level; this.levelSettings[0].xWidth = this.levelSettings[this.level].xWidth; for (let x = 1; x <= this.levelSettings[this.level].xWidth; x++) { for (let y = 1; y <= this.levelSettings[this.level].yWidth; y++) { if (!level || y <= th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Builder_sample(cubebox) {\n var i, j, k;// i RIGHE, j COLONNE, k indice per tenere il conto e scorrere l'array delle altezze data\n k = 0;\n //cube = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({ color: 0xff0000 }));\n var deep, diff;\n for (i = 0; i < groundNumBoxX; i++) {\n ...
[ "0.6558459", "0.64572215", "0.6215722", "0.6192971", "0.61664", "0.61379504", "0.61324257", "0.60917443", "0.60540926", "0.60522866", "0.60404885", "0.60181916", "0.59854", "0.5962769", "0.5874931", "0.58394414", "0.58081186", "0.58079106", "0.57972693", "0.57824177", "0.5780...
0.0
-1
METHODS FOR 1 LINES
async __START_LINES() { let full_line = false; let timer = await setInterval(()=>{ this.fields.forEach(el => { if (el.value === 0) { el.value = this.__RANDOM_VALUE(); full_line = true; } }); if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line(){}", "getLine() { return this.line; }", "voidLine() {\r\n\t\treturn null\r\n\t}", "setLine(line) { this.line = line; return this; }", "function PatchLine() { }", "unvoidL...
[ "0.7112591", "0.7112591", "0.7112591", "0.7112591", "0.7112591", "0.6919993", "0.6578272", "0.6437243", "0.6334404", "0.6232989", "0.61582845", "0.60624677", "0.6043118", "0.60402125", "0.60015595", "0.59855163", "0.5984257", "0.5975097", "0.5975097", "0.5964914", "0.59510005...
0.0
-1
Fill fields random cubes
__RANDOM_VALUE() { function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } return getRandomInt(1, 5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Builder_sample(cubebox) {\n var i, j, k;// i RIGHE, j COLONNE, k indice per tenere il conto e scorrere l'array delle altezze data\n k = 0;\n //cube = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({ color: 0xff0000 }));\n var deep, diff;\n for (i = 0; i < groundNumBoxX; i++) {\n ...
[ "0.6558459", "0.64572215", "0.6215722", "0.6192971", "0.61664", "0.61379504", "0.61324257", "0.60917443", "0.60540926", "0.60522866", "0.60404885", "0.60181916", "0.59854", "0.5962769", "0.5874931", "0.58394414", "0.58081186", "0.58079106", "0.57972693", "0.57824177", "0.5780...
0.0
-1
function to get form values
function getInputVal(id) { return document.getElementById(id).value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFormValuesAndDisplayResults() {\n}", "function getFormValues() {\n\tname = document.getElementById(\"name\").value;\n\temail = document.getElementById(\"email\").value;\n\tsubject = document.getElementById(\"subject\").value;\n\tmessage = document.getElementById(\"message\").value;\n}", "function f...
[ "0.8115061", "0.7739999", "0.7729837", "0.7690455", "0.7588425", "0.7514238", "0.7499329", "0.7498871", "0.74585134", "0.74411017", "0.7435742", "0.7373737", "0.7328542", "0.73269343", "0.7287043", "0.72496235", "0.71228313", "0.7111757", "0.71078146", "0.7081316", "0.7077044...
0.0
-1
save messages to firebase
function saveMessage(name, email, message) { var newMessageRef = messageRef.push(); newMessageRef.set({ name: name, email: email, message: message }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveMessages(name,email,phone,message, fecha){\n var newMessagesRef=messageRef.push();\n newMessagesRef.set({\n name: name,\n email: email,\n phone: phone,\n message: message,\n fecha : fecha\n })\n \n \n}", "function saveMessage(firstname, lastname, email, phone, message){\r\nvar new...
[ "0.7946064", "0.7919147", "0.787037", "0.7861598", "0.78244805", "0.78002125", "0.7796876", "0.77646154", "0.77426314", "0.7739127", "0.77224004", "0.7711819", "0.76604503", "0.7632143", "0.76304954", "0.7626349", "0.76042545", "0.76006633", "0.75826246", "0.7579342", "0.7568...
0.71750194
69
These functions calculate the lesion area, maximum depth, lesion width at 0%, 50%, and 95% of maximum depth, and the length of the affected surface. The input parameters are a pair of points defining the medial tibial plateau, a set of points defining the border of the lesion, and a pair of points defining the surface ...
function translate (slope, x0, y0, points){ // defines each point relative to the line with a given slope passing through (x0,y0) var closest_points = []; // closest points along surface line var leftmost_point = []; var leftmost_x = 10000000; // arbitrarily large number for (var i = 0; i < points.length; i++...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateArea(){\n // get all points\n pointObjects = [];\n for(var i=0; i<4; i++){\n pointObjects[i] = stage.getChildByName(\"corner\"+i);\n points[i] = new createjs.Point(pointObjects[i].x, pointObjects[i].y);\n }\n\n // pythagoras to get height\n heightX = Math.abs(points[0].x - points[3].x...
[ "0.56769", "0.56072694", "0.5537143", "0.5513721", "0.55104095", "0.5491142", "0.5470988", "0.5327976", "0.5269172", "0.5238173", "0.52078885", "0.51599115", "0.51258713", "0.5100492", "0.5092558", "0.50836784", "0.50821376", "0.5070948", "0.5069678", "0.5058628", "0.50546706...
0.0
-1
helper function for finding distance between two points
function distance(point1, point2){ return Math.sqrt(Math.pow(point1[0]-point2[0], 2) + Math.pow(point1[1]-point2[1], 2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_distance(x1, y1, x2, y2)\n{\n return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));\n}", "function distance (point1, point2) {\n Math.sqrt(Math.pow(point1[0] - point1[1], 2) + Math.pow(point2[0] - point2[1], 2))\n}", "function getDistance(point1, point2) {\n return Math.pow(point1.x - po...
[ "0.8243939", "0.8183616", "0.8136859", "0.8123683", "0.8104037", "0.8086833", "0.8083388", "0.8081029", "0.8078473", "0.8078468", "0.80752033", "0.8067622", "0.806442", "0.80597097", "0.8055251", "0.8052093", "0.80468726", "0.80447924", "0.80439895", "0.8043439", "0.804286", ...
0.8088127
5
helper function to find average
function avg(values){ var sum = 0; for (var i = 0; i < values.length; i++){ sum += values[i]; } return sum/values.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_avg(arr) {\n\t\tvar sum = 0, avg;\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tsum += arr[i];\n\t\t}\n\t\tavg = sum / arr.length;\n\t\treturn avg;\n\t}", "function average() {\n\t\tvar sum = 0;\n\t\tif (avgNum.length != 0) {\n\t\t\tfor (var i = 0; i < avgNum.length; i++) {\n\t\t\t\tsum = sum ...
[ "0.81655014", "0.8126148", "0.81075734", "0.7911035", "0.7857189", "0.7830829", "0.77762526", "0.77736145", "0.7769261", "0.77690023", "0.7748383", "0.77255243", "0.7715681", "0.7705366", "0.76876277", "0.76876277", "0.7662708", "0.7655033", "0.763717", "0.76056564", "0.76043...
0.741781
58
helper function to find standard deviation
function std(values){ var total = 0; var mean = avg(values); for (var i = 0; i < values.length; i++){ total += Math.pow((values[i]-mean), 2); } return Math.sqrt(total/values.length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stdev() {\r\n\tvar data = stdev.arguments;\r\n\tvar deviation = new Array();\r\n\tvar valid_data = new Array();\r\n\tvar sum = 0;\r\n\tvar devnsum = 0;\r\n\tvar stddevn = 0;\r\n\tvar len = data.length;\r\n\tvar valid_len = 0;\r\n\tfor (var i=0; i<len; i++) {\r\n\t\tthisnum = data[i];\r\n\t\tif (isFloat(th...
[ "0.8439233", "0.8313593", "0.82858473", "0.8225719", "0.8203802", "0.82026976", "0.81137675", "0.8105827", "0.7996622", "0.7882047", "0.7879467", "0.7828585", "0.78006965", "0.78006965", "0.78006965", "0.7787849", "0.7699232", "0.76282877", "0.7528473", "0.7528473", "0.752847...
0.7614484
18
helper function to determine if a number is between two values
function between(num, bound1, bound2){ return (((bound1 >= num) && (bound2 <= num)) || ((bound1 <= num) && (bound2 >= num))) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBetween(num, low, high){\n return (num >= low) && (num <= high);\n}", "function isBetween(num) {\n return num >= 50 && num <= 100; // returning a boolean\n}", "function between(min, max, num) {\n return (num >= min && num <= max);\n}", "between(num, lower, upper) {\n return num > lower && ...
[ "0.82739925", "0.80910385", "0.79597497", "0.7889863", "0.78193426", "0.77350265", "0.7667126", "0.76236165", "0.76078236", "0.7595073", "0.75630736", "0.75630736", "0.7562493", "0.7553439", "0.75348663", "0.752683", "0.74791425", "0.7414703", "0.74111664", "0.73932093", "0.7...
0.8046718
2
helper function to find the minimum distance between a single point and a surface defined by a set of points
function min_distance(point, surface){ var minimum = 1000000000; // arbitrarily large // find two closest points on surface var p1 = surface[0]; var p2 = surface[1]; var d1 = distance(p1, point); // second closest var d2 = distance(p2, point); // closest // swap values if necessary if (d1 < d2){ var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closest(points) {\n if (points.length === 1) {\n return Point.create(points[0]);\n }\n let ret = null;\n let min = Infinity;\n points.forEach((p) => {\n const dist = this.squaredDistance(p);\n if (dist < min) {\n ret = p;\n ...
[ "0.7094994", "0.68886316", "0.63958967", "0.6268024", "0.61662775", "0.61351293", "0.6076479", "0.5950406", "0.5922658", "0.5922221", "0.5880693", "0.5875567", "0.58688724", "0.5853577", "0.5852059", "0.5848378", "0.58183795", "0.58052945", "0.5805142", "0.57988274", "0.57884...
0.80360353
0
finds the vertical distance between two lines at a given xvalue
function vertical_distance(x, line1_p1, line1_p2, line2_p1, line2_p2){ // detect invalid values (not between x-ranges of both segments) if (!(between(x, line1_p1[0], line1_p2[0]) && (between(x, line2_p1[0], line2_p2[0])))){ return NaN; } // find corresponding points on both lines var slope1 = (line1_p1[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLineLengthBetweenPoints (x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n }", "function lineLength(x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n}", "function getLineLength(x1, y1, x2, y2) {\n var res = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 -...
[ "0.70935535", "0.6711785", "0.6684788", "0.641683", "0.6354587", "0.62838244", "0.6268492", "0.62093246", "0.6129224", "0.61134243", "0.60895437", "0.6074152", "0.6056755", "0.604596", "0.6024685", "0.6018125", "0.5999244", "0.59716916", "0.5969514", "0.5964811", "0.5954248",...
0.7826152
0
finds the width of a lesion at a given percentage of its maximum depth
function width_at_depth (points, percent_depth){ var lowest = 1000000; var highest = -1000000; for (var i = 0; i < points.length; i++){ if (points[i][1] < lowest){ lowest = points[i][1]; } if (points[i][1] > highest){ highest = points[i][1]; } } var pair1 = []; var pair2 = []; //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compute_width(depth, areas) {\n if (areas.length == 0) {\n return 0;\n } else {\n area = sum_array(areas);\n return area / depth;\n };\n}", "function levelWidth(root) {\n\t// array to loop over tree\n\tconst arr = [root, 's'];\n\t//counter to check for widths\n\tconst counter = [0];\n\n\t// ...
[ "0.68355453", "0.6271827", "0.62336767", "0.62298626", "0.61889863", "0.61743605", "0.6165617", "0.6149438", "0.6068723", "0.60285175", "0.5944012", "0.5940338", "0.5899395", "0.58972335", "0.58900857", "0.5862145", "0.5849093", "0.5821635", "0.5788713", "0.5764281", "0.57599...
0.64102584
1
calculates the area enclosed by a set of points
function area(border) { // calculate area var area = 0; for (var i = 0; i < border.length; i++){ if (i < border.length-1){ area += (border[i][0]*border[i+1][1]) - (border[i+1][0]*border[i][1]); } else{ area += (border[i][0]*border[0][1]) - (border[0][0]*border[i][1]); } } area /= 2; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArea(points) {\n var area = 0;\n var lengthPoints = points.length;\n var j = lengthPoints - 1;\n var p1;var p2;\n for (var i = 0; i < lengthPoints; j = i++) {\n p1 = points[i];p2 = points[j];\n area += p1.x * p2.y;\n area -= p1.y * p2.x;\n }\n area /= 2;\n r...
[ "0.80844116", "0.77336186", "0.7714033", "0.74511176", "0.7230042", "0.71543694", "0.71198237", "0.7117731", "0.70857763", "0.6976173", "0.69431424", "0.69025546", "0.6902238", "0.67703485", "0.673697", "0.6732529", "0.6732529", "0.67313004", "0.67277634", "0.6711462", "0.667...
0.0
-1
acts as a wrapper for the area function
function evaluateOsteophyte(border){ return area(border); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Area() {\n}", "area() {\n return 4 * (3.14) * (this.radius**2)\n }", "function area (height, width) {\n\treturn height * width;\n}", "get area() {\n return this.width * this.height\n }", "function area(width, height) {\n return width * height;\n}", "get area() {\n ret...
[ "0.76496685", "0.727273", "0.7198203", "0.7149386", "0.7130923", "0.7123216", "0.7114047", "0.7103795", "0.70556223", "0.70363045", "0.69860524", "0.69241035", "0.69192445", "0.6878352", "0.6837695", "0.6823132", "0.6821017", "0.6804658", "0.6804658", "0.6785561", "0.67742276...
0.6497839
49
analyzes cartilage width, accepts two sets of points representing the cartilage surface and osteochondral interface
function evaluateCartilage(surface, oc_interface, interval_count){ // transform coordinates so that a line between the ends of the OC interface is horizontal var oc_slope = (oc_interface[oc_interface.length-1][1]-oc_interface[0][1]) / (oc_interface[oc_interface.length-1][0]-oc_interface[0][0]); var new_surfac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeSetup()\n{ \n //set distances based on points...\n for(let i=0;i<4;i++)\n {\n len[i]=sqrt(pow(x[(i+1)%4]-x[i],2)+pow(y[(i+1)%4]-y[i],2));\n }\n \n whichType();//checks type.\n checkOpen();//checks open or crossed.\n}", "function computeCenters() {\n centers = [];\n ...
[ "0.62492615", "0.5696323", "0.55888826", "0.55412257", "0.5498206", "0.5485822", "0.54462564", "0.54199636", "0.5411243", "0.54064685", "0.5388579", "0.53209186", "0.53209186", "0.53154576", "0.5313278", "0.53125244", "0.5286746", "0.528181", "0.5277904", "0.5256129", "0.5246...
0.5735372
1
check if there is user with the same username
function validateSignupInput(data, otherValidation){ let { errors } = otherValidation(data); const { username } = data; return User.findOne({username: username}).then(user => { if(user){ if (user.username === username){ errors.username = "There is user with this username!"; } } re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async usernameCheck(username) {\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE UPPER(username) = UPPER($1)`,\n [username]\n );\n // returns true if username is already in use\n return duplicateCheck.rows.length > 0;\n }", "functi...
[ "0.77652323", "0.75814027", "0.75232685", "0.7463849", "0.74266696", "0.7262292", "0.7247066", "0.71808875", "0.71351284", "0.71322525", "0.7078025", "0.70370597", "0.7031352", "0.6990339", "0.6970152", "0.69452024", "0.69360954", "0.691047", "0.690314", "0.6854412", "0.68506...
0.0
-1
Handle the different ways the application can shutdown
function handleAppExit(options, err) { if (err) { console.error(err); } if (options.cleanup) { console.log("cleaning up"); } if (options.exit) { process.exit(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async onShutdown() {\n // put things to do upon application shutdown here\n }", "async shutdown(){}", "function doShutdown() {\n log.force(__filename, 'doShutDown()', 'Service shutdown commenced.');\n if (dbMan) {\n log.force(__filename, 'doShutDown()', 'Closing DB connections...');\n d...
[ "0.7592768", "0.7551665", "0.7459819", "0.7454891", "0.730467", "0.7202216", "0.71808577", "0.71494603", "0.7097208", "0.7097122", "0.70933646", "0.7091025", "0.7077032", "0.70372444", "0.7036709", "0.7023111", "0.70202124", "0.70202124", "0.70202124", "0.70202124", "0.702021...
0.0
-1
zwraca tyle ile potrzebuje zeby wbic 1 level
function formula(level) { return level * 100; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateWidestLevel(root) {}", "function beetle_lvl1() {}", "function addTsu(tree) {\n return Object.entries(tree).reduce((tsuTree, [key, value]) => {\n if (!key) {\n // we have reached the bottom of this branch\n tsuTree[key] = `っ${value}`;\n } else {\n // more subt...
[ "0.6209748", "0.5924397", "0.5866458", "0.57308483", "0.5718188", "0.57063794", "0.5693618", "0.56919634", "0.56779706", "0.5660213", "0.56478447", "0.5627209", "0.5519329", "0.5455261", "0.5449913", "0.5448773", "0.54248905", "0.53752536", "0.53727984", "0.5370324", "0.53661...
0.0
-1
var randomColor = Math.floor(Math.random()16777215).toString(16); document.body.style.backgroundColor = "" + randomColor; displayHex(randomColor); }
function changeBackgroundColor() { var randomHue = Math.floor(Math.random()*360); document.body.style.backgroundColor = "hsl(" + randomHue + ", 70%, 80%)"; var elHexcode = document.getElementById('hex-code'); elHexcode.textContent = HSLToHex(randomHue,70,80); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomColor() {\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var rbgColor = 'rgb(' + x + ',' + y + ',' + z + ')'; \n\ndocument.body.style.background = rbgColor;\n }", "function randomColor() {\n var x = Math.fl...
[ "0.8784057", "0.8684249", "0.8639134", "0.86088926", "0.8608596", "0.8575746", "0.85366344", "0.8511131", "0.84898937", "0.847793", "0.8447837", "0.8445836", "0.8430345", "0.84256274", "0.8417065", "0.841635", "0.84026456", "0.8380053", "0.8374863", "0.8366263", "0.83127946",...
0.8422206
14
going to try to solve this 'shrinking window'
function minSubArrayLen(arr, n) { let total = 0; let start = 0; let end = 0; let minLen = Infinity; // first we start with a window of length 0. while (start < arr.length) { // then we expand the window until the sum is >= n if (total < n && end < arr.length) { total += arr[end]; end++; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizedw(){\n\t\n}", "function windowResized() {\n\n getWrapperWidth();\n resizeCanvas(wrapperWide, wrapperWide);\n\n widthVar = (width - 40) / 100;\n drawArea = (width - 40);\n\n switchBox();\n}", "function doResizeStuff() {\n checkTextWidths();\n $('#mainwindow').height($(document).height...
[ "0.738601", "0.72426397", "0.7240199", "0.70970905", "0.709135", "0.70401025", "0.70277286", "0.7012389", "0.7012389", "0.7012389", "0.69847566", "0.6973786", "0.6948556", "0.6947652", "0.69229573", "0.6922389", "0.6913801", "0.69080794", "0.6903232", "0.68782616", "0.6875907...
0.0
-1
As a busy politician, so I know what the big stories of the day are, I want to see all of today's headlines in one place.
function createsListArrayFromResponse() { var testDescription = "createsListArrayFromResponse" var articlesList = new ArticlesList() setTimeout(function() { assert.isTrue(articlesList.listArray.length > 0, testDescription) }, 500) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeadlines(freshness) {\n let headlines = [];\n const urlQueries = freshness === 'top' ? 'sort=top&t=week' : '';\n axios.all([\n axios.get(`https://www.reddit.com/r/nottheonion/${freshness}.json?${urlQueries}`),\n axios.get(`https://www.reddit.com/r/theonion/${freshness}.j...
[ "0.64924955", "0.6282384", "0.6116581", "0.59095705", "0.5759602", "0.56638306", "0.55898464", "0.5573564", "0.55336064", "0.55234885", "0.5488466", "0.54665405", "0.5429966", "0.54112023", "0.5399972", "0.53913987", "0.5362171", "0.5356818", "0.53551644", "0.5345465", "0.533...
0.0
-1
match currentword to wordInput
function matchWords(){ if (wordInput.value===currentWord.innerHTML) { message.innerHTML='Correct!!!'; return true; }else{ message.innerHTML=''; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchWords() {\n if (wordInput.value === currentWord.innerHTML)\n return true;\n else \n return false;\n}", "function matchWords() {\n if(wordInput.value === currentWord.innerHTML) {\n message.innerHTML = 'Correct!!!'\n return true;\n } else {\n message.innerHTML...
[ "0.7345339", "0.7059616", "0.70418507", "0.68734044", "0.68594486", "0.6841881", "0.6832225", "0.68173707", "0.67627347", "0.6711301", "0.66974187", "0.6621317", "0.66189396", "0.65909106", "0.6538613", "0.6538226", "0.6505806", "0.6503142", "0.6496623", "0.6468929", "0.64581...
0.646286
20
pick and show random word
function showWord(words) { //generate random array index const randIndex=Math.floor(Math.random() * words.length); //output random word currentWord.innerHTML=words[randIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showWord(words) {\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n }", "function showWord(words) {\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}", "function showWord(...
[ "0.8288895", "0.8285007", "0.82234466", "0.8208006", "0.8109291", "0.806481", "0.80584437", "0.8049164", "0.8022298", "0.80017036", "0.79918873", "0.7983176", "0.79746974", "0.7945312", "0.7940346", "0.7859077", "0.78528863", "0.78324", "0.7770444", "0.7764458", "0.7749188", ...
0.803209
8
Sets the paused state of the game.
setIsPaused(flag) { validateRequiredParams(this.setIsPaused, arguments, 'flag'); this.isPaused = flag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pause() {\n this._isPaused = true;\n }", "pause() {\n this._isPaused = true;\n }", "togglepaused() {\n if (this.gamestate == GAMESTATE.PAUSED) {\n this.gamestate = GAMESTATE.RUNNING;\n }\n else {\n this.gamestate = GAMESTATE.PAUSED;\n }\n\n ...
[ "0.79460466", "0.79460466", "0.79098266", "0.768776", "0.7651369", "0.7634788", "0.7528867", "0.74508554", "0.7354809", "0.73284125", "0.72900057", "0.72774863", "0.7272434", "0.7249631", "0.7186054", "0.7185108", "0.71830535", "0.7094093", "0.70756465", "0.7028444", "0.70082...
0.71785104
17
Set the Barbarian actions as being locked or not.
setActionsLocked(flag) { if (flag === undefined) { throw new Error("setActionsLocked: flag argument is required"); } this.actionsLocked = flag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _lockFunctionality() {\n lockUserActions = true;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "function _unlockFunctionality() {\n lockUserActions = false;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "function lockActions() {\n $('.modal').find('.actio...
[ "0.6472561", "0.6130128", "0.61037046", "0.6103128", "0.5913216", "0.5810229", "0.5755878", "0.56787163", "0.56568575", "0.5608884", "0.5580455", "0.5566329", "0.5470361", "0.5470361", "0.5459375", "0.5442831", "0.5437788", "0.5437507", "0.54295367", "0.5421886", "0.5418577",...
0.7007486
0
Sets the backdrop offset to the current screen.
setBackdrop(screenNumber) { this.getBackdrop().css('background-position', -1* SCREEN_WIDTH * screenNumber + 'px 0px'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doRepositionBackdrop() {\n // Position under the topmost overlay\n var top = overlays.top();\n\n if (top) {\n\n // The backdrop, if shown, should be positioned under the topmost overlay that does have a backdrop\n for (var i = _overlays.length - 1; i > -1; i--) {\n if (_overlays[...
[ "0.628946", "0.6141828", "0.5879977", "0.54127306", "0.53979045", "0.53096074", "0.5268508", "0.5225944", "0.50899345", "0.508898", "0.5046985", "0.50173813", "0.5016853", "0.5008737", "0.49300045", "0.49275392", "0.49259233", "0.492385", "0.49155632", "0.49060243", "0.490602...
0.72804755
0
Hide the monsters on a particular screen.
hideMonsters(screenNumber) { validateRequiredParams(this.hideMonsters, arguments, 'screenNumber'); let opponents = this.getMonstersOnScreen(screenNumber); for (let opponent of opponents) { opponent.getProperties().getSprite().css('display', 'none'); opponent.getProperties...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hideAllScreens() {\n this.activeScreen = Screen.NONE;\n }", "function hideSinglePlayerStatScreen(){\n console.log(\"hideSinglePlayerStatScreen\")\n //indicate we are showing all of the player's stats\n statScreen.ShowAll = true;\n //Clears the healthbar\n singleGraphics.clear();\n statScree...
[ "0.76082146", "0.7279854", "0.7156498", "0.70310706", "0.6749914", "0.6706334", "0.66804695", "0.6653532", "0.66523284", "0.65389687", "0.65145296", "0.64873534", "0.64788747", "0.643965", "0.6429737", "0.6397872", "0.6385218", "0.6333699", "0.6319699", "0.62949526", "0.62641...
0.8165666
0
Initializes the current screen to ready it for playing.
initializeScreen(screenNumber) { validateRequiredParams(this.initializeScreen, arguments, 'screenNumber'); let monsters = this.getMonstersOnScreen(screenNumber); for (let monster of monsters) { this.initializeMonster(monster, screenNumber); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "initialize() {\n // vai pegar todas as funcoes da classe screen, coloca todos os herois na screen\n this.screen.u...
[ "0.73392546", "0.72611344", "0.68600833", "0.6799272", "0.66857326", "0.6666656", "0.66487676", "0.66453093", "0.66191334", "0.6599859", "0.65553117", "0.6541555", "0.64878327", "0.64472723", "0.6444534", "0.6442143", "0.64371455", "0.64132047", "0.63896555", "0.6378538", "0....
0.0
-1
Initialize a monster for a particular screen
initializeMonster(monster, screenNumber) { monster.getProperties().getSprite().css(CSS_LEFT_LABEL, monster.getProperties().getDefaultX() + 'px'); monster.getProperties().getSprite().css(CSS_BOTTOM_LABEL, monster.getProperties().getDefaultY(screenNumber) + 'px'); monster.getProperties...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeScreen(screenNumber) {\n validateRequiredParams(this.initializeScreen, arguments, 'screenNumber');\n let monsters = this.getMonstersOnScreen(screenNumber);\n\n for (let monster of monsters) {\n this.initializeMonster(monster, screenNumber);\n }\n }", "construct...
[ "0.6812995", "0.66513896", "0.6647709", "0.64412194", "0.64321977", "0.64271086", "0.6290029", "0.6266707", "0.6227675", "0.62144494", "0.621016", "0.61519355", "0.60422766", "0.5986478", "0.5948585", "0.59035206", "0.5882536", "0.5879027", "0.5867835", "0.58419025", "0.57953...
0.7641371
0
Reset sprite positions to the default.
resetSpritePositions(barbarian) { validateRequiredParams(this.resetSpritePositions, arguments, 'barbarian'); let characters = new Array(barbarian); for (let scrNum of this.getScreenNumbers()) { for (let opponent of this.getMonstersOnScreen(barbarian.getScreenNumber())) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() { // Resetting sprite/locations locations\n player.x = 205;\n player.y = 405;\n for (const enemy of allEnemies) {\n enemy.x = 0;\n }\n clearTimeout(stop);\n }", "resetPos() {\r\n this.pos.x = width/2;\r\n this.pos.y = height/2;\r\n }", "R...
[ "0.76029015", "0.72110623", "0.71432066", "0.71422046", "0.7086905", "0.70512563", "0.6945021", "0.694369", "0.6871926", "0.6806885", "0.6778953", "0.6709974", "0.6697391", "0.66891557", "0.6689043", "0.6657853", "0.66252583", "0.66165596", "0.6531836", "0.65208423", "0.65153...
0.0
-1
when the component is mount, we call the api toget the previously saved infos about this job offer and update the local state to update the form
componentDidMount() { AuthentificationStore.addChangeListener(this._onChange.bind(this)); fetch("/jobOffers/offer/" + this.props.match.params.id) .then(function(response) { return response.json(); }) .then(body => { this.setState({ jobOffer: body }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prepopulateJobBag(){\n \n const {history,match} = this.props;\n const jobId = parseInt(match.params.jobid);\n\n // Check if the job number id\n\n if(jobId!=\"NaN\" && jobId>0){\n const req = this.props.settings.setting.react_api_folder+'/manage_jobs_actions/...
[ "0.6709075", "0.6350005", "0.6288713", "0.6202829", "0.61889815", "0.6118971", "0.6112995", "0.6087327", "0.6084487", "0.6065637", "0.60639346", "0.6019141", "0.6003574", "0.60021144", "0.59993243", "0.59982663", "0.5986359", "0.5982946", "0.5961064", "0.5958583", "0.5937827"...
0.68641704
0
reset state if the seeded prop is updated note: setting state from props can be considered antipattern in react but due to a design issue with the layout of this component and its multi effected showmore/showless icon (changes if icon is toggled but also if rows are removed on the Unassigned event page thus this is nec...
componentWillReceiveProps(nextProps){ if (nextProps.showmoreIcon !== this.props.showmoreIcon) { this.setState({ showmoreIcon: nextProps.showmoreIcon }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset(prop, e) {\n var newState = {};\n newState[prop] = '';\n this.setState(newState);\n }", "componentWillReceiveProps(nextProps) {\n if (!nextProps.toggleL && nextProps.toggleR) {\n this.clearDeselectionPopup()\n }\n }", "static getDerivedStateFromProps(props, state) {\r\n if (p...
[ "0.65752596", "0.64249456", "0.6370593", "0.63347787", "0.62932795", "0.626881", "0.62357223", "0.62201375", "0.6217882", "0.6167349", "0.6165508", "0.6161676", "0.61551905", "0.61420536", "0.61419123", "0.6123111", "0.60797274", "0.6065943", "0.60545725", "0.60207033", "0.60...
0.6590052
0
FUNCTION TO CARRY OUT THE GAME
function checkguess() { // USER GUESS TAKEN FROM TEXT BOX, CONVERTED FROM A STRING AND STORED TO VAR var userguess = parseInt(document.getElementById("input1").value); // IF THE GUESS IS BIGGER if (userguess > randomnum) { //COUNT CLICKS VARIABLE CALLED ON AND ADDS +1 countClicks++; // RESULT ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endGame() {\n \n}", "function endGame(){\n $('.card-container').removeClass(\"selected-card\");\n $('.card-container').remove();\n while(model.getCardObjArr().length > 0){\n model.removeFromCardObjArr(0);\n }\n\n while(model.getDisplayedCardArr().length > 0...
[ "0.7363262", "0.73312306", "0.73222494", "0.71678025", "0.71493006", "0.71201795", "0.7084707", "0.7076073", "0.70394504", "0.7037044", "0.7035264", "0.70291007", "0.7026552", "0.7020337", "0.696077", "0.69574994", "0.6956808", "0.6954702", "0.6951126", "0.69385695", "0.69307...
0.0
-1
ADD TIME PERIOD MENU ITEM FUNCTION =========================================================================
function addTimePeriod() { var sheet = getTimesheet(); //GET LAST RECORDED END DATE var lastEndDate = sheet.getRange('B:B').getCell(2, 1).getValue(); sheet.insertRowBefore(2); //GET THE NEXT TIME PERIOD var startDate = lastEndDate.addDays(1); var endDate = startDate.addDays(13); //ADD THE NEXT TI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTime (i, el) {\n // 1 = 1am \n // 2 = 2am \n // 3 = 3am \n // 4 = 4am \n // 5 = 5am \n // 5 = 5am \n // 6 = 6am \n // 7 = 7am \n // 8 = 8am \n // 9 = 9am...
[ "0.66761744", "0.6578709", "0.6476905", "0.64587754", "0.61977345", "0.61643726", "0.610499", "0.60938215", "0.6052688", "0.6025024", "0.600126", "0.5966274", "0.5916883", "0.5916523", "0.5902393", "0.58783394", "0.5838918", "0.58361965", "0.583377", "0.5818206", "0.5809925",...
0.0
-1
========================================================================= CREATE FORM(S) MENU ITEM FUNCTION =========================================================================
function createTimePeriodForms() { var timesheet = getTimesheet(); var missingRows = getMissingForms(timesheet); var missingForms = getMissingForms(timesheet).length; for (i in missingRows) { var row = missingRows[i]; var startDate = formatDate(timesheet.getRange("A:A").getCell(row, 1).getValue(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_nav_forms(node,cmd1,employ,dflt,text1,classe,cmd2=undefined,text2=undefined){\n var Entry = document.createElement(\"INPUT\");\n Entry.setAttribute(\"type\", \"text\");\n var Valid = document.createElement(\"BUTTON\");\n Valid.setAttribute(\"type\", \"button\");\n Entry.defaultValue = dflt;\n En...
[ "0.6990442", "0.68305516", "0.6804216", "0.6776516", "0.67021793", "0.6616066", "0.65786904", "0.6508785", "0.6497008", "0.64693415", "0.64639425", "0.6453863", "0.63167304", "0.6272989", "0.6255736", "0.6229853", "0.6201799", "0.6198153", "0.6197487", "0.61962646", "0.618099...
0.0
-1
========================================================================= DIALOG TO CREATE FORM =========================================================================
function generateForm(startDate, endDate, row, missingForms) { var ui = SpreadsheetApp.getUi(); var result = ui.alert( 'Create form for ' + startDate + ' - ' + endDate, 'Would you like to create form?', ui.ButtonSet.YES_NO_CANCEL); if(result == ui.Button.YES) { createForm(startDate, endDate,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserCreateForm(){\n showCreateDialog();\n}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.c...
[ "0.76364017", "0.6876544", "0.68446994", "0.6825602", "0.67201614", "0.66626805", "0.65998334", "0.6504871", "0.6492423", "0.64827424", "0.64483285", "0.6444652", "0.6433792", "0.64095736", "0.6385686", "0.6385537", "0.63339317", "0.6331208", "0.6310927", "0.6288114", "0.6222...
0.5929561
50
========================================================================= CREATE FORM =========================================================================
function createForm(startDate, endDate, row, missingForms) { var timesheet = getTimesheet(); var folder = getFolder(); updateForm(); var formId = getFormDrive().makeCopy(folder).setName(startDate + ' - ' + endDate + ' | Time Tracking').getId(); var form = FormApp.openById(formId); form.setTitle(startD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficu...
[ "0.76923436", "0.75487274", "0.7398695", "0.7329685", "0.7280069", "0.70718175", "0.7013967", "0.6993846", "0.6953298", "0.693647", "0.69157314", "0.69026107", "0.68576825", "0.6847284", "0.683265", "0.68281305", "0.6795683", "0.6780787", "0.6753", "0.6750352", "0.6740529", ...
0.0
-1
========================================================================= SEND FORM LINK TO SLACK DIALOG =========================================================================
function generateSlackFormLink(startDate, endDate, form) { var ui = SpreadsheetApp.getUi(); var result = ui.alert( 'Slack ' + startDate + ' - ' + endDate + ' Form?', 'This will be send to #priv-consensys-member.', ui.ButtonSet.YES_NO_CANCEL); if(result == ui.Button.YES) { postForm(startDate,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExtLinkClickThru(ext_id,openNewWin,url,form) {\r\n\t$.post(app_path_webroot+'ExternalLinks/clickthru_logging_ajax.php?pid='+pid, { url: url, ext_id: ext_id }, function(data){\t\t\r\n\t\tif (data != '1') {\r\n\t\t\talert(woops);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!openNewWin) {\r\n\t\t\tif (form !=...
[ "0.64329827", "0.61569136", "0.61007124", "0.60126394", "0.60083985", "0.5876832", "0.5870301", "0.58429945", "0.5808113", "0.5797652", "0.5797511", "0.57779825", "0.5767741", "0.5749849", "0.5732234", "0.5730894", "0.5705166", "0.5668229", "0.56551516", "0.56508774", "0.5647...
0.6645757
0
========================================================================= CREATE NEW FORM TEMPLATE =========================================================================
function createFormTemplate() { var timesheet = getTimesheet(); var folder = getFolder(); var ff = FormApp.create('Time Tracking'); ff.setCollectEmail(true); ff.setAllowResponseEdits(true); ff.setLimitOneResponsePerUser(true); createFormFields(ff); //DELETE FORM var ffId = ff.getId(); var f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFormTemplate( itcb ) {\n // if no form to look up then we can skip this step\n\n formOptions.callback = onFormTemplateCreated;\n Y.dcforms.createTemplate( formOptions );\n\n function onFormTemplateCreated( err, newFormTemplate ) {\n ...
[ "0.7856063", "0.77676296", "0.72450745", "0.7109319", "0.6905929", "0.688041", "0.6855157", "0.6818233", "0.671859", "0.66371775", "0.66106206", "0.659762", "0.6581909", "0.6565585", "0.6519855", "0.6513095", "0.64874184", "0.644436", "0.643765", "0.6418902", "0.6408944", "...
0.7125773
3
May produce error since it was edited without being tested afterwards
function completePartialTime(partialText) { let timeText = timeTexts.filter((timeText) => timeText.y < partialText.y) .sort((a, b) => b.y - a.y)[0] let parts = timeText.text.split(':').map((str) => parseInt(str)) let hour = parts[0] let minute = parts[1] let partialM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "edit(args) {\r\n throw \"Error this method should be overridden by its extended class\";\r\n }", "function StupidBug() {}", "function VeryBadError() {}", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "transient private protected internal function m182() {}", "afterVali...
[ "0.61428", "0.612417", "0.6087249", "0.59984326", "0.5951818", "0.59509546", "0.58748704", "0.5843404", "0.5739072", "0.5722244", "0.566768", "0.5645219", "0.5644132", "0.5635358", "0.5599562", "0.55769557", "0.5562799", "0.5559864", "0.5554928", "0.5548569", "0.55451524", ...
0.0
-1
Get the list of all football leagues
function getSoccerLeaguesOnly(leagues) { return leagues.filter(league => { return league.strSport === 'Soccer'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLeagueList() {\n return League.find({}, \"name\").exec();\n}", "function getLeagues(req, rsp) {\n debug(\"/leagues called\");\n leaguesModel.getLeagues((err, leagues) => {\n if (err!==undefined) {\n debug(\"/leagues read ERROR:\");\n debug(err);\n }\n ...
[ "0.72773635", "0.6963674", "0.6731284", "0.66159254", "0.65268844", "0.63987297", "0.62263095", "0.61689657", "0.5988584", "0.59744275", "0.590825", "0.5859607", "0.58498526", "0.5841703", "0.58183575", "0.5811717", "0.57797885", "0.5709118", "0.5701218", "0.57001966", "0.568...
0.0
-1
Return shortened URLs that belong to a user in an object
function urlsForUser(id, database) { let urls = {}; for (const url in database) { if (database[url].userID === id) { urls[url] = database[url]; } } return urls; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlsForUser(id) {\n let usersUrl = {}\n for (shortURL in urlDatabase) {\n if (urlDatabase[shortURL].userID === id){\n usersUrl[shortURL]= (urlDatabase[shortURL][shortURL]);\n }\n }\n return usersUrl;\n}", "function urlsForUserId(user_id) {\n const urls = {};\n for (const short in urlDa...
[ "0.6838116", "0.68237954", "0.6809882", "0.6769905", "0.67195976", "0.66576904", "0.6623692", "0.66015947", "0.65150565", "0.6459998", "0.6297329", "0.6291095", "0.62496823", "0.6235603", "0.6184401", "0.61704236", "0.6099899", "0.6061286", "0.6043777", "0.6037085", "0.601005...
0.56548834
39
Convert emscripten FS errors to errnos
function fsErr(err) { if (typeof err === "object" && "errno" in err) return -err.errno; return -JSMIPS.ENOTSUP; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dump_file_error() {\n var aug = this;\n\n var files_with_errors =\n aug.match(\n '/augeas/files/*/*[error]'\n ).map(function(s){\n return s.substr(13); // cutoff /augeas/files: 13 = strlen(/augeas/files)\n });\n\n var res = \n files_with_erro...
[ "0.6703125", "0.6094719", "0.6080415", "0.605089", "0.6035562", "0.60013103", "0.5937532", "0.58368826", "0.58111817", "0.5800851", "0.5783971", "0.57740027", "0.57384616", "0.56868804", "0.56708854", "0.565661", "0.5634058", "0.5573953", "0.5527576", "0.5522136", "0.55079055...
0.6093026
2
We avoid Emscripten's cwd, because each MIPS sim has its own, so use this to get absolute paths
function absolute(mips, path) { if (path.length === 0) return mips.cwd; try { path = FS.lookupPath(path).path; } catch (ex) {} path = PATH.normalize(mips.cwd + path); return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "function tilda(cwd) {\n if (cwd.substring(0, 1) === '~') {\n cwd = (process.env.HOME || process.env.HOMEPATH || process.env.HOMEDIR || process.cwd()) + cwd.substr(1);\n }\n return path.resolve(cwd);\n}", "fu...
[ "0.69734997", "0.6636196", "0.6547233", "0.6374444", "0.63654643", "0.6335709", "0.6314468", "0.6249961", "0.6247353", "0.624221", "0.6210497", "0.62073255", "0.61992157", "0.61731625", "0.6162345", "0.61584747", "0.60821575", "0.60718787", "0.60528433", "0.60277003", "0.5992...
0.74453264
0
Generic frontend for stat and lstat
function multistat(mips, mode, pathname, statbuf) { if (typeof pathname === "number") pathname = absolute(mips, mips.mem.getstr(pathname)); // Assert its existence var ub = XHRFS.assert(pathname); if (ub) return ub; var j; try { j = FS[mode](pathname); } catch (err) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async lstat(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.lstat();\n }", "lstat(path, callback) {\n // Make sure the callback is only called once\n callback = call_1.callOnce(callback);\n try {\...
[ "0.62625146", "0.6105131", "0.60632145", "0.59935", "0.5946173", "0.5924304", "0.5921206", "0.58792937", "0.5697759", "0.5685265", "0.56828684", "0.5617481", "0.55987567", "0.55584455", "0.5558292", "0.54327375", "0.542147", "0.539336", "0.5352374", "0.53409564", "0.530639", ...
0.49874997
29
user management functions these are used to create users, which are for creating email alerts
function show_manage_user(){ var manage_user = fill_template('user-management',{}); $('#dd-log-in-menu').remove(); $('.navbar-nav').append(manage_user); $('#dd-manage-alerts').click( function(e) { show_manage_alerts(); }); $('#dd-lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser() {}", "function create_user(userobject){\n\n}", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role:...
[ "0.76551545", "0.7176187", "0.7124997", "0.7090544", "0.6969559", "0.6955733", "0.69338405", "0.6932489", "0.68941545", "0.6855995", "0.68553466", "0.67918295", "0.67797405", "0.67781377", "0.6750718", "0.67448187", "0.67433035", "0.6741922", "0.6702666", "0.67001975", "0.669...
0.0
-1
handles clicks on search button
function add_click() { $('#search').click(function(){ var query = find_query_params(); //show a simple error message if the user hasn't entered enough in the query query?query_data(query):error(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSearchButton(event) {\n if (\n event.target.label ==\n gSearchBundle.GetStringFromName(\"labelForSearchButton\")\n ) {\n onSearch();\n } else {\n onSearchStop();\n }\n}", "function clickSearchButton(e){\n _self.getDefaultPlace(_self.scope.inputSearch.value); \n }", "click...
[ "0.80174273", "0.7943545", "0.7888287", "0.7645776", "0.7494333", "0.7414766", "0.7395401", "0.73695916", "0.7334083", "0.73033756", "0.7250058", "0.72416484", "0.7235318", "0.72018605", "0.7183045", "0.71795493", "0.71750313", "0.71399635", "0.7122783", "0.710893", "0.705159...
0.66029847
76
executes search and passes off response
function query_data(query) { //for debugging // console.log(query); $('#data-tables').empty(); $('#data-tables').html('<h2>Searching ...</h2>'); $.get(query) .done(function(data){ //for debugging // console...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runSearch() {\n ps.search()\n .then(function(rsp) {\n if(rsp.stat === \"fail\") {\n ps.showError(rsp);\n }\n else if (rsp.stat === \"ok\") {\n ps.paging = rsp.photos;\n ps.parseSearchRes...
[ "0.7034373", "0.69414365", "0.69123495", "0.690377", "0.6849272", "0.6842155", "0.66532737", "0.66355866", "0.65946805", "0.6591839", "0.65762144", "0.65745604", "0.65614265", "0.6537782", "0.6533944", "0.6489339", "0.6484392", "0.6483958", "0.6464243", "0.64509946", "0.64360...
0.0
-1
show error message if they haven't at least selected one data type
function error(){ $('#data-tables').html('<h4 class="text-danger">Specify at least one search category.</h4>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typeOnChange () {\n var type=$('#type').val();\n //Error\n var type_error=$('#type_error');\n //Error Msg\n var msgSelect=\"NONE Selected\";\n\n if(type==0){\n type_error.text(msgSelect);\n type_error.show();\n }else{\n\n type_error.hide();\n\n }\n\n}", "func...
[ "0.65189207", "0.6409488", "0.63448626", "0.63024443", "0.6018869", "0.5987051", "0.59680885", "0.5943846", "0.59271896", "0.59091896", "0.58775055", "0.58342254", "0.5775999", "0.57736635", "0.5731995", "0.57294273", "0.57252806", "0.56768787", "0.5675666", "0.56635123", "0....
0.57170254
17