query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
start/stop map shader drawing | drawStart()
{
let n;
let light,viewLight;
let gl=this.core.gl;
gl.useProgram(this.program);
// matrix
// normal is set on a per mesh level as some have
// model matrixes which need to be calculated in
gl.uniformMatrix4fv(this.perspective... | [
"start()\n {\n // set the shader..\n }",
"drawStart()\n {\n let core=this.core;\n let gl=this.core.gl;\n\n gl.useProgram(this.program);\n\n // matrix\n\n gl.uniformMatrix4fv(this.perspectiveMatrixUniform,false,core.perspectiveMatrix.data);\n gl.uniform... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bundle all first and last name fields into comma seperated string | function BundleNames() {
var list = $(".guest-list");
if (list.length <= 0) {return false;}
var guests = "";
var names = $(".guest-list .name");
for (var i = 0; i < names.length; i++) {
var first = $(names[i]).find(".first").val();
var last = $(names[i]).... | [
"function firstName(obj) {\n var t = \"\"\n for (let i = 0; i < obj.length; i++) {\n t += (obj[i].name.first) + \", \"\n\n }\n t = t.slice(0, -2)\n return t\n}",
"function joinFields(fields) {\n var new_fields = [];\n for(var prop in fields) {\n\t new_fields.push(prop + fields[prop]);\n }\n var fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the labels from inputfields | function getLabels() {
const allTextInputs = document.querySelectorAll('#addedLabel')
let labels = []
allTextInputs.forEach(function (el) {
if (!!el.value) {
labels.push({
id: el.value.toLowerCase(),
displayName: el.value
})
}
})
... | [
"function _labelFromInput() {\n return {\n \"category\": htElement.welInputLabel.data('category'),\n \"name\": htElement.welInputLabel.val()\n };\n }",
"function convert_field_labels_to_placeholders() {\n // if form exists\n if ($('form')[0]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For the specific pair screen named 'currentScreenKey' and the action 'actionName', return the list of custom navigation conditionnames and their destination screens. | function getCustomNavigations( currentScreenKey, actionName ) {
var customNavigations = new Array();
return customNavigations;
} | [
"getLocalActionList() {\n\t\tlet res = {};\n\t\tthis.actions.forEach((entry, key) => {\n\t\t\tlet item = entry.getLocalItem();\n\t\t\tif (item && !/^\\$node/.test(key)) // Skip internal actions\n\t\t\t\tres[key] = omit(item.data, [\"handler\", \"service\"]);\n\t\t});\n\t\treturn res;\n\t}",
"function getVisibleAc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keeps the cowboy in the game's bounds | keepInBounds() {
let x = this.sprite.position.x;
let y = this.sprite.position.y;
let spriteHalfWidth = this.sprite.width / 2;
let spriteHalfHeight = this.sprite.height / 2;
let stageWidth = app.renderer.width;
let stageHeight = app.renderer.height;
if (x - sprite... | [
"function keepInBounds() {\n\tvar collision = false;\n\t\n\tif(character.x < 16) {\n\t\tcharacter.x = 16;\n\t\tcharacter.boundingSprite.x = 8;\n\t\tslide.play();\n\t}\n\tif(character.x > 944) {\n\t\tcharacter.x = 944;\n\t\tcharacter.boundingSprite.x = 936;\n\t\tslide.play();\n\t}\n\tif(character.y < 16) {\n\t\tchar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the throughcar equivalents for each approach based on ZonePCEs and Direction variables (ie. lanesharing, number of lanes, etc.) | calculateTCUs (initial_directions, initial_PCEs) {
// Ensure that the TCU volumes are up to date. Here we are assuming the user movement volumes have already been converted to their PCE.
if (initial_directions == -1) {
var direction_array = PROJECT.getIntersectionByID(this._intersection_ID).g... | [
"function computeLAN(moonPos) {\n \n //intermediate variables\n\n var moonPosUnit = unitVector(moonPos);\n var w = [-1, -1, -1]; //x,y,z\n var w2 = [-1, -1, -1]; //the negative of the quadratic formula\n var rightAscencion = -1; //intermediate in finding time\n var rightAscencion2 = -1; //negat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor Initializes a new instance of the `PdfRadialGradientBrush` class. | function PdfRadialGradientBrush(centerStart,radiusStart,centerEnd,radiusEnd,colorStart,colorEnd){var _this=_super.call(this,new PdfDictionary())||this;/**
* Local varaible to store the dictionary properties.
*/_this.mDictionaryProperties=new DictionaryProperties();_this.initialize(colorStart,colorEnd)... | [
"function PdfRadialGradientBrush(centerStart, radiusStart, centerEnd, radiusEnd, colorStart, colorEnd) {\n var _this = _super.call(this, new PdfDictionary()) || this;\n /**\n * Local varaible to store the dictionary properties.\n */\n _this.mDictionaryProperties = new Dictionary... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A board view that shows all the stages and tasks included in the process with the given id | function ProcessBoard(props) {
const [activeStageIds, setActiveStageIds] = useState({})
const [isProfileOpen, setIsProfileOpen] = useState(false)
const history = useHistory()
const { processId, taskId } = useParams()
const { data, subscribeToMore, loading } = useQuery(PROCESS_QUERY, {
variables: { id: pro... | [
"static loadView(stage) {\n TaskView.taskList.innerHTML = '';\n for (const key in Task.tasks) {\n const task = Task.tasks[key];\n if (task.stage === stage) {\n TaskView.createView(task);\n }\n }\n }",
"function getDBDetailEntries(id){\n lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split array into smaller arrays | function split(arr, size) {
var arrays = [];
while (arr.length > 0) {
arrays.push(arr.splice(0, size));
}
return arrays;
} | [
"function splitArray(array) {\n let i, j, temparray, chunk = 10;\n let newArray = [];\n for (i = 0, j = array.length; i < j; i += chunk) {\n temparray = array.slice(i, i + chunk);\n newArray.push(temparray);\n }\n return newArray;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of elements based on the value | function getArrayOfElements(value) {
if (isSingular(value)) {
// TODO: VirtualReference is not compatible to type Element
return [value];
}
if (value instanceof NodeList) {
return arrayFrom(value);
}
if (Array.isArray(value)) {
return value;
}
try {
return ar... | [
"function getArrayOfElements(value) {\n if (isElement$1(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function allows avatar makers to add new question and answer entry Also sorts the jsonData | function addNewEntry(questionType){
var goAhead = true;
if(questionType == "regular") {
var newQuestion = $('#new-question').val();
var newAnswer = $('#new-answer').val();
if(!newQuestion || !newAnswer){
alert("Please enter question and answer");
goAhead = false;
}
} else if (questionType=="filler") {
... | [
"extractJSON(contentJSON){\n for(let questionJSON of contentJSON.questions){\n let answersArray = []; \n let index = 0;\n if(quiz.pickedCategory == questionJSON.category){\n for(let x = 0; x < 4; x++ ){\n answersArray.push(questionJSON.answer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load csv records into variables for header and details 1.0.18 created to simplify | function loadCSV()
{
var invoiceLines='';
// load the CSV from the audit record
invoiceCSV = auditRec.getFieldValue('custrecord_payload');
invoiceCSV = UNencodeCSV(invoiceCSV);
// this code only deals with the invoice files
invoiceLines = invoiceCSV.split('\n');
//================================... | [
"function populate() {\n dataService.getCSV(vm.filename)\n .then(function(data) {\n vm.loading = false;\n vm.header = data.shift().header;\n vm.data = data;\n });\n }",
"csvDataReader() {\n // turn this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the tags (right menu) button is touched | function onTagsButtonTouched(e){
// Only if the tag count is above 0
if (media.tags.length) {
// Load the tags view
var view = Alloy.createController("media/hashtags", {
"tags": media.tags
}).getView();
addViewToSections(view);
} else {
animation.shake($.hashtagsButton);
}
} | [
"onTagClick(tag) {\n this.tagSelected.next(tag);\n }",
"function tagItem1(){\r\n var current = getCurrentEntry();\r\n var currentEntry = current.getElementsByTagName(\"entry-tagging-action-title\")[0];\r\n // var currentEntry = $(\"#current-entry .entry-actions\r\n // .entry-taggin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
yields a new matrix if defaultValue is a function then matrix[x][y] = defaultValue(x, y) else matrix[x][y] = defaultValue | function newMatrix(xLength, yLength, defaultValue) {
return newArray(xLength, function(x) {
return newArray(yLength, function(y) {
if (typeof defaultValue == "function") {
return defaultValue(x, y)
} else {
return defaultValue
}
})
})
} | [
"function matrix(rows, cols, defaultValue) {\n var arr = [];\n // Creates all lines:\n for (var i = 0; i < rows; i++) {\n // Creates an empty line\n arr.push([]);\n\n // Adds cols to the empty line:\n arr[i].push(new Array(cols));\n\n for (var j = 0; j < cols; j++) {\n // Initializes:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add to relative base by the value of param | adjustRelativeBase(param) {
const mode = this.getMode()
const offset = this.getValue(mode, param)
this.relativeBase += offset
} | [
"plus(n, base) {\n return new Fixed8(super.plus(n, base));\n }",
"addBase(amount)\n {\n this.ph = this.ph + amount;\n\n if(this.ph > PH_MAX)\n {\n this.ph = PH_MAX;\n }\n }",
"function increment(param){\n \n var progress = ractive.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When user has confirmed the resetting of beats | confirmationOnClick() {
this.props.resetBeats();
this.props.resetSelectedPairs();
this.setState({ clickedMenu: false, clickedReset: false })
} | [
"returnToConfirm(){\n this.isReconfirmed = true;\n this.confirm();\n }",
"confirmRequest() {\n this.confirmed = true\n }",
"mailConfirmed() {\n // Set Redux state for the data store\n this.messageService.clearXhrMessage();\n this.confirm();\n }",
"function no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add map markers for parameter list of stops with geolocation near the user | function mapStops(stopList) {
var infowindow = new google.maps.InfoWindow();
$.each(stopList, function(index, stop) {
var i;
/* place map markers for parameter stops - make them clickable to
obtain predicted arrival times for clicked stop */
text = stop.display_name + ', route: ... | [
"function addStopsMarkers(stops) {\r\n\tfor (stop of stops) {\r\n\t\t\r\n\t\t// convert coords returned by police.uk API into format required for google maps API\r\n\t\tvar stopLocation = {\r\n\t\t\tlat : Number(stop.location.latitude), \r\n\t\t\tlng: Number(stop.location.longitude)\r\n\t\t};\r\n\r\n\t\t// add info... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`shrink.tuple(shrs: (shrink a, shrink b...)): shrink (a, b...)` | function shrinkTuple(shrinks) {
assert(shrinks.length > 0, "shrinkTuple needs > 0 values");
var result = shrinkTupleImpl(shrinks, 0);
return utils.curried2(result, arguments);
} | [
"function shrinkPair(shrinkA, shrinkB) {\n var result = shrinkBless(function (pair) {\n assert(pair.length === 2, \"shrinkPair: pair should be an Array of length 2\");\n\n var a = pair[0];\n var b = pair[1];\n\n var shrinkedA = shrinkA(a);\n var shrinkedB = shrinkB(b);\n\n var pairA = shrinkedA.m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method Name: shadowExp Function : to show the shadow function for the widget | function shadowExp()
{
kony.print("\n**********in shadowExp*******\n");
frmShodowView.flxShadow.shadowDepth = 30;
frmShodowView.flxShadow.shadowType = constants.VIEW_BOUNDS_SHADOW;
} | [
"function backShadowExp()\n{\n kony.print(\"\\n**********in backShadowExp*******\\n\");\n frmHome.show();\n //\"shadowDepth\" : Represents the depth of the shadow in terms of dp.\n //As the shadow depth increases, widget appears to be elevated from the screen and the casted shadow becomes soft\n frmShodowView.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is an additional input handler only takes effect when the gameState is "showResult" when the current game is over. It listens for a space key to restart a new game. | function handleInput( keyPressed ) {
// if the user pressed the space bar
if ( keyPressed === "space" )
{
// if we're in the "showResult" game state
if ( global.gameState === "showResult" )
{
// reset the game and transition back to the running... | [
"function gameRestartHandler(e) {\n if (e.keyCode == keycode.ENTER) {\n toggleElementDisplay('gameover', false);\n toggleElementDisplay(toggledElementIds.menu, true);\n toggleElementDisplay(toggledElementIds.gameContent, false);\n restart();\n }\n }",
"function restart(){\n var s = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show or hide restaurant review form | function showReviewForm() {
$("#review-window").show();
$("#add-review-button").show();
} | [
"function showReviewForm(review) {\n\tdocument.getElementById(\"moreInfoReviewForm\").style.display = \"block\";\n\tdocument.getElementById(\"moreInfoReviewButton\").style.display = \"none\";\n\tdocument.getElementById(\"moreInfoReviewText\").style.display = \"none\";\n\tdocument.getElementById(\"reviewTextArea\").... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Object representing an AD element in a VAST template | function VastAd(node){
var me = this;
// required elements - section 2.2.4.1
this.id = node.getAttribute('id');
this.sequence = node.getAttribute('sequence');
this.impressions = [];
this.creatives = [];
this.creative_companions = [];
// optional elements - - section 2.2.4.2
this.description = NULL... | [
"function VMAPAdSource(xml) {\n\t var i = void 0;\n\t var len = void 0;\n\t var node = void 0;\n\t this.id = xml.getAttribute('id');\n\t this.allowMultipleAds = xml.getAttribute('allowMultipleAds');\n\t this.followRedirects = xml.getAttribute('followRedirects');\n\t this.vastAdData = null;\n\t this.adTagURI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add arrayOne data to hashMap Check if arrayTwo key is in hashMap Create a hashMap 'a' 'b' 'c' are the key true and false are value Check hashMap['x'] is true or false Check hashMap['u'] is true or false Check hashMap['c'] is true or false Time complexity is O(n) | function duplicateElement() {
const arrayOne = ['a', 'b', 'c'];
const arrayTwo = ['x', 'y', 'z'];
var hashMap = {};
var isDuplicate = false;
for (let arrayOneIndex = 0; arrayOneIndex < arrayOne.length; arrayOneIndex++) {
// Check key in hashMap
if (!(arrayOne[arrayOneIndex] in hashMa... | [
"function leetJoin(hashFirst, hashSecond) {\nlet firstArray=hashFirst.keysValues()\nlet secondArray=hashSecond.keysValues()\nlet result=[]\nfor (let i = 0; i < firstArray.length; i++) {\n let flag=true\n for (let j = 0; j < secondArray.length; j++) {\n if (firstArray[i][0]===secondArray[j][0]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dispalyPixel() Displays a pixel around the center position of the spray | displayPixel() {
// Display a pixel randomly inside the spray
this.pixelX = random(this.x + this.sprayWidth / 2, this.x - this.sprayWidth / 2);
this.pixelY = random(this.y + this.sprayHeight / 2, this.y - this.sprayHeight / 2);
// Fills the pixel with variabes, without stroke and displays it from the ce... | [
"function pixelDraw(x,y)\n{\n ctx.fillRect(x, y, pxl, pxl)\n}",
"drawPixel(x, y, value) {\n let index = x + y * DISPLAY_WIDTH;\n\n this.display[index] ^= value;\n return !this.display[index];\n }",
"function printPixel(nameOfImage, xpos, ypos){\nvar somePxl = new SimpleImage(nameOfIma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves the spells of a specific level from the spalls dat objects | function getSpellsByLevel(levelString,className){
var list = [];
if (className == 'None'){
for (spellName in spellsData){
if (spellsData[spellName].LEVEL == levelString){
list.push(spellName)
}
}
} else if (className == 'Mystic' || className == 'Technomancer'){
for (spellName in sp... | [
"function spells() {\n playerspells = {\n basicAttack: {\n name: \"Basic Attack\",\n nameid: \"basicAttack\",\n levelReq: 1,\n damage: Math.floor(player.damage + player.addDamage + (player.strength / 5) + (player.agility / 5)),\n description: \"Basic ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the right options blocks for the panel type. | function optionBlocksForPanelType(panelType) {
switch (panelType) {
case PanelType.HARDWARE:
default:
return HARDWARE_OPTION_BLOCKS;
case PanelType.VIEW:
return VIEW_OPTION_BLOCKS;
}
} | [
"function renderBlockDropDowns(){\n hideOption(\"symbol-div\");\n hideOption(\"unit-div\");\n hideOption(\"exchange-div\");\n hideOption(\"interval-div\");\n hideOption(\"submit-div\");\n showOption(\"block-symbol-div\");\n showOption(\"bl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get Betting Markets by Event / / The EventId of the desired event/game for which to pull all betting markets (includes outcomes/bets). | getBettingMarketsByEventPromise(eventId){
var parameters = {};
parameters['eventId']=eventId;
return this.GetPromise('/v3/nfl/odds/{format}/BettingMarkets/{eventId}', parameters);
} | [
"getBettingMarketsByMarketTypePromise(eventId, marketTypeID){\n var parameters = {};\n parameters['eventId']=eventId;\n parameters['marketTypeID']=marketTypeID;\n return this.GetPromise('/v3/nfl/odds/{format}/BettingMarketsByMarketType/{eventId}/{marketTypeID}', parameters);\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
list the pileups for the year | function list_pileups_year(){
pileups_year=[];
if(i_word>-1){
for(var i=0;i<pileups[i_word];i++) if(data_json_w['pileups'][i]['y']===year) pileups_year.push(i);
}
n_pileups_year=pileups_year.length;
} | [
"function list_pileups_pairwize_year(){\n // building the pileups\n pileups_year=[];\n if(i_word!==-1){\n\tfor(var i=0;i<pileups[i_word];i++) if(data_json_w['pileups'][i]['y']===year) pileups_year.push(i);\n }\n n_pileups_year=pileups_year.length;\n // building the pairwize\n pairwize_year=[];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task 2 ////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////// Declares a new constructor function, but with new addition, subtraction, division, and multiplication functions | function ConstructorFunction2(r, i) {
this.real = r;
this.img = i;
this.print = function () {
console.log(this.real + "+" + this.img+"i");
};
//Addition function
this.add = function (object2) {
let real2 = r + object2.real;
let img2 = i + object2.img;
//Creates ne... | [
"constructor(a, b, op) {\n //access calculation's internal properties\n this.a = a;\n this.b = b;\n this.op = op;\n }",
"function NumOperation(a, b, c) {\n this.firstNum = a;\n this.secondNum = b;\n this.operation = c;\n}",
"function createCalculator() {\n return {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calcular(10, 5, soma) Desafio criar uma funcao callback chamada servicosPrestados que tenha como dois servicos: dar banho no pet e tosar o pet sendo assim teremos sempre que passar um pet da nossa lista de pets e tambem um servico que aquele pet ira utilzar | function servicosPrestados(pet, servico) {
servico(pet)
} | [
"function PesoPaquete(payasos, munecas){\n let pesoTotal = (payasos * 112) + (munecas * 75);\n return pesoTotal\n}",
"function remoteMathService (cb) {\n var one = 0, two = 0;\n\n Promise.all([callOneService(), callTwoService()])\n .then(values => {\n one = values[0];\n two = values[1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
;; camDef(something) ;; ;; Returns false if something is JavaScriptundefined, true otherwise. ;; | function camDef(something)
{
return typeof(something) !== "undefined";
} | [
"function js() {\n return true;\n}",
"function False () {\n}",
"function isDef(obj) {\n return typeof obj !== 'undefined';\n }",
"function True () {\n}",
"function isDef(variable) {\n return typeof (variable) != \"undefined\";\n}",
"function $defined(obj){\r\n return (obj != undefined);\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Proximity Limit Switch 2 Extends mxShape. | function mxShapeElectricalProximityLimitSwitch2(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function mxShapeElectricalLimitSwitch2(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}",
"function mxShapeElectricalTwoPositionSwitch2(bounds, fill, stroke, stroke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterates through each registered test waiter, and invokes its callback. If any waiter returns false, this method will return true indicating that the waiters have not settled yet. This is generally used internally from the acceptance/integration test infrastructure. | function checkWaiters() {
if (!callbacks.length) {
return false;
}
for (var i = 0; i < callbacks.length; i++) {
var context = contexts[i];
var callback = callbacks[i];
if (!callback.call(context)) {
return true;
}
}
return false;
} | [
"function checkWaiters() {\n if (!callbacks.length) {\n return false;\n }\n\n for (let i = 0; i < callbacks.length; i++) {\n let context = contexts[i];\n let callback = callbacks[i];\n\n if (!callback.call(context)) {\n return true;\n }\n }\n\n return false;\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create MTD dependencies rules See Johan's XLS | function buildRules() {
// Start creating a new ruleset
var ruleset = $.deps.createRuleset();
var masterSwitch = ruleset.createRule(getDGFId("mechanicalThrombectomyDevice") + " select",
"not-any",
["--NOVALUE--", "noDevice", "notApplicable"]);
// Make this con... | [
"function updateEditedDependencies(range) {\n var newDependencyVal = range.getDisplayValue();\n \n var currentTaskRow = range.getRow();\n \n // No dependencies are declared; reset the task to the beginning\n if (newDependencyVal == \"\") {\n SpreadsheetApp.getActiveSpreadsheet().getSheets()[0].getRange(ran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a jQuery selector to a form, this will clear all the elements on the UI. | function drupalgap_form_clear(form_selector) {
try {
$(':input', form_selector)
.not(':button, :submit, :reset, :hidden')
.val('')
.removeAttr('checked')
.removeAttr('selected');
}
catch (error) { console.log('drupalgap_form_clear - ' + error); }
} | [
"function clearForm() {\n\t\tclearElements();\n\t\t$('#clearall').click();\n\t}",
"function clearForm() { // private function\n var selector = thisInstance.constants.selector;\n $(document).on('click', '.js-clear-form', function(e) {\n e.preventDefault();\n var $cycleSlideshow ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion guardarTextoComoArchivo se encarga de convertir el texto para poder descargarlo como .txt | function guardarTextoComoArchivo() {
// Sacar el texto que actualmente esta en el area de texto
var texto = document.getElementById("textoAGuardar").value;
// Convertir el texto en un tipo de data BLOB
var textoBlob = new Blob([texto], { type: "text/plain" });
// Crear el URL para descargar el arch... | [
"function crearArchivo(path, content){fs.writeFile(path, content, (err) => {if(err) throw err;});}",
"function pegarArchivo() {\n try{\n if (funciones.pathCopia.typePaste != -1) {\n var path = funciones.pathCopia.path+funciones.pathCopia.name;\n var direccionDestinoNormalizada = fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: Determine which question type ("textquestion" or "imagequestion") we have | function determineQuestionType(e) {
let questionTypeValue;
if(e.target.dataset.btn === 'btn--add-text-question') {
questionTypeValue = "text-question";
} else if(e.target.dataset.btn === 'btn--add-image-question') {
questionTypeValue = "image-question";
}
return questionTypeValue;
} | [
"function checkQuestionType(question) {\n const toRender = question.questionType;\n return toRender;\n}",
"function getQuestionType() {\n var randNum = getRandomInt(1, 3); // random number between 1 and 2\n\n if (randNum === 1) {\n return \"subtype\";\n } else {\n return \"runtime\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logout the current user by clearing web storage and navigating to the home page. | function logout() {
sessionStorage.clear();
web3.eth.defaultAccount = undefined;
window.location.assign('../index.html');
} | [
"Logout (){\n localStorage.clear()\n }",
"function _logout(){\n localStorage.removeItem(\"ndsAccount\");\n localStorage.removeItem(\"userName\");\n localStorage.removeItem(\"userMail\");\n localStorage.removeItem(\"userPhone\");\n _disableSettingsUI();\n document.location.href = myApp.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to handle edit paypal | function editPayPal() {
$( "#load" ).show();
var url = $('#editPayPalForm').attr('action');
var form = new FormData(document.getElementById('editPayPalForm'));
var paypal = $("#masked_paypal_email").val();
//validate new paypal entry
if( !isValidEmailAddress(paypal) ) {
return;
}
var dataStri... | [
"function paypalEdit(e) {\n e.preventDefault();\n var fields = $('#paypalSettings').serializeForm();\n $.post('https://cs341group4.tk/Checkout/PayPalEdit', fields)\n .done(function(data) {\n alert(data.message);\n location.reload();\n })\n .fail(function(data){\n alert(data.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function reads incoming session data | function onSessionCharacteristicRead(data, isNotification) {
if (isNotification) {
console.log('sessionidCharacteristic notification value: ', data.readInt8(0));
session_id = data.readInt8(0);
session_update();
} else {
console.log('sessionidCharacteristic read response value: ', data.readInt8(0));
... | [
"function session_read( sessionKey )\n{\n var sessionFilePath = pathFromSessionKey( sessionKey );\n return JSON.parse( fs.readFileSync( sessionFilePath, 'utf-8' ) );\n}",
"function read_w_session (sessionid, options, cb) {\n var pgm = service + '.read_w_session: ' ;\n var pgm2,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create creates a new document for the given model | create(model, doc, callback) {
var create_url = util.format('%s/%s/%s', this.url, this.version, model);
return new promise((resolve, reject) => {
request.post({
url: create_url,
auth: {
bearer: this.token
},
... | [
"function createDoc (dbModel, options) {\n options.data = options.data !== null ? options.data : {};\n options.success = options.success !== null ? options.success : function () {};\n options.error = options.error !== null ? options.error : function () {};\n\n options.data = cleanKeywords(options.data);\n\n db... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find all the focusable elements within the modal | findFocusableElementsWithinModal() {
// Find all focusable children
let potentiallyFocusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
let focusableElements... | [
"getFocusableElements() {\n return this.treeNodeRef.current ? Array.from(this.treeNodeRef.current.querySelectorAll(FOCUSABLE_SELECTOR)) : [];\n }",
"getFocusableElements() {\n return queryShadowRoot(this, isHidden, isFocusable);\n }",
"getFocusableElements() {\n return queryShadowRoot(this, isH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
crossfilterServer.dimension.groupAll() This is a convenience function for grouping all records into a single group. he returned object is similar to a standard group, except it has no top or order methods. Instead, use value to retrieve the reduce value for all matching records. Note: a grouping intersects the crossfil... | function groupAll() {
// reducing does nothing because currently we can't choose how the database will aggregate data
var groupAllObj = {
reduce: function () { return groupAllObj; },
reduceCount: function () { return groupAllObj; },
reduceSum: function () { return groupAllObj; },
... | [
"function group(key) {\n var group = {\n top: top,\n all: all,\n reduce: reduce,\n reduceCount: reduceCount,\n reduceSum: reduceSum,\n order: order,\n orderNatural: orderNatural,\n size: size,\n dispose: disp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializer method: run mixin initializers, then the base. | [base.name](/*...args*/) {
// Run mixin initializers. They cannot have arguments.
// Run them backwards so most-derived mixin is initialized first.
for (let i = mixins.length - 1; i >= 0; i--) {
let mixin = mixins[i];
let init = mixin.prototype[mixin.name];
if (init... | [
"function mixin(base /*, ...mixins*/){ // Create an initializer for the mixin, so when derived constructor calls\n// super, we can correctly initialize base and mixins.\nvar mixins=slice.call(arguments,1); // Create a class that will hold all of the mixin methods.\nvar Mixin=(function(_base){_inherits(Mixin,_base);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::Kendra::DataSource.SalesforceStandardObjectAttachmentConfiguration` resource | function cfnDataSourceSalesforceStandardObjectAttachmentConfigurationPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnDataSource_SalesforceStandardObjectAttachmentConfigurationPropertyValidator(properties).assertSuccess();
return {
Documen... | [
"function cfnDataSourceSalesforceConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDataSource_SalesforceConfigurationPropertyValidator(properties).assertSuccess();\n return {\n ChatterFeedConfiguration: cfnDataSourceSales... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use Stellar Public Network | static usePublicNetwork() {
this.use(new Network(Networks.PUBLIC));
} | [
"function InternetSharing() {}",
"suggestNetwork(){\n return _send(NetworkMessageTypes.REQUEST_ADD_NETWORK, {\n domain:locationHost(),\n network:network\n });\n }",
"function setNetwork() {\r\n network = document.getElementById(\"defaultnet\");\r\n\r\n if (ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load activity history, pass 'today' or 'all' | function loadActivityHistory (todayOrAll, activityDay, uName) {
var activityStr = localStorage.getItem (fa_activityList + uName);
if (activityStr == null || activityStr == "") {
return;
}
activityHistory.length = 0;
activityHistory = JSON.parse(activityStr);
activityHistoryView.length=0;
... | [
"function loadHistory(){\n\t\tvar data;\n\t\t$.getJSON(\"hosthistory.json\", function(data) {\n\t\t\t$(\"#loadingTable\").remove();\n\t\t\tvar tableHeading = '<tr><th>Datetime</th><th>Source</th><th>Action</th></tr>';\n\t\t\t$(\"#hostHistoryTable\").append(tableHeading);\n\t\t\t$.each(data.entries, function(i,entry... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Object Prototype used only by xTimerMgr | function xTimerObj(type, obj, mthd, preset, data)
{
// Public Properties
this.data = data;
// Read-only Properties
this.type = type; // 'interval' or 'timeout'
this.obj = obj;
this.mthd = mthd; // string
this.preset = preset;
this.reset();
} // end xTimerObj constructor | [
"function xTimerMgr()\n{\n this.timers = new Array();\n}",
"function SystemTimer() {}",
"function xTimerObj(type, obj, mthd, preset, data)\n{\n // Public Properties\n this.data = data;\n // Read-only Properties\n this.type = type; // 'interval' or 'timeout'\n this.obj = obj;\n this.mthd = mthd; // string... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle a local message (from a text buffer proxy) | _handleLocalMessage(message) {
const logObj = {message: message};
log.debug('Handling local message: ', logObj);
switch (message.type) {
case TEXT_BUFFER_PROXY_INSERT: {
const {textBufferProxyId, newText, startPos} = message;
this._localInsertAndEmitEvents(textBufferProxyId, newText, ... | [
"handleTextMessageRes(data) {\n if (data.ok) {\n this.webContents.send(\"msg-res\", {\n type: \"fullsend\",\n id: data.id\n })\n const msg = this.messageCache[data.id]\n this.outgoingMessages.push({\n _id: data.id,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function deleteItem . perform an ajax call to the route ''/products/delete/' the route takes the id of the product and deletes from the database takes the product ID as argument | function deleteItem(itemId) {
$.ajax({
url: '/products/delete/' + itemId,
type: 'DELETE',
}).then(data => {
console.log(data);
window.location.reload();
})
} | [
"function deleteItem(itemId) {\n $.ajax({\n method: 'DELETE',\n url: 'http://localhost:8080/items/' + itemId\n }).done(function (item) {\n console.log(\"Deleted item \" + itemId)\n })\n}",
"function deleteItem() {\n var id = $(this).data(\"id\");\n $.ajax({\n method: \"DEL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: describeObject Input: obj(Object) Output: Print a string that says 'This object has X properties' | function describeObject(obj){
return `This object has ${Object.keys(obj).length} properties`
} | [
"function getObjectDescription(obj) {\n\t\ttry {\n\t\t\tif (typeof(obj) == 'object') {\n\t\t\t\tvar desc = ['<h4>Basic Info</h4>', 'Native Class: ', obj.nativeClass, '<br />', 'Size: ', obj.size, '<br />', 'Scope: ', wrapObjectIdHtml(obj.parent), '<br />', 'Prototype: ', wrapObjectIdHtml(obj.prototype), '<br />', '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recibe el turno, estado, boolean, prof actual, max prof, movimiento que genero el estado actual | function minimax(turno, estado, maximizando, profundidad, maxprof, movimiento){ //debo retornar [fila,columna,heuristica]
if(profundidad==maxprof){
// CALCULAR HEURISTICA
return [movimiento[0], movimiento[1], movimiento[2]]; //si ya no hay sucesores
}
var movimientosposibles = getMovimientosPosi... | [
"function siguienteGeneracion() {\n if ((fitness.some(val => val > (1 / tamañoPoblacion * 1.4))) || (numPoblacionesIteradas > limiteIteraciones)) { //funcion de parado, cuando se hayan excedido el numero de iteraciones limite, o cuando se cumpla con la funcion de parado que es \n //cuando el fitness de un... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extract information from applet to html | function accessAppletMethod()
{
var fn = "";
fn = document.applets[0].getAttributes();
document.getElementById('showProperty').value = fn;
fn = document.applets[0].getFilename();
document.getElementById('showFilePath').value = fn;
comfirmCreatetask();
} | [
"function generateApplet(AppletAttrs, params) \r\n{ \r\n var str = '<applet';\r\n for (var i = 0; i<AppletAttrs.length; i++){\r\n \tstr += ' ' + AppletAttrs[i].name + '=\"' + AppletAttrs[i].value + '\"';\r\n }\r\n str += '>';\r\n for (var i = 0; i<params.length; i++){\r\n str += '<param name=\"' + param... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if you click on a symbol if symbol is clicked, open edit box and highlight symbol symbols have different methods to check if clicked | function findSymbol(_event) {
if (move == true) {
move = false; //drop symbol on new position after edit
}
else {
for (let i = 0; symbols.length > i; i++) { //goes through every symbol to check if clicked on
if (symbols[i].name == "cloud") {
... | [
"function symbolClick() {\n var symbol = $(this).text();\n updateFormula(function(text) {\n return text + symbol;\n });\n }",
"function showSymbol(evt) {\n evt.target.className = 'card open show';\n evt.target.isClicked = 1;\n\n }",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true if p lies on the line segment defined by AB, but not at any endpoints may need work! | function _onSegment(A,B,p, tolerance){
if(!tolerance){
tolerance = TOL;
}
// vertical line
if(_almostEqual(A.x, B.x, tolerance) && _almostEqual(p.x, A.x, tolerance)){
if(!_almostEqual(p.y, B.y, tolerance) && !_almostEqual(p.y, A.y, tolerance) && p.y < Math.max(B.y, A.y, tolerance) && p.y > Math.min(B... | [
"pointIsWithinLine(p) {\n\t\tconst a1 = this.endPoint.y - this.startPoint.y;\n\t\tconst b1 = -(this.endPoint.x - this.startPoint.x);\n\t\tconst c1 = -this.startPoint.y * b1 - this.startPoint.x * a1;\n\n\t\tif (round(a1 * p.x + b1 * p.y + c1) != 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst lineDirection = this.getL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: stopLoadingAnimation() Stops the "Loading..." animation when the feed finishes loading. | function stopLoadingAnimation()
{
if (loadingAnimationTimer != null) {
clearInterval(loadingAnimationTimer);
loadingAnimationTimer = null;
}
} | [
"function stopLoadingAnimation() {\n $('.loading-animation-container').remove();\n $('.loading-animation').remove();\n}",
"function _removeLoadingAnimation() {\n\t\t_loadingAnimation.stop();\n\t\t$(_loadingAnimationContainer).remove();\n\t}",
"function stopLoadingAnimation () {\r\n $('#root-loading-wheel').r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bulk select all items, setting their buttons to pressed and updating the displayed list of components. | function selectAllItems() {
selectedItems = []
Object.keys(allItemNames).forEach(itemName => {
selectItem(itemName)
})
updateSelectedItemComponents()
} | [
"function updateSelectAllButtonState(){\r\n\t\t\r\n\t\tvar objButton = g_objPanel.find(\".uc-button-select-all\");\r\n\t\t\r\n\t\tvar numItems = getNumItems();\r\n\t\t\r\n\t\tif(numItems == 0){\r\n\t\t\tobjButton.addClass(\"button-disabled\");\r\n\t\t\t\r\n\t\t\tobjButton.html(objButton.data(\"textselect\"));\r\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the result returned by a git log command using the standard log format (see above). | function parseLogResult({ error, code, stdout, stderr }) {
// Check for error conditions.
if( error ) {
throw error;
}
if( code !== 0 ) {
throw new Error(`${code}: ${stderr}`);
}
if( !stdout ) {
// Undefined result indicates no info available.
return undefined;
... | [
"function parseCommitLog (data) {\n la(is.string(data), 'expected string data', data)\n // commit [SHA]\n var commits = data.split(/\\n(?=commit [0-9a-f]{40})\\n?/g)\n\n return commits\n .filter(is.unemptyString)\n .map(parseCommit)\n .map(trim)\n}",
"readGitLog() {\n let lastTag = \"0.0.0\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an id for new object save object to store returns obj + new id | save(obj) {
obj.id = uniqid();
this.warehouse[obj.id] = obj;
return obj;
} | [
"createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}",
"function t_set_id(obj){t_id++;id='t_'+t_id; if(obj.id){return obj.id;}try {obj.setAttribute('id',id);} catch(e){obj.id=id;}return id;}",
"function createObjectId(id) {\n\t\treturn 'object_' + id;\n\t}",
"async save(obje... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var newTrait = override(trait_1, trait_2, ..., trait_N) | function override(var_args) {
var traits = slice(arguments, 0);
var newTrait = {};
forEach(traits, function (trait) {
forEach(getOwnPropertyNames(trait), function (name) {
var pd = trait[name];
// add this trait's property to the composite trait only if
// - the trait does not ... | [
"function setTraits(newOriginalTraits) {\r\n originalTraits = newOriginalTraits || {};\r\n availableTraits = {};\r\n $.each(originalTraits, function(key, val) {\r\n availableTraits[key] = val;\r\n });\r\n }",
"function setTraits(newOriginalTraits) {\n originalTrait... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluates, or attempts to evaluate, an AwaitExpression | async function evaluateAwaitExpression({ node, environment, evaluate, policy, statementTraversalStack }) {
// If a maximum duration for any operation is given, set a timeout that will throw a PolicyError when and if the duration is exceeded.
const timeout = policy.maxOpDuration === Infinity
? undefined
... | [
"function visitAwaitExpression(node){// do not downlevel a top-level await as it is module syntax...\nif(inTopLevelContext()){return ts.visitEachChild(node,visitor,context);}return ts.setOriginalNode(ts.setTextRange(ts.createYield(/*asteriskToken*/undefined,ts.visitNode(node.expression,visitor,ts.isExpression)),nod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a setup where the replaceable coins are replaced by the coin type and number of coins | function replace(setup, coinIndex, numOfCoins) {
// to replace the coins in a setup, it needs to be split into 3 parts:
// head: the part of the setup before the replacement which is left unaltered (if any)
// mid: the part of the setup that is actually replaced
// tail: the trailing part of the setup
... | [
"function makeChange(cents) {\n // -------------------- Your Code Here --------------------\n\n // Initialize the coins object\n\n \n // store the number of quarts as the dividend of the argument value divided by 25\n\n \n // store the remainder as the new value we're going to be calculating coin counts off o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the tab order for the form fields (if present on current page). | function setTabIndex() {
$('input, select, button', 'div#content form').each(function (index) {
$(this).attr('tabindex', index + 1);
});
} | [
"setTabOrder() {\n let tabIndex = 1;\n this.$el.find('input, select, button').each(function() {\n $(this).attr('tabindex', tabIndex);\n tabIndex++;\n });\n }",
"function reorderFields() {\n\t\tvar order = 1;\n\t\tblocksft.find('[data-order-field]').each(function() {\n\t\t\t$(this).val(order);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the crumbs from the current directory path | crumbs() {
const items = [];
const parts = this.$store.state.selectedDirectory.split('/');
// Add the drive as first element
if (parts) {
const drive = this.findDrive(parts[0]);
if (drive) {
items.push(drive);
parts.shift();
}
}
parts
... | [
"function createCrumbs() {\n const home = folderIcon.element({\n className: BREADCRUMB_HOME_CLASS,\n tag: 'span',\n title: PageConfig.getOption('serverRoot') || 'Jupyter Server Root',\n stylesheet: 'breadCrumb'\n });\n const ellipsis = ellipsesIcon.el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
first i decleread a varibale with all the properties and methods then the functions below will preform the operations addIngredinets will push the ingredients to the empty array / Q6 ============================================================================= / Create a ReadingList class by using OOP concept, where: Y... | function ReadingList(){
book = {};
book.read = 0;
book.unRead = 0;
book.toRead = [];
book.currentRead = "";
book.readBooks = [];
book.addBook = addBook;
book.finishCurrentBook = finishCurrentBook ;
return book;
} | [
"function ReadingList(read, unRead, toRead, currentRead, readBooks){\n\n var readingList = {};\n\n //Add the states to the return object.\n readingList.read = read;\n readingList.unRead = unRead;\n readingList.toRead = toRead;\n readingList.currentRead = currentRead;\n readingList.readBooks = readBooks;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add dom grid item to grid container | function addGridItem(game, gridSize) {
// Create element
const newElement = document.createElement('div');
newElement.classList.add('item', `${gridSize}`);
// Add inner HTML data
newElement.innerHTML = `
<img src="${game.image}" alt="">
<div class="price-description">
<div class="price-percentage"... | [
"function addGridItems(grid) {}",
"addItem(item) {\n return this.gridObject.add(item.nativeElement);\n }",
"function addItem(evt){\n var self = evt.target;\n var template = dom.closest(self, 'wb-row');\n // we want to clone the row and it's children, but not their contents\n var newItem = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets a new language to the cookie | function ls_setCookieLanguage(language) {
var today = new Date();
var expiry = new Date(today.getUTCFullYear() + 30, 1);
document.cookie = ls_cookie + '=' + escape(language) + '; expires=' + expiry.toGMTString();
} | [
"function setLangCookie() {\n document.cookie = \"language = \" + getLanguage();\n }",
"function setLangCookie() {\r\n\t// expire previous cookie (if it exists)\r\n\tdocument.cookie = \"lang=; expires=-1; path=/\";\r\n\r\n\t// cookie will expire after 90 days.\r\n\tvar expdate = new Date();\r\n\texpdate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make RPC for out of game | function outOfGame({status_string}) {
if (currentActivity !== status_string) {
log('green', `RPC: ${status_string}`);
currentActivity = status_string;
if (config.getAPIUseData) getDataUsed();
}
rpc.setActivity({
details: status_string,
largeImageKey: 'logo_png',
largeImageText: status_string,
... | [
"function handleGame(req, res) {\n var type = req.body.type;\n\n //console.log(req.body);\n\n if (type == undefined) {\n res.send(\"Message type is not specified.\");\n return;\n }\n\n // Create a new game function.\n // ===========================================================================\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Puts the colors of the next eight turns into the turn counter. | function changeCounter() {
for (var i = 0; i < 8; i++) {
document.getElementsByClassName("smallSquare")
.item(i + 1).style.backgroundColor = color(currentTurn + i);
}
} | [
"function nextColor() { \n c = colors[ count % colors.length]\n count = count + 1\n return c\n}",
"function nextColor() { \n c = colors[ count % color.length]\n count = count + 1\n return c\n}",
"function color(turn) {\n\n // By the end of this loop, i is the number of 1s in the binary representati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a file, as string, from the cache by key; null otherwise. | function _get(key){
var ret = null;
// Pull from cache or re-read from fs.
//console.log('key: ' + key)
//console.log('use_zcache_p: ' + use_zcache_p)
if( use_zcache_p ){
ret = zcache[key];
// console.log('_get CACHED: ', key, ret.slice(0, 10));
}else{
ret = afs.read_file(path_cache[key]);
// cons... | [
"function getCachedFile(key, etag, expectedDate) {\r\n var folder = new Paths(key).getKeyPath();\r\n // try disk cache\r\n return fsp\r\n .readdir(folder)\r\n .then(function (fileList) {\r\n var result = getLatest(getRemoteFileList(fileList));\r\n return !result ? Promise.reject... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dynamic message example that adds timestamp so it's easy to see when there's a cache hit vs cache miss. | function message() {
return `Hello! We only serve whirled peas. Generated: ${new Date().toString()}`
} | [
"create_msg(msg, type) {\n const timestamp = new Date().toISOString();\n return timestamp + \" | \" + type + \" | \" + msg + \"\\n\";\n }",
"function timestampMessage(msg, username){\n return getTimeStamp() + \" \" + username + \": \" + msg;\n}",
"function buildLogMessage( type, message ) {\n\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a constructor function for a Person, each person should have a firstName, lastName, favoriteColor and favoriteNumber. Your function MUST be named Person. Write a method called multiplyFavoriteNumber that takes in a number and returns the product of the number and the object created from the Person functions' fav... | function Person(firstName, lastName, favoriteColor, favoriteNumber) {
this.firstName = firstName;
this.lastName = lastName;
this.favoriteColor = favoriteColor;
this.favoriteNumber = favoriteNumber;
this.multiplyFavoriteNumber = function(num) {
return num * this.favoriteNumber;
}
} | [
"function Person(firstName, lastName, favoriteColor, favoriteNumber) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.favoriteColor = favoriteColor;\n this.favoriteNumber = favoriteNumber;\n this.multiplyFavoriteNumber = function (secondNum) {\n return secondNum * this.favori... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[String] String Number > null Populates the maze randomly with one user defined marker to signify an item, weapon, enemy, etc given: an array that is a solvable maze openings that can be traversed in the maze actual item object to be placed on the maze optional user defined marker position expected: a marker put random... | addMarker(level, openings, itemObj, startPosX = -1, startPosY = -1) {
let startPos = startPosX + startPosY;
if (startPos >= 0 && openings.indexOf(startPos) === -1 && startPos < this.maze.length) {
level[startPos] = itemObj;
}
else {
let randomCell = Math.floor(Mat... | [
"placeItems(){\n for (let item = 0; item < this.items.length; item++){\n this.items[item].y = Math.floor(random(this.mapSize));\n this.items[item].x = Math.floor(random(this.mapSize));\n while (this.map[this.items[item].y][this.items[item].x] !== \".\"){\n this.items[item].y = Math.floor(ra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format value using formatType and format | function customFormat(value, formatType, format) {
if (value === undefined || value === null) {
return undefined;
}
if (!formatType) {
return undefined;
}
switch (formatType) {
case 'time':
return format ? d3_time_format_1.timeFormat(format)(value) : autoTimeForma... | [
"function customFormat(value, formatType, format) {\n if (value === undefined || value === null) return;\n if (!formatType) return;\n\n switch (formatType) {\n case \"time\":\n return format ? dl.format.time(format)(value) : dl.format.auto.time()(value);\n case \"number\":\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns filtered data for current country | function getModifiedCurrentCountry(){
var filtered_data_current_country = dataset.filter((value)=>{
return (value.Country == currentCountry.Country)
});
return filtered_data_current_country
} | [
"function filterByCountry(filterCountry) {\n var newdata = []\n data.forEach(event => {\n if (event.country === filterCountry) {\n newdata.push(event)\n }\n })\n return newdata;\n}",
"function filterCountries(data) {\n var newData = data.filter(function (d) {\n return sele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
intersects Iterate through iViews, returning true for the first view that intersects iItemRect placed at the given location, false if none intersect. | function intersects(iTopLeft) {
return !iViewRects.every(
function (iViewRect) {
return !intersectRect(iViewRect,
{
x: iTopLeft.x,
y: iTopLeft.y,
width: iItemRect.width,
height: iItemRect.height
... | [
"intersects(rect) {\n return this.x <= rect.x + rect.width && rect.x <= this.x + this.width && this.y <= rect.y + rect.height && rect.y <= this.y + this.height;\n }",
"intersects(_rect, _insetByX, _insetByY) {\n if (this.isNumber(_insetByX)) {\n _rect = new HRect(_rect);\n if (this.isUndefined(_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to check if a record is selected in the appointment approval table | function isRowSelectedForAppointment(){
var radiosDonation = document.getElementsByClassName("appointRadios");
for(var i = 0; i<radiosDonation.length;i++){
if(radiosDonation[i].type === "radio" && radiosDonation[i].checked){
return true;
}
}
return false;
} | [
"function checkSelected() {\n var select = document.getElementById(\"selectAppointments\");\n if (select.value === \"default\") {\n alert(\"Select one appointment available!\");\n return (false);\n }\n return (true);\n}",
"function validateAdHocReviewSelected(){\n\tvar allowStatus = fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return undefined URL if not in same domain or not in runStandaloneAppFolderWhitelist | function localURL(sUrl) {
//that.parseUrl -> return an a(location)-object
if (that.parseUrl(sUrl).origin !== window.location.origin) {
return undefined;
}
//returns always an canonic absolute pathname
... | [
"devBaseUrls() {\n var baseUrl = new URL(window.location.origin);\n var parts = baseUrl.hostname.split(\".\");\n\n if (parts.includes(\"platformsh\") && parts.includes(\"www\")) {\n // We are on a Platform.sh development environment under\n // the app subdomain. Let's strip out the www ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to delete a question from the meeting. Deletes the question from firebase | function deleteQuestion(questionid){
var rmQuestionRef = new Firebase(fbUrl+"/meeting/"+questionid);
var onComplete = function(error) {
if (error)
console.log('Synchronization failed.');
else
console.log('Synchronization succeeded.');
};
rmQuestionRef.remove(onComplete);
} | [
"function deleteQuestion() {\n var questionID = $(this).attr(\"data-id\");\n\n roundsRef.child(\"/\" + currentRoundID + \"/questions/\" + questionID).remove();\n reorderQuestions();\n}",
"function delete_question(){\n let question = this.id.split('_')[0];\n console.log(\"one deleted: \" + question)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create conditional thunk. Options includes the algorithm and any algorithmspecific params. FIXME: do we need to return a thunk or an ERP (that knows how to score itself)? FIXME: finish | function conditional(computation, options) {
switch (options.algorithm) {
case "traceMH":
break
case "traceST":
break
case "LARJMH":
break
default: //rejection
... | [
"function conditional(computation, options) {\n\tswitch (options.algorithm) {\n\t\tcase \"traceMH\":\n\t\t\t\n\t\t\treturn mcmc_thunk(computation, new RandomWalkKernel(), options.lag, options.verbose, options.init)\n\t\t\t\n\t\tcase \"traceST\":\n\t\t\tvar rwkernel = new RandomWalkKernel(function(rec){return rec.st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle change voter status | function handleChangeVoterStatus(event, voterId) {
fetch(`/api/voters/${voterId}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
status: +event.target.value,
}),
})
.then((res) => res.json())
.then(() => {
getVoters();
})
... | [
"function watchVoteDone(){\r\n Ballot.events.voteDone({\r\n }, (error, event) => { \r\n console.log(event.returnValues.voter);\r\n updateNewVote(event.returnValues.voter); \r\n })\r\n .on('data', (event) => {\r\n })\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updating the start button after choosing the algorithm | function updateStartBtnText() {
if(algorithm == "Breadth First Search") {
$("#startBtn").html("Start BFS");
}
else if(algorithm == "Dijkstra's Algorithm") {
$("#startBtn").html("Start Dijkstra");
}
return;
} | [
"function buttonStart () {\n\tmodeDisplay();\n\tdocument.querySelector('#bStart').innerHTML = 'next random mode';\n}",
"function startVisualize() {\n if (selectedHeuristic == undefined && algorithmIndex == undefined) {\n showAlert(\"Please select an Algorithm and Heuristic function\");\n } else if (selectedH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes the request contract metadata clicked action. | function onRequestContractMetadataClicked() {
var symbol = $('#cm-symbol').val();
resolveSymbol(symbol, function (resolution) {
var metadata = resolution.metadata;
var fieldNames = Object.keys(metadata);
var view = $('#metadata');
view.empty();
var table = $('<table>');
... | [
"click() {\n this.sendAction('deal', this.get('result'));\n }",
"clickHandler() {\r\n\t\tif (this.clickMethod && this.targetContext && this.targetContext.data) {\r\n\t\t\tif (this.targetContext.data[this.clickMethod] instanceof Function) {\r\n\t\t\t\tthis.targetContext.data[this.clickMethod](this.data, this.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
starting from either node, or in the case of nonroot peer deps, the node's parent, walk up the tree until we find the first spot where this dep cannot be placed, and use the one right before that. place dep, requested by node, to satisfy edge | [_placeDep] (dep, node, edge, peerEntryEdge = null) {
if (!edge.error && !this[_updateNames].includes(edge.name))
return []
// top nodes should still get peer deps from their parent or fsParent
// if possible, and only install locally if there's no other option,
// eg for a link outside of the pr... | [
"async [_nodeFromEdge] (edge, parent_, secondEdge, required) {\n // create a virtual root node with the same deps as the node that\n // is requesting this one, so that we can get all the peer deps in\n // a context where they're likely to be resolvable.\n // Note that the virtual root will also have vir... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AddEntityEvent An entity has an event value also called by CG_CheckPlayerstateEvents | function AddEntityEvent(cent, position) {
var es = cent.currentState;
var ci = cgs.clientinfo[es.clientNum];
var event = es.event & ~EV_EVENT_BITS;
var dir = vec3.create();
// log('EntityEvent', 'ent:', es.number, ', event: ', event);
switch (event) {
case EV.FOOTSTEP:
SND.StartSound(null, es.number, /*CH... | [
"function AddEvent(ent, event, eventParm) {\n\tvar bits;\n\n\tif (!event) {\n\t\tlog('AddEvent: zero event added for entity', ent.s.number);\n\t\treturn;\n\t}\n\n\t// Clients need to add the event in PlayerState instead of EntityState.\n\tif (ent.client) {\n\t\tbits = ent.client.ps.externalEvent & EV_EVENT_BITS;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear all currently recorded shifts | function clearShifts()
{
// Set hours and pay to 0
totalHours = 0.0;
totalPay = 0.0;
// Update HTML
document.getElementById("hours").innerHTML = totalHours.toFixed(2);
document.getElementById("pay").innerHTML = "$" + totalPay.toFixed(2);
// Remove all shifts displayed in table
var table = doc... | [
"clear() {\n for (let i = 0; i < this.rounds; i++)\n for (let j = 0; j < 3; j++)\n this.keySchedule[i][j] = 0;\n }",
"pruneOpenShifts() {\n this.openShifts = [];\n this.gatherOpenShifts();\n }",
"function clearAll() {\r\n clearDetails();\r\n intTable.inne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns stroke color for particular ray | function strokeColor(d){
return '#444';
} | [
"function rayColor(ray, depth) {\n const black = [0, 0, 0];\n if(depth > bounce_depth) {\n return;\n }\n\n var closest = closestSurface(ray);\n if (closest.surface === null) {\n return black;\n }\n\n var surface = closest.surface;\n var intersection = closest.intersection;\n var material = materials[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GstLaunch found: /bin/gstlaunch1.0 GStreamer version: 1.16.2 GStreamer pipeline: v4l2src device=/dev/video0 ! decodebin ! jpegenc ! multipartmux boundary="videoboundary" ! tcpserversink host=0.0.0.0 port=10001 /! | function GstLaunch() {
const gst_launch_executable = 'gst-launch-1.0';
const gst_launch_versionarg = '--version';
const SpawnSync = require('child_process').spawnSync;
const Spawn = require('child_process').spawn;
const Assert = require('assert');
const Path = require('path');
const OS = require('os');
... | [
"function startRecordingGstreamer() {\n // Return a Promise that can be awaited\n let recResolve;\n const promise = new Promise((res, _rej) => {\n recResolve = res;\n });\n\n const useAudio = audioEnabled();\n const useVideo = videoEnabled();\n const useH264 = h264Enabled();\n\n let cmd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to take time zone and delete from array | deleteFromArray(timezoneVal){
try{
//delete from array and delete from array object
for(let i = this.timeZoneArray.length-1; i>= 0; i--){
if(this.timeZoneArray[i]==timezoneVal){
this.timeZoneArray.splice(i,1);
//break;
}... | [
"function removeFavoriteTimeZone(index) {\n locallySavedTimeZones.splice(index, 1);\n\n localStorage.setItem(\"timeZones\", JSON.stringify(locallySavedTimeZones));\n readLocalStorage();\n updateFavoriteTimeZones();\n formatFavoriteTimeZones();\n addFavoriteTimeZonesListners();\n}",
"function timeZoneArray()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listens to when a user reacts to the friend finding message, it will add them to the friend finding role and to the database with a status of 1. If they unreact, they will be set to a status of 0 in the database and removed from the role. | async function listenFFReactions(bot, msg, db) {
console.log(`${msg.guild.id}::::::::are you is here`);
const handleReaction = async (reaction, user, add) => {
if (user.id === botID) {
return;
}
const emoji = await reaction._emoji.name;
const { guild } = await reaction.message
let configFi... | [
"AddFriend(event){\n\n if(this.state.friend == this.props.golfer.username){\n this.setState({\n isFriend: \"Yourself\"\n });\n }\n else if(!(this.props.golfer.friends.filter(friend => friend.username === this.state.friend).length > 0)){\n this.setState({\n isFriend: false\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_getServerURL duplicated in test/unit/helper.js | function _getServerURL() {
var breakPoints = [ 'docs', 'test' ];
var oldArr = location.href.split( '/' );
var newArr = [];
for( var i = 0; i < oldArr.length; i++ ) {
if( breakPoints.indexOf( oldArr[ i ] ) !== -1 ) break;
newArr.push( oldArr[ i ] );
... | [
"function getTestUrl() {\n return $scope.environment.protocol + $scope.environment.subdomain + '.' + $scope.mint + ($scope.environment.port?':'+$scope.environment.port:'') + $scope.environment.entry;\n }",
"getServerUrl() {\n const {\n host,\n port\n } = this.serverConfig;\n return `//${hos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove opacity property of resultlabel elements | function darkenResultValueLabels () {
const $resultValueElems = document.getElementsByClassName('result-value');
for (let i = 0, l = $resultValueElems.length; i < l; i++) {
const elem = $resultValueElems.item(i);
elem.classList.remove('no-value');
}
} | [
"removeOpacity(containersRect, containerText) {\n for (let i = 0; i < containersRect.childNodes.length; i++) {\n containersRect.childNodes[i].setAttribute('opacity', '0.3');\n if (this.cellSettings.showLabel && containerText.childNodes[i]) {\n containerText.childNodes[i].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Play sequence from a starting currentButton for a specific number of turns (numTurns) | function playSequence(currentButton, numTurns) {
disableButtons();
if(currentButton >= numTurns) {
enableButtons();
return;
}
// Loop through each element in the sequence with a 0.8 second delay
var timer = setTimeout(function() {
nextTurn(currentButton);
playSequence(++currentButton, numTurns);
}, 800);
... | [
"function playSequence() {\n // If score is 20 (or somehow above), the player has won\n if (game.score >= 20) {\n winScreen();\n } else {\n $('#btn-start').css('background-color', colors.greenOn);\n game.allowPress = false;\n // Timestep gets shorter with each addition to the sequence\n game.times... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves username/id/authtoken to local storage | function saveSession(data) {
localStorage.setItem('username', data.username);
localStorage.setItem('id', data._id);
localStorage.setItem('authtoken', data._kmd.authtoken);
userLoggedIn();
} | [
"function saveToken (data) {\n\tconsole.log(\"savetoken\");\n\twindow.localStorage.setItem(\"token\", data.userId + \":\" + data.token);\n}",
"function saveDataToStorage() {\n\n if (user) {\n store.setItem(storageKeys.user, JSON.stringify(user));\n }\n\n if (token) {\n store.setItem(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Visual Basic printing commands for VB enabled browsers LoadVBPrinter() Accessibility ==================== Function: TextSize Purpose: Allows the user to alter the text size in the site style sheet. Input: '' to decrease the text size. '+' to increase the text size. Output: Alters the base text size on the tag. Ass... | function TextSize(strIncrement) {
//intTextSize = document.getElementsByTagName("body")[0].style.fontSize;
//intTextSize = document.body.style.fontSize;
strTextSize = GetCSSProperty(document.body,"fontSize","font-size");
if (strTextSize.indexOf("em") > 0) {
strTextSizeUnit = "em";
... | [
"function updateTextSize(newSize) {\n setClassExclusively(window.dGO.printArea, newSize, window.dGO.allTextSizes);\n}",
"_updateTextSize(size) {\n this['textSize'] = parseInt(size, 10);\n this._targetEl.style.fontSize = this['textSize'] + 'px';\n this._layoutWords();\n }",
"function change_text_siz... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the current rendering page. | get currentRenderingPage() {
if (this.pages.length === 0) {
return undefined;
}
return this.pages[this.pages.length - 1];
} | [
"page() {\n return this._frameManager.page();\n }",
"current() {\r\n return this.page(this.currentFilePath);\r\n }",
"function GetCurrentPage() {\r\n for each(var page in PAGES) {\r\n if ($(page[\"path\"]).filter(\":visible\").length) {\r\n return page;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
starts email oath process | function startOath(sender_psid, email){
DatabaseUtils.insertEmail(sender_psid, email, null);
RetreiveUrl.getAuthorizationUrl((err, url) => {
let response = {
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text": "Setup "+email,
"butto... | [
"function launch() {\n \n // Set number of iterations to check before declaring the script complete even if not all files are there and stores as userProperty to use as counter across times the trigger runs\n var stopPoint = 30;\n var userProperties = PropertiesService.getUserProperties();\n userProperties.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the default NEM Blockchain network. T for Testnet and M for Mainnet | function setNetwork() {
network = document.getElementById("defaultnet");
if (network.value === 'M')
url = "https://shibuya.supernode.me:7891";
else
url = "https://nis-testnet.44uk.net:7891";
nishost.value="";
nisport.value="";
defaultNo... | [
"setDefault() {\n if (this._Wallet.network == nem.model.network.data.mainnet.id) {\n if (this._storage.selectedMainnetNode) {\n this._Wallet.node = this._storage.selectedMainnetNode;\n } else {\n let endpoint = nem.model.objects.create(\"endpoint\")(nem.mod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper that supports multiple file patches via callbacks. | function applyPatches(uniDiff, options) {
if (typeof uniDiff === 'string') {
uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
}
var currentIndex = 0;
function processIndex() {
var index = uniDiff[currentIndex++];
if (!index) {
return options.complete... | [
"function _04_patchFilesFn () {\n var\n ctx_obj = this,\n patch_matrix = setupMatrix.patch_matrix || {},\n patch_dirname = patch_matrix.patch_dirname || '',\n patch_map_list = patch_matrix.patch_map_list|| [],\n patch_map_count = patch_map_list.length,\n promise... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
we use two passthroughs because the original ubjson stream doesnt even have pipe. probably should just rewrite ubjson/ubjsonstream.js | function decodeStream() {
var ins = new PassThrough
var outs = new PassThrough({ objectMode: true })
var ubs = new ubjson.Stream(ins)
pipeUBS(ubs, outs)
return duplexify.obj(ins, outs)
} | [
"collectJSONStream (stream, error) {\n let results = { streamData: [] };\n\n stream.on('end', () => {\n if (error) return;\n // If there were no errors save these test results to the database\n // save is left to run and not waited for\n // (test failures are not errors)\n this.saveRe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |