query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Utils drop DB collection: drop all collections This is surprisingly slow even for empty collection, so we can't use that all over the place like it should... | function dropDBCollections() {
//console.log( "dropDBCollections" ) ;
return Promise.all( [
dropCollection( versions ) ,
dropCollection( users ) ,
dropCollection( jobs ) ,
dropCollection( schools ) ,
dropCollection( towns ) ,
dropCollection( lockables ) ,
dropCollection( nestedLinks ) ,
dropCollection... | [
"async clearDatabase() {\n const { collections } = mongoose.connection;\n\n for (const key in collections) {\n const collection = collections[key];\n collection.deleteMany();\n }\n }",
"function dropCollection(collectionName) {\n mongoClient(function (client, db) {\n db.dropCollection(coll... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a `HarnessLoader` that can be used to load harnesses for components within the panel's content area. | async getHarnessLoaderForContent() {
return this.getChildLoader(".mat-expansion-panel-content" /* MatExpansionPanelSection.CONTENT */);
} | [
"function load() {\n Media.log('PluginComponent::load ' + id());\n assert(state() == PluginComponent.State.Unloaded, 'invalid component state');\n assert(pluginMgr.state() == Media.PluginManager.State.Initialized);\n assert(!task || task.pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
what happens when you select a piece from the menu show it up on the editor nd other stuff | function on_piece_select()
{
update_editor();
} | [
"function bbedit_components_draw_menu() {}",
"function get_selected_piece()\n{\n\tvar index = editor_menu.selectedIndex;\n\treturn piece_set[index];\n}",
"showComponentSelection() {\r\n // show single piece settings\r\n let label = (this.selectedComponents[0].label === '') \r\n ? 'no label' \r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the categorized unchecked keys that were in place before hitting the diff switch with state changes in between also reflected | static getRestoredCategorizedUncheckedKeys({
preSwitchCategorizedUncheckedKeys,
postSwitchCategorizedUncheckedKeys,
currCategorizedUncheckedKeys,
}) {
const restoredUncheckedKeys = (column_type) => {
// keys that the user checked while being in diff view
const userCheckedKeys = _.differenc... | [
"function getAppearedLabels(){\n\tvar arr = [] \n\tfor (var i = 0; i<labels.length; i++) {\n\t\tarr.push(labels[i].name.label);\n\t}\n\tvar appearedLabelsUnsort = arr.filter( onlyUnique );\n\t// manually add \"treeSphere\" and \"treeCube\" as their names are saved as \"vegetation\"\n\tappearedLabelsUnsort.push('tre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parsing all students from json then searching for exact match with Year and returning and students that have this year plus console log students from that year | showStudentsByYear(year){
console.log("Show student By year: ");
var data = fileSystem.readFileSync(studentData);
var jsonData = JSON.parse(data);
var i;
for (i = 0 ; i < jsonData.length ; i++ ){
if (jsonData[i].year != year) {
jsonData.splice(i--,1);
}
}
console.log("Students that qualifies: ... | [
"function filterYear(data) {\n let filteredData = data.filter(function(d, i) {\n return data[i].year === \"1980\";\n });\n data = filteredData;\n return data;\n }",
"function filter_movies_year(search, movieList){\r\n let filtered = [];\r\n\r\n for(let movieId in movieL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets positions inside map that have a Manhattan Distance to center between minRange and maxRange | getBetweenRangesPos(center, minRange, maxRange) {
let res = [];
for(let x = center.x - maxRange; x <= center.x + maxRange; x++) {
let remainingDistance = maxRange - Math.abs(x-center.x);
for(let y = center.y-remainingDistance; y <= center.y + remainingDistance; y++) {
let pos = new Position(... | [
"function showMarkersWithinRange(range)\n{\n\t// the range is in miles\n\tvar milesToMeters = 1609.34;\n\trange = range*milesToMeters;\n\t// Try W3C Geolocation (Preferred)\n\tif(navigator.geolocation) {\n\tbrowserSupportFlag = true;\n\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t initialLocat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a `rehype` tree to JSON, so that we can pass it as a prop to our React pages. | function rehype2json() {
this.Compiler = node => {
const rootNode = getRootNode(node)
visit(rootNode, removePositionFromNode)
return JSON.stringify(rootNode)
}
} | [
"serialiseTree() {\n\n }",
"writeTree(tree) {\n const treeObject = `${Object.keys(tree).map((key) => {\n if (Util.isString(tree[key])) {\n return `blob ${tree[key]} ${key}`;\n }\n return `tree ${Objects.writeTree(tree[key])} ${key}`;\n }).join('\\n')}\\n`;\n\n return Objects.write(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new NotFoundHtmlView | function NotFoundHtmlView(settings) {
if (!(this instanceof NotFoundHtmlView))
return new NotFoundHtmlView(settings);
HtmlView.call(this, 'NotFound', settings);
} | [
"function fileNotFound(req, h){\n const response = req.response\n //Preguntamos que si la response es un mensaje de boom y si el codigo es 404\n if (!req.path.startsWith('/api') && response.isBoom && response.output.statusCode === 404) {\n //Retornamos la vista de la pagina que muestra el error 404 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\ || || :: AJAX Form Submit Framework :: || || || || This framework is released under the GNU Public License, version 3 or later. || || || Syntax: || || AJAXSubmit(HTMLFormElement); \ | function AJAXSubmit(oFormElement) {
if (!oFormElement.action) {
return;
}
var oReq = new XMLHttpRequest();
oReq.addEventListener('load', ajaxSuccess);
oReq.addEventListener('progress', ajaxProgress);
oReq.addEventListener('error', ajaxError);
if (oFormElement.method.toLowerCase() === 'post') {
oR... | [
"function ajaxSubmitForm(methodToCall, additionalData) {\n var kradRequest = new KradRequest();\n\n kradRequest.methodToCall = methodToCall;\n kradRequest.additionalData = additionalData;\n\n kradRequest.send();\n}",
"function submitAddMovieForm(formSubmitEvent)\n{\n\tconsole.log(\"Submitting employee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this hook handle changes on this form input children element, updating the corresponding root field of the object payload we found via payloadPath | function HandleChangeHook(rootComponent, payloadPath) {
this.rootComponent = rootComponent;
this.payloadPath = payloadPath;
} | [
"onNodeSave(){\n const treeList = deepcopy(this.props.value.treeList);\n\n const {selectedNode} = this.props.value;\n\n this.findNode(treeList, selectedNode.id, node => {\n node.iconUrl = selectedNode.iconUrl;\n node.priority = selectedNode.priority;\n node.modu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change usedNums array to false, then generate new numbers for new card | function anotherCard() {
for (var i=1; i<usedNums.length; i++) {
usedNums[i] = false;
}
newCard();
return false;
} | [
"function generateNumber() {\n\tfor (i=0;i<4;i++) {\n\tnewNumber = Math.floor(Math.random()*12) + 1;\n\tgemNumber.push(newNumber);\n\t}\n\tconsole.log(gemNumber);\n}",
"constructor() {\n let chosenNums = [];\n for (let i = 0; i < 5; i++) { //row\n this.cardArr.push([]);\n for (let j = 0; j < 5; j+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the given area is the readonly chrome.storage.managed area. | function checkManaged(areaName) {
if (areaName === 'managed') {
throw new Error('chrome.storage.managed is read-only');
}
} | [
"isReadonlyWorksetCurrent () {\n return this.worksetCurrent?.Name && this.worksetCurrent?.IsReadonly\n }",
"function isEditable() {\n return (current && current.isOwner && !current.frozen);\n}",
"inSafeMode() {\n return this.getLoadSettings().safeMode;\n }",
"function areaDisponibleInterno(coorde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the booking file being accessed in the session storage and declare if the booking file is different | async setBookingFile(event) {
if (!(bookingTempStore.bookingFile === 'booking/' + event.target.id)) {
bookingTempStore.bookingFile = 'booking/' + event.target.id;
bookingTempStore.bookingFileHasChanged = true;
bookingTempStore.save();
}
} | [
"function setPageAccess(url, date){\n sessionStorage.setItem('url', url);\n sessionStorage.setItem('date', date);\n}",
"function writestorage(orderready) {\n orderready = JSON.parse(orderready);\n var fertigebestellung = orderready[\"response_data\"];\n fertigebestellung = JSON.stringify(fertigebes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setSelected animation : different whether item is on over if not we have to play over animation before selected animation | setSelected () {
if (this.el.classList.contains(MenuItem.OVER_CLASS)) {
this.animateSelected()
} else {
this.animateOnOver(() => {
this.animateSelected(() => {
this.setState()
})
})
}
} | [
"highlight() {\n this.model.set('isSelected', true);\n }",
"highlightSelected() {\n\n this.highlighter.setPosition(this.xStart + this.selected * this.distance, this.yPosition + this.highlighterOffsetY);\n\n }",
"setAnimation(animationName) {\n var currentAnimationName = this.animations.currentA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the axis with the same option to reflect the order change otherwise the order of axis's categories won't change | _updateAxis() {
const xAxis = this._getOption().xAxis;
const yAxis = this._getOption().yAxis;
this._setOption({xAxis, yAxis});
} | [
"function onAxisAfterSetOptions() {\n var axis = this;\n if (axis.brokenAxis && axis.brokenAxis.hasBreaks) {\n axis.options.ordinal = false;\n }\n }",
"setDefaultAxes() {\n let defaultAxes = this.dataHandler._getDefaultAxes();\n this.options.xAxis = defaultAxes.x;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
esta funcion se encarga de llenar la tabla de observaciones | function llenar_tabla_vistas_observaciones() {
$("#modal_vista_observaciones").show()
$("#tabla_vistas_observaciones tr").remove()
var cuestionario, pregunta, indice_cues, indice_preg = 1;
$.each(datos_mostrar, function (index, item) {
//*********aqui se va a usar pendiente ... | [
"function buscarObservaciones(data){\n var deferred = $q.defer();\n $http.post(appConstant.LOCAL_SERVICE_ENDPOINT + \"/buscarObservaciones\", data).then(function (res) {\n deferred.resolve(res.data);\n }, function (err) {\n deferred.reject(err);\n console.log(er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find users who have "annis" on their name. | function haveNameAnnis(input) {
let output = [];
for (let i = 0; i < input.length; i++) {
const el = input[i];
if (el.profile["full_name"].toLowerCase().search("annis") !== -1) {
output.push(el);
}
}
return output;
} | [
"searchUserByName(name) {\n const users = this.getUsers(); //Returns the collection of Users\n\n //Filter each user name based on the name we are interested in.\n const results = users.filter(\n user => user.firstName === name || user.lastName === name\n );\n\n return results.length === 0 ? fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a is input field id name b is invalid input message class name c is boolean value for required Function validates only url | function validateUrl(a, b, c) {
// Value in the field
var url = $(a).val();
// Regular Expression to validate value against
var regularExpression = /^((https?|ftp):\/\/|(www|ftp)\.)[a-z0-9-]+(\.[a-z0-9-]+)+([\/?].*)?$/;
if (c) {
// Validating field content
if (!regularExpression.te... | [
"function nameValidate(name) {\r\n var nameValue = document.getElementById('contact-name').value;\r\n var nameRegex = /^[a-zA-Z \\-\\']+(?:\\s[a-zA-Z]+)*$/.test(nameValue);\r\n var inputErr = document.getElementsByTagName('input')[1];\r\n\r\n if (nameValue == null || nameValue == \"\") {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the input autocomplete array parm | function setAutoComplete(arr) {
searchInput.autocomplete({source: arr});
} | [
"set CustomProvidedInput(value) {}",
"function autoCompleteForPickupLocation(element){\r\t\tvar inputPickupLocation = element;\r\t\t//var inputDropoffLocation = element;\r\t\t\r\t\t//Autocomplete for pickup location \r\t\tvar mapForPickupLocation = new google.maps.Map(inputPickupLocation, {\r\t\t\tcenter: {lat: 3... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
formats the params for the hiking api | function formatQueryParamsHiking(params) {
const queryItems = Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
return queryItems.join('&');
} | [
"function formatParameters() {\n if (!this.params) return '';\n return '(' + this.params.map(function (param) {\n return formatParameter(param);\n }).join(', ') + ')';\n}",
"function FormatParamVoucher()\n{\n var params = '';\n params += POSTinitP;\n for (var i = 0; i < arguments.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function : updateMsgs parameter : what does this function do : This function will call MsgInquiryUpdate | function updateMsgs() {
MsgInquiryUpdate(msg_inquiry_accumulate_page, msg_inquiry_current_sort, $('#process_prio_input').val(), $('#process_name_input').val(), (document.getElementById('SU_SD_Checkbox').checked + 0));
} | [
"updateFail(msg,onUpdate){\r\n assert.equal(typeof onUpdate,'function','onUpdate must be a function');\r\n assert.equal(typeof msg,'object','msg must be an object');\r\n assert.equal(typeof msg.messageText.messageText,'undefined','ECCO LERRORE');\r\n this.queueMgr.updateMessage(FATUS_QUE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load the add game form | function loadAddForm(){
populateOpponentSelect('addgameopponent');
} | [
"function newGame() {\n \n // ensure the form is visible\n document.getElementById('my-games-form').style.display='';\n // empty the fields on the screen\n document.getElementById('my-games-id-field').value = '';\n document.getElementById('my-games-name').value = '';\n document.getElementById('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
What needs to be done in order to complete the quest. | function CompleteQuest () {
if(coins >= 5){
//This tells us that the quest is complete and ready to be turned in.
_questDone = true;
//This changes what our NPC will say now that the quest is finished and ready to be turned in.
_npcs.NPCList[0].npcStage = 2;
//This changes our quest log's details.
_quests... | [
"finishAskTheAudience() {\n this.serverState.askTheAudience.populateAllAnswerBuckets();\n this.playSoundEffect(Audio.Sources.ASK_THE_AUDIENCE_END);\n\n // Update game is called first to make sure ask the audience end audio cue plays.\n this._updateGame();\n this.showHostRevealHotSeatChoice();\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates all registered media servers. | static validateRegisteredMediaServers(entryId){
let kparams = {};
kparams.entryId = entryId;
return new kaltura.RequestBuilder('livestream', 'validateRegisteredMediaServers', kparams);
} | [
"static validateRegisteredMediaServers(entryId){\n\t\tlet kparams = {};\n\t\tkparams.entryId = entryId;\n\t\treturn new kaltura.RequestBuilder('livechannel', 'validateRegisteredMediaServers', kparams);\n\t}",
"async verifySinks() {\n // Cached query; what currently is in store.\n this.cached = this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get_node_value() : obtain an element's value from a XML object Parameter(s) : which_doc : a XML object that you want to obtain an element's value from which_id :the element's name that you want to obtain its value Return : element's value | function get_node_value(which_doc, which_id){
var node = get_xml_node(which_doc, which_id);
var node_value = "";
if (node != null){
if (node.nodeType != 3){ // NS6/Mozilla will treat space as an element, so we need to ingore it
if (node.childNodes.length > 0){
node_value = node.childNodes[0].node... | [
"function get_child_value(which_node, which_id){\r\n\t\t\r\n\tfor (var i = 0; i < which_node.childNodes.length; i++){\r\n\t\tvar node = which_node.childNodes[i];\r\n\t\t\t\t\t\r\n\t\tif (node.nodeType != 3){ // NS6/Mozilla will treat space as an element, so we need to ingore it\t\t\t\t\r\n\t\t\tif (node.nodeName ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change sortByNameHandler by using sortByName() and showData() | function sortByNameHandler(){
// table.classList.remove('data');
// take isolated copy keep the refernce safe
let sortedByName = myData.slice();
sortedByName.sort(function(a , b){
//make case insensitive compare
if(a.name.toUpperCase() < b.name.toUpperCase()){
return -1;
... | [
"function sort() {\n var sortBy = sortOptions.value;\n\n if (sortBy === \"lname\") sortByLname();\n else if (sortBy === \"gender\") sortByGender();\n else if (sortBy === \"region\") sortByRegion();\n else sortByFname();\n}",
"function sortClickHandler(\n\tsortedOnType,\n\tsortedType,\n\tsortFunctio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait for a job to reach a certain status. By default, we wait for the job status to be "Success". For reference, see class JobStatus(object): INACTIVE = 0 QUEUED = 1 RUNNING = 2 SUCCESS = 3 ERROR = 4 CANCELED = 5 | waitForJob(job, targetStatus = 3) {
return this.waitFor(job, (job) => job.status === targetStatus)
} | [
"function getJobStatus(jobId, cb) {\n\n //First search Mongodb to check if the jobID has been processed and the html content exists\n fetchJobResult(jobId, function(fetchJobError, resp) {\n //If fetch from mongoDB failed, it must be in the job Queue waiting to be processed\n if(resp === null) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INITCAP extension to STRING | function initCap (msg) {
if (msg.length > 0) {
return msg.toLowerCase().replace(/(?:^|\s)[a-z]/g, function (m) {
return m.toUpperCase();
});
}
} | [
"function getUniversalCharString(){\n // Get lowercase options//\nif (lowerCasePref === true)\nuniversalCharacters = universalCharacters+lowerCharacters; \n\n// Get get upperCase char//\nif (upperCasePref === true)\nuniversalCharacters = universalCharacters+upperCharacters;\n\n// Get get numbers char//\nif (number... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the bytelength of the value encoded in the given buffer at the given index. | function encodedLength(encodedBuffer, index) {
var result = 0;
while (encodedBuffer[index + result] >= 0x80) {
result++;
}
result++; // to account for the last byte
if (index + result > encodedBuffer.length) {// FIXME(sven): seems to cause false positives
// throw new Error("integer representation ... | [
"getAvailableLength (index) {\n let file\n for (const f of this._files) {\n if (f.index === index) {\n file = f\n break\n }\n }\n if (!file) {\n return ''\n }\n const bin = this.get(index, 0, file.length - 1)\n const onesLength = headOnes(bin) * this._pieceLength\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 815 Create a function that takes an array of two numbers and checks if the square root of the first number is equal to the cube root of the second number. | function checkSquareAndCube(arr) {
return Math.sqrt(arr[0]) === Math.cbrt(arr[1]);
} | [
"function isSquareNumber(number) {\n if (number > 0 && Math.sqrt(number) % 1 === 0) {\n console.log(true);\n } else {\n console.log(false);\n }\n}",
"function abcmath(a, b, c) {\n\treturn ((a * b) % c === 0);\n}",
"function checkFrequecySquare(arr,sqareArr){\n const obj = {};\n const ob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get y set de deducciones | get deducciones() {
return this._deducciones
} | [
"get nombre(){\n return this._nombreMascota\n }",
"ObtenerDias(consulta) {\n var httpRequest = new XMLHttpRequest();\n httpRequest.open('GET', consulta, false);\n httpRequest.send();\n var cons = JSON.parse(httpRequest.response);\n var dias = cons.data[0].dias_disponibles;\n\n return d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validate dummy generated json message against a schema var v = new Validator(); console.log(v.validate(templateFile, schema)); | function validateTemplate(template, schema){
console.log("Validating template " + templateFileName + " against schema " + schemaFileName + " . . .");
//var validation = validate(templateFile, schema);
var validator = new validate.Validator(schema);
var check = validator.check(template);
console.log("Validatio... | [
"async function validateTemplate() {\n // Get item sub type\n const itemSubType = getItemSubType();\n core.info(`validateTemplate: itemSubType: ${itemSubType}`);\n\n // Compose message\n const message = composeMessage({ requireTemplate: true });\n\n // If issue type could not be determined\n if (itemSubType ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserswitchBlockStatementGroup. | exitSwitchBlockStatementGroup(ctx) {
} | [
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitBlockLevelExpression(ctx) {\n\t}",
"exitStatementWithoutTrailingSubstatement(ctx) {\n\t}",
"exitBasicForStatement(ctx) {\n\t}",
"visitBreakStatement(node){\r\n this.addToCFG(node);\r\n var node_str = this.nodeStr(node... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function checks highest mark and returns the value | highestMarks(marks) {
let mark = Object.values(marks[0]).map(element => {
return parseInt(element);
});
return Math.max(...mark);
} | [
"low() {\n let mark = Object.values(marks[0]).map(element => {\n return parseInt(element);\n });\n return Math.min(...mark);\n }",
"function findMax() {\n var max = dog.data[0].count;\n var winner = dog.data[0];\n for (var i = 0; i < dog.data.length; i++) {\n if (dog.data[i].count... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a change to a single line. Type must be one of "text", "gutter", "class", "widget" | function regLineChange(cm, line, type) {
cm.curOp.viewChanged = true
var display = cm.display, ext = cm.display.externalMeasured
if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
{ display.externalMeasured = null }
if (line < display.viewFrom || line >= display.viewTo) { return }
var lineView ... | [
"function onAddLine() {\n addLine()\n document.querySelector('[name=\"text\"]').value = 'TYPE SOMETHING'\n renderMeme()\n}",
"static line(spec) {\n return new LineDecoration(spec);\n }",
"function newFlowline(){\n resetFlowline();\n flowline.markers[0].enableEdit(map).startDrawing()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write messages out for each of the child groups of the parent with parentId | function writeMessagesForChildGroups(parentId) {
jQuery("[data-parent='" + parentId + "']").each(function () {
var currentGroup = jQuery(this);
var id = currentGroup.attr("id");
var data = getValidationData(currentGroup, true);
if (data) {
var messageMap = data.messageM... | [
"function writeMessagesForGroup(id, data, forceWrite, skipCalculateTotals) {\n var parent = jQuery(\"#\" + id).data(\"parent\");\n\n if (data) {\n var messageMap = data.messageMap;\n var pageLevel = data.pageLevel;\n var order = data.order;\n var sections = data.sections;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
every september, create a new document to record averhours and total hours | function aveSevHY(){
var date = new Date();
var year = date.getFullYear();
calChildNum().then(numOfChild => {
AverageServiceHours.create({
year:year,
childNum: numOfChild,
AveHours: 0,
TotalHours: 0,
})
.then(Aver => console.log(Aver))
})
} | [
"function perSevHY(){\n var date = new Date();\n var year = date.getFullYear() - 1;\n \n User.find({isActive:true, role:\"parent\"}).then(users =>{\n users.forEach(function(ele){\n let serviceHours = {year:year, totalHours:ele.totalHours,aveHours:ele.aveHours }\n User.findOneAndUpdate({_id:ele._id}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Various reports from the stats of the given rtcPeerConnection. | constructor(rtcPeerConnection) {
// Captures reports at instantiation time.
// If you want another set of reports at a later time, create another instance.
// stats is a promise for a Map of id => report.
this.stats = rtcPeerConnection.getStats();
} | [
"function requestStats() {\n // if (Object.keys(peerConnectionDataStore).length > 0)\n // chrome.send('getAllStats');\n}",
"function reportStats() {\n const now = Date.now();\n console.log(`STATS Tweets: ${totalTweets}\\tErrors: ${totalErrors}\\tUptime: ${Math.round((now - startStatus)/1000)}s`);\n}",
"_r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion Apprelated events region Window close callbacks Callback used to log the closure of the main window e to store the size. | function mainWindowCloseCallback() {
logger.silly("Closing main window");
// Save the sizes of the window
const size = mainWindow.getSize();
store.set("main-width", size[0]);
store.set("main-height", size[1]);
// Check is the window is maximized
store.set("main-maximized", mainWindow.isMax... | [
"function onClosed() {\n\t// dereference the window\n\t// for multiple windows store them in an array\n\tmainWindow = null;\n}",
"onAllWindowsClosed() {\r\n // Stub\r\n }",
"function popupPVAsWindow_onresize(e)\n{\n}",
"function resizeWindow () {\n\t\tparent.postMessage($('body').height(), '*');\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts coordinates of one sprite to another. | function spritePointToSprite(point, sprite, toSprite) {
return svgPointToSprite(spritePointToSvg(point, sprite), toSprite);
} | [
"toCoordinate() {\n assertParameters(arguments);\n \n return new Coordinate(this._width, this._height);\n }",
"function sukeistiMasyvo2Elementus(x, y) {\n var z = prekiautojai[x];\n prekiautojai[x] = prekiautojai[y];\n prekiautojai[y] = z;\n\n}",
"function sukeistiMasyvo2elementus(x, y) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: _fnEscapeRegex Purpose: scape a string stuch that it can be used in a regular expression Returns: string: escaped string Inputs: string:sVal string to escape | function _fnEscapeRegex ( sVal )
{
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
return sVal.replace(reReplace, '\\$1');
} | [
"function escapeRegex(target)\n{\n return String(target).replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').replace(/\\x08/g, '\\\\x08');\n}",
"function replaceEscapeSequences(string) {\n return string\n .replace(/[\\b]/g, \"\\\\b\")\n .replace(/\\f/g, \"\\\\f\")\n .replace(/\\n/g, \"\\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorts a list of tweets by created_at date tweetList must be an array of tweet objects with a created_at property in the format 'ddd MMM DD HH:mm:ss +SSSS YYYY' if sortOrder is 'descending' (not case sensitive) then the array will be sorted accordingly. If sortOrder is any other value or undefined the array will be sort... | function sortTweets(tweetList,sortOrder) {
var result;
var sortNum;
if (sortOrder.toLowerCase() === 'descending') {
sortNum = -1;
} else {
sortNum = 1;
}
tweetList.sort((tweet1,tweet2) => {
var time1 = moment(tweet1.created_at,'ddd MMM DD HH:mm:ss +SSSS YYYY');
var time2 = moment(tweet2.created_at,'ddd M... | [
"function sortArrayByDate(entries){\n for (var i = 0; i < entries.length;i++){\n entries[i]['data'].sort(function(a,b){\n return new Date(a['date']) - new Date(b['date'] );\n });\n }\n}",
"function sortFeeds() {\n feed_list.sort(function(x, y){\n return y.timestamp - x.timestamp;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Begin to remove all samples, indicating that all existing samples should fade away. | initiateSampleRemoval() {
for ( let i = 0; i < this.skaterSamples.length; i++ ) {
if ( !this.skaterSamples.get( i ).removeInitiated ) {
this.skaterSamples.get( i ).initiateRemove();
}
}
} | [
"cancelFadeAll() {\n\t\tconst _fades = this._fades;\n\t\twhile (_fades.length > 0) {\n\t\t\tconst fade = _fades.shift();\n\t\t\tclearInterval(fade);\n\t\t}\n\t}",
"resetEverything() {\n this.resetLoader();\n this.remove(0, Infinity);\n }",
"function clearRandomImages(){\n while (imageUl.firstChild) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes tspan dy using font size. This formula was empircally determined using a bestfit line. Works well in both VML and SVG browsers. | function computeTSpanDy(fontSize, line, lines) {
if (fontSize === null) {
fontSize = 10;
}
//return fontSize * 4.5 / 13
return fontSize * 4.5 / 13 * (line - 0.2 - lines / 2) * 3.5;
} | [
"function fontSize(d) {\n d.fontsize = Math.floor(d.radius/3);\n return d.fontsize + \"px\";\n }",
"_getTextMetrics(text) {\n var textSpan = document.createElement('span');\n textSpan.id = 'content-span';\n textSpan.innerHTML = text;\n\n var block = documen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Append new list element on the end of the tail history list | function addTailToHistoryList(tail) {
$("ul#tails_list").append($("<li></li>").text("" + tail));
if ( $('#tails_list').hasClass('ui-listview')) {
$('#tails_list').listview('refresh');
}
} | [
"addToTail(value) {\n const newNode = {\n value: value,\n next: null\n };\n\n if (!this.head && !this.tail) {\n this.head = newNode;\n this.tail = newNode;\n return;\n }\n this.tail.next = newNode;\n this.tail = newNode;\n }",
"addToBack(value){\n let newNode = n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the specified attributes and parses them as an integer or 0. | function parseAttrs(attrs, cb) {
getAttrs(attrs, function(values) {
_.each(attrs, function(attr) {
if(_.isUndefined(values[attr]))
values[attr] = 0;
else if(!isNaN(values[attr]))
values[attr] = parseInt(values[attr]);
});
cb(values);
});
} | [
"getStatMod(attribute){\n\n let mod;\n\n switch(attribute){\n\n case \"str\":\n mod = modCalc(this.strScore);\n break;\n\n case \"int\":\n mod = modCalc(this.intScore);\n break;\n\n case \"wis\":\n mod = modCalc(this.wisScore);\n break;\n\n case \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A dropdown menu can contain a header. | function DropdownHeader(props) {
var children = props.children,
className = props.className,
content = props.content,
icon = props.icon;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('header', className);
var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__["s" /* getUnhandl... | [
"function initDropdownHeader(index) {\n\td3.xhr((host + header), function(error, data) {\n\t\tif (error) throw error;\n\t\tvar response = JSON.parse(data.response);\n\t\tvar value = 0;\n\t\tfor (var j in response) {\n\t\t\t// Push the metric header to the dropdown only if there is at least one metric\n\t\t\tif (res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modal Functionality 1. Content update function | function updateContent(modalSummaryText, modalDetailsText) {
overlay.show();
projectModal.show();
$('a.arrow').show();
modalSummaryDiv.html(modalSummaryText).show();
modalDetailsDiv.html(modalDetailsText).show();
} | [
"function updateModalContent() {\r\n // Get the current image from state\r\n const image = state.images[state.currentImage];\r\n\r\n // Create variables for easy reference\r\n const title = image.data[0].title;\r\n const url = image.links[0].href;\r\n const description = image.data[0].description_508;\r\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts the given string to a CsvFile object. If hasHeaders is set to true, this will use the first row of text as the headers of the returned CsvFile. Otherwise, every row is considered body data. | function toCsvFile(responseText, hasHeaders=true){
let ret = new CsvFile();
let allLines = responseText.trim().split(NEWLINE_REGEX);
if(hasHeaders){
// removes first row and returns it.
let headers = allLines.shift().trim().split(",");
headers.forEach((header)=>r... | [
"function csvParser(options) {\n var csvOptHeaders, csvHeaders, csvHeaderDataTypes, allHeadersString = false;\n this.onEachRecord = function onEachRecord(recData, cb) { // The parser function\n var payload, json = {};\n if (!csvHeaders) {\n if (options.csvHeaders) { // if csvHeaders were supplied i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================== BROADCAST DRAWING DATA TO OTHER USERS ============================================================================== Sends the local user's drawingpath information to other users in the drawing room. | function broadcastPath () {
// If there aren't any points buffered (e.g., if the pen is down but not
// moving), then don't send the PATH message.
if (bufferedPath.length == 0) {
return;
}
// Use SEND_MESSAGE_TO_ROOMS to deliver the message to all users in the room
// Parameters are: messageName, roomID... | [
"function initDrawSocket() {\n socketDraw.on('joined', async function () {\n isDrawOnline = true\n // joined a room\n if (!isDrawJoined){\n isDrawJoined = true\n }\n else{\n writeInfo('<b>Rejoined the room. (drawing)</b>');\n }\n\n // Post all unsent drawings (reserved)\n // If th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a subset of the data using an array of field names | getDataSubset(allowed) {
const subsetData = Object.keys(this.data)
.filter(name => allowed.includes(name))
.reduce((obj, key) => {
obj[key] = this.data[key];
return obj;
}, {});
return subsetData
} | [
"function select(array, propName) {\r\n var output = [];\r\n if (array) {\r\n for (var n=0; n<array.length; n++){\r\n var value = array[n][propName]; \r\n if (!types.isUndefinedOrNull(value))\r\n output.push(value); \r\n }\r\n }\r\n\r\n return output; \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Associate an attachment with a transit gateway route table. For more information, see Amazon VPC Transit Gateways. Documentation: | function TransitGatewayRouteTableAssociation(props) {
return __assign({ Type: 'AWS::EC2::TransitGatewayRouteTableAssociation' }, props);
} | [
"function TransitGatewayAttachment(props) {\n return __assign({ Type: 'AWS::EC2::TransitGatewayAttachment' }, props);\n }",
"function TransitGatewayRouteTable(props) {\n return __assign({ Type: 'AWS::EC2::TransitGatewayRouteTable' }, props);\n }",
"function SubnetRouteTableAs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init default parameters for pods priority | function initPodsPriority() {
var podsPriority = lodash.get(ctrl.version, 'spec.priorityClassName', '');
if (lodash.isEmpty(podsPriority)) {
var defaultPodsPriority = lodash.get(ConfigService, 'nuclio.defaultFunctionConfig.attributes.spec.priorityClassName', '');
... | [
"static get defaultParameters () {\n return {\n paginate: true,\n limit: 10,\n offset: 0,\n orderDirection: 'ASC',\n multipleOrderColumns: false\n };\n }",
"function projectPriorities(priorityTitle, jobsList) {\n this.priority = prior... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used for UI warning. Uses the lcd objects to display an error message. | function hideerror()
{
pns.device_name.message('text', 'Drumrack Found');
for(var i=0;i<12;i++)
{
pns[Encoders[i]].message('text', ' ');
}
} | [
"function myWarning( _msg )\n{\n\tif( _msg.length != 0 )\n\t{\n\t\t$('#alert-warnings').html('<div style=\"margin-top: 6px; margin-bottom: 0px;\" class=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button><strong>Warning!</strong> ' + _msg + '</div>' )\n\t\t$('#alert-warnings').c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the given flow by its URI. | function __getFlow (fullUri) {
// defaults to static if scheme not specified
const normalisedUri = this.__normaliseFlowUri(fullUri);
const baseUri = this.__getBaseFlowUri(normalisedUri);
if (this.flows[baseUri]) {
return this.flows[baseUri];
}
else { // not found, try the same as a dynamic flow
const dynamicU... | [
"findById(id) {\n return request.get(`/api/flows/${id}`);\n }",
"getUrl (name) {\n name = name.name ? name.name : name\n return this.urls[name]\n }",
"getBlockByHash() {\n this.server.route({\n method: 'GET',\n path: '/stars/hash:{hash}',\n handler: (requ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
6. Register Takes the most recent video event returned by the server query, detects if it is a new event, if so runs the necessary sequences to follow through with the event and make sure that client is up to date with all other clients. | function registerVideoEvent(videoEvent) {
var isNewVideoEvent = checkIfNewVideoEvent(videoEvent);
if (isNewVideoEvent) {
_mostRecentVideoEventTime = videoEvent.timestamp;
videoSeekTo(videoEvent.video_time_at);
if (videoEvent.event_type === 'play') {
playVideo();
_mostRecentVideoEventType = '... | [
"_registerEvent () {}",
"function onParticipantVideo(status, resource, event) {\n var scope = event['in'];\n if (event.sender.href == rConversation.href && scope) {\n if (scope.rel == 'localParticipant') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provider that will create the Reports Service. | function ReportsManagementProvider() {
var provider = this;
provider.providerTemplates = {};
provider.addTemplate = function(type, template) {
provider.providerTemplates[type] = template;
return provider;
};
this.$get = function() {
return ... | [
"reports() {\n return {\n inst: this.instCache.report(),\n data: this.dataCache.report()\n };\n }",
"function addReport(report) {\n\n var deferred = $q.defer();\n\n if (reportCompare(report) == -1) {\n reports.push(report);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
showUserEntry(myId) calls the Admin's user entry form for userId: myId if myId = 0 then it will open a blank form | function showUserEntry(myId) {
if (myId === null) {
return false;
} else {
clearDiv("recordView");
var myURL = "AdminUsersEntryForm.php?U=" + myId;
processAjax (myURL, "recordView");
setBlockVis("recordView", "block");
showRecaptcha();
document.getElementById("Us... | [
"function showUserView(myId) {\r\n if (myId < 1) { \r\n return false; \r\n } else {\r\n clearDiv(\"recordView\");\r\n var myURL = \"UsersRecordView.php?U=\" + myId;\r\n processAjax (myURL, \"recordView\");\r\n setBlockVis(\"recordView\", \"block\");\r\n return true;\r\n }\r\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicate whether it's safe to call next_frame() or get_frame('next') on this [For use by NAV.] | has_next_frame() {
if(this.frame_idx >= this.frames.length-1) return false;
else return true;
} | [
"canGoBack () {\n cc.logID(7801);\n return true;\n }",
"function in_iframe () {\r\n try {\r\n return window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n }",
"async isCorrectPageOpened() {\n let curre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
expand each synonym in to its permutations and check them against the database. | function _eachSynonym(synonym, cb){
// expand token permutations
const phrases = _permutations(synonym);
// filter out permutations which do not match phrases in the index
async.filterSeries( phrases, _indexContainsPhrase.bind(this), (err, matchedPhrases) => {
return cb( null, _groups(synonym, matchedPhra... | [
"visitSynonym_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function expandAliases(unit) {\n\t\tfor (var key in unit) {\n\t\t\tvar alias = unit[key].alias, i = alias.length;\n\t\t\twhile (i--) {\n\t\t\t\tunit[alias[i]] = unit[key];\n\t\t\t}\n\t\t}\n\t}",
"function fuzz () {\n let len = 10\n let alp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
print functions / print query string | function printQuery (query) {
'use strict';
// restrict max length of printed query to avoid endless printing for
// very long query strings
var maxLength = 4096;
if (query.length > maxLength) {
stringBuilder.appendLine(section("Query string (truncated):"));
query = query.substr(0, maxLength / 2) + " ... | [
"function displayParams() {\n \"use strict\";\n const paramString = getQueryParamString();\n const span = document.getElementById(\"queryParamSpan\");\n\n span.textContent = paramString;\n}",
"function radLogger(req, res, next) {\n console.log(req.query) //req.query is the query in object form\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check all partitions torn writes and truncate the storage to the position before the first torn write. This might delete correctly written events in partitions, if their sequence number is higher than the torn write in another partition. | checkTornWrites() {
let lastValidSequenceNumber = Number.MAX_SAFE_INTEGER;
this.forEachPartition(partition => {
partition.open();
const tornSequenceNumber = partition.checkTornWrite();
if (tornSequenceNumber >= 0) {
lastValidSequenceNumber = Math.min(l... | [
"flushWrites() {\n for (const tableName in this.writeOperations) {\n if (this.writeOperations[tableName].isEmpty()) {\n delete this.writeOperations[tableName];\n }\n else {\n this.writeOperations[tableName].execute();\n }\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by KotlinParserblockLevelExpression. | exitBlockLevelExpression(ctx) {
} | [
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitStatementWithoutTrailingSubstatement(ctx) {\n\t}",
"exitJumpExpression(ctx) {\n\t}",
"exitConditionalOrExpression(ctx) {\n\t}",
"enterBlockLevelExpression(ctx) {\n\t}",
"exitLoopExpression(ctx) {\n\t}",
"exitMethodDeclarator(ct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Author: datube Date: 20051108 Revision: 0.0.31 / This script is free software; you can distribute it and/or modify it / under the terms of the GNU GPL. See the file COPYING. / Copyright (C) 2005 datube / Modified: $Author: datube $ $Date: 20051108 13:29:00 +0100 (Tue, 08 Now 2005) $ $Rev: 33 $ / compress input: (str) s... | function compress(sin, bs, ic,bsort){
var sout= '';
var comp = 0;
var re;
sout = sin;
bs=(typeof(bs)=='undefined')?false:bs;
ic=(typeof(ic)=='undefined')?false:ic;
bsort=(typeof(bsort)=='undefined')?false:bsort;
// I've not a lot of experience with Regular Expressions,
// Any for additional add-on... | [
"function sortcss(sin){\nvar sout = sin.substring(0,sin.length-1); //strip last -}- and split by -}-\nvar css = new Array();\nvar c='';var i=0;\n css[0] = sout.split('}'); //create array of styles\n css[1]= new Array(); css[2]= new Array(); css[3]= new Array();\n for(i=0;i<css[0].length;i++){\n c=(css[0][i]).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check or Uncheck All ExpenseType CheckBox | function selectAllExpenseTypeMenuCheckBox(){
if(document.getElementById('expenseTypeMenuSelectAllId').checked==true){
document.getElementById('expenseTypeMenuAddId').checked=true;
document.getElementById('expenseTypeMenuViewId').checked=true;
document.getElementById('expenseTypeMenuUpdateId').checked=true;
d... | [
"function selectAllLeaveTypeMenuCheckBox(){ \n\tif(document.getElementById('leaveTypeMenuSelectAllId').checked==true){\n\n\t\tdocument.getElementById('leaveTypeMenuAddId').checked=true;\n\t\tdocument.getElementById('leaveTypeMenuViewId').checked=true;\n\t\tdocument.getElementById('leaveTypeMenuUpdateId').checked=tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Squish will take any compression stream and squish all outgoing data following the this module on the connect stack. If the compression format given is not supported by the client, compression will not be applied. | function squish(compressors) {
var types = [];
if (!compressors || !(compressors instanceof Array)) {
throw 'Invalid parameter. First argument must be an array.';
}
compressors.forEach(function (compressor, i) {
if (!compressor.type || typeof compressor.type !== 'string') {
throw 'Invalid compressor... | [
"function handleSquish(ball, wasCollisionWithWall, collisionAngle, tangVelocity, perpSpeedI, perpSpeedF, time, deltaTime, handleContinuedSquish) {\n var duration, halfDuration, progress, weight1, weight2, squishStrength, minRx, endTime, handledPositioning, avgSpeed;\n handledPositioning = false;\n if (SQUI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Script runs main() when when PhoneGap is fully loaded. | function init() {
document.addEventListener("deviceready", main, true);
//$(document).ready(main);
} | [
"function main() {\n\tlog.verbose( 'main', 'Begin' );\n\tui.init({main: Notification});\n}",
"function onReady() {\n if (isDevelopment()) {\n installDevExtensions()\n }\n //setupGolem()\n createWindow()\n tray = createTray(win)\n\n ipcHandler(app, tray, win, createPreviewWindow, APP_WIDTH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================== Product View ============================== | function ProductView()
{
this.el = DIV("ProductView");
window.products = new ProductList();
this.details = new ProductDetails();
var companies = new ProductCompaniesList();
this.el.appendChild(SCROLL(window.products.el));
this.el.appendChild(this.details.el);
this.el.appendChild(SCROLL(companies.el));
LISTEN(th... | [
"function viewProducts() {\n console.log(chalk.green(\"\\n\\nBamazon - Manager View\\n\"));\n connection.query(\"SELECT * FROM products\\n\", function (err, res) {\n if (err) throw err;\n // called the function for the goods to be displayed\n createTable(res);\n });\n connection.end... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===== Check if a imsge/file name can be accepted Also, cf. 'acceptedFiles' in menubuttons.hbs (for Dropbox/dropzone) | function acceptedFileName (name) {
// This function must equal the acceptedFileName function in drop-zone.js
var acceptedName = 0 === name.replace (/[-_.a-zA-Z0-9]+/g, "").length
// Allowed file types are also set at drop-zone in the template menu-buttons.hbs
var ftype = name.match (/\.(jpe?g|tif{1,2}|p... | [
"function checkFile(el,allowed) {\n\tvar suffix = $(el).val().split(\".\")[$(el).val().split(\".\").length-1].toUpperCase();\n\tif (!(allowed.indexOf(suffix) !== -1)) {\n\t\talert(\"File type not allowed,\\nAllowed files: *.\"+allowed.join(\",*.\"));\n\t\t$(el).val(\"\");\n\t}\n}",
"function cs_contains_invalid_f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the contents of the cart to Local Storage | function saveCartToLocalStorage() {
localStorage.setItem('cart', JSON.stringify(Product.allProductsInCart));
} | [
"function saveCart() {\r\n //console.log(\"saveCart was called\");\r\n\r\n //localStorage.setItem(\"name\", value);\r\n //localStorage.setItem(\"shoppingCart\", cart);\r\n //NOTE local storage is best for strings and numbers\r\n //so going to convert cart into a usable string:\r\n localStorage.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sum of the surface fire HPUA and the entire active canopy HPUA (i.e., the canopy load canopy heat content, and NOT the canopy fuel model 10 HPUA) | function hpuaActive (surfHpua, cpyHpua) {
return surfHpua + cpyHpua
} | [
"function calcTotalValues(gam,mach,temp,dens,press) {\n\tvar temp0 = 0;\n\tvar dens0 = 0;\n\tvar press0 = 0;\n\ttemp0 = calcTotalTemperature(gam,mach,temp);\n\tdens0 = calcTotalDensity(gam,mach,dens);\n\tpress0 = calcTotalPressure(gam,mach,press);\n\treturn [temp0,dens0,press0];\n}",
"function airprops(t, p, phi)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abrir Modal Editar nutricionista | function AbrirModalsEditarNutricionista(){
$('#modals_nutricionista_editar').modal({backdrop:'static',keyboard:false});
$('#modals_nutricionista_editar').modal('show');
} | [
"function openModalNewResponsableMedicion() {\n\tabrirCerrarModal(\"modalAsignaPersonas\");\n\tsetFirstInput();\n}",
"function openModal(self) {\n\n console.log(self.bloqueEdit.data.title, this);\n self.controladorHTML.modalEdit.container.className = 'dia-show dia dia-nuevo-evento-container dia-defe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Delete buttons depending on if the element has siblings or not. If the field is the first field (and therefor don't have a sibling above) don't add a delete button. This mimics the way Liferay do it; In vanilla Liferay, you can't delete the _first_ element in a list of repeatable fields. Else, add a delete button. | function addDeleteButtons(el, siblings) {
if (siblings === 'before' || siblings === 'both') {
el.append('<a class="lfr-ddm-repeatable-delete-button icon-minus-sign" href="javascript:;"></a>');
}
} | [
"function handleVisibleDeleteAllButton() {\n\n let listElements = document.querySelectorAll('.to-buy__list--item').length;\n let btnBackground = document.querySelector('.delete-all');\n \n\n if (listElements < 1) {\n deleteBtn.style.display = 'none';\n btnBackground.style.display = 'none';\n\n } else {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles the task progress on the main page | function handleTaskProgress() {
var context = $('.hero__task-details'),
$heroPending = $('.-task-pending',context),
$heroAccepted = $('.-task-accepted',context),
$progress = $('.hero__task-details--progress',context);
if (window.workbert.taskState === 'pending') {
// show pending state
$heroAcce... | [
"function finishProcessing(id,percent,state,error){\n\t\tvar stateBar = getStateBarElement(id);\n\t\tvar btnStart = getBtnStartElement(id);\n\t\tvar btnDownlaod=getBtnDownloadElement(id);\n\t\t\n\t\tstateBar.innerHTML=state;\n\t\tif(error){\n\t\t\tupdateProgressBar (id, 0);\n\t\t\tresetColorsProgressBar (id);\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override this function to update any custom geometry needed for drawing based on new bounds. Called every time the state changes. | updateGeometry() {} | [
"updateGeometry_() {\n if (!this.iframe_) {\n return;\n }\n this.viewport_\n .getClientRectAsync(this.iframe_)\n .then((iframeBox) => {\n this.checkStillCurrent_();\n const formattedGeom = this.formatGeom_(iframeBox);\n this.sendMessage_(\n {\n newGeo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a `keepFirst` function that takes a string as parameter and return the string only keeping the 2 first characters Create a `keepLast` function that takes a string as parameter and return the string only keeping the 2 last characters Create a `keepFirstLast` function that takes a string as parameter and only keep... | function keepFirst(str) {
return str.slice(0, 2);
} | [
"function cutFirst(string){\n return string.substr(2);\n }",
"function move3(string1) {\n //test that string1 is at least three characters\n if (!(string1.length > 2)) {\n\n console.log(\"Input string must be at least three characters. Function execution terminates here.\")\n\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates pattern via copy and invert value | function setPattern({ y, x, value }) {
const patternCopy = [...pattern];
patternCopy[y][x] = +!value;
updatePattern(patternCopy);
} | [
"function setPattern({ y, x, value }) {\n const patternCopy = [...pattern];\n patternCopy[y][x] = +!value;\n updatePattern(patternCopy);\n }",
"invert() {\n for (let i = 0; i < this._data.length; i++) {\n this._data[i] = ~this._data[i];\n }\n }",
"function upd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the BoxIndex is essentially what number of box has been created, but NOT the true array index in state.boxes this function returns the true array index | findBoxArrayIndex(box){
var arrayIndex;
for (var i=0; i < this.state.boxes.length; i++) {
if (this.state.boxes[i].boxIndex === box.boxIndex) {
arrayIndex = i;
break;
}
}
return arrayIndex;
} | [
"function findSafeIndex(boxesUsed) {\n //looks at previous rows if inside the sub box to see if the current number can be placed in the sub box\n function boxSafe(index) {\n let indexBox = Math.floor(index / horizontalBoxSize);//finds which sub box the current index is in\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a Curve3 object along a Cubic Bezier curve : | static CreateCubicBezier(v0, v1, v2, v3, nbPoints) {
// tslint:disable-next-line:no-parameter-reassignment
nbPoints = nbPoints > 3 ? nbPoints : 4;
const bez = new Array();
const equation = (t, val0, val1, val2, val3) => {
const res = (1.0 - t) * (1.0 - t) * (1.0 - t... | [
"function bezierCurve(u, q){\n\tvar B = bern3;\n\tvar n = 4;\n\n\tvar p = vec3(0,0,0);\n\n\tfor(var i=0; i<n; i++){\n\t\tp = add(p, scale(B(i, u), q[i]));\n\n\t}\n\n\treturn p;\n}",
"get curve() {}",
"continue(curve) {\n const lastPoint = this._points[this._points.length - 1];\n const continue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Similar to FastPath.prototype.call, except that the value obtained by accessing this.getValue()[name1][name2]... should be arraylike. The callback will be called with a reference to this path object for each element of the array. | each(callback, ...names) {
const {
stack
} = this;
const {
length
} = stack;
let value = getLast(stack);
for (const name of names) {
value = value[name];
stack.push(name, value);
}
for (let i = 0; i < value.length; ++i) {
if (i in value) {
stack.pu... | [
"function invoke(arr, methodName, var_args){\n var args = Array.prototype.slice.call(arguments, 2);\n forEach(arr, function(item){\n item[methodName].apply(item, args);\n });\n return arr;\n }",
"applyPathFilterOnFilesList(file, index, array) {\n this[index] = self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_____________________________________________________________________// This function receives the measure mode choice done by the user // _____________________________________________________________________ | function measureMode(x)
{
if ((x != PRECISE_MEASURE) && (x != IMPRECISE_MEASURE))
{
return WRONG_MEASURE_MODE;
}
else
{
myMeasureMode = x;
return NO_ERROR;
}
} | [
"function parseMeasureMode(x)\n{\n\tswitch (x)\n\t{\n\t\tcase PRECISE_MEASURE_ID:\n\t\tmyMeasureMode = PRECISE_MEASURE;\n\t\treturn NO_ERROR;\n\t\tbreak;\n\t\t\n\t\tcase IMPRECISE_MEASURE_ID:\n\t\tmyMeasureMode = IMPRECISE_MEASURE;\n\t\treturn NO_ERROR;\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\treturn WRONG_MEASURE_MODE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the date less occures before or after the date more | function IsEarlier(less, more)
{
if (less.getFullYear() > more.getFullYear())
{
return false;
}
if (less.getMonth() > more.getMonth() && less.getFullYear() == more.getFullYear())
{
return false;
}
if (less.getDate() > more.getDate() && less.getMonth() == more.getMonth() && less.getFullYear() == more.getFullY... | [
"function validDates() {\n if (checkIn.val() != '' && checkOut.val() != '') {\n inDate = new Date(checkIn.val())\n outDate = new Date(checkOut.val())\n if (inDate < outDate) {\n return true\n }\n }\n return false\n }",
"function Ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initiate the image picker | function initializeImagePicker() {
$('#selectProjectImages').imagepicker({
selected: onImagePickerOptionChange
});
$('#selectProjectImages')
.data('picker')
.sync_picker_with_select();
} | [
"function open_img_selection() {\n if (!initializedLibraryUpload) {\n initializeLibraryUploadForm();\n initializedLibraryUpload = true;\n }\n $('#select-img-modal').modal('open');\n}",
"function onImagePickerOptionChange(pickerOption) {\r\n $('#projectImagePreview').attr('src', $(pickerO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables or disables authorization codes based upon the checkbox value | function toggleAuthCodes (){
if (dojo.byId('outOfStateCheckBox').checked){
dojo.byId('outOfStateAuthCodes').disabled = false;
for (var i=0; i<dojo.byId('outOfStateAuthCodes').options.length; i++){
// enable individual options
document.getElementById('outOfStateAuthCodes').options[i].disabled = false;
... | [
"enable() {\n\t\t\tSpark.post('/settings/two-factor-auth', this.form)\n\t\t\t\t.then(code => {\n\t\t\t\t\tthis.$parent.$emit('receivedTwoFactorResetCode', code);\n\n\t\t\t\t\tBus.$emit('updateUser');\n\t\t\t\t});\n\t\t}",
"enable () {\n Spark.post('/settings/two-factor-auth-google', this.form)\n .then... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The IntelliJ (and probably other IDEs) passes test names as a regexp in the format: grep=/some regexp.../ But mochajs doesn't expect the '/' characters before and after the regexp. The code below patches input args and removes '/' if they exists. | function installPatch(karma) {
const originalKarmaStart = karma.start;
karma.start = function (config, ...args) {
const regexpGrepPrefix = "--grep=/";
const regexpGrepSuffix = "/";
if (config && config.args) {
for (let i = 0; i < config.args.length; i++) {
const arg = config.args[i];
... | [
"generateExcludePattern() {\n const transpile = this.transpileModules;\n\n if (transpile === true) {\n return /(\\b@babel|core-js|webpack|(css)-loader)\\b/;\n } else if (!transpile || (Array.isArray(transpile) && !transpile.length)) {\n return /node_modules/;\n } else {\n const includeMod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Layout Siblings =============== a group of sibling layout areas | function LayoutSiblings(layoutAreas, parentArea, opt) {
opt = _.defaults(opt || {}, { siblingGap: 0 });
this.width = 0;
this.height = 0;
this.layoutAreas = this.sortLayoutAreas(layoutAreas);
this.parentArea = parentArea;
this.siblingGap = opt.siblingGap;
this.co... | [
"function applyOrderWidthAndVisibility (layout) {\n var stack = [{node :root , index :0}];\n\n do{\n var current = stack[stack.length-1];\n\n if (current.node.children.length === 0 && current.node.parent) {\n table.find('.' + current.node.parent.id).each(function (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return 1 if the athlete has a worse result in the previous checkpoint, 0 if it is the same or 1 if it's better. | function worseOrBetterResult(checkpointsCompleted, resultsAtCheckpoint, bibId, idCheckpointCurrent, currentRank) {
const indexCheckpoint = checkpointsCompleted.indexOf(idCheckpointCurrent);
// The first one, no changes
if (indexCheckpoint === 0) {
return 0;
}
const previousCheckpointId = checkpointsComple... | [
"function companyBotStrategy(trainingData) {\n let time = 0;\n let correctness = 0;\n trainingData.forEach(data => {\n if (data[1] === 1) {\n time += data[0];\n correctness += data[1];\n }\n });\n\n return time / correctness || 0;\n}",
"function checkScore() {\n if (locArray[currentL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sprite_Destination The sprite for displaying the destination place of the touch input. | function Sprite_Destination() {
this.initialize.apply(this, arguments);
} | [
"function DestinationNode(gl, renderGraph) {\n _classCallCheck(this, DestinationNode);\n\n var definition = {\n fragmentShader: _destinationnode2.default,\n vertexShader: _destinationnode4.default,\n properties: {},\n inputs: [\"u_ima... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if JSZip can read/generate Uint8Array, false otherwise. | get uint8array() {
return typeof Uint8Array !== "undefined";
} | [
"function isUtf8 (buffer) {\n\t\t// Adapted from https://mimesniff.spec.whatwg.org/ \"binary data byte\"\n\t\tvar view = new Uint8Array(buffer),\n\t\t\tcheck = Math.min(256, buffer.byteLength);\n\t\tfor (var i = 0; i < check; i++) {\n\t\t\tvar b = view[i];\n\t\t\tif (b <= 0x08 || b == 0x0B || (b >= 0x0E && b <= 0x1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Absorb the given event | function absorbEvent(event)
{
event.preventDefault();
} | [
"function cancelbubbling(e) {\n Event.stop(e);\n }",
"handleNoChangeEvent() {\n \n }",
"function stopObserving(eventName, handler){\n returning(this, function(){\n eventName = eventName.toString();\n if (!this._eventHandlers || !this._eventHandlers[eventName]) return;\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parser for table where just the columns are labeled | function parseLabeledCols(entries) {
return entries.map(function (entry) {
return parseEntry(entry);
});
} | [
"function parseTable() {\n var name = t.identifier(getUniqueName(\"table\"));\n var limit = t.limit(0);\n var elemIndices = [];\n var elemType = \"anyfunc\";\n\n if (token.type === _tokenizer.tokens.string || token.type === _tokenizer.tokens.identifier) {\n name = identifierFromToken... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a GIVEAProgram object from a table embedded in the HTML. | function TableIdToGIVEProgram(table_id) {
//retreive the DOM element within the GIVEAgency table id
var program_DOM_element = document.getElementById(table_id);
//there's no way to reliably retrieve the data in between <td> </td> tags
//using DOM element properties. Instead, obtain the innerHTML for the
//<tr> ... | [
"function TableIdToGIVEAgency(table_id) {\n\n\t//retreive the DOM element within the GIVEAgency table id\n\tvar agency_DOM_element = document.getElementById(table_id);\n\t\n\t//there's no way to reliably retrieve the data in between <td> </td> tags\n\t//using DOM element properties. Instead, obtain the innerHTML fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if all elements of the iterable object are true. | function all( iterable )
{
var res = true;
foreach(function (x)
{
if ( !x )
{
res = false;
throw StopIteration;
}
},
iterable);
return res;
} | [
"function any( iterable )\n {\n var res = false;\n \n foreach(function (x)\n {\n if ( x )\n {\n res = true;\n throw StopIteration;\n }\n },\n iterable);\n \n return res;\n }",
"function every(array, value) {\n var boolean = true;\n array.forEach(el => {\n if (el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Jasmine has trouble spying on properties supplied by getters, so to make it work we have to get the value, delete the getter, and set the value as a property. This makes two assumptions: The getter is idempotent (otherwise, callers in other tests might be surprised when the value here is returned) The getter returns a ... | function spyOnGetterValue(object, f) {
const value = object[f];
delete object[f];
object[f] = value;
return spyOn(object, f);
} | [
"unsetValue() {\n if (this._getter !== undefined) {\n throw new Error(`Cannot unset the value of an attribute that has a getter (${this.describe()})`);\n }\n if (this._isSet !== true) {\n return { previousValue: undefined };\n }\n const previousValue = this.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pause for 3 seconds, evaluate final winner status, and proceed to next stage | function transitionToNextRound() {
setTimeout(function () {
transitionDelay();
}, 3000);
if (player1Victories > 2) {
finalWinner = "Player 1";
}
if (player2Victories > 2) {
finalWinner = "Player 2";
}
} | [
"function submitRoundOneA(){\n\tcurrentCard = deck.pop();\n\tvar cardAsString = idCard(currentCard);\n\t//see if players guess is correct\n\tvar suit = currentCard % 4;\n\tif (suit === 1 || suit === 2){\n\t\t//TODO create equation to determine the amount of drinks to assign\n\t\t$(\".instructions\").text(\"Give Dri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Was this a cancelation exception? | function cancel_ques__1(exn) /* (exn : exception) -> bool */ {
var _x9 = info(exn);
return (_x9._tag === _tag_Cancel);
} | [
"function unsafe_cancel_exn() /* () -> exception */ {\n return exception(\"computation is canceled\", Cancel);\n}",
"isActionAborted() {}",
"function cancel_ques_(exception_info) /* (exception-info : exception-info) -> bool */ {\n return (exception_info._tag === _tag_Cancel);\n}",
"get isCancelled() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AVATAR TOOLTIP TWEAKS ================================================================== add links to avatar tooltips when they are hovered | function editAvatarTooltips(target) {
target.hover(function() {
var userUrlParts = $(this).attr("href").split("/");
var userID = userUrlParts[userUrlParts.length - 1];
// get username: if there is an Upic use its alt attribute, otherwise get it normally
if ( $(".tooltipster-base .Upic").length > 0 ) {
var... | [
"function create_tooltips() {\n $(\"#additional_volunteers .might-overflow\").tooltip({ placement: \"left\"});\n $(\"#additional_volunteers .volunteer_name\").hover(function() {\n $(this).children(\".help-edit\").removeClass(\"hidden\");\n }, function() {\n $(this).children(\".help-edit\").addCla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Macroish function that converts the input parameter to a CSS class selector | function CLASS_SELECTOR(className)
{
return "." + className;
} | [
"classNames(...classes) {\r\n let classesToAdd = [];\r\n\r\n classes.forEach(classObj => {\r\n // simple class name; apply it outright\r\n if (typeof classObj === 'string') {\r\n classesToAdd.push(classObj);\r\n\r\n } else if (typeof classObj === 'object... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove currency from table | function removeCurrency(id){
row = document.getElementById(id);
//Remove the index out of the used currencies
usedCurrencies = removeFromArray(parseInt(row.value),usedCurrencies);
//Remove the row of the currency
row.parentNode.removeChild(row);
//Add the currency back to the dropdown list for adding
upda... | [
"function removeRowDiscount(){\n \t$('.coupon_discount_amount .new_price').empty();\n }",
"function clearTable(){\r\n\tcTable = document.getElementById(\"conversionTable\");\r\n\titemList = cTable.childNodes;\r\n\tif(cTable.childElementCount<=2){return;}\r\n\t//Store the header and \"add currency\" rows\r\n\thead... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO API DOC FOR process_rendering_result_scripts_tags(arg_dom_element, arg_rendering_result_scripts_tags=[]/, arg_credentials/) | process_rendering_result_scripts_tags(arg_dom_element, arg_rendering_result_scripts_tags=[]/*, arg_credentials*/)
{
this.debug('process_rendering_result_scripts_tags:rendering body_scripts_tags', arg_rendering_result_scripts_tags)
arg_rendering_result_scripts_tags.forEach(
(tag)=>{
this.debug('process_re... | [
"process_rendering_result_scripts_urls(arg_dom_element, arg_rendering_result_scripts_urls=[], arg_credentials)\n\t{\n\t\tthis.debug('process_rendering_result_scripts_urls:rendering body_scripts_urls', arg_rendering_result_scripts_urls)\n\t\t\n\t\t// SEARCH DEVAPT BOOTSTRAP SCRIPT TAG\n\t\t// const devapt_bootstrap_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |