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 |
|---|---|---|---|---|---|---|
Replaces the content of pokemoncontainer with the last_inner_HTML (which is the content before the details are show) to simulate a "going back". | function goback() {
document.getElementById("pokemon-container").innerHTML = last_inner_HTML;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear_container() {\n document.getElementById(\"pokemon-container\").innerHTML = \"\";\n }",
"function goBack() {\n qs(\"h1\").textContent = \"Your Pokedex\";\n id(\"pokedex-view\").classList.remove(\"hidden\");\n id(\"results-container\").classList.add(\"hidden\");\n id(\"p2\").cl... | [
"0.6111937",
"0.59139264",
"0.5849505",
"0.555474",
"0.5546642",
"0.54033774",
"0.5392274",
"0.5390807",
"0.53772783",
"0.53500694",
"0.53318745",
"0.5307603",
"0.5269",
"0.5262297",
"0.5240399",
"0.52389544",
"0.5231966",
"0.51919174",
"0.518626",
"0.5142984",
"0.5122361",
... | 0.83784 | 0 |
Function that sets the eventhandlers on the loadnext and loadprev buttons. | function setEventHandlers() {
document.getElementById("loadprev").addEventListener('click', load_prev, false);
document.getElementById("loadnext").addEventListener('click', load_next, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHandlersOnPagination() {\n\t$('.pageNumber').on('click', function(event) {\n\t\tsetLoadingAnimation();\n\n\t\tvar num = parseInt(event.target.id.slice(4));\n\t\tloadNewsByPage(num);\n\t\tsetCurrents(num);\n\t\t// add class to really current element\n\t\t$(event.target).addClass('current');\t\n\t});\n\n... | [
"0.69583845",
"0.6929131",
"0.66894364",
"0.6595195",
"0.65292215",
"0.6524253",
"0.6520782",
"0.6515285",
"0.64465374",
"0.6370581",
"0.63599277",
"0.63550484",
"0.6352872",
"0.6298069",
"0.628591",
"0.62706524",
"0.6236208",
"0.62272185",
"0.6191848",
"0.6181563",
"0.618129... | 0.8655258 | 0 |
Function to find the role of a user in the database. | async function getLoginRole(username) {
let user = await findOneLogin(username);
if (user === null) {
throw new Error("User does not exist in the system");
}
return user.role;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function role() {\n let user = localStorage.getItem(\"currentUser\");\n if (!user) {\n return null;\n }\n //console.log(user)\n user = JSON.parse(user);\n return user.role.name;\n}",
"function findCurrentRol(theuserID, userrole) {\t\t \n\t\tvar mySearch = search.create({\n\t type: 'employee',\n\... | [
"0.66305447",
"0.65571105",
"0.64975464",
"0.642496",
"0.6390605",
"0.6359219",
"0.6326859",
"0.63205236",
"0.62019676",
"0.6181487",
"0.61785805",
"0.617028",
"0.6098747",
"0.6098669",
"0.60889333",
"0.60525525",
"0.6042896",
"0.6025759",
"0.5995406",
"0.5994997",
"0.5951731... | 0.6805293 | 0 |
Create a new Login for a user. Saves the login to the database. | async function createLogin(username, secret, role) {
let password = await generateHash(secret);
let newLogin = new Login({username, password, role});
return await newLogin.save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function login() {\n User.login(self.user, handleLogin);\n }",
"function createNewUser(username, password, email) {\n return dbinit.then(function(initDB) {\n\t\treturn initDB.User.create({\n\t username: username,\n\t\t\tpassword: password,\n\t\t\temail: email\n\t });\n\t})\n}",
"function createUser() ... | [
"0.6660858",
"0.6477222",
"0.6476257",
"0.6414156",
"0.6401083",
"0.6350798",
"0.6326631",
"0.63058907",
"0.6296818",
"0.6276463",
"0.6273368",
"0.6270631",
"0.62129885",
"0.6187427",
"0.6160094",
"0.6154742",
"0.6124331",
"0.6122936",
"0.61026305",
"0.6093578",
"0.60616416",... | 0.66556644 | 1 |
Generate a hash from a password using PBKDF2. Uses randomized salting to generate unique hashes. | async function generateHash(password) {
if ((typeof password) !== "string") {
throw new Error("The password when generating a hash is not a string")
}
const salt = await crypto.randomBytes(16).toString('hex');
let iterations = 65536;
let hash;
hash = crypto.pbkdf2Sync(password, salt, ite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genHash(password) {\n return bcrypt.hashSync(password, 8);\n}",
"function generateHash(password) { return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null); }",
"function generateHash (password) {\n return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);\n}",
"function generateHash... | [
"0.761037",
"0.7524915",
"0.7344945",
"0.73298955",
"0.7324603",
"0.7299042",
"0.72633934",
"0.72513604",
"0.7243352",
"0.7243352",
"0.72295266",
"0.72050875",
"0.7192548",
"0.7060668",
"0.70126",
"0.70054656",
"0.7001216",
"0.69790477",
"0.6976447",
"0.6938667",
"0.6903196",... | 0.7538982 | 1 |
Link an employee to a a login | async function addEmployeeToLogin(loginid, employeeid) {
let login = await getLoginWithID(loginid);
if (login === null) {
throw new Error("This login does not exist")
}
if (login.employee !== undefined) {
throw new Error("This login already has an employee linked")
}
let employee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function viewFullProfile() {\n history.push('/supported-employees/'+employee.id)\n }",
"function viewEmployee() {\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN r... | [
"0.5800394",
"0.57365483",
"0.57339084",
"0.5710944",
"0.5650762",
"0.56489736",
"0.56315434",
"0.5630088",
"0.5610141",
"0.5603383",
"0.5589881",
"0.5558999",
"0.5544896",
"0.5539339",
"0.55229276",
"0.548674",
"0.54781955",
"0.54752606",
"0.5471729",
"0.5452863",
"0.5425549... | 0.61938137 | 0 |
Remove an employee from a login | async function removeEmployeeFromLogin(login) {
if (login === undefined) {
throw new Error("Cannot remove employee from an undefined login")
}
login.employee = undefined;
await login.save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeEmployee(){\n connection.query(queryList.managerList, function(err, res){\n if (err) throw err;\n let list = res\n let choices = [new q.queryAdd(\"delete\", \"Which employee would you like to delete?\", res.map(e => e.name))]\n inquirer\n .prompt(choices)\n ... | [
"0.69825244",
"0.6915039",
"0.6840129",
"0.6824719",
"0.67836744",
"0.6767052",
"0.6748997",
"0.673127",
"0.6692509",
"0.6663337",
"0.6595392",
"0.6563864",
"0.654004",
"0.65367216",
"0.6501667",
"0.64709467",
"0.64419717",
"0.6407272",
"0.63978726",
"0.6395754",
"0.6393625",... | 0.76965874 | 0 |
Get a list of logins without an attached employee | async function getListOfLoginsWithoutEmployee() {
let logins = await getLoginsLean();
let listOfLogins = [];
for (let login of logins) {
if (login.employee === undefined) {
listOfLogins.push(login);
}
}
return listOfLogins;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getListOfLoginsWithEmployee() {\n let logins = await getLoginsLean();\n let listOfLogins = [];\n for (let login of logins) {\n if (login.employee !== undefined) {\n listOfLogins.push(login);\n }\n }\n return listOfLogins;\n}",
"async findUnassingnedEmployees... | [
"0.75656843",
"0.69545925",
"0.628404",
"0.60306025",
"0.6013241",
"0.588932",
"0.58398473",
"0.57997364",
"0.5714186",
"0.5593008",
"0.54553825",
"0.5440844",
"0.53352827",
"0.53300077",
"0.527476",
"0.5270288",
"0.5182698",
"0.5161176",
"0.51337004",
"0.5129337",
"0.5044552... | 0.8191112 | 0 |
Get a list of logins with an attached employee Not currently in use, but made for future use. | async function getListOfLoginsWithEmployee() {
let logins = await getLoginsLean();
let listOfLogins = [];
for (let login of logins) {
if (login.employee !== undefined) {
listOfLogins.push(login);
}
}
return listOfLogins;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listLogins() {\n const userKey = 'all';\n const applicationName = 'login';\n const optionalArgs = {\n maxResults: 10\n };\n try {\n const response = AdminReports.Activities.list(userKey, applicationName, optionalArgs);\n const activities = response.items;\n if (!activities || activities.l... | [
"0.65648377",
"0.6439266",
"0.58519775",
"0.56961626",
"0.55171406",
"0.55148435",
"0.54486895",
"0.5267301",
"0.5124626",
"0.5113864",
"0.50986326",
"0.50681835",
"0.5064336",
"0.50634146",
"0.50484467",
"0.50431097",
"0.5003447",
"0.49990097",
"0.4995195",
"0.494287",
"0.49... | 0.75137216 | 0 |
Gets a login from mongoDB using the id of the login. | async function getLoginWithID(ID) {
return Login.findOne({_id : ID}).exec();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserByID(id) {\n return db('username_password')\n .where('id', id)\n .first();\n}",
"function findUserByMongoID (id) {\n return db.UserModel.findById(id)\n}",
"static async findByLogin(id, password) {\n await userService.verifyPassword({ id, password });\n return await this.findBy... | [
"0.7271509",
"0.6869085",
"0.6795828",
"0.6734774",
"0.6691881",
"0.6456787",
"0.6446733",
"0.6421743",
"0.6401484",
"0.6381206",
"0.6380943",
"0.6373195",
"0.63663936",
"0.6358783",
"0.6356384",
"0.6335606",
"0.6331807",
"0.6327229",
"0.63114935",
"0.62564427",
"0.6229508",
... | 0.76005226 | 0 |
Function to get the lean version of logins | async function getLoginsLean() {
return Login.find().lean().exec();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function request_all_logins(){\n\tvar cmd_data = { \"cmd\":\"get_logins\"};\n\tcon.send(JSON.stringify(cmd_data));\n\tg_logins=[];\n}",
"GetFromNW() {\n let uri = \"\";\n if (this.state.userName !== \"\")\n {\n uri = 'https://yourwebapi.azurewebsites.net/nw/logins/getsome?surName=... | [
"0.59801686",
"0.57176906",
"0.5626933",
"0.5614556",
"0.5496877",
"0.544577",
"0.5410033",
"0.5353483",
"0.5313891",
"0.5296155",
"0.5280723",
"0.52731305",
"0.52635217",
"0.52607507",
"0.52248603",
"0.51670235",
"0.512975",
"0.51249146",
"0.51176196",
"0.509774",
"0.5091708... | 0.65198314 | 0 |
function to get the first classname found from a string | function get_classname(text) {
// execute the regex statement and return the second group (the classname)
const regex = text.match(/(?:"classname" ")(.*?)(?:")/);
if (!Array.isArray(regex) || !regex.length) {
// array does not exist, is not an array, or is empty
return null;
}
return regex[1];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getClassName(string, startIdx) {\n const classSlice = string.slice(startIdx)\n const nameOfClass = classSlice.split(/[ ]+/)[1]\n return nameOfClass\n }",
"function getClassComp(string, startIdx) {\n let stringSlice = string.slice(startIdx)\n let endIdxOfClassComp = getEndIdxOfFunc(string... | [
"0.7833787",
"0.6626618",
"0.6603684",
"0.6567507",
"0.65477836",
"0.6510665",
"0.6488708",
"0.6179764",
"0.61594075",
"0.61456937",
"0.6138494",
"0.61358356",
"0.6094042",
"0.6092592",
"0.60644174",
"0.58749896",
"0.58670557",
"0.5840436",
"0.5813465",
"0.5813465",
"0.580935... | 0.79152125 | 0 |
function to get the first targetname found from a string | function get_targetname(text) {
// execute the regex statement and return the second group (the targetname)
const regex = text.match(/(?:"targetname" ")(.*?)(?:")/);
if (!Array.isArray(regex) || !regex.length) {
// array does not exist, is not an array, or is empty
return null;
}
return regex[1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function locateTarget(String, aux) {\r\n let target = ''\r\n for (aux; aux < String.split(' ').length; aux++){\r\n target = target + String.split(' ')[aux] + ' ';\r\n }\r\n return target;\r\n}",
"function extractFirstName(nameString)\n{\n const nameList=nameString.split(' ');\n return name... | [
"0.6916046",
"0.68025595",
"0.6399403",
"0.63320035",
"0.63312393",
"0.62451816",
"0.62037474",
"0.6187749",
"0.6158977",
"0.6041628",
"0.5994579",
"0.59532565",
"0.58976626",
"0.5861161",
"0.584088",
"0.5829647",
"0.58132714",
"0.57622296",
"0.5758504",
"0.575261",
"0.574513... | 0.7273677 | 0 |
VLabItem onInitialized abstract function implementation; called from super.initialize() | onInitialized() {
this.vLab.SceneDispatcher.currentVLabScene.add(this.vLabItemModel);
this.setupInteractables()
.then((interactables) => {
/**
* Conditionally add to Inventory interactables
* (for VLabItem by default this.interactables[0] (this.vLabScenObje... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onInitialize() {}",
"function onInit() {}",
"_initialize() {\n debug(TRACE_INITIALIZE, this);\n\n this._initState();\n\n // Call subclass lifecycle methods\n this.initializeState(this.context);\n // Initialize extensions\n for (const extension of this.props.extensions) {\n extension.init... | [
"0.7107997",
"0.6565704",
"0.65432215",
"0.6440224",
"0.643833",
"0.6436299",
"0.6416241",
"0.64126927",
"0.6397354",
"0.63962907",
"0.63605237",
"0.6348247",
"0.6308073",
"0.6303636",
"0.6175518",
"0.61493605",
"0.61488897",
"0.6122486",
"0.6122486",
"0.6087336",
"0.6078252"... | 0.74697006 | 0 |
onTransitTakenInteractable called from this.vLab.SceneDispatcher.transitTakenInteractable | onTransitTakenInteractable(event) {
// console.log(event);
let envSphereMapReflection = event.toScene.envSphereMapReflection ? event.toScene.envSphereMapReflection : null;
this.setEnvMap(envSphereMapReflection);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"interact() {\n if (this.previousCollision !== undefined)\n game.getPlayer.input.handleInteraction(this.previousCollision);\n this.previousCollision = undefined;\n }",
"canInteract(target)\n {\n return false;\n\n }",
"function ActiverCameraCarte(){\n\t//bascule entre la ... | [
"0.5617356",
"0.55942583",
"0.5572505",
"0.5551552",
"0.55227274",
"0.5478883",
"0.54019785",
"0.5310889",
"0.53037465",
"0.52967596",
"0.5292115",
"0.52862185",
"0.5248825",
"0.521245",
"0.5207896",
"0.51564676",
"0.51563734",
"0.5104011",
"0.51018786",
"0.50385875",
"0.4976... | 0.65920556 | 0 |
textareas automatic resize logic | function resizeTextarea (object) {
var a = object;
a.style.height = 'auto';
a.style.height = a.scrollHeight+'px';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resizeTextArea() {\n let text = document.getElementById(\"normal-translation\");\n let cell = document.getElementById(\"normal-translation-cell\");\n text.style.height = \"auto\";\n text.style.height = text.scrollHeight + \"px\";\n cell.style.height = text.scrollHeight + \"px\";\n}",
"upd... | [
"0.7124647",
"0.71014875",
"0.69156945",
"0.6897658",
"0.6812281",
"0.67553914",
"0.6749413",
"0.67459065",
"0.6745475",
"0.67357755",
"0.6729845",
"0.6720303",
"0.67077214",
"0.66865504",
"0.6629443",
"0.65781206",
"0.6490987",
"0.6409394",
"0.63911897",
"0.635462",
"0.63311... | 0.72951394 | 0 |
manage_user_input : if input is valid (length > 0 and word has not already been entered by the user) : check if word is a TARGET of the CUE and store the word else : show an error message | function manage_user_input(){
let input = $("#user_input").val().toUpperCase();
if(input.length > 0 && !all_user_input.includes(input)){
$("#game_message_p").attr("hidden",true);
$("#user_input").val("");
let isTarget = check_user_input(input);
store_user_input(input,isTarget);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkUserInput() {\n var userInput = document\n .querySelector(\".type-area\")\n .value.replace(minusString, \"\");\n if (userInput[userInput.length - 1] === \" \") {\n handleSpace();\n return;\n }\n let startword = modifiedpara.substr(0, modifiedpara.indexOf(\" \") + 1);\n\n if (document... | [
"0.6810323",
"0.6776497",
"0.6430014",
"0.62973255",
"0.62947845",
"0.62008137",
"0.61706316",
"0.6124799",
"0.6089949",
"0.60652226",
"0.60317785",
"0.60267717",
"0.5992407",
"0.5991593",
"0.5991067",
"0.59845823",
"0.5924028",
"0.5909839",
"0.58985186",
"0.5885683",
"0.5847... | 0.7162454 | 0 |
Displays the stored word_info as an histogram. | function display_word_info_as_histogram() {
if(word_info != null) {
$("#my_dataviz").empty();
circular_histogram()
$("#word_info_as_table_div").hide();
$("#word_info_as_histogram_div").show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateWordInfo(word) {\n var info = \"\";\n if (word) {\n infoword = \"Word: \" + '\"' + word.word + '\"';\n infoms = \"Match score: \" + word.newest_score.toFixed(2);\n }\n d3.select(\"#word-info\").classed(\"hidden\", false);\n ... | [
"0.63707787",
"0.62415767",
"0.6058878",
"0.603538",
"0.58552694",
"0.5839556",
"0.58284676",
"0.5727901",
"0.571454",
"0.57088006",
"0.5527121",
"0.53991777",
"0.5369567",
"0.53558314",
"0.5296428",
"0.52878606",
"0.5250373",
"0.5248137",
"0.5184956",
"0.51840234",
"0.516587... | 0.7753627 | 0 |
Functions Cycle fader images | function cycleImages(){
var $active = $('#cycler .active');
var $next = ($active.next().length > 0) ? $active.next() : $('#cycler img:first');
$next.css('z-index',2);//move the next image up the pile
$active.fadeOut(1500,function(){//fade out the top image
$active.css('z-index',1).show().removeC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cycleImages(){\n var $active = $('#background .active'); //fondo actual\n var $next = ($('#background .active').next().length > 0) ? $('#background .active').next() : $('#background div:first'); //este operador terneario es un un if\n $next.css('z-index', 2);\n $active.fadeOut(1500, function()... | [
"0.6563221",
"0.64096886",
"0.64016676",
"0.6396897",
"0.6384766",
"0.6318252",
"0.62843496",
"0.6266643",
"0.62471145",
"0.62295604",
"0.6216435",
"0.6210741",
"0.61660737",
"0.6129093",
"0.6129043",
"0.6080127",
"0.60695565",
"0.60638803",
"0.60551447",
"0.60202813",
"0.600... | 0.64525837 | 1 |
Getter for the speed of the side walls | function getSpeedSide(){
var speed = 1;
if(canvas.height>canvas.width){
speed = (canvas.width/2-(ball.radius+wallThickness))/(canvas.height/2-(ball.radius+wallThickness));
}
return speed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getspeed() {\n\t\tif(this.vars.alive){\n\t\t\treturn distance(this.vars.x,this.vars.y,this.vars.px,this.vars.py);\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}",
"function getSpeed()\r\n {\r\n return speed;\r\n }",
"getSpeed() { return this.speed; }",
"get speed () {\n if (this.pointers.length > 0... | [
"0.7527077",
"0.7198578",
"0.71663296",
"0.69863725",
"0.69668895",
"0.6937511",
"0.6830655",
"0.6797065",
"0.67943066",
"0.6744023",
"0.6701209",
"0.6692084",
"0.6495644",
"0.6478085",
"0.6472303",
"0.6472303",
"0.6472303",
"0.6376669",
"0.63255507",
"0.6295567",
"0.6263073"... | 0.80529547 | 0 |
Updates properties of current os based on payload (not a pure function); | function updateOs(os, payload){
os.name = payload.name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AlterThisObjectProperties(packName, payload) {\n let url = `/pack/xdsl/${packName}`;\n return this.client.request('PUT', url, payload);\n }",
"get osVersion() {\n return this.getStringAttribute('os_version');\n }",
"set tvOS(value) {}",
"function osDetect() {\n\t\tif (s.u.match(/wi... | [
"0.5423425",
"0.53018004",
"0.51978576",
"0.51632285",
"0.51368445",
"0.50877225",
"0.50519973",
"0.5016039",
"0.5012522",
"0.4992544",
"0.49769944",
"0.49434906",
"0.4937319",
"0.49176824",
"0.49089324",
"0.49046183",
"0.48736876",
"0.48291996",
"0.4817309",
"0.47778493",
"0... | 0.79037696 | 0 |
Generates the chest with a loot object inside. | function GenerateChest(game, cfs, pos){
console.log(PC); //Shows PCProto, as intended
var loot = GenerateLoot(game, cfs.EquipID, cfs.ChestID, cfs.PC, cfs.CurrentFloorNum);
console.log(loot); //Shows GenerateLoot
console.log(cfs.ChestID);
var GeneratedChest = new ChestProto(game, cfs, pos.xpos, pos.y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chestCreator(amount, room) {\n for(var idx = 0; idx < amount; idx++) {\n var chest = new Location(-1, -1);\n chest.canMove = false;\n chest.description = \"An old wooden chest\";\n chest.terrainType = \"chest\";\n chest.symbol = \"∃\";\n chest.color = \"purple\";\n chest.searchable =... | [
"0.6580181",
"0.61767596",
"0.60175896",
"0.6002368",
"0.5808276",
"0.5769336",
"0.57606137",
"0.5751547",
"0.5747851",
"0.57369566",
"0.569847",
"0.56790423",
"0.5674154",
"0.56472296",
"0.5633816",
"0.5596952",
"0.55894387",
"0.5587919",
"0.5574936",
"0.55455685",
"0.548617... | 0.629615 | 1 |
assume that point belongs to the same line as this segment does | function inSegment(xP, yP) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IsPointOnLine(linePointA, linePointB, point) {\n var isOn = false;\n //quick bounding check\n if ((point.x >= linePointA.x && point.x <= linePointB.x) || (point.x >= linePointB.x && point.x <= linePointA.x)) {\n if ((point.y >= linePointA.y && point.y <= linePointB.y) || (point.y >= linePo... | [
"0.68615925",
"0.6854917",
"0.6854917",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.6791965",
"0.67814726",
"0.6773405",
"0.6655078",
"0.66177183",
"0.65925145",
"0.6564705",
"0.6544665",... | 0.6869831 | 0 |
Creates the promise chain for each test and appends the final | function startTesting(tests, config) {
var results = []
//create the starting promise
, chain = promise.resolve();
//loop through the tests adding a promise to the chain for each
tests.forEach(function (testObj) {
//create the test result object
var resul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createIterationPromises(chain, testObj, config, result) {\n\n //create a promise that reports the start of the test\n chain = chain.then(function() {\n testReporter.report('start-test', result);\n });\n\n //see if the testObj has an exception, from when the factory was... | [
"0.68309146",
"0.58979696",
"0.5864688",
"0.5815834",
"0.5777697",
"0.5696599",
"0.5599544",
"0.5591002",
"0.55837804",
"0.5577624",
"0.55653036",
"0.5556684",
"0.55255634",
"0.5522745",
"0.54881424",
"0.5487195",
"0.54841214",
"0.54683834",
"0.546563",
"0.5376829",
"0.537470... | 0.63816833 | 1 |
Creates a final result object | function createFinalResult(testResults) {
return testResultProcessor(testResults);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async createResult(req, res, next) {\n try {\n const result = await resultsService.createResult(req.body)\n res.send(result)\n } catch (error) {\n next(error)\n }\n }",
"function createResultObject(testObj) {\n return {\n \"title\": testObj.title\n , \"index\... | [
"0.6684234",
"0.66685843",
"0.6636855",
"0.6515226",
"0.6501433",
"0.6475338",
"0.63240725",
"0.6302931",
"0.6278099",
"0.61882687",
"0.61440754",
"0.6141223",
"0.6113414",
"0.6109846",
"0.6093439",
"0.60423493",
"0.6025587",
"0.5995594",
"0.5991774",
"0.5990871",
"0.5966995"... | 0.70234615 | 0 |
Creates the result object that will store the iteration assertion and exception data | function createResultObject(testObj) {
return {
"title": testObj.title
, "index": testObj.index
, "iterations": []
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createIterationResultObject(testObj, iteration) {\n return {\n \"index\": testObj.index\n , \"iteration\": iteration\n };\n }",
"function createIteration(chain, testObj, config, result, iteration) {\n\n //create a promise for the test iteration\n return c... | [
"0.69281995",
"0.6075726",
"0.5961414",
"0.5910831",
"0.58260924",
"0.581422",
"0.5796836",
"0.5787751",
"0.577037",
"0.5724399",
"0.5672612",
"0.56546926",
"0.56280947",
"0.5619491",
"0.5583168",
"0.55563045",
"0.5531328",
"0.5515516",
"0.54985243",
"0.5412559",
"0.5412309",... | 0.6448638 | 1 |
Creates and chains a promise for each test for each iteration | function createIterationPromises(chain, testObj, config, result) {
//create a promise that reports the start of the test
chain = chain.then(function() {
testReporter.report('start-test', result);
});
//see if the testObj has an exception, from when the factory was ran, missin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMockPromises() {\n var responses = Array.prototype.slice.call(arguments);\n var calls = 0;\n return function() {\n return responses[calls++];\n };\n }",
"function startTesting(tests, config) {\n var results = []\n //creat... | [
"0.61907834",
"0.6169247",
"0.614953",
"0.60480267",
"0.6017408",
"0.5925708",
"0.5920606",
"0.58612394",
"0.5745189",
"0.57440186",
"0.567954",
"0.5665498",
"0.5650285",
"0.56471926",
"0.56471926",
"0.5629185",
"0.5623895",
"0.5599942",
"0.5599942",
"0.5548209",
"0.5536034",... | 0.69247067 | 0 |
Creates the result object for the iteration | function createIterationResultObject(testObj, iteration) {
return {
"index": testObj.index
, "iteration": iteration
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createResultObject(testObj) {\n return {\n \"title\": testObj.title\n , \"index\": testObj.index\n , \"iterations\": []\n };\n }",
"function createIterResultObject(value, done) {\n\t\t// 1. Assert: Type(done) is Boolean.\n\t\tif (typeof done !== 'boolean... | [
"0.71569914",
"0.6716952",
"0.6711432",
"0.6655532",
"0.6651282",
"0.6438843",
"0.6360301",
"0.62974733",
"0.6284239",
"0.62835497",
"0.6261418",
"0.62248725",
"0.61952335",
"0.6027536",
"0.59846455",
"0.5924985",
"0.5901495",
"0.58408064",
"0.5828692",
"0.58226824",
"0.58131... | 0.75346637 | 0 |
Creates the test token that will be used for a single test across multiple iterations | function createTestToken(testObj, config, result, resolve) {
return {
"testObj": testObj
, "config": config
, "result": result
, "resolve": resolve
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static generateToken() {\n return DataGenerator.generateRandomText() + DataGenerator.generateRandomText(); // to make it longer\n }",
"function nextToken() {\n return Date.now() + Math.random()\n }",
"assignToken() {\n this.token = `${this.username}-${new Date().toISOString()}-${... | [
"0.6451958",
"0.6117293",
"0.6017321",
"0.58536327",
"0.58211184",
"0.57954425",
"0.5667396",
"0.5651876",
"0.56495035",
"0.562112",
"0.56203765",
"0.5611017",
"0.5504901",
"0.54871655",
"0.5479934",
"0.5454037",
"0.5421057",
"0.54020524",
"0.53929985",
"0.536308",
"0.5322448... | 0.6342268 | 1 |
Runs the arrange function and then moves on to the act function | function runArrange(token) {
try {
token.testObj.arrange.exec();
token.result.arrange = token.testObj.arrange.runtime;
runAct(token);
}
catch(ex) {
handlerError(token, ex);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function run() {\r\nsetTimeout(run, 150);\r\nact();\r\n}",
"function runAct(token) {\n try {\n var start = performance.now()\n , done = runActDone.bind(null, token, start);\n\n token.testObj.act.exec([done]);\n\n //if the act function has zero parameters then we... | [
"0.5960545",
"0.5878473",
"0.5849493",
"0.5802907",
"0.5738499",
"0.56885165",
"0.5655445",
"0.56410766",
"0.5537975",
"0.5514562",
"0.5505603",
"0.548016",
"0.54714656",
"0.5453814",
"0.5433253",
"0.54174846",
"0.5417369",
"0.53956413",
"0.5368891",
"0.53665775",
"0.53521496... | 0.7842571 | 0 |
Runs the arrange function, passing a done function to the act function | function runAct(token) {
try {
var start = performance.now()
, done = runActDone.bind(null, token, start);
token.testObj.act.exec([done]);
//if the act function has zero parameters then we can execute done
if (token.testObj.act.params.length === 0) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runArrange(token) {\n try {\n token.testObj.arrange.exec();\n token.result.arrange = token.testObj.arrange.runtime;\n\n runAct(token);\n }\n catch(ex) {\n handlerError(token, ex);\n }\n }",
"function run() {\r\nsetTimeout(run, 15... | [
"0.77040756",
"0.5826972",
"0.57454884",
"0.5736236",
"0.55252755",
"0.5502297",
"0.5493807",
"0.542416",
"0.5359941",
"0.5359269",
"0.5359097",
"0.5343934",
"0.53404856",
"0.53103197",
"0.5269598",
"0.52332103",
"0.5206002",
"0.52054113",
"0.5191318",
"0.51868576",
"0.517817... | 0.6377351 | 1 |
INTERNAL UTILITY FUNCTIONS // ////////////////////////////// Initialize the connector | async _initConnector() {
logger.debug('Entering _initConnector');
const tlsInfo = this.networkUtil.isMutualTlsEnabled() ? 'mutual'
: (this.networkUtil.isTlsEnabled() ? 'server' : 'none');
logger.info(`Fabric SDK version: ${this.version.toString()}; TLS: ${tlsInfo}`);
await t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Connector() {\n _classCallCheck(this, Connector);\n\n Connector.initialize(this);\n }",
"constructor(connector) {\n this.rpc = connector.rpc;\n }",
"init() {\n\t\tthis.connection = mysql.createConnection(this.setting);\n\t}",
"_installCreateConnection() {\n if (this._connectorHas... | [
"0.7320039",
"0.7019355",
"0.6910452",
"0.67284244",
"0.67027795",
"0.66907233",
"0.6574836",
"0.64476746",
"0.6414778",
"0.63492554",
"0.6330786",
"0.6325863",
"0.6296",
"0.6294666",
"0.62924826",
"0.6282332",
"0.626745",
"0.6266139",
"0.6250496",
"0.6237419",
"0.62290573",
... | 0.728067 | 1 |
Initializes the admins of the organizations. | async _initializeAdmins() {
logger.info('Initializing administrators');
const orgs = this.networkUtil.getOrganizations();
for (const org of orgs) {
const adminName = `admin.${org}`;
// Check if the caliper config file has this identity supplied
if (!this.netw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function requestAdmins(success, failure) {\n if (!self.currentOrganization) {\n failure();\n }\n apiGetRequest(\"/management/organizations/\" + self.currentOrganization + \"/users\", null, success, failure);\n }",
"function adminUserInit()\n\t{\n\t\tnavigationInit(\"adminUser\", \"web_admin_user\"... | [
"0.60427105",
"0.59964716",
"0.5948263",
"0.576265",
"0.57471025",
"0.57283",
"0.5676159",
"0.5675778",
"0.5665038",
"0.5542226",
"0.5540737",
"0.5488954",
"0.5478666",
"0.5439219",
"0.5435306",
"0.54077613",
"0.5344666",
"0.528504",
"0.5267676",
"0.52668786",
"0.5232973",
... | 0.7416763 | 0 |
Extract and persist Contracts from Gateway Networks for identities listed within the wallet | async _initializeContracts() {
logger.debug('Entering _initializeContracts');
for (const walletOrg of this.orgWallets.keys()) {
logger.info(`Retrieving and persisting contract map for organization ${walletOrg}`);
const orgWallet = this.orgWallets.get(walletOrg);
// P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getContracts(contract_initializer) {\n\treturn {\n\t WETH: new ethers.Contract(config[\"tokens\"][\"main\"][\"W-ETH\"], WEthAbi.interface, contract_initializer),\n\t DAI: new ethers.Contract(config[\"tokens\"][\"main\"][\"DAI\"], erc20Abi.interface, contract_initializer),\n\t SAI: new ethers.Contract(c... | [
"0.5908805",
"0.56840736",
"0.5625821",
"0.56050164",
"0.55892456",
"0.5557309",
"0.55453175",
"0.5486929",
"0.5475195",
"0.54599744",
"0.545191",
"0.54329056",
"0.5430497",
"0.5410996",
"0.54043794",
"0.53896457",
"0.5389645",
"0.5355141",
"0.53371274",
"0.53296834",
"0.5311... | 0.57739335 | 1 |
Initialize channel objects for use in peer targeting. Requires user gateways to have been formed in advance. | async _initializePeerCache() {
logger.debug('Entering _initializePeerCache');
for (const userName of this.userGateways.keys()) {
const gateway = this.userGateways.get(userName);
// Loop over known channel names
const channelNames = this.networkUtil.getChannels();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n\n // ESTABLISH WEB3 CONNECTION\n const web3 = new Web3('ws://' + gateways.blockchain.host + ':' + gateways.blockchain.port);\n\n // RESOLVE WITH REFERENCES\n return {\n web3: web3,\n managers: managers([\n 'user',\n 'device',\n 'task',\n 'token'... | [
"0.5696085",
"0.5505675",
"0.52951074",
"0.5120726",
"0.5119723",
"0.5116319",
"0.5105251",
"0.50959027",
"0.50955516",
"0.5013963",
"0.4997298",
"0.4973146",
"0.49559242",
"0.49537152",
"0.49482042",
"0.49221888",
"0.49149746",
"0.48982316",
"0.48898563",
"0.48892474",
"0.48... | 0.58386517 | 0 |
Conditionally initializes the organization wallet map depending on network configuration | async _prepareOrgWallets() {
logger.debug('Entering _prepareOrgWallets');
if (this.networkUtil.usesOrganizationWallets()) {
logger.info('Using defined organization file system wallets');
const orgs = this.networkUtil.getOrganizations();
for (const org of orgs) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _initializeContracts() {\n logger.debug('Entering _initializeContracts');\n for (const walletOrg of this.orgWallets.keys()) {\n logger.info(`Retrieving and persisting contract map for organization ${walletOrg}`);\n const orgWallet = this.orgWallets.get(walletOrg);\n\n ... | [
"0.5742914",
"0.5738049",
"0.57259",
"0.56327844",
"0.5625448",
"0.5620331",
"0.5533269",
"0.55130404",
"0.550972",
"0.53442955",
"0.53160334",
"0.53031343",
"0.52970177",
"0.52535444",
"0.5235459",
"0.5196962",
"0.515148",
"0.5129987",
"0.5125975",
"0.5125568",
"0.5115176",
... | 0.66930324 | 0 |
This creates the function called calcClass with a parameter of sumClass | function calcClass(sumClass) {
// This creates the variable called sumFields equal to document of getElementByClassName of sumClass
var sumFields = document.getElementsByClassName(sumClass);
// This creates another variable called sumTotal equal to 0
var sumTotal = 0;
// This creates ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcClass(sumClass) {\r\n // DVARL: Local variables for this function\r\n var sumFields = document.getElementsByClassName(sumClass),\r\n sumTotal = 0;\r\n // DLOOP: Loops through sumFields and calculates the total\r\n for (var i = 0; i < sumFields.length; i++) {\r\n ... | [
"0.7093922",
"0.6253355",
"0.62113416",
"0.58982676",
"0.56472117",
"0.5516298",
"0.546561",
"0.54329807",
"0.54322064",
"0.5418208",
"0.53749055",
"0.5366234",
"0.5353226",
"0.52644616",
"0.52549",
"0.52497226",
"0.5240211",
"0.5201675",
"0.5200445",
"0.51584244",
"0.514212"... | 0.65456796 | 1 |
Draws a square with a black stroke | function drawSquare(x, y, color){
ctx.fillStyle = color;
ctx.fillRect(x * SQ_SIZE, y * SQ_SIZE, SQ_SIZE, SQ_SIZE);
ctx.strokeStyle = "black";
ctx.strokeRect(x * SQ_SIZE, y * SQ_SIZE, SQ_SIZE, SQ_SIZE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawSquare(){\n ctx.fillRect(25, 25, 100, 100);\n ctx.clearRect(45, 45, 60, 60);\n ctx.strokeRect(50, 50, 50, 50);\n }",
"function drawSquare(x,y,color) {\n\tctx.fillStyle = color;\n\tctx.fillRect(x*SQ,y*SQ,SQ,SQ);\n\n\tctx.strokeStyle = \"BLACK\";\n\tctx.strokeRect(x*SQ,y*SQ,SQ,SQ)\n}",
"dr... | [
"0.81972766",
"0.7576214",
"0.7524594",
"0.7456268",
"0.7436825",
"0.7299734",
"0.7287269",
"0.7273618",
"0.7262037",
"0.7229719",
"0.7189988",
"0.7175417",
"0.7151255",
"0.7136631",
"0.71298003",
"0.7099561",
"0.7089523",
"0.705101",
"0.703232",
"0.7005534",
"0.6971976",
"... | 0.77099854 | 1 |
Spawns a new, random piece at the top of the board | function spawnNewPiece() {
// Create random number between 0 and 6
let r = randomN = Math.floor(Math.random() * PIECES.length)
// Return a newly created piece
return new Piece(PIECES[r][0], PIECES[r][1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"placeNewTile(board) {\n const emptyTiles = this.getEmptyTiles(board)\n const indices = emptyTiles[Math.floor(Math.random() * emptyTiles.length)]\n\n board[indices[0]][indices[1]] = Math.random() < 0.5 ? 2 : 4\n\n return board\n }",
"function newActivePiece () {\n activePiece = new... | [
"0.7231465",
"0.7173782",
"0.7100656",
"0.70475227",
"0.70291686",
"0.7021683",
"0.7020199",
"0.699526",
"0.6958199",
"0.69531417",
"0.68275934",
"0.68154275",
"0.6810233",
"0.67953146",
"0.6720067",
"0.6692881",
"0.66552526",
"0.6653737",
"0.6644835",
"0.6643199",
"0.662946"... | 0.7650206 | 0 |
Returns what the height of the YouTube player container should be, given its current width. By default, a 16:9 aspect ratio is used. | function calculatePlayerHeight(aspectRatio) {
if (!aspectRatio) {
aspectRatio = 9.0 / 16.0;
}
var playerWidth = $('.container.video-player-container').width();
var playerHeight = playerWidth * aspectRatio;
return playerHeight;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playerHeight() {\n\treturn 30;\t\n}",
"function videoDimensions() {\n\tjQuery('.sc_video_player').each(function() {\n\t\t\"use strict\";\n\t\tvar player = jQuery(this).eq(0);\n\t\tvar ratio = (player.data('ratio') ? player.data('ratio').split(':') : (player.find('[data-ratio]').length>0 ? player.find('[... | [
"0.65891445",
"0.6555986",
"0.65222543",
"0.6239372",
"0.6173074",
"0.61214614",
"0.6103371",
"0.6092041",
"0.6088788",
"0.6083551",
"0.6080766",
"0.60639954",
"0.6033356",
"0.60187757",
"0.6017513",
"0.60108805",
"0.60047674",
"0.6004373",
"0.59929466",
"0.5992802",
"0.59780... | 0.7391248 | 0 |
Este metodo nos devuelve todos los invoices con el usuario que lo creo | function getInvoices(req, res){
//Si paso json vacio es que quiero todos los elementos de la bd
Invoice.find({}).populate({path: 'user'}).exec((err, invoices) => {
if(err){
return res.status(500).send({message: 'Error en la peticion...el servidor de BD no esta arriba'});
}else{
if(!invoices){
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function agregarInvoices(){\n\t//debugger;\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"invoices\";\n\tvar arreglo = JSON.parse(localStorage.getItem(usuario_nombre));\n\tvar numeroInvoice = document.getElementById(\"numero\").value;\n\tvar cliente = document.getElementById(\"cliente\").va... | [
"0.62319714",
"0.6003081",
"0.58123946",
"0.57686585",
"0.57557315",
"0.5744334",
"0.5672367",
"0.5655659",
"0.5650839",
"0.56480205",
"0.56473404",
"0.5641048",
"0.56223184",
"0.5619147",
"0.5611727",
"0.55637014",
"0.55636",
"0.55624974",
"0.54888105",
"0.54746187",
"0.5458... | 0.60498786 | 1 |
This function set setting to figure material | function figureMaterial() {
material = new THREE.MeshNormalMaterial({side: 2, wireframe: false})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setMaterial(material) {\r\n\r\n\r\n\r\n\t}",
"function setMaterial()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\t\n\t\tif (rows.length > 0) \n\t\t{\n\t\t\tvar value = material.getValue();\t\t\t\n\t\t\t\n\t\t\tvar index = material.store.find('name', value);\n\t\t\tvar record = mate... | [
"0.7193138",
"0.6446718",
"0.6429943",
"0.6399727",
"0.6391531",
"0.63612956",
"0.633681",
"0.6280558",
"0.62197787",
"0.62037665",
"0.6200171",
"0.6011136",
"0.59788364",
"0.5897697",
"0.5888472",
"0.584856",
"0.57842845",
"0.57842845",
"0.574675",
"0.5687059",
"0.5642125",
... | 0.64717203 | 1 |
return access denied page component TODO: move it | accessDenied() {
return <AccessDenied />;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function accessDenied() {\n $state.go('401');\n }",
"deny () {\n this.redirect({\n error: 'access_denied'\n })\n }",
"function onUnauthorizedAccess() {\n if (angular.isFunction(permission.onUnauthorized)) {\n permission.onUnauthorized()($element);\n } ... | [
"0.67225444",
"0.66533834",
"0.6381627",
"0.6381627",
"0.6012614",
"0.6003598",
"0.5931518",
"0.5924784",
"0.5923421",
"0.5879283",
"0.58270365",
"0.57766056",
"0.5755453",
"0.57406807",
"0.57349634",
"0.5710117",
"0.566178",
"0.5652084",
"0.561093",
"0.5606308",
"0.559031",
... | 0.70775837 | 0 |
bootstrap modal /for tutor | function showTutorModal(data)
{
//you can do anything with data, or pass more data to this function. i set this data to modal header for example
$('.tutorDeleteByAdmin').attr('href','/deleteTutorByAdmin?id='+data);
$("#myModal .tutorDeleteId").html(data)
$("#myModal").modal();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uncoretModal(){\n $(\"#uncoretModal .modal-body\").html(\"Yakin kembalikan \"+currentProfile.tec_regno+\" (\"+currentProfile.name+\") ?\")\n $('#uncoretModal').modal('show');\n}",
"function coretModal(){\n $(\"#deleteModal .modal-body\").html(\"Yakin coret \"+currentProfile.tec_regno+\" (\"+currentPr... | [
"0.69159925",
"0.6812027",
"0.67581695",
"0.67506623",
"0.66961443",
"0.66916126",
"0.66916126",
"0.6644076",
"0.664348",
"0.66264474",
"0.6511584",
"0.6486405",
"0.64768606",
"0.64470184",
"0.64467436",
"0.6443982",
"0.64399713",
"0.64173526",
"0.64110416",
"0.6403858",
"0.6... | 0.7538642 | 0 |
Given a user object, add that user to the user array | function addUser(user) {
data.push(user);
updateDOM();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addUser(user) {\n users.push(user);\n }",
"function addUser(newUser) {\n userDataArray.push(newUser);\n updateDOM();\n}",
"function addToRegisteredUsers( obj ) {\n\t// alter this function if mongoDB is used later\n\tconsole.log(\"pushing the new user to the storage\");\n\tregisteredUse... | [
"0.78169596",
"0.74212974",
"0.7420122",
"0.7359721",
"0.73487866",
"0.7241052",
"0.7137915",
"0.7041912",
"0.6904716",
"0.6868997",
"0.6862962",
"0.67957056",
"0.6681722",
"0.66784596",
"0.66719824",
"0.66651416",
"0.6634417",
"0.6631054",
"0.6629371",
"0.6626643",
"0.662451... | 0.7541653 | 1 |
toggle up and down chevron on Projects accordion | function toggleChevron(e) {
$(e.target)
.prev('.panel-heading')
.find(".indicator")
.toggleClass('fa-chevron-down fa-chevron-up');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleCaChevron(e) {\n $(e.target).prev('.panel-ctab').find('i.cAindicator').toggleClass('fa-chevron-down fa-chevron-up ');\n }",
"function toggleChevron(e) {\n $(e.target).prev('.panel-heading').find(\"i.indicator2\").toggleClass('fa-plus fa-minus');\n }",
"function toggleChevron(... | [
"0.69867295",
"0.68802345",
"0.6869611",
"0.68486464",
"0.6712672",
"0.6683913",
"0.6566513",
"0.63370776",
"0.62986416",
"0.6267418",
"0.62455815",
"0.6201251",
"0.6197086",
"0.61543334",
"0.6148062",
"0.6148062",
"0.6138748",
"0.6135435",
"0.61289394",
"0.6104992",
"0.60951... | 0.73198473 | 0 |
==== Core Functions === Sets the webhook for the bot | function setWebhook() {
//Taken from "Current Web App Url" under Publish... Deploy as Web App...
messagePayload.url =
"";
var method = "setWebhook";
var response = sendPayload(method, messagePayload);
console.log(JSON.stringify(response.getContentText()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setWebhook() {\n var url = telegramUrl + \"/setWebhook?url=\" + webAppUrl;\n var response = UrlFetchApp.fetch(url);\n Logger.log(response.getContentText());\n}",
"configureWebhookEndpoint() {\n if (this.webserver) {\n this.webserver.post(this._config.webhook_uri, (req, res) => {\n ... | [
"0.7397394",
"0.6914554",
"0.646265",
"0.6419864",
"0.637025",
"0.6090902",
"0.60540164",
"0.6045008",
"0.5994735",
"0.59945446",
"0.59529227",
"0.5926795",
"0.5898615",
"0.5841971",
"0.57840586",
"0.5712776",
"0.56738037",
"0.56575894",
"0.5618559",
"0.56013143",
"0.5588519"... | 0.7603806 | 0 |
unhighlight row or column | function unhighlight() {
d3.select(this).classed('selected', false)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dehighlight(tr) {\n while (tr != null && tr.length > 0) {\n tr = dehighlight0(tr);\n if (trjs.events.lineGetCell(tr, trjs.data.TSCOL) != '' || trjs.events.lineGetCell(tr, trjs.data.TECOL) != '')\n break;\n }\n }",
"function unhighlightAll() {\n\t\tfo... | [
"0.7469286",
"0.7441316",
"0.7441316",
"0.73607147",
"0.7280459",
"0.7165317",
"0.7162106",
"0.70975506",
"0.69944674",
"0.6945538",
"0.6912712",
"0.6910607",
"0.6892585",
"0.6885128",
"0.6853165",
"0.6843846",
"0.6837094",
"0.68200505",
"0.67089313",
"0.670422",
"0.6700445",... | 0.7496305 | 0 |
select row or column | function select() {
var el = d3.select(this);
var thislabel = el.node().__data__;
var indx = _.indexOf(data.columnLabels, thislabel);
var indy = _.indexOf(data.rowLabels, thislabel);
if (indx > -1) {
selectedx = getselected(selectedx, indx)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"selectFriend (rowId) {\n\n }",
"select(column, row, length) {\n this._selectionService.setSelection(column, row, length);\n }",
"selectColumn() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectColumnInternal();\n }",
"selectCell() {\n if (... | [
"0.6353896",
"0.63488793",
"0.63371044",
"0.62490654",
"0.6202539",
"0.61946255",
"0.6194242",
"0.61603534",
"0.61563504",
"0.60966754",
"0.6087291",
"0.6035226",
"0.60163814",
"0.597757",
"0.59317094",
"0.59195465",
"0.58806247",
"0.58788353",
"0.58690846",
"0.5830904",
"0.5... | 0.6742137 | 0 |
get selected elements given current list | function getselected(current, target) {
if (_.indexOf(current, target) > -1) {
return []
} else {
return [target]
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSelectedElements()\n {\n return angular.isDefined($scope.lxSelectData.selected) ? $scope.lxSelectData.selected : [];\n }",
"function _get_selected(){\n \tvar ret_list = [];\n\tvar selected_strings =\n\t jQuery('#'+ sul_id).sortable('toArray', {'attribute': 'value'});\n ... | [
"0.64567006",
"0.62602663",
"0.6251946",
"0.6134946",
"0.6076464",
"0.59413624",
"0.5863423",
"0.58521473",
"0.5844708",
"0.5740129",
"0.5740125",
"0.57254684",
"0.5721102",
"0.56790614",
"0.56545997",
"0.56543666",
"0.5636004",
"0.5598565",
"0.55822086",
"0.5567612",
"0.5567... | 0.649269 | 0 |
Delete the wire and free start node and end node | destroy() {
this.startNode.setInputState(INPUT_STATE.FREE);
if (this.endNode == null)
return;
this.endNode.setValue(false);
this.endNode.setInputState(INPUT_STATE.FREE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destory() {\r\n this._data = null\r\n this.previousPtr = null\r\n this.nextPtr = null\r\n util.__verbose('_Node destoryed')\r\n }",
"destroy() {\n nodes.splice(nodes.indexOf(el), 1);\n }",
"destroyBetween(start, end) {\n if (start == end)\n return;\n ... | [
"0.6437473",
"0.6250964",
"0.613884",
"0.6100728",
"0.6088637",
"0.599864",
"0.5952729",
"0.5948689",
"0.58678",
"0.5838371",
"0.57943344",
"0.57943344",
"0.57505816",
"0.5747814",
"0.57359767",
"0.5715814",
"0.57016724",
"0.56652665",
"0.5656159",
"0.56429553",
"0.56376296",... | 0.6556537 | 0 |
Function will retrieve all courses as a json object and call the handler function with the courses. | function getCourses(handler) {
// Get URL from where to fetch courses json
var DHISFolder = getDHISInstallFolder();
var url = getHostRoot() + '/' + DHISFolder + '/api/systemSettings/VJFS_courses';
// Get courses as json object and on success use handler function
$.ajax({
url: url,
localCache : true,
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getAllCourses() {\n const response = await fetch('/api/courses');\n return handleJsonResponse(response);\n}",
"function getCourses(callback) {\n uwclient.get('/courses.json', function (err, res) {\n if (err) return callback(err, null);\n else return callback(null, res.data);\n });\n}",
... | [
"0.7603068",
"0.7207023",
"0.6836271",
"0.68260914",
"0.6804492",
"0.6738379",
"0.6699353",
"0.6681332",
"0.66597867",
"0.65849936",
"0.6566639",
"0.64022917",
"0.6390935",
"0.6357859",
"0.63514477",
"0.6338002",
"0.6322385",
"0.6318531",
"0.631827",
"0.6291898",
"0.6271472",... | 0.79026747 | 0 |
(public) convert to bigendian byte array | function bnToByteArray() {
var i = this.t, r = new Array();
r[0] = this.s;
var p = this.DB - (i * this.DB) % 8, d, k = 0;
if (i-- > 0) {
if (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p)
r[k++] = d | (this.s << (this.DB - p));
while (i >= 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bnToByteArray() {\n\tvar i = this.t, r = new Array();\n\tr[0] = this.s;\n\tvar p = this.DB-(i*this.DB)%8, d, k = 0;\n\tif(i-- > 0) {\n\t if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p)\n\t r[k++] = d|(this.s<<(this.DB-p));\n\t while(i >= 0) {\n\t if(p < 8) {\n\t d = (this.data[i]&(... | [
"0.70684004",
"0.70666355",
"0.70666355",
"0.7060335",
"0.7060335",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
"0.70405376",
... | 0.7067357 | 1 |
[GetValues retrives records for the subsegments based on the intents] | GetValues() {
logger.info(this.nodename, this.Intent)
this.res.status(200).send(this.Intent[this.nodename])
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllValues(data, path) {\n const values = [];\n const successFunction = (v) => values.push(v);\n extractValues(data, path.split('/'), successFunction);\n return values;\n}",
"async getDataValueProgramIndicators(indicators,periods,ous){ \r\n let url=\"analytics?dimension=dx:\"+indicato... | [
"0.5349454",
"0.53224",
"0.5184477",
"0.5104655",
"0.50556725",
"0.5019603",
"0.50030464",
"0.5001158",
"0.49891627",
"0.4984311",
"0.49698564",
"0.4848523",
"0.4827868",
"0.48261502",
"0.48223135",
"0.4802213",
"0.47708547",
"0.47679815",
"0.47618195",
"0.47482172",
"0.47451... | 0.5473222 | 0 |
Intelligent is TRUE tester. Tells whether a value should be considered as true or not. this is useful for ini files for example where all these values should be treated as TRUE: Yes, Y, Ja, Oui, On, True (string or bool), 1 (string or int) => all case insensitive everything else, like No, Off, False, 0, is treated as F... | function bs_isTrue(value) {
var trueVals = new Array('true','on','y','yes',1,'1','ja','oui');
if (value == '') return false;
if (typeof(value) == 'string') value = value.toLowerCase();
if (value == true) return true;
for (var i=0; i<trueVals.length; i++) {
if (value == trueVals[i].toLowerCase()) return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTrue(value) {\n return value == \"true\" || value == true;\n }",
"function pasreString2Boolean(value){\n return /^true$/i.test( value);\n }",
"function isTrue(v) {\n if (!v) return false;\n v = v.toLowerCase();\n return v === 'yes' || v === 'true';\n}",
"function isTrue(v)... | [
"0.7577747",
"0.74589443",
"0.730036",
"0.730036",
"0.7262107",
"0.7112388",
"0.69679236",
"0.69442385",
"0.6939467",
"0.69279224",
"0.68911386",
"0.68911386",
"0.6888288",
"0.6858331",
"0.6818348",
"0.6796968",
"0.6747754",
"0.6712485",
"0.6703129",
"0.66840863",
"0.66840863... | 0.78282946 | 0 |
tells if object is an instance of the class (constructor) specified. example: instanceOf(myArray, Array); this works like js 1.4: myArray instanceof Array | function instanceOf(object, constructor) {
while (object != null) {
if (object == constructor.prototype) return true;
object = object.__proto__;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInstanceOf(victim, constructor) {\n return victim instanceof constructor;\n}",
"function instanceOf (obj, Clss) {\n return Clss[Symbol.hasInstance](obj);\n}",
"function isInstanceOf(obj, ctor) {\n if (obj instanceof ctor) { return true; }\n if (isDirectInstanceOf(obj, ctor)) { return tru... | [
"0.7473699",
"0.7206854",
"0.69754463",
"0.68388706",
"0.6789087",
"0.6789087",
"0.6789087",
"0.66320884",
"0.66309375",
"0.65407544",
"0.64984703",
"0.64706945",
"0.6458997",
"0.645104",
"0.645104",
"0.645104",
"0.645104",
"0.645104",
"0.645104",
"0.645104",
"0.645104",
"0... | 0.720742 | 1 |
Merge array AND objects from left to write. That is the last param overwites the first if keys are the same. | function bs_arrayMerge(obj1, obj2) {
if (!bs_isObject(obj1) || !bs_isObject(obj2)) return false;
for (var key in obj2) {obj1[key] = obj2[key];}
return obj1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function merge(left, right, array){\n if (left.length == 0 && right.length == 0) {\n return array;\n } else if (left.length == 0) {\n return array.concat(right);\n } else if (right.length == 0) {\n return array.concat(left);\n } else if (left[0] < right[0]) {\n array.push(le... | [
"0.6249768",
"0.61006427",
"0.5980521",
"0.57931024",
"0.5752204",
"0.57297915",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
"0.5723165",
... | 0.62526447 | 0 |
Takes a vector ( == jsArray() ) or string and transforms it to a hash of key => TRUE. Sample: aArray = new Array('a', 'b', 'c'); aHash = bs_arrayFlip(aArray); aHash is now aHash['a'] = true aHash['b'] = true aHash['c'] = true | function bs_arrayFlip(aArray) {
var aHash = new Object();
type = bs_typeOf(aArray);
if (type == 'array') {
for (var i=0; i<aArray.length; i++) {
aHash[aArray[i]] = true;
}
} else if (type == 'string') {
if (aArray != '') {
aHash[aArray] = true;
}
}
return aHash;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arrayToBooleanHash (a) {\n var h = {}, i;\n for (i = 0; i < a.length; ++i) {\n h[a[i]] = true;\n }\n return h;\n}",
"function propertyArrayToHash(a) {\n return a.reduce(function (result, key) {\n result[key] = true;\n return result;\n }, {});\n }",
"function t... | [
"0.74423844",
"0.66514415",
"0.6492491",
"0.6492491",
"0.5480636",
"0.5480636",
"0.5480636",
"0.5174106",
"0.5153736",
"0.51470244",
"0.5124383",
"0.50982416",
"0.50635034",
"0.5053384",
"0.50091535",
"0.50091535",
"0.50091535",
"0.50091535",
"0.50091535",
"0.49756506",
"0.49... | 0.7735887 | 0 |
calculates the absoluteabsolute x and y position of your element to the left upper point. param stopIfAbsolute: if something is in a container that is positioned absolute (or has set overflow to auto or scroll which causes the same result) you can stop going up and asking parents. | function getAbsolutePos(el, stopIfAbsolute) {
if (bs_isNull(el)) {
var res = new Position(0, 0);
return res;
}
var res = new Position(el.offsetLeft, el.offsetTop);
if (el.offsetParent) {
if (el.offsetParent.currentStyle && el.offsetParent.currentStyle.position) {
var position = el.offsetParent.currentStyle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setAbsolutePosition() {\n var top = $(this).position().top + $boundary.scrollTop();\n var width = $(this).innerWidth();\n\n // store current yPos\n positions.unshift(top);\n // move to absolute positioning\n $(this)\n .css({\... | [
"0.6612468",
"0.6156101",
"0.61073345",
"0.60744214",
"0.6063768",
"0.59718376",
"0.5962887",
"0.5855134",
"0.58317184",
"0.5825655",
"0.58231145",
"0.5804267",
"0.57575035",
"0.57030904",
"0.5648963",
"0.56356156",
"0.56215596",
"0.5519888",
"0.5519888",
"0.54988873",
"0.547... | 0.74669397 | 0 |
finds the actual background color of the elment specified. the color does not need to be set for that element, it can be in the parent element. | function bs_findBackgroundColor(elm) {
if (typeof(elm) == 'string') {
elm = document.getElementById(elm);
}
if (typeof(elm) == 'undefined') return false;
if (moz) {
try {
var col = document.defaultView.getComputedStyle(elm, null).getPropertyValue("background-color");
} catch (e) {
return false;
}
} e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_background_color( elem ) {\n var result = '#fff';\n \n elem.add( elem.parents() ).each(function(){\n var c = $(this).css('background-color');\n if ( c !== 'transparent' && c !== 'rgba(0, 0, 0, 0)' ) {\n result = c;\n return false;\n }\n });\n ... | [
"0.78151315",
"0.711871",
"0.6844329",
"0.67002577",
"0.6695018",
"0.6361434",
"0.632959",
"0.6322488",
"0.62923104",
"0.62640345",
"0.623187",
"0.61720145",
"0.6165498",
"0.6121799",
"0.6084709",
"0.6084709",
"0.59891677",
"0.5935537",
"0.59036535",
"0.59016156",
"0.5900992"... | 0.7871187 | 0 |
toggles the visibility of the tag types specified. this is useful to hide all select and iframe elements on a webpage so that layers can 'overlap' them. also flash and java used to be unoverlappable using zindex. is that still the case? | function bs_toggleVisibility(show, tags) {
try {
if (typeof(tags) == 'undefined') tags = new Array('select', 'iframe');
for (var tag in tags) {
var elms = document.getElementsByTagName(tags[tag]);
for (var e = 0; e < elms.length; e++) {
elms[e].style.visibility = (show) ? 'visible' : 'hidden';
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setVisibility(name) {\n const ids = [\"src\", \"dest\", \"info\", \"block\"];\n for (var i = 0; i < 4; i++) {\n var x = document.getElementById(ids[i]);\n var display_type = \"\";\n if (ids[i] == name) {\n display_type = \"block\";\n } else display_type = \"none\";\n x.style.display ... | [
"0.6502063",
"0.6498041",
"0.6405871",
"0.63810587",
"0.63810587",
"0.6378426",
"0.62887144",
"0.62398463",
"0.6213064",
"0.61646175",
"0.61269766",
"0.6112656",
"0.61014086",
"0.6100401",
"0.6100151",
"0.60792035",
"0.6068856",
"0.60630834",
"0.60542405",
"0.604019",
"0.6018... | 0.7485875 | 0 |
Extends the event object with srcElement, cancelBubble, returnValue, fromElement and toElement | function extendEventObject() {
Event.prototype.__defineSetter__("returnValue", function (b) {
if (!b) this.preventDefault();
return b;
});
Event.prototype.__defineSetter__("cancelBubble", function (b) {
if (b) this.stopPropagation();
return b;
});
Event.prototype.__defineGetter__("srcElement", function... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function e(event) {\n event = event || window.event;\n event.target = event.target || event.srcElement;\n event.relatedTarget = event.relatedTarget || (event.type == 'mouseover' ? event.fromElement : event.toElement);\n event.target = event.target || event.sr... | [
"0.5977231",
"0.54966295",
"0.54248106",
"0.54248106",
"0.54248106",
"0.5416566",
"0.5408786",
"0.5387909",
"0.5347769",
"0.5347769",
"0.53268796",
"0.53237015",
"0.53131366",
"0.5311788",
"0.5286874",
"0.5284916",
"0.52736986",
"0.5245873",
"0.51774657",
"0.5175334",
"0.5173... | 0.70148546 | 0 |
Emulates element.attachEvent as well as detachEvent | function emulateAttachEvent() {
HTMLDocument.prototype.attachEvent =
HTMLElement.prototype.attachEvent = function (sType, fHandler) {
var shortTypeName = sType.replace(/on/, "");
fHandler._ieEmuEventHandler = function (e) {
window.event = e;
return fHandler();
};
this.addEventListener(shortTypeName, fH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addEvent2(elemento,nomevento,funcion,captura)\r\n{\r\n if (elemento.attachEvent)\r\n {\r\n elemento.attachEvent('on'+nomevento,funcion);\r\n return true;\r\n }\r\n else if (elemento.addEventListener)\r\n {\r\n elemento.addEventListener(nomevento,funcion,captura);\r\n return true;\r\n ... | [
"0.6593419",
"0.64144397",
"0.6395752",
"0.6384517",
"0.637527",
"0.63331157",
"0.62866217",
"0.62858796",
"0.62858796",
"0.62858796",
"0.62858796",
"0.6269706",
"0.62278825",
"0.62260604",
"0.61493105",
"0.6138121",
"0.6115725",
"0.61131835",
"0.6111912",
"0.60980785",
"0.60... | 0.8219873 | 0 |
encodes a string to be used as filename. this is used for example for the texttype class. NOTE: THIS IS THE JAVASCRIPT IMPLEMENTATION OF core/file/Bs_FileUtil.class.php examples: 1) this is a multiline string becomes: "this_eis_ea_e_nmultiline_estring _e = space (empty), _n = newline | function encodeFilename(filename, e) {
if (typeof(e) == 'undefined') e = '_';
/*
LOOK AT HOW NICE IT'S DONE IN PHP...
filename = str_replace(replFrom, replTo, filename);
*/
/*
OLD, BAD CODE
//note: need to treat \n and \\n (and the like) as a line break.
var replFrom = new Array(e, "\\r", "\r", "\\n"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringEncode(str) {}",
"function encode(string){\n\n}",
"function utf8_encode(argString) {\n // discuss at: http://phpjs.org/functions/utf8_encode/\n // original by: Webtoolkit.info (http://www.webtoolkit.info/)\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net... | [
"0.6534858",
"0.6364304",
"0.61795473",
"0.60847753",
"0.60413146",
"0.59853834",
"0.5968375",
"0.58140326",
"0.5793408",
"0.5621209",
"0.560702",
"0.5605011",
"0.5600765",
"0.5586668",
"0.5578774",
"0.5552276",
"0.5549599",
"0.552281",
"0.552281",
"0.552281",
"0.552281",
"... | 0.67835844 | 0 |
Copies the current selection to the clipboard | function copySelection() {
copiedEndX = endX;
copiedEndY = endY;
copiedStartX = startX;
copiedStartY = startY;
// Getting the selected pixels
clipboardData = currentLayer.context.getImageData(startX, startY, endX - startX + 1, endY - startY + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"copySelection() {\n let selectedText = window.getSelection().toString();\n let preparedText = this._prepareTextForClipboard(selectedText);\n atom.clipboard.write(preparedText);\n }",
"function copyToClipboard() {\n\tbid(\"#saveDataArea\").select();\n\tdocument.execCommand('copy');\n\t if (window.getSel... | [
"0.84873664",
"0.7631186",
"0.7580305",
"0.7453225",
"0.7437161",
"0.73975885",
"0.7328146",
"0.73209715",
"0.721806",
"0.721762",
"0.7216409",
"0.7183003",
"0.7125986",
"0.70856005",
"0.70783067",
"0.70154685",
"0.694557",
"0.6942657",
"0.6901579",
"0.68594646",
"0.68474424"... | 0.794348 | 1 |
Pastes the clipboard data onto the current layer | function pasteSelection() {
// Can't paste if the layer is locked
if (currentLayer.isLocked) {
return;
}
// Cancel the current selection
endSelection();
// I'm pasting
isPasting = true;
// Putting the image data on the tmp layer
TMPLayer.context.putImageData(clipboardData, copiedStartX, copiedStartY);
//... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paste(layer) {\n\t/* clone again, so can do multiple copies */\n\t_clipboard.clone(function(clonedObj) {\n\t\tlayer.discardActiveObject();\n\t\tclonedObj.set({\n\t\t\tleft: clonedObj.left + 10,\n\t\t\ttop: clonedObj.top + 10,\n\t\t\tevented: true,\n\t\t});\n\t\tif (clonedObj.type === 'activeSelection') {\... | [
"0.8150686",
"0.72348845",
"0.7158015",
"0.7017968",
"0.6979073",
"0.693317",
"0.69307125",
"0.67916393",
"0.6781189",
"0.674284",
"0.66970325",
"0.6655118",
"0.6644199",
"0.6590797",
"0.65287435",
"0.6526306",
"0.65099233",
"0.649636",
"0.64810055",
"0.6473741",
"0.64723384"... | 0.7971938 | 1 |
Triggers when metadata section is starting | _onMetaSectionStart () {
this._bytes(1, this._onMetaSectionLengthByte);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onMetaData (chunk) {\n this.emit('metadata', _parseMetadata(chunk));\n this._passthrough(this._icyMetaInt, this._onMetaSectionStart);\n }",
"function onLoadedMetaData() {\n logEvent('loadedmetadata', {\n readyState: rawVisualUserMedia.readyState,\n paused: rawVisualUserMedia.paused,\n ... | [
"0.6617968",
"0.61188257",
"0.60921544",
"0.60155493",
"0.593938",
"0.5881873",
"0.574727",
"0.574727",
"0.574727",
"0.574727",
"0.574727",
"0.574727",
"0.574727",
"0.574727",
"0.5730799",
"0.55403244",
"0.5513919",
"0.5513323",
"0.54721135",
"0.5455275",
"0.54367656",
"0.5... | 0.7470408 | 0 |
Triggers when we read 1 byte with metadata section length | _onMetaSectionLengthByte (chunk) {
const length = chunk[0] * METADATA_BLOCK_SIZE;
if (length > 0) {
this._bytes(length, this._onMetaData);
} else {
this._passthrough(this._icyMetaInt, this._onMetaSectionStart);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onMetaSectionStart () {\n this._bytes(1, this._onMetaSectionLengthByte);\n }",
"metaDataLength() {\n return this.bb.readInt32(this.bb_pos + 8);\n }",
"function doSeek(length,eocdrNotFoundCallback){reader.readUint8Array(reader.size-length,length,function(bytes){for(var i=bytes.length-EOCDR_MIN;i>... | [
"0.7157965",
"0.6573522",
"0.61033994",
"0.6078604",
"0.605512",
"0.60418653",
"0.6037985",
"0.5898087",
"0.5892986",
"0.5872373",
"0.5830296",
"0.5676616",
"0.565792",
"0.5558736",
"0.555004",
"0.555004",
"0.553456",
"0.5530269",
"0.5528345",
"0.5528345",
"0.5499199",
"0.5... | 0.74495304 | 0 |
Gets the current 'board', eg. program state. | function board() {
return pxsim.runtime.board;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBoard () {\n\t\treturn this.board;\n\t}",
"getBoard() {\n return state.board;\n }",
"board () {\n return this.chessGame.getBoard()\n }",
"function getCurrentBoard(){\n\t\t\tvar $rows = $el.find('.panel-row');\n\t\t\tvar currentBoard = [];\n\t\t\t\n\t\t\t$.each( $rows, function(){\n\t\t\t\tvar ... | [
"0.7917739",
"0.78400385",
"0.763778",
"0.75377935",
"0.75273573",
"0.75120467",
"0.7340474",
"0.7338494",
"0.7281361",
"0.7241732",
"0.72080433",
"0.7027567",
"0.7027567",
"0.6999278",
"0.6869576",
"0.6772661",
"0.6766494",
"0.67203164",
"0.6522127",
"0.64073914",
"0.6265216... | 0.8418723 | 0 |
Play recorded sample % blockId=play_recorded_sample block="play sample| %name" % blockNamespace=sound inBasicCategory=true % weight=97 | function playRecordedSample(name) {
for (var r = 0; r < pxsim.board().recordings.length; r++) {
var recording = pxsim.board().recordings[r];
if (recording["name"] == name) {
var audioelement = recording["audioelement"];
if (audioelement... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playSample(sample){\n\tsample.play();\n}",
"function playSample(_sound) {\n Soccer.sound[_sound].play();\n }",
"play(numsamples) {\n this.write(numsamples);\n }",
"function playSample(audioFile) {\n var sound = new Audio(audioFile);\n sound.play();\n }",
"funct... | [
"0.7724578",
"0.687848",
"0.6545631",
"0.64641106",
"0.624854",
"0.61980367",
"0.61431825",
"0.6014813",
"0.6000277",
"0.59907883",
"0.59799963",
"0.59745395",
"0.5891353",
"0.589002",
"0.589002",
"0.588475",
"0.58734286",
"0.5862907",
"0.5855754",
"0.5853036",
"0.58381784",
... | 0.7289308 | 1 |
Loop recorded sample % blockId=loop_recorded_sample block="loop sample| %name" % blockNamespace=sound inBasicCategory=true % weight=96 | function loopRecordedSample(name) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playRecordedSample(name) {\n for (var r = 0; r < pxsim.board().recordings.length; r++) {\n var recording = pxsim.board().recordings[r];\n if (recording[\"name\"] == name) {\n var audioelement = recording[\"audioelement\"];\n if... | [
"0.6400882",
"0.6302226",
"0.6181942",
"0.6036163",
"0.59577525",
"0.58068615",
"0.57886386",
"0.5757367",
"0.5669829",
"0.5656255",
"0.5578187",
"0.5539751",
"0.5533167",
"0.5503269",
"0.5483579",
"0.54404616",
"0.54271764",
"0.5423282",
"0.5381162",
"0.5377162",
"0.53761053... | 0.76254714 | 0 |
AnnotationLineSubject which provides color and dimensions from context. | function AnnotationLineSubject(_ref) {
var _ref2, _margin$left, _margin$top;
var min = _ref.min,
max = _ref.max,
props = _objectWithoutPropertiesLoose(_ref, ["min", "max"]);
var _useContext = (0, _react.useContext)(_DataContext.default),
theme = _useContext.theme,
margin = _useContext.ma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function upperLayerLineAttributes(width, color) {\n upperLayerContext.lineWidth = width;\n upperLayerContext.strokeStyle = color;\n}",
"function RendererTextLine() {\n\n /*\n * The width of the line in pixels.\n * @property width\n * @type number\n * @protected\n */\n this.width = 0;\n\n ... | [
"0.55552787",
"0.5324013",
"0.5245912",
"0.5236631",
"0.52272254",
"0.5186893",
"0.51723224",
"0.51716113",
"0.51140183",
"0.50946116",
"0.5085732",
"0.5071162",
"0.5057352",
"0.50450426",
"0.50428087",
"0.502415",
"0.5009223",
"0.4996641",
"0.4996641",
"0.49922705",
"0.49922... | 0.6690303 | 0 |
function to close popup window when game is won | function closePopup () {
winGame.setAttribute('style', 'display: none');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function close_win_layer(){\r\n second_layer.style.display=\"none\"\r\n reset_game()\r\n}",
"function contGame() {\n\twindow.open(\"#close\", \"_self\");// to close popup\n\tplayer.sprite = player.playerChar[player.stage];//to update player character\n\tplayer.resetPos();// to reset player position\n}"... | [
"0.7308472",
"0.7249639",
"0.72036695",
"0.72036695",
"0.71228766",
"0.7108772",
"0.71085685",
"0.70628136",
"0.7048958",
"0.704442",
"0.7028735",
"0.7023497",
"0.69922465",
"0.6986382",
"0.6972465",
"0.69515705",
"0.69362575",
"0.6928395",
"0.69145674",
"0.69103956",
"0.6891... | 0.7811144 | 0 |
If ID>0 display record, otherwise blank out the form. | function displayRecord(targid){
var record
if(targid>0){
record = Store.query({id:targid});
dijit.byId("saveBtn").set('disabled', false);
dijit.byId("deleteBtn").set('disabled', false);
dijit.byId("description").set('disabled', false);
dijit.byId("text1").set('disabled', false);
dijit.byId("num1").set('di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for Patient #\" + id;\n }\n pillboxContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2... | [
"0.64187217",
"0.6216118",
"0.62132794",
"0.61533415",
"0.6144761",
"0.6144565",
"0.61322945",
"0.6123491",
"0.61053234",
"0.61038256",
"0.5991309",
"0.59104455",
"0.58885884",
"0.5862478",
"0.5859398",
"0.5790754",
"0.57476443",
"0.5743398",
"0.5664403",
"0.5656708",
"0.5623... | 0.6731245 | 0 |
endregion ItemsList region LegendPositionEditor | function LegendPositionEditor(container, data, name, resources, legendPositionChangedCallbck) {
this.changedPosition = legendPositionChangedCallbck;
var self = this;
this.topText = resources.topText;
this.bottomText = resources.bottomText;
this.leftText = resources.leftText;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get legendItemTemplate() {\r\n return this.i.legendItemTemplate;\r\n }",
"get legendPosition() {\n\t\treturn this.nativeElement ? this.nativeElement.legendPosition : undefined;\n\t}",
"addLegend () {\n \n }",
"function createLegend() {\n return L.control({ position: 'bottomright' });\n}",
... | [
"0.56455976",
"0.5627564",
"0.55472547",
"0.54810554",
"0.54730725",
"0.5463702",
"0.54131925",
"0.5407268",
"0.5376541",
"0.5329608",
"0.53059226",
"0.52894986",
"0.52886194",
"0.5280107",
"0.52502817",
"0.52263504",
"0.515775",
"0.5153896",
"0.51247275",
"0.5107221",
"0.510... | 0.64854294 | 0 |
endregion LegendPositionEditor region TextFillEditor | function TextFillEditor(container, data, name, resources, textColorChangedCallback) {
this.colorChanged = textColorChangedCallback;
var self = this;
this.colorEditor = new ColorEditor(container, data.color !== keyword_undefined ? data.color : data.colorTitle, data.transparency, name, {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LegendPositionEditor(container, data, name, resources, legendPositionChangedCallbck) {\n this.changedPosition = legendPositionChangedCallbck;\n var self = this;\n this.topText = resources.topText;\n this.bottomText = resources.bottomText;\n this.leftText = resources.left... | [
"0.628437",
"0.56021965",
"0.5444981",
"0.5402869",
"0.53932244",
"0.5346507",
"0.5337341",
"0.5337341",
"0.5337341",
"0.52952504",
"0.5285554",
"0.52780336",
"0.52677697",
"0.5249467",
"0.52486444",
"0.5245507",
"0.52433354",
"0.52342033",
"0.5212722",
"0.5206108",
"0.519020... | 0.61555094 | 1 |
endregion LineEditor region SeriesEditor | function SeriesEditor(container, data, name, resources, seriesOptionsChangedCallback) {
var self = this;
self.seriesOptionsChanged = seriesOptionsChangedCallback;
this.primaryAxisText = resources.primaryAxisText;
this.secondaryAxisText = resources.secondaryAxisText;
this.radiogro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onDeleteLine() {\n changeCurrMeme('delete-row');\n initCanvasAndEditor();\n}",
"function LineEditor(container, data, name, resources, borderChangedCallback) {\n BorderEditor.call(this, container, data, name, resources, borderChangedCallback);\n }",
"function viewport_line(e){\n\tsettin... | [
"0.56643593",
"0.55488485",
"0.5509017",
"0.54851",
"0.5459417",
"0.540418",
"0.5396051",
"0.53696305",
"0.5314334",
"0.5306734",
"0.53019965",
"0.5299827",
"0.52735955",
"0.5246711",
"0.5239832",
"0.5235081",
"0.52302104",
"0.5227019",
"0.5217968",
"0.5217968",
"0.5217968",
... | 0.57939935 | 0 |
endregion SeriesEditor region FillColorEditor | function FillColorEditor(container, data, name, resources, colorChangedCallback) {
this.colorChanged = colorChangedCallback;
var self = this;
this.colorEditor = new ColorEditor(container, data.backColor, data.transparency || 0, name, {
noColorText: resources.noColorText,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRegionColor() {\n var hexColor = $('#fillColorPicker').val();\n var red = parseInt( hexColor.substring(1,3), 16 );\n var green = parseInt( hexColor.substring(3,5), 16 );\n var blue = parseInt( hexColor.substring(5,7), 16 );\n var alpha = $('#alphaSlider').val() / 100;\n annotationColo... | [
"0.6226215",
"0.61029685",
"0.6009666",
"0.57932365",
"0.5788535",
"0.57437027",
"0.5661826",
"0.5655194",
"0.5570977",
"0.5567547",
"0.5548433",
"0.5530018",
"0.5480516",
"0.5470996",
"0.54517907",
"0.5449013",
"0.54328996",
"0.541241",
"0.54074055",
"0.5399212",
"0.536904",... | 0.63476294 | 0 |
endregion ColorEditor region BorderEditor | function BorderEditor(container, data, name, resources, borderChangedCallback) {
this.borderChanged = borderChangedCallback;
var self = this;
this.colorEditor = new ColorEditor(container, data.majorGridLineColor || data.minorGridLineColor || data.borderColor, data.transparency, name, {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBorderColor(){return this.__borderColor}",
"_drawBorder() {\n const { x, y, width, height } = this.config;\n const bw = this.config.border.width;\n this._border = this.scene.add.rectangle( x - bw, y - bw,\n width + bw * 2, height + bw * 2 );\n this._border.setStrokeStyle( this.config.border.c... | [
"0.6436617",
"0.62465245",
"0.6203867",
"0.6052248",
"0.6023039",
"0.5917474",
"0.57927585",
"0.5772515",
"0.5753029",
"0.57174814",
"0.5607268",
"0.55985",
"0.5573817",
"0.55731195",
"0.55614567",
"0.550188",
"0.54790545",
"0.5432706",
"0.5409625",
"0.539487",
"0.5381937",
... | 0.6608146 | 0 |
endregion BorderEditor region InputNumberEditor | function InputNumberEditor(container, title, valueChangedCallback, option) {
this.valueChanged = valueChangedCallback;
this.domInput = this.addInputNumberEditor(title);
this.maxValue = option && !isNullOrUndefined(option.max) ? option.max : Number.MAX_VALUE;
this.minValue = option && !is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NumericCellEditor() {}",
"function Component_NumberInput(params) {\n\n /**\n * The max. number of digits of the number.\n * @property digits\n * @type number\n */\n this.digits = ui.Component_FormulaHandler.fieldValue(this, params.digits);\n\n /**\n * The number-cursor position.... | [
"0.63210946",
"0.6116135",
"0.6116135",
"0.5950932",
"0.5912726",
"0.5799168",
"0.5760423",
"0.5700905",
"0.5662976",
"0.558461",
"0.555702",
"0.55113834",
"0.5502562",
"0.5501902",
"0.5487457",
"0.5459391",
"0.5417141",
"0.54016906",
"0.5343658",
"0.53281325",
"0.5297791",
... | 0.6877234 | 0 |
endregion InputTextEditor region RadioGroup | function RadioGroup(container, items, name, radioGroupSelectedItemCallback) {
var self = this;
self.updateRaidoSelectedItem = radioGroupSelectedItemCallback;
self.domRadio = container;
items.forEach(function (item) {
if (item) {
container.append(self.addRadioI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MRadioGroup() {\n LinearLayout.apply(this);\n\n var self = this;\n var checkedId = -1;\n var onCheckedChangeListener = null;\n\n this.addChild = function(child, indexOrParams, params) {\n if (child.isChecked()) {\n if (checkedId != -1) {\n setCheckedStateFor... | [
"0.66125476",
"0.6431445",
"0.6419526",
"0.6373634",
"0.62387526",
"0.6228825",
"0.60918975",
"0.60511017",
"0.6019445",
"0.59851056",
"0.5978748",
"0.5944056",
"0.59038496",
"0.5872526",
"0.5817137",
"0.57721883",
"0.5765916",
"0.57416964",
"0.5698198",
"0.56502086",
"0.5638... | 0.64741945 | 1 |
endregion ColorPicker region InitSelectedElementEditor | function InitSelectedElementEditor(elements, updateSelectedElementCallback) {
this.updateSelectedElement = updateSelectedElementCallback;
this.selectedElementListDom = this.createSlectedElementEditor(elements);
return this.selectedElementListDom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n rootEditorElement = document.createElement('div');\n rootEditorElement.innerHTML = `\n <div class=\"slds-color-picker\">\n <div class=\"slds-form-element slds-color-picker__summary\">\n <div class=\"slds-form-element__control\">\n <button class=\"slds-butto... | [
"0.6429862",
"0.6332874",
"0.6228206",
"0.6089761",
"0.6016159",
"0.60129523",
"0.60112894",
"0.6009579",
"0.6009579",
"0.60089636",
"0.5963078",
"0.5956486",
"0.5917263",
"0.58962184",
"0.5859923",
"0.5858533",
"0.5832664",
"0.5824731",
"0.5783908",
"0.5778275",
"0.57716894"... | 0.7163935 | 0 |
endregion InitSelectedElementEditor region InitSelectedChartElement | function InitSelectedChartElement(elements, updateSelectedChartElementCallback) {
var self = this;
this.selectedElementsText = [];
this.updateSelectedChartElement = updateSelectedChartElementCallback;
this.selectedElement = this.createSelectedChartElement(elements);
elements.elem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function InitSelectedElementEditor(elements, updateSelectedElementCallback) {\n this.updateSelectedElement = updateSelectedElementCallback;\n this.selectedElementListDom = this.createSlectedElementEditor(elements);\n return this.selectedElementListDom;\n }",
"function selectElement(elemen... | [
"0.7075686",
"0.5875213",
"0.5809691",
"0.56789416",
"0.56186193",
"0.5616088",
"0.5532018",
"0.5506526",
"0.5464878",
"0.54376924",
"0.541622",
"0.5404764",
"0.53691477",
"0.5340522",
"0.5316091",
"0.5316091",
"0.5263381",
"0.5256828",
"0.5214715",
"0.5213502",
"0.5210224",
... | 0.75087625 | 0 |
endregion ChartPanelContainer region sliderPanel DataManager | function SliderPanelDataManager(chart, chartElement, selectedItem, category, dataPointIndex) {
this._chart = chart;
this._selectedElement = chartElement;
this._selectedItem = selectedItem;
this._categories = category;
this._dataPointIndex = dataPointIndex;
if (!isNullOrUn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render_panel() {\n if (shouldAbortRender()) {\n //return;\n }\n \n \n // this.seriesList = [];\n // this.data = [];\n\n var stack = panel.stack ? true : null;\n\n // Populate element\n var options = {\n hooks: {\n ... | [
"0.6152109",
"0.5877633",
"0.5727295",
"0.5719693",
"0.5716624",
"0.56982833",
"0.5695042",
"0.55952704",
"0.55948347",
"0.5587828",
"0.55169797",
"0.54915655",
"0.5465206",
"0.5465206",
"0.5457333",
"0.5359757",
"0.5359601",
"0.53516525",
"0.53494936",
"0.5344648",
"0.534269... | 0.68855494 | 0 |
Start of Shape / Draws a rectangle given two points | function drawRectangle(context, brush, p1, p2){
brush.draw(context, [p1, new Point(p2.x,p1.y), p2, new Point(p1.x,p2.y), p1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawRectangle2() {\n ctx.beginPath();\n ctx.fillRect(rectangleTwo.x, rectangleTwo.y, rectangleTwo.width, rectangleTwo.height);\n ctx.fillStyle = \"black\";\n ctx.fill();\n ctx.closePath();\n }",
"function drawRectangle() {\n}",
"function drawSquare(x, y, size1, si... | [
"0.72670317",
"0.7187517",
"0.71357197",
"0.709875",
"0.70915526",
"0.70893216",
"0.70893216",
"0.7025399",
"0.70091414",
"0.6984681",
"0.69731957",
"0.69617975",
"0.6891509",
"0.6848827",
"0.68389297",
"0.68332916",
"0.6826031",
"0.6701342",
"0.6700821",
"0.66868854",
"0.665... | 0.754616 | 0 |
Draws a circle given two points | function drawCircleFromPoints(context, brush, p1, p2){
drawCircle(context, brush, p1, Math.floor(Math.min(Math.min(p1.x,p2.x), Math.min(p1.y,p2.y)) / 2));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawCircle(x1, y1, x2, y2) {\n var circleVertices = [];\n var inc = 2 * Math.PI / 50;\n var radius = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n for (var theta = 0; theta < 2 * Math.PI; theta += inc) {\n circleVertices.push(vec2(radius * Math.cos(theta) + x1, radius * Ma... | [
"0.79709756",
"0.7643048",
"0.7630742",
"0.740172",
"0.7324681",
"0.72989345",
"0.7231516",
"0.7231516",
"0.7220144",
"0.7220144",
"0.72177035",
"0.7211125",
"0.7196854",
"0.71799076",
"0.7172853",
"0.7162764",
"0.71569353",
"0.7117377",
"0.7093355",
"0.7089143",
"0.7062082",... | 0.77067554 | 1 |
centers the ansDiv at (pageX, pageY) coordinates | function moveAt(pageX, pageY) {
ansDiv.style.left = pageX - ansDiv.offsetWidth / 2 + 'px';
ansDiv.style.top = pageY - ansDiv.offsetHeight / 2 + 'px';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function xCenter(e, w, h)\n{\n var ww=xClientWidth(),wh=xClientHeight(),x=0,y=0;\n e = xGetElementById(e);\n if (e)\n {\n w = w || xWidth(e);\n h = h || xHeight(e);\n\n if (ww < w)\n {\n w = ww;\n }\n else\n {\n x = (ww - w) / 2;\n }\n if (wh < h)\n {\n h = wh;\n ... | [
"0.6413876",
"0.61555386",
"0.61388814",
"0.6137177",
"0.6074581",
"0.60703874",
"0.6045293",
"0.60406023",
"0.6037442",
"0.6031326",
"0.60220027",
"0.60176957",
"0.6008247",
"0.5999138",
"0.5994948",
"0.5987251",
"0.5972729",
"0.59714127",
"0.5964862",
"0.5947989",
"0.594362... | 0.7186661 | 0 |
Function to Display all doctors available in the Clinique. | function displayDoctors() {
// Reading Doctors file.
var d = readFromJson('doc');
// For loop to run till all the doctor's are printed.
for (var i = 0; i < d.doctors.length; i++) {
// Printing doctor's id, name & speciality.
console.log(d.doctors[i].id + ". " + d.doctors[i].name + " (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function viewAllDoctors(res){\n User.find({userType: \"doctor\"}, function (err, docs) {\n Availability.find({}, function(err, availabilities) {\n res.render(\"viewDoctors\", {doctors: docs, availabilities: availabilities});\n });\n });\n}",
"showDoctors(){\n var j=1;\n ... | [
"0.7293917",
"0.6794394",
"0.610895",
"0.60706747",
"0.5972612",
"0.5880344",
"0.5880344",
"0.58343714",
"0.5820182",
"0.5820182",
"0.5784288",
"0.5757251",
"0.5745961",
"0.57347924",
"0.5676848",
"0.5649607",
"0.5648614",
"0.5637816",
"0.56237674",
"0.55770737",
"0.55545443"... | 0.78989625 | 0 |
Function to check the purpose of the user. | function purposeUser() {
// Displaying the patients.
var p = displayPatients();
// Asking the user to select the patient to change the appointment.
r.question("Hello User! Choose a patient ID to set/change his/her appointment! ", (ans1) => {
if (!isNaN(ans1.trim()) && ans1.trim() < p) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkReadOnly(){\n\tif (assistants.scope.current === 'eid'){\n return true; //read from eID\n\t}else{\n\t\tif (myForm.user){\n\t\t\tif (myForm.user.modeid == '3'){\n\t\t\t\treturn true; //Firmenkunde\n\t\t\t}else{\n\t\t\t\tif (myForm.user.levelid == '3') {\n\t\t\t\t\treturn true; //höhere Sicherhe... | [
"0.6188958",
"0.60436153",
"0.59865236",
"0.59690934",
"0.595422",
"0.59252876",
"0.5864137",
"0.58623683",
"0.5859835",
"0.5799223",
"0.57891893",
"0.5780737",
"0.57782054",
"0.57660604",
"0.5744509",
"0.572648",
"0.5719712",
"0.5700988",
"0.5686252",
"0.5664526",
"0.5664526... | 0.6400145 | 0 |
preload() Loads the images of the ships and bullets | function preload() {
shipImage = loadImage("assets/images/face.png");
bulletImage = loadImage("assets/images/heart.png");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preload()\n{\n this.load.image('nebula', 'assets/nebula.jpg');\n this.load.image('bullet', 'assets/bullet.png');\n this.load.image('player', 'assets/thrust_ship.png');\n this.load.image('baddie', 'assets/baddie.png');\n this.load.image('baddie2', 'assets/space-baddie.png');\n this.load.i... | [
"0.8239373",
"0.81986636",
"0.80232763",
"0.79525024",
"0.78894424",
"0.78692067",
"0.7853758",
"0.78436786",
"0.78408736",
"0.78253025",
"0.7824578",
"0.78119946",
"0.7799898",
"0.77839315",
"0.7773637",
"0.77672535",
"0.7766885",
"0.776306",
"0.7740851",
"0.773091",
"0.7730... | 0.85991544 | 0 |
displayGame() Handles input, moves the ships, updates the bullets, displays everything, and checks if the game is over. | function displayGame() {
ship1.handleInput();
ship2.handleInput();
ship1.update();
ship2.update();
ship1.updateBullets(ship2);
ship2.updateBullets(ship1);
ship1.display();
ship2.display();
// If either ship is NOT alive anymore the game is over
// so set state variable to "GAME OVER" to make the... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display_game(){\n\tvar me = game.me;\n\tvar them = game.them;\n\tdisplay_control_state(game);\n\tdisplay_player_stats(them);\n\t// reminder: d_c_lists(list, fanned?, visible?, action, ...)\n\tdisplay_card_lists(them.deck, false, false, null, them.hand, true, false, null);\n\tdisplay_card_lists(them.grave,... | [
"0.67566055",
"0.6698917",
"0.6660937",
"0.661783",
"0.6609545",
"0.6555223",
"0.65131193",
"0.6495623",
"0.6494967",
"0.6471945",
"0.64579284",
"0.6435843",
"0.64300346",
"0.6415476",
"0.6405954",
"0.6393254",
"0.6367633",
"0.6364807",
"0.63530123",
"0.6352485",
"0.6350933",... | 0.81019163 | 0 |
TODO setKeyLayout to a separate file that returns properties for each keyboard layout | function setKeyLayout() {
escRow = ["Esc", 'hid', 'hid', 'hid', 'hid', 'hid', 'hid',
configurationKey('3d', 'toggle_3d_keyboard'),
configurationKey('Screen brightness', 'toggle_screen_brightness'),
configurationKey('Keyboard size', 'toggle_keyboard_size') ];
numberRow = ['hid', two('1', '!'), ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"keyLayoutArray() {\n const layoutRowChars = [\n // Stand ins\n ['\\ud806\\udff7', '\\ud806\\udff8', '\\ud806\\udff9'],\n ['\\ud806\\udff4', '\\ud806\\udff5', '\\ud806\\udff6'],\n ['\\ud806\\udff1', '\\ud806\\udff2', '\\ud806\\udff3'],\n ['\\ud806\\udff0... | [
"0.6398933",
"0.63641423",
"0.60965556",
"0.57465863",
"0.56744653",
"0.56667876",
"0.5659067",
"0.56382316",
"0.56352943",
"0.5555092",
"0.55353826",
"0.5495814",
"0.54718596",
"0.5454583",
"0.53905344",
"0.5381618",
"0.5359218",
"0.5347513",
"0.5345031",
"0.5291607",
"0.529... | 0.8532406 | 0 |
Are all roles ready for start this task. | _isReady() {
for (const role of this._roles.values()) {
if (!role.isConnected()) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isCaseReady() {\n let caseNumber;\n for (const role of this._roles.values()) {\n caseNumber = caseNumber || role.currentCase;\n if (role.state !== RoleState.ready || caseNumber !== role\n .currentCase) {\n return false;\n }\n }\n return true;\n }",
"function checkAllRol... | [
"0.6484185",
"0.6192539",
"0.6129027",
"0.59327704",
"0.5869978",
"0.5769996",
"0.5743647",
"0.57055545",
"0.56928086",
"0.56783545",
"0.56566226",
"0.563788",
"0.55985343",
"0.5578198",
"0.5551505",
"0.5539798",
"0.5536344",
"0.5523749",
"0.55066013",
"0.55015075",
"0.549760... | 0.73152655 | 0 |
Are all roles ready for a specific case. | _isCaseReady() {
let caseNumber;
for (const role of this._roles.values()) {
caseNumber = caseNumber || role.currentCase;
if (role.state !== RoleState.ready || caseNumber !== role
.currentCase) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isReady() {\n for (const role of this._roles.values()) {\n if (!role.isConnected()) {\n return false;\n }\n }\n return true;\n }",
"function checkAllRoles() {\n roleIsDirty = false;\n $('#orgRoleList input').each(function (index, value) {\n if ($(value).prop('... | [
"0.6937595",
"0.68300205",
"0.65250677",
"0.6289261",
"0.61514217",
"0.5931718",
"0.5915072",
"0.5911199",
"0.5814446",
"0.58056086",
"0.5797812",
"0.5797712",
"0.57932556",
"0.5775476",
"0.5719274",
"0.570583",
"0.5683496",
"0.5643674",
"0.5639009",
"0.5624369",
"0.5619153",... | 0.7649995 | 0 |
Creates an Entry at the latest Revision with the specified index and fields. If an entry with the specified index already exists, returns 409 Conflict. If the entry previously existed but was deleted, it is recreated. Returns the new entry if successful. | static async createAtLatest(index, newEntryFields) {
logEntryModification(OP_TYPES.CREATE, index, newEntryFields)
const foundEntry = await this.findByIndexAtRevision(index)
if (foundEntry) {
const error = new Error('Entry with specified index already exists')
er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testInsert_New() {\n var table = env.schema.table('tableA');\n var pkIndexSchema = table.getConstraint().getPrimaryKey();\n var pkIndex = env.indexStore.get(pkIndexSchema.getNormalizedName());\n var rowIdIndex = env.indexStore.get(table.getRowIdIndexName());\n\n var primaryKey = '100';\n var row = t... | [
"0.5848207",
"0.56599903",
"0.5639943",
"0.5508548",
"0.54764843",
"0.53418225",
"0.5295272",
"0.51826894",
"0.51398236",
"0.51006",
"0.50740683",
"0.5000326",
"0.48730335",
"0.4857875",
"0.4762281",
"0.472642",
"0.47183904",
"0.47123784",
"0.47088423",
"0.47027075",
"0.46991... | 0.81380993 | 0 |
Deletes the Entry specified by index by clearing all fields and setting the _deleted flag to true in the latest Revision, returning the deleted entry, if any. | static async deleteAtLatest(index) {
logEntryModification(OP_TYPES.DELETE, index)
const existingEntry = await this.findByIndexAtRevision(index)
if (existingEntry) {
await this.remove({ index: existingEntry.index, _revisionIndex: getLatestRevisionIndex() })
await (new th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async delete(name) {\n\n await Entry.deleteMany({ _revisionIndex: this._id })\n const oldRevision = await this.remove()\n setLatestRevisionIndex(await this.getLatestRevisionIndex())\n return oldRevision\n\n }",
"delete(index) {\n if (index === undefined) throw new Error('Mis... | [
"0.65673846",
"0.5936384",
"0.5869877",
"0.5812586",
"0.57915837",
"0.5780814",
"0.57695943",
"0.5723486",
"0.57156086",
"0.5694659",
"0.5692561",
"0.565028",
"0.5610227",
"0.5610227",
"0.56011564",
"0.5588504",
"0.55796874",
"0.55624384",
"0.55493826",
"0.55368465",
"0.55354... | 0.75864357 | 0 |
Finds a single Entry by index as of the specified Revision, or the latest Revision if null, returning the query promise. | static async findByIndexAtRevision(index, revisionIndex, includeDeleted) {
const result = await this.findOne({ index })
.lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())
.sort('-_revisionIndex')
if (result && result._deleted && !includeDeleted) return null
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async findAtRevision(query, revisionIndex, projection, sort, limit, skip) {\n let cursor = null;\n if (limit && skip) {\n cursor = await this.aggregateAtRevision(revisionIndex)\n .match(query || {})\n .sort(sort || { index: 1 })\n .project(projection || ... | [
"0.6042949",
"0.5710561",
"0.56564283",
"0.5410902",
"0.5317296",
"0.52772516",
"0.5224029",
"0.5206183",
"0.5201671",
"0.5116464",
"0.50573957",
"0.5053663",
"0.4998881",
"0.49626267",
"0.49078575",
"0.4897843",
"0.4896209",
"0.48482415",
"0.4844642",
"0.4844642",
"0.4844642... | 0.73246247 | 0 |
Finds the indices of the previous and next entries in a given revision. | static async getAdjacentIndices(index, revisionIndex) {
let previous = await this.findOne({ _deleted: false })
.lte('_revisionIndex', revisionIndex || getLatestRevisionIndex())
.lt('index', index)
.sort('-index -_revisionIndex')
if (!previous) previous = await this.findOne({ _d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pos(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index)\n return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }",
"location(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && thi... | [
"0.574071",
"0.5698287",
"0.5576296",
"0.55020005",
"0.52020913",
"0.5188652",
"0.51869005",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.5155407",
"0.50654906",
"0.50636524",
"0.50616074"... | 0.69091314 | 0 |
Finds a single Entry by query as of the latest Revision and applies the specified changes, creating a version for the latest Revision if it doesn't yet exist. If inserting is true, the function will create the entry if no previous versions exist. | static async findByIndexAndUpdateAtLatest(index, updatedEntryFields, insert) {
if (!insert) logEntryModification(OP_TYPES.UPDATE, index, updatedEntryFields)
const entry = await this.findByIndexAtRevision(index, null, true)
if (entry || insert) {
let latest
if (entry &&... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async createAtLatest(index, newEntryFields) {\n\n logEntryModification(OP_TYPES.CREATE, index, newEntryFields)\n \n const foundEntry = await this.findByIndexAtRevision(index)\n if (foundEntry) {\n const error = new Error('Entry with specified index already exists')\n ... | [
"0.5591291",
"0.55632836",
"0.5478252",
"0.5385458",
"0.5173695",
"0.51479185",
"0.51479185",
"0.51479185",
"0.51479185",
"0.51479185",
"0.50954866",
"0.5003424",
"0.49475405",
"0.48577616",
"0.48525622",
"0.48441973",
"0.47974363",
"0.47206014",
"0.46799153",
"0.46136218",
"... | 0.6166993 | 0 |
Returns the beginning of an aggregation pipeline that finds the latest version of each entry, if it exists and hasn't been deleted. | static aggregateAtRevision(revisionIndex) {
return this.aggregate()
.allowDiskUse(true)
.match({ _revisionIndex: { $lte: revisionIndex || getLatestRevisionIndex() } })
.sort({ _revisionIndex: -1 })
.group({ _id: '$index', latest: { $first: '$$ROOT' } })
.append({... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getLatest() {\n const latest = await downloadLatest();\n\n return latest.map(restructure).filter(Boolean);\n}",
"queryAllFilterLatestData(callback) {\n this.collection.find({}).project({_id: 0, data: {$slice: -1}})\n .toArray(callback);\n }",
"static async getLatestRevisionIndex() {\n... | [
"0.54860646",
"0.5412143",
"0.5318766",
"0.5248415",
"0.5020957",
"0.5005367",
"0.49698976",
"0.4948272",
"0.49196002",
"0.48732167",
"0.48417732",
"0.47717768",
"0.47698006",
"0.47698006",
"0.47518608",
"0.47355106",
"0.47232595",
"0.4708089",
"0.4692113",
"0.46643457",
"0.4... | 0.54288 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.