query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
console.log(NANDfromNAND(0,0)) console.log(NANDfromNAND(0,1)) console.log(NANDfromNAND(1,0)) console.log(NANDfromNAND(1,1)) | function NANDfromNOR(a,b) {
return NOR(
NOR(NOR(a,a), NOR(b,b)),
NOR(NOR(a,a), NOR(b,b))
)
} | [
"function NAND(x, y) {\n return !(x && y) ? 1 : 0;\n}",
"function NAND(x, y) {\n return (!x || !y);\n}",
"function NAND(x, y) {\n\t// You can use whatever JS operators that you would like: &&, ||, !\n\tif (x === 0 && y === 0) {\n\t return 1\n\t} else if (x !== y) {\n\t return 1\n }\n else {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the descriptor for a gene by lineage id. | getDescriptor(lineageId) {
return this.descrMap.get(lineageId);
} | [
"getGeneInformation(id) {\n\t\treturn this.props.getGeneInformation(id);\n\t}",
"getGeneInformation(id) {\n\t\tlet geneInfoToReturn = undefined;\n\t\tthis.state.genes.forEach((gene) => {\n\t\t\tif (gene.id === id) {\n\t\t\t\tgeneInfoToReturn = gene;\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t\treturn geneInfoToReturn;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
} function to save wallet | function saveWallet() {
localStorage.setItem("currentWallet", JSON.stringify(currentWallet));
} | [
"function saveWallet() {\n if (typeof (Storage) === \"undefined\") {\n alert(\"Please update your browser to be able to use this application\");\n } else {\n var wallet = sessionStorage.getItem('ws_wallet');\n var data = {\n wallet : JSON.parse(wallet),\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update hints balls colors in UI | function updateHints() {
var queryResult = $document[0].getElementById("hint" + currentAttempt);
var currentHintRow = angular.element(queryResult)[0];
var children = currentHintRow.children;
for (var i = 0; i < children.length; i++) {
if (children[i].nodeType !== 8) {
angular.element(children[i]).r... | [
"function hint() {\n if (!randomColor) {\n return;\n }\n var redHint = document.getElementById('hint-red');\n var greenHint = document.getElementById('hint-green');\n var blueHint = document.getElementById('hint-blue');\n\n var rDiff = randomColor.red - red;\n var gDiff = randomColor.gre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the last 2000 messages published in the channel and broadcasts them to the channel | getOldMessages(channel) {
this.rcm.redisLrange(channel, 0, 2000)
.then(reply => {
reply.forEach(element => {
this.broadcastToSockets(channel, element);
});
})
.catch(err => {
console.log(err);
});
} | [
"async function fetchAllMessages(channel) {\n const all_messages = [];\n let last_id;\n\n while (true) {\n const options = {limit: 100}\n\n if (last_id) {\n options.before = last_id;\n }\n\n const messages = await channel.fetchMessages(options);\n all_messages.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function process the user's drawing and contacts the ncWMS server and the godiva program to produce graphs depending on the variables selected and the dates. It is used by transect.jsp | function handleDrawing(line)
{
map.addLayer(dlayer);//add drawing layer so it stays in map
var lat_lon = line.substring(11, line.length - 1);//extarct the lon_lat values of the drawing
var time = null;
try{
time = calStart.selection.get();//get the selected time in the start cale... | [
"function draw_line_graph() {\n\n\tif (!validate_input()) {\n\t\talert(\"Please enter valid inputs before testing\");\n\t\treturn;\n\t}\n\n\t// Retrieves and parses data\n\n\tvar dates = parse_dates();\n\tvar start_date = dates[\"start_date\"];\n\tvar end_date = dates[\"end_date\"];\n\tvar train_date = dates[\"trai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function that registers the given path onto ProtoFile's. | function _filePathRegistrar(protoPath) {
return function (descriptor, cb) {
if (descriptor instanceof Parser.ProtoFile) {
descriptor.path = protoPath;
return cb(null, descriptor);
}
return cb(new Error('Cannot add path to non-ProtoFile: ', descriptor));
}
} | [
"function _loadProto (path) {\n const packageDefinition = protoLoader.loadSync(\n path,\n {\n keepCase: true,\n longs: String,\n enums: String,\n defaults: true,\n oneofs: true\n }\n );\n return grpc.loadPackageDefinition(packageDefinition);\n}",
"function _loadProto(path) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the site groups | get siteGroups() {
return new SiteGroups(this);
} | [
"function getGroups() {\n return groups;\n}",
"getGroups() {\n return httpService(`${config.dbApiUrl}/groups`, 'GET');\n }",
"getGroups() {\n\t return request.get({ uri: process.env.AUTHZ_API_URL + '/groups', json: true, headers: { 'Authorization': 'Bearer ' + this.accessToken } })\n\t .then(re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an active Socket instance connected to this device, turning the device on if necessary. This is a lowlevel method that probably won't be necessary for most users. | async openSocket() {
return this._connect();
} | [
"connect() {\n if (this.socket) {\n return this.socket;\n }\n else {\n const version = net_1.isIPv6(this.options.target_host) ? 'udp6' : 'udp4';\n debug(`socket opening (${version})`);\n const socket = this.socket = dgram_1.createSocket({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a image processing task based on URI of orginal image uri: URI of orginal image, could be a blob newly created RK: rowkey of the task. If RK != null, it indicates creation from upload a file into blob. | function createTaskFromURI(uri, RK = null) {
if (uri != '') {
msg("Creating task from URI " + uri, "info");
$.ajax({
type: "post",
async: true,
url: "/createTask",
dataType: "jsonp",
jsonp: "callback",
data: {
"u... | [
"function ImageAssetTask(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the image to load\n */\n url) {\n var _this = _super.call(this, name) || this;\n _this.name = name;\n _this.url = url;\n return _this;\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether the user has lost the game, based on their position and which key they have last pressed. | function checkGameLost(){
var lost = false;
switch(keyDown) {
//Left
case 37:
//Check for out of bounds
lost = headPos.xPos <= 0;
//Check for body collisions
var i = 0;
while (i < bodyPos.length && !lost) {
if ((bodyPos[i].xPos === headPos.xPos - 1) && (bodyPos[i].yPos ... | [
"function loseCheck() {\n if (remainingAttempts === 0) {\n console.log(\"you lost and you suck at guessing.\");\n\n newGame();\n }\n }",
"function hasLost(){\n if (total_score > targetNumber){\n loss++;\n $(\".loss\").text(loss);\n $(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles deselection of an entity | onDeselect(entity) {
if (this.get('selectedDimensions').includes(entity)) {
dispatch(Actions.selectDimension(entity));
}
if (_.map(this.get('selectedEvents'), 'urn').includes(entity)) {
dispatch(Actions.selectEvent(entity));
}
if (this.get('selectedMetrics').includes(entit... | [
"deselect() {\n if (this.selectedIndex !== undefined && this._insertedItems[this.selectedIndex]) {\n this._insertedItems[this.selectedIndex].virtualElement._FBPTriggerWire(\"--itemDeSelected\");\n this.selectedIndex = undefined;\n }\n }",
"function onDeselection(object) {\n\t\tondeselection_cal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Solid when false says you can be inside of it | isSolid() {
return false;
} | [
"solid() {\n for (var i = 0; i < data.nonSolidBlocks.length; i++) {\n if (data.nonSolidBlocks[i] == this.blockID) {\n return false;\n }\n }\n return true;\n }",
"solid() {\n for (var i = 0; i < nonSolidBlocks.length; i++) {\n if (nonSo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is called by the document body onbeforeunload handler. This is a special event handler that is not like any other event handler. If a string is returned, that string, along with browser specific text, is displayed to the user along with an OK and a Cancel button. If the user clicks OK, the window is allow... | function bodyOnBeforeUnloadHandler() {
if (autoSavesActive > 0 && autoSaveMightBeStuck <= 2) {
return "Auto Backup or Save is active.\n\n * To guarantee your calendar is saved, press \"Cancel\"\n and wait 15 seconds before continuing.\n\n * To leave this page anyway, press \"OK\"";
}
if (userHasOkedLeavin... | [
"function confirmUnload(e) {\n\t\t// Prompt always shown in Mozilla Firefox\n\t\t// Prompt only show in Chrome if user interacted with the page\n\n\t\t// Cancel the default event\n\t\te.preventDefault();\n\n\t\t// Chrome requires returnValue to be set\n\t\te.returnValue = \"\";\n\t}",
"function confirmNavigationI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: ImageFlow Version: 1.3.0 (March 9 2010) Author: Finn Rudolph Support: License: ImageFlow is licensed under a Creative Commons AttributionNoncommercial 3.0 Unported License ( You are free: + to Share to copy, distribute and transmit the work + to Remix to adapt the work Under the following conditions: + Attributio... | function ImageFlow(){this.defaults={animationSpeed:50,aspectRatio:1.964,buttons:!1,captions:!0,circular:!1,imageCursor:"default",ImageFlowID:"imageflow",imageFocusM:1,imageFocusMax:4,imagePath:"",imageScaling:!0,imagesHeight:.67,imagesM:1,onClick:function(){document.location=this.url},opacity:!1,opacityArray:[10,8,6,4,... | [
"function ImageFlow(){this.defaults={animationSpeed:50,aspectRatio:1.964,buttons:!1,captions:!0,circular:!1,imageCursor:\"default\",ImageFlowID:\"imageflow\",imageFocusM:1,imageFocusMax:4,imagePath:\"\",imageScaling:!0,imagesHeight:.67,imagesM:1,onClick:function(){document.location=this.url},opacity:!1,opacityArray... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compiles the comment on the table. | comment(_comment) {
this.pushQuery(`comment on table ${this.tableName()} is '${_comment}';`);
} | [
"comment(comment) {\n this.pushQuery(`comment on table ${this.tableName()} is '${comment || ''}'`);\n }",
"enterComment_on_table(ctx) {\n\t}",
"comment(value) {\n if (typeof value !== 'string') {\n throw new TypeError('Table comment must be string');\n }\n this._single.comment = value;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
viewLeft This function returns the leftmost visible x coordinate. If the page is not scrolled horizontally, this value will be 0. Prototype: int viewLeft() Results: The x coordinate value of the leftmost visible column of pixels. | function viewLeft() {
if (self.pageXOffset)
return self.pageXOffset;
if (document.body && document.body.scrollLeft)
return document.body.scrollLeft;
return 0;
} | [
"function leftPosition() {\n\treturn typeof window.pageXOffset != 'undefined' ? window.pageXOffset\n\t\t\t: document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft\n\t\t\t\t\t: document.body.scrollLeft ? document.body.scrollLeft : 0;\n}",
"function leftPosition() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the users we want to add to the stream | getAddedUsers () {
return this.users.slice(2).map(user => user.user);
} | [
"async getUsers () {\n\t\tif (this.members) {\n\t\t\treturn;\n\t\t}\n\t\tthis.members = await this.data.users.getByIds(\n\t\t\tthis.stream.get('memberIds') || [],\n\t\t\t{\n\t\t\t\t// only need these fields\n\t\t\t\tfields: ['isRegistered', 'accessToken', 'accessTokens', 'broadcasterToken']\n\t\t\t}\n\t\t);\n\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper functions to implement Linear Regression. Our hypothesis function( h(w) or output)) | function hypothesis(x, w){
// add ones in other dimension.
let X = math.matrix([math.ones(x.length), math.flatten(x)])
// returns the javascript array instead of matrix object.
return math.evaluate('w * X', {w, X}).toArray()
} | [
"function hypothesis(X, w){\n // returns the javascript array instead of matrix object.\n wx = math.evaluate(\"X * w'\", {X, w})\n return sigmoid(wx)\n}",
"function linearRegression(y,x){\n\n var lr = {};\n var n = y.length;\n var sum_x = 0;\n var sum_y = 0;\n var sum_xy = 0;\n var sum_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Description Returns the letter case of the hexadecimal output. = Returns 1 if upporcase, 0 if lowercase. | hexCase() {
return this._hexcase;
} | [
"function isUppercaseLetter(code) {\n return code >= 0x0041 && code <= 0x005A;\n } // lowercase letter",
"function ascii_to_hex() {\r\n\tvar outResult = '';\r\n\tvar inValue = input.value;\r\n\tfor (var i = 0; i < inValue.length; i++) {\r\n\t\toutResult += inValue.charCodeAt(i).toString(16... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Looks up the fudgenode with the passed name in the array. Returns undefined if there is none | static getFudgeNode(_name) {
return this.FudgeNodes[_name];
} | [
"function ic_soa_data_getEDFFromName(edfName, dataObjects) {\n\tfor (var cur_do = 0; cur_do < dataObjects.EDFkeys.length; cur_do++) {\n\t\tif (dataObjects.EDFs[dataObjects.EDFkeys[cur_do]].name==edfName) return dataObjects.EDFs[dataObjects.EDFkeys[cur_do]];\n\t}\n\t//console.log(\"Failed to find edf named \" + edfN... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get transactions attached to the portfolio ID Endpoint: /api/portfolios/:portfolioID/transactions | function getTransactions(portfolioID) {
return $http.get('/api/portfolios/' + portfolioID + '/transactions/');
} | [
"handleTransactionsChanged(portfolio) {\n\t\tthis.getTransactions(this.props.selectedPortfolio)\n\t}",
"getTransactions(req, res, next) {\n models.Transaction.getTransactions(req.params.categoryId)\n .then((response) => {\n const transactions = budgetUtils.numberifyData(response);\n return r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the player name linked to given socket | getNameFromSocket(socket) {
return this.socketNames[socket.id];
} | [
"function getSocketName() {}",
"userName(socketid){\n\t\tvar username = this.playerList.find(function(player){return player.socketid === socketid})\n\n\t}",
"getPlayerFromSocket(socket) {\n return this.players[this.getNameFromSocket(socket)];\n }",
"function findPlayer(socket){\n\tif(socket.hasOwnPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To create a new preset, add its description to the presets array at the top of this script. Then, add a case statement below based on its 0based index in the array. If you don't want the preset to compute a standard icon corner radius, set usesStandardIconRadius to false in your case block. For example: case 13: size =... | function applyPreset(preset) {
var index = parseInt(preset);
var size = 0;
var cornerRadius = 0;
var usesStandardIconRadius = true;
switch (index) {
case 0:
size = 120;
break;
case 1:
size = 76;
break;
case 2:
... | [
"set preset(value) {}",
"loadStyle(presetName) {\r\n switch (presetName) {\r\n case \"Default\":\r\n this._style.Gray();\r\n break;\r\n case \"Gray\":\r\n this._style.Gray();\r\n break;\r\n case \"Rose\":\r\n this._style.Rose();\r\n break;\r\n case ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A standard object to store the Uvs of a texture | function TextureUvs()
{
this.x0 = 0;
this.y0 = 0;
this.x1 = 1;
this.y1 = 0;
this.x2 = 1;
this.y2 = 1;
this.x3 = 0;
this.y3 = 1;
} | [
"function TextureUvs()\n{\n this.x0 = 0;\n this.y0 = 0;\n\n this.x1 = 1;\n this.y1 = 0;\n\n this.x2 = 1;\n this.y2 = 1;\n\n this.x3 = 0;\n this.y3 = 1;\n\n this.uvsUint32 = new Uint32Array(4);\n}",
"function TextureUvs(){this.x0=0;this.y0=0;this.x1=1;this.y1=0;this.x2=1;this.y2=1;this.x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of arbitrarily nested arrays, return n, where n is the deepest level that contains a nonarray value. Examples Input Output array: [ [ 5 ], [ [ ] ] ] ==>2 array: [ 10, 20, 30, 40 ] ==>1 array: [ [ 10, 20 ], [ [ 30, [ 40 ] ] ] ] ==>4 array: [ ] ==>0 array: [ [ [ ] ] ] ==>0 | function arrayCeption(array) {
var deepest = 0 ;
function deepestLevel(array, level) {
for(var i = 0 ; i < array.length ; i++) { //i'll loop through all the array element
if(Array.isArray(array[i]) && array[i].length > 0) { //i'll check if that element is an array and it's not empty
deepestLevel(... | [
"function arrayception (array) {\n let currentDeepest = 0;\n let n = 0;\n \n function recurse(value){\n if(Array.isArray(value) && value.length > 0){\n n++;\n if(n > currentDeepest){\n currentDeepest = n;\n }\n for(var i = 0; i < value.length; i++){\n recurse(value[i])\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Launches the PaymentRequest UI that prints the shipping address received on shippingAddressChange events at the end of the transaction. | function buy() {
try {
var details = {
total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
displayItems: [
{
label: 'Pending shipping price',
amount: {currency: 'USD', value: '0.00'},
pending: true,
},
{label: 'Subtotal', amount: {cu... | [
"function show_payment_form(shipping_address_id, billing_address){\n\n var content = $(\".payment-check\").html();\n $(\".payment-check\").html(\"\");\n $('.change-body').html(content);\n $(\"#new_card\").css(\"display\",\"block\");\n $(\".snack-added\").html(\"\");\n $('.h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
makes a view text | function makeViewText(text)
{
const textSpan = makeSpan();
textSpan.attr("id", text);
textSpan.addClass("view");
setText(textSpan, text);
return textSpan;
} | [
"buildText() {\n\tthis.text += this.title + \"\\n\" + this.answerOptions[0].answer + \"\\n\" + this.answerOptions[1].answer;\n}",
"function draw_text(x, y, text)\n{\n surfaceTarget.fillText(text, x - view_xview, y - view_yview + font_size);\n}",
"setText(txt){}",
"function showViewTextAnimated(text) {\n g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
crawl last name pages and write result page URLs to sitemap | function lastNameCrawl() {
return new Promise ((resolve, reject) => {
const lastNameCrawler = new Crawler({
jQuery: false,
callback: function (error, res, done) {
if (error) {
console.log(error);
} else {
... | [
"async function traverseSitemap() {\n const sitemap = await sitemapFetch();\n const browser = await puppeteer.launch({ headless: true });\n const page = await browser.newPage();\n for (const link of sitemap) {\n console.log(link);\n // visit the page\n await page.goto(`${link}`, { waitUntil: \"networki... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a period object used by all time related data calculation functions. | function getPeriodObj() {
var now = moment(),
year = now.year(),
month = (now.month() + 1),
day = now.date(),
hour = (now.hours()),
activePeriod,
previousPeriod,
periodMax,
periodMin,
periodObj = {},
isSpecialPeriod = false,
daysInPeriod = 0,
rangeEndDay = null,
dateString,
... | [
"function getPeriodObj() {\n var now = _currMoment,\n year = now.year(),\n month = (now.month() + 1),\n day = now.date(),\n hour = (now.hours()),\n activePeriod,\n previousPeriod,\n periodMax,\n periodMin,\n pe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keeps the timer id, so we can kill it. Kills the timer (if it is running) | function stopTimer() {
if (timerId != 0) {
clearInterval (timerId);
timerId = 0;
}
} | [
"clearTimerID(timerID){\n clearInterval(timerID);\n }",
"function reset_timer() {\n idletime = 0;\n }",
"_destroyTimer(timer) {\n if(timer) {\n clearInterval(timer);\n }\n }",
"function clearTimer() {\n if(timerID) {\n clearInterval(timerID);\n timerID = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find all 1 unit squares along a tunnel's edge (useful for door placement) | _findSquares(tunnelDirection) {
let x, y
const result = []
if (tunnelDirection === 'NORTH') {
for (({ x } = this), end = (this.x+this.tunnelWidth)-1, asc = this.x <= end; asc ? x <= end : x >= end; asc ? x++ : x--) {
var asc, end
result.push({ x, y: this.y-1, width: 1, height: 1 }) }
... | [
"function getNeighbours() {\n\t//const edgeSqu\n const edgeSquares = grid.filter(e => e.x === 0 || e.y === 0 || e.x === sideLength -1 || e.y === sideLength - 1)\n for (const square of grid) { \n square.neighbours = grid.filter(e => {\n \tif (e !== square) return (Math.abs(square.x - e.x) <= 1 && Math.abs(sq... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
try to find the correct ace language mode | function find_mode(language) {
var modelist = M.qtype_coderunner.modelist,
candidates = []; // List of candidate modes
if (language.toLowerCase() === 'octave') {
language = 'matlab';
} else if (language.toLowerCase() === 'nodejs') {
language = 'javascript';
... | [
"function check_ace_lang() {\n if (uiplugin.val() === 'ace'){\n setUis();\n }\n }",
"setLanguage(e){\n const pane = document.getElementById(`editor-${this.state.selected}`);\n ace.edit(pane).getSession().setMode({path: `ace/mode/${e.target.id}`, v: Date.now()});\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the PPG for a round | function getRoundPPG(games) {
var totalPoints = 0;
var totalTeams = 0;
for (var i = 0; i < games.length; i++) {
var currentGame = games[i];
if (currentGame.team1) {
totalPoints += currentGame.team1.score;
totalTeams++;
}
if (currentGame.team2) {
... | [
"function getRoundNo(){\n return roundNo;\n }",
"function round(p) {\r\n return Math.max(0, Math.min(p, 1));\r\n}",
"getRound() {\n return this.currentRound;\n }",
"getPp() {\n return this.pp;\n }",
"get round() {\n let currentRound = this.rounds.at(-1);\n if (currentRound.isFinishe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
body > Only One Orion Context Entity (NGSI v1) > An element of contextResponses Array return > Only One Orion Context Entity (NGSILD) | function fromNGSIv1toNGSILD(body,ldContext){
/*
var bodyContextResponses = body.contextResponses
var bodyContextResponsesLength = bodyContextResponses.length
var contextElement
var entities={};
var attributes
*/
var contextElement = body.contextElement
var entities={};
var attributes={};
va... | [
"function getIntentsAndEntities(response) {\n\t//var getIntentsAndEntities = function (response) {\n\tconsole.log(\"::: Response from LUIS ::: \", JSON.stringify(response));\n\t\n\tLUISReply.topScoringIntent = response.topScoringIntent.intent; \n\n\tfor (var i = 1; i <= response.entities.length; i++) {\n\t\tLUISRep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initGlobals() Purpose: initializes the global tree variables according to boxSize so they can be used to create and place other objects within the hidden world Parameters: boxSize (number): the size of the hidden world | function initGlobals (boxSize) {
hwTreeHeight = 0.85*boxSize;
hwTreeRadius = 0.03*boxSize;
hwTree = makeHWTree(hwTreeHeight, hwTreeRadius, "forest_bark", "forest_bark", "leaf_fern_light");
} | [
"function initBoxes() {\n calcGrid();\n setBoxColors();\n createBoxes();\n}",
"function initGlobals() {\n // Data related variables\n data = []\n flad = null\n fuda = []\n allvals = {}\n aggval = {}\n derailval = {}\n \n gol = {}\n gol.siru = null\n oresets = []\n derails = []\n hashhash = {}\n \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a "cursorStr" into id params: id = cursorStr parent Id ms = Milliseconds the cursor wil blink. If cursorMs is not an integer it will blink indefinitely. | function addCursor(id, ms){
var dom = document.getElementById(id);
if (dom==null){ console.log('noid'); return false; }
dom.innerHTML += cursorStr;
cursorBlink(id, ms);
return true;
} | [
"function cursorBlink(id, ms){\r\n cur = getLastCursor(id);\r\n if (cur){\r\n if (cur.id.length==0){\r\n cur.id = generateCurId();\r\n }\r\n var tmo = (isNaN(parseInt(ms)))? false : parseInt(ms);\r\n var vis = cur.style.display;\r\n var c = setInterval(function(){\r\n vis = (vis=='')? 'hi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait a number of blocks using evm_mine and evm_increaseTime | wait(seconds = 20, blocks = 1) {
return new Promise(resolve => {
return this.web3.eth.getBlock("latest", (e, {number}) => {
resolve(blocks + number)
})
}).then(targetBlock => {
return this.waitUntilBlock(seconds, targetBlock)
})
} | [
"function advanceBlock () {\n ethers.provider.send(\"evm_increaseTime\", [13]) // add 13 seconds\n ethers.provider.send(\"evm_mine\", []) // mine the next block\n}",
"async function advanceBlocks (blocks) {\n const currentBlock = (await ethers.provider.getBlockNumber());\n const start = Date.no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the getDetails function is called, it will inject the content.js content script into the DOM of the active Chrome tab and execute that Javascript. It then sets up a listener to listen for the 'onMessage' event that will be triggered by content.js This function is called on doc.ready from popup.js. The callback pas... | function getPageDetails(callback) {
// Inject the content.js script (a content script to get current selection) into the current page
chrome.tabs.executeScript(null, { file: 'content.js' });
// Perform the callback when a message is received from the content script
chrome.runtime.onMessage.addListener(f... | [
"function getLectureInfo(tab, callback) {\n console.log(\"Get lecture info\");\n var port = chrome.tabs.connect(tab.id);\n port.postMessage({\n method: \"get_lecture_info\"\n });\n console.log(\"Sending request on lecture info to content script\");\n port.onMessage.addListener(callback);\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A cmp function for determining which forward segment to rely on more when computing coordinates. | function compareForwardSlotSegs(seg1, seg2) {
// put higher-pressure first
return seg2.forwardPressure - seg1.forwardPressure ||
// put segments that are closer to initial edge first (and favor ones with no coords yet)
(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||
... | [
"function compareForwardSlotSegs(seg1, seg2) {\n // put higher-pressure first\n return seg2.forwardPressure - seg1.forwardPressure ||\n // put segments that are closer to initial edge first (and favor ones with no coords yet)\n (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n // do no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
have to filter by genre outside of database call b/c elemMatch is not in free tier of Atlas takes the genre query params and returns just the movies that are one of those genres | function filterByGenre(movies, genres){
return movies.filter(function(movie){
for (let i = 0; i < genres.length; i++){
if (movie.genres.includes(genres[i])) return true;
}
});
} | [
"function genreMatch(genre) {\n const g = data\n .filter(function (el) {\n return el.genre_main === genre;\n })\n .map(function (elt) {\n return elt.movie;\n });\n\n return g;\n } // genreMatch()",
"getMoviesOfGenre(gen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute the camping step job | function executeCampingStep(request){
//var AMOUNT_BUFFERED_ACCOUNTS = 2;
var amountAccount = 0;
var aux, logs;
switch(request.stepId){
case "fillIPOnInternetPage":
if (getSomeElement("a", "href", "?view=logout", 0) == null){
setNextStep(request, "goToServerTab");
getSomeElement("input", "class", "bro... | [
"run() {\n const ScrapingJob = db.getModelClass('scraping_job');\n ScrapingJob.findJobsToRun().then((scrapingJobs) => {\n scrapingJobs.forEach((job) => this._runSingleJob(job));\n }).catch((err) => {\n logger.logError(err);\n });\n }",
"function plues_job() {\n \n}",
"function doStep()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a LaunchRequest request | launch() {
this.requestType(RequestType.LAUNCH_REQUEST);
return this;
} | [
"function CreateRequest(config){\n return new Request(config);\n }",
"function ModifyLaunchTemplateRequest() {\n _classCallCheck(this, ModifyLaunchTemplateRequest);\n\n ModifyLaunchTemplateRequest.initialize(this);\n }",
"function LaunchTemplatePlacementRequest() {\n _classCallCheck(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert mode to api endpoint | function modeToEndpoint (mode) {
return mode=="startup"?"/api/startup":"/api/signup";
} | [
"function getAPIUrl (mode, year) {\n switch (mode) {\n case Constants.MODE_DECEMBER_2015:\n return \"/api/2015-12-19/2015-12-26\";\n case Constants.MODE_SELECTED_YEAR:\n return `/api/${year}`;\n default:\n return \"/api/ping\";\n }\n}",
"formatEndpoint(str)\n {\n var url;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
detects if ball fell in hole, returns index of ball in allHoles else 1 | function ballFall(){
var radius = 0.64;
for(var i = 0; i < holePositions.length; i++){
if(Math.sqrt(Math.pow(Math.abs(ballMesh.position.z - holePositions[i][0]),2)+
Math.pow(Math.abs(ballMesh.position.x - holePositions[i][1]),2)) < radius){
... | [
"function findHole(holes) {\n const randomHole = Math.floor(Math.random() * holes.length); // Picks a random hole between 0 - 8\n const hole = holes[randomHole]; // assigns chosen hole\n if (hole === sameHole) {\n return findHole(holes); // If the same hole is selected twice in a row the function will... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a tree from an array of lines. | function treeFromLines(lines: string[]): tree.Node {
const data: Array<[string, number]> = [];
for (const line of lines) {
let [sizeStr, path] = line.split(/\s+/);
path = path || '';
const size = Number(sizeStr);
data.push([path, size]);
}
let node = tree.treeify(data);
// If there's a common... | [
"static fromArray(array) {\r\n let tree = new Tree();\r\n for (let i = 0; i < array.length; i++) {\r\n tree.add(new Node(array[i]))\r\n }\r\n return tree;\r\n }",
"function buildTree(root, lines, syntax) {\n root.children = lines.filter(function(line, i) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to make sure unapplied does not have any old migrations (older than the last db migration). | function ageCheck(cb) {
//console.log('ageCheck');
if(db_migs.length) {
unapplied.sort();
db_migs.sort().reverse();
if(unapplied[0] < db_migs[0]) {
cb(new Error('One of the migrations is older than the last applied migration that is in the database. Migrations must be applied in order.'));
} else {... | [
"function downCheck(cb) {\n\t\t//console.log('downCheck');\n\t\tif(file_migs.length) {\n\t\t\tdb_migs.sort().reverse();\n\n\t\t\tif(file_migs.indexOf(db_migs[0]) != -1) {\n\t\t\t\tunapplied.push(db_migs[0]);\n\t\t\t\tcb();\n\t\t\t} else {\n\t\t\t\tcb(new Error('The last applied migration does not have an associated... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que actualiza la variable con el numero de movimiento restantess | function actualizarCantidadMovimientos() {
limiteMovimientos -= 1;
} | [
"ponerNumero(numero){\r\n if(this.num1 == 0 && this.num1 !== '0.')\r\n this.num1 = numero;\r\n else\r\n this.num1+= numero;\r\n this.actualizarValor();\r\n }",
"function actualizarTrabajo(){\n cantMovimientos++;\n if(cantMovimientos >= actualizaMovimientos){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return days to next birthday | function numberOfDays(){
var milliseconds;
milliseconds = nextBirthday.getTime() - today.getTime();
var minutes = 1000 * 60;
var hours = minutes * 60;
var days = hours * 24;
var daysToReturn = milliseconds / days;
daysToReturn = Math.ceil(daysToReturn);
... | [
"function CalculateNextBirthday(birthDate, calendar, reference)\r\n {\r\n var birthDateDate = new Date(birthDate);\r\n\r\n if (reference === undefined)\r\n {\r\n reference = new Date(Date.now());\r\n }\r\n \r\n var birthdayThisYear = new Date(reference.getFull... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a Basic program into a binary with the initial 0xFF header. | function parseBasicText(text) {
// Split into lines. Only trim the start, spaces at the end should be kept.
const lines = text.split(/[\n\r]+/)
.map((line) => line.trimStart())
.filter((line) => line !== "");
const binaryParts = [];
binaryParts.push(new Uint8Array([exports.BASIC_HEADER_B... | [
"function decodeBasicProgram(binary) {\n const b = new teamten_ts_utils_dist[\"ByteReader\"](binary);\n let state;\n let preStringState = ParserState.NORMAL;\n let error;\n const annotations = [];\n // Map from byte address to BasicElement for that byte.\n const elements = [];\n const firstB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the execution info, return a list of nodes in topological order that need to be executed to compute the output. | function getNodesInTopologicalOrder(graph, weightMap, executionInfo) {
var usedNodes = executionInfo.usedNodes, inputs = executionInfo.inputs;
var frontier = [];
var inputNodes = Object.keys(inputs).map(function (name) { return graph.nodes[name]; });
inputNodes.forEach(function (input) {
if (use... | [
"function getNodesInTopologicalOrder(graph, weightMap, executionInfo) {\n const { usedNodes, inputs } = executionInfo;\n const frontier = [];\n const inputNodes = Object.keys(inputs)\n .map(name => Object(_operations_executors_utils__WEBPACK_IMPORTED_MODULE_0__[\"parseNodeName\"])(name)[0])\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
utility function for translating an columnID and startingtime to a pixel position the convention is that the run in the upper left corner is at position columnID,dayBegin //the run in the upper right, at last columnID,0 | function getPixels(columnID,startingTimeHours,startingTimeMinutes) {
var left = '0px';
var actualSlotWidth = $('.slot').width();
for (var p=0;p<columnNames.length;p++) {
if (columnID === columnNames[p]) {
left = (p*(actualSlotWidth+border))+'px';
}
}
var startingTime = (startingTimeHours*60+startingTimeMin... | [
"function get_month_coord_week_on_row_day_on_col(year,month,start_of_week)\n{\n return get_month_coord(year,month,start_of_week,\"week_on_row_day_on_col\");\n}",
"positionInCalendar(number) {\n return {\n row: Math.trunc(number/7),\n col: number%7\n };\n }",
"getStart( column ) {\n\t\tlet star... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a route string to a regular expression which is then used to match a uri against it and determine whether that uri matches the described route as well as parse and retrieve its tokens | function routeStringToRegExp(routeString) {
routeString = routeString
.replace(escapeRegex, "\\$&")
.replace(optionalParamRegex, "(?:$1)?")
.replace(namedParamRegex, function(match, optional) {
return optional ? match : "([^\/]+)";
})
.replace(splatParamRegex, "(.*?)");
return new RegExp(... | [
"function routeToRegExp(route) {\n route = route.replace(escapeRegExp, '\\\\$&')\n .replace(optionalParam, '(?:$1)?')\n .replace(namedParam, function(match, optional) {\n return optional ? match : '([^/?]+)';\n })\n .replace(splatParam, '([^?]*?)');\n return new RegExp('^' + route + '(?:\\\\?... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the results that come back from the system when the list query is run. Some items will not come back because of visibility rules, and if they have been overridden in such a way that means they should be visible, the item needs to be fetched individually. | function processResults (results, items, cb) {
if (!items) return cb(null, results)
var resultIds = results.map(function (item) { return item._id })
async.mapSeries(items, function (item, cb) {
if (item.isCustom) return cb(null)
// if an overridden item, need to check if its live and if so,... | [
"resultsHandler(response) {\n const upvotedItemsList = JSON.parse(localStorage.getItem('upvotedItemsList'));\n const hiddenItemList = JSON.parse(localStorage.getItem('hiddenItemsList'));\n\n const items = response.hits.map((item) => {\n const itemData = item;\n itemData.isHidden = false;\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filters raw database output in form of a measurement entry to be returned by the API. | function filterMeasurementFields(doc) {
return {
'_id': doc._id,
'date_added': doc.date_added,
'name': doc.name,
'value': doc.value,
'step': doc.step,
'epoch': doc.epoch
};
} | [
"function _filterData(body)\n{\n var obj = JSON.parse(body);\n var filtered = new Array();\n if (!obj.data) return filtered;\n var devdata = obj.data.devices;\n\n // DEBUG Dump\n //logger.debug(body);\n logger.debug(obj.data);\n for (i in devdata) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write to console player and team | function getPlayers(player, team) {
console.log(player + ": " + team);
} | [
"function printPlayers(){\n\t\t\tconsole.log(players);\n\t\t}",
"function consolePlayerLable(){\r\n console.log(\"******************************************\");\r\n console.log(\" (Player's turn) Move: \" + moveNumber);\r\n console.log(\"------------------------------------------\");\r\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all children from element of given ID and then places a loading gif image | function loadingIMG(id) {
var prompt = document.getElementById(id);
if (prompt) {
while(prompt.firstChild) {
prompt.removeChild(prompt.firstChild);
}
loading = document.createElement("IMG");
loading.src = "images/ajax-loader.gif";
prompt.appendChild(loading);
}
else {
console.log("loading passed b... | [
"function removeGifs() {\n $('#gif-results').children().remove();\n}",
"function contentClear() {\n $(\"#contents\").empty();\n\n var loaderGif = $('<img>');\n loaderGif.attr(\"src\", \"ajax-loader.gif\");\n loaderGif.attr(\"class\", \"middle\");\n loaderGif.appendTo(\"#contents\");\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a dir id from a dir path. It makes sure the dir path ends with a slash '/' | function getIdFromDirPath(dirPath) {
//make sure the dir path ends with a slash
dirPath = addEndingPathSeparator(dirPath);
return pathToIdMap[dirPath];
} | [
"function get_dir_id(id_str) {\n if (id_str.indexOf(ID_PREFIX + ID_SEP) === 0) {\n id_str = id_str.substring(ID_PREFIX.length + ID_SEP.length);\n }\n return id_str;\n }",
"function makeId(path) { return ('/' + path.join('/')); }",
"function idFromPath(path) {\n\treturn menuId + path.replace( /(\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns score result from radio buttons | function getResult() {
var score = (parseInt(getCheckedRadio('op1'))
+ parseInt(getCheckedRadio('op2'))
+ parseInt(getCheckedRadio('op3'))
+ parseInt(getCheckedRadio('op4')));
return score;
} | [
"function getScore(score) {\n $(\".submit\").on(\"click\", function(){\n //see what was selected \n $( \"input[type=radio]:checked\" ).val();\n //if something was selected, add one to answered questions \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a string of commaseparated directions Find shortest distance to end Grid is hexagonal (n,ne,se,s,sw,nw) | function hexPath(dir) {
var directions = dir.split(",");
//Each variable refers to the number of steps taken in that direction
var n = directions.filter(a => a == 'n').length;
var ne = directions.filter(a => a == 'ne').length;
var se = directions.filter(a => a == 'se').length;
var s = directions.filter(a => a ==... | [
"function findCoordinates(str) {\n const text = clean(str);\n let res = [];\n if (text.length >= 15) {\n // ex: 402500N 075000W (15)\n for (let index = 0; index < text.length - 15; index++) {\n if ((text[index + 6] == 'N' || text[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get empires with display name like limit by n | searchEmpiresLike(displayName, n=5) {
return client({
method: 'GET',
path: EMPIRE_SEARCH_ROOT+"findEmpiresByDisplayNameLike",
params: {
displayName: `%${displayName}%`,
page: 0,
size: n
}
})
} | [
"getTopEmpires(n){\n return client({\n method: 'GET',\n path: EMPIRE_SEARCH_ROOT+\"getAllByOrderByEloDesc\",\n params: {\n page: 0,\n size: n\n }\n })\n }",
"findNames(n) {\n return fetch(\"https://pokeapi.co/api/v2/po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function makes a RESTful call to the pearson dictionary and get the definition of the input word | function getDefinition(word){
longestWordString = "";
var xhttp = new XMLHttpRequest();
var url = "http://api.pearson.com/v2/dictionaries/lasde/entries?headword=" + word.toLowerCase();
console.log(url);
xhttp.onreadystatechange=function(){
if(xhttp.readyState == 4 && xhttp.status == 200){
... | [
"function getPearsonDefinition($word) {\n\tvar $baseURL = 'http://api.pearson.com/v2/dictionaries/entries?headword=';\n\tvar $searchURL = $baseURL + $word;\n\tvar $result = \"definition not found\";\n\t$.getJSON($searchURL, function(data) {\n\t\tif (data.results[0].senses[0].definition !== undefined) {\n\t\t\t//ale... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CENTER DISPLAY This function places the specified element in the center of the window | function CenterDisplay(tid)
{
try
{
document.getElementById(tid).style.position = 'absolute';
//Remember the old display style of the element
var strdisp = document.getElementById(tid).style.display;
//Make the element visisble. If the element is not visible, offsetHeight and wid... | [
"function $Center(elem)\n{\n\telem = $O(elem);\n\n\tvar elemDimensions = size(elem);\n\tvar elemWidth = parseInt(elemDimensions.width) || parseInt(getStyleValue(elem, 'width')); \n\tvar elemHeight = parseInt(elemDimensions.height) || parseInt(getStyleValue(elem, 'height'));\n\tvar bDimensions = Browser... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to swap to queue items | function swapQueueItems(msg, args) {
let arg1 = args.split(" ")[0], arg2 = args.split(" ")[1];
if(isNaN(arg1) || isNaN(arg2))
throw "Invalid position.";
if(arg1 == arg2)
throw "Invalid positions.";
let pos1 = Number(arg1);
let pos2 = Number(arg2);
if(pos1 % 1 != 0 || pos2 % 1 != 0)
throw "Invali... | [
"swapVideosInQueue(index1, index2){\n let temp = this.videoQueue[index1];\n this.videoQueue[index1] = this.videoQueue[index2];\n this.videoQueue[index2] = temp;\n }",
"queueReverse(){}",
"swapTopTwo() {\n let temp = this.items[this.size() - 1];\n this.items[this.size() - 1]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate Blob Url IE10 not supported | function _getBlobUrl(url) {
return window.URL.createObjectURL(new Blob([url]));
} | [
"getBlobUrl() {\n\t\treturn window.URL.createObjectURL(this.outputBlob);\n\t}",
"function dataUrlComp(blob){\n\treturn window.URL.createObjectURL(data);\n}",
"function dataToBlobURL (url) {\n var parts = url.split(\",\", 2);\n var mime = parts[0].substr(5).split(\";\")[0];\n var blob = base64toBlob(par... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculateCalendarMonthView : prepare data for the view | function calculateCalendarMonthView(calendarDateObject, events) {
var cdo = calendarDateObject;
if (calculateCalendarMonthView.view[cdo.titleMY]) return calculateCalendarMonthView.view[cdo.titleMY];
/* caching optimisation check */
console.warn('calculateCalendarMonth');
... | [
"get monthView() {\n const view = RenderView.MONTH;\n const currentYear = toDateSegment(this.view).year;\n const columnCount = MONTH_VIEW.columnCount;\n const monthCount = 12;\n const totalCount = MONTH_VIEW.totalCount;\n const monthsNames = this.monthsNames;\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the mesh, which includes reticle and/or ray. This mesh is then added to the scene. | getReticleRayMesh() {
return this.root;
} | [
"getMesh() {\n return this.mesh;\n }",
"mesh() {\n return this._mesh;\n }",
"get mesh() {\n if (this.internalMesh === undefined) {\n this.resize();\n }\n return this.internalMesh;\n }",
"getMesh(model) {\n let mesh;\n // Look for a Skinned Mesh\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If bytes constitute a valid PPM image, then return an object giving its width, height, maxColors image parameters. Additionally, it will also contain a pixelsIndex property giving the start of the image pixel data in bytes. If bytes does not constitute a valid PPM image, return undefined. | function ppmFormat(bytes) {
const bufIndex = new BufIndex(bytes);
const c0 = bufIndex.nextChar(), c1 = bufIndex.nextChar();
if (c0 !== PPM_FORMAT[0] && c1 !== PPM_FORMAT[1]) return undefined;
const width = bufIndex.nextInt();
const height = bufIndex.nextInt();
const maxColors = bufIndex.nextInt();
const p... | [
"function ppmFormat(bytes) {\n const bufIndex = new BufIndex(bytes);\n const c0 = bufIndex.nextChar(), c1 = bufIndex.nextChar();\n if (c0 !== PPM_FORMAT[0] && c1 !== PPM_FORMAT[1]) return undefined;\n const width = bufIndex.nextInt();\n const height = bufIndex.nextInt();\n const maxNColors = bufIndex.nextInt(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers the upstream servers | registerUpstream (name, upstream) {
if (typeof name === 'object') {
return Object.keys(name).map((k) => {
this.registerUpstream(k, name[k]);
});
}
// Require name and upstream to add
if (!name) {
throw new TypeError('upstream name cannot be undefined');
}
if (!upstream) {
throw new TypeErro... | [
"function initVhosts() {\n self.vhosts = Vhosts(opts.nginx, function running(isRunning) {\n if (!isRunning) {\n self.vhosts.nginx.start(function(err) {\n if (!err) return\n debug('Host.setup nginx start error ' + err)\n cb(err)\n })\n debug('Ho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends the FAQs fetched onto the FAQ view. | function appendFaq(response) {
let faq = response;
for (let i = 0; i < faq.length; i++) {
let question = faq[i].question;
let answer = faq[i].answer;
let q = gen("h3");
let a = gen("p");
q.textContent = question;
a.textContent = answer;
id("faq-list").appendChild(q);
... | [
"function populateFaq() {\n let url = URL + \"faq\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(appendFaq)\n .catch(handleRequestError);\n }",
"function fetchFAQ() {\n switchToView(\"faq\");\n if (!id(\"faq-list\").hasChildNodes()) {\n fetc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================== Function to call a handler on a dependency. | function callHandler(handler, dependency, value, id, promise) {
try {
var result = handler.call(dependency, value, id);
if (promise) {
promise.resolve(result);
}
}
catch (e) {
console.warn(e);
... | [
"handle() {\n this.handlers.forEach(func => func.call(this));\n }",
"function invokeHandler(handler, msg) {\r\n\t try {\r\n\t handler.processMessage(msg);\r\n\t }\r\n\t catch (err) {\r\n\t console.error(err);\r\n\t }\r\n\t }",
"function useCallHandler(obj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unhighlight tab after mouse leaves | function unhighlightHover(id) {
var clickedTab = document.getElementById(id);
clickedTab.setAttribute("class", "");
} | [
"function unhighlightMouseoutElement(event) {\n highlight_1.Highlight.clearHighlight(window.helenaContent.highlightedElement);\n }",
"handleMouseOut(event) {\n if (Control.active == null) {\n event.target.classList.remove('highlight');\n }\n }",
"unhighlight () {\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disassemble system coprocessor instruction. Return nonzero if instruction is not defined. | function disas_cp_insn(/* CPUARMState * */env, /* DisasContext * */ s, /* uint32_t */ insn)
{
var /* uint32_t */ rd = (insn >> 12) & 0xf;
var /* uint32_t */ cp = (insn >> 8) & 0xf;
if ((s.user)) {
return 1;
}
if (insn & (1 << 20)) {
if (!env.cp[cp].cp_read)
return 1;
... | [
"function coprocessor(input) {\n\t//Set all processors to 0\n\tvar processors = {a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, g: 0, h: 0};\n\tvar timesMulCalled = 0;\n\tfor (var i = 0; i < input.length; i++) {\n\t\tvar instr = input[i].split(\" \");\n\t\tvar opValue = isNaN(instr[2]) ? processors[instr[2]] : Number(instr[2]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks player's potion count returns array of potion counts | function checkPotionCounts(player) {
let potionCountArray = [];
potionCountArray.push(player.items.potionCount);
potionCountArray.push(player.items.bigPotionCount);
return potionCountArray;
} | [
"getOpponentCount(){\n return this.getOpponents()\n .filter( o => o.isAlive() )\n .length;\n }",
"alivePlayerCount()\n {\n const {numberOfLivesAndMistakes} = this.state\n let result = 0\n for(let k = 0; k < numberOfLivesAndMistakes.length; k++)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end connection pool fetching the data from the sql server | function fetchData(callback, sqlQuery) {
console.log("\nSQL Query::" + sqlQuery);
var connection = getConnectionFromPool();
connection.query(sqlQuery, function (err, rows, fields) {
if (err) {
console.log("ERROR: " + err.message);
pool.push(connection);
}
els... | [
"get_all_patient_info() {\n return this.pool.getConnection().then(connection => {\n var res = connection.query(patient_sql.get_all_patient_info_sql);\n connection.release();\n return res;\n });\n\n }",
"function releaseReturn() {\n\n if ( cn ) {\n\n odb.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end getTokens function / Return a count of the number of tokens in the material. Return int number of tokens in material. | function count_Tokens()
{
return this.tokens.length;
} | [
"function countStoredTokens() {\n const count = get(STORAGE_KEY_COUNT);\n if (count == null) {\n return 0;\n }\n\n // We change the png file to show if tokens are stored or not\n const countInt = JSON.parse(count);\n updateIcon(countInt);\n return countInt;\n}",
"get_tokens() {\n le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Include fields based on the beneficiary groups selected. Used to conditionally render fields for age, gender etc. | function includeIfBeneficiaryType(type, fields) {
const groupChoices = get('beneficiariesGroups')(data) || [];
return groupChoices.includes(type) ? fields : [];
} | [
"function updateFields()\n {\n for(var type in formGroups)\n formGroups[type].hide();\n formGroups[$typeSelect[0].value].show();\n\n }",
"static generateGroups(fields: Object[], formData: Object, disabled: boolean, onChange: Function, canEdit: boolean) {\n\n\n // API sometime... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set an object as primitive to be ignored traversing children in clone or merge | function setAsPrimitive(obj) {
obj[primitiveKey] = true;
} | [
"function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }",
"function setAsPrimitive(obj) {\n\t obj[primitiveKey] = true;\n\t }",
"function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n }",
"function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called on inbound weather broadcast from weather controller | receiveWeatherBroadcast(data) {
this.controllerData = data
} | [
"onInsideGoodWeather() {\n throw new NotImplementedException();\n }",
"broadcastSensorHistory() {\n debugSensorBroadcast('Broadcasting sensorData', {'payload': this});\n sendMessage('sensorData', {'payload': this});\n }",
"function broadcastConnectionEvent() {\n\t\t\t\t$rootScope.$broadcast.apply($ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new theoritical bounding box used for collision detection | createTheoriticalBoundingBox(x, y) {
var temp = new BoundingBox(x, y, this.width, this.height)
temp.entity = this.entity;
return temp;
} | [
"async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the electric field caused by a charge in a position (x, y). | function calculateField(from, to, charge) {
var dx = (to.x - from.x) * p$.CM_TO_M;
var dy = (to.y - from.y) * p$.CM_TO_M;
var r_sq = dx * dx + dy * dy;
var r_mag = Math.sqrt(r_sq);
var e = Math.floor(p$.K * charge / r_sq);
return {
x: Math.floor(e * dx / r_mag),
y: Math.floor(e * dy / r_mag),
};
} | [
"function calculationElectricField( d, q ) {\n\t\tvar d_inMeters = d * onePxInMeters;\n\t\tvar e = ( K * q ) / Math.pow(d_inMeters, 2);\n\t\tvar f = e * testChargeQ;\n\t\tvar magnitudeOfForce = (f * oneNInPx);\t\t\n\t\tvar fInExp = f.toExponential();\n\t\tvar mantissa = fInExp.split('e')[0];\n\t\tvar exponent = fIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keep in mind that your task is to help Bob solve a real IQ test, which means indexes of the elements start from 1 (not 0) Examples : iqTest("2 4 7 8 10") => 3 // Third number is odd, while the rest of the numbers are even iqTest("1 2 1 1") => 2 // Second number is even, while the rest of the numbers are odd | function iqTest(numbers){
let oddValueFound = 0;
let oddValueIndex = 0;
let evenValueFound = 0;
let evenValueIndex = 0;
//place a space at the beginning of the string
numbers = numbers.split(' ');
//loop through the array to looking for odd / even values
for(var i = 0; i<numbers.... | [
"function iqTest(numbers) {\n let numberArray = numbers.split(\" \");\n let numberOfOdd = 0;\n let numberOfEven = 0;\n\n // Loop through the numbers\n for (let i = 0; i < numberArray.length; i++) {\n // If it's an even number, add it to numberOfEven\n if (numberArray[i] % 2 === 0) {\n numberOfEven +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resolveWithRemote Resolves a local object with remote data Updates the ID Updates any schema items | function resolveWithRemote(data) {
//remote data must have ID or we're just going to cause a mess
if (typeof data[this.getPrimaryKey()] === 'undefined') {
throw('Error: Model - Cannot resolveWithRemote if passed data has no id');
}
this.setData(data);
} | [
"async updatePartialData(id, partialObjectData, repoName) {\n return new Promise(resolve => {\n const repo = this.connection.manager.getRepository(repoName);\n repo.findByIds([id])\n .then(res => {\n if (res.length <= 0) {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear the input box after the solution is revealed | function clearInput() {
var box = document.getElementById('userSolve');
box.value = '';
} | [
"function clearHints () {\n hintOne.textContent = ''\n hintTwo.textContent = ''\n hintThree.textContent = ''\n hintFour.textContent = ''\n hintFive.textContent = ''\n restartBtn.classList.add('hidden')\n form.solve.value = ''\n}",
"function clear() {\n currentEquation = []\n currentEntry.value = \"\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Responds to a REMOVED_FROM_SPACE event in Hangouts Chat. | function onRemoveFromSpace(event) {
console.info(event);
console.info("Bot removed from ", event.space.name);
} | [
"onMessagesRemoved() {}",
"function deleted_broadcasted(data) {\n let message = document.getElementById(data);\n\n // Hide message.\n message.style.animationPlayState = \"running\";\n message.addEventListener(\"animationend\", () => {\n message.remove();\n });\n}",
"function cleanMessagePosition(){\n\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete all info for cellId from this spreadsheet. Return an object mapping the id's of all dependent cells to their updated values. | async delete(cellId) {
cellId = cellId.toLowerCase();
this._undos = {};
const results = {};
if (this._cells[cellId]) {
const dependents = this._cells[cellId].dependents;
this._updateCell(cellId, cell => delete this._cells[cell.id]);;
for (const dependent of dependents) {
const f... | [
"async delete(cellId) {\n let results = this.memSpreadsheet.delete(cellId);\n try { \n var bulk = this.colName.initializeUnorderedBulkOp();\n await bulk.find({id: cellId}).removeOne();\n for( let key in results) {\n await bulk.find( { id: key} ).upsert()\n .update... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get contents from github | function gh_contents(page) {
let p = page || this.page;
let o = gh_opts(p);
var user = o.user;
var name = o.repo;
var path = o.path || 'README.md';
var ref = o.ref || 'master';
if (name === undefined) {
return '';
}
var prefix = ['https://github.com', user];
if (name) {
prefi... | [
"function getGitHubData() {\n // \"https://api.github.com/users/Jurecki07\"\n // fetch or axios request using this url\n // populate them html with the correct data from github\n \n}",
"getContents(owner, repo, path, ref) {\n path = ref ? (path + \"/\" + ref) : path;\n return this.contentReques... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Match first occurrence of the item in an array | function isFirstOccurrence(value, i, array) {
return (array.indexOf(value) === i);
} | [
"function firstTrue(array) {\n for (var element of array) {\n if (args[1](element)){\n return element;\n }\n }\n return undefined;\n }",
"function anyElementMatches(array, item) {\n var i = array.length;\n while (i > 0) {\n i -= 1;\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A helper function to be called before form submit and it'll ensure character limit in all textarea and textfields on form Arguments: No arguments required Sample Call: SP_ValidateTextFields() | function SP_ValidateTextFields() {
var pageList = new String(mcEditablePages).split(','),
txtVal = '';
if (SP_Trim(pageList) !== '') {
for (var i = 0, l = pageList.length; i < l; ++i) {
var pageId = +SP_Trim(pageList[i]) + 1;
if (pageId > 2) {
if (pageId < 10) {
pageId = 'mcPage_00' + pageId;
... | [
"function validate_details(txtfield, fieldtxt, maxchars, empty)\r\n{\r\n\tif ( empty && (!validate_notempty(txtfield, fieldtxt)) )\t//if specified, check if empty.\r\n\t\treturn false;\r\n\tif (txtfield.value.length > maxchars)\r\n\t{\r\n\t \talert(\"<\"+fieldtxt+\">: This field can not exceed \" + maxchars + \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieving data about review (DOM reference, index, all current reviews) | function getReviewData(e) {
let $currentReviews = $('.review'),
index = (arguments.length === 0 || e.type === 'click') ? $(this).closest('.review').index() : e,
$thisReview = $currentReviews.eq(index);
return {$currentReviews, $thisReview, index};
} | [
"function getReviews() {\n\t\tvar query = new Parse.Query(Review);\n\t\tquery.find({\n\t\t\tsuccess:function(results) {\n\t\t\t\tbuildReviews(results);\n\t\t\t}\n\t\t});\n\t}",
"getAllReviews () {\n\t\t// TODO: setup later with pagination, main code goes in this model, update client/freelancer review models to hi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler for the write() system call. path: the path to the file offset: the file offset to write to len: the number of bytes to write buf: the Buffer to read data from fh: the optional file handle originally returned by open(), or 0 if it wasn't cb: a callback of the form cb(err), where err is the Posix return code. A ... | function write(path, offset, len, buf, fh, cb) {
console.log("write(path, offset, len, buf, fh, cb)");
var err = 0; // assume success
lookup(connection, path, function (info) {
var parent = info.parent;
var beginning, blank = '', data, ending='', numBlankChars;
switch (file.type) {
case 'undefined':
... | [
"function write(path, offset, len, buf, fh, cb) {\n fs.write(fh, buf, 0, len, offset, function writeCb(err, bytesWritten, buffer) {\n if (err) \n return cb(-excToErrno(err));\n cb(bytesWritten);\n });\n}",
"function write(path, value) {\n return function (callback) {\n mkdirp(dirname(pat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize DOM, render popup | _initDOM() {
super._initDOM();
const popup = this.el;
this._urlTypeSection = popup.querySelector(`.${CLASS_URL_TYPE}`);
this._imageFileInput = popup.querySelector(`.${CLASS_IMAGE_FILE_INPUT}`);
this._altTextInput = popup.querySelector(`.${CLASS_ALT_TEXT_INPUT}`);
const fileTypeSection = popup... | [
"init_popup(parent) {\n // Div, initially hidden, pops up to show full record json\n parent.popup_el = document.getElementById('popup');\n parent.popup_close_el = document.getElementById('popup_close');\n parent.popup_fixed = false;\n }",
"_initDOM() {\n super._initDOM();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates device parameters based on the DPDB (Device Parameter Database). Initially, uses the cached DPDB values. If fetchOnline == true, then this object tries to fetch the online version of the DPDB and updates the device info if a better match is found. Calls the onDeviceParamsUpdated callback when there is an upd... | function Dpdb(fetchOnline, onDeviceParamsUpdated) {
// Start with the offline DPDB cache while we are loading the real one.
this.dpdb = DPDB_CACHE;
// Calculate device params based on the offline version of the DPDB.
this.recalculateDeviceParams_();
// XHR to fetch online DPDB file, if requested.
if (fetc... | [
"function Dpdb(fetchOnline, onDeviceParamsUpdated) {\n // Start with the offline DPDB cache while we are loading the real one.\n this.dpdb = DPDB_CACHE;\n\n // Calculate device params based on the offline version of the DPDB.\n this.recalculateDeviceParams_();\n\n // XHR to fetch online DPDB file, if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validate the name attribute | validateName () {
let error = this.validator.validateString(this.attributes.name);
if (error) {
return { name: error };
}
} | [
"function validateAttributeName(name) {\n if (name.length === 0) {\n return [false, \"Name is a required field.\"];\n } else if (name.match(/[^a-z]/gi) !== null) {\n return [false, \"Only a-z and A-Z are allowed for this field.\"];\n }\n return [true, \"\"];\n}",
"function nameValidation () {\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: getSimpleWhereInfo DESCRIPTION: Returns an object with information about the current where clause, if it is based on a single parameter. Returns an empty object if the where clause is empty, and null if the where clause is not a simple parameter comparison ARGUMENTS: none RETURNS: object has 4 properties: lva... | function SBRecordsetPHP_getSimpleWhereInfo(sqlObj)
{
var retVal = null;
var whereStr = dwscripts.trim(sqlObj.whereClause);
var info = new Object();
info.lval = "";
info.rval = "";
info.operator = "";
info.isString = false;
if (whereStr != "")
{
if (w... | [
"function SBRecordsetPHP_getSimpleWhereInfo(sqlObj)\r\n{\r\n var retVal = null;\r\n\r\n var whereStr = dwscripts.trim(sqlObj.whereClause);\r\n \r\n var info = new Object();\r\n info.lval = \"\";\r\n info.rval = \"\";\r\n info.operator = \"\";\r\n info.isString = false;\r\n\r\n if (whereStr != \"\")\r\n {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this creates a board, cellCount determines the amount of cells the board contains | function createBoard (cellCount) {
TicTacToePage.inputNumber.setValue(cellCount);
TicTacToePage.btnSubmit.click()
} | [
"makeEmptyBoard() {\n let x = 0,\n cells = [];\n for (; x < this.size; x++) {\n let y = 0,\n row = [];\n for (; y < this.size; y++) {\n row[y] = this.addNewTile();\n }\n cells[x] = row;\n }\n this.cells = cells;\n }",
"function createBoard() {\n for(let i=0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrive all bricoles between city under one user | async retriveAllBricolsBtCityOfUser(req, res, next) {
try {
let userId = req.params.userId;
let userDetails = await User.findById(userId);
if (!userDetails)
return res.status(404).end();
const limit = parseInt(req.query.limit) || 20;
c... | [
"function getCitywiseConnctions(city_name, total_country_connections) {\n\n\tvar member;\n\tvar members_arr = [];\n\n\tfor (var i = 0; i < total_country_connections.length; i++) {\n\t\tmember = total_country_connections[i];\n\n\t\tvar position = member.location_name.search(city_name);\n\t\tif (position != -1) {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function adds 1 to distractions | function distractionButtonFunc() {
distractions = distractions + 1;
} | [
"incrementTaskDistraction() {\n const taskDistraction = this.getAttribute('distraction');\n this.setAttribute('distraction', parseInt(taskDistraction, 10) + 1);\n this.updateTaskDistractionUI();\n }",
"incrementDistraction() {\n this.numDistraction += 1;\n if (this.taskList.selectedTask) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The total number of bytes processed by the load balancer over IPv6. | metricIpv6ProcessedBytes(props) {
try {
jsiiDeprecationWarnings.print("aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer#metricIpv6ProcessedBytes", "Use ``ApplicationLoadBalancer.metrics.ipv6ProcessedBytes`` instead");
jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_Metri... | [
"metricIpv6RequestCount(props) {\n return this.cannedMetric(elasticloadbalancingv2_canned_metrics_generated_1.ApplicationELBMetrics.iPv6RequestCountSum, props);\n }",
"metricIpv6RequestCount(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.Appli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
animation for the thumbnail | static thumbAnimation(obj, params, name, duration) {
const navigationAnimation = new R.AnimationClip(name, params);
navigationAnimation.duration(duration);
obj.animation.add(navigationAnimation);
obj.animation.start(name);
} | [
"static thumbAnimation(obj, params, name, duration) {\n const navigationAnimation = new RODIN.AnimationClip(name, params);\n navigationAnimation.duration(duration);\n obj.animation.add(navigationAnimation);\n obj.animation.start(name);\n }",
"function seven_thumb_preview(arg){\t \t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |