query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
determine if session should be saved to store | function shouldSave(req) {
// cannot set cookie without a session ID
if (typeof req.sessionID !== 'string') {
debug(
'session ignored because of bogus req.sessionID %o',
req.sessionID
);
return false;
}
return !saveUninitializedSession && cookieId !== req.sessionID
? is... | [
"function isSaved(sess) {\r\n\t\t\treturn originalId === sess.id && savedHash === hash(sess);\r\n\t\t}",
"save() {\n var string = JSON.stringify(this[PINGA_SESSION_STATE]);\n\n localStorage.setItem(this.userId, string);\n }",
"isPersistent ()\n\t{\n\t\treturn tryPersistWithoutPromtingUser ();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new notification for App using WebKit Notification API (currently chrome only) | function createNotificationWebkit(title, message) {
if(!allowed){
return;
}
popup = notification.createNotification(icon, title, message);
popup.show();
window.setTimeout(function(){
popup.cancel();
}, delay);
} | [
"_createDesktopNotification() {\n const title = this.state.title ? this.state.title : '';\n const options = {\n icon: DESKTOP_NOTIFICATION_ICON,\n body: this.state.content ? this.state.content : '',\n };\n\n const notification = new Notification(title, options);\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to programmatically remove DOM elements created by Annotationeer to help in optimization when viewer is either scaled or rotated. | function clearAnnotationeerDOMElements() {
console.log('clearAnnotationeerDOMElements()');
for (var i=0; i<aTotalPages; i++) {
$('#pageContainer' + (i + 1) + ' .canvasWrapper').find('div[id^="highlight"]').each(function() {
$(this).remove();
});
$('#pageAnnotation' + (i + 1... | [
"function removeDOMGarbage() {\n $(\"[class*=\\\"sideshow\\\"]\").not(\".sideshow-mask-part, .sideshow-mask-corner-part, .sideshow-subject-mask\").remove();\n }",
"clear() {\n // Wipe out the DOM content.\n for (let [, containerElem] of this._containerHtmlElems) {\n $(containerElem).emp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a normalized version of the input array which maps the array elements to a range between 0 and 1 | function normalizeArray(array) {
var minValue = Math.min.apply(Math, array);
var maxValue = Math.max.apply(Math, array);
// Apply the function below to each array element (to generate a normalized value between 0 and 1)
return array.map(function (value) {
return (value - minValue) / (maxValue - minValue);... | [
"function normalize(arr, maxVal) {\n\t// Create copy\n\tvar myArr = new Array();\n\n\t// Normalize array\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tmyArr.push(arr[i]/maxVal);\n\t}\n\n\t// Return it\n\treturn myArr;\n}",
"function L2normalization(array){\r\n var normalizedArray = new Array();\r\n var powArra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search an array of spans for a span matching the given marker. | function getMarkedSpanFor(spans, marker) {
if (spans) for (var i = 0; i < spans.length; ++i) {
var span = spans[i];
if (span.marker == marker) return span;
}
} | [
"function linear_search(arr, target) {\n for (var i=0; i<arr.length; i++) {\n if (arr[i] == target)\n return \"Found\";\n }\n return \"Not Found\";\n}",
"function Q2(callback)\n\t{\n\t\tStudent.find({\n\t\t\tscores: {\n\t\t\t\t$elemMatch: { \n\t\t\t\t\tscore: { $gt: 93, $lt: 95} \n\t\t\t\t}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace all the properties of an existing pipeline stage with the values provided. The updated stage will be returned in the response. | replace(objectType, pipelineId, stageId, pipelineStageInput, options = { headers: {} }) {
return __awaiter(this, void 0, void 0, function* () {
const localVarPath = this.basePath + '/crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}'
.replace('{' + 'objectType' + '}', encod... | [
"function Stage(props) {\n return __assign({ Type: 'AWS::ApiGateway::Stage' }, props);\n }",
"async update(properties) {\n return spPostMerge(this, request_builders_body(properties));\n }",
"function updateData() {\n var pipelineSteps = {};\n if ($scope.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
We should add interactions to each of the view's handles | createView(){
super.createView();
if(this.getView()) {
for (let h of this.getView().handles) {
this.addInteractionsToElement(h);
}
// this.detach();
}
} | [
"_attachViewButtonHandlers(){\n\t\tvar self = this;\n\t\tthis.$viewButton.click(function(){\n\t\t\tself._viewButtonAction();\n\t\t});\n\t\treturn this;\n\t}",
"addViews(views) {\n for (let i = 0; i < views.length; i++)\n this.addView(views[i]);\n }",
"function setupView() {\n // set home butto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders new best height announcements | function renderHeightAnnouncement() {
var fsi = 2.5; // font size max increase
var td = 0.5; // top decrease (per animation segment)
var ha = -3; // height adjustment
var dur = 300; // duration (of each animation segment)
var c = "rgba( 130, 0, 0, 1 )"; // color (default to dark red)
if ( highestRedFlo... | [
"function genHeightChart(smart) {\n var patient = smart.patient;\n var pt = patient.read();\n var obv = smart.patient.api.fetchAll({\n \n // Note - I don't know how to sort results by time or anything. Someone\n // should figure that out\n type: 'Observation',\n query: {\n code: {\n $o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add timezone abbreviation support for ie6+, Chrome, Firefox | function timeZoneAbbreviation() {
var abbreviation, date, formattedStr, i, len, matchedStrings, ref, str;
date = (new Date()).toString();
formattedStr = ((ref = date.split('(')[1]) != null ? ref.slice(0, -1) : 0) || date.split(' ');
if (formattedStr instanceof Array) {
matchedStrings = [];
f... | [
"function timeZoneAbbreviation() {\n\t var abbreviation, date, formattedStr, i, len, matchedStrings, ref, str;\n\t date = new Date().toString();\n\t formattedStr = ((ref = date.split('(')[1]) != null ? ref.slice(0, -1) : 0) || date.split(' ');\n\t if (formattedStr instanceof Array) {\n\t matchedStr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Ideally, we'd decouple the calculation of the path from animating the path. PathAnimation creates an animation for p that goes from (x1, y1) to (x2, y2) with an approximation deviation to the right of the given angle th. | function PathAnimation(p, x1, y1, x2, y2, th) {
this._p = p;
this._x1 = x1;
this._y1 = y1;
this._x2 = x2;
this._y2 = y2;
this._th = th;
} | [
"function path() {\n \"use strict\";\n var ret = { animate: \"path\",\n path: null,\n forward: [1, 0, 0],\n delay: 0,\n duration: 0,\n alpha: \"linear\"};\n\n ret.path = arguments[0]; // path\n if( arguments.length > 1 ) {\n ret.delay = _number... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the given object is an instance of Environment. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process. | static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Environment.__pulumiType;
} | [
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Host.__pulumiType;\n }",
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return ob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rearrange Vacation Date list | function rearrangeListOfVacationDates() {
var startDate, vacationDuraionTotal, tagID;
startDate = $('#startDateE').val();
for (var i = 0; i < listOfVacation.length; i++) {
vacationDuraionTotal += parseInt(listOfVacation[i].vacationStartDateE);
listOfVacation[i].vacationStartDateE = startDate... | [
"function getDateList(){\n return getContractMonthInfoList()\n .reduce(function(concatList,v,i,arr){ return concatList.concat(v.dateList.concat()) }, [])\n}",
"function sortLectures(arr) {\n return arr.sort((a,b) => DateTime.fromFormat(a.date, 'yyyy-MM-dd hh:mm') - DateTime.fromFormat(b.date, 'yyyy-MM-dd hh:m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[Editor cusomization Story 3.19] change the theme of the editor. Parameters: The selected input from the 'theme' dropdownlist. Returns: none. Author: Mimi | function changeTheme(){
var new_theme = $('#theme').val();
editor.setTheme("ace/theme/"+new_theme);
} | [
"function setupTheme() {\n var theme = interactive.theme;\n\n if (arrays[\"a\" /* default */].isArray(theme)) {\n // [\"a\", \"b\"] => \"lab-theme-a lab-theme-b\"\n theme = theme.map(function (el) {\n return 'lab-theme-' + el;\n }).join(' ');\n } else if (theme) {\n theme = 'lab-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable the submit button and make an ajax POST request in order to compute the word frequencies. | function count_word_frequencies() {
$('#text_submit_button').prop("disabled", true);
$.ajax({
url : '/',
data : {'input_text' : $('#text_input').val()},
type : 'POST',
success : update_view,
error: function() {
$("tbody").html("Could not parse any data.");
$('#text_submit_button... | [
"function submitWord() {\n\tif (player != \"\" && room != -1 && word != \"\") {\n\t\tdebug(\"-\");\n\t\tvar word = document.myForm.word.value.toUpperCase().replace(/Ä/g, \"a\").replace(/Ö/g, \"o\");\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=submitword&player=\" + player + \"&passcode=\" + passcode + \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the most recent nick who has talked. | function getMostRecentNick(scope, token) {
if (!scope.buffer) return [];
var keys = Array.from(scope.buffer.messages.keys()), nicks = [], ltoken = token.toLowerCase();
keys.sort();
keys.reverse();
for (var i = 0; i < keys.length; i++) {
var messageId = keys[i];
... | [
"function getLastUsername() {\n\treturn $(\".message\").last().find($(\".message_info_username\")).text().trim().toLowerCase(); // get the last post username\n}",
"function getNickName() {\r\n \r\n return $(\"#loggedin\").text().substring(9);\r\n \r\n \r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts alert node into the specified container | insert(containerId = null) {
containerId = (containerId == null) ? this.id + '_container' : containerId;
let container = document.getElementById(containerId);
if (container == null) {
throw 'Container not found.';
}
let el = Alert.getExisting(this.id);
if ... | [
"injectTemplate(container, content) {\n container.innerHTML = TEMPLATE;\n const body = container.querySelector('.bitski-dialog-body');\n if (body) {\n body.appendChild(content);\n }\n }",
"function alertMessageAdd() {\n\t\t\talert.css('display', 'block');\n\t\t}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by Python3Parsertest_nocond. | visitTest_nocond(ctx) {
console.log("visitTest_nocond");
if (ctx.or_test() !== null) {
return this.visit(ctx.or_test());
} else {
return this.visit(ctx.lambdef_nocond());
}
} | [
"visitNot_test(ctx) {\r\n console.log(\"visitNot_test\");\r\n if (ctx.NOT() !== null) {\r\n return {\r\n type: \"UnaryExpression\",\r\n operator: \"not\",\r\n operand: this.visit(ctx.not_test()),\r\n };\r\n } else {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
page constructor (checkbox input) creates a template for the checkbox page | function Page2(cathead, arg2) {
this.catheader = createElement("h1",'');
this.header = createElement('h2', cathead);
this.options = [];
var container = createDiv('');
// creates chekboxes based on the length of the chosen array.
for (n = 0; n < arg2.length; n++) {
this.options.push(createCheckb... | [
"function checkboxTemplate(name, value, label){\n var $tpl=\"<li>\";\n $tpl+=\"<input type='checkbox' name='\"+name+\"' value='\"+value+\"' />\";\n $tpl+=label;\n $tpl+=\"</li>\";\n return $tpl;\n }",
"function initCheckbox() {\n $(checkbox).each(function () {\n if ($(this).is(':... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method: moveTo Move the fader so that when the hand is at given position, the will be given value Arguments: position position [x,y,z] value target value for given position | function moveTo(position, value) {
if (api.flip) value = 1 - value;
center[api.orientation] = position[api.orientation] + ((0.5 - value) * api.size);
} | [
"moveTo(x, y) {\n let coordinates = this.getXY();\n this.x = x + coordinates.x;\n this.y = y + coordinates.y;\n }",
"moveAround() {\r\n\r\n\r\n }",
"function moveToDoorLocation() {\n penUp();\n turnRight(24);\n moveForward(50);\n turnRight(90);\n moveForward(20);\n turnRight(90)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Service to access study annotation types. | function StudyAnnotTypesService(biobankXhrReqService, domainEntityService) {
var services = {
getAll : getAll,
get : get,
addOrUpdate : addOrUpdate,
remove : remove,
valueTypes : valueTypes
};
return services;
//-------
function uri(annotTypeUri, st... | [
"annotation(type) {\n for (let ann of this.annotations) if (ann.type == type) return ann.value\n return undefined\n }",
"static define() {\n return new AnnotationType()\n }",
"function getAnnotation (path: NodePath): TypeAnnotation {\n let annotation;\n try {\n annotati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run the bucketing during audience evaluation This function always returns true to prevent having any impact on the actual audience | function bucketFromAudience(eid) {
var ready = false;
var obj = null;
// Look for the experiment in the config
for (var key in window.optly_mvt) {
obj = window.optly_mvt[key];
if (obj.id == eid) {
break;
}
}
if (obj === null) {
return true;... | [
"function bucketMVT(obj) {\n var ready = false;\n // check if this experiment has an audience\n var audiences = getAudience(obj);\n if (audiences === null) {\n // no audience so perform the bucketing now\n findBucket(obj);\n } else {\n // the experiment ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Joins an interest group and runs an auction, expecting no winner to be returned. "testConfig" can optionally modify the interest group or auctionConfig. | async function runBasicFledgeTestExpectingNoWinner(test, testConfig) {
const uuid = generateUuid(test);
await joinInterestGroup(test, uuid, testConfig.interestGroupOverrides);
let result = await runBasicFledgeAuction(
test, uuid, testConfig.auctionConfigOverrides);
assert_true(result === null, 'Auction un... | [
"function C101_KinbakuClub_RopeGroup_Run() {\n\tBuildInteraction(C101_KinbakuClub_RopeGroup_CurrentStage);\n\t\n\t// changing images\n\t// Group view\n\tif (C101_KinbakuClub_RopeGroup_CurrentStage == 100) {\n\t\tDrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/RopeGroupAmelia.png\", 600, 20);\n\t\tDrawImage(Cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update admin user password and email. | static updatePassword(email, password, newEmail = '', newPassword = '', otp = null){
let kparams = {};
kparams.email = email;
kparams.password = password;
kparams.newEmail = newEmail;
kparams.newPassword = newPassword;
kparams.otp = otp;
return new kaltura.RequestBuilder('adminuser', 'updatePassword', kpa... | [
"updateUser (id, email, newEmail, username, password) {\n return apiClient.updateUser(\n storage.getToken(),\n id,\n email,\n newEmail,\n username,\n password\n )\n }",
"function resetAdminPassword(req, res, next) {\n auth.session(req, res, function() {\n User.findOne(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a parameter group (deliminated by tags) within a panel. | function group(label) {
// parameter groups inside panels
var $label = $(label),
$description = $label.next('description');
return {
label: $label.text(),
description: $description.text(),
parameters: _.map($description.nextUntil('label'), param)
};
} | [
"function _parsePanelInfo( content ) {\n\n\t\t// Cuts irrelevant data from string, leaving only pipe-separated information\n\t\tvar content = content.slice(7, -1);\n\t\tcontent = content.split( '|' );\n\n\t\tvar l = content.length;\n\n\t\tfor (var i = 0; i < l; i++) {\n\t\t\tcontent[i] = content[i].split( '=' );\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validator for a market file. Outputs warnings and errors to the console. Updates the global exit code. filePath: Path to the market file | function MarketValidator(filePath) {
this.filePath = filePath;
this.errorsCount = 0;
this.warningsCount = 0;
this.validate = function() {
var data = fs.readFileSync(this.filePath, 'utf8');
var json = JSON.parse(data);
var features = json.features;
var cityName = this.ge... | [
"validateFilePath(file) {\n try {\n if (fs.existsSync(file)) {\n return;\n } else {\n // File wasn't found, but we didn't get an error\n console.error('Provided file path was not valid or not found. Please try again.');\n proce... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_______________________________________________________ initImport checks if the server is running, and calls sendImportPaths with importFormData, otherwise calls updateLoadingGif Value Parameters importFormData JSON form data from the import form Return Value void ______________________________________________________... | function sendImportPaths(importFormData){
getSettings().then((data)=>{
// Save the analysis type to the settings
var settings = data;
settings['analysis_type'] = importFormData.analType;
updateSettings(settings);
changeiFrameSrc();
importData(importFormData);
... | [
"function importData(importFormData){\n if (importPaths.label == undefined) importPaths.label = \"\"\n if(isDev()){\n var options = {\n scriptPath: path.join(__dirname, ENGINE_PATH),\n args: [importPaths.label, JSON.stringify(importPaths.runs), JSON.stringify(importFormData), TEMP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates the part of energy that is influenced by a free base (even if in mfemode only parts of the structures are analyzed, the energy difference refers to the whole structure) | function get_BasePart_Energy(pos_i, int_seq)
{
var bp_i; // assignment of the base
var size; // loop size
var pos_BP_vor, pos_BP_nach; // pos. of the BPs that enclose the free base (in BP_Order)
var i, j;
var group_i, group_j; // left and right border of the g... | [
"getNetEnergy() {\n return this.maxEnergy - this.fatigue\n }",
"function EnergyDiff(pos_j, sequence)\n{\n var pos_i; // binding pos. of pos. pos_j, if a BP is at pos. pos_j\n var bp_i_new, bp_j_new; // mutated assignments of the bases of the BP\n var bp_assign_new, base_assign_new; //muta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
datasetQuery creates an SQL query for a wide domain example SELECT COUNT(CASE WHEN month = '201161' THEN 1 END) one of the above for every domain value (month/camera/law) WHERE ~~~~~ and it joins the standard WHERE from the query JSON | function datasetQuery(query){
var select = "SELECT";
var params = {};
var builtConditions = generateConditions(query);
for(var paramsk in builtConditions.params){
if (!builtConditions.params.hasOwnProperty(paramsk)) continue;
params[paramsk]=builtConditions.params[paramsk];
}
for(var i = 0; i ... | [
"prepareTimeline(queryId, queryOutput, dateField) {\n\t\tvar timelineData = [];\n\t\tfor (let key in queryOutput.aggregations) {\n\t\t\tif (key.indexOf(dateField) != -1) {\n\t\t\t\tvar buckets = queryOutput.aggregations[key][dateField].buckets;\n\t\t\t\tbuckets.forEach((bucket) => {\n\t\t\t\t\tvar year = parseInt(b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when on win menu, goes back to menu | function backToWinMenu() {
changeVisibility("menu");
changeVisibility("winScreen");
} // backToWinMenu | [
"function backToLoseMenu() {\n changeVisibility(\"menu\");\n changeVisibility(\"loseScreen\");\n} // backToLoseMenu",
"function goBack(){\n if(screen.current == screen.combat) showMain();\n else if(screen.current == screen.input) setMain(createCombatTable(), screen.combat);\n}",
"function backToMain... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check member name to display events | function checkMember(name) {
let newArr = [];
name !== 'All members' ?
arrEVs.map((w) => {
if (w.parts.includes(name)) {
newArr.push(w);
}
}) : newArr = [...arrEVs];
clearEvents();
trs.length ? drawEvent(newArr) : null;
} | [
"function checkEventName(event) {\n if (event.name === null) {\n return '';\n } else {\n return event.name;\n }\n}",
"isMember(state) {\n return state.oauth.user !== null && ['board', 'member'].indexOf(state.oauth.user.level) !== -1;\n }",
"function hasEvent(eventsNames, oneEvent){\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./node_modules/reactvirtualized/dist/es/Grid/defaultCellRangeRenderer.js Default implementation of cellRangeRenderer used by Grid. This renderer supports cellcaching while the user is scrolling. | function defaultCellRangeRenderer(_ref) {
var cellCache = _ref.cellCache,
cellRenderer = _ref.cellRenderer,
columnSizeAndPositionManager = _ref.columnSizeAndPositionManager,
columnStartIndex = _ref.columnStartIndex,
columnStopIndex = _ref.columnStopIndex,
deferredMeasurementCache = _ref.... | [
"function defaultCellRangeRenderer(_ref) {\n var cellCache = _ref.cellCache,\n cellRenderer = _ref.cellRenderer,\n columnSizeAndPositionManager = _ref.columnSizeAndPositionManager,\n columnStartIndex = _ref.columnStartIndex,\n columnStopIndex = _ref.columnStopInd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all repo count from github for the rendered review item and set the state. | componentDidMount() {
axios
.get(
`https://api.github.com/search/repositories?q=${this.props.review.itemName}`
)
.then(res =>
this.setState({
githubReposCount: res.data.total_count
})
)
... | [
"async getApprovals(prNum) {\n let call =\n \"https://api.github.com/repos/\" +\n this.props.content +\n \"/pulls/\" +\n prNum +\n \"/reviews\";\n let reviews = await this.fetchGithub(call);\n let sum = 0;\n for (let i = 0; i < reviews.length; i++) {\n if (reviews[i].state ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
componentDidMount Function called after the component mounts. Loads the recommended items | componentDidMount() {
this._isMounted = true;
this.loadRecommendedItems();
} | [
"componentDidMount(){\n this.getItems()\n }",
"componentDidMount() {\n \n this.loadHoldings();\n\n }",
"async componentDidMount() {\n this._loadFontsAsync();\n await this.setRoute();\n this.getTasks();\n }",
"componentDidMount() {\n this.props.getDossiers();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkActivityOpened helper method to set the activities to opened or closed | checkActivityOpened(r3a1_one, r3a1_two, r3a1_three, r3a1_four, r3a1_five, r3a1_six) {
//this.r3a1_activityOneOpened = r3a1_one;
//this.r3a1_activityTwoOpened = r3a1_two;
//this.r3a1_activityThreeOpened = r3a1_three;
//this.r3a1_activityFourOpened = r3a1_four;
//this.r3a1_activityFiveOpened = r3a1_fi... | [
"function ActivityStarted(){\n\n\tif (g_bFullScreen) {\n\t\tOnResize(g_ConWidth, g_ConHeight, 2);\n\t\tDVD.CursorType = 0;\n\t}\n\n\tg_bActivityDeclined = false;\n\tUpdateDVDTitle();\n\t//MFBar.MessageBox(\"Activity Started\", \"Status\");\n}",
"validateActivityStatus() {\r\n let res = this.state.selectedD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decode a signed 64bits integer | function read64() {
var bytes = readBytes(_leb.MAX_NUMBER_OF_BYTE_U64);
var buffer = Buffer.from(bytes);
return (0, _leb.decodeInt64)(buffer);
} | [
"function decode_int(v) {\n return bigEndianToInt(v);\n }",
"function parseToSignedByte(value) {\n value = (value & 127) - (value & 128);\n return value;\n}",
"function divmodInt64(src) {\n var hi32 = Math.floor(src / V2E32);\n var lo32 = src - (hi32 * V2E32);\n return { hi32: hi32, lo3... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function initizlies the 9 CellType objects that serve as a lookup table for when we are running the simulation so that we know which neighboring cells have to be examined for determining the next frame's state for a given cell. | function initCellLookup()
{
// WE'LL PUT ALL THE VALUES IN HERE
cellLookup = new Array();
// TOP LEFT
var topLeftArray = new Array( 1, 0, 1, 1, 0, 1);
cellLookup[TOP_LEFT] = new CellType(3, topLeftArray);
// TOP RIGHT
var topRightArray = new Array(-1, 0, -1, 1,... | [
"setupBoard() {\n for (let i = 0; i < this.columns; i++) {\n this.board[i] = [];\n\n for (let j = 0; j < this.rows; j++) {\n // Create new cell object for each location on board\n this.board[i][j] = new Cell(i * this.w, j * this.w, this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a given method under the given name to the Date prototype if it doesn't currently exist. | function add(name, method) {
if( !Date.prototype[name] ) {
Date.prototype[name] = method;
}
} | [
"function addMethod(key) {\n Cacher.prototype[key] = function () {\n return this.query(key, Array.prototype.slice.call(arguments));\n };\n}",
"function overridePrototype(prototype, methodName, func) {\n prototype['_' + methodName] = prototype[methodName];\n prototype[methodName] = func;\n }",
"suppo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes the unit name of the largest wholeunit period of time. For example, 48 hours will be "days" whereas 49 hours will be "hours". Accepts start/end, a range object, or an original duration object. | function computeGreatestUnit(start, end) {
var i;
var unit;
var val;
for (i = 0; i < exports.unitsDesc.length; i++) {
unit = exports.unitsDesc[i];
val = computeRangeAs(unit, start, end);
if (val >= 1 && isInt(val)) {
break;
}
}
return unit; // will be ... | [
"function duration_within_display_range(range_start, range_end, event_start, event_end) {\n if (event_start < range_start) {\n return duration_seconds_to_minutes(event_end - range_start);\n } else if (event_end > range_end) {\n return duration_seconds_to_minutes(range_end - event_start);\n } else... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle user click on Rectify button calculate homography apply projective transformation | function handleRectify() {
if (coords.length < 4) alert("Select 4 points!");
let [w, h] = findMinDims(coords);
// Back-out any reduction to apply homography to full-size image
w = Math.floor(w / reduction);
h = Math.floor(h / reduction);
let _coords = coords.map(c => [
Math.floor(c[0] /... | [
"toggleProjectionMatrixHandInPlace() {\n const m = this._m;\n m[8] *= -1;\n m[9] *= -1;\n m[10] *= -1;\n m[11] *= -1;\n this._markAsUpdated();\n }",
"saveRectangularFace() {\n this.clearHighlights();\n d3.selectAll('#grid .point-path').remove();\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Javascript fn to Export to Word | function Export2Doc(element, filename = ''){
var preHtml = "<html><head><meta charset='utf-8'><title>Export HTML To Doc</title><link rel='stylesheet' href='/static/css/style.css'></head><body>";
var postHtml = "</body></html>";
var iframe=document.getElementById("awindow");
var report_template=ifram... | [
"function exportHTML(html){\r\n var header = \"<html xmlns:o='urn:schemas-microsoft-com:office:office' \"+\r\n \"xmlns:w='urn:schemas-microsoft-com:office:word' \"+\r\n \"xmlns='http://www.w3.org/TR/REC-html40'>\"+\r\n \"<head><meta charset='utf-8'><title>Export HTML to Word D... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
typescript types aren't available so we load javascriptstyle instead of using typescript's import Scan a folder, running parser on each file it finds TODO: implement configObjs.state and configObjs.catalog, which are just stubs for now TODO: use interfaces instead of "any" here | function scanDir(configObjs, parser) {
var config = configObjs.config;
var state = configObjs.state;
var catalog = configObjs.catalog;
// TODO: allow schema(s) to be passed in in config
var schema = null;
return fse
.readdir(config.target_folder)
.then(function (filelist) {
... | [
"cfg2ast (cfg) {\n /* establish abstract syntax tree (AST) node generator */\n let asty = new ASTY()\n const AST = (type, ref) => {\n let ast = asty.create(type)\n if (typeof ref === \"object\" && ref instanceof Array && ref.length > 0)\n ref = ref[0]\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks git for local untracked changes and allows the user to authorize stashing those changes for later and continuing | function checkForUntrackedChanges(cb){
git.changes((changes) => {
if(changes){
if(changes.untracked){
mess.warning("You have uncommitted changes. They will be stashed and returned to you after deployment");
mess.yesOrNo("Stash changes and continue?", rl, (yes) => ... | [
"async assertLocalOnlyGitRepository() {\n // make sure, git command succeeds\n const errResult = (await this.execGitCaptureErr(`remote -v`)).trim();\n if (errResult) {\n throw new Error(`\"git remote -v\" failed - \"${errResult}\"`);\n }\n const result = (await this.execCaptureOut(`${this.gitCom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the standardization scheme to be used. | SetupStandardization() {
if (!this._callbackStandardize) {
// no callback; useDefaultStandardization will drive the behavior
return;
}
// if the arguments indicate both standardization techniques (stock and
// custom), we use custom, i.e. the user's callback
... | [
"function determineColorScheme() {\n setColorScheme(userPreferences.colorScheme);\n}",
"setSurroundModeToStandard() {\n this._setSurroundMode(\"s_standard\");\n }",
"function getSchemeDefinition(options) {\n let definedSchemesNames = Object.keys(definedSchemes);\n // verify that its not custo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
7 huboVentas(mes, anio): que indica si hubo ventas en un mes determinado. | function huboVentas (mes, anio) {
return ventasMes(mes, anio) > 0;
} | [
"function siguienteMes(){\n if (numeroMes !== 11){\n numeroMes++;\n }else{\n numeroMes=0;\n anioCorriente++;\n }\n\n setearFechaNueva();\n}",
"function getImonesPelnas() {\n\n return imonesPajamos - kitosImonesIslaidos - getDarbuotojoAtlyginimas(valandosPovilas)- getDarbuotojoAtl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RTG[] Round To Grid 0x18 | function RTG(state) {
if (exports.DEBUG) { console.log(state.step, 'RTG[]'); }
state.round = roundToGrid;
} | [
"function roundToGrid(numb) {\n\treturn Math.round(numb/10) * 10;\n}",
"function drawGrid(){\r\n\t\r\n\tfor (var i = 0; i < grid.length; i++){\r\n\t\tfor (var j = 0; j < grid[i].length; j++){\r\n\t\t\t//Set the color to the cell's color\r\n\t\t\tctx.fillStyle = grid[i][j].color;\r\n\t\t\t//Offset each reactangle ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Each location has several descriptions. We select one at random. | function getRandomDescription(descriptions) {
d = descriptions
var i = 1;
var rand = Math.floor(Math.random() * d.length);
if (rand == 0) { rand = 1 }
for (i = 1; i < d.length; ++i) {
if (i == rand) {
return d[i]
}
}
} | [
"function randomLocation(suggestedLocations) {\n var obj_keys = Object.keys(suggestedLocations);\n var ran_key = obj_keys[Math.floor(Math.random() * obj_keys.length)];\n selectedLocation = suggestedLocations[ran_key];\n console.log(selectedLocation);\n console.log(\"Selected restaurant latitude is \" + se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API for creating a postit | static async apiCreatePostit(req, res, next) {
try {
const title = req.body.title;
const content = req.body.content;
const deadline = req.body.deadline;
const date = new Date();
const postitAddRes = await PostitsDAO.addPostit(
title,
content,
deadline,
... | [
"function Post(tistoryObj) {\r\n this.parser = tistoryObj.parser;\r\n this.baseurl = tistoryObj.baseurl;\r\n this.params = {\r\n access_token: tistoryObj.access_token,\r\n format: tistoryObj.format\r\n }\r\n\r\n this._requiredParams = {\r\n 'write': ['title'],\r\n 'modify'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create the alarm and initial notification | function createAlarm() {
// default delay of 60 seconds
var userDelay = 60;
if (userInput() != '') {
userDelay = parseInt(userInput());
}
var alarmInfo = {
delayInMinutes: userDelay,
periodInMinutes: userDelay
}
chrome.alarms.create(alarmName, alarmInfo);
chrome.not... | [
"createNotifications(id, date, time) {\n \n const body = `Beep Beep!! ${new Date(date).toDateString()} ${this.getTimestamp(date, time).toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true })}`;\n const icon = \"alarm-clock-icon.png\"; \n \n const notificationO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Card param : size => little / medium / big player => player id return : html element of card | cardPlayer(size = 'medium', playerId,elementId = null, theme = 'light')
{
if(playerId == null)
{
throw new Error('Missing player Id')
}
//request player
this.getOneById('players',playerId).then(
(res)=> {
//generation card
... | [
"function makeCard() {\n let card = document.createElement(\"div\");\n card.classList.add(\"card\");\n getRandomDesign(card);\n card.addEventListener(\"click\", cardSelect);\n $(\"game\").append(card);\n }",
"buildPlayingCard(cardFace, suitIcon, faceColor, suitColor) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper method, which takes a HTML string as an input and returns a HTML element object | elementFromHTML(html) {
const div = document.createElement('div');
div.innerHTML = html.trim();
return div.firstChild;
} | [
"function buildDom(htmlString) {\r\n const div = document.createElement(\"div\");\r\n div.innerHTML = htmlString;\r\n return div.children[0];\r\n}",
"function createElement(htmlString) {\n var div = document.createElement('div');\n div.innerHTML = htmlString;\n \t\n \t// console.log(div.children);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get pricing for configurable resource from resource Query | function getConfigPricingFromResourceQuery(ownerid, elements, callback) {
var configJson = {};
// Identify configurable vs
if((elements.uri).match('vs/') && (elements.uri).match('/configurable')){
configJson.volumeStorageUri = elements.uri;
if(elements.parameters && elements.parameters.size... | [
"getCurrency() {\n const tier = this.getTier();\n return get(tier, 'currency', this.props.data.Collective.currency);\n }",
"function getProductPrices()\n {\n $.getJSON(productPricesEndpoint, function (data) {\n prices = data;\n\n updateProductPrices();\n });\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the children of an existing block for creating/appending to a new page/block | async formatChildBlocks(block) {
const children = block.children;
if (!block.has_children) {
return [];
}
(await Promise.all(children.map((child) => this.formatChildBlocks(child))))
.forEach((c, i) => {
const child = children[i];
if (child.type === "child_pag... | [
"maintainImmediateChildren(CE) {\n let blockEls = BlockElements;\n\n let P,\n children = [].slice.apply(CE.childNodes);\n\n children.forEach(child => {\n if(blockEls[child.nodeName]) {\n\n /** Removes empty span tags. */\n if(child.firstChild && child.childNodes.length) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shows the annotation modal | showAnnotationForm() {
this.setState({showAnnotationModal: true})
} | [
"function createAnnotationModal(annotationText) {\n var overlay = (document.getElementById('overlay') !== null ? \n document.getElementById('overlay') : document.createElement('div'));\n overlay.id = \"overlay\";\n \n var innerDiv = document.createElement('div');\n var titleText = document.create... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true if the field with name of name1 occurs before field with name2 | function occursBefore(name1, name2) {
var field1 = jQuery("[name='" + escapeName(name1) + "']");
var field2 = jQuery("[name='" + escapeName(name2) + "']");
field1.addClass("prereqcheck");
field2.addClass("prereqcheck");
var fields = jQuery(".prereqcheck");
field1.removeClass("prereqcheck");
... | [
"function compare(a,b) {\n var compareOn = a.stopName ? 'stopName' : 'routeShortName';\n if (a[compareOn] < b[compareOn]) {\n return -1;\n }\n if (a[compareOn] > b[compareOn]) {\n return 1;\n }\n return 0;\n }",
"static isBefore(a, b) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkGame() checks to see if the game is over, and alert victory condition | function checkGame(){
if(victoryCondition){console.log("You Won!");}else{ console.log("You lose!");}
} | [
"checkNextGame (){\n\n }",
"function checkEngage(cell, opponent) {\n if (cell === opponent) {\n // TODO: basic support for eating power-ball (which is not in the game yet)\n if (gPacman.isSuper) {\n console.log('Ghost is dead');\n } else {\n clearInterval(gIntervalGhosts);\n gIntervalG... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsercontainer_tableview_name. | visitContainer_tableview_name(ctx) {
return this.visitChildren(ctx);
} | [
"visitTableview_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSelected_tableview(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitTablespace(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function onViewType(e)\n{\n\tvar viewtype = $F($('viewtype')); // 0: autodetect, 1:table;\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Watch for mediaQuery breakpoint activations | observeActivations() {
const queries = this.breakpoints.items.map(bp => bp.mediaQuery);
this.hook.registerBeforeAfterPrintHooks(this);
this.matchMedia
.observe(this.hook.withPrintQuery(queries))
.pipe(tap(this.hook.interceptEvents(this)), filter(this.hook.blockPropagation... | [
"function checkBreakpoint() {\n\t\t\t// Use an actual media-query-driven property of an element\n\t\t\t// to ensure JS and CSS are synced.\n\t\t\tvars.modelWidth = $(settings.modelSelector + ':first').outerWidth();\n\n\t\t\t// Loop through breakpoints and try to find a match with the model's current width.\n\t\t\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End Bind IT Franchisee Name Dropdown Start Bind Employee Dropdown | function BindEmployeeName()
{
debugger;
$.ajax({
type: "POST",
url: "WorkAllocation.aspx/BindEmployeeName",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
console.log(r);
var dept = $("... | [
"function BindFranchiseeName(dept, customUrlIT) { \n $('.FranchiseeName option').remove();\n $.ajax({ \n type: \"POST\",\n url: customUrlIT,\n data: '{}',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (r) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Language: PostgreSQL and PL/pgSQL | function pgsql(hljs) {
const COMMENT_MODE = hljs.COMMENT('--', '$');
const UNQUOTED_IDENT = '[a-zA-Z_][a-zA-Z_0-9$]*';
const DOLLAR_STRING = '\\$([a-zA-Z_]?|[a-zA-Z_][a-zA-Z_0-9]*)\\$';
const LABEL = '<<\\s*' + UNQUOTED_IDENT + '\\s*>>';
const SQL_KW =
// https://www.postgresql.org/docs/11/static/sql-key... | [
"function compile(sql) {\n // Text holds the query string.\n var text = '';\n // Values hold the JavaScript values that are represented in the query\n // string by placeholders. They are eager because they were provided before\n // compile time.\n var values = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encrypts string using s as a key and AES as the cipher | function aesEncrypt(str, s) {
// Turns our integer key into a 128-bit key
var key = generate128BitKey(s)
// Converting our text into to bytes
var textBytes = aesjs.utils.utf8.toBytes(str)
// Encyrypting our bytes using AES Counter mode
var aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.... | [
"function encryptPayload(payload) {\n return CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(payload), key, {iv: iv}).toString();\n}",
"function encryptData(textToEncryp){\n \n // Cipher text\n const cipher = crypto.createCipheriv('aes256', cipherKey, initializationVector);\n \n // Text encrypted w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
attach event handler function to beforePrint event | function attachOnBeforePrintEvent($iframe, beforePrintHandler) {
var win = $iframe.get(0);
win = win.contentWindow || win.contentDocument || win;
if (typeof beforePrintHandler === "function") {
if ('matchMedia' in win) {
win.ma... | [
"function printit(){\r\n frames[\"printPage\"].focus();\r\n frames[\"printPage\"].print();\r\n unloadMessage();\r\n }",
"function removeLazyLoadingOnPrint() {\r\n if (\"onbeforeprint\" in window) {\r\n window.onbeforeprint = removeLazyLoading;\r\n }\r\n\r\n}",
"function customer_printout()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task para gerar o scieloarticlestandalone.less | function processScieloArticleStandaloneLess(){
return src(target_src['less']['scielo-article-standalone'])
.pipe(sourceMaps.init({loadMaps: true}))
.pipe(concat(output['css']['scielo-article-standalone']))
.pipe(less(output['css']['scielo-article-standalone']))
.pipe(minifyCSS())
.pipe(sourceMap... | [
"function processScieloBundlePrintLess(){\n return src(target_src['less']['scielo-bundle-print'])\n .pipe(sourceMaps.init({loadMaps: true}))\n .pipe(concat(output['css']['scielo-bundle-print']))\n .pipe(less(output['css']['scielo-bundle-print']))\n .pipe(minifyCSS())\n .pipe(sourceMaps.write('./')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return one of this pattern: 1. a=others, b=null|undefined => _a_ 2. a=null|undefined, b=others => _b_ 3. Others => `undefined` | function xorForMaybe(a, b) {
var aIsSome = Maybe_1.isNotNullAndUndefined(a);
var bIsSome = Maybe_1.isNotNullAndUndefined(b);
if (aIsSome && !bIsSome) {
return a;
}
if (!aIsSome && bIsSome) {
return b;
}
// XXX: We can choose both `null` and `undefined`.
// But we return `... | [
"static coalesce(a, b, c) {\n return this.isDefined(a) ? a : (this.isDefined(b) ? b : c);\n }",
"function maybe_3(m, nothing) /* forall<a> (m : maybe<a>, nothing : a) -> a */ {\n return $default(m, nothing);\n}",
"function firstDefined(){\n var undefined, i = -1;\n while (++i < argumen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send notification to the push service. Remove the subscription from the `subscriptions` array if the push service responds with an error. Subscription has been cancelled or expired. | function sendNotification(subscription) {
webPush.sendNotification(subscription)
.then(function () {
console.log('Push Application Server - Notification sent to ' + subscription.endpoint);
}).catch(function () {
console.log('ERROR in sending Notification, endpoint removed ' +... | [
"async function send() {\n console.log('Registering service worker...')\n const register = await navigator.serviceWorker.register('/serviceWorker.js', {\n // this worker is applied to the home page/index\n scope: '/'\n })\n console.log('Service worker registered')\n\n console.log('Registering push...')\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates weatherurl with city/region/country pulled from ipapi api | function createWeatherURL() {
weatherURL = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "," + region + "," + country + "&units=imperial&appid=" + APIKey
} | [
"function getWeatherApiUrl(latitude, longitude) {\n var apiUrl = \"https://api.wunderground.com/api/1bc2b90471cb41bd/conditions/q/\";\n return apiUrl + latitude + \",\" + longitude + \".json\";\n }",
"function getUrl(city, type){\n var count = type === 'weather' ? 1 : 5\n var params = {\n q: cit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if we're at the beginning. | function atBeginning() {
return currentSceneIndex === 0;
} | [
"isStart(editor, point, at) {\n // PERF: If the offset isn't `0` we know it's not the start.\n if (point.offset !== 0) {\n return false;\n }\n\n var start = Editor.start(editor, at);\n return Point.equals(point, start);\n }",
"isPreceding(node) {\n var nodePos, thisPos;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store Comment in Object Adds the command line options to an object | storeCommentsInObject(obj,commandlineargs,vars=null,systeminfo=null) {
let cmt= { 'command ' : commandlineargs };
if (vars)
cmt['parameters']=JSON.parse(JSON.stringify(vars));
if (systeminfo)
cmt['systeminfo']=JSON.parse(JSON.stringify(systeminfo));
obj.addCommen... | [
"get commandJSON() {\n return {\n name: this.commandName,\n description: this.description,\n default_permission: this.defaultPermission,\n ...(this.options ? { options: this.options } : {})\n };\n }",
"function Option() {\n Argument.apply(this, argumen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function select/deselect checkboxes from a list. The selector checkbox must have id 'toggle' and checboxes 'cb + n' formid => the form id n => numeber of elements to select | function selectAll(formid, n) {
// get the form
var f = $(formid);
// get toggle status
var ck = f.toggle.checked;
// set the cbs
for(i=0; i<n; i++) {
cb = eval('f.cb' + i);
if(cb) {
cb.checked = ck;
}
}
} | [
"function make_cb_select_all (ev, ui) {\n ui.panel.find ('thead, tfoot').find ('.check-column :checkbox').on ('click.wp-toggle-checkboxes', function (event) {\n var $this = jQuery (this);\n var $table = $this.closest ('table');\n var controlChecked = $this.prop ('checked');\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
serve the singleplayer game html file. it contains the controller and view to handle client side of single player game | function singlePlayerGame(req,res) {
res.writeHead(200, {"content-type":"text/html;charset=utf-8"});
fs.createReadStream("html/singleplayer.html").pipe(res);
} | [
"function startGame() {\n removeWelcomePage();\n createGamePage();\n createCards();\n}",
"function initialHandler(req, res) {\n res.sendFile(__dirname + '/public/weather.html');\n}",
"function createGamePage() {\n var gamePage = document.createElement('main');\n gamePage.classList.add('game-board');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get only the expenses from month/year table | function getExpense(year, month){
return new Promise(function(resolve, reject){
var q = "SELECT * FROM " +month+year + " WHERE type = '-';";
//For each element in result, return a data object for formatting purpose
con.query(q, function(error, result){
if(error... | [
"function getIncomeHistory ()\r\n{\r\n //First get the month\r\n var date = new Date();\r\n var currentMonth = date.getMonth();\r\n var currentYear = date.getYear();\r\n\r\n return Income.filter(getAssetByMonth);\r\n}",
"function getIncomeHistoryIndex (index)\r\n{\r\n //First get the month\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merges change messages and reviewer updates into one array. Also processes all messages and updates, aligns or massages some of the properties. | _computeCombinedMessages(messages, reviewerUpdates, changeComments) {
const params = [messages, reviewerUpdates, changeComments];
if (params.some(o => o === undefined)) return [];
let mi = 0;
let ri = 0;
let combinedMessages = [];
let mDate;
let rDate;
for (let i = 0; i < messages.lengt... | [
"_computeCombinedMessages(messages, reviewerUpdates) {\n messages = messages || [];\n reviewerUpdates = reviewerUpdates || [];\n let mi = 0;\n let ri = 0;\n let combinedMessages = [];\n let mDate;\n let rDate;\n for (let i = 0; i < messages.length; i++) {\n messages[i]._index = i;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
timerCounter: Called 5 times per second from roundContinues Takes the difference between targetDate and current time, and updates time and other things that vary with time. | function timerCounter() {
var currentDate = new Date();
var remainingNow = targetDate.valueOf() - currentDate.valueOf();
if (! roundStarting) {
if (remainingNow < 0) {
$('#time').html("(Kierros päättynyt)");
roundEnded();
} else {
var seconds = Math.floor((remainingNow / 1000)) % 60;
var minutes... | [
"function _updateTimer(){\n _timeNow = Date.now();\n var $dt = (_timeNow-_timeThen);\n\n _delta = _delta + $dt; // accumulate delta time between trips, but not more than trip window\n _now = _now+_delta; // accumulate total time since star... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
After Submit script to populate the Approval matrix | function vbApprovalRouting(type,form) // After submit function
{
try {
var fileId = nlapiGetFieldValue('custbody_splunk_attach_bill');
if(fileId) {
//Attaching the file to the record after saving the record.
nlapiAttachRecord('file', fileId, nlapiGetRecordType(),nlapiGetRecordId());
}
}
catch (e) {
n... | [
"function onReportOrApprovalSubmit() {\n // This is the Expense Report Spreadsheet\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheets()[0];\n\n var currentTimeStamp = new Date();\n \n // Also open the Approvals Spreadsheet\n var approvalsSpreadsheet = SpreadsheetApp.openById(APPROVA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Q4. Given a 2D board and a word, find if the word exists in the grid. For example, Given board = [ ['A','B','C','E'], ['S','F','C','S'], ['A','D','E','E'] ] word = "ABCCED", > returns true, word = "SEE", > returns true, word = "ABCB", > returns false. | function wordSearch(board, word) {
if (word === "") return true;
for (var row = 0; row < board.length; row++) {
for (var col = 0; col < board[row].length; col++) {
if (board[row][col] === word[0]) {
if (dfs(0, row, col)) return true;
}
}
}
return false;
function dfs(index, x, y) {... | [
"function checkBoardTile(cx, cy, wordTreeNode, wordLen, strWorkString)\n{\n var tileLetter\n\n wordLen++;\n if (wordLen > maxWordLen) return;\n\n // Flag current tile as occupied\n boardTileUsed[cx][cy] = wordLen;\n\n // Read letter for current tile\n tileLetter = boardTiles[cx][cy];\n\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Schedule an update of all games for a specific date | function scheduleGamesUpdate(date) {
scheduleUpdate(matchesTimeout, date, function() {
onMatchesUpdate();
});
} | [
"function scheduleDataUpdate(date) {\n scheduleUpdate(dataTimeout, date, function() {\n onDataUpdate();\n });\n}",
"function updateGames() {\n\tfor each(var game in data.games) \n\t\tif(game.status == status.STARTING && !getReady(game)) \n\t\t\tstopTimer(game);\n}",
"function dailyScheduleToDb(game... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if we need to get the target data | function needTarget(effect,other_data){
return (!other_data.isLS && !other_data.sp && (effect['passive target'] !== undefined && effect['passive target'] !== 'self'));
} | [
"hasMissingMapping() {\n let isMissing = false;\n\n try {\n this._getAPIDiseases();\n } catch (err) {\n isMissing = true;\n }\n\n try {\n this._getAPIInterventions();\n } catch (err) {\n isMissing = true;\n }\n\n //Phase\n try {\n this._getAPIPhases();\n } catc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Watches for changes in media, invalidating layout as necessary. | function watchMedia() {
for (var mediaName in $mdConstant.MEDIA) {
$mdMedia(mediaName); // initialize
$mdMedia.getQuery($mdConstant.MEDIA[mediaName])
.addListener(invalidateLayout);
}
return $mdMedia.watchResponsiveAttributes(
['md-cols', 'md-row-height', 'md-gutt... | [
"function checkMediaSynchronization() {\n\n var HypervideoController = FrameTrail.module('HypervideoController'),\n isPlaying = HypervideoController.isPlaying,\n currentTime = HypervideoController.currentTime,\n overlay;\n\n for (var i = 0, l = syncedMedia.length; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the updated interval after applying the various backoff options | function backoff(interval, options) {
if (options.backoff) {
interval = interval * options.backoff;
}
if (options.max_interval) {
interval = Math.min(interval, options.max_interval);
}
return interval;
} | [
"resetBackoff() {\n process.nextTick(() => {\n this.backoffTimeout.reset();\n this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING);\n });\n }",
"static get sleepThreshold() {}",
"function getF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Based on an x/y offset determine the current drag direction. If both axis' offsets are lower than the provided threshold, return `null`. | function getCurrentDirection(offset, lockThreshold) {
if (lockThreshold === void 0) { lockThreshold = 10; }
var direction = null;
if (Math.abs(offset.y) > lockThreshold) {
direction = "y";
}
else if (Math.abs(offset.x) > lockThreshold) {
direction = "x";
}
return direction;
} | [
"static getDirection(x1, y1, x2, y2) {\n if (x1 <= x2) {\n if (y1 <= y2) {\n return 1; // Down Right\n }\n else {\n return 2; // UP Right.\n }\n }\n else {\n if (y1 <= y2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a history extension with the given configuration. | function history(config = {}) {
// FIXME register beforeinput handler
return [
historyField,
historyConfig.of(config)
];
} | [
"function dist_history(config = {}) {\n // FIXME register beforeinput handler\n return [\n historyField,\n historyConfig.of(config)\n ];\n}",
"function History(){}",
"function router_createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n let {\n initialE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all actions as an array | getActions() {
return Object.keys(this.actions)
.map(a => this.actions[a]);
} | [
"function getActiveActions() {\n var actions = [];\n if (!self.histories || self.histories.length <= 0)\n return actions;\n\n self.histories.forEach(function(history) {\n if (!history.isTrue)\n return;\n\n if (history.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare a map style object for diffing If immutable convert to plain object Work around some issues in the styles that would fail Mapbox's diffing | function normalizeStyle(style) {
if (!style) {
return null;
}
if (typeof style === 'string') {
return style;
}
if (style.toJS) {
style = style.toJS();
}
var layerIndex = style.layers.reduce(function (accum, current) {
return Object.assign(accum, (0, _defineProperty2.default)({}, current... | [
"function generateStyleMap(type) {\n switch (type) {\n \n case \"explore\":\n // Style object to be used by a StyleMap object\n vector_style_explore = new OpenLayers.Style({ \n 'fillColor': '#EB0000',\n 'fillOpacity': .3,\n 'strokeColor': '#8C0000',\n 'st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate end page items to show | endIndex()
{
let endIndex=0;
let startIndex=this.startIndex();
if(this.pageCount()===this.props.currentPage)
endIndex=this.pageCount();
else if(startIndex+(this.props.buttonsCount-1)<=this.pageCount())
endIndex=startIndex+(this.props.buttonsCount-1);
else
return this.pageCount();
return endIndex;... | [
"get end_results(){\n let resultsOnPage = (this.page_number + 1) * this.size;\n\n if (resultsOnPage <= this.total) {\n return resultsOnPage;\n }\n\n return this.total;\n }",
"get start_results(){\n return this.page_number * this.size + 1;\n }",
"function DDLigh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
use ajax function to insert into databsae question | function insert(body, panswerid, canswer, type, tolerance, quizname, imagename,modelanswer) {
// call PHP function
$.ajax({
url : 'http://shrouded-earth-7234.herokuapp.com/processQuizEntry.php',
type : 'post',
data : {
"funcName" : "InsertQuestion",
"quizname" : quizname,
"body" : body,
"canswer" :... | [
"function saveResult(currentQuestion,number, answer ){\n\t$.ajax({\n type: \"POST\",\n url: \"save_result.php\", \n data: {\n\t\t\t questionNo: currentQuestion\n\t\t\t, testNumber: number\n\t\t\t, testAnswer: answer\n\t\t\t},\n success: function (data) {\n\t\t data = jQuery.parseJSON( data )... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================== Set caret position in editor ============================================================================== | function setCaretPosition(position) {
document.getElementById("content-editor").setSelectionRange(position, position);
document.getElementById("content-editor").focus();
} | [
"updateCaret() {\n\t\tthis.caret = this.textarea.selectionStart;\n\t}",
"function setCaretPosition( element, caretPos ) {\n if ( element != null ) {\n if ( element.createTextRange ) {\n var range = element.createTextRange();\n range.move( \"character\", caretPos );\n range.select();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the intersection area of a bunch of circles (where each circle is an object having an x,y and radius property) | function intersectionArea(circles, stats) {
// get all the intersection points of the circles
var intersectionPoints = getIntersectionPoints(circles);
// filter out points that aren't included in all the circles
var innerPoints = intersectionPoints.filter(function (p) {
... | [
"function areaCircle (radius)\n{\n\t// var circle_Area = Math.PI * (radius * radius);\n\tvar circle_Area = Math.PI * (Math.pow(radius,2));\n\treturn circle_Area;\n}",
"function intersectionAreaPath(circles) {\n\t var stats = {};\n\t intersectionArea(circles, stats);\n\t var arcs = stats.arcs;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
asyncDelete() Delete selected messages aIds array of mesage id's returns json of entire db | async function asyncDelete(aIds) {
console.log(`Model::asyncDelete(${aIds}`);
const body = {
messageIds: aIds,
command: 'delete',
};
const response = await fetch('http://localhost:8082/api/messages', {
method: 'PATCH',
body: JSON.stringify(body),
headers: {
'Content-Type': 'application... | [
"function messagesDelete(token_id) {\n var where_param = '{\"name\":\"token\",\"condition\":\"EQUAL\",\"data\":\"' + token_id + '\"}';\n var del_raw_data = config.getToken(\"cloud_push\"); //Getting Tokens From Config\n del_raw_data['table_name'] = 'messages';\n del_raw_data['wheres'] = where_pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The awards committee had planned to give n research grants this year, out of a its total yearly budget. However, the budget was reduced to b dollars. The committee members has decided to affect the minimal number of highest grants, by applying a maximum cap c on all grants: every grant that was planned to be higher tha... | function findC(g, b) {
// first sort the grants and get total
// nlogn time
g.sort(function compareNumbers(a, b) {
return b - a;
})
console.log(g)
var total = 150
var neededCuts = total-b
var runningTotal = 0
for(var i=0; i<g.length; i++){
var currentMax = g[i]
if((g[i] - ... | [
"function GrowthYears(startBudget, currentbudget, yearStart, yearFinal) {\n\n return (Math.pow((currentbudget / startBudget), 1 / (yearFinal - yearStart)) - 1 ) * 100;\n}",
"function maximumToys(prices, budget) {\n prices = prices.sort((a, b) => a - b);\n let priceTotal = 0;\n let totalToys = 0;\n // assig... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check validity of input and return hour and minute in number format | function valCheck(input) {
if (input.length != 5) invTime();
var hour = Number(input.slice(0, 2));
if (isNaN(hour) || hour < 0 || hour > 23) invTime();
var minute = Number(input.slice(3, 5));
if (isNaN(minute) || minute < 0 || minute > 59) invTime();
minute*=.01;
return [hour, minute];
} | [
"function time_convert(num) {\n if (parseInt(num) > 60) return `${Math.floor(parseInt(num) / 60)}h ${parseInt(num) % 60}min`;\n else return num; \n}",
"function getHoursFromTemplate() {\n var hours = parseInt(scope.hours, 10);\n var valid = ( scope.showMeridian ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper for sending an SVG response given a promise of SauceLabs jobs. Need this because there are two handlers that have a lot of overlap: /sauce/:user Get jobs for any build (regardless of CI service). /travis/:user/:repo/sauce Get jobs for a Travis build. | function handleSauceBadge(req, res, client, promise) {
return promise.then((jobs) => {
const filters = {
name: req.query.name,
tag: req.query.tag
};
jobs = client.filterJobs(jobs, filters);
const browsers = client.getGroupedBrowsers(jobs);
if (browsers.length) {
const options = {... | [
"function fetchFromSvg(request, url, valueMatcher, cb) {\n request(url, (err, res, buffer) => {\n if (err !== null) {\n cb(err)\n } else {\n nodeifySync(() => valueFromSvgBadge(buffer, valueMatcher), cb)\n }\n })\n}",
"function getAndHandleJob(i) {\n\n //Get job\n var job = clients[i].getJo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the property data already fetched, if any... | getPropertyDetail() {
return {
propertyData: PropertyDataStore.currentPropertyDetail
};
} | [
"onPropertyGet(room, property, identifier) {\n return room[property];\n }",
"getData() {\n return PRIVATE.get(this).opt.data;\n }",
"function loadPropertiesbyowner() {\n $.ajax({\n url: \"/api/OwnerPropertyDescriptionAPI\",\n type: \"GET\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a command chain to call multiple commands at once. | chain() {
return this.commandManager.chain();
} | [
"register(commands) {\n commands.forEach((command) => {\n command.boot();\n validateCommand_1.validateCommand(command);\n this.commands[command.commandName] = command;\n /**\n * Registering command aliaes\n */\n command.aliases.fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return Array normalized to integers in lohi | normalizeInt (array, lo, hi) {
return this.normalize(array, lo, hi).map((n) => Math.round(n))
} | [
"function L2normalization(array){\r\n var normalizedArray = new Array();\r\n var powArray = new Array();\r\n for(let i = 0; i < array.length; i++){\r\n powArray.push(Math.pow(array[i],2));\r\n }\r\n var sum = powArray.reduce((x, y) => x + y);\r\n var norm = Math.sqrt(sum);\r\n for(let i = 0; i < array.len... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
competition partcipate in proposed team grading on Change table | function onchangeCompPartProposedTeamGradingData(value, index, key) {
const action = {
type: ApiConstants.ONCHANGE_COMPETITION_PART_PROPOSED_TEAM_GRADING_DATA,
value,
index,
key,
};
return action;
} | [
"function onchangeCompOwnFinalTeamGradingData(value, index, key) {\n const action = {\n type: ApiConstants.ONCHANGE_COMPETITION_OWN_PROPOSED_TEAM_GRADING_DATA,\n value,\n index,\n key,\n };\n return action;\n}",
"function totalCreditsAndQualityPoints(e){\n \n var credit = parseFloat($(e.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
subscribe to the gene set that they want to look at | onOpening() {
let index = (this.index() - 1) / 2;
if (!subscribedIndexes[index]) {
instance.subscribe("geneSetInGroup", instance.data._id, index);
subscribedIndexes[index] = true;
}
} | [
"function subscribeTo(p) {\n publisher = p;\n p.addGlube(that);\n }",
"bindEvents() {\n PubSub.subscribe(\"Location:location-data-loaded\", event => {\n const allLocations = event.detail;\n this.selectLocationList(allLocations);\n });\n //listens for change in location selection fr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserswitchStatement. | exitSwitchStatement(ctx) {
} | [
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitStatementWithoutTrailingSubstatement(ctx) {\n\t}",
"exitStatementNoShortIf(ctx) {\n\t}",
"exitIfThenElseStatement(ctx) {\n\t}",
"exitIfThenStatement(ctx) {\n\t}",
"exitBlockLevelExpression(ctx) {\n\t}",
"exitLabeledStatementNoS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populates the table nodes with the "summary" data about a company's stocks (averages, minimums, and maximums). | function populateStockSummaryTable(stockData) {
const openData = stockData.map(stock => stock.open); // creating arrays for each type of stock data
const closeData = stockData.map(stock => stock.close);
const lowData = stockData.map(stock => stock.low);
const highData = stockData.map(sto... | [
"function populateStockDataTable(stockData) {\n const tableBody = document.querySelector('#stockDataTable tbody');\n tableBody.innerHTML = \"\";\n for (let data of stockData) { \n let row = document.createElement('tr'); // each piece of 'data' will be a single row in the table\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signals whether or not the document at the snapshot's location exists. | exists() {
return null !== this._document;
} | [
"async detectNew() {\n const existing = await self.db.countDocuments();\n return !existing;\n }",
"function isDocumentUnsaved(doc){\n\t\t// assumes doc is the activeDocument\n\t\tcTID = function(s) { return app.charIDToTypeID(s); }\n\t\tvar ref = new ActionReference();\n\t\tref.putEnumerated( c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
console.log(tableData) Update table with a new dataset | function updateTable(dataset) {
tbody.html('');
dataset.forEach((toBeDefined) => {
var row = tbody.append("tr");
Object.entries(toBeDefined).forEach(([key,value]) => {
var cell = tbody.append("td");
cell.text(value);
});
});
} | [
"dsUpdateTable(table, what) {\n switch (what) {\n case \"add\":\n table.columns = [];\n table.indexes = [];\n table.partitions = [];\n table.relations = [];\n this.gMap.tables.set(table.table_id, table);\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isSmoothPoint :: Point > Boolean | function isSmoothPoint(point, precision) {
const angle = Math.abs(roundNumber(getAngle(point), precision))
return angle === 0 || angle === 180
} | [
"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]) {\n //console.log(\"point already in use:\", p);\n return false;\n } else {\n //console.log(\"point ok:\", p);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |