query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Source of Test generating stack trace is expensive, so using a getter will help defer this until we need it | get source() {
return test.stack;
} | [
"get stack() {\n \t\treturn extractStacktrace(this.errorForStack, 2);\n \t}",
"function _getCallerDetails() {\n var originalFunc = Error.prepareStackTrace\n\n var callerfile\n var line\n try {\n var err = new Error()\n var currentfile\n\n Error.prepareStackTrace = function (err, stack) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try to get a parse tree that spans at least up to `upto`. The method will do at most `timeout` milliseconds of work to parse up to that point if the tree isn't already available. | function ensureSyntaxTree(state, upto, timeout = 50) {
var _a
let parse =
(_a = state.field(Language.state, false)) === null || _a === void 0
? void 0
: _a.context
if (!parse) return null
let oldVieport = parse.viewport
parse.updateViewport({ from: 0, to: upto }... | [
"function forceParsing(view, upto = view.viewport.to, timeout = 100) {\n let success = ensureSyntaxTree(view.state, upto, timeout)\n if (success != dist_syntaxTree(view.state)) view.dispatch({})\n return !!success\n }",
"static getSkippingParser(until) {\n return new (class extends dist_P... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==================== Ende Abschnitt fuer Klasse Classification ==================== ==================== Abschnitt fuer Klasse TeamClassification ==================== Klasse fuer die Klassifikation der Optionen nach Team (Erst und Zweitteam oder Fremdteam) | function TeamClassification() {
this.team = new Team();
this.teamParams = { };
this.renameParamFun = function() {
const __MYTEAM = this.team;
getMyTeam(this.optSet, this.teamParams, __MYTEAM);
if (__MYTEAM.LdNr !== undefined) {
// Prefix fuer die Optionen mit gesondert... | [
"function Team() {\n this.Team = undefined;\n this.Liga = undefined;\n this.Land = undefined;\n this.LdNr = 0;\n this.LgNr = 0;\n}",
"function Off_Teams(a_team){\n\tthis.against = a_team; // This is the team that the offense is built against\n\tthis.num = 0;\n\t\n\tthis.addTeam = function(team, sco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the minimap gravity grid . ctx: The canvas rendering context instance. cameraPos: Camera position as an x, y object. w: Width of the minimap as a number. h: Height of the minimap as a number. scale: Zoom out factor of the minimap as a number. planets: An array of Planet instances in the game world. | function renderMinimapGravityGrid(ctx, cameraPos, w, h, scale, planets) {
ctx.save();
let start = {
x: -(MINIMAP_POINT_SPREAD * MINIMAP_GRID_BUFFER + cameraPos.x) % MINIMAP_POINT_SPREAD,
y: -(MINIMAP_POINT_SPREAD * MINIMAP_GRID_BUFFER + cameraPos.y) % MINIMAP_POINT_SPREAD
};
ctx.fillSt... | [
"function applyMinimapGravity(pointWorld, pointVisual, planets, w, h, scale, cameraPos) {\n let visual = { x: pointVisual.x, y: pointVisual.y };\n\n let gravityDominator = planets[0];\n let gravity = null;\n\n for (let k = planets.length - 1; k >= 0; k--) {\n let g = applyGravity(planets[k], poin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove column card count constraints. | removeColumnConstraints() {
$('.ghx-busted-max, .ghx-busted-min').removeClass('ghx-busted-min ghx-busted-max'); // Red/yellow background remove
$('.ghx-constraint').remove(); // Column header remove
} | [
"removeConstraint(constraint) {\n var index = constraintList.indexOf(constraint);\n if (index !== -1) {\n constraintList.splice(index, 1);\n }\n }",
"function removeShrink(){\n\t\tvar rows = $b42s_header.find( '.fl-row-content-wrap' ),\n\t\t\tmodules = $b42s_header.find( '.fl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the current set of Stack outputs from the last Stack.up(). | outputs() {
return __awaiter(this, void 0, void 0, function* () {
return this.workspace.stackOutputs(this.name);
});
} | [
"outputs() {\n return this.stack.outputs();\n }",
"function last() {\n return _navigationStack[_navigationStack.length - 1];\n }",
"static async getStackOutput(stackName) {\n var stack = await this.getStackInfo(stackName);\n var outputs = {};\n stack['Outputs'].for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds the provided callback function to the callbacks object under the desired type | function registerCallback(type, func) {
if( callbacks.hasOwnProperty(type) == false ) {
callbacks[type] = [];
}
callbacks[type].push(func);
} | [
"register (name: string, callback: Callback, type: CallbackKind = 'didSave') {\n if (typeof callback !== 'function') {\n throw new Error('callback must be a function')\n }\n if (type !== 'didSave' && type !== 'willSave') {\n throw new Error('type must be a willSave or didSave')\n }\n if (ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
define a function that fetches a given metric for a given queue | function metric_fetch_gen(cw, queue_name, metric_name) {
var f = function(callback) {
//console.log("fetching " + metric_name + " for queue " + queue_name)
var end = new Date();
// fetch the last 30 minutes of data, but return the most recent data point
var start = new Date(end.getTi... | [
"getV3SidekiqQueueMetrics(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
preload() The frog image will load on startup | function preload() {
frogImage = loadImage("assets/images/Frog.png");
} | [
"function preload(){\n\thelicopterIMG=loadImage(\"helicopter.png\")\n\tpackageIMG=loadImage(\"package.png\")\n}",
"function preload() {\n img = loadImage('./img/body.png');\n}",
"function preload() {\n game.load.image('chair', 'https://media1.popsugar-assets.com/static/imgs/interview/chair.png');\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If window is not the top level window, return parent for creating new child window, otherwise returns false. | function parentFrom(window) {
if (window.parent !== window) return window.parent;
} | [
"isWindowActive() {\n if (this.windowHandle === null) {\n this.windowHandle = Winhook.FindWindow(this.windowTitle);\n if (!this.windowHandle) {\n return false;\n }\n }\n return Winhook.GetForegroundWindow() === this.windowHandle;\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stripe component : Stamplay.Stripe This class rappresent the Stripe Object component on Stamplay platform It very easy to use: Stamplay.Stripe() constructor | function Stripe() {
this.url = '/api/stripe/' + Stamplay.VERSION + '/';
this.createCustomer = function (userId) {
if (Stamplay.Support.checkMongoId(userId))
return Stamplay.makeAPromise({
method: 'POST',
data: {
'userId': userId
},
url: this.url + 'customers'
})
else
re... | [
"function paymentFactory() {\n\tvar payment = {\n\t\tcNumber: \"\",\n\t\tcType: \"\",\n\t\tCName: \"\",\n\t\tcExp: \"\",\n\t\tcCvv: \"\"\n\t}\n\treturn payment;\n}",
"constructor() { \n \n StakingLedger.initialize(this);\n }",
"static fromObject(obj) {\n if (Card.isValid(obj)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends a media entry to the end of the mix timeline, this will save the mix timeline as a new version. | static appendMediaEntry(mixEntryId, mediaEntryId){
let kparams = {};
kparams.mixEntryId = mixEntryId;
kparams.mediaEntryId = mediaEntryId;
return new kaltura.RequestBuilder('mixing', 'appendMediaEntry', kparams);
} | [
"function addMediaAfterSubmit (post) {\n var set = {};\n if(post.url){\n var data = getEmbedlyData(post.url);\n if (!!data) {\n // only add a thumbnailUrl if there isn't one already\n if (!post.thumbnailUrl && !!data.thumbnailUrl) {\n set.thumbnailUrl = data.thumbnailUrl;\n }\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save user and the password hash into the DB, returns a promise | function saveToDB(user, pass) {
return bcrypt.hash(pass, salt)
.then(hash=>{
return User.create(user, hash)
})
} | [
"function saveUser(username, password) {\n\n //This newUserRef allows for a NEW user to be submitted rather than replaced\n var newUserRef = usersRef.push();\n\n //Sets the data into the database under a randomly generated key \n newUserRef.set({\n username: username,\n passwor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse an ip and port from a 'tcp://:' string | function _parse(info) {
if (typeof info !== 'string') {
throw new TypeError('expecting string transport uri');
}
var uri = url.parse(info);
if (!(uri.port > 0)) {
throw new Error('expected valid transport uri');
}
return {
host: uri.hostname,
port: uri.port
};
} | [
"function parseOnePortRule(rule){\n if (validRule(rule)==false ) {\n return \"err\";\n }\n\n rule = rule.split(\"\\x02\");\n\n //------------SOURCE PORT-----------------------\n rule[_src] = rule[_src].split(\"+\"); //tcp+udp\n if(isArray(rule[_src])){\n if(rule[_src].length == 2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
What is the ID of the model. In 100% of the cases this method should be overriden to provide a scalar value or object representing ID. That in mind, implementation of this method is completly optional if the application does not want to store models. | id() {
// implementation should be inside the child class, but below implementation
// if for simplicity in many occasions
if (typeof this.data.id != 'undefined') return this.data.id;
// no ID
return null;
} | [
"get id() {\n this._id = getValue(`cmi.objectives.${this.index}.id`);\n return this._id;\n }",
"preSaveSetId() {\n if (isNone(this.get('id'))) {\n this.set('id', generateUniqueId());\n }\n }",
"static async findById(id) {\n // Ensure model is registered before finding by ID\n assert.ins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter for evidence This will return an array of displayText strings from Evidence array | get evidence() {
if (!this._evidence) return [];
return this._evidence.map((e) => {
return e.value;
});
} | [
"listEvidence(propRefs) {\n let output = [];\n for (let prop = 0; prop < propRefs.length; prop++) {\n output.push(<h4 key={eval('this.props.topic.' + propRefs[prop] + '.key1')}>{propRefs[prop] + \". Evidence\"}</h4>);\n output.push(<ul key={eval('this.props.topic.' + propRefs[prop] + '.key2')}>{this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether the token will expire within eagerRefreshThresholdMillis | isTokenExpiring() {
var _a;
const now = new Date().getTime();
const eagerRefreshThresholdMillis = (_a = this.eagerRefreshThresholdMillis) !== null && _a !== void 0 ? _a : 0;
if (this.rawToken && this.expiresAt) {
return this.expiresAt <= now + eagerRefreshThresholdMillis;
... | [
"function expired() {\n return (this.token && this.token.expires_at && new Date(this.token.expires_at) < new Date());\n }",
"checkIdToken() {\r\n console.log('check Id token expiration')\r\n let user = this.user();\r\n if (user) {\r\n const expirationDateSecs = user.idTokenClaims... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a value implements the `Point` interface. | isPoint(value) {
return isPlainObject(value) && typeof value.offset === 'number' && Path.isPath(value.path);
} | [
"function isAPosPointDescription(desc)\n{\n var type = PosPoint.prototype.determineType(desc);\n return (type !== undefined);\n}",
"function check_point(p) {\n if (p.x < 0 || p.x > 9) {\n return false;\n } else if (p.y < 0 || p.y > 9) {\n return false;\n } else if (spielfeld[p.y][p.x]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if JS media query matches the query string passed | function getMediaQuery(query) {
var mediaQueryList = window.matchMedia == null ? void 0 : window.matchMedia(query);
if (!mediaQueryList) {
return undefined;
}
return !!mediaQueryList.media === mediaQueryList.matches;
} | [
"registerQuery(mediaQuery) {\n const list = Array.isArray(mediaQuery) ? mediaQuery : [mediaQuery];\n const matches = [];\n buildQueryCss(list, this._document);\n list.forEach((query) => {\n const onMQLEvent = (e) => {\n this._zone.run(() => this.source.next(new ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logic or a register with accumulator | orReg(register) {
regA[0] |= register[0];
regF[0] = regA[0] ? 0 : F_ZERO;
return 4;
} | [
"visitXor_expr(ctx) {\r\n console.log(\"visitXor_expr\");\r\n let length = ctx.getChildCount();\r\n let value = this.visit(ctx.and_expr(0));\r\n for (var i = 1; i * 2 < length; i = i + 1) {\r\n if (ctx.getChild(i * 2 - 1).getText() === \"^\") {\r\n value = {\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
allListings returns the IDs of all the listings currently on the market Once an item is sold, it will not be returned by allListings returns: a promise containing an array of listing IDs | function allListings() {
return itemListings.once('value')
.then(data => data.val())
.then(itemListings => {
let items = Object.keys(itemListings)
return items.filter(
listingID => itemListings[listingID].forSale === true
)
})
} | [
"function getAllBookings() {\n // the URL for the request\n const url = '/bookings';\n // Since this is a GET request, simply call fetch on the URL\n fetch(url)\n .then((res) => {\n if (res.status === 200) {\n // return a promise that resolves with the JSON body\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add to notes when "Enter" is pressed | onKeyPressHandler(event) {
if(event.key === "Enter") {
this.addToNotes();
}
} | [
"keyPress(e) {\n // If enter or tab key pressed on new notebook input\n if (e.keyCode === 13 || e.keyCode === 9) {\n this.addNotebook(e);\n }\n }",
"function enterobs(e){\n if(e.which == 13 && !e.shiftKey){\n $('#pubob').click();\n e.preventDefault();\n }\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DrawOrbs function with assigned properties by using the word "this." and the variable following afterwards. | function DrawOrbs() {
this.x = random(0, width);
this.y = random(0, height);
this.display = function() {
// Prefered to use a stroke instead of a fill here since there is enough noise with both the moving orbs and the mouse.
fill(random(400), random(300), 190);
noStroke();
push();
translate(this.x, this... | [
"draw(){\n\n for(let i=0; i<this.belt.length;i++){\n this.belt[i].draw();\n }\n }",
"display() {\n //set the color\n stroke(this.element*255) ;\n //draw the point\n point(this.identity.x,this.identity.y)\n }",
"drawNote() {\n push();\n colorMode(H... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invokes numerization for all available TracklistNodes (usually one of such). | function numerize() {
for(trackListNode of getTracklistNodes())
numerizeTracklist(trackListNode)
} | [
"function numerizeTracklist(trackListNode) {\n currentlyModifyingAnyTracklist = true\n\n let songNumber = 0\n for(songNode of trackListNode.children) {\n let iconNode = getIconNode(songNode)\n if(iconNode === null) continue // = IconNode not found. Shouldn't happen.\n\n songNumber++\n\n if(hasClass(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call the server to update the map for an array of tiles | function forceUpdateTiles(tiles) {
if (! (tiles instanceof Array)) {
tiles = new Array(tiles);
}
ajaxGet({
url: "http://192.241.227.45/api/mapdata/"+join(tiles),
requestDetails: tiles,
success: receiveMapData
});
} | [
"function updateMap(data, canvas) {\n\t//TODO\n}",
"rescaleTiles() {}",
"function updateOSMTiles(request) {\n if (request === undefined) {\n request = {};\n }\n\n if (!m_zoom) {\n m_zoom = m_this.map().zoom();\n }\n\n if (!m_lastVisibleZoom) {\n m_lastVisibleZoom = m_zoom;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assigns value for the property that has the given key, and exists under the sub chart | handleSubChartPropertyChange(key, value) {
const state = this.state;
state.configuration.charts[0][key] = value;
this.setState(state);
this.props.onConfigurationChange(state.configuration);
} | [
"set(key, value = null) {\n // If only argument is an Object, merge Object with internal data\n if (key instanceof Object && value == null) {\n const updateObj = key;\n Object.assign(this.__data, updateObj);\n this.__fullUpdate = true;\n return;\n }\n\n // Add change to internal upda... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test if collision with Dino | collision(dino){
if (!this.img||!dino.img) return false;
if(!((this.y>(dino.y+dino.h))||(!this.left&&((this.x>=dino.x+dino.w-25)||(this.x<=dino.x+25)))||(this.left&&((this.x<=dino.x+25)||(this.x>=dino.x+dino.w-25))))){
if(dino.shield) {
setTimeout(()=>{dino.shield=false},500);
return fal... | [
"function detect_collision(obj1, obj2) {\r\n\tif ((obj1.x + obj1.width > obj2.x) &&\r\n\t\t(obj1.x < obj2.x + obj2.width) &&\r\n\t\t(obj1.y + obj1.height > obj2.y) &&\r\n\t\t(obj1.y < obj2.y + obj2.height)) {\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"function checkCollision(n1, n2){\r\n p1 = getP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Supply the number of keys in the datastore to the callback function. | function length(callback) {
var self = this;
var promise = self.keys().then(function(keys) {
return keys.length;
});
executeCallback(promise, callback);
return promise;
} | [
"function keysCounter(obj) {\n // your code here\n var counter = 0;\n counter = Object.keys(obj).length;\nreturn counter;\n // code ends here\n}",
"function getLength(data) {\n\treturn Object.keys(data).length;\n}",
"function counterCallback(callback, count) {\n\treturn (function() {\n\t\tcount--;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Like `Array.prototype.findIndex` but returns `arr.length` instead of `1` | function findIndex(arr, test) {
var index = arr.findIndex(test);
return index < 0 ? arr.length : index;
} | [
"function arr_findIndex(arr = [], prop = \"\", val) {\n\treturn arr.findIndex(v => { return v && v[prop] === val })\n}",
"function findLastIndex(arr, fn) {\n\tfor (let i = arr.length - 1; i >= 0; --i) {\n\t\tif (fn(arr[i])) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}",
"function getMatchingIndex(arr, key, v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw the cropped image experiment. | function croppedImage () {
ctx.fillStyle = "#000"
ctx.fillRect(0, 0, w, h)
starfield()
let img = new Image()
img.src = "res/img/kerrigan.png"
img.addEventListener('load', drawCropped, false)
function drawCropped() {
ctx.drawImage(img, 500, 500)
// cropped
for (let ... | [
"_redraw() {\n\t\tlet p = this._points;\n\n\t\tlet leftX = p.nw.x;\n\t\tlet leftY = p.nw.y;\n\t\tlet size = this._getSize();\n\n\t\tthis._dom.cropTop.style.left = leftX + \"px\";\n\t\tthis._dom.cropTop.style.width = size.width + \"px\";\n\t\tthis._dom.cropTop.style.height = leftY + \"px\";\n\n\t\tthis._dom.cropBott... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
6. Define a function called isDivisible that takes two arguments and returns a boolean. Return true if the first argument is divisible by the second; otherwise, return false. | function isDivisible(argument1, argument2) {
if ((argument1/argument2) % 2 === 0){
return true;
}
else {
return false;
}
} | [
"function dividesEvenly(a, b) {\n\tif (a%b === 0) {\n\t\treturn true;\n\t} else return false;\n}",
"function divisible7and5(number){\n\tif((number % 7 === 0) & (number % 5 === 0))\n\t{\n\t\tconsole.log(true);\n\t}\n\telse\n\t{\n\t\tconsole.log(false);\n\t}\n}",
"function divisibleByB(a, b) {\n\treturn a - a % b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modal code Scene Modal: Edit a Scene | function openSceneModal(sceneID) {
if (sceneMap.has(sceneID)) {
// components
let sceneModalTitle = document.getElementById('scene-modal-title');
let sceneModalBody = document.getElementById('scene-modal-body');
let sceneModalFooter = document.getElementById('scene-modal-footer');
... | [
"function openEditChoicesForSceneModal(sceneID) {\n if (sceneMap.has(sceneID)) {\n // components\n let modalTitle = document.getElementById('edit-choices-for-scene-modal-title');\n let modalBody = document.getElementById('edit-choices-for-scene-modal-body');\n let modalFooter = docume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Profile Info AJAX request handler (ABOVE) / Categories Section AJAX request handler (BELOW) Handle app.get("/acccategories",...). Extract categories info from database and send it to clientside to display it correctly. | function getCategoryInfo(req, res) {
/* This is a nested SQL query, and the description is following:
* 1) Get uid using email in session
* 2) Using uid to get ccid and cnames with pcids as references.
* 3) Get JOIN with ParentCategory
* 4) Filter with uid again to get only corresponding uid's categories.... | [
"function updateCat() {\n\tfunction getCatCallback(event) {\n\t\tvar jsonData = JSON.parse(event.target.responseText);\n\t\tfor(var c in jsonData) {\n\t\t\tvar newCatDiv = document.createElement(\"div\");\n\t\t\tvar label = document.createElement(\"label\");\n\t\t\tvar input = document.createElement(\"input\");\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 101 RopeGroup Reveal the twins | function C101_KinbakuClub_RopeGroup_RevealTwins() {
C101_KinbakuClub_RopeGroup_TwinsRevealed = true;
ActorSpecificConcealment("Heather", false);
ActorSpecificConcealment("Lucy", false);
} | [
"function C101_KinbakuClub_RopeGroup_WillLucyTie() {\n\tif (ActorGetValue(ActorLove) >= 3 || ActorGetValue(ActorSubmission) >= 2) {\n\t\tOverridenIntroText = GetText(\"LucyNotTieYou\");\n\t\tC101_KinbakuClub_RopeGroup_CurrentStage = 600;\n\t} else C101_KinbakuClub_RopeGroup_PlayerTied();\n}",
"function C101_Kinba... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the error if this is an Err result, otherwise null. | getError() {
return !this.isOk ? this.value : null;
} | [
"function firstMessage(errors) {\n if (!Array.isArray(errors) || errors.length === 0) return null;\n\n var error = errors[0];\n if (error.message) {\n return error.message;\n } else {\n return error;\n }\n}",
"function error(id) {\n var item = itemDictionary()[id];\n if (item && i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function creates the xhttp request "/jobpostings/displayJobPostings" and sends it to the server. The response text is put into a div with id="jobPreivew" | function loadJobs() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("jobPreview").innerHTML = this.responseText;
}
};
xhttp.open("GET", "/jobpostings/displayJobPostings", true);
xhtt... | [
"function show_packing_jobs() {\n \tvar xhttp = new XMLHttpRequest();\n \txhttp.onreadystatechange = function () {\n \t\tif (this.readyState == 4 && this.status == 200) {\n \t\t\tvar obj = JSON.parse(this.responseText);\n \t\t\t$('#packing').append(mangaerJobCard(obj));\n \t\t\tlet status = $('#packing div:fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns all active blocks to 'used' and removes all 'shadows' | function makeUsed() {
let blocks = document.getElementsByClassName('column');
for (let i = 0; i < blocks.length; i++) {
if (blocks[i].hasAttribute('active')) {
blocks[i].removeAttribute('active');
blocks[i].setAttribute('used', 'true');
}
if (blocks[i].hasAttribut... | [
"function unScareAlien(){\n aliens.forEach(alien => alien.isScared = false)\n }",
"function clearBlock(){\n\tfor(var i = 0; i < 4; i++){\n\t\tif(currentBlock[i].x < 0 || currentBlock[i].y < 0){\n\t\t\tcontinue;\n\t\t}\n\t\tboardGui.rows[currentBlock[i].x].cells[currentBlock[i].y].style.backgroundColor = \"whi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calcule les voisins de chaque groupe | _calculateVoisins(nbCases = 10) {
let currentGroupe = null;
let totalCases = nbCases * 4;
// Parcourt les fiches. On enregistre le groupe courant, quand changement, on defini le groupe precedent et calcule le suivant du precedent
for (let i = 0; i < totalCases + 2; i++) {
let... | [
"_groupVitamins () {\n let mini, maxi;\n\n this.groups = {};\n this.vitamins.forEach(vit => {\n if (! this.groups[vit.color]) this.groups[vit.color] = { vitamins: [], mini: null, maxi: null };\n\n // Set mini in color group\n mini = this.groups[vit.color].mini;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the context for a ChangeDetectorRef to the given instance. | function initChangeDetectorIfExisting(injector, instance, view) {
if (injector && injector.changeDetectorRef != null) {
injector.changeDetectorRef._setComponentContext(view, instance);
}
} | [
"function applyRef(instance, ref) {\n if (!ref) {\n return;\n }\n if (typeof ref === \"function\") {\n ref(instance);\n }\n else if (typeof ref === \"object\") {\n ref.current = instance;\n }\n}",
"_changeContextViewPanel(context) {\n\t\tthis.setState({\n\t\t\tcurrentContext... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read .we file content | readWefile (filePath, savePath, err, data) {
if (err) {
this._clientPool.sendTransformFailedNotify(err)
} else {
const arr = filePath.split('\/')
const weFileName = arr.length > 1 ? arr[arr.length - 1] : 'unkown'
let content
try {
... | [
"readText() {\n const filePath = this._fullname;\n const text = fs.readFileSync(filePath, 'utf-8');\n return text;\n }",
"function readAndParseFile (file)\n{\n\tvar whichFile = doActionEx\t('DATA_READFILE',file, 'FileName', file,'ObjectName',gPRIVATE_SITE, \n\t\t\t\t\t\t\t\t'FileType', 'tx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a new identifier from the given seed (which increments every time we want a new identifier). | function generateIdentifierFromSeed(s)
{
// generate first char
let s1 = s % USE_CHARS.length;
let ret = USE_CHARS[s1];
s = Math.floor((s - s1) / USE_CHARS.length);
while (s > 0)
{
let s2 = (s - 1) % USE_CHARS.length;
ret = USE_CHARS[s2] + ret; // ensures the change is always the last char, which probably ... | [
"function generateUID() {\n return String(~~(Math.random()*Math.pow(10,8)))\n}",
"function _randId() {\n\t\t// Return a random number\n\t\treturn (new Date().getDate())+(''+Math.random()).substr(2)\n\t}",
"generateId() {\n const newId = `dirId-${Directory.nextId}`;\n Directory.nextId++;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to export the ruleset into a file | function ExportRules() {
try {
//update json for all rules in ruleset
CurrentRuleSet.updateAll();
CurrentRuleSet.Rules.forEach(rule =>{
//convert ruleset to JSON
var text = JSON.stringify(rule, null, 3);
var filename = rule.title;
... | [
"function exportSelectedRules() {\r\n\r\n var checkboxes = $('#ID-conditionTable .cb_export:checked');\r\n prepareExport('rules', checkboxes.length);\r\n\r\n\r\n checkboxes.each(function(index, element) {\r\n $.ajax({\r\n type : 'POST',\r\n async ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collapse other information and show cross selling section with a scrolling effect | function showCrossSelling() {
if ( $('#otherInfoContentTabs').is(':visible') ) {
$('#otherInfoContentTabs').collapse('hide');
}
if ( $('#crossSellingSection').is(':hidden') ) {
$('#crossSellingSection').collapse('show');
}
$('html, body').animate({
scrollTop: $("#crossSellingSection").o... | [
"function toggleDetailTable() {\n $('.extend-data').hide();\n $('.luft-extend-table').click(function (e) {\n $(this).parent().next().slideToggle(200);\n $(this).parent().parent().toggleClass('data-expended');\n e.preventDefault();\n });\n $('.extend-data'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OperationType : one of query mutation subscription | function parseOperationType(lexer) {
var operationToken = expect(lexer, _lexer.TokenKind.NAME);
switch (operationToken.value) {
case 'query':
return 'query';
case 'mutation':
return 'mutation';
// Note: subscription is an experimental non-spec addition.
case 'subscription':
return ... | [
"selectOperation(operation) {\n switch (operation) {\n case 'Inoltra al professore':\n this.sendToProfessor(this.state.selectedNotice);\n break;\n case 'Accetta':\n this.acceptedNotice(this.state.selectedNotice);\n break;\n case 'Non accetta':\n this.notAcceptNot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates total accumulated money since midnight | function calcMoney(rate) {
// number of seconds since midnight
var totalSeconds = (hour() * 60 * 60) + (minute() * 60);
return (totalSeconds + second()) * rate;
} | [
"calTotalCharged(){\n this._totalCharged = this._costPerHour * this._hoursParked;\n }",
"function calculateTotalTimeSpentToday(){\n\tvar l = Projects.length;\n\tfor(i=0;i<l;i++){\n\t\ttotalTimeSpentToday += Projects[i].timeSpentToday;\n\t\t\n\t\t//Calculate totalOvertimeSpentToday\n\t\tif(Projects[i].timeSp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start a grouping over the given items. | function group(items) {
const by = (key) => {
// create grouping with resolved keying function
const keyFn = typeof key === 'function' ? key : (item) => item[key];
const groups = createGrouping(items, keyFn);
// return collectors
return Object.freeze({
asArrays: (... | [
"function createGrouping(items, keyFn) {\n const groups = [];\n let idx = 0;\n for (const item of items) {\n const itemKey = keyFn(item, idx);\n idx++;\n const predicate = (g) => (0, deep_eql_1.default)(g.key, itemKey);\n const construct = () => ({ key: itemKey, items: [] });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hueristic function (h cost): cost to the goal | hueuristic() {
// This hueristic is simply the distance to the goal
return Math.sqrt(Math.pow(this.x - goal.x, 2) + Math.pow(this.y - goal.y, 2));
} | [
"function hCost(position) {\n return Math.abs(position.x - end_position.x) + Math.abs(position.y - end_position.y);\n }",
"docosts1(u,cost) {\n\t\tlet l = this.left(u); let r = this.right(u);\n\t\tlet mc = cost[u];\n\t\tif (l) {\n\t\t\tthis.docosts1(l,cost);\n\t\t\tmc = Math.min(mc, this.#dmin[l]);\n\t\t}\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function set the standard journal allocation credit lines | function setStandardJournalCreditLines(recBill,recJE)
{
//set the journal credit line for expense
var arrSubTab = [];
arrSubTab.push('item');
arrSubTab.push('expense');
var currentLine = recJE.getLineItemCount('line');
currentLine = (!currentLine || currentLine==0) ? 1 :... | [
"function setStandardJournalDebitLines(recBill,recJE,arrBDD)\r\n{\r\n var stMemo = 'System Generated from Vendor Bill #: ' + recBill.getFieldValue('transactionnumber');\r\n \r\n var currentLine = recJE.getLineItemCount('line');\r\n currentLine = (!currentLine || currentLine==0) ? 1 : currentLine +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AdditiveExpression : MultiplicativeExpression | AdditiveExpression ADDITIVE_OPERATOR Literal > Literal ADDITIVE_OPERATOR Literal ADDITIVE_OPERATOR Literal | AdditiveExpression() {
return this._BinaryExpression(
"MultiplicativeExpression",
"ADDITIVE_OPERATOR"
);
} | [
"function parseAdditive() {\n var token, left, right, r;\n\n left = parseMultiplicative();\n token = lexer.peek();\n if (matchOp(token, '+') || matchOp(token, '-')) {\n token = lexer.next();\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies the given fact (with zero hypotheses) to the workspace (a proved theorem with one hypothesis, representing a workinprogress). The workpath points to a subexpression of the work's only hypothesis. The factPath points to a subexpression of the fact's statement. These two subexpressions will be unified; then the f... | function applyFact(work, workPath, fact, factPath) {
if (!Array.isArray(factPath) ||
(factPath.length != 1) ||
((factPath[0] != 1) && (factPath[0] != 2))) {
throw new Error("factPath must be [1] or [2] for now.");
}
var varMap = getMandHyps(work, workPath, fac... | [
"function ground(work, dirtFact) {\n // verify that the hyp is an instance of the dirt\n var varMap = getMandHyps(work, [], dirtFact, []);\n if (DEBUG) {console.log(\"# ground MandHyps: \"+JSON.stringify(varMap));}\n work.Core[Fact.CORE_HYPS].shift();\n var newSteps = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to take the chords, see which keys they are in, and return the keys | function giveKeys(chords){
var addKey = true;
var retKeys = [];
for(var key in keys){
for(var chord in chords){
//TESTING ONLY --- //$('div#testDiv p#testP').append(' --- Testing' + ' ' + chords[chord] + ' in ' + keys[key] + ', and the result is: ' + jQuery.inArray(chords[chord],keys[key])); //testing//
... | [
"function getChord() {\n //get all playing keys\n var keys = document.querySelectorAll(\".key.playing\");\n\n //if less than 2 keys there is no chord, return blank\n if (keys.length < 2) {\n return \"\";\n }\n\n //get bass note (lowest playing note)\n var bass = keys[0].dataset.note;\n //get indicies of ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
12db lowpass biquad coefficients | function coeff_biquad_lowpass12db(freq, gain) {
var w = 2.0 * Math.PI * freq / samplerate;
var s = Math.sin(w);
var c = Math.cos(w);
var q = gain;
var alpha = s / (2.0 * q);
var scale = 1.0 / (1.0 + alpha);
var a1 = 2.0 * c * scale;
var a2 = (alpha - 1.0) * scale;
var b1 = (1.0 - c)... | [
"SolveBend_PBD_Triangle() {\n const stiffness = this.m_tuning.bendStiffness;\n for (let i = 0; i < this.m_bendCount; ++i) {\n const c = this.m_bendConstraints[i];\n const b0 = this.m_ps[c.i1].Clone();\n const ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3. Create a function that returns the sum of two numbers that are arguments. Then console.log the function with the variables from step two as your two arguments. | function addSum(a,b){
var answer = a + b;
//4. Create a function that returns the difference of two numbers that are arguments. Then console.log the function with the variables from step two as your two arguments.
console.log (answer);
} | [
"function consoleSum(x, y) {\r\n var sum = x + y;\r\n console.log(sum);\r\n}",
"function add(num1, num2){\n console.log(\"Summing Numbers!\");\n console.log(\"num1 is: \" + num1);\n console.log(\"num2 is: \" + num2);\n var sum = num1 + num2;\n return sum;\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abstracted reducer for the shortlist | function reduceShortlist(acc, crt) {
if (crt.id.pubchem.length > 1) {
acc.tmi.push(crt);
return acc;
};
acc.req.push(crt.id.pubchem[0]);
return acc;
} | [
"function reducer2(a, e) {\n var summ = 0;\n if (typeof a == \"string\") { // this handles the initial case where the first element is used\n summ = a.length; // as the starting value.\n }\n else {\n summ = a;\n }\n return summ + countLetters(e);\n}",
"function buildReducer(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function to that given a letter and a frequency:f will make f copies of the current set and return a new and for each copy, will append the letter f times should return 'a', 'aa', 'aaa' | function addLettersToSetHelper(letter, frequency, currSet) {
var letToAppend = '';
var retSet = new Set();
for (var j = 0; j < frequency; j++) {
var tempSet = currSet.clone();
letToAppend += letter;
var setToAdd = addLettersToSet(letToAppend, tempSet);
retSet.addEach(setToAdd);
};
return retSet;
} | [
"function display_letter_frequency(a,dom) {\n\t var table = \"<table>\";\n \tfor ( var x in a) {\n \t\ttable += \"<tr><td>\" + x + \"</td><td>\" + a[x] + \"</td></tr>\";\n \t}\n \ttable += \"</table>\";\n \tdom.innerHTML = table;\n\t\n}",
"function repeatChar(string,char){\n string= string.toLowerCase()\n strin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `AwsCloudMapServiceDiscoveryProperty` | function CfnVirtualNode_AwsCloudMapServiceDiscoveryPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an ob... | [
"function CfnVirtualNode_DnsServiceDiscoveryPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove " " form the start of screenDown | function removeNbsp () {
if (screenDown.innerHTML == " ") screenDown.innerHTML = "";
} | [
"function setNbsp () {\n\t\tif (screenDown.innerHTML == \"\") screenDown.innerHTML = \" \";\n\t}",
"function DEL () {\n\t\tscreenDown.innerHTML = screenDown.innerHTML.slice(0,-1);\n\t\tsetNbsp();\n\t}",
"function blank() {\n putstr(padding_left(seperator, seperator, sndWidth));\n putstr(\"\\n\");\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This clears all existing inputs in the output layer | clearAllInputsOutputLayer(){
for(var i = 0; i < neuralNet.layers[2].neurons.length; i++){
neuralNet.layers[2].neurons[i].receivedInputs = [];
neuralNet.layers[2].neurons[i].receivedWeights = [];
}
} | [
"reset(){\n this._input = null;\n this._output = null;\n }",
"clearAllErrorsInputLayer(){\n for(var i = 0; i < neuralNet.layers[0].neurons.length; i++){\n neuralNet.layers[0].neurons[i].receivedErrors = [];\n neuralNet.layers[0].neurons[i].receivedWeightsError = [];\n }\n }",
"function c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a new item to the items array in the state method is passed to the ShoppingListForm, which will be called with state from the form | addItem(item) {
let newItem = { ...item, id: uuidv4() }; //taking the existing item with only name and id coming from the form and adding an id field
this.setState(state => ({
items: [...state.items, newItem] //spread operator syntax, it sets items to be all the existing state items plus the new item
... | [
"addNewItem() {\n\t\tconst newItem = {itemName: \"\", tag: \"None\", description:\"\", price:\"\", pic:\"\"};\n\t\tthis.setState((prevState, props) => ({\n\t\t\titems: prevState.items.concat(newItem)\n\t\t}))\n\t}",
"function addItemShoppingList(newItem) {\n STORE.items.push({name: newItem, checked: false});\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funciton to render local searches on load | function renderLocalSearch () {
//checks local storage for localScores item
if(JSON.parse(localStorage.getItem("localCity")) === null) {
return;
}
// if localScores is in local storage, parses string to highScoreStore array.
storedSearches = JSON.parse(localStorage.getItem("localCity"));
} | [
"function renderStoredSearch() {\n // console.log(\"Im in render stored search locations func\");\n //creating a variable to hold the items in local storage parsed into JSON\n var searchArray = JSON.parse(localStorage.getItem(\"searchLocations\"));\n //if there are items in local storage\n if (search... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursively tries to push an item to the bottomright most tree possible. If there is no space left for the item, null will be returned. | function push_(item, a)
{
// Handle resursion stop at leaf level.
if (a.height === 0)
{
if (a.table.length < M)
{
var newA = {
ctor: '_Array',
height: 0,
table: a.table.slice()
};
newA.table.push(item);
return newA;
}
else
{
return null;
}
}
// Recursively push
var pushed ... | [
"_insertRecursively(node, data) {\n if (!node) {\n return new Node(data);\n }\n\n if (data <= node.data) {\n node.left = this._insertRecursively(node.left, data);\n } else {\n node.right = this._insertRecursively(node.right, data);\n }\n\n return node;\n }",
"insert(val) {\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the serverVersion. Only override if you implement functionality specifically not available in the declared base serverVersion. This is used when writing out serverVersion and fullVersion in the various JSON and HTML outputs. | get serverVersion() {
if (!this._devMode) console.log("Implement to override the default server version of 10.1");
return 10.1;
} | [
"getServerVersion() {\n if(!_.isUndefined(this.nodeInfo) && !_.isUndefined(this.nodeInfo.server)\n && !_.isUndefined(this.nodeInfo.server.version)) {\n return this.nodeInfo.server.version;\n }\n }",
"get nodeVersion() {\n return this._cliConfig.get('node-version', process.versions.node);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find sounds by character | static findSoundsByCharacter(character) {
return CharacterToSounds[character];
} | [
"static findCharactersBySound(sound) {\n return SoundToCharacters[sound];\n }",
"static findCharactersWithSingleSound(characters) {\n return _.select(characters, char => { \n return Canigma.findSoundsByCharacter(char).length == 1;\n });\n }",
"static findOtherCharactersWith... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
!onItemChanged To be called when the messageActive status changes, so that we can focus on the text control if appropriate. | function onMessageActive(newval, oldval) {
if(!newval && !oldval)
return;
if(newval && !oldval) {
$scope.focusTextInput();
}
} | [
"ShowCurrentItems(){\n MyUtility.getInstance().sendTo('telegram.0', {\n chatId : MyUtility.getInstance().getState('telegram.0.communicate.requestChatId'/*Chat ID of last received request*/).val,\n text: 'Bitte Raum wählen:',\n reply_markup: {\n keyboard:\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if a given browser's docshell should be active. | shouldActivateDocShell(aBrowser) {
if (this._switcher) {
return this._switcher.shouldActivateDocShell(aBrowser);
}
return (aBrowser == this.selectedBrowser &&
window.windowState != window.STATE_MINIMIZED &&
!window.isFullyOccluded) ||
this._printPreviewBrowsers.has(... | [
"function checkOpenDocument() {\r\n\tvar od = true;\r\n\tif (app.documents.length > 0) {\r\n\t\tvar docA = app.activeDocument;\r\n\t} else {\r\n\t\tvar msg = \"Annoyingly, Illustrator won't set the colour space of an SVG \";\r\n\t\tmsg += \"to CMYK unless there's already a file open! I'm going to open a new documen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recibe id favorito ,lleega por la url, recibe request y respuesta tipo get | function getFavorito(req,res){
var favoritoId= req.params.id;
//para buscar ese favorito
Favorito.findById(favoritoId,function(err,favorito){
if(err){
res.status(500).send({message:'error al devolver marcador'})
}
else{
if (!favorito){
res.stat... | [
"function getFavorites(success, error){\n let baseUrl = \"/favorites\";\n baseXHRGet(baseUrl, success, error);\n }",
"function getElencoEsamiUltimoAnno(matId,anno){ \n return new Promise(function(resolve, reject) {\n var options = { \n method: 'GET',\n url: strUrlGetSingoloE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check an object for unexpected properties. Accepts the object to check, and an array of allowed property names (strings). Returns an array of key names that were found on the object, but did not appear in the list of allowed properties. If no properties were found, the returned array will be of zero length. | function extraProperties(obj, allowed)
{
mod_assert.ok(typeof (obj) === 'object' && obj !== null,
'obj argument must be a non-null object');
mod_assert.ok(Array.isArray(allowed),
'allowed argument must be an array of strings');
for (var i = 0; i < allowed.length; i++) {
mod_assert.ok(typeof (allowed[i]) ... | [
"function defineObjectKeys(){\n Object.keys = (function() {\n 'use strict';\n var hasOwnProperty = Object.prototype.hasOwnProperty,\n hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),\n dontEnums = [\n 'toString',\n 'toLocal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rightResize: resize the rectangle by dragging the right handle | function rightResize(d) {
if(isUser || in_progress) { // user page
return;
}
// get event id
var groupNum = d.groupNum;
// get event object
var ev = getEventFromId(groupNum);
var newX = d3.event.x - (d3.event.x%(STEP_WIDTH)) - (DRAGBAR_WIDTH/2);
if(newX > SVG_WIDTH){
... | [
"function addRectHandle($canvas, parent, px, py) {\n\tvar handle, cursor;\n\n\t// Determine cursor to use depending on handle's placement\n\tif ((px === -1 && py === -1) || (px === 1 && py === 1)) {\n\t\tcursor = 'nwse-resize';\n\t} else if (px === 0 && (py === -1 || py === 1)) {\n\t\tcursor = 'ns-resize';\n\t} els... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function drawhookHighlights: called after plot 3 redraws, this handles making sure the right bars are highlighted | function drawhookHighlight(plot, canvas) {
plot.unhighlight();
for (var i = 0; i < highlighted[3].length; i++) {
plots[3].highlight(0,highlighted[3][i]);
}
plot.clearSelection(true);
drawhook(plot, canvas);
} | [
"function highlightBar(bar) {\n bar.fillColor = \"rgba(186,0,0,0.1)\";\n bar.strokeColor = \"rgba(186,0,0,0.5)\";\n bar.highlightStroke = \"rgba(208,0,0,0.5)\";\n bar.highlightFill = \"rgba(186,0,0,0.05)\";\n}",
"onLayerHighlight() {}",
"drawBarsRemoveOld(){\n }",
"function resetDrawingHighligh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether a platform id represents a web worker app platform. | function isPlatformWorkerApp(platformId) {
return platformId === PLATFORM_WORKER_APP_ID;
} | [
"function isRBMPlatform (currentPlatform) {\n return currentPlatform == HIGH_DIMENSIONAL_DATA[\"rbm\"].platform ? true : false;\n}",
"function platform() {\n\tvar s = process.platform; // \"darwin\", \"freebsd\", \"linux\", \"sunos\" or \"win32\"\n\tif (s == \"darwin\") return \"mac\"; // Darwin con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if username meets the length requirement. | function validUsername(username) {
return (username.trim().length) >= 3;
} | [
"function passwordLongEnough(password){\n if(password.length>=15)return true \n return false\n}",
"function strLength(x){\n if (typeof x === \"string\" && x.length >= 8){\n return true;\n }\n return false;\n }",
"function validatePassword(input){\n if(input.length >= ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a filtered array of all projects with a tag | projectsWithTag(tag) {
return this.projects.filter((p) => p.tags.includes(tag));
} | [
"function relevantProjects(){\n let filteredProjects = [];\n projects.forEach(function (project){\n let include = false;\n if (Object.keys(filter).length === 0){\n include = true;\n }\n else{\n Object.keys(filter).forEach(function (f){\n\n })\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change task property, save settings and reload list Params: taskIndex index of array element property name of key to change value | changeTaskProperty(taskIndex, property, value = '') {
if (taskIndex >= this.taskList.length) {
throw Error(`Index ${taskIndex} doesn't exist!`);
}
this.taskList[taskIndex][property] = value;
this.renderList();
this.saveStore(this.config.name, JSON.stringify(this.taskList));
} | [
"function updateTasksBackend() {\n let stringTasks = JSON.stringify(tasks);\n backend.setItem('test_tasks_board_jklaf', stringTasks);\n}",
"function moveTask(index, task, value) {\n $scope.schedule[$scope.currentUserId].splice(index, 1);\n if (value == 1) {\n $scope.schedule[$scope.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refreshes Highest Possible GPA | function refreshHighestGPA() {
var maxSemester = $("#highest_GPA_semester > select").val();
$("#highest_gpa").html(formatGPA(user.highestGPA(maxSemester), 2));
} | [
"async updateBestSolutionAndFitness() {\n this.bestSolution = this.population[0];\n this.bestFitness = this.fitness_values[0];\n }",
"function calcBasePop(useMaxFuel){\n //fuel and tauntimps\n var eff = game.generatorUpgrades[\"Efficiency\"].upgrades;\n var fuelCapacity = 3 + game.genera... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the current active list | _findActiveList() {
return this._findList(l => this._isActiveList(l));
} | [
"function getCurrentListElement() {\n var main_list_id = document.getElementsByClassName('shopping_list')[0].id.substring(8);\n var overview_lists = document.getElementsByClassName('user_list_overview');\n var overview_lists_id;\n for(var i = 0; i < overview_lists.length; i++) {\n\toverview_lists_id = o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will read files from supplied directory path. And it will call function to process on that files. | function readFiles(dirName, processOnFileContent, onError) {
fs.readdir(dirName, function(err, fileNames) {
if(err) {
onError(err)
return
}
//Now we have all fileNames....
fileNames.forEach(function(fileName) {
var filePath = path.join(dirName, fileName)
fs.readFile(filePath, function(err, content... | [
"function processRead(){\n\tvar platformPath;\n\t var operatingSystem = systemInfo.os;\n\tif(operatingSystem.indexOf('win32') > -1){\n\t\tplatformPath = 'C://';\n\t}\n\telse{\n\t\tplatformPath = '/proc';\n\t\t}\n\tvar subdir = platformPath;\n\tretrieveProcessInfo();\n\tfor(var i = 0; i < fileList.length-1; i++){\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a rating to a chord and +1 to the total number of raters | function rateChord(chordKey, newRating) {
return new Promise(function (resolve, reject) {
if (newRating < 1 || newRating > 5) {
reject('Rating value should be between 1 - 5');
}
var localRef = PlyFirebase.getRef("chords/" + chordKey);
... | [
"function increaseMoveCounter( )\n {\n moves.textContent = ++moveCounter;\n starRating( );\n }",
"function adjustRating() {\n if(newRestroom.rating === 1) {\n newRestroom.rating += 1;\n } else if(newRestroom.rating === -1){\n newRestroom.rating -= 1;\n }// end if\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Memory game router, handles registering a user for a new game & sending over information about a specific card in the game | function memoryRouter(parsedUrl, req, res) {
var data = '';
var route = parsedUrl.pathname;
var query = parsedUrl.query;
if (req.method === 'POST' && route === '/memory/intro') {
// Request to register a user with a new game
readRequestBody(req, function(err, data){
userList[data.id] = makeBoard(4);
// Se... | [
"function makeNewGame() {\n // //http://localhost:5000/\n //https://lit-retreat-32140.herokuapp.com/games/new\n\n postData('https://lit-retreat-32140.herokuapp.com/games/new', {\n username1: 'O',\n username2: 'x',\n }).then((data) => {\n if (data.game) {\n gameId = data.game._id;\n\n drawBoar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
let viewMat = new Mat4().setLookAt(x, y, z, 0, 0, 0, 0, 1, 0) // let viewMat2 = new Mat4()._setLookAt(x, y, z, 0, 0, 0, 0, 1, 0) // let viewMat = new Mat4().setLookAt(0, 0, 0.25, 0, 0, 0, 0, 1, 0) gl.uniformMatrix4fv(u_ViewMat, false, viewMat.getArray()) gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT) gl.drawArrays(g... | function draw() {
requestAnimationFrame(draw)
x += 0.00001
y += 0.00001
// z += 0.001
let viewMat = new Mat4().setLookAt(x, y, z, 0, 0, 0, 0, 1, 0)
// let viewMat = new Mat4().setLookAt(0, 0, 0.25, 0, 0, 0, 0, 1, 0)
gl.uniformMatrix4fv(u_ViewMat, false, viewMat.ge... | [
"function draw() { \r\n var translateVec = vec3.create();\r\n var scaleVec = vec3.create();\r\n \r\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n uploadViewDirToShader();\r\n\r\n // We'll use perspective \r\n mat4.perspect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a BigInt to a byte array of length l in MSB first order. | function bigint2bytes(m,l)
{
let r = [];
m = BigInt(m); // just in case
for(let i = 1 ; i <= l ; i++)
{
r[l - i] = Number(m & 0xFFn);
m >>= 8n;
}
if (m != 0n)
console.log("m too big for l", m, l, r);
return r;
} | [
"function longToByteArray(long){\n var byteArray = new Uint8Array(8);\n\n for (var index = 0; index < byteArray.length; index++){\n var byte = long & 0xff;\n byteArray [index] = byte;\n long = (long - byte) / 256 ;\n }\n return byteArray;\n}",
"function array2bigint(bytes)\n{\n\tl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the surround mode to game. | setSurroundModeToGame() {
this._setSurroundMode("s_game");
} | [
"setSurroundModeToAuto() {\n this._setSurroundMode(\"s_auto\");\n }",
"setSurroundModeToStandard() {\n this._setSurroundMode(\"s_standard\");\n }",
"setSurroundModeToStereo() {\n this._setSurroundMode(\"s_stereo\");\n }",
"setSurroundModeToRight() {\n this._setSurroundMode... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove user from group See: ``` api.removeUserFromGroup( id, userId ) ``` TODO: check what this returns | removeUserFromGroup (id, userId) {
assert.equal(typeof id, 'number', 'id must be number')
assert.equal(typeof userId, 'number', 'userId must be number')
return this._apiRequest(`/group/${id}/user/${userId}`, 'DELETE')
} | [
"removeUserFromGroup(hub, group, userId, options) {\n const operationOptions = coreHttp.operationOptionsToRequestOptionsBase(options || {});\n return this.client.sendOperationRequest({ hub, group, userId, options: operationOptions }, removeUserFromGroupOperationSpec);\n }",
"static async removeUs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searchCrit is a mongoDb search criteria. TODO: SECURITY!!!!!!!!!!!!!!!!!!!!!11 callback(err, campaignArray) | function findCampaigns(searchCrit, callback) {
$.ajax({
type: 'POST',
url: '/api/search',
data: JSON.stringify(searchCrit),
success: function(data) {if (callback) {callback(null, data);}},
error:function(jqXHR ) {if (callback) {callback(jqXHR.responseText);}},
co... | [
"function findCampaignsMetadata(searchCrit, callback) {\r\n $.ajax({\r\n type: 'POST',\r\n url: '/api/search',\r\n data: JSON.stringify(searchCrit),\r\n success: function(data) {if (callback) {callback(null, data);}},\r\n error:function(jqXHR ) {if (callback) {callback(jqXHR.resp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update specific classname to fixed element | styleFixedElement(element, computedStyle = null) {
const { hasFixedPosition, leftPx, rightPx } = this.getFixedPosition(element, computedStyle);
if (!hasFixedPosition) {
if (element.classList.contains(StyleClass.FixedElement)) {
... | [
"function updateElement(elementClass,replaceContent){\n\n document.querySelector(elementClass).innerHTML = replaceContent;\n\n\n}",
"function mark(elem, marker) {\n\tif (elem && !hasClass(elem, marker)) {\n\t\tvar names = getClassNames(elem) || [];\n\t\tnames.push(marker);\n\t\telem.className = names.join(' ')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the thrust of the rocket | updateThrust() {
this._thrust = this.fuel * 0.04;
} | [
"set thrust(thrust) {\n if(typeof(thrust) != 'number') { throw new Error('INVALID_THRUST')}\n\n this._thrust = thrust;\n }",
"SetTurtle(num) {\n if (num == 1) { this.turtleToughness = -1; this.turtleCapacity = 1; this.capacity += this.turtleCapacity; }\n if (num == 2) { this.turtleToughness = -1;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generates the markdown for the version tag line | _generateTagLine(newVersion, currentVersion) {
if (this.repoUrl && Str.weaklyHas(this.repoUrl, 'github.com')) {
return (`## [${newVersion}](${this.repoUrl}/compare/v${currentVersion}...v${newVersion}) - ` +
`(${Moment().format('YYYY-MM-DD')})`)
} else {
return (`## ${newVersion} - (${Moment(... | [
"function generateMarkdown(readmeData) {\n return `\n # ${readmeData.projectName}\n ${selectBadge(readmeData.license)}\n ## Description\n ${readmeData.description}\n ## Table of Contents\n * [Installation](#installation)\n * [Usage](#usage)\n * [License](#license)\n * [Contributing](#c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by Java9ParsersingleElementAnnotation. | enterSingleElementAnnotation(ctx) {
} | [
"enterAnnotationTypeElementModifier(ctx) {\n\t}",
"enterUnescapedAnnotation(ctx) {\n\t}",
"lesx_parseElement() {\n var startPos = this.start,\n startLoc = this.startLoc;\n\n this.next();\n\n return this.lesx_parseElementAt(startPos, startLoc);\n }",
"ente... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the given trials, up to _trialsPerPage, from the given start position. | function _showTrials(trials, start) {
var trial_list = $('#trial_list');
if (!start || 0 == start) {
trial_list.empty();
}
$('#show_more_trials').remove();
$('#g_map_toggle').show();
// no trials to show
if (!trials || 0 == trials.length || start >= trials.length) {
if (trials.length > 0 && start >= trials... | [
"function displayPetals() {\n const start = (currentPage - 1)\n}",
"get start_results(){\n return this.page_number * this.size + 1;\n }",
"function walkAverage(trials){\n var sum = 0,\n count = 0;\n\n function step(){\n var next = Math.random();\n sum += next;\n count... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the property existsInKG to true if the Node has triples in the DC KG. | async setExistsInKG() {
if (!this.dcid || this.existsInKG) {
return;
}
this.existsInKG = await doesExistsInKG(this.dcid);
} | [
"static checkPathForAllNodes(stationMap, path) {\n const pathSet = new Set(path);\n if (pathSet.size === stationMap.size) {\n console.log('All stations are included in the path');\n } else {\n console.log('There are only ' + pathSet.size + ' stations in the path.');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function to find the index of a swatch in a specified palette. If the color is found, otherwise it will return 1 | function findSwatchIndex(paletteResolver, swatch) {
return (designSystem) => {
if (!(0,_common__WEBPACK_IMPORTED_MODULE_1__.isValidColor)(swatch)) {
return -1;
}
const colorPalette = (0,_fast_design_system__WEBPACK_IMPORTED_MODULE_0__.evaluateDesignSystemResolver)(paletteResolver... | [
"function findClosestSwatchIndex(paletteResolver, swatch) {\n return (designSystem) => {\n const resolvedPalette = (0,_fast_design_system__WEBPACK_IMPORTED_MODULE_0__.evaluateDesignSystemResolver)(paletteResolver, designSystem);\n const resolvedSwatch = (0,_fast_design_system__WEBPACK_IMPORTED_MODU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controller function to get all lists | getAllLists(req, res, next) {
listsHelper.getAllLists(req.reqId).then((lists) => {
res.json({
success: 1,
message: responseMessages.listsFetched.success,
data: lists,
});
}).catch((error) => {
next(error);
});
} | [
"static listAllOfMyNews() {\n\t\treturn RestService.get('api/news');\n\t}",
"static async listStations(req, res) {\n const stations = await Station.retrieve();\n return res.json(stations);\n }",
"function listAll() {\n $scope.voters = VoterService.listAllVoters();\n }",
"list(_, res) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws debug data in foreground | drawDebugForeground() {
if (this.showDebug) {
var x = 15;
var y = 15;
this.ctx.fillStyle = Color.Style(Color.White50);
this.ctx.font = "12px monospace";
this.ctx.textBaseline = "top";
this.ctx.textAlign = "right";
this.ctx.fillT... | [
"function debug(text){\n stats.setContent(stats.getContent()+\"<br>\"+text);\n}",
"debugDrawObject(obj, time) {\n obj.debugDraw(time, this, this.drawContext);\n }",
"display() {\n //set the color\n stroke(this.element*255) ;\n //draw the point\n point(this.identity.x,this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that maps subscript to full feature name | function subToFeature(sub){
if(sub === "absmag")
return "Absolute Magnitude";
else if(sub === "mag")
return "Apparent Magnitude";
else if(sub === "ci")
return "Color Index";
else
return "Luminance";
} | [
"function nameOf(fun) {\n var ret = fun.toString();\n ret = ret.substr('function '.length);\n ret = ret.substr(0, ret.indexOf('('));\n return ret;\n }",
"function abbreviatedFun(fullname) {\n let array = fullname.split(' ');\n let result = array[0];\n for (i = 1; i < array.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the usage flags for a given track across every frame | getSoundEffectFlagsForTrack(trackId) {
return this.getSoundEffectFlags().map(flags => flags[trackId]);
} | [
"getSoundEffectFlags() {\r\n return this.decodeSoundFlags().map(frameFlags => ({\r\n [exports.FlipnoteSoundEffectTrack.SE1]: frameFlags[0],\r\n [exports.FlipnoteSoundEffectTrack.SE2]: frameFlags[1],\r\n [exports.FlipnoteSoundEffectTrack.SE3]: frameFlags[2]\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The first time the page is loaded. Get the entire transaction json > Call `LoadTransactions`. | async function OnLoadTransactions() {
const write_key = JSON.parse(localStorage.getItem('microprediction_key_current'))[0];
const url = base_url+write_key+"/";
resp = await get(url);
await LoadTransactions();
document.getElementById("box-href").href = "transactions/" + write_key + "/";
document.getElementBy... | [
"function init() {\n history = [];\n allTransactionsLoaded = false;\n\n account = StellarNetwork.remote.account(session.get('address'));\n account.on('transaction', function(data) {\n var transaction = {\n tx: data.transaction,\n meta: data.meta\n };\n\n history.unshift(tran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3. Summarize the nestedData at each level. This will facilitate easy reference to max and min values, for instance, at all levels of aggregation so that graphs can more easily be put on different scales. Should also facilitate normalizing values if needed and other manipulations. | function summarizeChildren(datum) {
function _summarize(datum) {
var descendantValues = datum.values.reduce((acc, cur) => {
cur.parent = datum;
return acc.concat(cur.values ? _summarize(cur) : cur.value);
}, []);
var pValues = returnPValues(datum);
function r... | [
"function returnNestedData(filters){\n var _nested = summarizeChildren({\n key: 'total',\n values: filterSections(filters).map(d => {\n var nested = nestBy([undefined, 'property', d, 'year'], filterData(filters));\n nested.forEach(datum => { // mutates nested\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
su/sudo/startstopdaemon work too badly with upstart and setuid is only available in > 1.4, hence this | function setupUGID(uid, gid) {
if (uid) {
if (!gid) {
gid = uid;
}
try {
process.setgid(gid);
util.log('changed gid to ' + gid);
process.setuid(uid);
util.log('changed uid to ' + uid);
} catch (e) {
util.log('Fa... | [
"function start () {\n let node = process.execPath\n let daemonFile = path.join(__dirname, '../daemon')\n let daemonLog = path.resolve(untildify('~/.hotel/daemon.log'))\n\n debug(`creating ${startupFile}`)\n startup.create('hotel', node, [daemonFile], daemonLog)\n\n console.log(` Started http://localhost:${c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return speed is RPM | function motorGetSpeed() {
return currentSpeedRpm;
} | [
"get speedVariation() {}",
"getSpeed() {\n return this.model ? this.model.getCurrentSpeedKmHour() : null;\n }",
"get sustainedClockSpeed() {\n return this.getNumberAttribute('sustained_clock_speed');\n }",
"_calculateTargetedSpeed() {\n if (this.mcp.autopilotMode !== MCP_MODE.AUTOPILO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a panel with a given id is expanded. | isExpanded(panelId) { return this.activeIds.indexOf(panelId) > -1; } | [
"_expandPanel(panel) {\n panel.expanded = true;\n }",
"function _isPanelOpen() {\n return $issuesPanel.is(\":visible\");\n }",
"_collapsePanel(panel) {\n panel.expanded = false;\n }",
"function searchPanelOpen(state) {\n var _a\n return (\n ((_a = state.field(searchS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
destroyEightQueens UI Data clear the game data from localStorage | destroyEightQueens(lsItem)
{
window.localStorage.removeItem( lsItem );
} | [
"function clear(){\n localStorage.clear();\n highScores=[];\n highScoreParent.innerHTML=\"\";\n }",
"function clearLeaderboard() {\n leaderboardArr = [];\n localStorage.clear();\n displayLeaderboard();\n}",
"function clearEmptyGames() {\n\n }",
"function clearScore() {\n localStorage.setI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |