query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Calls createWorker for each worker inside the this.workers config. | createWorkers() {
let me = this,
config = Neo.clone(NeoConfig, true),
hash = location.hash,
key, value;
// remove configs which are not relevant for the workers scope
delete config.cesiumJsToken;
// pass the initial hash value as Neo.configs
... | [
"async createWorkers () {\n\n let worker;\n if ( !this.fallback ) {\n\n let workerBlob = new Blob( this.functions.dependencies.code.concat( this.workers.code ), { type: 'application/javascript' } );\n let objectURL = window.URL.createObjectURL( workerBlob );\n for ( le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Zero out the top bits in the last 32bit words of the IV | function zeroIVBits(iv) {
// "We zero-out the top bit in each of the last two 32-bit words
// of the IV before assigning it to Ctr"
// — http://web.cs.ucdavis.edu/~rogaway/papers/siv.pdf
iv[iv.length - 8] &= 0x7f;
iv[iv.length - 4] &= 0x7f;
} | [
"function zeroDecipher(key, data) {\n\treturn decompress(sjcl.decrypt(key, data));\n}",
"static int256(v) { return n(v, -256); }",
"zero () {\n this.#secret.zero()\n }",
"static uint192(v) { return n(v, 192); }",
"static bytes28(v) { return b(v, 28); }",
"static uint248(v) { return n(v, 248); }",
"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logic that moves each pipe across the screen. Pipe speed is determined by the constants hash defined earlier, and will be placed in a callback called by eachPipe. eachPipe is necessary to properly retain 'this' when iterating through the pipes as it will be used for various functions. | movePipes() {
this.eachPipe(function (pipe) {
pipe.topPipe.left -= CONSTANTS.PIPE_SPEED;
pipe.topPipe.right -= CONSTANTS.PIPE_SPEED;
pipe.bottomPipe.left -= CONSTANTS.PIPE_SPEED;
pipe.bottomPipe.right -= CONSTANTS.PIPE_SPEED;
});
/*
Whenev... | [
"buildPipePair() {\n const topHeight = Phaser.Math.RND.between(\n 1,\n globals.tilesTall - globals.pipeGapSize - 1\n );\n const bottomHeight = globals.tilesTall - globals.pipeGapSize - topHeight;\n\n this.buildPipe(topHeight, false);\n this.buildPipe(bottomHeight, true);\n }",
"drawPipes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for updating the invite's category and specialty | async updateInviteCategory({ state, commit }, payload) {
// poast the data
await this.$axios.post(`/invites/${state.invite.id}/category`, {
new_invite: {
category: payload.data
}
})
.then(result => {
// set the order
commit(... | [
"modifyCategory(e, category) {\n\t\tlet firebaseRef = firebase.database().ref('dataset/expenseCategories');\n\t\tconst newCategory = this.state.newCategory;\n\t\tfirebaseRef.push(newCategory);\n\n\t\tthis.setState({ newCategory: '' });\n\t}",
"static syncPrivacyContext(entryId, categoryId){\n\t\tlet kparams = {};... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
random position of .shootingStar and move it across the screen | function comet() {
var bodyWidth = $(window).width();
var x = Math.floor((Math.random() * bodyWidth));
$('.shootingStar').css('left', x);
$(".shootingStar").animate({
marginLeft:"100%", marginBottom:"100%"
}, 800);
} | [
"jumpToRandom(){\n\t\tthis.coinCount -= 5;\n\t\tthis.updateCoinCount();\n\t\tconst randomTile = Math.floor(Math.random()*40 +1);\n\t\tthis.currentPosition = randomTile;\n\t\tthis.movePiece();\n\t\t$('.resultmessage__container').html(`<p>${this.character} hopped in the vortex and landed on tile [${this.currentPositi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks whether callback offsets always trigger | function _cbOffsets(){
return [o.callbacks.alwaysTriggerOffsets || contentPos>=limit[0]+tso,o.callbacks.alwaysTriggerOffsets || contentPos<=-tsbo];
} | [
"hasCallback() {}",
"verifyOffset(offset) {\n if (offset % 4 !== 0) {\n this.pushError(\"Misaligned branch offset (must be a multiple of 4) [line \" + this.line + \"]: \" + offset);\n return false;\n }\n return true;\n }",
"function OffsetDummyListener()\r\n{\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a ball grab request emit to the server | function requestBallCarrier() {
socket.emit('requestBallCarrier', myPlayerUpdate.playerID);
} | [
"sendDetectedBall(ball) {\n // console.log(ball);\n\n // Create a temp canvas to draw on\n const ballTempCanv = document.createElement('canvas')\n const ballTempCtx = ballTempCanv.getContext('2d')\n domContent.appendChild(ballTempCanv)\n ballTempCanv.classList.add('ballTemp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the given vector "result" with the element values from the index "offset" of the given FloatArray This function is deprecated. Use FromArrayToRef instead. | static FromFloatArrayToRef(array, offset, result) {
return Vector3.FromArrayToRef(array, offset, result);
} | [
"static FromFloatArrayToRef(array, offset, result) {\n Vector4.FromArrayToRef(array, offset, result);\n }",
"static FromFloatArray(array, offset) {\n return Vector3.FromArray(array, offset);\n }",
"static FromArray(array, offset = 0) {\n return new Vector3(array[offset], arr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reports that the |player| has used the given |throttle|. | reportThrottle(player, throttle) {
if (!this.throttles_.has(player))
this.throttles_.set(player, new Map());
this.throttles_.get(player).set(throttle, server.clock.monotonicallyIncreasingTime());
} | [
"processThrottle(player, throttle, currentTime) {\n if (!this.throttles_.has(player))\n return null; // the |player| hasn't used any throttle before\n\n const throttles = this.throttles_.get(player);\n if (!throttles.has(throttle))\n return null; // the |player| hasn't u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========= Functions ========= Update the amount displayed for each ingredient | function updateIngredients(base) {
ingredients.forEach(ingredient => ingredient.updateAmount(base));
} | [
"function updateIngredients(){\n\tlet ingredientAmt = 0;\n\tlet resultsChildren = $(\"#ingredient-list\").children();\n\n\t//Recalculate the amount of ingredients and reapply classes\n\tfor(let resultIndex = 0, buttonIndex = 1; resultIndex < resultsChildren.length; resultIndex++){\n\t\tconst $currentElement = $(res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send mqtt msg to all users in the users' list. | async function SendingUpdates() {
var d = new Date();
console.log('publish sensors updates: ', d)
console.log('there are: ', Object.keys(users).length, " users");
for (userKey in users) {
console.log('User: ', userKey)
var mqttTransmitMsg = JSON.stringify(users[userKey]);
var ext... | [
"sendUserlist() {\n this.print('Current Users');\n this.print(JSON.stringify(this.users, null, 2));\n this.namespace.emit('username list', this.getUsernames());\n }",
"function broadcast(obj){\n for (var i = obj.allUsers.length - 1; i >= 0; i--) {\n var user = obj.allUsers[i];\n if(availableConnc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if event is in sample ratio | function isInSampleRatioByVsi(sampleRatio) {
if (!sampleRatio || sampleRatioState === 'none') {
return true;
}
var res = wixBiSession.coin % sampleRatio === 0;
if (!res && wixBiSession.hasOwnProperty('coinByRequestId') && experiment && experiment.isOpen ... | [
"isSampled() {\n return this._transaction.isSampled()\n }",
"function pcmGetClippingRatio(src) {\r\n const numSamples = src.length;\r\n let numClippedSamples = 0;\r\n for (let i = 0; i < numSamples; i++) {\r\n const sample = src[i];\r\n if (sample <= -32768 || sample >= 32767)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tells the reader to parse the entries. | parseEntries() {} | [
"function processEntries(response) {\n\t\tfor (i=0; i<response[1].length; i++) {\n\t\t\tvar title = response[1][i];\n\t\t\tvar description = response[2][i];\n\t\t\tvar link = response[3][i];\n\t\t\t//creates new object with current article title, desc and link\n\t\t\tvar thisArticle = new createEntry(title, descrip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List measurement events for an assignment as a chart series. | function listMeasurementsForAssignmentAsChartSeries(axios$$1, token, mxIds, paging) {
var query = '';
if (paging) {
query += '?' + paging;
}
if (mxIds) {
for (var i = 0; i < mxIds.length; i++) {
query += '&measurementIds=' + mxIds[i];
}
}
return restAuthGet(axios$$1, 'a... | [
"function listMeasurementsForAssignment(axios$$1, token, paging) {\n var query = '';\n if (paging) {\n query += '?' + paging;\n }\n return restAuthGet(axios$$1, 'assignments/' + token + '/measurements' + query);\n }",
"get __seriesEventNames() {\n return {\n /**\n * Fired when the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que recibe un parametro y crea un span con ese texto. | function crearSpan(pInfo) {
let nuevoSpan = document.createElement('span');
nuevoSpan.textContent = pInfo;
return nuevoSpan;
} | [
"function createSpan(){\n return document.createElement('span');\n}",
"function addSpan(className, techName){\n var usedOnce = false;\n const location = className;\n const tech = techName;\n\n return function addSpanElement(){ \n if(!usedOnce){\n var span = document.createE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParseralter_session_set_clause. | visitAlter_session_set_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitUpdate_set_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"_add_assignment_statement_subtree_to_ast(cst_current_node) {\n var _a;\n this.verbose[this.verbose.length - 1].push(new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print out the details of a matching rule. | function debug(rules, key_name, key_value) {
var matches = find_rules(rules, key_name, key_value);
if (matches.length == 0) {
return "Null";
} else {
return dump(matches);
}
} | [
"function ruleLine(r) {\n return util.format('%s %s %s', r.uuid,\n r.enabled ? 'true ' : 'false ', r.rule);\n}",
"function ruleAsMarkdown(rule) {\n let markdown = `## Rule: ${asUrl(rule)}\\n\\n`;\n let targetEnumeration = \"\";\n if (hasPublic(rule)) {\n targetEnumeration += \"- Every... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserrecord_type_def. | visitRecord_type_def(ctx) {
return this.visitChildren(ctx);
} | [
"visitType_definition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_declaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitXmltype_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_body(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitObject_type_def(c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether or not any headers have been set for this file. Some files, such as vertex csv files will require headers, whereas edge csv files may not. | containsHeaders(){
return this.headerRow.length !== 0;
} | [
"function guessHeader( data, isNumeric ) {\n\n // if there is just one row, we do not consider it a header\n if( data.length < 2 ) {\n return false;\n }\n\n // if we have at least one col, where the col is numeric and the first row is not,\n // then we assume, there is a header row\n if( data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for each item in arr, resolves the second promise only after the first promise is entirely contained within G. | function update(arr) {
arr.forEach(async ([p1, p2]) => {
const A = await p1
if (A.every(i => G.includes(i)))
p2.resolve(A)
})
} | [
"function update(arr) {\n arr.forEach(async ([p1, p2]) => {\n const A = await p1\n if (A.every(i => C.includes(i)))\n p2.resolve(A)\n })\n }",
"function Promise_all(array) {\n return new Promise((resolve, reject) => {\n let results = [];\n // Resolve it when all promises in a given ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Althought MS Surface support screen touch, IE10/11 do not support touch event and MS Edge supported them but not by default (but chrome and firefox do). Thus we use Pointer event on MS browsers to handle touch. | function usePointerEvent() {
// TODO
// pointermove event dont trigger when using finger.
// We may figger it out latter.
return false;
// return env.pointerEventsSupported
// In no-touch device we dont use pointer evnets but just
// use mouse event... | [
"function isReallyTouch(e){//if is not IE || IE is detecting `touch` or `pen`\nreturn typeof e.pointerType==='undefined'||e.pointerType!='mouse';}",
"function PointerEventsPolyfill(t){if(this.options={selector:\"*\",mouseEvents:[\"click\",\"dblclick\",\"mousedown\",\"mouseup\"],usePolyfillIf:function(){if(\"Mi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper for evaluate which clears the output and allows that GUI update to happen before running. | function evaluateClear(id) {
store(id);
window.globalRunId = id; // hack: set state used by printing
window.globalPrintCount = 5000;
clearOutput();
var ta = document.getElementById(id);
var text = ta.value;
preloadImages(text);
// hack: use setTimeout to run this a bit in the future, so the ... | [
"function clearScreen() {\n calculator.displayValue = '0';\n calculator.firstOperand = null;\n calculator.waitForNextOperand = false;\n calculator.operator = null;\n calculator.inBaseTen = true;\n}",
"function evaluate() {\n\t\tif((leftWindow.value > 0) && (centerWindow.value !== '') && (rightWindo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the dimensions (mutates sliderOpts): | function findDimensions(gd, sliderOpts) {
var sliderLabels = gd._tester.selectAll('g.' + constants.labelGroupClass)
.data(sliderOpts.steps);
sliderLabels.enter().append('g')
.classed(constants.labelGroupClass, true);
// loop over fake buttons to find width / height
var maxLabelWi... | [
"function setupDimensions() {\n\t$('.opt').css('width', width/numtabs+'px');\n\t$('.sub').css('width', width+'px');\n\t$('.sub').css('overflow', 'hidden');\n\t$('.controlgroup').css('width', numtabs*width+'px');\n\t$('#camera').css('margin-top', '1px');\n\t$('#camera').css('margin-bottom', '2px');\n\t$('.controlgro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function getMaxEVs(void): list Return a list containing all of the maximum ev input elements | function getMaxEVs()
{
return [
parseInt(document.getElementById('hp-max').value),
parseInt(document.getElementById('atk-max').value),
parseInt(document.getElementById('def-max').value),
parseInt(document.getElementById('spa-max').value),
parseInt(document.getElementById('spd-max').value),
parseInt(documen... | [
"function getMinEVs()\n{\n\treturn [\n\t\tparseInt(document.getElementById('hp-min').value),\n\t\tparseInt(document.getElementById('atk-min').value),\n\t\tparseInt(document.getElementById('def-min').value),\n\t\tparseInt(document.getElementById('spa-min').value),\n\t\tparseInt(document.getElementById('spd-min').val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserresourceList. | exitResourceList(ctx) {
} | [
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitStatementWithoutTrailingSubstatement(ctx) {\n\t}",
"exitElementValueList(ctx) {\n\t}",
"exitOrdinaryCompilation(ctx) {\n\t}",
"exitCollectionLiteral(ctx) {\n\t}",
"exitAnnotationList(ctx) {\n\t}",
"exitExceptionTypeList(ctx) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : loadFilterDevices() AUTHOR : James Turingan DATE : December 18, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS : | function loadFilterDevices(){
var query = {"QUERY":[{"user":globalUserName,"domainname":window['variable' + dynamicDomain[pageCanvas] ],"zone":"Default"}]};
query = JSON.stringify(query);
$.ajax({
url: getURL("ConfigEditor","JSON"),
data : {
"action": "getdeviceinfo",
"query": query
},
method: 'POST... | [
"function loadFilters(that) {\r\n if (that.config.filters !== undefined) {\r\n $.each(that.config.filters, function (index, value) {\r\n //Filter function\r\n if (that.config.filters[index].context === \"context:dimension\") {\r\n that.idxFilter[ind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the path for the source image | function getImagePath(source){
var urlPath = url.parse(source).path;
var lastPath = _.last(urlPath.split("/"));
var savePath = ORGINAL_IMAGE_PATH + lastPath;
return savePath;
} | [
"get src() {\n this._logService.debug(\"gsDiggThumbnailDTO.src[get]\");\n return this._src;\n }",
"function getQrImagePathToSave()\n{\n return path.join(__dirname,'../../../client/qr-images/');\n}",
"getSrc(){\n\t\tif( this.props.activeTrack ) {\n\t\t\treturn this.props.activeTrack.url;\n\t\t}\n\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Note: incoming 'ind' starts from 0 NOTE: We can change steps only if the grid selection is complete. This restriction arises because we don't have enough state within a StepObject to capture whether we are currently configuring, or selecting dest/source grids etc. If we add state, we can change steps at any point withi... | function changeStep(ind) {
var sO = CurStepObj;
var fO = CurFuncObj;
// If we are going to a next step while we are just going through
// new output grid selection menu, abandon current step
//
if (sO.stageInStep < StageInStep.ConfigStarted) {
CurFuncObj.curStepNum = ind;
... | [
"function redrawCurStep() {\r\n\r\n\r\n var fO = CurFuncObj;\r\n var sO = CurStepObj;\r\n\r\n // for all grid objects in sO (stepObject)\r\n //\r\n for (var id = 0; id < sO.allGridIds.length; id++) {\r\n\r\n var htmlId = AllHtmlGridIds[id];\r\n var gO = fO.allGrids[sO.allGridIds[id]];\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepares the encodings and calls the renderer | function render(renderProperties, encodings, options) {
encodings = (0, _linearizeEncodings2.default)(encodings);
for (var i = 0; i < encodings.length; i++) {
encodings[i].options = (0, _merge2.default)(options, encodings[i].options);
(0, _fixOptions2.default)(encodings[i].options);
}
(0, _fixOptions2... | [
"onRender() {}",
"handleUTF8() {\n var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n if (this.useUTF8()) {\n this.fileNameStr = utf8decode(this.fileName);\n this.fileCommentStr = utf8decode(this.fileComment);\n } else {\n var upath = thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserreference_model. | visitReference_model(ctx) {
return this.visitChildren(ctx);
} | [
"visitReferences_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function STLangVisitor() {\n STLangParserVisitor.call(this);\n this.result = {\n \"valid\": true,\n \"error\": null,\n \"t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to apply tweening to a central message, by specifying target height and target opacity | function tweenMessage(msg, waiting, time, targetHeight, targetAlpha) {
createjs.Tween.get(msg).wait(waiting).to({y:targetHeight, alpha:targetAlpha}, time);
} | [
"bounce() {\n\n this.balltween\n .to('#ball', this.time/2, {y: '+=250px', scaleY: 0.7, transformOrigin: \"bottom\", ease: Power2.easeIn,\n onComplete: () => {\n this.checkColor();\n }\n }).to('#ball', this.time/2, {y: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the destination of the ship(NO UPDATE DB YET) Returns new destination if updated successfully or undefined otherwise | function changeDestination( shipObj, newDestination )
{
DEBUG_MODE && console.log( "Calling changeDestination in ShipBO, new destination:" , newDestination );
if ( newDestination == undefined )
{
DEBUG_MODE && console.log( "ShipBO.changeDestination: new destination is undefined" );
return un... | [
"function moveShip( shipObj, newLocation )\n{\n DEBUG_MODE && console.log( \"Calling moveShip in ShipBO, new location:\" , newLocation );\n if ( shipObj == undefined )\n {\n DEBUG_MODE && console.log( \"ShipBO.moveShip: shipObj is undefined\" );\n return undefined;\n }\n\n if ( newLocat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the currently active document, which in effect should switch from single dcoument view to multi document view. | function clearActiveDocument()
{
_activeDocument = null;
} | [
"function dwscripts_clearDocEdits()\n{\n docEdits.clearAll();\n}",
"clearSelect() {\n const [selection] = this.cm.getDoc().listSelections();\n\n if (selection) {\n this.cm.setCursor(selection.to());\n }\n }",
"function closeDoc() {\n for (let i = 0; i < appData.documents.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Doubles the size of the entries array and rehashes the old values back into the map | _doubleEntriesSizeAndRehashEntries() {
const entries = this._entries;
const oldLength = this._entryRange;
const newLength = oldLength * 2;
//Reset the values
this._entries = new Array(newLength);
this._entryRange = newLength;
this._spaceTaken = 0;
for (let entry of entries) {
if(!e... | [
"function actualRehashValues() {\n var oldBuckets = currentHashTable.buckets;\n\n actualRehash();\n\n currentHashTable.slots = slots;\n currentHashTable.size = size;\n currentHashTable.buckets = buckets;\n\n //console.log(JSON... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Counting missed lessons, appears only after updating page | function missedLessons() {
let missLess = document.getElementById("missedLessons");
let notMissed = document.getElementsByClassName("green");
let totalLessons = document.getElementsByClassName("score");
let missed = totalLessons.length - notMissed.length;
missLess.innerHTML = "Missed Lessons " + m... | [
"function updateRemainingGuesses(){\n document.querySelector(\"#guessesCount\").innerHTML = remainingGuesses;\n }",
"function updateCounter() {\n var toDoListItems = document.querySelectorAll('.todo-items');\n\n listCounter.innerHTML = toDoListItems.length - completedTasks;\n}",
"function updateCounte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add extra letter function | function addExtraLetter() {
const word = document.querySelector('.word.active') || wordsContainer.firstChild
const prevLength = word.children.length
if (letterIndex >= prevLength) {
const span = document.createElement('span')
span.className = 'extra';
span.innerHTML = textarea.value
word.appendChi... | [
"function fillDisplayWord (letter) {\n\n}",
"function hoofdletters(tekst) {\n return tekst.toUpperCase(); // dit is alles\n}",
"function addLetterToCurrentWord(editableDiv, letter) {\n\tvar oldStr = editableDiv.textContent;\n\tvar curPos = getCaretPositionInDiv(editableDiv);\n\tvar firstPos = getStartingPositi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get eligible cards from passcode sheet | function getEligibleCards(passcodeSheet) {
var eligibleCards = {};
for (var i = 0; i !== passcodeSheet.length; ++i) {
for (var j = 0; j !== filter.length; ++j) {
if (passcodeSheet[i].indexOf(filter[j]) !== -1 && !passcodeSheet[i][5].length) {
// Eligible for a code to be given
... | [
"ListOfCreditCards() {\n let url = `/me/paymentMean/creditCard`;\n return this.client.request('GET', url);\n }",
"function getCreditCards(){\n\tif(paymentScreenProps.windowType==\"Modal\" && !isUserLoggedIn()){\n\t\treturn false;\n\t}\n\ttogglePaymentAndIFrameBlock(false);\n\t\n\t\t$('#cancelButt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
iglooCSD tags page for CSD or deletes page under csd criteria | function iglooCSD (page, csdtype) {
this.pageTitle = page;
this.csdtype = csdtype;
} | [
"function removeGhPages()\n{\n console.log(\"\\tStart removeGhPages\");\n\n var i;\n var srch = \"gh-pages\";\n var tags = document.getElementsByTagName(\"a\");\n for (i = 0; i < tags.length; i++) \n {\n if(tags[i].href.indexOf(srch) > -1)\n {\n console.log(\"\\t\\thref [\"+ tags[i].href + \"] is g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the index of the aggregate with the given agg_type and agg_value | function get_aggregate(type, agg_name)
{
for(var i = 0; i < aggregate_data.length; i++)
{
if(aggregate_data[i]["agg_type"] === type && aggregate_data[i]["agg_name"] === agg_name)
{
return i;
}
}
return -1;
} | [
"get indexType()\n {\n return 1;\n }",
"function simpleAggregateField(data, aggField, compareField, item){\n var total = 0;\n for (var i = 0; i < data.length; i++) {\n if (data[i][compareField] == item){\n total += data[i][aggField];\n }\n }\n return total;\n}//simpleAggregateField",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inicializar datepickers. | M_datepicker('dp_fecha_inicio'); | function M_datepicker(dp_date_picker) {
var dp_origen = document.getElementById(dp_date_picker); //Obtener datepicker.//
//Obtiene un datepicker y lo inicializa.//
M.Datepicker.init(dp_origen, opciones_fecha);
} | [
"function pgvar_dtpdfecha_inicial__init(){\n $('#pgvar_dtpdfecha_inicial').datepicker({\n language: \"es\",\n todayBtn: \"linked\",\n format: \"dd/mm/yyyy\",\n multidate: false,\n todayHighlight: true,\n autoclose: true,\n\n }).datepicker(\"setDate\", new Date());\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I want to off all on the class. | function reset() {
$double.find('> *').addClass('off').removeClass('on');
} | [
"function off(event) {\r\n\t\tthis.classList.remove(\"on\");\r\n\t}",
"function towerClassReset() {\n $('.towerOption').attr('class', 'tower')\n $('#rays').children().attr('id', 'invisible')\n}",
"function unScareAlien(){\n aliens.forEach(alien => alien.isScared = false)\n }",
"static disable() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::S3ObjectLambda::AccessPointPolicy` resource | function cfnAccessPointPolicyPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnAccessPointPolicyPropsValidator(properties).assertSuccess();
return {
ObjectLambdaAccessPoint: cdk.stringToCloudFormation(properties.objectLambdaAccessPoint),
... | [
"function cfnAccessPointPropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnAccessPointPropsValidator(properties).assertSuccess();\n return {\n Bucket: cdk.stringToCloudFormation(properties.bucket),\n BucketAccountId: cdk.stringToCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fungsi untuk mengambil element id pada keterangan jumlah pemesanan setiap data menu yang ditampilkan | function getElementIDJumlahPesanan (id)
{
var el = "";
switch (id)
{
case 0: el = "ket1"; break;
case 1: el = "ket2"; break;
case 2: el = "ket3"; break;
case 3: el = "ket4"; break;
case 4: el = "ket5"; break;
case 5: el = "ket6"; break;
... | [
"function deleteMenuElelement(id) {\n for (var key in submenu_content) {\n if (submenu_content.hasOwnProperty(key)) {\n if (submenu_content[key].parentId == id) {\n tmpelid = submenu_content[key].elementId;\n delete submenu_content[key];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to see if a coordinate is safe or not? | function safeCoordinate(x, y) {
if (x < 0 || x >= row) return false;
if (y < 0 || y >= col) return false;
if (grid[x][y].state == 'block') return false;
return true;
} | [
"function check_point(p) {\n if (p.x < 0 || p.x > 9) {\n return false;\n } else if (p.y < 0 || p.y > 9) {\n return false;\n } else if (spielfeld[p.y][p.x]) {\n //console.log(\"point already in use:\", p);\n return false;\n } else {\n //console.log(\"point ok:\", p);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
is the value in valuelistID being selected ? | function isValueSelected(idx, selectedValues) {
if ($scope.model.valuelistID) {
if (selectedValues) {
for (var v = 0; v < selectedValues.length; v++) {
if ($scope.model.valuelistID[idx].realValue == selectedValues[v]) {
return true;
}
}
}
}
... | [
"isValueSelected(value) {\n if (this._invalid) {\n return false;\n }\n return this.selectionModel.isSelected(value);\n }",
"selectSlotItem(value) {\n const items = this.getSelectableElements();\n for (let i = 0; i < items.length; i += 1) {\n const item =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
it must be getting state from the top redux container the state isn't from here, it is from the top container this maps that state into the PROPS of this component, SurveyFormReview | function mapStateToProps(state) {
//this will add props to the component
// console.log(state);
// this shows object with AUTH and FORM, AUTH from way back from passport
// FORM is from redux-form
// specificlaly, it is from: form: 'surveyForm' in SurveyForm.js
// form.surveyForm,values
// formValues... | [
"function mapStateToProps({loginuser , users ,questions}) {\r\n // we will get all the questions that the login user answer to it \r\n //console.log(JSON.stringify(loginuser),users ,questions) \r\n//من الفديو عاوزين الاجابات يبقي key\r\n const allAnswers = users[loginuser].answers\r\n //من الفديو عاوزين... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deprecates a method if it's no longer gonna be updated | function deprecate(method) {
console.warn(`(collections:${process.pid}) DeprecationWarning: Method "${method}" is deprecated and will be removed in a future release, refrain from creating bug reports of this method.`);
} | [
"function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global$1.process)) {\n return function () {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (browser$1$1.noDeprecation === true) {\n return fn;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new Saturday night social ticket to the cart contents | function add_saturday()
{
var name = validate_name( 'saturday_name', 'Saturday Night Social' );
if( ! name )
{
return;
}
var socializer = {};
socializer.amount = 95;
socializer.item_name = saturday_id;
socializer.on0 = saturday_name_code;
socializer.os0 = name;
socializer.tax_rate = 13;
cart_contents.pus... | [
"add(board, ticket) {\n\t\tticket.ua = Date.now();\n\t\tthis.dispatch(Action.Ticket.Add, { board, ticket });\n\t}",
"nextTicket() {\n this.lastTicket += 1;\n\n // create a new ticket\n let ticket = new Ticket(this.lastTicket, null); \n this.tickets.push(ticket);\n\n this.saveDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add tag when enter key pressed | function tagOnEnterKeyPress(event) {
// based on browser
var key = event.which || event.keyCode;
// 13 is the code for enter
if (key === 13) {
var tag = tagInput.value.slice(0, tagInput.value.length);
tagInput.value = "";
addTag(tag);
if (tagOutput.children.length > tagNu... | [
"onFieldTagsKeyDown(event) {\n let me = this;\n\n if (event.key === 'Enter') {\n Neo.main.DomAccess.getAttributes({\n id : event.target.id,\n attributes: 'value'\n }).then(data => {\n VNodeUtil.findChildVnode(me.vnode, {classNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert subnet mask format to prefix length format | function mask2prefix(s_ip){
var a_ip = s_ip.split('.');
var i_ip = ip_num(a_ip);
var b_ip_r = i_ip.toString(2).split('').reverse().join('');
var i_ip_r = parseInt(b_ip_r,2);
var prefix = 0;
while(i_ip_r & 0x1){
prefix++;
i_ip_r = i_ip_r>>>1;
}
if(i_ip_r!=0)
return null;
return prefix;
} | [
"function createNetmaskAddr(bitCount) {\r\n var mask = [],\r\n i, n;\r\n for (i = 0; i < 4; i++) {\r\n n = Math.min(bitCount, 8);\r\n mask.push(256 - Math.pow(2, 8 - n));\r\n bitCount -= n;\r\n }\r\n return mask.join('.');\r\n}",
"function getIpRangeFromAddressAndNetmask(st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO / fullDetails method refactor add an additional join the Images table on Blog ID to retrieve image paths without requiring a second query allBlogsDetails implement similiar join to return images of all blogs formatting of resuls should be the same with a key of "urls" containing an array of relevant image links | async fullDetails( blog_id ) {
if( !blog_id ) return "Missing ID"
const blog_details = await db(this.name).select(
'Blogs.id',
'Blogs.title',
... | [
"function getAllImageFeed(callback) {\n let sqlString = 'SELECT image_feed.user_id, image_feed.image_approved, image_feed.image_is_active, image_feed.image_feed_id, image_feed.image_timestamp, image_feed.image_id,'+'image.user_id, image.image_approved, image.image_is_active, image.image_thumbnail_url, image.im... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
query RAC by activation code, return in json format | function queryRACByActivationCode(req, res) {
RAC.find(
{
'activationCodes.code': req.query.code
})
.then(doc => {
res.json(doc);
})
.catch(err => {
res.status(500).json(err);
})
} | [
"function getActiveHacs(){\n\tvar sql = \"SELECT * FROM info_hac where activation_code is not null and activation_code <> 'NULL'\";\n\tvar hacs = [];\n\texecuteSql(sql, null, \n\t\tfunction(rows){\n\t\t\tif(rows) hacs.push(rows);\n\t\t}, \n\t\tfunction(err){\n\t\t\tconsole.log(\"Error: failed when get active HAC li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Discards the Printer object ePosDev.deleteDevice(printer, callback_deleteDevice); | function callback_deleteDevice(errorCode) {
console.log('callback_deleteDevice called');
//Terminates connection with device
ePosDev.disconnect();
console.log('disconnect with invoice printer');
} | [
"function deleteLinkFromDev(dev){\n\tif(globalInfoType == \"JSON\"){\n var devices = getDevicesNodeJSON();\n }else{\n var devices =devicesArr;\n }\n\tvar allline =[];\n\tfor(var i = 0; i < devices.length; i++){ // checks if the hitted object is equal to the array\n\t\tallline = gettargetmap(de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Associates behaviors with this set of styles. | withBehaviors(...behaviors) {
this.behaviors =
this.behaviors === null ? behaviors : this.behaviors.concat(behaviors);
return this;
} | [
"function addStyles() {\n\t styles.use();\n\t stylesInUse++;\n\t}",
"addInteraction(interaction) {\n // Maybe have a list of interactions that are all handled??\n this.interactions[interaction.type] = interaction;\n return this;\n }",
"function appearanceBehavior(value, styles) {\n return new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fades out the ripple element. | fadeOut() {
this._renderer.fadeOutRipple(this);
} | [
"function fadeOut() {\n anime({\n targets: [\".logo\", \".burger\", \".navbar-right\", \".home-text1\", \".home-text2\", \".home-text3\", \".arrow-button\", \".socials\"],\n keyframes: [\n {\n opacity: 0,\n translateY: 50,\n easing: \"easeInCubic\",\n duration: 300,\n },... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open/close the tutorial modal This method may be triggered via `EventBus.trigger()` | tutorial_toggle() {
if (this.isTutorialDialogOpen()) {
this.tutorial_close();
return;
}
this.tutorial_open();
} | [
"onCreateEventClick() {\n set(this, 'showCreateEventModal', true);\n }",
"close() {\n this.showModal = false;\n\n this.onClose();\n }",
"function open_prediction_modal(app, {ack, payload, context}, title){\n \n // Acknowledge the command request\n ack();\n \n // Return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints a hint about valid location parameters | function printOpenWeatherMapsLocationHint () {
console.log(' "location" contains get parameters to send to api.openweathermap.org/2.5/forecast to specify forecast location')
console.log(' Valid key value pairs are:')
console.log(' "q": "CITY_NAME,ISO_3166_COUNTRY_CODE"')
console.log(' OR')
console.log... | [
"function printLatitudeHint () {\n console.log(' \"lat\" is the north latitude(north is positive, south is negative) in degrees')\n console.log(' latitudes are between -90 and 90 degrees')\n console.log(' A typical \"lat\" looks like: \"lat\": 40.596')\n}",
"function printLongitudeHint () {\n console.log('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates cart display with the listings stored in the ListingID cookie should be called when page is refreshed | function updateCartOnLoad(){
console.log("updateCartOnLoad()");
var cookieString = getCookie('ListingID');
if(cookieString == "") {
return;
}
var ids = cookieString.split('|');
var i;
for(i = 0; i < ids.length; i++) {
updateCart(ids[i]);
}
document.getElementById("cart_quantity").innerHTML = cartQuantity;
... | [
"function updateCart() {\n\tsaveFormChanges();\n\trenderCart();\n}",
"function updateAnalyticsCart() {\n if (typeof s_setP !== 'undefined') {\n $.ajax({\n dataType: \"json\",\n url: webContextRoot + '/xhr/data/adobe-analytics-cart.jsp',\n data: '',\n success: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translate the query filter name to the API return item filter name | function filterToItemFilter(filter) {
return filter.charAt(0).toUpperCase() + filter.slice(1);
} | [
"function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n\n return function filterFn(item) {\n var toMatch = angular.lowercase(item.name);\n\n return (toMatch.indexOf(lowercaseQuery) !== -1);\n };\n }",
"function formFilterString(){\n\t\t HK.tmpStr.sort();\n\t\t HK.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Boilerplate Code Helper to find one of the configured scopes (home_id, mobile_id, ...) | function getProfileScope() {
var requestScope = context.request.query.scope ||
context.request.body.scope;
var scopes = requestScope.split(' ');
var required_scope = _.find(scopes, function(scope) {
return supported_scopes[scope];
});
return required_scope;
} | [
"getPlaceHolder () {\n const { activeType, activeScope, isSearchBoxFocused } = this.state,\n scopeFilters = searchUtil.getScopeFilters(),\n activeFilterType = activeType === 'all' ? 'anything' : _.get(_.find(typeFilters, ['action', activeType]), 'placeholder'),\n activeFilterScope = _.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compile and output a complete module. / Compilation happens in 3 phases: / 1. Parse translate a JS program to a syntax tree. / 2. Compile first pass compilation of the program to a module. / 3. resolve final stage of linking up unresolved reference in the input program. | function compile(code, output) {
var syntax = esprima.parse(code);
var compiler = new FirstPassCodeGen();
var module = compiler.compile(syntax);
module.resolve();
module.output(output);
return true;
} | [
"_compile(content, filename, filename2) {\n\n content = internalModule.stripShebang(content);\n\n // create wrapper function\n var wrapper = Module.wrap(content);\n\n var compiledWrapper = vm.runInThisContext(wrapper, {\n filename: filename,\n lineOffset: 0,\n displayErrors: true\n });... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves a headline and posts to twitter, determined by the user plainText: headline provided by the markov function | function saveHeadline(plainText) {
console.log(plainText);
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('\n\nPost to Twitter and Save? (1 for Yes, 2 for No) ',
(answer) =>
{
// TODO: Log the data in a database
if(answer == '1')
{
fs.appendFile... | [
"function postToTwitter(markovHeadline)\n{\n\tT.post('statuses/update', { status: markovHeadline }, function(err, data, response) {\n\t\tconsole.log(data);\n\t})\n}",
"function writeTwitter(nam,handl){\n\t // takes twitter name from link area box and writes it\n\t \n\t // check for blanks\n\t if ((nam==\"\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates zoom UI from local storage | function updateZoomUI () {
$("#mapZoom").prop('value', localStorage.getItem("userZoom") );
$(".zoomValue").text(localStorage.getItem("userZoom"));
} | [
"function onZoom()\r\n{\r\n\tevaluateLayerVisibility();\r\n\t$(\"#zoomlevel\").val(Math.floor(map.getView().getZoom()));\r\n}",
"function update() { \n set_zoom_button_mode()\n show_zoom_button_tooltip(tooltip_showing)\n }",
"function updateUI() {\n if (isSmall) {\n view.ui.add(expandLegend, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to return a sorted unique array of all asset files out of the asset object | getAssetFiles(assets) {
const files = _.uniq(Object.keys(assets).filter(assetType => assetType !== 'chunks' && assets[assetType])
.reduce((files, assetType) => {
let asset = assets[assetType];
return files.concat(Array.isArray(asset) ? asset.map(v => v.file) : asset);
}, []));
files.... | [
"distinctStyleAssetsBase() {\n let assets = [];\n const clean = [];\n // CSS\n if (this.css.length > 0) {\n this.css.forEach((file, index, arr) => {\n assets = assets.concat(file.assets);\n });\n const group = helper.groupBy(assets, b => b.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
After lands on the page, AJAX in the resources API with jQuery and let that be the returned data that's named 'resources. Check to see if the the component is mounted before setting state with data and set mounting to false on unmount to prevent a memory leak. Read more at and | componentDidMount() {
$.ajax({
url: "/api/resources",
dataType: 'json',
success: function(resourceTypes) {
if(this._mounted != false) {
/* ...create two variables: one that will be an array of
* resource types and another that will be an array of
* resources type... | [
"componentDidMount() {\n this._isMounted = true;\n this.loadRecommendedItems();\n }",
"function postMount() {\n fetchReleases().then(response => {\n $$invalidate('releases', releases = response.data);\n });\n }",
"function postMount() {\n fetchWeather().then(r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET to "/dashboard" Show dashboard with user's events and list upcoming meetups | async function dashboard(req, res, next) {
// find current user
let user = await findUserByToken(req, next);
// if user is not confirmed
if (!user.confirmed) {
// redirect to account requests
//(which will redirect unconfirmed user to newAccountRequest page)
console.log("redirecting unconfirmed user... | [
"function listUpcomingEvents() {\n const calendarId = 'primary';\n // Add query parameters in optionalArgs\n const optionalArgs = {\n timeMin: (new Date()).toISOString(),\n showDeleted: false,\n singleEvents: true,\n maxResults: 10,\n orderBy: 'startTime'\n // use other optional query parameter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. | function completeOutstandingRequest(fn) {
try {
fn.apply(null, sliceArgs(arguments, 1));
} finally {
outstandingRequestCount--;
if (outstandingRequestCount === 0) {
while (outstandingRequestCallbacks.length) {
try {
outstandingRequestCallbacks.pop()();
}... | [
"function debounce(quietMillis, fn, ctx) {\r\n ctx = ctx || undefined;\r\n var timeout;\r\n return function () {\r\n var args = arguments;\r\n window.clearTimeout(timeout);\r\n timeout = window.setTimeout(function () {\r\n fn.apply(ctx, args);\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setup the paging text | function setupPagingDisplayText(p_name, p_page, p_interval, p_total) {
var l_range_low = 0;
var l_range_high = 0;
//text display
l_range_high = (p_total < p_interval) ? p_total : (p_interval * p_page);
l_range_low = (p_total < p_interval) ? 1 : (l_range_high ... | [
"function initPaging() {\n vm.pageLinks = [\n {text: \"Prev\", val: vm.pageIndex - 1},\n {text: \"Next\", val: vm.pageIndex + 1}\n ];\n vm.prevPageLink = {text: \"Prev\", val: vm.pageIndex - 1};\n vm.nextPageLink = {text: \"Next\", val: vm.pageIndex + 1};\n }",
"function setup... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`deleteGraph` removes all triples with the given graph from the store | deleteGraph(graph) {
return this.removeMatches(null, null, null, graph);
} | [
"removeVertex(vertex) {\n // Delete from nodes property of graph\n this.nodes.delete(vertex);\n\n // update adjacency lists of other vertices\n for (let v of vertex.adjacent){\n v.adjacent.delete(vertex);\n }\n\n // clear adjacency list of vertex\n vertex.adjacent.clear();\n }",
"delete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render individual sock in item.html | function renderMyItemSock(){
$.ajax({
method: "GET",
url: "/api/sock/" + itemHtmlId
}).done(function(sockArr){
sockArr.forEach(function(sock){
$('.sock-html #sock-information .featured-socks').attr('src', sock.image_path);
$('.sock-html .this-box-goes-right .sock-name').append(sock.item_name);
$('.soc... | [
"function render(items) {\n // LOOP\n // var item = ...\n // $(\"div#target\").append(\"<p>\" + item.message + \"</p>\")\n //\n }",
"function render(msg)\n{\n document.getElementById('feeds').innerHTML = msg;\n}",
"function render(packets, selectedIndex) {\n document.getElementById('cards')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: DrawEffectiveness Author: Peter Chen Purpose: New 3PL Lead infographic elements Arguments: DrawEffectiveness(canvas_name, x_position, y_position, date, Dealer_data, Brand_data); Data format: value Example: DrawEffectiveness("myCanvas", 0, 0, 01/01/2012, 400, 1000); | function DrawEffectiveness(c,x,y,date,d,b)
{
var canvas = document.getElementById(c);
var context = canvas.getContext("2d");
context.save();
var lineWidth = 7;
var maxHeight = 200;
var bHeight = 0;
var dHeight = 0;
bHeight = maxHeight * (b-1);
dHeight = maxHeight * (d-1);
//write text
context.beginPat... | [
"function Used_Vehicle_Sale(c, x, y, w, h, d) {\n var canvas = document.getElementById(c);\n var ctx = canvas.getContext(\"2d\");\n ctx.save();\n ctx.scale(w/150,h/130);\n x = x/(w/150);\n y = y/(h/130);\n\n ctx.fillStyle = \"black\";\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function returns a unique list according to the condition. Params 1> arr = array 2> comparisonField = field name. 3> value = field value to compare to. 4> resultFieldValue = the new array returns values of this certain field | findListByCondition(arr, comparisonField, value, resultFieldValue) {
var tempArr = [];
for (var index = 0; index < arr.length; ++index) {
if (arr[index][comparisonField] === value) {
if (!this.isExist(tempArr, arr[index][resultFieldValue])) {
tempArr.pu... | [
"function removeDuplicates(array, fields) {\n var uniques = []\n // Cycle through the array\n array.forEach(function(item) {\n // See if we've seen it, if we haven't seen it, push it to uniques[]\n var seen = uniques.find(function(element, index, array) {\n // check each fields\n var m = true\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map a route to a module view controller The controller module is extended from the Nori.View.BaseSubView module | function mapView(templateID, controllerModID, isRoute, mountPoint) {
_subViewMapping[templateID] = {
htmlTemplate: _template.getTemplate(_subViewHTMLTemplatePrefix + templateID),
controller : createSubView(requireNew(controllerModID)),
isRouteView : isRoute,
mountPoint : mountPoi... | [
"function runRoute(route, queryStrObj) {\n var routeObj = _routeMap[route];\n\n if (routeObj) {\n routeObj.controller.call(window, {\n route: route,\n templateID: routeObj.templateID,\n queryData: queryStrObj\n });\n } else {\n console.log('No Route map... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the given value is a subject reference. | function _isSubjectReference(v) {
// Note: A value is a subject reference if all of these hold true:
// 1. It is an Object.
// 2. It has a single key: @id.
return (_isObject(v) && Object.keys(v).length === 1 && ('@id' in v));
} | [
"function ISREF(value) {\n if (!value) return false;\n return value.isRef === true;\n}",
"function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range$1.is(candidate.insert) && Range$1.is(candidate.replace);\n }",
"contains(value){\n var run... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: handle the button: Add to Following List for company at the right | function onClickFollow2(){
if(compnameComparison[1] === undefined){
notification['warning']({
message: 'Function Error',
description:
'There is no company selected.',
});
}else{
notification['success']({
message: 'Operation Success',
description:
`${co... | [
"function onClickFollow1(){\n if(compnameComparison[0] === undefined){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operation Success',\n description... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a string and an array of delimiters (which must be strings), returns a split of the string in the order that the delimiters are found. splitStr : String that is to be split splitDelimiters : Array of delimiters to split on callback : (String, Array of Strings > void) return : Array of Array of Strings The optiona... | function multiSplit(splitStr, splitDelimiters, callback)
{
/*
* We use a helper function because this way we can pass the result and use
* tail recursion for each recursive call.
*/
function multiSplitHelp(str, delimiters, result)
{
var i;
var minI;
var minIndex = -1;
/*
* For each delimiter, find ... | [
"function split(str, delimiter)\n{\n let arr = [], n = 0\n , esc = -99\n , s = ''\n\n for (let i=0; i<str.length; i++) {\n switch(str[i]) {\n case delimiter :\n if (esc !== (i-1)) {\n arr[n++] = s\n s = ''\n } else s += str[i]\n break\n case '\\\\' :\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
main update function, reads currently selected filters and applies them before updating the display | function update_filters() {
//get currently selected (or unselected values for all ids in columns.head)
for (var i = 0; i < columns.length; i++) {
columns[i].filter = $('#'+columns[i].cl).val();
}
// apply filter
filtered_dataset = full_dataset.filter(filter_function);
filtered_unique_c... | [
"function updateFilter()\r\n\t{\r\n\t\tvar activeCount = filterBox.find(\"input[type=checkbox]\").filter(\":checked\").length;\r\n\r\n\t\tif (activeCount == 0)\r\n\t\t{\r\n\t\t\ttoys.show();\r\n\t\t\tupdateStatus();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\ttoys.show();\r\n\r\n\t\t\r\n\t\ttoys.each(function(index, t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
View for a group of questions. Constructs the answer object from all the user answers | function QuestionView() {
var questionContainer = document.getElementById('system_inputs');
questionContainer.className = 'tab-content';
var resetButton = document.getElementById('resetButton');
var widgets = [];
var that = this;
var lastQuestions;
this... | [
"function getQuestionsWithUserAnswers(data){\n var questions = data.questions;\n var userAnswers = data.userData.questions_answered;\n\n // maps question ids to user answers\n dictOfAnswers = {};\n \n // populate dictOfAnswers with ids of user answers and \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: getNumberOfLayers Usage: returns number of all layers in document Input: Must have an open document Return: Integer | function getNumberOfLayers() {
var desc = getDocumentPropertyDescriptor(TID.numberOfLayers);
var numberOfLayers = desc.getInteger(TID.numberOfLayers);
return numberOfLayers;
} | [
"function getSelectedLayersCount(){\n\t\tvar res = new Number();\n\t\tvar ref = new ActionReference();\n\t\tref.putEnumerated( charIDToTypeID(\"Dcmn\"), charIDToTypeID(\"Ordn\"), charIDToTypeID(\"Trgt\") );\n\t\tvar desc = executeActionGet(ref);\n\t\tif( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){\n\t\t\td... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function checks if the user input is valid in this case, the input is valid if it is not already included in the todolist and it is not an empty string | isInputValid(input) {
return !this.todos.includes(input) && input != '';
} | [
"addNewItem() {\n // we remove whitespace from both sides of the string saved in newItem\n this.newItem = this.newItem.trim();\n if (this.isInputValid(this.newItem)) {\n // if the user input is valid, we add the user input to the todo-list\n this.todos.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor [Arguments] peripheral | Object | Required | The `peripheral` object of noble, | | | which represents this device | constructor(peripheral) {
this._peripheral = peripheral;
this._peripheral_handler = new PeripheralHandler(peripheral);
this._chars = null;
this._SERV_UUID_PRIMARY = '6e400001b5a3f393e0a9e50e24dcca9e';
this._CHAR_UUID_COMMAND = '6e400002b5a3f393e0a9e50e24dcca9e';
this._CHAR_UUID_NOTIFY = '6e400... | [
"constructor(capacitance, connections, chargeResistance, dischargeResistance) {\r\n //capacitance in Farad, array containing anode and cathode, resistance between\r\n //anode and voltage source and resistance between anode and ground\r\n this.connection1 = connections[0];\r\n this.groundConn = connectio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert an arg string to an array of args. Handles escaping | function argStringToArray(argString) {
const args = [];
let inQuotes = false;
let escaped = false;
let arg = '';
function append(c) {
// we only escape double quotes.
if (escaped && c !== '"') {
arg += '\\';
}
arg += c;
escaped = false;
}
f... | [
"_parse(args) {\n const parsed = args.map(arg => {\n if (arg.includes('=')) {\n const [flag, value] = arg.split('=');\n const command = this._commandParser.getCommand(flag);\n return new Argument(command, value);\n } else {\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if a operator is pressed, switch inputs and clear the screen | function OperatorPressed(pressedOp)
{
//console.log("Operator: " + pressedOp);
if(input1 != "" && input2 != "")
{
workingOnCalculation = true;
}
if(input1 == "" && input2 =="")
{
return;
}
//if there is no current operator
//then set to that operator and switch inp... | [
"function pressEquals() {\n\t// if an operator was just pressed, prior to pressing equals, \n\t// ignore that operator\n\tif (opPressed) {\t\n\t\tif (firstOperator !== NO_OP) {\n\t\t\tlet res = operate(firstOperator, firstValue, lastValue);\n\t\t\tlastValue = res;\n\t\t}\n\t\topPressed = false;\n\t}\t\n\t// a value... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO Pedestrians Same as cross traffic TODO Function to check collisions | function checkCollisions() {
// check lTraffic
var numObs = lTraffic.length;
var i = 0;
for (i = 0; i < numObs; i++){
if (rectOverlap(userCar, lTraffic[i])) {
handleCollision();
}
}
// TODO check rTraffic
numObs = rTraffic.length;
for (i = 0; i < numObs; i++) {
if (rectOverlap(userCar, rTraffic[i])) {
... | [
"detectCollisions() {\n const sources = this.gameObjects.filter(go => go instanceof Player);\n const targets = this.gameObjects.filter(go => go.options.hasHitbox);\n\n for (const source of sources) {\n for (const target of targets) {\n /* Skip source itself and if source or target is destroyed.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief Calculates minimum value of cover height used in calculation of flat terrain spotting distance using logarithmic variation with height. Used for burning pile and surface fire spotting distances. \param firebrandHt Maximum firebrand height (ft+1) \param appliedDownWindCoverHeight Adjusted downwind canopy height b... | function criticalCoverHeight (firebrandHt, appliedDownWindCoverHeight) {
const criticalHt = firebrandHt > 0 ? 2.2 * Math.pow(firebrandHt, 0.337) - 4 : 0
return Math.max(appliedDownWindCoverHeight, criticalHt)
} | [
"function distanceFlatTerrain (firebrandHt, criticalCoverHeight, u20) {\n // Wind speed must be converted to mi/h\n return criticalCoverHeight <= 0 || firebrandHt <= 0 ? 0 : 5280 * 0.000718 * (u20 / 88) * Math.sqrt(criticalCoverHeight) * (0.362 + Math.sqrt(firebrandHt / criticalCoverHeight) / 2 * Math.log(firebra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que captura la pulsacion de la tecla F5 y solicita la bajada de objetos de negocio | function tratarF5()
{
if (atcl_navegador.esIE())
{
if(event.keyCode == 116) {
// Eliminanos el codigo de tecla para evitar el refresco del navegador
event.keyCode = 0;
// Enviamos la solicitud a traves del conector de comunicaciones
if (utils_isComuServidorWeb()){
utils_servidorWeb_enviaPlano("CTE_B... | [
"mood_check_compute() {\n\n // get the phq uds and tally the score\n let mood_uds = this.uds.get_all(RESPONSE_MOOD);\n let score = 0;\n for(let ud of mood_uds) {\n score = Math.max(score, Number(ud.response));\n }\n\n if(score < MOOD_LOWEST_FAIL) {\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create number of rows | function createRow (number) {
let newRow = document.createElement('tr');
for (let i = 0; i <= number; i++){
newRow;
}
return
} | [
"function initializeRows() {\n resultContainer.empty();\n var resultsToAdd = [];\n for (var i = 0; i < results.length; i++) {\n resultsToAdd.push(createNewRow(results[i]));\n }\n resultContainer.append(resultsToAdd);\n }",
"function calcNumRows(){\n \tvar map = document.getEl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
waitforButton: Show the extension's button in the omnibox for the given tab; wait for it to be clicked; hide it. Also hide when aborted. | function waitforButton(tabid) {
waitfor() {
chrome.pageAction.show(tabid);
function listener(tab) { if (tab.id == tabid) resume(); }
chrome.pageAction.onClicked.addListener(listener);
}
finally {
chrome.pageAction.onClicked.removeListener(listener);
chrome.pageAction.hide(tabid);
}
} | [
"click_meetingOne_ResultTab_FullReplayButton(){\n this.meetingOne_ResultTab_FullReplayButton.waitForExist();\n this.meetingOne_ResultTab_FullReplayButton.click();\n }",
"clickUpcomingRacesTab(){\n //this.upcomingRacesTab.waitForExist();\n this.upcomingRacesTab.click();\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fungsi string concat untuk menggabungkan string | function concat(){
var kalimat1 = 'saya';
var kalimat2 = kalimat1.concat(" belajar")
console.log(kalimat2);
console.log(kalimat2.concat(" di", " pasar"));
} | [
"function stringconcate(val){\n\ttemp1=temp1.concat(val);\n\tdisplaydata(temp1);\n}",
"function sc_stringAppend() {\n for (var i = 0; i < arguments.length; i++)\n\targuments[i] = arguments[i].val;\n return new sc_String(\"\".concat.apply(\"\", arguments));\n}",
"function CONCATENATE() {\n for (var _len4 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switch sort buttons between "Name", "Reviewers", "Rating", and "Price", when clicked | switchSortButtons(selected) {
for(let button of $("#btn-sort button")) {
if(button === selected[0]) {
let icon = button.children[0];
let font = icon.getAttribute("class");
let sort = button.getAttribute("value").split('-');
this.sortKey... | [
"sortOnClick(sortBy) {\n\n if (this.state.sortBy === sortBy) {\n this.setState({ sortAscending: !this.state.sortAscending });\n } else {\n // by default names are sorted ascending and amounts descending\n const ascending = sortBy === 'name' ? true : false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pass SHA1 instead of SHA256 into hmac constructor. | function sha1Hmac(pass) {
sjcl.misc.hmac.call(this, pass, sjcl.hash.sha1);
} | [
"function hmacsha1(key, text)\n {\n return crypto.createHmac('sha1', key).update(text).digest('base64')\n }",
"function core_hmac_sha1(key, data) \n { \n var bkey = str2binb(key); \n if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); \n \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Credit to: Search games function for games.html webpage search bar | function search_games() {
var searchTerm = document.getElementById('searchBar').value
// To eliminte confusion between capital vs lowercase letters
searchTerm = searchTerm.toLowerCase();
// Gets elements by class name
var gameList = document.getElementsByClassName('games');
// Loops through the list of gam... | [
"function handleSearch(){\n var term = element( RandME.ui.search_textfield ).value;\n if(term.length){\n requestRandomGif( term, true);\n }\n}",
"function searchtoresults()\n{\n\tshowstuff('results');\n\thidestuff('interests');\t\n}",
"function perform_search() {\n if (lastSearchType == \"D\") {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searchWikipedia('Terminator'); return an observable object | function getWikipediaSearchResults(term) {
return Observable.create(function forEach(observer) {
let cancelled = false;
const encodeTerm = encodeURIComponent(term);
const url = `https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=${encodeTerm}&callback=?`;
$.getJSO... | [
"function searchWikipedia (term) {\n\t$results.empty();\n\treturn $.ajax({\n\t url: 'http://en.wikipedia.org/w/api.php',\n\t dataType: 'jsonp',\n\t data: {\n\t\taction: 'opensearch',\n\t\tformat: 'json',\n\t\tsearch: global.encodeURI(term)\n\t }\n\t}).promise();\n }",
"function performWikiTopicSear... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We expect an object to only be of one element kind. | function assertKind(expected, obj) {
if (support_smi_only_arrays) {
assertEquals(expected == element_kind.fast_smi_only_elements,
%HasFastSmiOnlyElements(obj));
assertEquals(expected == element_kind.fast_elements,
%HasFastElements(obj));
} else {
assertEquals(expected =... | [
"function isObject(element) {\n if (!element) return false\n if (typeof element !== 'object') return false\n if (element instanceof Array) return false\n return true\n}",
"function firstCollectionElem(obj){\n\t//get first element, if any\n\tvar elem = $(obj).first();\n\t//check if collection is empty ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the list of coupons that have been collected by that user | 'getCollectedCoupons'(userID){
console.log('[server/main]: getCollectedCoupons called for userID: ' + userID);
getCollectedCoupons(userID, function(err, result){
if(err){
throw new Meteor.Error(err, result)
}
else{
console.log('[server/main]: getCollectedCoupons r... | [
"'collectCoupon'(userID, couponID){\n couponIsCollectable(userID, couponID, function(error, isCollectable){\n console.log(\"[server/main] collectCoupon, Collecting coupon = \" + couponID);\n if(isCollectable){\n // Collect the coupon\n UserDB.update({\"_id\" : userID}, {$addToSe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents a event set within a and its associated set of tracks. | function EventSet(opt_events) {
this.bounds_dirty_ = true;
this.bounds_ = new tr.b.Range();
this.length_ = 0;
this.guid_ = tr.b.GUID.allocateSimple();
this.pushed_guids_ = {};
if (opt_events) {
if (opt_events instanceof Array) {
for (var i = 0; i < opt_events.length; i++)
... | [
"function Set() {\n this._items = [];\n }",
"function EntitySet() {\n /**\n * All the entities in the set.\n * @type {DSSet.<Entity>}\n */\n var entities = new DSSet();\n\n /**\n * Newly added entities to the set.\n * @type {DSSet.<Entity>}\n */\n var addedEntities = new DSSet();\n\n /*... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SND BANK SELECT | PROGRAM | GROUP | NUMBER MSB | LSB | NUMBER | | ++++ 088 | 000 | 001 064 | User SN Drum Kit | 0001 0064 ++++ 088 | 064 | 001 026 | Preset SN Drum Kit | 0001 0026 | function collectSND_Preset() {
collect_bank([88,88],[64,64],[0,25],'snd');
} | [
"function _moduleAddr(addr) {\r\n if (addr < 16) {\r\n switch (addr) {\r\n case 0:\r\n rpio.open(16, rpio.OUTPUT, rpio.HIGH);\r\n rpio.open(18, rpio.OUTPUT, rpio.HIGH);\r\n rpio.open(29, rpio.OUTPUT, rpio.HIGH);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates an export of predictions (frozen and edited) as CSV and downloads it. Uses global state's seizureData object. | export() {
let { output, outputFrozen } = this.appState.data.seizureData;
// Generate CSV
let csv = 'is-seizure,is-seizure-user-corrected\n';
for( let i = 0; i < output.length; i++ ) {
csv += `${Number(outputFrozen[i])},${Number(output[i])}\n`;
}
// Generate data URI and associated link... | [
"function csvExportRecommenderData() {\n csvExportUser()\n csvExportVideoHistory()\n csvExportVideoAnalytics()\n csvExportFavouritedVideos()\n csvExportSkillsSelectedFreq()\n}",
"downloadData() {\n let domEl = document.createElement('a');\n domEl.id = \"download\";\n domEl.down... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles pushing and popping TextareaStates for undo/redo commands. I should rename the stack variables to list. | function UndoManager(callback, panels) {
var undoObj = this;
var undoStack = []; // A stack of undo states
var stackPtr = 0; // The index of the current state
var mode = "none";
var lastState; // The last state
var timer; // The setTimeout handle for cancelling th... | [
"function saveUndoState()\n{\n\t// $.extend is used to deep copy the array because JIT doesn't >:|\n\tundoStates.push({ graph: $.extend(true, [], rgraph.toJSON('graph')), root: rgraph.root.id});\n\tif(undoStates.length > MAX_UNDO)\n\t\tundoStates.shift();\n\t$('#undo').removeAttr('disabled');\n}",
"function Texta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a jQuery container, activate all tooltips within the container. | function ActivateTooltips(container) {
if (container && container.tooltip) {
container.find('span[rel="tooltip"]').tooltip();
}
} | [
"function tooltipInit() {\n\n jQuery(\"[data-toggle='tooltip']\").tooltip();\n }",
"function plugin_jquery_twitterTip($){\n /* ===========================================================\n * bootstrap-tooltip.js v2.0.2\n * http://twitter.github.com/bootstrap/javascript... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |