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 |
|---|---|---|---|---|---|---|
Push into bit_array the binary value of "value" (value is coded in nbits) | function crc_pre_calcul(value, nbits, bit_array)
{
tab = [];
for (i=nbits-1; i>=0; i--)
{
tab.push((Number(value)>>i)&0x1);
}
for (j=0; j<nbits; j++)
{
bit_array.push(tab[j]);
}
return tab;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"add_bits(numBits, value) {\n var available_len, remaining_len, results, this_value;\n if (value > 0xffffffff) {\n throw new Error(\"value must be <= 0xffffffff (uint32)\");\n }\n if (value < 0) {\n throw new Error(\"value must be >= 0 (uint32)\");\n }\n r... | [
"0.7003465",
"0.5899967",
"0.5876635",
"0.5876635",
"0.5876635",
"0.58666974",
"0.5746038",
"0.5728695",
"0.5712973",
"0.5711141",
"0.57032996",
"0.56907964",
"0.56803095",
"0.56788415",
"0.56046903",
"0.55787975",
"0.5556501",
"0.5539974",
"0.5537268",
"0.5537268",
"0.553726... | 0.64040303 | 1 |
Return CRC7 from a bit array | function crc7(bit_array)
{
// Transform the bits array into byte array
var byte_array = [];
var dec = 0;
for (j=0; j<bit_array.length/8; j++)
{
for (i=0; i<8; i++)
{
dec += bit_array[(j*8)+i]*Math.pow(2,7-i);
}
byte_array.push(dec);
dec = 0;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function crc_array(array)\n{\n var final_array = [];\n var dec = 0;\n for (j=0; j<array.length/8; j++)\n {\n for (i=0; i<8; i++)\n {\n dec += array[(j*8)+i]*Math.pow(2,7-i);\n }\n final_array.push(dec);\n dec = 0;\n }\n return final_array;\n}",
"fun... | [
"0.6987842",
"0.6782314",
"0.6782314",
"0.663652",
"0.6405248",
"0.61515915",
"0.612719",
"0.59650403",
"0.5951762",
"0.59091157",
"0.58205473",
"0.58148354",
"0.578435",
"0.5776017",
"0.57446086",
"0.5738176",
"0.57358885",
"0.57288843",
"0.56865215",
"0.5685815",
"0.5680806... | 0.83034635 | 0 |
Gets or sets the balance this user has on their bank account. Writes will be processed as high priority, because | get bankAccountBalance() { return this.bankAccountBalance_; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateUserBalance(newTotal) {\n ctx.users[0].balance = newTotal;\n }",
"async userBalance (user){\n //Reads the Header information\n \n try{\n let userAct = this.protoData.account.get(user);\n return userAct[0].toFixed(2).toString().replace(/\\B(?=(\\d{3})+... | [
"0.7139467",
"0.69853675",
"0.6796091",
"0.661595",
"0.6531321",
"0.64952695",
"0.6456697",
"0.6447154",
"0.6404925",
"0.6380565",
"0.63714916",
"0.6356735",
"0.6326208",
"0.62420887",
"0.62173855",
"0.62094104",
"0.6207793",
"0.61803627",
"0.61607224",
"0.6149656",
"0.613146... | 0.72130585 | 0 |
Gets or sets the time until when the player has been muted, if at all. | get mutedUntil() { return this.mutedUntil_; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get muted() { return this._muted; }",
"static get muted() { return Engine._muted; }",
"get muted() {\n return this._muted;\n }",
"get muted() {\n return this._solo.muted || this.mute;\n }",
"get muted() {\n return Boolean(this.media.muted);\n }",
"function unMuteIfMuted() {\r\n i... | [
"0.64535016",
"0.63618374",
"0.62918115",
"0.6181088",
"0.6127044",
"0.6110703",
"0.5980438",
"0.5973414",
"0.59119165",
"0.59119165",
"0.5845671",
"0.5844843",
"0.57937753",
"0.57937753",
"0.5786805",
"0.5713404",
"0.571089",
"0.56680685",
"0.566032",
"0.56309295",
"0.561451... | 0.72012806 | 0 |
Gets or sets the array of skin decorations this player should have. | get skinDecorations() { return this.skinDecorations_; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get windowskin() { return this._windowskin; }",
"get skin() {\n if (this.args.skin) {\n return `auk-navbar--${this.args.skin}`;\n }\n return 'auk-navbar--white';\n }",
"initSkin() {\n if (objectPath.get(this.config, \"header.self.skin\")) {\n document.body.classList.add(\n \"kt-he... | [
"0.5528056",
"0.5396005",
"0.5233968",
"0.520368",
"0.5170989",
"0.5033955",
"0.50141245",
"0.4997569",
"0.49794188",
"0.4966464",
"0.49325654",
"0.47847316",
"0.47411597",
"0.47411597",
"0.47411597",
"0.47401255",
"0.47336376",
"0.47177407",
"0.4709197",
"0.47013268",
"0.468... | 0.7764855 | 0 |
Returns whether this account data has requested an update, for fields of high importance. | hasRequestedUpdate() { return this.hasRequestedUpdate_; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isProductUpdateNeeded() {\n var config = Config.getConfig();\n var lastUpdate;\n var now = new Date().getTime();\n var updateFrequency;\n var updateNeeded;\n //noinspection JSUnresolvedVariable\n var productFeed = _.find( config.jsonDatabaseFeeds, function(... | [
"0.6550681",
"0.62448317",
"0.6212839",
"0.6113813",
"0.60936785",
"0.6039171",
"0.6004286",
"0.59520704",
"0.5926943",
"0.5919397",
"0.573877",
"0.57116246",
"0.57116246",
"0.57116246",
"0.57116246",
"0.57116246",
"0.56912065",
"0.5679803",
"0.56781274",
"0.56334025",
"0.561... | 0.65395963 | 1 |
Render the selected column // ////////////////////////////// renderer > RenderingToolKit() | function renderColumn(col, data) {
//Get the rows
var viewport = document.getElementById("viewport").querySelector(".content");
viewport.innerHTML = "";
//Create indexation array
var indexes = [];
if(!data) return; //No data to display, cancel the rendering process
for(let i = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onColumnChange(e){this.selected=e.detail.value;this._updateCols(parseInt(e.detail.value))}",
"function renderCol(ctx, col, direction, index, x, y, width, height) {\n var offset = x + index * width;\n adjoinAndRender(col, direction, function(index1, index2) {\n renderLine(ctx, offset, y + index1 * height, o... | [
"0.642888",
"0.6374942",
"0.62905675",
"0.61394334",
"0.6007828",
"0.5990278",
"0.59705865",
"0.5941112",
"0.59389365",
"0.59263474",
"0.59235615",
"0.58779967",
"0.5874232",
"0.58643657",
"0.5855032",
"0.5848433",
"0.58334416",
"0.5808334",
"0.58066916",
"0.5776275",
"0.5748... | 0.6459208 | 0 |
performs a PATCH operation on an item, passing in the specified properties | function patch(id, properties) {
return function () { return RestUtility.patch(id, properties); };
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function patch(id, properties) {\n var parsedBody = JSON.stringify(properties);\n var request = {\n url: RichApiTest.RestUtility.getBaseUrlUsingOverride(ExcelTest.settings.baseUri) + id,\n method: RichApiTest.RestUtility.httpMethodPatch,\n body: pa... | [
"0.6679947",
"0.65491533",
"0.63435286",
"0.63400453",
"0.63091093",
"0.63091093",
"0.6279312",
"0.6071556",
"0.6041256",
"0.60357726",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5802595",
"0.58023405",
"0.579753... | 0.67603326 | 0 |
Gets an object of type T out of the response. Optionally applies a transformation function (e.g., to get a particular property out of the body). | function getBodyAsObject(transform) {
return function (resp) { return RestUtility.getBodyAsObject(resp, transform); };
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBodyAsObject(resp, transform) {\n var obj = JSON.parse(resp.body);\n if (transform) {\n obj = transform(obj);\n }\n return obj;\n }",
"function transformToJson (response) {\n if (response.ok) {\n return response.json(); ... | [
"0.7123238",
"0.5643905",
"0.5616703",
"0.5607989",
"0.5593848",
"0.5546276",
"0.5146597",
"0.5129347",
"0.511429",
"0.5110969",
"0.50153685",
"0.4952647",
"0.49391377",
"0.49116763",
"0.48863247",
"0.4852248",
"0.48389238",
"0.48170885",
"0.48099834",
"0.4806786",
"0.4804007... | 0.61176443 | 1 |
Validates that the value and expected value are same with each other | function validateValue(value, expectedValue, delta) {
Util.assert(Util.compare(value, expectedValue, delta));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkEqual(name, expectedValue) {\n const actualValue = this._getRawValue(name);\n if (actualValue !== expectedValue)\n throw new Error(`expected ${name}=${expectedValue}; got ${name}=${actualValue}`);\n // success\n }",
"function checkValueEquality (a, b) {\n\t return a === b... | [
"0.6763973",
"0.65819836",
"0.64110583",
"0.6389436",
"0.6389436",
"0.6190395",
"0.61476153",
"0.61428285",
"0.60901624",
"0.606767",
"0.5973228",
"0.5962514",
"0.5910977",
"0.5906678",
"0.5904408",
"0.59017307",
"0.58922833",
"0.5892",
"0.58647543",
"0.5854626",
"0.58377457"... | 0.7131154 | 0 |
performs a PATCH operation on an item, passing in the specified properties | function patch(id, properties) {
var parsedBody = JSON.stringify(properties);
var request = {
url: RichApiTest.RestUtility.getBaseUrlUsingOverride(ExcelTest.settings.baseUri) + id,
method: RichApiTest.RestUtility.httpMethodPatch,
body: parsedBody
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function patch(id, properties) {\n return function () { return RestUtility.patch(id, properties); };\n }",
"updateItem(id, formData) {\n const oz = this._appContext.oz, url = oz.getItemURI(this.name, id);\n return oz.request(url, {\n method: 'PATCH',\n ... | [
"0.67603326",
"0.65491533",
"0.63435286",
"0.63400453",
"0.63091093",
"0.63091093",
"0.6279312",
"0.6071556",
"0.6041256",
"0.60357726",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5821814",
"0.5802595",
"0.58023405",
"0.57975... | 0.6679947 | 1 |
Gets an object of type T out of the response. Optionally applies a transformation function (e.g., to get a particular property out of the body). | function getBodyAsObject(resp, transform) {
var obj = JSON.parse(resp.body);
if (transform) {
obj = transform(obj);
}
return obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBodyAsObject(transform) {\n return function (resp) { return RestUtility.getBodyAsObject(resp, transform); };\n }",
"function transformToJson (response) {\n if (response.ok) {\n return response.json(); //OSEF\n }\n\n throw Error(\"Content not loade... | [
"0.61176443",
"0.5643905",
"0.5616703",
"0.5607989",
"0.5593848",
"0.5546276",
"0.5146597",
"0.5129347",
"0.511429",
"0.5110969",
"0.50153685",
"0.4952647",
"0.49391377",
"0.49116763",
"0.48863247",
"0.4852248",
"0.48389238",
"0.48170885",
"0.48099834",
"0.4806786",
"0.480400... | 0.7123238 | 0 |
Encodes an odata literal (e.g., when a parameter is passed in to a method, as in: worksheets('charts')/charts/$/add(type='pie',sourceData='a1:b4') While the encoding is not necessary for the simple case above, if instead of 'a1:b4' the text contained an apostrope or invalid URL characters, it would need to be appropria... | function encodeODataLiteral(value) {
if (typeof value === 'string') {
// Replace single apostrophe with double-apostrophe
return "'" + replaceAll(value, "'", "''") + "'";
}
else if (typeof value == 'boolean' || typeof value == 'number') {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_encodeLiteral(literal) {\n // Escape special characters\n var value = literal.value;\n if (escape.test(value)) value = value.replace(escapeAll, characterReplacer); // Write the literal, possibly with type or language\n\n if (literal.language) return '\"' + value + '\"@' + literal.language;else if (lit... | [
"0.64110464",
"0.62916005",
"0.62728995",
"0.6151804",
"0.61204296",
"0.60409015",
"0.5962614",
"0.58337224",
"0.5830269",
"0.5775436",
"0.57625484",
"0.5756665",
"0.57237923",
"0.57050186",
"0.57050186",
"0.57050186",
"0.56822133",
"0.5629548",
"0.5590752",
"0.5502899",
"0.5... | 0.701578 | 0 |
Removes all charts from the sheet, and then either calls the passedin test function, or just returns a promise that can be chained on to another action. | function removeAllChartsBefore(sheetName, test) {
RichApiTest.log.comment('Cleaning all charts from the sheet "' + sheetName + '"');
var ctx = new Excel.RequestContext();
var charts = ctx.workbook.worksheets.getItem(sheetName).charts;
ctx.load(charts, "id");
var result = ctx.sync... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearCharts() {\n var elms = document.getElementsByClassName(\"chart-table\");\n _.each(elms, function (value) {\n value.parentElement.removeChild(value)\n });\n charts = {};\n rowCounter = 0;\n }",
"clearCache() {\n this.sheets.forEach(sheet => sheet.... | [
"0.5875283",
"0.5634428",
"0.55416477",
"0.5534006",
"0.55069184",
"0.54329777",
"0.5385853",
"0.53633",
"0.53448635",
"0.52789044",
"0.5277395",
"0.52054274",
"0.51776594",
"0.51317453",
"0.50039446",
"0.4999208",
"0.4989874",
"0.498481",
"0.49806756",
"0.4980455",
"0.498019... | 0.8145236 | 0 |
Get an active date using the value, or current date as default | getActiveDate(value, min, max) {
return dateFromRange(this.activeDate, min, max) || value || dateFromRange(new Date(), min, max);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCurrentDate() {\n\t\t\tvar currentDate = new Date();\n\t\t\tcurrentDate = $filter('date')(currentDate, \"MM/dd/yyyy\");\n\t\t\treturn currentDate;\n\t\t}",
"function setDefaultDate() {\n var dateField = document.getElementById(\"selected-date\");\n var tomorrow = new Date();\n tomorrow.setDa... | [
"0.63095814",
"0.62120104",
"0.6146519",
"0.60883594",
"0.6051672",
"0.6023077",
"0.60209966",
"0.60186195",
"0.60100764",
"0.5997467",
"0.5948586",
"0.593613",
"0.59161973",
"0.5896627",
"0.58746773",
"0.586837",
"0.5866778",
"0.58089334",
"0.57891685",
"0.57789916",
"0.5778... | 0.7374151 | 0 |
======Change header pagination: ========================================= | function headerPagination(){
let headerPaginationBlock = $('.header-pagination');
let activeMenuIndex = $('#top-menu a.active').index()+1;
let numberSection = activeMenuIndex<10 ? "0"+activeMenuIndex : activeMenuIndex;
$('.header-pagination-current-num').text(numberSection);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static setResponseHeaders(res, currentPage, limit, total) {\n res.set('X-Pagination-Page', currentPage);\n res.set('X-Pagination-Limit', limit);\n res.set('X-Pagination-Page-Count', Math.ceil(total / limit));\n res.set('X-Pagination-Item-Count', total);\n }",
"function ChangePageSize(data) {\n //... | [
"0.6605245",
"0.64573115",
"0.6435032",
"0.6329287",
"0.63256884",
"0.6320687",
"0.6320687",
"0.6320687",
"0.6320687",
"0.62931573",
"0.6288214",
"0.6284334",
"0.62836117",
"0.6282125",
"0.6247512",
"0.6200174",
"0.61918783",
"0.6170272",
"0.6143345",
"0.61417264",
"0.6138056... | 0.738482 | 0 |
addUpTo2 is faster because there is only 3 operation, regardless of the size of n Time complexity is: O(1) constant | function addUpTo2(n) {
return n * ( n + 1 ) / 2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addUpTo2(n) {\n return n * (n+1)/2\n}",
"function addUpTo2(n) {\n return (n * (n + 1)) / 2;\n}",
"function addUpToV1(n) {\n let total = 0;\n for (let i = 0; i < n; i++) {\n total += i;\n }\n\n return total;\n}",
"function addUpTo(n) {\n return (n * (n + 1)) / 2;\n}",
"function addUpTo(... | [
"0.7958144",
"0.77259475",
"0.755139",
"0.7383946",
"0.7358917",
"0.7329118",
"0.7329118",
"0.7329118",
"0.7209412",
"0.71844846",
"0.71440905",
"0.7131076",
"0.7098917",
"0.7059315",
"0.70375156",
"0.698918",
"0.6945246",
"0.6866141",
"0.6710452",
"0.66433066",
"0.6599655",
... | 0.7768167 | 1 |
handle transport down during request error | function handle_transport_down() {
// mimics `once()` event listener
bayeux.unbind('transport:down', handle_transport_down);
handle_error(ioerr(io.ECONNGONE, 'Server gone. (RT)'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onTransportError() {\n if (this.status === UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n if (!this.error || this.error !== UA.C.NETWORK_ERROR) {\n this.status = UAStatus.STATUS_NOT_READY;\n this.error = UA.C.NETWORK_ERROR;\n }\n }",
"function trans... | [
"0.71705747",
"0.65781856",
"0.65360975",
"0.65316105",
"0.65316105",
"0.65316105",
"0.65316105",
"0.65169334",
"0.65169334",
"0.6490622",
"0.6490622",
"0.64879465",
"0.6483715",
"0.6483715",
"0.6483715",
"0.6478637",
"0.64646524",
"0.64646524",
"0.64646524",
"0.64479434",
"0... | 0.7409076 | 0 |
layers starting from target node | applyLayers() {
function _setLayer(node, layer, visited = []) {
node.layer = layer
visited.push(node.id)
for (let edge of node.input
.filter(_e => !visited.some(v => _e.from === v))
) {
_setLayer.call(this, this.nodes[edge.from], layer + 1, visited)
}
}
_setLaye... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"markWayBackFromTarget(tree, targetNode) {\n var node = targetNode;\n\n while (true) {\n if (typeof tree[node] === 'undefined') {\n break;\n }\n\n var key = this.meshHolder.getKey(node, tree[node]);\n\n document.getElementById('connection-' + ... | [
"0.6301042",
"0.5943577",
"0.588433",
"0.5692147",
"0.5676412",
"0.5639772",
"0.5639648",
"0.55977094",
"0.5565165",
"0.54988647",
"0.5468215",
"0.54671276",
"0.5466265",
"0.5451435",
"0.5436657",
"0.54166865",
"0.53860897",
"0.53848326",
"0.53761286",
"0.5348113",
"0.5346612... | 0.7083296 | 0 |
makes nav bar visible | function showNav() {
$(_element).find('.kks_nav').show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function navBarVisibility() {\n\t\tvar hash = window.location.hash;\n\t\thash = hash.toString();\n\n\t\tvar showNavBar = [];\n\t\tvar hideNavBar = [\"\", \"#host-volunteer-view\", \"#main-menu-view\", \"#register-view\", \"#register-view-a\", \"#register-view-b\", \"#register-view-c1\", \"#register-view-c2\", \"#r... | [
"0.7810839",
"0.7367949",
"0.7355379",
"0.7268964",
"0.72421163",
"0.7239683",
"0.7234604",
"0.7212547",
"0.72079134",
"0.7201459",
"0.7171709",
"0.7161732",
"0.7132377",
"0.704501",
"0.7007705",
"0.7006389",
"0.6997029",
"0.6972378",
"0.69597924",
"0.6952067",
"0.69511235",
... | 0.7540049 | 1 |
hides the nav bar | function hideNav() {
$(_element).find('.kks_nav').hide();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideNav() {\n navbar.style.display = \"none\";\n}",
"function hideNav () {\n\t\tjQuery('#nav').removeClass('nav-expanded');\n\t\tjQuery('#nav').slideUp();\n\t}",
"function hideNav(){\n navIsDown = false;\n nav.css('top', -navHeight).css('opacity', '0');\n}",
"function hideNav() {\n $(\"#ma... | [
"0.7893189",
"0.76589787",
"0.7620647",
"0.75182587",
"0.7395486",
"0.72587603",
"0.71501005",
"0.71035695",
"0.7051724",
"0.7026374",
"0.69935507",
"0.6977084",
"0.6953598",
"0.6952092",
"0.6950695",
"0.6853529",
"0.6843147",
"0.682738",
"0.6824504",
"0.6797916",
"0.67962945... | 0.8191542 | 0 |
Get user arguments from implied or explicit arguments. Sideeffects: set _scriptPath if args included script. Used for default program name, and subcommand searches. | _prepareUserArgs(argv, parseOptions) {
if (argv !== undefined && !Array.isArray(argv)) {
throw new Error('first parameter to parse must be array or undefined');
}
parseOptions = parseOptions || {};
// Default to using process.argv
if (argv === undefined) {
argv = process.argv;
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // Default to using process.argv\n if (argv === undefined) {\n argv = process.ar... | [
"0.6337344",
"0.56605357",
"0.55550545",
"0.55486894",
"0.5520106",
"0.54966384",
"0.54293776",
"0.5327214",
"0.52754533",
"0.5216674",
"0.51830757",
"0.5176391",
"0.5162842",
"0.49709424",
"0.4961667",
"0.49608487",
"0.4958296",
"0.49478686",
"0.49454767",
"0.49428576",
"0.4... | 0.61824596 | 1 |
Invoke help directly if possible, or dispatch if necessary. e.g. help foo | _dispatchHelpCommand(subcommandName) {
if (!subcommandName) {
this.help();
}
const subCommand = this._findCommand(subcommandName);
if (subCommand && !subCommand._executableHandler) {
subCommand.help();
}
// Fallback to parsing the help flag to invoke the help.
return this._dispa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _run_help() {\n this._options.usage();\n }",
"showHelp() {\n // To be overrided by subclasses\n }",
"static ShowHelpForObject() {}",
"function cmd_Help() {\n\t\t\n\t}",
"function help(term, args) {\n if(args.length > 0)\n {\n command = args[0];\n switch(command) {\n ... | [
"0.72191066",
"0.7179768",
"0.7046432",
"0.6993544",
"0.6674409",
"0.666207",
"0.6639258",
"0.66260517",
"0.6603305",
"0.65963894",
"0.6457956",
"0.64238805",
"0.62809914",
"0.62168694",
"0.62096786",
"0.62068146",
"0.6194622",
"0.61824465",
"0.61583865",
"0.61526453",
"0.607... | 0.7255082 | 0 |
Display an error message if a mandatory option does not have a value. Called after checking for help flags in leaf subcommand. | _checkForMissingMandatoryOptions() {
// Walk up hierarchy so can call in subcommand after checking for displaying help.
for (let cmd = this; cmd; cmd = cmd.parent) {
cmd.options.forEach((anOption) => {
if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n for (let cmd = this; cmd; cmd = cmd.parent) {\n cmd.options.forEach((anOption) => {\n if (anOption.mandatory && (cmd._getOptionValue(anOption.attributeName()) === undefined)... | [
"0.76067805",
"0.63709146",
"0.63709146",
"0.63709146",
"0.63222516",
"0.5981479",
"0.58697176",
"0.580716",
"0.578698",
"0.57708156",
"0.5645951",
"0.5578812",
"0.55571157",
"0.5512558",
"0.5464158",
"0.5446624",
"0.54253113",
"0.5396787",
"0.53813386",
"0.5371387",
"0.53325... | 0.76261955 | 1 |
Display an error message if conflicting options are used together in this. | _checkForConflictingLocalOptions() {
const definedNonDefaultOptions = this.options.filter(
(option) => {
const optionKey = option.attributeName();
if (this.getOptionValue(optionKey) === undefined) {
return false;
}
return this.getOptionValueSource(optionKey) !== 'defa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n for (let cmd = this; cmd; cmd = cmd.parent) {\n cmd._checkForConflictingLocalOptions();\n }\n }",
"checkUnknownOptions() {\n const { options, globalCommand } = this.cli;\n ... | [
"0.6452124",
"0.6042516",
"0.5798278",
"0.57858264",
"0.5775831",
"0.56764305",
"0.55956084",
"0.5420432",
"0.5420432",
"0.5420432",
"0.5413244",
"0.53638065",
"0.53478295",
"0.53401345",
"0.5331094",
"0.5329724",
"0.5329724",
"0.5320902",
"0.5315796",
"0.5315796",
"0.5284704... | 0.60776454 | 1 |
Display an error message if conflicting options are used together. Called after checking for help flags in leaf subcommand. | _checkForConflictingOptions() {
// Walk up hierarchy so can call in subcommand after checking for displaying help.
for (let cmd = this; cmd; cmd = cmd.parent) {
cmd._checkForConflictingLocalOptions();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printHelp() {\n console.error(\"boxboat/config-merge [flags] file1 [file2] ... [fileN]\")\n console.error(\"-a, --array merge|overwrite|concat whether to merge, overwrite, or concatenate arrays. defaults to merge\")\n console.error(\"-f, --format json|toml|yaml whether to outp... | [
"0.6324016",
"0.62759036",
"0.61475813",
"0.60252404",
"0.60252404",
"0.5964066",
"0.5959357",
"0.5808703",
"0.5808703",
"0.5808703",
"0.5582804",
"0.557368",
"0.55714434",
"0.55151737",
"0.5503082",
"0.548072",
"0.54594654",
"0.5434982",
"0.54194295",
"0.5409573",
"0.5400423... | 0.7112433 | 0 |
Apply any option related environment variables, if option does not have a value from cli or client code. | _parseOptionsEnv() {
this.options.forEach((option) => {
if (option.envVar && option.envVar in process.env) {
const optionKey = option.attributeName();
// Priority check. Do not overwrite cli or options from unknown source (client-code).
if (this.getOptionValue(optionKey) === undefined ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tempEnvHack(config) {\n options.forEach(option => {\n const optKey = option.attributeName();\n const configKey = configKeyForOptKey[optKey] || optKey;\n const { envVar } = option;\n if (!envVar) {\n return;\n }\n const optVal = _.get(config, configKey);\n if (typeof optVal === '... | [
"0.64442146",
"0.58678347",
"0.57370543",
"0.5621359",
"0.5618556",
"0.5594321",
"0.5577079",
"0.55313843",
"0.5526749",
"0.55223703",
"0.54768",
"0.5458915",
"0.5451445",
"0.5408773",
"0.54085195",
"0.5408436",
"0.53900313",
"0.53134656",
"0.527421",
"0.52567494",
"0.5202555... | 0.76767206 | 0 |
use: findExpensiveDigest(selector1, selector2, ...); | function findExpensiveDigest() {
if (typeof findExpensiveDigest !== 'function') {
throw new Error('cannot find findExpensiveDigest function');
}
var selectors = Array.prototype.slice.call(arguments, 0);
var durations = selectors.map(function timeSelectorDigest(selector) {
var started = performance.now()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function measureLegacy(n, data, method) {\n method = kMethods[method];\n bench.start();\n for (let i = 0; i < n; ++i) {\n createHash(method).update(data).digest();\n }\n bench.end(n);\n}",
"deriveNumberOfDigestsToCreate(paymentId){\n //determine how many digests to create for next payment round accord... | [
"0.5612772",
"0.5298813",
"0.51951706",
"0.515022",
"0.50685817",
"0.50275344",
"0.49947125",
"0.49817896",
"0.49816462",
"0.49729693",
"0.49658778",
"0.49475864",
"0.4943182",
"0.48964095",
"0.4791475",
"0.47875124",
"0.47835082",
"0.47382048",
"0.47222656",
"0.4696413",
"0.... | 0.79972774 | 0 |
function we want to sort the bandnames as stripped but without mofifying them so we need a strip function to temporarily strip them | function sortContent() {
const regex = /(?:(the|a|an) +)/i;
function strip(bandname) {
return bandname.replace(regex, "");
}
const bandsOrdered = bands.sort((a, b) => (strip(a) > strip(b)) ? 1 : -1);
list.innerHTML = bandsOrdered.map((band) => {
return `<li>${band}</li>`;
}).join("");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sanitizeBandName(name) {\n // - if bandname ends with comma, remove comma\n if (name.slice(-1) === ',') name = name.slice(0, -1);\n // - if bandname ends with period, remove period\n if (name.slice(-1) === '.') name = name.slice(0, -1);\n return name;\n}",
"function sort_compact() {\r\n\t\r\n\t//fu... | [
"0.6327336",
"0.6004508",
"0.57903856",
"0.54863125",
"0.5388487",
"0.5387536",
"0.53449327",
"0.5335652",
"0.53332436",
"0.53034407",
"0.52398485",
"0.5189892",
"0.51346487",
"0.51334953",
"0.5113373",
"0.50887823",
"0.5065307",
"0.50629437",
"0.5008575",
"0.4999351",
"0.499... | 0.65020204 | 0 |
Setup a control output handler with a function of type (path, value) to be used on each generated output value. This handler will be called each audio cycle at the end of the 'compute' method. | setOutputParamHandler(handler) {
this.output_handler = handler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setOutputParamHandler(handler)\n {\n this.output_handler = handler;\n }",
"static set outputSampleRate(value) {}",
"onoutput(outputs) {\n }",
"function controller(number, value) {\n switch (number) {\n case 2:\n $(\"fFreq\").setRatioValue(value);\n onUpdateFilterCutoff(100 * val... | [
"0.5520844",
"0.5408778",
"0.53252286",
"0.5228738",
"0.5103934",
"0.5091932",
"0.5031428",
"0.50261587",
"0.49867487",
"0.49734324",
"0.49462724",
"0.49339914",
"0.4932438",
"0.4931581",
"0.49010235",
"0.48494992",
"0.48345393",
"0.48005885",
"0.47793967",
"0.47345337",
"0.4... | 0.55027604 | 1 |
Get the current output handler. | getOutputParamHandler() {
return this.output_handler;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getOutputParamHandler()\n {\n return this.output_handler;\n }",
"static getInstance() {\r\n if (!!Output.instance) {\r\n return Output.instance;\r\n }\r\n else {\r\n window[C.WIN_PROP.OUTPUT_INST] = new Output(window.document);\r\n return Output.... | [
"0.7132074",
"0.56824195",
"0.5488107",
"0.5468917",
"0.546569",
"0.5437166",
"0.5429089",
"0.5424408",
"0.53518796",
"0.5239723",
"0.52207935",
"0.5206541",
"0.5162801",
"0.5161515",
"0.5157394",
"0.5157394",
"0.5157394",
"0.51483476",
"0.5146757",
"0.51241386",
"0.5079962",... | 0.7235856 | 0 |
Generic MIDI message handler. | onMidi(data) {
this.port.postMessage({ type: "midi", data: data });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onMIDIMessage (message) {\n\n const midiActionType = message.data[0];\n const midiNumber = message.data[1];\n\n if (midiActionType === 144 && midiNumber > 0) {\n noteOnCallback(midiNumber);\n }\n\n if (message.data[0] === 128 || message.data[2] === 0) {\n noteOffCallback(midiN... | [
"0.72169983",
"0.6917283",
"0.6838206",
"0.6634567",
"0.65366644",
"0.64996046",
"0.63309866",
"0.6329826",
"0.6303853",
"0.6228601",
"0.61764663",
"0.61171067",
"0.60866606",
"0.60832226",
"0.60594845",
"0.60582614",
"0.6054822",
"0.5997657",
"0.598278",
"0.59363055",
"0.586... | 0.7097684 | 1 |
This function will run startGame() when all the name inputs meet the conditions. It ensures that none of the name slots are left blank, and checks to see that none of the names are the exact same before it displays the names in the chart. | function checkNames() {
let playerCheck = []
for (let i = 0; i < playerCount; i++) { // We use the playerCount variable we defined earlier for all these loops.
playerCheck.push(document.getElementById(`playerNumber${i}`).value) // We push each name to the playerCheck array so we can use conditionals on ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkName() {\n\t\t\tnameInputValue = nameInput.value;\n\t\t\t// let nameInputValue = nameInput.value.toLowerCase();\n\t\t\tfor (let i = 0; i < nameArray.length; i++) {\n\t\t\t\tif (nameInputValue.toLowerCase() === nameArray[i]) {\n\t\t\t\t\tendGame();\n\t\t\t\t} \n\t\t\t}\n\n\t\t\tstartWeaponPage();\n\t\... | [
"0.7248606",
"0.69223964",
"0.6673807",
"0.66151303",
"0.6490544",
"0.6247753",
"0.61390793",
"0.61358017",
"0.6090546",
"0.60897535",
"0.60126734",
"0.5936665",
"0.5932978",
"0.59146273",
"0.58551925",
"0.5851964",
"0.5823458",
"0.5808971",
"0.5806428",
"0.58008367",
"0.5787... | 0.7165986 | 1 |
by using set timeout instead of interval we guarantee that there is a one second break in refreshing the log | function triggerNextLogUpdate(time) {
window.setTimeout(updateLog, time);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLog() {\n $.ajax({\n method: \"GET\",\n url: \"/api/get_log?t=\" + new Date().getTime() / 1000,\n success: data => {\n let count = (data.code === 200) ? data.new_count : 0;\n $(\"#new_message\").text(\"New Messages: \" + count);\n }\n })\n setT... | [
"0.679738",
"0.65886736",
"0.6412521",
"0.638243",
"0.6252168",
"0.6205985",
"0.6205607",
"0.6197199",
"0.6181823",
"0.61812526",
"0.6180424",
"0.6168945",
"0.6111759",
"0.6099124",
"0.6041516",
"0.60341674",
"0.6029948",
"0.60008085",
"0.59524506",
"0.5938882",
"0.5935213",
... | 0.72675383 | 0 |
This function sorts the sentences in order of least to most amount of keep votes returns the list of ids to hide | function sortInLeastAmountOfKeepVotes(sents) {
sents.sort(function (a, b) {
return a[3] - b[3];
});
var toReturn = [];
for(var i = 0; i < sents.length; i++) {
toReturn.push(sents[i][0]);
}
return toReturn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sortSentences(sentence_weights_list){\n\t\tsentence_weights_list.sort((a,b)=>{\n\t\t\treturn b[0]-a[0];\n\t\t})\n\t\treturn sentence_weights_list;\n\t}",
"function sortPlaylistByVotesAscendant(){\n var playlist = $('.playlist');\n playlist.children('.playlist-item').sort(function (a, b) {\n var name_a = $(a... | [
"0.53921837",
"0.53548706",
"0.51966715",
"0.5195641",
"0.5113069",
"0.5111568",
"0.5098459",
"0.5091343",
"0.50647354",
"0.50634956",
"0.5014048",
"0.5008439",
"0.50023675",
"0.49951085",
"0.49644375",
"0.49644375",
"0.49644375",
"0.49644375",
"0.49644375",
"0.49644375",
"0.... | 0.60622746 | 0 |
the function that clears the lap value displayed | function lapClear() {
let lapRecords = document.querySelector('#lap-list');
lapRecords.innerHTML = "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearDisplay()\n{\ndocument.calc.display.value = \"\";\n}",
"function clearVal() {\n\t\tdocument.getElementById(\"displayVal\").value = \"0\";\n\t\tcalcSpace.valOne = \"\";\n\t\tcalcSpace.valTwo = \"\";\n\t\tcalcSpace.isSecondParam = false;\n\t\tcalcSpace.operator = \"\";\n\t\tcalcSpace.operatorFlag = f... | [
"0.720091",
"0.7071232",
"0.6914224",
"0.6873554",
"0.6805296",
"0.6771105",
"0.67535365",
"0.6746064",
"0.67310476",
"0.67247057",
"0.67105377",
"0.6710113",
"0.6700722",
"0.6632865",
"0.6619823",
"0.6596168",
"0.6586469",
"0.65715766",
"0.65586",
"0.655729",
"0.65545887",
... | 0.7261527 | 0 |
Get all comments of a post according the specified pagination | async getComments(postID, {limit, offset, sortingOrder, sortParameter} = {}) {
return getComments(client.baseURL, postID, {limit, offset, sortingOrder, sortParameter})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function fetchComments({ postId, limit, skip }) {\n try {\n const response = await axios({\n url: `${baseUrl}/?post=${postId}&limit=${limit}&skip=${skip}`,\n method: 'get',\n });\n\n // return list of comments\n return response.data;\n } catch (e) {\n console.log(... | [
"0.7077546",
"0.66471404",
"0.65300536",
"0.64686877",
"0.6392037",
"0.6290567",
"0.62839127",
"0.62680817",
"0.617915",
"0.612581",
"0.59607923",
"0.59027",
"0.59020984",
"0.58839536",
"0.58093077",
"0.5802731",
"0.5733084",
"0.5721762",
"0.5719479",
"0.5717262",
"0.5716622"... | 0.704141 | 1 |
Get all replies of a comment according the specified pagination. | async getReplies(commentID, postID, {limit, offset, sortingOrder, sortParameter} = {}) {
return getReplies(client.baseURL, commentID, postID, {limit, offset, sortingOrder, sortParameter})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getReplies () {\n\t\tconst postId = this.codeError.get('postId');\n\t\tif (!postId) {\n\t\t\t\tthrow this.errorHandler.error('notFound', { info: 'postId' });\n\t\t}\n\n\t\t// TODO this should be paginated\n\t\tconst posts = await this.data.posts.getByQuery(\n\t\t\t\t{\n\t\t\t\t\t\tteamId: this.codeError.get(... | [
"0.5763749",
"0.568998",
"0.56565166",
"0.5541725",
"0.55071497",
"0.5496816",
"0.5470384",
"0.5444113",
"0.542526",
"0.5401",
"0.5396154",
"0.53748435",
"0.5330224",
"0.5302518",
"0.52748066",
"0.525975",
"0.52134323",
"0.52128935",
"0.5181486",
"0.51324517",
"0.5112799",
... | 0.66092914 | 0 |
register costume danmaku type | registerDanmakuType(name, type) {
this.nameToType.set(name, type)
this.danmakuPools.set(type, new Set())
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"registerChoroplethType(name, classdef) {\n if (!ChoroplethProtocol.hasImpl(classdef)) {\n alert('Choropleth plugin must implement the ChoroplethProtocol! ' + name);\n return;\n }\n if (!PluginFactory._choroplethTypeMap.has(name)){\n PluginFactory._choroplethTyp... | [
"0.554436",
"0.55137867",
"0.5454363",
"0.5454363",
"0.542705",
"0.54209656",
"0.53585005",
"0.5290668",
"0.5279922",
"0.5267852",
"0.5196806",
"0.51825327",
"0.51669836",
"0.51278234",
"0.50995845",
"0.50731564",
"0.50665873",
"0.5063819",
"0.5063793",
"0.5061489",
"0.505702... | 0.7418946 | 0 |
remove danmaku from danmakuPool | withdraw(danmaku) {
return this.danmakuPools.get(danmaku.type).delete(danmaku)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function destroy(done){\n return del(config.prod,{ force: true });\n}",
"function deregister() { // 2252\n var index = instances.indexOf(instance); ... | [
"0.57509106",
"0.571746",
"0.5639071",
"0.5560174",
"0.54916",
"0.5491112",
"0.5491112",
"0.5488761",
"0.54845256",
"0.54845256",
"0.54845256",
"0.54845256",
"0.54845256",
"0.54845256",
"0.54845256",
"0.5461248",
"0.54095346",
"0.5398677",
"0.53593653",
"0.53382283",
"0.53191... | 0.69501096 | 0 |
get limit to the new added danmaku | _getLimit(danmaku, ...args) {
let limitList = []
for (let existedDanmaku of this.danmakuPools.get(danmaku.type)) {
limitList.push(existedDanmaku._getLimit(...args))
}
return limitList
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get limit() {}",
"set limit(value) {}",
"limit(limit) {\n const uri = URI('').addQuery('limit', limit);\n return new LimitListRequest(merge({}, this.options, { path: uri.toString() }), this.context);\n }",
"limit(limit) {\n this.limitNumber = limit;\n return this;\n }",
"function ch... | [
"0.72416705",
"0.6840976",
"0.6379678",
"0.6135789",
"0.6119842",
"0.60678446",
"0.60602695",
"0.6016109",
"0.598555",
"0.59710115",
"0.59710115",
"0.59613454",
"0.588822",
"0.5830084",
"0.5824034",
"0.5819593",
"0.5814457",
"0.57991993",
"0.57819295",
"0.5774675",
"0.5766052... | 0.6908406 | 1 |
Change the position of the Y2 and refresh the canvas | function animateY2() {
// Calculate the new value of Y2
function getNewY2() {
var newY2 = y2 + y2v; // Calculate the new value of Y2 based on the current velocity
if ((newY2 < 0) || (newY2 >= c.height)) { // If the new value exceeds the canvas:
y2v = -y2v; // Invert the velocity
newY2 = y2 + y2v; // Discar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setOriginY(neworiginY) { this.originY = neworiginY; }",
"function increaseXY() {\n resetAnimation();\n brd1.update();\n AD2.point1.moveTo([3.0, 10.5], 1000);\n AD2.point2.moveTo([10.5, 3.0], 1000);\n brd1.update();\n }",
"function getNewY2() {\n\t\tvar newY2 = y2 + y2v; //... | [
"0.7230009",
"0.68826765",
"0.6849223",
"0.682887",
"0.6651237",
"0.665029",
"0.6647752",
"0.6637339",
"0.66211796",
"0.66058594",
"0.6454678",
"0.6332152",
"0.6299764",
"0.6265759",
"0.62388045",
"0.62372434",
"0.6212332",
"0.62021893",
"0.6199286",
"0.6191299",
"0.6191153",... | 0.7347841 | 0 |
Calculate the new value of Y2 | function getNewY2() {
var newY2 = y2 + y2v; // Calculate the new value of Y2 based on the current velocity
if ((newY2 < 0) || (newY2 >= c.height)) { // If the new value exceeds the canvas:
y2v = -y2v; // Invert the velocity
newY2 = y2 + y2v; // Discard the previous result and recalculate the position
}
hu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animateY2() {\n\t// Calculate the new value of Y2 \n\tfunction getNewY2() {\n\t\tvar newY2 = y2 + y2v; // Calculate the new value of Y2 based on the current velocity\n\t\tif ((newY2 < 0) || (newY2 >= c.height)) { // If the new value exceeds the canvas:\n\t\t\ty2v = -y2v; // Invert the velocity\n\t\t\tnewY... | [
"0.7248391",
"0.6694698",
"0.66409296",
"0.63178056",
"0.620686",
"0.609398",
"0.6054285",
"0.60289633",
"0.6017951",
"0.6016879",
"0.6013646",
"0.59766656",
"0.5951849",
"0.5941784",
"0.59337246",
"0.5914988",
"0.58646894",
"0.5861899",
"0.5853516",
"0.5794809",
"0.5744332",... | 0.76539445 | 0 |
Event handler for onmousedown | function onMouseDown(event) {
mouseDown = true;
lastEvent = event;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onMouseDown(event) { }",
"function onMouseDown(event) {\n\tevent.preventDefault();\n\tvar array = getMousePosition(container, event.clientX, event.clientY);\n\tonDownPosition.fromArray(array);\n\tcontainer.addEventListener('mouseup', onMouseUp, false);\n}",
"function mouseDown(e)\r\n{\r\n isMouseDo... | [
"0.8554334",
"0.7437713",
"0.73641527",
"0.7275293",
"0.7253842",
"0.72336274",
"0.72233677",
"0.7177912",
"0.7155719",
"0.71539825",
"0.71376574",
"0.7124568",
"0.71211517",
"0.71125746",
"0.7094764",
"0.7092225",
"0.7084383",
"0.7076774",
"0.7075299",
"0.70579153",
"0.70535... | 0.7951996 | 1 |
Integer of guesses made [Set cap equals to five] endregion GLOBAL VARIABLES region FUNCTIONS Generate buttons for every char in alphabetArr. Destination row 64 | function generateButtons() {
let buttons = alphabetArr.map(letter => `
<li><button name="keyboard" class="eightbit-btn" type="button"
id="${letter}" onclick="checkGuess('${letter}')">${letter}</button></li>`).join('');
document.getElementById('letterButtons').innerHTML = buttons;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateButtons() {\n return \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\").map(letter => (\n <button\n // Represent the buttons as large with 2px space\n class=\"btn btn-lg btn-dark m-2\"\n key={letter}\n value={letter}\n // Call function to handle the guess to add to set of... | [
"0.7489327",
"0.728598",
"0.7240737",
"0.71344537",
"0.70948523",
"0.7092579",
"0.70807564",
"0.7080098",
"0.69573647",
"0.69067216",
"0.6902401",
"0.6815657",
"0.6801597",
"0.67511296",
"0.67205703",
"0.6698205",
"0.66838425",
"0.66511184",
"0.66508406",
"0.6597081",
"0.6534... | 0.75690967 | 0 |
fetch last seen for the receiver from the server | function getLastSeenFeed(){
try{clearTimeout(timer)} // reset timer
catch(err){}
sender = document.querySelector('.my-account').childNodes[1].innerHTML;
receiver = document.querySelector('.active-contact').childNodes[1].innerHTML;
timer = setTimeout(() => { // start new one based on arg
sock... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getLastSeen(pos) {\n const msg = this.data.contacts[pos].messages;\n const receivedMsg = msg.filter((message) => message.status === 'received');\n let lastMessages = (receivedMsg.length > 1) ? receivedMsg[receivedMsg.length - 1] : receivedMsg[0];\n if (typeof (lastMessages) == 'undefined') {\n ... | [
"0.6897756",
"0.65289384",
"0.62912804",
"0.61096466",
"0.60062975",
"0.59508985",
"0.5753398",
"0.5751756",
"0.56617194",
"0.56605667",
"0.5659633",
"0.5643565",
"0.5636902",
"0.56263816",
"0.56014514",
"0.55794007",
"0.55459243",
"0.55398494",
"0.55389214",
"0.5474798",
"0.... | 0.77236134 | 0 |
takes screenshot, and names the SS as num of files in the folder | function take_screenshot(){
var dir = './test';
var tosave="/test/"
var basepath="./currdir" //add current dir here
var path=basepath+tosave
fs.readdir(dir, (err, files) => { //getting num of files in folder to name SS
//console.log(files.length);
var i=files.length;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function copyScreenShots() {\n var desktop = fs.readdirSync(DESKTOP_PATH);\n lastNumber = calculateLastNumber();\n desktop.forEach(function (file) {\n if (file.indexOf(\".png\") >= 0) {\n console.log(\"COPYING SCREEN SHOT\");\n fs.renameSync(DESKTOP_PATH + file, IMAGES_PATH + ... | [
"0.6625343",
"0.5992971",
"0.5892137",
"0.5862027",
"0.585853",
"0.57996416",
"0.5669959",
"0.5590662",
"0.5525285",
"0.5473657",
"0.5464379",
"0.5425655",
"0.54096013",
"0.5371266",
"0.5362962",
"0.5358522",
"0.5341156",
"0.53147215",
"0.5302385",
"0.5297127",
"0.5295175",
... | 0.70137113 | 0 |
App start up synchronized using await with the config API call | async function appStartup() {
// Take local defaults from .env.development or .env.development.local
// Or fall back to internal defaults
let API_ENDPOINT = process.env.VUE_APP_API_ENDPOINT || '/'
let AUTH_CLIENT_ID = process.env.VUE_APP_AUTH_CLIENT_ID || ''
// Load config at runtime from special `/config` e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function init() {\n await sessionStore.sync();\n await db.sync();\n await generateApp();\n await appListen();\n}",
"async function initialize() {\n process.on('uncaughtException', criticalErrorHandler.processUncaughtExceptionHandler.bind(criticalErrorHandler));\n global.willAppQuit = false;\n\n ... | [
"0.73105943",
"0.72417563",
"0.7029934",
"0.7003597",
"0.6856425",
"0.67518663",
"0.66972744",
"0.6598676",
"0.65747833",
"0.65194774",
"0.64850605",
"0.64710987",
"0.6454185",
"0.64538634",
"0.6433218",
"0.64298576",
"0.6423467",
"0.640783",
"0.64018637",
"0.63999486",
"0.63... | 0.75273675 | 0 |
Updates state variable for word count. Also required info for WPM. | wordCount(string) {
let newState = this.state;
newState.wordCount = string.length > 0 ? string.split(' ').length : 0;
this.setState(newState);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateWordCount() {\n let count = contentEditor.getWordCount();\n $('#word-count').prop('hidden', !wordCount);\n $('.word-count-none').prop('hidden', count > 0);\n $('.word-count-one').prop('hidden', count !== 1);\n $('.word-count-many').prop('hidden', count <= 1);\n $('.word-count').tex... | [
"0.73300564",
"0.66565955",
"0.627442",
"0.6241688",
"0.61582565",
"0.61037487",
"0.60685724",
"0.596964",
"0.596964",
"0.5958063",
"0.59232163",
"0.5881788",
"0.5862625",
"0.5852855",
"0.5849984",
"0.5823092",
"0.58219796",
"0.5788889",
"0.576851",
"0.57576627",
"0.57552135"... | 0.68511254 | 1 |
Uses faker api to generate multiple sentences for user to try and type | generateChallenge() {
let challenge = faker.hacker.phrase();
for (let i = 0; i < 5; i++) {
challenge += ` ${faker.hacker.phrase()}`;
}
return challenge;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"randomizeWord() {\n \n const sentences= [\n 'Cameroun',\n 'so fat I swerved to miss her and ran out of gas',\n 'Juridiction',\n 'Cameroon',\n 'so fat she don need no internet shes already world wide',\n 'so hair her armpits look like Don King in a headlock',\n 'victoire... | [
"0.6593559",
"0.65817195",
"0.6483904",
"0.64502627",
"0.63846314",
"0.6344494",
"0.6319088",
"0.6267811",
"0.6233368",
"0.6223075",
"0.61849064",
"0.61817855",
"0.6140228",
"0.6138719",
"0.61354226",
"0.61190873",
"0.6113197",
"0.6104914",
"0.60831356",
"0.6063338",
"0.60590... | 0.6648341 | 0 |
Given the positions of a white bishop and a black pawn on the standard chess board, determine whether the bishop can capture the pawn in one move. This bishop has no restrictions in distance for each move, but is limited to diagonal movement. Ex: For bishop = 'a1' and pawn = 'c3', bishopAndPawn(bishop, pawn) = true. o ... | function bishopAndPawn(bishop, pawn) {
const board = {
a: 1,
b: 2,
c: 3,
d: 4,
e: 5,
f: 6,
g: 7,
h: 8,
};
const bishopX = board[bishop.charAt(0)];
const bishopY = Number(bishop.charAt(1));
const pawnX = board[pawn.charAt(0)];
const pawnY = Number(pawn.charAt(1));
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bishopAndPawn(bishop, pawn) {\n function subNum(num) {\n var alphabet = ['a','b','c','d','e','f','g','h'];\n\n return parseInt(alphabet.indexOf(num.split('')[0])+1) >= parseInt(num.split('')[1]) ? parseInt(alphabet.indexOf(num.split('')[0])+1)-parseInt(num.split('')[1]) : parseInt(num.split('... | [
"0.786736",
"0.7289368",
"0.65087867",
"0.63513696",
"0.63097286",
"0.62816435",
"0.61636305",
"0.6022548",
"0.5982278",
"0.594926",
"0.5944432",
"0.59318745",
"0.5871544",
"0.5866098",
"0.5863958",
"0.5849856",
"0.58393896",
"0.58375573",
"0.58213246",
"0.58107215",
"0.57970... | 0.8309937 | 0 |
Returns a reference URL to the resource. Used for linking in Permissions. | get url() {
return createPermissionUri(this.user.database.id, this.user.id, this.id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get url()/*:string*/ {\n return this.link.absoluteTarget\n }",
"function SafeResourceUrl() { }",
"function SafeResourceUrl() { }",
"function SafeResourceUrl() { }",
"function SafeResourceUrl() { }",
"function SafeResourceUrl() { }",
"function SafeResourceUrl() { }",
"getLinkURI() {\n try {... | [
"0.6441299",
"0.63683796",
"0.63683796",
"0.63683796",
"0.63683796",
"0.63683796",
"0.63683796",
"0.6354057",
"0.62883526",
"0.62883526",
"0.62883526",
"0.6257338",
"0.61813086",
"0.6166733",
"0.6086205",
"0.6036097",
"0.60100526",
"0.60100526",
"0.6001955",
"0.5990876",
"0.5... | 0.681352 | 0 |
if the (auxiliary or structural) variable x[j] is fixed, the pattern of its column is empty | function doit(typx){
if (typx != LPX_FX)
{ if (j <= m)
{ /* x[j] is non-fixed auxiliary variable */
ndx[++len] = j;
}
else
{ /* x[j] is non-fixed structural variables */
len = lpx_g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isFull() {\n for(var column of this.cells) {\n if(!column[0].filled) {\n return false;\n }\n }\n return true;\n }",
"function isEmpty(x, y) {\n return grid[y][x] === \"_\";\n }",
"function findSpotForCol(x) {\n // TODO: write the real version of... | [
"0.5677972",
"0.5673004",
"0.5629109",
"0.5529528",
"0.5464349",
"0.54213786",
"0.53636533",
"0.5339706",
"0.53315735",
"0.5330781",
"0.53243524",
"0.53061956",
"0.5250879",
"0.5250447",
"0.52116114",
"0.5209763",
"0.51620585",
"0.5151395",
"0.51330066",
"0.51312834",
"0.5120... | 0.6003466 | 0 |
The routine check_error computes the maximal relative error between left and righthand sides for the system B x = b (if tr is zero) or B' x = b (if tr is nonzero), where B' is a matrix transposed to B. (This routine is intended for debugging only.) | function check_error(lpf, tr, x, b){
var m = lpf.m;
var B = lpf.B;
var i, j;
var d, dmax = 0.0, s, t, tmax;
for (i = 1; i <= m; i++)
{ s = 0.0;
tmax = 1.0;
for (j = 1; j <= m; j++)
{ if (!tr)
t = B[m * (i - 1) + j] * x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkBorder(b) {\n const r = this._size / 2;\n if (this.position.x < b.minx + r || this.position.x > b.maxx - r) {\n this.boostDirection.x *= -1; // Reflect left-right\n this.position.x = Math.max(this.position.x, b.minx + r);\n this.position.x = Math.min(this.positio... | [
"0.5136006",
"0.50158983",
"0.49547082",
"0.4914212",
"0.48903647",
"0.4840704",
"0.48216262",
"0.48180366",
"0.4798681",
"0.47711268",
"0.47554207",
"0.4748724",
"0.47151616",
"0.4692561",
"0.46810928",
"0.46679497",
"0.465542",
"0.46300814",
"0.4624141",
"0.46230376",
"0.46... | 0.73906684 | 0 |
err_in_cbar compute maximal relative error in dual solution This routine returns maximal relative error: max |cost[j] cbar[j]| / (1 + |cost[j]|), where cost and cbar are, respectively, directly computed and the current (updated) reduced costs of nonbasic nonfixed variables. NOTE: The routine is intended only for debugg... | function err_in_cbar(csa){
var m = csa.m;
var n = csa.n;
var stat = csa.stat;
var cbar = csa.cbar;
var j;
var e, emax, cost;
var pi = new Float64Array(1+m);
eval_pi(csa, pi);
emax = 0.0;
for (j = 1; j <= n; j++)
{ if (stat[j] == GL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cobylb(calcfc, n, m, mpp, x, rhobeg, rhoend, iprint, maxfun)\n // calcf ist funktion die aufgerufen wird wie calcfc(n, m, ix, ocon)\n {\n // N.B. Arguments CON, SIM, SIMI, DATMAT, A, VSIG, VETA, SIGBAR, DX, W &\n // IACT\n // have been removed.\n\n // Set the initial values of some ... | [
"0.53787136",
"0.49987912",
"0.47482842",
"0.47197646",
"0.468765",
"0.461337",
"0.46013796",
"0.458965",
"0.45048457",
"0.44897166",
"0.4486003",
"0.44794595",
"0.4459093",
"0.44479552",
"0.44476706",
"0.4424318",
"0.43990955",
"0.43795776",
"0.43672773",
"0.43366942",
"0.43... | 0.7031672 | 0 |
4.0 renderMainCard(dog) (takes an object and creates html) | function renderMaincard(dog) {
console.log("Inside renderMainCard: ", dog);
mainSectionEl.innerHTML = "";
const headingEl = document.createElement("h2");
headingEl.innerText = dog.name;
mainSectionEl.append(headingEl);
const imageEl = document.createElement("img");
imageEl.setAttribute("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderDogDetails(dog) {\n dogInfo.innerHTML = `\n <img src=${dog.image}>\n <h2>${dog.name}</h2>\n <button class=\"good-or-bad\"></button>\n `;\n // set inital depending on status:\n dogbutt = dogInfo.querySelector(\"button\");\n if (dog.isGoodDog == true) {\n dogbutt.innerText = \"Good ... | [
"0.6915785",
"0.68505347",
"0.6835819",
"0.68082005",
"0.6806524",
"0.6732337",
"0.67109233",
"0.6693725",
"0.6689457",
"0.66628885",
"0.6633136",
"0.6631811",
"0.66233444",
"0.6609462",
"0.6485862",
"0.6456437",
"0.6438972",
"0.642555",
"0.6388625",
"0.63572645",
"0.6354394"... | 0.83773065 | 0 |
function for finding the average color | function averageColor(row, column) {
var blockSize = 1, // we can set how many pixels to skip
data, width, height,
i = -4,
length,
rgb = {
r: 0,
g: 0,
b: 0
},
count = 0; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRGB(avg){\r\n\tif (Math.abs(avg) > 1){\r\n\t\tvar v = 1 - ((parseFloat(Math.abs(avg))/3)*0.35)\r\n\t\tvar s = 1\r\n\t\tvar colors = HSVtoRGB((parseFloat(avg) >= 0 ? 0.0389 : 0.58), s, v)\r\n\t\treturn 'rgb(' + colors.r + ',' + colors.g + ', ' + colors.b + ')'\r\n\t} else {\r\n\t\tvar v = 0.7 + (parseFl... | [
"0.70874554",
"0.70874554",
"0.68371695",
"0.68371695",
"0.669804",
"0.65797305",
"0.6350117",
"0.630235",
"0.6268548",
"0.6244064",
"0.61959475",
"0.61613303",
"0.6146224",
"0.6119638",
"0.60910803",
"0.60848504",
"0.6084559",
"0.6050298",
"0.60428333",
"0.603494",
"0.603082... | 0.7257333 | 0 |
Implements a fallback function based on window.setTimeout() for use / in cases where window.requestAnimationFrame() is not available. | function setTimeoutFallback(callback, element)
{
return window.setTimeout(callback, constants.FRAME_REQUEST_RATE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function defaultSetTimout(){throw new Error('setTimeout has not been defined');}",
"function fallback(/* function */ callback, /* DOMElement */ element){\r\n window.setTimeout(callback, 1000 / 60);\r\n }",
"function timeoutShim(callback) {\n window.setTimeout(callback, 1000/(storm.animationInter... | [
"0.6772586",
"0.6636221",
"0.65274733",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6526448",
"0.6521164",
"0.65157914",
"0.64378315",
"0.6433595",
"0.6358898",
"0.6358898",
... | 0.7926704 | 0 |
Return data used for the display of edges in the network | getDisplayEdges(){
let dsplLayers = this.getLayersInOrder();
// no edges if there is only a single layer
if (dsplLayers.length < 2)
return [];
// node positions are relative to their own origin, thus they need to be
// shifted according to the layer's order in the final display
let shifts = [ 0 ];
dsp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function edgeFormat() {\n var edges = {\n \"labelTitle\": null,\n \"valueTitle\": getTypeLabels().concat(\n [\"Qt_Items\", \"English\", \"Portuguese\", \"Spanish\", \"German\", \"French\",\n \"Research N.I.\", \"Tolerancia a falhas\", \"Inteligencia Artificial\", \"Modelagem ... | [
"0.672233",
"0.64817387",
"0.6300514",
"0.6287843",
"0.61622936",
"0.6152575",
"0.60173607",
"0.5904633",
"0.5903021",
"0.59028465",
"0.5866513",
"0.5863858",
"0.58144885",
"0.5802579",
"0.5791832",
"0.5785053",
"0.5781317",
"0.5760863",
"0.56957155",
"0.56772006",
"0.5656068... | 0.7198299 | 0 |
Return data used for the display of layers' background | getDisplayLayers(width, height){
let data = [];
let shift = 0;
this.getLayersInOrder().forEach(dl => {
if (this.displayedLayers.get(dl).display){
let layer = this.layers.get(dl);
if (layer.dims === undefined) this.initLayerNodesPositions(dl,width,height);
data.push({
color: layer.color,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getRgbData() {\n let rgb = document.createElement(\"strong\");\n rgb.innerHTML = \"RGB Code: \";\n this.DATA.appendChild(rgb);\n const RGB_DIV = document.createElement(\"div\");\n RGB_DIV.innerHTML = this.CANVAS.style.backgroundColor;\n this.DATA.appendChild(RGB_DIV);\n\t}",
"getPaletteData() {... | [
"0.6465839",
"0.622787",
"0.6202669",
"0.6060098",
"0.601438",
"0.6014349",
"0.5989319",
"0.5881273",
"0.5869642",
"0.5846811",
"0.5800325",
"0.57615817",
"0.5749463",
"0.57402164",
"0.5735962",
"0.57094896",
"0.5703423",
"0.5703423",
"0.5697238",
"0.56590366",
"0.5654542",
... | 0.62457913 | 1 |
This sample demonstrates how to Gets a list of compute operations. | async function operationsListMaximumSetGen() {
const credential = new DefaultAzureCredential();
const client = createComputeManagementClient(credential);
const options = {
queryParameters: { "api-version": "2022-08-01" },
};
const initialResponse = await client.path("/providers/Microsoft.Compute/operation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function operationsListMinimumSetGen() {\n const credential = new DefaultAzureCredential();\n const client = createComputeManagementClient(credential);\n const options = {\n queryParameters: { \"api-version\": \"2022-08-01\" },\n };\n const initialResponse = await client.path(\"/providers/Microsoft.C... | [
"0.69424444",
"0.65274525",
"0.60591286",
"0.58474606",
"0.57536495",
"0.5700698",
"0.5695821",
"0.5680702",
"0.56242347",
"0.55490816",
"0.55419755",
"0.5539836",
"0.5539836",
"0.5539836",
"0.5539836",
"0.5539836",
"0.5539836",
"0.5539836",
"0.5539836",
"0.55184937",
"0.5502... | 0.6844956 | 1 |
This sample demonstrates how to Gets a list of compute operations. | async function operationsListMinimumSetGen() {
const credential = new DefaultAzureCredential();
const client = createComputeManagementClient(credential);
const options = {
queryParameters: { "api-version": "2022-08-01" },
};
const initialResponse = await client.path("/providers/Microsoft.Compute/operation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function operationsListMaximumSetGen() {\n const credential = new DefaultAzureCredential();\n const client = createComputeManagementClient(credential);\n const options = {\n queryParameters: { \"api-version\": \"2022-08-01\" },\n };\n const initialResponse = await client.path(\"/providers/Microsoft.C... | [
"0.68438274",
"0.6524601",
"0.60563475",
"0.5845185",
"0.5751564",
"0.569892",
"0.56939656",
"0.5678786",
"0.5623453",
"0.55472547",
"0.5539746",
"0.5538099",
"0.5538099",
"0.5538099",
"0.5538099",
"0.5538099",
"0.5538099",
"0.5538099",
"0.5538099",
"0.5516503",
"0.55025804",... | 0.69412833 | 0 |
A propertyvalue map of changed properties for which no write request has been sent so far. null while no changes are pending. / public | function getChangedProperties()/*:Object*/ {
return this.changedProperties$s7K2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {});\n }",
"function clearChangedProperties()/*:void*/ {\n this.changedProperties$s7K2 = null;\n }",
"_flushProperties() {\n if (this.__dataPending && this.__dataOld) {\n let changedProps = this.__dataPending;\... | [
"0.6128104",
"0.6047396",
"0.60081184",
"0.5991125",
"0.59637505",
"0.59637505",
"0.5948707",
"0.59103566",
"0.5907829",
"0.5907829",
"0.5849683",
"0.57946104",
"0.578879",
"0.5786328",
"0.57641864",
"0.57529473",
"0.57529473",
"0.57529473",
"0.57529473",
"0.57529473",
"0.571... | 0.6729579 | 0 |
Remove all property changes associated with this entry. / public | function clearChangedProperties()/*:void*/ {
this.changedProperties$s7K2 = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearChanges() {\n this._changes = {};\n\n for (let propName of this._changedTrackedDataProperties()) {\n this.get(propName).clearChanges();\n }\n }",
"clearChanges() {\n const\n me = this,\n { changes } = me;\n\n me.remove(me.added.values, true);\n ... | [
"0.7461801",
"0.7105998",
"0.7030683",
"0.6942616",
"0.6789121",
"0.6416393",
"0.6379293",
"0.63018566",
"0.62799454",
"0.62799454",
"0.62239975",
"0.61670476",
"0.6154843",
"0.60854626",
"0.60608816",
"0.6026203",
"0.60136795",
"0.6000939",
"0.59980524",
"0.59829175",
"0.596... | 0.7715523 | 0 |
Add a single changed property to the map of changed properties. | function setProperty(propertyName/*:String*/, value/*:Object*/)/*:void*/ {
if (!this.changedProperties$s7K2) {
this.changedProperties$s7K2 = {};
}
var merged/*:Boolean*/ = this.tryToMergeProperty$s7K2(propertyName, value);
if (merged) {
return;
}
this.removeObsoleteCurrentProperti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {});\n }",
"updated(_changedProperties) {}",
"updated(_changedProperties) {}",
"function updatePropertyOnAttributeChanged(propertyName, propertyEntry, attribute, prev, value)\n {\n const propertyType = getTypeFunct... | [
"0.6387665",
"0.60146475",
"0.60146475",
"0.5972907",
"0.5961902",
"0.5929092",
"0.5929092",
"0.5929092",
"0.5929092",
"0.5929092",
"0.58524233",
"0.58360505",
"0.5822808",
"0.58164763",
"0.5802359",
"0.5802359",
"0.5802359",
"0.57775015",
"0.5760269",
"0.57576",
"0.57538307"... | 0.6073207 | 1 |
If the given propertyName (actually a serialized property path) starts with one of the current property names, then the given value can be merged into the object structure of the already existing property value. | function tryToMergeProperty(propertyName/*:String*/, value/*:Object*/)/*:Boolean*/ {
// Try to find a subsuming property name among the current property names.
var subsumingPropName/*:String*/;
for (var propName/*:String*/ in this.changedProperties$s7K2) {
if (com.coremedia.ui.data.impl.PropertyPathUt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setProperty(propertyName/*:String*/, value/*:Object*/)/*:void*/ {\n if (!this.changedProperties$s7K2) {\n this.changedProperties$s7K2 = {};\n }\n\n var merged/*:Boolean*/ = this.tryToMergeProperty$s7K2(propertyName, value);\n\n if (merged) {\n return;\n }\n\n this.removeObsolet... | [
"0.5480488",
"0.52836484",
"0.507411",
"0.5068901",
"0.5065187",
"0.5019119",
"0.5008995",
"0.49841172",
"0.49508342",
"0.4934389",
"0.48897415",
"0.48897415",
"0.48877338",
"0.48583737",
"0.47795194",
"0.4746137",
"0.47417048",
"0.4733308",
"0.4732254",
"0.46492362",
"0.4641... | 0.7307657 | 0 |
All current properties whose names (property paths) start with the given property name (path) are now obsolete as their values are subsumed by the new property value. | function removeObsoleteCurrentProperties(propertyName/*:String*/)/*:void*/ {var this$=this;
var currentPropertyNames/*:Array*/ = [];
for (var propName/*:String*/ in this.changedProperties$s7K2) {
currentPropertyNames.push(propName);
}
currentPropertyNames.forEach(function (propName/*:String*/)/*:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {});\n }",
"function clearChangedProperties()/*:void*/ {\n this.changedProperties$s7K2 = null;\n }",
"_updateProperties () {\n // Build a list of new fields\n let fields = Object.keys(this)\n .filter(x => x[0] !... | [
"0.59464914",
"0.5852095",
"0.58107835",
"0.57089037",
"0.5686052",
"0.5658655",
"0.5639791",
"0.5630859",
"0.56208026",
"0.5599232",
"0.55821276",
"0.5566456",
"0.55390334",
"0.5503618",
"0.54815876",
"0.5466191",
"0.54320514",
"0.54215235",
"0.53788114",
"0.5366416",
"0.534... | 0.7804501 | 0 |
Picks up on if and when an input field changes, then sets the lastEdited flag to the input field that was changed. TEMPERATURE | function celsiusChanged() {
lastEditedTemp = CELSIUS_ID;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"update(){if(this.originalInputValue===''){this._reset();}}",
"function onBuildInputChange() {\n\n\tif (!changed)\n\t\tchanged = true;\n\n}",
"function RememberGearTempOnFocus() {\n\tevent.target.temp = event.target.value;\n}",
"inputChanged(){\r\n let mask = this.getRef('element'),\r\n newV... | [
"0.60517496",
"0.58794963",
"0.5871337",
"0.5775844",
"0.57066435",
"0.567267",
"0.5660765",
"0.56219137",
"0.5618728",
"0.5576637",
"0.55565095",
"0.55351776",
"0.5507209",
"0.54934645",
"0.5459444",
"0.5449366",
"0.5448083",
"0.5447106",
"0.54178315",
"0.54012346",
"0.53779... | 0.67076653 | 0 |
Method works because arrays are the same size and values are ordered in the same position as ids. example: attributeNumberValueArray([FAHRENHEIT_ID, KELVIN_ID], [conversionF, conversionK]); position 0 of valuesArray has the value for fahrenheit. | function attributeNumberValueArray(idsArray, valuesArray) {
for (i = 0; i < idsArray.length; i++) {
document.getElementById(idsArray[i]).value = valuesArray[i];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function values2Array(dat){\nreturn values(dat).map((v) => v.map((x) => x['value']));\n}",
"function dataToArray(values) {\n return $.map(values, function(value) {\n return [value];\n });\n }",
"function getValuesArray() {\n\t\tvar numbers_str = $(\"values\").value.... | [
"0.5822939",
"0.567181",
"0.55667645",
"0.54746085",
"0.5430231",
"0.5368668",
"0.5368668",
"0.53564453",
"0.5306992",
"0.526785",
"0.52013236",
"0.5169223",
"0.5151286",
"0.5128863",
"0.51137996",
"0.51068455",
"0.50978875",
"0.50899947",
"0.50691247",
"0.5059867",
"0.505986... | 0.6861491 | 0 |
Method to convert on keypress enter key | function functionEnter(e) {
if (e.keyCode === 13) convertf();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enterKeyPressed(event)\n{\n\t//13 = enter\n\treturn keyPressed(event, 13);\n}",
"_onEnter(event){\n switch (event.keyCode) {\n case KEYCODE.ENTER:\n this.send();\n break;\n default:\n break;\n }\... | [
"0.76690006",
"0.7154677",
"0.7035779",
"0.7018242",
"0.70096076",
"0.6943384",
"0.69082123",
"0.68607885",
"0.6856734",
"0.6843229",
"0.6838291",
"0.6807218",
"0.677613",
"0.6763025",
"0.6753563",
"0.6724308",
"0.6701517",
"0.6692368",
"0.6691441",
"0.6688585",
"0.66855896",... | 0.7529663 | 1 |
Intermediate constructor to instantiate children prototype without executing Parent constructor code | function ParentEmptyCtor() { } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function C() { this.constructor = child; }",
"function Constructor() {\n this.constructor = child;\n }",
"function Child() {}",
"function Parent() {}",
"function ParentConstructorFirst() {\n\t// Extend this.__defaults from a __defaults of a constructor's prototype, because this.__defaults... | [
"0.7086303",
"0.6921501",
"0.6776353",
"0.6716662",
"0.67081",
"0.66212404",
"0.64374584",
"0.6437122",
"0.6332232",
"0.63131934",
"0.6296402",
"0.625098",
"0.625098",
"0.613299",
"0.612907",
"0.6115793",
"0.61090606",
"0.60672957",
"0.6049183",
"0.6040329",
"0.6023713",
"0... | 0.73167926 | 0 |
Here we have the routes: index : return all trucks searchManualRoute : show all trucks within search radius. createRoute : Make one new truck showRoute : show details of one truck updateRoute : update details of one truck deleteRout : delete one truck | function indexRoute(req, res, next) {
Truck
.find()
.exec()
.then((trucks) => res.json(trucks))
.catch(next);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createWeatherStationRoute(model){\n //GET'/WeatherStation' \n router.route('/WoT/WeatherStation').get(function(req, res, next){\n req.model = model;\n req.type = 'root'; //nombre del html en la carpeta view\n req.uri = 'WeatherStation';\n\n //var fields = ['id','name','description','tags','c... | [
"0.6295421",
"0.60374177",
"0.60346645",
"0.60240626",
"0.59703636",
"0.592532",
"0.59169",
"0.58989155",
"0.58403385",
"0.5820654",
"0.58153147",
"0.578101",
"0.57735986",
"0.57452595",
"0.5743436",
"0.5704451",
"0.5702158",
"0.5682099",
"0.5663154",
"0.5658577",
"0.56478846... | 0.60717124 | 1 |
enemyST.x = (enemyST.width 2) | function enemy(){
this.width = enemyST.width
this.height = enemyST.height
this.x = enemyST.x
this.y = enemyST.y
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetEnemy() {\r\n this.y = -30;\r\n if(this.position == 1){\r\n this.x = 75;\r\n }else{\r\n this.x = config.width-175;\r\n }\r\n }",
"function set_enemy_position(scrx, scry){\n var ex = xScreenToWord(scrx);\n var ey = yScreenToWord(scry);\n var d = M... | [
"0.6993552",
"0.6966197",
"0.67912173",
"0.67429805",
"0.65245295",
"0.64905924",
"0.6446306",
"0.63783324",
"0.6352537",
"0.6341921",
"0.6262286",
"0.6256314",
"0.62496257",
"0.62492585",
"0.6234485",
"0.6223979",
"0.6219657",
"0.6213127",
"0.6181245",
"0.6137581",
"0.613145... | 0.7522262 | 0 |
Crafts response message on Platform Failure. | function craft_error_response()
{
// Add here to be returned literal
var errorMsg = 'RAPP Platform Failure';
var response = {payload: '', basename: '', encoding: '', error: errorMsg};
var logMsg = 'Return to client with error --> ' + errorMsg;
postMessage( craft_slaveMaster_msg('log', logMsg) );
return res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function craft_error_respose()\n{\n var response = {\n services: [],\n error: 'RAPP Platform Failure'\n };\n\n return response;\n}",
"function gameFailure(data) {\n let err = data\n if (data.responseJSON && data.responseJSON.error) {\n err = data.responseJSON.error\n }\n $(\".erro... | [
"0.6908122",
"0.62534577",
"0.6176833",
"0.6151085",
"0.6141121",
"0.6111963",
"0.61016893",
"0.6078368",
"0.60750043",
"0.6024935",
"0.6005835",
"0.6001968",
"0.5998912",
"0.5998912",
"0.5984067",
"0.59817517",
"0.5978857",
"0.59761775",
"0.5962644",
"0.5939711",
"0.5930632"... | 0.7362301 | 0 |
Returns masterprocess comm msg literal. | function craft_slaveMaster_msg(msgId, msg)
{
var _msg = {
name: __hopServiceName,
id: __hopServiceId,
msgId: msgId,
data: msg
};
return _msg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"on_master_msg(msg) {\n this.cur_msg = msg;\n this.inner_emitter.emit(msg.type + \" \" + msg.cmd, msg);\n }",
"function NewMsg(command, data) {\n return JSON.stringify({ \"c\": command,\"d\":data});\n }",
"function mtos( msg ) { return Gun.text.ify( msg ); } // message-to-string",
"... | [
"0.577402",
"0.5467963",
"0.5395479",
"0.5280398",
"0.5277899",
"0.52668536",
"0.52316916",
"0.51610816",
"0.51559633",
"0.51529497",
"0.5139037",
"0.51253253",
"0.510322",
"0.5086331",
"0.5046318",
"0.5008549",
"0.49505007",
"0.49402452",
"0.49402452",
"0.49038622",
"0.49038... | 0.6269732 | 1 |
True if this is an input and connected. | isConnectedInput() { return (this.type == 'input'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isUnconnectedInput() { return (this.type == 'unconnected_input'); }",
"isConnectable() {\n if (this.isInputOrOutput() && !(this.hasChildren() ||\n this.parent.isMinimized || this.parentComponent.isMinimized)) return true;\n\n return this.isMinimized;\n }",
"is_connected() {\n ... | [
"0.7012533",
"0.69319713",
"0.69205046",
"0.67828053",
"0.6468864",
"0.635782",
"0.63288975",
"0.62918895",
"0.62166643",
"0.6136464",
"0.6115525",
"0.6051074",
"0.60383296",
"0.60383296",
"0.60383296",
"0.60383296",
"0.5978533",
"0.5960058",
"0.59599453",
"0.5941321",
"0.591... | 0.83326215 | 0 |
True if this an input and unconnected. | isUnconnectedInput() { return (this.type == 'unconnected_input'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isConnectedInput() { return (this.type == 'input'); }",
"isUndirectedCyclic(){\n // Mark all the vertices as not visited\n let visited =[]\n for(let i=0; i<this.num_nodes; i++){\n visited.push(false)\n }\n // Call the recursive helper function to detect cycle in diff... | [
"0.67957497",
"0.589931",
"0.56694114",
"0.5572407",
"0.5551174",
"0.5498767",
"0.54923105",
"0.54753536",
"0.5472064",
"0.54524696",
"0.54229665",
"0.5330942",
"0.53280544",
"0.52385813",
"0.52328813",
"0.52309763",
"0.5170795",
"0.51615876",
"0.512929",
"0.512355",
"0.51090... | 0.84196746 | 0 |
True if this is an input whose source is an autoivc'd output | isAutoIvcInput() { return (this.type == 'autoivc_input'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isOutput() { return (this.type == 'output'); }",
"isViableAutoSourceNode(node) {\n\t\treturn node.outputs &&\n\t\t\tnode.outputs.length > 0 &&\n\t\t\t!CanvasUtils.isSrcCardinalityAtMax(node.outputs[0].id, node, this.getLinks());\n\t}",
"isInputOrOutput() { return this.type.match(inputOrOutputRegex); }",
"isE... | [
"0.673028",
"0.6476536",
"0.6263552",
"0.61738396",
"0.5946318",
"0.591669",
"0.57445866",
"0.5636314",
"0.5496503",
"0.54843944",
"0.54531133",
"0.54111195",
"0.5282046",
"0.5187322",
"0.5159634",
"0.5115577",
"0.51115465",
"0.50822645",
"0.508074",
"0.50704753",
"0.50662565... | 0.6581927 | 1 |
True if this.type is 'output'. | isOutput() { return (this.type == 'output'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isInputOrOutput() { return this.type.match(inputOrOutputRegex); }",
"get outputType() {\n let t= this._output;\n if (!t) {\n t= this.getType(0);\n this._output=t;\n }\n return t;\n }",
"isImplicitOutput() { return (this.isOutput() && this.implicit); }",
"isExplicitOutput() { return (th... | [
"0.7574578",
"0.7189407",
"0.69688666",
"0.6807364",
"0.67128205",
"0.6648771",
"0.6359095",
"0.6359095",
"0.6359095",
"0.6359095",
"0.6359095",
"0.6359095",
"0.6359095",
"0.6346339",
"0.6153386",
"0.6108849",
"0.6095534",
"0.60825115",
"0.60729873",
"0.60729873",
"0.60532296... | 0.9180738 | 0 |
True if this is the root node in the model | isRoot() { return (this.type == 'root'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isRoot() {\n return !this.parent;\n }",
"isEmpty() {\n return this.root === null;\n }",
"isEmpty(){\n return this.root === null;\n }",
"isRoot(node) {\n return node.p === null\n }",
"isEmpty() {\n return this.root.key === null;\n }",
"IsRoot() {\n return thi... | [
"0.79612",
"0.7521827",
"0.74915856",
"0.7216361",
"0.7204905",
"0.7193389",
"0.69375145",
"0.692988",
"0.6866456",
"0.683871",
"0.6833172",
"0.68024564",
"0.67308486",
"0.6621873",
"0.6609774",
"0.65872735",
"0.65647626",
"0.6519011",
"0.64957285",
"0.6423845",
"0.6412092",
... | 0.813963 | 0 |
True if this is an output and it's not implicit | isExplicitOutput() { return (this.isOutput() && !this.implicit); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isImplicitOutput() { return (this.isOutput() && this.implicit); }",
"isOutput() { return (this.type == 'output'); }",
"isInputOrOutput() { return this.type.match(inputOrOutputRegex); }",
"hasOutput(token) {\n const code = token.value.trim().charCodeAt(0);\n return code === 0x24; // $\n }",
"doOutput... | [
"0.79378974",
"0.7912817",
"0.6590387",
"0.6487544",
"0.64482677",
"0.6424565",
"0.63523585",
"0.61550164",
"0.6098416",
"0.5963176",
"0.5951956",
"0.5830462",
"0.5830462",
"0.5830462",
"0.5830462",
"0.582933",
"0.5815533",
"0.58040136",
"0.5759825",
"0.56973726",
"0.5674393"... | 0.80391365 | 0 |
True if this is an output and it is implicit | isImplicitOutput() { return (this.isOutput() && this.implicit); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isExplicitOutput() { return (this.isOutput() && !this.implicit); }",
"isOutput() { return (this.type == 'output'); }",
"isInputOrOutput() { return this.type.match(inputOrOutputRegex); }",
"function isAnyOutputCompVariant(comp)\n {\n if (comp.comment == \"\") {\n // no tag grandfathered c... | [
"0.85187256",
"0.79736614",
"0.64355075",
"0.6320574",
"0.6107542",
"0.6016748",
"0.58970416",
"0.5890041",
"0.5857988",
"0.5833557",
"0.58289146",
"0.5806855",
"0.58058774",
"0.5773235",
"0.5743531",
"0.56857294",
"0.5617484",
"0.56033397",
"0.55653995",
"0.55287766",
"0.552... | 0.8583304 | 0 |
True is this.type is 'subsystem' | isSubsystem() { return (this.type == 'subsystem'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isComponent() { return (this.isSubsystem() && this.subsystem_type == 'component'); }",
"isGroup() { return (this.isSubsystem() && this.subsystem_type == 'group'); }",
"function isSCActive(){\n\t\t\n\t\treturn(typeof SC != \"undefined\");\t\n\t}",
"static isInstance(obj) {\n if (obj === undefined || ob... | [
"0.8290206",
"0.77902824",
"0.5642811",
"0.553071",
"0.546384",
"0.5451294",
"0.54282165",
"0.53659767",
"0.53333676",
"0.5311725",
"0.5311725",
"0.5304407",
"0.52957726",
"0.52648026",
"0.5264724",
"0.5261216",
"0.5253198",
"0.5242526",
"0.5230821",
"0.5224057",
"0.52156276"... | 0.92600834 | 0 |
True if it's a subsystem and this.subsystem_type is 'group' | isGroup() { return (this.isSubsystem() && this.subsystem_type == 'group'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSubsystem() { return (this.type == 'subsystem'); }",
"isComponent() { return (this.isSubsystem() && this.subsystem_type == 'component'); }",
"ingroup(groupType) {\n return (this.groups.indexOf(groupType) >= 0);\n }",
"get isGroup() { return this._isGroup; }",
"function isGroup( node ) {\n\t\tre... | [
"0.7994769",
"0.7461669",
"0.685782",
"0.67043513",
"0.62899554",
"0.6192013",
"0.5869362",
"0.5841281",
"0.5732685",
"0.57227397",
"0.5549674",
"0.5493006",
"0.5493006",
"0.54245085",
"0.5423082",
"0.5412093",
"0.538433",
"0.5373756",
"0.5296543",
"0.5290903",
"0.52399755",
... | 0.9258756 | 0 |
True if it's a subsystem and this.subsystem_type is 'component' | isComponent() { return (this.isSubsystem() && this.subsystem_type == 'component'); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSubsystem() { return (this.type == 'subsystem'); }",
"isGroup() { return (this.isSubsystem() && this.subsystem_type == 'group'); }",
"hasComponent(){\n return (bbn.fn.isString(this.component) || (bbn.fn.isObject(this.component) && Object.keys(this.component).length)) || this.currentTemplate ? true :... | [
"0.84411305",
"0.71143085",
"0.6942314",
"0.6097537",
"0.5998306",
"0.5960484",
"0.5894908",
"0.5880618",
"0.58455455",
"0.5827616",
"0.5791646",
"0.5761354",
"0.575941",
"0.5724966",
"0.56418025",
"0.56207246",
"0.56076145",
"0.56076145",
"0.56076145",
"0.56076145",
"0.56076... | 0.93243325 | 0 |
Not connectable if this is a input group or parents are minimized. | isConnectable() {
if (this.isInputOrOutput() && !(this.hasChildren() ||
this.parent.isMinimized || this.parentComponent.isMinimized)) return true;
return this.isMinimized;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isUnconnectedInput() { return (this.type == 'unconnected_input'); }",
"collapseEpsilons() {\n let pMap = this.pMap;\n\n for (let node in this.graph) {\n // take action only if node is an epsilon and has no operators\n if (this.graph[node].type === constants.EPSILON) {\n this.collapseNode(p... | [
"0.54707444",
"0.50604385",
"0.5009926",
"0.5008646",
"0.4976692",
"0.49726757",
"0.49365658",
"0.48592374",
"0.4850988",
"0.48474076",
"0.4785313",
"0.47540227",
"0.46978265",
"0.46937",
"0.46935403",
"0.4684694",
"0.4679912",
"0.46539176",
"0.46277606",
"0.46123835",
"0.460... | 0.6619951 | 0 |
Return false if the node is minimized or hidden | isVisible() {
return !(this.varIsHidden || this.isMinimized);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isHidden(node) {\n return !node || node.offsetParent === null;\n}",
"function isHidden(node) {\n return !node || node.offsetParent === null;\n}",
"function isHidden(node) {\n return !node || node.offsetParent === null;\n}",
"function navigationNodesShouldBeShown(){\n\tif(!DISABLE_NAVIGATION_CONTR... | [
"0.6804688",
"0.6804688",
"0.6804688",
"0.665769",
"0.66416717",
"0.6574559",
"0.6525172",
"0.65105796",
"0.65082",
"0.6454725",
"0.64353985",
"0.64046305",
"0.64046305",
"0.64046305",
"0.6382459",
"0.6382459",
"0.6368409",
"0.6338598",
"0.6291488",
"0.62755734",
"0.6257549",... | 0.7177663 | 0 |
select all the .recipe and remove them from the .recipes section | function resetRenderRecipes() {
const recipes = document.querySelectorAll('.recipe')
if (recipes) {
recipes.forEach(el => {
el.remove()
})
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeRecipeIngredient(recipe){\n const index = this.shoppingList.indexOf(this.shoppingList.recipe.id);\n this.shoppingList.splice(index, 1);\n }",
"function clearBasicRecipeContents() {\n $(\"#recipe-name\").empty();\n $(\"#recipe-img\").empty();\n $(\"#recipe-ingredients\").empty();\n $(\"... | [
"0.672174",
"0.658292",
"0.6397181",
"0.63444597",
"0.62526095",
"0.6142319",
"0.6136228",
"0.60451597",
"0.5980903",
"0.59236264",
"0.5921447",
"0.59139514",
"0.5869374",
"0.58677727",
"0.5839033",
"0.58320683",
"0.5737453",
"0.5696646",
"0.56643206",
"0.5653828",
"0.5623240... | 0.76702267 | 0 |
reset ingredientsList[] push data from searchResult || recipesList and generate the list of ingredients | function generateIngredientsList(searchResult) {
if (searchResult) {
ingredientsList = []
searchResult.filter(recipes => recipes.ingredients.forEach(el => {
ingredientsList.push(el.ingredient.toLowerCase())
}))
ingredientsList = [...new Set(ingredientsList)]
} else {
ingredientsList = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIngredientList(drinkDetails) {\n ingredientList = [];\n \n for (var j = 1; j < 16; j++) {\n var currentIngredient = drinkDetails['drinks'][0]['strIngredient' + j];\n if (currentIngredient != null && currentIngredient != \"\") {\n ingredientList.... | [
"0.6806841",
"0.6581832",
"0.6569961",
"0.65146345",
"0.6507513",
"0.6503925",
"0.6449302",
"0.640015",
"0.6295889",
"0.6287006",
"0.6252535",
"0.6237937",
"0.6210333",
"0.61973166",
"0.61793697",
"0.61753297",
"0.60981345",
"0.6081703",
"0.60455555",
"0.6041524",
"0.6032314"... | 0.7921939 | 0 |
reset appliancesList[] push data from searchResult || recipesList and generate the list of appliances | function generateAppliancesList(searchResult) {
if (searchResult) {
appliancesList = []
searchResult.filter(recipe =>
appliancesList.push(recipe.appliance.toLowerCase())
)
appliancesList = [...new Set(appliancesList)]
} else {
recipesList.filter(recipe =>
appliancesList.push(recipe.a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAppliance() {\n let appliances = recipesJson.map((recipe) => recipe.appliance).flat();\n let arrayAppliances = Array.from(new Set(appliances));\n APPLIANCE.push(arrayAppliances);\n displayAppliances(arrayAppliances);\n return arrayAppliances;\n}",
"function renderAppliancesList() {\n appliances... | [
"0.6475796",
"0.6465267",
"0.63698155",
"0.59194505",
"0.57725114",
"0.5738469",
"0.56178564",
"0.55668616",
"0.55398345",
"0.5535707",
"0.5527246",
"0.552554",
"0.5498019",
"0.5481636",
"0.54760617",
"0.54513747",
"0.54306",
"0.5385491",
"0.5373044",
"0.53537273",
"0.531555"... | 0.7900876 | 0 |
reset ustensilsList[] push data from searchResult || recipesList annd generate the list of ustensils | function generateUstensilsList(searchResult) {
if (searchResult) {
ustensilsList = []
searchResult.filter(recipes => recipes.ustensils.forEach(el => {
ustensilsList.push(el.toLowerCase())
}))
ustensilsList = [...new Set(ustensilsList)]
} else {
recipesList.filter(recipes => recipes.ustensi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateIngredientsList(searchResult) {\n if (searchResult) {\n ingredientsList = []\n searchResult.filter(recipes => recipes.ingredients.forEach(el => {\n ingredientsList.push(el.ingredient.toLowerCase())\n }))\n ingredientsList = [...new Set(ingredientsList)]\n } else {\n ingredien... | [
"0.6593631",
"0.64607763",
"0.6441245",
"0.64318556",
"0.640305",
"0.60733235",
"0.60031015",
"0.59810174",
"0.59692824",
"0.5921821",
"0.5844176",
"0.5805302",
"0.569638",
"0.5674253",
"0.5673694",
"0.5664744",
"0.56552655",
"0.5650643",
"0.56224716",
"0.56188023",
"0.559200... | 0.7874472 | 0 |
create list from appliancesList[] | function renderAppliancesList() {
appliancesList_ul.innerHTML = ''
appliancesList.forEach(el => {
const li = document.createElement('li')
li.classList.add('filters-results-list__item')
li.innerText = `${el}`
li.addEventListener('click', (e) => {
addToFilterList({category: 'appliance', value:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateAppliancesList(searchResult) {\n if (searchResult) {\n appliancesList = []\n searchResult.filter(recipe =>\n appliancesList.push(recipe.appliance.toLowerCase())\n )\n appliancesList = [...new Set(appliancesList)]\n } else {\n recipesList.filter(recipe =>\n appliancesList... | [
"0.6358103",
"0.6090063",
"0.57723564",
"0.5625082",
"0.55615747",
"0.5550116",
"0.55491585",
"0.5500788",
"0.53505844",
"0.5348334",
"0.5321",
"0.53206104",
"0.52956903",
"0.5275009",
"0.5231152",
"0.5225418",
"0.5217445",
"0.51426023",
"0.51382196",
"0.5117016",
"0.5103993"... | 0.62146616 | 1 |
for Ingredients hide button & display filters list with input field | function toggleDisplayIngredientsListFilter() {
ingredientsFilter_btn.classList.toggle('hidden')
ingredientsFilter_dropdown.classList.toggle('hidden')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filter(event) {\n const search = event.target.value.trim().toLowerCase();\n\n $('.admin-element-item')\n .hide()\n .filter((key, item) => $(item).html().trim().toLowerCase().indexOf(search) !== -1)\n .show();\n\n $('.admin-element')\n .show()\n ... | [
"0.70579123",
"0.69325936",
"0.6751895",
"0.66569906",
"0.6547435",
"0.6528196",
"0.652162",
"0.6499923",
"0.6488742",
"0.6486455",
"0.64790016",
"0.6460992",
"0.64546824",
"0.6453452",
"0.6443525",
"0.64403045",
"0.6424828",
"0.6420347",
"0.6415925",
"0.6379822",
"0.6359854"... | 0.7406379 | 0 |
for Ustensiles hide button & display filters list with input field | function toggleDisplayUstensilsFilter() {
ustensilsFilter_btn.classList.toggle('hidden')
ustensilsFilter_dropdown.classList.toggle('hidden')
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideFilterLists() {\n categoryFilter.style.display = \"none\";\n priceFilter.style.display = \"none\";\n searchbar.style.display = \"none\"\n}",
"function filterButtonPressed(filter_type) {\n var categoryFilter = document.getElementById(\"categoryFilter\");\n var priceFilter = document.getElementBy... | [
"0.7262604",
"0.7187394",
"0.71790254",
"0.7140759",
"0.70797324",
"0.7055357",
"0.70356923",
"0.69997907",
"0.6939563",
"0.69266844",
"0.6880878",
"0.6874705",
"0.68703353",
"0.6868266",
"0.6858562",
"0.68305403",
"0.6821197",
"0.68176895",
"0.6798848",
"0.67977965",
"0.6792... | 0.7391449 | 0 |
Adding incomeValue to incomeTotal in UI | static updateIncome(income) {
budget.incomeTotalAdd(income);
let total_income = budget.getIncomeTotal();
let budgetTotal = budget.getBudget();
if(budgetTotal === 0){
selectors.budget_value.textContent = budgetTotal;
}
else if(budgetTotal > 0){
selectors.budget_value.textContent = "+... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static updateIncomeSub(income){\n budget.incomeTotalSubtract(income);\n let total_income = budget.getIncomeTotal();\n let budgetTotal = budget.getBudget();\n\n if(budgetTotal === 0){\n selectors.budget_value.textContent = budgetTotal;\n }\n else if(budgetTotal > 0){\n selectors.budget_v... | [
"0.72211635",
"0.71863836",
"0.7014552",
"0.6973747",
"0.6955519",
"0.6942119",
"0.68526",
"0.67976564",
"0.67863226",
"0.66556394",
"0.6654988",
"0.66111714",
"0.6604476",
"0.65875244",
"0.6579806",
"0.6570976",
"0.6559745",
"0.6559396",
"0.65509814",
"0.65498686",
"0.653683... | 0.78230697 | 0 |
Updating income value when income has been deleted | static updateIncomeSub(income){
budget.incomeTotalSubtract(income);
let total_income = budget.getIncomeTotal();
let budgetTotal = budget.getBudget();
if(budgetTotal === 0){
selectors.budget_value.textContent = budgetTotal;
}
else if(budgetTotal > 0){
selectors.budget_value.textConte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static updateIncome(income) {\n budget.incomeTotalAdd(income);\n let total_income = budget.getIncomeTotal();\n let budgetTotal = budget.getBudget();\n\n if(budgetTotal === 0){\n selectors.budget_value.textContent = budgetTotal;\n }\n else if(budgetTotal > 0){\n selectors.budget_value.te... | [
"0.7061618",
"0.6513196",
"0.6473835",
"0.6183764",
"0.60528666",
"0.5983138",
"0.59407794",
"0.5763448",
"0.5761759",
"0.5758168",
"0.57096684",
"0.5703067",
"0.57028246",
"0.5700199",
"0.5638719",
"0.56158334",
"0.5615294",
"0.5606268",
"0.5594589",
"0.5549927",
"0.5537118"... | 0.68309706 | 1 |
Adding expenseValue to expenseTotal in UI | static updateExpenses(expense) {
budget.expenseTotalAdd(expense);
let total_expense = budget.getExpenseTotal();
let budgetTotal = budget.getBudget();
if(budgetTotal === 0){
selectors.budget_value.textContent = budgetTotal;
}
else if(budgetTotal > 0){
selectors.budget_value.textConte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addExpenseTotal(){\n\t\t\tconst expenseItem={};\n\t\t\t//read inputAmount\n\t\t\tconst textAmount=inputElement.value;\n\n\t\t\t//read the inputDesc\n\t\t\tconst textDesc=inputDescEl.value;\n\n\t\t\t//convert string to number\n\t\t\tconst expense = parseInt(textAmount,10);\n\n\t\t\t//put it in object\n\t\t... | [
"0.79806733",
"0.7482705",
"0.73820066",
"0.7341299",
"0.7246911",
"0.7126886",
"0.69748324",
"0.6930504",
"0.6909514",
"0.6895926",
"0.6749707",
"0.67039496",
"0.66918355",
"0.66787094",
"0.66725165",
"0.66590345",
"0.66277975",
"0.6613616",
"0.6586429",
"0.6569956",
"0.6563... | 0.7765388 | 1 |
N A V I G A T I O N getPage([event e, ]string page[, array/object atts]) Navigate to requested page | function getPage() {
var args = $.makeArray(arguments),
kevt = (args[0] && typeof args[0] === 'object') ? args.shift()||{} : {},
shift = kevt.shiftKey,
ctrl = kevt.ctrlKey,
page = args.shift();
// string 'content', object (page, shift, ctrl), array function_args
ajax('content', {page: page, shift: shift,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function goToPage(event) {\n \n var pageTextAndValue = event.data.pageObj;\n var numPages = event.data.pages;\n //making sure we don't do anything if we don't need to\n if ((currentPage == 1 && (pageTextAndValue.value == -1 || pageTextAndValue.value == -numPages)) ||\n (currentPage == numPage... | [
"0.6714879",
"0.63981265",
"0.63976955",
"0.6277517",
"0.62724686",
"0.626591",
"0.62541837",
"0.6207506",
"0.61528283",
"0.6149547",
"0.6143862",
"0.60586834",
"0.6052098",
"0.6049841",
"0.60489774",
"0.6042489",
"0.60281456",
"0.60105914",
"0.59947866",
"0.59578824",
"0.594... | 0.66623443 | 1 |
Function checks the brightness of each pixel | function checkBrightness(r, g, b) {
return Math.sqrt(
(r * r) * 0.299 +
(g * g) * 0.587 +
(b * b) * 0.114
) / 100;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function greenScreen(pixels) {\n // hold the max and min green\n const levels = {};\n\n document.querySelectorAll('.rgb input').forEach(input => {\n levels[input.name] = input.value;\n });\n \n // Loop over every single pixel\n for (let i = 0; i < pixels.data.length; i+=4) {\n let red = pixels.data[i ... | [
"0.68984526",
"0.6750328",
"0.67410296",
"0.67250013",
"0.6708956",
"0.6597516",
"0.6553388",
"0.6496974",
"0.6483738",
"0.6475892",
"0.6433294",
"0.6405341",
"0.63838446",
"0.63585514",
"0.63545996",
"0.633914",
"0.62425685",
"0.61752033",
"0.6147589",
"0.609759",
"0.6088696... | 0.71917963 | 0 |
randombetweenvalues se salta el 0 | function randombetweenvalues(min, max) {
var randValue = Math.floor(Math.random() * (max - min +1))+min;
return randValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randrange(a, b) { return randint(b-a+1)+a-1 }",
"function newRandom() {\n return value == 0 ? Math.random() * ( upper - lower ) + lower : value + ((Math.random() * 2) - 1);\n}",
"function randBetween(lo, hi){\n\tif(lo>=hi) return 0;\n\t\n\treturn Math.floor( (pRand()*(hi-lo)) + lo);\n\t\n}",
"fun... | [
"0.6953587",
"0.6814",
"0.67679554",
"0.67341185",
"0.6729376",
"0.670898",
"0.6695031",
"0.66594976",
"0.66318595",
"0.6610552",
"0.6591435",
"0.6589465",
"0.6576334",
"0.6575733",
"0.6571314",
"0.65702814",
"0.65457875",
"0.65348417",
"0.65346164",
"0.6509919",
"0.65006167"... | 0.703861 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.