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 |
|---|---|---|---|---|---|---|
Este tipo de estructuras es lo que usamos como clases en JS. mando una propiedad al prototype, metodos cuando quiero que una funcionalidad compartida entre todos asi ocupo un solo lugar y lo usan todos por referencia al tener la funcion adentro de persona, puedo jugar con la info publica y privada, del closure | function persona(nombre, edad) {
//let this ={}
//Atributos privados
let n = nombre
//Atributos publicos
this.nombre = nombre
this.edad = edad
//metodo publico de instancia
this.getNombre = function () {
console.log(n)
}
//Metodo publico de clase. lo tiene toda la clase ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function heredaDe(prototipoHijo, prototipoPadre) { // Esta es una funcion que recibe funciones\n var fn = function () {} // Creamos una funcion vacia\n fn.prototype = prototipoPadre.prototype // Hacemos una copia del prototipo del Padre para guardarlo en el protitipo de nuestra funcion vacia\n prototipoHi... | [
"0.69822586",
"0.6792804",
"0.6696645",
"0.65551305",
"0.6462891",
"0.6354235",
"0.6341623",
"0.63321924",
"0.63091993",
"0.63001126",
"0.627603",
"0.6182699",
"0.61824167",
"0.61650586",
"0.6158881",
"0.6153584",
"0.61154467",
"0.6104249",
"0.6103842",
"0.6084468",
"0.606706... | 0.6800792 | 1 |
populate the modal with the data from the API | function populateModal(response) {
let year;
let month;
let day;
let types = [];
title.text(response.nom + ' ' + response.prenom)
$('#nom').val(response.nom);
$('#prenom').val(response.prenom);
arrayDate = response.birth_date.split('-');
year = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function createInvAdminModal() {\n const modal = await modalController.create({\n component: \"inv-admin-modal\",\n cssClass: \"invAdminModal\",\n });\n\n var settings = {\n \"url\": `http://localhost:8080/api/admin/inventory/detail/${storedButtonID}`,\n \"method\": \"GET\",\n \"timeout\": ... | [
"0.70962197",
"0.6957138",
"0.68608016",
"0.6750015",
"0.66756284",
"0.6612753",
"0.6595244",
"0.6577784",
"0.65774995",
"0.65458566",
"0.6530714",
"0.65199953",
"0.65182585",
"0.6505897",
"0.6491617",
"0.6475869",
"0.6452186",
"0.64410675",
"0.64391524",
"0.64356095",
"0.641... | 0.7054622 | 1 |
This funcion "stopEnterKeyPress(evt)"added by Khaja for Browser Campatability | function stopEnterKeyPress(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopRKey(evt) { \nconsole.log(evt);\n var evt = (evt) ? evt : ((event) ? event : null); \n var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); \n if ((evt.keyCode == 13) && (node.type==\"text\")) {return false;} \n}",
"function stopRKey(evt) { \n var evt = (evt) ? evt... | [
"0.8124445",
"0.80460334",
"0.8031595",
"0.7967437",
"0.79473096",
"0.7944956",
"0.77802676",
"0.7563559",
"0.74646187",
"0.7437273",
"0.7426337",
"0.7323661",
"0.73177993",
"0.7282453",
"0.7282453",
"0.7259817",
"0.72519916",
"0.7213866",
"0.7154951",
"0.71531796",
"0.712972... | 0.8477559 | 0 |
This function takes in the comments array and maps over it to return another array that is then passed into the rendered card. | function renderComments(comments) {
let commentsReview = comments
.map((review) => {
return `
<div id="card-wrapper">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">${review.name}</h5>
<h6 class="c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RenderComments({comments}){\n //check for null comments\n if(comments != null){\n //map the comments and put them in specific position\n const reviews = comments.map((review) => {\n return(\n <li key={review.id} className=\"py-2\">\n ... | [
"0.7425737",
"0.7304867",
"0.70581084",
"0.6928109",
"0.6904209",
"0.6889367",
"0.6776773",
"0.67410153",
"0.6634037",
"0.661831",
"0.6603771",
"0.65737563",
"0.6536416",
"0.6530158",
"0.6502114",
"0.64984566",
"0.64769363",
"0.64665604",
"0.64082384",
"0.63774616",
"0.633717... | 0.77894 | 0 |
Event Listeners //////////////////////////////////////////// Called when user updates settings related to formatting. | onDeskletFormatChanged() {
this.updateAgenda();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onStyleSettingsChange() {\n this.sendAction('change', this.get('styleSettings'));\n }",
"function onWPDataChange() {\n var format = wp.data.select( 'core/editor' ).getPostEdits().format || wp.data.select('core/editor').getCurrentPostAttribute('format');\n if ( format !== lastFormat ... | [
"0.6557288",
"0.62030226",
"0.59918094",
"0.5947912",
"0.5928213",
"0.5912242",
"0.58551854",
"0.58531374",
"0.5801727",
"0.5782581",
"0.5747413",
"0.57229096",
"0.5677817",
"0.5643867",
"0.56379956",
"0.5583328",
"0.55722505",
"0.5557001",
"0.55562145",
"0.5544544",
"0.55150... | 0.6835279 | 0 |
Called when the desklet is removed. | on_desklet_removed() {
Mainloop.source_remove(this.updateID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onRemove() {\n RB.DnDUploader.instance.unregisterDropTarget(this.$el);\n }",
"disconnectedCallback() {\n this.$.list.removeEventListener(\n \"editable-list-item-delete\",\n this.triggerDeleteModal.bind(this)\n );\n }",
"_removeCallback() {\n this._renderCallback()\n this._view... | [
"0.69935447",
"0.64396435",
"0.63324",
"0.6270618",
"0.6246498",
"0.6232861",
"0.62126",
"0.62030506",
"0.61760765",
"0.61659503",
"0.6165705",
"0.61613303",
"0.61460054",
"0.61193955",
"0.61137366",
"0.6091186",
"0.6071903",
"0.6067305",
"0.6067305",
"0.60652757",
"0.6044129... | 0.7530738 | 0 |
Called when user clicks on the desklet. | on_desklet_clicked(event) {
this.retrieveEvents();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleJDotterClick() {}",
"deal() {\n\t\tAppDispatcher.handleViewAction({\n \t\tactionType: actionTypes.DECK_DEAL,\n \t});\n\t}",
"onDoubleClick(e) {}",
"function onTargetClick(){\r\n\r\n\t\tif( vaultDweller.currentAttackMode === \"single\"){\r\n\t\tvaultDweller.arm(AKS74u);\r\n\t\tvaultDweller.att... | [
"0.6476323",
"0.633229",
"0.6277018",
"0.61663866",
"0.61526763",
"0.61515105",
"0.61184895",
"0.6114762",
"0.6076998",
"0.60765946",
"0.60085696",
"0.60063684",
"0.5952516",
"0.59423184",
"0.58759433",
"0.5859324",
"0.5849797",
"0.58490044",
"0.58322465",
"0.5822392",
"0.581... | 0.73566604 | 0 |
Utility Functions //////////////////////////////////////////// Construct gcalcli command to retrieve events. | getCalendarCommand() {
let dateTime = new Date();
let command = ["gcalcli", "agenda"];
command.push(CalendarUtility.formatParameterDate(dateTime));
if (this.interval == null) {
this.interval = 7; // Default interval is 7 days
}
dateTime.setDate(dateTime.getDat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetLogEventsCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }",
"retrieveEvents() {\n if (this.updateInProgress) {\n ... | [
"0.6801598",
"0.6391801",
"0.59276015",
"0.5728683",
"0.55465",
"0.54578346",
"0.5433657",
"0.529033",
"0.529033",
"0.51975536",
"0.51660514",
"0.51599413",
"0.51588047",
"0.5143073",
"0.51407135",
"0.5085161",
"0.50715816",
"0.5067516",
"0.5039027",
"0.5034359",
"0.5018773",... | 0.75351834 | 0 |
Convert string line to Event object and store in a list. This method also add the event to widget. | addEvent(eventLine) {
let event = new Event(eventLine, this.use_24h_clock);
this.eventsList.push(event);
this.addEventToWidget(event);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"line_handler(line) {\n this.events.push(JSON.parse(line));\n }",
"function UnknownLineEvent(eventType){this.eventType=eventType;}",
"function lineEvent(f, h, l) {\n\n // Get a list of all calls on the line\n calls = l.get('calls');\n\n //console.log('16:25 - SimpleCTI.lineEvent f... | [
"0.7334328",
"0.548943",
"0.5421573",
"0.5383485",
"0.53824544",
"0.53679025",
"0.52892923",
"0.52253973",
"0.51961225",
"0.51953745",
"0.5148287",
"0.51388663",
"0.5128059",
"0.5122695",
"0.50715643",
"0.505762",
"0.5056393",
"0.50531113",
"0.50458634",
"0.5012436",
"0.50109... | 0.6827284 | 1 |
Append given event to widget. | addEventToWidget(event) {
// Create date header
if (this.lastDate === null || event.startDate.diffDays(this.lastDate) <= -1) {
let leadingNewline = "";
if (this.lastDate) {
leadingNewline = "\n\n";
}
this.lastDate = event.startDate;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addEvent() {\n sendLog(\"Add Event\")\n selectEvent(0);\n handleShow();\n }",
"function addEvent(element, settings, customEvent, event) {\n\t\telement.bind(event, settings[customEvent]);\n\t}",
"addEvent(eventLine) {\n let event = new Event(eventLine, this.use_24h_clock)... | [
"0.61914027",
"0.61389226",
"0.5928868",
"0.5798676",
"0.5798676",
"0.5755042",
"0.5704934",
"0.5686494",
"0.5612147",
"0.5565522",
"0.55484647",
"0.54941714",
"0.54804826",
"0.54418224",
"0.5407741",
"0.5380687",
"0.5374716",
"0.53741467",
"0.5335467",
"0.5318582",
"0.531049... | 0.66424143 | 0 |
Reset internal states and widget CalendarUtility. | resetWidget(resetEventsList = false) {
if (resetEventsList) {
this.eventsList = [];
this.today = new XDate().toString("yyyy-MM-dd");
this.tomorrow = new XDate().addDays(1).toString("yyyy-MM-dd");
}
this.lastDate = null;
this.window = CalendarUtility.wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset() {\n clock.style.display = 'none';\n container.style.display = 'block';\n removeClass(calendar, 'datipi-circle-hidden');\n calendar.style.display = 'block';\n btnPreviousMonth.style.display = 'inline-block';\n btnNextMonth.style.display = 'inline-block';\n if (hou... | [
"0.70383555",
"0.6454652",
"0.645403",
"0.6430253",
"0.6422805",
"0.6403882",
"0.6383192",
"0.6368707",
"0.63611215",
"0.6358446",
"0.63183695",
"0.62937176",
"0.6283175",
"0.6281819",
"0.62692463",
"0.62692463",
"0.62692463",
"0.6250096",
"0.62348",
"0.62173754",
"0.6175695"... | 0.6458761 | 1 |
Gets styling for the specified scene, but in a raw form | getRawStyling(instance, scene) {
if (typeof(this.scenes.common) !== 'undefined') {
if (typeof(this.scenes[scene]) !== 'undefined') {
return _Merge({}, this.scenes.common.getRawStyle(instance), this.scenes[scene].getRawStyle(instance));
}
return this.scenes.com... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getRawStyling(instance, scene) {\n const styling = [];\n\n for (let i = 0, len = this.selectors.length; i < len; i++) {\n const selector = this.selectors[i].getRawStyling(instance, scene);\n styling.push(selector);\n }\n\n return styling;\n }",
"function getSt... | [
"0.72138864",
"0.6305797",
"0.61039907",
"0.5991179",
"0.5960804",
"0.57574046",
"0.5751537",
"0.5729122",
"0.5721681",
"0.5707768",
"0.56930727",
"0.56491786",
"0.56259745",
"0.56147385",
"0.5606325",
"0.55580163",
"0.5544034",
"0.5539171",
"0.5483751",
"0.5469984",
"0.54699... | 0.75214225 | 0 |
check if a specific type of condition is satisfied | checkType(type, instance) {
let instanceVal;
let conditionVal;
if (type === 'styler') {
instanceVal = instance.styler;
conditionVal = this.styler;
} else if (type === 'state') {
instanceVal = instance.state;
conditionVal = this.state;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function conditionChecker(condition){\n \n if (typeof condition == \"string\") {\n condition = [condition];\n }\n\n if (typeof condition[0] == \"string\") {\n condition = [condition];\n }\n\n for (let disjunct of condition) {\n let satisfied = true;\n for (let conjunct of disjunct) {\n \n ... | [
"0.64876837",
"0.6358389",
"0.63496995",
"0.622",
"0.61462843",
"0.6142557",
"0.6142557",
"0.61142814",
"0.61142814",
"0.6097008",
"0.6089504",
"0.60726625",
"0.6070456",
"0.6050081",
"0.6047717",
"0.60467505",
"0.6043378",
"0.60076284",
"0.5973186",
"0.5924181",
"0.5778156",... | 0.67618567 | 0 |
see if condition and instance are equal | validateCondition(conditionVal, instanceVal) {
const keys = Object.keys(conditionVal);
for (let i = 0, len = keys.length; i < len; i++) {
const key = keys[i];
const objVal = instanceVal[key];
const selVal = conditionVal[key];
if (typeof(selVal) === 'objec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"equal(other) {\n return other instanceof DaggeredGate && other.gate.equal(this.gate)\n }",
"eq(other) { return this == other; }",
"function eq(value,condition) {\n return value === condition;\n }",
"function eq(value,condition) {\n return value === condition;\n }",
"equalValue(rhs) {\n retur... | [
"0.62330973",
"0.61888945",
"0.61624044",
"0.61624044",
"0.60328305",
"0.59754163",
"0.59561646",
"0.5943669",
"0.59278154",
"0.591978",
"0.5915261",
"0.58784753",
"0.57955706",
"0.5795267",
"0.57870865",
"0.5772867",
"0.5772867",
"0.57620245",
"0.57614315",
"0.5751092",
"0.5... | 0.6322586 | 0 |
User registration process : create user , create account , map user to account and make selfsigned users superadmin for his account do this process in transaction i.e. either all tables are populated or none(rollback) | function signupAction(req, res, data){
if(con == null)
con = db.openCon(con);
con.query("select email from users where email = ?", [data.email], function(err, result) {
if (err) console.log("signup_error: ", err.stack);
if (result.length > 0) {
res.json({success : 0});
}
else {
con.begi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"doPostRegister(req) {\r\n return new Promise((resolve, reject) => {\r\n // be sure not to OVERWRITE existing users (Only INSTERT, not UPDATE)\r\n let requiredFields = [\"pk_username\", \"pwhash\", \"email\"];\r\n for (let i = 0; i < requiredFields.length; i++) {\r\n ... | [
"0.66847",
"0.66333836",
"0.6446136",
"0.6427951",
"0.642431",
"0.6388084",
"0.6369165",
"0.6358987",
"0.6349823",
"0.634438",
"0.63427407",
"0.63320655",
"0.63283134",
"0.6321722",
"0.63064677",
"0.62752575",
"0.6264958",
"0.6263821",
"0.6258247",
"0.6255026",
"0.62424177",
... | 0.67481434 | 0 |
Who is the No.1 programmer on Codewars? Yes, Of course, his name is myjinxin2015. Wow, please don't throw tomatoes and stinky eggs ;) Unfortunately, due to site failures (or hacker attacks?), The leaderboard often shows incorrect rankings. Your task is: accept a string leaderBoard as argument, correct it and output it. | function correct(leaderBoard){
let jinx=0
let arr = leaderBoard.split`\n`.map((v,i)=>v.includes('myjinxin2015')?jinx=i:v)
arr[jinx]=arr[0].replace(/#\d/,`#${jinx+1}`)
arr[0]='#1 myjinxin2015'
return arr.join('\n')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scrabbleScore() {\n console.log(`Currently using : ${scoringAlgorithms[2].name}`);\n\tconsole.log(`The score for your word, ${userWord}, is ${oldScrabbleScoreTotal(userWord)}!`);\n}",
"function scoreBoard(score) {\n if (score == 1) {\n return \"15\";\n } else if (score == 2) {\n ret... | [
"0.64258116",
"0.64103967",
"0.63478345",
"0.6330782",
"0.608122",
"0.60700566",
"0.6026896",
"0.59998596",
"0.5993339",
"0.5960354",
"0.5939922",
"0.59333056",
"0.58738536",
"0.5871815",
"0.5867355",
"0.5806875",
"0.57852453",
"0.5775262",
"0.5766335",
"0.5756087",
"0.575608... | 0.7190476 | 0 |
in returns can be params without name (only type), its naming in structure param0, param1 ... etc | prepareReturns(params) {
let paramPos = 0;
return params.reduce((params, param) => {
params[param.hasOwnProperty('literal') ? param.id || param.name : 'param' + paramPos] = {
type: param.hasOwnProperty('literal') ? param.literal.literal : param.name
};
paramPos++;
return params;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paramTypeNotSpecified(p) {\n return p;\n}",
"function name1(param1) {\n return \"returning \" + param1;\n}",
"function Generica(param) {\n console.log(\"El tipo es: \" + typeof (param));\n return param;\n}",
"function Param () {\n var obj = {\n display: \"\",\n conditions: [\n... | [
"0.6096071",
"0.6093795",
"0.5983625",
"0.5928453",
"0.59076196",
"0.58841664",
"0.58197254",
"0.5818197",
"0.58149457",
"0.57274956",
"0.57252353",
"0.57243764",
"0.56782854",
"0.5672404",
"0.5650846",
"0.56496453",
"0.5640945",
"0.55671304",
"0.55534804",
"0.5516081",
"0.55... | 0.6745183 | 0 |
Google Key key=AIzaSyD3VP6H8LmxL13wLIcS6klH9yLrMxqqKt0 Google API Darksky Key 9a451f009690bf1c4cb3b721e22d623e DarkSky API over all google google api + zip + google key once that is retrieved, use the lat and lng results to get the dark sky results over all darksky + results from google steps enter zip code to request ... | function LatLong_Complete(result) { //function LatLong_Complete is defined
var lat = result.results[0].geometry.location.lat;
var lng = result.results[0].geometry.location.lng;
var local = lat + "," + lng;
var city = result.results[0].address_components[1].long_name;
var state = result.results[0].address_com... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLocation() {\n $.get(\"http://jarvis.cse.buffalo.edu/mine/zipcode\", function(zip){\n zipcode = zip;\n if(zipcode == 0){zipcode = 14086;}\n $.get(\"http://maps.googleapis.com/maps/api/geocode/json?address=\"+zipcode, function(loca){\n lat = loca['results'][0]['geometry']['locat... | [
"0.67588407",
"0.64658237",
"0.64117044",
"0.6372155",
"0.6370354",
"0.63318616",
"0.6255203",
"0.6215513",
"0.61982226",
"0.6175802",
"0.6159355",
"0.6158477",
"0.61431324",
"0.6113134",
"0.610384",
"0.6068298",
"0.60681754",
"0.60642123",
"0.5981957",
"0.5979981",
"0.596917... | 0.65133166 | 1 |
function dessiner&deplacer les visages | function drawAndMoove() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (let i = 0; i < LesVisages.length; i++) {
LesVisages[i].dessiner();
}
for (let i = 0; i < LesVisages.length; i++) {
LesVisages[i].deplacer();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _CarregaBotoesVisao() {\n var div_visoes = Dom('div-visoes');\n if (div_visoes == null) {\n // Testes nao possuem o div.\n return;\n }\n for (var visao in tabelas_visoes) {\n var botao_visao = CriaSpan(Traduz(tabelas_visoes[visao].nome), 'span-' + visao, null);\n var handler = {\n vis... | [
"0.6435172",
"0.6206964",
"0.6123645",
"0.60016316",
"0.599657",
"0.5929308",
"0.592361",
"0.5866946",
"0.58111846",
"0.5800999",
"0.5794664",
"0.5771359",
"0.57367504",
"0.5727918",
"0.57269657",
"0.5717871",
"0.5712509",
"0.5674087",
"0.56663316",
"0.56647515",
"0.5657683",... | 0.6829895 | 0 |
Adds error state to element | function addErrorState(field){
field.addClass("form-error");
field.attr("placeholder", field.data("needed") + " needed");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateErrorState( domElement ) {\n if( !domElement ) { return; }\n var className = domElement.className;\n var hasErrorClass = ERROR_CLASS_REGEXP.test( className );\n var hasErrorPendingClass = ERROR_PENDING_CLASS_REGEXP.test( className )... | [
"0.69266677",
"0.67910427",
"0.67479837",
"0.6706266",
"0.66882557",
"0.6664762",
"0.66611606",
"0.6627684",
"0.6618137",
"0.66180634",
"0.66035575",
"0.656733",
"0.65511525",
"0.6537945",
"0.6488826",
"0.64843535",
"0.6482017",
"0.646393",
"0.645932",
"0.6448311",
"0.6431083... | 0.6800587 | 1 |
your age, your maximum age, estimate amount of your favorite food per day (as a number). The function calculates how many of the food you will eat for the rest of your life. Write JS program lifetimeSupplyCalc.js that calculates the amount of a few foods that you will eat. The result should be printed on the console. | function calcSupply(age, maxAge,foodPerDay, strFood){
var food=(maxAge-age)*foodPerDay*365;
console.log(food+'kg of '+ strFood+' would be enough until I am ' + maxAge+ ' years old.');return(food);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateSupply (age, ammountPerDay){\n\tvar maxAge = 70;\n\n\tconsole.log(\"You will need \" + ammountPerDay*365*(maxAge-age) + \" to last you until the ripe old age of \" + maxAge);\n}",
"function calculateSupply(age, amountPerDay) {\n\tvar timeLeft = 115 - age; //incredibly ominous variable name, I k... | [
"0.79994243",
"0.79022115",
"0.7547943",
"0.75431645",
"0.7542196",
"0.7521185",
"0.7514212",
"0.7509312",
"0.74714303",
"0.7437668",
"0.7424127",
"0.73176605",
"0.7304239",
"0.728139",
"0.7212756",
"0.70684314",
"0.7063942",
"0.7020079",
"0.6961879",
"0.6959401",
"0.6953731"... | 0.7990265 | 1 |
NotDone : board > PlayResult | NotDone(board) {
return {
board,
isDone() { return false },
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playNext(board) {\n\t\tresetScore();\n\t\tif (board == \"boardEasy\") {\n\t\t\t$boardEasy.remove();\n\t\t\t$overlay.hide();\n\t\t $(\"#buttonNormal\").click();\n\t\t} else if (board == \"boardNormal\") {\n\t\t\t$boardNormal.remove();\n\t\t\t$overlay.hide();\n\t\t\t$(\"#buttonAdvanced\").click();\t\t\n\... | [
"0.6687583",
"0.6646155",
"0.65901434",
"0.6542949",
"0.6529043",
"0.6508755",
"0.6461407",
"0.64562094",
"0.63809973",
"0.63489455",
"0.6341048",
"0.6303314",
"0.6276636",
"0.62565696",
"0.6254903",
"0.62461764",
"0.6238057",
"0.6227723",
"0.62266624",
"0.6226049",
"0.622599... | 0.6932247 | 0 |
gameOver : Board > Boolean | function gameOver(board) {
return false // stub
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"GameOver() {\n if(this.grid[1][2] != 0) {\n console.log(\"game over\");\n return true;\n }\n return false;\n }",
"gameIsOver() {\n if (this.gameState.board.includes(0)) { // if there's a zero\n this.gameState.over = false;\n } else if (this.i... | [
"0.8330674",
"0.80898124",
"0.8004476",
"0.7996769",
"0.7979291",
"0.79570484",
"0.792771",
"0.76825875",
"0.76027596",
"0.7597549",
"0.7584835",
"0.7579564",
"0.75614357",
"0.7548005",
"0.74854684",
"0.74640334",
"0.7440378",
"0.7416429",
"0.741438",
"0.74063337",
"0.7384023... | 0.854249 | 0 |
playTurn : Array Brain > Board > Function(Board) > Task(_, Board) | function playTurn(brains, board, tick) {
return brains
.reduce(
(accTask, brain) => accTask.chain(board => playBrain(brain, board, tick)),
Task.of(board)
)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ticTacToe(board) {\n\n}",
"function takeTurn () {}",
"function conwayLife( board, turns ){\n for (let i = 0; i < turns; i++){\n board = transform(board)\n }\n return board\n}",
"takeTurn() {}",
"function takeABlindMove(turn) { ... }",
"function gameTicTacToe(){\n userTurn();\n updateMove... | [
"0.6460954",
"0.64451575",
"0.6387835",
"0.6118144",
"0.60310656",
"0.59562004",
"0.5951632",
"0.58539027",
"0.58199584",
"0.581308",
"0.5784155",
"0.57731783",
"0.57682914",
"0.57472366",
"0.5741901",
"0.57239336",
"0.5716009",
"0.5697859",
"0.5678606",
"0.566034",
"0.564721... | 0.71704626 | 0 |
playBrain : Brain > Board > Function(Board) > Task(_, Board) Plays one brain's turn. | function playBrain(brain, board, tick) {
// this is basically a 'while' loop
return brain.play(board)
.chain(result => {
// notice that this is not necessarily called at the end of a brain's turn. it could happen
// after just one move (e.g. if a move takes place and the board ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playTurn(brains, board, tick) {\n return brains\n .reduce(\n (accTask, brain) => accTask.chain(board => playBrain(brain, board, tick)),\n Task.of(board)\n )\n}",
"function takeTurn () {}",
"takeTurn() {}",
"play() {\r\n /*Display \"Simulating Battle*/\r\n ... | [
"0.76371855",
"0.5981738",
"0.5952405",
"0.5813011",
"0.5800668",
"0.57970744",
"0.5714801",
"0.5642199",
"0.55969286",
"0.5576881",
"0.5538387",
"0.5475672",
"0.54459625",
"0.54168004",
"0.54168004",
"0.5355397",
"0.5350587",
"0.53349614",
"0.5323329",
"0.53090185",
"0.52854... | 0.76714957 | 0 |
newHtmlMember function is a function that generate the data into a bulma table to store the data. each table is assigned with a different color for distinction each table also contains the required information for each role | function newHtmlMember(member) {
return new Promise(function(resolve, reject) {
const role = member.getRole();
const name = member.getName();
const id = member.getID();
const email = member.getEmail();
let data = "";
if (role === "Engineer") {
const github... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addHtml(member) {\n return new Promise(function (resolve, reject) {\n const name = member.getName();\n const role = member.getRole();\n const id = member.getId();\n const email = member.getEmail();\n let data = '';\n if (role === 'Engineer') {\n const gitHub = member.getGithub();\n... | [
"0.63148504",
"0.6265793",
"0.61980486",
"0.61458784",
"0.6115505",
"0.60825616",
"0.6050785",
"0.6019814",
"0.6014652",
"0.5987241",
"0.5956826",
"0.59549755",
"0.5927964",
"0.5839112",
"0.58225507",
"0.5806796",
"0.5804438",
"0.5803803",
"0.5795314",
"0.5771071",
"0.5757839... | 0.6586386 | 0 |
Initialize the whole pool tool (jquery gantt chart, date pickers, add new booking form, ...) | function init(){
$('.page-content').append(window.ST.pooToolSpinner.el);
changeDesign();
initializeCheckOrientation();
initializeListingDateLocationService();
initializeGantt();
initializeDatepickers();
initialize_poolTool_createTransaction_form(gon.locale, gon.choose_employee_or_renter_msg)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeDatepickers(){\n window.ST.set_datepicker_language(gon);\n\n // Get booked dates for\n // Set the first listing as checked and initialize datepicker with the booked dates of this listing\n var booked_dates = [];\n $('input:radio[name=listing_id]:first').prop('checked',true);\n ... | [
"0.6558901",
"0.6522491",
"0.6361033",
"0.6274721",
"0.6189915",
"0.6099556",
"0.60969436",
"0.60721284",
"0.60716623",
"0.5999481",
"0.5982584",
"0.5930398",
"0.59157544",
"0.588578",
"0.5870728",
"0.5860377",
"0.5860098",
"0.5847246",
"0.583509",
"0.5830992",
"0.5826939",
... | 0.75484324 | 0 |
Removes all borrowed booking cards (divs) and then calls the method for showing the borrowed devices This is used for updating the view, for example after a booking has been deleted, changed or created | function update_my_borrowed_devices(){
if (gon.user_active_bookings !== null){
$('.open_booking_entry').remove();
$('.no-open-bookings').remove();
show_my_borrowed_devices();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cleanUpView(){\n\tconst cards = document.querySelectorAll('.contactinfo > div')\n\tfor (const card of cards)\n\t\tcard.remove()\n}",
"function selectedCardDisappears() {\n $(this).parent().empty();\n }",
"function show_my_borrowed_devices(){\n // gon.user_active_bookings = only bookings which a... | [
"0.6492944",
"0.6343195",
"0.6318992",
"0.625918",
"0.6125047",
"0.6120447",
"0.61180186",
"0.6041569",
"0.6030425",
"0.6021625",
"0.60204864",
"0.60094017",
"0.59355664",
"0.5913559",
"0.59041137",
"0.58853537",
"0.5857219",
"0.5853853",
"0.5852328",
"0.5844503",
"0.5817319"... | 0.70122933 | 0 |
Check if start date is greater than today and remove booking if thats the case. This can happen if a booking is updated via the gantt chart | function remove_future_bookings(bookings){
var today = new Date(new Date().setHours(1,0,0,0));
for(var i=0; i<bookings.length; i++){
if(new Date(bookings[i].start_on) > today){
bookings.splice(i, 1);
i--;
}
}
return bookings;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove_old_bookings(bookings){\n for(var i=0; i<bookings.length; i++){\n for(var j=i+1; j<bookings.length; j++){\n if (bookings[i].listing_id === bookings[j].listing_id){\n // Remove the booking, which has the earlier return date\n if (new Date(bookings[i].end_on) < new Da... | [
"0.67653906",
"0.6101484",
"0.59707695",
"0.5917016",
"0.58400387",
"0.57660604",
"0.554732",
"0.55089575",
"0.5500143",
"0.54909384",
"0.5485698",
"0.5477982",
"0.5457254",
"0.5439769",
"0.5430314",
"0.54136175",
"0.53668576",
"0.5360824",
"0.53605825",
"0.53486437",
"0.5321... | 0.7630306 | 0 |
Initialize the pool tool options, like "Show only mine", ... | function initialize_poolTool_options(){
// Show only my bookings (the current user)
$('.only_mine').on('change', function(){
show_only_mine();
});
$('.only_mine').prop('checked', false);
$('#only_mine_label').on('click',function(ev){
if ($('.only_mine').prop('checked')){
$('.onl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initPool() {\n this.pool = [];\n for (let choice of this.choices) {\n for (let i = 0; i < choice[1].totalNumber; i++) this.pool.push(choice[0])\n }\n }",
"function poolDefaults() {\n return {\n /* jshint camelcase:false */\n name: '',\n ... | [
"0.631207",
"0.6143709",
"0.57563937",
"0.57312226",
"0.56523013",
"0.56523013",
"0.56523013",
"0.56338495",
"0.56262666",
"0.56262666",
"0.5620569",
"0.5605839",
"0.5543482",
"0.54897267",
"0.54755664",
"0.54649866",
"0.5459752",
"0.54493487",
"0.5446464",
"0.5428721",
"0.54... | 0.67589194 | 0 |
Initialize the listings picture preview. The listings picture should be shown if the user hovers a listing in the gantt chart | function initialize_listing_previews(){
for (var i = 0; i < window.ST.poolToolRows; i++) {
// Function in a loop. Do not use i in there!
/*jshint -W083 */
$('#rowheader' + i).on('mouseover', function(ev){
if (ev.currentTarget.firstChild.firstChild){
var id = ev.currentTarget.id;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n renderImgs(gImgs, '.gallery-cont');\n renderCloud(gKeywords);\n \n $('.img').click(function () {\n gState.selectedImgId = this.id;\n $('.main-cont').toggle();\n $('.meme-cont').toggle();\n renderCanvas(gState, gMapImg);\n })\n\n \n\n \n}",
"fun... | [
"0.57094085",
"0.5650236",
"0.56370544",
"0.56360835",
"0.5635074",
"0.56309164",
"0.5617537",
"0.5576536",
"0.5572197",
"0.55693877",
"0.55570245",
"0.5514322",
"0.5502109",
"0.5473239",
"0.54679424",
"0.5462887",
"0.5453795",
"0.54382217",
"0.54343075",
"0.5432316",
"0.5430... | 0.6028781 | 0 |
Initialize the different themes and the checkbox callbacks & set the default theme | function initializeThemes(){
var allThemes = ["theme_dark", "theme_red", "theme_white"];
var allClasses = ["gantt", "header_g", "row_g", "wd_g", "sa_g", "sn_g",
"today", "navigate", "fn-content", "legend", "dataPanel_past",
"gantt_otherReason", "ganttLegend_otherReas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initThemeSwitching() {\n//ini kalau dihapus thema gak bisa diswitch lagi\n\t\tthemes = [\n\t\t\t'cube',\n\t\t\t'coverflow',\n\t\t\t'classic',\n\t\t\t'carousel',\n\t\t\t'concave',\n\t\t\t'cards'\n\n\t\t];\n\t\t\n\t\tselectedThemeIndex = 0;\n\t\tinitKeys();\n\t\tselectTheme(0);\n\t}",
"function setThemeOn... | [
"0.71800333",
"0.68310714",
"0.6716312",
"0.66058975",
"0.65912706",
"0.65844977",
"0.65576345",
"0.6528264",
"0.6480877",
"0.64212656",
"0.6347222",
"0.63298017",
"0.6308608",
"0.6302527",
"0.6288995",
"0.62851524",
"0.6264553",
"0.62584287",
"0.62290174",
"0.6228965",
"0.62... | 0.6977718 | 1 |
Actually changes the theme by removing and adding classes to the DOM objects | function changeTheme(theme, allThemes, allClasses){
for (var y=0; y<allClasses.length; y++){
// remove old themes
for (var i=0; i<allThemes.length; i++){
$('.' + allClasses[y]).removeClass(allClasses[y] + '_' + allThemes[i]);
}
// add new theme
$('.' + allClasses[y]).addClass(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function switch_theme() {\n console.log(\"Here\");\n const body = document.getElementById('Stage');\n\n if (body.classList.contains('t--light')) {\n body.classList.remove('t--light');\n body.classList.add('t--dark');\n } else {\n body.classList.remove('t--dark');\n body.classList.add('t--light');\n... | [
"0.7398392",
"0.7289952",
"0.72568846",
"0.71001494",
"0.7070531",
"0.70623386",
"0.704508",
"0.70365757",
"0.7030264",
"0.700752",
"0.70045537",
"0.69886196",
"0.6984464",
"0.6921051",
"0.6921051",
"0.6921051",
"0.6921051",
"0.6921051",
"0.68715405",
"0.68685746",
"0.6864187... | 0.7378559 | 1 |
Saves which themes the users has selected into the database | function saveTheme(theme){
$.ajax({
method: "post",
dataType: "json",
url: "/" + gon.current_user_username + "/poolToolTheme",
data: {theme: theme},
})
.success(function(data){
// Do not show any message to user
})
.error(function(data){
// Do not show any message... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"saveTheme(){\n let saveTheme = (this.themeInput.checked) ? 'dark' : 'light';\n\n localStorage.setItem('theme', saveTheme);\n }",
"function saveTheme() {\n var val, style, rebuild, customTheme = {};\n \n if ($('#theme-notipsy').hasClass('active')) {\n customTheme.notipsy = true;\n }\n \... | [
"0.7080679",
"0.67071426",
"0.65830874",
"0.65192425",
"0.64516073",
"0.6359922",
"0.62222725",
"0.61944866",
"0.6146152",
"0.61056966",
"0.61026746",
"0.6089691",
"0.6047266",
"0.6043668",
"0.6039741",
"0.6033506",
"0.6029766",
"0.6020681",
"0.60179174",
"0.5996758",
"0.5968... | 0.7154146 | 0 |
Saves if legend is shown by user or not | function saveLegend(legend){
$.ajax({
method: "post",
dataType: "json",
url: "/" + gon.current_user_username + "/poolToolLegend",
data: {legend: legend},
})
.success(function(data){
// Do not show any message to user
})
.error(function(data){
// Do not show any me... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get legendShow() {\n return this._legendShow;\n }",
"function setShowLegend(showLegend, dst) {\n if (showLegend === undefined) {\n // If the default was auto, make a choice for this field\n var isAutoByDefault = DEFAULTS.showLegend === undefined;\n\n if (isAutoByDefault) {\n //... | [
"0.6780338",
"0.65853363",
"0.65853363",
"0.64746654",
"0.64739823",
"0.6447188",
"0.62954235",
"0.62512845",
"0.62311834",
"0.6227157",
"0.6212198",
"0.6116324",
"0.609679",
"0.6043531",
"0.60398746",
"0.60398746",
"0.60398746",
"0.60398746",
"0.60398746",
"0.60398746",
"0.6... | 0.6879835 | 0 |
Initialize the Datepickers (add new booking & edit existing booking). Also add an eventlistener for updating the datepicker if the user changes the listing in the 'add new booking form' | function initializeDatepickers(){
window.ST.set_datepicker_language(gon);
// Get booked dates for
// Set the first listing as checked and initialize datepicker with the booked dates of this listing
var booked_dates = [];
$('input:radio[name=listing_id]:first').prop('checked',true);
var listing_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initDatePickers(){\n $('.datepickerhotelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date')... | [
"0.7049368",
"0.68842757",
"0.68633693",
"0.68633693",
"0.6703704",
"0.6581875",
"0.656846",
"0.65046495",
"0.6478885",
"0.63650125",
"0.62821454",
"0.62818176",
"0.622822",
"0.62117434",
"0.6183927",
"0.6169634",
"0.61429006",
"0.61429006",
"0.61167854",
"0.61095387",
"0.610... | 0.78478754 | 0 |
Initializes the second Datebicker with the 'booked_dates' array | function updateDatepicker2(booked_dates, start_date){
window.ST.initializeDatePickerWithBookings('#datepicker2', booked_dates, '#start-on2', '#end-on2', "#booking-start-output2", "#booking-end-output2", start_date);
$('#datepicker2').datepicker('update');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeDatepickers(){\n window.ST.set_datepicker_language(gon);\n\n // Get booked dates for\n // Set the first listing as checked and initialize datepicker with the booked dates of this listing\n var booked_dates = [];\n $('input:radio[name=listing_id]:first').prop('checked',true);\n ... | [
"0.6745728",
"0.6497647",
"0.62593764",
"0.59082115",
"0.5875161",
"0.57047033",
"0.5672296",
"0.56606513",
"0.56365156",
"0.5557711",
"0.5557711",
"0.54643625",
"0.54643625",
"0.5442725",
"0.53501296",
"0.53381",
"0.53014874",
"0.529915",
"0.5240126",
"0.5204685",
"0.5202379... | 0.6816188 | 0 |
Initializes the jquery gantt plugin with the listings and their transactions. Since gon.devices only hold the devices with transactions & gon.open_listings only hold all open listings, but no transactions, those two arrays are merged and then taken as source for initializing the gantt chart. | function initializeGantt(){
var source = jQuery.extend(true, [], gon.devices); // deep copy - we don't change the gon.devices array
var today = new Date();
var today_ms = Math.round(today.getTime());
var today_minus_3 = new Date(new Date(today).setMonth(today.getMonth()-3));
var today_minus_3_ms =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateGanttChart(source){\n source = source || gon.source;\n\n var count_extern = 0;\n for (var oo = 0; oo < source.length; oo++){\n if (source[oo].desc === \"extern\"){\n count_extern ++;\n }\n }\n gon.count_extern_listings = count_extern;\n\n $(\".gantt\").gantt({\n ... | [
"0.6015409",
"0.5680297",
"0.55403435",
"0.5397176",
"0.5378229",
"0.52786595",
"0.52734476",
"0.51581305",
"0.5125904",
"0.5090532",
"0.5038947",
"0.49810395",
"0.49737918",
"0.49711302",
"0.49601305",
"0.49429303",
"0.4937069",
"0.49278578",
"0.4920361",
"0.4914766",
"0.490... | 0.8307364 | 0 |
Creates an object which hold the device location alias for a specific date and adds this object to the global gon variable. This is needed because we need to show where the device is at a certain date. All listings with transactions are stored within the gon.devices variable. Each transaction has a 'starter' and this u... | function initializeListingDateLocationService(){
var listingDateLocation = {};
gon.devices.forEach(function(dev_with_trans){
// go through each transaction of listing
dev_with_trans.values.forEach(function(trans){
// we create listing-location objects where the key is always a date string
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tunits: 'metric'\n \t}\n }",
"function location() {\n return {\n id: utils.uuid(),\n name: domainEnti... | [
"0.5140637",
"0.51323473",
"0.5004182",
"0.500324",
"0.50018483",
"0.4995206",
"0.4899814",
"0.4895729",
"0.48559245",
"0.48267704",
"0.4811035",
"0.48079166",
"0.4792498",
"0.47859895",
"0.47800076",
"0.47616184",
"0.4757761",
"0.4749457",
"0.47476894",
"0.473735",
"0.473616... | 0.69305766 | 0 |
Search for the given term within the source of jquery GanttChart & updates the ganttchart | function search(term, force_search){
var source = jQuery.extend(true, [], gon.source); // deep copy - we don't change the gon.source array
force_search = force_search || false;
// Search for booking id (actually tx id)
if (term.indexOf("BID=") === 0){
searchTermOld = term;
var booking_id =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateGanttChart_with_search(){\n var value = $('#poolTool_search').val();\n search(value, true);\n }",
"function search_update_gantt(term, source){\n if (term.length > 2){\n for (var x = 0; x < source.length; x++){\n var re = new RegExp(term, \"i\");\n var remove1 = false;\... | [
"0.7249519",
"0.6331251",
"0.6047723",
"0.57504416",
"0.57176626",
"0.5690596",
"0.56414056",
"0.5619205",
"0.5610451",
"0.5582106",
"0.5569679",
"0.55331755",
"0.5526773",
"0.5498924",
"0.5468046",
"0.5464924",
"0.54441667",
"0.5420965",
"0.54140776",
"0.53201187",
"0.530248... | 0.643236 | 1 |
Search the term within the gantt chart and remove rest | function search_update_gantt(term, source){
if (term.length > 2){
for (var x = 0; x < source.length; x++){
var re = new RegExp(term, "i");
var remove1 = false;
var remove2 = false;
var remove3 = false;
var remove4 = false;
var remove5 = true;
var remove6... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterTodos (term) {\n\n\n // Make an Array of tasks\n\n Array.from(list.children)\n // filter tasks list to hide the list item that doesn't include the (Searched Term)\n .filter( item=> !item.textContent.toLowerCase().includes(term))\n // add the filter class that hide this ... | [
"0.58950275",
"0.5835368",
"0.58028907",
"0.5727194",
"0.5697304",
"0.5691231",
"0.56487125",
"0.56466067",
"0.56258",
"0.5599492",
"0.55667484",
"0.5498592",
"0.54612315",
"0.5412332",
"0.54111654",
"0.5408889",
"0.54038495",
"0.53977746",
"0.53977746",
"0.539276",
"0.533155... | 0.683623 | 0 |
Search the listings in the booking dialog and remove rest | function search_update_booking_dialog(){
var listings = $('.home-fluid-thumbnail-grid-item');
// show all
listings.show();
// hide specific
listings.each(function(index, element){
var listingid = $(element).data("listingid");
var visible = false;
gon.search_source.forEach(functi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove_old_bookings(bookings){\n for(var i=0; i<bookings.length; i++){\n for(var j=i+1; j<bookings.length; j++){\n if (bookings[i].listing_id === bookings[j].listing_id){\n // Remove the booking, which has the earlier return date\n if (new Date(bookings[i].end_on) < new Da... | [
"0.6221696",
"0.5962448",
"0.57473385",
"0.57343847",
"0.5710346",
"0.5634319",
"0.562818",
"0.5622446",
"0.55882585",
"0.5560492",
"0.55365896",
"0.5526575",
"0.5486548",
"0.54660743",
"0.5448273",
"0.5434762",
"0.5432675",
"0.54116285",
"0.53847724",
"0.53839654",
"0.537021... | 0.6644485 | 0 |
This function actually initializes and updates the jquery gantt chart, but also keeps the search term in mind. | function updateGanttChart_with_search(){
var value = $('#poolTool_search').val();
search(value, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chargerGantt(source){\n\n $(\".gantt\").gantt({\n source: source ,\n scale: \"days\",\n\tminScale: \"days\",\n\tmaxScale: \"months\",\n navigate: \"scroll\",\n months : \t[\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre... | [
"0.6394416",
"0.5977889",
"0.58998096",
"0.58791625",
"0.58387417",
"0.5802914",
"0.57967585",
"0.57416946",
"0.57278633",
"0.56920534",
"0.5654179",
"0.56529045",
"0.5615844",
"0.5595704",
"0.55955535",
"0.5594405",
"0.5571863",
"0.55581427",
"0.55442256",
"0.55147755",
"0.5... | 0.71500206 | 0 |
Initializes the radio button listing device picker by defining an onclick event handler | function initialize_device_picker(){
$('.pooltool_grid_item_modifier_class').on('vclick', function(ev){
ev.preventDefault();
if(ev.currentTarget.nextElementSibling && ev.currentTarget.nextElementSibling.className === "radiobutton_griditem"){
ev.currentTarget.nextElementSibling.firstElementChild.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\nvar hiddenStatus = document.getElementById('hiddenstatus');\n\n\tvar selectedRadioBtn = selectedRadio();\n\n\tif(selectedRadioBtn != false)\n\t{\n\tdoubleClick(selectedRadioBtn);\n\tdoubleClick(selectedRadioBtn);\n\t}\n\telse\n\t{\n\t\t//no option exsit\n\t\tconsole.log(\"no option exist\");\n\t... | [
"0.65132487",
"0.6470715",
"0.63060606",
"0.62689817",
"0.61648625",
"0.61648625",
"0.61004114",
"0.60924786",
"0.6050404",
"0.6041752",
"0.6009625",
"0.5977372",
"0.570403",
"0.56849986",
"0.56849986",
"0.56784785",
"0.5667919",
"0.5654066",
"0.5649135",
"0.5603775",
"0.5571... | 0.7594627 | 0 |
Calls check orientation function and adds eventlistener to window for orientationchange event. | function initializeCheckOrientation(){
window.addEventListener("orientationchange", function() {
setTimeout(function(){
check_orientation();
}, 150);
});
check_orientation();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handler() {\n // Get the current orientation.\n var orientation = get_orientation();\n\n if (orientation !== last_orientation) {\n // The orientation has changed, so trigger the orientationchange event.\n last_orientation = orientation;\n ... | [
"0.7317187",
"0.72900575",
"0.71294844",
"0.7026402",
"0.69581646",
"0.6907756",
"0.67423767",
"0.6607498",
"0.65638953",
"0.6515665",
"0.6489561",
"0.6433405",
"0.6411621",
"0.63959634",
"0.6309199",
"0.6309199",
"0.62557095",
"0.62525773",
"0.62493646",
"0.6222584",
"0.6201... | 0.81387895 | 0 |
Returns matched elements by given type | allMatchedElements(searchByType){
if ( ! searchByType ){
return this.matchedElements;
}
var elements = [];
for ( var i = 0; i < this.matchedElements.length; i++ ) {
if ( searchByType in this.matchedElements[i].getPointerSettings() ){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"elementsOfType(types) {\n return _.chain(this.getTableEntries())\n .filter(e => {\n var elemType = getElemFieldVal(e, FIELD_TYPE);\n return _.includes(types, elemType);\n })\n .map(e => {\n return getElemFieldVal(e, FIELD_NAME);\n })\n .value();\n }",
"getElement... | [
"0.7081699",
"0.6942723",
"0.63170224",
"0.63080907",
"0.63060915",
"0.62327784",
"0.619777",
"0.619777",
"0.619777",
"0.619777",
"0.619777",
"0.619777",
"0.61726224",
"0.61424744",
"0.60605335",
"0.59467816",
"0.59044504",
"0.58863354",
"0.58857995",
"0.58772516",
"0.5856239... | 0.7204963 | 0 |
receive packets from remote end | function receiver() {
if (self.readyState > WebSocketXHR.OPEN) return
recv = request(url, 'GET', null, function (err, result) {
if (err) {
// aborted request?
if (err.code === 0) {
// disconnect the socket with wasClean: true if it is open
disconnect(self.readyState !==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function do_recv() {\n\t\tconsole.log(\">> do_recv\");\n\t\tif(ws.rQlen() >= 1024) {\n\t\t\tmoreMsgs = true;\n\t\t} else {\n\t\t\tmoreMsgs = false;\n\t\t}\n\t\tvar arr = ws.rQshiftBytes(ws.rQlen()), chr;\n\t\twhile (arr.length > 0) {\n\t\t\tchr = arr.shift();\n\t\t\tlargeMsg += String.fromCharCode(chr); \n\t\t}... | [
"0.62659746",
"0.612317",
"0.59360164",
"0.59352076",
"0.5787072",
"0.5772995",
"0.57229435",
"0.56786656",
"0.56177455",
"0.5566354",
"0.55134535",
"0.5451673",
"0.54441345",
"0.54232943",
"0.5417417",
"0.54087406",
"0.5405805",
"0.53970337",
"0.53929",
"0.537397",
"0.535496... | 0.62977684 | 0 |
api doesn't save name in schedule endpoint for 'sleep' type for some reason, need to get it through resourcelinks endpoint resource links dont work for other types, got to get the other names the regular way | findName() {
const { resources, id } = this.props;
if (resources && id) {
let name = "";
let found = false;
objectToArray(resources).forEach(resource => {
found = resource.links.some(link => {
return link === "/schedules/" + id;
});
if (found) {
name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSleep(steps, ser) {\n\t up.sleeps.get({}, function(err, body) {\n\t //console.log('Body: ' + body);\n\t sleep_me = JSON.parse(body);\n\t\t dashboard(steps, sleep_me.data.items[0].details.quality, res);\n\t\t});\n\t}",
"async function getSinkSsmName(name = 'woocommerce') {\n const res =... | [
"0.5389892",
"0.53077",
"0.5293399",
"0.5289284",
"0.5150055",
"0.51483244",
"0.51276904",
"0.5093949",
"0.508467",
"0.5080132",
"0.50487584",
"0.50365806",
"0.50314033",
"0.5029262",
"0.50277996",
"0.5014812",
"0.5006819",
"0.49898997",
"0.49840936",
"0.49662906",
"0.4930136... | 0.6647005 | 0 |
////////////////////////////////////////////////////////////// Se evalua toda la cadena cargada en la cinta (tabla), // recorrinedola y mandando a llamar la funcion EvaluateStep // la cual nos alluda a evaluar caracter por caracter // | function Evaluate(id){
chain = $("#tabla" + id + " td");
i = Machines[id].i;
if(!Machines[id].Functions.Acceptable(Machines[id].State) && chain.length > i && Machines[id].Count < 10000){
time = 1000 - $("#rango").val();
result = EvaluateStep(chain[i].textContent.trim(), ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eval( input )\n\t{\n\t\t\n\t\t// 0 -> 15.9, 16 -> 19.9, etc.\n\t\tfunction e_test( a, b, n )\n\t\t{\n\t\t\tif (n >= a && b > n)\n\t\t\t\treturn 1;\n\t\t}\n\t\t\n\t\t/* PURPOSE:\n\t\t@@ evaluate through\n\t\t@@ return position on table\n\t\t*/\n\t\tfunction runthrough( input )\n\t\t{\n\t\t\tfor ( let i=0,b... | [
"0.59137344",
"0.5905907",
"0.5792903",
"0.5743526",
"0.57146966",
"0.5681809",
"0.5647842",
"0.5582574",
"0.55691934",
"0.55264145",
"0.5505961",
"0.55016035",
"0.5487732",
"0.54301775",
"0.5358208",
"0.5331715",
"0.5322921",
"0.5319053",
"0.5311408",
"0.5310781",
"0.5305448... | 0.6408211 | 0 |
fill in code that creates the triangles for a cube with dimensions 1x1x1 on each side (and the origin in the center of the cube). with an equal number of subdivisions along each cube face as given by the parameter subdivisions | function makeCube (subdivisions) {
// fill in your code here.
// delete the code below first.
var side_len = 1 / subdivisions
var start = 0.5
for(var row = 0; row < subdivisions; row++) {
for(var col = 0; col < subdivisions; col++) {
// front
addTriangle (-start + (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeCube (subdivisions) {\n \n // fill in your code here.\n // delete the code below first.\n\n\t//// Old code\n //addTriangle (-0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5);\n\n\t// var A = [-0.5, 0.5, 0.5];\n\t// var B = [ 0.5, 0.5, 0.5];\n\t// var C = [-0.5, -0.5, 0.5];\n\t// var D =... | [
"0.837329",
"0.73807096",
"0.70339346",
"0.69812834",
"0.6894983",
"0.6894983",
"0.6859008",
"0.6857733",
"0.68521017",
"0.68250805",
"0.68220395",
"0.6670592",
"0.6669641",
"0.6618769",
"0.6618532",
"0.6614962",
"0.65929055",
"0.6495117",
"0.64808524",
"0.64792925",
"0.64592... | 0.8284358 | 1 |
fill in code that creates the triangles for a cylinder with diameter 1 and height of 1 (centered at the origin) with the number of subdivisions around the base and top of the cylinder (given by radialdivision) and the number of subdivisions along the surface of the cylinder given by heightdivision. | function makeCylinder (radialDivision, heightDivision){
// fill in your code here.
var heightDivTransformed = 1 / heightDivision;
var rads = radians(360);
var radDivision = rads / radialDivision;
var start = 0.5;
var radius = 0.5;
// makes the base of the cylinder at the top
baseMaker(r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeCylinder (radialdivision,heightdivision){\n // fill in your code here.\n\tvar triangles = [];\n\tvar circ_triangles = []; // Contains triangles from the top and bottom\n\tvar side_triangles = []; // Contains triagnles from the side and \n\n\tvar Bottom_Center = [0, -0.5, 0];\n\tvar Top_Center = [0,... | [
"0.83331484",
"0.7894957",
"0.73782814",
"0.6960461",
"0.67795444",
"0.6691757",
"0.66388756",
"0.6564211",
"0.6525047",
"0.6499509",
"0.6489442",
"0.6453762",
"0.6392167",
"0.6333922",
"0.6300313",
"0.6298295",
"0.62824404",
"0.62377745",
"0.6217063",
"0.6205277",
"0.6197941... | 0.8400233 | 0 |
fill in code that creates the triangles for a cone with diameter 1 and height of 1 (centered at the origin) with the number of subdivisions around the base of the cone (given by radialdivision) and the number of subdivisions along the surface of the cone given by heightdivision. | function makeCone (radialDivision, heightDivision) {
// fill in your code here.
var heightDivTransformed = 1 / heightDivision;
var rads = radians(360);
var radDivision = rads / radialDivision;
var start = 0.5;
var innerRadius = 0.5;
var outerRadius = 0.5;
// makes the base of the cylinde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeCone (radialdivision, heightdivision) {\n // fill in your code here.\n\tvar triangles = [];\n\tvar circ_triangles = []; // Contains triangles from the top and bottom\n\tvar side_triangles = []; // Contains triangles from the side and \n\n\tvar Bottom_Center = [0, -0.5, 0];\n\tvar Apex = [0, 0.5, 0]... | [
"0.7978908",
"0.7500569",
"0.71107817",
"0.7014096",
"0.6676775",
"0.6611506",
"0.6423435",
"0.61504537",
"0.6075379",
"0.6068237",
"0.6057042",
"0.6028118",
"0.5925591",
"0.588171",
"0.5876394",
"0.5753584",
"0.5749783",
"0.5747331",
"0.5741241",
"0.57381165",
"0.5691552",
... | 0.77439463 | 1 |
fill in code that creates the triangles for a sphere with diameter 1 (centered at the origin) with number of slides (longitude) given by slices and the number of stacks (lattitude) given by stacks. For this function, you will implement the tessellation method based on spherical coordinates as described in the video (as... | function makeSphere (slices, stacks) {
// fill in your code here.
var sliceDivision = radians(360) / slices;
var stackDivision = radians(180) / stacks;
var radius = 0.5;
for (var longitude = 0; longitude < radians(360); longitude += sliceDivision) {
for (var latitude = 0; latitude < radians... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeSphere (slices, stacks) {\n // fill in your code here.\n\tvar triangles = [];\n\tvar origin = [0.0, 0.0, 0.0];\n\tconst radius = 0.5;\n\tconst longi_step = radians(360 / slices); // in radian\n\tconst lati_step = radians(180 / stacks); // in radian\n\n\tvar theta = 0.0;\n\t\n\n\tfor (var i=0; i<sli... | [
"0.8593383",
"0.7472863",
"0.70200586",
"0.69014615",
"0.6889358",
"0.6754576",
"0.67332435",
"0.66008836",
"0.6548116",
"0.6509059",
"0.6507935",
"0.6459938",
"0.63842565",
"0.63613063",
"0.63434935",
"0.6336178",
"0.6292412",
"0.6278946",
"0.62735254",
"0.6205755",
"0.62000... | 0.8486747 | 1 |
Compiling the model before it gets used | function compileModel(){
model.compile({
optimizer: tf.train.sgd(0.1),
loss: 'categoricalCrossentropy',
metrics: ['accuracy']
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async compile(settings) {\n const entries = [];\n const cache = new Set();\n for (const source of settings.sources) {\n if (source.package) {\n await Helper_1.loadPackage(source, entries, cache);\n }\n else {\n await Helper_... | [
"0.6338605",
"0.6129089",
"0.6072686",
"0.60014915",
"0.59090304",
"0.58873564",
"0.58722615",
"0.58247066",
"0.5809662",
"0.5785004",
"0.5764027",
"0.57500786",
"0.57095945",
"0.56983477",
"0.56666917",
"0.56501544",
"0.5647224",
"0.56428534",
"0.56360155",
"0.5631222",
"0.5... | 0.6413597 | 0 |
Function to covert the canvas data to the size of mnist data | function canvasToMnistData(){
let x,y,col,ys;
x = y = 0;
xs = [];
// Taking the canvas pixels as input
loadPixels();
for(let index=0 ; index<784 ; index++){
let colors = [];
x = (index*factor)%width;
for(let i=x,p=0 ; p<factor ; i++,p++)
for(let j=y,k=0 ; k<factor ; j++,k++){
let pix = (i + j*width)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canvasSize(target) { \n\t\t\t\t\t//var height = parseFloat(d3.select(target).node().clientHeight)\n\t\t\t\t\tvar width = parseFloat(d3.select(target).node().clientWidth)\n\t\t\t\t\treturn [width]\n\t\t\t\t}//canvasSize",
"function submitCanvas(sendToNeuralNet){\n\n var dataURL = canvas.toDataURL();\n ... | [
"0.62267596",
"0.6190362",
"0.60249764",
"0.5848657",
"0.58452547",
"0.5788113",
"0.5760976",
"0.5672895",
"0.56542104",
"0.560128",
"0.55542845",
"0.5522075",
"0.5511969",
"0.54850304",
"0.54546756",
"0.54492265",
"0.54419565",
"0.5431481",
"0.5422203",
"0.5422016",
"0.53603... | 0.68004096 | 0 |
Function to take in an mnist data and draw it on the canvas | function mnistDataToCanvas(imgPixels){
// Converting the pixel values from 0-1 to 0-255
for(let i=0 ; i<imgPixels.length ; i++)
imgPixels[i] = map(imgPixels[i],0,1,0,255);
let x,y;
x = y = 0;
loadPixels();
for(let index=0 ; index<imgPixels.length ; index++){
x = (index*factor)%width;
if((index+1)%28===0)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static draw(nn, context, inputs){\n context.clearRect(0, 0, context.canvas.width, context.canvas.height)\n\n inputs.forEach( (elem, index) => { // Voir si on peut draw les inputs dans la boucle du dessous où s'il faut vraiment séparer\n context.lineWidth = 1 // A set ailleurs ?\n context.strokeStyl... | [
"0.63085073",
"0.62730384",
"0.62190914",
"0.6122549",
"0.60318786",
"0.5911219",
"0.58916175",
"0.5875574",
"0.57953924",
"0.57662755",
"0.5716319",
"0.57150334",
"0.57091594",
"0.5678888",
"0.56669515",
"0.56537354",
"0.5630986",
"0.55844873",
"0.55458236",
"0.5518791",
"0.... | 0.6850194 | 0 |
Function covert an RGB color to Grayscale value | function RGB2GRAY(col){
let rWeight,gWeight,bWeight;
// Values from Wikipedia page 'Relative Luminance'
rWeight = 0.2126;
gWeight = 0.7152;
bWeight = 0.0722;
return rWeight*col.r + gWeight*col.g + bWeight*col.b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function colorToGrayscale(ctx, canvas) {\n\t\tvar imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n\t\tvar pixels = imgData.data;\n\t\tvar grayscalePixel = new Array(pixels.length / 4);\n\t\tvar j = 0;\n\t\tfor (var i = 0, n = pixels.length; i < n; i += 4) {\n\t\t\t// The Luminance Algorithm - red ... | [
"0.75625896",
"0.7006515",
"0.69198453",
"0.6743763",
"0.67379415",
"0.67181873",
"0.6686748",
"0.6591569",
"0.65358925",
"0.6509556",
"0.6496576",
"0.64577097",
"0.6456255",
"0.6452633",
"0.63872457",
"0.6383216",
"0.63609594",
"0.6341404",
"0.63411665",
"0.6341063",
"0.6310... | 0.76102144 | 0 |
End Animations Begin Utility Functions Sets the Opacity of the currCards shadow | function ShadowOpacity(val, sec) {
cardShadow.style.opacity = val;
cardShadow.style.transition = 'all '+ sec +'s ease-in';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function turnOverAllCards() {\n // alert(\"test\");\n for (var j = 0; j < allCardContainers.length; j++) {\n allCardContainers[j].BackImage.alpha = 1;\n allCardContainers[j].FrontImage.alpha = 0;\n }\n DisplayEndingNot... | [
"0.669512",
"0.6389662",
"0.63700104",
"0.6192161",
"0.6173346",
"0.6136383",
"0.6102483",
"0.6065279",
"0.60127145",
"0.5999915",
"0.59831345",
"0.5962983",
"0.5950323",
"0.5938615",
"0.58968675",
"0.5878621",
"0.58734024",
"0.58649623",
"0.58474874",
"0.5831672",
"0.5825041... | 0.7303402 | 0 |
function that will replace tokens using tokenVals | function replaceTokens(val) {
var token = val.replace(/^@@(.*)@@$/, '$1');
if (tokenVals[token] !== undefined) {
// console.log('token match', token, tokenVals[token]);
return tokenVals[token];
} else {
// console.log('token not found', token);
return val;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processTokens(template,item) {\n var processed = template;\n template.match(/\\%\\%[^\\%]*\\%\\%/g).forEach(function(token) {\n var key = token.replaceAll('%%','');\n processed = processed.replaceAll(token,item.values[key]);\n });\n \n return processed;\n }... | [
"0.6308845",
"0.61842245",
"0.585626",
"0.5819945",
"0.5760256",
"0.5712619",
"0.5673796",
"0.5643139",
"0.5626751",
"0.56243753",
"0.559068",
"0.55811137",
"0.5565204",
"0.5493152",
"0.5414761",
"0.5414761",
"0.54105496",
"0.5389148",
"0.53668725",
"0.53325707",
"0.5327153",... | 0.6860207 | 0 |
OPEN FIRST MENU FUNCTION This is for handling all the buttons that open menus, keeping track of their state and being able to show corresponding icons. | function openFirstMenu(event) {
setIsFirstMenuOpen(!isFirstMenuOpen)
setFirstMenuAnchorEl(event.currentTarget)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openMenu() {\n g_IsMenuOpen = true;\n}",
"function handleOpenMenu() {\n setOpenMenu(!openMenu);\n }",
"function onOpen() {\n createMenu();\n}",
"function openMenu () {\n $(this).toggleClass('open');\n $('ul, .social-links').toggleClass('active open');\n }",
"function openMen... | [
"0.69274616",
"0.65867186",
"0.65395087",
"0.64302975",
"0.6422965",
"0.63732386",
"0.63012564",
"0.63012564",
"0.62915",
"0.6275244",
"0.6253741",
"0.6202761",
"0.62012804",
"0.61777866",
"0.6176375",
"0.6172659",
"0.6138541",
"0.61060596",
"0.6096133",
"0.60518897",
"0.6049... | 0.7266422 | 0 |
HANDLE FIRST MENU INPUT FUNCTION This if for keeping track of the value the user inputs and then render it's corresponding stream. | function handleFirstStreamInput(event) {
setFirstStreamInput(event.target.value)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function InputSection() {\n\n // REACT STATE HOOKS\n\n // FIRST INPUT MENU STATE AND PLACEMENT\n\n const [isFirstMenuOpen, setIsFirstMenuOpen] = useState(false);\n const [firstMenuAnchorEl, setFirstMenuAnchorEl] = useState(false);\n\n // FIRST INPUT TRACKING AND LOCKING\n\n const [firstStreamInpu... | [
"0.6381396",
"0.6155089",
"0.5980951",
"0.5965762",
"0.59330523",
"0.59326774",
"0.5892718",
"0.58173645",
"0.57199156",
"0.5704332",
"0.5704332",
"0.5561847",
"0.55471754",
"0.55409396",
"0.55362105",
"0.5445041",
"0.54446316",
"0.54160285",
"0.5381463",
"0.5366554",
"0.5318... | 0.66292495 | 0 |
LOCK FIRST STREAM INPUT FUNCTION This is used for locking the input once the user has set the name of the streamer, adding it to the stream counter, and for easier handling of how many streams have to render. If the user tries to input nothing, it shows an alert saying that's not possible, making the user not able to m... | function lockFirstStream() {
if (firstStreamInput.length === 0) {
alert("You have to input something before you want to set it")
} else if (firstStreamInput.length >= 1) {
setIsFirstStreamReady(true)
setStreamCount(streamCount + 1)
setIsFirstMenuOpen(false... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lockSecondStream() {\n if (secondStreamInput.length === 0) {\n alert(\"You have to input something before you want to set it\")\n } else if (secondStreamInput.length >= 1) {\n setIsSecondStreamReady(true)\n setStreamCount(streamCount + 1)\n setIsSe... | [
"0.7531852",
"0.7384831",
"0.72406393",
"0.6573817",
"0.59394354",
"0.58911973",
"0.56336546",
"0.5594846",
"0.5493799",
"0.5335857",
"0.5305026",
"0.5137126",
"0.5122092",
"0.50826347",
"0.50753146",
"0.5058752",
"0.5044689",
"0.48844132",
"0.48422447",
"0.48227474",
"0.4808... | 0.8105079 | 0 |
LOCK SECOND STREAM INPUT FUNCTION Idem first input lock function | function lockSecondStream() {
if (secondStreamInput.length === 0) {
alert("You have to input something before you want to set it")
} else if (secondStreamInput.length >= 1) {
setIsSecondStreamReady(true)
setStreamCount(streamCount + 1)
setIsSecondMenuOpen(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lockFirstStream() {\n if (firstStreamInput.length === 0) {\n alert(\"You have to input something before you want to set it\")\n } else if (firstStreamInput.length >= 1) {\n setIsFirstStreamReady(true)\n setStreamCount(streamCount + 1)\n setIsFirstM... | [
"0.6336488",
"0.5990725",
"0.5983909",
"0.58981866",
"0.566131",
"0.554493",
"0.541581",
"0.54025024",
"0.5319787",
"0.52539647",
"0.5201988",
"0.5201988",
"0.5201988",
"0.51910067",
"0.515772",
"0.5139369",
"0.51089567",
"0.5081495",
"0.5015427",
"0.5003813",
"0.49804008",
... | 0.69183475 | 0 |
OPEN THIRD MENU FUNCTION Idem first menu function | function openThirdMenu(event) {
setIsThirdMenuOpen(!isThirdMenuOpen)
setThirdMenuAnchorEl(event.currentTarget)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onOpen() {\n createMenu();\n}",
"function Vmenu2()\r\n{\r\n\twindow.colorlink = $(\"a.tablelinkssearch\").css(\"color\");\r\n\t$('.Vmenu2 ul li a').hover(\r\n\tfunction()\r\n\t{\r\n\t\tif($(this).parent().attr('class')!='hr')\r\n\t\t\t$(this).addClass('menu_active');\r\n\t},\r\n\tfunction()\r\n\t{\r\n\... | [
"0.66388404",
"0.6633626",
"0.65686214",
"0.65476996",
"0.6515741",
"0.6434699",
"0.63745576",
"0.633852",
"0.63021964",
"0.62845325",
"0.6273995",
"0.6240128",
"0.6218447",
"0.6202148",
"0.6161461",
"0.61532414",
"0.6136682",
"0.61321616",
"0.6125013",
"0.61202145",
"0.61157... | 0.6720581 | 0 |
LOCK THIRD STREAM INPUT FUNCTION Idem first input lock function | function lockThirdStream() {
if (thirdStreamInput.length === 0) {
alert("You have to input something before you want to set it")
} else if (thirdStreamInput.length >= 1) {
setIsThirdStreamReady(true)
setStreamCount(streamCount + 1)
setIsThirdMenuOpen(false... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lockSecondStream() {\n if (secondStreamInput.length === 0) {\n alert(\"You have to input something before you want to set it\")\n } else if (secondStreamInput.length >= 1) {\n setIsSecondStreamReady(true)\n setStreamCount(streamCount + 1)\n setIsSe... | [
"0.6279172",
"0.6179239",
"0.61352396",
"0.5894056",
"0.58694386",
"0.5568391",
"0.5539337",
"0.54490525",
"0.5433782",
"0.5410476",
"0.53832024",
"0.53321797",
"0.52589977",
"0.52493924",
"0.5240933",
"0.5240933",
"0.5240933",
"0.5237644",
"0.52088517",
"0.5178756",
"0.51774... | 0.6742344 | 0 |
OPEN FOURTH MENU FUNCTION Idem first menu function | function openFourthMenu(event) {
setIsFourthMenuOpen(!isFourthMenuOpen)
setFourthMenuAnchorEl(event.currentTarget)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onOpen() {\n createMenu();\n}",
"function basicMenu() {\nif (advancedMenuIsOpen)\n{closeAdvancedMenu()}\nelse {\n if (basicMenuIsOpen) {\n closeBasicMenu();\n } else {\n openBasicMenu();\n }\n}\n}",
"function myFunction(){\r\n if(location.href === \"http://localhost/thefabexperience/index.h... | [
"0.6365132",
"0.633065",
"0.62412065",
"0.6203941",
"0.6061971",
"0.60570395",
"0.6030276",
"0.6013536",
"0.59882176",
"0.59515214",
"0.5943057",
"0.59328425",
"0.5927345",
"0.59116477",
"0.59058046",
"0.58909065",
"0.5888991",
"0.5874572",
"0.582302",
"0.5815687",
"0.5806436... | 0.6694508 | 0 |
LOCK FOURTH STREAM INPUT FUNCTION Idem first input lock function | function lockFourthStream() {
if (fourthStreamInput.length === 0) {
alert("You have to input something before you want to set it")
} else if (fourthStreamInput.length >= 1) {
setIsFourthStreamReady(true)
setStreamCount(streamCount + 1)
setIsFourthMenuOpen(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lockThirdStream() {\n if (thirdStreamInput.length === 0) {\n alert(\"You have to input something before you want to set it\")\n } else if (thirdStreamInput.length >= 1) {\n setIsThirdStreamReady(true)\n setStreamCount(streamCount + 1)\n setIsThirdM... | [
"0.64017624",
"0.6282493",
"0.6248737",
"0.5948272",
"0.56110513",
"0.5578666",
"0.5555921",
"0.5515829",
"0.5359173",
"0.5344077",
"0.5341662",
"0.52947944",
"0.5288994",
"0.52868026",
"0.5271054",
"0.5257562",
"0.5202465",
"0.5202465",
"0.5202465",
"0.5202426",
"0.5202306",... | 0.67499864 | 0 |
Read track data from file and fill data | function /*void*/ PrepareTrack()
{
FlushChanges();
trackchanged = false;
status |= st.MOREDATA;
D.p = 0;
D.datatrack = track;
D.dataside = side;
// Track has 10 sectors, 512 bytes each; offset of the file is === ((Track<<1)+SIDE)*5120
var /*long*/ offset = ((track<<1) + side) * 5120;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MIDIFileTrack(buffer, start, strictMode) {\n\t\t\t\t// no buffer, creating him\n\t\t\t\tif (!buffer) {\n\t\t\t\t\tvar a = new Uint8Array(12);\n\t\t\t\t\t// Adding the empty track header (MTrk)\n\t\t\t\t\ta[0] = 0x4D; a[1] = 0x54; a[2] = 0x72; a[3] = 0x6B;\n\t\t\t\t\t// Adding the empty track size (4)\n\t\... | [
"0.56649077",
"0.557804",
"0.55518615",
"0.544713",
"0.54396456",
"0.54197735",
"0.53771996",
"0.53754234",
"0.52869946",
"0.5283771",
"0.5273866",
"0.5212918",
"0.5200081",
"0.518416",
"0.518416",
"0.51689756",
"0.5160476",
"0.5158537",
"0.515344",
"0.5151201",
"0.51231545",... | 0.6532322 | 0 |
Decode track data from raw data Raw is array[Sz=6250] of bytes Dest is array of 5120 bytes Returns: true decoded, false parse error /bool | function DecodeTrackData(/*uint8_t[]*/ Dest)
{
var Raw = D.data;
var /*uint16_t*/ p=0, r=0; // Offsets in data array
while( p<Sz )
{
while (p < Sz && Raw[p] == 0x4e) p++; // Skip GAP1 or GAP3
if (p >= Sz) break; // End of track or error
while (p < Sz && Raw[p] == 0) p++; // Ski... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decodeStream ( binary ) {\n this.offset = 0;\n this.buf = binary;\n var self = this;\n\n this.remainingLength = function() {\n return self.buf.length - self.offset;\n };\n\n this.remainingData = function() {\n if (self.buf.length == self.offset) {\n return new Ui... | [
"0.56601304",
"0.56258297",
"0.5616327",
"0.54482156",
"0.5421875",
"0.54073095",
"0.5377758",
"0.53711027",
"0.5364098",
"0.5359428",
"0.53459406",
"0.5307697",
"0.5232154",
"0.5232154",
"0.5232154",
"0.5232154",
"0.5205563",
"0.5197221",
"0.5189469",
"0.51695496",
"0.516226... | 0.756769 | 0 |
TODO: Need to figure out how to zoom a camera out over a longer time period | function performCameraZoom(cameraScope : Camera, endpoint : float, t : float) {
if (isOrthographic) {
cameraScope.orthographicSize = Mathf.Lerp(cameraScope.orthographicSize, endpoint, t);
} else {
cameraScope.fieldOfView = Mathf.Lerp(cameraScope.fieldOfView, endpoint, t);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zoom() {\n const speed = 2;\n if (Date.now() - lastUpdate > mspf) {\n let e = window.event || e; // old IE support\n let delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n\n cameraDistance += delta * speed;\n cameraDistance = Math.min(Math.max(cameraDistanc... | [
"0.73686004",
"0.7329772",
"0.6990734",
"0.6913559",
"0.69052136",
"0.6832202",
"0.6754492",
"0.6625295",
"0.6612208",
"0.66035926",
"0.65750307",
"0.64732975",
"0.6457959",
"0.6457016",
"0.6434753",
"0.6434583",
"0.6424044",
"0.6422944",
"0.64219916",
"0.6416957",
"0.6380106... | 0.7339368 | 1 |
// WanwanRelay Event binding controller | function WanwanRelay() {
this.signals = {};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bindListener() {\n MxWcEvent.listenInternal('actived', performWhenActived);\n MxWcEvent.listenInternal('selecting', performWhenSelecting);\n MxWcEvent.listenInternal('completed', performWhenCompleted);\n MxWcEvent.listenInternal('idle', performWhenIdle);\n}",
"_bindEvents () {\n this.channel.on('... | [
"0.47772563",
"0.47673136",
"0.47634938",
"0.47322527",
"0.47215426",
"0.4716571",
"0.4631082",
"0.46179172",
"0.4556949",
"0.4513386",
"0.45022452",
"0.44661567",
"0.44538468",
"0.44332957",
"0.4424911",
"0.44166192",
"0.4411792",
"0.44030058",
"0.43702692",
"0.4369443",
"0.... | 0.69146895 | 0 |
/// WanwanIO Data encoder/decoder object // // Used to convert arbitrary text (and potentially binary) data // to and from ascii. | function WanwanIO() {
this.fromHex = [];
for(var i = 0; i < 103; ++i) this.fromHex.push(0);
this.fromHex[48] = 0;
this.fromHex[49] = 1;
this.fromHex[50] = 2;
this.fromHex[51] = 3;
this.fromHex[52] = 4;
this.fromHex[53] = 5;
this.fromHex[54] = 6;
this.fromHex[55] = 7;
this.fro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function TextData() {}",
"function TextData() {}",
"function TextData() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encoder() {}",
"function Encode... | [
"0.5829878",
"0.5829878",
"0.5829878",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
"0.57961625",
... | 0.64470625 | 0 |
/////////// WanwanClient controls network interactions with the server | function WanwanClient(cgiURL) {
this.index = 0;
this.updateRequest = null;
this.updateCycleTime = 8500;
this.url = cgiURL;
this.messages = [];
this.initialized = false;
this.userName = "Anon.";
this.channelName = "Lobby";
this.onWANWANMSG = function(name, mess... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setWanMode(mode) {\n\tvar changed = (uci['network']['wan']['mode'] == mode);\n\tif (mode == 'static' || mode == 'bridge') {\n\t\tuci['network']['wan']['mode'] = mode;\n\t\tuci['network'].pchanged = changed;\n\t}\n}",
"function WanwanRelay() {\n this.signals = {};\n}",
"function wst_client() {\n ... | [
"0.6225101",
"0.6219392",
"0.61748224",
"0.60559165",
"0.59657943",
"0.59055275",
"0.5899837",
"0.58663845",
"0.58604866",
"0.5732224",
"0.57123256",
"0.5687418",
"0.5687418",
"0.5687418",
"0.5687418",
"0.5687418",
"0.566118",
"0.5657099",
"0.5631512",
"0.5611902",
"0.5591196... | 0.69296265 | 0 |
helperFunction to create a mousedown function which triggers the event specified in `eventName` | function getMoseDownFunc(eventName) {
return function (ev) {
ev = ev || window.event;
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
ev.stopPropagation();
var x = ev.pageX || ev.touches[0].pageX;
var y = ev.pageY || ev.touches[0].pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMoseDownFunc(eventName) {\n return function (ev) {\n ev = ev || window.event;\n ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;\n ev.stopPropagation();\n\n var x = ev.pageX || ev.touches[0].pageX;\n var y = ev.p... | [
"0.70313853",
"0.6546621",
"0.6546621",
"0.63564134",
"0.63497967",
"0.63497967",
"0.63075376",
"0.62737864",
"0.61953616",
"0.6117186",
"0.61067873",
"0.61067873",
"0.6085307",
"0.6067923",
"0.6016568",
"0.60135347",
"0.59930176",
"0.5968794",
"0.5955142",
"0.59549016",
"0.5... | 0.69997644 | 1 |
Returns database metric definitions. | _listMetricDefinitions(resourceGroupName, serverName, databaseName, options) {
return this.client.sendOperationRequest({ resourceGroupName, serverName, databaseName, options }, listMetricDefinitionsOperationSpec);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMetrics() {\n return Array.from(this._metrics.values())\n .map(metric => metric.get())\n .filter(Utils_1.notNull);\n }",
"get_metrics() {\n let result = [];\n let regex_assigned = /^\\s{0,}[^\\#]\\s{0,}write.*Metric\\w*\\(\\\"(.*?)\\\".+$/gm;\n let match;\n... | [
"0.5808149",
"0.5782453",
"0.5743999",
"0.56635857",
"0.555513",
"0.5523191",
"0.5466424",
"0.5336772",
"0.5258129",
"0.52579415",
"0.52528435",
"0.52135295",
"0.5197937",
"0.5197937",
"0.5197937",
"0.516921",
"0.51409525",
"0.51120806",
"0.51051944",
"0.50850964",
"0.5085096... | 0.6416882 | 0 |
Upgrades a data warehouse. | beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options) {
return __awaiter(this, void 0, void 0, function* () {
const directSendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
return this.client.sendOperationRequest(args, spec);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeWarehouse(event) {\n warehouseProducts = $H([]);\n $(hiddenInputField).value = Object.toJSON(warehouseProducts);\n var warehouseId = event.target.value;\n var params = {'warehouse_id': warehouseId};\n if(warehouseId && warehouseId!=0){\n ... | [
"0.5447572",
"0.53510153",
"0.52737993",
"0.5187416",
"0.51801926",
"0.50848854",
"0.5074346",
"0.5036647",
"0.49776834",
"0.49670377",
"0.4949485",
"0.49348846",
"0.4930252",
"0.4906334",
"0.48942614",
"0.4881628",
"0.48762694",
"0.48463082",
"0.48432645",
"0.4841771",
"0.48... | 0.5859051 | 0 |
Finally, test a single item property. A single input field from user is match against the related item property The test is based on the DATA TYPE of the content of property | function testSinglePropertyOfItem(singlePropValue, singlePropValueRequired) {
const singlePropValueType = typeof singlePropValue;
switch (singlePropValueType) {
case 'string' :
return singlePropValue.search(new RegExp(singlePropValueRequired, 'i')) > -1;
case 'bool' :
return singlePropValue ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testItem(item, allPropertiesRequireds) {\n const prepareToPropTest = Object.entries(allPropertiesRequireds);\n return prepareToPropTest.every(singleRequire => {\n const propertyNameInJSON = singleRequire[0];\n const singlePropValueRequired = singleRequire[1];\n if(singlePropValueRequired === ''... | [
"0.6988403",
"0.5849656",
"0.5837109",
"0.567189",
"0.55465347",
"0.5524566",
"0.5515559",
"0.54899305",
"0.5448027",
"0.5444745",
"0.5379439",
"0.5349001",
"0.5349001",
"0.5349001",
"0.5349001",
"0.5275559",
"0.5252617",
"0.52503014",
"0.5241848",
"0.51978177",
"0.5193024",
... | 0.66087824 | 1 |
Prepare item's property to be tested. Each property of the item need pass the whole test set. (test set: all the input fields from user) | function testItem(item, allPropertiesRequireds) {
const prepareToPropTest = Object.entries(allPropertiesRequireds);
return prepareToPropTest.every(singleRequire => {
const propertyNameInJSON = singleRequire[0];
const singlePropValueRequired = singleRequire[1];
if(singlePropValueRequired === '') return t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testItem() {\n\t\tthis.Question;\n\t\tthis.RightUnswer;\n\t\tthis.Unswers;\n\t}",
"setTestItem(testItem) {\n this.testItem = testItem;\n }",
"prepareItems(items) {\n if(!items)\n return items;\n \n if (items.total_count)\n this.total_count = items.total_count;\n \n if(items.i... | [
"0.61892444",
"0.58776224",
"0.5681743",
"0.54486203",
"0.54034275",
"0.5383684",
"0.53825116",
"0.53825116",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53701997",
"0.53538215",
"0.5350412",
... | 0.65348405 | 0 |
Handles on reset filters event | function onResetFilters() {
$rootScope.$broadcast('search-input_reset');
ctrl.filtersCounter = 0;
$timeout(paginateFunctions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onResetFilters() {\n $rootScope.$broadcast('search-input_reset');\n\n ctrl.filtersCounter = 0;\n }",
"onFiltersCleared() {\n }",
"resetFilters () {\n this.setFilters({});\n }",
"function resetFilters() {\n\tfilterOptions[0] = \"\";\n\tfilterOptions[1] = \"\";\n\tfil... | [
"0.8443182",
"0.78093785",
"0.7741744",
"0.75290173",
"0.7518077",
"0.71844137",
"0.7178981",
"0.7139352",
"0.7134391",
"0.70502174",
"0.7038859",
"0.6961156",
"0.69427115",
"0.69394255",
"0.69226617",
"0.69223315",
"0.692041",
"0.68917805",
"0.68528605",
"0.68457335",
"0.681... | 0.80929255 | 1 |
Navigates to New Function screen | function openNewFunctionScreen() {
$state.go('app.project.create-function');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddNewDetail() {\r\n navigation.navigate('DetailRegister', { edit: false, step: {} });\r\n }",
"function nextScreen(navigation,id,name,desc){\r\n if(name==''){alert('Enter a valid name')}\r\n navigation.navigate('Create2',{id:id,name:name,desc:desc})\r\n}",
"function handleAddNewQuizBtnClick... | [
"0.6609566",
"0.65789574",
"0.6298614",
"0.6290502",
"0.61642075",
"0.61640286",
"0.61128974",
"0.6075938",
"0.60655975",
"0.60587454",
"0.600822",
"0.59327006",
"0.59184355",
"0.5913198",
"0.58836085",
"0.58451337",
"0.5828895",
"0.58279127",
"0.581647",
"0.5806999",
"0.5806... | 0.8333707 | 0 |
Init data for pagination | function initPagination() {
ctrl.page = {
number: ctrl.page.number || 0,
size: 10
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _pagination_setPageData() {\r\n var _pagination = _data['pagination'];\r\n\r\n var _startIdx = _pagination['currentPage'] * _pagination['numElementsPerPage'];\r\n\r\n _pagination['current']['elyos'].empty().pushAll(_data['elyos'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage'... | [
"0.77555394",
"0.7536357",
"0.7397742",
"0.73666",
"0.7284916",
"0.71299994",
"0.7075551",
"0.7068393",
"0.7038418",
"0.69673055",
"0.6962627",
"0.6895064",
"0.68749034",
"0.68638444",
"0.68614733",
"0.6791007",
"0.6785308",
"0.67323375",
"0.6696731",
"0.6677227",
"0.6632668"... | 0.7972276 | 0 |
Opens a splash screen on start change state | function stateChangeStart() {
ctrl.isSplashShowed.value = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function start(){\n registerScreens()\n Navigation.events().registerAppLaunchedListener(() => {\n Navigation.setRoot({\n root: {\n component: {\n name: \"hrms_splash\"\n }\n \n }\n });\n\n \n});\n}",
"function loadSplashScreen(){\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tgenerateF... | [
"0.7297202",
"0.7225134",
"0.71728194",
"0.6934217",
"0.67714816",
"0.6755628",
"0.6715574",
"0.6685538",
"0.6598962",
"0.6556853",
"0.65294695",
"0.6516221",
"0.64902407",
"0.640535",
"0.6402438",
"0.63050973",
"0.6271906",
"0.6269749",
"0.62374413",
"0.6224217",
"0.6217943"... | 0.79107225 | 0 |
Opens a splash screen on error change state | function stateChangeError() {
ctrl.isSplashShowed.value = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static show_maybe(){\n if(!persistent_get(\"dont_show_splash_screen_on_launch\")){\n this.show()\n }\n }",
"function stateChangeStart() {\n ctrl.isSplashShowed.value = true;\n }",
"function loadSplashScreen(){\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tgenerateFram... | [
"0.6531963",
"0.6439571",
"0.6313499",
"0.6180246",
"0.60318124",
"0.6028382",
"0.59937704",
"0.59707266",
"0.59194183",
"0.59059423",
"0.58861697",
"0.58821",
"0.58628404",
"0.58618546",
"0.58506435",
"0.5805332",
"0.579825",
"0.57971704",
"0.5788468",
"0.57878447",
"0.57593... | 0.7508842 | 0 |
Set switch target state on received MQTT command message | setLightState(message) {
this.debug(`Received set light state ${message}`)
const command = message.toLowerCase()
switch(command) {
case 'on':
case 'off': {
const duration = this.data.beam_duration ? Math.min(this.data.beam_duration, 32767) : undefined
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setOutletState(message, outletId) {\n this.debug(`Received set ${outletId} state ${message}`)\n const command = message.toLowerCase()\n switch(command) {\n case 'on':\n case 'off': {\n const duration = 32767\n const data = Boolean(command ===... | [
"0.6629539",
"0.61038333",
"0.6046437",
"0.5964267",
"0.5956304",
"0.5953282",
"0.5929758",
"0.592229",
"0.5900674",
"0.5900674",
"0.5900674",
"0.58957916",
"0.58272636",
"0.5800418",
"0.57822347",
"0.57729954",
"0.5749702",
"0.57366496",
"0.5649701",
"0.56157976",
"0.5612072... | 0.6512325 | 1 |
get the last parsed nonwhitespace character | function lastNonWhitespace () {
var p = chars.length - 1;
while (p >= 0) {
var pp = chars[p];
if (pp !== ' ' && pp !== '\n' && pp !== '\r' && pp !== '\t') { // non whitespace
return pp;
}
p--;
}
return '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lastCharacter(str) {\n return str[str.length - 1];\n}",
"findTrailingNonWhitespace(content) {\n // loop back to find the first non-whitespace character\n let index = content.length;\n whitespaceCheck: for (let i = content.length - 1; i >= 0; i--) {\n switch (content.ch... | [
"0.6549014",
"0.6394939",
"0.6371526",
"0.6366703",
"0.6366357",
"0.6256205",
"0.62115884",
"0.62095183",
"0.617752",
"0.6164136",
"0.6163371",
"0.6098467",
"0.60952395",
"0.60952395",
"0.60952395",
"0.60952395",
"0.60952395",
"0.60952395",
"0.6091612",
"0.6084325",
"0.608432... | 0.82441264 | 0 |
skip a block comment '/ ... /' | function skipBlockComment () {
i += 2;
while (i < jsString.length && (curr() !== '*' || next() !== '/')) {
i++;
}
i += 2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function skipCommentAndContinue() {\n nextComment(null, dumpComment);\n}",
"function skip_comment() {\n read_while(function(char) { return char !== \"\\n\" });\n // Skip over newline character\n input.next();\n }",
"function skipComment () {\n i += 2;\n while (i < jsString.leng... | [
"0.7837456",
"0.74249274",
"0.72520953",
"0.7088589",
"0.6598001",
"0.64636326",
"0.6395291",
"0.63084096",
"0.6295755",
"0.62763983",
"0.6267754",
"0.62267524",
"0.62232876",
"0.6171303",
"0.6170326",
"0.6145376",
"0.6138846",
"0.6131949",
"0.60627794",
"0.6003526",
"0.59610... | 0.8521946 | 0 |
parse an unquoted key | function parseKey() {
var specialValues = ['null', 'true', 'false'];
var key = '';
var c = curr();
var regexp = /[a-zA-Z_$\d]/; // letter, number, underscore, dollar character
while (regexp.test(c)) {
key += c;
i++;
c = curr();
}
if (specialValues.indexOf(key) === -1) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readKey ( parser ) {\n\t \tvar token;\n\n\t \tif ( token = readStringLiteral( parser ) ) {\n\t \t\treturn identifier.test( token.v ) ? token.v : '\"' + token.v.replace( /\"/g, '\\\\\"' ) + '\"';\n\t \t}\n\n\t \tif ( token = readNumberLiteral$1( parser ) ) {\n\t \t\treturn token.v;\n\t \t}\n\n\t \t... | [
"0.644943",
"0.6337367",
"0.6269636",
"0.6211801",
"0.60922694",
"0.5970322",
"0.58748686",
"0.5832924",
"0.5832924",
"0.5832924",
"0.5832924",
"0.5832924",
"0.5778697",
"0.5691793",
"0.5680897",
"0.5680897",
"0.5680897",
"0.56219",
"0.55999506",
"0.55849206",
"0.54911345",
... | 0.68384016 | 0 |
Handles the touchstart stop propagation. Selects an option on mobile devices with one click | handleTouchStartStop (index, option) {
this.pointerSet(index)
this.select(option)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function flexiCSSMenus_clickHandlerForTouchDevices(event) {\n\n var submenu = $(this).find('ul').eq(0);\n var hasSubmenu = (submenu.length > 0);\n var isCurrentButton = CSSMenus.flexiCSSMenus_currentButton && jQuery(CSSMenus.flexiCSSMenus_currentButton).is(this);\n\n event.stopPropagati... | [
"0.6802973",
"0.64974874",
"0.6465304",
"0.6301228",
"0.6205652",
"0.6172865",
"0.6170019",
"0.61675584",
"0.612139",
"0.6114241",
"0.5985971",
"0.5962755",
"0.59327054",
"0.5929081",
"0.5921054",
"0.5900501",
"0.58964187",
"0.5893237",
"0.58887583",
"0.58700716",
"0.5860962"... | 0.687965 | 0 |
Gets an upload token from google photos api in order to submit and image | async getUploadToken(image){
let name = image.path.split('/')
name = name[name.length-1]
const token = await GoogleSignin.getTokens();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/uploads',
method: 'POST',
headers: {
'Content... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"uploadAndGetToken(image_buffer) {\n let file = {\n value: image_buffer,\n options: {\n contentType: \"image/jpg\",\n filename: \"receipt.jpg\"\n }\n }\n let request = this.buildRequest(file)\n\n return request_promise.post(request)\n }",
"async submitImage(uploadData, al... | [
"0.6660008",
"0.62604666",
"0.6144536",
"0.605197",
"0.5875013",
"0.5842241",
"0.5809142",
"0.5808554",
"0.564433",
"0.56431556",
"0.5641778",
"0.5611776",
"0.5595961",
"0.5574326",
"0.5571099",
"0.55550313",
"0.5533929",
"0.55177706",
"0.5502419",
"0.5499996",
"0.5467952",
... | 0.8379564 | 0 |
Submits an image to google photos api | async submitImage(uploadData, albumID){
const mediaItems = this.processUploadImages(uploadData)
const token = await GoogleSignin.getTokens();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate',
headers: {
'Authorization': 'Beare... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadImage(img) {\n console.log(img, 'from uploadImage');\n var drive = google.drive({version: 'v3', auth: googleAuth.oauth2Client});\n fs.readFile('client_secret.json', function processClientSecrets(err, content) {\n if (err) {\n console.log('Error loading client secret file: ' + err);\n ... | [
"0.6932702",
"0.66624117",
"0.6587522",
"0.6551485",
"0.6496343",
"0.6496343",
"0.6418392",
"0.62674254",
"0.6238424",
"0.61795735",
"0.61280555",
"0.60773796",
"0.6075623",
"0.6056166",
"0.6038094",
"0.603687",
"0.60329175",
"0.60308534",
"0.6016131",
"0.59529734",
"0.593096... | 0.68401796 | 1 |
Converts the form of uploadData to something google photos api understands | processUploadImages(uploadData){
mediaItems = []
for (i = 0; i < uploadData.length; i ++){
mediaItems.push({
"description": uploadData[i].description,
"simpleMediaItem": {
"uploadToken": uploadData[i].uploadToken
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMultipartData (formData, data) {\n var key, arr, i;\n\n for (key in data) {\n if (data.hasOwnProperty(key) && key !== 'files') {\n if (data[key] instanceof Array) {\n arr = data[key];\n\n for (i = 0; i < arr.length; i += 1) {\n fo... | [
"0.55172086",
"0.54417044",
"0.5429019",
"0.5425791",
"0.5376524",
"0.53143483",
"0.52681696",
"0.5262455",
"0.5262455",
"0.5262455",
"0.5262455",
"0.5262455",
"0.5211225",
"0.5193457",
"0.51910883",
"0.5178918",
"0.5173261",
"0.51691616",
"0.516629",
"0.5161723",
"0.51616085... | 0.545401 | 1 |
Gets media items (images) from a google photo library | async getMediaItems(albumID){
//Reponse contains an array of (id, description, productUr, mediaMetaData, filename)
const token = await GoogleSignin.getTokens();
await this.getDbUserData();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeApiCall() {\n gapi.client\n .request({\n path: \"https://photoslibrary.googleapis.com/v1/mediaItems\",\n })\n .then(\n function (response) {\n const googlePhotos = responseToMap(response);\n scatterImages(googlePhotos);\n },\n function (reason) {\n co... | [
"0.7391346",
"0.73336905",
"0.698107",
"0.66177654",
"0.6610576",
"0.6598222",
"0.6530227",
"0.6505277",
"0.6394705",
"0.6389576",
"0.6353636",
"0.6322508",
"0.6297819",
"0.62863946",
"0.627209",
"0.626307",
"0.6251056",
"0.62244356",
"0.6221099",
"0.62120813",
"0.61747754",
... | 0.747409 | 0 |
Creates an album in google photos | async createAlbum (title) {
const token = await GoogleSignin.getTokens();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/albums',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer '+ token.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async shareAlbum(albumID){\n const token = await GoogleSignin.getTokens();\n data = {\n URI: `https://photoslibrary.googleapis.com/v1/albums/${albumID}:share`,\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Autho... | [
"0.6789126",
"0.66695553",
"0.6610988",
"0.6474538",
"0.64325285",
"0.62585413",
"0.6202182",
"0.61414504",
"0.6128519",
"0.60904574",
"0.6045826",
"0.6013822",
"0.5975022",
"0.59747267",
"0.5946302",
"0.59237903",
"0.5879033",
"0.5770455",
"0.5764391",
"0.57350826",
"0.57285... | 0.7745056 | 0 |
Makes an album shareable | async shareAlbum(albumID){
const token = await GoogleSignin.getTokens();
data = {
URI: `https://photoslibrary.googleapis.com/v1/albums/${albumID}:share`,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async joinSharedAlbum(shareToken){\n const token = await GoogleSignin.getTokens();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums:join',\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n ... | [
"0.67930853",
"0.65879375",
"0.6453441",
"0.6360529",
"0.6259707",
"0.6224894",
"0.6161214",
"0.61188436",
"0.6111594",
"0.6084217",
"0.6049909",
"0.60368085",
"0.6007804",
"0.5948247",
"0.59453154",
"0.5920995",
"0.5907329",
"0.58907855",
"0.587026",
"0.58280945",
"0.5826483... | 0.77806515 | 0 |
Retrieve all albums created by this app from google photo | async getAlbums(){
const token = await GoogleSignin.getTokens();
await this.getDbUserData();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',
method: 'GET',
headers: {
'Authorization': 'Bearer '+ tok... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getSharedAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Author... | [
"0.77899975",
"0.7268515",
"0.7139652",
"0.7115756",
"0.7079678",
"0.68577695",
"0.6837979",
"0.6821033",
"0.66176647",
"0.660727",
"0.6552349",
"0.63630176",
"0.63600075",
"0.62909245",
"0.62854403",
"0.625071",
"0.62436277",
"0.624279",
"0.62240857",
"0.6197287",
"0.6192477... | 0.8437491 | 0 |
Retrieve all albums shared or shared by others from google photo | async getSharedAlbums(){
const token = await GoogleSignin.getTokens();
await this.getDbUserData();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',
method: 'GET',
headers: {
'Authorization': 'B... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'B... | [
"0.7495476",
"0.676664",
"0.64020246",
"0.6395662",
"0.62575525",
"0.62471974",
"0.6177822",
"0.61480427",
"0.61450213",
"0.61444104",
"0.61053103",
"0.6036481",
"0.5948124",
"0.5898566",
"0.58974326",
"0.58788514",
"0.584359",
"0.5840999",
"0.5808266",
"0.5796186",
"0.578172... | 0.82987624 | 0 |
Joins a shared Album | async joinSharedAlbum(shareToken){
const token = await GoogleSignin.getTokens();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums:join',
method: 'POST',
headers: {
'Authorization': 'Bearer '+ token.accessToken,
'Conte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getSharedAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Author... | [
"0.66796255",
"0.65617186",
"0.5980817",
"0.59408796",
"0.58534306",
"0.57573265",
"0.575305",
"0.5643351",
"0.56406194",
"0.5622663",
"0.5540779",
"0.5529859",
"0.5527291",
"0.5524766",
"0.5470311",
"0.5460653",
"0.54591364",
"0.5447756",
"0.54364127",
"0.5433429",
"0.541480... | 0.70665264 | 0 |
Leaves a shared Album | async leaveSharedAlbum(shareToken){
const token = await GoogleSignin.getTokens();
data = {
URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums:leave',
method: 'POST',
headers: {
'Authorization': 'Bearer '+ token.accessToken,
'Con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteAlbum(insideAlbum) {\n if (insideAlbum) {\n deleteAlbumImgur(urlParams.get('id'))\n window.location.href=\"../index.html\"\n } else {\n deleteAlbumImgur(currentAlbumId)\n }\n}",
"deleteAlbum(artistName, albumName){\n let artistWithAlbum = this.getArtistByName(artistName);\n let a... | [
"0.5995033",
"0.5908435",
"0.57311887",
"0.56811696",
"0.56792426",
"0.5592567",
"0.5588486",
"0.5533811",
"0.5530117",
"0.55066705",
"0.5491988",
"0.5441767",
"0.54113865",
"0.5392971",
"0.5371426",
"0.52661395",
"0.52349734",
"0.5147303",
"0.5130874",
"0.51227057",
"0.51031... | 0.7048329 | 0 |
Register parsers for standard Protobuf types. | function registerWellKnownParsers() {
for (let [typeUrl, parser] of wellKnownParsers) {
TypeParsers.register(parser, typeUrl);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initParsers() {\n this.parserRegistry = new ParserRegistry();\n }",
"_refreshTypeParser(dataType) {\n for (const type of dataType.types.mysql) {\n parserMap.set(type, dataType.parse);\n }\n }",
"_refreshTypeParser(dataType) {\n for (const type of dataType.types.mysql) {\n parserMap.set(... | [
"0.5567041",
"0.48168692",
"0.48168692",
"0.48057973",
"0.47990346",
"0.4798425",
"0.47307944",
"0.46939874",
"0.4689535",
"0.46729237",
"0.46729237",
"0.46373796",
"0.4608624",
"0.44821978",
"0.4467467",
"0.43937737",
"0.43844497",
"0.4341504",
"0.43016502",
"0.4299671",
"0.... | 0.67301285 | 0 |
shows entity bounds and shooting bounds | showBounds(context) {
// entity bound
context.setLineDash([]);
context.beginPath();
context.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);
context.fill();
context.fillStyle = "#FD0";
context.stroke();
// shooting bound
context.setLineDash([8, 15]);
context.beginPath();
co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setBounds() {\n let x = this.position.getX();\n let y = this.position.getY();\n let s = Game.Settings().UnitSize;\n let hs = s / 2;\n\n //generate Individual Bounds\n this.bounds = new Bounds(x - hs, y - hs, x + hs, y + hs);\n }",
"show(){\n noFill();\n rect(this.boundary.x, this.boundar... | [
"0.63668066",
"0.61405504",
"0.6135943",
"0.60917896",
"0.6032314",
"0.59820914",
"0.59719616",
"0.5946948",
"0.59446645",
"0.59404427",
"0.5912284",
"0.5895541",
"0.58946925",
"0.58884525",
"0.5871786",
"0.5855748",
"0.5837168",
"0.57994485",
"0.5784643",
"0.5776471",
"0.577... | 0.7580241 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.