query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
The Constructor is returned by this Immutable function. Callers can then use it to create new instances of objects that they expect to meet the schema, set forth by this Immutable. | function Constructor (values) {
var propName,
// we return self - it will provide access to the getters and setters
self = {};
values = values || {};
if (
// you can override initial validation by setting
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Immutable (originalSchema) {\n var schema = {}, blueprint, prop, propCtor;\n\n if (!originalSchema) {\n return new InvalidArgumentException(new Error('A schema object, and values are required'));\n }\n\n // Convert any objects that aren't validata... | [
"0.6791926",
"0.6657413",
"0.6598576",
"0.63822585",
"0.6093695",
"0.60557866",
"0.5974791",
"0.5974791",
"0.5974791",
"0.5880356",
"0.5854953",
"0.58489996",
"0.57926",
"0.5789543",
"0.57499486",
"0.5741624",
"0.5736388",
"0.5665391",
"0.5631423",
"0.56235254",
"0.56166756",... | 0.67129695 | 1 |
Immutable / Creates a copy of the value, and creates a readonly property on `self` | function makeImmutableProperty (self, schema, values, propName) {
var Model, dateCopy;
if (schema[propName].__immutableCtor && is.function(schema[propName])) {
// this is a nested immutable
Model = schema[propName];
self[propName] = new Model(valu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"copyable(newValue = true) {\n this.value.copyable = newValue;\n return this;\n }",
"set(value) {\n if (value === this._value) {\n return this;\n }\n\n return new ImmutableAccessor(value, this.path);\n }",
"get shallowCopy() {\n return this.shallowCopy$();\n }",
"copy... | [
"0.670268",
"0.64647347",
"0.619443",
"0.61899436",
"0.6068771",
"0.60651004",
"0.60070676",
"0.5987902",
"0.5985432",
"0.5942874",
"0.5942874",
"0.5942874",
"0.5942874",
"0.5942874",
"0.5887968",
"0.58343893",
"0.57599264",
"0.5753789",
"0.57491195",
"0.57491195",
"0.5740890... | 0.6560574 | 1 |
makeImmutableProperty / make a readonly property that returns null | function makeReadOnlyNullProperty (self, propName) {
objectHelper.setReadOnlyProperty(self, propName, null, makeSetHandler(propName));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internalProperty(options) {\n return property({ attribute: false, hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged });\n}",
"function internalProperty(options){return property({attribute:false,hasChanged:options===null||options===void 0?void 0:options.hasChanged});}",
... | [
"0.6054209",
"0.59780294",
"0.5920431",
"0.5707005",
"0.5707005",
"0.5630741",
"0.562664",
"0.5625052",
"0.5625052",
"0.56013256",
"0.55963504",
"0.5557508",
"0.55510676",
"0.55313903",
"0.5501012",
"0.5501012",
"0.5501012",
"0.5501012",
"0.5448218",
"0.5448218",
"0.5448218",... | 0.6763025 | 0 |
makeReadOnlyNullProperty / make a set handler that returns an exception | function makeSetHandler (propName) {
return function () {
var err = new Exception(locale.errorTypes.readOnlyViolation, new Error('Cannot set `' + propName + '`. This object is immutable'));
config.onError(err);
return err;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeReadOnlyNullProperty (self, propName) {\n objectHelper.setReadOnlyProperty(self, propName, null, makeSetHandler(propName));\n }",
"function setter() {\n\t throw new Error('vuex getter properties are read-only.');\n\t }",
"set booking(stuff){\n throw \"sorry you can... | [
"0.66587955",
"0.6356464",
"0.6235886",
"0.6208156",
"0.5865558",
"0.58342254",
"0.57981133",
"0.57048345",
"0.56855756",
"0.5644346",
"0.5636067",
"0.56044286",
"0.548204",
"0.548204",
"0.548204",
"0.548204",
"0.5450891",
"0.5335113",
"0.5334958",
"0.5333292",
"0.53252125",
... | 0.7683469 | 0 |
Metodo para finalizar accion de mover | function finishMove(){
//Cambiar estado hotspot
$(".hots"+id).find(".in").removeClass("move");
$(".hots"+id).find(".out").removeClass("moveOut");
$(".hotspotElement").removeClass('active');
$(".hotspotElement").css("pointer-events", "all");... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"finMouvement() {\n\t\tthis.visuel.removeEventListener('transitionend', this.evt.visuel.transitionend);\n\t\tthis.file.shift();\n this.cellule.verifierObjet();\n\t\tthis.prochainMouvement();\n\t\t//this.vitesse = 0; //maintenant gere dans la fn prochainMouvement\n\t}",
"function end(){\n this.previousRo... | [
"0.6835387",
"0.62044543",
"0.6173208",
"0.6167339",
"0.61224705",
"0.61108464",
"0.59987867",
"0.5991849",
"0.5975187",
"0.5969416",
"0.5935727",
"0.5925944",
"0.58890903",
"0.5871062",
"0.5811536",
"0.5802742",
"0.5782116",
"0.5748354",
"0.5741184",
"0.5724469",
"0.57241756... | 0.63237244 | 1 |
Code as fast as you can! You need to double the integer and return it. | function doubleInteger(i) {
// i will be an integer. Double it and return it.
return i*2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doubleInteger(i) {\n return i*2;\n}",
"function doubleInteger(i) {\n // i will be an integer. Double it and return it.\n return i * 2;\n}",
"function getInt(n){\n return Math.floor(get() * (n + 1));\n}",
"function doubleIT(num){\n var result = num * 2;\n return result;\n}",
"function dou... | [
"0.74438244",
"0.74044526",
"0.7052231",
"0.69679093",
"0.667166",
"0.65629786",
"0.6411179",
"0.63856465",
"0.6376736",
"0.63684785",
"0.6325474",
"0.63242817",
"0.63145906",
"0.63068527",
"0.628197",
"0.6243972",
"0.6173825",
"0.61356324",
"0.61268353",
"0.6111958",
"0.6100... | 0.74575794 | 0 |
Function name: add module Author: Reccion, Jeremy Date Modified: 2018/04/02 Description: creates a new collection by the name inputted by the user. it is then registered to the "modules" collection. Parameter(s): Object. includes: name: required. string type fields: optional. Array type. initialized if not existing fro... | function addModule(newModule){
//imitate angular promise. start by initializing this
var deferred = Q.defer();
newModule.name = newModule.name.toLowerCase();
//check if there is an existing module
db.modules.findOne({name: newModule.name}, function(err, aModule){
if(err){
defer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n ... | [
"0.69070256",
"0.6625662",
"0.6408294",
"0.6319275",
"0.6271609",
"0.5992774",
"0.59464574",
"0.58238715",
"0.57643443",
"0.5700712",
"0.5631341",
"0.56060815",
"0.5589861",
"0.5577479",
"0.5543143",
"0.54741263",
"0.5458044",
"0.54475826",
"0.54274565",
"0.54143834",
"0.5408... | 0.72655445 | 1 |
Function name: update module Author: Reccion, Jeremy Date Modified: 2018/04/02 Description: updates the name of the module Parameter(s): Object. Includes: _id: required. string type name: required. string type Return: Promise | function updateModule(updateModule){
var deferred = Q.defer();
updateModule.name = updateModule.name.toLowerCase();
//fields array should not be editable when using this function. therefore, delete it from input
delete updateModule.fields;
db.modules.find({$or: [
{_id: mongo.helper.toObje... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateModule(updateModule){\n var deferred = Q.defer();\n\n updateModule.name = updateModule.name.toLowerCase();\n\n //fields array should not be editable when using this function. therefore, delete it from input\n delete updateModule.fields;\n\n //check if the name of the selected module h... | [
"0.7093112",
"0.7071991",
"0.68973994",
"0.67273706",
"0.67273706",
"0.6495799",
"0.6399463",
"0.63616574",
"0.6330262",
"0.6246438",
"0.62095666",
"0.6175385",
"0.6175385",
"0.6175385",
"0.6175385",
"0.6175385",
"0.6175385",
"0.6175385",
"0.61658496",
"0.6108117",
"0.6101938... | 0.7073509 | 1 |
Function name: delete module Author: Reccion, Jeremy Date Modified: 2018/04/23 Description: drops the specific collection then remove its document from the 'modules' collection Parameter(s): moduleName: string type Return: Promise | function deleteModule(moduleName){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
//drop the collection
db.bind(moduleName);
db[moduleName].drop(function(err){
if(err){
if(err.codeName == 'NamespaceNotFound'){
deferred.reject(notFound);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteModule(id, moduleName){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //drop the collection\n db.bind(moduleName);\n db[moduleName].drop();\n\n //remove document from 'modules' collection\n db.modules.remove({_id: mongo.helper.toObjectID(id)}, function... | [
"0.84370935",
"0.7958818",
"0.79092586",
"0.7097685",
"0.6860468",
"0.67647773",
"0.662002",
"0.6473157",
"0.62492627",
"0.58944094",
"0.5845492",
"0.5764855",
"0.57641274",
"0.573505",
"0.57172936",
"0.5634599",
"0.5621253",
"0.56094986",
"0.55869454",
"0.5581452",
"0.552641... | 0.87686384 | 0 |
Function name: add module field Author: Reccion, Jeremy Date Modified: 2018/04/20 Description: insert a new field object to the specific module's fields array Parameter(s): moduleName: required. string type fieldObject: required. object type. includes: name: required. string type unique: required. boolean type Return: ... | function addModuleField(moduleName, fieldObject){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
//create a new objectID to used as query for updates and delete
fieldObject.id = new ObjectID();
//the query searches for the module name that do not have the inputted field name
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //create a new objectID to used as query for updates and delete\n fieldObject.id = new ObjectID();\n\n db.modules.update({name: moduleName}, {$push: {fields: fieldObject}}, func... | [
"0.8235917",
"0.679162",
"0.67566025",
"0.6683053",
"0.6612175",
"0.6491345",
"0.64870906",
"0.6423668",
"0.6423668",
"0.6410956",
"0.62967265",
"0.62095296",
"0.6172234",
"0.6075467",
"0.60152245",
"0.5900019",
"0.58819133",
"0.585371",
"0.5834094",
"0.5774164",
"0.57685655"... | 0.8132459 | 1 |
Function name: update module field Author: Reccion, Jeremy Date Modified: 2018/04/24 Description: update a field object from the specific module's fields array Parameter(s): moduleName: required. string type fieldObject: required. object type Return: Promise | function updateModuleField(moduleName, fieldObject){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
console.log(fieldObject);
service.getModuleByName(moduleName).then(function(aModule){
//use array.filter() to get the duplicate fields
var duplicateFields = aMo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateModuleField(moduleName, fieldObject){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n fieldObject.id = new ObjectID(fieldObject.id);\n \n db.modules.update({name: moduleName, fields: {$elemMatch: {id: fieldObject.id}}}, {$set: {'fields.$': fieldObject}}, funct... | [
"0.8456608",
"0.81074345",
"0.805101",
"0.7392945",
"0.7392381",
"0.70211095",
"0.68865806",
"0.66497767",
"0.66221124",
"0.647745",
"0.6348413",
"0.6348413",
"0.63277465",
"0.6174028",
"0.60932803",
"0.60513693",
"0.6039068",
"0.60181665",
"0.5856864",
"0.57826996",
"0.57653... | 0.8240337 | 1 |
Function name: delete module field Author: Reccion, Jeremy Date Modified: 2018/04/24 Description: delete a field object from the specific module's fields array Parameter(s): moduleName: required. string type fieldID: required. string type Return: Promise | function deleteModuleField(moduleName, fieldID){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err, writeResult){
if(err){
deferred.reject(err);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteModuleField(moduleName, fieldID){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n \n db.modules.update({name: moduleName}, {$pull: {fields: {id: mongo.helper.toObjectID(fieldID)}}}, function(err){\n if(err){\n deferred.reject(err);\n }\n ... | [
"0.8156747",
"0.67469287",
"0.66539174",
"0.6590933",
"0.65539515",
"0.6496182",
"0.6480931",
"0.6474819",
"0.6348002",
"0.6331068",
"0.62288254",
"0.6219512",
"0.6177473",
"0.6077904",
"0.6047087",
"0.5973316",
"0.59649444",
"0.59559435",
"0.59484595",
"0.58134276",
"0.58067... | 0.80614734 | 1 |
Function name: get a specific module Author: Reccion, Jeremy Date Modified: 2018/04/20 Description: retrieves a specific module by its name Parameter(s): moduleName: string type Return: Promise | function getModuleByName(moduleName){
var deferred= Q.defer();
moduleName = moduleName.toLowerCase();
db.modules.findOne({name: moduleName}, function(err, aModule){
if(err){
deferred.reject(err);
}
else if(aModule){
deferred.resolve(aModule);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getModuleByName(moduleName){\n var deferred= Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.findOne({name: moduleName}, function(err, aModule){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve(aModule);\n }\n ... | [
"0.7550319",
"0.64568645",
"0.6341758",
"0.61982876",
"0.6101905",
"0.5989672",
"0.59674895",
"0.5937421",
"0.5917052",
"0.5729546",
"0.56361324",
"0.5632423",
"0.5617168",
"0.5553284",
"0.55260795",
"0.55196166",
"0.5515729",
"0.5500644",
"0.54888695",
"0.548056",
"0.5458297... | 0.7540487 | 1 |
Function name: add document Author: Reccion, Jeremy Date Modified: 2018/04/24 Description: add a document in a specific collection Parameter(s): moduleName: string type newDoc: object type. //fields must be the specific module's 'fields' in 'modules' collection Return: Promise | function addModuleDoc(moduleName, newDoc){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
service.findDuplicateDoc(moduleName, newDoc).then(function(){
db.bind(moduleName);
db[moduleName].insert(newDoc, function(err){
if(err){
deferred.reject(e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addModuleDoc(moduleName, newDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].insert(newDoc, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferred.resolve();\n ... | [
"0.79263556",
"0.66809034",
"0.66809034",
"0.65259874",
"0.6474247",
"0.6462474",
"0.6386402",
"0.62038225",
"0.6137509",
"0.60923326",
"0.60543627",
"0.60535026",
"0.60426795",
"0.60029393",
"0.5956532",
"0.5956532",
"0.5956532",
"0.58633536",
"0.5832858",
"0.57799244",
"0.5... | 0.78352207 | 1 |
Function name: get documents of a module Author: Reccion, Jeremy Date Modified: 2018/04/04 Description: get all documents of a specific module Parameter(s): moduleName: string type Return: Promise | function getAllModuleDocs(moduleName){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
db.bind(moduleName);
db[moduleName].find().toArray(function(err, moduleDocs){
if(err){
deferred.reject(err);
}
else{
deferred.resolve(moduleDocs);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getDocument(req, res, next){\n\n document.findAll({ attributes: ['name'] })\n .then(document => {\n res.status(200).send(document)\n })\n .catch(err => {\n res.status(400).send(e);\n })\n}",
"GetAllDocuments() {\n return this.Start().then(Cache.DB).then(db => new Promise((resolve, re... | [
"0.6185267",
"0.5993622",
"0.59846175",
"0.59552914",
"0.57914364",
"0.5780547",
"0.57780313",
"0.57778186",
"0.5751649",
"0.57448214",
"0.5715541",
"0.5707072",
"0.5701094",
"0.5696588",
"0.56830984",
"0.56245357",
"0.56133175",
"0.55978113",
"0.55827266",
"0.5580734",
"0.55... | 0.8136698 | 1 |
Function name: update a module document Author: Reccion, Jeremy Date Modified: 2018/04/04 Description: update a document of a specific module Parameter(s): moduleName: string type updateDoc: object type. includes: _id: required. string type //fields must be the specific module's 'fields' in 'modules' collection Return:... | function updateModuleDoc(moduleName, updateDoc){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
service.findDuplicateDoc(moduleName, updateDoc).then(function(){
db.bind(moduleName);
//convert '_id' to ObjectID
updateDoc._id = new ObjectID(updateDoc._id);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateModuleDoc(moduleName, updateDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n //create another object and copy. then delete the '_id' property of the new copy\n var forUpdate = {};\n Object.assign(forUpdate, updateDoc);\n del... | [
"0.8221811",
"0.7874364",
"0.77189493",
"0.738352",
"0.72332454",
"0.68794364",
"0.68794364",
"0.68435234",
"0.6736119",
"0.63068366",
"0.6303614",
"0.62880695",
"0.62741476",
"0.6246192",
"0.61462486",
"0.61180973",
"0.60007644",
"0.59134805",
"0.59115833",
"0.58952177",
"0.... | 0.80793613 | 1 |
Function name: delete a module document Author: Reccion, Jeremy Date Modified: 2018/04/04 Description: delete a document of a specific module Parameter(s): moduleName: string type id: string type. //id of the specific document Return: Promise | function deleteModuleDoc(moduleName, id){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
db.bind(moduleName);
db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err, writeResult){
if(err){
deferred.reject(err);
}
else{
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteModuleDoc(moduleName, id){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.bind(moduleName);\n\n db[moduleName].remove({_id: mongo.helper.toObjectID(id)}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n ... | [
"0.8478919",
"0.8008632",
"0.79626316",
"0.7090099",
"0.69446784",
"0.6760206",
"0.6703368",
"0.6679069",
"0.6499352",
"0.648364",
"0.6419483",
"0.6418587",
"0.63801485",
"0.63159657",
"0.6239152",
"0.6212612",
"0.6169452",
"0.61594284",
"0.61558723",
"0.61168295",
"0.6104319... | 0.8466946 | 1 |
Function name: find duplicate values Author: Reccion, Jeremy Date Modified: 2018/04/12 Description: check for duplicate values according to one or more unique fields Parameter(s): moduleName: required. string type moduleDoc: required. object type. includes: _id: optional. string type //if this exists, the document is b... | function findDuplicateDoc(moduleName, moduleDoc){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
//get the fields of the specific module
service.getModuleByName(moduleName).then(function(aModule){
//initialize array & object for querying
var uniqueValues = [];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findDuplicateDoc(moduleName, moduleDoc){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n //get the fields of the specific module\n service.getModuleByName(moduleName).then(function(aModule){\n //initialize array & object for querying\n var uniqueFields = ... | [
"0.7790472",
"0.6359789",
"0.6185164",
"0.60583496",
"0.59461486",
"0.5890801",
"0.57857865",
"0.563223",
"0.5565228",
"0.55593705",
"0.55330694",
"0.5467956",
"0.5450589",
"0.5444566",
"0.54175276",
"0.53952575",
"0.53873485",
"0.5369162",
"0.53616375",
"0.53610873",
"0.5342... | 0.77881294 | 1 |
Function name: update fields array Author: Reccion, Jeremy Date Modified: 2018/04/12 Description: sets the 'fields' property of the specific module to the inputted array. Parameter(s): moduleName: required. string type fieldArray: required. array type. //this array is from angular's UISORTABLE Return: Promise | function updateFieldArray(moduleName, fieldArray){
var deferred = Q.defer();
moduleName = moduleName.toLowerCase();
//need to convert each 'id' property to an ObjectID
for(var i = 0; i < fieldArray.length; i++){
fieldArray[i].id = new ObjectID(fieldArray[i].id);
}
db.modules.updat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateFieldArray(moduleName, fieldArray){\n var deferred = Q.defer();\n moduleName = moduleName.toLowerCase();\n\n db.modules.update({name: moduleName}, {$set: {fields: fieldArray}}, function(err){\n if(err){\n deferred.reject(err);\n }\n else{\n deferre... | [
"0.8652673",
"0.70994407",
"0.69737965",
"0.6589965",
"0.6513358",
"0.6509463",
"0.59435564",
"0.5773354",
"0.5769816",
"0.5576439",
"0.55589837",
"0.55294067",
"0.54397786",
"0.5399783",
"0.5358418",
"0.53507483",
"0.530652",
"0.5295252",
"0.5295252",
"0.5285423",
"0.5277235... | 0.84816843 | 1 |
Clears the query params | clearQueryParams() {
this.queryParams = {};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeAllURLQueryString() {\n delete this.urlObj.search;\n }",
"clearQs() {\n this.forwardQueryString = false;\n this.queryString = {};\n return this;\n }",
"clearInitialSearch() {\n const params = this.params();\n delete params.q;\n\n m.route(app.route(this.searchRoute, pa... | [
"0.7641261",
"0.75850177",
"0.7096127",
"0.7081908",
"0.7053546",
"0.70035225",
"0.6965717",
"0.69373214",
"0.67906666",
"0.6681247",
"0.6549215",
"0.65451187",
"0.64949024",
"0.6426417",
"0.64178604",
"0.6417518",
"0.63831586",
"0.6334712",
"0.63329154",
"0.6330536",
"0.6310... | 0.8285499 | 0 |
Clones the query params | _cloneQueryParams() {
var extend = function (object) {
const scratch = {};
Object.keys(object).forEach((key) => {
const value = object[key];
if (Array.isArray(value)) {
scratch[key] = value.splice(0);
} else if (typeof value === 'object') {
scratch[key] = exte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearQueryParams() {\n this.queryParams = {};\n }",
"clearQs() {\n this.forwardQueryString = false;\n this.queryString = {};\n return this;\n }",
"addQueryParams(additionalQueryParams) {\n for (const key in additionalQueryParams) {\n if (additionalQueryParams.hasOwnProperty(... | [
"0.72527725",
"0.6354464",
"0.62944865",
"0.62072563",
"0.6136836",
"0.60743904",
"0.603191",
"0.5953603",
"0.5945542",
"0.59019774",
"0.59019774",
"0.58880925",
"0.58802503",
"0.5855626",
"0.58492976",
"0.58412933",
"0.58412933",
"0.58412933",
"0.58412933",
"0.58412933",
"0.... | 0.7555594 | 0 |
sets that.selectedMonth and that.selectedYear if different. returns true if the properties were set | function setMonthYear(date) {
var month = date.getMonth();
var year = date.getFullYear();
// update properties if different
if (month !== that.selectedMonth || year !== that.selectedYear) {
that.selectedMonth = month;
that.selectedYear = y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setSelectedMonth(value) {\n if (value instanceof DateRange) {\n this._selectedMonth = this._getMonthInCurrentYear(value.start) ||\n this._getMonthInCurrentYear(value.end);\n }\n else {\n this._selectedMonth = this._getMonthInCurrentYear(value);\n }\... | [
"0.65656024",
"0.65656024",
"0.63593584",
"0.60906655",
"0.5955042",
"0.5863237",
"0.5845072",
"0.57911855",
"0.5727883",
"0.56956816",
"0.56956816",
"0.56865835",
"0.56865835",
"0.5653115",
"0.56506276",
"0.5645195",
"0.5645195",
"0.564405",
"0.55890894",
"0.557247",
"0.5555... | 0.776558 | 0 |
build the calendar array | function buildCalendar() {
var year = that.selectedYear;
var month = that.selectedMonth;
var firstDateOfMonth = getDate(year, month, 1);
var firstDayOfMonth = firstDateOfMonth.getDay();
var firstDayOfWeek = that.options.firstDayOfWeek;
var rowInd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function constructCalendar(selectedDate){\n scope.calendarDays = [];\n //Setting up the array\n var endOfMonth = angular.copy(defaultDate);\n endOfMonth = endOfMonth.endOf('month').format('DD');\n var currentDate = angular.copy(defaultD... | [
"0.71836436",
"0.7157168",
"0.69721913",
"0.67158526",
"0.6659444",
"0.6658404",
"0.6619664",
"0.65990007",
"0.6590704",
"0.6581579",
"0.6548451",
"0.6483488",
"0.6477152",
"0.6459985",
"0.64313257",
"0.6424336",
"0.6384324",
"0.63710535",
"0.6348234",
"0.6305048",
"0.624175"... | 0.7292485 | 0 |
Keep track of the active TextEditor, because when single clicking a file from the treeview, atom.workspace.getEditor() returns undefined | subscribeToFileOpen() {
return atom.workspace.onDidOpen(event => {
this.activeEditor = event.item;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _onEditorChanged() {\n\t\t_close();\n\t\tcurrentEditor = EditorManager.getCurrentFullEditor();\n\n\t\tcurrentEditor.$textNode = $(currentEditor.getRootElement()).find(\".CodeMirror-lines\");\n\t\tcurrentEditor.$textNode = $(currentEditor.$textNode.children()[0].children[3]);\n\t\tcurrentEditor.$numbersNod... | [
"0.6879253",
"0.66936564",
"0.6544721",
"0.6524527",
"0.6499231",
"0.6499231",
"0.64954007",
"0.64462477",
"0.6404208",
"0.63776016",
"0.62949413",
"0.627102",
"0.6243174",
"0.618155",
"0.61683685",
"0.61574864",
"0.61540544",
"0.61104655",
"0.60639465",
"0.60564834",
"0.6051... | 0.7107289 | 0 |
! ignore /! Returns this documents _id cast to a string. | function r(){return null!=this._id?String(this._id):null} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function o(){return null!=this._id?String(this._id):null}",
"toString() {\r\n\t\t\treturn 's' + this.idNum;\r\n\t\t}",
"function n(){return null!=this._id?String(this._id):null}",
"function n(){return null!=this._id?String(this._id):null}",
"toString() {\n return this.id();\n }",
"getId() {\n ... | [
"0.7108244",
"0.7106047",
"0.7063738",
"0.7063738",
"0.6905292",
"0.6743027",
"0.6708931",
"0.6708931",
"0.6708931",
"0.6708931",
"0.6708931",
"0.6595603",
"0.6582902",
"0.6465702",
"0.6418251",
"0.6397523",
"0.6375707",
"0.62922573",
"0.62424135",
"0.6236174",
"0.62212014",
... | 0.74571913 | 0 |
The load process: Get the value Validate with the schema If upgrade is required, upgrade it | load(dataKey) {
return __awaiter(this, void 0, void 0, function* () {
const key = `${this.schema}/${dataKey}`;
let value = yield this.loadItem(key);
if (!value) {
return undefined;
}
const schemaVer = SchemaUtils_1.SchemaUtils.ver(value... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get loadType() {}",
"set loadType(value) {}",
"function validateYupSchema(values,schema,sync,context){if(sync===void 0){sync=false;}if(context===void 0){context={};}var validateData=prepareDataForValidation(values);return schema[sync?'validateSync':'validate'](validateData,{abortEarly:false,context:context});}... | [
"0.51111925",
"0.50718504",
"0.4980221",
"0.49248552",
"0.48824722",
"0.4878055",
"0.48144794",
"0.47584155",
"0.47560233",
"0.47282618",
"0.47135982",
"0.47014138",
"0.46864286",
"0.4670959",
"0.46695036",
"0.46513745",
"0.46497405",
"0.46280164",
"0.46182457",
"0.46181858",
... | 0.6279358 | 0 |
Sets the origin so that floorplan is centered | resetOrigin()
{
var centerX = this.canvasElement.innerWidth() / 2.0;
var centerY = this.canvasElement.innerHeight() / 2.0;
var centerFloorplan = this.floorplan.getCenter();
this.originX = Dimensioning.cmToPixel(centerFloorplan.x) - centerX;
this.originY = Dimensioning.cmToPixel(centerFloorplan.z) - cent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"recenter(origin = Vector.zero) {\n this.originX = origin.x;\n this.originY = origin.y;\n }",
"function moveToOrigin() {\n if (visible) {\n ctx.translate(-((width / 2) - x(viewCenter.x)), -(-y(viewCenter.y) + (height / 2)));\n }\n }",
"function setOrigin(ctx, axis) {... | [
"0.6963244",
"0.68701035",
"0.67081255",
"0.65162814",
"0.6457855",
"0.6382377",
"0.6355766",
"0.6334865",
"0.6326623",
"0.624805",
"0.6244178",
"0.622014",
"0.6214292",
"0.6188106",
"0.61551195",
"0.6151244",
"0.6120659",
"0.61107975",
"0.6072131",
"0.6060452",
"0.6059877",
... | 0.81728476 | 0 |
Iterates the current array value and yields a binder node for every item. | *[Symbol.iterator]() {
const array = this.valueOf();
const ItemModel = this[_ItemModel];
if (array.length !== this.itemModels.length) {
this.itemModels.length = array.length;
}
for (const i of array.keys()) {
let itemModel = this.itemModels[i];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"*[Symbol.iterator]() {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n yield node.value;\n }\n }",
"* values() {\n\t\tfor (const [, value] of this) {\n\t\t\tyield value;\n\t\t}\n\t}",
"*[Symbol.iterator]() {\n let values = this.values;\n ... | [
"0.59960055",
"0.59519696",
"0.5868421",
"0.5701254",
"0.5693932",
"0.5630378",
"0.5591889",
"0.557498",
"0.5558848",
"0.55200684",
"0.550839",
"0.5439565",
"0.5429936",
"0.53422356",
"0.5290209",
"0.52881205",
"0.52828795",
"0.52828795",
"0.5261787",
"0.52565503",
"0.5194202... | 0.7023833 | 0 |
create a function/fuctions that collects the form values appends the values to the list of Adjectives make sure that the adjective is clickable make sure the list of adjectives is updated when a word is clicked on/ removed | function myFunc(event) {
event.preventDefault()
let word = document.createElement("li")
word.textContent = form.field1.value;
words.appendChild(word)
//dynamic.textContent = form.field1.value;
let dynamicWords = document.querySelectorAll("li")
dynamicWords.forEach( word => {
word.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buttonListener()\n{\n event.preventDefault(); //do not reload\n\n //get all fields\n const myAdLib = document.getElementById( \"title_input\" ).value;\n const noun = document.getElementById( \"noun\" ).value;\n const verb = document.getElementById( \"verb\" ).value;\n const adjective = d... | [
"0.6291504",
"0.6167496",
"0.6037546",
"0.6015859",
"0.599327",
"0.5981399",
"0.59106576",
"0.5880307",
"0.58223295",
"0.57768416",
"0.57426405",
"0.5727314",
"0.572152",
"0.56488866",
"0.5647244",
"0.56373197",
"0.56308115",
"0.55923796",
"0.55520326",
"0.55425507",
"0.55364... | 0.63710004 | 0 |
Set the logging function to be called to write logs. Argument: logFunction Logging function | function setLogFunction(logFunction)
{
my.logFunction = logFunction
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setLog(log) {\n module.exports.log = typeof log === 'function' ? log : null;\n }",
"log(message) {\n this.loggingFunction(message);\n }",
"function log() {\n //log here\n }",
"function log()\n {\n if (my.logFunction == null)\n return\n\n var meta = ['... | [
"0.68975186",
"0.67589045",
"0.6642748",
"0.6397973",
"0.63949114",
"0.6261316",
"0.62445617",
"0.6176604",
"0.61177546",
"0.6078538",
"0.60657465",
"0.59924805",
"0.5958662",
"0.5945363",
"0.58728874",
"0.58673686",
"0.5862124",
"0.58538395",
"0.58296937",
"0.58278614",
"0.5... | 0.8587265 | 0 |
Write logs via a configured logging function. Arguments: key, value, ... An even number of string arguments | function log()
{
if (my.logFunction == null)
return
var meta = ['name', 'QuickQWERTY']
var data = Array.prototype.slice.call(arguments)
my.logFunction.apply(this, meta.concat(data))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i - 0] = arguments[_i];\n }\n if (!args.length) {\n return;\n }\n var id = args[0] + '';\n var fn = logMap[id];\n if (fn) {\n fn.apply(void 0, args.slice(1));\n }\n else {\... | [
"0.67879707",
"0.6533823",
"0.6361992",
"0.6361992",
"0.6291028",
"0.6206539",
"0.619093",
"0.61777097",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.61760527",
"0.... | 0.6722094 | 1 |
Return unit number m. Argument: m Unit number Return: Unit object | function unit(m)
{
if (alternateUnitAvailable(m) &&
my.settings.unit == my.UNIT.ALTERNATE) {
return Units.alternate[m - Units.alternateStart]
} else {
return Units.main[m - 1]
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function m(t, n, r) {\n return t.units[n][r];\n }",
"get unit () {\n\t\treturn this._unit;\n\t}",
"function calculateUnitValue(i) {\n\tif (getUnit(i) === \"in\") return 1;\n\telse if (getUnit(i) === \"cm\") return .3937;\n\telse return 0;\n}",
"get unit() {\n\t\treturn this.__unit;\n\t}",
"func... | [
"0.70042497",
"0.68661445",
"0.68420166",
"0.6795911",
"0.6646663",
"0.66201526",
"0.6605138",
"0.6602586",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6594072",
"0.6593717",
"0.65248364",
"0.65179926... | 0.78354245 | 0 |
Return true if an alternate unit is available for unit number m. Argument: m Unit number Return: true if an alternate unit is available; false otherwise | function alternateUnitAvailable(m)
{
if (m >= Units.alternateStart &&
m < Units.alternateStart + Units.alternate.length) {
return true
} else {
return false
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unit(m)\n {\n if (alternateUnitAvailable(m) &&\n my.settings.unit == my.UNIT.ALTERNATE) {\n return Units.alternate[m - Units.alternateStart]\n } else {\n return Units.main[m - 1]\n }\n }",
"metricTypeMatching (unitType, unitTypeTo) {\n switc... | [
"0.7132564",
"0.5845576",
"0.5764157",
"0.5596584",
"0.5589817",
"0.55570203",
"0.5511924",
"0.54607326",
"0.5388938",
"0.53454024",
"0.5287075",
"0.5208508",
"0.519486",
"0.51917964",
"0.5117975",
"0.50865567",
"0.50762963",
"0.5061085",
"0.5053876",
"0.50512236",
"0.5026597... | 0.8651971 | 0 |
Display the unit links | function displayUnitLinks()
{
// Delete all existing unit links
var linksDiv = my.html.unitLinks
Util.removeChildren(linksDiv)
// Create new unit links
for (var i = 0; i < Units.main.length; i++) {
var label = 'སློབ་མཚན། ' + (i + 1)
var selected = (i ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Cre... | [
"0.7937359",
"0.7711603",
"0.64367145",
"0.6167931",
"0.614548",
"0.61015666",
"0.60523754",
"0.5939187",
"0.5838429",
"0.5720863",
"0.56588864",
"0.55833983",
"0.55783045",
"0.5575401",
"0.55705994",
"0.5568032",
"0.55376863",
"0.55354947",
"0.5526451",
"0.5490971",
"0.54887... | 0.89430076 | 0 |
Create an HTML div element containing a label if the div element is specified as selected, and/or a hyperlink if the div element is specified as not selected. Arguments: label Label to be displayed inside the div element selected Whether the div element should be marked selected href Fragment identifier for the link to... | function boxedLink(label, selected, href, clickHandler)
{
var divElement = document.createElement('div')
if (selected) {
var spanElement = document.createElement('span')
Util.addChildren(spanElement, label)
divElement.appendChild(spanElement)
divElem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formAnchorHtml(href, label) {\r\n\treturn \"<div class='linkContainer'>\" + label + \": <a href='\" + href + \"' target='_blank'>\" + href + \"</a></div>\";\r\n}",
"function createLink(label,link){\n var newLink=$(\"<a>\", {\n title: label,\n href: link,\n class: ... | [
"0.6615223",
"0.60973525",
"0.5916459",
"0.58006585",
"0.55518717",
"0.5511999",
"0.5477806",
"0.5327929",
"0.5247053",
"0.52089906",
"0.5196766",
"0.51823187",
"0.51765573",
"0.51503855",
"0.5128251",
"0.5105734",
"0.5094164",
"0.5088068",
"0.5087811",
"0.5085603",
"0.507770... | 0.7782364 | 0 |
Return fragment identifier to be used in URL for the specified unit and subunit. Arguments: m Unit number (number) n Subunit number (number) Return value: Fragment identifier to be used in URL (string) | function unitHref(m, n)
{
if (typeof m == 'undefined') {
return ''
} else if (typeof n == 'undefined') {
return '#' + m
} else {
return '#' + m + '.' + n
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_fragment( url ) {\n return url.replace( re_fragment, '$2' );\n }",
"function updateUnitFromURL()\n {\n // Default lesson is Unit 1.1\n var unitNo = 1\n var subunitNo = 1\n\n // Parse the fragment identifier in the URL and determine the\n // unit\n if ... | [
"0.59477466",
"0.593649",
"0.5595272",
"0.5579261",
"0.5552435",
"0.5512202",
"0.5512202",
"0.5512202",
"0.5494468",
"0.5494468",
"0.5205885",
"0.51779586",
"0.51635396",
"0.511326",
"0.5038234",
"0.49963725",
"0.49533242",
"0.49533242",
"0.4853974",
"0.48509097",
"0.48320642... | 0.6636278 | 0 |
Process the current URL and perform appropriate tasks. This function is called automatically when the fragment identifier in the current URL changes. | function processURLChange()
{
switch(window.location.hash) {
case '#restart':
currentSubunit()
break
case '#previous':
previousSubunit()
break
case '#next':
nextSubunit()
br... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processURL() {\n\t\t\tlet urlParams = {};\n\t\t\t// Get URL params - split em up - loop over them - fill urlParams object\n\t\t\twindow.location.search\n\t\t\t\t.replace('?', '')\n\t\t\t\t.split('&')\n\t\t\t\t.forEach(chunks => {\n\t\t\t\t\tlet kv = chunks.split('=');\n\t\t\t\t\turlParams[kv[0]] = kv[1];\n\t\t\t\t... | [
"0.6454162",
"0.6398715",
"0.61943847",
"0.6142036",
"0.61398184",
"0.6094532",
"0.6076581",
"0.603019",
"0.5881091",
"0.5881091",
"0.58692473",
"0.58692473",
"0.58692473",
"0.58502096",
"0.5821408",
"0.5806132",
"0.5700259",
"0.56412446",
"0.5632201",
"0.5630265",
"0.5624022... | 0.67682683 | 0 |
Go to current subunit. | function currentSubunit()
{
var m = my.current.unitNo
var n = my.current.subunitNo
window.location.href = unitHref(m, n)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheLastSubunit()) {\n if (n == my.current.subunitTitles.length) {\n // If the user is at unit M.L where L is the last\n // subunit of unit ... | [
"0.7053677",
"0.6360854",
"0.6329819",
"0.60506517",
"0.59753084",
"0.5795796",
"0.57329166",
"0.570666",
"0.5690685",
"0.5668464",
"0.5607941",
"0.5563058",
"0.55586433",
"0.5523618",
"0.55072564",
"0.55072564",
"0.55072564",
"0.55072564",
"0.55072564",
"0.5503803",
"0.54995... | 0.75363404 | 0 |
Check if the current unit is the first subunit among all the subunits. Return: true if the current subunit is the first subunit; false otherwise | function currentSubunitIsTheFirstSubunit()
{
return my.current.unitNo == 1 && my.current.subunitNo == 1
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function currentSubunitIsTheLastSubunit()\n {\n return my.current.unitNo == Units.main.length &&\n my.current.subunitNo == my.current.subunitTitles.length\n }",
"function isFirstChild(subtree){\n var par = subtree.parent;\n if (par.children[0] === subtree) {\n return true;\n }\n}... | [
"0.6750091",
"0.59201705",
"0.5856817",
"0.56979275",
"0.5572986",
"0.5389489",
"0.52738553",
"0.5268939",
"0.5255774",
"0.5230735",
"0.5198978",
"0.5186373",
"0.51727164",
"0.51307213",
"0.51191735",
"0.51138365",
"0.5085178",
"0.5050002",
"0.50461066",
"0.5044285",
"0.50414... | 0.8978072 | 0 |
Check if the current subunit is the last subunit among all the subunits. Return: true if the current subunit is the last subunit; false otherwise | function currentSubunitIsTheLastSubunit()
{
return my.current.unitNo == Units.main.length &&
my.current.subunitNo == my.current.subunitTitles.length
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function currentSubunitIsTheFirstSubunit()\n {\n return my.current.unitNo == 1 && my.current.subunitNo == 1\n }",
"function isLast(idx) {\n const parent = inArr[idx][1];\n for (let i = idx + 1; i < inArr.length; i++) {\n if (inArr[i][1] === parent) {\n return false;\n ... | [
"0.7374074",
"0.6813333",
"0.6345423",
"0.634049",
"0.62572867",
"0.61544603",
"0.60059303",
"0.5926182",
"0.58705175",
"0.57863706",
"0.5739082",
"0.5722547",
"0.56428087",
"0.56001955",
"0.5597021",
"0.55936736",
"0.5565375",
"0.5556319",
"0.5512312",
"0.53971046",
"0.53872... | 0.8845541 | 0 |
Go to previous subunit. Do nothing if the user is already at the first subunit of the first unit. | function previousSubunit()
{
var m = my.current.unitNo
var n = my.current.subunitNo
if (!currentSubunitIsTheFirstSubunit()) {
if (n == 1) {
// If the user is at unit M.1, go to unit (M - 1).L
// where L is the last subunit of the previous unit.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gotoPrevious() {\n\tif(typeof previousInventory !== 'undefined') {\n\t\tnextInventory = currentInventory;\n\t\tcurrentInventory = previousInventory;\n\t\tpreviousInventory = undefined;\n\t}\n}",
"function nextSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n ... | [
"0.6854732",
"0.6815929",
"0.658525",
"0.64508104",
"0.640415",
"0.63642716",
"0.63620764",
"0.63244075",
"0.63183886",
"0.62671536",
"0.62564474",
"0.6256289",
"0.62429714",
"0.6223968",
"0.62040365",
"0.61888427",
"0.6183852",
"0.61303896",
"0.6111446",
"0.60822654",
"0.608... | 0.8497916 | 0 |
Go to next subunit. Do nothing if the user is already at the last subunit of the last unit. | function nextSubunit()
{
var m = my.current.unitNo
var n = my.current.subunitNo
if (!currentSubunitIsTheLastSubunit()) {
if (n == my.current.subunitTitles.length) {
// If the user is at unit M.L where L is the last
// subunit of unit M, then go to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function previousSubunit()\n {\n var m = my.current.unitNo\n var n = my.current.subunitNo\n\n if (!currentSubunitIsTheFirstSubunit()) {\n if (n == 1) {\n // If the user is at unit M.1, go to unit (M - 1).L\n // where L is the last subunit of the prev... | [
"0.7028668",
"0.6967198",
"0.6539519",
"0.6401484",
"0.5965367",
"0.5732943",
"0.5724467",
"0.5700484",
"0.5699314",
"0.5635313",
"0.5633174",
"0.55105114",
"0.545854",
"0.54373163",
"0.54054415",
"0.5392803",
"0.5353802",
"0.53360796",
"0.53306997",
"0.53289",
"0.53122544",
... | 0.8740801 | 0 |
Parse the current URL and determine the current unit and subunit numbers, and display the determined subunit. The fragment identifier in the URL may contain the current unit and subunit numbers in m.n format where m is the current unit number and n is the current subunit number. If the fragment identifier is absent, th... | function updateUnitFromURL()
{
// Default lesson is Unit 1.1
var unitNo = 1
var subunitNo = 1
// Parse the fragment identifier in the URL and determine the
// unit
if (window.location.hash.length > 0) {
var fragmentID = window.location.hash.slice(1)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processURLChange()\n {\n switch(window.location.hash) {\n\n case '#restart':\n currentSubunit()\n break\n\n case '#previous':\n previousSubunit()\n break\n\n case '#next':\n nextSubunit()\... | [
"0.57399017",
"0.55339396",
"0.55089235",
"0.5478526",
"0.5245436",
"0.52014214",
"0.51806206",
"0.51796454",
"0.51796454",
"0.51796454",
"0.51796454",
"0.5109641",
"0.5109641",
"0.51018316",
"0.5095522",
"0.5089784",
"0.5089784",
"0.5089784",
"0.50066376",
"0.49780166",
"0.4... | 0.7518052 | 0 |
Update the visibility of the navigation links to the previous and the next subunits. Hide the link to the previous subunit when the user is at the first subunit. Hide the link to the next subunit when the user is already at the last subunit. Display both links otherwise. | function updateNavigationLinks()
{
if (currentSubunitIsTheFirstSubunit()) {
my.html.previousLink.style.visibility = 'hidden'
my.html.nextLink.style.visibility = 'visible'
} else if (currentSubunitIsTheLastSubunit()) {
my.html.previousLink.style.visibility = 'visib... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySubunitLinks()\n {\n // Delete all existing subunit links\n var linksDiv = my.html.subunitLinks\n while (linksDiv.firstChild &&\n linksDiv.firstChild.className != 'stretch') {\n\n linksDiv.removeChild(linksDiv.firstChild)\n }\n\n // Cre... | [
"0.6815112",
"0.6497733",
"0.6421594",
"0.63802665",
"0.6369621",
"0.6159566",
"0.59982234",
"0.5988072",
"0.5962577",
"0.5941914",
"0.59193903",
"0.57708377",
"0.5681644",
"0.56591916",
"0.5647338",
"0.5598288",
"0.55446005",
"0.5538505",
"0.5519809",
"0.5513127",
"0.5512945... | 0.8930255 | 0 |
Display the number of characters in the current lesson as a tooltip for progress bar and progress percent. | function updateProgressTooltip()
{
my.html.progress.title =
'This lesson contains ' + my.current.subunitText.length +
' characters.'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getText()\n\t{\n\t\tif (that.showUsed)\n\t\t\treturn \"Tries used: \" + that.current;\n\t\telse\n\t\t\treturn \"Tries left: \" + (that.maximum - that.current);\n\t}",
"function progressCounter() {\n return document.getElementById(\"counter\").innerHTML =\n `Score: ${questionCount}/12`;\n}",
... | [
"0.63974106",
"0.63857794",
"0.6294473",
"0.608395",
"0.60486114",
"0.60395604",
"0.60382754",
"0.6016912",
"0.6004261",
"0.5978744",
"0.59687585",
"0.5904694",
"0.589417",
"0.5893446",
"0.5883062",
"0.58821046",
"0.5881417",
"0.58747065",
"0.5828251",
"0.5799645",
"0.5796174... | 0.7974769 | 0 |
Display alternate unit links for units which alternate units are available. Display nothing otherwise. | function displayAlternateUnitLinks()
{
// If alternate unit is not available for the current unit,
// hide the alternate links element
if (!alternateUnitAvailable(my.current.unitNo)) {
alternateUnitLinks.style.visibility = 'hidden'
return
}
// Delete ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayUnitLinks()\n {\n // Delete all existing unit links\n var linksDiv = my.html.unitLinks\n Util.removeChildren(linksDiv)\n\n // Create new unit links\n for (var i = 0; i < Units.main.length; i++) {\n var label = 'སློབ་མཚན། ' + (i + 1)\n var ... | [
"0.77809185",
"0.7369583",
"0.58161587",
"0.5763911",
"0.56235474",
"0.55743605",
"0.54173905",
"0.51850575",
"0.5181195",
"0.51405776",
"0.5051855",
"0.49769798",
"0.4955198",
"0.49350837",
"0.48927215",
"0.4863896",
"0.48422644",
"0.4814439",
"0.48136592",
"0.48125017",
"0.... | 0.8933749 | 0 |
Toggle between main unit and alternate unit | function toggleUnit()
{
var newUnit
var confirmMessage
if (my.settings.unit == my.UNIT.MAIN) {
newUnit = my.UNIT.ALTERNATE
confirmMessage = Units.alternateConfirmMessage
} else {
newUnit = my.UNIT.MAIN
confirmMessage = Units.mainConfir... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toggle(){this.off=!this.off}",
"toggle4() {\r\n }",
"doClick( evt ) {\n if( evt.altKey ) {\n let alternate = new CustomEvent( Thermometer.ALTERNATE, {\n detail: {\n status: this.status()\n }\n } );\n this.root.dispatchEvent( alternate );\n } else {\n // Toggl... | [
"0.6337465",
"0.63069147",
"0.62731224",
"0.6251226",
"0.6235556",
"0.6194663",
"0.6177884",
"0.6143803",
"0.608878",
"0.6079503",
"0.6077901",
"0.602295",
"0.5992622",
"0.59773976",
"0.5958581",
"0.5950306",
"0.5947523",
"0.5947133",
"0.59378153",
"0.59265465",
"0.5925762",
... | 0.72000253 | 0 |
Reset the state of the current subunit. The following activities are performed while resetting the state of the current subunit. 1. Set the state of the tutor to READY. 2. Set the number of errors made to 0. 3. Clear the input textarea element. | function resetSubunit()
{
my.current.state = my.STATE.READY
my.current.errors = 0
my.html.input.value = ''
log('state', my.current.state.toUpperCase(),
'unit', my.current.unitNo + '.' + my.current.subunitNo,
'type', my.settings.unit)
updatePracticePa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset() {\n\tstate.questionCounter = 0;\n\tstate.score = 0;\n\tstate.questions = [\n\t\t{\n\t\t\tid: 0,\n\t\t\tpregunta: 'Ets un/a Vilafranquí/ina de Tota la Vida? Prova el test!',\n\t\t\trespostes: [],\n\t\t\tcorrecte: null,\n\t\t},\n\t];\n\tstate.collectedAnswers = [];\n\tstate.comodinsLeft = state.como... | [
"0.643484",
"0.6290009",
"0.6285774",
"0.6202145",
"0.62011844",
"0.61792785",
"0.6145059",
"0.6135676",
"0.6133065",
"0.6085142",
"0.60610527",
"0.6059029",
"0.599889",
"0.5981631",
"0.59789747",
"0.5977937",
"0.5974269",
"0.5968152",
"0.5956023",
"0.59373504",
"0.59372663",... | 0.88482547 | 0 |
Set the tutor properties for the specified unit and subunit numbers. Arguments: m Unit number n Subunit number | function setSubunit(m, n)
{
my.current.unitNo = m
my.current.subunitNo = n
my.current.unit = unit(m)
my.current.subunitTitles.length = 0
for (var subunitTitle in my.current.unit.subunits) {
my.current.subunitTitles.push(subunitTitle)
}
var subun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setUnits() {\n this.units = unitSystem.getUnits();\n }",
"function setUnitInfoInfo(stroption) {\n UnitInfo = stroption;\n}",
"function setTerreainUniformVariables() {\n // Terrain uniform variables\n terrainDeferred.bindTexToUnit(\"tex_Color\", terrain_diffuse, 0);\n terrainDeferred... | [
"0.54758155",
"0.52496386",
"0.49302256",
"0.49276233",
"0.49223965",
"0.49028546",
"0.49028546",
"0.4879682",
"0.48509598",
"0.4790742",
"0.47573644",
"0.4746591",
"0.46574658",
"0.46320707",
"0.45933446",
"0.45891666",
"0.4576543",
"0.45003316",
"0.44828627",
"0.4465418",
"... | 0.75769377 | 0 |
Display the subunit links for the current unit. | function displaySubunitLinks()
{
// Delete all existing subunit links
var linksDiv = my.html.subunitLinks
while (linksDiv.firstChild &&
linksDiv.firstChild.className != 'stretch') {
linksDiv.removeChild(linksDiv.firstChild)
}
// Create new subunit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayUnitLinks()\n {\n // Delete all existing unit links\n var linksDiv = my.html.unitLinks\n Util.removeChildren(linksDiv)\n\n // Create new unit links\n for (var i = 0; i < Units.main.length; i++) {\n var label = 'སློབ་མཚན། ' + (i + 1)\n var ... | [
"0.7663342",
"0.68255967",
"0.68116045",
"0.6465879",
"0.6303267",
"0.6192426",
"0.61063194",
"0.5817894",
"0.55888015",
"0.5503396",
"0.54560477",
"0.54035646",
"0.5357568",
"0.5330761",
"0.5311307",
"0.5309545",
"0.5302293",
"0.5295641",
"0.528613",
"0.5247997",
"0.52389777... | 0.86291367 | 0 |
Display title for the current unit. | function displayUnitTitle() {
// Parts of the unit title
var unitNo = 'སློབ་མཚན། ' + my.current.unitNo +
'.' + my.current.subunitNo
var space = '\u00a0\u00a0'
var title = '[' + my.current.unit.title + ']'
Util.setChildren(my.html.unitTitle, unitNo, space, t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"title() { return this.owner.name + \" - \" + this.label.replace('\\n', ' ') }",
"showTitle() {\n this.log(_consts.SEPARATOR);\n\n if (!this.options.title) {\n const title = `${_consts.GENERATOR_NAME} v${_package.version}`;\n const subTitle = 'Add hook to existing API';\n ... | [
"0.69369173",
"0.6902636",
"0.6851144",
"0.68014085",
"0.67773896",
"0.6727385",
"0.6676678",
"0.6635912",
"0.64873755",
"0.6485262",
"0.6455869",
"0.6447169",
"0.6438482",
"0.64255977",
"0.64178836",
"0.6412323",
"0.64063",
"0.6403999",
"0.6394279",
"0.6350035",
"0.6350035",... | 0.8794409 | 0 |
Display guide for the current unit. | function displayGuide() {
my.html.guide.innerHTML = my.current.unit.guide
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateDisplayString() {\n this.displayString = 'Increase ' + this.name + ' by ' + this.value + ' ' + this.measuringUnit;\n }",
"function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' in... | [
"0.59519535",
"0.5727213",
"0.559132",
"0.5571523",
"0.55665183",
"0.5551647",
"0.55430514",
"0.55373716",
"0.55318224",
"0.5527445",
"0.55033475",
"0.55029726",
"0.54797006",
"0.5464949",
"0.5432987",
"0.5432799",
"0.54291075",
"0.5413121",
"0.54024214",
"0.5394989",
"0.5379... | 0.8241103 | 0 |
Set the target text to be typed. The target text consits of three parts: 1. Prefix 2. Target character 3. Suffix The target character is the character the user should type to move ahead in the subunit. The prefix and the suffix offer some context around the target character to be typed. These three parts combined, in t... | function setTargetText() {
// The target text should display at least one character
var targetLength = Settings.TARGET_TEXT_LENGTH
if (targetLength < 1) {
targetLength = 1
}
// Length of the target text should be odd as equal number of
// characters should b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayTargetText()\n {\n // Create target character element\n var targetCharElement = document.createElement('span')\n var targetChar = document.createTextNode(my.current.targetChar)\n targetCharElement.className = 'targetChar'\n targetCharElement.appendChild(targetC... | [
"0.60048664",
"0.5775657",
"0.56695825",
"0.56505764",
"0.55948794",
"0.5434984",
"0.5434984",
"0.5361348",
"0.5334576",
"0.52660495",
"0.518258",
"0.5154124",
"0.51522535",
"0.51208586",
"0.51101273",
"0.5055028",
"0.5045333",
"0.50254977",
"0.5013132",
"0.5006947",
"0.49945... | 0.83831364 | 0 |
Display the current target text | function displayTargetText()
{
// Create target character element
var targetCharElement = document.createElement('span')
var targetChar = document.createTextNode(my.current.targetChar)
targetCharElement.className = 'targetChar'
targetCharElement.appendChild(targetChar)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayTarget(){\n findTarget();\n if(isPlaying===true){\n $('#target-letter').text(\"'\" + targetLet + \"'\");\n }\n}",
"function setTargetText() {\n\n // The target text should display at least one character\n var targetLength = Settings.TARGET_TEXT_LENGTH\n if (ta... | [
"0.7295878",
"0.7170134",
"0.68684554",
"0.6815694",
"0.66996807",
"0.6583383",
"0.6583383",
"0.64378256",
"0.6414652",
"0.6315669",
"0.62590045",
"0.6213346",
"0.6204112",
"0.6199924",
"0.61949795",
"0.61788446",
"0.61720175",
"0.61701274",
"0.6166431",
"0.61591864",
"0.6146... | 0.86897904 | 0 |
Update practice pane after evaluating the user's input. The input typed by the user is evaluated for correctness and then the practice pane is updated. | function updatePracticePane()
{
evaluateInput()
setTargetText()
displayTargetText()
updateProgress()
updateSpeed()
updateError()
updateSmiley()
if (my.current.state == my.STATE.COMPLETED) {
displayAdvice()
setResultTooltips()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function evaluateInput()\n {\n var inputText = my.html.input.value\n var inputLength = inputText.length\n\n // If the tutor is in READY state, and input has been entered,\n // then set it to RUNNING STATE.\n if (my.current.state == my.STATE.READY && inputLength > 0) {\n\n ... | [
"0.72625816",
"0.67071354",
"0.5888808",
"0.5870281",
"0.5828073",
"0.5824714",
"0.58144224",
"0.5802231",
"0.577422",
"0.56987923",
"0.56887746",
"0.56745684",
"0.56663615",
"0.5627791",
"0.5627436",
"0.5613489",
"0.55984586",
"0.55934066",
"0.5570111",
"0.5563535",
"0.55629... | 0.770059 | 0 |
Evaluate the input typed by the user and change the practice panel state if necessary. | function evaluateInput()
{
var inputText = my.html.input.value
var inputLength = inputText.length
// If the tutor is in READY state, and input has been entered,
// then set it to RUNNING STATE.
if (my.current.state == my.STATE.READY && inputLength > 0) {
my.curr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePracticePane()\n {\n evaluateInput()\n setTargetText()\n displayTargetText()\n updateProgress()\n updateSpeed()\n updateError()\n updateSmiley()\n\n if (my.current.state == my.STATE.COMPLETED) {\n displayAdvice()\n setR... | [
"0.6807743",
"0.669007",
"0.63524586",
"0.6127466",
"0.60732496",
"0.5969236",
"0.58497804",
"0.58126897",
"0.58098054",
"0.5806892",
"0.57868755",
"0.5749469",
"0.5738369",
"0.56831956",
"0.5662569",
"0.5647252",
"0.56438404",
"0.56296617",
"0.56276786",
"0.5623167",
"0.5600... | 0.79498196 | 0 |
Update the state of the practice pane according to the current state of the unit. | function updatePracticePaneState()
{
switch (my.current.state) {
case my.STATE.READY:
my.html.practicePane.className = ''
my.html.input.disabled = false
my.html.input.focus()
Util.setChildren(my.html.status, 'READY')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePracticePane()\n {\n evaluateInput()\n setTargetText()\n displayTargetText()\n updateProgress()\n updateSpeed()\n updateError()\n updateSmiley()\n\n if (my.current.state == my.STATE.COMPLETED) {\n displayAdvice()\n setR... | [
"0.8052318",
"0.57588446",
"0.5743218",
"0.56928384",
"0.5668989",
"0.5660109",
"0.55661553",
"0.55559504",
"0.5511542",
"0.55113316",
"0.5503733",
"0.5496617",
"0.5492996",
"0.546254",
"0.54377234",
"0.5434156",
"0.54306704",
"0.54262424",
"0.5418253",
"0.5390242",
"0.538537... | 0.7647987 | 1 |
Update the typing speed. | function updateSpeed()
{
// WPM and CPM does not need to be calculated on error
if (my.current.state == my.STATE.ERROR) {
return
}
var goodChars = my.current.correctInputLength
// Determine the time elapsed since the user began typing
var currentTime = n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTyping () {\n if (connected) {\n if (!typing) {\n typing = true;\n socket.emit('typing', {\n target: target,\n });\n }\n lastTypingTime = (new Date()).getTime();\n\n setTimeout(function () {\n var typingTimer = (new Date()).getTime();\n ... | [
"0.7157912",
"0.7022486",
"0.7008835",
"0.69932204",
"0.69932204",
"0.69932204",
"0.69932204",
"0.69932204",
"0.6932238",
"0.66575783",
"0.6471192",
"0.6457088",
"0.6453484",
"0.6439646",
"0.6439646",
"0.6439646",
"0.6439646",
"0.6439646",
"0.6437958",
"0.6437958",
"0.6437958... | 0.7838378 | 0 |
Update the error rate. | function updateError()
{
var goodChars = my.current.correctInputLength
var errorRate
var errorRateTooltip
var accuracyTooltip
// Update error rate
if (my.current.errorRate == Number.POSITIVE_INFINITY) {
errorRate = '\u221e'
} else {
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static set updateRate(value) {}",
"updateLearningRate() {\n /* history must have more than 2 values */\n if (this.mseHistory.length < 2) {\n return;\n }\n /* MSE went up = bad update then devide by 2*/\n if (this.mseHistory[0] > this.mseHistory[1]) {\n ... | [
"0.68976146",
"0.6777766",
"0.612367",
"0.59151495",
"0.590682",
"0.5859789",
"0.57602364",
"0.56785697",
"0.5597232",
"0.55769384",
"0.55600226",
"0.548091",
"0.54773706",
"0.5463604",
"0.5435289",
"0.5433369",
"0.5412823",
"0.5403989",
"0.53394127",
"0.5322566",
"0.53169334... | 0.7552104 | 0 |
Update the smiley to reflect the user's performance. | function updateSmiley()
{
var errorRate = Math.round(my.current.errorRate)
var smiley
if (errorRate == 0) {
if (my.current.wpm >= 40) {
smiley = my.SMILEY.VERY_HAPPY
} else {
smiley = my.SMILEY.HAPPY
}
} else if (er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateEmoji(){\r\n if(this.rating < .2){\r\n this.emoji = \"media/verysad.png\"; \r\n }\r\n else if(this.rating < .4){\r\n this.emoji = \"media/sad.png\"; \r\n }\r\n else if(this.rating < .6){\r\n this.emoji = \... | [
"0.6357531",
"0.6007764",
"0.58803296",
"0.58789414",
"0.5813852",
"0.5813852",
"0.5776564",
"0.5775895",
"0.57672244",
"0.5700112",
"0.56986904",
"0.56731766",
"0.56420135",
"0.5633069",
"0.5606887",
"0.55965483",
"0.5571476",
"0.5565529",
"0.55529016",
"0.5541287",
"0.55394... | 0.78108287 | 0 |
Clear the tooltips in the result pane. | function clearResultTooltips()
{
my.html.speed.title = ''
my.html.error.title = ''
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear_tooltip() {\n\t$(\"#tooltip_container\").empty()\n\t$(\"#tooltip_container\").hide()\n}",
"function hideTooltips() {\n\t\t\t\t\ttooltipObject.remove();\n\t\t\t\t}",
"removeAllTooltips() {\n if (!this.activeToolTips?.length) {\n return;\n }\n for (let i = this.activeToolTips.length ... | [
"0.72888374",
"0.7272986",
"0.71922415",
"0.70528156",
"0.7044061",
"0.6836587",
"0.6780974",
"0.6755042",
"0.67468494",
"0.6684047",
"0.6585681",
"0.65823495",
"0.6580139",
"0.6493192",
"0.6448353",
"0.6445565",
"0.6445071",
"0.6443478",
"0.64297915",
"0.6418842",
"0.6394975... | 0.8378526 | 0 |
Set the tooltips in the result pane. | function setResultTooltips()
{
var textLength = my.current.subunitText.length
var charNoun = textLength == 1 ? 'character' : 'characters'
// Speed tooltip
my.html.speed.title =
'You have typed ' + textLength + ' ' + charNoun +
' in\n' +
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }",
"set tooltip(value) {}",
"function initializeTooltips() {\n // Download document link\n $('.download-document').tooltip({\n 'show': true,\n ... | [
"0.7334321",
"0.73147136",
"0.6849508",
"0.68288565",
"0.67945063",
"0.65687245",
"0.65527654",
"0.6503227",
"0.6503227",
"0.6503227",
"0.6503227",
"0.64765465",
"0.6445026",
"0.64272773",
"0.6391714",
"0.6388349",
"0.63838303",
"0.63723147",
"0.6370157",
"0.63505405",
"0.635... | 0.753394 | 0 |
Process command entered by the user in the input textarea element when the tutor is in error state. Once the tutor enters the error state, the supported commands are searched at the end of the erroneous input. If a supported command is found at the end of the erroneous input, the command is processed. The following is ... | function processInputCommand()
{
var inputText = my.html.input.value
var goodChars = my.current.correctInputLength
if (inputCommandIs('restart') || inputCommandIs('rst')) {
location.href = '#restart'
} else if (inputCommandIs('fix') || inputCommandIs('xxx')){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleError(command, index, error) {\n // Record the reason for the command failure.\n if (command.func.name === 'throwError') {\n historyItem[index].status = 'Unrecognized';\n }\n else if (failHard) {\n historyItem[index].status = 'Skipped';\n }\n else {\n ... | [
"0.5959118",
"0.58217865",
"0.58019996",
"0.5768349",
"0.5623921",
"0.55826753",
"0.552547",
"0.54393476",
"0.5423634",
"0.5421429",
"0.5404077",
"0.5386142",
"0.537462",
"0.5317956",
"0.53178096",
"0.5307177",
"0.52626866",
"0.52485746",
"0.5248293",
"0.52112913",
"0.5206284... | 0.67122287 | 0 |
Check if the input entered by the user contains the specified command. The specified command is considered to be contained in the input if the input ends with the specified command. Return: true if the specified command is present in the input; false otherwise | function inputCommandIs(command)
{
var input = my.html.input.value
return input.substring(input.length - command.length) == command
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasCmd(cmd) {\n return this.parsed._.includes(cmd.name);\n }",
"function checkIfValidCommand(command) {\n\n var valid_commands = /df|mf|al[0-9]+|ar[0-9]|none+/i;\n\n if (valid_commands.test(command)) {\n return true;\n } else {\n console.log(\"Unknown command: \" + command);\n r... | [
"0.7033517",
"0.6786447",
"0.6714409",
"0.65853816",
"0.6538311",
"0.650227",
"0.63899565",
"0.6280926",
"0.6191514",
"0.60680556",
"0.6061942",
"0.60344607",
"0.6002469",
"0.5984184",
"0.5972817",
"0.5945315",
"0.59247154",
"0.58821195",
"0.5809269",
"0.57636255",
"0.5706619... | 0.80050147 | 0 |
Create an HTML element to display a pink heart and add it to the HTML page. Return: HTML element with containing the heart | function createHeart()
{
var span = document.createElement('span')
span.style.position = 'absolute'
span.style.color = '#f52887'
span.style.opacity = '0'
Util.addChildren(span, '\u2665')
document.body.appendChild(span)
return span
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function heartHeartHeart() {\r\n document.body.appendChild(heartsHome);\r\n heartBlock(); \r\n }",
"function createHeart(color) {\r\n const heart = document.createElement(\"div\");\r\n heart.className = \"heart\";\r\n heartsHome.appendChild(hea... | [
"0.76339394",
"0.742686",
"0.6561861",
"0.6505662",
"0.6476186",
"0.6309439",
"0.62926173",
"0.6253584",
"0.62520117",
"0.6244221",
"0.62009877",
"0.6122166",
"0.6114754",
"0.60292",
"0.6018961",
"0.59802157",
"0.59791756",
"0.58925426",
"0.58808786",
"0.581332",
"0.5811368",... | 0.8188092 | 0 |
Display growing hearts all over the page. | function growingHearts()
{
var ox = 0
var oy = 80
var w = document.body.clientWidth - ox - 200
var h = document.body.clientHeight - oy - 200
var newInterval = Util.random(200, 2000)
window.setInterval(function()
{
var heart = createHeart()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function risingHearts()\n {\n var ox = 0\n var oy = 80\n\n var w = document.body.clientWidth - ox - 200\n var h = document.body.clientHeight - oy - 200\n\n var newInterval = Util.random(200, 2000)\n\n window.setInterval(function()\n {\n var x = Util.ra... | [
"0.7028781",
"0.69954866",
"0.6911459",
"0.67804664",
"0.66451013",
"0.66191816",
"0.65603215",
"0.6518552",
"0.6307231",
"0.6275858",
"0.62382776",
"0.61654353",
"0.61185664",
"0.60795075",
"0.6067219",
"0.59611285",
"0.5948496",
"0.59225917",
"0.591076",
"0.58987635",
"0.58... | 0.7471282 | 0 |
Display hearts rising across the page | function risingHearts()
{
var ox = 0
var oy = 80
var w = document.body.clientWidth - ox - 200
var h = document.body.clientHeight - oy - 200
var newInterval = Util.random(200, 2000)
window.setInterval(function()
{
var x = Util.random(ox, ox + w)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countHearts() {\n\t\t$(\"#hearts\").html(\"\");\n\t\tfor (let i = 0; i < fullHearts; i++) {\n\t\t\t$(\"#hearts\").append('#');\n\t\t}\n\t\tfor (let j = 0; j < emptyHearts; j++) {\n\t\t\t$(\"#hearts\").append('*');\n\t\t}\n\n\t}",
"function hearts() {\n ctx.font = \"20px Times New Roman\";\n //number o... | [
"0.68376845",
"0.6826211",
"0.67068046",
"0.63591355",
"0.63379914",
"0.6292296",
"0.628281",
"0.6262421",
"0.61563504",
"0.60988206",
"0.60862625",
"0.6055171",
"0.60303503",
"0.602348",
"0.601556",
"0.5917671",
"0.5907442",
"0.5907421",
"0.5824928",
"0.5818143",
"0.5815627"... | 0.7237409 | 0 |
XXX: handle drafts in some other way. it's better to provide a control mechanism for filtering content based on metadata | draft() {
return require.context(
'json!yaml-frontmatter!./drafts',
false,
/^\.\/.*\.md$/
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n star... | [
"0.57377356",
"0.5270778",
"0.526762",
"0.5255141",
"0.5207966",
"0.51788485",
"0.51779246",
"0.51768345",
"0.5156462",
"0.5125829",
"0.5097602",
"0.506294",
"0.5008472",
"0.49900922",
"0.4970971",
"0.49272928",
"0.49175787",
"0.49066842",
"0.488469",
"0.48751068",
"0.4848656... | 0.53065634 | 1 |
Creates a new LibraryAtlas | function LibraryAtlas(uid, shapePadding) {
if (typeof shapePadding === "undefined") { shapePadding = 4; }
this.uid = uid;
this.shapePadding = shapePadding;
/**
* Contains the blocks used in the Binary Packing
* @type {Array}
*/
this.blocks = [];
Li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createLibrary(name) {\n var denverLibrary = {\n name: name,\n shelves: {\n fantasy: [],\n fiction: [],\n nonFiction: []\n }\n }\n return denverLibrary;\n}",
"function NewLibrary() {\n//this.property = value\n this.books = [];\n this.currentCallNumber = 0;\n}",
"async libra... | [
"0.64622486",
"0.5337491",
"0.5260609",
"0.525528",
"0.52491814",
"0.516564",
"0.51183516",
"0.5086852",
"0.506477",
"0.5023035",
"0.50163406",
"0.50099206",
"0.50010246",
"0.4973214",
"0.49606636",
"0.49443272",
"0.49343997",
"0.4902602",
"0.48722452",
"0.48701003",
"0.48535... | 0.66683453 | 0 |
This bit of disgustingness is to deal with a bug (28/11/2017) in the Twitch JS Helper. Normally you would call listen for the whisper channel inside onAuthorized when you get your opaque ID, however, calling twitch.listen inside onAuthorise causes the listen function to be registered more than one time for some reason.... | function whisperHack() {
if (!firstTimeOnly) {
// Listen to this viewer's private PubSub whisper channel
twitch.listen('whisper-'+latestAuth.userId, (target, type, msg) => {
// console.log("New Twitch PubSub whisper:", msg);
});
} else {
se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_registerExternalAuthListeners () {\n this.migration = caller('migration', {postMessage: window.parent.postMessage.bind(window.parent)})\n this.authenticate = caller('authenticate', {postMessage: window.parent.postMessage.bind(window.parent)})\n this.createLink = caller('createLink', {postMessage: window.... | [
"0.61958736",
"0.58636725",
"0.576607",
"0.57518506",
"0.5557802",
"0.5553211",
"0.5529361",
"0.5524213",
"0.55090606",
"0.54507405",
"0.5442383",
"0.5430207",
"0.5401749",
"0.5368009",
"0.5361097",
"0.53551096",
"0.53515387",
"0.53437555",
"0.5279312",
"0.5274094",
"0.527357... | 0.6062984 | 1 |
Worker that checks the sentiment of comments every 5 seconds | function startWorker(){
(function worker() {
var channel_id = getGlobalChannelName();
// console.log("channel_id", channel_id);
$.ajax({
type: "POST",
url: "https://chat-snitcher-ebs.herokuapp.com/collect_chat_analysis",
contentType: 'appl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function main(){\r\n const botSubmissions = await r.getUser('autolovepon').getSubmissions()\r\n botSubmissions.forEach(function(submission){\r\n parseThread(submission)\r\n\r\n //if pass certain comment threshold then pass to download function\r\n //or compare with a list of anime ... | [
"0.6835597",
"0.5810288",
"0.5720304",
"0.57178414",
"0.55585927",
"0.5508826",
"0.5481348",
"0.54404646",
"0.5433081",
"0.54156774",
"0.5384332",
"0.5373829",
"0.5351049",
"0.53434616",
"0.5324132",
"0.52862245",
"0.5258912",
"0.52586526",
"0.52499324",
"0.52377635",
"0.5236... | 0.59157854 | 1 |
Finds and selects the first option labelled 'isDefault' from the item object | getDefaultItemOption(item) {
item.options.some(option => (
option.isDefault ? !this.setState({
currentOption: option,
}) : false
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setDefaultSelectedOption() {\n var _a, _b;\n\n this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex(el => el.defaultSelected)) !== null && _b !== void 0 ? _b : -1;\n }",
"function select_default_menu_item()\r\n{\r\n\tmenu_item_selected(document.getElementById('m... | [
"0.66718537",
"0.6311194",
"0.6039267",
"0.6000806",
"0.5955329",
"0.59164506",
"0.5895007",
"0.58630586",
"0.57978356",
"0.5726508",
"0.5656774",
"0.56539035",
"0.5653307",
"0.5616319",
"0.5609541",
"0.5600866",
"0.55922085",
"0.55840874",
"0.55624026",
"0.55548036",
"0.5553... | 0.7483216 | 0 |
busca el valor de apertura (de la propiedad OPEN) de cada dia (propiedad DTYYYYMMDD)(el primer valor de apertura de cada dia) | function buscarAperturaDia(array) {
let day;
let arr = [];
for (let i = 0; i < array.length; i++) {
let date = array[i].DTYYYYMMDD;
if (day != date) {
day = date;
for (let j = 0; j < array.length; j++) {
if (array[j].DTYYYYMMDD === day) {
arr.push(array[j].OPEN);
br... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dadosDiaAtual(diasMonitorados) {\n\n\tvar posDiaAtual = diasMonitorados.length - 1;\n\tvar dadosDiaAtual = diasMonitorados[posDiaAtual];\n\n\treturn dadosDiaAtual;\n}",
"function diaClave(propie){\n\n\tfor(i=0; i< propie.length; i++){\n\t\tvar info = propie[i].properties;\t\n\n\t\tconst latitud = info.L... | [
"0.5676619",
"0.55443245",
"0.5450236",
"0.5415511",
"0.53871185",
"0.5380379",
"0.53533",
"0.53489166",
"0.5307834",
"0.53009665",
"0.52848023",
"0.52716637",
"0.52353776",
"0.5230704",
"0.5217601",
"0.5216233",
"0.5204208",
"0.51924366",
"0.5186632",
"0.5181951",
"0.5172368... | 0.58460104 | 0 |
busca el valor de maximo (de la propiedad HIGH) de cada dia (propiedad DTYYYYMMDD)(el valor de maximo de cada dia) | function buscarMaxDia(array) {
let day;
let arr = [];
for (let i = 0; i < array.length; i++) {
let date = array[i].DTYYYYMMDD;
if (day != date) {
day = date;
let res;
let contador = 0;
for (let j = 0; j < array.length; j++) {
if (array[j].DTYYYYMMDD === day) {
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMax() {\n var max = Math.max.apply(null, config.values);\n max += 10 - max % 10;\n return max;\n console.log(max);\n }",
"function setMax() {\n var cd = curDay();\n var input = document.getElementById('date');\n input.setAttribute(\"max\", this.value);\n i... | [
"0.68274987",
"0.67250717",
"0.66997606",
"0.6594341",
"0.65138334",
"0.65106434",
"0.64073956",
"0.6382986",
"0.6377778",
"0.6359372",
"0.63428384",
"0.6298422",
"0.6285514",
"0.6256145",
"0.6250908",
"0.6232988",
"0.6216029",
"0.62050897",
"0.6192077",
"0.6187974",
"0.61835... | 0.6782513 | 1 |
busca el valor de minimo (de la propiedad LOW) de cada dia (propiedad DTYYYYMMDD)(el valor de minimo de cada dia) | function buscarMinDia(array) {
let day;
let arr = [];
for (let i = 0; i < array.length; i++) {
let date = array[i].DTYYYYMMDD;
if (day != date) {
day = date;
let res;
let contador = 0;
for (let j = 0; j < array.length; j++) {
if (array[j].DTYYYYMMDD === day) {
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function milisegundosToMinutos(milisegundos) {\n let minutos = milisegundos / 60000\n return minutos\n}",
"function sumaDuracion(){\n \n var sumHrs = parseInt(0), sumMin = parseInt(0);\n var auxHrs = parseInt(0), auxMin = parseInt(0);\n var totalHrs = parseInt(0), totalMin, i=1, ni=0;\n \n ... | [
"0.6305875",
"0.6247586",
"0.61750144",
"0.60922945",
"0.6088371",
"0.6011467",
"0.5953956",
"0.59032714",
"0.58966565",
"0.5886316",
"0.58637834",
"0.5840592",
"0.5825569",
"0.5822594",
"0.58093446",
"0.58093446",
"0.58093446",
"0.58093446",
"0.58093446",
"0.58093446",
"0.58... | 0.6517961 | 0 |
Quits the application and installs the update. | quitAndInstall() {
setTimeout(() => {
this.autoUpdater.quitAndInstall()
}, 5000)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async scheduleInstallOnQuit() {\n this.restart = false;\n await this._rememberInstallAttempt();\n this._setupExitHook();\n }",
"function updateApplication() {\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\tvar updater = new air.Updater();\r\n\t\t\t\tupdater.update(newAppFile, currentVersion);\r\n\t\t... | [
"0.6529961",
"0.63500094",
"0.6310466",
"0.62678844",
"0.61116886",
"0.59876883",
"0.59263605",
"0.5832421",
"0.5810761",
"0.5805487",
"0.58005667",
"0.5796299",
"0.576113",
"0.5694946",
"0.56922966",
"0.55574274",
"0.5548117",
"0.552466",
"0.5483094",
"0.5480218",
"0.5464473... | 0.63585895 | 1 |
drag_util.js Utility functions for YUI darg and drop applications ///////////////////////////////////// Dependencies from YUI yahoomin.js dommin.js eventmin.js //////////////////// //////////////////////////// selectMultiple Event Handeler Uses Shift or Cmd/Ctrl click to select multiple items in a supplied container el... | function selectMultiple(ev, use_parent){
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
var dd = null;
var tar = Event.getTarget(ev);
if(use_parent){
tar = tar.parentNode;
}
var kids = tar.parentNode.getElementsByTagName(tar.tagName);
//Event.stopEvent(ev);
//If ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeMultipleSelectBoxMouseEvent($container) {\r\n\t\tvar $document = $(document);\r\n\t\t/* process container event */\r\n\t\t$container.bind(\"mousedown.\" + PLUGIN_NAMESPACE, function(e) {\r\n\t\t\t/* disable text selection */\r\n\t\t\te.preventDefault();\r\n\t\t\t/* starting row */\r\n\t\t\tvar t... | [
"0.64923054",
"0.64745873",
"0.6313913",
"0.62336046",
"0.5861946",
"0.5806698",
"0.57896096",
"0.5698621",
"0.5660796",
"0.56062526",
"0.55689436",
"0.5549231",
"0.5530512",
"0.55174196",
"0.549765",
"0.546832",
"0.5462681",
"0.5454696",
"0.5427804",
"0.5427804",
"0.5427804"... | 0.77628446 | 0 |
Returns an array of all the file paths currently in the virtual folder. | getAllPaths() {
return Object.keys(this[FILES]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllFilePaths() {\n \n //holds all the file paths being tracked by storyteller\n var allFilePaths = [];\n \n //go through each file/dir mapping\n for(var filePath in pathToIdMap) {\n if(pathToIdMap.hasOwnProperty(filePath)) {\n \n //if the file exists in th... | [
"0.66810745",
"0.62842715",
"0.61882734",
"0.6179658",
"0.6170243",
"0.61617494",
"0.6159305",
"0.6144904",
"0.61183137",
"0.61148167",
"0.6114717",
"0.6114136",
"0.611184",
"0.6051959",
"0.6038199",
"0.60099494",
"0.59697807",
"0.595084",
"0.5949616",
"0.59400827",
"0.593931... | 0.6898038 | 0 |
This is the key function or entry point to render a view route, model, callback | function viewRender(route, model, callback){
console.log("viewRender: %s", JSON.stringify(route));
var template = getTemplate(route);
loadController(route.controller, function(){
var ret = model;
if(!ret){
var handler = controllers[route.controller][route.action] || controllers[rou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"view() {\n // console.log('Render called');\n return this._view.renderView();\n }",
"render(){}",
"render(){}",
"function render() {\n var currentAction = $route.current.action || 'list';\n \n switch(currentAction) {\n case 'add': {\n publicMethods.create();\n } break;\n ... | [
"0.7086873",
"0.70798975",
"0.70798975",
"0.68738425",
"0.66272753",
"0.6625312",
"0.6625312",
"0.6625312",
"0.6560287",
"0.6489538",
"0.64632446",
"0.64632446",
"0.6427854",
"0.64211416",
"0.6405989",
"0.63958013",
"0.63621193",
"0.63380516",
"0.63336235",
"0.6321515",
"0.63... | 0.77995634 | 0 |
get argument names of a callback function. | function getParamNames(func) {
var fnStr = func.toString().replace(STRIP_COMMENTS, '')
var result = fnStr.slice(fnStr.indexOf('(')+1, fnStr.indexOf(')')).match(ARGUMENT_NAMES)
if(result === null)
result = []
return result
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function argumentNames(fn) {\n\t var names = fn.toString().match(/^[\\s\\(]*function[^(]*\\(([^)]*)\\)/)[1]\n\t .replace(/\\/\\/.*?[\\r\\n]|\\/\\*(?:.|[\\r\\n])*?\\*\\//g, '')\n\t .replace(/\\s+/g, '').split(',');\n\t return names.length == 1 && !names[0] ? [] : names;\n\t}",
"function argumentNames(f) {... | [
"0.75850946",
"0.6928508",
"0.6827934",
"0.6582613",
"0.63940877",
"0.6366113",
"0.6350676",
"0.60110426",
"0.59533465",
"0.58827436",
"0.5869651",
"0.58469486",
"0.58403456",
"0.58285767",
"0.5812033",
"0.57768273",
"0.57695436",
"0.5761976",
"0.5671639",
"0.5669627",
"0.565... | 0.6949597 | 1 |
return route object base on current url it should answer what is the controller, and the view. format for the hash controller/action?param1=value1¶m2=value2 | function getRoute(hash){
var hash = hash || window.location.hash.substring(1);
if(!hash) {
console.log("hash is not defined use defaultRoute: %s", JSON.stringify(defaultRoute));
return defaultRoute;
}
var i = hash.indexOf("?");
var path = paramStr = "";
var route = $.extend({... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRouteHelper(obj){\r\n var tmpRoute;\r\n if(typeof(obj)==\"string\"){\r\n tmpRoute = {action: obj, controller: currentControllerName};\r\n }\r\n else{\r\n tmpRoute = obj;\r\n }\r\n tmpRoute.getParams = $.extend({},tmpRoute.params);\r\n return $.extend({}, defaultRoute, tmp... | [
"0.69673014",
"0.65067947",
"0.6253531",
"0.6098924",
"0.6054433",
"0.5961769",
"0.5955426",
"0.59383893",
"0.59383893",
"0.59383893",
"0.5920788",
"0.5877686",
"0.5872621",
"0.5826042",
"0.5781528",
"0.5694709",
"0.5683778",
"0.56832606",
"0.5681354",
"0.56583095",
"0.564041... | 0.6940775 | 1 |
[END buttoncallback] Function used to return current user graduation status based on their user.email. | function returnGradStatus (email, emailVerified) {
if (emailVerified) {
// Email is verified.
// Get domain of email (note: if email is 'abc@abc'@example.com, then this next line won't work properly)
var domain = email.replace(/.*@/, ""); // Replaces everything up to and including the @ sy... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CheckStatus(){\n \n fire.auth().onAuthStateChanged(\n (user)=>{\n if (user) {\n setUserInfo(user.email)\n }\n }\n )\n }",
"function checkUserState() {\n var user = firebaseData.getUser();\n if (user) {\n // logged in - hide this\n document.ge... | [
"0.6206232",
"0.6147407",
"0.6083824",
"0.60828996",
"0.5799449",
"0.5774487",
"0.56727433",
"0.56727433",
"0.5600111",
"0.55664414",
"0.5553524",
"0.55490065",
"0.55338335",
"0.55041534",
"0.5503462",
"0.55018497",
"0.5495348",
"0.5492129",
"0.54843765",
"0.5479782",
"0.5477... | 0.634385 | 0 |
Esta funcion crea el cursor y setea los listeners | function createCursor() {
cursor = document.createElement("div");
cursor = document.createElement("div");
span = document.createElement("span");
title = document.queryCommandValue("h1");
cursor.classList.add("custom-cursor");
document.body.append(cursor);
setCursorListeners();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static SetCursor() {}",
"function createCursor() {\r\n cursorBar = document.createElement(\"div\");\r\n cursorBar.classList = [\"cursor-bar\"];\r\n\r\n checkCursorIntervalHandle = setInterval(function() {\r\n cursorImage = display_element.querySelector(\"#jspsych-a... | [
"0.7385312",
"0.6627222",
"0.66079",
"0.6439811",
"0.63694715",
"0.631824",
"0.6286023",
"0.6217564",
"0.6203469",
"0.6197986",
"0.61702645",
"0.6104216",
"0.60769176",
"0.604556",
"0.6027897",
"0.6027897",
"0.6000636",
"0.59923834",
"0.59831095",
"0.5976143",
"0.5970618",
... | 0.699894 | 1 |
Method to Cycle and Click Through Each Individual Movie Page | clickThrough() {
let movie = browser.elements('.datalayer-movie.ng-binding');
movie.value.forEach(function (element) {
element.click()
browser.back();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\... | [
"0.6419166",
"0.6275278",
"0.62354785",
"0.6154287",
"0.60783213",
"0.6074694",
"0.60680723",
"0.6021547",
"0.59701854",
"0.59179115",
"0.5917031",
"0.5912935",
"0.59110445",
"0.59108114",
"0.5867433",
"0.5818511",
"0.580864",
"0.5808399",
"0.57993436",
"0.57836354",
"0.57826... | 0.6516985 | 0 |
Convert a base64url encoded string to a base64 encoded string ``` > base64url.toBase64('qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA') 'qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==' ``` | function toBase64(base64url) {
// We this to be a string so we can do .replace on it. If it's
// already a string, this is a noop.
base64url = base64url.toString();
return padString(base64url)
.replace(/\-/g, "+")
.replace(/_/g, "/");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant",
"function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode... | [
"0.8253048",
"0.810408",
"0.8092335",
"0.8054918",
"0.8038858",
"0.8022879",
"0.7992094",
"0.7969552",
"0.7969552",
"0.7945164",
"0.7945164",
"0.79449964",
"0.79290575",
"0.79279673",
"0.7888982",
"0.78838384",
"0.7867639",
"0.7675953",
"0.7584292",
"0.7412218",
"0.7359118",
... | 0.8505418 | 0 |
Convert a base64url encoded string to a Buffer ``` > base64url.toBuffer('c3Bpcml0dWFsaXplZA') ``` | function toBuffer(base64url) {
return new Buffer(toBase64(base64url), "base64");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function base64ToBuffer(s) {\n var l = s.length * 6 / 8\n if(s[s.length - 2] == '=')\n l = l - 2\n else\n if(s[s.length - 1] == '=')\n l = l - 1\n\n var b = new Buffer(l)\n b.write(s, 'base64')\n return b\n}",
"function base64ToBuffer( str ) {\n\n\t\t\tvar b = atob( str );\n\t\t\tvar buf = new Uint8... | [
"0.7596794",
"0.7490258",
"0.71877104",
"0.68810594",
"0.6857738",
"0.6816563",
"0.6808298",
"0.6806062",
"0.6789498",
"0.6786183",
"0.6778464",
"0.677261",
"0.6742628",
"0.6730694",
"0.67012304",
"0.66876876",
"0.6680805",
"0.66783303",
"0.6665888",
"0.66353947",
"0.66345745... | 0.8812362 | 0 |
Further exploration Find the middle word of a phrase and take care of all edge cases | function middleWord(string) {
if (string.trim() !== '') {
let wordsArray = string.split(' ');
if (wordsArray.length % 2 === 1) {
return wordsArray[Math.floor(wordsArray.length / 2)];
} else {
return wordsArray[(wordsArray.length / 2) - 1] + ' ' + wordsArray[wordsArray.length / 2];
}
} e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findMiddle(word) {\n if (word.length % 2 === 0) {\n let mid1 = Math.floor(word.length / 2) - 1;\n let mid2 = mid1 + 1;\n return word[mid1] + word[mid2];\n } else {\n let mid = Math.floor(word.length / 2);\n return word[mid];\n }\n //console.log(s.length);\n //console.log(Math.ceil(s.le... | [
"0.7172398",
"0.68735045",
"0.6397718",
"0.6332119",
"0.63306844",
"0.63306844",
"0.63306844",
"0.63306844",
"0.62016183",
"0.6201138",
"0.6158012",
"0.61031693",
"0.6042598",
"0.60257244",
"0.60142297",
"0.5983992",
"0.59764767",
"0.5936545",
"0.5919664",
"0.5916847",
"0.591... | 0.6972745 | 1 |
Operating status and date of ceased operation cross check | function CrossCheck_operatingStatus_dateOfCeased (input1,input2){
var result = new Object();
var error;
result.flgname = [];
result.flgs = [];
result.flgvalue = [];
result.flgmsg = [];
result.pass = true;
if ((presence_check && ! presence_check(input2))||(!presence_check(input1) && presence_che... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CrossCheck_operatingStatus_dateOfCeased (input1,input2){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar test = {\r\n\t\t\"Ceased Operation \": input1,\r\n\t\t\"date of Ceased\" : input2\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.... | [
"0.64863586",
"0.5092882",
"0.5054814",
"0.4955838",
"0.49546498",
"0.49452978",
"0.48403302",
"0.4805371",
"0.48015884",
"0.4790848",
"0.4779167",
"0.4752892",
"0.47342303",
"0.47306263",
"0.47246015",
"0.4723393",
"0.47053486",
"0.47014406",
"0.47013104",
"0.4695447",
"0.46... | 0.6539003 | 0 |
Integration function for fax number of contact information | function contact_fax_number(input){
var result = new Object();
var error;
result.flgname = [];
result.flgs = [];
result.flgvalue = [];
result.flgmsg = [];
result.pass = true;
if (!check_allowed_char(input, "faxNum", "conf1")){
error = "E7_1"
result.flgname.push(flags[error].name);
resul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function contact_fax_number(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_1\"\r\n\t\tre... | [
"0.6103495",
"0.5506917",
"0.54916734",
"0.54750323",
"0.5413505",
"0.53329533",
"0.52630657",
"0.5251573",
"0.5194549",
"0.51921785",
"0.51061815",
"0.50646424",
"0.50291324",
"0.5021229",
"0.50026774",
"0.4974901",
"0.49386153",
"0.4937306",
"0.4931722",
"0.49151254",
"0.48... | 0.61291915 | 0 |
Manage or unmanage a user corresponding the the button clicked | function manage_click(ev) {
let btn = $(ev.target);
let manage_id = btn.data('manage');
let user_id = btn.data('user-id');
if (manage_id != "") {
unmanage(user_id, manage_id);
}
else {
manage(user_id);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_button(user_id, value) {\n $('.manage-button').each( (_, bb) => {\n if (user_id == $(bb).data('user-id')) {\n $(bb).data('manage', value);\n }\n });\n update_buttons();\n}",
"_handleButtonAddAdmin()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_ADD_USER_A... | [
"0.6860396",
"0.6796665",
"0.67126906",
"0.6608286",
"0.6574718",
"0.6490629",
"0.64260656",
"0.6401233",
"0.6337171",
"0.6303121",
"0.6264086",
"0.62334836",
"0.6207008",
"0.618509",
"0.61143035",
"0.60488296",
"0.60316664",
"0.6026643",
"0.60264945",
"0.6025551",
"0.6013679... | 0.73570883 | 0 |
Initialize the click function for each manage button and update the button text | function init_manage() {
if (!$('.manage-button')) {
return;
}
$(".manage-button").click(manage_click);
update_buttons();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_buttons() {\n $('.manage-button').each( (_, bb) => {\n let user_id = $(bb).data('user-id');\n let manage = $(bb).data('manage');\n if (manage != \"\") {\n $(bb).text(\"Unmanage\");\n }\n else {\n $(bb).text(\"Manage\");\n }\n });\n}",
"function clickManage() {\n\t$.t... | [
"0.7035822",
"0.66758835",
"0.64078724",
"0.6397366",
"0.63584006",
"0.63528085",
"0.62530726",
"0.6239302",
"0.6207319",
"0.6185898",
"0.6181031",
"0.6173993",
"0.61525655",
"0.6131418",
"0.6096139",
"0.60945183",
"0.60889703",
"0.60612595",
"0.6057443",
"0.6047189",
"0.6040... | 0.7350768 | 0 |
Initialize sanitation processes to clean up sheets and instantiate properties | function init() {
resetScript();
if (!saveAndTestSheets()) // break if sheets invalid
return;
let pointsSheet = new PointsSheet().sheet;
let summarySheet = pointsSheet.getSheets()[0];
let membersRef = summarySheet.getRange(`${POINTS_FIELD.FIRST_NAME}3:${POINTS_FIELD.LAST_NAME}${summarySheet.getLastRow(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"newPropertiesSheet() {\n this.properties_sheet = new InstanceProperties(this.artefact)\n }",
"_initializeProperties() {}",
"newPropertiesSheet() {\n this.properties_sheet = new MysqlDatabaseSystemProperties(this.artefact)\n }",
"function initializeSpreadsheet() {\n var ui = SpreadsheetAp... | [
"0.560905",
"0.54945755",
"0.54502386",
"0.5349935",
"0.5338927",
"0.5281933",
"0.52564126",
"0.52491397",
"0.52102023",
"0.51928",
"0.5192077",
"0.5191688",
"0.51606315",
"0.51458764",
"0.5133424",
"0.5106165",
"0.50655323",
"0.50415117",
"0.5039748",
"0.5039748",
"0.5039748... | 0.55610746 | 1 |
base reader from the locally stored movie feed. / defaults to filter the movies by the rating of 3 or better / also accepts an array of genre ids to then filter the list from too | function setMovieListing(filters = "3", filter = "genre_ids"){
try{
let movies = localStorage.getItem("latestMovies") ? JSON.parse(localStorage.getItem("latestMovies")) : getLatestMovies();
let filteredMovies = movies; ///create a default object to start with
//Now see if we've passed in an Array to filte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFilteredMovies(filter, callback) {\n var options = {\n method: 'GET',\n endpoint:'movies5s',\n qs: {ql:\"\"}\n };\n // Build query from params specified\n if (filter.name != '') {\n if (options.qs.ql != \"\") // For multiple parameters\n options.qs.ql ... | [
"0.58723307",
"0.56935096",
"0.56881374",
"0.56881106",
"0.5616227",
"0.5546773",
"0.55130726",
"0.5501481",
"0.55011076",
"0.54993886",
"0.5485237",
"0.5466375",
"0.54627585",
"0.5451765",
"0.54440784",
"0.5442648",
"0.5428851",
"0.54076856",
"0.53821534",
"0.5366641",
"0.53... | 0.57119143 | 1 |
creates default table row to display when user does not have any tickets. | function createNothingToDisplayElement() {
let nothingToDisplayRow = document.createElement("tr");
let nothingToDisplayData = document.createElement("td");
nothingToDisplayData.setAttribute("colspan", "7");
nothingToDisplayData.innerHTML = "No reimbursment requests discovered.";
nothingToDisplayRow... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRowWithTicket(pOneTicketData, pOrder) {\n\n var tableBody = $(\"#table-body\");\n var mainRow = $(\"#table-body-main-row\");\n var newRow = $(\"<tr>\");\n newRow.attr('data-ticket-DBID', pOneTicketData.ticketID);\n newRow.attr('data-ticket-custDBID', pOneTicketData... | [
"0.64105254",
"0.61403865",
"0.58570755",
"0.5753898",
"0.57094246",
"0.5695277",
"0.5616051",
"0.56051475",
"0.56041616",
"0.55941886",
"0.5586514",
"0.558389",
"0.551595",
"0.54904765",
"0.5488418",
"0.54874057",
"0.5483197",
"0.5468182",
"0.54633564",
"0.54485804",
"0.5441... | 0.6236705 | 1 |
Item owner gets money. Item transfer to \to_cont | function sell_item_transfer(to_cont, item, cost_adjustment) {
return $q.all([
change_gold(item._2o.container(), item.cost*cost_adjustment),
put_item(to_cont, item)
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buy_item(to_cont, item, cost_adjustment) {\n return $q.all([\n change_gold(to_cont, -1*(item.cost*cost_adjustment)),\n put_item(to_cont, item)\n ]);\n }",
"function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}",
... | [
"0.7070466",
"0.6346074",
"0.6200739",
"0.6120404",
"0.6072922",
"0.6057651",
"0.6030295",
"0.6030295",
"0.6030295",
"0.6030295",
"0.6030295",
"0.6030295",
"0.60043234",
"0.59226453",
"0.58981985",
"0.5893371",
"0.586702",
"0.58419544",
"0.58244896",
"0.58140206",
"0.58131313... | 0.70928687 | 0 |
Item owner gets money. Item destroyed | function sell_item_destroy(item, cost_adjustment) {
//U.pluck(item._2o.container()._2m.items(), item);
return $q.all([
change_gold(item._2o.container(), item.cost*cost_adjustment),
Oit.destroy_item(item)
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onClick() {\n // Remove a bushel\n this.quantity -= 1;\n\n // Give the player money depending on the STATE.cashPerCrop variable\n STATE.resources.money += STATE.cashPerCrop;\n\n // Check if any bushels remain.\n // If not, destroy this wheat and\n // let the player know\n if (this.quantity ... | [
"0.63991505",
"0.60630536",
"0.60042256",
"0.598459",
"0.59381306",
"0.5932423",
"0.5908321",
"0.5883736",
"0.5836178",
"0.5832816",
"0.58318627",
"0.58135724",
"0.5797597",
"0.5789406",
"0.57611763",
"0.57611763",
"0.57611763",
"0.57611763",
"0.57611763",
"0.57611763",
"0.57... | 0.6786365 | 0 |
\to_cont gets money and item | function buy_item(to_cont, item, cost_adjustment) {
return $q.all([
change_gold(to_cont, -1*(item.cost*cost_adjustment)),
put_item(to_cont, item)
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}",
"function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}",
"function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",... | [
"0.6196287",
"0.6105152",
"0.5942234",
"0.5917596",
"0.58974034",
"0.582925",
"0.5816826",
"0.5787249",
"0.5771156",
"0.57099897",
"0.5675126",
"0.5673713",
"0.5654836",
"0.56474245",
"0.5618255",
"0.55915976",
"0.5585326",
"0.5561582",
"0.5555752",
"0.5553342",
"0.55374587",... | 0.6338091 | 0 |
============================== | Picker state functions | ============================== For coach | setPickerValue(newValue) {
this.setState({
pickerSelection: newValue
});
this.togglePicker();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Picker( ){}",
"checkPickingState() {\n return false;\n }",
"settingPickerTypeSelChange(params){\n this.setState({\n pickerType: params.target.value\n })\n }",
"dropDownCompnent() {\n return (\n <Picker\n selectedValue={this.state.selectedValueFrom... | [
"0.7216407",
"0.68951535",
"0.6845155",
"0.66380024",
"0.6548477",
"0.65253407",
"0.6477068",
"0.63730913",
"0.62361926",
"0.6196419",
"0.60491556",
"0.6031117",
"0.60304826",
"0.6018748",
"0.5975368",
"0.5966839",
"0.5966839",
"0.5962316",
"0.595822",
"0.59511197",
"0.593562... | 0.6951598 | 1 |
push "current" into "data" for the number oh hours that separate "from" to "to" | function pushData(from, to) {
let curr = new Date(from.getTime());
const color = current > rooms[roomNumber].peopleLimitNumber ?
stdColor['alert']
: current >= rooms[roomNumber].peopleLimitNumber * 0.7 ?
stdColor['warning']
: stdColor['normal'];
do {
data.push(current);
labels.push(curr.toLoca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function appendTimeData(data) {\n let startTime = moment(new Date().setHours(9, 30, 0, 0))\n let endTime = moment(new Date().setHours(15, 0, 0, 0))\n let middleClose = moment(new Date().setHours(11, 30, 0, 0))\n let middleOpen = moment(new Date().setHours(13, 0, 0, 0))\n let dataLastTime = moment(data[data.le... | [
"0.645218",
"0.6056108",
"0.5870095",
"0.58694327",
"0.5809828",
"0.56978",
"0.5636531",
"0.5636531",
"0.5540302",
"0.5517433",
"0.55127144",
"0.5452314",
"0.544941",
"0.5445816",
"0.54395735",
"0.5438016",
"0.53598696",
"0.53370005",
"0.5328558",
"0.5306034",
"0.5274006",
... | 0.72138286 | 0 |
The CenterControl adds a control to the map that recenters the map on Chicago. This constructor takes the control DIV as an argument. | function CenterControl(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.className = "ControlContainer";
controlUI.title = 'Click to recenter the map';
controlDiv.appendChild(controlUI);
// Set CSS for the control i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CenterControl(controlDiv, map) {\r\n\r\n // Set CSS for the control border.\r\n var controlUI = document.createElement('div');\r\n controlUI.style.backgroundColor = '#fff';\r\n controlUI.style.border = '2px solid #fff';\r\n controlUI.style.borderRadius = '3px';\r\n controlUI.style.boxShadow = '0 2px... | [
"0.8013828",
"0.7968754",
"0.77727115",
"0.76235056",
"0.75115454",
"0.75090045",
"0.7507734",
"0.7456348",
"0.6888448",
"0.688808",
"0.6839767",
"0.6628802",
"0.6518375",
"0.629978",
"0.62581444",
"0.61835754",
"0.61082137",
"0.60353446",
"0.5949223",
"0.59388125",
"0.593619... | 0.8255781 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.