query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Compile an optional list of positional arguments, which pushes each argument onto the stack and returns the number of parameters compiled | function CompilePositional(params) {
if (!params) return {
count: 0,
actions: _syntax_concat__WEBPACK_IMPORTED_MODULE_4__["NONE"]
};
let actions = [];
for (let i = 0; i < params.length; i++) {
actions.push(Object(_encoder__WEBPACK_IMPORTED_MODULE_1__["op"])('Expr', params[i]));
}
return {
... | [
"function compile_arguments(exprs, environment_index_table) {\n let i = 0;\n let s = length(exprs);\n let max_stack_size = 0;\n while (i < s) {\n max_stack_size = math_max(i + \n compile(head(exprs), \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fonction Storage SET met dans cookie donnesSauvegardees la liste maListeDesTaches | function exportListe(){
localStorage.setItem("donnesSauvegardees", JSON.stringify(maListeDesTaches));
} | [
"function setLista(que_lista){\n var lista;\n if(que_lista == 0){\n lista = sessionStorage.getItem(\"listaRecientes\");\n }\n else{\n lista = sessionStorage.getItem(\"listaRecomendaciones\");\n }\n sessionStorage.setItem(\"listaAux\",lista);\n}",
"function criaListaAtalhos(){\n listaAtalhos = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Code derived from Sorts the entries of a list of entries by the dateAccessed, Most Recent First. | function sortEntriesMRU(entries){
// Comparison function for sort
var date_sort_desc = function (entry1, entry2) {
var date1 = entry1.dateAccessed;
var date2 = entry2.dateAccessed;
if (date1 > date2) return -1;
if (date1 < date2) return 1;
return 0;
};
entries.sort(date_sort_desc);
} | [
"function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAccessed);\n\t\tvar date2 = Date.parse(entry2.dateAccessed);\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shortens string by one char and reenables decimal if "." is deleted | function backspace (string) {
if(string.charAt(string.length-1) === ".") enableDecimal();
return string.substring(0,string.length-1);
} | [
"function cleanNumber(num) {\n if (num.charAt(num.length - 1) === \".\")\n num = num.slice(num.length - 1);\n return num;\n }",
"function fixNumber(n) {\n\tn = n.split('');\n\n\tif (n[0] == '.') {\n\t\tn = '0' + n.join('');\n\t}\n\telse if (n[n.length-1] == '.') {\n\t\tn.splice(n.length-1,1)\n\t\tn = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables or disables the raycasting ray which gradually fades out from the origin. | setRayVisibility(isVisible) {
this.ray.visible = isVisible;
} | [
"toggleRaycastDebug() {\n const world = this.getWorld();\n if (!world) {\n return console.warn('World not set on character');\n }\n if (Settings.get('physics_debug')) {\n const scene = world.getScene();\n scene.add(this.rayStartBox);\n scene.add(this.rayEndBox);\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a cover when the user double clicks it | function removeCover(event) {
var coverId = event.target.id;
for (var i = 0; i < savedCovers.length; i++) {
if (`${savedCovers[i].id}` === coverId) {
savedCovers.splice(i, 1);
}
}
displaySavedCovers();
} | [
"function onCoverClick(event) {\n\t\tif(event.target === cover || event.target === close) {\n\t\t\tdeactivate();\n\t\t}\n\t}",
"function removeCover(){\n\tvar coverDivObject = document.getElementById(\"coverLayer\");\n\tif(coverDivObject!=null)\n\t{\n\t\tdocument.body.removeChild(coverDivObject);\n\t}\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Devuelve 1 si logro actualizar el turno indicado por id | modificarTurno(turno, id) {
return __awaiter(this, void 0, void 0, function* () {
const result = (yield this.db.query('UPDATE turnos SET ? WHERE ID = ?', [turno, id]))[0].affectedRows;
console.log(result);
return result;
});
} | [
"overrideTurnById(id){\n\t\t\tfor(let i =0; i<Netcode.players.length; ++i){\n\t\t\t\tif(Netcode.players[i].id === id){\n\t\t\t\t\tthis.turn = i-1;\n\t\t\t\t\tthis.advanceTurn();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function asignarTurno(idTurno){\n let usuarioLogueado = traerLocalStorage('usuarioLo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw 'fairness' benchmark lines | function drawFairLines() {
let benchmark = 0.08;
for (let l=0;l=2;l++) {
let lineDivID = 'line-div-' + (i+1);
let lineDivClass = 'line-div';
}
} | [
"function drawOneLine(x,y){\n // Move to the location\n push();\n translate(x,0);\n noStroke();\n fill(220,220,220);\n // Draw the background gray to give the main timeline greater visual value on the page.\n rect(x0,y+1,x1-x0,30);\n // Loop through the cluster array and draw the segments for each cluster a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set an array or object of data as attributes. | setAttributes(data) {
if(isArray(data) || isObject(data)) {
each(data, (value, key) => {
this.setAttribute(key, value);
});
}
} | [
"setAttributes(data) {\n if (isArray(data) || isObject(data)) {\n each(data, (value, key) => {\n this.setAttribute(key, value);\n });\n }\n }",
"_setAttributesFromData(data) {\n // for debugging\n this.builtFrom=data;\n for (var key of this.myAttributes) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this fnx gets the male population per district and return them in an array | function getMalePopulationPerDistrct(district_data)
{
let male_population_pre_district = [];
for (let i = 0; i < district_data.length; i++)
{
male_population_pre_district.push(district_data[i].male)
}
return male_population_pre_district;
} | [
"function getFemalePopulationPerDistrct(district_data)\n{\n let female_population_pre_district = [];\n for (let i = 0; i < district_data.length; i++)\n {\n female_population_pre_district.push(district_data[i].female);\n }\n return female_population_pre_district;\n}",
"function accumulatePopu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to save page without all the extra classes, and with header/footer | function savePage(){
$('.short').removeClass('spondee dactyl endfoot startfoot long1 long2 short1 short2').addClass('syll short')
$('.long').removeClass('spondee dactyl endfoot startfoot long1 long2 short1 short2').addClass('syll long')
$('.feet').remove()
$('.hemi').remove()
var bufferId = document.documentEleme... | [
"function savePage () {\n\tif (html_mode) {\n\t\t// Set content\n\t\tCKEDITOR.instances.page_content.setData(content_editor.getValue());\n\t}\n}",
"function exportPage() {\n // generate html page\n const page = `<html><head><style>${css}</style></head><body>${html}</body></html>`;\n \n // create html ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gTS([1,3,5,7,9,13]) This Length, That Value Given two numbers, return array of length num1 with each value num2 . Print "Jinx!" if they are same. | function thisLengthThatValue(num1, num2)
{
var arr1= []
for(var i=0; i<num1; i++)
{
arr1.push(num2)
}
if(num1 === num2)
{
console.log('Jinx!')
}
return arr1
} | [
"function lengthValue(num1, num2) {\n var array = [];\n if(num1 == num2) {\n console.log(\"Jinx!\");\n }\n for(var i = 0; i < num1; i++) {\n array[i] = num2;\n }\n return array;\n }",
"function thisLengthThatValue(num1, num2) {\n newArray = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Array of days belongs to the month of the specified date including previous and next month days which are on the same week as first and last month days. | function monthCalendar(date) {
var start = date.clone().startOf("month").startOf("week").startOf("day");
var end = date.clone().endOf("month").endOf("week").startOf("day");
var result = [];
var current = start.weekday(0).subtract(1, "d");
while (true) {
current = current.clone().add(1,... | [
"days() {\n // TODO: clean up all this\n\n const n = numberOfDaysInMonth(this.monthNumber, this.yearNumber);\n\n const days = [];\n\n // First, add all days in the same week before the start of the first day.\n const previousMonthN = numberOfDaysInMonth(this.monthNumber - 1, this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import ChooseFilm from "./chooseFilm/ChooseFilm"; import ChooseGlasses from "./chooseGlasses/ChooseGlasses"; import BaiTapThucHanhChiaLayout from "./component/BaiTapThucHanhChiaLayout/BaiTapThucHanhChiaLayout"; import DataBuilding from "./databuilding/DataBuilding"; import DataBuildingFC from "./databuilding/DataBuildi... | function App() {
return (
<div className="App">
{/* <BaiTapThucHanhChiaLayout/> */}
{/* <DataBuilding></DataBuilding> */}
{/* <DataBuildingFC></DataBuildingFC> */}
{/* <HandleEvent></HandleEvent>
<HandleEventFC></HandleEventFC> */}
{/* <RenderData></RenderData> */}
<Choos... | [
"function App() {\n // Nơi trả ra thẻ từ FILE trong folder Component\n return (\n <div className=\"App\">\n {/* <HomeComponent/> */}\n {/* <Databinding/> */}\n {/* <BaiTapThucHanhLayout/> */}\n {/* <Demo /> */}\n {/* <HandleEvent/> */}\n {/* <StyleComponent />\n <p className=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assemble a list of all names assigned to by the node. This method takes care of resolving chaining of the assignment operator like `foo = bar = 5`. | function exported(node) {
var names = []
, right
, exp
if ((exp = assignment(node))) {
names.push(exp.left)
right = exp.right
while (right && right.type === 'AssignmentExpression') {
names.push(right.left)
right = right.right
}
return names
}
return null
} | [
"function parseAssignment(scope, node, value) {\n var obj = lookupChain(node)\n var ref = fu.last(obj).name\n\n if (!scope.hasOwnProperty(ref)) {\n throw new Error('Undefined variable ' + ref)\n }\n\n var indices = fu.map(getPropertyValue, fu.init(obj).reverse())\n\n return [ref, setCollectionValue(scope[r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a string representation of an edge. | edge2string(e, label=null, terse=false) {
return e == 0 ? '-' :
((terse && this.n <= 26) ?
(this.x2s(this.left(e), label) +
this.x2s(this.right(e), label)) :
('{' + this.x2s(this.left(e), label) + ',' +
this.x2s(this.right(e), label) +
(this.hasWeights ? ',' + this.weight(e) : '')... | [
"function edgeStringify(edge) {\n var stream = new Tinkerpop.ByteArrayOutputStream();\n var builder = Tinkerpop.GraphSONWriter.build();\n var writer = builder.create();\n writer.writeEdge(stream, edge);\n return stream.toString(Tinkerpop.UTF8);\n }",
"function getEdgeString(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the top X players 'objects' is an array of skater or teamobjects 'sit' is the strength situation: all, ev5, pp, sh 'stat' is the property name by which to rank players 'limit' is the number of players to return (if there are ties, more players will be returned) | function getLeaders(objects, sit, stat, limit) {
// Return an empty array if 'objects' is empty after filtering
if (objects.length === 0) {
return [];
}
var leaders = [];
// Store the sort value
objects.forEach(function(s) {
if (stat === "i_sh_pct") {
s.sort_val = s.stats[sit].is < 10 ? 0... | [
"function topTenScorers(teamsAndPlayers) {\n return Object.entries(teamsAndPlayers)\n .flatMap(([team, teamsAndPlayers]) =>\n teamsAndPlayers.map((p) => [...p, team])\n )\n .filter((p) => p[1] >= 15)\n .map(([name, gamesPlayed, points, team]) => ({\n name: name,\n ppg: points / gamesPlay... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end function addLineSelectionLists / NAME: drawSparkLine DESCRIPTION: function to add a new saparkline to chgarts righthand margin area on addition of a new data line ARGUMENTS TAKEN: none ARGUMENTS RETURNED: none CALLED FROM: drawPopulationLineOnChart CALLS: numberWithCommas | function drawSparkLine(scenario) {
// select new data line group element created for main data line just plotted
// append a new 'g' elements to contain spaerkline and all its related DOM elements
// attach data to allow line and marker constrcution
d3.selectAll(
".aleph-line-group-" +
aleph.curre... | [
"function displaySparkline() { \n Sparkline.draw(sparks,midPriceArray.slice(midPriceArray.length-5));\n}",
"function appendSparkline(selection, data, width, height, year) {\n var domain = d3.extent(data);\n console.log(domain);\n var x = d3.sca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset combo if no match | resetCombo() {
this.startCombo = 0;
} | [
"resetCombo() {\n this._comboModifier = 0;\n this._killStreak = 0;\n this._comboScore = 0;\n }",
"function clearCombo(combo) {\n if (combo.options.length > 0) {\n combo.options.length = 0;\n }\n}",
"reset(){\n this.currentCombo = [0,0,0,0,0,0,0,0];\n }",
"function clearSelectedItem ()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear accumulated full definitions | clearFullDefs () {
this.fullDefs = []
} | [
"function clearDefinitions() {\n for (let key in definitions) {\n if (definitions.hasOwnProperty(key)) {\n delete definitions[key];\n }\n }\n }",
"_clearDefs() {\n const def = this._defs;\n def.gradient = {};\n def.clipping = {};\n }",
"cle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets clickTAG variable, if it is not defined (e.g. banner is being tested locally) it will fallback to example.com | function getClickTag() {
return window.clickTag || 'http://www.google.com';
} | [
"function tagThisClick(sender, onSite) {\r\n\tvar tagUrl = \"\";\r\n\ttagUrl = $(\"#linkManagedURL\").attr(\"href\");\r\n\tif (!tagUrl) tagUrl = ShopTogether.URL;\r\n\tif (!tagUrl) tagUrl = $(\"meta[property='og:url']\").attr(\"content\");\r\n\tif (!tagUrl) tagUrl = $(\"link[rel='bookmark']\").attr(\"href\");\r\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
De gebruiker heeft alle schroeven aangedraaid. Het object is geplaatst en voltooid | function voltooienObject(){
afspelenGeluid("schroeven_compleet");
objectenCompleet++;
volgenInstructies = false;
} | [
"apprendreAuthentification(pseudonyme){\n console.log(\"Nouveau joueur: \" + pseudonyme);\n this.pseudonymeAutreJoueur = pseudonyme;\n\n //Un nouveau joueur c'est authentifié, on peut lancer le premier dé de selection entre les deux joueurs \n if(!this.partieDemarrer)\n this.afficherSelectionPrem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
post creditnote transaction into netsuite 1.0.6 20 July 2012 added post full credit note 1.0.6 20 July 2012 added post full credit note 1.0.16 corrected error message MJL 1.0.17 change Auto Apply flag to false MJL 1.0.18 17 Sept amended add patient + invoice number cust fields update 1.0.19 call findLineItemValue() to ... | function postCreditNote(invIntID)
{
var creditMemoID = 0;
var invLineNum = 0;
try
{
// full credit
creditMemo = nlapiTransformRecord('invoice', invIntID, 'creditmemo');
creditMemo.setFieldValue('autoapply', 'F'); //1.0.17 change Auto Apply flag to false MJL
creditMemo.setFieldValue('... | [
"function postTransactionIntoNetSuite()\r\n{\r\n\t\r\n\tvar invIntId=0;\t\t// 1.0.6\r\n\tvar crIntId=0;\t\t// 1.0.6\r\n\t\r\n\t// post details to netsuite\r\n\tif (invoiceNo.length > 0)\r\n\t{\r\n\t\t// look up the invoice\r\n\t\tinvIntId = lookupInvoice(invoiceNo);\r\n\t\t\r\n\t\t//================================... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This updates the blur value, by increasing/decreasing it with the blur change value. The blur change value is negated when the blur value reaches either its maximum or minimum limit. | updateBlurValue() {
if (this.blur < this.blurMin || this.blur > this.blurMax)
this.blurChange = -this.blurChange;
this.blur += this.blurChange;
} | [
"function onUpdateBlur() {\r\n\tvar o = this.target;\r\n\tvar tgt = o.tgt;\r\n\tif (o.val == 0) {\r\n\t\ttgt.style.filter = \"none\";\r\n\t\ttgt.style.WebkitFilter = \"none\";\r\n\t} else {\r\n\t\ttgt.style.filter = \"blur(\" + o.val + \"px)\";\r\n\t\ttgt.style.WebkitFilter = \"blur(\" + o.val + \"px)\";\r\n\t}\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attaches highlighting to the page load event. | function initHighlightingOnLoad() {
window.addEventListener('DOMContentLoaded', initHighlighting, false);
window.addEventListener('load', initHighlighting, false);
} | [
"function initHighlightingOnLoad() {\n window.addEventListener('DOMContentLoaded', initHighlighting, false);\n window.addEventListener('load', initHighlighting, false);\n }",
"function initHighlightingOnLoad() {\n addEventListener('DOMContentLoaded', initHighlighting, false);\n addEventListen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return whether this criteria is valid as an object inside of an attribute | function validSubAttrCriteria(c) {
return _.isObject(c) && (
c.not || c.greaterThan || c.lessThan || c.greaterThanOrEqual || c.lessThanOrEqual || c['<'] || c['<='] || c['!'] || c['>'] || c['>='] || c.startsWith || c.endsWith || c.contains || c.like);
} | [
"isValid(data) {\n const index = this.getIndex(data);\n return data[this.property].hasOwnProperty(index);\n }",
"function validSubAttrCriteria(c) {\n\n if(!_.isObject(c)) { return false; }\n\n var valid = false;\n var validAttributes = [\n 'equals', 'not', 'greaterThan', 'lessThan', 'greate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Posicina los combos tipoSolicitud y periodos segun el seleccionado | function posicionarCombos() {
//combo tipoSolicitud
var iSeleccionadoTipoSol = new Array();
iSeleccionadoTipoSol[0] = get('frmFormulario.hOidTipoSolicitud');
set('frmFormulario.cbTipoSolicitud',iSeleccionadoTipoSol);
//combo periodos
var iSeleccionadoPeriodo = new Array();
iSeleccionadoPeriodo[0] = ... | [
"function ordenarSeleccionados() {\n\n\tfor(let i=0;i<2;i++){\n\t\tfor(j=1;j<3;j++){\n\t\t\tif(valoresSel[i].precio>valoresSel[j].precio){\n\t\t\t\ttemporal=valoresSel[i];\n\t\t\t\tvaloresSel[i]=valoresSel[j];\n\t\t\t\tvaloresSel[j]=temporal;\n\t\t\t}\n\t\t}\n\t\t\n\t}\t\n}",
"function ordenarPorPrecioOtrosProduc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================================= MethodName: GetCurrentLegByRouteID Description: used for Position object's constructor Arguments: RouteID Return Value: current leg Object from leg table =========================================================================== | GetCurrentLegByRouteID(routeID) {
//TODO
return { legobject: 'this is legdata' };
} | [
"GetLegStatusByGPSid(GPSid) {\n //1, determine RouteID by GPSid\n // a Method here\n //2, Read Whole Route info from DB\n //\n }",
"async GetRouteID(legID){\n try{\n let routeID = await db.query(`SELECT RouteID From Leg WHERE ID = '${legID}'`);\n // conso... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor / componentDidMount : When the render is done then is the moment to retrieve the data from external resource and set its in the state. | componentDidMount() {
const that = this;
httpRequest.get( this.urlDataProvider )
.end((err, res) => {
if(!err) {
var data = JSON.parse(res.text);
that.setState(data);
}
});
} | [
"componentDidMount() {\n\t\tthis.fetchDataFromUrl(this.props.url);\n\t}",
"componentDidMount() {\n\t\t//\tThe version here grabs data from our hardcoded file, but it is just for testing, we will use a json\n\t\t// feed from a service.\n\t\t//\n\t\t//this.setState({ robots: robots})\n\n\t\tfetch('http://jsonplace... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return array of string values, or NULL if CSV string not well formed. | function CSVtoArray(text) {
var re_valid = /^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/;
var re_value = /(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s... | [
"function CSVtoArray(text) {\n var re_valid = /^\\s*(?:'[^'\\\\]*(?:\\\\[\\S\\s][^'\\\\]*)*'|\"[^\"\\\\]*(?:\\\\[\\S\\s][^\"\\\\]*)*\"|[^,'\"\\s\\\\]*(?:\\s+[^,'\"\\s\\\\]+)*)\\s*(?:,\\s*(?:'[^'\\\\]*(?:\\\\[\\S\\s][^'\\\\]*)*'|\"[^\"\\\\]*(?:\\\\[\\S\\s][^\"\\\\]*)*\"|[^,'\"\\s\\\\]*(?:\\s+[^,'\"\\s\\\\]+)*... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new instance of the [DataUri](xref:adaptiveexpressions.DataUri) class. | constructor() {
super(expressionType_1.ExpressionType.DataUri, DataUri.evaluator(), returnType_1.ReturnType.String, functionUtils_1.FunctionUtils.validateUnary);
} | [
"function dataURIPlugin() {\n let resolved;\n return {\n name: 'vite:data-uri',\n buildStart() {\n resolved = {};\n },\n resolveId(id) {\n if (!dataUriRE.test(id)) {\n return null;\n }\n const uri = new URL$3(id);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares the yposition to the bottom position of the menu (var menubottom), when the page is loaded (important for refreshing!). | function yoffset(){
if (window.pageYOffset >= menu_bottom) {
$(".menu").addClass("fixed_menu");
fixed_menu_active=true;
}
else {
$(".menu").removeClass("fixed_menu");
fixed_menu_active=false;
}
} | [
"function menuBottom(){\r\n\t\tmenu_bottom=$(\".avoid_jump\").offset().top;\r\n\t\tcurrent_menu_height=($(\".menu\").outerHeight());\r\n\t\t$(\".avoid_jump\").css({\"height\":current_menu_height+\"px\"});\r\n\t}",
"function getMainMenuTopPos(menuObj, y) { // Private method\n if (y + menuObj.offsetHeight <= getCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BeispielException mit try catch return | function exception_example_return( ) {
//
// TRY Block
//
try {
//
// Werfe eine neue Exception vom Typ MyError
//
// throw new MyError("Banane")
return -1;
}
//
// CATCH Block
//
catch( err ) {
//
// Teste, ob ein Fehler vom Typ MyError geworfen wurde
//
if( err instanceof MyError ) {
... | [
"function Exception() {}",
"function Exception() {\n return;\n}",
"function testTryCatch1() {\n try {\n return 123;\n } catch (e) {\n }\n}",
"function getErrorObj(){\n\t\t try{ throw Error(\"\")}catch(err){ return err }\n\t }",
"function tryCatch(fn, obj, arg) { ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
subscribe to get messages about the loading status of the graph | function subscribeToGraphStatus() {
var socket = new SockJS('/pp-websocket');
stompClient = Stomp.over(socket);
stompClient.connect({}, function (frame) {
console.log('Connected: ' + frame);
stompClient.subscribe('/topic/graphStatus', function (graphStatus){
if(graphStatus.body==... | [
"onLoadStarted() {\n this.messageLoading = true;\n this.messageLoaded = false;\n }",
"function callUponMessageLoading() {\n FGMessageLoading(appendMessageToParent);\n nbrOfLoadingMessages++;\n }",
"function checkGraphStatus() {\n $.get(\"graphStatus\", function (graphStatus) {\n if(graph... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set url in current url box | function set_url(fragment) {
var baseurl = window.location.protocol+"//"+window.location.host+window.location.pathname
var url = baseurl + fragment;
$('span#cur_url').html("<a href='"+url+"'>"+url+"</a>");
} | [
"function setViewUrl() {\n document.getElementById(\"url\").value = getViewLink(window.location.hash);\n}",
"function setUrlValue(){\n\tchrome.tabs.query({active:true,currentWindow:true},function(tabs){\n\t\tvar re = new RegExp(/^.*\\/\\/(.*?)\\//);\n\t\ttheTab = re.exec(tabs[0].url)[1];\n\t\tdocument.getEleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calls function to enable render of DocsList | navigateToDocs() {
this.props.enableDocsList();
} | [
"function veridoc_render_list(\n data\n){\n var listType = data.listType;\n var listData = data.listData;\n var listTitle = data.listTitle;\n var listNotes = data.listNotes;\n\n document.getElementById('list-title').innerText = listTitle;\n document.getElementById('list-notes').innerText = list... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the DOM to display a list of sandwiches from the cart | render() {
const sandwichUl = document.querySelector('.sandwich-list');
// Empty the sandwichUl before adding any content to it.
sandwichUl.innerHTML = '';
this.items.forEach((sandwich) => {
const sandwichDiv = this.createSandwichCard(sandwich);
sandwichUl.appen... | [
"function renderShoppingList(){\n const itemsString = generateItemString(store);\n \n $(`.js-shopping-list`).html(itemsString);\n}",
"function renderShoppingList() {\n console.log('`renderShoppingList` ran');\n const shoppingListItemsString = generateShoppingItemsString(STORE);\n // insert that HTML into th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper: Formatting given custom delimiter into a format to use as regex. | function formatCustomDelimitersForRegexReady(delimitersAndNumbers) {
const delimiters = delimitersAndNumbers
.slice(1, delimitersAndNumbers.length - 1)
.filter(del => del !== "")
.map(del => {
const backslashLiterals = "[\^$.|?*+(){}";
if(backslashLiterals.includes(del[0])) {
if(del.l... | [
"function delimiterHandler(delimiter, numbers)\n{\n\t// base delimiters\n\tvar delimiter = /[\\n,]/g;\n\t\n\tif(numbers.includes(\"//\"))\n\t{\n\t\tdelimiter = numbers.substring(2,3);\n\t\tnumbers = numbers.substring(4);\n\t}\n\t\t\n\treturn delimiter;\n}",
"function getRegexForCustomDelimiters(delimitersToParse)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch two characters from the $number starting from $index. | getBlock($number, $index) {
return $number.substr($index, 2);
} | [
"function myNth (string,number) {\n if(number >=0) {\n return string[number]\n } else {\n return string[string.length+number]\n }\n}",
"function twoChar(str, index) {\n // YOUR CODE HERE\n}",
"function nthCharacter(input1, input2) {\n // input1 = String\n // input2 = number (nth you'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
region Loading cover part / Loading work into webpage | function RDCoverLoading(){
/* Action depend on the name of the file */
switch(pageName){
/* Homepage loading */
case "index.html":
SetCookie(0);
RenderTitleImageOrVideo(IndexHomePageFilePath, IndexHomePageBackground);
RDIndexCoverLoading();
break;
... | [
"function loadintro() {\n var MyCover = document.querySelector('.solange1');\n MyCover.addEventListener('load', function () {\n var loader = document.querySelector('.loader');\n loader.classList.add('loader-finish');\n });\n}",
"function load() {\n \n //writes all the html for the page\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CSI 1 ; 0 '_' : clear all audio objects. | clearAllAudioObjects(asSequence = false) {
return this._seqOrWrite(`${CSI}1;0;_`, asSequence);
} | [
"function clearWholeWordAudio(){\n\t$('#playWholeWord').attr('src',' ');\n}",
"function resetAllAudio(){\n\tfor(var sound in g_audio) {\n\t\tg_audio[sound].reset();\n\t}\n}",
"clearAllAudioBuffers() {\n if (ActiveMediaPlayer.AUDIO_BUFFERS)\n ActiveMediaPlayer.AUDIO_BUFFERS.forEach((_buffer, n) => this.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a layout restorer. | function LayoutRestorer(options) {
var _this = this;
this._first = null;
this._promises = [];
this._restored = new coreutils_1.PromiseDelegate();
this._registry = null;
this._state = null;
this._trackers = new Set();
this._widgets = new Map();
this... | [
"function LayoutRestorer(options) {\n var _this = this;\n this._firstDone = false;\n this._promisesDone = false;\n this._promises = [];\n this._restored = new coreutils_1.PromiseDelegate();\n this._trackers = new Set();\n this._widgets = new Map();\n this._con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A partial convex hull fragment, made of two unimonotone polygons | function PartialHull(a, b, idx, lowerIds, upperIds) {
this.a = a
this.b = b
this.idx = idx
this.lowerIds = lowerIds
this.upperIds = upperIds
} | [
"function PartialHull(a, b, idx, lowerIds, upperIds) {\n this.a = a\n this.b = b\n this.idx = idx\n this.lowerIds = lowerIds\n this.upperIds = upperIds\n}",
"function Shape2D_computeConvexHull() {\n\t\n\tvar points = this.asPolygon.slice(0); //copy points\n\tpoints.sort(function(a,b){return a.compareTo(b)});... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear objectmap (called from outside) clears the objectmap. | clearobjectmap() {
if (this.internal.objectmap===null)
return;
this.deleteoldobjectmap();
this.informToRender();
this.internal.cmapcontroller.removeobjectmap();
this.internal.objectmaptransferinfo={ showcolorbar : false, 'colormode' : 'Objectmap' };
... | [
"function clearObjects() {\n setMapOnAll(null);\n}",
"function cleanMap() {\n mapObjects.forEach(function(item) {\n item.setMap(null);\n });\n mapObjects = [];\n}",
"function deleteObjects() {\n clearObjects();\n mapObjects = [];\n}",
"function clearMap() {\n\tvic.destroy();\n\tkerr.destroy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method iterates the JavaScript heap and finds all objects with the given prototype. | async queryObjects(prototypeHandle) {
const context = await this.mainFrame().executionContext();
return context.queryObjects(prototypeHandle);
} | [
"async queryObjects(prototypeHandle) {\n const context = await this.mainFrame().executionContext();\n (0, assert_js_1.assert)(!prototypeHandle.disposed, 'Prototype JSHandle is disposed!');\n const remoteObject = prototypeHandle.remoteObject();\n (0, assert_js_1.assert)(remoteObject.objec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy all bytes of output file written since the last copy to the home directory. | function copyPartialOutput(){
var tempTotal = totalWrittenBytes;
var size = totalWrittenBytes - lastCopied;
var buf = Buffer.alloc(size);
// Read the bytes that have been written since the last copy
fs.read(outputfile, buf, 0, size, lastCopied,
function readCallback(err, bytesRead, buffer){
... | [
"function backup(){\n var output = fs.createWriteStream(backupPath + '/dataBackUp.zip');\n var archive = archiver('zip', {\n zlib: { level: 9 } // Sets the compression level.\n });\n output.on('close', function() {\n console.log(archive.pointer() + ' total bytes');\n console.log('archiver has been fina... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls the onIdChange callbacks with the new FID value, and broadcasts the change to other tabs. | function fidChanged(appConfig, fid) {
const key = getKey(appConfig);
callFidChangeCallbacks(key, fid);
broadcastFidChange(key, fid);
} | [
"function fidChanged(appConfig, fid) {\n var key = getKey(appConfig);\n callFidChangeCallbacks(key, fid);\n broadcastFidChange(key, fid);\n }",
"function fidChanged(appConfig, fid) {\n var key = getKey(appConfig);\n callFidChangeCallbacks(key, fid);\n broadcast... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves form state to chrome.storage.local | function saveFormState() {
const form = d.querySelector('form');
const data = objectFromEntries(new FormData(form).entries());
/*if (!wifi_store.checked) {
data.json_config = '';
}*/
let formJson = JSON.stringify(data);
storage.setItem('form', formJson);
} | [
"function saveFormState() {\n const form = d.querySelector('form');\n const data = objectFromEntries(new FormData(form).entries());\n if (!wifi_store.checked) {\n data.wifi_pass = '';\n }\n let formJson = JSON.stringify(data);\n storage.setItem('form', formJson);\n storage.setItem('protocol', protocol.va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find all will return a list of all reports | static findAll() {
const wrapper = new ReportWrapper();
return wrapper.listAll()
.then(results => {
if (!_.isArray(results)) { return [new Report(results)]; }
return results.reduce((models, data) => {
models.push(new Report(data));
... | [
"reports () {\n console.log('Reports: ', Reports.find({}))\n return Reports.find({})\n }",
"function getAllReports (req, res, next) {\n return Report.find({})\n .then(allReports => {\n return res.status(200).send({reports: allReports})\n })\n .catch(() => next({status: 500, mes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert the data from the awesome.json file to the movies table of the database | function insertAwesome(db) {
awesome.forEach(movie => {
const sql = 'INSERT INTO awesome(link, id, metascore, rating, synopsis, title, votes, year) ' +
'VALUES("' + movie.link + '", "' + movie.id + '", ' + movie.metascore + ', ' + movie.rating +
', "' + movie.synopsis + '", "' + movi... | [
"function insertMovies(db) {\n movies.forEach(movie => {\n const sql = 'INSERT INTO movies(link, id, metascore, rating, synopsis, title, votes, year) ' +\n 'VALUES(\"' + movie.link + '\", \"' + movie.id + '\", ' + movie.metascore + ', ' + movie.rating +\n ', \"' + movie.synopsis + '\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Publish all assets from the manifest | async publish() {
var _a;
const self = this;
for (const asset of this.assets) {
if (this.aborted) {
break;
}
this.currentAsset = asset;
try {
if (this.progressEvent(progress_1.EventType.START, `Publishing ${asset.id}... | [
"async function manifest() {\n const base = JSON.parse(await fs.readFile(`${DIST}/manifest.json`, 'utf8'));\n const data = await buildManifest(base);\n await fs.mkdir(DIST).catch(() => {});\n await fs.writeFile(`${DIST}/manifest.json`, JSON.stringify(data), 'utf8');\n}",
"function chromeAppAssets() {\n\tgulp.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the tour URL and displays it in the respective box | prepareTourUrl() {
let code = this.createTourCodeUrl();
document.getElementById("resultBox").textContent = code;
document.getElementById("resultBox").select();
} | [
"function getTourUrl() {\n self.location = \"/promos/dc/take_tour.html\";\n}",
"openTour(id) {\n window.location = window.location.origin + `/tours/${id}`;\n }",
"function setupOurteamPage() {\n\t$('body').on('click', '.short-text', function() {\n\t\t$(this).hide();\n\t\t$(this).siblings('.full-tex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that the given collection has the specified number of items. | function checkCollection(collection, name, items)
{
var count = countProperties(collection);
ok(count == items, name + ' should have ' + items + ' items, not ' + count);
} | [
"function size(collection) {\n return isArray(collection) ? collection.length : Object.keys(collection).length;\n}",
"function size(collection) {\n return isArray(collection)\n ? collection.length\n : Object.keys(collection).length;\n}",
"function favLessThanLimit() {\n var currentFavourite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import as projectItem from '../actions/projectItem'; project from customized props | function mapStateToProps(state,props) {
console.log("VisibleApplicationList props",props);
return {
project: props.project
};
} | [
"render_project(project){\n return (<ProjectCard project={project} key={project.name} handler={this.handler}/>);\n }",
"renderProject(project) {\n return <Project project={project} pressed={this.getPressedState(project)} onClick={this.props.voteProject} showVote={this.props.showVote} displaySupervisorN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds new cathegory to our object and option list | function addNewCateg(){
var addCategText = document.getElementById('NewCathegoryField').value;
categ.categName[addCategText]= [];
console.log("categ.categName + " + Object.getOwnPropertyNames(categ.categName));
var addToOptionList=document.getElementById('cathegoryOption');
var option = document.createElement('op... | [
"function addToCateg () {\n\n\t\tfor(var i=0;i<whichCateg;i++){\n\t\t\tif(cathegory == Object.getOwnPropertyNames(categ.categName)[i])\n\t\t\t\t{console.log(\"this is working BUT\");\n\t\t\t\t\tconsole.log(\"cathegory \" + cathegory);\n\t\t\t\t\t// BUT CANT AUTOMATED////////\n\t\t\t\t\tObject.keys(categ.categName[c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
jQuery jsonp jQuery xml response yahoo pipes | function showTextFromServiceJQueryAndYahooPipes() {
$.ajax({
url: "http://pipes.yahoo.com/pipes/9oyONQzA2xGOkM4FqGIyXQ/run?&_render=json&_callback=printYourPipeResult&feed=http://weather.yahooapis.com/forecastrss?w=545801",
dataType: 'jsonp',
timeout: 5000, //5 sec
});
} | [
"function fetchRSS(feed, success){\n $.ajax({\n url : 'https://query.yahooapis.com/v1/public/yql',\n jsonp : 'callback',\n dataType : 'jsonp',\n data : {\n q : \"select title, link, pubDate from rss where url='\" + feed + \"'\",\n format : 'json'\n },\n success : function(data){ return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count the field number | function fieldCount()
{
var count = 0;
for(var appName in allFields)
{
for(var beanName in allFields[appName])
{
for(var fieldName in allFields[appName][beanName])
count++;
}
}
return count;
} | [
"getFieldCount() {\n return this.fields.length;\n }",
"function htmlFieldCounter(field) {\n\tvar count = $(field).text().length;\n\tvar max = $(field).parents('.html').find('.summernote').data('rules').htmlField[1]\n\n\t$(field).parents('.html').find('.counter').find('.curCount').text(count);\n\t$(field).pare... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct Event instance with topic, data and additional options. topic should be a string representing the event. data should be an object with the event payload. | constructor(topic, data, options = {}) {
this._data = Object.assign(
{
topic,
data,
target: '',
inReplyToEvent: null,
},
options,
{
id: uuid.v4(),
sent: null,
... | [
"function Event(topic, data) {\n var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];\n\n _classCallCheck(this, Event);\n\n this._data = Object.assign({\n topic: topic,\n data: data,\n target: '',\n inReplyToEvent: nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the collection of papers by reading in a string, parsing it and setting the global state corpus to the result. | setCorpusToString(inputText) {
let corpus = parseCorpus(inputText);
// set a unique key for each paper using it's index in the corpus
corpus = corpus.map((paper, i) => Object.assign(paper, { id: i }));
this.props.setCorpus(corpus);
} | [
"buildCorpus() {\n const options = this.options;\n this.data.forEach(item => {\n const line = item.string;\n const words = line.split(' ');\n const stateSize = options.stateSize; // Default value of 2 is set in the constructor\n // Start words\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove empty pages, Generated due to add spread | function removeEmptyPages(document){
for(var k=0;k < document.pages.length;k++){
var page = document.pages[k];
if(page.pageItems.length <= 0){
page.remove();
}
}
} | [
"function checkEmptyPages() {\n var index = 0;\n var total = pages.total;\n\n while (index < total) {\n var page = pages.list[index];\n if (page.getNumApps() === 0) {\n pageHelper.remove(index);\n break;\n }\n index++;\n }\n }",
"function removePages() {\n // Iter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a row to the specified analytics table. | function add_analytics_row(table, name, timestamp) {
// Check for greater than zero rows.
if (table.getNumberOfRows() > 0) {
// Don't add the same name twice in a row on the same day.
var last_name = table.getValue(table.getNumberOfRows() - 1, 0);
var last_ts = table.getValue(table.getNumberOfRows() - 1, 1);
... | [
"function addRowToTable(){\n createTableElementsFromInputs();\n postTableElementsFromInputs();\n }",
"function addRow() {\n rows++;\n refreshTable();\n}",
"function appendRow(rowData) {\n \tvar newIdx = data.length;\n var row = _makeRow(newIdx, rowData);\n data.push(row);\n _cha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the appropriate status class for the `Status` column. | getStatusClass(status) {
const statusMap = {
"Not Bidding": "danger",
"Complete": "success",
"Bidding": "warning",
};
return `text-${statusMap[status]}`;
} | [
"function getStatusType() {\n if (status === 'osstatus') return 'os_status_id';\n if (status === 'diagstatus') return 'diag_status_id';\n if (status === 'repairstatus') return 'repair_status_id';\n if (status === 'paymentstatus') return 'payment_status_id';\n }",
"function status_type(statu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
purpose: a method which returns all the card in mixing form. | giveCards(){
var suit=["♣️","♦️", "♥️", "♠️"];
var rank=["King","Queen","Jack","Ace","2","3","4","5","6","7","8","9","10"];
var cards=new Array();
var n=suit.length*rank.length;
for (let i = 0; i < suit.length; i++) {//adding of all 52 cards in array
for (let... | [
"function getCards() {\n // Array to hold Suites\n var suites = ['Diamonds', 'Spades', 'Hearts', 'Clubs'];\n // Array to hold non-numeric card faces \n var faceCards = ['J', 'Q', 'K', 'A'];\n\n // Array to hold Cards\n var cards = [];\n\n // Loop for each Suite\n var currentCardIndex = 0;\n for (var suite ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse OBJ lines into model. For reference, this is what a simple model of a square might look like: v 0.5 0.5 0.5 v 0.5 0.5 0.5 v 0.5 0.5 0.5 v 0.5 0.5 0.5 f 4 3 2 1 | function parseObj( model, lines ) {
// OBJ allows a face to specify an index for a vertex (in the above example),
// but it also allows you to specify a custom combination of vertex, UV
// coordinate, and vertex normal. So, "3/4/3" would mean, "use vertex 3 with
// UV coordinate 4 and vertex normal 3". In WebGL... | [
"function parseObj(model, lines) {\n // OBJ allows a face to specify an index for a vertex (in the above example),\n // but it also allows you to specify a custom combination of vertex, UV\n // coordinate, and vertex normal. So, \"3/4/3\" would mean, \"use vertex 3 with\n // UV coordinate 4 and vertex normal 3\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ChildWindowManager maintains the lifecycle of a child attention window. When you instantiate a ChildWindowManager, no window exists yet; use .whenReady() or postMessage() to call up the child window and perform actions on it. Provided the child window calls ChildWindowManager.fireReady(), this class takes care of the b... | function ChildWindowManager(url) {
this.url = url;
this.childWindow = null;
this.childWindowReady = false;
this.childOnReadyCallbacks = [];
this.releaseCpuLock = null;
window.addEventListener('message', this);
} | [
"function onChildWindowReady( callback ){\n\t\t\t\tchildWindowReadyHandlers.push( function(){\n\t\t\t\t\tcallback.call( null, childWindow );\n\t\t\t\t});\n\t\t\t}",
"function initChildWindow () {\n registerProtocolHandlers()\n hideCursor()\n moveWindowBounce()\n setupFollowWindow()\n startVideo()\n detectWi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Force a file as RIFF. | toRIFF() {
this.fromScratch(
this.fmt.numChannels,
this.fmt.sampleRate,
this.bitDepth,
unpackArray(this.data.samples, this.dataType));
} | [
"toRIFF() {\n if (this.container == \"RF64\") {\n this.fromScratch(\n this.fmt.numChannels,\n this.fmt.sampleRate,\n this.bitDepth,\n this.data.samples);\n } else {\n this.container = \"RIFF\";\n this.LEorBE_(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if edit new name for operator | function _isRenaming(){
return currentOperatorUid != null;
} | [
"get canRename()\n\t{\n\t\treturn true;\n\t}",
"function update_name() {\n // only allow editing of a node if it's not already in editing mode\n if( !inEditing ) {\n enableUpdateNode( st.clickedNode );\n }\n}",
"function isOperator( nickName ) {\n\tvar skypeUsername = getSkypeUsername(nickName);\n\tif ( g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
builds a very simple error payload | function buildError(code,message){
return {
"status" : "error",
"error" : {
"code" : code,
"message" : message
}
};
} | [
"function buildError(err = null) {\n return records.ErrorMsg(err);\n}",
"static buildMessage(error){let __buildMessage=function(error,level){if(!error)return\"\";let res=\"\",space=\" \";for(let i=0,ii=level;i<ii;i++)space+=\" \";if(error.code&&(res+=\"Code: \"+error.code+\"/0x\"+error.code... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the artist data for return. | function formatArtist (name, docset) {
var albums = sortAlbums(docset);
return {
name: name,
albums: albums
};
} | [
"function artist_data() {\n this.name = \"\";\n this.data = [];\n this.crit_points = [];\n this.fontsize = 100;\n}",
"artistMetaFromLastFMData(artistData) {\n if (!artistData) {\n return;\n }\n const { name } = artistData;\n return {\n name,\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marks the property to be mapped from the root. | function root(target, key, descriptor) {
validateProperty("root", key, descriptor);
mapping.getOrCreateOwn(target, key, () => ({})).root = true;
} | [
"set root(val){\n this._root = val;\n }",
"set rootPosition(value) {}",
"setRoot(_node) {\n if (!_node)\n return;\n this.branch = _node;\n this.viewport.setBranch(this.branch);\n }",
"static setChildrenProperty(slot, property, value) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
logOut function is called, when user wants to logout. Returns program to start. | function logOut() {
input = readline.question("Are you sure you want to log out? (yes / no)\n>> ");
if (input === "yes") {
console.log("Logging out, thanks for using MustGet Banking CLI!");
// Clear user
user = {};
// If user wants to logout, return back to beginning of program
... | [
"function Logout() {}",
"function loggingOut(){\n\tresetLoggedIn(store[\"current_user\"]);\n\tredirectToHome();\n}",
"function logOut() {\n getInfo('logout', AUTH_LOG_OUT, function(){\n location.reload();\n });\n }",
"function logOut() {\n makeAlertBox(currentUser[1] + \" \" + currentUser[2] + \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searches yelp per parameter | function searchYelp(tag, done) {
// console.log(tag);
console.log('------ offset --------');
// console.log(offsetCounter);
console.log('------ sort --------');
// console.log(sortCounter);
yelp.search({location: tag, limit:20, offset:offsetCounter, sort:sortCounter}, function(error, data) {
... | [
"function yelp (agent) {\n const { Food_Category : term, 'geo-city' : location } = parameters;\n console.log(`${term}, ${location}`);\n return yelpApi.search({term, location,limit:1})\n .then((data) => {\n const { name, rating, location: address } = data.jsonBody.businesses[0];\n agent.a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
animatie klok van boven naar beneden | function animatie(){
var timeline = new TimelineMax ({repeat:-1});
timeline.to("#klok", 50, {ease: Elastic.easeOut.config(10), y:6});
} | [
"function pokreni_animaciju () {\n\n\t// popunjavanje ready queue s vrijednostima do kraja simulacije\n\tpopuni_ready_queue();\n\t\n\n\tfor (jz=1; jz<=podaci_o_procesima.ukupan_broj_procesa; jz++) {\n\t\t//stvori novi timeline za svaki proces\n\t\twindow[\"anim\" + proba] = new TimelineMax({paused:true});\n\t\t\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor avec les 3 edges composant le triangle | constructor(e1, e2, e3)
{
this.id = ++Triangle.ID;
this.e1 = e1;
this.e2 = e2;
this.e3 = e3;
this.centerPoint = null;
} | [
"function Triangle(edge1, edge2, edge3) {\n\t\tthis.edge1 = edge1;\n\t\tthis.edge2 = edge2;\n\t\tthis.edge3 = edge3;\n\t}",
"function Triangle(num1, num2, num3) {\n Polygon.call(this, [new Side(num1), new Side(num2), new Side(num3)]);\n}",
"function Triangle(side1, side2, side3) {\n Polygon.call(this, [new ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| | on page load run the getVouchers function | | componentDidMount() {
this.getVouchers();
} | [
"findViewers() {\n\n const viewerid = this.getAttribute('bis-viewerid');\n const viewerid2 = this.getAttribute('bis-viewerid2') || null;\n\n this.VIEWERS = [document.querySelector(viewerid)];\n this.VIEWERS[0].setName('viewer1');\n if (viewerid2 !== null) {\n this.VIEWE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom link tracking for Facebook Like button This is bound to the like event when Facebook is first initialized Implementation could be adjusted if you wanted to track the specific URL being liked | function facebookLike(url) {
var s=s_gi(s_account);
s.eVar2='fRecommend';
s.events='event12';
s.trackExternalLinks = false;
s.linkTrackVars='eVar2,events';
s.linkTrackEvents='event12';
s.tl(this,'o','fRecommend');
} | [
"function trackCustomLink(link_obj, link_name) {\n\tvar s=s_gi(s_account)\n\ts = s_gi(s_account);\n\ts.linkTrackVars = \"eVar10\";\n\ts.eVar10 = link_name;\n\ts.linkTrackEvents = 'None';\n\ts.tl(link_obj, 'o', link_name);\n }",
"function setupLinkTracking() {\n // track all links with \"a\" tag and \"analyti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
18) Write a function that returns true if a given argument is a multiple of 3. Examples of multiples of 3 are 0,3,6,9 ... | function multipleOf3 (number) {
if(number%3===0) {
return true;
} else {
return false;
}
} | [
"function multipleOf3(n) {\n return n % 3 === 0;\n}",
"function isMultipleOfThree(input){\n if (input % 3 === 0)\n return true;\n else\n return false\n}",
"function isMultipleOfThree(x) {\n if(x % 3 === 0) {\n return true;\n } else {\n return false;\n }\n}",
"function isMultipl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a list of unique category names, from the items. | extractCategoriesFromItems(allItems) {
let categories = [];
let unique = {};
for (let prop in allItems) {
// Check the "category" first.
if (typeof(unique[allItems[prop].category]) == "undefined" &&
allItems[prop].category) {
categories.push(allItems[prop].category);
... | [
"extractCategoriesFromItems(allItems) {\n let categories = [];\n let unique = {};\n\n for (let prop in allItems) {\n // The properties used as categories are \"type\" and \"specialType\".\n\n // Check the \"type\" first.\n if (typeof(unique[allItems[prop].type]) == \"undefined\" && allItems[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================================================================ readNames() read all variable names in chaincode state ============================================================================================================================ | function readNames(cb, lvl){ //lvl is for reading past state blocks, tbd exactly
read('_all', cb, lvl);
} | [
"function readVariable(noPrintVarName){\r\n\t\tvar ret={name:\"\",indexes:[]};\r\n\t\tnext();\r\n\t\tswitch(type){\r\n\t\t\tcase \"VAR\":\r\n\t\t\t\tret.name=readVar();\r\n\t\t\tbreak;case \"word\":\r\n\t\t\t\tret.name=word;\r\n\t\t\tbreak;default:\r\n\t\t\t\treadNext=0;\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\twhi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate tip position relative to the trigger | function getPosition(trigger, tip, conf) {
// get origin top/left position
var top = conf.relative ? trigger.position().top : trigger.offset().top,
left = conf.relative ? trigger.position().left : trigger.offset().left,
pos = conf.position[0];
top -= tip.outerHeight() - conf.offset[0];
left += ... | [
"function getPosition(trigger, tip, conf) { \n\n \n // get origin top/left position \n var top = conf.relative ? trigger.position().top : trigger.offset().top, \n left = conf.relative ? trigger.position().left : trigger.offset().left,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete a previous login | function removePreviousLogin(id){
var previous = getPreviousLogins();
if(previous !== null){
previous = $.grep(previous, function(value) {
return value != id;
});
window.localStorage.setItem(PREVIOUS_LOGIN, JSON.stringify(previous));
}
} | [
"function deleteLogin () {\n\tlocalStorage.removeItem(\"login\");\n}",
"function clearSavedLogin() {\n L.info('Removing last logged user info');\n\n return Peerio.TinyDB.removeItem(lastLoginKey)\n .then(()=>L.info('Removed last saved login info'))\n .catch(err=>L.error('Failed ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Options that can be used to configure how an icon or the icons in an icon set are presented. | function IconOptions() {} | [
"function IconOptions() { }",
"function setIconOptions(options) {\n\t _iconSettings.__options = tslib_1.__assign({}, _iconSettings.__options, options);\n\t}",
"function setIconOptions(options) {\r\n _iconSettings.__options = tslib_1.__assign({}, _iconSettings.__options, options);\r\n}",
"function setIco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a better table formatter for SPARQL select result | function SPARQLSelectTableFormatter(json, namespaces, snorql){
this.sq_formatter = new SPARQLResultFormatter(json, namespaces, snorql);
this.tbody = [];
this.std_tbl_rows = 20;
this.row_count = 0;
this.inc = null;
this.ns = namespaces;
this.snorql = snorql;
this.qh = new GnrQueryHandler(this);
} | [
"convertResultsToTable(results,formatter=this.defaultFormatter){\n let json = JSON.parse(sem.queryResultsSerialize(results,\"json\")); \n let table = `<table>\n ${json.caption!=null?`<caption>${json.caption}</caption>`:''}\n <thead><tr>${json.head.vars.map((varName)=>`<th>${varName}</th>`).join('\\n')}</tr></t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Walk up the ancestors chain looking for the constant | function const_lookup_ancestors(cref, name) {
var i, ii, ancestors;
if (cref == null) return;
ancestors = $ancestors(cref);
for (i = 0, ii = ancestors.length; i < ii; i++) {
if (ancestors[i].$$const && $has_own(ancestors[i].$$const, name)) {
return ancestors[i].$$const[name];
} el... | [
"function const_lookup_ancestors(cref, name) {\n var i, ii, result, ancestors;\n\n if (cref == null) return;\n\n ancestors = Opal.ancestors(cref);\n\n for (i = 0, ii = ancestors.length; i < ii; i++) {\n if (ancestors[i].$$const && $hasOwn.call(ancestors[i].$$const, name)) {\n return ancestor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Groups Group sprites into a container | group(...sprites) {
let container = new this.Container();
sprites.forEach(sprite => {
container.addChild(sprite);
});
return container;
} | [
"function Group() {\n\n //basically extending the array\n var array = [];\n\n /**\n * Gets the member at index i.\n *\n * @method get\n * @param {Number} i The index of the object to retrieve\n */\n array.get = function(i) {\n return array[i];\n };\n\n /**\n * Checks if the group contains a sprite.\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will add the success emoji as the prefix and then translate the message | success(key, args) {
try {
const emoji = this.client.customEmojis['checkmark'];
return this.send({ embed:{ color:3066993, description:`${emoji} ${this.client.translate(key, args, this.client.config.defaultSettings.Language)}` } });
} catch (err) {
this.client.logger.error(err.message);
}
} | [
"success(key, args) {\n\t\t\ttry {\n\t\t\t\tconst emoji = this.client.customEmojis['checkmark'];\n\t\t\t\tconst embed = new MessageEmbed()\n\t\t\t\t\t.setColor(3066993)\n\t\t\t\t\t.setDescription(`${emoji} ${this.client.translate(key, args, this.guild.settings.Language) ?? key}`);\n\t\t\t\treturn this.send({ embeds... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh strips and image lists | function refresh()
{
var strips = document.getElementById("head").querySelectorAll("div");
for (var i = 0, n = strips.length; i < n; ++i) {
strips[i].innerHTML = "";
strips[i]._images = populus.shuffle(images);
strips[i]._i = 0;
draw_strip(strips[i]);
}
} | [
"refresh() {\n for (let i = 0; i < this.cache_.length; i++) {\n this.updateImageOverlay_(this.cache_[i], true);\n }\n }",
"function refresh() {\n ranArrInd(imgArr.length);\n imgOneEl.src = imgArr[imgInd[0]].path;\n imgTwoEl.src = imgArr[imgInd[1]].path;\n imgThreeEl.src = imgArr[imgInd[2]].path;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if password and emails match | function passwordCheck (pass, email) {
for (let key in users) {
if (emailExist(email)) {
if (users[key].password === pass) {
return true
}
}
} return false
} | [
"checkEmailPassword(email, password) {\n // FIXME Connection with first fake user only\n return email === fakeUsers[0].email && password === fakeUsers[0].password;\n }",
"function isPasswordMatches({ email, password }) {\n const userdb = JSON.parse(fs.readFileSync('./users.json', 'UTF-8'))\n return (\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for changing context attribute | toggleContextAttribute(attribute) {} | [
"onToggleContextAttribute(event) {\n var attribute = event.target.name;\n this.toggleContextAttribute(attribute);\n }",
"changeContextParameter(param) {}",
"set contextId(value) { this._contextId = value; }",
"function setContext(key, context) {\n get_current_component().$$.context.set(key, context)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function should generate each of the archive page eg. `archive/20180524` So I need to iterate through the daily links and for each I need to call createPage with template archivepage.js and id of the linksJson node in context. | function generateDDevArchive(graphql, createPage){
return graphql(`
{
allLinksJson{
edges {
node {
id
date
}
}
}
}
`).then(result => {
result.data.allLinksJson.edges.forEach(({ node }) => {
let slug = `/archive/${node.date}`
... | [
"function createTemplates(){\n //parse /src/templates/page.html\n //store page.html content into a variable\n var pageContent = fs.readFileSync(\"src/templates/page.html\");\n //parse pages.json file\n var getFileJson = require(\"./src/data/pages.json\");//load the json file\n var obj = JSON.parse(JSON.string... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PARAMETERS: 1) verb (string) GET, POST, DELETE, PUT 2) route (string) user, 3) jsonInput: json object input paramters for the request RETURNS: a json object of the response | function request(verb, route, jsonInput){
const url = localURL.concat(route);
const param={
headers:{
"content-type":"application/json; charset=UTF-8"
},
body:JSON.stringify(jsonInput),
method:verb
};
return fetch(url,param)
.then(data=>{return data.json()})
... | [
"function routeJson(req, res) {\n 'use strict';\n \n var metaJson = {};\n metaJson.command = {};\n metaJson.command.name = '';\n metaJson.command.start = new Date();\n metaJson.command.finish = null;\n metaJson.command.transaction = uuid.v4();\n metaJson.command.request = '';\n metaJson.command.response =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the knockdown chance of a weapon if it hits the body | function getKnockdownChanceBody(weaponWeight, rawDamage)
{
var weightScale = Math.min(weaponWeight * 0.33, 2.0);
var damageScale = Math.min((rawDamage - 40.0) * 0.2, 5.0);
var kdChance = Math.max(0, Math.round(((weightScale * damageScale * 0.015) - 0.05) * 10000) / 100);
return kdChance;
} | [
"function getKnockdownChanceHeadLegs(weaponWeight, rawDamage)\n{\n\tvar weightScale = Math.min(Math.max(weaponWeight * 0.33, 1.0), 2.0);\n\tvar damageScale = Math.min(Math.max((rawDamage - 40.0) * 0.5, 5.0), 15.0);\n\tvar kdChance = Math.max(0, Math.round((weightScale * damageScale * 0.015) * 10000) / 100);\n\t\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Valida um barcode de 47 digitos, boleto | function validateBarCode47(barcode) {
if (barcode != null) {
barcode = barcode.replace(/\D/g,"");
if (barcode.length == 47) {
var campo1 = barcode.substring(0,9);
//console.log('Campo 1: ' + campo1 + ' ' + modulo10(campo1));
var campo2 = barcode.substring(10,20);
//console.log('Campo 2: ' +... | [
"function validateBarCode48(barcode) {\n\n if (barcode != null) {\n barcode = barcode.replace(/\\D/g,\"\");\n //console.log('Barcode: ' + barcode);\n\n if (barcode.length == 48) {\n var reference = barcode.substring(2,3);\n //console.log('Reference: ' + reference);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check whether multiple different code bases map to a single lambda uri, and remove 'sourceDir' and pass to callback. | function obtainUniqueness(manifest, callback) {
let checkUniqueMap = new Map();
let domainKeyArray = domainRegistry.domainList().map((domain) => {
return domainRegistry.getSkillSchemaKey(domain);
});
for (let domainKey of domainKeyArray) {
if (!manifest.manifest.apis[domainKey] || !manif... | [
"lookupAvailableLambdas() {\n const lambdaConfig = this.fs.readJSON(\n this.destinationPath('src/lambda-config.json'), {\n lambdas: []\n }\n );\n this.availableLambdas = lambdaConfig.lambdas.map((lambda) => {\n return lambda.functionName;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creating colour changing centre dot. | function centreDot() {
if (colorChoosen === 1){
fill(255, 0 ,0);
} else if (colorChoosen === 2){
fill(0, 255, 0);
} else if (colorChoosen === 3){
fill(0, 0, 255);
}
ellipse(width/2, height/2, width/3, width/3);
} | [
"static set centerColor(value) {}",
"static get centerColor() {}",
"drawDot()\n {\n this.ctx.fillStyle = this.colour;\n this.ctx.beginPath();\n this.ctx.arc(this.x, this.y, this.r, 0 * Math.PI, 2 * Math.PI);\n this.ctx.fill();\n }",
"_drawCircleBorderOctants( centerX, centerY... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When a modal window is opened, thid property determines if clicking on the mask closes the window or not. Property type: boolean | get closeOnMaskClick() {
return this.nativeElement ? this.nativeElement.closeOnMaskClick : undefined;
} | [
"static set hasModalWindow(value) {}",
"static get hasModalWindow() {}",
"closeReasonModal() {\n this.askReason = false;\n }",
"closeModal() {\n this.isModalOpen = false;\n }",
"closeModal() {\n this.bShowModal = false;\n }",
"function _modal_close() {\n\t\t\tvar _overlay = w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Using the item. If we assign a slot, we already know where to equip it. | function UseItem(i:Item,slot:int,autoequip:boolean)
{
if(i.isEquipment){
//This is in case we dbl click the item, it will auto equip it. REMEMBER TO MAKE THE ITEM TYPE AND THE SLOT YOU WANT IT TO BE EQUIPPED TO HAVE THE SAME NAME.
if(autoequip)
{
var index=0; //Keeping track of where we are in the list.
va... | [
"function EquipItem(i:Item,slot:int)\n{\n\tif(i.itemType == ArmorSlotName[slot]) //If the item can be equipped there:\n\t{\n\t\tif(CheckSlot(slot)) //If theres an item equipped to that slot we unequip it first:\n\t\t{\n\t\t\tUnequipItem(ArmorSlot[slot]);\n\t\t\tArmorSlot[slot]=null;\n\t\t}\n\t\tArmorSlot[slot]=i; /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gradually decreases speed and moves the ball accordingly | function updateSpeed() {
if (abs(ball.horizontalSpeed) < .075 && abs(ball.verticalSpeed) < .075) { //if ball is moving too slow, stop it
ball.horizontalSpeed = 0;
ball.verticalSpeed = 0;
} else { //otherwise continue gradually decreasing the speed
decrement -= .0001;
ball.horizontalSpeed = ba... | [
"function stayBall()\n{\n ball.speed = 0;\n ball.dx = 0;\n ball.dy = 0;\n}",
"function increaseBallSpeed(){\n\txdirection > 0? xdirection += 2: xdirection -= 2;\n\tydirection > 0? ydirection += 1: ydirection -= 1;\n\n\tpaddle.speed += 5;\n\tcurrPaddleSpeed = paddle.speed;\n}",
"function animateBall(){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Doubles delay between steps, within limits. | function slower() {
if (stepDelay >= MAX_DELAY) { return; }
stepDelay *= 2;
} | [
"function delay(d, i) { return i * 50 }",
"function delayDouble(d) {\n // keep track of the maximum number of concurrent functions\n this.maxConcurrent = Math.max(this.maxConcurrent || 0,this._concurrent);\n var self = this;\n return Promise.delay(50+Math.random()*10)\n .then(function() {\n self.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes path between airports | function deletePolyline() {
myPath.setMap(null);
} | [
"function deleteFlightPath() {\n for (let i =0; i<flightArray.length; i++) {\n flightArray[i].setMap(null);\n }\n flightPathCoordinate = [];\n line1 =[];\n line2 =[];\n}",
"function removeDrawRoute() {\n //console.log(ruta);\n if(myflightPath)\n myflightPath.setMap(null);\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |