query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Verificar que ninguno de los campos input se encuentren vacios | function validarCampo() {
if (
id_a.value == "" ||
owner_a.value == "" ||
capacity_a.value == "" ||
cat_a.value == "" ||
nombre_a.value == ""
) {
return true;
} else {
return false;
}
} | [
"validateInputs() {\n\t\tif(isNaN(this.billAmount) || this.billAmount <= 0 || this.totalPerson == 0) return false;\n\t\treturn true;\n\t}",
"function validaCadenaVacia(campo, nombreCampo){\n\tif(campo === null \n\t\t\t|| campo === undefined\n\t\t\t|| trimTexto(campo).length === 0){\n\t\talert(\"El campo \" + nomb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
////// I N I T M A S T E R ///////////////////////////////////////////////// var Burst = new Burst("name",640,480); | function newBurst(canvasId,BurstScript){
if(window.addEventListener){
window.addEventListener("load",function(){
var canvas=document.getElementById(canvasId);
var cWidth=canvas.clientWidth;
var cHeight=canvas.clientHeight;
if (!canvas.getContext){
//console.log("This browser does n... | [
"function Sprite_BattlerTS() {\n this.initialize.apply(this, arguments);\n}",
"function createBombers() {\n\t\tfor (var b = 0; b < 4; b++) {\n\t\t\tvar angle = b * toRadians(90);\n\t\t\tvar x = WIDTH/2 + (RADIUS * Math.cos(angle));\n\t\t\tvar y = HEIGHT/2 + (RADIUS * Math.sin(angle));\n\t\t\t// rotate to face ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mobile Menu Scripts ========================================================= Close Mobile Menu | function closeMobileMenu() {
navMenuMobile.style.maxHeight = null;
navMenuMobile.style.pointerEvents = 'none';
bodyOverlay.style.opacity = 0;
document.querySelector('body').style.overflow = 'unset';
bodyOverlay.style.pointerEvents = 'none';
navTriangle.style.display = 'none';
} | [
"function closeBurgerMenu() {\n $menuBurgerOverlay.removeClass('open');\n $body.removeClass('overflow');\n }",
"function closeMenu(){\n /*This remove the hamburger bar after body is clicked\n $('.toggle').fadeOut(200);*/\n $('.item').removeClass('active'); \n }",
"async closeMenu() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that sorts and swaps the words | function swap(){
//first for loop that goes down from the length of array to 0
for(var i = txt.length - 1; i >= 0; i-- ){
//second for loop that goes from 0 to i
for(var j = 0; j < i; j++ ){
//seeing if one word is greater than the other word
if (txt[i]<txt[j]){
//sets a variable to the ... | [
"function reOrdering(text) {\n let s = text.split(' '), i = s.findIndex(a => a[0] === a[0].toUpperCase());\n return [s[i], ...s.slice(0, i), ...s.slice(i + 1)].join(' ');\n}",
"function shuffleAndSort(wordAndOccurence){\n\tfor (var i=0, l=wordAndOccurence.length; i<l; i++){\n\t\treduce(wordAndOccurence[i]);\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expect indicator to have property 'scatter' of type scatter: ['x column name', 'y column name', 'x data type', 'y data type'] | function getScatterData(indicator) {
var xcol = indicator.histogram[0];
var ycol = indicator.histogram[1];
var xtype = indicator.histogram[2];
var ytype = indicator.histogram[3];
var xdata = [];
if (xtype === "numeric") {
for (var row=0; row<csvObject[xcol].length; row++)
xdata.push(+csvObject[xcol... | [
"function onAddSeries(e) {\n if (this.is3d()) {\n if (e.options.type === 'scatter') {\n e.options.type = 'scatter3d';\n }\n }\n }",
"function onAfterInit() {\n var options = this.options;\n if (this.is3d()) {\n (options.series || []).f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get numbe of possible IPs based on bits | function getIPCount(bitCount) {
valor = 32 - bitCount;
return Math.pow(2, valor);
} | [
"function countAddr (ip1Int, ip2Int){\r\n\tvar res = ip1Int[3] - ip2Int[3] + 1;\r\n\tres += (ip1Int[2] - ip2Int[2])*256;\r\n\tres += (ip1Int[1] - ip2Int[1])*256*256;\r\n\tres += (ip1Int[0] - ip2Int[0])*256*256*256;\r\n\treturn res;\r\n}",
"function rangeBitCount(a, b) {\n let sumOfOnes = 0;\n for(let i = a; i <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ClosestDistance3DFunction A convienence function to find the closest distance between two 3 dimentional lines | function closestDistance3D( line1, line2 ) {
//console.log('\n');
//console.log( line1, line2 );
var a0 = [ line1.startX, line1.startY, line1.startZ ],
a1 = [ line1.endX, line1.endY, line1.endZ ],
b0 = [ line2.startX, line2.startY, line2.startZ ],
b1 = [ line2.endX, line2.endY, lin... | [
"static computeClosestDistance(startPoint, endPoint, thirdPoint) {\n // We are going to use the formula C = Arccos ((a2 + b2 - c2) / 2ab) to\n // calculate the angle C, and sin(C) * b formula to calculate the\n // closest distance.\n // a is the length of the line. b and c are the lengths from start and... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Support function: creates an empty element to replace embedded SWF object | function replaceSwfWithEmptyDiv(targetID){
var el = document.getElementById(targetID);
if(el){
var div = document.createElement("div");
el.parentNode.insertBefore(div, el);
//Remove the SWF
swfobject.removeSWF(targetID);
//Give the new DIV the old element's ID
... | [
"function iefixNindexi1f1() {\r\n document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"100%\" height=\"100%\">\\n')\r\n document.write(' <param name=\"movie\" value=\"lab1.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the child of the given LView | function getLViewChild(lView) {
var childIndex = lView[TVIEW].childIndex;
return childIndex === -1 ? null : lView[childIndex];
} | [
"function findAndGetChild(childName, parent) {\n for (var _i = 0, _a = parent.children; _i < _a.length; _i++) {\n var child = _a[_i];\n if (child.name === childName) {\n return child;\n }\n }\n return null;\n}",
"child(root, index) {\n if (Text.isText(root)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
query schedule through a start and end range. optional userId | function getScheduleHandler(request, reply) {
const userId = _get(request.params, 'userId');
const getScheduleMatcher = [
{
$match: {
"date.date": {$gte: new Date(request.query.startDate), $lte: new Date(request.query.endDate)}
}
}
];
if (userId) ... | [
"listEventsForTimespan (groupId, from = undefined, to = undefined, method = 'intersect') {\n assert.equal(typeof groupId, 'number', 'groupId must be number')\n assert.ok(from || to, 'at least either from or to must be defined')\n if (from) {\n assert.equal(typeof from, 'date', 'from must be date')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates and returns a Tipp button of the appropriate kind: 1) built with Tipp amount form if content creator has Stripeenabled Tipp account. 2) built with calltoaction message asking user to tell the creator to create such an account. | function createTippButton(stripeUser) {
stripeUser.stripeId = 'acct_1C0L5AH09iECdXAu'; // REMOVE AFTER TESTING
stripeUser.fname = 'Brandon'; // REMOVE AFTER TESTING
stripeUser.lname = 'Canaday'; // REMOVE AFTER TESTING
stripeUser.displayname = 'brandoncanadaytest'; // REMOVE AFTER TESTIN... | [
"function createCheckoutButton(preference) {\n var script = document.createElement(\"script\");\n\n // The source domain must be completed according to the site for which you are integrating.\n // For example: for Argentina \".com.ar\" or for Brazil \".com.br\".\n script.src = \"https://www.mercadopago.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Messages back from the bot to Alexa There can be multiple responses back from the bot from a single request. Problem is that with Alexa we can only send 1 response back, so how do we know when the bot is finished replying? If your bot is written to only respond with 1 reply to every request this isn't a problem, if not... | function botSays(activity) {
let startTime = Date.now();
console.log("Subscribe event: " + activity.replyToId + " from: " + activity.from.id + " message: " + activity.text);
//console.log(util.inspect(activity, false, null));
// When you only have exactly 1 bot response per user request you can safely do this ... | [
"function respond(message, gateway, request, response, number) {\n console.log('[' + number + '] sending ' + message.length + 'c: ' + message);\n if (gateway === 'telerivet') {\n // Telerivet requires JSON response\n var res = {\n messages: [ { content: message } ]\n };\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
will get in the current dicitonary object as well, there is a specific dictionary for each verb the current path string the object associated with that path and returns the updated dictionary | storePath(currentVerbPathDictionary, dynamicPath, storageObject) {
return new PathDictionary();
} | [
"prepare () {\n this.bloggify = path.join(this.root, this._paths.bloggify)\n iterateObject(this._paths, (value, pathName) => {\n if (pathName === \"bloggify\" || pathName === \"root\" || typeof this[pathName] === \"function\") { return; }\n this[pathName] = value.startsWith(\"/\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert the output of ImageMagick's `identify verbose` command to a JavaScript Object. | function imageMagickOutputToObject(output) {
let previousLineIndent = 0;
const lines = output.match(/[^\r\n]+/g);
lines.shift(); // Remove First line
lines.forEach((line, index) => {
const currentIdent = line.search(/\S/);
line = line.trim();
if (line.endsWith(':')) {
lines[ind... | [
"function parseInfo(filePath) {\r\n\tvar arr = fs.readFileSync(filePath, 'utf8').toString().split('\\r\\n');\r\n\ttitle = arr[0].split(':')[1];\r\n\tsize = arr[1].split(':')[1];\r\n\tvar result = {\r\n\t\t\"title\" : title,\r\n\t\t\"size\" : size\r\n\t};\r\n\tconsole.log(\"video info: \" + JSON.stringify(result))\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Withdraw the number on the screen | function withdrawCash() {
var num = parseFloat(document.getElementById("calScreen").innerHTML);
accountModule.widthdraw(num);
} | [
"function withdraw (account, amount) {\n account.balance -= amount;\n}",
"clickMinusOrdinary() {\n\t\t$(document).on('click', '#minus-ordinary', () => {\n\t\t\tlet number = Number($('#number-ordinary').text());\n\t\t\tif (number !== 0) {\n\t\t\t\tnumber -= 1;\n\t\t\t\t$('#number-ordinary').html(number);\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function adds an implicit limiter between the node start and the start of the first limited region It also calculates and adds the distance between each limited region Expects node.limiter_objects to be sorted by partition start time Should be called after addLimiterToLoopNodes is called for every limiter of a loo... | function postProcessLimiters(node) {
if (isComponentOrFunctionNode(node))
return;
// Do the first if statement for both starts/ends
let allObjects = [];
if (node.hasOwnProperty("limiter_start_objects"))
allObjects = allObjects.concat(node.limiter_start_objects);
if (node.hasOwnProper... | [
"function addLimiterToLoopNodes(limiterParentNode, limiterStartParentNode, limiterEndParentNode, limiterStartElement, limiterEndElement, limitedRegionCapacity, checkPreviousIteration, thresholdDelay) {\n if (checkPreviousIteration === undefined) {\n checkPreviousIteration = false;\n }\n if (threshol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
8.buildHeightDialog & 9.buildDownDialog Made by Irenebode Since 171105 | function buildDialog() {
ctx.runOnUiThread(new java.lang.Runnable({
run: function() {
try {
var dialog = new android.app.AlertDialog.Builder(ctx, 5);
var layout = new android.widget.LinearLayout(ctx);
layout.setOrientation(1);
var editT = new android.widget.EditText(ctx);
... | [
"function setupDimensions() {\n\t$('.opt').css('width', width/numtabs+'px');\n\t$('.sub').css('width', width+'px');\n\t$('.sub').css('overflow', 'hidden');\n\t$('.controlgroup').css('width', numtabs*width+'px');\n\t$('#camera').css('margin-top', '1px');\n\t$('#camera').css('margin-bottom', '2px');\n\t$('.controlgro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========== video randomizer button ========== | function random_button() {
const array = ['video/chicken.mp4', 'video/froggo.mp4', 'video/sangfugl.MOV']
var x = Math.floor((Math.random() * array.length));
document.getElementById('divVideo').src = array[x]
} | [
"function displayVideo() {\n\tvar correctVideoLink = questionID.videoLink;\n\t//console.log(\"value of src = \" + correctVideoLink);\n\t$(\"#answer-media\").attr(\"src\", correctVideoLink);\n}",
"function RandVal()\n{\n\tdocument.getElementById(\"finalscore\").innerHTML= ''; //Changes the text of finalscore to nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When called with an argument that is not already on the list, it adds that argument to the list. When called with an argument that is already on the list, it removes the element from the list. When called without arguments, it logs all items on the list. If the list is empty, it logs an appropriate message. | function makeList() {
let list = [];
return function(argument) {
if (argument === undefined) {
if (list.length > 0) {
list.forEach(element => console.log(element));
} else {
console.log('The list is empty.');
}
return;
}
if (!list.includes(argument)) {
... | [
"function AddListElement(prElement, prList) {\r\n\tif(prList == \"\")\r\n\t\t//if list is blank, return new element as list\r\n\t\treturn prElement;\r\n\telse\r\n\t\t//otherwise, return list with element appended\r\n\t\treturn prList + \",\" + prElement;\r\n}",
"function makeList() {\n let list = [];\n return f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
General function to draw a thing to a context Calls drawThingOnCanvas[Single/Multiple] with more arguments | function drawThingOnCanvas(context, me) {
if(me.hidden) return;
var leftc = me.left,
topc = me.top;
if(leftc > innerWidth) return;
// If there's just one sprite, it's pretty simple
// drawThingOnCanvasSingle(context, me.canvas, me, leftc, topc);
if(me.num_sprites == 1) drawThingOnCanvasSingle(conte... | [
"draw(ctx) {\r\n if (this.isDistanced) {\r\n this.distanceGraph();\r\n }\r\n // draw all nodes and store them in grid array\r\n this.nodeList.forEach(node => {\r\n node.draw(ctx);\r\n storeNodeAt(node, node.x, node.y);\r\n });\r\n\r\n // draw all edges\r\n this.edgeList.forEach(e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch all country name list and set india as selected | function fetchCountryList() {
fetch('https://api.covid19api.com/countries')
.then((response) => {
return response.json();
})
.then((countries) => {
countries.forEach((country) => {
const option = document.createElement('option');
option... | [
"fillCountrySelect(data) {\n\n const countries = data.map(d => `<option value=\"${d.code}\">${d.name}</option>`).join(' ');\n this.countrySelect.innerHTML += countries;\n }",
"function populateListbox() {\n\t\t\tvar select = document.getElementById(\"statesListbox_by_country\");\n\t\t\tvar select... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
name to field nodes and definitions) as well as a list of fragment names referenced via fragment spreads. | function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) {
var cached = cachedFieldsAndFragmentNames.get(selectionSet);
if (!cached) {
var nodeAndDefs = Object.create(null);
var fragmentNames = Object.create(null);
_collectFieldsAndFragmentNames(context, pare... | [
"static getVirtualFieldsList(names){\n\t}",
"function buildFragmentForRoot(root: Root): Fragment {\n return {\n argumentDefinitions: (root.argumentDefinitions: $FlowIssue),\n directives: root.directives,\n kind: 'Fragment',\n metadata: null,\n name: root.name,\n selections: root.selections,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fieldClone() Clones a field object into a brandspanking new field object which is returned. This is necessary when modifying objects as they are copied for multiple perspectives. | function fieldClone(field)
{
// first, just get a copy of the object itself
var clone = Object.assign({},field); // clone ALL object fields
var listFields = ["perspective","target","start","end","targetVal",
"multiplier","low","high",
"shape","x","y","width","height", ... | [
"function cloneFields(obj, fields){\n let ret = {}\n pluckFields(ret, obj, fields);\n return ret;\n}",
"cloneAndAddNode(node) {\n\t let new_node = new $N.BaseNode(node.getID());\n\t new_node.setFeatures($DS.clone(node.getFeatures()));\n\t this._nodes[node.getID()] = new_node;\n\t th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
zipper.js Main Zipper class. | function Zipper() {
this._entries = [];
} | [
"function toZip( location ){\n\t\n\tvar myWorker;\n\t\n\tif( os.isWindows ){\n\t\t\t\t/* Windows platform */\n\t\t\t\t\n\t\tvar zipItLoaction = studio.extension.getFolder().path + \"resources/zipit\";\n\t\tzipItLoaction = zipItLoaction.replace( /\\//g, \"\\\\\" );\n\t\tlocation = location.replace( /\\//g, \"\\\\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the numeric identifier corresponding to an Apple device name (i.e. for use by TARGETED_DEVICE_FAMILY). | function appleDeviceNumber(deviceName) {
return _deviceMap[deviceName];
} | [
"function targetedDeviceFamily(deviceNames) {\n return deviceNames.map(function (deviceName) {\n return appleDeviceNumber(deviceName);\n }).join(\",\");\n}",
"function getDeviceDataId() {\n if (_deviceData._deviceDataId === undefined) {\n _deviceData._deviceDataId = sjcl.codec.base64.fromBits... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This updates the speed for the instance of the aircraft by checking the difference between current speed and requested speed | updateSpeedPhysics() {
let speedChange = 0;
const differenceBetweenPresentAndTargetSpeeds = this.speed - this.target.speed;
if (differenceBetweenPresentAndTargetSpeeds === 0) {
return;
}
if (this.speed > this.target.speed) {
speedChange = -this.model.rat... | [
"updateGroundSpeedPhysics() {\n // TODO: Much of this should be abstracted to helper functions\n\n // Calculate true air speed vector\n const indicatedAirspeed = this.speed;\n const trueAirspeedIncreaseFactor = this.altitude * ENVIRONMENT.DENSITY_ALT_INCREASE_FACTOR_PER_FT;\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SET THE CALENDAR TO TODAY'S DATE AND DISPLAY THE NEW CALENDAR | function setToday() {
// SET GLOBAL DATE TO TODAY'S DATE
calDate = new Date();
// SET DAY MONTH AND YEAR TO TODAY'S DATE
var month = calDate.getMonth();
var year = calDate.getFullYear();
// SET MONTH IN DROP-DOWN LIST
tDoc.calControl.month.selectedIndex = month;
// SET YEAR VAL... | [
"function atgCalendar_changeDate(calendarInstance) {\n\tvar theDate = calendarInstance.displayDate;\n\tif ((theDate == null) || (theDate == \"\"))\n\t\ttheDate = new Date();\n\n var containerObject = atgCalendar_findElementById(calendarInstance.containerId);\n var nodeType = containerObject.tagName;\n\n if (node... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
processing i = 1, sum = 0; while i <= n, sum += 1 (add and assign i to sum), then increment i by 2 output displays the sum of all odd integers between 1 and n | function sumOdds() {
let n = parseInt(document.getElementById('integer').value);
let i = 1;
let sum = 0;
while (i <= n) {
sum += i
i += 2;
}
document.getElementById('output').innerHTML = sum;
} | [
"function summationEven(num){\n let n = 0;\n for(var i = 1; i<= num; i++){\n\n if(i % 2 == 0){\n n += i \n }\n }\n console.log(n) \n}",
"function sum_odd_5000(){\n var sum = 0;\n for(var i=1; i<5000; i+=2){\n sum = sum + i;\n }\n return sum;\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Batch decode a number of points input: Array of sec1encoded points output: Array of sec1decoded points | function batchDecodePoints(pointArr) {
let decPointArr = [];
for (let i=0; i<pointArr.length; i++) {
decPointArr.push(sec1DecodePoint(pointArr[i]));
}
return decPointArr;
} | [
"decompressRunLengthEncodedList(numbers) {\n let arr = [];\n for (let i = 0; i < numbers.length; i += 2) {\n const frequency = numbers[i];\n const val = numbers[+i + 1];\n for (let j = 0; j < frequency; j++) {\n arr.push(val);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the registered instance of Injectable. | getInstance() {
if(this.instance.constructor === NoInstance)
throw new Error(`Injectable ${this.name} is not initiated, but an instance is requested, please create it \
first via the container.`);
return this.instance;
} | [
"get injector() {\n return this._injector;\n }",
"getInjectable(name) {\n const node = this.injects[name] || null;\n if (node !== null) {\n return node instanceof Node ? node : this.newNode(node);\n }\n return MISSING_NODE;\n }",
"function getServiceRegistry() {\n var injector... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que retorna el ancho de manda minimo para QPSK | function getAnchoBandaMinimoQPSK(Fb) {
B=Fb/2
return B;
} | [
"function krnGetQuantum()\n{\n // If the scheduler has a quantum display it.\n if(_Scheduler.getQuantum)\n {\n _StdIn.putText(\"Quantum:\" + _Scheduler.getQuantum());\n }\n else\n {\n _StdIn.putText(\"The scheduler doesn't have a quantum.\");\n }\n}",
"function getAnchoBandaMini... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ringct MG sigs Prove: c.f. section 4. definition 10. This does the MG sig on the "dest" part of the given key matrix, and the last row is the sum of input commitments from that column sum output commitments this shows that sum inputs = sum outputs Ver: verifies the above sig is created corretly | function verRctMG(mg, pubs, outPk, txnFeeKey, message, kimg) {
const cols = pubs.length;
if (cols < 1) {
throw Error("Empty pubs");
}
const rows = pubs[0].length;
if (rows < 1) {
throw Error("Empty pubs");
}
for (let i = 0; i < cols; ++i) {
if (pubs[i].length !== rows... | [
"function proveRctMG(message, pubs, inSk, kimg, mask, Cout, index, hwdev) {\n xmr_str_utils_1.JSONPrettyPrint(\"proveRctMG\", {\n message,\n pubs,\n inSk,\n kimg,\n mask,\n Cout,\n index,\n }, \"args\");\n const cols = pubs.length;\n if (cols < 3) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INTERNAL FUNCTIONS Description: perform a function with an initialized zip filesystem, making sure that such filesystem is initialized. Note that due to a race condition, more than one zip filesystem may be instantiated. However, the last one to be set on the model object will prevail and others would be garbage collec... | function withZipFsPerform(callback, onerror) {
if (_zipFs) {
callback(_zipFs, onerror);
} else {
// The Web Worker requires standalone inflate/deflate.js files in libDir (i.e. cannot be aggregated/minified/optimised in the final generated single-file build)
... | [
"function _preloadZip () {\n if (!_URLsToLoad.length) return; // If no zip file to download, that's it, we're done\n var getZipFile = function(url){ // Called for each URL that was passed\n function removeURL() { // Called to remove a URL from the array (when unzipped done, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserallow_or_disallow. | visitAllow_or_disallow(ctx) {
return this.visitChildren(ctx);
} | [
"function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\n\tif (tempDesc == ' print' || tempType == 'identifier' || tempType == 'type' || tempDesc == ' while' || tempDesc == ' if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plays random lobby song every time page loads | function randomLobbySong(order){
switch (order){
case 'play': lobby[randomLobby].lobbyAudio.play(); break;
case 'pause': lobby[randomLobby].lobbyAudio.pause(); break;
}
} | [
"function randomBackgroundSong(play){\n switch (play){\n case 'pause': backgroundSong[randomSongNum].backgroundSongAudio.pause(); break;\n case 'play': backgroundSong[randomSongNum].backgroundSongAudio.play(); break;\n }\n}",
"function ORandomPlay() {\n\n\t\t// Loop to find a valid play\n\t\tf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom log functions for groups and custom debouncing | function log(configGroup) {
var deBounceGroup = {};
var deBounceCheck = function(oldTime, newTime, bounceTime) {
if (newTime - oldTime > bounceTime) {
return true;
}
return false;
};
return function (group, title, value, bounce) {
if (configGroup[group]) {
... | [
"visitLog_grp(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"startLogging() {\n this.isLogging = true;\n this.debounceTime$\n .pipe(takeUntil(this.stopLogging$), switchMap((debounceTime) => this.periodicalLogging(debounceTime)))\n .subscribe(() => this.onPostMessages());\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
According to the requirements, workshop F in session 2 and workshop H in session 3 must be taken together. This function verifies that a participant chooses F and H only when the other is choosen as well. | function checkIfF(){
var workshop3El = document.getElementsByName('workshop3'); // get the radio buttons from session 3
var workshop2El = document.getElementsByName('workshop2'); //get the radio buttons from session 2
var errorMessage = "The \'Security of Biometrics\' workshop from session 2 and the " +
... | [
"function checkIfB(){\n var workshop1El = document.getElementsByName('session1'); // get the radiobuttons from the first session\n var workshop2El = document.getElementsByName('session2'); // get the radio buttons from the second session\n var errorMessage = \"The \\'Investigations Involving Automobile Me... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if the cards to be played have a higher highest card than the previous cards | isValidHighestCard(cards, prevCards = null) {
let currHighest = cards[cards.length - 1].getPriority();
let prevHighest;
if (prevCards == null) {
prevHighest = this.prevCards[this.prevCards.length - 1].getPriority();
}
else {
prevHighest = prevCards[prevC... | [
"isValidPriority(cards, prevCards = null) {\n const prioritySum = (accumulator, card) => accumulator + card.getPriority();\n let currPriority = cards.reduce(prioritySum, cards[0].getPriority());\n var prevPriority;\n\n if (prevCards == null) {\n prevPriority = this.prevCards.r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Full Body Protection Carousel on product page | function fullBodyCarousel(){
$('.full-body-carousel').owlCarousel({
items:1,
loop:false,
center:true,
margin:0,
URLhashListener:true,
autoplayHoverPause:true,
startPosition: 'URLHash',
animateOut: 'fadeOut',
animateIn: 'fadeIn'
});
} | [
"buildCarousel() {\n // Subclasses may override.\n }",
"function owl_main_carousel() {\r\n //owl slider\r\n var owl = $(\"#main-carousel\");\r\n owl.owlCarousel({\r\n nav: true, // Show next and prev buttons\r\n smartSpeed: 1000,\r\n dotsSpeed: 1000,\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the text content of the view's text element. | get text() {
return (this._textElement || this._element).textContent;
} | [
"function getTextContent(element) {\r\n\r\n if (window.mozilla) {\r\n return element.textContent;\r\n }\r\n else {\r\n return element.innerText\r\n }\r\n}",
"function getDocumentText(element) {\n element = $(element) || $(\"body\");\n var params = { \"text\": \"\", \"trim\": true };\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the bottom of a content for connection type 0 | function getBottomForConnectionType0(content){
if(content != undefined){
// Gets the ratio of likes to dislikes
var likesToDislikes = content.Ratio;
returnS = '<center> <div class="likeAndDislikeDiv" id="likeAndDislikeDiv_' + content.ContentID +'">'
+'<div class="centeredInDiv likeDiv" id="like... | [
"function getBottomForConnectionType1(content){\n\t\tif(content != undefined){\n\n\t\t\t// Gets the ratio of likes to dislikes\n\t\t\tvar userHasLikedString = \"Error...\"\n\t\t\tif(content.IsLike==0){\n\t\t\t\tuserHasLikedString = \"They dislike this.\";\n\t\t\t} else if(content.IsLike==1){\n\t\t\t\tuserHasLikedSt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select all organisms suitable as outgroups for current species selection, sort by Mash distance and add to outgroup list | function outgroupPick() {
var commonTax = commonGroup();
//console.log(typeof commonTax[1]);
var activeOutgroups = [];
var inactiveOutgroups = [];
if (typeof commonTax[1] == "string") { //if only one NCBI id in list
//var allOutgroups = jsonOrgs["outgroups"]; // change?
var groupId = commonTax[0]+"id";
$('#outgrsel').e... | [
"function selectHouses() {\n console.log(\"got to selecthouses\");\n // If no further limits have been entered, just make the finalGroup array equal to the areaGroup\n // array — we don't want to filter the houses further — then run updateDisplay().\n if ( builtTarget.value == \"anyyearb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mouse down event handler for resizable master/slave tables e the mouse down event return none Compatibility: IE, NS6 | function i2uiResizeSlaveonmousedown(e)
{
var name;
i2uiResizeSlaveOrigonmouseup = document.onmouseup;
i2uiResizeSlaveOrigonmousemove = document.onmousemove;
document.onmousemove = i2uiResizeSlaveonmousemove;
document.onmouseup = i2uiResizeSlaveonmouseup;
i2uiResizeSlavewhichEl = null;
... | [
"function i2uiResizeSlaveonmouseover()\r\n{\r\n if (i2uiResizeSlavewhichEl == null && event.srcElement.id.indexOf(i2uiResizeKeyword) != -1)\r\n {\r\n event.srcElement.style.cursor = \"move\";\r\n }\r\n event.returnValue = true;\r\n}",
"function i2uiResizeSlaveonmousemove(e)\r\n{\r\n if (i2uiResizeSlavewhi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update B1 Service Layer session timeout | function updateSLSessionTimeout() {
//Calculates and store when session will be expired
console.log("Updating SL Session Expiration date in cache")
redisClient.hget(hash_Timeout, hash_Timeout, function (error, reply) {
if (error) {
console.error("Can't Update Session Timeout in Redis " +... | [
"function showSessionTimeout() {\n showLightboxComponent(kradVariables.SESSION_TIMEOUT_DIALOG);\n}",
"function showSessionTimeoutWarning() {\n showLightboxComponent(kradVariables.SESSION_TIMEOUT_WARNING_DIALOG);\n}",
"function updateTimeout() {\n $timeout(function () {\n if ($sco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
propagate expanded state to child tree | function propagateExpanded(data, state) {
data.data.expanded = state;
data.children.forEach(child => propagateExpanded(child, state));
} | [
"function expandAll(d) {\n root.children.forEach(expand);\n update(root);\n }",
"function expandActiveItem() {\n if (settings.expandActiveItem === true) {\n var activeItem = settings.activeSelector;\n\n $(activeItem, mlnParentList).each(funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setting the panel collection | set panelCollection(panelCollection: PanelCollection) {
this._panelCollection = panelCollection;
} | [
"function setHtmlPanel(){\n\t\t\n\t\t//add panel wrapper\n\t\tg_objWrapper.append(\"<div class='ug-grid-panel'></div>\");\n\t\t\n\t\tg_objPanel = g_objWrapper.children('.ug-grid-panel');\n\t\t\n\t\t//add arrows:\n\t\tif(g_temp.isHorType){\n\t\t\t\n\t\t\tg_objPanel.append(\"<div class='grid-arrow grid-arrow-left-hor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the current animation to the animation specified by animationName, unless that animation is currently playing. If the animation is currently playing, no action is taken. | setAnimation(animationName) {
var currentAnimationName = this.animations.currentAnim.name;
if (currentAnimationName != animationName) {
this.animations.play(animationName);
}
} | [
"play_anim (anim_name) {\n\t\tclearInterval(this._anim);\n\t\tthis._current_sprite[0] = anim_name;\n\t\tthis._current_sprite[1] = 0;\n\t\t// if it is a multi-frame animation, set sprite change rate\n\t\tif (this._sprites[anim_name].length != 1) {\n\t\t\tthis._anim = setInterval(() => {\n\t\t\t\tthis._current_sprite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute a shared signature from shares. | function mergeSignatures(shares) {
const ids = Object.keys(shares)
const coeffs = lagrangeCoefficients(ids.map(id => BigInt(id)))
let sign = bls.PointG2.ZERO
for (let i = 0; i < ids.length; i++) {
sign = sign.add(bls.PointG2.fromSignature(bigIntToBuffer(shares[ids[i]])).multiply(coeffs[i]))
}
return buf... | [
"function mergePublicShares(shares) {\n const sum = shares.slice(1).reduce((sum, share) => {\n return sum.add(bls.PointG1.fromCompressedHex(bigIntToBuffer(share)))\n }, bls.PointG1.fromCompressedHex(bigIntToBuffer(shares[0])))\n return bufferToBigInt(sum.toCompressedHex())\n}",
"function _signDigest(d, hash... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List the site sources. Returns a list of static files to be copied, and documents to be built. | async function listSources( config, files ) {
let buildable = isHTMLFile,
copyable = isNotHiddenFile;
// If a list of files to build is specified then expand
// the list to include dependencies.
if( files ) {
// The ste of copyables is any file on the file list.
... | [
"function htmlSourcesIndex(data)\n{\n\treturn PrintIndex('S', _('Sources Index'), Dwr.search.IndexTypeS, htmlSourcesIndexTable, htmlSourcesIndexList, data);\n}",
"async function listSources(appDir, sourcesConfig) {\n const globs = (sourcesConfig || ['**/*']).concat('!node_modules', '!.env');\n return globby... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rotate ruler according to new handle position. | function rotateRuler(ctx, p, leftHandle = true) {
const oldpos = { x: triangle.x, y: triangle.y };
const oldAngle = ruler.angle;
clear(ctx, ruler);
// Compute rotation center p0 and baseline angle diff.
const p0 = leftHandle ? ruler.ne : ruler.nw;
const baseAngle = getAn... | [
"function moveRuler(ctx, p) {\n const oldpos = {x: ruler.x, y: ruler.y};\n clear(ctx, ruler);\n ruler.x = p.x;\n ruler.y = p.y;\n getRulerCorners();\n draw(ruler, rulerCanvas);\n }",
"function _updateImageRotate ( values, handle ) {\n\t\tupdateAngle.call( this, values,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gatewayWriter: every 10s write a doc to gateway | function gatewayWriter(gateway){
var ip = gateway.replace(/[\.,\:,\/]/g,"")
var id = "perf_"+ip+"_"+process.hrtime(start_time)[0]
coax.put([gateway,id],
{at : new Date(), on : gateway, channels : "stats"}, function(err, json){
if( err != null){
console.log("Error: unable to ... | [
"function sendGeneratedNumber(res) {\n res.write(\"data: \" + `New number is ${num++}\\n\\n`)\n\n // call the function every second\n setTimeout(() => {\n sendGeneratedNumber(res)\n }, 1000);\n}",
"function createSyncDoc(service, SyncDoc) {\n service.documents\n .create({\n uniqueName: SyncDoc,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send message to one or all windows. If no handle is provided (i.e. undefined), the message is broadcasted to all windows | function sendMessage( param, hWnd ) {
if( param && param.msg ) {
var
e = new $.Event( param.msg ),
selector = hWnd !== undefined ? '#' + hWnd : '.window';
e.msg = param.msg;
e.param = param;
root
.find( selector )
.trigger( e );
}
} | [
"notifySenders () {\n let message = Object.assign({}, arguments);\n this.mb.broadcast(message);\n }",
"send(...args) {\n this._send_handler(...args)\n }",
"function broadcast(...args) {\n // XXX(Kagami): Better to use `for...of` but it seems to generate\n // inefficient code in babel currently.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adjust version number as per CB5337 Windows8 build fails due to invalid app version | function fixConfigVersion (version) {
if(version && version.match(/\.\d/g)) {
var numVersionComponents = version.match(/\.\d/g).length + 1;
while (numVersionComponents++ < 4) {
version += '.0';
}
}
return version;
} | [
"function default_versionCode(version) {\n var nums = version.split('-')[0].split('.');\n var versionCode = 0;\n if (+nums[0]) {\n versionCode += +nums[0] * 10000;\n }\n if (+nums[1]) {\n versionCode += +nums[1] * 100;\n }\n if (+nums[2]) {\n versionCode += +nums[2];\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chains two functions for further assigning as one wrapped callback function | function chainCallbacks(f1, f2) {
return function (...args) {
if (f1) {
f1.apply(this, args);
}
return f2.apply(this, args);
};
} | [
"static conduct(a, b, callback, on) {\r\n callback(a, b)\r\n\r\n }",
"function callback(callback){\n callback()\n}",
"function liftf(binaryFunction){\n\treturn function (x){\n\t\treturn function(y){\n\t\t\treturn binaryFunction(x, y)\n\t\t};\n\t}\n}",
"function setThisWithApply(fn, thisValue, args)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save the video picture to the folder /pics | function saveVideoPicture(path) {
var videoCanvas = document.getElementById("videoCanvas");
const url = videoCanvas.toDataURL('image/jpg', 0.8);
const base64Data = url.replace(/^data:image\/png;base64,/, "");
var fs = require('fs');
// console.log(base64Data);
fs.writeFile(path, base64Data... | [
"function saveToCameraRoll() {\n\tif (typeof canvas2ImagePlugin !== 'undefined') {\n\t\tcanvas2ImagePlugin.saveImageDataToLibrary(\n\t\tfunction(msg) {\n\t\t\t//console.log(msg);\n\t\t}, function(err) {\n\t\t\t//console.log(err);\n\t\t}, 'savespot');\n\t}\n}",
"function takepictureMotion(dir) {\n countImag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
take world coords (screen) and get tilemap coords | function getTileCoordsFromWorld(x, y, sx, sy) {
sy = sy || sx;
x = Math.floor(x / sx);
y = Math.floor(y / sy);
// uglify can't handle the es6 (well nodejs)
//return {x, y};
return {x: x, y: y};
} | [
"function viewportCoordsToScreenXY(coords) {\n\t\t\tvar left = SCREEN_WIDTH * (coords.x + 1) / 2;\n\t\t\tvar top = SCREEN_HEIGHT * (-coords.y + 1) / 2;\n\t\t\treturn new THREE.Vector2(left, top);\n\t\t}",
"function convertScreenToGrid(x, y) {\n const a = (((x - gridX - offsetY) / zoom) / (tileWidth / 2)) / 2\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API bool Draw(const char label = "Filter (inc,exc)", float width = 0.0f); // Helper calling InputText+Build | Draw(label = "Filter (inc,-exc)", width = 0.0) {
if (width !== 0.0)
bind.PushItemWidth(width);
const value_changed = InputText(label, this.InputBuf, IM_ARRAYSIZE(this.InputBuf));
if (width !== 0.0)
bind.PopItemWidth();
if (value_chang... | [
"function drawBackgroundText() {\n textSize(24);\n fill(255);\n textFont(promptFont);\n text(\"<-- Brandish Your Mask -->\", 50, 50);\n}",
"function draw_help() {\n ctx.font = 'bold 1em sans-serif';\n ctx.globalAlpha = 0.5;\n ctx.fillText('esc to exit', canvas.width/dpi - 13, 20);\n ctx.fillText('up/d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggered on change to the type of rule in the new rule, adjusts the data structure to match different rule types | changeRuleType(event, selectorNum) {
var rulesets = this.state.rulesets
var selectorParameters = rulesets[this.state.currentRuleset][selectorNum].parameters
rulesets[this.state.currentRuleset][selectorNum].rules[event.target.id].rule = event.target.value
if (event.target.value == "Tota... | [
"function setRuleType(x, n){\n\t\n\tswitch (x) {\n\t\tcase 1:\n\t\t\tcreateRules(n);\n\t\t\tbreak;\t\n\t\tcase 2:\n\t\t\tcreateRules(n);\n\t\t\tbreak;\t\n\t\tcase 3:\n\t\t\tcreateRules(n);\n\t\t\tbreak;\t\n\t\tcase 4:\n\t\t\tcreateRules(n);\n\t\t\tbreak;\t\n\t\tcase 5:\n\t\t\tcreateRules(n);\n\t\t\tbreak;\t\n\t\tca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Linearly interpolates between two polynomials of the same degree | function lerpPolynomials(poly1, poly2, pct){
var newPoly = [];
for(let i = 0; i < polyDegree+1; i++){
newPoly.push(lerp(poly1[i], poly2[i], pct));
}
return newPoly;
} | [
"function linear_interpolate(x, x0, x1, y0, y1){\n return y0 + ((y1 - y0)*((x-x0) / (x1-x0)));\n}",
"function lerp(x1,y1,x2,y2,y3) {\n\treturn ((y2-y3) * x1 + (y3-y1) * x2)/(y2-y1);\n}",
"function cubic_interp_1d(p0, p1, p2, p3, x) {\n\t// Horner-scheme like separation of coefficients to save multiplication... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME :deviceQstr() AUTHOR :Mary Grace P. Delos Reyes DATE :March 19, 2014 MODIFIED BY : REVISON DATE : REVISON : DESCRIPTION : PARAMETERS : | function deviceQstr(device){
var devicesStr = "[";
for(var t=0; t<device.length; t++){
if(t == device.length - 1){
devicesStr += "{ 'DeviceId':'"+device[t].DeviceId+"','Type': '"+device[t].Type+"' }";
}else{
devicesStr += "{ 'DeviceId':'"+device[t].DeviceId+"','Type': '"+device[t].Type+"' },";
}
}
devic... | [
"function device_information(id)\n{\n document.getElementById(id).innerHTML = \"MODEL = \"+device.model;\n}",
"function baynote_getQscrValue() {\n\tvar qscrValue = baynote_getUrlParamValue(\"qscr\");\n\tif (qscrValue) {return qscrValue;}\n\n\tvar qsfrValue = baynote_getUrlParamValue(\"qsfr\");\n\tif (qsfrValue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes the geospatial data passed to the map in order to draw it on the map. | function processGeoData(geoData) {
if (geoData && geoData.length > 0) {
ctrl.mapGeometry = [];
for (var i=0; i < geoData.length; i++) {
if (geoData[i].type === 'point') {
ctrl.mapGeometry.push( new Point(geoData[i]) );
}
else if... | [
"function updateMap(data, canvas) {\n\t//TODO\n}",
"function loadMapData()\r\n{\r\n\t//First clear the old shapes from the editor\r\n\t//This is important in the event that we're either\r\n\t//loading a new layer or a completely new image map\r\n\tclearEditor();\r\n\tloadLayers();\r\n\t//Load the shapes onto the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the message tooltip if there are messages for this field, otherwise hides it. The showAndClose flag allows the message to be closed automatically after some predetermined amount of time, and the change flag forces the show call on the plugin to deal with potential placement issues that can occur. | function showMessageTooltip(fieldId, showAndClose, change) {
var field = jQuery("#" + fieldId);
var data = getValidationData(field);
if (data && data.useTooltip && data.messagingEnabled && !haltValidationMessaging) {
var elementInfo = getHoverElement(fieldId);
var tooltipElement = jQuery(el... | [
"function showMessage (node, text, options = {}) {\n const timeout = options.timeout ? options.timeout : 2000\n const relativePos = options.relativePos\n ? options.relativePos\n : self.tooltip.links.relativePos\n const prevRelativePos = self.tooltip.links.relativePos\n\n if (text) self.setText... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor for MenuItem object from server data. | function MenuItem (data) {
this.name = data.Name;
this.description = data.Description;
this.price = "$" + (data.Price / 100.0).toFixed(2);
this.isSpecial = data.Special;
} | [
"function createMenu () {\n\tconst template = require('./data/menu.json');\n\tmenu = Menu.buildFromTemplate(template);\n\tMenu.setApplicationMenu(menu);\n}",
"function Menu() {\n _super.call(this);\n }",
"function initItemNode(item, node) {\n var classParts = [MENU_ITEM_CLASS];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the next tweet into the specified element or returns it if it is not specified | function nextTweet(element) {
var result = tweets.pop();
if (tweets.length == 0) {
_iterateTweets();
}
if (element == undefined) {
return result;
} else {
console.log(result.favorite_count);
console.log(result.retweet_count);
element.find(".profile_pic").attr("src", result... | [
"function nextTweet(){\n if( tweet = tweets.shift() ){\n checkTweet();\n }\n else {\n setTimeout( run, 100 );\n }\n }",
"function nextPage( callback ){\n // Get tweets from local archive if configured\n if( conf.archive ){\n if( ! archive ){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default bucket size 31 | constructor(size=31){
this.buckets = new Array(size);
} | [
"function initBuckets() {\n var objBuckets = [];\n for (var i = 0; i < 96; i++) {\n var bucket = new Object();\n bucket.absQuarter = i;\n bucket.quantity = 0;\n bucket.actions = [];\n objBuckets.push(bucket);\n }\n return objBuckets;\n}",
"bucketFor(name) {\n return hashBucket(this.hashFor(n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format surfshop data from datastore | function surfshopFromDS(obj) {
let surfshop = {};
let boards = false;
if ("boards" in obj && obj.boards != "") {
boards = [];
for (let board of boards) {
boards.push({"id": board, "self": `${obj.url}/boards/${board}`});
}
}
surfshop.id = obj.id;
surf... | [
"function reformatData(data, vendor){\n let price = data.price.toString();\n let link = data.link.toString();\n return {\"Vendor\":vendor, \"Price\":price, \"Link\":link};\n}",
"getShoe(save) {\n if (save == null)\n return null;\n let shoe = _.cloneDeep(save)\n let base = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Intercept links within tabs to open the appropriate tab and jump to the anchor point | function setupLinkInterceptsInTabs() {
if (anchorToJumpTo.length > 0) {
// Jump to the required anchor
var anchorElement = $('[name="'+anchorToJumpTo+'"]');
$("html,body").scrollTop( anchorElement.offset().top);
anchorToJumpTo = "";
}
$(".tabLink").click(function() {
var href = $(this).attr("href");
v... | [
"function gotoTab() {\n let url_string = window.location.href;\n let url = new URL(url_string);\n let tab = url.searchParams.get(\"open\");\n // console.log('url', tab);\n if (tab) {\n // console.log('has tab');\n let idName = '#' + tab;\n let idTabName = idName + 'Tab';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a semicolonenclosed block of statements, handling `"use strict"` declarations when `allowStrict` is true (used for function bodies). | function parseBlock(allowStrict) {
var node = startNode(), first = true, oldStrict;
node.body = [];
expect(_braceL);
while (!eat(_braceR)) {
var stmt = parseStatement();
node.body.push(stmt);
if (first && allowStrict && isUseStrict(stmt)) {
oldStrict = strict;
setStrict... | [
"function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\n\tif (tempDesc == ' print' || tempType == 'identifier' || tempType == 'type' || tempDesc == ' while' || tempDesc == ' if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to verify if the key pressed is a numeric key | function isNumericKeyCode(keyCode){
return (event.keyCode >= 48 && event.keyCode <=57)
||(event.keyCode >= 96 && event.keyCode <= 105)
} | [
"function ValidateSpecialAndNumeric(e) {\n var key = window.event ? e.keyCode : e.which;\n var text = String.fromCharCode(event.keyCode);\n var unicodeWord = RegExSpecialAndNumeric();\n if (unicodeWord.test(text)) {\n return true;\n }\n else {\n return false;\n }\n return true;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief Calculates steady state flame duration (min+1) of the toching trees \param species Species label of the torching trees \param dbh Dbh of the torching trees (in+1) \param trees Number of torching trees \return Flame duration (min+1) of torching trees | function torchingTreesSteadyFlameDuration (species, dbh, trees) {
return TorchingSteadyFlame[species].duration[0] * Math.pow(dbh, TorchingSteadyFlame[species].duration[1]) * Math.pow(trees, -0.2)
} | [
"function torchingTreesSteadyFlameHeight (species, dbh, trees) {\n return TorchingSteadyFlame[species].height[0] * Math.pow(dbh, TorchingSteadyFlame[species].height[1]) * Math.pow(trees, 0.4)\n}",
"function torchingTreesFirebrandHeight (treeHt, flameHt, flameDur) {\n const parms = [{\n a: 4.24,\n b: 0.332... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the TARGETED_DEVICE_FAMILY string given a list of target device names. | function targetedDeviceFamily(deviceNames) {
return deviceNames.map(function (deviceName) {
return appleDeviceNumber(deviceName);
}).join(",");
} | [
"function applePlatformName(targetOSList, platformType) {\n return applePlatformDirectoryName(targetOSList, platformType).toLowerCase();\n}",
"function targetDevices(targetOS) {\n for (var key in _platformDeviceMap) {\n if (targetOS.contains(key))\n return _platformDeviceMap[key];\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds default primary key to fields list if there's no primary key specified | _addDefaultPrimaryKey() {
var isFined = false;
_each(this.fields, field => {
if (field['decorators'] === 'primaryKey()') {
isFined = true;
}
});
if (!isFined) {
this.fields.unshift({
property: 'id',
deco... | [
"function createEmptyPkField(id, fieldName, columnName) {\n return createNewField({\n _id: id,\n fieldName: fieldName,\n columnName: columnName,\n id: true, \n nullable: false, \n type: 'integer',\n d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set click event to HamburgerIcon. | setEventToHamburgerIcon() {
document.getElementById("hamburgerIcon").addEventListener("click", () => {
let res = document.getElementById("myTopnav");
if (res.className === "huge-topnav") {
res.className += " responsive";
} else {
res.className... | [
"function handleBurgerMenu() {\n // console.log('`handleBurgerMenu` ran')\n $('.hamburger').on('click', function(event) {\n $('.navbar').toggleClass('menu-open')\n })\n}",
"function addIconClickListener(callBack) {\n browserAction.onClicked.addListener(callBack);\n}",
"static openBarMenu(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
; Gets a commaseparated string listing the types of events that were expected. / public | function get$expectedEventTypes()/* : String*/
{
var eventTypes/* : String*/ = "";
for ( var i/*: uint*/ = 0; i < this._expectedEventTypes$_LKQ.length; i++ )
{
eventTypes +=AS3.as( this._expectedEventTypes$_LKQ[ i ], String);
if ( i < this._expectedEventTypes$... | [
"function get$dispatchedExpectedEventTypes()/* : String*/\n {\n var eventTypes/* : String*/ = \"\";\n\n for ( var i/*: uint*/; i < this._dispatchedExpectedEvents$_LKQ.length; i++ )\n {\n var event/* : Event*/ =AS3.as( this._dispatchedExpectedEvents$_LKQ[ i ], flash.events.E... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the node is an embedded view, traverses up the view tree to return the closest ancestor view that is attached to a component. If it's already a component node, returns itself. | function getClosestComponentAncestor(node) {
while (node.type === 2 /* View */) {
node = node.view.node;
}
return node;
} | [
"elementFromNode(node) {\n let part = this.nodes2parts[node.uuid];\n // one of many hacks to handle circular constructs, this returns the ID for the initial block\n // which we assume is the circular block itself when given the id for the end cap.\n if (part === Layout.backboneEndCapId) {\n invaria... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Locates the component within the given LView and returns the matching index | function findViaComponent(lView, componentInstance) {
const componentIndices = lView[TVIEW].components;
if (componentIndices) {
for (let i = 0; i < componentIndices.length; i++) {
const elementComponentIndex = componentIndices[i];
const componentView = getComponentLViewByIndex(el... | [
"_getColumnIndex(subCtrlName) {\n\t\tfor (let i = 0; i < this.props.control.subControls.length; i++) {\n\t\t\tif (this.props.control.subControls[i].name === subCtrlName) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"getColumnIndex(): number {\n const { row, cell } = this;\n const ce... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actualiza el 'x' e 'y' del jugador sumando el 'desplazamiento x' y 'desplazamiento y' respectivamente. | actualizarXY(){
this.x += this.desplX;
this.y += this.desplY;
return true;
} | [
"function movimentaBolinha(){\n xbolinha += velocidadeXbolinha;\n ybolinha += velocidadeYbolinha;\n}",
"function pitagoroTeorema (x, y) {\nvar rezultatas = ( x * y ) + ( y * y);\n console.log(\"Ilgoji trikampio kraštinė:\", rezultatas);\n}",
"function sukeistiMasyvoElementus(x,y) {\n let isimenamx = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fires an info toast message. | showInfoToast(title = 'Info', message = '') {
this.showToast(title, message, 'info');
} | [
"function displayInfo (message, type) {\n alert(message)\n }",
"info() {\n return this._send(format.apply(this, arguments), SysLogger.Severity.info);\n }",
"function showToastMessage() {\n const toast = localStorage.getItem('showToast');\n if (localStorage.length <= 0) return;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new array, given: array, min index, max index | function myFunction(array, min, max) {
var newArray = [];
for (var i = min - 1; i < max && i < array.length; i++) {
newArray.push(array[i]);
}
return newArray;
} | [
"function filterBetween(array, min, max){\n if(\n Array.isArray(array) &&\n typeof min == 'string' &&\n typeof max == 'string'\n ){\n let newArr = array.concat(min, max).sort()\n let startSlice = newArr.indexOf(min) + 1\n let endSlice = newArr.indexOf(max)\n\n return newArr.slice(startSlice, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If there are any pending deletes for the seek buffer, this will rotate through them and delete them | cleanSeekBuffer()
{
if (this._pendingSeekDeletes.length > 0)
{
var pending = this._pendingSeekDeletes.shift();
this.deletePendingSeeks(pending.delete_range);
}
} | [
"resetOnDemandBuffer()\n {\n const video = this.playBuffer();\n this._pendingOnDemandDeletes = [];\n for (var rangeIdx = 0; rangeIdx < video.buffered.length; rangeIdx++)\n {\n let start = video.buffered.start(rangeIdx);\n let end = video.buffered.end(rangeIdx);\n this.deletePendingOnDema... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inside upload dir the files are organized in /year/month directories | function getRelPathInsideUploadDir(){
return new Date().getFullYear()+'/'+(new Date().getMonth() + 1)
} | [
"function get_full_file(month) {\n\n //\n // Get the fullpath and append \".txt\"\n //\n return path.resolve(__dirname, '../tmp/' + month + '-wet.paths.gz.txt');\n\n}",
"function getImagesByDate(day) {\n document.getElementById(`images-show${day}`).innerHTML = '';\n let directoryPath = path.join... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return an array containing all the `id` property of the `assignedIssue` property for each issue with an `assignee` property that is not `null` | get withAssignee() {
return issues.filter(obj => obj.assignee !== null)
.map(obj => obj.id);
} | [
"function getAssignmentDetails (arr) {\n var arrOut = []\n arr.forEach(element => {\n arrOut.push(element.id)\n })\n return arrOut\n}",
"get withPullRequest() {\n return issues.filter(obj => obj.pull_request !== undefined\n && obj.pull_request !== null)\n .map(obj => obj.id);\n }",
"get ids()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to return text for the iteration number | function get_iteration_number_text(current, max_iter = null) {
let iteration_str = "Iteration " + current;
if (max_iter !== null && max_iter !== undefined) {
iteration_str += " of " + max_iter;
}
return iteration_str;
} | [
"function outputText(){\n for(let i = 1; i <= 5; i++){\n if(i >= 2){ console.log(`There are ${i} bottles of beer on the wall`);}\n if(i < 2){ console.log(`There is ${i} bottle of beer on the wall`);}\n }\n \n}",
"function Counting(){\n for(var i=1; i<=100; i++){\n if(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
post route required data: pizza_id, quantity, size. Token optional data as none | post(req,callback){
//check incoming data
var pizza_id = typeof(req.body.pizza_id) == "string" && req.body.pizza_id.trim().length > 0 ? req.body.pizza_id.trim() : false;
var quantity = typeof(req.body.quantity) == "number" && req.body.quantity > 0 ? req.body.quantity : false;
var size = ... | [
"function addPlat(name, description, price, restaurant_id) {\n\n params = `name=${name}&description=${description}&price=${price}&restaurant_id=${restaurant_id}`;\n\n let maRequete = new XMLHttpRequest();\n\n maRequete.open('POST', 'http://localhost:8888/frameworkPooRest-pm/index.php?controller=plat&task=c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles a key, value pair to put in the selector document if the value is an object | function populateDocumentWithObject (document, key, value) {
const keys = Object.keys(value);
const unprefixedKeys = keys.filter(k => k[0] !== '$');
if (unprefixedKeys.length > 0 || !keys.length) {
// Literal (possibly empty) object ( or empty object )
// Don't allow mixing '$'-prefixed with non-'$'-pre... | [
"function populateDocumentWithKeyValue (document, key, value) {\n if (value && Object.getPrototypeOf(value) === Object.prototype) {\n populateDocumentWithObject(document, key, value);\n } else if (!(value instanceof RegExp)) {\n insertIntoDocument(document, key, value);\n }\n}",
"function insertIntoDocum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the winning cells (in outer form) | function getWinning() {
let result = ''
if (game.winner != PLAYER_NONE) {
const winning = findTriplet(game.board[game.winner], 15)
for (let w = 0; w < winning.length; ++w) {
winning[w] = game.board[game.winner][winning[w]]
}
for (let m = 0; m < CELLS; ++m) {
... | [
"function checkRowForWin() {\n var i, totalCount = 1;\n var leftSideComplete = false;\n var rightSideComplete = false;\n var cells = [];\n var row, col;\n \n for(i = 1; i < _config.col; i++){\n \n if (_config.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes the invisible recaptcha. Does nothing if component's size is not set to "invisible". | execute() {
if (this.size !== "invisible") {
return;
}
if (this.widget != null) {
this.grecaptcha.execute(this.widget);
}
else {
// delay execution of recaptcha until it actually renders
this.executeRequested = true;
}
} | [
"function HideGoogleRecaptchaDiv() {\n\t\trecaptchadiv.style.visibility = 'hidden';\n\t\trecaptchadiv.style.display ='none';\n\t}",
"resizeBotIfUserInputHidden() {\n this.characterContainer.classList.add(\"hide\");\n if (this.botIntegrationContainer.classList.contains('container-show')) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set height of container to the height of the active slide | function autoHeight(activeSlide) {
var slideHeight;
slideHeight = activeSlide.offsetHeight;
console.log('active slide height: ', slideHeight);
zwiperContainer.style.height = slideHeight + 'px';
} | [
"function setSlidesHeight() {\n let tallest = 0;\n\n $.each(self.find('.walkthrough__slide'), function () {\n tallest = $(this).height() > tallest ? $(this).height() : tallest;\n });\n\n $('.walkthrough__slide').css('height', tallest);\n }",
"function slideContentHeight() {\n var contentHei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the maps static URL for the currently displayed map | getStaticUrl() {
var staticMapUrl = "https://maps.googleapis.com/maps/api/staticmap?" +
this.defaultOptsString + "&" +
this.centerString + "&" +
this.zoomString + "&" +
this.runPathString + "&" +
this.markerString;
return staticMapUrl;
} | [
"initStaticMapStrings() {\n this.defaultOptsString = \"size=1168x480&maptype=roadmap\";\n }",
"function generateMap() {\n\t\t$('#koi-deeplink-root').extractDeeplinkIdentifiers();\n\n\t\tvar initializing = true;\n\n\t\tmapGenerated = true;\n\t\t\n\t\t$.address.history(use_history);\n\n\t\t$.address.init(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Library Create a repository for custom type detection. ```js var lib = new type.Library; ``` | function Library() {
if (!(this instanceof Library)) return new Library();
this.tests = {};
} | [
"static registerType(type) { ShareDB.types.register(type); }",
"createLibrary(event) {\n const controller = event.data.controller;\n InputDialog.type = 'createLibrary';\n const dialog = new InputDialog((input) => {\n if (null == controller.createLibrary(input)) {\n I... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nsAbCard.idl attribute AUTF8String directoryId; | get directoryId()
{
return this._abCard.directoryId;
} | [
"get uuid()\n\t{\n\t\treturn this._abCard.uuid;\n\t}",
"generateId() {\n const newId = `dirId-${Directory.nextId}`;\n Directory.nextId++;\n return newId;\n }",
"function jsDAV_Directory() {}",
"getID() {\r\n return this.id.toString().padStart(3, '0');\r\n }",
"get diskId() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initalize the color database. The Color picked related functions. | function initColorDatabase()
{
this.colors = new Array("#F8F4FF", "#F3E5AB", " #FAEBD7", "#E52B50 ", "#960018", "#FE28A2", "#FF6FFF", "#FF69B4", "#FBAED2", "#F88379", "#A52A2A", "#C41E3A", "#C71585", "#B2
2222", "#E25822", "#AB4E52", "#800000", "#FF2400", "#722F37", "#E0115F", "#FF004F", "#915C83", "#65000B", "... | [
"function setupColorControls()\n{\n dropper.onclick = () => setDropperActive(!isDropperActive()) ;\n color.oninput = () => setLineColor(color.value);\n colortext.oninput = () => setLineColor(colortext.value);\n\n //Go find the origin selection OR first otherwise\n palettedialog.setAttribute(\"data-palette... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates one cart by parameter id from specified DB.Cart | function updateCart(req, res) {
DB.Cart.update({_id: req.params.id}, {$set: req.body}, {new:true}, (err, uCart) => {
if (err) { return console.log("index error: " + err); }
res.json(uCart);
});
}//end of updateCart() | [
"async function updateCart(cartId, sessionId, cart, callback) {\n\t//return await genericActions.updateById(baseUrl, property, cartId, sessionId, cart);\n\tgenericActions.updateById(baseUrl, property, cartId, sessionId, cart, function(res){\n\t callback(res);\n\t})\n}",
"function updateCart() {\n\tsaveFormChan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================= Funcion para actualizar una fila en la tabla ascensor_valores_pozo ============================================== | function updateItemsAscensorValoresPozo(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {
db.transaction(function (tx) {
var query = "UPDATE ascensor_valores_pozo SET n_calificacion = ?,"+
"v_calificacion = ?,"+
... | [
"function updateItemsAscensorValoresFoso(k_codusuario,k_codinspeccion,k_coditem, n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE ascensor_valores_foso SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that the site folder and index page exist. | function checkSite()
{
var path = "./public";
var ok = fs.existsSync(path);
if(ok) path = "./public/index.html";
if(ok) ok = fs.existsSync(path);
if(!ok) console.log("Can't find", path);
return(ok);
} | [
"function pageExists( title )\n{\n if (FILE.file_exists( pagePath( title ) ) || isSpecial( title ) ){\n return true;\n }else{\n return false;\n }\n}",
"function isSiteRootSane() {\n\tvar siteRoot = dw.getSiteRoot();\n\tvar folderSane = true;\n\n\t//Is site root defined?\n\tif (siteRoot != \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cmdTalk(talkTarget): This function is activated by a 'talk' command. It displays the dialogue of the chosen entity. | function cmdTalk(talkTarget)
{
// All entities are checked to see if they're a potential target for conversation.
var entTarget = checkEntityContext(talkTarget);
// If the target is found, display its dialogue and pass time.
if (entTarget >= 0) {
lookAtDialogue(entTarget);
passTime();
return;
}
// Otherwise... | [
"function sendMessage (target, context, message) {\r\n if (context['message-type'] === 'whisper') {\r\n client.whisper(target, message)\r\n } else {\r\n client.say(target, message)\r\n }\r\n}",
"function doom(target, context, params) {\r\n var thing = (context);\r\n\r\n if(params.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function 2: sends Spreadsheet in an email as a PDF reworked from ctrlq.org/code/19869emailgooglespreadsheetspdf | function emailAsPDF() {
// Send the PDF of the spreadsheet to this email address
var email = "someone@somewhere.gov.uk,someone@elsewhere.gov.uk";
// Gets the URL of the currently active spreadsheet
var ss = SpreadsheetApp.getActiveSpreadsheet();
var url = ss.getUrl();
url = url.replace(/edit$/,'');
// ... | [
"function createPdfs() {\n\n var ui = SpreadsheetApp.getUi()\n\n if (TEMPLATE_ID === '') { \n ui.alert('TEMPLATE_ID needs to be defined in code.gs')\n return\n }\n\n // Set up the docs and the spreadsheet access\n\n var templateFile = DriveApp.getFileById(TEMPLATE_ID)\n var activeSheet = SpreadsheetA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set move status to no move found | makeNoMoveStatus() {
this.currentMove = {
status: 'None',
from: { row: -1, column: -1 },
via: { row: -1, column: -1 },
to: { row: -1, column: -1 },
type: -1
};
} | [
"function resetFailedMoves() {\n failedMoves = 0;\n}",
"function clearMove(){\n for(var y; y < 8; y++){\n for(var x; x < 8; x++){\n if(state.board[y][x] === 'move'){\n state.board[y][x] = null;\n }\n }\n }\n}",
"function invalidMove(){\n\n }",
"function resetMoves() {\n moveCount... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
On signup show ADD btn | function signUp() {
$('#main-header').text("B-Day List");
$('#login-container').hide();
$('#logout-btn').removeClass('hide');
$('#add-btn').removeClass('hide');
} | [
"function handleShowSignUp() {\n $('body').on(\"click\", \"#js-show-sign-up-form-btn\", (event) => {\n displaySignUpForm($('.js-content'));\n });\n}",
"function RegisterClicked(){\r\n // set pwd length\r\n _registerControl.PLength(_pwdLength);\r\n // remember me\r\n var persist = false;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a random 64 bit integer returns a string due to JavaScript limitations | function randomInt64() {
var halfOne = crypto_1.randomBytes(4).readUInt32LE(0, true);
var halfTwo = crypto_1.randomBytes(4).readUInt32LE(0, true);
var str = "" + halfOne + halfTwo;
var len = str[0] === "9" ? 18 : 19;
return str.slice(0, len); // postgres max int64 == 9223372036854775808
} | [
"function generateUID() {\n return String(~~(Math.random()*Math.pow(10,8)))\n}",
"function random128() {\n var result = \"\";\n for (var i = 0; i < 8; i++)\n result += String.fromCharCode(Math.random() * 0x10000);\n return result;\n}",
"function getRandomNumber () {\n return String.fromCharCode(Math.f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |