query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Watch the babel configuration file and warn to reload the CLI if it changes. | function watchBabelConfig(projectRoot, configPath) {
if (watchingFiles.includes(configPath)) {
return;
}
watchingFiles.push(configPath);
const configName = _path().default.relative(projectRoot, configPath);
(0, _fs().watchFile)(configPath, (cur, prev) => {
if (prev.size || cur.size) {
_intern... | [
"watch() {\n chokidar.watch(`${this.app.cwd}/config.json`, { ignoreInitial: true }).on('all', () => this.load());\n }",
"function watcher() {\n mode = 'watch'\n watch( globPath )\n .on( 'change', transpile )\n}",
"async function watch([arg, ...moreArgs]) {\n const funs = steps[arg || 'webpack'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a new Previous Grant row to the table | function AddPreviousGrantRow() {
// get the field values
var projectName = $("#projectName").val();
var grantId = $("#grantId").val();
var keyOutcomes = $("#keyOutcomes").val();
// create the markup that needs to be added to the table
var markup = "<tr><td><input type='checkbox' name='rpgRecord... | [
"function prevRow() {\n\tif (currentIndex <= 1) {\n\t\t// start of list\n\t} else {\n\t\tcurrentIndex--;\n\t\tselectRow(currentIndex);\n\t}\n}",
"prev() {\n if (this._selectedIndex >= 0) {\n this._focusRowByIndex(this._selectedIndex - 1);\n }\n }",
"previous() {\n this.send('onTableRowClick', t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the (strongly typed) end angle | get endAngle() { return Angle_1.Angle.createRadians(this._radians1); } | [
"static angle(start, end) {\n var tDot = start.x * end.x + start.y * end.y;\n var tDet = start.x * end.y - start.y * end.x;\n var tAngle = -Math.atan2(tDet, tDot);\n return tAngle;\n }",
"get endDegrees() { return Angle_1.Angle.radiansToDegrees(this._radians1); }",
"getActualEndAn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scrapes the given asset for metadata. | async function scrape(asset) {
return metascraper.scrapeUrl(
asset.url,
Object.assign({}, metascraper.RULES, {
section: $ => $('meta[property="article:section"]').attr('content'),
modified: $ => $('meta[property="article:modified"]').attr('content'),
})
);
} | [
"async fetchMetadata (_collectionId, _assetId) {\n const { address } = constant.opensea.collections[_collectionId]\n\n const res = await fetch(`https://api.opensea.io/api/v1/asset/${address}/${_assetId}`, {\n headers: {\n 'x-api-key': constant.opensea.api_key,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns HTML from a MarkDown AST | function mdAstToHtml(ast, lines) {
if (lines == undefined)
lines = [];
// Adds each element of the array as markdown
function addArray(ast) {
for (let child of ast)
mdAstToHtml(child, lines);
return lines;
}
// Adds tagged content
function addTag(tag, ast,... | [
"toAST(txt) {\r\n return new MarkdownAST(txt)\r\n }",
"get markup() {}",
"function astToHtmlAst(ast) {\n if (ast == null) {\n return []\n }\n if (typeof (ast) !== 'object') {\n // This should never happen\n return []\n }\n function appendText(accum ,htmlAst ,otext) {\n // MD Single spacing\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asigna el plugin ColorBox para cuando den click sobre alguna imagen de la galeria la muestra en un estilo superBox. | function colorBox () {
$('.thumbnail a').colorbox({rel:'thumbnail a', transition:"elastic", maxWidth:"95%", maxHeight:"95%"});
} | [
"function colorbox_call(){\n \n}",
"function activate_colorbox()\n {\n\t\tif($(\"a.colorbox\"))\n\t\t{\n\t\t $(\"a.colorbox\").colorbox({transition:\"fade\", photo:true, width: 800, height: 600, scalePhotos: true});\n\t\t}\n\t\tif($(\".inline\"))\n\t\t{\n\t\t $(\".inline\").colorbox({iframe: true, width... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add disableinteraction layer and adjust the size and position of the layer | function _disableInteraction(){var disableInteractionLayer=document.querySelector(".introjs-disableInteraction");if(disableInteractionLayer===null){disableInteractionLayer=_createElement("div",{className:"introjs-disableInteraction"});this._targetElement.appendChild(disableInteractionLayer);}setHelperLayerPosition.call... | [
"function _disableInteraction () {\n\t var disableInteractionLayer = document.querySelector('.introjs-disableInteraction');\n\t if (disableInteractionLayer === null) {\n\t disableInteractionLayer = document.createElement('div');\n\t disableInteractionLayer.className = 'introjs-disableInteraction';\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
regSE :: SoundMaster > (String, String) > SoundMaster | regSE(path, keyword) {
let audio = SoundMaster.createAudio(path, false),
newList = M_List.Cons({
keyword: keyword,
audio: audio
})(this._seList);
return new SoundMaster(this._bgmList, newList);
} | [
"regBGM(path, keyword, loop) {\n let audio = SoundMaster.createAudio(path, loop),\n newList = M_List.Cons({\n keyword: keyword,\n audio: audio\n })(this._bgmList);\n return new SoundMaster(newList, this._seList);\n }",
"static io_registersound(dir, name, fcn) {\n if (window.S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a row to the academic table. | function addAcademicRow(row, tableId) {
$('#'+tableId).append($('<tr>')
.append($('<td>')
.addClass('dbId')
.html(row.id)
.hide()
)
.append($('<td>')
.addClass('period')
.html(row.period)
)
.append($('<td>')
.addClass('className')
.html(row.className)
... | [
"function addRowToTable(){\n createTableElementsFromInputs();\n postTableElementsFromInputs();\n }",
"function appendRow() {\n var tbl = document.getElementById('E_Table'), // table reference\n row = tbl.insertRow(tbl.rows.length), rowx;\n // insert table cells to the new row\n \n create... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[2sample ttest]( This is to compute two sample ttest. Tests whether "mean(X)mean(Y) = difference", ( in the most common case, we often have `difference == 0` to test if two samples are likely to be taken from populations with the same mean value) with no prior knowledge on standard deviations of both samples other than... | function t_test_two_sample(sample_x, sample_y, difference) {
var n = sample_x.length,
m = sample_y.length;
// If either sample doesn't actually have any values, we can't
// compute this at all, so we return `null`.
if (!n || !m) return null ;
// default difference (... | [
"function t_test_two_sample(sample_x, sample_y, difference) {\n\t var n = sample_x.length,\n\t m = sample_y.length;\n\n\t // If either sample doesn't actually have any values, we can't\n\t // compute this at all, so we return `null`.\n\t if (!n || !m) return null;\n\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a boolean telling if a getter exists | static hasGetter(name) {
return !!this.getGetter(name);
} | [
"function isGetter(obj, prop) {\r\n // Object.getOwnPropertyDescriptor cannot find getter/setter of object instance.\r\n // So we must seek in the instance's prototype.\r\n const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), prop);\r\n return Boolean(descriptor) && (typeof des... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getUser() .then(user => login(user)) .then(status => showPage(status)) .then(page => console.log(page)) .catch(err => console.log(err)) async ... await keywords | async function main() {
try {
const user = await getUser();
const status = await login(user)
const page = await showPage(status);
console.log(user, status, page)
}
catch (err) {
console.log(err)
}
} | [
"async function start() {\n try {\n let user = await getUser();\n let success = await login(user);\n console.log(success);\n } catch (err) {\n console.log(err)\n }\n finally {\n console.log('done');\n }\n}",
"async function displayUser(){\n\n try{ \n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
|| FUNCTION: MediaStart || PARAMETERS: || RETURNS: || PURPOSE: Starts the media cycling. Call with 'OnLoad' from body || tag to have an image start cycling on page load. || || | function MediaStart()
{
iInternalCount = TimeInSecondsBetweenCycles * 1000;
MediaStop();
MediaInternalCycle();
} | [
"function MediaInternalCycle()\r\n{\r\n (iCurrentImage == (xMediaContent.length - 2)) ? iCurrentImage = 0 : iCurrentImage+=2;\r\n if( document.MEDIAIMAGE ) document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];\r\n\r\n xTimerHandle = setTimeout(\"MediaInternalCycle()\", iInternalCount);\r\n bTimerRun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a path parameter from the HTTP request dataset | removePathParameter(key) {
if (key) {
delete this.pathParams[key.toLowerCase()];
}
return this;
} | [
"function withoutQuery(path) {\n return path.replace(queryMatcher, '');\n}",
"[types.UNSELECT_API_PARAM](state, paramName) {\n const i = _.findIndex(state.queryParams, param => !_.isUndefined(param[paramName]));\n\n if (i >= 0) {\n state.queryParams.splice(i, 1);\n }\n }",
"function removePath(u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trunc() Integral Part of a Number | function trunc(num) {
return Math[num < 0 ? 'ceil' : 'floor'](num);
} | [
"function trunc(num) {\r\n\treturn Math[(num*100) < 0 ? 'ceil' : 'floor'](num);\r\n}",
"function trunc(x){\n return (x<0?Math.ceil(x):Math.floor(x));\n}",
"function floor(num){\n \n \n return parseInt(num)\n}",
"floor() {\n const one = new Ratio(BigInt(1), BigInt(0))\n const trunc = simplify... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fromUncheckedUnaryType :: (Type > Type) > Type > Type | function fromUncheckedUnaryType(typeConstructor) {
var t = typeConstructor (Unknown);
return def (t.name) ({}) ([Type, Type]) (fromUnaryType (t));
} | [
"function fromUncheckedUnaryType(typeConstructor) {\n var t = typeConstructor(Unknown);\n var _1 = t.types.$1.extractor;\n return CheckedUnaryType(t.name, t.url, t._test, _1);\n }",
"function fromUncheckedUnaryType(typeConstructor) {\n var t = typeConstructor (Unknown);\n var _1 = t.types.$1.extra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update the table when the league changes and automatically reload the table with league information at set intervals | async reload(leagueChanged) {
var selectBox = document.getElementById("selectLeague");
var selectedValue = selectBox.options[selectBox.selectedIndex].value;
this.setState({teams: []});
this.setState({isLoading: "spinner"});
fetch({
query: "{ gameweek }",
}).then(res => {
this.setState({gameweek: res... | [
"function updateTable() {\n // empty table\n $(\"#table-body\").empty();\n\n // updates values in table for each object key\n for (i = 0; i < trainNames.length; i++) {\n //ensures that time is in the past\n firstTimeConverted = moment(trainTimes[i], \"hh:mm\").subtr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to validate confirmation code form | validateConfirmationForm() {
return this.state.confirmationCode.length > 0;
} | [
"function validateConfirmationForm() {\n return fields.confirmationCode.length > 0;\n }",
"function validateConfirmationForm() {\n return fields.confirmationCode.length > 0;\n }",
"function activation_form_validation(){\n\n \n if(activation_code.value.localeCompare('') == 0) {\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fill the positions with 0,0 values for each colorZone | function clearCentroidPositions() {
colorCentroidStructure = [];
colorZones.forEach(function () {
// X Y count SumSQ SumSQ/sqrt(N)
colorCentroidStructure.push(new XY(0, 0, 0, 0, 0));
});
} | [
"_populateGhostPosition() {\n let coordinateArrays = Object.values(this.ghostPosition);\n coordinateArrays.forEach(array => {\n array.forEach(coordinate => {\n let [row, col] = [coordinate[0], coordinate[1]];\n if (this.field[row] && this.field[row][col] !== th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the shape of the reshaped and permuted input Tensor before any cropping is applied. The new shape will be: [batch / prod(blockShape),inputShape[1] blockShape[0], ..., inputShape[M] blockShape[M1],inputShape[M+1], ..., inputShape[N1]] See step 3: | function getReshapedPermuted(inputShape, blockShape, prod, batchToSpace) {
if (batchToSpace === void 0) { batchToSpace = true; }
var reshapedPermuted = [];
if (batchToSpace) {
reshapedPermuted.push(inputShape[0] / prod);
}
else {
reshapedPermuted.push(inputShape[0] * prod);
}
... | [
"function getReshaped(inputShape, blockShape, prod, batchToSpace) {\n if (batchToSpace === void 0) { batchToSpace = true; }\n var reshaped = [];\n if (batchToSpace) {\n reshaped = reshaped.concat(blockShape.slice(0));\n reshaped.push(inputShape[0] / prod);\n reshaped = reshaped.concat(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the value. Complex number renderer. | render(initialValue) {
let returnValue = initialValue;
if (this.context._regexSpecial.nonNumericValue.test(initialValue) === false) {
let realPart = returnValue.realPart,
imaginaryPart = returnValue.imaginaryPart,
sign,
significantDigits = thi... | [
"printComplexNumber() {\n //outputs to the console the value of the real number + the imaginary number with an i attached to it\n return console.log(this.realValue + \" + \" + this.imaginaryValue + \"i \");\n }",
"render()\n {\n //the result to return\n var res;\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initial implementation notes: next word on , if empty, then set value="" after if value == currentword, mark as correctword else, mark as incorrectword if value.length != currentword[:value.length], mark as incorrectword else, mark as currentword | function checkWord(word) {
var wlen = word.value.length;
// how much we have of the current word.
var current = $(".current-word")[0];
var currentSubstring = current.innerHTML.substring(0, wlen);
// check if we have any typing errors
if (word.value.trim() != currentSubstring) {
current.c... | [
"function checkAndMarkClozeWord(ele) {\n var result = checkClozeWord(ele);\n if (result != '') {\n markClozeWord(ele, CORRECT);\n ele.value = result;\n return CORRECT;\n } else if (!ele.value) {\n markClozeWord(ele, NOT_ATTEMPTED);\n return NOT_ATTEMPTED;\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. Get the sum of all even numbers between 1 and 1000. | function sum_even_numbers(){
var sum = 0;
for(var i = 1; i <= 1000; i++) {
if (i % 2 === 0)
sum += i;
}
return sum;
} | [
"function even1000() {\r\n var sum = 0;\r\n for (var i = 1; i <= 1000; i++) {\r\n if (i % 2 === 0) {\r\n sum += i;\r\n }\r\n }\r\n return sum;\r\n}",
"function getEven1000()\n{\n var sum = 0;\n for(var i = 1; i <= 1000; i++ )\n {\n if(i % 2 == 0)\n {\n sum+= i;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to make timer field editable This method hard binds focus & blur events to pause & resume and recognizes builtin pretty time (for eg 12 sec OR 3:34 min) It won't recognize user created formats. Users may not always want this hard bound. In such a case, do not use the editable property. Instead bind custom functi... | function makeEditable(timer) {
var element = timer.element;
$(element).on('focus', function() {
pauseTimer(timer);
});
$(element).on('blur', function() {
// eg. 12 sec 3:34 min 12:30 min
var val = $(element)[display](), valArr;
if (val.indexOf('sec') > 0) {
// sec
$(element).data('totalSec... | [
"function TimeEdit(obj)\n{\n\tthis.selIndex = -1;\n\tthis.charIndex = -1;\n\tthis.editBox = obj;\n\tthis.editBox.onFocus = this.editBox.onfocus;\n\tthis.editBox.onBlur = this.editBox.onblur;\n\tthis.editBox.onKeyPress = this.editBox.onkeypress;\n\tthis.editBox.onKeyDown = this.editBox.onkeydown;\n\tthis.editBox.onK... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an action in the diagram | function addAction(label, start, end){
var actionContainer = $("<div></div>").addClass("actionContainer"),
actionBar = $("<div></div>").addClass("actionBar"),
actionLine = $("<div></div>").addClass("actionLine"),
gradMark = $("<div></div>").addClass("gradMark"),
timeLine = $("#timeLine");
actionBar.htm... | [
"addaction() {\n this.actions.push(this.act);\n }",
"function addAction() {\n\t// get inputs\n\tvar newAction = document.getElementById(\"ActionInputName\").value;\n\tvar corrSkill = document.getElementById(\"ActionSelectSkill\").value;\n\n\tif (corrSkill === \"Corresponding Skill\") {\n\t\taler... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove cursor and selection, if there are. cursor = Object describing cursor to manipulate selection = Object describing the selection to manipulate | function cancelCursorSelection (cursor, selection) {
// Clear cursor
let cellCursor = cursor.cell;
if (cellCursor != null) {
if (cellCursor.classList.contains(Reshidden)) {
cellCursor.classList.remove(Reshidden);
}
cellCursor.classList.remove(CursorHighlight);
}
// Clear selection
let cells = selectio... | [
"removeSelection(selection) {\n _.remove(this.cursors, selection.cursor);\n _.remove(this.selections, selection);\n this.cursorsByMarkerId.delete(selection.cursor.marker.id);\n this.emitter.emit(\"did-remove-cursor\", selection.cursor);\n return this.emitter.emit(\"did-remove-selection\", selection);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Photo Layer Key Handling | function photoLayerKeyHandling(e){
if(e.keyCode == 37) // left arrow
{
$("#photoAlbumPrev").focus().click();
}
else if(e.keyCode == 39) // right arrow
{
$("#photoAlbumNext").focus().click();
}
else if(e.keyCode == 27) // right arrow
{
... | [
"function keyUpHandler(e) {\n\tif ($('#overlay').css('visibility') == 'hidden') return\n\t// prevent default keyup behavior\n\te.preventDefault()\n\n\t// current image being show in overlay\n\tvar images = $('.image')\n\tvar cur = images.index(current_image)\n\t// previous image - left arrow\n\tif (e.which == 37) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Right: One angle is a right angle (exactly 90 degrees). Acute: All three angles are less than 90 degrees. Obtuse: One angle is greater than 90 degrees. To be a valid triangle, the sum of the angles must be exactly 180 degrees, and every angle must be greater than 0. If either of these conditions is not satisfied, the t... | function triangle(...angles) {
if (angles.some(isZero) || angles.reduce(sum) !== 180) {
return 'invalid';
} else if (angles.some(isNinetyDegrees)) {
return 'right';
} else if (angles.some(isGreaterThanNinety)) {
return 'obtuse'
} else {
return 'acute';
}
} | [
"function triangle(a1, a2, a3) {\n let total = a1 + a2 + a3;\n let angles = [a1, a2, a3];\n \n if (angles.includes(0) || total !== 180) return \"invalid\";\n if (angles.includes(90)) {\n return \"right\";\n } else if (angles.every(degree => degree < 90)) {\n return \"acute\";\n } else {\n return \"o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Smalltalk class creation. A class is an instance of an automatically created metaclass object. Newly created classes (not their metaclass) should be added to the smalltalk object, see smalltalk.addClass(). Superclass linking is not handled here, see smalltalk.init() | function klass(spec) {
var spec = spec || {};
var that;
if(spec.meta) {
that = new SmalltalkMetaclass();
} else {
that = new (klass({meta: true})).fn;
that.klass.instanceClass = that;
that.className = spec.className;
that.klass.className = that.className + ' class';
}
that.fn = spec.fn || fu... | [
"_createClass (name, superclass, instSlots = {}, classSlots = {}) {\n const metaclass = createClassStub(\n this.loadClass('Metaclass'),\n `${name} class`,\n superclass.class(),\n classSlots\n )\n return createClassStub(metaclass, name, superclass, instSlots)\n }",
"function __makeCla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function gets called when clicking on table filter checkboxes. It builds a list of selected values and then filters the table based on that | function buildAndExecFilter() {
var show = [];
var filters = document.getElementsByName('tablefilter');
for (var i = 0; i < filters.length; i++) {
if (filters[i].checked) {
show.push(filters[i].value);
}
}
execFilter(show); // Filter based on selected values
} | [
"function filterTable() {\n\n// 8. Set the filtered data to the tableData.\n let filteredData = tableData\n\n// 9. Loop through all of the filters and keep any data that\n// matches the filter values\nObject.entries(filters).forEach(([key, value]) => {\nfilteredData = filteredData.filter(row => row[key] === value)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An assert internal to Interrupt that will not get audited. | function assert (condition, ...vargs) {
if (! condition) {
throw new Interrupt.Error(Interrupt.Error.options.apply(Interrupt.Error, [{ $callee: assert }].concat(vargs)))
}
} | [
"interrupt() {\n this.interruptedTime_ = performance.now();\n }",
"Interrupt() {\n\n }",
"onTtsInterrupted() {}",
"interrupted(/* motions */) {\n }",
"interrupt () {\n this._interrupt(true)\n }",
"get interruptible() {\n return this._ctx != null && this._ctx.interruptible;\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open product taxes modal with input name if id!=0 then open with id of data | openSTaxesModalWithData(id , input_value, model_id){
ModalManager.open(<CreateEditTexesModal title = ""
handleClose = {this.handleCloseTaxModal.bind(this)}
setCreatedSTAX = {this.setCreatedSTAX.bind(this)}
setCreatedWSTAX ... | [
"function openAddPromoModal(id) {\n\t$('#serviceId').val(id);\n\taddModal.style.display = \"block\";\n}",
"function modal (isDoublon) {\n if(isDoublon){\n $('#modalDoublon').modal('open');\n } else {\n $('#modalPrice').modal('open');\n $('.co-js-price-modal').val(dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate Account menu items and handle click event. | async function generateAccountsMenu() {
const h = await gen();
const menu = Object.assign(document.createElement('div'), { innerHTML: h });
const me = document.querySelector(SELECTOR_ME);
const userName = me ? me.textContent.trim() : null;
menu.querySelector('#multiacc_menu').addEventListener('click', e => {... | [
"function insertAccounts(accounts) {\n ul = document.createElement('ul');\n document.getElementById('accounts').appendChild(ul);\n\n accounts.forEach(function(item) {\n let li = document.createElement('li');\n li.id = item;\n\n ul.appendChild(li);\n\n let user = document.createE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API list todos options: _page, _limit, _sort, _order, q (search string) | async listTodos(options = {}) {
try {
console.log("Api list todos with params:");
for (let k in options) {
console.log(`${k} => ${options[k]}`);
}
return await axios.get(baseUrl, { params: options });
} catch (e) {
console.log(e);
}
} | [
"function getAll() {\n return todos;\n }",
"function listTodos(cb){\n $fh.cloud(\n {\n path: 'todo',\n method : 'GET'\n },\n function (todoItems) {\n return cb(null, todoItems);\n },\n function (code, errorprops, params) {\n return cb(errorprops);\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CLIENT SIDE Inputs header, h Inputs paylod, p To the function encode to encode in b64 algorithm | function encode(h, p) {
const headerEnc = b64(JSON.stringify(h));
const payloadEnc = b64(JSON.stringify(p));
return `${headerEnc}.${payloadEnc}`;
} | [
"getEncodedString(){let length=this.__data.length;for(;isFinite(this.__length)&&this.__data.length<this.__length;)this.__data.push(0);let raw=String.fromCharCode(...this.__data);return this.__data.length=length,tchmi_base64encode(raw)}",
"encrypt_and_hmac(bytes) {\n \n // parse the json\n var body... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map one enum type to another by value | static mapEnum(value) {
return value;
} | [
"projection(other) {\n // var syms = (this.symbols as any[]).filter(sym => include(other.enum_type.members, sym));\n var syms = this.symbols.filter(sym => other.enum_type.members.includes(sym));\n return new EnumSet(other.enum_type, syms);\n }",
"projection(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handleYearsView handles the tab selector and depending on the number you select the size of the array changes in getLineChartData. | handleYearsView(e) {
this.setState({
salesYearToView: e,
}, () => {
this.getLineChartData();
});
} | [
"function handleYearChange(data) {\n selectYear = data.year;\n setDomains();\n drawChart(currentData);\n}",
"function renderYearListSelector(viewYear) {\n if (yearSelectorSection !== undefined) {\n //\tdisplay 17 years, 8 above and 8 below.\n yearSelectorSection.onscroll = function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createPage(websiteId, page) adds the page parameter instance to the local pages array. The new page's websiteId is set to the websiteId parameter | function createPage(websiteId, page) {
page.websiteId = websiteId;
pages.push(page);
} | [
"function createPage(websiteId, page) {\n var pageId = Math.random(); // random value between 0 and 1\n pageId = pageId * 999; // random rational between 0 and 999\n pageId = Math.floor(pageId);\n\n if (uniqueId(pageId)) {\n var toAdd = {\n \"_id\": pageId,\n \"name\": p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles mouse click check if duck was hit Screen flashes red to simulate a possible killed duck | function handleClick(event) {
if (gameState == "READY") {
level++;
//Shortens game time according to level to make it more difficult
gameTime = 1000 - 100*level;
if (gameTime < 100)
gameTime = 100;
makeDucks();
gameState = "PLAY";
}
else if (gameState == "PLAY") {
//If screen clicked - make gun sho... | [
"function handleClick(e) {\n\t//console.log('here');\n\t// Check that it's the user's turn\n\tif (yourTurn) {\n\t\t// Figure out where has been clicked\n\t\tvar x = event.pageX;\n\t\tvar y = event.pageY;\n\t\tx -= canvas.offsetLeft;\n \t\ty -= canvas.offsetTop;\n\n \t// Figure out which hexagon has been clicked\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scan a literal or distance tree to determine the frequencies of the codes in the bit length tree. | function scan_tree(tree, // the tree to be scanned
max_code // and its largest code of non zero frequency
) {
var n; // iterates over all tree elements
var prevlen = -1; // last emitted length
var curlen; // length of current code
var nextlen = tree[0 * 2 + 1]; // length of next code
... | [
"function scan_tree(tree,// the tree to be scanned\nmax_code // and its largest code of non zero frequency\n) {\nvar n; // iterates over all tree elements\nvar prevlen = -1; // last emitted length\nvar curlen; // length of current code\nvar nextlen = tree[0 * 2 + 1]; // length of next code\nvar count = 0; // repeat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PathIndex supports several kinds of spatial query on a layer of polyline or polygon shapes | function PathIndex(shapes, arcs) {
var boundsQuery = getBoundsSearchFunction(getRingData(shapes, arcs));
var totalArea = getPathBounds(shapes, arcs).area();
function getRingData(shapes, arcs) {
var arr = [];
shapes.forEach(function(shp, shpId) {
var n = shp ? shp.length : 0;
for... | [
"function findInteriorPaths(shape, type, index) {\nvar enclosedPaths = index.findPathsInsideShape(shape),\n dissolvedPaths = [];\nif (!enclosedPaths) return null;\n// ...\nif (type == 'erase') enclosedPaths.forEach(MapShaper.reversePath);\nif (enclosedPaths.length <= 1) {\n dissolvedPaths = enclosedPaths; // no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query movies with rating higher or equal to 7 | function ratingMovies(db) {
const sql = 'SELECT DISTINCT * FROM MOVIES WHERE RATING >= 7'
db.all(sql, function (err, rows) {
rows.forEach(function (row) {
console.log(row);
})
});
} | [
"function filterByRating(rating){\n\t\treturn movies.filter((movie) => {\n\t\t\tconst average = getAvarageRating(movie);\n\t\t\treturn average >= rating && average < rating + 1;\n\t\t});\n\t}",
"function showMoviesByRating(event){\n\t\tresetValues('select-genre');\n\t\tresetValues('select-greatest')\n\t\tif(event... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads scores for all concepts, which are used in the filter navigation sidebar | function loadConceptScores() {
$("#filterSection .spinner").show();
$("#filterLoadingContainer").hide();
// Get the list of all concepts and their scores
d3.json("../content_recommender_stats/masteryGraph/all/all", function(error, data) {
$("#filterSection .spinner").hide();
$("#filterLoadingContainer").show();... | [
"function loadScores() {\n getWins();\n getDraws();\n getLosses();\n}",
"loadScore() {\n this.measureMap = {};\n this.measureNoteMap = {};\n this.clearModifierSelections();\n this.selections = [];\n }",
"function getScores() {\n return scores;\n}",
"function loadScores() {\n scoreL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Animate map and text when scrolling into lower half of Team section | function animateGeoText() {
const geoBlurbAnimation = anime
.timeline({loop: false, autoplay: false})
.add({
targets: '.map-container',
translateY: [100, 0],
opacity: [0, 1],
easing: 'easeOutQuart',
duration: 1500
})
.add({
targets: '.geo-coverage-panel',
translateY: [100, 0],
... | [
"function ScrollToMap()\n{\n $('html, body').animate({\n scrollTop: $(\"#mapHolder\").offset().top\n }, 500);\n}",
"function animateInfoSection(){\n\n var sectionInfo = $('.section-info')\n\n sectionInfo.waypoint(function (){\n sectionInfo.addClass('section-info-animate')\n }, {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all players in a potential revenge game | getRevenge(opponentTeamId, players) {
return players.filter(player => {
for (const team of player.teams) {
if (team.teamId === opponentTeamId) return true;
}
return false;
})
} | [
"getAllPlayers() {\n let players = [];\n Object.keys(this.trackedPlayers).map((guid) => {\n players = players.concat(this.trackedPlayers[guid]);\n });\n return players.filter((player, index, self) => {\n return index === self.findIndex((p) => p.name === player.name)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts one picture into a category (decoupling implementation for future data structure changes) | function insertPicture(element, category, list) {
list[category].push(element)
} | [
"function setCategoryImageById(category) {\n pexelsClient.getPhoto(708488)\n .then(function (result) {\n let imgUrl = result.src.small;\n firebase.database().ref('categories/' + category + '/img').set({\n img: imgUrl\n });\n }).\n catch(function (e) {\n console.err(e);\n });\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true if the input dom node should not end a column. returns false otherwise | function checkDontEndColumn(dom) {
if (dom.nodeType == 3) {
// text node. ensure that the text
// is not 100% whitespace
if (/^\s+$/.test(dom.nodeValue)) {
//
// ok, it's 100% whitespace,
// so we should return checkDontEndColumn
// o... | [
"function checkDontEndColumn(dom){\n\t\t\tif(dom.nodeType == 3){\n\t\t\t\t// text node. ensure that the text\n\t\t\t\t// is not 100% whitespace\n\t\t\t\tif(/^\\s+$/.test(dom.nodeValue)){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// ok, it's 100% whitespace,\n\t\t\t\t\t\t// so we should return checkDontEndColumn\n\t\t\t\t\t\t// ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add links to module reference pages and JavaScript reference pages | function _addReferencePages (_sourceFolder,_sourceFileExtensionRegExp,_referenceFolder) {
for (
var
_fileNo = -1,
_referenceUrlPrefix = '/' + (_referenceFolder || _sourceFolder)+ '/',
_files = _fileSystem.getFiles ({
path:_sourcePath + '/' + _sourceFolder,
... | [
"function setupLinks() {\n\tfor(let i = 0; i < 11; i++) {\n\t\tif(i == 10) { \n\t\t\tlinks[i] = createA('/resilience-repository/about.html', proj_names[i]);\n\t\t}\n\t\telse {\n\t\t\tlinks[i] = createA('/resilience-repository/projects/proj'+i+'.html', proj_names[i]);\n\t\t}\n\t}\n}",
"function HateoasLinks() {}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the next random track on the link list | function NextTrack() {
/*currentSong++;
if( currentSong == $( "#playlist li a" ).length ) {
currentSong = 0;
}*/
var listLength = $( "#playlist li a" ).length
var randomTrack = Math.floor( Math.random() * listLength );
var currentSong = randomTrack
return currentSong
} | [
"function NextTrack() {\n var listLength = $( \"#playlist li a\" ).length - 1\n var randomTrack = Math.floor( Math.random() * listLength );\n var currentSong = randomTrack\n\n return currentSong\n}",
"function randomIndex(){\n let last_index = audio_utility.index_curr_track;\n let current_index ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ObjectDef readyStateHeadersReceived at xmlhttprequest.ceylon (19:019:63) | function $3gt(){
var readyStateHeadersReceived$=new $3gt.$$;ReadyState(2,readyStateHeadersReceived$);
return readyStateHeadersReceived$;
} | [
"function headers__RECEIVED_ques_(xmlHttpRequestReadyState) /* (xmlHttpRequestReadyState : xmlHttpRequestReadyState) -> bool */ {\n return (xmlHttpRequestReadyState === 3);\n}",
"getReadyState () {\n return this.xhttp.readyState;\n }",
"function readyStateChangePoll() {\n if( asyncRequest.r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add better asynchronous support to a test function The test function must return a promise The promise will automatically be bound to "done" and the $rootScope will be automatically digested | function asynchronous(fn) {
return function (done) {
var returnValue = fn.call(this, done);
returnValue
.then(function () {
done();
})
.catch(function (err) {
done.fail(err);
});
$rootScope.$apply();
retu... | [
"function asynchronous (fn) {\n return function (done) {\n var returnValue = fn.call(this, done);\n returnValue.then(function () {\n done();\n }).catch(function (err) {\n done.fail(err);\n });\n $rootScope.$apply();\n return returnValue;\n };\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set user's Unit balance | async function SetBalance(id, value)
{
// Find user's balance, it always exists if there's a need to adjust it, cuz we call GetBalance before
const Balance = await Bank.findOne({ where: { UID: id } });
Balance.update( {units: value} ); // Set new balance
} | [
"async updateAUsersWallet (Wallet, balance, user_uuid) {\n\t\tawait Wallet.update({ balance }, { where: { user_uuid } });\n\t}",
"function update_user_balance(cost){\r\n\ttake_coins = cost;\r\n\t\r\n\tnew_balance = my_coins - take_coins;\r\n\t\r\n\t$('.coins-amount').html(new_balance);\r\n\t\r\n\tmy_coins = new_b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw the hero's stat bars and backpack contents | function drawHero() {
// Draw the hero's current stats on the screen
let healthText = "Health: " + hero.health;
$("#health").width(PIXELS_PER_UNIT * hero.health).text(healthText);
let magicText = "Magic: " + hero.magic;
$("#magic").width(PIXELS_PER_UNIT * hero.magic).text(magicText);
let sizeTex... | [
"drawHealthBars() {\n this.game.map.units.forEach(unit => {\n if (!unit.isAlive) return;\n\n let sc = this.view.screenCoordinates(unit.x, unit.y);\n let ts = this.view.tileSize;\n\n let fullBarSize = this.view.tileSize * 3 / 4;\n let barSize = Math.ceil(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls `focus` on the `focusTarget` and returns `true` if the element was focused successfully. If `false`, further steps may be necessary to determine a valid substitute to be focused instead. | attemptFocus(focusTarget) {
focusTarget.focus();
return this.document.activeElement === focusTarget;
} | [
"function focusTarget(target) {\n // If the element that was clicked was not a link, return early\n if (target.tagName !== 'A' || target.href === false) {\n return false\n }\n\n const input = document.querySelector(target.hash)\n if (!input) {\n return false\n }\n\n const legendOrLabel = getAssociatedL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves directories list of source path using glob pattern. | function GetLocalDirectoriesList(sourcePath, pattern) {
if (pattern === void 0) { pattern = ["*"]; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
var options;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
... | [
"function getAllDirectories(sourceDir) {\n const isDirectory = source => lstatSync(source).isDirectory();\n const getDirectories = source => readdirSync(source).map(name => join(source, name)).filter(isDirectory);\n \n return getDirectories(sourceDir) || [];\n}",
"function collectFilesWithPattern(cwd,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update Camera Orientation variables | function cameraUpdateOrientation()
{
if(CamMotion.UP || CamMotion.DOWN || CamMotion.RIGHT || CamMotion.LEFT)
{
if(CamMotion.UP)
{
CamMotion.vertical += CamMotion.rotationSpeed;
CamMotion.vertical = CamMotion.vertical > CamMotion.verticalMax ? CamMotion.verticalMax... | [
"function updateCameraDirection() {\n cameraOrientation = [Math.cos(yAxisRot)*Math.sin(xAxisRot), Math.cos(xAxisRot), Math.sin(yAxisRot)*Math.sin(xAxisRot)];\n}",
"updateOrientation() {\n this.orientation = Mathf.mod((Scene.Map.current.orientation - 2)\n * 3 + this.orientationEye, 4);\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
detect image url changes | function onUrlChange() {
$('input#id_imgUrl').change(function() {
console.log('url change detected');
updateThumb(thumbTarget, this);
});
} | [
"function isNewUrl(url){\n\n\tif(imageList.length>0){\n\n\tfor(var i=0; i<imageList.length; i++){\n\t\t//console.log(JSON.stringify(imageList));\t\n\t\tif(imageList[i].images.standard_resolution.url===url){\n\t\t\tconsole.log(\"REPEAT URL\");\n\t\t\treturn false;\t\t\n\t\t}\t\n\t\t\n\t}\n\n\t}\t\n\t\n\treturn true;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves a taxon's details to the database. | save() {
this._toggleSaveThrobber();
try {
this._readFromForm();
var resp = this.dao.save();
if (!resp) {
alert("Error while saving taxon.")
} else {
var jsonObj = JSON.parse(resp);
if (jsonObj[0].response ==... | [
"function handleAddedTaxon() {\n if ($('#new-taxon-name').val().trim() === '' || !$('#new-taxon-group').val()) {\n alert('Please fill in all the values before proceeding.')\n return false;\n }\n $.ajax({\n dataType: 'jsonp',\n url: indiciaData.read.url + 'index.php/services/data/taxa_ta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the closest campus to the current location If no campus is within ten miles, default to Colchester TODO: Webservice call to fetch campus from students' course? | getClosestCampus(latitude, longitude) {
// Iterate through each of the campuses available, and see which is closes
var closest = this.campus[0],
distance = 11; // distance in miles (ish)
this.campus.forEach((campus) => {
var campusLat = campus.location.latitude,
campusLon = campus.... | [
"_confirmLocation() {\n var closestCity = null;\n var closestDistance = Infinity;\n for (var city in showroomLocations) {\n if (showroomLocations.hasOwnProperty(city)) {\n var d = distanceSq(showroomLocations[city], this.state.location);\n if (d < BOUNDS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the backend registered under the provided name. Returns null if the name is not in the registry, or the registration hasn't finished yet. | function findBackend(name) {
return engine_1.ENGINE.findBackend(name);
} | [
"function findBackend(name) {\n return _engine.ENGINE.findBackend(name);\n}",
"function findBackend(name) {\n return ENGINE.findBackend(name);\n}",
"function findBackend(name) {\n return _engine__WEBPACK_IMPORTED_MODULE_0__.ENGINE.findBackend(name);\n}",
"function findBackendFactory(name) {\n return _en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hotPotato Game nameList is player and number is pass flower times. | function hotPotato(nameList, number){
var queue = new Queue();
for(var i=0;i<nameList.length;i++){
queue.enqueue(nameList[i]);
}
var eliminated = '';
while (queue.size() > 1){
for(var i=0;i<number;i++){
queue.enqueue(queue.dequeue());
}
eliminated = queu... | [
"function pick_9_Pokemons_from_list(pokemon){\n\n\t\tfor (let i = 0; i < 9;i++){\n\t\t\tgetRandomPokemon(pokemon);\n\t\t}\n\t\t//selectRandomName();\n\t}",
"function filterList(num, repeat) {\r\n let fighter = CHARACTERS.filter(name => name.removed === false);\r\n const F_LEN = fighter.length;\r\n\r\n for (let... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scrolls the list to the given Date. | scrollToDate(date,animate){this._scrollToPosition(this._differenceInMonths(date,this._originDate),animate)} | [
"scrollToDate(date, animate) {\n this._scrollToPosition(this._differenceInMonths(date, this._originDate), animate);\n }",
"scrollToDate(date, animate) {\n this._scrollToPosition(this._differenceInMonths(date, this._originDate), animate);\n }",
"_handleCalendarSelect (date) {\n var el = this.refs.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: checkIntegrity Checks the integrity of the input string by scanning for disallowed characters. If any disallowed characters are present, triggers an error. | function checkIntegrity(input) {
var okayChars = /[A-Za-z_0-9\\\/<>\-~()\s\&\|\=\!\u2227\u2228\u2192\u2194\u22A4\u22A5\u00AC]/;
for (var i = 0; i < input.length; i++) {
if (!okayChars.test(input.charAt(i))) {
scannerFail("Illegal character", i, i + 1);
}
}
} | [
"function checkStringValid(input) {\n\tif (input.length <= 256 && input != \"\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} \n}",
"function checkInput(input){\n if(input.length != 1) return false;\n let allowedChars = '0123456789C/x-+=.%';\n for (let i = 0; i < allowedChars.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets list of current user favorites, generates their HTML, and puts on page. | function putFavoritesOnPage() {
console.debug('putFavoritesOnPage');
$favoritesList.empty();
if (currentUser.favorites.length === 0) {
$favoritesList.append('<h5>No favorites added!</h5>');
}
// loop through all of the favorited stories and generate HTML for them
for (let story of currentUser.favorit... | [
"function generateFavorites() {\n // empty out that part of the page\n $favoritedArticles.empty();\n\n if (currentUser.favorites.length === 0) {\n const msg = \"<h5>No favorites added!</h5>\";\n $favoritedArticles.append(msg);\n }\n\n // loop through all of our favorites and generate HTML f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
request system application to show the volume status volume.requestShow(); | function volumeUp(){
// request system application to increase audio volume
volume.requestUp();
} | [
"function showVolume() {\n\t\tconst volumeDiv = document.querySelector(\"#volume__content\");\n\t\tif (volumeDiv.style.display === \"none\") {\n\t\t\tvolumeDiv.style.display = \"block\";\n\t\t} else {\n\t\t\tvolumeDiv.style.display = \"none\";\t\n\t\t}\n\t}",
"showVolumeControl() {\r\n this.visible = true\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears any message currently set in the file upload modal's status message container | function clearFileUploadMessage() {
$('#fileupload-message').text('')
} | [
"function clearModal() {\n\tstatus.innerHTML = '';\n}",
"function clearMessage() {\r\n\r\n $(\".message-box .message-box-content\").html(\"\");\r\n\r\n }",
"function clearFileInfo() {\n fileInfo.find('.file-name').html(fileInfoDefaultMsg);\n fileInfo.attr('title', '');\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls the board's clear method and pauses the simulation. | function clearBoard() {
board.clear();
pause();
} | [
"function clearBoard() {\n initBoard();\n refresh();\n}",
"function clearBoard(){\n ClearBoard();\n }",
"function clearBoard(){\n\t\tturns = [];\n\t\tusedSlots = [];\n\t\tplayersTurn = true;\n\t\tcount = 0;\n\t\tsetTimeout(function(){\n\t\t\t$('.squares').text('');\n\t\t},500);\n\t}",
"function clearBoa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keypress event handler for lat lon input fields. | function latlonKeypress(event)
{
if(event.which == 13)
{
$(this)[0].blur();
event.preventDefault();
}
} | [
"function latLongOnfocusHandler(evt) {\n const thisRow=whichRow(this.id);\n const point=parseLatLong(this.value);\n if (point)\n displayPoint(point, true);\n}",
"function latLongChangeHandler(evt) {\n const thisRow=whichRow(this.id);\n const point=parseLatLong(this.value);\n\n displayPoints();\n display... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compiles sassy files from /sassy into /css NOTE: This theme uses sassy by default. To swtich to sassy you will need to update this gulpfile by changing the 'less' tasks to run 'sass'! | function sassy(cb) {
return src(['src/scss/heathshults.scss', 'src/scss/theme-dark-mode.scss'], {sourcemaps: true})
.pipe(changed(p.www_css))
.pipe(sass())
.pipe(autoprefixer())
.pipe(header(banner, { pkg }))
.pipe(dest(p.www_css), {sourcemap: '.', overwrite: true})
.... | [
"function compileSass( ){\n\n\tgulp.src( './stylesheets/scss/zz.scss' )\n\n\t\t.pipe( sass( ) )\n\t\t.pipe( sass.sync( ).on( 'error', sass.logError ) )\n\t\t.pipe( gulp.dest( './stylesheets/_gss' ) );\n}",
"function buildScssThemes() {\n return gulp.src(\"css/scss/simplyCountdown.theme.*.scss\")\n .pipe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets width of 'tabs' div. | function setTabAreaWidth() {
$(".tabs").css("max-width", ($(window).innerWidth() - (2 * $(".tabScrollButton").outerWidth(true))) + "px");
} | [
"_setTabsAndTabWidth() {\n this.tabsWidth = this.$el.width();\n this.tabWidth = Math.max(this.tabsWidth, this.el.scrollWidth) / this.$tabLinks.length;\n }",
"function setTabWidth() {\r\n\r\n\t// we will set width of DIV \"tabsetDiv\" as per size of element styled\r\n\t// \"portlet_maxwidth\". Each pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Params: inputOne, inputTwo Response: string value Description: Returns a string that states the inputs do not match | function logMismatch(inputOne, inputTwo){
return `${inputOne} does not match ${inputTwo}!`;
} | [
"function matchWithTwoParameters(inputOne, inputTwo){\n if(inputOne === inputTwo){\n return true;\n }else{\n return false;\n }\n}",
"function logMatch(inputOne, inputTwo){\n return `${inputOne} does match ${inputTwo}!`;\n}",
"function areIdentical(input1 , input2) {\n var returnMessage = input1 ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns what the contents of the document would appear to be after decorations (i.e. with substitutions applied to the text) | getDecoratedText(range) {
range = this.document.validateRange(range);
const text = this.document.getText(range);
const substitutions = [];
for (let subst of this.prettyDecorations.unscoped) {
if (!subst.pretty)
continue;
const substRanges = ... | [
"getModifiedText() {\n const output = new tsdoc_1.StringBuilder();\n this._writeModifiedText({\n output,\n separatorOverride: undefined\n });\n return output.toString();\n }",
"function getDocumentContent() {\n var doc = DocumentApp.openById(this.pdfToDoc());\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates global year varibale Calls functions to update shot chart and season rank list | function updateYear(year) {
yearSelected = year;
updateShotChart();
updateSeasonRank();
} | [
"function yearUpdate(year) {\n updateChart(year);\n updateHistogram(year);\n updateLineChart(year);\n}",
"function updateYear(value) {\n\n YEAR = value;\n\n // Update each chart.\n\n mapvis.wrangleData(\"state\");\n mapvis.clearValueless();\n mapvis.updateVis();\n mapv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build a result object Parameters: handled: boolean indicates whether command has handled the request stop: boolean indicates whether execution should stop severity: string provides a severity level. Severity levels are defined in result.severities msg: string provides a user friendly message | function build (handled, stop, severity, msg) {
var obj;
handled = handled || false;
stop = stop || false;
severity = severity || "";
msg = msg || "";
obj = { handled: handled, stop: stop };
if(severity && msg) {
obj.message = { msg: msg, severity: severity };
}
return obj;
... | [
"function handle_result( success_message, error_message, stdOut, silent, detailed_info ) {\n if ( stdOut.indexOf(\"[ERROR]\") != -1 ) {\n messenger.error(error_message, true, stdOut);\n } else {\n if ( !silent ) {\n if ( detailed_info != undefined ) {\n messenger.succes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new struct with encoding `fresh`, and then populate it with the data and pointers from layout `stale` (pointers are updated to target the same objects as the old pointers). Zerofill layout `stale` and the new struct's unknown data and pointers (some old pointers may remain nonzero since they may be used as lan... | static upgrade(
level: uint, arena: ArenaB, ref: Word<SegmentB>,
segment: SegmentB, stale: StructLayout, fresh: Bytes
): this {
const width = fresh.data + fresh.pointers;
const object = arena.preallocate(width, segment);
/* Move the data section. */
const source: {| +segment: SegmentB, positi... | [
"static upgrade(\n level: uint, arena: ArenaB, ref: Word<SegmentB>,\n segment: SegmentB, stale: NonboolListLayout, fresh: Bytes\n ): this {\n const width = fresh.data + fresh.pointers;\n const object = arena.preallocate(8 + stale.length * width, segment);\n\n /* Write the tag word. */\n nonboolLi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fix the final promo game if we detect it might not be tracked Remember that Riot won't tell us we're in promos when we check the final game | function fixFinalPromoGame(row) {
// determine if we've played the right amount of promo games or not
// we needed 2 wins or losses (3 if in division 1 promos)
// if we haven't gotten enough, then correct the current game to be promos
var s = SpreadsheetApp.getActiveSpreadsheet();
var sheet = s.getSheetByName... | [
"function completeRevealPhase () {\n detectCheat();\n stopCardAnimations(); // If the player was impatient\n /* reveal everyone's hand */\n for (var i = 0; i < players.length; i++) {\n if (players[i] && !players[i].out) {\n players[i].hand.determine();\n players[i].hand.sort... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
buildObjectFromObjectData creates an object from given objectData. This objectData are the attributes saved on the persistance layer. Attention. This is called on EVERY call of getObject so object you get by getObject is a different one on every call. The consequence of this is, that you cannot add properties to the ob... | function buildObjectFromObjectData(objectData,roomID,type){
if (!objectData){
Modules.Log.error('No object data!');
}
var type=type||objectData.type;
//get the object's prototype
var proto=ObjectManager.getPrototypeFor(type);
//build a new object
var obj=Object.create(proto);
obj.init(objectData.id... | [
"initExistingObj(objData){\n this.addExistingObj(objData.path, objData.display, objData.type, objData.newLink, true);\n }",
"static setObject(object) {\n let newObject = new UserData(object[\"name\"], object[\"email\"], object[\"password\"]);\n newObject.setPhoneNumber(object[\"phoneNumber... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a marker has messages during its trail | function victimHasMessages(marker) {
var key = marker.nodeId;
for(var i = victimsPoints[key].length - 1; i >= 0 ; i--)
if(victimsPoints[key][i].message != null && "" != victimsPoints[key][i].message)
return true;
return false;
} | [
"isLastMessageMine() {\r\n if (!this.props.thread.messages.length) {\r\n return false;\r\n }\r\n const message = this.props.thread.messages[this.props.thread.messages.length - 1];\r\n const from = StanzaHelper_1.StanzaHelper.getJid(message);\r\n return from.toLowerCase(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restarts paddle and ball pos | function Restart()
{
paddle.x = 10;
paddle.y = 0;
paddle2.x = 400;
paddle2.y = 291;
ball.speedX = 1;
ball.speedY = 1;
ball.x = 210;
ball.y = 210;
BallStartPosition()
console.log("New Game");
} | [
"function gameIsRestart() {\n ball = new Ball(width / 2, height / 2, 5, 5, 50, 5);\n rightPaddle = new Paddle(width - 12, height / 2, 16, 80, 10, DOWN_ARROW, UP_ARROW, \"right\");\n leftPaddle = new Paddle(12, height / 2, 16, 80, 10, 83, 87, \"left\");\n}",
"function resetPaddle() {\n\tpaddleX = startPaddleX;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render update by key | renderUpdateByKey() {
} | [
"renderGetByKey() {\n\n }",
"function renderKey(key) {\n\t\t\tkey.html = $sce.trustAsHtml($renderKey.html(key,$sanitize));\n\t\t}",
"function updateViewData(key, value) {\n viewData[key] = value;\n }",
"function update_render( data, id)\n{\n $.each(data, function(key, value){\n if(typeof(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the player's money to 0 | resetMoney() {
this._money = 0;
ResetPlayerMoney(this.id);
} | [
"function betReset() {\r\n\tlet moneyBet = document.getElementById(\"money-bet\");\r\n\r\n\tmoneyBet.innerHTML = 0 + \"$\";\r\n\r\n\tMONEY_COUNT += BET;\r\n\tBET = 0;\r\n\r\n\tremoveAllChips();\r\n\r\n\tsetBet(BET);\r\n\tsetMoney(MONEY_COUNT)\r\n}",
"function resetMoney() {\n if(moneyIsModified) {\n use... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void _Attribute.GetTypeInfoCount([ref] uint32 pcTInfo) | GetTypeInfoCount() {
} | [
"GetTypeInfo() {\n\n }",
"get reflectionProbeUsage() {}",
"function __getSyntheticTypeSize(typeName, contextInheritorModule)\n{\n var typeInfo = __syntheticTypes[typeName];\n var size = typeInfo.size;\n if (size === undefined)\n {\n size = 0;\n var curBit = 0;\n var addBit = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the page height. | get pageHeight() {
return this.pageHeightIn;
} | [
"function propertyPageHeight() {\n return _pageHeight;\n }",
"function mGetPageHeight () {\r\n\t\tvar mRoot = document.documentElement || document.body;\r\n\t\treturn mGetMaxHeight(mRoot, 0);\r\n\t}",
"function setPropertyPageHeight(val) {\n _pageHeight = val;\n }",
"function setPropertyPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
THIS CONTAINS ALL THE PENDING INVOICE FUNCTIONS ////////////////////////////////////////////////////////// AUTHOR : AKASH GURRAM START OF PENDING INVOICES FUNCTIONS This function generates the Report for a project's Pending Invoices | function projectPendInvReport() {
window.open(
'Report?' +
'id=' +
projectID +
'&type=Project PendInv Report ' +
'~' +
$('#pendingInvoiceSelector2').val()
);
} | [
"function PL_Fees_Assessed_after_Intake() {\n logDebug(\"Begin PL_Fees_Assessed_after_Intake\");\n try {\n var emailFrom;\n var emailTo;\n var templateName = \"PL_APPICATIONACCEPTED_FEESDUE\";\n\n var reportFile = [];\n var vFees = loadFees(capId);\n var feesAdded = f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate three random path and pass them to render | function randomindexPath() {
do {
var right = randomNum();
var middle = randomNum();
var left = randomNum();
var equality = right == left || right == middle || left == middle;
} while (equality || availableItem([left, middle, right]))
uniqueItem = [];
uniqueItem.push(
... | [
"function pickRandomPathLevel1(numberOfPossiblePaths){\n return Math.floor((Math.random()*100) % numberOfPossiblePaths);\n}",
"function chooseRandomPath() {\n goals = paths[Math.floor(Math.random() * paths.length)];\n goal = goals[0];\n }",
"function render(){\n noMatchingRandomNumbers();\n var first... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
allows the circle to turn less green | function circleLessGreen(){
g = g - 40;
} | [
"function circleLessRed(){\n r = r - 40;\n}",
"function circleMoreGreen(){\n g = g + 40;\n}",
"function circleMoreRed(){\n r = r + 40;\n}",
"function circleLessBlue(){\n b = b - 40;\n}",
"function toggleCircleColor() {\n d3.selectAll(\"circle\").transition(\"elastic\")\n .style(\"fill\", functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a `Promise` with an async executor that automatically catches errors occurring within the executor. Nesting promises in this way is usually deemed an _antipattern_, but it's useful and clean when promisifying the eventbased code that's inherent to JSON RPC. So, here we solve the issue of nested promises by ensu... | function createAutoCatchingPromise(executor) {
return new Promise(function (resolve, reject) {
var result = executor(resolve, reject);
Promise.resolve(result).catch(reject);
});
} | [
"static await(promise) {\n\t\treturn Async.create((succ, fail) => promise.then(succ, fail));\n\t}",
"async function usingPromiseCatch() {\n let resolveValue = await asyncFunction('thing that will fail');\n}",
"async function withoutTryCatchAsyncFunc() {\n return waitOrRejectOrErr();\n}",
"async function u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initiates the fading of the buttons | function fadeButtonsStart () {
//log ("fadeButtonsStart ()");
fadeCounter = 0;
fadeFrom = trayButton.opacity;
fadeTo = widgetFocused ? 255 : 0;
fadeDiff = fadeTo - fadeFrom;
fadeTimer.ticking = true;
} | [
"function fadeClick() {\n\t\t\tself.causeKibua.visible = false;\n\t\t\tself.classKibua.visible = false;\n\t\t\tstatFade();\n\t\t\ttextFade();\n\t\t\tanimalsFade();\n\t\t\tclassFade();\n\t\t\trsFade();\n\t\t\tyearFade();\n\t\t}",
"function GNG_start_fading()\n{\n\tif(!GNG_FadeRunning)\n\t\tGNG_FadeAnimation();\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns cookies that are NOT suspected to be account cookies. | function get_non_account_cookies(domain) {
var cs = pii_vault.aggregate_data.session_cookie_store[domain];
var non_account_cookies = {};
for (c in cs.cookies) {
if (cs.cookies[c].current_state == 'absent') {
// No point in testing for cookies that are not present in the
// default cookie-store.... | [
"function delete_all_except_suspected_account_cookies(domain) {\n chrome.cookies.getAll({\n\t 'domain' : domain,\n\t\t},\n\tfunction(all_cookies) {\n\t\tvar cookies_to_delete = [];\n\t\tvar cs = pii_vault.aggregate_data.session_cookie_store[domain];\n\t\tfor (var i = 0; i < all_cookies.length; i++) {\n\t\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursive function that assign positions to each node | assignPosition(node, position) {
if(node.parentNode && position<node.parentNode.position){
position = node.parentNode.position;
}
while(this.positionMap.get(`${node.level},${position}`)){
position++;
}
node.position = position;
this.positionMap.set(`${node.level},${position}`, true);
for(var i in no... | [
"assignPosition(node, position) {\n node.position = position;\n\n if (node.children) {\n node.children.forEach(function(child) {\n position=this.assignPosition(child,position);\n }.bind(this))\n\n if (node.children.length == 0) {\n position... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(affirmations['0']); document.getElementById("affirmations").innerHTML = affirmations[0]; | function getRandom() {
var affirmations = JSON.parse(sessionStorage.getItem("affirmationsList"));
//console.log(affirmations);
//console.log(sessinStorage.getItem('affirmationsList'));
//var affirmations = ['Strive For Greatness', 'I feel good today', 'I got this'];
var randomNumber = Math.floor(Math.random... | [
"async function getAffirmation() {\n let response = await fetch(affirmationURL)\n let affirmationData = await response.json()\n // updateAffirmation(affirmationData.affirmation)\n document.getElementById(\"affirmation\").innerHTML = affirmationData.affirmation\n}",
"function display(){\n \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sequence :: (Applicative f, Traversable t) => (TypeRep f, t (f a)) > f (t a) . . Inverts the given `t (f a)` to produce an `f (t a)`. . . This function is derived from [`traverse`](traverse). . . ```javascript . > sequence(Array, Identity([1, 2, 3])) . [Identity(1), Identity(2), Identity(3)] . . > sequence(Identity, [I... | function sequence(typeRep, traversable) {
return traverse(typeRep, identity, traversable);
} | [
"function sequence(typeRep, traversable) {\n return traverse (typeRep, identity, traversable);\n }",
"function sequence(applicative, traversable, tfa) {\n return traversable.traverse(applicative, _Identity.id, tfa);\n}",
"function asSequence(object) {\r\n\t var seq;\r\n\t if (typeof object.at === 'fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function displayAnn() for loop with parameters including: an index var being created index var being less than the length of the annDetails array index var being concentated by 1 after each loop is completed 3 nested if statements which test for: 1. Announcement Grade = Student Grade or if Announcement is intended for ... | function displayAnn() {
for (var index = 0; index < annDetails.length; index += 1) {
if (annGrade[index] === studentGrade || annGrade[index] === "allgrades") {
if (annGender[index] === studentGender || annGender[index] === "allgenders") {
if (annClub[index] === studentClub || annClub[index] === "allstudents" ... | [
"function getAnnInfo() {\n\tannTitle[index] = document.getElementById(\"title\").value;\n\tannDetails[index] = document.getElementById(\"details\").value;\n\tannGrade[index] = document.getElementById(\"grade\").value;\n\tannGender[index] = document.getElementById(\"gender\").value;\n\tannClub[index] = document.getE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if a toon has been knocked out (player or opponent) and updates the DOM accordingly | function toonKnockedOut()
{
if (playerHealth <= 0)
{
// Prevents player from having negative health
playerHealth = 0;
// Updates player's toon HP in DOM
$("#your-character").find(".hp").empty();
$("#your-character").find(".hp").append(play... | [
"_sendOutWinningAndLoosingInformation () {\n this.io.sockets.to(this.playerWhoWon).emit('won', true);\n if (this.playerWhoWon === this.playerOne) {\n this.io.sockets.to(this.playerTwo).emit('won', false);\n } else {\n this.io.sockets.to(this.playerOne).emit('won', false);\n }\n }",
"setWon(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enqueues the given process. Return the enqueue'd process | enqueue(process) { // puts the item into the queue
process.setParentQueue(this); // set the parent queue to 'this' queue
this.processes.push(process); // use array push
return process; // return the result of the push
} | [
"enqueue(process) {\n process.setParentQueue(this);\n return this\n .processes\n .push(process);\n }",
"enqueue(process) {\n // console.log(\"This is the processes array\", this.processes[0]);\n this.processes.unshift(process);\n // console.log(\"This is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all activities in the sheet | function getActivities(sheet){
// Set variables for range
var startRow = 2; // Skipping the header
var numRows = sheet.getLastRow() - 1; // -1 because startRow is 2
var startColumn = 1; // Starting at first column
var numColumns = sheet.getLastColumn(); // Last column
var dataRange = sheet.getRange(startRo... | [
"function getAllActivities() {\n var allActivities = [];\n var allActivitiesNames = ['All activities'];\n currentCountries.map(country => \n country.activities && allActivities.push(country.activities));\n allActivities.map(currentActivities => \n currentActivities.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Readjust the game view origin point whenever a zoom happens. | function setGameViewOrigin(zoomAdjust) {
temp1 = gameViewOriginX / cellSize;
temp2 = gameViewOriginY / cellSize;
dragDeltaX = temp1 * zoomAdjust;
dragDeltaY = temp2 * zoomAdjust;
// TODO: zoomAdjust needs to be looked at. Also, the && needs to be looked at.
if(gameViewOriginX - dragDeltaX >=... | [
"snapToCamera() {\n this.x = Phaser.Math.snapToFloor(this.game.camera.view.left - tileSize, tileSize);\n this.y = Phaser.Math.snapToFloor(this.game.camera.view.top - tileSize, tileSize);\n }",
"updateCameraPosition() {\n const targetPivot = new PIXI.Point(\n this.followedObject.x - Game.app.rende... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Log store event's time(type:1) | async eventStoreTime() {
// eventTAT's sysKey
const sysKey = this.ctx.params.sysKey;
const eventTAT = this.ctx.request.body;
eventTAT.sysKey = sysKey;
if (!await this.service.eventTAT.eventLog(eventTAT, 1)) {
this.response(403, 'log event sto... | [
"async eventStoreTime() {\n\n // eventTAT's sysKey\n const sysKey = this.ctx.params.sysKey;\n\n if (!await this.service.eventTAT.eventLog(sysKey, 1)) {\n this.ctx.body = this.service.util.generateResponse(403, 'log event store time failed');\n return;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loop through the protocols and connect to the first one possible | function connect() {
var deferred = _core.Deferred();
console.log("Attempting to connect...");
var c = null,
ix = -1,
handshakeComplete = false,
_
function tryNext() {
ix+=1;
if (ix < _preferredClients.length) {
c = new _preferredClients[ix].class(_preferredClients[ix].name);
... | [
"function nextProtocol(){\n\tvar foundNextProtocol = false;\n\t// Search for next protocol that has not been completed\n\tfor(var i = 0; foundNextProtocol == false && i < protocolList.length; i++){\n\t\tif(protocolList[i].completeStatus == false){\n\t\t\tfoundNextProtocol = true;\n\t\t\tcurrentExperNum = i + 1;\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
simple stop cut scene | function skip() {
game.cutScene.style.display = 'none';
game.soundInstance.stop();
// TODO: stop and unload cut scene animation
} | [
"function CutScene () {\n\n}",
"function kill() {\n\tclip = 0; \n\tctlout_stop();\n}",
"function playScene() {\n var target = document.getElementById(\"cut_scene_images\");\n target.innerHTML = \"<div id='flash_content'></div>\";\n if (game.currentScene.number === 1) {\n\t swfobject.embedSWF(\"image... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |