query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
end updatePlayerSlotGameState Timer_VariableIntervalScript:updateAISlotGameState() Updates the AI's game state to reflect new choices being made available. | function updateAISlotGameState() {
//create a blank "choice" GameAction
var g:GameAction = ScriptableObject.CreateInstance('GameAction');
g.setActionType(ActionType.Choice);
//check if the slots are occupied, if not, add a GameAction to it
var aiSlotOne:GameAction = GameStateScript.ge... | [
"function myUpdate () {\r\n //make sure that the time is based on when this script was first called\r\n //instead of when the game started\r\n \t\r\n\ttimeSinceLast += Time.deltaTime; // increment how long it's been since the last update\r\n\tif (timeSinceLast >= timeUntil) {\r\n\t\t// update the random next ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the movie list component if appropriate (after a search) | movieListCondition() {
if (this.state.movies != null) {
return <Grid className="MovieList" item xs={12}>
<MovieList count={Math.ceil(this.state.searchCount / 10 )} page={this.state.page} movies={this.getMovies()} clickHandler={this.updateCurrentMovie} onPageChange={this.onPageChange}></MovieList>
... | [
"renderList() {\n if (this.props.items.length === 0) {\n const message = \n <h3 className=\"message\">No movies found. Try altering your search\n options!</h3>;\n return message;\n }\n else {\n const items = this.props.items.map(item => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The toplevel symbol table for the body of this file. | get symbolTable() {
return this.ast.symbolTable;
} | [
"getSymbolTable() {\n let node = this;\n while (node) {\n if (node.symbolTable) {\n return node.symbolTable;\n }\n node = node.parent;\n }\n }",
"function SymbolTable() {\n this.scopeId = 0;\n this.tree = new TreeModel();\n\n // Sets... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to compare choices to determine winner NOTE: can 1) put human and computer at the global level, 2) put human and computer as function arguments, 3) define human and computer INSIDE of determineWinner | function determineWinner(human, computer) {
if ((human == ROCK && computer == PAPER)
|| (human == PAPER && computer == SCISSORS)
|| (human == SCISSORS && computer == ROCK)) {
console.log(`Computer`);
return COMPUTER;
} else if ((human == PAPER && computer == ROCK)
|| (human == SCISSORS && com... | [
"function determineWinner() {\n console.log(\"determine winner\");\n\n // options if player chose rock\n if (playerChoice == rock && computerChoice == \"rock\") {\n showDraw();\n } \n \n if (playerChoice == rock && computerChoice == \"paper\") {\n showLoss();\n } \n \n if (p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The render Statement renders the board and all 9 squares the divs have classNames of boardrow which refers the Custom CSS in index CSS | render() {
return (
<div>
<div className="board-row">
{this.renderSquare(0)}
{this.renderSquare(1)}
{this.renderSquare(2)}
</div>
<div className="board-row">
{this.renderSquare(3)}
{this.renderSquare(4)}
... | [
"render() {\n return (\n <div>\n <div className=\"board-row\">\n {this.renderSquare(0)}\n {this.renderSquare(1)}\n {this.renderSquare(2)}\n </div>\n <div className=\"board-row\">\n {this.renderSquare(3)}\n {this.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make a proper request to twitter using the this._request local returns a promise request is used as a helper function to get and post | request(opts) {
opts.params = opts.params || {};
// build request options
const _options = {
method: opts.method ? opts.method.toLowerCase() : "get",
uri: this.endpoint(opts.path)
}
switch (_options.method) {
case "get":
_options.qs = opts.params;
break;
case "post":
... | [
"function fetchTweets(tweetBox,userInput,submitBtn) {\n var request = new XMLHttpRequest();\n var screen_name = userInput.value;\n var requestUrl = '/get_tweets/?screen_name=' + screen_name;\n console.log(requestUrl);\n request.open(\"GET\",requestUrl,true);\n request.send();\n submitBtn.innerH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Declare a function printMemberProps that accepts an object and outputs the value of the name and instrument properties to the console | function printMemberProps(member){
console.log(`${member.name} plays ${member.instrument} in the Dum Dum Girls Band`);
} | [
"function printMemberProps(member){\n console.log(`Name : ${member.name}\\nInstrument : ${member.instrument}`);\n}",
"function printprops(o) {\r\nfor(var p in o)\r\nconsole.log(p + \": \" + o[p] + \"\\n\");\r\n}",
"function printprops(o) {\n\tfor (var p in o) {\n\t\tconsole.log(p + ': ' + o[p] + '\\n');\n\t}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a point with the location of a marker | function markerPoint(current) {
var $this = $(current);
var li = $($this.parents()[0]);
return new Point(parseInt(li.css('left')),parseInt(li.css('top')));
} | [
"function marker(latlng,options){return new Marker(latlng,options);}",
"function markerMaker(point, icono, name) {\n var om = L.marker([point.lat, point.lon], {\n icon: icono\n }).bindPopup(name);\n \n return om;\n \n }",
"function _getPoint(lng, lat) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates a users first name | function update_firstname(){
var username = localStorage.getItem('username');
var firstName = localStorage.getItem('firstname');
var newFirstName = $("#updatefirstname").val();
if (firstName.trim()!==newFirstName.trim()){
let inputs = {
firstname: newFirstName
};
let params = {
method: "POST",
... | [
"function setFirstName(firstName) {\n database\n .ref(`users/${currentUser.uid}/profile`)\n .set({ firstName: `${firstName}` });\n }",
"function set_fname(user_id,fname,callback) {\n\tdb.query(\"UPDATE TABLE Users SET firstname = ? WHERE user_id = ?\", [fname, user_id], \n function(err,rows,f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reference to the parent accordion API, if present | get accordionAPI() {
return this.accordionEl ? $(this.accordionEl).data('accordion') : undefined;
} | [
"get accordionEl() {\n return this.element.parents('.accordion').first()?.[0];\n }",
"function CallbackOnAccordionClicked(hid, bflag) {\n // The function MUST be override in html page\n}",
"function initAccordion() {\n\t\"use strict\";\n\n\tif($j(\".q_accordion_holder\").length){\n\t\t$j(\".q_accordion_h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check bank value, if >=2, proceed. Else, insult broke player. | function bankCheck() {
var guess = [];
if (bankValue < 2) {
document.getElementById("message").innerHTML += '<h3 style="color:red">I got 99 problems, and clearly your net-worth is one... No money, no play</h3>';
} else {
console.log("good to go, bank is full")
document.getElementById("message").... | [
"function checkBusted() {\r\n var player = game.players[game.current_player_index];\r\n var dealer = game.players[game.players.length - 1];\r\n // check blackjack on the first hand\r\n if (player.cards.length == 2 && player.sum == 11 && player.sum_Ace == 21) {\r\n checkEndGame();\r\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switches the planner to 24 hour time system | function render24hrs() {
$("#12hour").removeClass("active");
$("#24hrs").addClass("active");
myStorage.setItem("use24hr", true);
$(".container").empty();
renderPlanner();
} | [
"_set24HourMode () {\n this.setHourMode(24);\n }",
"_set12HourMode () {\n this.setHourMode(12);\n }",
"function advance_hour(){\r\n // TO DO: if 24\r\n // console.log(start_time);\r\n time_split = start_time.split(\":\");\r\n var new_hour = parseInt(time_split[0]) + 1;\r\n start_time = pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a new function called 'updateInfo()' that receives the data from the call to that function (see above). Use logic to write the appropriate labels to 'dataLabel1' and 'dataLabel2' elements in starwars.html, as well as the appropriate values from the data object to the 'dataValue1' and 'dataValue2' elements in sta... | function updateInfo(data){
var myKey=Object.keys(data)
document.querySelector('#dataValue1').textContent=data[myKey[0]];
document.querySelector('#dataValue2').textContent=data[myKey[3]];
document.querySelector('#dataLabel1').textContent=myKey[0];
document.querySelector('#dataLabel2').textContent=myK... | [
"function updateInfo() {\n q1ATH.textContent = '$' + highValue;\n cPrice.textContent = '$' + currentClose;\n volume = cData.data[0].volume;\n abbreviateNumber(volume);\n vol.textContent = volume + ' shares traded at last business day';\n companyN.textContent = nData.data[0].name;\n compSymbol =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Swaps the sortIndex with the next greaterEntry. | function incrementSortIndex(entry){
var d = $.Deferred();
db.transaction(function (tx) {
// fetch sortIndex of the current entry
tx.executeSql('SELECT sortIndex FROM entries WHERE id = ? ', [entry.id], function (tx, entryResults) {
if (!entryResults... | [
"function decrementSortIndex(entry){\n\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n // fetch sortIndex of the current entry\n tx.executeSql('SELECT sortIndex FROM entries WHERE id = ? ', [entry.id], function (tx, entryResults) {\n if (!e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Update the developer portal configuration. | async function apiManagementUpdatePortalConfig() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const portalConfigId = "default";
const ifMatch = "*";
const ... | [
"function updateConfiguration() {\n var headers = {};\n var payload = {};\n var options = {method:\"post\", contentType:\"application/x-www-form-urlencoded\", headers:headers, payload:payload};\n var responseCode = UrlFetchApp.fetch(url + initializationUri, options).getResponseCode();\n if (responseCode == 204... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a uni query parameter retrieve data about that uni (its stats and its faculties stats) and send it in the response in JSON format. For more details about the nature of the object returned see getUniversityData descriptino in the dataManager.js module. If uni query parameter is missing or its nonsense an empty obj... | function retrieveUniData(request,response)
{
//set response header
var headers = {};
headers["Access-Control-Allow-Origin"] = "*"; //for cross enviroment request
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS";//methods allowed to responce
headers["Access-Control-Allow-Crede... | [
"function getFaculty(universityId) {\n $('#faculty').empty();\n var dataFaculty = 'https://api.vk.com/method/database.getFaculties?university_id='+universityId;\n $.ajax({\n url: dataFaculty,\n type: 'GET',\n dataType: 'jsonp',\n success: function(data) {\n for(el in data.respons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
textTypeTransitions Given a current text type and a type change request, what is the result text type? This truth table tells you. | static get textTypeTransitions() {
return [
[1, 1, 0],
[1, 0, 1],
[1, 2, 2],
[2, 2, 0],
[2, 0, 2],
[2, 1, 1],
[0, 1, 1],
[0, 0, 0],
[0, 2, 2]
];
} | [
"static get textTypeTransitions() {\n return [\n [1, 1, 0],\n [1, 0, 1],\n [1, 2, 2],\n [2, 2, 0],\n [2, 0, 2],\n [2, 1, 1],\n [0, 1, 1],\n [0, 0, 0],\n [0, 2, 2]\n ];\n }",
"function transitionType... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searchShippingLookupRecord Function search for shipping lookup record | function searchShippingLookupRecord(itemIntID,shippingDestinationIntID)
{
try
{
shippingLookupFilters[0] = new nlobjSearchFilter('custrecord_sl_item', null, 'is', itemIntID); //filter by item
shippingLookupFilters[1] = new nlobjSearchFilter('custrecord_sl_destination', null, 'is', shippingDestinatio... | [
"function getShippingDestinations()\r\n{\r\n\t//Declaring the local variables\r\n\tvar shippingDestinationFilters = new Array();\r\n\r\n\ttry\r\n\t{\r\n\t\t//Adding filters to search the active shippingDestinations \r\n\t\tshippingDestinationFilters[0] = new nlobjSearchFilter('isinactive',null, 'is','F');\t\t\r\n\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if message can be display by the date. | function checkDate(messageDate) {
//Set the start and end date of message
var startMessageDate = new Date(messageDate[0]);
var endMessageDate = new Date(messageDate[1]);
if (today > startMessageDate && today < endMessageDate) {
return 1;
}
return 0;
} | [
"function shouldSendMessage(date) {\n if (!config.messageThreshold || !date) {\n return true;\n }\n\n const { time, units } = config.messageThreshold;\n const threshold = moment().subtract(time, units);\n\n return date.isBefore(threshold);\n}",
"function checkDate(message, oAuthor){\n\tlet dTemplate = [31... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
You can modify and use this source freely only for the development of application related Live2D. (c) Live2D Inc. All rights reserved. ============================================================ ============================================================ class L2DMotionManager extends MotionQueueManager =============... | function L2DMotionManager() {
_live2d.MotionQueueManager.prototype.constructor.call(this);
this.currentPriority = null;
this.reservePriority = null;
this.super = _live2d.MotionQueueManager.prototype;
} | [
"function L2DExpressionMotion() {\n\t _live2d.AMotion.prototype.constructor.call(this);\n\t this.paramList = new Array(); //ArrayList<L2DExpressionParam>\n\t}",
"function initLuxoMotions() {\n\n // basic interpolation test\n// myboxMotion.currTime = 0.1;\n// console.log('kf',myboxMotion.currTime,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search all elements of an array for the only value that occurs twice (all other values occur once), and return that value. | function findDup(array) {
var testedValue;
var i;
var j;
var matches;
for (i = 0; i < array.length; i += 1) {
testedValue = array[i];
matches = 0;
for (j = 0; j < array.length; j+= 1) {
if (array[j] === testedValue) {
matches += 1;
}
}
if (matches > 1) {
re... | [
"function occursOnce(array) {\n const occurances = getOccurances(array);\n const occurancesKeys = Object.keys(occurances);\n\n for (let i = 0; i < occurancesKeys.length; i++) {\n if (occurances[occurancesKeys[i]] === 1) {\n return occurancesKeys[i]; // return first occurance since we are ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the round gets updated and displayed displayed | function updateRound(data){
$("#roundDiv").text(round+" / " + roundsPerGame);
} | [
"function updateRoundDisplay(round) {\n var roundDisplay;\n roundDisplay = round < 10 ? '0' + round : round;\n $('#round').text(roundDisplay);\n }",
"function updateRound() {\n $('#roundCount').text(gameRound);\n }",
"function showRound() {\n if (displayedRounds < 7) {\n displayedR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transpose an array of strings | function transpose (array) {
// Convert to true 2D array before transpose
let newArray = [];
for (let i = 0; i < array.length; i++) {
array[i] = array[i].split('');
}
array = array[0].map((col, i) => array.map(row => row[i]));
// Convert back into array of strings
for (let i = 0; i < array.length; i++... | [
"function transposeTwoStrings(arr) { \n const [str1, str2] = arr;\n const maxLength = Math.max(str1.length, str2.length);\n let result = '';\n \n for (let i = 0; i < maxLength; i++) {\n result += `${(str1[i] || ' ')} ${(str2[i] || ' ')}\\n`;\n }\n return result.slice(0,-1);\n}",
"function transpose(arr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy... | function toNumBytes(humanReadableBytes) {
len = humanReadableBytes.length;
if (len <= 1) {
return -1;
}
unit = humanReadableBytes[len - 1];
val = parseFloat(humanReadableBytes.substring(0, len - 1));
if (isNaN(val)) {
return -1;
}
// Fallthrough intended throughout.
switch (unit) {
case 'Y... | [
"function convertByteSizeString(s)\n{\n\tif (s === undefined || s === null)\n\t\treturn null;\n\tvar ary = s.match(/^\\s*([\\d\\.,]+)\\s*(\\w+)?\\s*$/);\n\tif (!ary)\n\t\treturn null;\n\n\tvar amountStr = ary[1].replace(/,/g, \"\");\n\tvar sizePrefix = (ary[2] === undefined ? \"B\" : ary[2]).toUpperCase();\n\tvar m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
login history news category | async news_categorys({session,request, response, view}){
var language_ad = JSON.parse(fs.readFileSync('public/language/'+session.get('lang_ad')+'/back.json', 'utf8'));
return view.render('back.news_categorys.news_cat',{
news_cat: 'active',
title: language_ad.a_m_news_catgory,
... | [
"function isLoggedIn() {\n $(\"#menu\").show();\n showView(\"Catalog\");\n getCatalog();\n $(\"#profile\").show();\n $(\"#profile\").find(\"span\").text(sessionStorage.getItem(\"username\"));\n }",
"function getNewsCategory() {\n // get news button with class selected-news... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
targil5("yakov", "a"); targil 6 | function targil6() {
console.log("sayonara".substr(0,3));
} | [
"function nextTargetName(angka){\n\n // Mulai code disini\n\t\n}",
"function uzun() {console.log (\"Ben uzun js dosyasıyım!..\");}",
"function luasjajar () {\n return alas * tinggi\n}",
"function ShraniZadnjoStran() {\n\n}",
"function tu_test_unitaire1(){\n\t\t\n\t}",
"function q4q2($obj){\n movime... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that will create and add gifs | function addGifs(response) {
// var gifDiv = $("<div>");
// gifDiv.attr("id", "gifDiv");
for(var i = 0; i < response.data.length; i++) {
var gifCard = $("<div>");
gifCard.addClass("gifCard");
var gifElement = $("<img>");
gifElement.attr("src", r... | [
"function makeGifs() {\n }",
"function displayGifs() {}",
"function generateGif(){\n var gifImg = document.createElement('img');\n gifImg.src = 'https://media.giphy.com/media/l0ExaAxJrEtQro8BW/giphy.gif'\n document.getElementById('gif-img').appendChild(gifImg);\n}",
"function addGifs(buttonName)\n{\n\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks for variable in an array. | function in_array(variable, theArray)
{
return $.inArray(variable, theArray) != -1;
} | [
"function in_array(variable, theArray)\n{\n\tfor (var i = 0; i < theArray.length; i++)\n\t{\n\t\tif (theArray[i] == variable)\n\t\t\treturn true;\n\t}\n\treturn false;\n}",
"static contains(array, thing) {\n return array.indexOf(thing) >= 0;\n }",
"function isInArray(value, array) {\r\n \t\treturn ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert input value to a list and display it | convertInputValue() {
var value = this._input.value,
list = [];
try {
list = JSON.parse(value);
} catch (e) {
this.displayError('The JSON is malformed.');
return;
}
if (PreorderedTree.isValid(list)) {
this.displayError('The tree is not valid.');
return;
}
if (!list.length) {
this... | [
"function formfield_value_to_list(the_field, the_separator) {\n var ret = \"\";\n if (!the_field.length) {\n ret = the_field.value;\n }\n else {\n for (i = 0; i < the_field.length; i++) {\n ret = list_append(ret, the_field[i].value, the_separator);\n }\n }\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get(i) should return an OutOfBounds exception if there is no element in that position should return the element in that position | get(i) {
if (this.items.indexOf(i) == -1) {
throw new Error('OutOfBounds')
}
else {
return(this.items.indexOf(i))
}
} | [
"function get_(as, i) {\n return isOutOfBound(i, as) ? _index2.none : (0, _index2.some)(as[i]);\n}",
"obtenerElem(index){\r\n\t\r\n\t\tif (index => 0 && index <= this.capacidad()-1){\r\n\t\t\tvar elem = this._array[index];\r\n\t\t\tif (typeof elem == 'undefined') {\r\n\t\t\t\tthrow \"No hay datos para la posicio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[boolean] isMainlineTurnout([SVGElement] obj) Determines if object is on mainline (created simply for code readability) | function isMainlineTurnout(obj)
{
return isOnMainlineLayer(obj);
} | [
"function isOnMainlineLayer(obj)\n{\n\tvar mainlineTrackLayer = svgDocument.getElementById(\"mainlineTrackLayer\");\n\t\n\tif((mainlineTrackLayer != null) && (obj == mainlineTrackLayer))\n\t\treturn true;\n\t\n\tif((obj == svgDocument) || (obj == null))\n\t\treturn false;\n\t\t\n\treturn isOnMainlineLayer(obj.paren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function uploads the form inputs to the database | function uploadInputs(){
var form_elem = document.getElementById(AllIdNames.form_id);//Form element
if (tester === true){
console.log('Talking to the server...');
var dbname = AllIdNames.db_name_id;//gets the id of the h2 which has the database name
var formData = new For... | [
"function getInputAndStoreInDB() {\n\t//get input data\n\tname = $('#train-name').val().trim();\n\tdestination = $('#destination').val().trim();\n\tfirstTrainTime = $('#train-time').val().trim();\n\tfrequency = $('#frequency').val().trim();\n\n\t//store in db\n\tdatabase.ref().push({\n\t\tname: name,\n\t\tdestinati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new ProductFieldAllOf. | constructor() {
ProductFieldAllOf.initialize(this);
} | [
"function PipelineAllOf() {\n _classCallCheck(this, PipelineAllOf);\n\n PipelineAllOf.initialize(this);\n }",
"function PipelineSelectorAllOf() {\n _classCallCheck(this, PipelineSelectorAllOf);\n\n PipelineSelectorAllOf.initialize(this);\n }",
"function PipelineStepAllOf() {\n _classCallCheck(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable green row highlight for data entry form table | function enableDataEntryRowHighlight() {
$('form#form table#form_table :input, form#form table#form_table a')
.bind('click focus select', function(event){
// If save buttons are not displayed (e.g., form is locked), then don't highlight row
if ($('#__SUBMITBUTTONS__-div').css('display') == 'none') return;
// ... | [
"highlight(row){}",
"function highlightTableRow(e)\n{\n if (e.className != 'selectedRow')\n {\n e.style.backgroundColor = '#C3C3FE';\n }\n}",
"function enableDataEntryRowHighlight() {\r\n $('form#form #questiontable :input, form#form #questiontable a')\r\n .bind('click focus select', f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use st... | async function applicationPackageCreate() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const applicationName = "app1";
const versionName = "1";
cons... | [
"async function createOrUpdateManagedApplicationDefinition() {\n const subscriptionId = \"subid\";\n const resourceGroupName = \"rg\";\n const applicationDefinitionName = \"myManagedApplicationDef\";\n const parameters = {\n description: \"myManagedApplicationDef description\",\n authorizations: [{ princi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
See registerOnThemeChangeCallback(). Removes previously registered callbacks. | function removeOnThemeChangeCallback(callback) {
var i = _onThemeChangeCallbacks.indexOf(callback);
if (i === -1) {
return;
}
_onThemeChangeCallbacks.splice(i, 1);
} | [
"function removeOnThemeChangeCallback(callback) {\n var i = _onThemeChangeCallbacks.indexOf(callback);\n if (i === -1) {\n return;\n }\n _onThemeChangeCallbacks.splice(i, 1);\n }",
"function removeOnThemeChangeCallback(callback) {\n\t var i = _onThemeChangeCallbacks.in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable or disable the help content in the analyserpanel | function toggleHelp() {
toggleAnalyserPanel('help');
} | [
"function setupHelpButton()\n{\n\thelpButton.setText(\"Show Help\");\n\t\n\tvar helpButtonHandler =\n\t{\n\t\tactionPerformed: function(evt)\n\t\t{\n\t\t\thelpEnabled = !helpEnabled;\n\t\n\t\t\tif(helpEnabled)\n\t\t\t{\n\t\t\t\thelpButton.setText(\"Hide Help\");\n\t\t\t\tcckModule.setHelpEnabled(helpEnabled);\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::DeviceFarm::NetworkProfile` resource | function cfnNetworkProfilePropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnNetworkProfilePropsValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
ProjectArn: cdk.stringToCloudFormation(pr... | [
"function instanceProfileResourcePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n InstanceProfileResourcePropsValidator(properties).assertSuccess();\n return {\n Roles: cdk.listMapper(cdk.stringToCloudFormation)(pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use this to just return a count of the emails matched to each search query. Alternatively, use the other function (thread_query to show snippets of the email in the card notification. | function countQuery_(gmailQuery) {
var pageToken;
var return_count = 0;
do {
var threadList = Gmail.Users.Threads.list('me', {
q: gmailQuery,
pageToken: pageToken
});
if (threadList.threads && threadList.threads.length > 0) {
threadList.threads.forEach(function(thread) {
... | [
"function job_check_gmail_count_only() {\n\n var search_query_array = config_gmail_search_array_();\n \n for (var i = 0; i < search_query_array.length; i++) {\n\n //console.log('searching: ' + search_query_array[i][1]);\n \n var result = countQuery_(search_query_array[i][1]);\n\n if(result > ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use an approximation by checking the value of nodeType and presence of nodeType host instead of instead of using the isImpl from "../generated/ShadowRoot" to avoid introduction of circular dependencies. | function isShadowRoot(nodeImpl) {
return Boolean(nodeImpl && nodeImpl.nodeType === NODE_TYPE.DOCUMENT_FRAGMENT_NODE && "host" in nodeImpl);
} | [
"function isNode$1(nodeImpl) {\n return Boolean(nodeImpl && \"nodeType\" in nodeImpl);\n }",
"function isNode(value) {\n if ( typeof Node === \"object\" ) {\n return value instanceof Node;\n }\n else {\n return value && typeof value === \"object\" && typeof value.nod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A send method to send data to the Discord WebSocket using your library. Getting the shard for the guild and sending the data to the WebSocket. | send(id, payload) {
const guild = client.guilds.cache.get(id);
if (guild) guild.shard.send(payload);
} | [
"send(data) {\n const socket = this.machine.context?.socket;\n if (socket === null) {\n warn(\"Cannot send: not connected yet\", data);\n } else if (socket.readyState !== 1) {\n warn(\"Cannot send: WebSocket no longer open\", data);\n } else {\n socket.send(data);\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows to add a price to a places. This price is recovered from price combinations. | function addPriceToPlaces(places, pricesCombination) {
// Adds a price to the given places.
places.forEach(p => p.price = pricesCombination.get(getRandomInt(1, 6)))
} | [
"function addPrice(amount){\n this.price = amount\n }",
"function addTotalPrice(price){\n var total = $(\"aside strong\").text();\n //Convert from Currency to Number\n var number =Number(total.replace(/[^0-9\\.]+/g,\"\"))\n //Subtract Price of Ingredient from Total\n var newTotal = (number + price)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Async getComponent is only invoked when route matches path: evaluateListPage, | getComponent(nextState, cb) {
/* Webpack - use 'require.ensure' to create a split point
and embed an async module loader (jsonp) when bundling */
require.ensure(
[],
require => {
/* Webpack - use require callback to define
dependencies for bundling */
const Ev... | [
"function loadList() {\n // Call API\n apiHelper.getAllUrls()\n .then(result => {\n //console.log('getAllUrls result: ' + result);\n\n // Send event to render page\n mainWindow.webContents.on('did-finish-load', () => {\n console.log('sending mylittleurl:s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the order of list items | function checkOrder() {
listItems.forEach((listItem, index) => {
const personName = listItem.querySelector('.draggable').innerText.trim();
if (personName !== panovnici[index]) {
listItem.classList.add('wrong');
} else {
listItem.classList.remove('wrong');
listItem.classList.add('right')... | [
"function checkOrder() {\n listItems.forEach((listItem, index) => {\n const personName = listItem.querySelector('.draggable').innerText.trim();\n \n if (personName !== headOfState[index]) {\n listItem.classList.add('wrong');\n } else {\n listItem.classList.remove('wrong');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stopping a peer connection includes, removing the remote media stream, closing and deleting the peer connection object from the connectedUsers array, and decrementing the userID. The function also checks the number of users connected and acts accordingly | function stop(hangupUser) {
console.log('closing peer connection of :'+hangupUser);
connectedUsers[hangupUser].close();
$media.removeChild(document.getElementById('panels'+hangupUser));
userID--;
console.log('deleting the user from connected users array');
delete connectedUsers[hangupUser];
console.log('connect... | [
"function checkPeerDisconnect(event, userId) {\n var state = otherPeers[userId].pc.iceConnectionState;\n // console.log(`connection with peer ${userId} ${state}`);\n if (state === \"failed\" || state === \"closed\" || state === \"disconnected\") {\n delete otherPeers[userId];\n videoGrid.removeChild(docume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increase mana_points. Can not regenerate above maximum mana | regenerateMana(amountToRegenerate){
//Determine maximum
let maxToRegen = this.props.stats_current.mana - this.props.mana_points;
//If trying to regenerate more than maximum, only regen up to maximum
let appliedAmountToRegenerate = ((amountToRegenerate > maxToRegen) ? maxToRegen : amoun... | [
"function manaIncrease(){\r\n console.log('manaIncrease');\r\n addPlayerMana(15);\r\n}",
"function updateXpDinheiroAndAbility(){\n player.xp += 30;\n player.dinheiro += 30;\n if (player.xp >= player.xpMax){\n player.level++;\n player.ability += 10;\n player.dinheiro += 1000;\n p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the (W0, alpha, gamma) values for the regression given the current list of records. | function calculateOptimalWeights() {
var records = JSON.parse(sessionStorage.getItem('records'));
var vecB = calculateBVector(records);
var matA = calculateAMatrix(records);
var transposeMatA = math.transpose(matA);
var squareMatA = math.multiply(transposeMatA, matA);
if (math.det(squareMatA) == 0) {
r... | [
"function getMultipleRegEquationValues(data1, data2, data3, data4){\n var returnValues = {};\n console.log(data3);\n var xMatrix = new Matrix(getMultRegDataTriples(data1, data2, data3));\n var yMatrix = new Matrix(getMultRegYValues(data4));\n var errorValues = [];\n console.log(xMatrix);\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate through HTMLNode in DOMTree, and apply task() function | function HTMLNodeIterator()
{
//task:function, node:HTML Node, extraParam: extta param passed to task function
this.iterate = function iterate(task, node, extraParam)
{
task(node, extraParam);
if (node.childNodes.length > 0)
for(var x = 0; x < node.childNodes.length; x++)
this.iterate(task, node.childNo... | [
"function walkTheDOM(node, func) {\n \n}",
"function walkTheDOM(node, func) {\r\n func(node);\r\n node = node.firstChild;\r\n while (node) {\r\n walkTheDOM(node, func);\r\n node = node.nextSibling;\r\n }\r\n }",
"function walkTheDOM(node, func) {\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The ideal frame rate which was set by setFrameRate(). | get idealFrameRate() { return this._idealFrameRate; } | [
"get frameRate() {}",
"framerate () {\n\t\tthis.totalFrames = 0;\n\t\tthis.fpsDips = 0;\n\t\tthis.fpsThreshold = 30; // Minimum FPS\n\t\tthis.fpsDipsThreshold = 120; // Number of times FPS is allowed to dip below threshold\n\t\tthis.fps = 0;\n\t\tthis.trackFps = true;\n\t}",
"static getFrameRate(frames) {\nvar ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the current maximum Accordion Thief songs the player can have in their head | function getSongLimit() {
return 3 + ((0, _kolmafia.booleanModifier)("Four Songs") ? 1 : 0) + (0, _kolmafia.numericModifier)("Additional Song");
} | [
"function getSongLimit() {\n return 3 + (kolmafia_1.booleanModifier(\"Four Songs\") ? 1 : 0) + kolmafia_1.numericModifier(\"Additional Song\");\n}",
"function getSongLimit() {\n return 3 + ((0,kolmafia__WEBPACK_IMPORTED_MODULE_0__.booleanModifier)(\"Four Songs\") ? 1 : 0) + (0,kolmafia__WEBPACK_IMPORTED_MODULE_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get battle points from card given name | function getBpFromName(name) {
console.log(storyCardFaceUp);
console.log(storyCardFaceUp.foe);
console.log(name);
for (var i = 0; i < cardTypeList.length; i++) {
// console.log(cardTypeList[i]);
// console.log(name);
if (cardTypeList[i].name === name)
if (cardTypeList[i].hasOwnProperty('bp')) {
if(s... | [
"function getPoint(card) {\n\tif (card == 1)// ace\n\t\treturn 11;\n\telse if (card >= 2 && card < 11) // between 2 and 10\n\t\treturn card;\n\telse // jack, queen, king\n\t\treturn 10;\n\t\n}",
"getCardPoints(card) {\n if (!isNaN(card.value)) {\n return +card.value;\n }\n if (card.value === \"ACE\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns list of terminals in this grammar. | getNonTerminals() {
if (!this._nonTerminals) {
let nonTerminals = {};
let grammarEntries = this.get();
for (let k in grammarEntries) {
nonTerminals[this.getLHS(grammarEntries[k])] = true;
}
this._nonTerminals = Object.keys(nonTerminals);
}
return this._nonTerminals;
... | [
"getTerminals() {\n if (!this._terminals) {\n this._terminals = [];\n let grammarEntries = this.get();\n\n for (let k in grammarEntries) {\n this._terminals = this._terminals.concat(\n this.getRHS(grammarEntries[k]).filter(this.isTerminal)\n );\n }\n }\n\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get winners and create presentable string for who won | winnerString(){
var winnersText = "Game Over!\n";
var winners = getWinners();
for (let index = 0; index < winners.length; index++) {
winnersText += winners[index].toString();
if(index < winners.length){
winnersText += " and ";
}
}... | [
"function getWinners(callback) {\n return callback.map((e) =>\n e[\"Home Team Goals\"] > e[\"Away Team Goal\"]\n ? `The Winner is: ${e[\"Home Team Name\"]}`\n : `The Winner ${e[\"Away Team Name\"]}`\n );\n}",
"function displayWinner (){\n //todo add content when player wins\n}",
"function winn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set idle flag, stop animation, and clear leds | idle() {
this._idle = true;
this._animation.stop();
this.emit('clear');
this.emit('idle');
} | [
"function setIdle() {\n clearTimeout(idleTimer);\n stopClock();\n }",
"function idle_anim() {\n if (!(idle_on)) {\n if (direction === \"right\") {\n shrek = walks[1];\n } else if (direction === \"left\") {\n shrek = walkbacks[1];\n }\n }\n walk_anim = false;\n frame = 0;\n idle_on =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates the quantity needed for each part and adds that value as a new key pair to the part object in the partsOrder array | function buildOrder() {
for (var i = 0; i < $scope.partsOrder.length; i++){
//console.log('Qty to Order: ', $scope.partsOrder[i].quantity_required - $scope.partsOrder[i].quantity_available);
$scope.partsOrder[i].quantity_needed = $scope.partsOrder[i].quantity_required - $scope.partsOrder... | [
"_priceParts() {\n this._cost = _.sum(this._parts, part => this._partPriceMap[part]);\n }",
"function calculateCost (parts)\n{\n var cost = 0;\n for (var i in parts)\n {\n var part = parts[i];\n if (COST[part])\n {\n cost += COST[part];\n }\n }\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructor Initializes a new instance of the `PdfGridHeaderCollection` class with the parent grid. | function PdfGridHeaderCollection(grid){/**
* The array to store the `rows` of the grid header.
* @private
*/this.rows=[];this.grid=grid;this.rows=[];}//Properties | [
"function PdfGridHeaderCollection(grid) {\n /**\n * The array to store the `rows` of the grid header.\n * @private\n */\n this.rows = [];\n this.grid = grid;\n this.rows = [];\n }",
"initHeader() {\n const me = this,\n config = Object.assign(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if the item is checked, push the item id into the savedResults array | handleCheckedItem(item) {
this.setState((prevState) => {
console.log(prevState)
var tempArr = prevState.savedResults.slice();
tempArr.push(item.id)
// console.log(tempArr)
return { savedResults: tempArr }
})
} | [
"function saveItem() {\n selectedItems = [];\n showSelectedItemsModal.forEach(function(e){\n e.username = addUsername;\n e.status = \"committed\";\n checkoutItems.push(e);\n putItem(e.id, e);\n });\n return putItem(showSelectedItemsModal[showSelectedItemsModal.length-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ADD PERSON / Adds an entry from input field values. Person is added to the Array and then stringified in the JSON file. We then call the render_entries() function to show the person that was just saved in the table. | function add_person() {
var person_name = document.getElementById('name').value,
genderDdl = document.getElementById('gender'),
person_gender = genderDdl.options[genderDdl.selectedIndex].value,
person_age = document.getElementById('age').value;
person_id = counter; // This counter creat... | [
"function addPerson() {\n if (validateInput(\"Input\")) {\n // get the name and night values from the form\n let nameInput = document.getElementById(\"name-input\").value;\n let nightsInput = document.getElementById(\"nights-select\").value;\n\n // Capitalize name\n // nameIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Atualiza os Indices dos Inputs da Tabela | function fct_AtualizaInputsTabela() {
fct_Index("Codigo", "Codigo");
fct_Index("InicioVigencia", "DtInicioVigencia");
fct_Index("FimVigencia", "DtFimVigencia");
fct_Index("DiaDaSemana", "DiaDaSemana");
fct_Index("HoraInicio", "HoraDeInicioDasAulas");
fct_Index("HoraFim", "HoraDeFimDasAulas... | [
"function addRowIndex() {\r\n const table = $('#main').DataTable();\r\n \r\n table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {\r\n const data = this.data();\r\n data[0] = rowIdx + 1;\r\n this.data(data);\r\n });\r\n}",
"mapTXInputs() {\n for (const [i, input] of thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clustering locations based on spatialThreshold | function distance_clustering (inactiveLocations) {
var clusterCounter = []
for (var index = 0; index < inactiveLocations.length; ++index) {
if (index === 0) {
inactiveLocations[index]['cluster'] = 0
clusterCounter.push(1)
continue
}
for (var index2 = 0; index2 < index; ++index2) {
... | [
"function dbscanCenterDistance(geodata, minDistance){\n // To detect if the data is already belonged to a cluster\n assigned = new Array (geodata.length);\n // To keep average coordinates from a cluster\n var average_coordinates = new Object();\n // To keep final result of clustering\n final_clusters = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=>show some data transaction | * show(){
return yield Database
.table('transactions')
.select('action', 'status', 'acc_type')
.where({id:id})
} | [
"static displayTransations() {\n const transactions = Store.getTransations();\n\n transactions.forEach(transaction => {\n const ui = new UI();\n\n // Display in UI transactions and balance from Local Storga\n ui.addTransactionToListFromLocalStorage(transaction);\n ui.resume();\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isSSN (STRING s [, BOOLEAN emptyOK]) isSSN returns true if string s is a valid U.S. Social Security Number. Must be 9 digits. NOTE: Strip out any delimiters (spaces, hyphens, etc.) from string s before calling this function. For explanation of optional argument emptyOK, see comments of function isInteger. | function isSSN (s)
{ if (isEmpty(s))
if (isSSN.arguments.length == 1) return defaultEmptyOK;
else return (isSSN.arguments[1] == true);
return (isInteger(s) && s.length == digitsInSocialSecurityNumber)
} | [
"function isSSN(pString)\n{\n // Establish a pattern: 3 digits, a dash, 2 digits, a dash, and 4 digits.\n var varPattern = /^\\d{3}-\\d{2}-\\d{4}$/;\n // Perform a regular expression match.\n var varMatch = pString.match(varPattern);\n if(varMatch == null)\n {\n // The match failed.\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
class Mixer x,y,w,h,Slider, canvas, c_1,c_2, c_3 | constructor(x,y,w,h,Slider, canvas,c_1,c_2, c_3, Button, SFButton){
this.x = x;
this.y = y;
this.w = w;
this.h = h;
// class Button x,y,w,h,text, c_1, c_2, c_3, canvas
this.strokeB = new SFButton(x+4*0.125*w, y-0.15*h, 0.1*w, 0.2*h, "S", c_1, c_3, c_2, canvas, "Stroke" );
this.fill... | [
"constructor(x,y,w,h,Slider, canvas,c_1,c_2, c_3){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n //class Slider (canvas,x,y,w,h,c_1,c_2, c_3, max, min, start)\r\n this.R = new Slider(canvas, x+1*0.125*w, y+0.1*h, 3*0.125*w, 2*0.1*h , c_1, c_2, c_3, 255, 0, 255);\r\n this.G... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used to verify resetToken, WORKING | function verifyResetRequest() {
return compose()
.use(function(req, res, next) {
let resetToken = req.session.reset; //fix session not always defined
jwt.verify(req.body.resetToken, config.secrets.session, {maxAge: '1 day'}, function(err, token) {
if(err) return res.status(403).send('This link... | [
"function verifyToken( ) {\n\n }",
"async verifyResetToken(req, res) {\n if (!(req.query && req.query.token && req.query.email)) {\n return Errors.Network.missingFields(res);\n }\n const {\n token,\n email\n } = req.query;\n RPC.request({\n method: 'POST',\n url: `${... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. | set state(newState) {
if (this._state !== constants_1.SocksClientState.Error) {
this._state = newState;
}
} | [
"setState(newState) {\n if (this.state !== constants_1.SocksClientState.Error) {\n this.state = newState;\n }\n }",
"set _error(err) {\n if (err) {\n this._lastValueState = this.valueState;\n this.valueState = 'Error';\n } else if (this.valueState === 'Error') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check or Uncheck Optimization | function checkOrUncheckOptimization() {
let checkAllElementChecked = $("#checkAll:checked");
if(checkAllElementChecked.length > 0) {
// uncheck the check all if a check is clicked and if the check all is already clicked
checkAllElementChecked.prop('checked', false);
}
// Click the checkAll is all the c... | [
"performCheck(check) {\n \n }",
"function removeCheck()\n{\n\twriteMessage(\"\");\n\tif(checkSolution) check();\n}",
"get isOptimizable() {}",
"set enableOptimizedSpellCheck(value) {\n this.performOptimizedCheck = value;\n }",
"workerStateCheck(creep) {\n if (creep.store[RESOURCE_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for status' code This will return the code string from CodeableConcept, corresponding to the status' code | get statusAsCode() {
if (!this._cancerDiseaseStatus.dataValue
|| !this._cancerDiseaseStatus.dataValue.value
|| !this._cancerDiseaseStatus.dataValue.value.coding
|| !this._cancerDiseaseStatus.dataValue.value.coding[0]
|| !this._cancerDiseaseStatus.dataValue.value.c... | [
"function getCodeableConceptCode(codeableConcept) {\n if (codeableConcept.coding != null) {\n return codeableConcept.coding[0].code;\n }\n else {\n return \"\";\n }\n }",
"function getStatusMessage (code) {\n if (!Object.prototype.hasOwnProperty.call(status.message, code)) {\n throw new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copies a single property from origin to destination | function deepCopyProperty(prop, origin, dest) {
var originProp = origin[prop];
var destProp = dest[prop];
// if the source and target don't have the same type, replace with target
var originType = type_3.getTypeString(originProp);
var destType = type_3.getTypeString(destProp);
... | [
"function redirectProp(originObj, prop) {\n if (copyProps) {\n if (hardCopy) {\n // Copy all\n // console.log('target', targetObj[prop], 'origin', originObj[prop]);\n targetObj[prop] = originObj[prop];\n // console.log('targetAfter', targ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the respond tools to a tweet | function appendRespondTools( domObject ){
var tweet = $(domObject);
$(tweet).addClass("replying");
var html = "<td class='respondBar'>"
+ "<div class='counter'>140</div>"
+ "<textarea rows='4' cols='55'>"
+ "Reply to "+$(tweet).find(".screenName").text()
+ "</textarea>"
+ "<div class='bt... | [
"function tweetIt(txt) {\n\n\tvar tweet = {\n\t\tstatus: txt\n\t}\n\tT.post('statuses/update', tweet, tweeted);\n\n}",
"function tweetIt(txt){\n T.post('statuses/update', { status: txt }, function(err, data, response) {\n })\n}",
"function respondToTweet(event) {\n // sanitise tweet text by removing punctuat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For this node and all descendents, set the location data to `locationData` if the location data is not already set. | updateLocationDataIfMissing(locationData, force) {
if (force) {
this.forceUpdateLocation = true;
}
if (this.locationData && !this.forceUpdateLocation) {
return this;
}
delete this.forceUpdateLocation;
this.locationData = locationData;
return this.eachChild(functio... | [
"updateLocationDataIfMissing(locationData) {\n if (this.locationData && !this.forceUpdateLocation) {\n return this;\n }\n delete this.forceUpdateLocation;\n this.locationData = locationData;\n return this.eachChild(function(child) {\n return child.updateLocationD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrap all links in 3D goodness. | function enableRollingLinks() {
if (supports3DTransforms && !( 'msPerspective' in document.body.style )) {
var anchors = document.querySelectorAll(SLIDES_SELECTOR + ' a:not(.image)');
for (var i = 0, len = anchors.length; i < len; i++) {
var anchor = anchors[i];
... | [
"function link_force(alpha1,alpha2){\n\n\t\t\t\t\t\t \titm_nodes.forEach(function(item,index){\n\n\t\t\t\t\t\t \t\titm_nodes.forEach(function(item2,index2){\n\t\t\t\t\t\t if(index != index2){\n\t\t\t\t\t\t var l = Math.sqrt(Math.pow(item2.x - item.x,2) + Math.pow(item2.y - item.y,2) );\n\t\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Atualiza o vetor currentBooks dada uma categoria de livros. | filterBooks(category) {
this.currentCategory = category;
if (this.currentCategory == "Todos") {
this.currentBooks = this.books;
} else {
this.currentBooks = this.books.filter(this.applyFilter);
}
} | [
"static updateBookStatus(id) {\n const storedBooks = Store.retrieveBooks();\n\n storedBooks.forEach((book) => {\n if (id === book.id) {\n book.status = (book.status === 'read') ? 'unread' : 'read';\n }\n });\n\n localStorage.setItem('library', JSON.stringify(storedBooks));\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Passo Fundo console.log(calcDistance(imed, pf)); | function calcDistance(imed, pf) {
return (google.maps.geometry.spherical.computeDistanceBetween(imed, pf) / 1000).toFixed(2);
} | [
"function calculateDistance() {}",
"calculateDistance() {}",
"getDistance(input1, input2, index) {\n const point1 = parseFloat(input1[index]); //Las copias de los points que estan en el estado\n const point2 = parseFloat(input2[index]);\n\n// Obtener el maximo de cada punto, \n let maxPoint1 = Math.cei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run a queue of functions as quickly as possible, passing value to each. | function runHandlers(queue, value) {
for (var i = 0; i < queue.length; i++) {
queue[i](value);
}
} | [
"function runHandlers(queue, value) {\n for (var i = 0; i < queue.length; i++) {\n queue[i](value);\n }\n}",
"function runHandlers(queue, value) {\r\n\t\tfor (var i = 0; i < queue.length; i++) {\r\n\t\t\tqueue[i](value);\r\n\t\t}\r\n\t}",
"function callNext(num = 1){\n debugg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If specified, launchArg can be a config object or path to config file. | function reqLaunch(launchArg) {
if (typeof(launchArg) === 'object') {
launch(launchArg);
return;
}
if (typeof(launchArg) === 'string') {
let config = getConfig(launchArg);
launch(config);
return;
}
launch(defaultConfig);
} | [
"function evalLaunch(kwArgs, createParameters, launch){\n if (launch){\n let dict = evaluateYaml(kwArgs.launchFile);\n const launchKeys = [];\n nested(dict, (cb) => {\n if (cb.level == 1 && launchKeys.indexOf(cb.item) == -1){launchKeys.push(cb.item)}\n });\n let dictValue = dict[launch];\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
process key, determine if choice exists in array, reduce remaining letter count if so. Otherwise, reduce guess count. check for game over condition at the end. | function processChoice(key, answer, valid) {
if (valid.indexOf(key) > -1) {
validPicked.push(key);
lettersPicked.push(key);
lettersRemaining = (answerKey.length - validPicked.length)
rebuildBoard(validPicked);
} else {
document.getElementById("lettersPicked").textContent += " " + key;
lette... | [
"function updateWrongGuessesAndCount(eventKey) {\n if(!containsChar(chosenWord, eventKey) && !containsChar(wrongGuess, eventKey)) {\n wrongGuess.push(eventKey);\n guessCounter -= 1;\n }\n}",
"function evalWord() {\n\n //Get empty divs to give data to\n var userGuess = document.getEle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(4) cria diretorios relacionados | function criarDiretorios(element) {
let newElemento = {}
let tipo = element.TIPO
if(tipo!=='CARTAFRETE') {
sendLog('AVISO',`(005) Não é CARTAFRETE. (${JSON.stringify(element)})`)
return 0
}
let cartaFrete = `${element.DOCUMENTO}`.substr(0,3)+`${element.DOCUMENTO}`.s... | [
"function MakeDirectories() {\r\n}",
"_initEtc() {\n let etc = this.root.find(\"etc\");\n etc.addChild(new File(\"passwd\"));\n let shadow = new File(\"shadow\");\n shadow.setRights(\"700\");\n etc.addChild(shadow);\n etc.addChild(new File(\"group\"));\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to update user if a body parameter is set | function updateUser(userFound,reqBody) {
var userIndex = userDbStub.lastIndexOf(userFound);
if (reqBody) {
for (var params in reqBody) {
// we avoid to insert non existing property and avoid the modification of the id and password that it's forbbiden
if( params && par... | [
"update(id, user) {}",
"setData(user, body){\n (body.firstName) ? user.firstName = body.firstName : null;\n (body.lastName) ? user.lastName = body.lastName : null;\n (body.email) ? user.email = body.email : null;\n (body.password) ? user.password = body.password : null;\n return user\n }",
"upda... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create vis.js plot data using previously generated input data | function createPlotData(inputData=[1]) {
// Create and populate data table
// var vis = require('vis'); // TODO: need to stop using cdn for vis.js and build with npm
var data = new vis.DataSet(); // output data to plot (x,y,z)
// z-functions: z = f(x,y)
var counter = 0
var steps=50
var xMin=-500
var xMax=500... | [
"function makeVis() {\n ScatterPlot = new ScatterPlot(\"scatter_plot\", all_data, lottery_data, round_1_data, round_2_data);\n Slider = new Slider('slider', all_data);\n\n}",
"function visualizeData(data) {\n\n}",
"function _PlotData() {\r\n\t\tthis.nodes = [];\r\n\t\tthis.links = [];\r\n\t\tthis.nodesByU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HANDLER HELPERS Update hosted stream. | updateHostedStream() {
let thisObj = this;
this.StreamClient.streamAsync({
live: true,
privateMode: thisObj.state.privateMode,
voting: thisObj.state.voting,
autopilot: thisObj.state.autopilot,
limited: thisObj.state.limited
}, {
streamData: thisObj.setStreamData.bind(this... | [
"function openUpdateStream() {\n var source = new EventSource(updates_url);\n source.onmessage = function (response) {\n processResponseData(response.data)\n };\n console.log(\"Stream Opened:\", updates_url);\n }",
"updateStream (callback) {\n\t\t// before doing the actua... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get/read the number of cars at the end > getCarsAtEnd() | getCarsAtEnd(){
//to refer to the database and listen to the 'carsAtEnd' to find out the number of cars at end and store it inside the 'this.rank'
database.ref('carsAtEnd').on("value", (data)=>{
this.rank = data.val()
})
} | [
"getCarsAtEnd() {\n var carsAtEndRef = databaseObj.ref('CarsAtEnd');\n carsAtEndRef.on(\"value\", function (data) {\n carsAtFinishLine = data.val();\n this.rank = data.val();\n });\n }",
"function countStop()\n{\n return stopCount.length-4 + \" stops in total.\";\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
define function currentLine. Tells the person their position in the line. | function currentLine(line) {
//Create an empty container (array) to store the persons name and position.
var ref = [];
// i used as counter
var i;
// write static part of printed message
var message = "The line is currently:";
//copy contents (names) from katzDeliLine accross to lin... | [
"get currentLine() {\n return this.lines[this.lineIndex];\n }",
"get currentline() {\n return this._currentline;\n }",
"function currentLine(line) {\n \n if(line.length < 1){\n return \"The line is currently empty.\";\n }\n \n const lineList = [];\n \n for(let n=0; n<line.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
12. Write a function that accepts a pokemon Object and returns an array of ability names | function pokemonAbilities(pokemon){
return response.abilities.forEach(function(ablilites){
console.log(abilities.ability.name)
})
} | [
"function pokemonAbilities(response){\n\tvar abilitiesArray = [];\n\tresponse.abilities.forEach(function(item) {\n\t\tabilitiesArray.push(item.ability.name); \n\t});\n\treturn abilitiesArray;\n}",
"@computed get teamAbilities() {\n return this.team.map(teamPkmnProps => {\n if (teamPkmnProps.name) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load icons list set based on environment Production: `iconssprite.config.json` subset Development: `/src/assets/icons | function loadIconsSet() {
let list = [];
if (build.isDev()) {
list = fs.readdirSync(iconsPath).map(file => file.replace(/\.[^\.]+$/, ''));
} else {
list = require('../src/assets/icons-sprite.config.json');
}
return list;
} | [
"async _cacheResourcesAsync () {\n const images = [require('./assets/images/icon.png')]\n const cacheImages = images.map(image => {\n return Asset.fromModule(image).downloadAsync()\n })\n return Promise.all(cacheImages)\n }",
"function prefetchIcons() {\n\tvariants.forEach(variant => {\n\t\ttrop... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function updates the doesntContain array | function updateContainsArray(rowNo,colNo,squareValue) {
doesntContain[0][rowNo].splice(doesntContain[0][rowNo].indexOf(squareValue),1);
doesntContain[1][colNo].splice(doesntContain[1][colNo].indexOf(squareValue),1)
doesntContain[2][(rowNo - rowNo % 3) + (colNo - colNo % 3) / 3].splice(doesntContain[2][(rowNo - ro... | [
"function notcontains(data, array) {\n for (i in array) {\n if (data == array[i]) {\n return false\n }\n\n }\n return true\n }",
"function updateMentionsCollection() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
config components by routes, init router | initRouter() {
Router.config(AppConfig.get('routes'));
Router.onBeforeAction((r, p) => {
const token = Accounts.getToken()
if(!r.ignoreLogin && !token) Accounts.logout()
})
/** Login **/
Router.on('login', (rota, req) => {
this.component(... | [
"setupRoutes(){\n this.indexController = new IndexController({ layout: this.layout });\n this.indexRouter = new IndexRouter({ controller: this.indexController });\n \n this.channelController = new ChannelController({ layout: this.layout });\n this.channelRouter = new ChannelRouter({ controller: this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MOSTRAR VENTANAS // Segun rol se muestra la primera ventana | function mostrarVentanaInicio(){
//verificar el rol
if (datosUsuario[0]["idRol"] == 3) {
mostrarVentanaChef1(datosUsuario[0]["nombre"]); // Invoca la ventana de Cocina y envia nombre del empleado
}
else if(datosUsuario[0]["idRol"] == 2) {
mostrarVentanaCajero(datosUsuario[0]["nombre"]); //Invoca la ventana de C... | [
"function turnosRestantes(){\n let cliente = traerLocalStorage('usuarioLogueado')[0];\n let membresia=0;\n switch(cliente.membresia){\n case 'Bronce': membresia=2; break;\n case'Plata': membresia=3; break;\n case 'Oro': membresia=4; break;\n case 'Champion': membresia=6; break;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AUTH: Require tmobileids for certain routes (POST/PATCH/DELETE) | requiretmobileid (req, res, next, loginUrl = '/login') {
if (env === 'production') {
Log.debug(`ISAUTH: ${req.isAuthenticated()}`)
Log.debug(`TYPEOF: ${typeof req.isAuthenticated}`)
Log.debug(`SESSION OBJ: ${req.session}`)
}
// req.isAuthenticated()
// ? return next()
// ... | [
"applyRoutes() {\n // Rotas públicas\n this.express.post(\n '/api/authentication/sign_in',\n (request, response, next) => this.signin(request, response, next),\n );\n this.express.post(\n '/api/authentication/sign_up',\n (request, response, next) => this.signup(request, response, nex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
|| FUNCTION: MediaClickWithInfo || PARAMETERS: || RETURNS: || PURPOSE: Clicks to the URL you have listing in your media, plus || the value passed in as 'ADDITIONAL INFO'. This is || useful if you have defined your media URL's as || directories, and have multiple files in those directori|| || | function MediaClickWithInfo( AdditionalInfo )
{
if( LoadInNewWindow ) {
URL = xMediaContent[iCurrentImage+1] + AdditionalInfo;
win=window.open(URL,"NewWindow","");
if (!win.opener)win.opener=self;
} else
document.location.href = (xMediaContent[iCurrentImage+1] + Additional... | [
"function torrentOnClick(info, tab) {\r\n add_torrent(info.linkUrl);\r\n}",
"function ShowMediaInfo(media, type, id)\n{ \n switch(media)\n {\n case \"movies\" : ShowMovieInfo(id);\n break;\n\n case \"tvshows\" : if (type != \"episodes\") {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to refresh the images | function refresh() {
ranArrInd(imgArr.length);
imgOneEl.src = imgArr[imgInd[0]].path;
imgTwoEl.src = imgArr[imgInd[1]].path;
imgThreeEl.src = imgArr[imgInd[2]].path;
imgOneEl.name = imgArr[imgInd[0]].name;
imgTwoEl.name = imgArr[imgInd[1]].name;
imgThreeEl.name = imgArr[imgInd[2]].name;
imgArr[imgInd[0]... | [
"refresh() {\n for (let i = 0; i < this.cache_.length; i++) {\n this.updateImageOverlay_(this.cache_[i], true);\n }\n }",
"function refreshImages() {\n for (var i = 0; i <= numImages; i++) {\n // Append a timestamp to the url to force the browser not to cache it\n var time... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parser helping function takes an array of text created with .split(' '), and an index number for where to start, then rebuilds the string. Can also accept an index value for where to stop. | function build(text, index, stop) {
var newtext = '';
if(stop == undefined || stop == 0) {stop = text.length}
else if(stop < 0) {stop += text.length}
if(index == stop || index == text.length - 1) {return text[index];}
for(var i = index; i < stop; i++) {
newtext += text[i] + ' ';
}
return newtext;
} | [
"function splitTextByIndex(text, index) {\r\n let textPart1 = \"\";\r\n let textPart2 = \"\";\r\n\r\n for (let i = 0; i < text.length; i++) {\r\n if (i >= index) {\r\n textPart2 += text[i];\r\n } else {\r\n textPart1 += text[i];\r\n }\r\n }\r\n\r\n return [t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For functionlike signatures, this returns the TSDoc "overload index" which can be used to identify a specific overload. | getOverloadIndex(astDeclaration) {
const allDeclarations = astDeclaration.astSymbol.astDeclarations;
if (allDeclarations.length === 1) {
return 1; // trivial case
}
let overloadIndex = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);
if (overloadIndex ===... | [
"insertOverload(index, structure) {\r\n return this.insertOverloads(index, [structure])[0];\r\n }",
"selectOverloadBySignature(type) {\n return this.overloads.find(func => type.sameSignature(func.type));\n }",
"addOverload(structure) {\r\n return this.addOverloads([structure])[0];\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Views details of single selected agency | function viewAgency(agency_id) {
console.log('view details clicked ', agency_id);
$http.get('/agencies/' + agency_id).then(function(response) {
agency.selected = response.data;
console.log('Agency record back from db: ', agency.selected);
});
} | [
"function viewDetails(appointment_id) {\n console.log('view details clicked ', appointment_id);\n $http.get('/appointments/' + appointment_id).then(function(response) {\n appointment.selected = response.data;\n console.log('Apt & Client details back from db: ', appointment.selected);\n });\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changeGate() Function called to change the gates that are output. Each gate has a value that will satisfy the logic. The value is randomly slected between 0 or 1. For now the number that determines the gate, that is the value that satisfies that "gate". | function changeGate(gate){
//V Change value of the first gate V
if(gate == 1){
temp = Math.floor(Math.random() * 16);
gate1.type = temp;
gate1.need = gateValue[temp];
}
//V change the value of the second gate V
if(gate == 2){
temp = Math.floor(Math.random() * 16);
... | [
"function resetGates(gate){\n\n if(gate == 1){\n changeGate(1);\n gate1.rate = Math.floor((Math.random() * 4) +1);\n while(gate1.rate == gate2.rate || gate1.rate == gate3.rate){\n gate1.rate = Math.floor((Math.random() * 4) +1);\n }\n gate1.y = -200;\n }\n else... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update wopo data list back to custom record | function updateWopoDataList(recs) {
try {
for (var i = 0; i < recs.length; i++) {
updateWopoDataRecord(recs[i]);
}
}
catch (ex) {
nlapiLogExecution('ERROR', 'error in updateWopoDataList(recs) method', ex.toString());
throw ex;
}
} | [
"updateRecord(data, state) {\n const index = data.findIndex(i => JSON.stringify(i) === JSON.stringify(state.recordRef || {}));\n switch (state.type) {\n case TransactionType.ADD:\n data.push(state.value);\n break;\n case TransactionType.DELETE:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encode one frame from the encoder queue. | function encodeFrame() {
var png = new PNG(frames[currentFrame]);
png.decode(function(pixelData) {
//var pixelData = frames[currentFrame];
var frameCount = frames.length;
console.log("Encoding " + fileName + " frame: " + (currentFrame+1) + " of " + frameCount);
encoder.addFrame(pixelData)... | [
"function produceFrame(frame)\n{\n\tif (stream_buffer.length<=0) //Skip frame if consumer is falling behind\n\t\tstream_buffer.push(frame);\n}",
"function encodeFrame(frameNum, encoder, dialog, canvases, resolve = function() { }){\r\n\r\n\t// Cancel\r\n \tif (!ENCODING){\r\n \t\tstopRecording();\r\n \t\treturn;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function called by TouchableOpacity to move a note down in the list | function MoveNoteDown(noteIndex) {
if (noteIndex > stateVars.itemArray.length - 2) {
return;
}
var newNoteArray = [];
if (stateVars.itemArray != null) {
newNoteArray = stateVars.itemArray;
}
var placeholder = newNoteArray[noteIndex + 1];
... | [
"function moveNote() {\n let lastPosition = noteWrapper.selectedIndex;\n function listener(ch, key) {\n if (\n key.name === 'k' ||\n key.name === 'j' ||\n key.name === 'up' ||\n key.name === 'down'\n ) {\n let currentPosition = noteWrapper.selectedIndex;\n notes.swap(currentPos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the Yerushlmi masechta (tractate) of the Daf Yomi in Hebrew, It will return &x05D1;&x05E8;&x05DB;&x05D5;&x05EA; for Berachos. | getYerushalmiMasechta() {
return Daf.masechtosYerushlmi[this.masechtaNumber];
} | [
"getMasechta() {\n return Daf.masechtosBavli[this.masechtaNumber];\n }",
"isHebrewFormat() {\n return this.hebrewFormat;\n }",
"function convertHEB(totr) {\n\tif (totr) {Temp = []; Temp[0] = totr;}\n\telse Temp = document.getElementsByClassName(\"hebrew\");\n\ttlen = Temp.length;\n\tfor (i=0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Combine the two R parts together. | get rCombined() {
return (this.r7 & 0x80) | (this.r & 0xF7);
} | [
"function accumulateResources(res1, res2)\r\n{\r\n var ri;\r\n\r\n for ( ri = 0; ri < 4; ++ri )\r\n {\r\n res1[ri] += res2[ri];\r\n }\r\n\r\n return res1;\r\n}",
"function orRmm(r, r1, r2) {\n return function(registers, mmu) {\n const value = mmu.readByte(pairRegister(registers, r1, r2));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funzione che genera una lista XHTML con gli item presi dal testo RSS (linguaggio basato su xml) ricevuto come argomento xml | function parsificaXml( xml ) {
// variabili di funzione
var
// Otteniamo la lista degli item dall'RSS 2.0 di edit
items = xml.getElementsByTagName("item"),
// Predisponiamo una struttura dati in cui memorrizzare le informazioni di interesse
itemNodes = new Array(),
// la variabile di ritorno, in ques... | [
"function parsificaXml(xml) {\n\n\t// Otteniamo la lista degli item dall'RSS 2.0 di edit\n\tvar items = xml.getElementsByTagName(\"item\");\n\n\t// Predisponiamo una struttura dati in cui memorrizzare le informazioni di interesse\n\tvar itemNodes = new Array();\n\n\t// la variabile di ritorno, in questo esempio, e'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |