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 |
|---|---|---|---|---|---|---|
rerenderMatrix with new ActiveIndeces... | MatrixReRender(newRow, newCol)
{
// updates this field for tracking purposes...
this.activeIndeces = {
row: newRow,
col: newCol
}
this.HTMLMatrix = this.MatrixDom(this.Matrix, this.activeIndeces.col, this.activeIndeces.row);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"reiniciar(){\n mat4.set(this.inicial,this.matrix);\n }",
"resetMatrix() {\n this.activator();\n const conf = { stft: {}, startTime: 0 };\n this.stftHandler.setConfig(conf);\n this.transformationMatrix = this.savedMatrix;\n this.emitUpdateEvent();\n }",
"functio... | [
"0.70557743",
"0.6919507",
"0.69096047",
"0.6562324",
"0.5972937",
"0.59623635",
"0.5941905",
"0.5928385",
"0.58323795",
"0.5818394",
"0.5793352",
"0.5782571",
"0.57284987",
"0.5718711",
"0.5702104",
"0.5667926",
"0.5657788",
"0.56479913",
"0.56325185",
"0.56052434",
"0.55785... | 0.70051473 | 1 |
define setVariations mutation to set the list of variations returned by loadVariations action | setVariations(state, payload) {
state.variations = payload.variations
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function History_Variations_ProcessVariations(interpreter)\n{\n\t//loop through the array of changes\n\tfor (var i = 0, c = this.Changes.length; i < c; i++)\n\t{\n\t\t//get changes\n\t\tvar changes = this.Changes[i];\n\t\t//get this object\n\t\tvar intObject = interpreter.LoadedObjects[changes.UniqueId];\n\t\t//va... | [
"0.62103146",
"0.58091617",
"0.56588465",
"0.5414776",
"0.51175904",
"0.5095622",
"0.49786478",
"0.49156454",
"0.49093965",
"0.4896046",
"0.48675936",
"0.48565045",
"0.48420227",
"0.48320326",
"0.478984",
"0.47723776",
"0.47263205",
"0.4647214",
"0.4629102",
"0.4622292",
"0.4... | 0.6905264 | 0 |
Classes to be applied to the single tab component | get mainClasses() {
return classNames(
'carbon-tab',
this.props.className
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get CLASS() {\n return {\n BUTTON_ACTIVE: 'tab-button--active',\n CONTENT_ACTIVE: 'tab-content--active'\n }\n }",
"static get CLASS() {\n return {\n MAIN_TAB_ELEMENT: '.tab-element'\n };\n }",
"static get CLASS() {\n return {\n TAB_BAR_ELEMENT: '.tab-button-bar',\n ... | [
"0.79943603",
"0.72043836",
"0.6877499",
"0.6595442",
"0.6573601",
"0.6550351",
"0.6451486",
"0.6435729",
"0.6401261",
"0.63354826",
"0.6325788",
"0.6278734",
"0.62637615",
"0.6262583",
"0.62482566",
"0.62216765",
"0.6114815",
"0.6072058",
"0.60569584",
"0.60552734",
"0.60408... | 0.7417523 | 1 |
start a typewriter animation for a text in the dataText array | function StartTextAnimation(i) {
if (typeof dataText[i] == 'undefined'){
setTimeout(function() {
StartTextAnimation(0);
}, 20000);
}
// check if dataText[i] exists
if (i < dataText[i].length) {
// text exists! start typewriter animation
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StartTextAnimation(i) {\n if (typeof dataText[i] == 'undefined'){\n setTimeout(function() {\n StartTextAnimation(0);\n }, 20000);\n }\n // check if dataText[i] exists\n if (i < dataText.length) {\n // text exists! start typewriter animation\n typeWriter(dataT... | [
"0.8425488",
"0.8423421",
"0.84225845",
"0.8398641",
"0.8368707",
"0.83426553",
"0.8238835",
"0.8178536",
"0.80250746",
"0.78592485",
"0.77650225",
"0.7303372",
"0.71506786",
"0.71217304",
"0.7065817",
"0.7065817",
"0.69983804",
"0.69718003",
"0.69590026",
"0.6950085",
"0.694... | 0.84705985 | 0 |
Main entry point. Program : NumericLiteral ; | Program() {
return this.NumericLiteral();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Numeric() {}",
"NumericLiteral() {\n const token = this._eat('NUMBER');\n return {\n type: 'NumericLiteral',\n value: Number(token.value),\n };\n }",
"NumericLiteral() {\n const token = this._eat('NUMBER')\n return {\n type: 'NumericLiteral',\n v... | [
"0.7023095",
"0.67890817",
"0.66804117",
"0.641636",
"0.6260363",
"0.61293614",
"0.59811544",
"0.5881108",
"0.5572822",
"0.5548579",
"0.5542209",
"0.54260683",
"0.5425548",
"0.5422782",
"0.5418761",
"0.54183877",
"0.53679",
"0.5362949",
"0.533921",
"0.533921",
"0.533921",
"... | 0.7471119 | 0 |
Updater for the max attr | set max(value) {
Helper.UpdateInputAttribute(this, 'max', value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set _max(value) {\n Helper.UpdateInputAttribute(this, \"max\", value);\n }",
"_updateMaxRings() {\n this._vRings.forEach((ring) => {\n if (ring.typeAttr === \"V\")\n ring.maxValue = max$1(this.model.data.nodes.dataNodes, function (d) { return d.values[ring.indexAttr]; });\n else\n ... | [
"0.77965295",
"0.7202517",
"0.71898013",
"0.71628803",
"0.684866",
"0.67915064",
"0.67915064",
"0.67915064",
"0.67915064",
"0.67915064",
"0.67915064",
"0.6666205",
"0.6608196",
"0.6600614",
"0.6583223",
"0.6567004",
"0.65615094",
"0.6559054",
"0.6547594",
"0.65265375",
"0.651... | 0.75997406 | 1 |
Updater for the step attr | set step(value) {
Helper.UpdateInputAttribute(this, 'step', value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set _step(value) {\n Helper.UpdateInputAttribute(this, \"step\", value);\n }",
"setStep (stepIn) {\n this.step = stepIn\n }",
"_stepChanged() {\n // Cant have a step less than 0\n if(this.step < 0) {\n console.warn(\"Improper configuration: step cannot be negative. Falling back to abso... | [
"0.7481281",
"0.6671935",
"0.65674883",
"0.65107715",
"0.63392025",
"0.6335667",
"0.629827",
"0.6205307",
"0.60663927",
"0.60595113",
"0.60156476",
"0.5988744",
"0.5987871",
"0.59684443",
"0.5944692",
"0.59017074",
"0.585805",
"0.5847243",
"0.5822298",
"0.5814214",
"0.5813503... | 0.7124157 | 1 |
Getter method for errortext | get errortext() {
return this._errortext;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set errortext(value) {\n Helper.UpdateInputAttribute(this, \"errortext\", value);\n }",
"set errortext(value) {\n Helper.UpdateInputAttribute(this, \"errortext\", value);\n }",
"getErrMsg() {\n return this.errMsg;\n }",
"getErrMsg() {\n return this.errMsg;\n }",
"getErrMsg() {\n... | [
"0.7364162",
"0.7364162",
"0.715109",
"0.715109",
"0.715109",
"0.6666991",
"0.6666178",
"0.6656867",
"0.66293997",
"0.6621079",
"0.6528939",
"0.6512095",
"0.64912415",
"0.6476851",
"0.6465187",
"0.6426698",
"0.64261353",
"0.6418479",
"0.63952684",
"0.63834125",
"0.6330066",
... | 0.8918166 | 1 |
clears the error and restores the errortext. | clearError() {
this.error = false;
this._errortext = this.__initalErrorText;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function esconderError() {\n setError(null);\n }",
"function clearErrorMsg() {\n AlmCommon.clearMsgs();\n }",
"function _resetErrors() {\r\n el.email_input.removeClass('error');\r\n el.email_error.text('');\r\n }",
"resetErrors() {\n this.errorCount = 0;\n thi... | [
"0.7292767",
"0.71926737",
"0.6678966",
"0.661028",
"0.6569272",
"0.65190256",
"0.6468266",
"0.643626",
"0.63895965",
"0.63895965",
"0.63812524",
"0.6356434",
"0.6335597",
"0.63029116",
"0.62968445",
"0.62544125",
"0.62499875",
"0.6245735",
"0.6244612",
"0.6227017",
"0.622154... | 0.8262353 | 1 |
Adds placeholder/ warning formatting to project carousel entry in the event that a project cannot be retrieved from the HOT Tasking Manager API | function makePlaceholderProject (projectId, projectOrder) {
// Adds error title
$(`ul li:nth-child(${projectOrder}) .HOT-Title p`)
.html(`<i class="ico icon collecticon-sign-danger"></i>
<b>HOT Project #${projectId} Not Active/Not Found in HOT Tasking Manager</b>`);
// Hides Tasking Manager Contribute button... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static projectListEmpty() {\n const template = `\n <div class=\"col-12 alert alert-warning\">Empty projects list</div>\n `;\n\n return template;\n }",
"function showSpecialProjects(projects, warning) {\n\t\tif ( !projects.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$overview.append... | [
"0.6054263",
"0.59629065",
"0.5813488",
"0.5769285",
"0.57360196",
"0.5634282",
"0.5568235",
"0.5547311",
"0.5504847",
"0.54419005",
"0.5418139",
"0.54020035",
"0.5348606",
"0.53368795",
"0.5297292",
"0.5249192",
"0.52272",
"0.5216851",
"0.5212802",
"0.5196234",
"0.51935434",... | 0.6137705 | 0 |
Start loading the pokemon list | async _startLoadingPokemonNames() {
this.pokemonNames = await getPokemonNamesAction();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadList() {\n showLoadingMessage('Loading Pokemon list, please wait...');\n return fetch(apiUrl)\n .then(function(response) {\n return response.json();\n })\n .then(function(json) {\n hideLoadingMessage();\n json.results.forEach(function(item) {\n... | [
"0.7459682",
"0.7194094",
"0.7126985",
"0.7103284",
"0.7044874",
"0.700089",
"0.69537044",
"0.6952534",
"0.6937209",
"0.69120497",
"0.6899374",
"0.6879257",
"0.68570215",
"0.68570215",
"0.683107",
"0.6824678",
"0.6775585",
"0.67381364",
"0.6736215",
"0.66878814",
"0.668753",
... | 0.7690149 | 0 |
fulfills/reject a promise for a response with the given response | function fulfillResponsePromise(promise, response) {
// wasnt streaming, fulfill now that full response is collected
if (response.status >= 200 && response.status < 400)
promise.fulfill(response);
else if (response.status >= 400 && response.status < 600 || response.status === 0)
promise.reject(response);
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolvePromise(response,status,headers,statusText){//status: HTTP response status code, 0, -1 (aborted by timeout / promise)\nstatus=status>=-1?status:0;(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText});}"... | [
"0.7198706",
"0.71578866",
"0.71056706",
"0.71056706",
"0.71056706",
"0.71056706",
"0.71046627",
"0.7022702",
"0.6916886",
"0.69115233",
"0.69115233",
"0.69115233",
"0.69115233",
"0.69115233",
"0.69115233",
"0.69084144",
"0.69084144",
"0.69084144",
"0.69084144",
"0.69084144",
... | 0.7188794 | 1 |
ServerResponse ============== EXPORTED Interface for local servers to respond to requests generated internally and given to local servers not given to clients; instead, interfaces with the ClientResponse given to the client | function ServerResponse(resPromise, isStreaming) {
local.util.EventEmitter.call(this);
this.resPromise = resPromise;
this.isStreaming = isStreaming;
this.clientResponse = new ClientResponse();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nlobjServerResponse() {\n}",
"function Response (fd,server,request) {\n this._server = server;\n this.headersSent = false;\n this.request = request;\n util.extend(this,{\n sock: fd,\n status: 200,\n contentLength: 0,\n contentType: 'text/html',\n cookies: {... | [
"0.6487338",
"0.6343833",
"0.6103964",
"0.5925554",
"0.58621836",
"0.57792115",
"0.57530725",
"0.57482255",
"0.5732799",
"0.5699669",
"0.56889683",
"0.56511074",
"0.56501013",
"0.56487465",
"0.56265235",
"0.5614992",
"0.5598642",
"0.5579648",
"0.5539696",
"0.5508397",
"0.5501... | 0.6951913 | 0 |
get sysconfig device schema success | [actions.TOPOLOGYMGMT_GET_SYSCONFIG_DEVICE_SCHEMA_SUCCESS](state, action) {
return {
...state,
[action.identify]: {
...state[action.identify],
[action.schemaType]: action.sysconfigDeviceSchema,
sysconfigDevicePropertySchema: action.sysconfi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getSysInfo() {\n let response = await this.get('/api/slot/0/sysInfo');\n return Object.assign({}, response.sysInfo.device[0],\n response.sysInfo.network.LAN);\n }",
"[actions.TOPOLOGYMGMT_GET_SYSCONFIG_DEVICE_TYPE_SCHEMA_SUCCESS](state, action) {\n re... | [
"0.6363715",
"0.61965734",
"0.58091056",
"0.5780956",
"0.57349235",
"0.5647388",
"0.54743236",
"0.54537046",
"0.5425951",
"0.53549933",
"0.52701443",
"0.5240563",
"0.5228665",
"0.51658493",
"0.5148837",
"0.5135066",
"0.5090773",
"0.50842357",
"0.5053806",
"0.5042949",
"0.5033... | 0.6550549 | 0 |
POPULATE THE CHANNEL PICKER | function channelPicker(){
// Loop that adds individual items to the menu
for ( var i = 0; i < stationsArray.length; i++ ) {
$('.channelPicker').append("<p class = \"channels\">"+ stationsArray[i] +"</p>"); //labelArray[i]
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get channelCount() {return 2}",
"function renderChannels() {\n return channels.map( (channel,i)=>{\n return <ColorPicker key={i} channel={channel} index={i} />\n });\n }",
"function update_channels(data){\n\t\tlet ch_win = document.querySelector('#channelPanel');\n\t\tlet ch = document.createElemen... | [
"0.59693855",
"0.5934769",
"0.5801612",
"0.57664514",
"0.5740865",
"0.5616635",
"0.5601509",
"0.54973084",
"0.5482909",
"0.5464007",
"0.5383213",
"0.53642625",
"0.5342078",
"0.5307463",
"0.5279064",
"0.52684176",
"0.5254879",
"0.5230545",
"0.52046895",
"0.5203241",
"0.52032",... | 0.59669983 | 1 |
EVENTS ON THE CHANNEL PICKER | function channelPickerFunctions(){
// FADE THE PICKER IN
$('.station').mousedown(function(){
$('.channelPicker').fadeIn("fast");
});
// FADE THE STATION PICKER OUT
$('.overlay').mousedown(function(){
$('.channelPicker').fadeOut("fast");
});
// STATION PICKER SELECT FUNCTION
$('.channels'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mouseClicked() {\n \n\nsendChannel1();\n\n}",
"function OnChannelOpen()\n{\n}",
"function update_channels(data){\n\t\tlet ch_win = document.querySelector('#channelPanel');\n\t\tlet ch = document.createElement(\"a\");\n\t\tch.setAttribute('class','list-group-item list-group-item-action pt-1 pb-1');\n\t... | [
"0.68384004",
"0.6434275",
"0.63512367",
"0.6206217",
"0.6082241",
"0.6002677",
"0.5984843",
"0.5888755",
"0.5876408",
"0.5834882",
"0.58345443",
"0.5806587",
"0.57784283",
"0.5767014",
"0.57607764",
"0.5747453",
"0.5722924",
"0.57179606",
"0.5706434",
"0.57042664",
"0.570089... | 0.6459381 | 1 |
DRAG THE PAGE CONTENT | function dragContent(){
$('.stationInfo').draggable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dragGo(event) {\n var x, y;\n // Get cursor position with respect to the page.\n y = event.clientY + window.scrollY;\n\n //d.elNode.style.left = (d.elStartLeft + x - d.cursorStartX) + \"px\";\n if ((d.elStartTop + y - d.cursorStartY)>=(dims.headerw? (dims.headert+16) : (dims.top+16)) && (d... | [
"0.62688243",
"0.624319",
"0.6200051",
"0.6160135",
"0.6149124",
"0.61482155",
"0.61482155",
"0.6147092",
"0.61396194",
"0.6130347",
"0.6098387",
"0.6019324",
"0.59599024",
"0.59240323",
"0.5894683",
"0.5887332",
"0.58621633",
"0.5848109",
"0.5847589",
"0.5844106",
"0.5835519... | 0.7125542 | 0 |
page load to trigger calendar stuff | function pageLoad(){
console.log("init hello");
getDates()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadCalendar() {\r\n hideall();\r\n $(\"#sidebar\").show();\r\n $(\"#cal\").show();\r\n deactiveAll();\r\n $(\"#side-calendar\").addClass(\"active\");\r\n $(\"#navbar\").show();\r\n // Additonal calls \r\n clearCalendar();\r\n makeCalander();\r\n\r\n}",
"function loadCalendar... | [
"0.75878567",
"0.72122395",
"0.7166728",
"0.7073075",
"0.70363116",
"0.7024932",
"0.688169",
"0.6701853",
"0.66491824",
"0.6618067",
"0.65925217",
"0.658759",
"0.65814245",
"0.6580542",
"0.6554781",
"0.65365714",
"0.6521853",
"0.651464",
"0.6504879",
"0.64728487",
"0.6469415"... | 0.72326994 | 1 |
Split chunked results (just a string). Extract a list of "[VP ... ]" | static getPossibleSubjects(chunked) {
let vpStart = chunked.indexOf('[VP');
if (vpStart === -1) {
return [];
}
let numParenthesis = 0;
let possibleSubjects = []
for (let i = vpStart; i < chunked.length; i++) {
if (chunked[i] === '[') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function split(parsed){\n\tvar ret = [];\n\tvar chunk = [];\n\tfor(var i=0; i<parsed.length; i++){\n\n\t\tvar item = parsed[i];\n\t\tvar flags = item.flags;\n\t\t\n\t\tfor(var f=0; f<flags.length; f++){\n\t\t\tvar flagList = flags[f];\n\t\t\tif(spliton.indexOf(flagList.flag) > -1){\n\t\t\t\tif(chunk.length){\n\t\t... | [
"0.6086279",
"0.6064586",
"0.59706223",
"0.5855275",
"0.55438745",
"0.5536561",
"0.5504183",
"0.55004984",
"0.5418984",
"0.5368119",
"0.53680086",
"0.53676605",
"0.53315324",
"0.5310026",
"0.5254557",
"0.5254557",
"0.5213982",
"0.52102554",
"0.51966274",
"0.51901525",
"0.5165... | 0.606998 | 1 |
remove square brackets && tags of splitted chuck | static removeTags(trees) {
for (let i = 0; i < trees.length; i++) {
trees[i] = trees[i].replace(/\[[^ ]* /g, '') // remove left hand chunk eg. [VP
.replace(/\/[^ ]* /g, ' ') // remove tag with space following backlash eg. /NN
.replace(/\/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stripTags(text) {\n return text.trim().replace(/(^\\{)|(\\-{2})|(\\}$)+/g, '').split('=')\n }",
"function cleanTagArr(arr) {\n let filteredArr = [];\n let cleanedStr = \"\";\n\n arr.forEach(function(item) {\n cleanedStr = item.replace(tagEndFilter, \"\");\n cleanedStr = cleanedStr.replace(tagB... | [
"0.6435555",
"0.60848635",
"0.57598597",
"0.5648822",
"0.5625583",
"0.56027794",
"0.55615765",
"0.55615765",
"0.55615765",
"0.55615765",
"0.55195",
"0.5515027",
"0.54350555",
"0.54176295",
"0.54053295",
"0.5395376",
"0.53943354",
"0.53919286",
"0.5357124",
"0.5356103",
"0.533... | 0.6523311 | 0 |
Places button elements into the buttonsDiv div | function placeButtons() {
// Loops through all pagination buttons and adds them to the buttonsDiv div
for (let index = 0; index < paginationLinks.length; index += 1) {
buttonsDiv.appendChild(paginationLinks[index]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderButtons() {\n\n // Deleting the divas prior to adding new divas\n $(\"#buttons-view\").empty();\n\n // Looping through the topics array\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each diva in the array\n var a = $(\"<button>\");\n ... | [
"0.7514127",
"0.73259753",
"0.72511363",
"0.7206749",
"0.71777666",
"0.7163624",
"0.7122378",
"0.7120076",
"0.71190095",
"0.7096883",
"0.7085724",
"0.7071741",
"0.70515966",
"0.7038598",
"0.70276165",
"0.70253754",
"0.7024846",
"0.70227146",
"0.7010986",
"0.70086503",
"0.6970... | 0.7560548 | 0 |
Puts a search bar in the page header div | function displaySearchBar() {
const pageHeader = document.getElementsByClassName("page-header cf")[0];
pageHeader.appendChild(searchBar);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initHeaderSearch()\n\t{\n\t\t$('.search_button').click(() => {\n\t\t\t$('.header_search_container').toggleClass('active');\n\t\t\tif ($('.header_search_container')[0].classList.contains('active')) {\n\t\t\t\t$('.body_container').css('margin-top', '203px');\n\t\t\t} else {\n\t\t\t\t$('.body_container').css... | [
"0.7148975",
"0.7078412",
"0.69821644",
"0.6945551",
"0.6903557",
"0.67621315",
"0.6753377",
"0.67422616",
"0.6722419",
"0.66810703",
"0.6643654",
"0.6620723",
"0.6596512",
"0.65390056",
"0.6500469",
"0.645625",
"0.6363759",
"0.63355947",
"0.6307315",
"0.63052195",
"0.6299969... | 0.77130455 | 0 |
selection of the first name, last name and employeeid from the employee table and back to an object array | async function helperEmpManager() {
let res = await connection.query(`SELECT CONCAT(employee.first_name," " ,employee.last_name) AS fullName, employee.id FROM employee`)
let employeName = [];
res.forEach(emp => {
//saving on the list of objects
employeName.push({ name: emp.fullName, value: emp.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateEmployees() {\n const query = \"SELECT ID, first_name, last_name FROM employee\";\n connection.query(query, (err, res) => {\n employees.splice(0, employees.length);\n employeesId.splice(0, employeesId.length);\n for (const i in res) {\n employees.push(res[i].f... | [
"0.7116407",
"0.6998401",
"0.69345665",
"0.68816906",
"0.6806682",
"0.67939144",
"0.6717165",
"0.67162424",
"0.668744",
"0.66248214",
"0.661333",
"0.65045404",
"0.6483556",
"0.6443473",
"0.6402794",
"0.63866645",
"0.6378177",
"0.6375228",
"0.6360225",
"0.6314511",
"0.6300731"... | 0.70862657 | 1 |
generic function to convert milliseconds into a string in "years days hours minutes seconds" format in this game used for seconds | function formatMillisecondsToStr (milliseconds) {
var temp = Math.floor(milliseconds / 1000);
var years = Math.floor(temp / 31536000);
var fomattedTime = "";
if (years) {
fomattedTime += years + ' year' + checkEndingNumber(years) + ' ';
}
var days = Math.floor((temp %= 31536000) / 86400)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ms_seconds(x){ return x / 1000;}",
"getTimeString(milliseconds) {\n let seconds = Math.ceil(milliseconds / 1000);\n let minutes = Math.floor(seconds / 60);\n seconds -= minutes * 60;\n let hours = Math.floor(minutes / 60);\n minutes -= hours * 60;\n \n le... | [
"0.7223536",
"0.71075994",
"0.6995057",
"0.6947999",
"0.6938646",
"0.6925377",
"0.6895865",
"0.685288",
"0.68289614",
"0.68265647",
"0.6810427",
"0.6807825",
"0.6783638",
"0.6782001",
"0.677569",
"0.6738993",
"0.67346483",
"0.67283756",
"0.6709994",
"0.6709024",
"0.66736215",... | 0.73317325 | 0 |
GET CHAT LOCKS function is dependant on facebook having Add Photos embeded at each chat box so that to recognise it is a chat | function setLockOnChat(){
$( "form" ).each(function(index) {
var html = $(this).parent("span").html();
if(html){
if (html.indexOf('Add Photos') >= 0 && $(this).parent("span").parent("div").parent("div").html().indexOf("crypter") == -1){
var textarea = $(this).closest( ".fbNubFlyoutFooter" ).find("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openChat(userID){\n if(page_type=='profile'){\n if($('#TenTimes-Modal .modal-title').text().search('Mutual')>-1){\n $('#TenTimes-Modal').modal('hide');\n }\n }\n showloading();\n channelChat.push(function() {\n channelizeUI.openChatBox(userID);\n });\n channelizeInit.ca... | [
"0.58359236",
"0.58301306",
"0.5684095",
"0.5661284",
"0.5650271",
"0.55920273",
"0.5527262",
"0.55242246",
"0.5520333",
"0.54800636",
"0.53806084",
"0.5316668",
"0.5301417",
"0.52618843",
"0.52604985",
"0.5247135",
"0.52340174",
"0.5232229",
"0.52311236",
"0.52311236",
"0.52... | 0.6606391 | 0 |
GET DECRYPT BUTTONS this function depends on; the class ._5yl5 being the parent(x2) class of every message and .fbNubFlyoutInner is a parent class of both the crypter button | function setDecryptButton(){
var html = $("body").html();
var pnters = getIndicesOf(tag, html);
var pntsToDecrypt = [];
for(var x = 0; x < pnters.length; x++){
if(x > 0){
var isstartspan = html.substring(pnters[x-1] -6, pnters[x-1]);
}
pntersn = pnters[x] +tag.length;
var isendspan = html.substring(pnter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onMessageSecurityPopupHidden() {\n // Clear the variables for signature and encryption.\n gSigKeyId = null;\n gEncKeyId = null;\n\n // Hide the UI elements.\n document.getElementById(\"signatureHeader\").collapsed = true;\n document.getElementById(\"encryptionHeader\").collapsed = true;\n document.... | [
"0.5609015",
"0.54924583",
"0.5414198",
"0.53730613",
"0.53577864",
"0.53456104",
"0.5314917",
"0.52885073",
"0.52843946",
"0.5260756",
"0.52607167",
"0.52290934",
"0.52012855",
"0.5199426",
"0.51809585",
"0.51809454",
"0.5171301",
"0.5159756",
"0.5114364",
"0.5106976",
"0.50... | 0.63057566 | 0 |
creates a new suite object to be added to the results | buildSuite (isRoot, data) {
let suite = {
'title': '',
'suites': [],
'tests': [],
'pending': [],
'root': isRoot,
'fullFile': '',
'file': '',
'passes': [],
'failures': [],
'skipped': [],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeSuite(suiteClass) {\n return processSuiteClass(suiteClass);\n}",
"function Suite(suiteName, suite) {\n this.name = suiteName.replace(/gclitest\\//, '');\n this.suite = suite;\n\n this.tests = {};\n Object.keys(suite).forEach(function(testName) {\n if (testName !== 'setup' && testName !== '... | [
"0.71317625",
"0.65184844",
"0.65174764",
"0.59204113",
"0.58939165",
"0.5862179",
"0.5841131",
"0.5753801",
"0.5740199",
"0.5718536",
"0.569544",
"0.56883913",
"0.5652046",
"0.5613949",
"0.5532156",
"0.54961854",
"0.54954714",
"0.54081196",
"0.54020584",
"0.53997874",
"0.537... | 0.66981393 | 1 |
binding the framebuffer to draw | function bind() {
gl.bindFramebuffer(gl.FRAMEBUFFER, session.renderState.baseLayer.framebuffer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bind(){\n gl.bindFramebuffer(FRAMEBUFFER,framebuffer);\n }",
"bind () {\n this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._framebuffer)\n return this\n }",
"bindFramebuffer(renderTarget) {\n\t\t// Try to fetch framebuffer\n\t\tvar framebuffer = this._cached_fbos.get(rende... | [
"0.796934",
"0.7244258",
"0.7161722",
"0.67954165",
"0.6791971",
"0.67908716",
"0.67600375",
"0.6750258",
"0.6747103",
"0.6747103",
"0.6747103",
"0.6747103",
"0.6747103",
"0.6747103",
"0.6747103",
"0.67404836",
"0.66740215",
"0.6576488",
"0.6565902",
"0.64241666",
"0.6415381"... | 0.7717711 | 1 |
set the camera from XRFrame.pose | function setCamera(GL, mCamera, mBind = true) {
if (!session || !frame) {
return;
}
const pose = frame.getViewerPose(xrRefSpace);
if (pose) {
if(!binding) {
binding = new XRWebGLBinding(session, gl);
}
const view = pose.views[0]; // ar has only 1 view
const { x, y, width, height } = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"changeCamera() {\n this.scene.camera = this.cameras[this.currentView];\n }",
"set worldCamera(value) {}",
"setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n ... | [
"0.70045567",
"0.6926789",
"0.69241166",
"0.67329055",
"0.6731911",
"0.6725786",
"0.66853905",
"0.6616004",
"0.66108936",
"0.658683",
"0.651366",
"0.64864373",
"0.64507484",
"0.64459217",
"0.64286804",
"0.6418061",
"0.64117527",
"0.63873243",
"0.63311064",
"0.63239",
"0.63212... | 0.69758594 | 1 |
renderizzo il componente con una "table" di exercises richiamando il metodo "exerciseList" del componente che popola la table con gli elementi dello state | render() {
return (
<div>
<h3>Logged Exercises</h3>
<table className="table">
<thead className="thead-light">
<tr>
<th>Username</th>
<th>Description</th>
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"exerciseList() {\n // per ogni elemento dell'array ritorno un componente \"Exercise\"\n // con l'elemento corrispondente, il metodo per la sua cancellazione\n // e l'id come chiave dell'elemento nella lista\n return this.state.exercises.map(currentexercise => {\n return (\n ... | [
"0.7443063",
"0.6870059",
"0.6788729",
"0.6722673",
"0.6574966",
"0.6552333",
"0.65333575",
"0.643875",
"0.64063096",
"0.63989973",
"0.63793004",
"0.62722987",
"0.6263926",
"0.62362736",
"0.6232983",
"0.62289506",
"0.61834556",
"0.61473316",
"0.61329275",
"0.612546",
"0.61233... | 0.78098255 | 0 |
display time properties from the daySchedule object to the corresponding elements | function displayTimes() {
// iterate through the daySchedule object then display the corresponding value in the time container on the page
for (var t = 0; t < daySchedule.length; t++) {
// set the format for the currentTime
$('#time-' + t).text(moment(daySchedule[t].time, "HH").format("h A"));... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"displaySchedule(schedule) {\n // helper-function: add leading Zero to Numbers < 10\n function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }\n\n let today = new Date();\n let target = document.querySelector(\"#wrapper\");\n let dayNames = [\"Sun\", \"Mon\"... | [
"0.6930126",
"0.6619785",
"0.65634316",
"0.64973927",
"0.64738774",
"0.64639986",
"0.6456017",
"0.6428822",
"0.641086",
"0.6409306",
"0.6403009",
"0.63883996",
"0.63763565",
"0.6358337",
"0.6233593",
"0.6217903",
"0.61781096",
"0.61467344",
"0.61417496",
"0.613167",
"0.613045... | 0.7757449 | 0 |
for setting the color of each activity based on current time | function changeColor() {
// iterate through the daySchedule object
for (var c = 0; c < daySchedule.length; c++) {
currentTime = moment().format('HH');
var d = daySchedule[c].time;
// divide the object's time value by 100 to get two digits (representing hours)
d = daySchedule... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateColors() {\n var today = new Date();\n var timeNow = today.getHours();\n //${i} for assigning to the style.css and added classes\n for (var i = 9; i < 18; i++) {\n //current time\n if ($(`#${i}`).data(\"time\") == timeNow) {\n $(`#text${i}`).addClass(\"present\");\n ... | [
"0.7634946",
"0.74435693",
"0.72347355",
"0.7170634",
"0.7148914",
"0.70776415",
"0.6970294",
"0.6929381",
"0.69128674",
"0.6872476",
"0.6869426",
"0.6859149",
"0.6818585",
"0.66610867",
"0.6644319",
"0.66322005",
"0.6617859",
"0.6617181",
"0.65979856",
"0.6569251",
"0.656855... | 0.7476478 | 1 |
check if the activity entered has already been written to local storage | function checkActivity(btnID) {
var currentActivity = $('#activity-' + btnID).val();
//console.log (currentActivity)
if (localStorage.getItem("daySchedule") !== null) {
var scheduleCheck = JSON.parse(localStorage.getItem("daySchedule"));
scheduleCheck[btnID].activity = currentActivity;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasSavedData(){\n return localStorage.hasOwnProperty(getKey());\n}",
"function checkStorageItem() {\n return localStorage.getItem(localBook) !== null;\n}",
"function saveToStorage(){\n\tvar length = keyLog[fullTimeStamp].length;\n\tif(length != 0 && saving != true && enabled == true){\n\t\tsavin... | [
"0.6378222",
"0.6318161",
"0.61980975",
"0.6148711",
"0.60278285",
"0.6000248",
"0.599689",
"0.59810704",
"0.59385055",
"0.59245867",
"0.59232885",
"0.5895843",
"0.5881293",
"0.58766145",
"0.5855156",
"0.58480984",
"0.58453137",
"0.58428925",
"0.5803073",
"0.5773894",
"0.5768... | 0.63670576 | 1 |
save the daySchedule to local storage | function saveSchedule(scheduleJSON) {
localStorage.setItem("daySchedule", JSON.stringify(scheduleJSON));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"saveTodaysSchedule() {\n localStorage.setItem(\"SavedSchedule\", JSON.stringify(this.schedule));\n }",
"function saveSchedule() {\n fs.writeFile(__dirname + '/schedule.json', JSON.stringify(schedule), function (err) {\n if (err) throw err;\n console.log('Saved!');\n });\n}",
"function saveDate() {\... | [
"0.85090536",
"0.8025833",
"0.7788933",
"0.77042735",
"0.7700678",
"0.7697454",
"0.7580122",
"0.7415263",
"0.72901773",
"0.7236852",
"0.7214319",
"0.7105223",
"0.70989436",
"0.7086137",
"0.70697004",
"0.7057975",
"0.70425135",
"0.69309604",
"0.6893991",
"0.6880082",
"0.684176... | 0.8178603 | 1 |
Helper function to set program box bottom border color to black | function restoreBorder() {
if(window.programDiv) {
window.programDiv.css("borderBottomColor", window.programDiv.css("borderRightColor"));
window.programDiv = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function BottomBorder(BottomBorderX,BottomBorderY){\n fill(0,0,255);\n rect(BottomBorderX,BottomBorderY,1300,1000);\n}",
"_drawBorder() {\n const { x, y, width, height } = this.config;\n const bw = this.config.border.width;\n this._border = this.scene.add.rectangle( x - bw, y - bw,\n width + bw *... | [
"0.6710436",
"0.66663903",
"0.65117943",
"0.64982593",
"0.6481126",
"0.6384281",
"0.6362506",
"0.6357896",
"0.63539904",
"0.62612873",
"0.6181909",
"0.61528486",
"0.6110388",
"0.6090754",
"0.6069893",
"0.60480964",
"0.6042646",
"0.6032935",
"0.6032935",
"0.59965354",
"0.59860... | 0.7390634 | 0 |
Closes previous and opens new details box for the program | function ondetails(link, chid, progid) {
var detailsDiv = jQuery(".program-details-ajax"); // find already existing details box
if(jQuery("#program-details-ajax-" + progid).length) {
// user clicks already opened detailed box, simply close it
closeDetailsBox(detailsDiv, function() {});
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeDetails() {\n\n\tif (!Alloy.Globals.detailsWindow) {\n\t\treturn;\n\t}\n\n\t$.tab.closeWindow(Alloy.Globals.detailsWindow);\n\n\tAlloy.Globals.detailsWindow = null;\n}",
"function openDetails() {\n if (detailsRBElement.checked == true) {\n localStorage.setItem(\"patientId\", getPatientId(... | [
"0.70158476",
"0.6426695",
"0.6324949",
"0.6218159",
"0.62158614",
"0.611689",
"0.6109213",
"0.61079985",
"0.608059",
"0.6076226",
"0.6073249",
"0.605331",
"0.60505825",
"0.60451555",
"0.6034995",
"0.59946585",
"0.5958594",
"0.59427917",
"0.59359276",
"0.5932886",
"0.59312594... | 0.6502137 | 1 |
05 Functions & Closure (functions.js) / Guest List Functions The `guestListFns` function accepts two arguments: Guest List Array: This is the original guest list your superior gave you Secret Code: The secret code can be any JavaScript value The `guestListFns` returns an array of functions. Each function in the array r... | function guestListFns(gstListArr, code){
var allGsts = [];
for(var i = 0; i < gstListArr.length; i++){
allGsts.push(function(j){
return function(secretCode){
if(secretCode === code){
return gstListArr[j];
} else {
return 'Secret-Code: Invalid';
}
}
}(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createGreetings(){\n var greetings = [\n function(){console.log(\"Hello!\");},\n function(){console.log(\"Hola!\")},\n function(){console.log(\"Guten Tag!\")},\n function(){console.log(\"Bon Jour!\")}\n ];\n \n return greetings;\n}",
"function makeTorpedAssigner (... | [
"0.5522466",
"0.5374254",
"0.5278829",
"0.5257757",
"0.5250933",
"0.52028656",
"0.5187683",
"0.5177942",
"0.50890976",
"0.50679827",
"0.50584406",
"0.5042085",
"0.4998489",
"0.4988005",
"0.49823704",
"0.49685028",
"0.49559933",
"0.493401",
"0.49189046",
"0.4910997",
"0.490838... | 0.75186265 | 0 |
Updates all the child categories while upadating the category | async function updateCategories(req) {
let tree;
req.query = {};
req.entity = "category"
req.query.filter = { "criteria": [{ "key": "tree", "value": req.oldTree, "type": "regexOr" }] }
let query = serviceUtil.generateListQuery(req);
let categories = await Category.list(query);
for (let val of categories) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function actionUpdateCategory()\n{\n\tvar name = $('.input-child-category').find('.txt_name').val();\n\tvar description = $('.input-child-category').find('.txt_description').val();\n\tvar category_id = $('#txt_category_id').val();\n\tvar parent_id = $('#cbo_parent').val();\n\t\n\t// console.log(name);\n\t// consol... | [
"0.6911807",
"0.6426701",
"0.6275288",
"0.6048214",
"0.5988543",
"0.5928561",
"0.5903505",
"0.5884027",
"0.5862444",
"0.585206",
"0.580222",
"0.5785168",
"0.57737774",
"0.5762167",
"0.55802685",
"0.55749345",
"0.5567324",
"0.5561134",
"0.55333227",
"0.5502506",
"0.5495961",
... | 0.66537243 | 1 |
Map both the keys and the values of obj using the provided function f | function mapObj(obj, f) {
return Object.keys(obj).reduce(function (mapped, key) {
mapped[f(key)] = f(obj[key]);
return mapped;
}, {});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mapValues(fn, obj) {\n return (0, _keys.default)(obj).reduce(function (acc, key) {\n acc[key] = fn(obj[key]);\n return acc;\n }, {});\n}",
"function mapValues(obj, fn) {\n obj = _.extend({}, obj);\n for (var k in obj) {\n if (obj.hasOwnProperty(k)) obj[k] = fn(k, obj[k]);\n }\n ... | [
"0.82402927",
"0.80568975",
"0.7984064",
"0.7983854",
"0.79628754",
"0.794192",
"0.794192",
"0.794192",
"0.761242",
"0.7600006",
"0.7409779",
"0.7187359",
"0.69158435",
"0.68651795",
"0.6745356",
"0.67328936",
"0.66797537",
"0.65720695",
"0.65097475",
"0.64685535",
"0.6436636... | 0.842082 | 0 |
Convert python format string so that it is understood by polyglot. For details of the python syntax, see e.g. | function pyInterpolationToPolyglot(str) {
// An old format string consists of a %, followed by a name in parenthesis,
// field width, precision, length modifier (ignored by python) and a conversion type.
// Only the % and the conversion type are mandatory; we only care about the name.
var oldFormat = /%(?:\(([^... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"format (formatString = '%s%y%j%p%n') {\n let str = formatString\n\n str = str.replace(/%s/g, this.sign)\n str = str.replace(/%c/g, this.currency)\n str = str.replace(/%y/g, this.symbol)\n\n str = str.replace(/%\\+/g, this.signIfPositive)\n str = str.replace(/%-/g, this.signIfNegative)\n\n str ... | [
"0.6398953",
"0.6271232",
"0.6218726",
"0.6218726",
"0.6105232",
"0.60034704",
"0.59797496",
"0.5963981",
"0.5963981",
"0.5963981",
"0.5963981",
"0.5933067",
"0.5916462",
"0.5906282",
"0.582464",
"0.58217543",
"0.5744564",
"0.5744564",
"0.5744564",
"0.5744564",
"0.57431906",
... | 0.69217914 | 0 |
Transform translation data from django JSONCatalog format to polyglot format | function djangoToPolyglot(data) {
if (!data.catalog) {
return data;
}
// Django has different plural forms as an object with keys 0, 1 etc; we need
// them separated by four pipes
var transformedPlurals = mapObj(data.catalog, function (val) {
return (typeof val === 'undefined' ? 'undefined' : _typeof... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTranslationString_JSON(obj) {\n\tfor (key in obj) {\n\t obj[key].description = addSlashes(obj[key].description);\n\t obj[key].value = addSlashes(obj[key].value);\n }\n return FormatJSON(obj);\n}",
"transformData(data) {\n return data.map((element) => {\n const newElement =... | [
"0.5729858",
"0.56402814",
"0.5612992",
"0.56040734",
"0.5586983",
"0.55348915",
"0.5435655",
"0.53758025",
"0.5324887",
"0.53100824",
"0.52703774",
"0.5253084",
"0.52518666",
"0.5226228",
"0.5199142",
"0.5193826",
"0.5188892",
"0.5175228",
"0.51506186",
"0.51322305",
"0.5119... | 0.7286287 | 0 |
Opportunity related Related Functions Before Load Option to place dynamic field to capture the Event ID | function oppEventBeforeLoad(type, form, request)
{
if (type == 'create' && nlapiGetContext().getExecutionContext()=='userinterface')
{
var eventIdFld = form.addField('custpage_eventid','text','Event ID');
eventIdFld.setDisplayType('hidden');
if (request.getParameter('eventid'))
{
eventIdFld.setDefaul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Before_Load(type,form)\n{\n //nlapiLogExecution(\"debug\",\"event type is :\",type);\n if(type == \"view\" || type == \"edit\")\n {\n\t var url = nlapiLookupField(\"customrecord_custom_diamond\",nlapiGetRecordId(),\"custrecord_hidden_portal_url\");\n\t //nlapiLogExecution(\"debug\",\"Porta... | [
"0.63677317",
"0.63028467",
"0.5944487",
"0.5744691",
"0.5690974",
"0.56859875",
"0.5682086",
"0.5619965",
"0.55863297",
"0.5581106",
"0.5578001",
"0.55504525",
"0.5537874",
"0.5534482",
"0.55176926",
"0.54483855",
"0.54466695",
"0.54465604",
"0.54328907",
"0.5430663",
"0.540... | 0.7181739 | 0 |
=== 0 true 1 1 123 true 124 124 100000 true 100001 100001 4294967294 true 4294967295 4294967295 4294967168 true 4294967169 4294967169 4294967169 true 4294967170 4294967170 4294967170 true 4294967171 4294967171 4294967171 true 4294967172 4294967172 4294967172 true 4294967173 4294967173 4294967173 true 4294967174 4294967... | function test() {
var i;
function f(str) {
var arridx = false;
var arr1, arr2;
arr1 = []; arr1[str] = 1;
if (arr1.length !== 0) { arridx = true; }
arr2 = [ 1 ]; arr2[str] = 1;
if (arr2.length !== 1) { arridx = true; }
if (arridx) {
print(str... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function h(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}",
"function test0() {\n var IntArr1 = [-107237352, -1613253955, -9159329201106759000, -295102479, -1, 795305804, 1058299229, 65537, 1, 546814013, -2147483648];\n protoObj1 = Object();\n IntArr1[14] = 1;\n IntArr1[12] = 1;\n var __loopvar0 = 0;... | [
"0.6090381",
"0.59488195",
"0.58763707",
"0.5781853",
"0.57161915",
"0.5713532",
"0.5685816",
"0.56827056",
"0.5676543",
"0.5643982",
"0.5643982",
"0.5643982",
"0.5643982",
"0.55902165",
"0.5580717",
"0.5563829",
"0.5538094",
"0.5500481",
"0.546933",
"0.5467246",
"0.54501736"... | 0.59776425 | 1 |
tells us if we have matched the end | matchEnd() {
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"canMatchMore() {\n return !this.matchEnd();\n }",
"function matchEnd() {\n\t\tvar pattern = /^\\$/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"eatWhile(match) {\n let start = this.pos;\n while (this.e... | [
"0.77409804",
"0.7316657",
"0.6870027",
"0.6460663",
"0.64508057",
"0.6384769",
"0.63775814",
"0.6365683",
"0.6278249",
"0.6239945",
"0.6238881",
"0.6238881",
"0.62212956",
"0.61958003",
"0.61950886",
"0.61718076",
"0.6161558",
"0.61504316",
"0.6120408",
"0.6105333",
"0.60893... | 0.79824454 | 0 |
tells us if we can continue matching | canMatchMore() {
return !this.matchEnd();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"matchEnd() {\n return false;\n }",
"function skipMatch(candidate) {\n return invalidPattern || !candidate;\n }",
"eatWhile(match) {\n let start = this.pos;\n while (this.eat(match)) { }\n return this.pos > start;\n }",
"match(tokenKind) {\n if (this.check(... | [
"0.701463",
"0.64767194",
"0.6257058",
"0.6024656",
"0.6009251",
"0.5873003",
"0.5862502",
"0.58210486",
"0.57893705",
"0.57278013",
"0.571297",
"0.5583556",
"0.55668336",
"0.5516677",
"0.5510207",
"0.5485718",
"0.54802245",
"0.5462836",
"0.54625773",
"0.54271317",
"0.5416217... | 0.72331095 | 0 |
The colour of the logo is route dependent, let's add a switch statement to select the correct colour | pickLogo () {
/**
* You have to call require in each call otherwise it breaks for some reason
*/
let url = require('../../images/logo_white.png');
switch(this.props.route.toString()){
case 'Default':
url = require('../../images/logo_bart.png');
break;
case 'Meeting':
url = require('../... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"changeBg(){\n let path = this.$route.path;\n switch (path) {\n case '/':\n this.currentBg = \"rgb(250,250,250)\";\n break;\n case '/about':\n this.currentBg =`rgb(${this.about[0]},${this.about[1]},${this.about[2]})`;\n break;\n c... | [
"0.6522631",
"0.63559735",
"0.63001156",
"0.6240436",
"0.6157442",
"0.6103078",
"0.6041447",
"0.6041008",
"0.5967534",
"0.596149",
"0.5950847",
"0.5938622",
"0.5917509",
"0.58878416",
"0.58833855",
"0.5881012",
"0.58795774",
"0.587738",
"0.5875699",
"0.5815518",
"0.57895535",... | 0.65234727 | 0 |
for tmp1 and tmp2, if result value is 0, it is safe as it failed the "addr > ta_absolute_addr && addr < ta_absolute_addr + string_size" condition in ta_read(), it will fail the same condition again in ta_write() so won't write value 0 to the memory modify pointer to first element index (aarw_ui32.ui32[0]) with an addre... | function read4(addr) {
// save the old values
let tmp1 = ta_read(aarw_ui32.elements_addr + 12);
let tmp2 = ta_read(aarw_ui32.bs_addr + 16);
// rewrite the backing store ptr
ta_write(aarw_ui32.elements_addr + 12, addr);
ta_write(aarw_ui32.bs_addr + 16, addr);
let val = aarw_ui32.ui32[0];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readStr(a_read, addr) {\n var str = \"\";\n var read_addr = Int64.copy(addr);\n while (true) {\n var bytes = a_read(read_addr);\n for (i = 0;i<bytes.length;i++) {\n if (bytes[i] == 0) {\n return str;\n }\n str += String.fromCharCode(bytes[i]);\n }\n read_addr.addOp(4);... | [
"0.5514908",
"0.50901246",
"0.5079712",
"0.4875964",
"0.4828484",
"0.46873993",
"0.46431243",
"0.46075606",
"0.45773917",
"0.455167",
"0.455167",
"0.455167",
"0.455167",
"0.45368838",
"0.45368737",
"0.45238605",
"0.45158535",
"0.44984075",
"0.4495987",
"0.4467116",
"0.4465357... | 0.56901085 | 0 |
add a course to a user's favoriteCourses array | addCourseToFavorite(userId, courseNumber) {
return users().then((userCollection) => {
return userCollection.updateOne({ _id: userId }, {
$addToSet: {
favoriteCourses: courseNumber
}
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCourse(course) {\n myCourses = JSON.parse(localStorage.getItem(\"myCourses\")) || [];\n myCourses.push(course);\n localStorage.removeItem(\"myCourses\");\n // console.log(myCourses);\n addToLocalStorage(myCourses);\n }",
"addCourse(course) {\r\n this.courses.push(course);\r\n ... | [
"0.6607571",
"0.64040005",
"0.6282068",
"0.6231512",
"0.6196266",
"0.6128233",
"0.60782135",
"0.6063119",
"0.60566413",
"0.5932757",
"0.58486694",
"0.5834501",
"0.5820388",
"0.58118486",
"0.5806978",
"0.5779144",
"0.5749553",
"0.57456464",
"0.56800014",
"0.56672066",
"0.56550... | 0.68021053 | 0 |
remove a course from a user's favoriteCourses array | removeCourseFromFavorite(userId, courseNumber) {
return users().then((userCollection) => {
return userCollection.updateOne({ _id: userId }, {
$pull: {
favoriteCourses: courseNumber
}
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function removeUser(userID, courseID){\n const person = await User.findOne({\"_id\": userID});\n let courseList = person.courses;\n const fullName = person.firstName + \" \" + person.lastName;\n let index = -5;\n for (const element of courseList){\n if (element.toString().localeCompare(... | [
"0.6597636",
"0.65632904",
"0.6504922",
"0.64634794",
"0.64501673",
"0.64227366",
"0.6411155",
"0.6390016",
"0.6337808",
"0.62960637",
"0.6282618",
"0.6248859",
"0.6222324",
"0.6209903",
"0.61944383",
"0.6151013",
"0.6146441",
"0.6072707",
"0.6067813",
"0.6054407",
"0.6002863... | 0.7064332 | 0 |
Add 'history button to all users | function addUserHistoryLink(){
var userhistory = '<a href="javascript:;" class="user-history-button" title="view user history" target="_blank">H</a>'
if( this.firstChild ) return $(this).find('a:last').append(','+userhistory);
$(this).append('['+userhistory+']');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function push_history() {\n\tedit_history_index++;\n\tsave_history();\n\tedit_history.length = edit_history_index+1;\n}",
"@action\n showHistoryAction() {\n this.showHistory = true;\n }",
"function renderHistoryList() {}",
"function displaySearchHistory() {\n const key = 'Search History';\n var se... | [
"0.6550179",
"0.6530674",
"0.65195346",
"0.6508765",
"0.64592963",
"0.629128",
"0.62827104",
"0.62534297",
"0.61841476",
"0.617962",
"0.61561567",
"0.61260283",
"0.612291",
"0.6122131",
"0.60793835",
"0.6074577",
"0.6063829",
"0.6036348",
"0.59952104",
"0.5987572",
"0.5985449... | 0.7889487 | 0 |
Transform a list of profile into a map of API | function getApiMap(client, profiles) {
return Object.keys(profiles).reduce((acc, name) => {
const profile = profiles[name];
return Object.assign(Object.assign({}, acc), { [name]: createApi(client, profile) });
}, {});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildProfileList(uuid, profiles = {}) {\n const key = `skyblock_profiles:${uuid}`;\n redis.get(key, (err, res) => {\n if (err) {\n return logger.error(`Failed getting profile list hash from redis: ${err}`);\n }\n const p = JSON.parse(res) || {};\n // TODO - Mark old profiles\n const ... | [
"0.58225316",
"0.55742526",
"0.55660045",
"0.5525799",
"0.54847586",
"0.547537",
"0.54286504",
"0.5306766",
"0.52811146",
"0.52607846",
"0.5194253",
"0.51831746",
"0.51683694",
"0.51598066",
"0.51311094",
"0.5116322",
"0.5074728",
"0.5071464",
"0.5052881",
"0.5039164",
"0.501... | 0.70200264 | 0 |
paramify is useful if wording of the message is important returns the message in an array of words without the mention at the beginning | function paramify(message) {
var commandString = message.text.replace(bot.mention, "").replace(/\:/g, "").toLowerCase();
var command = commandString.split(" ");
if (command[0] === "") {command.shift();}
return command;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moderateSwearwords(message) {\n return badWordsFilter.clean(message);\n}",
"function moderateSwearwords(message) {\n return badWordsFilter.clean(message);\n}",
"function fw(phrase) {\n let wordsList = phrase.split(' ');\n\n return wordsList;\n}",
"function partiallyHide(phrase) {\n let ar... | [
"0.6235616",
"0.6235616",
"0.6154617",
"0.6146968",
"0.6145208",
"0.60893494",
"0.60447484",
"0.59540707",
"0.5931108",
"0.5904661",
"0.5797134",
"0.57763535",
"0.57397294",
"0.5719011",
"0.565586",
"0.56254226",
"0.5604686",
"0.55736154",
"0.5559802",
"0.552705",
"0.5526377"... | 0.6690411 | 0 |
Storage for chord data | function ChordData(options) {
this.chordPatterns = [{
'type': 'clamp',
'fret': 'isNumber:isInteger',
'string': 'isNumber:isInteger:inStringRange'
}, {
'type': 'barre',
'fret': 'isNumber:isInteger',
'barre': {
'from':... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"chordInfo(mR, tR){\n var t = this.theoryDecoding(tR);\n var m = this.midiNotes(mR);\n var l = this.actualNotes(mR);\n\n var chord = {theory: t, letter: l, numeral: m};\n\n console.table(chord);\n }",
"function putChord() {\n\tvar tuning = document.getElementById('chordtuning').value.split(\",\").... | [
"0.6205563",
"0.5857674",
"0.5852804",
"0.563392",
"0.5477717",
"0.54719794",
"0.5467775",
"0.5455645",
"0.54312116",
"0.53811854",
"0.5297774",
"0.5297774",
"0.5297774",
"0.52509874",
"0.52143025",
"0.5186821",
"0.5177129",
"0.5158698",
"0.5158698",
"0.5158698",
"0.5136651",... | 0.5889694 | 1 |
get SID from Fritz!Box | function fritzBoxSid(settingsFB) {
console.log('Fritz!Box: authenticate');
return es6_promise_1.Promise.resolve()
.then(function (res) {
var opt = {
uri: 'http://' + settingsFB.url + '/login_sid.lua'
};
return rp(opt);
})
.then(function (res) {
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetSidString(sid) {\n var r = 'S-' + sid[0] + '-' + sid[7];\n for (var i = 2; i < (sid.length / 4); i++) r += '-' + ReadIntX(sid, i * 4);\n return r;\n }",
"function getSid(sid)\r\n {\r\n return m_asid[sid - 1];\r\n }",
"function api_getsid(ctx, user, passwordkey, hash) {\... | [
"0.7012541",
"0.6692651",
"0.63668156",
"0.60457456",
"0.5989276",
"0.5969615",
"0.58625317",
"0.57754314",
"0.5754585",
"0.5686369",
"0.5640427",
"0.55544454",
"0.55111694",
"0.55111694",
"0.55111694",
"0.5502928",
"0.5449496",
"0.54481053",
"0.5430022",
"0.5390978",
"0.5369... | 0.67410666 | 1 |
Get the current difficulty. | function getDifficulty() {
return LEVEL_TO_DIFFICULTY[level];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCurrentDifficulty() {\r\n var _a;\r\n const selectedDifficultyBtn = this.getElement(\".difficulty__btn--click\");\r\n if (selectedDifficultyBtn &&\r\n selectedDifficultyBtn.dataset &&\r\n selectedDifficultyBtn.dataset.difficulty) {\r\n const selectedDifficul... | [
"0.7880444",
"0.7536101",
"0.73611885",
"0.645885",
"0.6081394",
"0.6040104",
"0.60039735",
"0.59601045",
"0.58061534",
"0.5748524",
"0.56765527",
"0.5659129",
"0.56262594",
"0.5600334",
"0.55881035",
"0.55680496",
"0.55655026",
"0.55177164",
"0.5509505",
"0.55081797",
"0.549... | 0.7820384 | 1 |
Show the current difficulty. | function displayDifficulty(difficulty) {
$("#difficulty").html("Difficulty: " + difficulty +
" <b class=\"caret\"></b>");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDiff() {\n document.getElementById(\"diffLvl\").innerHTML = difficulty;\n}",
"function cycleDifficulty() {\n difficulty = difficultyLevels[difficultyIndex];\n if (difficultyIndex === 2) {\n difficultyIndex = 0;\n } else {\n difficultyIndex++;\n }\n $('#difficulty').text... | [
"0.6337104",
"0.6250085",
"0.62430227",
"0.61102915",
"0.58498967",
"0.5845666",
"0.5841185",
"0.5816877",
"0.58140045",
"0.5807104",
"0.5755771",
"0.57386595",
"0.5736474",
"0.5718637",
"0.5714812",
"0.57147294",
"0.570829",
"0.56862825",
"0.56803876",
"0.56695247",
"0.56593... | 0.74470484 | 0 |
Loads a new expression with the difficulty specified by the hash and resets level variables. | function setDifficulty() {
var hash = window.location.hash;
if (hash.length > 1) {
hash = hash.substr(1);
newLevel = LEVEL_TO_DIFFICULTY.indexOf(hash);
if (newLevel != -1) {
level = newLevel;
rightStreakLength = 0;
wrong... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadNewExpression() {\n var difficulty = getDifficulty();\n // Display the current difficulty.\n displayDifficulty(difficulty);\n // http://stackoverflow.com/questions/10134237/javascript-random-integer-between-two-numbers\n var choice = Math.floor(Math.random() * 3);\n ... | [
"0.574851",
"0.5147478",
"0.50533247",
"0.5048357",
"0.50423396",
"0.49834743",
"0.4930088",
"0.4805231",
"0.47536272",
"0.47203162",
"0.4704156",
"0.46843717",
"0.46606025",
"0.46518815",
"0.46502635",
"0.46010888",
"0.45827407",
"0.45786178",
"0.45709696",
"0.4564921",
"0.4... | 0.63856035 | 0 |
Show the full parse tree for the current expression. | function showParseTree() {
// Hide the answers until the user generates a new expression.
$(".new-expression").show();
$(".answers").hide();
var expression = $("#"+TreeConstants.ROOT_TAG).text();
// Show help if active.
TreeConstructor.promptActive = false;
var fn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printParseTree(){\n\tvar parseReturnText = \"\\nParse Tree: \\n\" + printTree(tree,0);\n\tputMessage(parseReturnText);\n}",
"function printAst(value) {\n var str = printAstRecursively(value, \"\", \"\");\n console.log(str);\n}",
"function print_form(ast) {\n if (ast instanceof Array) { \n ret... | [
"0.6127062",
"0.5700708",
"0.5520169",
"0.551417",
"0.55006844",
"0.54726684",
"0.5409723",
"0.5404632",
"0.533642",
"0.529916",
"0.52695847",
"0.52513176",
"0.52232623",
"0.5190298",
"0.51583534",
"0.5065568",
"0.50534755",
"0.5028071",
"0.502135",
"0.5011416",
"0.5001723",
... | 0.7061419 | 0 |
when the player dies we put hus result to local storage, reset game and create the table with highscores | finish() {
document.querySelector(".game-page").style.display = "none";
document.querySelector(".scores-page").style.display = "block";
localStorage.setItem(
"game" + Date.now(),
this.player.name + "," + this.player.score
);
this.reset();
mylib.createHighscoresTable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearHighScore() {\n playerScores = [];\n playerInitals = [];\n lsPlayerScores = \"\";\n lsPlayerInitals = \"\";\n localStorage.setItem(\"playerInital\", \"\");\n localStorage.setItem(\"playerScore\", \"\");\n viewHS();\n }",
"_wonGame () {\n this.s... | [
"0.7007253",
"0.6889933",
"0.68793386",
"0.6872354",
"0.68317235",
"0.6787568",
"0.6759373",
"0.6695639",
"0.66767657",
"0.66596216",
"0.6643777",
"0.66384697",
"0.6630437",
"0.6628249",
"0.6609684",
"0.65798676",
"0.6570319",
"0.6556002",
"0.6554925",
"0.6539535",
"0.6535855... | 0.7063271 | 0 |
Given an async function, creates a Source object that can be used with `SourceBackedEntity` | function AsyncSource(kind, asyncFactory) {
return {
kind,
fetch() {
return fromPromise(this.doFetch());
},
async doFetch() {
const entities = await asyncFactory();
return entities.map(entity => {
const result = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSource(...args) {\n return new Source(...args)\n}",
"function _factory(aSourceMap, aSourceMapURL) {\n let sourceMap = aSourceMap\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap)\n }\n\n const consumer =\n sourceMap.sections != null\n ? new ... | [
"0.6297226",
"0.55325496",
"0.5470734",
"0.544089",
"0.5266723",
"0.5249048",
"0.5210926",
"0.5179598",
"0.51657134",
"0.5156396",
"0.51231474",
"0.50920904",
"0.50894827",
"0.5071169",
"0.50596267",
"0.50596267",
"0.5053511",
"0.5032393",
"0.5032393",
"0.5032393",
"0.5004431... | 0.6728955 | 0 |
11 / \ 1 2 4 \ / / \ 3 5 8 \ / \ \ 6 7 10 let ret = findNodesWithZeroAndOneParents(parentChildPairs); console.log(ret); mat 1 2 3 4 5 6 7 8 9 10 11 1 t 2 t 3 t t 4 5 t 6 t t 7 t 8 t 9 10 t 11 | function hasCommonAncestor(parentChildPairs, indOne, indTwo){
let mat = [];
let max = parentChildPairs[0][0];
// get max node
for (var pair of parentChildPairs){
if (pair[0] > max) max = pair[0];
if (pair[1] > max) max = pair[1];
}
// build matrix
for (var i = 0; i < max+1; i++){
let row = [];... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function commonChild(s1, s2) {\n \n var matrix = new Array(s1.length);\n \n for(var i = 0; i < s1.length; i++) {\n matrix[i] = new Array(s1.length);\n for(var j = 0; j < s1.length; j++) {\n var cmp = s1[i] === s2[j];\n var left = j === 0 ? 0 : matrix[i][j-1];\n ... | [
"0.6027568",
"0.59790033",
"0.58048713",
"0.5733928",
"0.56946653",
"0.56446046",
"0.56313",
"0.5619823",
"0.56106293",
"0.56106293",
"0.5559021",
"0.55470145",
"0.5512603",
"0.55027795",
"0.5498253",
"0.54782534",
"0.5469623",
"0.54681885",
"0.54681885",
"0.54681885",
"0.546... | 0.6264542 | 0 |
Appends a noflip comment to a style rule in order to prevent it from being automatically flipped in RTL contexts. This should be used only in situations where the style must remain unflipped regardless of direction context. See: | function noflip(value) {
if (typeof value === 'number') return "".concat(value, "px ").concat(NOFLIP);
if (typeof value === 'string') return "".concat(value, " ").concat(NOFLIP);
throw new TypeError('noflip expects a string or a number');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rtlifyRules(options, rulePairs, index) {\n if (options.rtl) {\n var name_1 = rulePairs[index];\n if (!name_1) {\n return;\n }\n var value = rulePairs[index + 1];\n if (typeof value === 'string' && value.indexOf(NO_FLIP) >= 0) {\n rulePairs[index ... | [
"0.51939934",
"0.51939934",
"0.50309414",
"0.50309414",
"0.50309414",
"0.49661556",
"0.4484958",
"0.44345975",
"0.44345975",
"0.44284663",
"0.43972668",
"0.4319569",
"0.43069437",
"0.42945042",
"0.42945042",
"0.4292347",
"0.429004",
"0.4288461",
"0.42800957",
"0.42800957",
"0... | 0.6067385 | 0 |
This function takes an array of styles and separates them into styles that are handled by Aphrodite and inline styles. | function separateStyles(stylesArray) {
var classNames = []; // Since determining if an Object is empty requires collecting all of its
// keys, and we want the best performance in this code because we are in the
// render path, we are going to do a little bookkeeping ourselves.
var hasInlineStyles = false;
va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function separateStyles(stylesArray) {\n var aphroditeStyles = [];\n\n // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n var hasInlineSt... | [
"0.7946915",
"0.7371387",
"0.7371387",
"0.65832365",
"0.648405",
"0.6445151",
"0.6439433",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424998",
"0.6424589",
"0.6252087",
"0.6232219",
"0.6223856",
"0.62137675",
... | 0.73849237 | 1 |
Derive the create function from the interface and direction | function makeCreateFn(direction, stylesInterface) {
var directionSelector = direction === _WithStylesContext.DIRECTIONS.RTL ? 'RTL' : 'LTR';
var create = stylesInterface["create".concat(directionSelector)] || stylesInterface.create;
if (true) {
create = (0, _perf["default"])('create')(create);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"create() {}",
"create() {}",
"create () {}",
"create () {}",
"create() {\n\t}",
"function create() {\n\n}",
"static create() {\nreturn this.from_xyzw(0, 0, 0, 1);\n}",
"function callCreate(object){ object.create(); }",
"create(){\n\n }",
"static create () {}",
"create() {\n\n }",
"create(... | [
"0.64049023",
"0.64049023",
"0.63389593",
"0.63389593",
"0.6243647",
"0.616857",
"0.5912787",
"0.5833179",
"0.57683784",
"0.5756949",
"0.5751484",
"0.5751484",
"0.5751484",
"0.56373906",
"0.56373906",
"0.56285495",
"0.55949384",
"0.55494875",
"0.550555",
"0.550555",
"0.548986... | 0.6945129 | 0 |
Derive the resolve function from the interface and direction | function makeResolveFn(direction, stylesInterface) {
var directionSelector = direction === _WithStylesContext.DIRECTIONS.RTL ? 'RTL' : 'LTR';
var resolve = stylesInterface["resolve".concat(directionSelector)] || stylesInterface.resolve;
if (true) {
resolve = (0, _perf["default"])('resolve')(resolve);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resolve(flags, iface, name, type, domain, callback) {\n return __awaiter(this, void 0, void 0, function* () {\n const nameBuf = Buffer.from(name + '\\0');\n const typeBuf = Buffer.from(type + '\\0');\n const domainBuf = Buffer.from(domain + '\\0');\n let length = ... | [
"0.61958",
"0.60905445",
"0.59716076",
"0.5920935",
"0.5885276",
"0.5857105",
"0.5843426",
"0.58086294",
"0.569442",
"0.56823975",
"0.5676368",
"0.5584725",
"0.5556014",
"0.5555916",
"0.5555916",
"0.54840815",
"0.545558",
"0.5423439",
"0.5413475",
"0.5413475",
"0.53817993",
... | 0.6403878 | 0 |
end function 'getInstance' class cast declaration: class creates cast component input(s): (none) output(s): (none) | function cast(){
//nothing
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(castSession, namespace, onMessage) {\n _defineProperty(this, \"castSession\", void 0);\n\n _defineProperty(this, \"messageListener\", void 0);\n\n _defineProperty(this, \"namespace\", void 0);\n\n this.castSession = castSession;\n this.namespace = namespace;\n\n if (onMessage) {\n ... | [
"0.5393729",
"0.5341538",
"0.52659005",
"0.5239621",
"0.52154315",
"0.51742536",
"0.5108025",
"0.5100311",
"0.5049985",
"0.49942195",
"0.49805892",
"0.4949583",
"0.49436185",
"0.49127427",
"0.48986256",
"0.48860642",
"0.48530552",
"0.48389763",
"0.48296535",
"0.48045194",
"0.... | 0.63918746 | 0 |
function is calling in ColorCard component and it removes color by id from colors state and concat it to selectedColors array in state | selectColorById(colorId){
if(this.state.selectedColors.length < 10){
let array = this.state.colors;
for(let i = 0; i < array.length; i++){
if(array[i].id == colorId){
let index = array.indexOf(array[i]);
let selected = array.splice(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeSelectedColorById(colorId){\n let array = this.state.selectedColors;\n for(let i = 0; i < array.length; i++){\n if(array[i].id == colorId){\n let index = array.indexOf(array[i]);\n let selected = array.splice(index, 1);\n this.setState(\n ... | [
"0.8643352",
"0.6975374",
"0.680012",
"0.66474867",
"0.6609447",
"0.6594508",
"0.65910405",
"0.6418813",
"0.63577694",
"0.6340512",
"0.62056714",
"0.6182061",
"0.6163191",
"0.61329067",
"0.6103079",
"0.6089032",
"0.60562253",
"0.60509145",
"0.6018254",
"0.59965044",
"0.599503... | 0.816136 | 1 |
function is calling in SelectedColor component and it removes selected color by id from selected colors array and concat it to colors array in state | removeSelectedColorById(colorId){
let array = this.state.selectedColors;
for(let i = 0; i < array.length; i++){
if(array[i].id == colorId){
let index = array.indexOf(array[i]);
let selected = array.splice(index, 1);
this.setState(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"selectColorById(colorId){\n if(this.state.selectedColors.length < 10){\n let array = this.state.colors;\n for(let i = 0; i < array.length; i++){\n if(array[i].id == colorId){\n let index = array.indexOf(array[i]);\n let selected = ar... | [
"0.82526577",
"0.6972237",
"0.6927903",
"0.6840714",
"0.6764835",
"0.67632794",
"0.6620878",
"0.6513679",
"0.6401671",
"0.63508695",
"0.6336969",
"0.62930363",
"0.6285228",
"0.62258863",
"0.6225204",
"0.62011623",
"0.61943525",
"0.6184794",
"0.6181218",
"0.61544764",
"0.61411... | 0.8822399 | 0 |
String builder for auth url... | function _buildAuthUrl() {
return 'https://bitbucket.org/site/oauth2/authorize?client_id='
+ bitbucketConfig.client_id
+ '&response_type=code'
+ '&scope=repository:write'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get_url() {\n this._authentication.state = crypto.randomBytes(6).toString('hex');\n // Replace 'api' from the api_url to get the top level trakt domain\n const base_url = this._settings.endpoint.replace(/api\\W/, '');\n return `${base_url}/oauth/authorize?response_type=code&client_id=${... | [
"0.6613223",
"0.6543533",
"0.64788413",
"0.6432293",
"0.633993",
"0.63042384",
"0.6265706",
"0.6239043",
"0.6057646",
"0.604806",
"0.603704",
"0.60282725",
"0.5997546",
"0.59799016",
"0.5953228",
"0.5921398",
"0.5837988",
"0.5824942",
"0.5743185",
"0.57337135",
"0.57321584",
... | 0.66719747 | 0 |
directDisplay is the one function depending on event manipulating the currentPos variable, and displaying the rigth indexed picture. | function directDisplay (event) {
for (var i = 0; i < photoButtons.length; i++) {
if (event.target === photoButtons[i]) {
currentPos = i
}
}
displaySpace.setAttribute('style', 'background-image:' + thePhotos[currentPos].link)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"display() {\n if (this.isDrank === false) {\n //Display\n image(this.image, this.x, this.y, this.size, this.size);\n }\n }",
"function showOtherPic(pos){\n\t\tconsole.log(pos);\n\t\tindex = pos;\n\t\tshowPic();\n\t}",
"display() {\n // draw our player at their current position with the corr... | [
"0.6456515",
"0.61993915",
"0.6052083",
"0.58271503",
"0.5814702",
"0.5679845",
"0.56746525",
"0.56343174",
"0.5586849",
"0.5553204",
"0.5533977",
"0.553335",
"0.546831",
"0.5461944",
"0.5459573",
"0.54574287",
"0.5444372",
"0.54406774",
"0.5418974",
"0.5411262",
"0.54078937"... | 0.67606515 | 0 |
find value in query string by key key of query string | function getValueFromQueryString(key){
//new array
var result = new Array("No Query String","No Query String");
//search get ?key1=value1&key2=value2&...
//substring get key1=value1&key2=value2&...
var queryStr = window.location.search.substring(1);
if (queryStr!=undefined){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getQueryStringValue(key)\n{ \n return unescape(window.location.search.replace(new RegExp(\"^(?:.*[&\\\\?]\" + escape(key).replace(/[\\.\\+\\*]/g, \"\\\\$&\") + \"(?:\\\\=([^&]*))?)?.*$\", \"i\"), \"$1\")); \n}",
"function getQueryVairable(markup,key){\n\tvar values=markup.split(\"&\");\n\tfor(var i=0... | [
"0.71724224",
"0.70011497",
"0.6988522",
"0.6988522",
"0.6988522",
"0.6988522",
"0.698421",
"0.6886512",
"0.6839169",
"0.6793537",
"0.6777892",
"0.6774005",
"0.67288375",
"0.67145956",
"0.6705159",
"0.6703986",
"0.67014533",
"0.66393685",
"0.657466",
"0.65223306",
"0.6479271"... | 0.734096 | 0 |
use for set value dom element to set value value to set | function setDomValue(dom,value){
if (!dom) return false;
dom.value = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setElementValue(el, value) {\n switch (el.get(0).tagName) {\n case \"SELECT\":\n el.selectmenu();\n el.val(value).selectmenu('refresh');\n break;\n case \"INPUT\":\n el.val(value);\n break;\n }\n}",
"function setDomValueById(domI... | [
"0.7516543",
"0.7494231",
"0.74912906",
"0.73372304",
"0.72964764",
"0.72732806",
"0.7252516",
"0.71809834",
"0.71659803",
"0.7155335",
"0.71506506",
"0.71178085",
"0.7113911",
"0.703857",
"0.70065904",
"0.6934621",
"0.69244945",
"0.6896808",
"0.68953365",
"0.68915135",
"0.68... | 0.7630115 | 0 |
use for set value id of dom element to set value value to set | function setDomValueById(domId,value){
setValueToDOM(ele(domId),value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setVal(id) {\n\t$('.hid-field').attr('value', id);\n}",
"function setElementValue ( id, value )\n {\n\tvar elt = myGetElement(id);\n\t\n\tif ( elt && elt.type && elt.type == \"checkbox\" )\n\t{\n\t if ( value && value != \"0\" )\n\t\telt.checked = true;\n\t else\n\t\telt.checked = false;\n\t}\n... | [
"0.75570345",
"0.7502244",
"0.73624885",
"0.71466637",
"0.7062299",
"0.705692",
"0.6947591",
"0.68754894",
"0.6784064",
"0.67348987",
"0.6657547",
"0.6648596",
"0.65570873",
"0.65512276",
"0.6514799",
"0.6505293",
"0.64607203",
"0.6459111",
"0.6429936",
"0.64171636",
"0.64143... | 0.7705441 | 0 |
if bmi 30 return "Obese" | function bmi(weight, height) {
const bmi = weight / (height**2);
if(bmi <= 18.5) return "Underweight";
if(bmi <= 25.0) return "Normal";
if(bmi <= 30.0) return "Overweight";
return "Obese";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getLabelFromBMI() {\n let label = ''\n\n if (this.bmi >= 25) {\n label = 'overweight'\n } else if (this.bmi >= 18.5 && this.bmi < 25) {\n label = 'normal'\n } else {\n label = 'underweight'\n }\n\n return label\n }",
"function bmiCalculator (weight, height) {\r\n var bmi = weight/(height * height)... | [
"0.78092754",
"0.762371",
"0.7592119",
"0.75547457",
"0.7455507",
"0.73844236",
"0.7341994",
"0.7301205",
"0.72290784",
"0.7159451",
"0.71151876",
"0.71014065",
"0.7045533",
"0.7004743",
"0.6954715",
"0.69277483",
"0.68690497",
"0.67739904",
"0.66655344",
"0.6646886",
"0.6644... | 0.79473543 | 0 |
Constructor for vertical view | function VerticalViews(parent) {
var _this = _super.call(this, parent) || this;
_this.isInverseTableSelect = true;
_this.baseCssClass = 'e-vertical-view';
return _this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VerticalView(parent){var _this=_super.call(this,parent)||this;_this.viewClass='e-day-view';_this.isInverseTableSelect=true;_this.baseCssClass='e-vertical-view';return _this;}",
"get vertical() { return this._vertical; }",
"get vertical() { return this._vertical; }",
"get vertical() {\n re... | [
"0.7139245",
"0.67702603",
"0.67702603",
"0.6493843",
"0.64425826",
"0.6288335",
"0.61822945",
"0.61351776",
"0.61231935",
"0.6114381",
"0.6113979",
"0.6106765",
"0.6106765",
"0.6106765",
"0.59219944",
"0.59219944",
"0.59219944",
"0.5900511",
"0.5900511",
"0.58720356",
"0.585... | 0.731578 | 0 |
Tries to synchronize the course notes. | function syncNotes(showErrors) {
return $mmaNotesSync.syncNotes(courseid).then(function(warnings) {
showSyncWarnings(warnings);
}).catch(function(error) {
if (showErrors) {
if (error) {
$mmUtil.showErrorModal(error);
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"synchronize() {\n console.log('Syncing evernote....')\n return new Promise((resolve, reject) => {\n this.client = new Evernote.Client({token: this.accessToken, sandbox: false})\n this.noteStore = this.client.getNoteStore()\n\n // for now I just care about a few specific notes from evernote, th... | [
"0.628566",
"0.5996045",
"0.58377296",
"0.5828778",
"0.5777362",
"0.55788195",
"0.55549955",
"0.5524901",
"0.54783124",
"0.5477703",
"0.54553556",
"0.5445066",
"0.54390556",
"0.5357885",
"0.53553194",
"0.53464717",
"0.53301483",
"0.52961004",
"0.5248076",
"0.5231264",
"0.5230... | 0.6351042 | 0 |
Show sync warnings if any. | function showSyncWarnings(warnings) {
var message = $mmText.buildMessage(warnings);
if (message) {
$mmUtil.showErrorModal(message);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayWarning() {\n warn(\"block\");\n setTimeout(() => {\n warn(\"none\");\n }, 10000);\n }",
"function showSpecialWarning() {\r\n return true;\r\n}",
"function showWarning() {\n return __awaiter(this, void 0, void 0, function* () {\n return apputils_1.showDialog(... | [
"0.65851563",
"0.6341777",
"0.5966126",
"0.5932924",
"0.5894407",
"0.5886334",
"0.5789219",
"0.5701421",
"0.5699061",
"0.5688658",
"0.56396455",
"0.56348926",
"0.5625075",
"0.5608756",
"0.5582862",
"0.5539677",
"0.553086",
"0.55290824",
"0.5524282",
"0.55173475",
"0.5479982",... | 0.799395 | 0 |
A simple formatter that replaces $0, $1, $2, etc. with the corresponding param | function myCustomFormatter (message) {
let params = Array.prototype.slice.call(arguments, 1);
return params.reduce((msg, param, index) => msg.replace("$" + index, param), message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sformat(format) {\n var args = arguments;\n var i = 0;\n return format.replace(/{(\\d*)}/g, function sformatReplace(match, number) {\n i += 1;\n if (typeof args[number] !== 'undefined') {\n return args[number];\n }\n if (typeof args[i] !== 'undefined') {\n return... | [
"0.7063723",
"0.70458317",
"0.70458317",
"0.6975646",
"0.69653",
"0.6954993",
"0.68692183",
"0.68560743",
"0.68286514",
"0.675672",
"0.6722729",
"0.67205036",
"0.6709644",
"0.67060655",
"0.67060655",
"0.67060655",
"0.67060655",
"0.6701742",
"0.6701742",
"0.6701742",
"0.670174... | 0.7457236 | 0 |
takes a single card and wraps it up in an array, also converst it to the json string representation. So the result is a oneelement array, as jsonstring. | function wrapAsArray(card)
{
let resultArray = [];
JSON.stringify(resultArray.push(card));
return resultArray;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stringJSON() {\n\treturn JSON.stringify(json_array);\n}",
"function reprCardArray(array: Array<Card>) {\n var cards = [];\n for(var i=0;i<array.length;i++) cards.push(array[i].reprString());\n return \"[\" + cards.join(', ') + \"]\";\n}",
"function convertDeckCard(card) {\n if (Array.isArray(card)... | [
"0.6497685",
"0.63337785",
"0.62163657",
"0.57410485",
"0.57306665",
"0.5525378",
"0.5479194",
"0.5456758",
"0.5424799",
"0.5422009",
"0.5364353",
"0.5310964",
"0.52888364",
"0.5279314",
"0.5253174",
"0.52439994",
"0.5219672",
"0.51828724",
"0.51823187",
"0.518167",
"0.517652... | 0.76776356 | 0 |
print function function that prints image contents | function print( catNum ){
if( printerReady ){
printerReady = false;
let cat = catNum == 0 ? 'm5' : catNum == 1 ? 'm15' : 'p15';
let n = catNum == 0 ? ran(5) : catNum == 1 ? ran(3) : ran(3);
let imagePath = baseImagesPath + cat + '-' + n + '.jpg';
console.log( imagePath );
printer
.printImage( imageP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function image_display() {\r\n\r\n}",
"_print() {\n const printWindow = window.open('about:blank', '_new');\n printWindow.document.open();\n printWindow.document.write(`\n <html>\n <head>\n <script>\n function onloadImage() ... | [
"0.7049592",
"0.661522",
"0.653272",
"0.6532423",
"0.6510392",
"0.6485976",
"0.6393766",
"0.63211244",
"0.6280563",
"0.6241105",
"0.62311816",
"0.61837524",
"0.6163741",
"0.6108587",
"0.6098162",
"0.60975236",
"0.60828334",
"0.60455114",
"0.6029005",
"0.600598",
"0.5991633",
... | 0.662333 | 1 |
PrintRssItem function Taking a random Item of rss Feed | function printRssItem () {
let n = ran(feed.items.length);
console.log("Printing RSS item #" + n);
if( printerReady ){
printerReady = false;
printer
.horizontalLine(32)
.bold(true)
.big(true)
.center()
.printLine("" + feed.items[n].title)
.big(false)
.bold(false)
.small(true)
.left(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get tag(){return\"rss-items\"}",
"function printItem(item){\n\t\t$(\"#items_list\").append('<span style=\"min-height:55px;min-width:55px;display:inline-block;\"><a class=\"tooltip-stop\" href=\"http://canisback.com/tooltips/item/'+item['id']+'\"><span class=\"item\" data-id=\"'+item['id']+'\" style=\\'bac... | [
"0.61539435",
"0.61121374",
"0.6054878",
"0.60496235",
"0.5859604",
"0.58502316",
"0.5835659",
"0.57758963",
"0.5714194",
"0.5699642",
"0.5677941",
"0.56343657",
"0.56223696",
"0.56136936",
"0.5591665",
"0.55403674",
"0.5533873",
"0.5463739",
"0.54521227",
"0.54227877",
"0.53... | 0.7974559 | 0 |
Should standartize two API versions responses: gid, is_closed, name, photo, photo_big, photo_medium, screen_name, type id, is_closed, name, photo_50, photo_100, photo_200, screen_name, type | function normalizeGroup(data) {
return {
gid: `-${data['gid'] || data['id']}`,
is_closed: data['is_closed'],
name: data['name'],
photo: data['photo_50'] || data['photo'],
photo_big: data['photo_big'] || data['photo_200'],
photo_medium: data['photo_medium'] || data['photo_100'],
screen_name... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getImageGroupTypes() {\n\n var date = new Date();\n var cacheBuster = \"?cb=\" + date.getTime();\n\n return $http({ method: 'GET', url: urlBase + '/GetImageGroupTypes' + cacheBuster });\n }",
"getImages() {\n let data = '';\n if (this.props.currentEditor ===... | [
"0.54489076",
"0.54105276",
"0.5392496",
"0.53696436",
"0.53299314",
"0.53170586",
"0.5294713",
"0.5240335",
"0.5179372",
"0.5166232",
"0.51492494",
"0.51483923",
"0.5139404",
"0.5076086",
"0.5062077",
"0.50549823",
"0.5029372",
"0.50258887",
"0.50220233",
"0.501739",
"0.5016... | 0.5946148 | 0 |
run a strider command with gitane | function gitaneCmd(cmd, dest, privkey, context, done) {
var start = new Date()
context.status('command.start', { command: cmd, time: start, plugin: context.plugin })
gitane.run({
emitter: {
emit: context.status
},
cmd: cmd,
baseDir: dest,
privKey: privkey,
detached: true
}, functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pruebaGit(){\n console.log('hola mundo ')\n}",
"function gitSync(){\n let cp=require('child_process');\n cp.execFileSync(gitParent+'scripts/gitSync.exe')\n }",
"function runGit(version = '') {\n const token = process.env.GITHUB_TOKEN\n const repo = process.env.GITHUB_REPO\n const ... | [
"0.5479778",
"0.53760195",
"0.53727865",
"0.5225195",
"0.5199438",
"0.514702",
"0.51408595",
"0.50780815",
"0.5063127",
"0.50298935",
"0.4998766",
"0.49161398",
"0.4902585",
"0.49010026",
"0.48813537",
"0.48697636",
"0.4860533",
"0.4832926",
"0.4812166",
"0.48043662",
"0.4794... | 0.57149494 | 0 |
Returns a promise that resolves when sortie station info has been ingested into the global EventList | function fetchStation(sortie) {
let p = fetch(buildStationsURLQuery(sortie))
.then(response => {
if (response.ok) {
return response.json();
} else {
return Promise.reject(response.status + ":" + response.statusText);
}
})
.t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStationData() {\n\n return Promise.all([getStationInfo(), getStationStatus()])\n .then(results => {\n const stationMap = {}\n const stations = results[0].data.stations;\n const stationStatus = results[1].data.stations;\n \n stations.forEa... | [
"0.5389551",
"0.5365288",
"0.52669376",
"0.5264808",
"0.5253512",
"0.52533257",
"0.52262557",
"0.52039367",
"0.5173969",
"0.51694256",
"0.51555014",
"0.5153419",
"0.50798386",
"0.50738645",
"0.50731087",
"0.50542825",
"0.5052215",
"0.5049446",
"0.504622",
"0.50290304",
"0.502... | 0.6141462 | 0 |
Enable the service timer with 20s interval | function enableTimer() {
fritsService.enableTimer( 20000,
function(r){handleSuccess(r);},
function(e){handleError(e);});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _startTimer() {\n service.timer.start(times.ONE_MINUTE);\n }",
"startTimer() {\n if (this.onStartCallback) {\n this.onStartCallback(this.timeRemaining);\n }\n\n this.tickWaktu();\n this.intervalId = setInterval(() => {\n this.tickWaktu(... | [
"0.7226867",
"0.70505446",
"0.6823716",
"0.6726135",
"0.66798776",
"0.6660426",
"0.66342866",
"0.6631252",
"0.6597125",
"0.6585263",
"0.65587646",
"0.6422284",
"0.6421099",
"0.64188844",
"0.63885766",
"0.6375615",
"0.6361096",
"0.6345642",
"0.63358605",
"0.633576",
"0.6331439... | 0.79594475 | 0 |
Register the service to start on reboot of the device | function registerForBootStart() {
fritsService.registerForBootStart( function(r){handleSuccess(r);},
function(e){handleError(e);});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initServices(){\n if ( OS_ANDROID ) {\n\n if (!Ti.Android.isServiceRunning(intentService)) {\n Ti.Android.startService(intentService);\n } else {\n Ti.API.info('Service is already running.');\n }\n } else {\n Ti.App.fireEvent('stopService');\n ... | [
"0.657016",
"0.63165426",
"0.62244475",
"0.62240255",
"0.6070843",
"0.6033111",
"0.59967405",
"0.5977657",
"0.58916026",
"0.56840926",
"0.5668452",
"0.56640995",
"0.5627269",
"0.5605778",
"0.553407",
"0.5508543",
"0.5488112",
"0.54798996",
"0.5479389",
"0.54665875",
"0.542175... | 0.7081756 | 0 |
Public function to cancel the next alarm | function cancelBackgroundAlarm() {
NextAlarmTimestamp = -1;
var config = {
"NextAlarmTimestamp" : '' + NextAlarmTimestamp,
};
fritsService.setConfiguration( config,
function(r){handleSuccess(r);},
function(e){handleError(e);});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cancelAlarm(e) {\r\n if (e.keyCode !== 13)\r\n return;\r\n id = document.getElementById(\"alarmCancel\").value;\r\n chrome.alarms.getAll(function (alarms) {\r\n if (id <= 0 || alarms.length < id) {\r\n alert(\"Alarm \" + id + \" does not exist!\");\r\n return;\... | [
"0.71712434",
"0.7107562",
"0.68783987",
"0.6797169",
"0.6734185",
"0.66988367",
"0.66612476",
"0.6382518",
"0.63547647",
"0.63429785",
"0.6324796",
"0.63170516",
"0.6309599",
"0.6286281",
"0.62637264",
"0.6244555",
"0.6241485",
"0.6229757",
"0.6219736",
"0.62176365",
"0.6210... | 0.78304386 | 0 |
Map a path array to an object reference, such that [foo, bar, baz] becomes a reference to the value at obj[foo][bar][baz]. | function pathToReference(obj, path) {
return reduce(function (reference, segment) {
if (reference) {
if (typeof segment === "object" && segment.hasOwnProperty("id"))
return idToReferenceAndIndex(reference, segment.id).obj;
else
return reference[segment];
}
else
return reference;
},
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function path (pathArray, obj){\n let iteration = 0;\n let objUnderOperation = obj;\n while(iteration < pathArray.length) {\n objUnderOperation = objUnderOperation[pathArray[iteration]];\n iteration +=1;\n }\n return objUnderOperation;\n}",
"function buildPath(target, ...accessPath) {\n accessPath ... | [
"0.68684375",
"0.6310042",
"0.62450814",
"0.62450814",
"0.6160519",
"0.61178917",
"0.6003847",
"0.5895691",
"0.58738863",
"0.58637184",
"0.5851344",
"0.5851344",
"0.58288383",
"0.58279",
"0.582342",
"0.5820778",
"0.5820778",
"0.5820778",
"0.5820778",
"0.5820778",
"0.5820778",... | 0.6429345 | 1 |
Apply a single command to an object. | function applyCommand(target, command) {
var container =
pathToReference(target, command.path.slice(0, command.path.length - 1));
if (!container) {
return;
}
if (command.action == "move") {
if (!command.path[command.path.length-1].hasOwnProperty("id"))
return;
var reference = idToReference... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Command () {}",
"function Command(execute, undo, value) {\n this.execute = execute;\n this.undo = undo;\n this.value = value;\n}",
"function execute(command) {\n console.log(\"calling execute\"); // remove when finished debugging\n player[command.action](command.target);\n}",
"function perform(... | [
"0.58079064",
"0.55632436",
"0.5386049",
"0.5376702",
"0.53053993",
"0.5283841",
"0.52700377",
"0.5183362",
"0.51624066",
"0.51164705",
"0.5067572",
"0.5067237",
"0.49962574",
"0.49924856",
"0.49791357",
"0.49773",
"0.49690586",
"0.49548978",
"0.4947215",
"0.4946594",
"0.4944... | 0.56854284 | 1 |
Subscribe to a youtube channel | async function subscribeChannel (res) {
let channelId;
if(app === apps[0]){ // For smartpathshala
channelId = appConstant.YOUTUBE.SMARTPATHSHALA.CHANNEL_ID;
} else if(app === apps[1]){ // For codestrippers
channelId = appConstant.YOUTUBE.CODESTRIPPERS.CHANNEL_ID;
} else if(app === apps[2]){ // For localhost
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function subscribeChannel(err) {\n if (err) {\n console.log(`Pubsub channel '${channel}' is unavailable`)\n console.log(err.message)\n throw err\n } else {\n console.log(`Pubsub subscribed to channel '${channel}'`)\n }\n }",
"subscribeToChannel(channelId) {\n let that = this;... | [
"0.6080504",
"0.6058687",
"0.60335505",
"0.59770256",
"0.59297514",
"0.5925349",
"0.5901352",
"0.5869934",
"0.5866482",
"0.586234",
"0.5856228",
"0.5856228",
"0.5856228",
"0.5856228",
"0.5856228",
"0.585454",
"0.585454",
"0.585454",
"0.585454",
"0.585454",
"0.58405024",
"0.... | 0.7591166 | 0 |
constructor for navbar color change | function navColorChange(id) {
var selector = document.getElementById("js-hero-" + id);
if (selector) {
var scrll = new ScrollMagic.Scene({
triggerElement: selector,
})
.offset(heroBottom - 28)
.triggerHook(0)
.setClassToggle("#js-navbar", "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeColor(newColor){\r\n\tvar navColor=document.getElementByid('navbar');\r\n\tnavColor.style.backgroundColor=newColor\r\n}",
"function changeNavColor(color) {\n document.querySelector('#nav').classList.add(color);\n}",
"function addColoredStyleToNavigation() {\n selectElement(\".container\").clas... | [
"0.6815362",
"0.6765921",
"0.6585627",
"0.6343379",
"0.62229645",
"0.6213609",
"0.6179146",
"0.6179146",
"0.6116876",
"0.59923774",
"0.5954048",
"0.59210736",
"0.5917005",
"0.590317",
"0.5898421",
"0.5838233",
"0.5821456",
"0.58164155",
"0.57943726",
"0.5734804",
"0.57216424"... | 0.6792903 | 1 |
Function for sending event to background page Data: the path to the object (selector) or redirectionURL evType: Type of the event (click, change, redirect) newValue: newValue as example for chaged value | function sendmsg(data, evType, newValue){
//console.log(objPath);
port.postMessage({msgType: "RecordedEvent", "data": data, "evType": evType, "newValue" : newValue});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickHandler(e) {\r\n console.log(\"clickhandler is being triggered\");\r\n chrome.storage.sync.set({\"test1\": \"working?\"}, function(){\r\n console.log(\"storage cb firing\");\r\n });\r\n //emit message containing form data\r\n chrome.runtime.sendMessage(\r\n {\r\n directive: \"submit-f... | [
"0.58265615",
"0.53654474",
"0.534219",
"0.53042746",
"0.52549195",
"0.52542084",
"0.5239133",
"0.522415",
"0.5189805",
"0.5151657",
"0.5147012",
"0.5144785",
"0.51078594",
"0.5104184",
"0.50965244",
"0.5085686",
"0.50800204",
"0.507405",
"0.5072888",
"0.50714475",
"0.5062458... | 0.6044586 | 0 |
Returns true if item is filtered | isFiltered(key) {
const item = this._.get(key);
return item ? item.filtered : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filteredCheck({ filteredItems, localFilter }) {\n // Determine if the dataset is filtered or not\n let isFiltered = false\n if (!localFilter) {\n // If filter criteria is falsey\n isFiltered = false\n } else if (looseEqual(localFilter, []) || looseEqual(localFilter, {})) {\n ... | [
"0.7302519",
"0.6953677",
"0.6941117",
"0.68881816",
"0.6882476",
"0.6715439",
"0.67079306",
"0.6607389",
"0.66048616",
"0.65204775",
"0.6496232",
"0.6436058",
"0.6422137",
"0.6370254",
"0.6363495",
"0.6349487",
"0.6344481",
"0.62894875",
"0.62424546",
"0.62383837",
"0.623828... | 0.7659098 | 0 |
texture, horiz, vert, total, duration. | function TextureAnimator(texture, tilesHoriz, tilesVert, numTiles, tileDispDuration) {
this.tilesHorizontal = tilesHoriz;
this.tilesVertical = tilesVert;
this.numberOfTiles = numTiles;
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function TextureAnimator(texture, tilesHoriz, tilesVert, numTiles, tileDispDuration) {\n this.tilesHorizontal = tilesHoriz;\n this.tilesVertical = tilesVert;\n this.numberOfTiles = numTiles;\n texture.wrapS = texture.wrapT = THREE.RepeatWr... | [
"0.6527551",
"0.64507306",
"0.6367514",
"0.6328346",
"0.6291671",
"0.62449414",
"0.61427575",
"0.60995924",
"0.60960454",
"0.60393363",
"0.6003513",
"0.59903276",
"0.5910777",
"0.5845135",
"0.57793075",
"0.5779296",
"0.5776795",
"0.5756273",
"0.5737376",
"0.57003075",
"0.5687... | 0.6560196 | 0 |
texture, horiz, vert, total, duration. | function TextureAnimator(texture, tilesHoriz, tilesVert, numTiles, tileDispDuration) {
this.tilesHorizontal = tilesHoriz;
this.tilesVertical = tilesVert;
this.numberOfTiles = numTiles;
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function TextureAnimator(texture, tilesHoriz, tilesVert, numTiles, tileDispDuration) {\n this.tilesHorizontal = tilesHoriz;\n this.tilesVertical = tilesVert;\n this.numberOfTiles = numTiles;\n texture.wrapS = texture.wrapT = THREE.RepeatWr... | [
"0.6558824",
"0.6451031",
"0.6366934",
"0.63272834",
"0.6291543",
"0.6244749",
"0.61425954",
"0.6099017",
"0.6094923",
"0.6038783",
"0.60035825",
"0.59891874",
"0.59101343",
"0.58448005",
"0.5779657",
"0.5778734",
"0.57772255",
"0.57557636",
"0.5736661",
"0.5699639",
"0.56867... | 0.65262544 | 1 |
Check which MIDI interface is MIDI Monger and if found start requesting configuration from interface | function onMIDISuccess(midiAccess) {
midi = midiAccess;
// store in the global variable
console.log(midiAccess);
for (var input of midiAccess.inputs.values()) {
console.log(input.name);
if (input.name == "Mountjoy MIDI") {
input.onmidimessage = getMIDIMessage;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onMIDISuccess(midi) {\n midiAccess = midi;\n console.log('MIDI Access Object', midiAccess);\n selectMIDIOut = document.getElementById(\"midiOut\");\n selectMIDIOut.onchange = changeMIDIOut;\n selectMIDIOut.options.length = 0;\n\n //calculate the MIDI clock (24ppq)\n tempo = 60 / bpm /... | [
"0.55272883",
"0.54615235",
"0.5428206",
"0.53560823",
"0.53507465",
"0.52479875",
"0.52438897",
"0.5223066",
"0.5102135",
"0.507558",
"0.5039807",
"0.49644238",
"0.49539375",
"0.49531376",
"0.49397692",
"0.48978686",
"0.48746973",
"0.4870904",
"0.48634505",
"0.48456872",
"0.... | 0.55780447 | 0 |
Receive MIDI message mainly used to process configuration information returned from module | function getMIDIMessage(midiMessage) {
console.log(midiMessage);
if (midiMessage.data[0] == 0xF2) {
var type = (midiMessage.data[1] & 0xF0) >> 4;
if (requestNo < 9) {
document.getElementById("gType" + requestNo).value = type;
document.getElementById("gChannel" + requestN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onMidiMessage(e) {\n // Create Message object from MIDI data\n const message = new Message(e.data);\n /**\n * Event emitted when any MIDI message is received on an `Input`.\n *\n * @event Input#midimessage\n *\n * @type {object}\n *\n * @property {Input} po... | [
"0.7249323",
"0.66561055",
"0.66307235",
"0.6563092",
"0.6399998",
"0.6381411",
"0.6380396",
"0.6298676",
"0.6250165",
"0.6220107",
"0.61766803",
"0.6080919",
"0.60748726",
"0.6051351",
"0.6051351",
"0.6012913",
"0.6010587",
"0.599988",
"0.59926885",
"0.5959712",
"0.5883005",... | 0.738512 | 0 |
Sends MIDI note to requested channel | function sendNote(noteValue, channel) {
if (checkConnection()) {
output.send([0x90 + parseInt(channel - 1), noteValue, 0x7f]);
output.send([0x80 + parseInt(channel - 1), noteValue, 0x40], window.performance.now() + 1000.0);
// note off delay: now + 1000ms
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playNote(midiNote) {\n var res = playMidiNote(midiNote);\n myapp.ports.playedNote.send(res);\n}",
"noteChannel (control, channel) {\n return this.set(0x02, control, channel)\n }",
"function playNote(note){\n MIDI.noteOn(0, note, velocity, delay);\n MIDI.noteOff(0, note, delay + 0.75);\n}",... | [
"0.67415905",
"0.6525093",
"0.6436209",
"0.6320851",
"0.6185005",
"0.60714453",
"0.6036616",
"0.5872686",
"0.58288395",
"0.5787518",
"0.5741872",
"0.5735234",
"0.5729725",
"0.5722875",
"0.56760687",
"0.56625736",
"0.56534106",
"0.5593768",
"0.5589871",
"0.5579479",
"0.5579065... | 0.7122059 | 0 |
Request configuration for output (uses MIDI song position mechanism) | function getOutputConfig(outputNo) {
var message = [0xF2, parseInt(outputNo), 0x00];
output.send(message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function download_config() {\n var content = '';\n content += '[Speaker]\\n';\n content += ' volume_curve = explicit\\n';\n var points = generatePoints();\n var last = 0;\n for (var i = NN; i >= 0; i--) {\n var v = points[i];\n if (isNaN(points[i])) v = last;\n content += ' db_at_' + i + ' = ' + M... | [
"0.61804104",
"0.5912885",
"0.5831578",
"0.5807378",
"0.56460226",
"0.5628872",
"0.5615303",
"0.55713487",
"0.5514824",
"0.53084046",
"0.5268458",
"0.5224622",
"0.52041256",
"0.51549757",
"0.5148751",
"0.5141411",
"0.51306534",
"0.51290184",
"0.51157826",
"0.50853467",
"0.507... | 0.6075331 | 1 |
Send out a configuration change to a specific gate | function updateGate(gateNo, cfgType) {
updateDisplay(controlEnum.gate, gateNo);
switch (cfgType) {
case cfgEnum.type:
var gType = document.getElementById("gType" + gateNo);
var cfgValue = gType.options[gType.selectedIndex].value;
break;
case cfgEnum.specificNote:
var gNo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"#send() {\n const data = this.#parse();\n if (data) {\n this.#device.printDevice('Calling <b>writeConfiguration()</b>');\n this.#device.sendRequest({\n 'method': 'writeConfiguration',\n 'configuration': data\n });\n\n this.#timeout = setTimeout(() => {\n this.#timeout... | [
"0.61286455",
"0.59836125",
"0.58927196",
"0.58455324",
"0.5424706",
"0.53950465",
"0.5392088",
"0.53089285",
"0.52753526",
"0.5223348",
"0.52171266",
"0.5172591",
"0.51478505",
"0.5069127",
"0.50690085",
"0.5067522",
"0.50199103",
"0.4997161",
"0.4989438",
"0.4934844",
"0.49... | 0.71860826 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.