query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
add a new option to select at a given index. | add (val, txt, i, attr) {
if (typeof val === "undefined") throw new Error("No value to add");
const O = this;
const opts = O.E.find('option');
const value = val;
let
text = txt,
index = i;
if (typeof txt === "number") { // .a... | [
"function AddOption(option, select){\n var newOption = document.createElement(\"option\");\n newOption.text= option;\n newOption.value = option;\n select.add(newOption);\n}",
"function AddOptionToSelect( select, option )\n{\n\ttry\n\t{\n\t\t// Standards-compliant\n\t\tselect.add( option, null );\n\t}\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ BROWSER DETECTION / NOTIFICATION PROCESS / Use JQuery.browser to test whether IE compatibility mode is turned on in IE9+ Use jQuery.support and Modernizr.js to determine baseline feature support, then write values to an array Use Jquery to write browser data to the notification div, then show it to those browsers who... | function browserDetectNotify() {
// Initialize vars:
// Message array
var message_legacy = '';
var legacy = '';
var compat = '';
/****************************************************************************/
// Use jQuery.support and Modernizr.js to determine feature support
// Run Modernizr first, because... | [
"function featureChecks() {\n\n // Browser compatiblity tests\n if (!Modernizr.websockets || !Modernizr.webworkers || !Modernizr.postmessage ||\n !Modernizr.canvas || !wsWwTest) {\n\n var notSupported =\n '<br><span class=\"glyphicon glyphicon-ban-circle text-danger\" aria-hidden=\"tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the list of nodes from a Template safely. In addition to removing nodes from the Template, the Template part indices are updated to match the mutated Template DOM. As the template is walked the removal state is tracked and part indices are adjusted as needed. div div1 (remove) < start removing (removing node is... | function removeNodesFromTemplate(template,nodesToRemove){const{element:{content},parts}=template;const walker=document.createTreeWalker(content,walkerNodeFilter,null,false);let partIndex=nextActiveIndexInTemplateParts(parts);let part=parts[partIndex];let nodeIndex=-1;let removeCount=0;const nodesToRemoveInTemplate=[];l... | [
"function removeNodesFromTemplate(template,nodesToRemove){const{element:{content},parts}=template,walker=document.createTreeWalker(content,walkerNodeFilter,null,!1);let partIndex=nextActiveIndexInTemplateParts(parts),part=parts[partIndex],nodeIndex=-1,removeCount=0;const nodesToRemoveInTemplate=[];let currentRemovi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function removes el from array arr | function removeArrayElement(arr,el) {
var r = new Array();
for (var i = 0; i<arr.length;i++) {
if(!(arr[i]==el))
r.push(arr[i]);
}
return r;
} | [
"function removeArrayElement(arr, element) {\n return arr.filter(e => e !== element)\n}",
"function delEl(e, array) {\n var newArr = [];\n for (var i = 0; i < array.length; i++) {\n if (e !== array[i]) {\n newArr[newArr.length] = array[i];\n }\n }\n return newArr;\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use to remove all the device info at once | function removeAllDeviceInfo() {
savedDeviceOptions = [];
actualBrowser.storage.local.set({"deviceOptions": []});
actualBrowser.runtime.sendMessage({data: JSON.stringify([]), subject: "deviceOptions"});
document.getElementById('deviceInfoList').getElementsByTagName('tbody')[0].innerHTML = "";
docume... | [
"function removeDeviceInfo() {\n var deviceProperty, element;\n element = document.querySelector(\"#deviceInfoList .selected td\");\n if (element !== null && element !== undefined) {\n deviceProperty = element.getAttribute(\"value\");\n savedDeviceOptions.splice(savedDeviceOptions.indexOf(dev... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the container is being pushed to the side by one of the drawers. | _isPushed() {
return (this._isDrawerOpen(this._start) && this._start.mode !== 'over') || (this._isDrawerOpen(this._end) && this._end.mode !== 'over');
} | [
"_isPushed() {\n return this._isDrawerOpen(this._start) && this._start.mode != 'over' || this._isDrawerOpen(this._end) && this._end.mode != 'over';\n }",
"_isPushed() {\n return (this._isDrawerOpen(this._start) && this._start.mode != 'over') ||\n (this._isDrawerOpen(this._end) && this._end.m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if provided value is a valid URL string. Copied from | static valid_url(value) {
if (!value) return false;
// check for illegal characters
if (/[^a-z0-9:/?#[\]@!$&'()*+,;=.\-_~%]/i.test(value)) return false;
// check for hex escapes that aren't complete
if (/%[^0-9a-f]/i.test(value)) return false;
if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) retur... | [
"function verifyUrl(value) {\n try {\n new URL(value);\n return true;\n } catch (_) {\n return false;\n }\n}",
"verifyUrl(value) {\n try {\n new URL(value);\n return true;\n } catch (_) {\n return false;\n }\n }",
"verifyUrl(value) {\n try {\n new URL(value... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register setters for capabilities. | registerCapabilities() {
this.registerMultipleCapabilityListener([ Capabilities.TARGET_TEMP ], this.onSetTargetTemperature.bind(this), DEBOUNCE_RATE);
this.registerMultipleCapabilityListener([ Capabilities.CLOCK_PROGRAMME ], this.onSetClockProgramme .bind(this), DEBOUNCE_RATE);
this.registerMultipleCa... | [
"function buildSetters(capability) {\n const { setters } = capability;\n\n if (!setters) return [];\n\n return setters\n .sort((a, b) => a.name.localeCompare(b.name))\n .map(setter => {\n const functionName = snakeCaseToCamelCase(setter.name);\n\n const properties = [\n ...(setter.mandator... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mobile// set to toggle between dollars and watts on click | function clickToggleWattsDollars( jqueryObj, watts ){
jqueryObj.clickToggle(function(){
$(this).text(convertWattsToDollars(watts));
},
function(){
$(this).text(watts + ' watts');
}
);
} | [
"function toggleFuel(btn) {\n\tmaxFuel = (maxFuel == 100 ? 0 : (maxFuel == 0 ? 50 : 100));\n\tfuel = maxFuel;\n\tbtn.text = \"Fuel: \" + maxFuel + '%';\n}",
"function mobileDown() {\n if (snakeDiraction != 'u') {\n snakeDiraction = 'd';\n }\n}",
"function toggleUnits() {\n if (countryUnits =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Everytime a letter key is pressed we need to update the keypress_stack, which will then be used to set the current value of our select component. We first check whether the last update was less than a second ago and append the new character to the end of the stack in case the user pressed another letter key less than a... | updateKeypressStackWithChar(c, time=Date.now()) { // time as an optional argument used here to simplify testing
if(this.keypress_stack_last_updated < time-this.keypress_stack_timeout) {
this.keypress_stack_last_updated = time;
this.keypress_stack = c;
} else {
this.keypress_stack += c;
}
... | [
"function addNextChar(){\n\n currentKeycode = log[index][0]; //integer keycode\n strArrayIdx = log[index][1]; //idx of next insertion\n strArrayIdxEnd = log[index][2]; //ending idx of selection\n var strArrayChar = keyCodeMap[log[index][0]] //value of next i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor of arbitraryprecision decimals | function Decimal(number) {
if (number === undefined || number === null) {
throw new TypeError('Decimal constructor() missing arguments');
}
if (number.constructor === Decimal) {
return number;
}
if (typeof number !== 'object') {
number = Decimal.parse(String(number));
}
if (number.sequence.eve... | [
"newZero() {\n let ret = new Decimal(\"0\");\n ret.precision = this.precision;\n return ret;\n }",
"function DecimalNumber(num,precision){if(typeof(precision)=='undefined'){precision=0;};if(typeof(num)=='undefined'){num='0';};this.getPi=function(precision){if(precision>37){alert('Note: this approximatio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Crea 16 lineas random y las asigna | set_random_lines() {
let lista = [];
let lineas = [];
for (let index = 0; index < 16; index++) {
let width = Math.random() * (this.canvas.width - 50) + 20;
let height = Math.random() * (this.canvas.height - 50) + 20;
let line = new Object();
line.x... | [
"function generateLine () {\n for (let x = 0; x < Matrix.size; x++) {\n line[x] = Matrix.RND(64, 255)\n }\n}",
"function drawRandomLines1() {\r\n\t\tctx.beginPath();\r\n\t\tctx.moveTo(x,y);\r\n\t\tctx.lineTo(x + 100, H-y-100);\r\n\t\tctx.stroke();\r\n\t}",
"function generateRandomLine() {\n return types... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get exercise from Lessons Database | function getExerciseEntriesFromLessons(){
console.log("Getting Exercise Entries for lesson Page " + lessonID);
dbShellLessons.transaction(function(tx){ // put teacher_id also
tx.executeSql("select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\
exercise... | [
"function getExercises() {\n\t\t\t\treturn Exercise.query().$promise.then(function(results) {\n\t\t\t\t\treturn results;\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}",
"async get(id) {\n const data = conn.query(\"SELECT * FROM Fit_Exercises WHERE id=?\", id);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
De volgende functie zorgt ervoor dat wanneer je op de knop "ja" klikt, er een tekst in beeld verschijnt die aangeeft hoeveel slokken je mag uitdelen. De hoeveelheid slokken wordt bepaald met een randomizer. | function jaa() {
var getal = Math.random() * 8;
var cijfer = Math.floor(getal);
document.getElementById("tekst").innerHTML = "Goedzo! U mag " + cijfer + " slokken uitdelen";
/*De volgende regel code zorgt ervoor dat wanneer er op de knop "ja" wordt geklikt, de p in de html groen wordt. Want als je op j... | [
"function generateRandom(){\n\t\tindex = Math.floor(Math.random()*Object.keys(current_dict).length);\n\t\tenglishKey = Object.keys(current_dict)[index];\n\t\tspanishValue = current_dict[englishKey]\n\t\t$(\"#inputword\").text(spanishValue);\n\t\tconsole.log(englishKey);\n\t}",
"function generate(){\n var r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
works by only counting multiples of 10 when iterating through. It gets tricky when you reach hundreds, 100 => 2 zeroes | function countZero(n){
var count = 0;
while(n>0){
count += Math.floor(n/10);
n = n/10;
}
return count;
} | [
"function fill_by_zeros(integer, zeros_count){\n return integer - (integer % (Math.pow(10,zeros_count)))\n}",
"function generateTwentyToZero(){\n var array = [];\n for(var i = 20; i >= 0; i--){\n array.push(i);\n }\n return array;\n}",
"function number9(n){\n let count = 0;\n for (let i = 1; i <= n;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dispose of the MasterPlaylistController and everything that it controls | dispose() {
this.masterPlaylistLoader_.dispose();
this.audioTracks_.forEach((track) => {
track.dispose();
});
this.audioTracks_.length = 0;
this.mainSegmentLoader_.dispose();
this.audioSegmentLoader_.dispose();
} | [
"dispose() {\n this.masterPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n\n this.audioSegmentLoader_.dispose();\n }",
"dispose() {\n this.trigger('dispose');\n this.decrypter_.terminate();\n this.mainPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n if (t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Code derived from Sorts the entries of a list of entries by the date created, Newest first. | function sortEntriesNewest(entries){
// Comparison function for sort
var date_sort = function (entry1, entry2) {
var date1 = Date.parse(entry1.dateAdded);
var date2 = Date.parse(entry2.dateAdded);
if (date1 > date2) return -1;
if (date1 < date2) return 1;
return 0;
};
console.log("sort newest");
entries... | [
"function sortEntriesOldest(entries){\n\t// Comparison function for sort\n\tvar date_sort = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAdded);\n\t\tvar date2 = Date.parse(entry2.dateAdded);\n\t\tif (date1 > date2) return 1;\n\t\tif (date1 < date2) return -1;\n\t\treturn 0;\n\t};\n console.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a timestamp from the log files and return a moment object. | function parseTimestamp(str)
{
var ts = new moment(str, "DD.MM.YYYY HH:mm:ss.SSS");
if(!ts.isValid())
return moment.unix(0);
return ts;
} | [
"function parseTimestamp(ts) {\n return moment.unix(ts.split('.')[0]).format(\"DD/MM/YYYY HH:MM:ss\");\n}",
"function unixToMoment(timestamp) {\n return moment(timestamp);\n}",
"function parseTimestamp(timestamp)\n{\n var res = /(\\d{4})\\/(\\d{2})\\/(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2}).(\\d{6})/.exec(times... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tamanho randomico do mosquito | function tamanhoAleatorio() {
let classe = Math.floor(Math.random() * 3)
switch(classe) {
case 0:
return 'mosquito1'
case 1:
return 'mosquito2'
case 2:
return 'mosquito3'
}
} | [
"function tamanhoAleatorio() {\n\tvar classe = Math.floor(Math.random() * 3)\n\n\tswitch(classe){\n\t\tcase 0:\n\t\t\treturn 'mosquito1'\n\t\tcase 1:\n\t\t\treturn 'mosquito2'\n\t\tcase 2:\n\t\t\treturn 'mosquito3'\n\t}\n}",
"function tamanhoAleatorio() {\n var classe = Math.floor(Math.random() * 3); // tamanho ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_ESAbstract.GetPrototypeFromConstructor / global Get, Type 9.1.14. GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto ) | function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { // eslint-disable-line no-unused-vars
// 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prot... | [
"function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { // eslint-disable-line no-unused-vars\n\t// 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic object. The corresponding object must be an intrinsic that is intended to be used as the [[Prot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The tile the current creature is on | getCreatureTile() {
return this.creatureTile;
} | [
"getCurrentTile() {\n return this.tile;\n }",
"get tile() {\n return this.m_tile;\n }",
"get tile()\n {\n if (typeof this.tileDefinition === 'undefined')\n return undefined;\n else\n return this.world.tileset.getByArray(this.tileDefinition, this);\n }",
"function tile(t, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given any part of the messageobj hierarchy, pull out the contentobject uses ducktyping to find the content | function toMsgContent (obj) {
if (!obj)
return null
if (obj.value && obj.value.content && obj.value.content.type)
return obj.value.content
if (obj.content && obj.content.type)
return obj.content
return obj
} | [
"function chewStructure(msg) {\n // imap.js builds a bodystructure tree using lists. All nodes get wrapped\n // in a list so they are element zero. Children (which get wrapped in\n // their own list) follow.\n //\n // Examples:\n // text/plain =>\n // [{text/plain}]\n // multipart/alternative wi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract the text from the specified node EXCLUDING the innernode text | function atText(node) {
var elem = node.cloneNode(true);
for (var i = elem.childNodes.length - 1; i >= 0; i--) {
if (elem.childNodes[i].tagName) elem.removeChild(elem.childNodes[i]);
}
return elem['innerText' in elem ? 'innerText' : 'textContent'];
} | [
"extractTextContent(node) { return ''; }",
"function extractText(tree) {\n return tree.node.texts().join(' ').trim();\n }",
"function extractInnerText(tree) {\n return tree.node.text;\n }",
"function getText(node) {\n\n\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\treturn node.data;\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init sign up button | function _init_sign_up_button(){
try{
var sign_up_button = Titanium.UI.createButton({
top:(self.screen_height/2)+100,
title:'Sign-up',
width:160... | [
"function signUp(){\n\t}",
"function onSignUp() {\n\t\tSignUp.init( $content, ref );\n\t}",
"function handleSignUp(e) {\n setVisible(false);\n setSignUp('true');\n }",
"function signupHandler() {\n setDisplayMenu(false);\n setDisplaySignup(true);\n setDisplayLogin(false);\n setDimOverlay(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encapsulates getUnparsedData, which contains the translated lines | function getTranslatedLines(){
return getUnparsedData("/data/GhostChanceEnglish.xml");
} | [
"function parseGettext(locale, data, options = {}) {\n const out = {\n charset: 'utf-8',\n headers: {\n 'project-id-version': options.project || 'i18next-conv',\n 'mime-version': '1.0',\n 'content-type': 'text/plain; charset=utf-8',\n 'content-transfer-encoding': '8bit'\n },\n trans... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private helper for topologically sorting all nodes marked Status.REACHABLE starting with the passed in nodes. Both nonpassive and passive children are considered in the sort order. Returns a topologically sorted array of nodes. | function topologicalSort(nodes) {
var result = [];
nodes.forEach(function(node) {
toposortDfs(node, result);
});
result.reverse();
return result;
} | [
"function sortNodes(nodes) {\n\n return nodes.sort(function (t1, t2) {\n return t1.start - t2.start;\n });\n }",
"sortedChildren() {\n // Project dependencies to current children\n const nodes = this.nodes;\n const projectedDependencies = projectDependencies(this.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Reviews from JSON into ES | async function loadReviews () {
const promises = []
reviews.forEach((review) => {
const record = {
index: config.get('esConfig.ES_INDEX'),
type: config.get('esConfig.ES_TYPE'),
id: review.id,
body: _.extend({ resource: 'review' }, review)
}
promises.push(esClient.create(record))
... | [
"static load(json) {\n RAG.state = Object.assign(new State(), JSON.parse(json));\n RAG.views.editor.generate();\n RAG.views.marquee.set(L.STATE_FROM_STORAGE);\n }",
"function loadView(viewObj) {\n var path = _loadedDocument.getViewablePath(viewObj);\n console.log(\"Loading view URN: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
process the robot instructions | processRobotInstructions(inputInstructions) {
let skip_instruction = false, over_the_edge = false, robot_position, input_instructions = inputInstructions.split('');
// loop through each instruction
for (let instruction of input_instructions) {
if (instruction == 'L' || instruction ==... | [
"completeMovementInstructions() {\n const instructions = this.instructions;\n instructions.forEach(instruction => {\n switch (instruction) {\n case \"L\":\n this.rotateLeft();\n break;\n\n case \"R\":\n this.rotateRight();\n break;\n\n case \"M\":\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
objectUser= Objeto con los datos a ingresar url= direccion con la consulta | function insertDataArray(objectUser, url) {
$.ajax({
type: "POST",
url: url,
contentType: "application/json; charset=utf-8",
traditional: true,
data: JSON.stringify(objectUser),
success: function (msg) {
if(msg){
console.log("objeto ingresado en BD suscriptores");
console.... | [
"function load_userObj(data) {\n userObj.id = data.id;\n userObj.email = data.email;\n userObj.nick = data.nick;\n userObj.name = data.name;\n userObj.role = data.role;\n}",
"function getUserObject() {\n\tvar user = {\n\t\t\"id\":elementAPI.user().data.id,\n\t\t\"first_name\":elementAPI.user().data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converting windows stack trace to posix and removing cwd C:\\project\\path\\features\\support/code.js becomes features/support/code.js | function normalizeExceptionAndUri(exception, cwd) {
return exception
.replace(cwd, '')
.replace(/\\/g, '/')
.replace('/features', 'features')
} | [
"function cleanExceptionStack(stack)\n{\n try\n {\n const shortPath = \"resource://flagfox/\";\n const longPath = ioService.newChannel(shortPath,null,null).URI.spec;\n return stack.replace(new RegExp(longPath,\"ig\"), shortPath);\n }\n catch (e)\n {\n return stack;\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a request to get the hit_config | function getHitConfig(callback_function) {
$.ajax({
url: '/get_hit_config',
timeout: 3000 // in milliseconds
}).then(
function(data) {
if (callback_function) {
callback_function(data);
}
}
);
} | [
"fetchConfiguration() {\n this._checkAndCreateClientIfNeeded()\n\n return get(\n this._httpClient,\n `${ENDPOINT}/deployments/${this.credentials.token}`,\n { credentials: this.credentials.token }\n )\n }",
"getConfiguration() {\n let url_ = this.baseUrl + \"/v1/BusinessRules/config... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function calculates the score for a word | function calculateScore(word) {
var strength = 1;
// Find letter strength
for (i = 0; i < word.length; i++) {
strength = strength * (gameState['strength'][
word.charAt(i)] + 1);
}
return (word.length * strength);
} | [
"static scoreWord(word) {\n //create letterScore\n const letterScore = {\n 'A' : 1,\n 'N' : 1,\n 'B' : 3,\n 'O' : 1,\n 'C' : 3,\n 'P' : 3,\n 'D' : 2,\n 'Q' : 10,\n 'E' : 1,\n 'R' : 1,\n 'F' : 4,\n 'S' : 1,\n 'G' : 2,\n 'T' : 1,\n 'H' ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set state of single element | function elSetState(el, state, highlightDigit) {
if (el) {
(state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);
}
} | [
"function setInternalState(element, name, value) {\n // TODO: Move all aspects from classes to attributes.\n if (name === \"selected\") {\n element.toggleAttribute(name, value);\n } else {\n element.classList.toggle(name, value);\n }\n if (\n element[internal.nativeInternals] &&\n element[internal.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the global event list by reading from the events of all CalendarDays. | function updateEventList(dayList) {
let newEventList = [];
dayList.forEach((day) => {
day.eventList.forEach((obj) => {
newEventList.push(obj);
});
});
return newEventList;
} | [
"function loadCalendarEntries() {\n calendarEntries = [];\n gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'showDeleted': false,\n 'singleEvents': true,\n 'orderBy': 'startTime'\n }).then(function(response) {\n let events = response.result.items;\n\n events.forEach(function(eve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. Create a function that takes voltage and current and returns the calculated power. | function circuitPower(voltage, current) {
var Power = voltage * current;
return Power;
} | [
"function circuitPower(voltage, current) {\n return voltage * current \n}",
"function circuitPower(voltage, current) {\n return voltage * current;\n}",
"get power() { return this.voltage * this.current; }",
"function calcVoltage(val){\n\n var factor = 1.211*8.4;\n return factor * val;\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assemble string used for origins parameter of google Distance Matrix API call | function getOriginsString(inputData){
return inputData.address1.coordinates.lat + ',' +
inputData.address1.coordinates.lng + '|' +
inputData.address2.coordinates.lat + ',' +
inputData.address2.coordinates.lng;
// if it becomes useful to query using a single address,
// c... | [
"function getMapURL (coords) {\n\t\treturn [\n\t\t\t'https://maps.googleapis.com/maps/api/staticmap?center=' + coords,\n\t\t\t'zoom=4',\n\t\t\t'size=600x400',\n\t\t\t'scale=2',\n\t\t\t'format=jpg',\n\t\t\t'maptype=satellite',\n\t\t\t['markers=size:mid','color:red','label:A', coords].join('%7C'),\n\t\t\t'key=AIzaSyC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
keep returning the same promise until autosave fires resolve/reject autosave when debounce finally runs & save is complete | function autosave(...args) {
function wait() {
const pending = new Promise((resolve, reject) => {
let canRun = true
emitter.emit('start', ...args)
// warn user if changes not yet saved
function reset() {
canRun = fa... | [
"save() {\n // Perform the save\n let doSave = async () => {\n let promises = this.savePending;\n delete this.savePending;\n\n // Save the cache and resolve all pending promises\n await this.saveDeferred();\n for (let promise of promises) promise.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is called of control is attached to the dom. | __attach(){TCHMI_DESIGNER||this.__parent||"TcHmi.Controls.System.TcHmiView"===this.__type||this.__element[0].classList.contains("tchmi-in-topmostlayer")||TCHMI_CONSOLE_LOG_LEVEL>=1&&e.Log.error("[Source=Control, Module=TcHmi.Controls.System.TcHmiControl, Id="+this.getId()+"] Missing logical parent.\nIf the control was ... | [
"function appendControlToDOM() {\n publicApi.remove();\n\n // append a fresh copy of the buttons\n $(publicApi.$attachToThisElement).append(renderTemplate());\n // and keep a reference to the dom object for further operations later on.\n publicApi.$element = publicApi.$attachToThisElement.parent().fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================================================== from functions/system/CurrentProcessMilliseconds.java =================================================================== Needed early: Builtin Needed late: Rational | function CurrentProcessMilliseconds() {
} | [
"function getProcessTime() {\n var preciseTime = process.hrtime();\n return (new decimal_js_1.Decimal(preciseTime[0])).times(\"1e+9\").add(preciseTime[1]);\n}",
"getMilliseconds() {\n let currentMilliseconds = window.performance.now();\n return currentMilliseconds - this.startMilliseconds;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a Maintenance object to the blockchain state identifited by the maintenanceId | async RegisterMaintenance(stub, maintenanceId) {
let maintenance = {
id: maintenanceId,
type: 'maintenance',
};
await stub.putState(maintenanceId, Buffer.from(JSON.stringify(maintenance)));
// add maintenanceId to 'maintenance' key
let data = await stub.... | [
"async maintenance(opts) {\n opts = utils.normalizeKeys(opts);\n opts = utils.defaults(opts, this.consul._defaults);\n\n const req = {\n name: \"agent.service.maintenance\",\n path: \"/agent/service/maintenance/{id}\",\n params: { id: opts.id },\n query: { enable: opts.enable },\n };... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an authorized row. In this case only an email is displayed. Will first check that this is a valid email. Then will check that the email is not already in the current or new users. | function add_auth_row() {
var newEmail = $("#new_auth_user").val().trim();
if (!validateEmail(newEmail)) {
alert("The email provided is not in a valid format");
return;
}
if (checkForDuplicates(newEmail)) {
alert("This email is already listed as an authorized user.");
return;
}
$("#n... | [
"function add_row(email, key, link) {\n\n var $row = $key_table.find('tr[data-template]').clone();\n\n $row.removeAttr('data-template');\n $row.attr('data-email', email);\n $row.find('[data-user-email]').text(email);\n $row.find('[data-user-link]').text(link).attr('href', link);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Policy Approver and Assign to Change Approval | function beforeSubmit(context) {
var newApproval = context.newRecord;
// On Create
if(context.type === context.UserEventType.CREATE) {
// Get the change type
var approvalChangeType = newApproval.getValue({fieldId: 'custrecord... | [
"function getPolicyApprovers(changeType) {\r\n var policyApprovers = [];\r\n\r\n // Get the default Policy Approver record\r\n var mySearch = search.create({\r\n type: 'customrecord_change_approval_policy',\r\n columns: ['custrecord_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saveSituation Stores a situation in CouchDB Returns 404 if thing or situation template are not found Returns 504 if CouchDB does not respond | function saveSituation(req, res){
//check if referenced id of thing exists
queryThingAndTemplate(req.body.thing,
req.body.situationtemplate, function(doc){
//console.log(doc);
if (doc[0] == null){
insertDocument(req.body,req.body.situationtemplate, function() {
checkCallbacks(req.body);
res.json... | [
"function saveThing(req, res){\n var document = req.swagger.params.body.value;\n //console.log(req.body.id);\n //validateGeoJSON(req.body.location, function(valid){\n db.collection('Things').find({name: document.name}).count(function (error, count) {\n if (count != 0) {\n res.statusCod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subfunction to simplify character update for all novels in save | function updateAllCharacters(save, fn) {
_.forEach(save, (character_list, novel_id) => {
if (novel_id == "_info")
return ;
save[novel_id] = character_list.map((character) => fn(character));
});
} | [
"function saveCharacterEdits(){}",
"function dbUpdateCharacters() {}",
"function updateCharacters(ch, el) {\n //TODO refactor function\n for(var i = 0; i < el.length; i++) {\n\tdocument.getElementsByClassName('char_name')[i].innerHTML=ch[i]['sheet']['name'];\n\tdocument.getElementsByClassName('init_roll')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the count of all the possible numbers (16) If one number has a count of at least 3 it returns the dice sum in 3 of a kind If one number has a count of at least 4 it returns the dice sum in 4 of a kind | function threeFourKind(number){
var count1 = 0;
var count2 = 0;
var count3 = 0;
var count4 = 0;
var count5 = 0;
var count6 = 0;
for (var i = 0; i < diceArray.length; i++) {
if (diceArray[i] === 1) {
count1++;
}
if (diceArray[i] === 2) {
count2++;
}
if (diceArray[i] === 3) ... | [
"function solution(number){\n // I need to collect all the numbers between 1 and the given number in an array\n let allNumbers = [];\n // This will collect the sum of the numbers found inside the allNumbers array that fit the criteria\n let divNumbers = 0;\n // first I need to collect the numbers\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the output file path for a given source via the "outFile" config option; returns an absolute path. | function getOutFile(source, outFile) {
let resolvedOutFile = outFile;
if (isFile(source)) {
// dynamic output; run the given iterator function on each source
if (typeof outFile === 'function') {
resolvedOutFile = outFile(source);
}
// output is a directory; append t... | [
"function getOutputDirForSourceFile(context, sourceFile) {\n const { tsInstance, emitHost, outputFileNamesCache, compilerOptions, tsInstance: { getOwnEmitOutputFilePath, getOutputExtension }, } = context;\n if (outputFileNamesCache.has(sourceFile))\n return outputFileNamesCache.get(sourceFile);\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the Spoofax code according to the incoming MPS edit | handleSpoofaxEdit(data)
{
console.log("Incoming Spoofax edit: ", JSON.stringify(data));
switch (data["opType"])
{
case "SetPropertyOp":
var lineArr = this.spoofaxData["model_0.dsl"].split('%0A');
lineArr[data["lineIndex"]] = data["text"];
... | [
"function setModVox(pos,code) {\n // set locally\n client.modvoxes[pos.join('|')] = code\n // send remotely\n client.connection.emit('modvox',pos,code)\n }",
"_changePincode(evt) {\n console.log(\"inside RegisterForm >>> changepincode >>> pincode \"+evt.target.value)\n var newState = this._merg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
No servers are available so send some simple JavaScript to the client to make it retry after a short period of time. | function sendRetryResponse(res) {
res.send(`All ${cirrusServers.size} Cirrus servers are in use. Retrying in <span id="countdown">10</span> seconds.
<script>
var countdown = document.getElementById("countdown").textContent;
setInterval(function() {
countdown--;
if (countdown == 0) {
window.location.relo... | [
"function retryCountdown() {\n // decrease the retry countdown cpt by 1\n retryCpt -= 1;\n $(\"#connection-info-header\").html(\n \"<i class='fas fa-exclamation-triangle'></i> \" + window.i18n.msgStore['interrupted-connection'] + \" \" + window.i18n.msgStore['retry-in'] + \" \" + retryCpt\n + \"s <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
countCardsClicked() Tel het aantal kaarten die een speler heeft aangeklikt. | function countCardsClicked()
{
var clicked = 0;
if(cards_clicked[FIRST_CARD_CLICKED] !== NO_CARD_CLICKED)
clicked++;
if(cards_clicked[LAST_CARD_CLICKED] !== NO_CARD_CLICKED)
clicked++;
return clicked;
} | [
"function moveCounter() {\n if (clickedCards.length === 0) {\n moves++;\n moveNumber.innerHTML = moves;\n starRating(moves);\n }\n}",
"function cardCount() {\n if (openCardCount === 2) {\n moveCounter();\n checkMatch();\n $('li').removeClass('card open show').addClass('card');\n openCardCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clone source but excludes source data. | function cloneSourceShallow(source) {
return new SourceImpl({
data: source.data,
sourceFormat: source.sourceFormat,
seriesLayoutBy: source.seriesLayoutBy,
dimensionsDefine: clone(source.dimensionsDefine),
startIndex: source.startIndex,
dimensionsDetectedCount... | [
"function _cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: (0, zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_2__.clone)(source.dimensionsDefine),\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
plotPoints function which draw the meteorites. | function plotPoints() {
/* json method is used to fetch meteorites data. */
d3.json("js/meteorite-strike-data.json", function(json) {
/* A scale created to draw the circles. Each circle depends on the mass of the meteorite. Larger mass results in bigger meteorite. */
var massScale = d3.scale.sqrt()
.domain... | [
"function plotPoints() {\n\t\t// Go through all wells and create markers for them\n\t\tfor (var i = 0; i < currentWells.length; i++) {\n\t\t\tcreateMarker(currentWells[i], i, false);\n\t\t}\n\t}",
"function drawPoints(){\n\tfor (var i=0; i<p.length; i+=1){\n\t\tp[i].pplot(1);\n\t}\n}",
"function drawRandomPoint... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the enemies attack timer. | function startEnemyTimer() {
enemyCanGo = false;
enemy.timer = 0;
$("#enemy-attack-progress").css("width", 0);
} | [
"function initEnemy() {\n Point.pointToStyle(ENEMY_START, enemy.style);\n enemyStats.health = ENEMY_HEALTH.base + ENEMY_HEALTH.perLevel * enemyStats.level;\n enemyAttackState.thinkTimer = 0;\n enemyAttackState.thinkInstance = 0;\n enemyAttackState.timer = 0;\n newEnemyDestination();\n updateEne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handler for quiz intent: to save data into database | function handleSaveToDB_quiz(agent) {
//agent.add('Welcome to quiz intent!');
console.log('quiz intent works');
return db.runTransaction(t => {
t.set(dialogflowAgentRef, {
date: date,
classType: classType,
hoursSpent: hoursSpent,
professorName: professorName,
qu... | [
"function saveAnswers(){\n localStorage.setItem(\"quiz_answers\", getAnswers());\n }",
"saveQuestion() {\n\t\tif (typeof(Storage) == undefined) {\n\t\t\talert(\"Você precisa habilitar o uso de cookies antes de usar o site!\");\n\t\t\treturn;\n\t\t}\n\n\t\t/* store the set of answer to a given qu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Avro enum type. Represented as strings (with allowed values from the set of symbols). Using integers would be a reasonable option, but the performance boost is arguably offset by the legibility cost and the extra deviation from the JSON encoding convention. An integer representation can still be used (e.g. for compatib... | function EnumType(schema, opts) {
Type$2.call(this, schema, opts);
if (!Array.isArray(schema.symbols) || !schema.symbols.length) {
throw new Error(f('invalid enum symbols: %j', schema.symbols));
}
this.symbols = Object.freeze(schema.symbols.slice());
this._indices = {};
this.symbols.forEach(function (sy... | [
"function EnumType(schema, opts) {\n Type.call(this, schema, opts);\n if (!Array.isArray(schema.symbols) || !schema.symbols.length) {\n throw new Error(f('invalid enum symbols: %j', schema.symbols));\n }\n this.symbols = Object.freeze(schema.symbols.slice());\n this._indices = {};\n this.symbols.forEach(fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Die Funktion weiterZeit() startet die durch wartenZeit() unterbrochene StoppUhr wieder | function weiterZeit() {
starteZeit(ausgabeZeit, formatZeit);
} | [
"function zeitermitteln() {\r\n\t\ttime = new Date();\r\n\t\tSekunden = Math.abs(time - start);\r\n\t\tvar zeitinsec = (Sekunden / 1000)\r\n\t\tvar zeitinmin = Math.floor(zeitinsec / 60)\r\n\t\tzeitinsec = zeitinsec - (zeitinmin * 60)\r\n\t\t$(\"#gewonnen\").show();\r\n\t\t$(\"#gewonnen\").append(\"Zeit: \" + zeiti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a dependency tracker to the provided 'bundler' | function addDependencyTracker(baseDir, bundler, filter) {
var res = { bundler: bundler, allDeps: {} };
bundler.on("dep", function (evt) {
if (filter != null && !filter(evt)) {
return;
}
// relativize file absolute path to project directory
... | [
"addDependsOn(serviceName) {\n this.dependsOn.push(serviceName);\n }",
"registerDependency(dependency) {\n this.allDependencies.push(dependency)\n }",
"addBundledDeps(...deps) {\n if (deps.length && !this.allowLibraryDependencies) {\n throw new Error(`cannot add bundled dependenc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to validate whether PublicKeyId starts with prefix LIVE or SANDBOX | function isEnvSpecificPublicKeyId(publicKeyId) {
return publicKeyId.toUpperCase().startsWith('LIVE') || publicKeyId.toUpperCase().startsWith('SANDBOX')
} | [
"verifyS3Key(value) {\n let regex = RegExp('^[a-zA-Z0-9 \\-\\'\\/!_.*()]*$');\n return regex.test(value);\n }",
"setKeyStartsWith(prefix) {\n if (!isValidPrefix(prefix)) {\n throw new errors.InvalidPrefixError(`Invalid prefix : ${prefix}`)\n }\n this.policy.conditions.push(['starts-with', '$k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default constructor, assigns the given id and adds the node to this component. | constructor(node, id) {
this.id = id;
this.nodes = [];
this.nodes.push(node);
} | [
"_AddNode(node, id) {\n node.rId = this.Size + 1;\n if (node.Id == null || node.Id == undefined) {\n node.Id = this.Size + 1;\n }\n this.Nodes[node.Id] = node;\n this.Size++;\n }",
"function makeNode(id, label) {\n g.setNode(id, {\n label: label,\n sty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redraw the data set with a given window. | function redraw_Y(wrow) {
// Limit to 0 and len-windowsize.
wrow = wrow.clamp(0, _ROWLENGTH - windowsize);
// Compute the window.
var data = emptyBlock();
var xindex = 0; //_CHECK : replace with the x position from the left panel (or whichever panel controls the x axis)
for (var row=0; row<windowsize; ++row){
... | [
"function redraw(wcol) {\n\t// Limit to 0 and len-windowsize.\n\twcol = wcol.clamp(0, _COLLENGTH - windowsize);\n\t // Compute the window.\n\tvar data = emptyBlock();\n\tvar yindex = 0; //_CHECK : replace with the y position from the left panel (or whichever panel controls the y axis)\n\tfor (var row=0; row<windows... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add one or more elements on either the `left` or the `right` | addOn(side, ...elements) {
if (side === "left" || side === "top") {
this.prepend(elements);
}
else {
this.append(elements);
}
} | [
"function add(left, right) {\n const sum = [left, right];\n reduce(sum);\n return sum;\n}",
"function add(leftArg, rightArg) {\n return leftArg + rightArg;\n}",
"merge (left, right) {\n let resultArray = [], leftIndex = 0, rightIndex = 0;\n\n // We will concatenate values into the resultArray ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a rawmaterial with id. DELETE rawmaterials/:id | async destroy ({ params, request, response }) {
let { id } = params
let material = await RawMaterial.find(id)
return await material.delete()
} | [
"function deleteMaterial(id) {\n API.deleteMaterial(id)\n .then(res => loadMaterials())\n .catch(err => console.log(err));\n }",
"deleteMaterial(material) {\n // destroys the record, refresh is not needed because result is cached\n material.destroyRecord();\n }",
"static deleteMateria... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to group memories into months | function groupMemories(memories) {
memories.forEach(
datum =>
(datum['groupingDate'] = moment(datum['createdAt']).format(DATE_FORMAT))
);
// Group memories by MM/YYYY
// Create a dict of MM/YYYY => [mem1, mem2]
return _.chain(memories)
.groupBy('groupingDate')
.toPairs()
.map(pair => _.... | [
"function groupByMonth(data, start, end) {\n\n var timeline_data = [];\n var template = [];\n var startMonth = parseInt(start.month);\n var startYear = parseInt(start.year);\n\n var numMonths = (parseInt(end.month) - parseInt(start.month)) + (12 * (parseInt(end.year) - parseInt(start.year)));\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normal callDateSet method with ability to handle ISOWeek setting as well. | function callDateSetWithWeek(d, method, value, safe) {
if (method === 'ISOWeek') {
setISOWeekNumber(d, value);
} else {
callDateSet(d, method, value, safe);
}
} | [
"function callDateSetWithWeek(d, method, value) {\n\t if(method === 'ISOWeek') {\n\t return setWeekNumber(d, value);\n\t } else {\n\t return callDateSet(d, method, value);\n\t }\n\t }",
"function callDateSetWithWeek(d, method, value) {\n if (method === 'ISOWeek') {\n return setWeekNumb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes an immediate into its value. | function decodeImmediate(value) {
if (false
/* LOCAL_DEBUG */
) {}
if (value > 1073741823
/* MAX_INT */
) {
switch (value) {
case 1073741824
/* FALSE */
:
return false;
case 1073741825
/* TRUE */
:
return true;
case 1073741... | [
"function decodeImmediate(value) {\n if (value > 1073741823\n /* MAX_INT */\n ) {\n switch (value) {\n case 1073741824\n /* FALSE */\n :\n return false;\n\n case 1073741825\n /* TRUE */\n :\n return true;\n\n case 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===========================================================================// SpanHandle ===========================================================================// A handle exposing an active span to the client. Terminology: the "span record" is the data associated with a completed span and the "span handle" is the ... | function SpanHandle(state, record) {
// Don't call release() on _record as this is non-owning reference.
this._record = record;
this._state = state;
// Internal identifier; useful for tracking unclosed spans
this._id = gIdCounter++;
} | [
"function getActiveSpan(context) {\n return context.getValue(exports.ACTIVE_SPAN_KEY) || undefined;\n}",
"getCurrentSpan() {\n const ctx = api.context.active();\n // Get the current Span from the context or null if none found.\n return core_1.getActiveSpan(ctx);\n }",
"function getAct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GraphQL query to get grid data for specified entity | function entityGridDataQuery(entityName, client, columns, gridState, filter, callback) {
const limit = gridState.pageInfo.pagesize;
const offset = gridState.pageInfo.pagesize * gridState.pageInfo.pagenum;
const sortCol = gridState.sortInfo.sortcolumn;
const sortDir = (!gridState.sortInfo.sortdirection |... | [
"QueryData(entity, args)\n {\n return [];\n }",
"getAll() {\n let query = `\n query{\n companies{\n slug\n title\n platform\n description\n }\n }\n `;\n return this._GQL.get(query);\n }",
"getEntities() {\n const { query... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the lease Id. | get leaseId() {
return this._leaseId;
} | [
"get id(): ?string {\n\t\tconst ref = this._ref.get();\n\t\treturn ref ? ref.id : undefined;\n\t}",
"function getId() {\n return id;\n }",
"getId() {\n return this.user ? this.user[this.config.identifierKey] : null;\n }",
"get id() {\n return CLIENT_GUID;\n }",
"function getRoomId(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the routes from the successfull response | function returnRoutes(jobId){
//construct the url with the job id
let checkJobUrl = serviceUrl + '/jobs/' + jobId +'/results/out_routes?f=json';
fetch(checkJobUrl)
.then(function(response){
return response.json();
})
.then(function(json){
co... | [
"function getRoutes() {\n $.get('/api/subsegments', renderRouteList);\n }",
"async function getRoutes() { \n \n try {\n const response = await postData('/action/getroutes');\n \n if (response) {\n return response.data;\n } \n } catch (e) { \n console.error(\"Request to Stryke fail... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BindingComplete event Handler. When the dataSource or size of listBox is changed. | _bindingCompleteHandler() {
const that = this;
if (!that.$.listBox) {
return;
}
that._setDropDownSize();
that._positionDetection.checkBrowserBounds();
} | [
"_bindingCompleteHandler() {\n const that = this;\n\n if (!that.$.listBox) {\n return;\n }\n\n if (that.isRendered) {\n that._setDropDownSize();\n that._positionDetection.checkBrowserBounds();\n }\n }",
"_bindingCompleteHandler() {\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getIgnoreKeywords_onomatopoeia_doubleLetter() Get the doubl eletter onomatopoeia letters. For example: [a,h] ("ahhhhh"), [e,k] ("eeeek"), [h,m] ("hhhhhmmmmmm"), [o,h] ("ohhhhhhhh"), etc.. | function getIgnoreKeywords_onomatopoeia_doubleLetter() {
return [
[
'a',
'h',
],
[
'e',
'k',
],
[
'e',
'p',
],
[
'h',
'm',
],
[
'n',
'o',
],
[
'o',
'h',
],
[
'u',
'h',
],
];
} | [
"function getIgnoreKeywords_onomatopoeia_singleLetter() {\n\t\treturn [\n\t\t\t'a',\n\t\t\t'e',\n\t\t\t'm',\n\t\t\t'o',\n\t\t\t'u',\n\t\t];\n\t}",
"function getIgnoreKeywords_onomatopoeia_doubles() {\n\t\tvar onolist = [];\n\t\t\n\t\tvar pieces = getIgnoreKeywords_onomatopoeia_doubleLetter();\n\t\tvar pieceslengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AJAX request for Cluster food items | function getItems(S, L, C, num_results) {
var result;
$.ajax({
url: client,
type: 'POST',
data: $.param({S: S, L: L, C: C, num_results: num_results}),
dataType: 'text',
async: false, //not the best but we'll use it because we prefer all results no stickiness
timeout: 5000,
error: function(xhr, textSt... | [
"function get_cluster()\n{\n new Request.JSON({\n url: '/cluster',\n onFailure: function() { alert('Unable to connect backend. Try again later.') },\n \t onSuccess: ui_list_cluster\n \t}).get();\n}",
"function getFood(){\n \n //how many response objects to return\n var limit ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
home page left side image two loader | function image_loader_two() {
let mid_left_img_two = new Image();
mid_left_img_two.onload = function(){
ml_two.style.backgroundImage = this.src;
b_two = true;
console.log("Image two loaded!");
image_loader_all_checker();
};
mid_left_img_two.src = dir + '002_m.jpg';
} | [
"function image_loader_one() {\n let mid_left_img_one = new Image();\n mid_left_img_one.onload = function(){\n ml_one.style.backgroundImage = this.src;\n console.log(\"Image one loaded!\");\n\n b_one = true;\n image_loader_all_checker();\n };\n mid_left_img_one.src = dir + '0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swap annotation box background color | swap_anno_bg_color(new_bg_color) {
const annbox = jquery_default()("#" + this.config["annbox_id"]);
const ret = annbox.css("background-color");
annbox.css("background-color", new_bg_color);
return ret
} | [
"swap_anno_bg_color(new_bg_color) {\n const annbox = $(\"#\" + this.config[\"annbox_id\"]);\n const ret = annbox.css(\"background-color\");\n annbox.css(\"background-color\", new_bg_color);\n return ret\n }",
"function resetAnnotationsToOriginal(){\n\tidx=0;\n\tannotations.each(func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find and move to the page containing the item matching the given predicate TODO: This will probably cause the list to be rerendered for each page it looks at. I looked into modifying `nextPage` to accept a predicate, but the logic got very complicated and buggy. Best to call this function before rendering to the templa... | findPage(predicate, currentPage = this.firstPage()) {
return currentPage.then((items) => {
if (items.find(predicate)) {
return items;
} else if(!this.get('hasNextPage')) {
//matching item not found, return to first page.
return this.firstPage();
} else {
return this... | [
"function next(array, item, predicate) {\n predicate = predicate || _.constant(true)\n var index = _.findIndex(array, item)\n return _.find(array.slice(index + 1), predicate)\n}",
"filterToPage() {\n if (this.state.contentData) {\n let index = 0;\n for (let content of this.state.co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
one off establishment of stored value in local storage. This should be handled by the useLocalStorage hook, but for some reason using the hook creates an infinete loop. Need to investigate... >window.localStorage.setItem("team", JSON.stringify(teamData)); console.log("const team>", teamData); | function App() {
const [team, setTeam] = useState(teamData);
// console.log("team from app->",team);
// const [storedTeam, setStoredTeam, handleStoredTeam] =useLocalStorage("team");
const [storedTeam, setStoredTeam] =useLocalStorage("team");
console.log(storedTeam);
// console.log("Before settting stored... | [
"function getTeamData(teamId)\n{ \n var tId = teamId;\n localStorage.setItem(\"teamID\",teamId);\n}",
"saveToLocalStorage() {\n this.data.team = [];\n this.forEach(function(child) {\n let pieceData = {\n basePiece: child.data.basePiece,\n id: chi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete channel on submit track user action when deleting channel | @track({action: 'click-channel-delete'})
handleChannelDelete(channel){
let {url} = channel;
this.props.deleteChannelRequest(url);
} | [
"function deleteMyChannel(req, res) {\n var index = req.indx;\n User.findById(req.user._id, function(err, user) {\n user.myChannels.splice(index, 1);\n user.save(function(err) {\n if (err) res.send(err);\n res.json({\n message: 'myChannel successfully removed.',\n myChannels: user.myChan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An external interface to call BoxGuyEntity.nextMessage() from entities.js | function manualMessageUpdate() {
// Note: me.game.world.getChildByName() is computationally expensive, so try not to do this all the time.
var boxguys = me.game.world.getChildByName("BoxGuyEntity");
// When no box guys are on the level, just treat the message as a one-message interaction
if (boxguys.le... | [
"next() {\r\n let n = new Msg(this.id, this.round+1, this.from)\r\n //n.history = this.history\r\n return n\r\n }",
"nextMessage() {\n return new Promise(resolve => {\n if (this.messages.length > 0)\n resolve(this.messages.shift())\n else\n this.resolveFunctions.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To get the flash animation played, me.state needs to change to a new value. In game.js, two states are linked to the same GameScreen. So as long as the state is toggled between those two states, the transition effect will always play. | function MakeshiftFlashAnimation() {
if (me.state.isCurrent(me.state.FLASH_ANIMATION)) {
me.state.change(me.state.PLAY);
} else {
me.state.change(me.state.FLASH_ANIMATION);
}
} | [
"switchFlash() {\n let newFlashMode;\n const { on, off } = constants.FlashMode;\n\n switch (this.state.camera.flashMode) {\n case on: {\n newFlashMode = off;\n break;\n }\n case off: {\n newFlashMode = on;\n break;\n }\n default:\n newFlashMode = off;\n }\n\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate raw mock data for creating a building | function generateMockBuilding(id) {
if (!id) {
id = `zone_bld-${BLD_COUNT++}`;
}
const levels = Array(10)
.fill(0)
.map(i => generateMockLevel());
const features = {};
for (const lvl of levels) {
const count = Math.floor(Math.random() * 3 + 2);
features[lvl.le... | [
"function generateStrainData() {\n return {\n name: faker.lorem.words(),\n type: faker.lorem.word(),\n description: faker.lorem.sentence(),\n flavor: faker.lorem.word()\n }\n}",
"makeMockData (callback) {\n\t\tthis.data = {\n\t\t\tname: this.userFactory.randomFullName()\n\t\t};\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exercise 2 Write a function in Typescript that takes 2 integers as parameters and returns true if the first parameter is divisible by the second parameter, false otherwise. | function EvenlyDivisible(int1, int2) {
return ((int1 % int2) == 0);
} | [
"function isDivisible(a,b) {\n if(a % b === 0){\n return true;\n } else {\n return false;\n }\n // body...\n}",
"function IsDivisibleBy(a, b) {\n if (a % b === 0 || b % a === 0) {\n console.log(1);\n } else {\n console.log(0);\n }\n }",
"function divisible(number1, number2) {\r\n if(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
XMLtoJS utility function to attempt to translate an XML document into a JS object | function xmlToJS(node)
{
if(node.nodeType == Node.COMMENT_NODE || node.nodeType == Node.PROCESSING_INSTRUCTION_NODE)
{
return null; // ignore comments unconditionally
}
if(node.nodeType == Node.TEXT_NODE || node.nodeType == Node.CDATA_SECTION_NODE)
{
return node.nodeValue
}
var bodyText = '';
var thisObj ... | [
"function processXML(xml){\r\n\t\tvar x2js = new X2JS();\r\n\t\tvar jsObj = x2js.xml_str2json(xml);\r\n\t\treturn jsObj;\r\n\t}",
"_xml2json(xml) {\n try {\n let obj = {};\n if (xml.attributes) {\n const c = xml.attributes;\n for (let i = 0; i < c.length;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
index page of all wikis to view | index(req, res, next){
let role;
if(req.user){
role = req.user.role;
} else {
role = false;
}
wikiQueries.getAllWikis((err, wikis) => {
if(err){
res.redirect(500, "static/index");
} else {
res.render("wikis/index", {wikis, role});
}
});
} | [
"static generateIndexPages(wiki) {\n return Promise.all(\n Object.keys(wiki.directoryIndex).map(function(dirPath) {\n const resolvedDir = path.join(wiki.root, dirPath),\n sourceIndexFile = path.join(resolvedDir, 'index.md'),\n generatedIndexFile = path.join(resolvedDir, '_index.md')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses a TTYRec file into many frames. | static *parse(/** !ArrayBuffer */ buf) {
const reader = new Reader();
const view = new DataView(buf);
let /** number */ pos = 0;
while (pos < buf.byteLength) {
// Read the frame header
const startMs = timeMs(view, pos);
const len = view.getUint32(pos + 8, true);
const endMs = pos... | [
"createFrames(needs_validate = false) {\n let frames = this.fileContents.split('\\n')\n .map((row) => {\n return row.trim();\n });\n\n if (needs_validate) {\n frames = frames.filter(GCodeModel.validateFrame);\n }\n\n frames = frames.map((ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the full message content. aMsgHdr: nsIMsgDBHdr object whose text body will be read returns: string with full message contents | function getContentFromMessage(aMsgHdr) {
const MAX_MESSAGE_LENGTH = 65536;
let msgFolder = aMsgHdr.folder;
let msgUri = msgFolder.getUriForMsg(aMsgHdr);
let messenger = Cc["@mozilla.org/messenger;1"]
.createInstance(Ci.nsIMessenger);
let streamListener = Cc["@mozilla.org/network/sync-str... | [
"function getContentFromMessage(aMsgHdr) {\n const MAX_MESSAGE_LENGTH = 65536;\n let msgFolder = aMsgHdr.folder;\n let msgUri = msgFolder.getUriForMsg(aMsgHdr);\n\n let messenger = Cc[\"@mozilla.org/messenger;1\"].createInstance(\n Ci.nsIMessenger\n );\n let streamListener = Cc[\n \"@mozilla.org/network... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the update data of a project | removeUpdate() {
this.setState({
updatePending: false,
dataHasChanged: false,
project_id: this.props.project.project_id,
project_token: this.props.project.token,
project_name: this.props.project.name,
project_description: this.props.projec... | [
"function resetProject() {\n problemManager.resetProject();\n // Reset ractive bindings\n setRactives();\n update();\n showProjectResetDialogue();\n}",
"resetProject() {\n this.initialiseProject();\n }",
"reloadProjects() {\n let projects = this.projects.slice();\n this._clear();\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
linkEvent(sEntidad,sEvento,fAccion,sId,sCondicion): Este metodo se encarga de apilarnos la accion fAccion a la pila de funciones disparadas por el evento sEvento de las entidades de tipo sEntidad [ que cuelgan del arbol DOM del id sId | o de la entidad BODY ][y que los nodos padre de sEntidad cumplan la condicion sCond... | function linkEvent(sEntidad,sEvento,fAccion,sId,sCondicion) {
var oId;
var aNodes;
var oSearch;
// alert(sEntidad + ' - ' + sEvento + ' ' + sId + ' ' + sCondicion);
if (sId) oId = document.getElementById(sId);
else oId = document.body;
if (!oId) {
alert('DOM Failure to obtain root element '+sId);
return fa... | [
"function agregar_evento_click_a_titulos() {\n var titulos = document.getElementsByClassName(\"raiz\");\n\n for(var i = 0; i < titulos.length; i++) {\n var titulo = titulos[i];\n\n // tag '<a>' que contiene el titulo y lo hace cliqueable\n var tagA = titulo.childNodes[1].childNodes[2];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a ClinicalImpressionFinding resource | static get __resourceType() {
return 'ClinicalImpressionFinding';
} | [
"static get __resourceType() {\n\t\treturn 'ClinicalImpression';\n\t}",
"static get __resourceType() {\n\t\treturn 'ClinicalImpressionRuledOut';\n\t}",
"function getCritic(){\n //console.log(\"critic id\", props.r.critic.id);\n api.get_critic_reviews(props.r.critic.id);\n //api.get_user_fol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the cookie disclaimer has already been accepted | function hideAlreadyAcceptedCookieDisclaimer() {
var consent = Cookies.get('_cookie_consent');
if (!consent) {
$('.cookies-disclaimer').show();
}
} | [
"function checkDisclaimer() {\n\n\tvar reponse = getCookie('acceptedDisclaimer');\n\n\tif (reponse == 'yes') {\n\t\treturn 'yes';\n\t\t// return '';\n\t} else {\n\t\treturn '';\n\t}\n}",
"function acceptedCookie() {\n var policy = Cookies.get(\"cookiePolicy\");\n if (policy) {\n return true;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
village kills the accused | async function villageKillAccused(gameid, token) {
let accused = await getAccusedFromRoundTable(gameid);
let accusedRole = await getAccusedRole(accused,gameid);
let livingWerewolves = await query({ role: "werewolf", status: "alive",gameid:gameid});
if (accusedRole === "werewolf" && livingWerewolves.length == 1)... | [
"kill(){\n this.vulnerable = false;\n this.lives -= 1;\n this.engine.stop();\n this.emit(\"ship_death\");\n this.setActive(false).setVisible(false);\n }",
"function killRandomVulnerableEnemy() {\n\t\t\tif (moved) return;\n\t\t\tObject.keys(findVulnerableEnemies()).forEach(pos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts locale data from CLDR format (if needed) | function from_CLDR(data) {
// the usual time measurement units
var units = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'];
// result
var converted = { long: {} };
// detects the short flavour of labels (yr., mo., etc)
var short = /-short$/;
var locale = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_... | [
"function getLocaleFormatData(locale) {\n var data = [\n { unit: units.month, num: \"11\", placeholder: \"mm\" },\n { unit: units.day, num: \"22\", placeholder: \"dd\" },\n { unit: units.year, num: \"3333\", placeholder: \"yyyy\" },\n ];\n // create a new localized string from a known ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run sql statement with map and join. | function sqlRunMapJoin(db, pre, dat, map, sep) {
for(var i=0, I=dat.length, z= []; i<I; i+=256) {
var prt = dat.slice(i, i+256);
z.push(db.run(pre+prt.map(map).join(sep), prt));
}
return Promise.all(z);
} | [
"join() {\n let sql = '';\n let i = -1;\n const joins = this.grouped.join;\n if (!joins) return '';\n while (++i < joins.length) {\n const join = joins[i];\n const table =\n join.schema && !(join.table instanceof Raw)\n ? `${join.schema}.${join.table}`\n : join.tabl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates sliders range on window resize. | onResize() {
var sizes = document
.getElementById('demogl')
.getBoundingClientRect();
this.sliders.forEach(function(slider) {
slider.max = sizes[slider.getAttribute('data-size')];
this.onSliderChange({ target: slider });
... | [
"onResize() {\n var sizes = document.getElementById('demogl').getBoundingClientRect();\n\n this.sliders.forEach(function(slider) {\n slider.max = sizes[slider.getAttribute('data-size')];\n this.onSliderChange({ target: slider });\n }, this);\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(void)arcToX1:(float)x1 y1:(float)y1 x2:(float)x2 y2:(float)y2 radius:(float)radius; | arcTo(x1, y1, x2, y2, radius) {
CanvasManager.arcTo(findNodeHandle(this), x1, y1, x2, y2, radius)
} | [
"function cnvArc( x, y, r, a1, a2, forward ){\n \"use strict\";\n var an1, an2;\n if ( forward === undefined ){\n\tforward = true;\n }\n if ( !forward ){\n\tan1 = a2;\n\tan2 = a1;\n } else {\n\tan1 = a1;\n\tan2 = a2;\n }\n cnv.arc( x, y, r, -an1, -an2, forward );\n}",
"xcircle(r) {\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add DONE button toolbar in Keyboard | function addUserKeyBoard(){
var flexSpace = Titanium.UI.createButton({systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE});
var btnDone = Titanium.UI.createButton({
title : 'Done',width : 67,height : 32
});
btnDone.addEventListener('click',function(e){
$.txtfieldMobile.blur();
});
$.txtfi... | [
"function addUserEmirateKeyBoard(){\n\tvar flexSpace = Titanium.UI.createButton({systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE});\n\tvar btnDone = Titanium.UI.createButton({ \n\t title : 'Done',width : 67,height : 32\n\t});\n\tbtnDone.addEventListener('click',function(e){\n\t $.txtfieldEmir... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Views details of selected default appointment slot | function viewDefaultSlot(appointment_slot_id) {
$location.path('/admin-default-edit');
console.log('view default slot clicked ', appointment_slot_id);
$http.get('/schedule/' + appointment_slot_id).then(function(response) {
defaultSlot.selected = response.data;
defaultSlot.selected.start_time = n... | [
"view() {\n window.app.intercom.view(false);\n window.app.nav.selected = 'Schedule';\n window.app.view(this.header, this.main, '/app/schedule');\n if (!this.managed) this.manage();\n this.viewAppts();\n }",
"function Appointment() { }",
"function configureSlotLocationDispla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
string ctor s(number): create zerofilled string of numberlength s(string): make a copy of the string s(uint8[]): make a copy of the string Returns a Uint8Arraystring. | function $s(v) {
var t = typeof v;
if (t === 'number') {
return new Uint8Array(v);
}
if (t !== 'string') {
v = '' + v;
}
var s = new Uint8Array(v.length);
for (var i = 0; i < v.length; i++) {
s[i] = v.charCodeAt(i);
}
return s;
} | [
"function caml_new_string (s) { return new MlBytes(0,s,s.length); }",
"function $s(v) {\n var t = typeof v;\n if (t === 'number') {\n return new Uint8Array(v);\n }\n if (t !== 'string') {\n v = '' + v;\n }\n var s = new Uint8Array(v.length);\n for (var i = 0; i < v.length; i++) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PUBLISH DAILY RECAP REPORTS | function publishDlyRecpsReports() {
// NOTIFY PROGRESS
console.log('publishDlyRecpsReports');
// DEFINE LOCAL VARIABLES
var emailPromises = [];
// RETURN ASYNC WORK
return new Promise(function (resolve, reject) {
// COLLECT TODAY'S REPORTS
proReport.dailyRecaps.publish()
... | [
"function scheduleRecurringExport() {\n\t(function exportLoop(){ //eslint-disable-line\n\t\tgames.exportTimeSheetAndGameHistory();\n\t\tgambling.exportLedger();\n\t\tsetTimeout(exportLoop, 70000);\n\t})();\n}",
"_registerSubscriptionsReport() {\n const job = new CronJob('0 0 * * *', async function () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Valida que el value pasado como parametro sea numero Y ademas de ser un numero que sea entero. Los parametros son value (valor a comparar), y colname que es el nombre del campo que deseamos validar. | function checkNumberInt(value,colname){
if(Math.floor(value)==value)
return [true,""];
else
return [false,"El campo "+colname+" solo admite valor numericos enteros"];
} | [
"function validar_numero(dato){\n\n\treturn Number.isInteger(Number(dato));\n\n}",
"function validarDatos(event) {\n\n console.log();\n //se utilizo la funcion isNaN para comprobar si el valor obtenido es un numero,en caspo de que no sea un numero, se utilizo el metodo focus para no permitirle al usuario ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to construct DOM nodes for 'edit','delete' buttons and 'bagdes' to show the range. | function genetarateMicroButtons(type, factoryName, minRange = null, maxRange = null) {
let div = document.createElement('div');
let button = document.createElement('button');
let span = document.createElement('span');
if (type === "range") {
div.setAttribute("class", "col-2 col-md-2 d-flex flex-... | [
"function createElements(){\t\n\treturn{\n\t\t/*create diiferent elements required in slider*/\n\t\theading:document.createElement('h2'),\n\t\tdocfrag:document.createDocumentFragment(),\n\t\tfig:document.createElement('figure'),\n\t\timage:document.createElement('img'),\n\t\tfigcaption:document.createElement('figca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This calls getReviewers() if we can't find the requested user id in our store. If we can find it, nothing will happen. | async getReviewersIfNotStored({ getters, dispatch }, { userId }) {
if (!getters.getUserById({ id: userId })) {
dispatch('getReviewers');
}
} | [
"async getReviewers({ commit, rootState }) {\n if (isSuperUser() || isWriter()) {\n let response = await reviewersAPI.getReviewers();\n\n if (response.status === 200 && response.data) {\n commit('set_reviewers', { reviewers: response.data })\n\n let filteredData = response.data.filter(r =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |