query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
End rotating Must call if `rotateStart()` was called | rotateEnd() {
return this._getUpdatedState({
startRotationX: null,
startRotationOrbit: null
});
} | [
"rotateEnd() {\n return this._getUpdatedState({\n startRotatePos: null,\n startBearing: null,\n startPitch: null\n });\n }",
"stopRotation() {\n this._options.rotation.enable = false;\n }",
"function stopAnimation() {\n animatedMove = {};\n autoRotateSpeed = config.autoRotate ? c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
iframe all reset. 1. spEdit remove 2. targetOutline remove 2. ipkMemu remove 3. hide hiddenBox | function f_resetAll(){
fdoc.find('.spEdit').removeAttr('contenteditable').removeClass('spEdit');
fdoc.find('.targetOutline').removeAttr('contenteditable').removeClass('targetOutline');
fdoc.find('#ipkMenu').hide();
fdoc.find('.ipkMenuCopyAnime').removeClass('ipkMenuCopyAn... | [
"function hideiframe() {\r\n\r\n browser = navigator.appName;\r\n\t\r\n\t$(\"#text\"+selected_div).css('visibility','');\r\n\t\r\n\tvar myIFrame = document.getElementById(\"iView\");\r\n var iframe_body_html = myIFrame.contentWindow.document.body.innerHTML;\r\n \r\n $(\"#text\"+selected_div).html... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that adds after every gamepad press the '2' piece inside a random game cell if the cell is currently empty | function generateNumberInRandomCell () {
let randomCell = Math.floor(Math.random() * 15);
if (gameCells[randomCell].innerText != "") {
randomCell = Math.floor(Math.random() * 15);
}
let span = document.createElement('span');
span.innerText = '2';
span.classList.add('game-piece');
... | [
"insertNumber() {\r\n this.emptySpaces = [];\r\n for (let i = 0; i < this.gridSize; i++) {\r\n for (let j = 0; j < this.gridSize; j++) {\r\n this.board[i][j] == 0 ? this.emptySpaces.push({ \"x\": i, \"y\": j }) : undefined;\r\n }\r\n }\r\n let randObj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function called from boundary via mainMgmt In case that delete all boundary parent of vertex Different between this func and remove func is, in this case we don't care the parent, because it was deleted | delete() {
// Remove all edge relate to vertex
this.vertexMgmt.edgeMgmt.removeAllEdgeConnectToVertex(this)
// Remove from DOM
d3.select(`#${this.id}`).remove()
// Remove from data container
_.remove(this.dataContainer.vertex, (e) => {
return e.id === this.id
})
} | [
"function detachVertexHelper()\n{\n\t//if (INTERSECTED.name.category == 'stuff' && readOnly != 1) {\n\t\tfor (var i=0; i<vertexHelpers.length; i++){\n\t\t\tscene.remove(vertexHelpers[i]);\n\t\t}\n\t\tvertexHelpers = [];\n\t\tclickedVertex = null;\n\t//}\n}",
"deleteVertex(vertex) {\n\t\t\tlet freeOfConstraint;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function which asserts a schema is valid by throwing an error if it is invalid. | function assertValidSchema(schema) {
var errors = validateSchema(schema);
if (errors.length !== 0) {
throw new Error(errors.map(function (error) {
return error.message;
}).join('\n\n'));
}
} | [
"function assert$c(value, struct) {\n const result = validate(value, struct);\n\n if (result[0]) {\n throw result[0];\n }\n}",
"function assert_error(plan) {\n var ok = false;\n try {\n tasks(\"inputs\").run(plan);\n ok = false;\n } catch(e) {\n ok = true;\n }\n if (!ok)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get s3 static folder path | function pathStaticS3(id, baseFolder, subFolder) {
var path = '';
path += baseFolder + '/';
path += idLevel(id) + '/';
if (subFolder) {
path += subFolder + '/';
}
return path;
} | [
"function urlStaticS3(userId, baseFolder, subFolder, filename, width, random) {\n\tvar url = pathStaticImageS3(userId, baseFolder, subFolder, filename, width);\n\tif (S3URL) {\n\t\turl = S3URL + url;\n\t}\n\treturn random ? url + '?' + Math.random() : url;\n}",
"function pathStaticImageS3(id, baseFolder, subFolde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to Create Histogram by Default Projects Histogram | function projectHistogram() {
var hG = {}, hGDim = {t: 30, r: 30, b: 100, l: 80};
hGDim.w = 800 - hGDim.l - hGDim.r,
hGDim.h = 600 - hGDim.t - hGDim.b;
var axisPadding = 3;
var feelings= [1,2,3,4,5];
... | [
"function Histogram(PreRoundingMultiplier)// generator\r\n{\r\n var RD=PreRoundingMultiplier,hist= new Map();;\r\n function atEveryStepDo(CurrentPosition,CurrentAmount=1)\r\n {\r\n //Head is too old, it is leaving the window\r\n\t \r\n\t var CurrentPositionRound=parseFloat(( Math.round( CurrentPosi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collects the ids of the clicked item objects (the property id). | function collectClicked() {
var insulaIdsOfClicked = [];
var propertyIdsOfClicked = [];
var selectedInsulae = getUniqueClicked();
var length = selectedInsulae.length;
for (var i=0; i<length; i++) {
var property = selectedInsulae[i];
if (property.feature.properties.Property_Id != undefined){
var prop... | [
"function selectPropertiesInAllSelectedInsula(uniqueClicked){\n\t\tif(interactive){\n\t\t\tvar i=0;\n\t\t\tvar currentInsulaId;\n\t\t\tvar currentInsula;\n\t\t\tvar listOfSelectedInsulaIds=[];\n\t\t\tfor(i;i<clickedInsula.length;i++){\n\t\t\t\tcurrentInsula=clickedInsula[i];\n\t\t\t\tcurrentInsulaId=currentInsula[1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a blank offer | function createBlankOffer(data) {
console.log(data);
return $http.post('/api/v1/offers/', data)
.then(generalCallbackSuccess)
.catch(generalCallbackError);
} | [
"function create(req, res) {\n Offer\n .create(req.body)\n .then(offer => res.status(201).json(offer))\n .catch(err => {\n if (err.name === 'ValidationError') {\n res.status(422).json(err)\n } else {\n res.status(500).json(err)\n }\n })\n}",
"static from(offerCreate) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a google form for any lessons scheduled to occur between this Wednesday and next. Because this looks for Wednesday of the current week, this job MUST NOT run before Sunday. Running this job deletes triggers associated with any other forms, such as forms from the previous week's lesson signup. | function cronJobCreateForm() {
log(COL_TIMESTAMP, new Date())
// Check for scheduled lessons from Wed to Wed
var from = new Date();
from.setDate(from.getDate() - from.getDay() + 3); // Get Wednesday of current week
Logger.log('from %s', from.toString())
var until = new Date(from);
until.setDate(from.getDa... | [
"function formSetup() {\n let sheet = SpreadsheetApp.getActiveSpreadsheet();\n if (sheet.getFormUrl()) {\n let ui = SpreadsheetApp.getUi();\n ui.alert(\n 'ℹ️ A Form already exists',\n 'Unlink the form and try again.\\n\\n' +\n 'From the top menu:\\n' +\n 'Click \"Form\" > \"Unlink form\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This encodes the common fields that precede an import definition, i.e. module_len module field_len field kind | importDefinition (definition) {
let [module, field] = definition.importSource;
return this
.string(module, "module")
.string(field, "field")
.byte(`external_kind.${definition.kind}`, "kind");
} | [
"loadFieldInfo(){\n let fieldInfo = [];\n this.props.orderStore.currentOrder.templateFields.fieldlist.field.forEach(field =>\n this.props.orderStore.fieldInfo.push([field, '']));\n this.props.orderStore.fieldInfo.forEach(field =>\n {\n if(field[0].type == \"SEPARATOR\"){\n field[1] = \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function saves a key under the provided identifier. This is used to save the keys that are used to decrypt and encrypt blobs that are identified by a 'keyid'. | function saveKey(id, key) {
savedKeys[id] = key;
} | [
"async saveIdentity(identity) {\n if (identity && identity.token) {\n KeyManager.replacePassword(KEYCHAIN_NAME, identity.token)\n delete identity.token;\n }\n if (!identity) {\n KeyManager.deletePassword(KEYCHAIN_NAME)\n }\n await DatabaseStore.inTransaction((t) => {\n return t.pe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private Methods Inverse side set in the relation can be either string property name of the column on inverse side, either can be a function that accepts a map of properties with the object and returns one of them. Second approach is used to achieve typesafety. | computeInverseSide(inverseSide) {
const ownerEntityPropertiesMap = this.inverseEntityMetadata.createPropertiesMap();
if (typeof inverseSide === "function")
return inverseSide(ownerEntityPropertiesMap);
if (typeof inverseSide === "string")
return inverseSide;
// th... | [
"get hasInverseSide() {\n return this.inverseEntityMetadata && this.inverseEntityMetadata.hasRelationWithPropertyName(this.inverseSideProperty);\n }",
"get inverseSideProperty() {\n if (this._inverseSideProperty) {\n return this.computeInverseSide(this._inverseSideProperty);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove config items without art | async function purgeNoArt(dir) {
var configFile = configPath + dir + '.json';
var config = await fsw.readFile(configFile, 'utf8');
var config = JSON.parse(config);
for await (let item of Object.keys(config.items)) {
if ((config.items[item].hasOwnProperty('has_logo')) || (config.items[item].hasOwnP... | [
"function clearConfig() {\n const configSheet = getConfigSheet();\n const namedRanges = configSheet.getNamedRanges();\n namedRanges.forEach((namedRange) => {\n if (namedRange.getName() === 'gradeValues'\n || namedRange.getName() === 'gradeRanges') {\n const gradeRange = namedRange.getRange();\n f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION creates the requests and event listeners for the API Requests | function createRequests() {
try {
// Calls GenerateXmlHttpRequest() and assigns a new XMLHttpRequest to the variable
let weatherRequest = GenerateXmlHttpRequest();
let forecastRequest = GenerateXmlHttpRequest();
// * Resetting / assigning APIRequest()'s global VARIABLES *
//assigns the radio button ... | [
"init()\n {\n this.request = undefined;\n this.request = new XMLHttpRequest();\n\n this.request.overrideMimeType(this.config.requestType);\n\n for (let handler in this.config.handlers) {\n this.request.addEventListener(handler, this.config.handlers[handler]);\n }\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value of a parameter. `name` name of the parameter | getParameter(name) {
if (this.params.hasOwnProperty(name)) {
return this.params[name];
} else {
return null;
}
} | [
"function ServerBehavior_getParameter(name)\n{\n var paramVal = null;\n var undefined; // Use to compare against 'undefined' type\n \n // Note: be careful about when we use the old parameter value. We only want do this\n // if the new version of the parameter is undefined. We may have assigned the\n // ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which will automatically store any Javamon made into array | function pushJavamon(all){
javamon.push(all)
} | [
"function store() {\n customs.push(custom); //stores custom arrays\n custom = {\n name: \"\",\n opt: [] //clears custom array to get new things\n };\n}",
"function buildAddrOfArray(obj)\n{\n let arr = [obj, obj];\n let tmp = {escapeVal: arr.length};\n arr[tmp.escapeVal] = floatMapObj;\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will be called when a client disconnects from the server. It will remove the disconnected client from the clients array, and if the client is one of the two players, it will set that player to null, and reset the game. | onDisconnect(client){
this.clients.splice(this.clients.indexOf(client),1);
if(this.player1 == client) this.player1 = null;
if(this.player2 == client) this.player2 = null;
if(this.player1 == null || this.player2 == null){
Game.reset();
this.broadcastStatus();
}
} | [
"function handleClientDisconnection(socket) {\n\tsocket.on('disconnect', function() {\n\t\tvar nameIndex = namesUsed.indexOf(nickNames[socket.id]);\n\t\tdelete namesUsed[nameIndex]; \t\t\t\t\t\t\t\t//del an elem containig user's nickname in the namesUsed array\n\t\tdelete nickNames[socket.id]; \t\t\t\t\t\t\t\t//del... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The value of the current property is always the final element of this.stack. | getValue() {
return getLast(this.stack);
} | [
"popValue() {\n let size = this.stack.pop().size;\n this.write(\"[-]<\".repeat(size));\n }",
"peek(){\n\n if(!this.top){\n return 'Stack is empty.';\n\n }\n try{\n return this.top.value;\n } \n catch(err){\n return 'Stack is empty.';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./node_modules/underscore/modules/_tagTester.js Internal function for creating a `toString`based type tester. | function tagTester(name) {
var tag = '[object ' + name + ']';
return function(obj) {
return _setup["t" /* toString */].call(obj) === tag;
};
} | [
"function fnExoticToStringTag() {}",
"static string(v) { return new Typed(_gaurd, \"string\", v); }",
"toSTRING() {\n switch (this._type) {\n case \"NODE\":\n return this._value.nodeType === 1 ? this._value.outerHTML : this._value.nodeValue;\n case \"STRING\":\n return this._value;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resend the data if previous sending failed | resend() {
this.streamStatus = 'initialize';
this.requester.addToSendList(this.data);
} | [
"retry()\n {\n if ((this.attempts + 1) === this.config.attempts) {\n window.clearInterval(this.timer);\n return;\n }\n\n this.attempts++;\n\n this.init();\n this.send();\n\n return;\n }",
"sendLoop() {\n\n while (this.sends.length > 0) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move Up One Level | function MoveUpOneLevel()
{
var treeFrame = GetTreeFrame();
var selectedNode = treeFrame.getSelectedTreeNode();
if(selectedNode != null) //tree could be expanded but no node selected
{
var parentNode = selectedNode.getParent();
if(parentNode != null) //check we are not at the top of the t... | [
"function goUp() {\n if (currentSectionIndex > 0) {\n goToSection(currentSectionIndex - 1);\n }\n }",
"function levelUp(){\n let nextlvxp = getxpforlv(player.level + 1);\n while(player.xp > nextlvxp){\n if(player.level != 100){\n player.levelup();\n adddiv_c(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic Mask Stack data structure | function StencilMaskStack()
{
/**
* The actual stack
*
* @member {any[]}
*/
this.stencilStack = [];
/**
* TODO @alvin
*
* @member {boolean}
*/
this.reverse = true;
/**
* Internal count
*
* @member {number}
*/
this.count = 0;
} | [
"function Stack() {\n\tthis.layers = [];\n\tthis.layers.push({});\n\t\n\tthis.addLayer = function() {\n\t\tthis.layers.push({});\n\t}\n\tthis.removeLayer = function() {\n\t\tthis.layers.pop();\n\t}\n\tthis.addVar = function(name, value) {\n\t\tname = name.toLowerCase();\n\t\tthis.layers[this.layers.length-1][name] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets all booleans in videoList to false to reset played | function resetPlayed() {
for (i = 0; i < videoList.length; i++) {
videoList[i][1] = false;
}
} | [
"function _pauseCurrentPlayingVideo(){\n\t\t\tcontext.videoListControl.filter(function (videoItem) {\n\t\t\t\t// i need to get all the videos that are playing, which means its currentState is equals to 'play'\n\t\t\t\treturn videoItem.API.currentState === 'play';\n\t\t\t}).map(function (filteredVideo) {\n\t\t\t\t//... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks at yourself, displaying the player's current appearance in whole. | function lookAtMe()
{
// First, the variable newText is created to hold all of the required text to print.
var newText = "";
// The player's basic information is concatenated into newText.
newText += yourAppearance[0];
// Space is added.
newText += "<br>";
// The player's current clothing is concatenated into ne... | [
"function writeUI () {\n player.wherePlayer();\n health.writeThirst();\n}",
"function happycol_presentation_play(args){\n\thappycol_assignments(args, function(){\n\t\thappycol_presentation_beginShow(args);\n\t});\n\t\n}",
"function chanceUpdateOnUI() {\n let chanceUpdateElement = document.getElementsByClassN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the meal type from the filter information | function getMealFromFilter(filterParams, data) {
let meals = [];
let restaurantData = [];
for (let key in filterParams) {
let split = key.split("-");
if (split[0] == "meal") meals.push(split[1]);
}
if (meals.length == 0) {
return data;
} else {
for (let meal in meals) {
for (let key in data) {
if... | [
"getType(){\n const { type } = this.props\n if (type) return type\n return \"posts\"\n }",
"function getCategory(type){\n if (type == 'jeans' || type == 'pants' || type == 'leggings') return 'pants';\n if (type == 'longsleeve' || type == 'tshirt' || type == 'sweatshirt' || type == 'sweater' ||... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::AppMesh::GatewayRoute.GatewayRouteVirtualService` resource | function cfnGatewayRouteGatewayRouteVirtualServicePropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnGatewayRoute_GatewayRouteVirtualServicePropertyValidator(properties).assertSuccess();
return {
VirtualServiceName: cdk.stringToCloudFormatio... | [
"function cfnVirtualServiceVirtualRouterServiceProviderPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnVirtualService_VirtualRouterServiceProviderPropertyValidator(properties).assertSuccess();\n return {\n VirtualRouterName: cdk.str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
store (contains the products) | function store() {
this.products = [];
} | [
"addProducts() {\n document.querySelector('#product-list').innerHTML = '';\n document.querySelector('#update').innerHTML = '';\n Product.all.forEach(\n product => (document.querySelector('#product-list').innerHTML += product.renderProduct())\n );\n }",
"function addProduct({ name, price, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
YOUHOLE Returns a randomly generated "seed" to use as a search term. | function getSearchSeed() {
if(randomWords.length === 0 && !isPopulating) {
populateRandomWords();
}
algo = Math.floor(Math.random() * 9) + 1;
if(algo === 1) {
return nonsenseWord();
} else if(algo === 2) {
return nonsenseChinesePhrase();
} else if(algo === 3) {
return nonsenseJapanesePhrase... | [
"function pickRootWord() {\n let rand = Math.floor(Math.random() * sixLetterDict.length);\n rootWord = sixLetterDict[rand];\n}",
"function randomSeedQuery() {\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = crypto.getRandomValues(new Uint8Array(1))[0] % 16 |... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts public part of given key to ASN1 Hex String. | function _rsapem_publicKeyToX509HexString(rsaKey) {
var encodedIdentifier = "06092A864886F70D010101";
var encodedNull = "0500";
var headerSequence = "300D" + encodedIdentifier + encodedNull;
var keys = _rsapem_derEncodeNumber(rsaKey.n);
keys += _rsapem_derEncodeNumber(rsaKey.e);
var keySequenc... | [
"function encodePublicKey(publicKey) {\n const x = publicKey.getX().toArrayLike(Buffer, \"be\", 32)\n const y = publicKey.getY().toArrayLike(Buffer, \"be\", 32)\n\n return Buffer.concat([x, y]).toString(\"hex\")\n}",
"function pubKey2pubKeyHash(k){ return bytes2hex(Bitcoin.Util.sha256ripe160(hex2bytes(k))); }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the data of the prsm from data variable prsm_data and convert to Html | function loadDatafromJson2Html(){
document.getElementById("File_name").innerHTML = prsm_data.prsm.ms.ms_header.spectrum_file_name;
document.getElementById("PrSM_ID").innerHTML = prsm_data.prsm.prsm_id;
document.getElementById("Scan").innerHTML = prsm_data.prsm.ms.ms_header.scans;
document.getElementById("Precursor_... | [
"reportPRListDetailed( dataPR ) {\n if( dataPR === undefined ) {\n return(\n <div><h3>Array was undefined</h3></div>\n );\n }\n\n if( dataPR.length === 0 ) {\n return(\n <div><h3>Found no data</h3></div>\n );\n }\n\n var githubPRsDataDetailed;\n\n githubPRsDataDet... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List short link objects by filter and pager. | static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('shortlink_shortlink', 'list', kparams);
} | [
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('livechannelsegment', 'list', kparams);\n\t}",
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signs the given transaction data and sends it. Abstracts some of the details of buffering and serializing the transaction for web3. | function sendSigned(txData, cb) {
const privateKey = new Buffer(privKey, 'hex')
const transaction = new Tx(txData)
transaction.sign(privateKey)
const serializedTx = transaction.serialize().toString('hex')
web3.eth.sendSignedTransaction('0x' + serializedTx, cb)
} | [
"function sendSigned(txData, cb) {\n const privateKey = new Buffer(config.privKey, 'hex');\n const transaction = new Tx(txData);\n transaction.sign(privateKey);\n const serializedTx = transaction.serialize().toString('hex');\n web3.eth.sendSignedTransaction('0x' + serializedTx, cb);\n}",
"function sendTransa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class loader utility to load JavaScript classes from qualified route name, e.g. actions.HomeActionget. Adds a cache layer in order to speed up classes lookup. | function ClassLoader() {
this.cache = {};
} | [
"function ResourceLoader() {}",
"parse(parentPath, arr, parentHandlers, index) {\n\n let handler\n\n // check if the module is path of mjs file or a function, function can be used as a \n // middleware or guard\n switch (typeof arr[index].module) {\n case 'string':\n handler = async (outle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List file assets by filter and pager. | static listAction(filter, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('fileasset', 'list', kparams);
} | [
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('flavorasset', 'list', kparams);\n\t}",
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Form to select section for which to view top stories default selection = 'home' input type = radio buttons | function TopStoriesForm({ selectTopStorySection }) {
const [formData, setFormData] = useState('home');
function handleChange(evt) {
evt.preventDefault();
setFormData(evt.target.value);
}
function handleSubmit(evt) {
evt.preventDefault();
selectTopStorySection(formData);
}
/** Create Form ... | [
"function chooseStation() {\n var stationId = window.location.hash.substr(1);\n\n if (!stationId) {\n // this is the default if none selected\n stationId = 'nac_radio';\n }\n\n var station = STATIONS[stationId];\n var streamId = station.streamId;\n var url = station.url;\n var logo = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes the userprovided address by retrieving corresponding longitude, latitude and saving the results through an asynchronous request to the server. | function processAddress()
{
var address = getAddress();
//creating a geocoder object
var geocoder = new google.maps.Geocoder();
geocoder.geocode({'address': address}, function(results, status)
{
//If this was successful, then...
if (status === 'OK')
{
//get the latitude and longitude: Note this is part ... | [
"async handleAddressLookup() {\n /* Display loading template while API call happens */\n this.isLoading = true;\n\n /* Disable the templates for New Address Search and Manual Entry. Enable the Search Results template. */\n this.newSearchForm = false;\n this.manualEntryForm = false... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isolate sixth box in LEVEL FOUR | function levelFourGridBox6(j) {
let box6 = 18;
let across = 2;
let nextLine = 12;
if (
(j > box6 && j < box6 + across) ||
(j > box6 + nextLine && j < box6 + nextLine + across)
) {
return true;
} else {
return false;
}
} | [
"function levelFourGridBox4(j) {\n let box4 = 16;\n let across = 2;\n let nextLine = 12;\n if (\n (j > box4 && j < box4 + across) ||\n (j > box4 + nextLine && j < box4 + nextLine + across)\n ) {\n return true;\n } else {\n return false;\n }\n}",
"function levelFourGridBox5(j) {\n let box5 = 17... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This new function captures a user quote from a prompt every time the user click the botton 'Write your own quote'. 1 Ask for a user quote an store the response in a variable 'userQuote'. 2 Ask the user nick name and save the answer inside the variable 'userSource'. . 3 Push the new object quote into last position of th... | function newQuote() {
var userQuote = prompt('Write any personal quote that you think.');
var userSource =prompt('What is your nick name?');
quotes.push({
quote:userQuote,
source:userSource,
citation: "This Website",
year:2019
});
} | [
"function showQuotes() {\n\n // create a new array of all the authors of the quotes to use for the user prompt\n var authors = [];\n for (var i = 0; i < quotes.length; i++) {\n authors.push(i + \") \" + quotes[i].author);\n }\n \n // ask the user to choose which author's quote they want to see\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set equal heights of list: columns list obj | function setEqualHeight(columns) {
var tallestItem = 0;
columns.each(function(index, item) {
var itemHeight = $(this).height();
alert(itemHeight);
if(itemHeight > tallestItem){
tallestItem = itemHeight;
}
});
columns.height(tallestItem);
} | [
"function saveListSize() {\n var $this = $(this);\n $this.css('min-height', $this.height());\n }",
"function setupHeights() {\n let heights = [];\n for (let i = 1; i <= num_elements; i++) {\n heights.push(Math.floor(i * height_scalar));\n }\n return heights;\n}",
"setupBodyHeights () {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
:: source:string offset:number length:number cachedContent:?string cachedLineCount:?number | constructor(source, offset, length) {
this.source = source
this.offset = offset
this.length = length
this.cachedContent = null
this.cachedLineCount = null
} | [
"static sourcePosition() {\n var _a;\n const stackObj = {};\n Error.captureStackTrace(stackObj, Resource.sourcePosition);\n // Parse out the source position of the user code. If any part of the match is missing, return undefined.\n const { file, line, col } = ((_a = Resource.sourc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn rover right. Without moves. | function turnRight(rover) {
var movement="r";
switch(rover.direction) {
case 'N':
rover.direction = 'E';
break;
case 'E':
rover.direction = 'S';
break;
case 'S':
rover.direction = 'W';
break;
case 'W':
rover.direction = 'N';
break;
}
var report = v... | [
"function goRight(rover) {\r\n\tswitch(rover.direction) {\r\n\t\tcase 'N': rover.position[1]++;\r\n\t\t\tbreak;\r\n\t\tcase 'E': rover.position[0]++;\r\n\t\t\tbreak;\r\n\t\tcase 'W': rover.position[0]--;\r\n\t\t\tbreak;\r\n\t\tcase 'S': rover.position[1]--;\r\n\t\t\tbreak;\r\n\t}\r\n}",
"function turnRight(rover)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate Private key Given the username and prefix, generate a private key string | function generatePrivateKey(prefix, username){
return prefix + '.' + 'component' + '.' + username;
} | [
"generatePrivateKey() {\n // Generates 64 hexadecimal values then concatenates all 64 values\n let r = [];\n for (let i = 0; i < 64; i++) {\n r.push(this.random.integer(0, 15).toString(16));\n }\n return r.join('');\n }",
"function genKeys(cb){\n // gen private\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
project 4d point in 3d space | function project4to3(p) {
var v = viewpoint4D.v,
pv = p.minus(v),
lambda = -1 * v.dotproduct(v) / v.dotproduct(pv),
pp = pv.scalproduct(lambda).plus(v),
p1 = pp.dotproduct(viewpoint4D.e1),
p2 = pp.dotproduct(viewpoint4D.e2),
p3 = pp.dotproduct(viewpoint4D.e3);
ret... | [
"project(x, y) {\n var width = this.width;\n var height = this.height;\n var vpRadius = Math.sqrt(width*width + height*height) / 2;\n var scale = this.scene.view.r / vpRadius;\n var vLeft = this.scene.view.x - width * scale / 2;\n var vTop = this.scene.view.y + height * sca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name : checkCreateAccountSec Return type : validated Input Parameter(s) : elementId Purpose : To validate the form fields of biller and personal information section. History Header : Version Date Developer Name Added By : 1.0 26th July, 2013 Pradeep Yadav | function checkCreateAccountSec(elementId) {
var validated = true;
var emailRegEx = /^[a-zA-Z0-9][a-zA-Z0-9\_\.\+\-]*[a-zA-Z0-9]\@[a-zA-Z0-9][a-zA-Z0-9\.\-]*\.[a-zA-z]{2,6}/;
var passwordRegEx = /^(?=\S+$).{4,20}/;
var phoneRegEx = /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/;
var zipRegEx = /^\d{5}$/;
var $requiredF... | [
"function createBillerAndPersonalInfoSec(billerCredsElement) {\n var PHONE_BOX = \"PHONE_BOX\";\n var DATE_BOX = \"DATE_BOX\";\n var inputType = \"text\";\n var elementId = billerCredsElement.id;\n var elementType = billerCredsElement.elementType;\n var isPersonalInfoSec = false;\n if (elementI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return appropriate glyph for alert | getGlyph() {
return this.props.type !== "success" ? <Glyph className="tag" icon='alert'/> : <Glyph className="tag" icon='heart'/>;
} | [
"FindGlyph(c) {\r\n const glyph = this.native.FindGlyph(c);\r\n return glyph && new ImFontGlyph(glyph);\r\n }",
"function WH_RenderGlyph(glyph, option) {\n\tvar code, width, height, temp\n\tif(glyph === \"..\") {\n\t\twidth = WH_HEIGHT\n\t\treturn \"<table width='{width}px' border='0'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the closest heading to an element | static getClosestHeading($, headingsSelector, element) {
const prevElements = $(element).prevAll();
for (let i = 0; i < prevElements.length; i += 1) {
const currentElement = $(prevElements[i]);
if (currentElement.is(headingsSelector)) {
return currentElement;
}
const childHeading... | [
"_prevHeading() {\n const headings = this._allHeadings();\n // Use `findIndex` to find the index of the currently\n // selected element and subtracts one to get the index of the previous\n // element.\n let newIdx =\n headings.findIndex(headings =>\n headings === document.ac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generates refreshPage button after player wins | function genRefresh(){
var button = document.createElement('button');
button.setAttribute('onClick', 'refreshPage()')
button.setAttribute('type','button')
button.setAttribute('id','refresh')
button.appendChild(document.c... | [
"function checkForGameOver(){\r\n if(gameOver === true){\r\n location.reload();\r\n }\r\n }",
"function handleEndOfGameClick(){\n location.reload()\n\n }",
"function showWinnerPage(winner) {\n removeGamePage();\n createWinnerPage(winner);\n}",
"function handleRestartButton() {\n STORE.res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all the terms in this termset in an ordered tree using the appropriate sort ordering This is an expensive operation and you should strongly consider caching the results | async getAllChildrenAsOrderedTree(props = {}) {
const selects = ["*", "customSortOrder"];
if (props.retrieveProperties) {
selects.push("properties", "localProperties");
}
const setInfo = await this.select(...selects)();
const tree = [];
const childIds = [];
... | [
"inOrder() {\r\n\r\n let resultsArr = [];\r\n\r\n let _walk = node => {\r\n if (node.left) _walk(node.left);\r\n resultsArr.push(node.value);\r\n if (node.right) _walk(node.right);\r\n }\r\n\r\n _walk(this.root);\r\n\r\n return resultsArr\r\n}",
"get sets() {\n return TermSets(this);\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new tenant script. | function createTenantScript(axios$$1, identifier, tenantToken, request) {
return restAuthPost(axios$$1, 'instance/microservice/' + identifier + '/tenants/' + tenantToken + '/scripting/scripts', request);
} | [
"static createTenant() {\n return HttpClient.post(`${TENANT_MANAGER_ENDPOINT}tenant`);\n }",
"function createTenant(axios$$1, payload) {\n return restAuthPost(axios$$1, '/tenants', payload);\n }",
"function activateTenantScript(axios$$1, identifier, tenantToken, scriptId, versionId) {\n return restAu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Code Example 8.13 Add a viewer to a folder. Replace ID with one from a folder URL and the email address in the "addViewer() method call. | function shareFolder() {
var folderId = 'ID From Url',
folder = DriveApp.getFolderById(folderId);
folder.addViewer('emailAddress');
} | [
"async addFolder(folder) {\n await this.client('folders')\n .insert(folder)\n .onConflict('href')\n .merge();\n }",
"editVirtualFolder(aFolder) {\n let folder = aFolder || GetSelectedMsgFolders()[0];\n\n function editVirtualCallback(aURI) {\n // we need to rel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will synthesize a trace that's over 256 MB. To do that, we'll take an existing trace and repeat the same events again and again until we've gone over 256 MB. Note: We repeat all but the last event, as it's the CpuProfile event, and it triggers specific handling in the devtools streaming parser. Once we re... | function buildAndParse256mbTrace() {
const stripOuterBrackets = str => str.replace(/^\[/, '').replace(/\]$/, '');
const partialEventsStr = events => stripOuterBrackets(JSON.stringify(events));
const traceEventsStr = partialEventsStr(events.slice(0, events.length-2)) + ',';
// read the trace int... | [
"function cleanTrace(trace) {\n const traceEvents = trace.traceEvents;\n // Keep track of most occuring threads\n const threads = [];\n const countsByThread = {};\n const traceStartEvents = [];\n const makeMockEvent = (evt, ts) => {\n return {\n pid: evt.pid,\n tid: evt.tid,\n ts: ts || 0, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assign event handlers to topic links. | function linkTopic(a) {
a .on("click", click)
.on("mouseover", mouseover)
.on("mouseout", mouseout);
} | [
"function setUpListeners() {\n var i = 0;\n for(i = 0; i < linkIds.length; i++) {\n var anchor = document.getElementById(linkIds[i]);\n $('#'+linkIds[i]).click(function() {\n annotationOnClick(this.id);\n });\n }\n}",
"function setupLinks() {\n $('#channels a').click(function(event){\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle csv export of data. | function handleExportCSV() {
analyticsService.logEvent('EE Employment Training', 'Clicked', `Export_CSV`)
GridHelpers.exportDataAsCSV({
selectedRows: selectAllChecked ? null : selectedRows,
rowData: employee_training_report_items,
sortColumn,
sortDirection,
searchTerm,
filter... | [
"function exportCSV() {\n\n if (queryData != null && queryData != \"\") {\n console.log(queryData);\n } else {\n // let user know there is an error\n dialogSpawn(\"Error\",\"Please query data before exporting to a CSV file.\",\"notif\",\"errTitle\",\"filterText\");\n return;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Animate all steps of the NelderMead algorithm | function animateNelderMead(){
// Disable clicking/hovering events
disableUser();
// Create initial simplex by expanding mouse position into a right triangle
var mouseX = currScale.x.invert(d3.mouse(this)[0]);
var mouseY = currScale.y.invert(d3.mouse(this)[1]);
var stepSize = 1;
var initial... | [
"animate () {\n if (this.multiStep) this.animateSteps()\n this.animateDraws()\n }",
"function animate() {\r\n if (frame < 25) {\r\n requestAnimationFrame(animate);\r\n }\r\n\r\n nodes.forEach(function (n) {\r\n n.x = n.x + n.dx / 25;\r\n n.px = n.x;\r\n n.y = n.y + n.dy / 25;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Value that includes raw user input | get rawInputValue() {
return this.extractInput(0, this.value.length, {
raw: true
});
} | [
"function inputvalue(){\n return input.value\n}",
"getRawValue() {\n return this.value;\n }",
"getDisplayValue() {}",
"function userInput() {\n return document.getElementById('delayInMinutes').value;\n }",
"set CustomProvidedInput(value) {}",
"function spinputvalue () {\n if (!isContent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detect the Flash Player version for nonInternet Explorer browsers Detecting the plugin version via the object element is more precise than using the plugins collection item's description: a. Both release and build numbers can be detected b. Avoid wrong descriptions by corrupt installers provided by Adobe c. Avoid wrong... | function testPlayerVersion() {
var b = doc.getElementsByTagName("body")[0];
var o = createElement(OBJECT);
o.setAttribute("style", "visibility: hidden;");
o.setAttribute("type", FLASH_MIME_TYPE);
var t = b.appendChild(o);
if (t) {
var counter = 0;
... | [
"function detectWMP()\r\n{\r\n\tvar wmpInfo = {\r\n\t\tinstalled: false,\r\n\t\tscriptable: false,\r\n\t\ttype: null,\r\n\t\tversionInfo: null\r\n\t};\r\n\tvar wmp64 = \"MediaPlayer.MediaPlayer.1\";\r\n\tvar wmp7 = \"WMPlayer.OCX.7\";\r\n\tif((window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1) ||... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region Verify SMIME signature | function verifySMIME()
{
//region Parse MIME contents to find signature and detached data
const parser = new MimeParser();
parser.write(document.getElementById("smime_message").value);
parser.end();
//endregion
if(("_childNodes" in parser.node) || (parser.node._childNodes.length !== 2))
{
const las... | [
"function processAgentSignature(msg) {\n if (isIgnoreHashCheck() == false) {\n var verified = false;\n\n // This agent did not report a valid TLS certificate hash, fail now.\n if (obj.agentSeenCerthash == null) return false;\n\n // Raw RSA signatures have an exact ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads options from local storage or uses default options if no options are stored. | loadOptions() {
browser.storage.local.get("options").then(res => {
if (Object.getOwnPropertyNames(res).length != 0) {
this.options = res.options;
} else {
this.options = DEFAULT_OPTIONS;
}
});
} | [
"function loadOptions() {\n\t\t\tvar userOptions = {};\n\n\t\t\tif (supported('localStorage')) {\n\t\t\t\tuserOptions = JSON.parse(localStorage.getItem('ADI.options')) || {};\n\t\t\t}\n\n\t\t\t// merge with defaults\n\t\t\tfor (var opt in userOptions) {\n\t\t\t\toptions[opt] = userOptions[opt];\n\t\t\t}\n\t\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays proper state / province dropdown on purchase page. | function displayStateSelect() {
//jQuery('#country').each(function() {
//var si = jQuery("#country option:selected").val();
var si = jQuery("#country").val();
if (si == 'United States' || si == '') {
jQuery('#usstate_div').show();
jQuery('#caprovince_div').hide();
jQuery('#usstat... | [
"renderStateSelection() {\n const state = this.props.state || \"CA\";\n const allUSStateAbbreviations = WeatherReportUtil.getStateAbbreviations();\n const createUSStateOptions = (state) => {\n return <option key={state.toLowerCase()} value={state.toLowerCase()}>{state}</option>;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Gets the details of a registered vCenter server(Add vCenter server). | async function getsTheDetailsOfAVCenter() {
const subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574";
const resourceName = "MadhaviVault";
const resourceGroupName = "MadhaviVRG";
const fabricName = "MadhaviFabric";
const vcenterName = "esx-78";
const credential = new DefaultAzureCredential();
const c... | [
"function getVCenterServerAddress(inputID) {\n\tvar preFix = \"https://\";\n\tvar sufix=\"/sdk\";\n\tvar port = \"443\";\n\tvar server = $('#'+inputID).val();\n\tif (server.indexOf(\":\") > 0) {\n\t\treturn preFix+server+sufix;\n\t}else {\n\t\treturn preFix+server+\":\"+port+sufix;\n\t}\n}",
"function generateCli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
First argument is a sequence of values, second is multiplier. The function should filter all nonnumeric values and multiply the rest by given multiplier. | function multiplyAndFilter(array, multiplier){
return array.filter(value => typeof value === 'number').map(value => (value * multiplier))
} | [
"function MULTIPLY() {\n for (var _len10 = arguments.length, values = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {\n values[_key10] = arguments[_key10];\n }\n\n // Return `#NA!` if 2 arguments are not provided.\n if (values.length !== 2) {\n return error$2.na;\n }\n\n // decompose values into... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a find block that is big enough for a task | function findFreeBlockForTask(task, freeBlocks) {
var i;
for (i = 0; i < freeBlocks.length; i++) {
if (typeof freeBlocks[i] === 'undefined') {
continue;
} else if (freeBlocks[i].length() >= task.length)
return freeBlocks[i];
}
return undefined;
} | [
"async waitForBlock(goal) {\n let height = await this.height();\n while (height < goal) {\n await sleep(1000);\n height = await this.height();\n }\n return height;\n }",
"function findGeneral(port, cb) {\n check(port)\n .then(function (res) {\n if (res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a class to the given element. Parameters: elem The element to add the class to. className The String containing the class to add to the given element. | function addClass(elem, className)
{
if (elem.getAttribute("class") == null)
{
elem.setAttribute("class", "");
}
// Add only if not already in class attribute
if (elem.getAttribute("class").search(className) == -1)
{
// If not empty, then append a space to separate the next class name f... | [
"function changeClass(elementId, className){\r\n // Get a reference to the element\r\n element = document.getElementById(elementId);\r\n // Make sure the element was on the page\r\n if (element) {\r\n\t\t\t// Update the element's className property\r\n\t\t\telement.className = className;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Emit events from `DispatchingProfiler` as `browser_info` karma events. | function handleReactProfilerResults(event) {
// Only own properties are persisteded when sending the object.
const info = { type: event.type, detail: event.detail };
// eslint-disable-next-line no-underscore-dangle -- public: http://karma-runner.github.io/5.2/dev/plugins.html
window.__karma__.info(info);
} | [
"captureInstrumentation() {\n setInterval(() => {\n this.instrumentation.pushMetrics();\n setMetrics();\n }, config.instrumentationTimer);\n }",
"function JsonDomReporter() {\n var events = [];\n\n this.jasmineStarted = function(info) {\n events.push(['jasmineStarted', info]);\n };\n\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function creates the admin role and inserts the admin user | function createAdmin(callback) {
AccessToken.destroyAll( function(err) {
if (err) return callback(err);
RoleMapping.destroyAll( function(err) {
if (err) return callback(err);
Roles.destroyAll( function(err) {
if (err) return cal... | [
"async function okCreateLogin() {\n if (userRole === \"Admin\"){\n let loginName = userNameInput.value + \"\";\n let loginPassword = passwordInput.value + \"\";\n let loginRole = loginRoleSelect.value + \"\";\n let response = await adminPOST({loginName, loginPassword, loginRole}, \"ap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
address functions / compresses all non white space elemnets of an array into a new array | function compressAddressParts(arrayIn) {
var arrOut = [];
for (var i = 0; i < arrayIn.length; i++) {
if (arrayIn[i].search(/\S/) != "-1") { arrOut.push(arrayIn[i]); }
}//for
return arrOut;
} | [
"function trimArray(arr) {\n for(i=0;i<arr.length;i++)\n {\n arr[i] = arr[i].replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n return arr;\n}",
"function convert4x4(array) {\n currentIndex = 0;\n var newArray = [[null,null,null,null],[null,null,null,null],[null,null,null,null],[null,null... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserwindowing_elements. | visitWindowing_elements(ctx) {
return this.visitChildren(ctx);
} | [
"visitWindowing_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitWindowing_type(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokens... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get mnemonic.txt file and return | function mnemonic() {
try {
return fs.readFileSync("./mnemonic.txt").toString().trim();
} catch (e) {
if (defaultNetwork !== "localhost") {
console.log(
"☢️ WARNING: No mnemonic file created for a deploy account. Try `yarn run generate` and then `yarn run account`."
);
}
}
return... | [
"function readRomanTxtFile() {\r\n var request = require('request');\r\n var url = \"https://projecteuler.net/project/resources/p089_roman.txt\";\r\n return new Promise(function (resolve, reject) {\r\n request.get(url, function (error, response, body) {\r\n if (response.statusCode === 200) {\r\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts that the work's only hypothesis is an instance of the given fact. Returns a "grounded" theorem, i.e. one with no hypothesis, representing a completed proof. | function ground(work, dirtFact) {
// verify that the hyp is an instance of the dirt
var varMap = getMandHyps(work, [], dirtFact, []);
if (DEBUG) {console.log("# ground MandHyps: "+JSON.stringify(varMap));}
work.Core[Fact.CORE_HYPS].shift();
var newSteps = [];
eachVarOnce(... | [
"confirmAssertion () {\n this._asserted = true;\n }",
"function forEachGroundableFact(work, cb) {\n allKnownFacts.forEach(function(f) {\n if (f.Core[Fact.CORE_HYPS].length == 0) {\n try {\n if (work.Core[Fact.CORE_HYPS][0] !== 1) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reposition the handle if the Yvalue changed. | _valueYChanged(value) {
if (this.enableY) {
this._handle.style.top = (this._canvas.scrollHeight)
* ((value - this.minY) / (this.maxY - this.minY)) + 'px';
}
} | [
"_updateYPosition() {\n this._updateSize();\n }",
"_decreaseY() {\n if (!this._invertedY()) {\n this.valueY = Math.max(this.minY, this.valueY - this.stepY);\n } else {\n this.valueY = Math.max(this.maxY, this.valueY - this.stepY);\n }\n }",
"_increaseY() {\n if (!this._invertedY... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an array of info for every movie | function buildMovieList(){
for(let i=0; i < titles.length; i++){
var mov = {
'title':titles[i],
'src':images[i],
'synopsis':synopsis[i],
'directors':directors[i],
'actors':actors[i],
'year':year[i]
};
//add to each set of info to all... | [
"function getAllMovieInfo(list){\n\tfor(var i=0;i<list.length;i++){\n\t\tgetMovieInfo(list[i]).then( function(response){\n// \t\t\tconsole.log(': '+ JSON.stringify(response.results[0])+'\\n\\n');\n\t\t\tconsole.log('['+ response.results[0].original_title+']');\n\t\t\tconsole.log(response.results[0].overview+'\\n');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
route_selection_expression computed: true, optional: false, required: false | get routeSelectionExpression() {
return this.getStringAttribute('route_selection_expression');
} | [
"function massAssignRoute() {\n angular.forEach($scope.shared.selections, function(student) {\n var route = parseInt($scope.bulkAssignmentRoute); // Get the value of the route as na Int.\n student.bus_route = route; // Set the route value of the student.\n StudentsModel.updateStudent(stude... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mirrors the first n characters and appends them at the end of text. Returns the text together with the mirrored characters. | function mirrorFirstCharacters(text, n) {
let result = text;
for (let k = n - 1; k >= 0; k--) {
result += text[k];
}
return result;
} | [
"function modifyLast(str, n) {\n\treturn str.slice(0, -1) + str.slice(-1).repeat(n);\n}",
"function clip(text, n)\n{\n if(text.length > n)\n {\n return text.slice(0,n-4) + \"...\";\n }\n return text\n}",
"function padRight(s, c, n) {\n if (!s || !c || s.length >= n) {\n return s;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return items that are unsaved | getItemsUnsaved(){ return this.state.list.filter(function(el){ return el.saved == false})} | [
"uncommittedItems(){\n return this.items({isCommitted: false})\n }",
"committedItems(){\n return this.items({isCommitted: true})\n }",
"undeleted(state) {\n return state.list.filter(item => \n item.change_type !== ChangeTypeConstants.ChangeTypeDeleted);\n }",
"function checkUnsave... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the background according to the weather condition | function setBackground(weatherCondition){
var background = document.getElementById("usersLocation");
if( weatherCondition == "drizzle"){
background.style.backgroundImage = "url(" + backgrounds.drizzle + ")";
}
else if(weatherCondition == "rain"){
background.style.backgroundImage = "url("... | [
"function changeBackgroundImage() {\n if(backgroundPicture.hasOwnProperty(currentConditionIcon)) {\n var imageURL = \"./images/\" + backgroundPicture[currentConditionIcon];\n $(\".weather-background\").css({\n 'background-image': 'url('+ imageURL +')'\n });\n }\n}",
"function updateBackground() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Syncronous function for drawing and querying the line chart | function syncLineChart(callback){
lineChartQuery(lineChartParams,callback);
} | [
"function updateLine() {\n if (globalAvgLine && selectedCountryLine) {\n const monthSelector = document.getElementById(\"lineChartMonthSelect\");\n const month = monthSelector.options[monthSelector.selectedIndex].value;\n const monthAsNumber = moment().month(month).format(\"MM\");\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para subir una imagen con Ajax, se ocupa el nombre del formulario, y el nombre del input | function subirImagen(form_, name) // Funcion para subir al servidor la imagen seleccionada
{
console.log("form_: " + form_ + "\nname:" + name);
var form = document.forms.namedItem(form_);
var logodependencia = document.getElementsByName(name).value;
var
//oOutput = document.getElementById... | [
"function getFormImg(id, append, page){\n\n // Form data JS Object\n var myFormData = new FormData();\n myFormData.append( '_token', $('meta[name=\"csrf-token\"]').attr('content'));\n myFormData.append('page', page);\n\n $.ajax({\n\n url: '/form/' + id,\n type: \"POST\",\n contentType:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends and generate pages | function appendPages(pages) {
var menuTemplate = "";
for (let page of pages) {
addMenuItem(page);
addPage(page);
}
setDefaultPage(pages[0].slug); // selecting the first page in the array of pages
getPersons();
getTeachers();
} | [
"function appendPages(pages) {\n var menuTemplate = \"\";\n for (let page of pages) {\n addMenuItem(page);\n addPage(page);\n }\n setDefaultPage(pages[0].slug); // selecting the first page in the array of\n getBoeger();\n getKrystaller();\n getMaetter();\n setTimeout(function() {\n showLoader(false... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function to close all parents that might still be open. Used when a cell of data is empty but further cells on the row are not. | function closeLooseParents(range, topRow, column, row, parentRow, cell)
{
//If this cell is empty, and the cell to the right isn't empty
if (!(hasData(range[row][column])) && (hasData(range[row][column+1])))
{
//Time to close up this cell's parents.
return cell += closeParents(range, topRow, column, parentR... | [
"function closeParents(range, topRow, column, parentRow, cell, forceClose)\n{\n //Grab the parent we're currently examining\n var parent = range[parentRow][column];\n\n //First, if the parent we're examining isn't empty...\n if (hasData(parent))\n {\n //And you're 'force closing' the parent\n if (forceCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the grandparent of the delete button which is the entire row of the table (tr > td > a) | function deleteRow(button){
button.parent().parent().remove();
} | [
"deleteRow() {\n let table = this.getParent();\n if (table !== null) {\n let rowIndex = table.getContentRowIndex(this);\n let contentRows = __WEBPACK_IMPORTED_MODULE_7__utils__[\"a\" /* convertInputToNumber */](table.getValue('contentRows'));\n if (rowIndex !== -1 && c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a location, extract the text from the full source | function extractSource(location, lines) {
var start = location.startBody,
end = location.endBody;
if (start.line === end.line && lines[start.line - 1] !== undefined) {
return lines[start.line - 1].substring(start.col, end.col);
} // NOTE: storysource locations are 1-based not 0-based!
var startLine... | [
"async function getTextFromSource(){\n let text;\n if (process.argv[2] === 'file') {\n let filePath = process.argv[3];\n text = await cat(filePath);\n }\n else if (process.argv[2] === 'url') {\n let url = process.argv[3];\n text = await webCat(url);\n }\n else {\n console.error(`Bad input. Plea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the originalDoc matches expectations, if its hash matches what was specified previously, and if the blinded document matches the hash and blinding factor. | verifyContents(blindHash, blindingFactor, originalDoc) {
if (!originalDoc.match(/^The bearer of this signed document, .*, has full diplomatic immunity.$/)) {
return false;
}
let h = blindSignatures.messageToHash(originalDoc);
if (!this.consistent(blindHash, blindingFactor, h)) {
return false... | [
"consistent(blindHash, factor, hash) {\n let n = this.key.keyPair.n;\n let e = new BigInteger(this.key.keyPair.e.toString());\n blindHash = blindHash.toString();\n let bigHash = new BigInteger(hash, 16);\n let b = bigHash.multiply(factor.modPow(e, n)).mod(n).toString();\n let result = blindHash ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
callculating price by selected equipment, phone storage and rate | priceCalc(){
var that = this;
var equipmetCost = 0;
var tempPrice = this.phoneStorage.filter(function(el){
if(el.storage == that.selectedStorage ){
return el;
}
});
this.selectedEquipment.forEach(function(el)... | [
"function getpsPrice(product) {\n\n let $prod = $(product);\n let qty = $prod.find(\"option:selected\").data(\"qty\");\n let pprice_to = Number($prod.find(\"option:selected\").data(\"pprice\"));\n let pprice = pprice_to.toFixed(2);\n\n let sprice_to = Number($prod.find(\"option:selected\").data(\"spr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scales the image by (float) scale < 1 returns a canvas containing the scaled image. | function downScaleImage(img, scale) {
var imgCV = document.createElement('canvas');
imgCV.width = img.width;
imgCV.height = img.height;
var imgCtx = imgCV.getContext('2d');
imgCtx.drawImage(img, 0, 0);
return downScaleCanvas(imgCV, scale);
} | [
"function downScaleImage(img, scale) {\n var imgCV = document.createElement('canvas');\n imgCV.width = img.width;\n imgCV.height = img.height;\n var imgCtx = imgCV.getContext('2d');\n imgCtx.drawImage(img, 0, 0);\n return downScaleCanvas(imgCV, scale);\n }",
"scale(sca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set fusion ID (when creating or removing fusions) | async setFusionId(playerId, fusionId) {
await sql.run(`UPDATE Players SET Fusion_ID = $fusionId WHERE ID = $playerId`, {$playerId: playerId, $fusionId: fusionId});
} | [
"setTrackingID() {\n dataLayer.push({ ga_tracking_id: window.fatherlyDataLayer.ga_tracking_id });\n ga('create', window.fatherlyDataLayer.ga_tracking_id, 'auto');\n }",
"function _generateFluxId() {\n return next_flux_id++;\n}",
"preSaveSetId() {\n if (isNone(this.get('id'))) {\n this.set('id', ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Then I need to setup the timeblocks/colors for current time, possibly using moment aswell. if else statements possibly that use the current hour vs the time stated in the block and if it is past that time to give it a class or remove a class that colors the field. | function colorBlocks() {
//console.log(now)
if (now > 9) {
$("#9am").addClass("past");
} else if (now >= 9 && now < 10) {
$("#9am").addClass("present");
} else if (now < 9) {
$("#9am").addClass("future");
}
if (now > 10) {
$("#10am"... | [
"function colorizor() {\n var timeOfDay = moment().hour();\n var timeSlots = [9, 10, 11, 12, 13, 14, 15, 16, 17];\n\n $.each(timeSlots, function (index, slot) {\n\n var hrNum = slot < 13 ? slot : slot - 12;\n\n if ((timeOfDay > slot)) {\n $('#hour-' + hrNum)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides Year title displays. | function hideYears() {
svg.selectAll('.year').remove();
} | [
"function hideYearControl(selectedSort, controlsNode) {\n\tvar hideNoYearLabel = controlsNode.children[3];\n\tif (selectedSort == \"year\") {\n\t\thideNoYearLabel.style.display = \"inline-block\";\n\t} else {\n\t\thideNoYearLabel.style.display = \"none\";\n\t}\n}",
"function hideNoYear() {\n\tvar controlsNode = t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
+initialize support: called to run the onetime initialization of a class and its superclass. Can also be used as a wrapper to ensure initialization on property access/method calls when forwarding is not needed or desired. Keeps track of what is initialized by adding classes as properties to function object. | function objj_initialize(aClass) {
// need to initialize top-down
let chain = [];
for (let targetClass = aClass; targetClass !== Object.getPrototypeOf(_CPObject2.default); targetClass = Object.getPrototypeOf(targetClass)) {
if (!targetClass.initialized) chain.unshift(targetClass);
}
for (let i = 0; i < chain.le... | [
"setupInitialization () {\n const finishInitialization = (result) => {\n this.isInitialized = result\n\n // We only want to resolve / reject the init promise once during the initialization flow. Because some trackers\n // do not support reporting \"failures\" we need to support timeouts that can ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure the lemma is saved as 'revised by' this user Is necessary in case nothing was altered | function reviseLemma(iLemmaId) {
sRevDate = 'now';
ajaxCall_reviseLemma("./php/reviseLemma.php?iLemmaId=" + iLemmaId +
"&sDatabase=" + sDatabase + "&iUserId=" + iUserId +
uniqueString());
} | [
"editMentor() {}",
"function updateRoles(user, level) {\n if (role_rewards.length <= 0) return;\n\n const roleID = getLevelRole(level);\n if (roleID && !user.roles.cache.has(roleID)) {\n // Remove old roles (could be optional)\n for (const reward of role_rewards) {\n if (user.rol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Same recursive concept of scaleTextSize() The 'fins' of the arrow have to be within the particular text line | function scaleArrowSize(as)
{
if (2*as/10 > tSize)
{
return scaleArrowSize(as-1);
}
else
{
return as;
}
} | [
"function scaleTextSize(ts)\n{\n // The textSize is dynamically computed based on the number of items ;)\n // Make the text the biggest possible but make sure everything fits inside the canvas\n textSize(ts);\n\n // Horizontally we have to leave minimum 25% of the space for the arrow\n if (tListStart[1] + item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of values accessible in this run, given the selected data samples interval. When the datalogger is actively recording and the specified run is the current run, calling this method reloads last sequence(s) from device to make sure it includes the latest recorded data. | function YDataRun_get_valueCount()
{
if(this._isLive) this.refresh();
return Math.ceil(this._duration / this._browseInterval);
} | [
"function refreshNextRunsData() {\n\t\t// Checks if the run data array is actually imported yet by checking if it's an array.\n\t\tif ($.isArray(runDataArray.value) && !refreshingNextRunsData) {\n\t\t\trefreshingNextRunsData = true;\n\t\t\tnextRuns = getNextRuns(runDataActiveRun.value, 4);\n\t\t\trefreshingNextRuns... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
equals extendBy(xy, theta, delta) | function extendBy(xy, theta, delta) {
var xDelta = Math.cos(theta) * delta,
yDelta = Math.sin(theta) * delta;
return init(xy.x - xDelta, xy.y - yDelta);
} | [
"_extendIndices(geo, info) {\n const { index } = geo;\n const indicesPerQuad = 6; // quad = 2 triangles => 6 indices\n const startToShift = info.addPerCylinder * indicesPerQuad;\n const shift = info.addPerCylinder;\n let shifted = index.array.slice(startToShift, index.count);\n shifted = shifted.m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserindex_partitioning_clause. | visitIndex_partitioning_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitSplit_index_partition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitAlter_index_partitioning(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitQuery_partition_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDrop_index_partition(ctx) {\n\t return this.visitChildren(ctx)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
triggers while clicking on accordian or layer checkbox | function accordionClick(thisObj, currentChkBoxObj) {
var _tempIndex = $('.siteaccordion').index(thisObj);
var isChecked = currentChkBoxObj.is(":checked");
if (isChecked) {
$(thisObj).removeClass('closereg').addClass('openreg');
$('.mfbox').eq(_tempIndex).slideDown(300,function() {});
} else {
$(thisObj)... | [
"_onClick() {\n this.expanded = !this.expanded;\n\n // Dispatch an event that signals a request to expand to the\n // `<howto-accordion>` element.\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {isExpandedNow: this.expanded},\n bubbles: true,\n })\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes gruntbrowserify aliasMappings config and converts it into an alias array | function aliasMappingsToAliasArray(aliasMappings)
{
var aliasArray = [],
aliases = util.isArray(aliasMappings) ? aliasMappings : [aliasMappings];
aliases.forEach(function (alias) {
grunt.file.expandMapping(alias.src, alias.dest, {cwd: alias.cwd}).forEach(function(file) {
var expose = file.dest.sub... | [
"function expandAliases(unit) {\n\t\tfor (var key in unit) {\n\t\t\tvar alias = unit[key].alias, i = alias.length;\n\t\t\twhile (i--) {\n\t\t\t\tunit[alias[i]] = unit[key];\n\t\t\t}\n\t\t}\n\t}",
"getResolve() {\n return {\n extensions: ['.js', '.jsx', '.ts', '.tsx'],\n alias: this.config.alias !== u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set marker based on speed and heading | function setMarkerSpeedAndHeading(marker, speed, heading) {
var icon = marker.getIcon();
if (speed > 0) {
icon.fillColor = "green";
} else {
setMarkerStopped(marker);
}
icon.rotation = parseInt(heading);
marker.setIcon(icon);
} | [
"function renderHeightMarker() {\n var hrfy = canvas.height - yValFromPct( highestRedFlowerPct ); // highest red flower y value currently\n var chmp = 100-pctFromYVal(HeightMarker.y); // current height marker percentage\n if ( Math.floor( highestRedFlowerPct ) > Math.floor(chmp) ) { // initializes animations... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sorts the cleaned grams | function sortGrams(grams) {
grams.sort(function(a, b){
return b.likes - a.likes;
})
return grams;
} | [
"function sortGroceries() {\n let categories = Array.from(new Set(groceryList.map((grocery) => grocery.category))).sort();\n let tempgroceryList = [];\n categories.forEach((category) => {\n let currentCategoryItems = groceryList.filter((grocery) => grocery.category == category);\n currentCate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calling this mutation will trigger redrawing of any components that monitor the value of 'refreshCounter'. | refreshMutation (state, { }) {
console.log('In Mutation refreshMutation()', state.refreshCounter)
state.refreshCounter++
} | [
"_refresh(){\n this._refreshSize();\n this._refreshPosition();\n }",
"function refreshGraph() {\n data = [\n trace0,\n trace1,\n upperBound,\n lowerBound,\n leftBound,\n rightBound\n ];\n\n Plotly.react(graph, data, layout);\n}",
"refreshColorB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filters dislpayed cultures by choosen event index | function filterCultures(choosenEventIndex) {
resetAllEvents();
events[choosenEventIndex].choosen = true;
events[choosenEventIndex].button.gotoAndStop(2);
for (var i=0; i<cultures.length; i++) {
if ( hasEvent(cultures[i].events, events[choosenEventIndex].name)) {
markCulture(i);
... | [
"function stopHoverCulture(index){\n\t\t\tif ( cultures[index].filter != \"faded\") { \t\t// if unfiltered do nothing\n\t\t\t\tif ( cultures[index].filter == \"none\") { \t\t// there is no filter\n\t\t\t\t\t// update all cultures and events display\n\t\t\t\t\tresetAllEvents();\n\t\t\t\t\tresetAllCultures();\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |