query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
output hello hello1 hello2 hello3 hello4 hi because hello setTimeOut is web api means it firstly store in browser stack after completed it's task it move to call back stack means first normal task exuited then other task exuited (micro, macro) | function example2() {
setTimeout(() => console.log("hi"), 0); // macro task
queueMicrotask(() => console.log("interesting hello")); // micro
queueMicrotask(() => console.log("interesting hello 1")); // micro
console.log("hello");
console.log("hello1");
console.log("hello2");
console.log("hello3");
console.log("hello4")... | [
"function funcionIntermedia(request, response, next){\n console.log('Ejecutado a las : ' +new Date());\n //netx ejecuta lo siguiente que hay en app.get('/concatenado.....')\n next(); //esta siempre es la ultima linea\n}",
"function delayedGreet() {\n // ADD CODE HERE\n setTimeout(sayWelcome, 3000);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========================================================== Our handleKeys function. Rudimentary camera controls meant primarily for debugging purposes ========================================================== | function handleKeys( event ) {
var key = event.keyCode;
console.log(key);
switch (key) {
case 119: // w
camera.position.z += 0.1;
break;
case 115: // s
camera.position.z -= 0.1;
break;
case 97: // a
camera.position.x += 0.1... | [
"function handleKeys() {\n if (currentlyPressedKeys[33]) {\n // Page Up\n pitchRate = 0.1;\n } else if (currentlyPressedKeys[34]) {\n // Page Down\n pitchRate = -0.1;\n } else {\n pitchRate = 0;\n }\n\n if (currentlyPressedKeys[37] || currentlyPressedKeys[65]) {\n // Left cursor key or A\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge multiple streams and propagate their errors into one stream in parallel. | function merge(streams) {
var mergedStream = merge2(streams);
streams.forEach(function (stream) {
stream.on('error', function (err) { return mergedStream.emit('error', err); });
});
return mergedStream;
} | [
"function mergeStreams(streams) {\n streams = streams.filter(function(e) {return !!e});\n if (!streams || streams.length == 0) {\n return;\n }\n if (streams.length == 1) {\n return streams[0];\n }\n var result = merge(streams[0], streams[1]);\n for (var i = 2; i < streams.length; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createProvider: create a new provider and add it to the provider list (g_providers) provider: the provider name (dropbox, gdrive, onedrive) email: the email to identify the account used to connect to the provider refreshToken: the refresh token for gdrive and onedrive, undefined otherwise token: the token for the authe... | function createProvider(provider, email, refreshToken, token, freeStorage, totalStorage) {
var credentials = Windows.Security.Credentials;
var passwordVault = new credentials.PasswordVault();
var i, found = undefined;
// Check if the provider exists
for (i = 0; i < g_providers.length; i++) {
... | [
"async function apiManagementCreateAuthorizationProviderOobGoogle() {\n const subscriptionId = process.env[\"APIMANAGEMENT_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"APIMANAGEMENT_RESOURCE_GROUP\"] || \"rg1\";\n const serviceName = \"apimService1\";\n const authorizationProviderI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Below are the main calculation methods. The equation (a string) will be passed as an argument into calculateBrackets CalculateBrackets will target the innermost pair of parentheses and pass the 'subexpression' within through calculateAddition. If no parentheses are found, the whole expression is passed into calculateAd... | calculateBrackets() {
//this section is to handle multiplication bracket notation. Example "5(10)" should equal 50
let sliceIndex = this.calculation.search(/[0-9]\(/) //find instances of digit followed by open bracket
if (sliceIndex > -1) {
this.calculation = this.calculation.slice(0... | [
"function evaluateExpression(equation, inputs) {\n //I'm pretty sure this removes all whitespace.\n equation = equation.replace(/\\s/g, \"\");\n //if equation is an input (like 't'), return the value for that input.\n if (equation in inputs) {\n return inputs[equation];\n }\n //make each va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to get a typed SimpleDbStore for the target globals object store. | function globalTargetStore(txn) {
return IndexedDbPersistence.getStore(txn, DbTargetGlobal.store);
} | [
"function getDatabase() {\n return new Database(config.database.uri);\n}",
"transformStores (app) {\n const stores = app.config.database.stores\n const jsdata = {}\n Object.keys(stores).forEach(key => {\n const connection = lib.Adapters.loadConnection(stores[key])\n let store = new JSDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks to see if all the images values have a unique value | function isunique(arr)
{
var charecterValue1 = 0;
var charecterValue2 = 0;
var hasdup = false;
do
{
for(i = 0; i <= arr.length; i++)
{
for(j = i; j < arr.length; j++)
{
charecterValue1 = parse... | [
"function validateArrayValueUnique (arr){\r\n var i = 0, j = 0;\r\n while (undefined !== arr[i]){\r\n j = i + 1;\r\n while(undefined !== arr[j]){\r\n if (arr[i] == arr[j]) {\r\n return false;\r\n }\r\n ++j;\r\n }\r\n ++i;\r\n }\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decode dsa enum string in the format of [optionA,optionB,optionC] | function decodeEnums(enums) {
let targetString = enums;
if (targetString.startsWith('[') && targetString.endsWith(']')) {
targetString = targetString.substring(1, targetString.length - 1);
}
return targetString.split(',').map(s => decodeNodeName(s));
} | [
"function _hexDecode(data) {\n var j\n , hexes = data.match(/.{1,4}/g) || []\n , back = \"\"\n ;\n\n for (j = 0; j < hexes.length; j++) {\n back += String.fromCharCode(parseInt(hexes[j], 16));\n }\n\n return back;\n }",
"_cleanEnums(columnType) {\n if (!columnTy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Same as 'string'.codePointAt(pos), but works in older browsers. | function codePointAt(string, pos) {
var first = string.charCodeAt(pos), second;
if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
second = string.charCodeAt(pos + 1);
if (second >= 0xDC00 && second <= 0xDFFF) {
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae... | [
"getChar(pos) {\n return this.document.getText(new vscode.Range(pos, pos.translate(0, 1)));\n }",
"function getCodePoints(string) {\n var newArray = [];\n for (i = 0; i < string.length; i++) {\n newArray.push(string.codePointAt(i));\n\n }\n return newArray;\n}",
"function returnACha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get L2 Address for Force Bridge | async function getL2Address(_web3, _account) {
console.log(`getL2Address: \n${_web3}`);
const addressTranslator = new nervos_godwoken_integration_1.AddressTranslator();
const depositAddress = await addressTranslator.getLayer2DepositAddress(_web3, _account);
console.log(`Layer 2 Deposit A... | [
"getComponentAddress() {\n return this.room.xmpp.breakoutRoomsComponentAddress;\n }",
"function getDeviceAddress(b64_pubkey){\n\treturn `0${getChash160(b64_pubkey)}`;\n}",
"static address(v) { return new Typed(_gaurd, \"address\", v); }",
"async getBankAddressByGlobalConfig(block, chain) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the view data column text matches what we expect after a column move. Shouldn't need to be called by itself. Call testUI() instead. | function testView(order) {
rowText.length = 0;
if (!locked) {
Ext.Array.each(view.getRow(view.all.item(0)).childNodes, function (n) {
rowText.push(n.textContent || n.innerText);
});
} else {
// For locked grids, we must loop over both ... | [
"function testRowColoumnData(that, test) {\n\n // TODO(Akshay): Scrolling records\n\n that.apiResponse.records.forEach(function (record, recordNo) {\n\n that.columns.forEach(function (column) {\n\n // Check cell's visibility in viewport\n var rowColumnData = pe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes a MySQL query to insert a new order into the database. Returns a Promise that resolves to the ID of the newlycreated order entry. | async function insertNewOrder(order) {
order = extractValidFields(order, OrderSchema);
const [ result ] = await mysqlPool.query(
'INSERT INTO orders SET ?',
order
);
return result.insertId;
} | [
"async insertNewTask(task){\r\n try {\r\n const insertId = await new Promise((resolve, reject) => {\r\n const query = \"INSERT INTO task (Title, List_ID, Done, Task_Date) VALUES (?,?,?,?)\";\r\n\r\n connection.query(query, [task.Title, task.ListID, task.Done, task.Tas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether a platform id represents a browser platform. | function isPlatformBrowser(platformId) {
return platformId === PLATFORM_BROWSER_ID;
} | [
"function isRBMPlatform (currentPlatform) {\n return currentPlatform == HIGH_DIMENSIONAL_DATA[\"rbm\"].platform ? true : false;\n}",
"function platform() {\n\tvar s = process.platform; // \"darwin\", \"freebsd\", \"linux\", \"sunos\" or \"win32\"\n\tif (s == \"darwin\") return \"mac\"; // Darwin con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. | removeStyles(styles) {
const target = getShadowRoot(this.element) ||
this.element.getRootNode();
if (styles instanceof HTMLStyleElement) {
target.removeChild(styles);
}
else if (styles.isAttachedTo(target)) {
const sourceBehaviors = styles.behaviors;
... | [
"function removeStylesToElement(tag, styles) {\n\t/* TODO: its possible this will mess up some page's inline CSS, but in those cases,\n * it will probably be messed up anyway. */\n\tfor (var styleKey in Object.keys(styles)) {\n\t\ttag.style[styleKey] = \"\";\n\t}\n}",
"_destroyStyles() {\n if (!this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function initially draws the "game level", it will then call the renderEntities function. Remember, this function is called every game tick (or loop of the game engine) because that's how games work they are flipbooks creating the illusion of animation but in reality they are just drawing the entire screen over an... | function render() {
gameController.render();
renderEntities();
gameController.postRender();
} | [
"function render() {\n\n // This array holds the relative URL to the image used\n // for that particular row of the game level.\n var rowImages = [\n 'images/water-block.png', // Top row is water\n 'images/stone-block.png', // Row 1 of 3 of stone\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler for dropdown option change event. Calls setLanguagePair to set the new language. | function languageChangeHandler() {
if (document.getElementById('selectLanguage').value == "en") {
//alert('selected value is english');
transliterationControl.disableTransliteration();
//return;
} else {
//enableTransliteration()
var dropdown =... | [
"function handleLangSelect ( event ) {\r\n\t\t\r\n\t\t// prevent going to #\r\n\t\tevent.preventDefault()\r\n\r\n\t\tlet selectElement = event.srcElement\r\n\t\t// to be shown as placeholder\r\n\t\tlet buttonElement = selectElement.parentElement.previousElementSibling\r\n\t\t// element in with data to be saved of s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Base container that can be locked and resized | function BaseContainer() {
this.size = 0;
this.maxSize = null;
this.minSize = 0;
this.resizable = true;
this.locked = false;
this.element = null;
this.collapsed = false;
} | [
"constructor() {\n super();\n this.isContainer = false;\n }",
"readjustGroup() {\n // Calculate the new required group size, content box x1 and y1 based on\n // the minContentWidth and the minContentHeight.\n if (isNull(this.frame)) {\n this.width = this.minContentWidth;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the time every second and then adds a bug to the board if a new bug is due | function addRandomBug(){
if (curTime >= 60){
endRound();
} else if (!gamePaused) {
curTime ++;
if (curTime == (nextBug + lastBugTime)){
//Get colour and x location of bug
var randomX = getRandomIntInclusive(10, 390);
var randColour = getRandomColour();... | [
"function runGame() {\n score = 0;\n gamePaused = false;\n curTime = 0;\n nextBug = 1\n lastBugTime = 0;\n bugList = [];\n foodList = [];\n\n drawScoreboard();\n bugInterval = window.setInterval(addRandomBug, 1000);\n createRandomFoods(5);\n window.requestAnimationFrame(animateBoard... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return parameter in a certain position in a string | function getParam(msg, position)
{
var tmp = msg.split(' ');
return tmp[position];
} | [
"function getPosition(str,start,needle){\n\tvar index = str.substr(start).indexOf(needle);\n\tif (index==-1) {\n\t\treturn index;\n\t}\n\treturn index+start;\n}",
"function param1() {\n do {\n str = prompt(\"Introduzca una frase con 2 delimitadores: \");\n } while (!str);\n do {\n del1 = prompt(\"Introdu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(6) Given a 32bit value, write a function to return the byte in the n position 0b00000101 11101011 10100101 11110001 n=2 11101011 3 2 1 0 | function getByteN(value, n) {
return ((value >> (8 * n)) & 0b11111111);
} | [
"static bytes32(v) { return b(v, 32); }",
"static bytes31(v) { return b(v, 31); }",
"static bytes9(v) { return b(v, 9); }",
"static bytes11(v) { return b(v, 11); }",
"static bytes22(v) { return b(v, 22); }",
"static uint8(v) { return n(v, 8); }",
"function CByte(n) {\n var i=n*1;\n i=Math.round(i)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the current user session (from localStorage). This will emit the usersessionchanged event, but does not return the user session. | loadUserSession() {
const storedUserSession = localStorage.getItem('userSession');
const userSession = storedUserSession
? UserSession.deserialize(storedUserSession)
: null;
this.userSession = userSession;
this.resetRenewalTimer(userSession);
this.emit('user-session-changed', userSessio... | [
"function loadUsers() {\n var loadedUsers = JSON.parse(localStorage.getItem(\"trivia-users\"));\n\n if (loadedUsers) {\n users = loadedUsers;\n }\n}",
"function init() {\n var storedUsers = JSON.parse(localStorage.getItem(\"Users\"));\n if (storedUsers !== null) {\n users = storedUsers;\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a function called "printHeart" that prints out "<3" and run once Write your function here: | function printHeart() {
console.log("<3");
} | [
"function showHeart() {\n document.getElementById(\"heart-box\").innerHTML = \"<3\";\n}",
"function displayHeartRate(hr)\n{\n document.getElementById(\"mood-hr-main\").text = \" \" + hr + \"hr \";\n}",
"beat(){\n this.heartrate = this.Generate_Random_num(60,100);\n //Display the patient detail... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the system frameworks | function systemFrameworks(callback) {
if (sysframeworks) {
return callback(null, sysframeworks, sysframeworkDir);
}
settings(function(err,config){
if (err) {
return callback(err);
}
sysframeworkDir = path.join(config.simSDKPath,'System','Library','Frameworks');
frameworksFromDir(sysframeworkDir, funct... | [
"function frameworksFromDir(frameworkDir, callback) {\n\tif(frameworkDir == null || !fs.existsSync(frameworkDir)) {\n\t\tcallback(null, []);\n\t\treturn;\n\t}\n\tvar r = /(.*)\\.framework$/;\n\tfs.readdir(frameworkDir, function(err,paths) {\n\t\tif (err) return callback(err);\n\t\tvar fw = paths\n\t\t\t.map(functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_getGraphs` returns an array with the given graph, or all graphs if the argument is null or undefined. | _getGraphs(graph) {
if (!isString(graph)) return this._graphs;
const graphs = {};
graphs[graph] = this._graphs[graph];
return graphs;
} | [
"getGraphs () {\n return this._vizceral.graphs;\n }",
"static getGraphs(reportType, reportInputFilter, dimension = null, objectIds = null, responseOptions = null){\n\t\tlet kparams = {};\n\t\tkparams.reportType = reportType;\n\t\tkparams.reportInputFilter = reportInputFilter;\n\t\tkparams.dimension = dimensio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ VALID NAME FIELD REGULER EXPRESSION | function ValidNameField(sender) {
var id = $(sender).attr('id');
var nameField = $('#' + id).val();
var regexpp = /^[a-zA-Z][a-zA-ZéüöóêåÁÅÉá .´'`-]*$/
var Exp = /^[0-9]+$/;
if (nameField.length > 0) {
if (nameField.trim() == '')
return false
else {
if (Exp.t... | [
"function nameValidation() {\n // Name validation\n const nameValue = name.value;\n const nameValidator = /[a-zA-z]+/.test(nameValue);\n\n return nameValidator;\n}",
"function validName(input) {\n return input.length > 0\n }",
"function name_check() {\r\n name_warn();\r\n final_validate();\r\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start a new mode with a `lexeme` to process. | function startNewMode(mode, lexeme) {
var node
if (mode.className) {
node = build(mode.className, [])
}
if (mode.returnBegin) {
modeBuffer = ''
} else if (mode.excludeBegin) {
addText(lexeme, currentChildren)
modeBuffer = ''
} else {
modeBuffer = lexeme
}
... | [
"function pushlex(type, info) {\n var result = function(){\n lexical = new CSharpLexical(indented, column, type, null, lexical, info)\n };\n result.lex = true;\n return result;\n }",
"function startVoiceContext(id) {\n id = id || '';\n if (!id && context !== result) {\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
performs validation of the participant names on the second form | function formValidateParticipant() {
var inputNames = document.querySelectorAll("input#name");
// validates each participant name
for(var i = 0; i < inputNames.length; i++) {
var name = inputNames[i].value;
// checks whether name is invalid or null
if(!nameValidate(name) || name... | [
"function formValidation() {\n let nameField = document.getElementById(\"name\");\n let emailField = document.getElementById(\"mail\");\n let bioInfo = sections[0];\n let emailErrorPresent = document.getElementById(\"emailError\");\n let nameErrorPresent = document.getElementById(\"nameError\");\n let activit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copyright (c) 20102011 Turbulenz Limited SceneLoader =========== Helper class to load() a scene and wait for its dependencies before complete() is true /global TurbulenzEngine: false /global ResourceLoader: false | function SceneLoader() {} | [
"LoadScene()\n {\n\n if ( this.__loaded )\n {\n console.error( \"Unable to load scene, already loaded \" )\n return;\n }\n\n this.LocalSceneObjects.forEach( element => {\n\n let _constructor = element[0];\n let _serializedCallback = eleme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this turns the div blue | function goBlue() {
$target.css({
backgroundColor: 'blue'
});
} | [
"function showColorColoredBox(css) {\n document.getElementById(\"boxColor\").style.backgroundColor = `${r}, ${g}, ${b}`;\n }",
"_setColor() {\n this._container.classList.remove(\n `alert--${this._data.color === \"red\" ? \"green\" : \"red\"}`\n );\n this._container.classList.add(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to display user entered values in an alert box and redirect to HomePage | function displayValues()
{
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;
var phone = document.getElementById("phoneNo").value;
var message = document.getElementById("message").value;
alert( "You entered the following dat... | [
"function alertpopupUitgelogd() {\n alert(\"U moet eerst registreren om te kunnen matchen!\");\n loadController(CONTROLLER_REGISTREER);\n }",
"function displayError() {\r\n alert(\"Search term cannot be empty\");\r\n }",
"function signUp()\n {\n var email = d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if two words differ at a certain index, return 1 | function diff(idx1, idx2) {
if (word1[idx1-1] === word2[idx2-1]) {
return 0;
}
return 1;
} | [
"function naiveString(str1,str2){\n var count = 0;\n for(var i = 0;i <str1.length;i ++){\n for(var j = 0;j <str2.length;j ++){\n if(str1[i + j] != str2[j]){\n break;\n }\n if(j === str2.length - 1){\n //console.log(str2.length );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to display plots from a country from dropdown menu selection | function optionChangedProduction() {
// Assign dropdown menu to variable using D3 and ID for menu given in HTML
let dropdownMenu = d3.select("#dropdownPro");
// Assign the value of the country dropdown menu option to a variable
let country = dropdownMenu.property("value");
// Clear the alread... | [
"function chooseCountry() {\n let firstDropdown = document.getElementById(\"countries\")\n let countryIndex;\n let countryName;\n firstDropdown.addEventListener(\"change\", function() {\n countryName = this.value\n let countries = covidData.countries\n for (let i = 0; i < countries.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register or update an endpoint | _registerOrUpdate(ep) {
if (ep.id && this._endpoints[ep.id]) {
Object.assign(this._endpoints[ep.id], ep);
this.emit('update', ep);
console.log('CoAP RD: Updated endpoint ' + ep.ep);
} else {
ep.id = makeEpIdentifier(ep);
this._endpoints[ep.id] = ep;
this.emit('register', ep);
consol... | [
"function addEndpoint(url, opts, cb) {\n opts = opts || {}\n\n read((err, configData) => {\n if (err) { cb(err); return }\n\n let endpoints = configData.endpoints || []\n let info\n url = utils.cleanUrl(url)\n\n if (opts.port) {\n info = addEndpointForPort(endpoints, url, opts.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nextDisable() Disables the next button. | function nextDisable() {
$('#btnNextStep').attr('disabled', 'disabled');
} | [
"disable_next_button() {\n $('.nav_next_button').prop('disabled', true);\n $('.nav_next_button').addClass('button_disabled');\n }",
"enable_next_button() {\n $('.nav_next_button').prop('disabled', false);\n $('.nav_next_button').removeClass('button_disabled');\n }",
"function n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loop over the quakes array and add a marker for each quake | function addQuakeMarkers(quakes, map) {
//loop over the quakes array and add a marker for each quake
var quake;
for (var i = 0; i < quakes.length; i++) {
quake = quakes[i];
quake.mapMarker = new google.maps.Marker({
map : map,
position : new google.maps.LatLng(quake.... | [
"addQuads(quads) {\n for (let i = 0; i < quads.length; i++) this.addQuad(quads[i]);\n }",
"function addEarthquakeMarkers(earthquakesData) {\n\n\t// Variable to store earthquakes array\n\tlet earthquakes = null;\n\t// Length of array\n\tlet earthquakesLength = null;\n\n\t// First check if there are actually ea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function sets the day fills as well as the day numbers (day of the month) | function setCalendarDayFills(weeksIntoFuture){
var daysInAdvance = weeksIntoFuture * 7;
var theDay = today.getDay();
//theDay = 0; //Just for testing
//Shift the days over so Monday is 0 instead of Sunday
theDay -= 1;
if(theDay == -1){theDay = 6;}
//Variables for fill
var fillMO = fillTU = fillWE = fill... | [
"function setupMonths(){\n for(var i = 0; i < months.length; i++){\n for(var x = months[i].firstDay; x < months[i].lastDay + months[i].firstDay; x++){\n months[i].days.push({cell: {}, todos: [], events:[]});\n }\n }\n}",
"function setDateContent(MONTH, YEAR) {\n\tdocument.getElementById(\"id_month\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Code Example 8.19 B Return an array of file IDs for files with duplicate names. Loops over the object returned by getFileNameIdMap() and returns only those file IDs for duplicate file names. | function getDuplicateFileNameIds() {
var fileNameIdMap = getFileNameIdMap(),
fileName,
duplicateFileNameIds = [];
for (fileName in fileNameIdMap) {
if (fileNameIdMap[fileName].length > 1) {
duplicateFileNameIds =
duplicateFileNameIds
.concat(fileNameIdMap[fileName]);
}
... | [
"function fileNaming(names) {\n let arr = []\n for(let i=0;i<names.length;i++){ \n if(arr.indexOf(names[i])<0){ // no dups = put string in final array\n arr.push(names[i])\n }else{\n let j = 1\n while(arr.indexOf(names[i]+'('+ j +')')>=0){ //while loo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
style the date retrieving from the ajax response. | function date_styler(date) {
var d = new Date(date);
return d.getFullYear() + '/' + (d.getMonth() + 1) + '/' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
} | [
"function loadDateHtmlPage() {\n var dateHtmlPage = '';\n dateHtmlPage += '<div class=\"dateBox\" id=\"dateBox\">';\n dateHtmlPage += '<div class=\"dateBox-inner\" >';\n dateHtmlPage += '<div class=\"datePickDiv\">';\n dateHtmlPage += '<label for=\"date\">起:</l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chunk a single array into multiple arrays, each containing `count` or fewer items. | function chunk(array, count) {
if (count == null || count < 1) return [];
var result = [];
var i = 0, length = array.length;
while (i < length) {
result.push(slice.call(array, i, i += count));
}
return result;
} | [
"chunk(arr, size) {\n if(typeof size === 'undefined') {\n size = 1;\n }\n let arrayChunks = [];\n for(let i = 0; i < arr.length; i+=size) {\n let arrayChunk = arr.slice(i, i+size);\n arrayChunks.push(arrayChunk);\n }\n return arrayChunks;\n }",
"function chunk(array, size) {\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the active visualization. Could be called from a user defined dropdown or whatever way the user wants to change a visualization dynamically. Public Accessor: Amplitude.changeVisualization( visualization ) | function publicChangeActiveVisualization( visualization ){
/*
First we stop the active visualization. If the visualization
is set up correctly, it should halt all callbacks, and clear
the amplitude-visualization element.
*/
privateStopVisualization();
/*
Next we set the active visualization in the ... | [
"function setVisual(enabled) {\n _visual = enabled;\n }",
"changeActiveCamera() {\n if (this.interface.cameras) {\n let interfaceCam = this.interface.cameras[ACTIVE_CAMERA];\n let defOrtho = this.graph.views.orthos[interfaceCam];\n let defPerspective = this.graph.views.perspectives[int... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a connection to this nodes list of connections | addConnection(connection){
this.connections.push(connection);
this.hasChildren = true;
} | [
"addConnection(connection) {\n const fromNeuron = this.neurons.get(connection.from.id);\n const toNeuron = this.neurons.get(connection.to.id);\n\n if (fromNeuron === undefined || toNeuron === undefined) {\n throw new Error(\n \"The connection could not be added because the `from` or `to` neuron... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
logMultiples takes in two numbers and logs any number between 1 and 100 that is a multiple of x or y there is no return value Example: logMultiples(20, 25) would log 20 25 40 50 60 75 80 100 | function logMultiples(x, y) {
} | [
"function logMap(val, inMin, inMax, outMin, outMax) {\n\n // log( = infinity)\n for (var i = 0; i < arguments.length; i++) {\n if (arguments[i] === 0) {\n arguments[i] = 0.0000000000000001;\n }\n }\n\n var minv = Math.log(outMin);\n var maxv = Math.log(outMax);\n\n var numerator = maxv - minv;\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saving members with keypress enter | function editMemberNameKeyBoard(e) {
const inputFiled = e.target.closest('.member-in-list').querySelector('.new-member-name');
const memberName = e.target.closest('.member-in-list').querySelector('.memebr-name');
const memberId = e.target.closest('.member-in-list').getAttribute('data-id');
console.info(memb... | [
"function editMemberNameKeyBoard(e) {\n const inputFiled = e.target.closest('.member-in-list').querySelector('.new-member-name');\n const memberName = e.target.closest('.member-in-list').querySelector('.memebr-name');\n\n\n\n if (e.keyCode === 13) {\n if (e.target.value) {\n\n //to toggle sapn\\inpute\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieve all sport pref info | function handleReadAllSportPrefInfo(agent) {
// Payload base
var localBasePayload = fbBasePayload;
var senderID = getSenderID();
return admin.database().ref('pazienti/' + senderID + '/preferenze/sport/').once('value').then((snapshot) => {
let sportPref = snapshot.val();
... | [
"function getFacts() {\n API.getCountryFacts(country).then((res) => {\n setFacts(res.data);\n });\n }",
"function getList() {\r\n // URL to access list of all Pokemon names and URLs from PokeAPI\r\n const POKEMON_LIST_URL = \"https://pokeapi.co/api/v2/pokemon/?offset=0&limit=964\";\r\n\r\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends an updated progress to the websocket | reportProgress() {
if (this._reportProgressHandler) {
clearTimeout(this._reportProgressHandler);
this._reportProgressHandler = false;
}
ImporterWebsocket.progressUpdated(this.progress);
} | [
"sendProgress() {\n // compute number of tests if not done so already\n if (!this.testCount) {\n this.testCount = 0;\n this.frameworks.forEach(framework => {\n framework.tests.forEach(test => {\n this.testCount++;\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accepts multiple mixed jquery and string object ands concatenates them to one htmlstring. Parameter: arguments | function createMixed(/*arguments*/) {
let result = "";
for (let arg = 0; arg < arguments.length; ++arg) {
let part = arguments[arg];
if (typeof part === "string") {
result += $("<div>").text(part).html();
} else if (part instanceof jQuery) {
... | [
"function renderToJQ(str, objects) {\n var template = chooseTemplate(str),\n lines = [];\n\n renderEach(objects, function (i, obj) {\n var resultsArray = makeNodes(tokenize(template), obj),\n nodes = resultsArray[0];\n\n // Check for tokens left over in ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
normalized: List >, init?: List[ Map, n: number ] > List[ Map, number ] Helper function for reduceData and reduceDataBulk. Reduces a List of Maps into one Map, adding everything together. Returns a pair consisting of the reduced Map, along with the number of sites the reduction is based on. | function reducer (normalized, old = Map(), n = 0) {
const reduced = normalized.reduce(
(acc, instance) => acc.mergeWith((prev, next) => prev + next, instance),
old
);
const newCount = n + normalized.size;
// Filter out zero-valued props
const filtered = reduced.filter(val => val > 0);
return List.... | [
"function mergeMap (map) {\n if (map instanceof Map) {\n map.forEach((count, metric) => {\n add(metric, count)\n })\n }\n }",
"_doubleEntriesSizeAndRehashEntries() {\n const entries = this._entries;\n const oldLength = this._entryRange;\n const newLength = oldLength * 2;\n //Re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a list where each entry is a tuple of [group object, list of items belonging to that group], produce a new list of the top grouped items. We used to also produce an "other" aggregation, but that turned out to be conceptually difficult to deal with, so that's gone, leaving this method with much less to do. | makeTopGroups(aAttrDef, aGroups, aMaxCount) {
let nounDef = aAttrDef.objectNounDef;
let realGroupsToUse = aMaxCount;
let orderedBySize = aGroups.concat();
orderedBySize.sort(this._groupSizeComparator);
// - get the real groups to use and order them by the attribute comparator
let outGroups = o... | [
"facetComplexItems(aItems) {\n let attrKey = this.attrDef.boundName;\n let filter = this.facetDef.filter;\n let idAttr = this.facetDef.groupIdAttr;\n\n let groups = (this.groups = {});\n let groupMap = (this.groupMap = {});\n this.groupCount = 0;\n\n for (let item of aItems) {\n let vals =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the metadata cont_var list | function update_cont_var_list(divid){
var c_url = '/metadata/cont_var/list';
var cAjax = new Ajax.Updater(divid, c_url, {});
} | [
"function updateDef(){\n\tinstDef.setparse(\"METADATA\", metaDict.stringify());\n\tinstDef.setparse(\"DATA\", dataDict.stringify());\n}",
"function setVocabMetadata(lang, text, text_comp, bookslist, text_from, text_to, add_remove) {\n\n words_metadata = {\"language\":lang, \"text\":text, \"text_comp\":text_com... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME:multipleSession AUTHOR:Mary Grace P. Delos Reyes DATE:mach 26, 2014 MOTIFIED BY : REVISON DATE: REVISON : DESCRIPTION :Chat group Conversation PARAMETERS: /FUNCTION NAME: loadChatSession AUTHOR:Mary Grace P. Delos Reyes DATE:February 1, 2014 MOTIFIED BY : REVISON DATE: REVISON : DESCRIPTION :Chat load PAR... | function loadChatSession(){
// var url ="https://"+CURRENT_IP +"/cgi-bin/Final/NFast_RM/NFastRMCGI.py?"
// var url = 'https://'+CURRENT_IP+'/cgi-bin/NFast_3-0/CGI/RESERVATIONMANAGER/FastConsoleCgi.py?action=getmessage&query=username='+globalReciever+'^userFrom='+globalUserName;
// var query = "username="+globalReciever... | [
"function getSession(text) {\n\n return text.substring(text.search('Session ID:')).split('\\n', 1)[0];\n\n }",
"function get_converted_session_data_from(from_table) {\n\t// TODO: the to_table is also relevant for round tripping!\n\t// Because we have a Players table and a Teams Table in tw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables the Edit Prefs including the Preferences view (Custom Edit Prefs) menu item in the widget menu to be clicked. Widget providers should use this function when initializing their widgets after determining if the widget has preferences to modify. | function enableEditPrefsMenuItem(regionWidgetId, isPreferencesView) {
// setup the edit prefs widget menu item
var $menuItemEditPrefs = $("#widget-" + regionWidgetId + "-menu-editprefs-item");
$menuItemEditPrefs.removeClass("menu-item-disabled");
$menuItemEditPrefs.b... | [
"function switchToAssocEditor() {\n $scope.editSection = 'assoc-editor';\n }",
"function enableButtons()\n{\n\tg_Options[g_TabCategorySelected].options.forEach((option, i) => {\n\n\t\tlet enabled =\n\t\t\t!option.dependencies ||\n\t\t\toption.dependencies.every(config => Engine.ConfigDB_GetValue(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
complete task in todoist | function task_complete_todoist(task_name, project_id, todoist_api_token) {
todoist_api_token = todoist_api_token || 'a14f98a6b546b044dbb84bcd8eee47fbe3788671'
return todoist_add_tasks_ajax(todoist_api_token, {
"content": task_name,
"project_id": project_id
}, 'item_complete')
} | [
"function isTodoCompleted(todo) {\n return todo.isDone;\n }",
"function toggleComplete(taskName) {\n var task = TaskListNamespace.taskList.tasks[taskName];\n var calendar = TaskListNamespace.cal;\n\n var p = new promise.Promise();\n task.completed = !task.completed;\n\n var req = {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates the next x,y for defence | function calcNextDefenceCoordinates(data) {
var ret = {x: 0, y: 0};
ret.x = Math.floor((battleSettings.defenceXCounter * data.cols / battleSettings.boardResolution + battleSettings.defenceYCounter % 3 * battleSettings.defenceBlockPixelShiftX) % data.cols);
ret.y = Math.floor((data.rows - (battleSettings.de... | [
"function val2between({\n xy, //function y(x) set as pairs in array [e1,e2]\n x, //\"anchor\" value of x,\n //By default y=e1, x=e2,\n inv, //inverse pairs, means x=e2, y=e1,\n }){\n var xy = xy;\n var alen = xy.length;\n var alen1 = xy.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INTERNAL: Send the next command in the queue OR clears to send if none. | sendNextCommand() {
if (this.commandQueue.length > 0) {
this.socket.send(this.commandQueue[0]);
this.cts = false;
}
else {
this.cts = true;
}
} | [
"_sendRequestFromQueue () {\n while (this[ _requestQueue ].length > 0) {\n const request = this[ _requestQueue ].shift()\n this._sendRequest(request)\n }\n }",
"_sendPossibleCommands() {\n const active_ids = new Set(Array.from(this._currently_allocated_ids).map(k => parseInt(k, 10)))\n Obje... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
transfer records from swap_table to stable_tree | function transferSwapToStable(callback) {
// remove all previous records of stable tree
con.query('DELETE FROM stable_tree;', function(err, result) {
if (err) throw err;
con.query('ALTER TABLE stable_tree AUTO_INCREMENT = 1;', function(err, result) {
if (err) throw err;
// migrate tree data into actual tabl... | [
"function table_put(dsid, tb) {\n const fixid = a => a ? a.map((row, x) => ({ ...row, id: x+1, })) : [];\n\n const newtb = (tb.id) \n ? topStack().tables.map(t => t.id === tb.id ? { ...t, ...tb } : t)\n : [ ...topStack().tables, { \n id: topStack().tables.length + 1,\n //rows: [], \n d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====== USER OBJECT FUNCTIONS ======// Set user object in localStorage and save all usernames in common list | function setGameObject(userName, obj){
var newUsername = 'usr_' + userName;
localStorage.setItem(newUsername, JSON.stringify(obj));
if(localStorage.getItem("gameUsersList") == undefined){
var list = new Array();
list[0] = userName;
localStorage.setItem("gameUsersList", JSON.stringify(list));
}
else
{
var ... | [
"function saveUsers() {\n localStorage.setItem(\"trivia-users\", JSON.stringify(users));\n}",
"function init() {\n var storedUsers = JSON.parse(localStorage.getItem(\"Users\"));\n if (storedUsers !== null) {\n users = storedUsers;\n //renderUsers();\n }\n}",
"function loadUsers() {\n var lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a property to filterObject, then reloads the grid. | function filterGrid(filterProperty) {
//alert("filterGrid --> " + filterProperty);
filterObject[filterProperty] = this.value().join();
saveCustomFiltersToCookie();
$(this.element).parents('.filters').hide();// to hide the multiselect dropdown.
$('.k-icon.k-filter.show-filter' + filterProperty).... | [
"function set_with_filter(newValue) {\n\t\tif (filter) {\n\t\t\teachIndex(filter, function (fn) {\n\t\t\t\tif (fn) {\n\t\t\t\t\tnewValue = fn.call(obj, newValue);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tset_without_filter(newValue);\n\t}",
"function cancelFilter(filterProperty) {\r\n // debugger;\r\n //alert(\"ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Marcar los registros que tienen la marca de Nuevos como ya vistos por el usuario indicado | function MarcarComoVistos(registros, usuario){
var idsNuevos = new Array();
//Obtener los ids de los registros nuevos
for (var i=0; i < registros.length; i++){
if (registros[i].Nuevo)
idsNuevos.push(registros[i]._id);
}
//Actualizar la BD
accesoMongo.ActualizarSolicitudesVistas(
function () ... | [
"function AnalizarRegistrosVistos(registros, usuario){\n //Recorrer registros\n for (var i=0; i<registros.length; i++){\n //Verificar si el usuario ya vió esta solicitud\n registros[i].Nuevo = !registros[i].VistoUsuarios.includes(usuario);\n\n //Borrar propiedad, ya que puede informar nombres de otros us... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rents out one Economy car if any are available | function econCars() {
if (carRental.econAvail() > 0) {
carRental.bookEcon();
} else alert("no cars available");
} | [
"async sellCar(ctx, carCRN, dealerCRN, adhaarNumber) {\n //Verify if this funtion is called by Dealer\n let verifyDealer = await ctx.clientIdentity.getMSPID();\n //calling the function carDeatils to retrieve the car details\n let carObject = this.carDetails(ctx, carCRN);\n //Verify if the function is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set ticket's rows that are "Resolved" to Grey CCCCCC and sends email to client notifying them that their ticket has been resolved | function darkenResolvedTickets(e) {
var statusColumnIndex = getColIndexByName("Status", sheet); // Column index for "Status"
// If the edit was in the "Status" column and value is "Resolved"
if(e.range.getColumn() == statusColumnIndex && e.range.getValue() == "Resolved"){
var row = e.range.getRow();
... | [
"function assignedEmailStatusUpdate(e) { \n var assignedColumnIndex = getColIndexByName(\"Assigned\", sheet); // Column index for \"Assigned\"\n // If edited cell was in \"Assigned\" column\n if(e.range.getColumn() == assignedColumnIndex) { \n var employeeDataSheet = SpreadsheetApp.openById(sheetID).getS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show master to change the child | function showDialog(){
debug('Action');
master.show(new Array({name: "Child", data:childrenList},
{name: "Action", data:actions},
{name: 'Shape', data:iceCreamShapes},
{name: 'Taste', data:iceCreamTastes})
, onComplete);
document.... | [
"onAfterShow(msg) {\r\n super.onAfterShow(msg);\r\n this.parent.update();\r\n }",
"function showParent($node) {\n // just show only one superior level\n var $temp = $node.closest('table').closest('tr').siblings().removeClass('hidden');\n // just show only one line\n $temp.eq(2).childr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a Color4 value containing a green color | static Green() {
return new Color4(0, 1.0, 0, 1.0);
} | [
"static Green() {\n return new Color3(0, 1, 0);\n }",
"static Red() {\n return new Color4(1.0, 0, 0, 1.0);\n }",
"function Color4(/**\n * Defines the red component (between 0 and 1, default is 0)\n */r,/**\n * Defines the green component (between 0 and 1, defa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws the circles representing the tree nodes tree: the BST svgContainer: the SVG coordinate space jsonNodes: an array of nodes in JSON format | function drawNodes(tree, svgContainer, jsonNodes) {
//add SVG circles to the svgContainer and bind data to circles
var circles = svgContainer.selectAll("circle")
.data(jsonNodes)
.enter()
.append("circle");
//set the circle attributes
var circleAttributes = circles
.attr... | [
"function drawAnimatedNode(tree, svgContainer, animatedNode, xpos, ypos) {\n\n //Special case: when there is only one item, there is nothing to animate\n if(tree.size() === 1) {\n //clear the screen\n svgContainer.selectAll(\"circle\").remove();\n svgContainer.selectAll(\"line\").remove()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
general function that animates pad and play sounds | function animatePad(padNumber, background1, background2, boxShadow, sound){
if (soundIsOn) { //check if sound is turned on; if yes animate pad and play sound
$(padNumber).animate({ backgroundColor: background1 }, 200).animate({ backgroundColor: background2 }, 400).css('box-shadow', `0px 0px 1px 2px... | [
"function animateAndSound(arg) {\n $(arg).fadeOut(150).fadeIn(150);\n soundIndex = slices.indexOf(color);\n sounds[soundIndex].play();\n}",
"function playAnimations() {\n animator.start();\n}",
"function playStuff() {\r\n\t\tgsapAnimation(this);\r\n\t\tuserClicks.push(\"#\"+this.id);\r\n\t\tcheckCorrectne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs a bulk of Ctrl clicks. | static bulkCtrlKey(selectors) {
return bulkOfClicks(Action.ctrlClick, selectors);
} | [
"static async ctrlClick(selector) {\n return JQueryAction.click(selector, {ctrlKey: true});\n }",
"static bulkShiftKey(selectors) {\n return bulkOfClicks(Action.shiftClick, selectors);\n }",
"function countClicks() {\n\tcounter += 1;\n\tdocument.onkeydown = function (e) {\n\t\tif (e.target =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. Transform Functions We don't have any since the input reminder string is exactly what we want to display. 3. Create Functions / Create a new "done" link that will cross off the given reminder list item. | function createDoneLink(reminderItem) {
var doneLink = $('<a></a>');
doneLink.text('X');
doneLink.attr('href', '');
// Part of setting up the "done" link is ensureing it can cross the item off.
// It's okay to register a callback here.
doneLink.on('click', function(event) {
// Prevent clicking on the li... | [
"function createReminderItem(reminderString) {\n var reminderItem = $('<li></li>');\n reminderItem.text(reminderString);\n var doneLink = createDoneLink(reminderItem);\n reminderItem.append(doneLink);\n return reminderItem;\n}",
"function onClickCalendarDate(e)\n{\n//JBARDIN\n var button = this;\n var date... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate chunks loaded, 2205 is chunks loaded by 5 players with view distance of 10 | function calcModernChunks(viewDistance, maxPlayers) {
return roundMemory((viewDistance * maxPlayers) / 2205);
} | [
"function calcLegacyChunks(viewDistance, maxPlayers) {\n return roundMemory((viewDistance * maxPlayers) / 4410);\n}",
"function updateVisible() {\n var \n u, v, w, chunk, hash;\n \n var pos = Forge.Player.getRegion();\n var new_visible_hash = {};\n var old_visible_array;\n var chunks_to_qu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function subtracts Saree number for W_W&I by 1 | function countSareeWwiMinus() {
if(instantObj.noOfSareeWWI > 0) {
instantObj.noOfSareeWWI = instantObj.noOfSareeWWI - 1;
countTotalBill();
}
} | [
"function countSareeWwfMinus() {\n\t\t\tif(instantObj.noOfSareeWWF > 0) {\n\t\t\t\tinstantObj.noOfSareeWWF = instantObj.noOfSareeWWF - 1;\n\t\t\t\tcountTotalBill();\n\t\t\t}\n\t\t}",
"function countShirtWwiMinus() {\n\t\t\tif(instantObj.noOfShirtWWI > 0) {\n\t\t\t\tinstantObj.noOfShirtWWI = instantObj.noOfShirtWW... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The modifier updated its arguments. | didUpdateArguments () {
} | [
"enterParameterModifier(ctx) {\n\t}",
"function makeArgChanges() {\n //Only do the alterations if the arguments indicate a real or preview\n //run of the program will be executed.\n validateArgs();\n if (-1 !== aargsGiven.indexOf('-repo')) {\n oresult.srepo = PATH.normalize(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tableExpression3 > tableExpression inner join tableExpression on expression | function tableExpression3( machine )
{
onclause = machine.popToken();
machine.checkToken("on");
rhs = machine.popToken();
machine.checkToken("join");
machine.checkToken("inner");
lhs = machine.popToken();
machine.pushToken( new joinExpression( "inner", lhs, rhs, onclause.... | [
"function tableExpression2( machine )\n {\n rhs = machine.popToken();\n machine.checkToken(\"join\");\n machine.checkToken(\"inner\");\n lhs = machine.popToken();\n machine.pushToken( new joinExpression( \"inner\", lhs, rhs, \"true\" ) );\n }",
"function tableExpression4( machin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides a concise syntax to create an Op object. |side| is used by TransformStream to distinguish between the two strategies. | function op(type, name, side = undefined) {
return new Op(type, name, side);
} | [
"function createBinaryExpression(op, left, right) {\n \treturn {\n \t\ttype: 'BinaryExpression',\n \t\top: op,\n \t\tleft: left,\n \t\tright: right\n \t};\n}",
"_applyShapeAtSide(shape, side) {\n const viewBox = ShapeWebcomponent.registeredShapes[shape].viewBox || '0 0 1440 320';\n const ratio = viewBox.spl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the distance from the top edge of the first slide to each slide (init) => slidePositions | function setSlidePositions () {
slidePositions = [0];
var attr = horizontal ? 'left' : 'top',
attr2 = horizontal ? 'right' : 'bottom',
base = slideItems[0].getBoundingClientRect()[attr];
forEach(slideItems, function(item, i) {
// skip the first slide
if (i) { slidePositions.push... | [
"function getOffsets() {\n // Set a static position before getting the offsets\n $articleHeading.css('position', 'static');\n $articleHeading.each(function (idx) {\n articleHeadingOffset[idx] = $(this).offset().top;\n })\n // Clear style attr\n $articleHeading.attr('style', '');\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translates survey progress into section progress | function calculateSectionProgress(surveyProgresses){
var sectionProgresses = {};
$.each(surveyProgresses, function(i, surveyProgress){
var progress = sectionProgresses["progress_" + surveyProgress.sectionId];
if(progress == null){
sectionProgresses["progress_" + surveyProgress.sectionId] = {'resp':surveyP... | [
"checkOnComplete() {\n let questionNo = 0;\n const plainData = this.props.survey.getPlainData();\n for (let i = 0; i < this.hashmap.length; i++) {\n const numOfQuestionForSubsection = this.hashmap[i].ele.elements[0].elements.length;\n const subSectionName = this.hashmap[i].ele.elements[0].title;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the proper [linebreak]( string for this state. | get lineBreak() {
return this.facet(EditorState.lineSeparator) || '\n'
} | [
"function getLineBreak(theForm){\n var retVal;\n var selInd = theForm.WhichPlatform.selectedIndex;\n\n switch (selInd){\n case 0:\n\t retVal = \"\\r\\n\";\n\t\t break;\n\t case 1:\n\t retVal = \"\\r\";\n\t\t break;\n\t case 2:\n\t retVal = \"\\n\";\n\t\t break;\n }\n \n return retVal;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns pull header state | function _getPullHeaderState(instance) {
var state = instance.data('pullHeaderState');
if (!state) {
// If unknown : take 'initial' as default
state = 'initial';
}
return state;
} | [
"function _changePullHeaderState(instance, state) {\n \n var settings = instance.data('options');\n var contentWrapper = _getMarkupCache(instance, 'contentWrapper');\n var pullHeader = contentWrapper.children('.scrollz-pull-header');\n \n if (!pullHeader.hasClass(state)) {\n pullHeader.replac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 244 Create a function that takes an array of items and checks if the last item matches the rest of the array. | function matchLastItem(arr) {
let a = ''
for (let i = 0; i < arr.length - 1; i++) {
a += arr[i];
}
return a === arr[arr.length - 1];
} | [
"function hops(arr) {\nvar current = 0;\nvar flag = false;\n\twhile (current !== arr.length - 1) {\n\t\tcurrent += arr[current];\n\t\tif (current === arr.length - 1) {\n\t\t\treturn true;\n\t\t} else if (current === current + arr[current]) {\n\t\t\treturn false;\n\t\t}\n\t}\n}",
"function allSame (arr) {\n\t if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates user survey info in profile depending on type of survey | 'update_userSurvey'(objectID, survey_type)
{
if (survey_type == 'personal')
{
Meteor.users.update(
{_id: Meteor.userId()},
{$push:
{
"profile.personal_survey": objectID
}
});
}
else if (survey_type == 'employer')
{
Meteor.users.u... | [
"async displayProfile(step) {\n const user = await this.userProfile.get(step.context, {});\n const survey_result = await this.survey_result;\n const results = \"\" ;\n for(let e in survey_result.values()) {\n results += e; \n };\n \n await step.context.sen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all Portal Objects | getPortals() {
let portals_buffer = [];
let rooms_buffer = getReferenceById(g_gamearea.ID).AGRooms;
this._AGroomID = rooms_buffer[0].ID;
if (getReferenceById(this._AGroomID).AGobjects.length > 0) {
getReferenceById(this._AGroomID).AGobjects.forEach(function (element) {
... | [
"function Portal({ container, children }) {\n const [mountNode, setMountNode] = useState(null);\n\n useEffect(() => {\n setMountNode(container ? container.current : document.body);\n }, [container]);\n\n if (mountNode) {\n return ReactDOM.createPortal(children, mountNode);\n }\n\n return null;\n}",
"c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update cuePoint status by id. | static updateStatus(id, status){
let kparams = {};
kparams.id = id;
kparams.status = status;
return new kaltura.RequestBuilder('cuepoint_cuepoint', 'updateStatus', kparams);
} | [
"static update(id, cuePoint){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.cuePoint = cuePoint;\n\t\treturn new kaltura.RequestBuilder('cuepoint_cuepoint', 'update', kparams);\n\t}",
"static updateStatus(id, status){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\tkparams.status = status;\n\t\tretu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets the message asynchronously | set (message) {
this.message = message
return Promise.resolve()
} | [
"set message(message) {\n this.result.message = message;\n }",
"async processSingleMessage(message) {\n\n }",
"async function generateMessageAsync() {\n\tvar messagePromise = new Promise(function(resolve, reject) {\n\t\tsetTimeout(() => {\n\t\t\tconst newMessage = {\n\t\t\t\thi: \"async\",\n\t\t\t\ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables the keyboard controls | startKeyboardControl() {
this.state.keyboardEnabled = true;
} | [
"function enableKeyEvents() {\n lumx.isFocus = true;\n $document.on('keydown keypress', _onKeyPress);\n }",
"function enableControls() {\n $(\"button.play\").attr('disabled', false);\n $(\"select\").attr('disabled', false);\n $(\"button.stop\").attr('disabled', true);\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Paul Tero, July 2001 Optimised for performance with large blocks by Michael Hayworth, November 2001 Modified by Recurity Labs GmbH THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DI... | function des(keys, message, encrypt, mode, iv, padding) {
//declaring this locally speeds things up a bit
var spfunction1 = new Array(0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400,
0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400... | [
"function des (key, message, encrypt, mode, iv, padding) {\n //declaring this locally speeds things up a bit\n var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x10... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears form data hides the form | function clearAndHideForm() {
clearForm();
hideForm();
} | [
"function clearForm() {\n form.reset();\n }",
"function clear_form(){\n $(form_fields.all).val('');\n }",
"function clearDataForm() {\r\r\n $(\"#datInputDateTime\").val(\"\");\r\r\n $(\"#numTotalPeople\").val(\"\");\r\r\n}",
"_hideFormElements()\r\n {\r\n $(this.el).find('#filt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disappear after the duration expired | expire() {
this._disappear()
} | [
"function stopTimer () {\r\n\tif (showCardsTime === 5) {\r\n\t\tremoveShow();\r\n\t\tclearInterval(showCardsTimer);\r\n\t}\r\n}",
"hide() {\n\t\tlet _ = this\n\n\t\t_.timepicker.overlay.classList.add('animate')\n\t\t_.timepicker.wrapper.classList.add('animate')\n\t\tsetTimeout(function () {\n\t\t\t_._switchView('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a previous result value to id values in a nested array. For a single id value and a single previous result then the previous value is added directly. For arrays we put all of the ids from the previous result array in a map and add them to id values with the same id. This function does not mutate. Instead it return... | function addPreviousResultToIdValues(value, previousResult) {
// If the value is an `IdValue`, add the previous result to it whether or not that
// `previousResult` is undefined.
//
// If the value is an array, recurse over each item trying to add the `previousResult` for that
// item.
if (Objec... | [
"function updatePreviousBatch(curArr){\n for(var i=0; i < curArr.length; i++){\n previousProducts[i] = curArr[i];\n }\n\n}",
"static _groupByOrderNumber(results, newLineItemState) {\n const existingItem = results.find(\n (lineItem) => lineItem.orderNumber === newLineItemState.orderNumber\n )\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send firmware update starting to the hub | function sendStartingUpdate(pending, callback) {
var patch = {
firmware: {
pendingFwVersion: pending,
fwUpdateStatus: 'current',
fwUpdateSubstatus: '',
lastFwUpdateStartTime: new Date().toISOString()
}
};
deviceTwin.properties.reported.update(patch, function(err) {
callback(err... | [
"function OnUpdateFirmware(force, connid) {\n let RaucHandler = require('./RaucHandler');\n let raucHandler = new RaucHandler();\n raucHandler.on('progress', function (progressInfo) {\n log(progressInfo);\n });\n raucHandler.raucGetSlotStatus(function (err, platformStat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find King of Specific Color | function findKing(squares, color) {
for (let j=0; j < 64; j++) {
if (squares[j].piece === "King" && squares[j].color === color) {
return (j);
}
}
} | [
"FindIndexOfFace(color){\n let faceIndex = -1;\n this.faces.forEach((face, index) => {\n if (face.color == color){\n faceIndex = index;\n }\n })\n return faceIndex;\n }",
"function checkCube() {\n//===============================\n var check = f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fits the number into specific `min` and `max` bounds. | function fitNumber(value, min, max) {
if (value > max) {
return max;
} else if (value < min) {
return min;
}
return value;
} | [
"function minMaxSet() {\n min = parseInt(minRange.value);\n max = parseInt(maxRange.value);\n}",
"function bound (n, min, max) {\n return Math.min(max, Math.max(min, n))\n}",
"function clamp(n, min, max) {\n return isNumeric(n) ? Math.min(Math.max(n, min), max) : min;\n}",
"function constrain(n, min, max)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the HTML for the notified column in the inventory table. | function createNotifiedCol(item) {
return '<td align="center"><span id="' + getNotifiedSpanID(item.itemNumber)
+ '" onclick="processNotifiedClick(' + item.itemNumber
+ ')" title="Click to be notified again"></span></td>';
} | [
"function createAvailabilityCol(item) {\n\tvar stockClass = (item.isInStock ? 'inStock' : 'outOfStock');\n\tvar stockText = (item.isInStock ? 'In Stock' : 'Out of Stock');\n\treturn '<td class=\"stock ' + stockClass + '\">' + stockText + '</td>';\n}",
"function createDescriptionCol(item) {\n\treturn '<td align=\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse the daylight saving rule for the given year return epoch seconds (local time) | function parseRule(year, rule) {
var
inMonth = rule[0],
onDay = rule[1],
atHour = rule[2],
week = ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
m = $.inArray(inMonth, [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul... | [
"function dayOfProgrammer(year) {\n let adjustment = 0;\n if (year < 1918 && year % 4 === 0){\n adjustment = 1;\n } else if (year === 1918){\n adjustment = -13;\n } else if ((year > 1918) && ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0))){\n adjustment = 1;\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DEPRECATED by now, Tours will be generated deivers empty bound to instance return a single tour by tourName: getTour(tourName) | getTour(tourName){
return this.tourMap.get(tourName);
} | [
"function Tour() {\n\t}",
"function findTour(band) {\n return db.query(`SELECT tours.id, tour_date, venues.name, venues.address, venues.id AS venue_id FROM tours, venues WHERE tours.band_id=$1 AND tours.venue_id = venues.id ORDER BY tour_date`, [band.id]);\n}",
"getTourNames(){\n return this.tourMap.k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the client is started. Sets background processes running. | start() {
this._clientRunning = true;
} | [
"function startReadyProcesses()\n {\n // Start as many processes as we can!\n //writeToLog(\"INFO\", \"***** maxNumberOfRunningProcesses = \" + maxNumberOfRunningProcesses + \"; numberOfRunningProcesses = \" + numberOfRunningProcesses);\n var numVertices = graph.vertexCount();\n var v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load nodes or summary, depending on request parameters, save firstrun state in history | function pageLoad(){
var pagestate;
if(filterParams.filterName || filterParams.filter|| filterParams.filterAll ){
nodeFilter.setPageParams(filterParams);
nodeFilter.updateMatchedNodes();
pagestate=nodeFilter.getPageParams();
nodeSummary.reload();
}else{
nodeFilter.re... | [
"function load() {\n numOfPages();\n loadList();\n}",
"function loadExecution(model, resource, jsonld) {\n model.execution.iri = resource['@id'];\n model.pipeline.iri = jsonld.getReference(resource,\n 'http://etl.linkedpipes.com/ontology/pipeline');\n var status = jsonld.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Not W3C conform, but we need the path for handling! FileWriter interface (derives from FileSaver) | function FileWriter() {
} | [
"function getFileWriter(path, options) {\n var q = $q.defer();\n getFileEntry(path, options)\n .then(function(fileEntry) {\n fileEntry.createWriter(q.resolve, q.reject);\n }, q.reject);\n return q.promise;\n }",
"function saveStringToFile(string, filename) {\n\tvar fileObj = fil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Arabic word context checkers | function arabicWordStartCheck(contextParams) {
var char = contextParams.current;
var prevChar = contextParams.get(-1);
return (
// ? arabic first char
(prevChar === null && isArabicChar(char)) ||
// ? arabic char preceded with a non arabic char
(!isArabicChar(prevChar)... | [
"function menutoshowlang(){\n}",
"function CheckArabicword(field) {\n\tif(isEmpty(field)){\n\t\treturn true;\n\t}\n\tvar string = field.value;\n\tfor (i = 0; i < string.length; i++) {\n\t\tvar c = string.charAt(i);\n\t\tif (!isArabic(c) && c != ' ') {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function Calculates College GPA | function calculateCollegeGPA() {
var sum = 0;
var creditSums = 0;
var grades = [];
var credits = [];
var finalGPA = 0;
var i;
for (i = 1; i < counter + 1; i++) {
if (document.getElementById("grade" + i).value !== "") {
grades.push(parseFloat(document.getElementById("grade" + i).value));
}
... | [
"gpaCalc() {\r\n let totalPoints = 0;\r\n let totalUnits = 0;\r\n const macPoints = {\"A+\": 12, \"A\": 11, \"A-\": 10,\r\n \"B+\": 9, \"B\": 8, \"B-\": 7,\r\n \"C+\": 6, \"C\": 5, \"C-\": 4,\r\n \"D+\": 3, \"D\": 2, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParsermethodInvocation_lfno_primary. | exitMethodInvocation_lfno_primary(ctx) {
} | [
"exitMethodInvocation_lf_primary(ctx) {\n\t}",
"enterMethodInvocation_lfno_primary(ctx) {\n\t}",
"exitClassInstanceCreationExpression_lfno_primary(ctx) {\n\t}",
"exitMethodReference_lf_primary(ctx) {\n\t}",
"exitClassInstanceCreationExpression_lf_primary(ctx) {\n\t}",
"exitMethodDeclarator(ctx) {\n\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Suma eliptica recibe dos arreglos de largo 2 donde el primer elemento del arreglo es el componente x del punto y el segundo elemento es el componente y. La tercera y cuarta variables son las constantes de la curva eliptica. | function sumaEliptica(x, y, a, b){
var resultado = [];
if(x[0] == y[0] && x[1] == -y[1]){
return null;
}
if(x[0] == y[0] && x[1] == y[1]){
var lambda = (3*Math.pow(x[0],2)+a)/(2*y[0]);
}else{
var lambda = (y[1]-y[0])/(x[1]-x[0]);
}
resultado[0] = Math.pow(lambda,2)-x[0]-y[0];
resultado[1] = lambda*(x[0... | [
"function pitagoroTeorema (x, y) {\nvar rezultatas = ( x * y ) + ( y * y);\n console.log(\"Ilgoji trikampio kraštinė:\", rezultatas);\n}",
"function pitagoroTeorema(x, y) {\nvar ilgosKrastinesIlgis = Math.sqrt(Math.pow(x,2)+Math.pow(y,2));\nconsole.log(ilgosKrastinesIlgis);\n}",
"function movimentaBolinha(){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form Reset sl means the form selector form')"> | function resetForm(sl) {
document.querySelector(sl).reset();
} | [
"function resetForm() {\n setInputs(initial);\n }",
"function resetForm() {\n $leaveComment\n .attr('rows', '1')\n .val('');\n $cancelComment\n .closest('.create-comment')\n .removeClass('focused');\n }",
"function resetForm() {\n $form... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mousemove does the same as for mouseenter, but the event has coordinates relative to the iframe. | function mousemove(e) {
var ifrPos = eventXY(e) // mouse from iframe origin
var xyOI = iframeXY(iframe) // iframe from window origin
var xySW = scrollXY(window) // window scroll
var xySI = scrollXY(iwin) // iframe scroll
// mouse in iframe viewport
var xyMouse = xy.subtract(ifrPos, x... | [
"function updateMouse(e) {\n mouseX = e.pageX;\n mouseY = e.pageY;\n}",
"function onMouseMove(event) {\n const x = event.layerX - CANVAS_BORDER_WIDTH;\n const y = event.layerY - CANVAS_BORDER_WIDTH;\n\n // upon cursor entering the canvas, the 'mouseenter' and 'mousemove'\n // events both trigger, registerin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |