query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Returns a list containing the values of the data series at |count| points, starting at |startTime|, and |stepSize| milliseconds apart. Caches values, so showing/hiding individual data series is fast. | getValues(startTime, stepSize, count) {
// Use cached values, if we can.
if (this.cacheStartTime_ === startTime &&
this.cacheStepSize_ === stepSize &&
this.cacheValues_.length === count) {
return this.cacheValues_;
}
// Do all the work.
this.cacheValues_ = this.getValuesIntern... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getValuesInternal_(startTime, stepSize, count) {\n const values = [];\n let nextPoint = 0;\n let currentValue = 0;\n let time = startTime;\n for (let i = 0; i < count; ++i) {\n while (nextPoint < this.dataPoints_.length &&\n this.dataPoints_[nextPoint].time < time) {\n curren... | [
"0.7949372",
"0.5502136",
"0.5275158",
"0.5233204",
"0.515285",
"0.5107172",
"0.5053928",
"0.50388145",
"0.50058025",
"0.49254194",
"0.4901491",
"0.48911986",
"0.48689213",
"0.48393866",
"0.4835799",
"0.4820728",
"0.47670266",
"0.47472343",
"0.47414076",
"0.47237545",
"0.4670... | 0.70340323 | 1 |
Returns the cached |values| in the specified time period. | getValuesInternal_(startTime, stepSize, count) {
const values = [];
let nextPoint = 0;
let currentValue = 0;
let time = startTime;
for (let i = 0; i < count; ++i) {
while (nextPoint < this.dataPoints_.length &&
this.dataPoints_[nextPoint].time < time) {
currentValue = this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getValues(startTime, stepSize, count) {\n // Use cached values, if we can.\n if (this.cacheStartTime_ === startTime &&\n this.cacheStepSize_ === stepSize &&\n this.cacheValues_.length === count) {\n return this.cacheValues_;\n }\n\n // Do all the work.\n this.cacheValues_ = this.g... | [
"0.7175927",
"0.579356",
"0.579356",
"0.55021775",
"0.5450643",
"0.5441113",
"0.5408668",
"0.5340319",
"0.52413726",
"0.51009965",
"0.5085878",
"0.5084537",
"0.50807005",
"0.50741255",
"0.5020163",
"0.5007443",
"0.49845633",
"0.49801472",
"0.4963073",
"0.4924633",
"0.49241197... | 0.59739953 | 1 |
Writes food data to masterData database | function writeUserData(date, meal, location, food) {
firebase.database().ref(`masterData`).push().set({
date : date,
meal : meal,
location : location,
food : food
});
document.write("Successfully wrote " + food + " to master db")
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeStock(x){\n database.ref('/').update({\n Food: x\n })\n }",
"function writeToArchive(food) {\n firebase.database().ref('foodArchive').push().set({\n food : food\n });\n}",
"function writeStock(x){\n database.ref('/').update({\n Food:x\n })\n}",
"function writeDataInt... | [
"0.6487674",
"0.64178115",
"0.6354973",
"0.6253716",
"0.6202341",
"0.6094093",
"0.6038725",
"0.5960817",
"0.5937026",
"0.59279096",
"0.59090024",
"0.5897781",
"0.588479",
"0.58187705",
"0.5793781",
"0.5792784",
"0.577725",
"0.5767684",
"0.576122",
"0.5753659",
"0.57479596",
... | 0.74519974 | 0 |
Writes food to archive database | function writeToArchive(food) {
firebase.database().ref('foodArchive').push().set({
food : food
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeStock(x){\n database.ref('/').update({\n Food: x\n })\n }",
"function writeStock(x){\n database.ref('/').update({\n Food:x\n })\n}",
"function writeUserData(date, meal, location, food) {\n firebase.database().ref(`masterData`).push().set({\n date : date,\n meal : meal,\n ... | [
"0.6566954",
"0.63741714",
"0.62838346",
"0.62368333",
"0.602272",
"0.6016315",
"0.59534913",
"0.5855415",
"0.58547926",
"0.5844566",
"0.5824655",
"0.58016104",
"0.5801507",
"0.57301253",
"0.57039255",
"0.5694352",
"0.5691133",
"0.5671416",
"0.56539744",
"0.56539273",
"0.5653... | 0.7830355 | 0 |
Writes date info to date db | function writeDateData(date) {
firebase.database().ref(`dateData`).push().set({
date : date
});
document.write("Successfully wrote " + date + " to date db")
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function write_dos_date(buf, date) {\n\tif(typeof date === \"string\") date = new Date(date);\n\tvar hms = date.getHours();\n\thms = hms << 6 | date.getMinutes();\n\thms = hms << 5 | (date.getSeconds()>>>1);\n\tbuf.write_shift(2, hms);\n\tvar ymd = (date.getFullYear() - 1980);\n\tymd = ymd << 4 | (date.getMonth()+... | [
"0.6638407",
"0.6638407",
"0.6638407",
"0.6638407",
"0.6625939",
"0.63798",
"0.6170891",
"0.6144417",
"0.6002292",
"0.59971064",
"0.5844244",
"0.57393384",
"0.57343763",
"0.5712451",
"0.57115763",
"0.57115763",
"0.56815004",
"0.5662586",
"0.5655457",
"0.5617467",
"0.5568135",... | 0.7149188 | 0 |
Create a drawing.Path for a rounded rectangle. Receives the bounding box and the borderradiuses in CSS order (topleft, topright, bottomright, bottomleft). The radiuses must be objects containing x (horiz. radius) and y (vertical radius). | function roundBox(box, rTL0, rTR0, rBR0, rBL0) {
var tmp = adjustBorderRadiusForBox(box, rTL0, rTR0, rBR0, rBL0);
var rTL = tmp.tl;
var rTR = tmp.tr;
var rBR = tmp.br;
var rBL = tmp.bl;
var path = new Path({ fill: null, stroke: null });
path.moveTo(box.left, box.top + rTL.y);
if (rTL.x) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _buildRoundRectPath(x, y, width, height, radius) {\r\n var w = width, h = height,\r\n r0 = radius[0], r1 = radius[1],\r\n r2 = radius[2], r3 = radius[3],\r\n w2 = (width / 2) | 0, h2 = (height / 2) | 0;\r\n\r\n r0 < 0 && (r0 = 0);\r\n r1 < 0 && (r1 = 0);\r\n r2 < 0 && (r2... | [
"0.74293697",
"0.7353971",
"0.7337654",
"0.7261688",
"0.7244709",
"0.71202064",
"0.71093607",
"0.70745313",
"0.7054942",
"0.7036854",
"0.7036854",
"0.6980099",
"0.69381267",
"0.69330275",
"0.69154555",
"0.68909913",
"0.6779745",
"0.67643076",
"0.6527992",
"0.65261537",
"0.650... | 0.73552823 | 1 |
this function will be called to draw each border. it draws starting at origin and the resulted path must be translated/rotated to be placed in the proper position. arguments are named as if it draws the top border: `len` the length of the edge `Wtop` the width of the edge (i.e. bordertopwidth) `Wleft` the width of the ... | function drawEdge(color, len, Wtop, Wleft, Wright, rl, rr, transform$$1) {
if (Wtop <= 0) {
return;
}
var path, edge = new Group();
setTransform$1(edge, transform$$1);
group.append(edge);
sanitizeRadius(rl);
sanitizeRadius(rr);
// draw main ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawEdge(color, len, Wtop, Wleft, Wright, rl, rr, transform$$1) {\n\t if (Wtop <= 0) {\n\t return;\n\t }\n\t\n\t var path, edge = new Group();\n\t setTransform$1(edge, transform$$1);\n\t group.append(edge);\n\t\n\t sanitizeRadius(rl);\n\t sanitiz... | [
"0.6513412",
"0.6510739",
"0.6499747",
"0.59647447",
"0.5811284",
"0.56876016",
"0.56306905",
"0.55659646",
"0.5536552",
"0.5490116",
"0.5372757",
"0.5345526",
"0.53385264",
"0.5336191",
"0.5325127",
"0.5324734",
"0.53119314",
"0.5295348",
"0.528474",
"0.5275812",
"0.5275482"... | 0.66363215 | 0 |
draws one round corner, starting at origin (needs to be translated/rotated to be placed properly). | function drawRoundCorner(Wright, r, transform$$1) {
var angle = Math.PI/2 * Wright / (Wright + Wtop);
// not sanitizing this one, because negative values
// are useful to fill the box correctly.
var ri = {
x: r.x - Wright,
y: r.y - Wtop
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawRoundCorner(Wright, r, transform$$1) {\n\t var angle = Math.PI/2 * Wright / (Wright + Wtop);\n\t\n\t // not sanitizing this one, because negative values\n\t // are useful to fill the box correctly.\n\t var ri = {\n\t x: r.x - Wright,\n\t ... | [
"0.675623",
"0.6561048",
"0.655816",
"0.64326656",
"0.62747943",
"0.59803766",
"0.5978996",
"0.59567374",
"0.59404546",
"0.59313476",
"0.5874697",
"0.58654714",
"0.58475703",
"0.58325833",
"0.58288527",
"0.58106905",
"0.580036",
"0.5795021",
"0.57820404",
"0.57631683",
"0.576... | 0.67354244 | 1 |
Sets the new scale for an element, as if it was zoomed into `clientX, clientY` point | function zoomTo(svgElement, clientX, clientY, scaleMultiplier) {
var transform = getTransform(svgElement)
var parent = svgElement.ownerSVGElement
var parentCTM = parent.getScreenCTM()
// we have consistent scale on both X and Y, thus we can use just one attribute:
var scale = transform.matrix.a * scaleMultipl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleScale(e) {\n var origins = getTransformOrigin(el);\n var parts = getTransform(el);\n var oldScale = +parts[0];\n if ((e.deltaY < 0 && oldScale >= maxScale)\n || (e.deltaY > 0 && oldScale <= minScale)) {\n return;\n }\n var deltScale = e... | [
"0.6927653",
"0.6753072",
"0.67261064",
"0.6724211",
"0.66250086",
"0.6616712",
"0.65875936",
"0.64995337",
"0.64986014",
"0.64969003",
"0.6494306",
"0.6492286",
"0.6492286",
"0.6492286",
"0.6490745",
"0.64666325",
"0.6465926",
"0.6432087",
"0.642981",
"0.64108974",
"0.638030... | 0.7178966 | 1 |
Change straight quotes to curly and double hyphens to emdashes. | function smarten(a) {
a = a.replace(/(^|[-\u2014\s(\["])'/g, "$1\u2018"); // opening singles
a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes
a = a.replace(/(^|[-\u2014/\[(\u2018\s])"/g, "$1\u201c"); // opening doubles
a = a.replace(/"/g, "\u201d"); ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set DoubleQuote(value) {}",
"get DoubleQuote() {}",
"function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }",
"function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }",
"function esc(v) { return... | [
"0.6364124",
"0.61465424",
"0.59933156",
"0.59933156",
"0.59933156",
"0.59933156",
"0.59755725",
"0.59755725",
"0.59755725",
"0.59755725",
"0.5947093",
"0.5922883",
"0.5891615",
"0.58870107",
"0.5840751",
"0.5743681",
"0.5730794",
"0.5681684",
"0.566637",
"0.5646332",
"0.5641... | 0.6669284 | 0 |
Bee Class holds all of the attributes for bee creation | function Bee() {
this.BEE_FLIGHT_RADIUS = 12;
this.BEE_FLIGHT_Y_MOVEMENT = 3;
this.MAX_WING_ANGLE = 45;
this.MAX_LEG_ANGLE = 30;
// dimensions for head
this.HEAD_MATERIAL = new Material (vec4 (.2, 0, .6, 1), 1, 1, 1, 40); // default blue
this.HEAD_RADIUS = 1/2;
// dimensions for thorax (rectangular prism)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function beeModel() {\n //variables\n this.name = 'Bee';\n this.cost = 0;\n this.gender = 'Female';\n this.canAddHoney = false;\n this.canAddTerritory = false;\n this.canAddHealth = false;\n this.eggRate = 0;\n this.honeyRate = 0;\n this.territoryRate = 0;\n this.healthRate = 0;\n this.domT... | [
"0.7167673",
"0.64679414",
"0.6144913",
"0.6066607",
"0.6034691",
"0.60186803",
"0.5857203",
"0.57693285",
"0.57670736",
"0.5692938",
"0.568638",
"0.5660569",
"0.56382376",
"0.56249976",
"0.56211907",
"0.5620175",
"0.55744046",
"0.55572325",
"0.55141705",
"0.550414",
"0.54738... | 0.69761163 | 1 |
Flower Class holds all of the attributes for flower creation | function Flower() {
// controls the swaying angle of flower
this.MAX_STEM_ANGLE = 1;
// dimensions for flower
this.FLOWER_MATERIAL = new Material (vec4 (.5, .5, 0, 1), 1, 1, 1, 40); // default yellow
this.FLOWER_RADIUS = 1;
this.PETAL_MATERIAL = new Material (vec4 (.4, 0, 0, 1), 1, 1, 1, 40);
this.NUM_FLOWER_P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function BasicFlower(){\n\n\t// size l represented by basic styles\n\tthis.flowerSizes = {\n\t\tcssClassS : 'flower__small',\n\t\tcssClassM : 'flower__medium',\n\t\tcssClassXl : 'flower__xlarge',\n\t}\n\n\tthis.flower = createFlower();\n\n\tfunction createFlower(){\n\t\tlet flower = document.createElement('div');\... | [
"0.72126305",
"0.66222924",
"0.6212252",
"0.6195043",
"0.61527044",
"0.6082194",
"0.6082194",
"0.59906095",
"0.5868412",
"0.5865271",
"0.58624303",
"0.58521134",
"0.583644",
"0.58287424",
"0.5785014",
"0.5783557",
"0.5757908",
"0.5753696",
"0.575099",
"0.57299167",
"0.5691207... | 0.74513304 | 0 |
Ground Class holds all of the attributes for ground creation | function Ground() {
// dimensions of ground plane
this.GROUND_MATERIAL = new Material (vec4( 0.503922, 0.803922, 0.26078, 1), 1, 1, 1, 10);
this.GROUND_X = 150;
this.GROUND_Y = 0.1;
this.GROUND_Z = 150;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"CreateGround() {\n const bd = new b2.BodyDef();\n const ground = this.m_world.CreateBody(bd);\n const shape = new b2.ChainShape();\n const bottomLeft = new b2.Vec2(), topRight = new b2.Vec2();\n Fracker.GetExtents(bottom... | [
"0.70413995",
"0.6795256",
"0.674617",
"0.66538596",
"0.6613165",
"0.6528328",
"0.64832896",
"0.63935137",
"0.6314495",
"0.62776244",
"0.62315524",
"0.6207531",
"0.6206279",
"0.61950487",
"0.61429745",
"0.6123748",
"0.6074315",
"0.6069648",
"0.60649043",
"0.60197884",
"0.6017... | 0.7486694 | 0 |
Interfaces: utf8 = utf16to8(utf16); utf16 = utf16to8(utf8); | function utf16to8(str) {
if (str.match(/^[\x00-\x7f]*$/) != null) {
return str;
}
var out, i, j, len, c, c2;
out = [];
len = str.length;
for (i = 0, j = 0; i < len; i++, j++) {
c = str.charCodeAt(i);
if (c <= 0x7f) {
out[j] = str.charAt(i);
}
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Utf16BeEncoding()\r\n{\r\n // note: false means big-endian.\r\n var myUtf16EncodingBase = new Utf16EncodingBase(false);\r\n \r\n this.stringFromBytes = function(dynamicDataView, beginIdx, size)\r\n {\r\n return myUtf16EncodingBase.stringFromBytes(dynamicDataView, beginIdx, size);\r\n... | [
"0.7393821",
"0.7270583",
"0.7055033",
"0.66526073",
"0.64706486",
"0.63793415",
"0.6350469",
"0.62929094",
"0.62923",
"0.6285934",
"0.6285934",
"0.6274399",
"0.6270515",
"0.625805",
"0.6241539",
"0.62309146",
"0.62309146",
"0.62309146",
"0.62309146",
"0.62309146",
"0.6230914... | 0.7310141 | 1 |
runs once per tick move any dynamic meshes to correct chunk octree | function updateDynamicMeshOctrees(self) {
for (var i = 0; i < self._dynamicMeshes.length; i++) {
var mesh = self._dynamicMeshes[i]
if (mesh._isDisposed) continue // shouldn't be possible
var pos = mesh.position
var prev = mesh._currentNoaChunk || null
var next = self.noa.worl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tickPhysics()\n{\n n_recalculateTorques(rootNode);\n n_applyTorques(rootNode);\n n_updatePositions(rootNode);\n}",
"updateMeshes () {\r\n const availableMeshes = this.world.getAvailableMeshes(this.player.position)\r\n const objectsToAdd = availableMeshes.filter(mesh => !this.currentMeshes.inclu... | [
"0.66243577",
"0.63371557",
"0.6323728",
"0.62447864",
"0.62447864",
"0.6239522",
"0.6137942",
"0.6137942",
"0.6041333",
"0.6006749",
"0.5939085",
"0.5874244",
"0.5845505",
"0.58395785",
"0.582584",
"0.582316",
"0.5796315",
"0.5791467",
"0.57906073",
"0.57839364",
"0.5782277"... | 0.75015557 | 0 |
If camera's current location block id has alpha color (e.g. water), apply/remove an effect | function checkCameraEffect(self, id) {
if (id === self._camLocBlock) return
if (id === 0) {
self._camScreen.setEnabled(false)
} else {
var matId = self.noa.registry.getBlockFaceMaterial(id, 0)
if (matId) {
var matData = self.noa.registry.getMaterialData(matId)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setAlphaAt(layerID, alpha) {\n this.compositeEffect.getLayerAt(layerID).alpha = alpha\n }",
"function currentColor() {\n if(timeBlock < currentTime) {\n \n \n \n }\n}",
"function changeColor()\n{\n if (this.style.backgroundColor === 'rgb(255, 255, 255)' || flag === ... | [
"0.58621484",
"0.5848601",
"0.58363485",
"0.580018",
"0.5714294",
"0.57138485",
"0.56716233",
"0.56299466",
"0.5619025",
"0.5610608",
"0.56007105",
"0.5596775",
"0.55777013",
"0.557615",
"0.5548642",
"0.55468994",
"0.5541848",
"0.5540143",
"0.5535363",
"0.552314",
"0.5512634"... | 0.7216677 | 0 |
Eventos para o filtro de Indicadores. | function iniciarFiltroIndicadores() {
//Se o item j? estiver selecionado (tela de update), efetua as devidas a??es.
if ( $('input[name="_indicadores_id"]').val() !== '' )
selecionadoIndicadores();
//Bot?o de filtrar
$('.btn-filtro-indicadores').on({
click: function() {
if ( !$(_indicador... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleEventFiltering() {\n this.events = this.filterByType(this.replicaSetEvents.events, this.eventType);\n this.events = this.filterBySource(this.events, this.eventSource);\n }",
"function handleFilterList() {\n if (startDate === \"\" || endDate === \"\") {\n notify(\n \"warning\",\n ... | [
"0.63003135",
"0.6253646",
"0.6243953",
"0.608406",
"0.60441786",
"0.6011637",
"0.59893626",
"0.5984248",
"0.5945106",
"0.58831203",
"0.5812188",
"0.5811994",
"0.579895",
"0.5793439",
"0.57808",
"0.5780231",
"0.57760215",
"0.5732845",
"0.5726112",
"0.5717813",
"0.57172835",
... | 0.6693178 | 0 |
Generates the HTML for a user profile | function GenerateProfileHTML(user) {
if(typeof user['link'] != 'undefined')
return '<a href="' + user['link'] + '" class="user-link">by ' + user['display_name'] + '</a>';
else
return '<span class="user-link">' + user['display_name'] + '</span>'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function output_user_profile(res, login, userInfo, userInterests, userFriends, peopleWithSameInterests) {\n\tres.render('profile.jade',\n\t\t { title: \"Profile for User with login \" + login,\n\t\t\t userInfo: userInfo,\n\t\t\t userInterests: userInterests,\n\t\t\t userFriends: userFriends,\n\t\t\t peopleWithSa... | [
"0.75059193",
"0.7350002",
"0.7340478",
"0.725944",
"0.7104964",
"0.69974136",
"0.6963821",
"0.69281244",
"0.6910094",
"0.6898787",
"0.67968345",
"0.67879885",
"0.67773235",
"0.67619056",
"0.66910547",
"0.66604096",
"0.662208",
"0.66174966",
"0.6601753",
"0.6594279",
"0.65588... | 0.78647846 | 0 |
Generates the HTML for an answer | function GenerateAnswerHTML(options, answer) {
var content = '';
if(options['votes'] == 'true')
content += '<div class="hr" /><a href="' + answer['link'] + '" target="_blank" class="heading answer-count">' +
answer['score'] + ' votes' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateHtml() {\n $(\"#instruction\").html('Select the right answers and click Submit');\n $(\"#score\").html(\"\");\n for (i = 0; i < triviaDatabase.length; i++) {\n var newQuestion = $(\"<h2>\").append(triviaDatabase[i].question);\n $(\"#allQuestions\").append... | [
"0.74989074",
"0.7023817",
"0.68999875",
"0.68755084",
"0.6849847",
"0.6837036",
"0.683609",
"0.68310374",
"0.6823454",
"0.67912704",
"0.6783779",
"0.6772609",
"0.67647177",
"0.6763939",
"0.67504144",
"0.67454016",
"0.6709869",
"0.6702773",
"0.6700059",
"0.6697529",
"0.667088... | 0.7679076 | 0 |
Processes the answers to a question, returning the HTML for the answers | function ProcessAnswers(options, data) {
// Unfortunately we need to manually sort the answers because the API does not do this for us and then
// convert the answers into a map where the key becomes the answer's ID
var sorted_answers = data['answers'].sort(function ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showQuizTemplate(correctAnswers, question, questionNumber) {\n// question per my function nextQuestion() is from the questionList array of objects\n\treturn `\n\t<form title=\"American Government Quiz\"> <h2 id=\"question\">${question.text}</h2>\n <fieldset role=\"radiogroup\">\n <legend>Select ... | [
"0.6973838",
"0.6918255",
"0.6884803",
"0.688155",
"0.68615085",
"0.68143135",
"0.67644507",
"0.6753648",
"0.67509836",
"0.67452663",
"0.6738506",
"0.67295504",
"0.6701158",
"0.66990095",
"0.66983205",
"0.6680145",
"0.66799057",
"0.6675865",
"0.66687196",
"0.6658865",
"0.6637... | 0.6962763 | 1 |
Processes a list of questions for a particular site | function ProcessQuestionList(question_list, api_data) {
// First, convert the data into a map [question ID] => [API data]
var questions = {};
$.each(api_data, function(key, question) { questions[question['question_id']] = question; });
// N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupQuestions() {\n // swap the div on display\n document.getElementById(\"introduction\").style.display = \"none\";\n document.getElementById(\"questions\").style.display = \"block\";\n // get the page elements\n questionHeading = document.getElementById(\"question_heading\");\n questi... | [
"0.6087599",
"0.60601276",
"0.6002623",
"0.599546",
"0.5988311",
"0.5872708",
"0.582767",
"0.58103687",
"0.57809484",
"0.57569563",
"0.5686904",
"0.5642264",
"0.5620857",
"0.560039",
"0.55774873",
"0.5534916",
"0.55207205",
"0.5466782",
"0.546408",
"0.5447002",
"0.54176056",
... | 0.63155174 | 0 |
Generate a random number, odd goes to the left even goes to the right 1 for the left, 1 for the right | function leftOrRight() {
random = Math.floor(Math.random() * 10)
if (random % 2 == 0) {
return 1
} else {
return -1
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomNumber() {\r\n\tvar n = Math.round(Math.random() * 2 + 2);\r\n\tif (n !== 1) {\r\n\t\tn = n - n % 2;\r\n\t} else {\r\n\t\tn = n + n % 2;\r\n\t}\r\n\treturn n;\r\n}",
"function getRandomInt() {\r\n return Math.floor(Math.random() * 2)\r\n }",
"function getRamdom0_1() {\n var random = Math.fl... | [
"0.7182977",
"0.71080846",
"0.70146334",
"0.6957639",
"0.6837845",
"0.67743313",
"0.6759685",
"0.67589605",
"0.6746578",
"0.67362314",
"0.6668971",
"0.66381127",
"0.6614286",
"0.6609744",
"0.66034836",
"0.65852904",
"0.6581735",
"0.65784013",
"0.6567241",
"0.6566158",
"0.6565... | 0.7583175 | 0 |
Gets all call by all customers and sets them to statusList state. | getAllCalls(){
GetAllCustomers().then(async(response) => {
const callList = await Promise.all(response.data.map(async (customer, id) => {
var callResponse = await GetCallLogsByCustomerId(customer.id)
if(callResponse.status == "OK")
{
return callResponse.data
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCustomers() {\n CustomerService.getCustomers()\n .success(function(custs) {\n $scope.gridOpts.data = custs;\n })\n .error(function(error) {\n $scope.status = 'Unable to load customer data: ' + error.message;\n... | [
"0.6240233",
"0.6136181",
"0.6102866",
"0.5976002",
"0.5974769",
"0.5848147",
"0.5843582",
"0.5815147",
"0.57983464",
"0.57979554",
"0.5793831",
"0.57835865",
"0.5773335",
"0.5763073",
"0.57528096",
"0.5717742",
"0.57162035",
"0.56668085",
"0.5666196",
"0.5666149",
"0.5634427... | 0.65816563 | 0 |
Sets status to a call with given parameters, will notify on succes or error. | setStatusOfCall(callId, status, callsArrayId){
var patchData = {
callId: callId,
status: status
}
UpdateCallLog(patchData).then(response => {
if(response.status === "OK")
{
var callsLogs = this.state.calls
callsLogs[callsArrayId] = response.data;
this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCallStatus(status) {\n $_this(\"#call-status\").html(status);\n}",
"setStatusOfCall(callId, status, callsArrayId){\n var patchData = {\n callId: callId,\n status: status\n }\n\n UpdateCallLog(patchData).then(response => {\n if(response.status === \"OK\")\n {... | [
"0.6543013",
"0.61126715",
"0.57874435",
"0.57742774",
"0.5642735",
"0.5571528",
"0.55477214",
"0.55229205",
"0.55229205",
"0.55152935",
"0.55079836",
"0.5498298",
"0.54933405",
"0.5418",
"0.53999656",
"0.5372049",
"0.53691375",
"0.5354892",
"0.5344342",
"0.53082156",
"0.5292... | 0.61631477 | 1 |
Hash function: uses timestamp, lasthash and stored data as the N that represents the hashe | static hash(timestamp, lastHash, data, nonce, difficulty){
return ChainUtil.hash(`${timestamp}${lastHash}${data}${nonce}${difficulty}`).toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static hash(timestamp, lastHash, data, nonce, difficulty) {\n \treturn ChainUtil.hash(`${timestamp}${lastHash}${data}${nonce}${difficulty}`).toString();\n }",
"calculateHash(){ \r\n return SHA256(this.index + this.previousHas... | [
"0.78690886",
"0.7355337",
"0.73309845",
"0.73182297",
"0.73091763",
"0.7297435",
"0.7273449",
"0.72452766",
"0.7225147",
"0.7198172",
"0.7198172",
"0.7193585",
"0.71111614",
"0.69616747",
"0.68930244",
"0.68919784",
"0.68058074",
"0.6762053",
"0.6741979",
"0.6735577",
"0.668... | 0.7995697 | 0 |
apply the new board | function applyBoard(){
g_wall = new Wall(g_newBoard,0,0);
reset();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateBoard(board) {\n\tvar newBoard = copyArray(board);\n\tfor (var i = 0; i < getHeight(board); i++) {\n\t\tfor (var j = 0; j < getWidth(board); j++) {\n\t\t\tvar neighborCount = countNeighbors(board, j, i);\n\t\t\tif (neighborCount === 3) {\n\t\t\t\tnewBoard[j][i] = 1;\n\t\t\t}\n\t\t\telse if (neighbor... | [
"0.66442454",
"0.6634518",
"0.64425874",
"0.6410926",
"0.6409043",
"0.6390954",
"0.63543725",
"0.6344303",
"0.6341869",
"0.63381916",
"0.6297657",
"0.6277048",
"0.62498033",
"0.62179506",
"0.62153035",
"0.6211329",
"0.6207918",
"0.6198665",
"0.6193621",
"0.61816263",
"0.61791... | 0.7477831 | 0 |
set current volume level and store to | function _setVolume(v)
{
videoObject.volume = v;
control_volume.seekSlider('seek', v);
if(typeof localStorage != 'undefined')
{
localStorage.setItem('volume', v);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MV_SetVolume(volume) {\n volume = Math.max(0, volume);\n volume = Math.min(volume, MV_MaxTotalVolume);\n\n MV_TotalVolume = volume;\n}",
"function set_volume(){\n\t\taudio.volume = parseFloat(this.value / 100);\n\t}",
"set volume(vol)\n {\n this._control.value = Math.max(0,Math.min(100,vo... | [
"0.74144095",
"0.74120355",
"0.73880714",
"0.7236963",
"0.717101",
"0.7169664",
"0.71038556",
"0.7097744",
"0.7087106",
"0.70365304",
"0.7019019",
"0.69965756",
"0.6995026",
"0.69910365",
"0.69901466",
"0.6981654",
"0.69679344",
"0.6965144",
"0.69648945",
"0.69552225",
"0.694... | 0.7577558 | 0 |
increases the ad pointer or sets it to null if there are no more ads | function _gotoNextAd()
{
nextAd++;
if(nextAd >= player.clip.ads.length)
{
nextAd = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AdsRefresh() {\n var detect_device = get_device();\n if (detect_device == 'desktop') {\n if (jQuery(\".node-type-recipe\").length > 0) {\n // Adding the adslot for desktop & mobile.\n if (jQuery('div#ad-multi_ad_leaderboard').length > 0) {\n var scrollTopPosition, bottomOfElement, ou... | [
"0.55693",
"0.5512934",
"0.54049003",
"0.53304243",
"0.5269616",
"0.5240582",
"0.52376586",
"0.5179522",
"0.5167669",
"0.51491725",
"0.5121991",
"0.5073402",
"0.5069809",
"0.50062525",
"0.49965",
"0.4995619",
"0.49791002",
"0.49763164",
"0.49457395",
"0.49062073",
"0.4900071"... | 0.72789824 | 0 |
Returns true if the maxValueCount value is valid. | isMaxValueCountValid() {
if (this.isValueTypeSelect()) {
return (this.isSingleSelect() || this.isMultipleSelect());
}
return ((this.maxValueCount === null) ||
(this.maxValueCount === AnnotationMaxValueCount.NONE));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function maxValueCountRequired() {\n return ((vm.annotType.maxValueCount < 1) || (vm.annotType.maxValueCount > 2));\n }",
"function isLessThanMaxValuePlusNonZero() {\n\t\n\tvar len = inputDigits.length;\n\n\tvar i, j;\n\n\tfor(i = 0; i < len; i++){\n\n\t\tif(inputDigits[i] > MAXVAL){\n\n\t\t\terrorMessag... | [
"0.7149446",
"0.6726938",
"0.66662204",
"0.6664043",
"0.6528222",
"0.627548",
"0.60015124",
"0.57038605",
"0.5689484",
"0.5676869",
"0.56721824",
"0.5643552",
"0.56225073",
"0.56146497",
"0.557657",
"0.5554315",
"0.5544934",
"0.55034465",
"0.5490678",
"0.5475875",
"0.5474719"... | 0.8210685 | 0 |
Called when the annotation type's value type has been changed. | valueTypeChanged() {
if (!this.isValueTypeSelect()) {
this.maxValueCount = AnnotationMaxValueCount.NONE;
}
this.options = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleAnnotationTypeChange() {\n gAnnotationType = parseInt($('#annotation_type_id').val());\n globals.currentAnnotationsOfSelectedType = gCurrentAnnotations.filter(function(e) {\n return e.annotation_type.id === gAnnotationType;\n });\n setTool();\n setupCBCheckboxes();\n }",
"func... | [
"0.6767074",
"0.65800756",
"0.62600935",
"0.61884594",
"0.6157069",
"0.59539425",
"0.5904408",
"0.58459175",
"0.57941115",
"0.57693505",
"0.57078177",
"0.56280786",
"0.5511516",
"0.5461591",
"0.544887",
"0.5443955",
"0.542222",
"0.54216987",
"0.5400331",
"0.54001176",
"0.5391... | 0.73789895 | 0 |
Used to add an option. Should only be called when the value type is 'Select'. | addOption() {
if (!this.isValueTypeSelect()) {
throw new DomainError('value type is not select: ' + this.valueType);
}
this.options.push('');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function optionAdd() {\n if (vm.annotType.valueType !== 'Select') {\n throw new Error('value type error: ' + vm.annotType.valueType);\n }\n\n if (!vm.annotType.options) {\n vm.annotType.options = [];\n }\n vm.annotType.options.push('');\n }",
"function addOption(theSel, ... | [
"0.77989566",
"0.73904634",
"0.7381969",
"0.7187327",
"0.7187327",
"0.7166405",
"0.70861614",
"0.7084701",
"0.7045026",
"0.70237374",
"0.69763595",
"0.69511616",
"0.6941061",
"0.69407755",
"0.6897757",
"0.68942875",
"0.68754005",
"0.6807149",
"0.6749737",
"0.6749737",
"0.6734... | 0.75692135 | 1 |
Returns true if each of the options in the options array are valid options for this annotation type. Options is an array of objects with keys: value and checked. | validOptions(options) {
return options.reduce((memo, option) => memo && this.options.includes(option), true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isOptions(){\n for (var key in options)\n if (options.hasOwnProperty(key)) return true;\n return false;\n }",
"function validateOptions(options) {\n const validateInt = (name) => {\n const val = toInt(options[name]);\n if (val === undefined) {... | [
"0.60108817",
"0.56587464",
"0.5567893",
"0.5441195",
"0.53729427",
"0.53729427",
"0.5292512",
"0.5292512",
"0.52333707",
"0.5221375",
"0.5221375",
"0.5221056",
"0.5196151",
"0.5188089",
"0.5187421",
"0.5185178",
"0.5128911",
"0.5128026",
"0.5093299",
"0.5093299",
"0.5055166"... | 0.65866643 | 0 |
Gets the first (latest) token from a cookie: THIS__ONE>>NOT__THIS__ONE>>AND__NOT__THIS__ONE | function getFirstTokenFromCookie(cookie){
var result = "";
var firstSeparatorIndex = cookie.indexOf(traffic_source_COOKIE_TOKEN_SEPARATOR);
result = firstSeparatorIndex !== -1 ? cookie.substring(0, firstSeparatorIndex) : cookie; //if there is a separator, provide the newest value no the cookie ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getToken() {\n var token = document.cookie.replace(/(?:(?:^|.*;\\s*)token\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\");\n return token;\n}",
"function getToken() {\n if (!document.cookie) {\n return null;\n }\n const cookies = document.cookie.split(';')\n .map((i... | [
"0.733249",
"0.68202746",
"0.681249",
"0.6801257",
"0.6770747",
"0.6666369",
"0.65973717",
"0.65405947",
"0.64683044",
"0.6361763",
"0.6337599",
"0.6225791",
"0.6212634",
"0.6188346",
"0.6156331",
"0.61473703",
"0.6135041",
"0.6135041",
"0.6132989",
"0.61210614",
"0.6070494",... | 0.7724577 | 1 |
Remove the protocol for the referral token | function removeProtocol(href) {
return href.replace(/.*?:\/\//g, "");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function urlWithoutProtocol(url) {\n return url.replace(protocolReg, '');\n }",
"function removeStoredToken(){\n var url = 'https://accounts.google.com/o/oauth2/revoke?token=' + tokenStored;\n window.fetch(url);\n chrome.identity.removeCachedAuthToken({token: tokenStored}, function (){});\n}",
"function... | [
"0.6180391",
"0.5867053",
"0.5826833",
"0.55653465",
"0.55465436",
"0.5531629",
"0.55298555",
"0.5409788",
"0.5377281",
"0.5373203",
"0.5362341",
"0.5348067",
"0.52953166",
"0.5282851",
"0.524859",
"0.5232394",
"0.52268034",
"0.5217557",
"0.5215772",
"0.5181174",
"0.51475173"... | 0.64212996 | 1 |
Return the best size for the requested avatar size | function getBestSizeFor(size) {
for (var i = 0; i < KNOWN_AVATAR_SIZES.length; i++) {
var currentSize = KNOWN_AVATAR_SIZES[i];
if (size <= currentSize) return currentSize;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBestImageSize(sizes) {\n let bestSize = false;\n\n for (let size in sizes) {\n if (sizes[size][1] >= this.windowWidth) {\n bestSize = size;\n break;\n }\n }\n\n if (!bestSize) {\n // Get last key in sizes object\n bestSize = Object.keys(sizes)[Object.keys(sizes).len... | [
"0.64878374",
"0.6473315",
"0.618326",
"0.60618657",
"0.5899504",
"0.58367985",
"0.5785582",
"0.5780182",
"0.57740504",
"0.576017",
"0.5734904",
"0.570705",
"0.56564313",
"0.5644715",
"0.55765253",
"0.556347",
"0.55545896",
"0.5499402",
"0.54921895",
"0.5485978",
"0.54574734"... | 0.8122676 | 0 |
Returns the optimal avatar url to return for the given size | function getGroupAvatarUrlForSize(group, size) {
const avatarUrl = group.avatarUrl;
const parsed = url.parse(avatarUrl, true);
// Tack on a version param otherwise the S3 url is always the same and
// you always get the cached avatar from nginx's cache.
parsed.query = parsed.query || {};
if (group.avatarV... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _usfGetOriginImgWithSize(url, size = '50x50') {\r\n var n = url.lastIndexOf(\".\");\r\n if (n != -1)\r\n return url.substring(0, n) + '_' + size + url.substring(n);\r\n else\r\n return url\r\n}",
"function getUserPhotoUrl(accountName, size) {\n var userPhotoBaseUrl = tryGetAlte... | [
"0.69802517",
"0.6954084",
"0.69303304",
"0.69303304",
"0.6868553",
"0.68492115",
"0.6655605",
"0.6637753",
"0.6630408",
"0.66101694",
"0.66101694",
"0.66101694",
"0.66101694",
"0.66101694",
"0.65870404",
"0.6555746",
"0.6551981",
"0.6540415",
"0.64227694",
"0.6413774",
"0.63... | 0.75917065 | 0 |
Rely on the secondary, but if that doesn't find a recently created group, fallback to querying the primary | function findOnSecondaryOrPrimary(groupId) {
return Group.findById(groupId, SELECT_FIELDS, { lean: true })
.read(mongoReadPrefs.secondaryPreferred)
.then(function(group) {
if (group) return group;
// Chance that it's not on the secondary yet...
return Group.findById(groupId, SELECT_FIELDS, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSingleGroup(db, ObjectID, groupdoc, issuper, curruserid){\n\n var getGroupArray = async () => {\n var userdoc = await (global.lookupUserName(db, groupdoc.groupadminid));\n var adminname = userdoc.username;\n var adminimage = userdoc.imagepath;\n\n var newgroup = new Group.Group_CS(\n ... | [
"0.6087339",
"0.56494653",
"0.5526681",
"0.55133677",
"0.5358821",
"0.5290795",
"0.5276548",
"0.526237",
"0.5246025",
"0.51711124",
"0.51671284",
"0.51584417",
"0.5131122",
"0.5131122",
"0.5131122",
"0.5131122",
"0.5131122",
"0.5131122",
"0.5131122",
"0.51241094",
"0.51191163... | 0.7356845 | 0 |
Use the custom group avatar URL if we have one | function _getAvatarFromGroup(group, size) {
if (group.avatarUrl) {
return getGroupAvatarUrlForSize(group, size);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getGroupAvatarUrlForSize(group, size) {\n const avatarUrl = group.avatarUrl;\n\n const parsed = url.parse(avatarUrl, true);\n\n // Tack on a version param otherwise the S3 url is always the same and\n // you always get the cached avatar from nginx's cache.\n parsed.query = parsed.query || {};\n if (... | [
"0.6959928",
"0.6775977",
"0.6768385",
"0.6631696",
"0.65791017",
"0.6502219",
"0.6493715",
"0.6490361",
"0.6450367",
"0.6434274",
"0.6331503",
"0.63183075",
"0.6306597",
"0.6305018",
"0.62483144",
"0.6240524",
"0.6221686",
"0.61915576",
"0.6189803",
"0.61801225",
"0.61769724... | 0.72789663 | 0 |
Initialise the color editor used to change the main color | function initColorEditor() {
const keyword = "coloroverride"
const keyhistory = []
document.addEventListener("keyup", evt => {
keyhistory.push(evt.key.toLowerCase())
// See if the user entered the secret keyword
let valid = true
for(let i = keyword.length; i > 0; i--) {
if(keyhistory[keyhistory.lengt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initialize () {\n // Dynamically set default color value and preview.\n var palette = Array.prototype.slice.apply(document.querySelectorAll('.custom-color'));\n\n palette.forEach(function(customOption) {\n var color = colors[$(customOption).data('target')],\n defaultColor = $(customOp... | [
"0.7226462",
"0.6910648",
"0.6772753",
"0.6743187",
"0.6701363",
"0.66706365",
"0.6508841",
"0.6464322",
"0.6459971",
"0.6444418",
"0.64343137",
"0.63924754",
"0.6390817",
"0.638868",
"0.6370697",
"0.6367619",
"0.6322547",
"0.62874156",
"0.6269315",
"0.6259995",
"0.6228138",
... | 0.7463424 | 0 |
Snap Elements: this._rect, this._nrTxt, this._btns.topright, this._btns.top, this._btns.bottomright, this._btns.bottom Foreign Elements: this._txt, this._check, (only as blocktype.definition: this._name, this._alt ) | draw(editable, group){
this._editable = editable;
this._g = group;
this._height = 0;
let cornerRadius = this._roundedCornerRadius;
// draw rect
this._rect = this._s.rect(
0, 0,
this._width, this._height,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateBlocks() {\n \n //Hide all \"ofBookmark\" blocks first\n let shapesInCanvas = canvas.getObjects();\n for (let i = 0; i < shapesInCanvas.length; i++) {\n if (shapesInCanvas[i].type == \"ofBookmark\") {\n shapesInCanvas[i].visible = false;\n }\n }\n \n //S... | [
"0.5565884",
"0.5502996",
"0.54520917",
"0.53433204",
"0.5341646",
"0.533016",
"0.5264438",
"0.5259604",
"0.52548414",
"0.5243613",
"0.5235779",
"0.52287257",
"0.52131337",
"0.52106184",
"0.5202586",
"0.520198",
"0.51878464",
"0.5176747",
"0.51706",
"0.51617706",
"0.5155396",... | 0.5959678 | 0 |
creates editable text element and adds it in foreign container to SVG | createForeignText(text, editable){
var myforeign = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject')
myforeign.setAttribute("width", "350");
myforeign.classList.add("foreign"); //to make div fit text
var textdiv = document.createElement("div");
textdiv.clas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function text(){\n var att=['x', 'y', 'text'];\n var object = shape('text', att);\n\n // Override the function copy_shape mantaining the most part of\n // his code\n object.parent_copy_shape = object.copy_shape;\n object.copy_shape = function(target){\n this.parent_copy_shape(target);\n ... | [
"0.6952405",
"0.66341835",
"0.66031826",
"0.6577088",
"0.6465521",
"0.64469",
"0.64155585",
"0.6400974",
"0.6380137",
"0.6374758",
"0.63710266",
"0.6344246",
"0.6307608",
"0.6289739",
"0.6289739",
"0.6266213",
"0.62391365",
"0.6223653",
"0.6220332",
"0.61983484",
"0.617812",
... | 0.81736207 | 0 |
Test if a URL is valid | function isValidUrl(url) {
// Try and create a URL object
// If it TypeErrors we know it's invalid
try {
new URL(url);
return true;
} catch (e) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.tes... | [
"0.8212457",
"0.81672513",
"0.81602883",
"0.8061537",
"0.7998464",
"0.79887223",
"0.79749054",
"0.79209757",
"0.78805083",
"0.7863487",
"0.78495777",
"0.7833165",
"0.7812309",
"0.78092265",
"0.779994",
"0.77716887",
"0.77540344",
"0.7736699",
"0.77102196",
"0.7686806",
"0.768... | 0.82583463 | 0 |
helper function to calculate zoom step | getZoomStep(currentZoomLevel) {
if (currentZoomLevel > 3) {
return 1.2;
} else {
return currentZoomLevel / 4;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zoomFactor(){\n\tvar percentOffFloor = (transform.position.y - zoomFloor)/zoomCeiling;\n\treturn percentOffFloor + 1;\n}",
"function zoom(value) {\n return value * zoomLevel;\n}",
"function zoom () {\r\n if (zoomAllowed) {\r\n d3.event.preventDefault()\r\n var dy = +d3.event.wheelDeltaY\... | [
"0.6887877",
"0.6567673",
"0.65666026",
"0.65600044",
"0.63644785",
"0.63644785",
"0.6340326",
"0.62715423",
"0.62563574",
"0.6237917",
"0.6233597",
"0.6233597",
"0.6204101",
"0.6177413",
"0.61689407",
"0.61249894",
"0.61089003",
"0.6100329",
"0.6091082",
"0.6087894",
"0.6074... | 0.73594874 | 0 |
Convert a NodeForge type distingished name object to the DistinigishedName object | static getFromNodeForgeDistingishedName(forgeAttributes) {
var distingishedName = new DistingishedName();
for (var attribute of forgeAttributes) {
if (!('type' in attribute))
throw new Error('node-forge produced an attribute without a valid type for a certificate distingished... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static convertTLSDistingishedName(distingishedName) {\n return {\n 'commonName': distingishedName['CN'],\n 'givenName': distingishedName['GN'],\n 'surname': distingishedName['SN'],\n 'initials': distingishedName['initials'],\n 'localityName': distingish... | [
"0.62638706",
"0.5417477",
"0.50152504",
"0.4912157",
"0.4820243",
"0.48173767",
"0.48173767",
"0.4803079",
"0.47787532",
"0.47638088",
"0.4730757",
"0.46950424",
"0.46944845",
"0.46709007",
"0.46613783",
"0.46613783",
"0.46492112",
"0.4627388",
"0.4623463",
"0.4623463",
"0.4... | 0.687117 | 0 |
Convert the list of attributes to a simple to use lookup string | updateLookupString() {
this.lookupString = this.attributesToString(DistingishedName.lookupAttributeKeys);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"attributesToString(attributeKeys) {\n var result = null;\n for (var attributeKey of attributeKeys) {\n if (!this.attributes.has(attributeKey)) {\n throw new Error(Util.format(\"distinighed name missing attribute '%s'\", attributeKey));\n }\n if (result ... | [
"0.6247813",
"0.6208343",
"0.60990256",
"0.6040961",
"0.5885408",
"0.57853425",
"0.5724533",
"0.56705606",
"0.5641991",
"0.55810255",
"0.55810255",
"0.55810255",
"0.55810255",
"0.55787355",
"0.55787355",
"0.55787355",
"0.5563431",
"0.5554823",
"0.55394626",
"0.55169815",
"0.5... | 0.64476913 | 0 |
Convert the list of attributes to a simple to use identity string | updateIdentityString() {
this.identityString = this.attributesToString(DistingishedName.identityAttributeKeys);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}",
"function _getAsAttributeList(attrs) {\n\t\tvar s = '';\n\t\tfor (var name in attrs) {\n\t\t\ts += ' ' + name + '... | [
"0.6765786",
"0.64373475",
"0.6316487",
"0.6217544",
"0.61595184",
"0.6099874",
"0.60874957",
"0.59805536",
"0.5862916",
"0.586259",
"0.586259",
"0.586259",
"0.586259",
"0.58526134",
"0.5843435",
"0.58401835",
"0.58401835",
"0.58401835",
"0.5839162",
"0.5832626",
"0.5829996",... | 0.64497566 | 1 |
The convert the current attribute map into a string given the attribute keys to use | attributesToString(attributeKeys) {
var result = null;
for (var attributeKey of attributeKeys) {
if (!this.attributes.has(attributeKey)) {
throw new Error(Util.format("distinighed name missing attribute '%s'", attributeKey));
}
if (result == null)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_attributes (attr) {\n\t\tvar attr_str = '';\n\t\tfor (var k in attr) {\n\t\t\tif (k && attr[k] != null) attr_str += ' '+ k +'='+ '\"'+ attr[k] +'\"';\n\t\t}\n\t\treturn attr_str;\n\t}",
"function attrsToStr(attrs){var parts=[];$.each(attrs,function(name,val){if(val!=null){parts.push(name+'=\"'+html... | [
"0.6694932",
"0.64469504",
"0.6341036",
"0.6306847",
"0.63060904",
"0.63060904",
"0.62814486",
"0.62814486",
"0.62814486",
"0.62704647",
"0.62667257",
"0.62106633",
"0.6205157",
"0.6205157",
"0.6205157",
"0.6205157",
"0.61934173",
"0.6192872",
"0.6189862",
"0.617363",
"0.6169... | 0.7032027 | 0 |
Convert the TLS formatted distingished name object to the x509 libaray object | static convertTLSDistingishedName(distingishedName) {
return {
'commonName': distingishedName['CN'],
'givenName': distingishedName['GN'],
'surname': distingishedName['SN'],
'initials': distingishedName['initials'],
'localityName': distingishedName['L']... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSubjectString(cert, whose, extended) {\n if (typeof extended === 'undefined') {\n extended = false;\n }\n var c = Certificate.decode(new Buffer(cert), 'der');\n var fields;\n if (whose === 'issuer') {\n fields = c.tbsCertificate.issuer.value;\n } else if (whose === 'own') {\n fields = c.... | [
"0.5783547",
"0.5614888",
"0.5449339",
"0.5449339",
"0.5410501",
"0.5138633",
"0.5123641",
"0.5098004",
"0.49852043",
"0.4980931",
"0.49252653",
"0.49252653",
"0.49252653",
"0.49252653",
"0.4915836",
"0.49119663",
"0.48569724",
"0.4850773",
"0.4844865",
"0.48207843",
"0.48207... | 0.56652105 | 1 |
Function for outputting array | function arrayOutput(a) {
for (var i=0; i<a.length; i++) {
document.writeln(a[i]+'<br>');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function outputArray(arr){\n for(i=0; i<arr.length; i++)\n console.log(arr[i]);\n}",
"function outputArray( heading, theArray, output )\n{\n output.innerHTML = heading + theArray.join( \" \" ); \n} // end function outputArray",
"function arrayOutput(ar){\n\tvar s = \"\";\n\tar.map((el)=>{\n\t\ts += J... | [
"0.7625371",
"0.7390827",
"0.73558474",
"0.7337655",
"0.72103214",
"0.7100164",
"0.7075473",
"0.68633175",
"0.68230885",
"0.6666615",
"0.66453016",
"0.6614072",
"0.6504439",
"0.6481119",
"0.6422144",
"0.6419136",
"0.6419136",
"0.63970864",
"0.6395362",
"0.63842034",
"0.635013... | 0.75947565 | 1 |
get first block with greater than or equal time to targetDate | async function getLeftmostBlock(left, right, targetDate) {
if (left >= right)
return right;
let m = (left + right) >> 1;
let block = await web3.eth.getBlock(m);
// convert to ms first
let date = new Date(block.timestamp * 1000);
//console.log('LEFT: ', left, ' RIGHT: ', right, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findFirstValidHold (currentAudioTime) {\n\n let listActiveHolds = this.activeHolds.asList() ;\n for ( var i = 0 ; i < listActiveHolds.length ; i++) {\n\n let step = listActiveHolds[i] ;\n\n if ( step !== null && step.beginHoldTimeStamp <= currentAudioTime) {\n r... | [
"0.58645713",
"0.550507",
"0.5480811",
"0.54645824",
"0.5345906",
"0.5241293",
"0.52398133",
"0.5222808",
"0.51976556",
"0.5076727",
"0.5051302",
"0.4966554",
"0.4961413",
"0.49602956",
"0.49491388",
"0.49074468",
"0.48900807",
"0.48770028",
"0.48598707",
"0.4837624",
"0.4836... | 0.6291921 | 0 |
checks if the home is checked | function checkHome(user) {
user.home = !user.home;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pols_is_home(){\r\n\treturn (this.is_home || this.door_uid == 'home_interior' || this.door_uid == 'home_exterior') ? true : false;\r\n}",
"function returnHomeDetection(){\n if (state === 'piano' || state === 'guitar'){\n if(mouseIsPressed){\n if (mouseX > 25 && mouseX < 75 &&\n mouseY > 25 &... | [
"0.7579653",
"0.7010302",
"0.69425005",
"0.6913471",
"0.6874251",
"0.6720546",
"0.6662882",
"0.6454105",
"0.6404019",
"0.63230604",
"0.63128626",
"0.63128626",
"0.63128626",
"0.6297328",
"0.6294323",
"0.62893623",
"0.6123589",
"0.6112723",
"0.6093868",
"0.604046",
"0.600343",... | 0.75523907 | 1 |
Reset elements to their initial state. | reset() {
arrayEach(this.elements, ui => ui.reset());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _reset () {\n _elements = [];\n }",
"reset(){\n this.ended = false;\n this.elements = [];\n }",
"function reset()\n\t\t{\n\t\t\t\n\t\t\tfor(var i=0;i<a;i++)\n\t\t\t{\n\t\t\t\tvar a1=$(element).find(\"#g\"+i).get(0);\n\t\t\t\t\n\t\t\t\tvar a2=$(element).find(\"#s\"+i).g... | [
"0.82190245",
"0.73723614",
"0.73670727",
"0.7325234",
"0.7169908",
"0.71429116",
"0.71264213",
"0.71264213",
"0.71236986",
"0.71177864",
"0.71028036",
"0.71028036",
"0.71028036",
"0.71028036",
"0.71022475",
"0.70965993",
"0.70843774",
"0.70843774",
"0.70525646",
"0.7031606",
... | 0.7656365 | 1 |
returns an array consisting of 'type' and any 'class' properties | function getClassList(type) {
var classList = davinci.ve.metadata.queryDescriptor(type, 'class');
if (classList) {
classList = classList.split(/\s+/);
classList.push(type);
return classList;
}
return [type];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProperties (type) {\n\n}",
"function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes\n .map(function (c) { return c && typeof c === 'object' ? Object.keys(c).map(function (key) { return !!c... | [
"0.64413375",
"0.63544554",
"0.61874616",
"0.6066649",
"0.6019503",
"0.5999366",
"0.5942111",
"0.594038",
"0.5935475",
"0.593419",
"0.59158164",
"0.5765498",
"0.5745204",
"0.5737128",
"0.5726987",
"0.5725635",
"0.57159704",
"0.56694007",
"0.5654689",
"0.5634892",
"0.56270546"... | 0.7040512 | 0 |
returns 'true' if any of the elements in 'classes' are in 'arr' | function containsClass(arr, classes) {
return classes.some(function(elem) {
return arr.indexOf(elem) !== -1;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasClass (cls) {\r\n if (!cls) return false\r\n emptyArray.some.call({ 'a': 'asas' }, function (el) {\r\n console.log(el)\r\n })\r\n }",
"anyHighlighted(arr) {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i])\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function valida... | [
"0.6747393",
"0.648532",
"0.6372377",
"0.6261987",
"0.6231514",
"0.6092992",
"0.6058115",
"0.6042399",
"0.60270303",
"0.6022681",
"0.6020663",
"0.59999645",
"0.59999645",
"0.5996123",
"0.59672314",
"0.5953228",
"0.59128493",
"0.59070724",
"0.59056646",
"0.59056646",
"0.589130... | 0.83967656 | 0 |
Returns 'true' if the dropped widget is allowed as a child of the given parent. | function isAllowed(children, parent) {
var parentType = parent instanceof davinci.ve._Widget ?
parent.type : parent._dvWidget.type;
var parentClassList,
allowedChild = davinci.ve.metadata.getAllowedChild(parentType);
// special case for HTML <body>
if (parentType === "html.body") {
allowedC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canDropOnWidget(element) {\n var targetWidget = viewmodel.getWidgetFromElementId(element.id);\n return draggedWidget && draggedWidget !== targetWidget && targetWidget.canHaveChildren;\n }",
"isElementAllowed(parent, event) {\n if (this._overlayToIgnore?.size > 0) {\n ... | [
"0.712374",
"0.66280293",
"0.64605296",
"0.6460221",
"0.62799704",
"0.62799704",
"0.62799704",
"0.6207811",
"0.62066627",
"0.6175943",
"0.6142097",
"0.61072016",
"0.6022566",
"0.59747666",
"0.5956069",
"0.59204423",
"0.58989155",
"0.58889574",
"0.58308643",
"0.5830085",
"0.58... | 0.67826295 | 1 |
Province validation (can't be empty) | function signupValidateProvince() {
let signupProvValue = signupProv.value;
if (signupProvValue !== "") {
signupProv.className = "browser-default custom-select is-valid";
signupProvValid = true;
//console.log("provok");
} else {
signupProv.className = "browser-default custom-select is-invalid";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateProvince() {\nlet provValue = prov.value;\nif (provValue != \"\") {\n prov.className = \"browser-default custom-select is-valid\";\n isProvValid = true;\n //console.log(\"provok\");\n} else {\n prov.className = \"browser-default custom-select is-invalid\";\n isProvValid = false;\n ... | [
"0.6978302",
"0.6485312",
"0.62608373",
"0.6251504",
"0.62093073",
"0.61184615",
"0.6112493",
"0.6112493",
"0.606515",
"0.5969102",
"0.59423846",
"0.592389",
"0.5922719",
"0.5921367",
"0.5905196",
"0.5889689",
"0.58868885",
"0.5867619",
"0.5853295",
"0.584024",
"0.5809986",
... | 0.67521983 | 1 |
Constructor function creates the object a koopa has two animation sprites, so two images must be refered to in the parameters | constructor(img1, img2, xPos, yPos) {
this.img1 = img1;
this.img2 = img2;
this.xPos = xPos;
this.yPos = yPos;
this.pic = 1;
this.counter = 0;
this.frames = 8;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() { //initializes objects within class\n this.sprite = 'images/'; //targets image folder\n this.x = 2;\n this.y = 5;\n }",
"create() {\n this.hero = this.matter.add.sprite(this.game.config.width / 2, this.game.config.height / 2, 'hero');\n this.hero.depth = 1200;\n\n this.m... | [
"0.7134549",
"0.68747884",
"0.6856599",
"0.6834679",
"0.67721814",
"0.6759674",
"0.6745981",
"0.6735408",
"0.6706429",
"0.67043114",
"0.6691438",
"0.6632302",
"0.66067713",
"0.6601587",
"0.65867394",
"0.65856683",
"0.6576728",
"0.6572616",
"0.65671897",
"0.6563973",
"0.652479... | 0.74034387 | 0 |
Fa apparire il layer corrispondente al servizio selezionato. La mappa attuale e' letta dalla variabile currentMap. Il servizio attivo e' letto dalla variabile activeService. | function refreshServicesLayer() {
if ((!currentMap) || (!activeService)) { // Sanity check
return;
}
var currentMapId = currentMap.id;
// Accendiamo il solo layer giusto.
for (i = 0; i < SERVICES.length; i++) {
var service = SERVICES[i];
var element =
document.getElementById(currentMapId + "-" + service)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function iniciarmapa() {\n\t\n\t\n\t\n vector = new OpenLayers.Layer.Vector(\"Vector Layer\", {});\n tapetes = new OpenLayers.Layer.Vector(\"Tapetes Layer\", {});\n carrera.kmlayer = new OpenLayers.Layer.Vector(\"Layer\", {});\n ruta_layer = new OpenLayers.Layer.Vector(); \n\n\t//carrera.geosalida = ne... | [
"0.6041067",
"0.58429295",
"0.58237344",
"0.5769705",
"0.57498026",
"0.557698",
"0.5548231",
"0.55145276",
"0.5510567",
"0.54791963",
"0.5475966",
"0.54692197",
"0.54571754",
"0.5453897",
"0.540028",
"0.53521776",
"0.53401756",
"0.531895",
"0.531619",
"0.53136617",
"0.5307683... | 0.613104 | 0 |
Expand the node (with the given child rule) Make children if the node has any | expandChildren(childRule, preventRecursion) {
this.children = []
this.finishedText = ''
// Set the rule for making children,
// and expand it into section
this.childRule = childRule
if (this.childRule === undefined) {
// In normal operation, this shouldn't ever happen
this.errors.pu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"decorateChildren() {\n this.forEachChild(aChild => {\n var element = this.getDomHelper().getElement(aChild.getId());\n if (element) {\n aChild.decorate(element);\n }\n });\n }",
"add_child(node) {\n this.add_child_no_propagation(node);\n this.propagate_children_count(node.get_t... | [
"0.58339405",
"0.57834166",
"0.5781947",
"0.5772468",
"0.57266563",
"0.56836873",
"0.5679065",
"0.56179726",
"0.56079644",
"0.55745816",
"0.55084455",
"0.5478811",
"0.5471258",
"0.5459611",
"0.5459611",
"0.5453229",
"0.54441553",
"0.5442059",
"0.5433409",
"0.54229283",
"0.539... | 0.71496874 | 0 |
Expand this rule (possibly creating children) | expand(preventRecursion) {
if (!this.isExpanded) {
this.isExpanded = true
this.expansionErrors = []
// Types of nodes
// -1: raw, needs parsing
// 0: Plaintext
// 1: Tag ("#symbol.mod.mod2.mod3#" or "#[pushTarget:pushRule]symbol.mod")
// 2: Action ("[pushTarget:pushRul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"expandChildren(childRule, preventRecursion) {\n this.children = []\n this.finishedText = ''\n\n // Set the rule for making children,\n // and expand it into section\n this.childRule = childRule\n if (this.childRule === undefined) {\n // In normal operation, this shouldn't ever happen\n ... | [
"0.6554786",
"0.5971226",
"0.5688395",
"0.5547575",
"0.5547575",
"0.5512633",
"0.5477365",
"0.547535",
"0.54587495",
"0.5410104",
"0.5406938",
"0.5370141",
"0.53616136",
"0.53261757",
"0.52407646",
"0.51841414",
"0.5175142",
"0.5163919",
"0.516161",
"0.51360625",
"0.5128049",... | 0.60383654 | 1 |
Load Game and append to req | function load(req, res, next, id) {
Game.get(id).then((game) => {
req.game = game; // eslint-disable-line no-param-reassign
next();
}).error((e) => next(e));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getGame() {\n return this.__request(`${this.api_url}/game/start`, \"POST\");\n }",
"function startGameRequest() {\n\n var create_game_callback = function(json) {\n window.gameID = parseInt(json);\n console.log(\"created new game with gameID: \" + gameID);\n sendToTicker(\"... | [
"0.6211857",
"0.6126062",
"0.5934646",
"0.5840731",
"0.5799337",
"0.5746652",
"0.5663466",
"0.56548005",
"0.5628111",
"0.55975467",
"0.55939734",
"0.5577671",
"0.5568673",
"0.55614096",
"0.5516825",
"0.5513034",
"0.54994535",
"0.5479766",
"0.5471277",
"0.5460641",
"0.54582477... | 0.6873634 | 0 |
cache parsed config object | function config () {
if (cache) {
return cache;
}
var path = process.cwd() + '/config.json'
, content;
//load and merge object
content = fs.readFileSync(path, 'utf-8');
try {
cache = JSON.parse(content);
log.info('config file ' + path + ' loaded.');
} catch(e) {
log.error('could no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseConfig (json, cacheKey) {\n var configMap = json.data.configMap;\n var processed = preProcessJson(configMap);\n cache[cacheKey] = processed;\n return processed;\n }",
"function getConfig() {\n if (Date.now() - lastCache > 10000) {\n cach... | [
"0.701395",
"0.6928701",
"0.67437273",
"0.6413513",
"0.63028",
"0.61956316",
"0.61699945",
"0.608119",
"0.599038",
"0.59258044",
"0.59253776",
"0.5915819",
"0.59088254",
"0.5902001",
"0.589082",
"0.58899724",
"0.587048",
"0.5823641",
"0.5818629",
"0.5812218",
"0.5798256",
"... | 0.7593662 | 0 |
Process this token with a regex and return true if it matched. If possible, extract a uid for this token from the path. | match(id, regex) {
var match = false;
var matches = this.path.match(regex);
if (matches) {
this.id = id;
if (matches.length > 1) {
this.uid = matches[1];
}
match = true;
}
return match;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookup( path ) {\n\t\t\tvar i, re,\n\t\t\t\tdata = properties[ path.join( \"/\" ) ];\n\n\t\t\tfor ( i in data ) {\n\t\t\t\tre = new RegExp( \"^\" + data[ i ] );\n\t\t\t\tif ( re.test( value ) ) {\n\t\t\t\t\ttoken.value = i;\n\t\t\t\t\treturn tokenRe = new RegExp( data[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tre... | [
"0.5434234",
"0.5110512",
"0.49547535",
"0.48878807",
"0.48615125",
"0.4848644",
"0.48464763",
"0.48126134",
"0.47948828",
"0.47948828",
"0.47633854",
"0.47633854",
"0.47633854",
"0.47633854",
"0.4755162",
"0.4755162",
"0.4755162",
"0.4755162",
"0.4755162",
"0.47479805",
"0.4... | 0.6581221 | 0 |
Create a clone of this token to own | clone() {
return new Token(this.path, this.value, this.uid, this.id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clone() {\n\t\tlet data = JSON.parse(JSON.stringify(this.Serialize()));\n\t\treturn new this.constructor(data);\n\t}",
"clone() {\n return new this.constructor(this);\n }",
"static clone(scope) {\n const newScope = new Scope();\n if (scope) {\n newScope._breadcrumbs = [...scope._breadcrumbs];\n ... | [
"0.6218622",
"0.6186806",
"0.604567",
"0.6034622",
"0.60241276",
"0.60078615",
"0.6001775",
"0.6001775",
"0.5984051",
"0.595189",
"0.5838016",
"0.58067316",
"0.58067316",
"0.58067316",
"0.58067316",
"0.5763902",
"0.5749831",
"0.5737132",
"0.57201767",
"0.5717641",
"0.5717641"... | 0.83719844 | 0 |
phone book trie class contacts : is an array of contacts in the other they are in trie : is the trie structure with keys as followed | function PhoneBookTrie(){
var t = this;
var uuid = 1;
t.contacts = [];
t.trie = new TrieNode();//prefix $ for address, # for number, @ for name
var insertTrieNode = function (key, val){
var cur = t.trie;
for (var i = 0; i < key.length; i++){
//already there, then traverse down
if (typeof cur.looku... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Trie(){\n\tthis.word = null;\n\tthis.children = {};\n}",
"function Trie() {\n\t}",
"function trie (arr, itemToTokens) {\n const map = new Map();\n for (const item of arr) {\n const tokens = itemToTokens(item);\n for (const token of tokens) {\n let currentMap = map;\n for (let i = 0; ... | [
"0.58253497",
"0.58040035",
"0.5803537",
"0.56999886",
"0.5697964",
"0.56910306",
"0.5688914",
"0.56153136",
"0.5470733",
"0.54263145",
"0.5307313",
"0.52863944",
"0.5252589",
"0.5246136",
"0.5243802",
"0.522956",
"0.51908535",
"0.5180295",
"0.5177391",
"0.5158725",
"0.514469... | 0.8099619 | 1 |
phone book trie class contacts : is an array of contacts in the other they are in trie : is the trie structure with keys as followed | function PhoneBookTrie(){
var t = this;
var uuid = 1;
t.contacts = [];
t.trie = new TrieNode();//prefix $ for address, # for number, @ for name
var insertTrieNode = function (key, val){
var cur = t.trie;
for (var i = 0; i < key.length; i++){
//already there, then traverse down
if (typeof cur.looku... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Trie(){\n\tthis.word = null;\n\tthis.children = {};\n}",
"function trie (arr, itemToTokens) {\n const map = new Map();\n for (const item of arr) {\n const tokens = itemToTokens(item);\n for (const token of tokens) {\n let currentMap = map;\n for (let i = 0; i < token.length; i++) {\n ... | [
"0.5824923",
"0.58051974",
"0.5803916",
"0.5700077",
"0.5698136",
"0.56904846",
"0.5688616",
"0.5616329",
"0.5470682",
"0.5427127",
"0.5307126",
"0.52866936",
"0.5253028",
"0.5246945",
"0.52440655",
"0.5229373",
"0.5190896",
"0.5180394",
"0.5176953",
"0.5157817",
"0.5144703",... | 0.8099989 | 0 |
If import is successful, trigger "completed" and reload the page after 800ms. | onSuccess() {
Radio.trigger('components/importExport', 'completed');
window.setTimeout(() => document.location.reload(), 800);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadDone() {\n return true;\n }",
"function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}",
"function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}",
"function loadComplete() {\n if (++docsLoad... | [
"0.6418801",
"0.63642937",
"0.63642937",
"0.63642937",
"0.63642937",
"0.62059766",
"0.61288226",
"0.6116786",
"0.58759737",
"0.5859792",
"0.58537364",
"0.5794822",
"0.57850343",
"0.57789326",
"0.5776228",
"0.57382846",
"0.57163465",
"0.5715653",
"0.5713039",
"0.5707896",
"0.5... | 0.7271098 | 0 |
:: first: string; last: string; | constructor(first /*: string */, last /*: string */) {
this.first = first;
this.last = last;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(first, last) {\n this.first = first;\n this.last = last;\n }",
"function fullName2(first, last) {\n return first + \" \" + last;\n}",
"function printName2(first, last) {\n console.log(first + \" \" + last)\n}",
"function combineNames(first,last) {\n return `${first} ${last... | [
"0.6915124",
"0.67556626",
"0.6513084",
"0.63991654",
"0.6238873",
"0.62131447",
"0.6168731",
"0.6078372",
"0.60631084",
"0.60281205",
"0.60135126",
"0.6004888",
"0.58821124",
"0.58812714",
"0.5870726",
"0.58311486",
"0.5805098",
"0.57619363",
"0.57511514",
"0.5688302",
"0.56... | 0.8130865 | 0 |
Set the publicity of a journal entry | setPublicity(id, publicity) {
const data = {
id: id,
public: publicity
};
submitDataAsync(data, "journal/publicity", false, (responseData) => {
console.log(responseData);
if (responseData.success === true) {
this.setState(prevSt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function publish(book){\n// return book.set(\"isPublished\",true);\nreturn produce(book,draftBook=>{ // immer library\n draftBook.isPublished=true;\n})\n}",
"_updatePublisher(uPCs) {\t\t\n\t\tvar key = this._loaderAndLoads(uPCs);\t\t\t \n\t\tif(key !== null && uPCs[key].situation === \"CONTRIBUTING\"){\n\... | [
"0.53639084",
"0.52458656",
"0.51209664",
"0.5063708",
"0.50479555",
"0.50266033",
"0.5014022",
"0.4914085",
"0.4895055",
"0.4881235",
"0.48652253",
"0.48590454",
"0.48167673",
"0.4793418",
"0.47915107",
"0.4745217",
"0.4693576",
"0.46904704",
"0.46869975",
"0.46375576",
"0.4... | 0.58801407 | 0 |
create moons and rocks | function createMoons() {
let bright = new THREE.MeshBasicMaterial({
color: accentColor
});
let dark = new THREE.MeshBasicMaterial({
color: mainColor
});
let rockGeometry = new THREE.SphereGeometry(0.05, 20, 20);
let moonGeometry = new THREE.SphereGeometry(0.08, 25, 25);
let moon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"makeMoons(lib) {\n for (var i=0;i<7;i++) {\n let newMoon = {\n s: Math.random()*12,\n x: Math.random()*(lib.width),\n y: lib.randomNumber(50, lib.height - 50),\n r: 62+lib.randomNumber(0,50),\n g: 39+lib.randomNumber(0,30)... | [
"0.6811464",
"0.63147223",
"0.627289",
"0.6015108",
"0.5972452",
"0.5929267",
"0.58844453",
"0.5877934",
"0.5832125",
"0.578988",
"0.5777931",
"0.57223433",
"0.57140654",
"0.5670986",
"0.5625472",
"0.5624902",
"0.56245315",
"0.5621228",
"0.55639887",
"0.5531652",
"0.5520419",... | 0.678634 | 1 |
Adds all help listeners for plugins | function addHelpListeners (controller, plugins) {
_.forEach(plugins, function (plugin) {
if (_.get(plugin, 'help.text') && _.get(plugin, 'help.command')) {
registerHelpListener(controller, plugin.help)
}
})
controller.hears('^help$', 'direct_mention,direct_message', function (bot, message) {
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function registerHelpListener (controller, helpInfo) {\n controller.hears('^help ' + helpInfo.command + '$', 'direct_mention,direct_message', function (bot, message) {\n let replyText = helpInfo.text\n\n if (typeof helpInfo.text === 'function') {\n let helpOpts = _.merge({botName: bot.identity.name}, _... | [
"0.6600582",
"0.61788136",
"0.61536866",
"0.61536866",
"0.61066115",
"0.59435326",
"0.5918944",
"0.58046377",
"0.57392347",
"0.57364315",
"0.5709877",
"0.5705624",
"0.5668277",
"0.5662392",
"0.5646811",
"0.56132394",
"0.5595348",
"0.5594614",
"0.5583859",
"0.55775535",
"0.557... | 0.75997305 | 0 |
Adds a single help listener for a plugin | function registerHelpListener (controller, helpInfo) {
controller.hears('^help ' + helpInfo.command + '$', 'direct_mention,direct_message', function (bot, message) {
let replyText = helpInfo.text
if (typeof helpInfo.text === 'function') {
let helpOpts = _.merge({botName: bot.identity.name}, _.pick(mess... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addHelpListeners (controller, plugins) {\n _.forEach(plugins, function (plugin) {\n if (_.get(plugin, 'help.text') && _.get(plugin, 'help.command')) {\n registerHelpListener(controller, plugin.help)\n }\n })\n\n controller.hears('^help$', 'direct_mention,direct_message', function (bot, messa... | [
"0.676042",
"0.5684966",
"0.566419",
"0.5652563",
"0.56465024",
"0.5621818",
"0.55474514",
"0.5544842",
"0.55405694",
"0.5535002",
"0.5513129",
"0.551219",
"0.5512027",
"0.55072033",
"0.5464571",
"0.54353446",
"0.5431577",
"0.5414223",
"0.53818804",
"0.5356573",
"0.5350121",
... | 0.72513807 | 0 |
Attempts to locate an alignment pattern in a limited region of the image, which is guessed to contain it. overallEstModuleSize estimated module size so far estAlignmentX coordinate of center of area probably containing alignment pattern estAlignmentY y coordinate of above allowanceFactor number of pixels in all directi... | function findAlignmentInRegion(overallEstModuleSize, estAlignmentX, estAlignmentY, allowanceFactor, image) {
estAlignmentX = Math.floor(estAlignmentX);
estAlignmentY = Math.floor(estAlignmentY);
// Look for an alignment pattern (3 modules in size) around where it should be
var allowance = Ma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AlignmentPattern(posX, posY, estimatedModuleSize)\r\n{\r\n\tthis.x=posX;\r\n\tthis.y=posY;\r\n\tthis.count = 1;\r\n\tthis.estimatedModuleSize = estimatedModuleSize;\r\n\t\r\n\tthis.__defineGetter__(\"EstimatedModuleSize\", function()\r\n\t{\r\n\t\treturn this.estimatedModuleSize;\r\n\t}); \r\n\tthis.__de... | [
"0.6874053",
"0.66919404",
"0.66338426",
"0.6466172",
"0.57354194",
"0.5114524",
"0.5044666",
"0.48943785",
"0.48560306",
"0.47541577",
"0.46912557",
"0.46429765",
"0.46381676",
"0.46337447",
"0.46068656",
"0.45935106",
"0.45466596",
"0.45453006",
"0.45367014",
"0.44856912",
... | 0.818658 | 0 |
Computes the dimension (number of modules on a size) of the QR Code based on the position of the finder patterns and estimated module size. | function computeDimension(topLeft, topRight, bottomLeft, moduleSize) {
var tltrCentersDimension = Math.round(distance(topLeft.x, topLeft.y, topRight.x, topRight.y) / moduleSize);
var tlblCentersDimension = Math.round(distance(topLeft.x, topLeft.y, bottomLeft.x, bottomLeft.y) / moduleSize);
var dime... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function computeDimension(topLeft, topRight, bottomLeft, matrix) {\n var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLef... | [
"0.65384746",
"0.60086787",
"0.5908827",
"0.5684075",
"0.5587406",
"0.54986596",
"0.54790145",
"0.5448537",
"0.53718317",
"0.53554606",
"0.53298867",
"0.5306322",
"0.5273099",
"0.526163",
"0.5245542",
"0.5222601",
"0.517767",
"0.51723564",
"0.51645786",
"0.5144787",
"0.513965... | 0.62702376 | 1 |
Computes the total width of a finder pattern by looking for a blackwhiteblack run from the center in the direction of another point (another finder pattern center), and in the opposite direction too. | function sizeOfBlackWhiteBlackRunBothWays(fromX, fromY, toX, toY, image) {
var result = sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY, image);
// Now count other way -- don't run off image though of course
var scale = 1;
var otherToX = fromX - (toX - fromX);
if (otherToX < 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countBlackWhiteRun(origin, end, matrix, length) {\n var rise = end.y - origin.y;\n var run = end.x - origin.x;\n var towardsEnd = countBlackWhiteRunTowardsPoint(origin, end, matrix, Math.ceil(length / 2));\n var awayFromEnd = countBlackWhiteRunTowardsPoint(origin, { x: origin.x - run, y: origi... | [
"0.649426",
"0.62279093",
"0.5698632",
"0.5365985",
"0.527906",
"0.527906",
"0.52629113",
"0.5153313",
"0.5132754",
"0.51157504",
"0.50945956",
"0.50812924",
"0.5035681",
"0.5011034",
"0.50109863",
"0.49814257",
"0.49036807",
"0.48977312",
"0.48894203",
"0.4883083",
"0.487474... | 0.6303991 | 1 |
Computes an average estimated module size based on estimated derived from the positions of the three finder patterns. | function calculateModuleSize(topLeft, topRight, bottomLeft, image) {
return (calculateModuleSizeOneWay(topLeft, topRight, image) + calculateModuleSizeOneWay(topLeft, bottomLeft, image)) / 2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function computeDimension(topLeft, topRight, bottomLeft, moduleSize) {\r\n\t\t var tltrCentersDimension = Math.round(distance(topLeft.x, topLeft.y, topRight.x, topRight.y) / moduleSize);\r\n\t\t var tlblCentersDimension = Math.round(distance(topLeft.x, topLeft.y, bottomLeft.x, bottomLeft.y) / moduleSize);\r\... | [
"0.57280034",
"0.5540435",
"0.53792703",
"0.52424026",
"0.5117586",
"0.5117586",
"0.5070961",
"0.5068654",
"0.50404084",
"0.49998394",
"0.49994612",
"0.49917972",
"0.4977473",
"0.49752748",
"0.49266025",
"0.4909818",
"0.4899954",
"0.48816302",
"0.48655826",
"0.48574534",
"0.4... | 0.5978173 | 0 |
Given a count of black/white/black pixels just seen and an end position, figures the location of the center of this black/white/black run. | function centerFromEnd(stateCount, end) {
var result = (end - stateCount[2]) - stateCount[1] / 2;
if (helpers_1.isNaN(result)) {
return null;
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countBlackWhiteRun(origin, end, matrix, length) {\n var rise = end.y - origin.y;\n var run = end.x - origin.x;\n var towardsEnd = countBlackWhiteRunTowardsPoint(origin, end, matrix, Math.ceil(length / 2));\n var awayFromEnd = countBlackWhiteRunTowardsPoint(origin, { x: origin.x - run, y: origi... | [
"0.6693089",
"0.626105",
"0.60249573",
"0.5923096",
"0.57945",
"0.5737114",
"0.5688535",
"0.5610086",
"0.5545497",
"0.5544482",
"0.53885883",
"0.53602487",
"0.5351306",
"0.5348422",
"0.5330814",
"0.53264034",
"0.52810115",
"0.5271384",
"0.525986",
"0.52412474",
"0.52239156",
... | 0.6282014 | 1 |
After a horizontal scan finds a potential alignment pattern, this method "crosschecks" by scanning down vertically through the center of the possible alignment pattern to see if the same proportion is detected. startI row where an alignment pattern was detected centerJ center of the section that appears to cross an ali... | function crossCheckVertical(startI, centerJ, maxCount, originalStateCountTotal, moduleSize, image) {
var maxI = image.height;
var stateCount = [0, 0, 0];
// Start counting up from center
var i = startI;
while (i >= 0 && image.get(centerJ, i) && stateCount[1] <= maxCount) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handlePossibleCenter(stateCount, i, j, moduleSize) {\r\n\t\t var stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];\r\n\t\t var centerJ = centerFromEnd(stateCount, j);\r\n\t\t if (centerJ == null) {\r\n\t\t return null;\r\n\t\t }\r\n\t\t var cent... | [
"0.556877",
"0.55510575",
"0.550457",
"0.54952186",
"0.5485731",
"0.54697144",
"0.5401432",
"0.53315246",
"0.5296665",
"0.52186847",
"0.519853",
"0.5159309",
"0.51492774",
"0.51125616",
"0.5105361",
"0.5051013",
"0.5049619",
"0.50307536",
"0.4978565",
"0.49664906",
"0.4953451... | 0.7157436 | 0 |
Takes in a byte array, a qr version number and an error correction level. Returns decoded data. | function decodeQRdata(data, version, ecl) {
var symbolSequence = -1;
var parityData = -1;
var bits = new bitstream_1.BitStream(data);
var result = { val: [] }; // Have to pass this around so functions can share a reference to a number[]
var fc1InEffect = false;
var mode;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function QR8bitByte(data) {\n this.mode = QRMode.MODE_8BIT_BYTE;\n this.data = data;\n this.parsedData = [];\n\n // Added to support UTF-8 Characters\n for (var i = 0, l = this.data.length; i < l; i++) {\n var byteArray = [];\n var code = this.data.charCodeA... | [
"0.60470945",
"0.6000193",
"0.6000193",
"0.6000193",
"0.59892744",
"0.5986568",
"0.59758204",
"0.5876389",
"0.5847092",
"0.58175814",
"0.5387994",
"0.5387994",
"0.5336766",
"0.5256566",
"0.52518564",
"0.52518564",
"0.52463794",
"0.52461064",
"0.5236617",
"0.5228752",
"0.52287... | 0.65863824 | 0 |
Output the file creation details to the specified file | function outputFileCreationInfo(file)
{
// Add the build information and header to the output file
ccdd.writeToFileLn(file, "# Created : " + ccdd.getDateAndTime() + "\n# User : " + ccdd.getUser() + "\n# Project : " + ccdd.getProject() + "\n# Script : " + ccdd.getScriptName());
// Check if any table is ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function outputFileCreationInfo(file)\n{\n // Add the build information and header to the output file\n ccdd.writeToFileLn(file, \"/* Created : \" + ccdd.getDateAndTime() + \"\\n User : \" + ccdd.getUser() + \"\\n Project : \" + ccdd.getProject() + \"\\n Script : \" + ccdd.getScriptName());\n\n ... | [
"0.7589007",
"0.6463051",
"0.6254441",
"0.6184719",
"0.6148196",
"0.6126077",
"0.611571",
"0.6045737",
"0.5959177",
"0.594336",
"0.5943259",
"0.58981055",
"0.5860408",
"0.5773959",
"0.5757392",
"0.57503754",
"0.5746891",
"0.5734899",
"0.573418",
"0.57076967",
"0.56968117",
... | 0.76575094 | 0 |
Determine if the row containing the specified variable is not an array definition. A row in a table is an array definition if a value is present in the Array Size column but the variable name does not end with a ']' | function isVariable(variableName, arraySize)
{
// Only output non-array variables or array members (i.e., skip array
// definitions)
return variableName != null && arraySize != null && (arraySize.isEmpty() || variableName.endsWith("]"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arrayLike (data) {\n return assigned(data) && greaterOrEqual(data.length, 0);\n }",
"function typeIsArray(instance_var) {\n return getType(instance_var).includes(\"[]\") || getName(instance_var).includes(\"[]\");\n}",
"function isDataArray(x) {\n return Array.isArray(x);\n}",
"function isD... | [
"0.62658256",
"0.6088386",
"0.6051291",
"0.6051291",
"0.6051291",
"0.60416573",
"0.6009855",
"0.59947145",
"0.59820694",
"0.59604335",
"0.59486055",
"0.5947597",
"0.5918841",
"0.59055036",
"0.588324",
"0.588324",
"0.588324",
"0.58347255",
"0.58346623",
"0.579784",
"0.577385",... | 0.6629437 | 0 |
Convert an array member variable name by replacing left square brackets with underscores and removing right square brackets (example: a[2] becomes a_2) | function convertArrayMember(variableName)
{
return variableName.replaceAll("[\\[]", "_").replaceAll("[\\]]", "");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function underscore (name) {\n return varname.split(name).join('_');\n}",
"function underscore (name) {\n return varname.split(name).join('_');\n}",
"function normalize_dataset_name(name) { // 214\n\treturn name.replace(/[\\]\\[\... | [
"0.6083765",
"0.6083765",
"0.6016209",
"0.59452313",
"0.5863515",
"0.56995344",
"0.5670354",
"0.55625224",
"0.5526872",
"0.54653025",
"0.5438944",
"0.53927195",
"0.53881425",
"0.5387266",
"0.53272283",
"0.5309225",
"0.5305594",
"0.52917945",
"0.5289355",
"0.5289287",
"0.52698... | 0.8395666 | 0 |
Check if the supplied array size contains a value | function isArrayElement(arraySize)
{
return arraySize != null && !arraySize.isEmpty();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get hasValues() {\n return this.arrayWidth > 0 && this.arrayHeight > 0;\n }",
"validateArraySize (req, array) {\n const FREEMIUM_INPUT_SIZE = 20\n const PRO_INPUT_SIZE = 20\n\n if (req.locals && req.locals.proLimit) {\n if (array.length <= PRO_INPUT_SIZE) return true\n } else if (array... | [
"0.67656267",
"0.6722253",
"0.6622202",
"0.6506073",
"0.64943284",
"0.64565045",
"0.64473206",
"0.63594013",
"0.63058066",
"0.6303271",
"0.6277014",
"0.62455976",
"0.62435305",
"0.6223165",
"0.6206438",
"0.6189157",
"0.6183994",
"0.61791366",
"0.61791366",
"0.6156779",
"0.614... | 0.7749507 | 0 |
Get the array index value from the variable name | function getIndex(name)
{
// Split the variable name on the underscores and use the last part as the
// array index
var parts = name.split("_");
return parts[parts.length - 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"variableAt(index) {\n\t\treturn this._vars[index];\n\t}",
"function nthArray(arrayName, number) {\n\n return arrayName[number];\n}",
"function index(arr, name) {\n return _.findIndex(arr, matchName(name));\n}",
"function getVarValue(index){\n return varList[index].value;\n}",
"function getIndexByNam... | [
"0.66877156",
"0.6651087",
"0.640118",
"0.6385651",
"0.63771635",
"0.63339627",
"0.619989",
"0.6096024",
"0.6087681",
"0.6075198",
"0.6040069",
"0.59576315",
"0.5896634",
"0.5833155",
"0.5832128",
"0.58292294",
"0.57799965",
"0.5752793",
"0.57407445",
"0.57022464",
"0.5697944... | 0.8149556 | 0 |
Turn on audio for marker in close proximity | TurnOnMarkerAudio(filename){
const {FadeInVolume, FadeOutVolume} = this;
const url = serverURL[0].url;
//if there is media file attached to marker
if(filename!=='none'){
FadeOutVolume(()=>{
this.audio.pause() // pause background audio
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateAudioForLocation(lat, lng) {}",
"function playSound(marker)\n{ console.log(marker.data);\n if(marker.id!==isThis)\n {\n let notiOS=true;\n if (device==='iPad'||device==='iPhone'||device==='iPod'===true)\n {\n notiOS=false;\n }\n if(sound!==undefined){soun... | [
"0.7011543",
"0.6692145",
"0.61068994",
"0.6084379",
"0.6030354",
"0.6030354",
"0.5947804",
"0.5937005",
"0.5917849",
"0.5901378",
"0.5892711",
"0.5856441",
"0.5830479",
"0.58228517",
"0.58228004",
"0.58221316",
"0.5796113",
"0.5795161",
"0.5789441",
"0.57812077",
"0.57784516... | 0.6923207 | 1 |
call draw method on all flowers | function drawFlowers() {
for (let i = 0; i < flowers.length; i++) {
flowers[i].draw();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}",
"draw() {\n\n for (let i = 0; i < this.belt.length; i++) {\n this.belt[i].draw();\n }\n }",
"draw() {\n this.loop(DrawableArray.dr... | [
"0.7339453",
"0.7263549",
"0.7232819",
"0.7232819",
"0.7232819",
"0.7089712",
"0.7030468",
"0.6987068",
"0.69428116",
"0.6938341",
"0.6901095",
"0.6898949",
"0.6890323",
"0.68310916",
"0.682752",
"0.67846096",
"0.6748135",
"0.6743789",
"0.6735853",
"0.6720965",
"0.6703261",
... | 0.8836986 | 0 |
call draw method on all moveables | function drawMoveables() {
for (let i = 0; i < moveables.length; i++) {
moveables[i].draw();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n clickablesManager.draw();\n\n for( let i = 0; i < clickables.length; i++ ) {\n clickables[i].visible = false;\n }\n\n if( gDebugMode == true ) {\n drawDebugInfo();\n }\n}",
"draw() {\n... | [
"0.74547124",
"0.737334",
"0.73551196",
"0.72698575",
"0.7235449",
"0.7233821",
"0.71460575",
"0.7132533",
"0.70798904",
"0.70558506",
"0.7053185",
"0.7053185",
"0.7053185",
"0.69858325",
"0.69764304",
"0.6968767",
"0.69512206",
"0.6936371",
"0.69245255",
"0.692414",
"0.69082... | 0.8923036 | 0 |
refresh page (called by click on refresh button) | function refresh() {
window.location.reload();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshPage()\n\t\t\t{\n\t\t\t\twindow.location.reload(true);\n\t\t\t}",
"function pageRefresh() {\n\tlocation.reload();\n}",
"function refresh () {\r\n window.location.reload(true);\r\n}",
"function refreshPage() {\n setTimeout(\"location.reload(true);\",0);\n }",
"fu... | [
"0.8514916",
"0.84528846",
"0.8304804",
"0.8283872",
"0.8282947",
"0.8273043",
"0.8260663",
"0.82455134",
"0.82455134",
"0.82455134",
"0.823502",
"0.8229787",
"0.8216325",
"0.81969965",
"0.81398815",
"0.81083155",
"0.80973935",
"0.8089189",
"0.807985",
"0.8032232",
"0.8013077... | 0.8535902 | 0 |
draw sun in random location in the sky | function drawSun() {
L10_Super.crc2.beginPath();
L10_Super.crc2.arc(Math.random() * width + 100, height / 4, 100, 0, 2 * Math.PI);
L10_Super.crc2.fillStyle = "#FFFF66";
L10_Super.crc2.fill();
L10_Super.crc2.closePath();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sun (yPos) {\n fill(\"#f7cb39\"); // Yellow color\n circle(250, yPos, 50);\n}",
"function sky(x, y, r, g, b, a) { //input 6 random values for every unique ellipse\n ellipseMode(CENTER);\n noStroke();\n fill(r, g, b, a);\n var diam = random(30);\n ellipse(x, y, diam, diam);\n}",
"function up... | [
"0.76427907",
"0.73669904",
"0.72002107",
"0.68546826",
"0.67772126",
"0.6686576",
"0.66750973",
"0.64924186",
"0.64907587",
"0.64816463",
"0.64057523",
"0.63944376",
"0.6379517",
"0.6342701",
"0.631193",
"0.6224635",
"0.6220528",
"0.6158347",
"0.6134893",
"0.61311525",
"0.61... | 0.817499 | 0 |
Inject stylesheet for SVG coloring | function insertStylesheet(css) {
const svgStyle = document.createElement("style");
svgStyle.setAttribute("id", "svgStyle");
svgStyle.innerHTML = css;
document.head.appendChild(svgStyle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applyStyleToSVG() {\n page.evaluate(function (css) {\n //We need to apply the style to the SVG\n var defs = document.createElement(\"defs\"),\n style = document.createElement(\"style\");\n style.innerHTML = css;\n\n defs.appendChild(style);\n document.querySelector(\"svg... | [
"0.7557541",
"0.62982994",
"0.62784463",
"0.625939",
"0.61719155",
"0.6044573",
"0.599222",
"0.599222",
"0.599222",
"0.599222",
"0.59726524",
"0.594328",
"0.5938573",
"0.5887238",
"0.58497477",
"0.5797033",
"0.57859725",
"0.57859725",
"0.57743204",
"0.576513",
"0.5759397",
... | 0.7069628 | 1 |
GnuBook() ______________________________________________________________________________ After you instantiate this object, you must supply the following bookspecific functions, before calling init(): getPageWidth() getPageHeight() getPageURI() You must also add a numLeafs property before calling init(). | function GnuBook() {
this.reduce = 4;
this.padding = 10;
this.mode = 1; //1 or 2
this.displayedLeafs = [];
//this.leafsToDisplay = [];
this.imgs = {};
this.prefetchedImgs = {}; //an object with numeric keys cooresponding to leafNum
this.timer = null;
this.animating... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Book(title, author, genre, numPages) {\n this.title = title\n this.author = author\n this.genre = genre\n this.numPages = numPages\n}",
"function addBook(x, y, size, book) {\n\tvar bk = new MultiWidgets.BookWidget();\n\n\tif (bk.load(\"./Research\")) {\n\t\tbk.addOperator(new MultiWidgets.St... | [
"0.61242014",
"0.58713675",
"0.5843355",
"0.58092076",
"0.57605493",
"0.57401794",
"0.5651841",
"0.56432414",
"0.56054217",
"0.5600922",
"0.55815536",
"0.55815536",
"0.55815536",
"0.55815536",
"0.55815536",
"0.5576414",
"0.5575361",
"0.5561301",
"0.54979515",
"0.54977494",
"0... | 0.79524344 | 0 |
accept a jQuery object and chart title. Display "data unavailable message" within that jQuery object | function dataUnavailable(chartFrame, chartTitle){
chartTitle = typeof chartTitle !== 'undefined' ? chartTitle : '';
chartFrame.html('<div class="data-unavailable-header" style="color:#ccc;">'
+chartTitle
+'</div>'
+'<div class="error-msg">'
+'<div>Data is currently unavailable at this time.</div>'
+'<di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display_no_data() {\n $(\"#error-message\").show()\n $(\"#error-message\").html(\"There is no data to display in the selected dates.\");\n\n}",
"function plotChart(row, col, val, pclass, title) {\r\n //return;\r\n var $obj = $newsChart.find('tbody > tr:nth-child(' + row + ') > td.nval' + col... | [
"0.59305507",
"0.5876474",
"0.5761086",
"0.5742612",
"0.57100195",
"0.5625927",
"0.562035",
"0.562035",
"0.56080574",
"0.5588725",
"0.5522136",
"0.5522136",
"0.5487216",
"0.5470456",
"0.5422378",
"0.5390072",
"0.53599054",
"0.5353561",
"0.5342917",
"0.53107345",
"0.53068966",... | 0.72367615 | 0 |
Write the font list to console | function listFonts () {
asciify.getFonts(function (err, fonts) {
if (err) { return console.error(err); }
var padSize = ('' + fonts.length).length;
fonts.forEach(function (font, index) {
console.log(pad(padSize, index+1, '0') + ': ' + font);
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listFonts()\n{\n\tvar all_items = dom.library.items;\n\t\n\t\n\t\n\t// ----------------------------------------------------------------------------\n\t// Find embedded fonts\n\t\n\t\n\t\n\tfl.outputPanel.trace(\"\");\n\tfl.outputPanel.trace(\"\");\n\tfl.outputPanel.trace(\"Embedded fonts\");\n\tfl.outputP... | [
"0.6297762",
"0.6203963",
"0.6191316",
"0.6162986",
"0.61116916",
"0.6106843",
"0.6098715",
"0.6084012",
"0.6020266",
"0.5924539",
"0.5892548",
"0.58653396",
"0.58136976",
"0.58115643",
"0.57844603",
"0.5727393",
"0.5725591",
"0.56826437",
"0.56826437",
"0.5669104",
"0.565631... | 0.7600052 | 0 |
Write examples of all the fonts to console | function showAll (text) {
asciify.getFonts(function (err, fonts) {
if (err) { return console.error(err); }
var padSize = ('' + fonts.length).length;
fonts.forEach(function(font, index) {
var opts = {
font: font,
color: argv.color
};
asciify(exampleText, opts, function (err, result) {
con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listFonts () {\n\n\tasciify.getFonts(function (err, fonts) {\n\t\tif (err) { return console.error(err); }\n\n\t\tvar padSize = ('' + fonts.length).length;\n\n\t\tfonts.forEach(function (font, index) {\n\t\t\tconsole.log(pad(padSize, index+1, '0') + ': ' + font);\n\t\t});\n\t});\n}",
"function fonts(cb) ... | [
"0.68187654",
"0.638602",
"0.5888868",
"0.5866639",
"0.58145434",
"0.5797385",
"0.5756701",
"0.57539225",
"0.5693272",
"0.56023425",
"0.55444175",
"0.54966766",
"0.5493995",
"0.5487679",
"0.54576886",
"0.54560536",
"0.54505223",
"0.5408863",
"0.5402523",
"0.5392015",
"0.53669... | 0.6774358 | 1 |
Get random red herrings roots and mix them with the roots of the word to display n possible options | randomChoices(wordParts, roots) {
let wordRoots = _.filter(wordParts, (c) => c.type === 'root' && c.valueUnsolved.includes('_'))
wordRoots = _.map(wordRoots, (root) => ({ 'value': root.valueSolved, 'definition': root.definition, 'isAnswer': 'true' }));
let choices = _.nRandom(_.toArray(roots), this.state.ch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"makeText(numWords = 100) {\n let chains = this.makeChains(); // MM object\n \n // first word to start chaining\n let key_words = Object.keys(chains); // array of key-words in MM object to choose from\n let key_num = key_words.length; // number of words to choose from\n let key_ind = Math.floor(Ma... | [
"0.6214368",
"0.6063824",
"0.6059455",
"0.6050696",
"0.6041775",
"0.6006292",
"0.6001649",
"0.5961085",
"0.5952532",
"0.5944608",
"0.5924603",
"0.5910431",
"0.5867985",
"0.58559555",
"0.58529425",
"0.5834867",
"0.5786931",
"0.5786193",
"0.5774761",
"0.5763499",
"0.5757616",
... | 0.67645144 | 0 |
gets trail to follow where mouse is | function follow(event) {
trail[count%10].style.left = (event.pageX - 4) + "px";
trail[count%10].style.top = (event.pageY - 4) + "px";
count++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n // Make sure the mouse position is set everytime\n // draw() is called.\n var x = mouse.x,\n y = mouse.y,\n a = nn.a,\n b = nn.b;\n \n // \n trailDots.forEach(function(dot, index, dots) {\n var nextDot = dots[index + 1] || dots[0];\n \n dot.x = x;\n dot.y = y;... | [
"0.6623059",
"0.6256627",
"0.61688584",
"0.6162687",
"0.6136588",
"0.6136588",
"0.6106844",
"0.60663706",
"0.603016",
"0.59770775",
"0.59696585",
"0.5961057",
"0.5933689",
"0.5903817",
"0.58774084",
"0.5858013",
"0.58573806",
"0.58380884",
"0.5827353",
"0.58161414",
"0.581068... | 0.73703915 | 0 |
gets trail to catch up when mouse stops | function catchUp(event) {
var i = 0;
clearInterval(timer);
timer = setInterval(function() {
if (i >= 10) {
clearInterval(timer);
}
trail[count%10].style.left = (event.pageX - 4) + "px";
trail[count%10].style.top = (event.pageY - 4) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_stop_mouse_track() {\n\t\t\tif (this.track_id) {\n\t\t\t\tthis.track_id = clearInterval(this.track_id);\n\t\t\t}\n\t\t\tthis.add_info('movement', this.current_mouse_movement, 'shape');\n\t\t}",
"function mouseReleased() {\n stamped =false;\n}",
"function mouseReleased () {\n noLoop();\n}",
"function mouse... | [
"0.69502985",
"0.6558655",
"0.65094835",
"0.6478189",
"0.6477866",
"0.6458269",
"0.64239883",
"0.6349911",
"0.6340094",
"0.63370156",
"0.63217205",
"0.63098055",
"0.62825036",
"0.62748396",
"0.62323934",
"0.62156135",
"0.620627",
"0.6204919",
"0.62033325",
"0.62033325",
"0.62... | 0.69081503 | 1 |
Returns whether or not the passed in relationship is the "owner" of the relationship. This defaults to true for belongsTo and false for hasMany | isRelationshipOwner(relationship) {
var owner = relationship.owner;
// TODO: use lack of an inverse to determine this value as well
return relationship.kind === 'belongsTo' && owner !== false ||
relationship.kind === 'hasMany' && owner === true
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }",
"_isOwner() {\n return this.record && (this.record.userId == this.user.id);\n }",
"isOwner() {\n\t\treturn this.owner === Meteor.userId();\n \t}",
"inversesAlreadyAssociated(inverse, owner) {\n let inverseKey = thi... | [
"0.67703396",
"0.67549163",
"0.6647881",
"0.6158982",
"0.615429",
"0.58760184",
"0.5599584",
"0.54984426",
"0.543576",
"0.54100883",
"0.5388887",
"0.5386056",
"0.5383923",
"0.5323997",
"0.5282229",
"0.5269805",
"0.52515984",
"0.52163994",
"0.5214126",
"0.51703036",
"0.5168879... | 0.84309566 | 0 |
Build music sprites if we have music list | buildMusicSprites() {
let index = 0;
for (const music of G.musics) {
const offset = index++ - this.selected;
const sprite = G.graphics.createSprite((w, h, self) => ({
x: w,
y: 0.3 * h + MUSIC_LIST_ITEM_HEIGHT * (1 - MUSIC_LIST_ITEM_Y_DELTA) * (offs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async onInitialize() {\n G.audio.playBGM('bgm/voltexes-ii.mp3');\n // backgrounds\n this.stage.addChild(G.graphics.createImage('graphics/music-select-bg.jpg', {\n position: 'center',\n size: 'cover'\n }));\n // darken shadow\n this.stage.addChild(G.gr... | [
"0.6595777",
"0.6150873",
"0.59576416",
"0.59306365",
"0.5915868",
"0.5881308",
"0.58765936",
"0.58548594",
"0.5812746",
"0.5780421",
"0.5751419",
"0.57379997",
"0.5732832",
"0.570023",
"0.5683659",
"0.56786245",
"0.5662781",
"0.5658697",
"0.56582654",
"0.5647283",
"0.5644443... | 0.79835737 | 0 |
2. Any year is entered through the keyboard. Write a function to determine whether the year is a leap year or not. | function isLeapYear() {
var year = Number(prompt("Year ? "));
var leapYear = year % 100 === 0 ? year % 400 === 0 : year % 4 === 0;
return leapYear;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"leapYear(year) {\n if (year > 999 && year < 10000) {\n if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n console.log(year + \" is a leap year\");\n else\n console.log(year + \" is not a leap year\");\n\n }\n else\n console... | [
"0.84381413",
"0.8392031",
"0.82617843",
"0.82614595",
"0.82559925",
"0.8253501",
"0.8251277",
"0.8201279",
"0.817877",
"0.8175716",
"0.81660974",
"0.8121428",
"0.80832213",
"0.8080325",
"0.80487055",
"0.8036659",
"0.8035254",
"0.8034036",
"0.8031653",
"0.8031488",
"0.8012644... | 0.87025005 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.