query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Given a token response, computes and returns the expiresAt timestamp. Note that this should only be used immediately after an access token is received, otherwise the computed timestamp will be incorrect. | function getAccessTokenExpiration(tokenResponse, env) {
const now = Math.floor(Date.now() / 1000); // Option 1 - using the expires_in property of the token response
if (tokenResponse.expires_in) {
return now + tokenResponse.expires_in;
} // Option 2 - using the exp property of JWT tokens (must not assume JWT... | [
"function getAccessTokenExpiration(tokenResponse) {\n const now = Math.floor(Date.now() / 1000);\n // Option 1 - using the expires_in property of the token response\n if (tokenResponse.expires_in) {\n return now + tokenResponse.expires_in;\n }\n // Option 2 - using the exp property of JWT toke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear the function layer | function clearFuncLayer(ctx, axis) {
ctx.clearRect(axis.xLeftRange - axis.blank, axis.yRightRange - axis.blank,
canvasWidth, canvasHeight);
} | [
"clear () {\n this.layers.forEach(layer => layer.clear())\n }",
"function clearLayer(){\r\n\t//map.removeLayer(vectorLayer);\r\n\tvar i;\r\n\tvar maplayers=map.getLayers();\r\n\tfor (i = maplayers.getLength(); i > 0; i--) {\r\n\t\tmap.removeLayer(maplayers.item(i));\r\n\t}\r\n\r\n}",
"clear() {\n\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Info: This methode is invoked when we click on save of the config page Params: NA Result: Reconstructs the JSON to be stored on the custom metada records and updates/ creats the values on records | handleSave(){
let secFields =this.template.querySelectorAll("lightning-input");
let selectedfieldList =this.template.querySelectorAll("lightning-dual-listbox");
let configDataUpdated=[]; // Holds the reconstructed JSON object
//Validation logic to check for mandatory fields
cons... | [
"storeCustomSetting(core, event) {\n return new Promise((resolve) => {\n // PopTemplate.buffer();\n PopLog.event(this.name, `storeCustomSetting`, event);\n const setting = event.config.metadata.setting;\n const body = {\n value: event.config.control.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
private functions Cast provided filters (could be in multiple format) into an array of ColumnFilter | castFilterToColumnFilters(columnFilters) {
// keep current filters & always save it as an array (columnFilters can be an object when it is dealt by SlickGrid Filter)
const filtersArray = (typeof columnFilters === 'object') ? Object.keys(columnFilters).map(key => columnFilters[key]) : columnFilters;
... | [
"function getFilters() {\n var filters = [];\n\n _.forEach($scope.data.filters, function(value, key){\n //filter applied\n if(value.filterApplied && value.filterValue) {\n\n var filterObject = {}\n filterObject.key = value.key;\n filterObject.type = value.filterApplied;\n\n //convert str... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets the theme without applying it | function resetTheme() {
editTheme(baseTheme);
$('#theme-msg')
.html('Default theme loaded')
.attr('class', 'msg-ok')
.show().delay(2000).fadeOut(500);
} | [
"activateDefaultTheme() {\n this._reset();\n }",
"function resetStyles()\n{\n}",
"__clearTheme() {\n const styleElement = document.getElementById(this.constructor.__fullId(this.__id) + \"_Styles\");\n if (styleElement) styleElement.parentElement.removeChild(styleElement);\n }",
"applyThem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
detect quicktime for all browsers | function hasQuickTime() {
var result = hasPlugin("QuickTime");
if (!result){
result = hasIEPlugin("QuickTime.QuickTime");
}
return result;
} | [
"function hasQuickTime(){\r\n\tlet result = hasPlugin('QuickTime');\r\n\tif (!result){\r\n\t\tresult = hasIEPlugin('QuickTime.QuickTime');\r\n\t}\r\n\treturn result;\r\n}",
"function hasQuickTime(){\r\n var result = hasPlugin(\"QuickTime\");\r\n if (!result){\r\n result = hasIEPlugin(\"QuickTime.Quic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all smslog from db | function getAllSMSLogFromDB(req, res, next) {
SMSLog.find().sort({ createdOn: -1 })
.then(function (smsLog) {
return res.json(smsLog);
})
.catch(function (err) {
return next(err);
})
} | [
"function getLogs(cb) {\n\tMessage.find({}).exec(function (err, result) {\n\t\tcb(result);\n\t});\n}",
"function getLogs(){\n return logs.find({});\n}",
"function _getLogEntries() {\n\t\ttry {\n\t\t\t//Variable to keep query statement \n\t\t\tvar lvQuery = 'SELECT * FROM \"' + gvSchemaName + '\".\"' + gvLogT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getPassword returns the base64 decoded encrypted password object (json) from the current record. | function getPassword() {
var data = getRecord()
blob = bin2String(Utilities.base64Decode(data[COL_PASSWORD]));
return blob;
} | [
"getPassword() {\n\t\treturn this.password\n\t}",
"getPassword() {\n return this.password;\n }",
"get passwordData() {\n return this.getStringAttribute('password_data');\n }",
"get password() {\n return this._password;\n }",
"get password() {\n return this._password;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closing the HTML Table | function fn_htmlclosetable()
{
var tempCode;
tempCode = "</table>";
return tempCode + Chr(10);
} | [
"function t_table_close()\r\n{\r\ndocument.write(\"</table></td></tr></table>\");\r\n}",
"function closeTable(tableToClose) {\n // Add closing table tag to html string\n tableToClose += \"</table>\";\n // Pass along contents of the table\n return tableToClose;\n}",
"endTable() {\n this.cTable = u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a StartOverIntent to Alexa | sendStartOverIntent() {
let startOverIntent = StartOverIntent;
if (this.sessionAttributes) {
startOverIntent.session.attributes = this.sessionAttributes;
}
return this._sendIntent(startOverIntent)
} | [
"function onIntent(intentRequest, session, callback) {\n console.log(\"onIntent requestId=\" + intentRequest.requestId\n + \", sessionId=\" + session.sessionId);\n var intent = intentRequest.intent,\n intentName = intentRequest.intent.name; \n if (\"AMAZON.StartOverIntent\" === i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build modal popup for Comic | function buildComicModal(id)
{
var comic = null;
// Loop through comics
comics.forEach(function(comicInfo, index)
{
// Search for ID match
if(id === comicInfo.id)
{
// Set id match as target comic
comic = comicInfo;
}
});
// Is description null?
if(comic.description === null)
{
... | [
"function covidClick() {\n\n var name = \"Coronavirus Genome Variant [C]\";\n var desc = \"An efficient seed-search alignment tool \\\n to compare read-variants to the COVID-19 \\\n virus genome using Burrows-Wheeler transform, \\\n suffix arrays, the FM-Index, and... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prosedur Print_multi Mengecek apakah fungsi getNama_multi() mengembalikan nilai true Kemudian mengambil kembalian dari fungsi getNama_multi() Sebelum print dilakukan pembersihan object yang aktif agar kontrol pembantunya tidak ikut di cetak. Timeout Prosedur untuk menuggu pemberisah object aktif. hal ini dilakukan kare... | function print_multi() {
if (getNama_multi()) {
nama = getNama_multi();
//bersihkan canvas sebelum print
canvas_multi.discardActiveObject(canvas_multi.getActiveObject());
canvas_multi.requestRenderAll();
//timeout menuggu canvas dibersihkan
setTimeout(function () {
//printing
$("#c... | [
"function print() {\n if (getNama()) {\n nama = getNama();\n //bersihkan canvas sebelum print\n canvas.discardActiveObject(canvas.getActiveObject());\n canvas.requestRenderAll();\n //timeout menuggu canvas dibersihkan\n setTimeout(function () {\n //printing\n $(\"#c\")\n .get(0)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
All for attributes match the id of a form field. | function hasForAttributesThatMatchIds() {
const problemLabels = elementData.label
.filter(label => label.for &&
!inputsSelectsTextareas.find(element => element.id === label.for))
.map(label => stringifyElement(label));
if (problemLabels.length) {
const item = {
// description: 'The for attri... | [
"get idAtrrs () {\n return this.attrs.filter((attr) => attr.isID)\n }",
"function getIdParams()\n{\n\tvar params = \"\";\n\tjQuery(\"input.idfield\").each(function(){\n\t\tif( jQuery(this).val() && !jQuery(this).is(\":disabled\") )\n\t\t\tparams += \"&\" + jQuery(this).attr(\"name\") +\"=\"+ jQuery(this).val(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ProjectService An example of a service that leverages the BaseObjectService to perform the heavy lifting for CRUD operations. | function ProjectService(context) {
if (!util.isObject(context)) {
context = {};
}
context.type = TYPE;
ProjectService.super_.call(this, context);
} | [
"function ProjectService($http) {\n //api endpoints\n var allProjUrl = 'project/getAllProjects';\n var projInfoUrl = 'project/loadSelectedProject';\n\n // project properties\n var projectId;\n var projectName = 'DemoRun';\n\n // Cache\n var projects = [];\n\n return {\n // allProje... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a promise that will be resolved once all invalidated web components are rendered | static whenDOMUpdated() {
if (renderTaskPromise) {
return renderTaskPromise;
}
renderTaskPromise = new Promise(resolve => {
renderTaskPromiseResolve = resolve;
window.requestAnimationFrame(() => {
if (invalidatedWebComponents.getList().length === 0) {
renderTaskPromise = undefined;
resolve... | [
"static renderDeferred(webComponent) {\n\t\t// Enqueue the web component\n\t\tconst res = invalidatedWebComponents.add(webComponent);\n\n\t\t// Schedule a rendering task\n\t\tRenderScheduler.scheduleRenderTask();\n\t\treturn res;\n\t}",
"invalidate_() {\n if (this.initializePromiseReject_ !== null) {\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to make the 'empty' button (X) appear/disappear in Glossary Search text box (when text is entered/removed) | function toggleEmptyGlossBtn() {
if(this.value == "") {
emptyGlossBtn.style.visibility = "hidden";
suggestions.innerHTML = "";
}
else {
emptyGlossBtn.style.visibility = "visible";
}
} | [
"function clearGlossary() {\n emptyGlossBtn.style.visibility = \"hidden\";\n glossSearchText.value = \"\";\n suggestions.innerHTML = \"\";\n}",
"function toggleEmpty() {\n if(searchBox.value === \"\") {\n empty.style.visibility = \"hidden\";\n action.style.action = \"\";\n }\n else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the specified mod is loaded. | function IsModLoaded(name) {
return (document.getElementById('modscript_' + name) != null);
} | [
"function IsModLoaded(name) {\n\treturn document.getElementById('modscript_' + name) != null;\n}",
"function moduleExists(mod) {\n try {\n eval('require.resolve')(mod);\n return true;\n }\n catch (e) {\n return false;\n }\n}",
"isModuleLoaded() {\n return !!RNSentry;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create componet NameTag you can have nameTag and import it as NameTag. have to have capitalied to diffrenciate between regular html tags you can also have arrow function or anon function but its better for testing prop or prop children fragment for adding lastname show react.fragment array as fragment wrapp it with a t... | function App() {
return (
<div className="App">
<header className="App-header">
<h1 className="title">Name List</h1>
<NameTag firstName="john" lastName="johnson"></NameTag>
<NameTag firstName="peter" lastName="peterson"></NameTag>
<NameTag firstName="jill" lastName="jillson"></... | [
"function buildNametagHTML (nametag) {\n // TODO: Your code goes here.\n return `\n <div class=\"card\">\n <div class=\"card-header\" style=\"text-align: center; background-color: blue; color: white;\">\n Hello, my name is:\n </div>\n <div class=\"card-body\" style=\"text-align: cente... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNKCIJE ZA PRIKAZ PROIZVODA PO GRIDU | function klikIspisProizvoda(nizGrid, gridKlasa){
for(let i=0; i<nizGrid.length;i++){
dodeliAkciju(nizGrid[i], gridKlasa[i]);
}
} | [
"function fInicializaGrid(){\n// specNume = {type:'number', className:'posNumber', format:{decPlaces:2, thouSep:'', decPoint:'.',negSign:'-'},canFilter:true};\n specNume = {className:'posNumber', format:{decPlaces:2, thouSep:',', decPoint:'.',negSign:'-'},canFilter:true};\n var opts = {\n \t\tbufferTimeout :... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function to create a select control option for Notes | function createNoteOption(select, key) {
var option = document.createElement('option');
option.innerHTML = key;
option.value = notes[key];
select.appendChild(option);
} | [
"function createSelect( attrib , o ) { return( createElement( 'select' , attrib , o ) ); }",
"createTypeOption(){\n var select = document.getElementById(\"chooseArtType\");\n var newOption = document.createElement(\"option\");\n newOption.text = this.type;\n select.options.add(newOptio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a function converting html nodes to an i18n Message given an interpolationConfig | function createI18nMessageFactory(interpolationConfig){var visitor=new _I18nVisitor(_expParser,interpolationConfig);return function(nodes,meaning,description,id,visitNodeFn){return visitor.toI18nMessage(nodes,meaning,description,id,visitNodeFn);};} | [
"function createI18nMessageFactory(interpolationConfig){var visitor=new _I18nVisitor(_expParser,interpolationConfig);return function(nodes,meaning,description,id,visitNodeFn){return visitor.toI18nMessage(nodes,meaning,description,id,visitNodeFn)}}",
"function createI18nMessageFactory(interpolationConfig) {\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set placemark with given coordinates | setPlacemark(coordinates) {
this.myPlacemark.geometry.setCoordinates(coordinates);
} | [
"function setPointOnMap(ax, ay) {\n myMap.geoObjects.removeAll();\n var onePoint = new ymaps.Placemark(\n [ay, ax], {},\n {\n preset: \"islands#redIcon\",\n });\n\n myMap.geoObjects.add(onePoint);\n myMap.setCenter([ay, ax], 16);\n}",
"placeMark(pos, mar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create configuration from object. | static fromObject(options, filename = null) {
Config.validate(options, filename);
return new Config(options);
} | [
"function buildObj(cfgObj, baseObj)\n {\n // Try to find the corresponding constructor\n var ctor = baseObj[cfgObj.id];\n\n // Ensure that this is a valid constructor id\n if (!ctor || !(ctor.prototype instanceof baseObj))\n error('unknown dimension:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Place in a corner that is opposite the enemy | function aiOpposingCorner() {
var spaces = getAvailableSpaces();
var enemyCorners = [];
data.board.forEach(function(move, space){
if (CORNERS.includes(space) && move == data.player1) {
enemyCorners.push(space);
}
});
for (var i = 0; i < enemyCorners.length; i++) {
var copyBoard = getBoardCo... | [
"function oppositecorner(player){\n\n}",
"function drawEnemy() {\r\n\t if (theenemy) {\r\n \t\tvar x = translate ( ei * SQUARESIZE ); \t\r\n \t\tvar z = translate ( ej * SQUARESIZE ); \t\r\n \t\tvar y = enemyFloor;\t\r\n \r\n \t\ttheenemy.position.x = x;\r\n \t\ttheenemy.position.y = y;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns `true` if the app is in landscape mode. | isLandscape() {
return !this.isPortrait();
} | [
"isLandscape () {\n const dim = Dimensions.get(\"screen\");\n return dim.width >= dim.height;\n }",
"function isLandscape() {\n return getHeight() < getWidth();\n}",
"function isMobileLandscape() {\n\t\treturn (Modernizr.mq('all and (min-width : 321px) and (max-device-width : 360px) and (orientation :... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a class symbol information | function serializeClass(symbol, node) {
var details = serializeSymbol(symbol);
details.implements = getImplementedTypes(node, details.name);
setTypeParameters(details.name, node);
if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {
details.entryType = DocEntryType.interfa... | [
"function serializeClass(symbol) {\n var details = serializeSymbol(symbol);\n // Get the construct signatures\n var constructorType = checker.getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration);\n details.constructors = constructorType\n .getConstructSignatures()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an array of horizontal sequences that are considered winning moves. | function getHorizontalWinners(board) {
let results = [];
for(let row = 0; row <= board.length - 1; row++) {
for(let column = 0; column <= 3; column++) {
if(board[row][column] === colors.red &&
board[row][column+1] === colors.red &&
board[row][column+2] === colors.red &&
board[ro... | [
"function getHorizontal(col, row, win_length) {\n let horizontal = [];\n let val = 0;\n for (let i=0; i <= row-1; i++){\n let current_row = [];\n for(let j=0; j<=col-1; j++){\n current_row.push(val);\n val++;\n }\n horizontal.push(getSets(current_row, win_length));\n }\n return(horizontal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines whether a codepoint matches [[NC_NAME_START_CHAR]]. | function isNCNameStartChar(c) {
return ((c >= 0x41 && c <= 0x5A) ||
c === 0x5F ||
(c >= 0x61 && c <= 0x7A) ||
(c >= 0xC0 && c <= 0xD6) ||
(c >= 0xD8 && c <= 0xF6) ||
(c >= 0x00F8 && c <= 0x02FF) ||
(c >= 0x0370 && c <= 0x037D) ||
(c >= 0x037F && c <= 0x1FFF) |... | [
"function isNCNameStartChar(c){return c>=0x41&&c<=0x5A||c===0x5F||c>=0x61&&c<=0x7A||c>=0xC0&&c<=0xD6||c>=0xD8&&c<=0xF6||c>=0x00F8&&c<=0x02FF||c>=0x0370&&c<=0x037D||c>=0x037F&&c<=0x1FFF||c>=0x200C&&c<=0x200D||c>=0x2070&&c<=0x218F||c>=0x2C00&&c<=0x2FEF||c>=0x3001&&c<=0xD7FF||c>=0xF900&&c<=0xFDCF||c>=0xFDF0&&c<=0xFFFD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a new plant to store in season | createPlantObjectTemplate(seasonName, plantName, plantGerminationTime, plantHarvestTime, plantSowDate ){
var obj = JSON.parse(localStorage.getItem(seasonName));
if(obj == undefined){
obj = {
season: seasonName,
}
localStorage.setItem(obj.season, JSON.stringify(obj));
}
obj[plan... | [
"function makePlant () {\n var plant = {};\n plant.height = 5*getRandomInt (1, 10) + 5*getRandomInt (1, 10);\n plant.petal_number = getRandomInt (2, 6);\n if (getRandomInt(0, 1)==0) {\n plant.leaf_veins = \"parallel\";\n } else {\n plant.leaf_veins = \"branched\";\n }\n plant.location = locations[getRa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read a message from the tangle | function readMessageFromTangle(txHash, callback){
var hashes = [txHash];
iota.api.getTransactionsObjects(hashes, function(error, result) {
if (error) {
console.error(error);
} else {
//console.log("Found tx-obj: ", result);
// console.log("signatureMessageFragment: ", result[0].signatureM... | [
"_readMessage () {\n const message = this.messages.parseBuffer( this.dataBuffer );\n if ( message ) {\n this.emit( message.command, message );\n this._readMessage();\n }\n }",
"function readMessage() {\n\tport.on('readable', function() {\n\t\traw = port.read()\n\t\tif (raw != null) {\n\t\t\tse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the main filter into the DataView instance. | setDataViewFilter() {
if (!this.dataView) return;
this.dataView.setFilter(Filter.bind(this));
} | [
"function setFilter(newFilter) {\n filter = newFilter;\n }",
"function setFilters(){}",
"function updateFilter() {\n view.map.ground.opacity = 0.5;\n updateFilterGeometry();\n featureFilter = {\n // autocasts to FeatureFilter\n geometry: filterGeometry,\n spatialRelationship: selecte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to obtain values for smart vehicle graphs | function getSensorMeasurementValues_sv(sensor, data) {
var values = [];
var value = "";
switch(sensor) {
case "tachometer":
value = "tachometer_rpm";
break;
case "wss":
value = "wss_speed";
break;
case "potentiometer":
valu... | [
"getSignalValues() {\r\n return extractSignalValuesFromView(this.vegaViewGl, this.vegaSpec);\r\n }",
"getStateValues(component) {\n return this.graph.data.nodes.map( n => n[component]);\n }",
"get vectorValue() {}",
"function accelGetValues() {\n\n accelerometer.getValues(functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds name as an option to the given dropdown element. | function create_dropdown_option(name, dropdown) {
const el = document.createElement("option")
el.textContent = name
el.value = name
dropdown.appendChild(el)
} | [
"function addName(name) {\n\t\tvar option = document.createElement(\"option\");\n\t\toption.innerHTML = name;\n\t\toption.value = name;\n\t\tdocument.getElementById(\"allnames\").appendChild(option);\n\t}",
"function addNewOption(name){\n // make an ID for this option\n let id = optionIdFromName(name);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves selection to next line. | moveToNextLine() {
this.moveDown();
} | [
"extendToNextLine() {\n if (isNullOrUndefined(this.start)) {\n return;\n }\n this.end.moveToNextLine(this.upDownSelectionLength);\n this.fireSelectionChanged(true);\n }",
"navigateLineEnd() {\n this.selection.moveCursorLineEnd();\n this.clearSelection();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the wait time before terminating the attempt to execute a command and generating an error. | setTimeout(ms) {
if (!this._commandTimeoutTimer) {
this._commandTimeoutTimer = setTimeout(() => {
if (!this.isResolved) {
this.reject(new Error("Command timed out"));
}
}, ms);
}
} | [
"function commandTimeout() {\n console.log(\"\\t\\t\" + prettyDate() + \" ~ Command timed out: \" + chalk.red(\"fail\"));\n mCommandTimeout = undefined;\n mTestInst.onCommandDone({result: 'fail'});\n }",
"commandTimeout() {\n // if there are commands in the queue - pop the earliest command from the q... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Classify whether a character is unicode whitespace, unicode punctuation, or anything else. Used for attention (emphasis, strong), whose sequences can open or close based on the class of surrounding characters. | function classifyCharacter(code) {
if (
code === null ||
markdownLineEndingOrSpace(code) ||
unicodeWhitespace(code)
) {
return 1
}
if (unicodePunctuation(code)) {
return 2
}
} | [
"function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace_1(code) || unicodeWhitespace_1(code)) {\n return 1\n }\n\n if (unicodePunctuation_1(code)) {\n return 2\n }\n}",
"function classifyCharacter$2(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace$8(code)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove is hidden from modal (because modal is hidden by default) & make the body position fixed (to prevent scrolling) | function modalOpen() {
modal.classList.remove("is-hidden");
document.body.classList.add("position-fixed");
} | [
"function fixScroll() {\n if(!$modal.length) {\n return false;\n }\n \n var scrollTop = $(window).scrollTop();\n \t$modal.css('top', scrollTop);\n \t\n\t\t\t}",
"function toggleBodyScroll(){\n let root = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get uri plugin, which exports to require | function getURI() {
return request([{
"name": "uri",
"src": "../lib/uri/uri.js",
"shim": true
}, {
"name": "util",
"src": "../lib/src/util.js"
}, {
"name": "template",
"src": "../lib/uritemplate/uritemplate... | [
"function loadUriModule (filepath, method, uri) {\n const moduleName = `${filepath}/${method}-${uri}`\n try {\n return require(moduleName)\n } catch (err) {\n Logger.error(err, `error loading ${moduleName}`)\n return null\n }\n}",
"static makeURI(uri) {\n return _core__WEBPACK_IMPORTED_MODULE_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=====================================================================\ void importProject(file) \===================================================================== | function importProject(file) {
const importedXml = !file ? document.getElementById('importedXml').files[0] : file;
if (importedXml !== null && importedXml.type === 'text/xml') {
const fileReader = new FileReader();
fileReader.onload = function(e) {
Blockly.Events.disable();
const textFromFile = e.target.re... | [
"function importFromFile() {\n var file = dialog.showOpenDialog({\n \"title\": i18n.__(\"Import from file\"),\n \"filters\": [{\n \"name\": 'PHP files',\n \"extensions\": ['php', 'phtml', 'tpl', 'ctp']\n }],\n });\n\n if (file) {\n fs.readFile(file[0], \"utf8\", importReady);\n }\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: fix this Function to compute interest from present date until next payment This is used for Loans in repayment to accurately keep track of balance changes Arguments: principal [Float]: The portion of the Loan's balance that is principal dailyRate [Float]: Decimal representing the daily rate of interest previousPa... | function interestTillNextPayment(
principal,
dailyRate,
previousPayDate,
nextPayDate
) {
return (
principal *
Math.floor((nextPayDate - previousPayDate) / 86400000) *
dailyRate
);
} | [
"function determinePrincipal(balance, dailyRate, previousPayDate) {\n let today = new Date();\n return parseFloat(\n (\n balance /\n (1 +\n dailyRate *\n Math.round((today.valueOf() - previousPayDate.valueOf()) / 86400000))\n ).toFixed(2)\n );\n}",
"function getInterestforPrinci... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns message counter in current asymmetric ratchet round. | getCounter() {
precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);
let proxyResult;
proxyResult = Module._vscr_ratchet_message_get_counter(this.ctxPtr);
return proxyResult;
} | [
"_getCurrentAmountInIcon () {\n return parseInt(this.app.DOM.chatCount.textContent, 10);\n }",
"_calcMessageKey (ratchet) {\n let chain = ratchet.chain\n // Calculate next message key\n const messageKey = this._HMAC(chain.key, Buffer.alloc(1, MESSAGE_KEY_SEED))\n // Calculate next ratchet chain ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
using host and path, determine content key | function getKeyForRequest(req) {
var key = cm.ckey(req.host, req.path);
return key;
} | [
"getKeyFromPhysicalPath(physicalPath) {\n if (!physicalPath) throw new Error('path required')\n let key = physicalPath.replace(this.config.src, '').split(path.sep).join('/')\n if (key.startsWith('/')) {\n key = key.substr(1)\n }\n\n return key\n }",
"function key_test(path, home) {\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the parent select of this option and appends the div to its option list. | bind_to_select(select) {
this.parent = select;
select.option_div.appendChild(this.div);
} | [
"function fillSelectParent(){\n // Pour chaque parent on créé une option dans notre liste\n $.each((splittedParentsList), function(i){\n $(\"#myParent\").append(\"<option value=\"+splittedParentsList[i]+\">\"+splittedParentsList[i]+\"</option>\")\n })\n }",
"function populateParentSelector(target) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gives the user an error message when they try to make an illegal move. | moveError(text) {
// alert() is a standard browser feature.
alert('Invalid move: ' + text);
} | [
"function badMove(error){\n\tclearMessage();\n\t$(\"#message\").append($(\"<p>\").append(error));\n\tresetRackPositions();\n}",
"function outOfBound(newMove) {\n if (newMove > 410 || newMove < 10) {\n promptError(\"You shall not pass!\");\n return true;\n } else return false;\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the class name for the infobox. Returns: string: The CSS class name for the infobox element. | className() {
return `infobox ${this.infoboxID}`;
} | [
"openInfoBox(){\n\t\tdocument.getElementById(\"info-box\").className = \"information\";\n\t}",
"function getClassInfo() {\n return data.dataTree.classes[config.ClassIndex];\n}",
"getClassName() {\n\t\tvar className = ['wprec-calendar-grid'];\n\t\tif (this.isEmpty()) {\n\t\t\tclassName.push('wprec-calendar-gr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an instance of BaseValidationInputComponent. | constructor() {
super(...arguments);
this.name = this.args.validation;
this.parent = this.args.parent;
if (this.args.parent === undefined) {
if (this.args.alone) return; // if input is alone ignore
throw new ConfigurationException(`Component '${this.constructor... | [
"function BaseInput(config) {\n BaseComponent.call(this, config);\n}",
"function IValidator() { }",
"function FormValidatorFactory() {\n}",
"_validation() {\n // to be overridden by child class\n }",
"function createValidator() {\n const validationStorage = {};\n const groupStroage = {};\n const res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing Assessment resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, opts) {
return new Assessment(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"static get(name, id, state, opts) {\n return new ResourcePolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) {\n return new Association(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads all text files in a directory. | function readFiles(directory, onFileContent, onError) {
fs.readdir(directory, function(err, filenames) {
if (err){
onError(err);
return;
}
filenames.forEach(function(filename) {
if(!filename.endsWith(".txt")) {
return;
}
... | [
"function readDirectory(dir) {\n const content = fs.readdirSync(dir)\n let files = []\n content.forEach((file) => {\n const cur = path.join(dir, file)\n if (isDirectory(cur)) {\n files = files.concat(readDirectory(cur))\n }\n else {\n const ext = path.extname(file)\n if (ext === '.yaml... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Export a deck to Cockatrice format | function exportDeck(w, h) {
checkDeckSize();
checkDeckCost();
sortDeckList();
var bsPopup = document.getElementById('deckbody')
bsPopup.innerHTML = "";
var printdeck = document.createElement('textarea');
printdeck.setAttribute('rows', 50);
printdeck.setAttribute('cols', 50);
printdeck.setAttribute('class', 'ex... | [
"function exportList( deck ){\n\t\n\t// Clean up oddball characters in the deck name to make a file name\n\tif ( deck.name )\n\t\tname = deck.name.replace( /[\\s\\?\\\\\\/_]+/g, \" \" );\n\t\t\n\t// Default to \"list.txt\" if the deck wasn't named at all\n\telse\n\t\tname = \"list\";\n\t\t\n\t// Use file saver to c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize chosen jquery plugin. | function init() {
$( '.chosen-select' ).chosen( {
width: '100%',
/* eslint-disable camelcase, lines-around-comment */
no_results_text: 'Oops, nothing found!'
/* eslint-endable */
} );
} | [
"function chosenSelects() {\n\t$('select').chosen({\n\t\tdisable_search: true,\n\t\tplaceholder_text_single: \"Select one\",\n\t\twidth: \"auto\"\n\t});\n}",
"function nb_live_chosen() {\n\t\tjQuery('.lcweb-chosen').each(function() {\n\t\t\tvar w = jQuery(this).css('width');\n\t\t\tjQuery(this).chosen({width: w})... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Document per sample (dps) | function DocumentPerSample() {
this.preload = function() {
this.db = db.getSisterDB("labs_cpu").dps
};
this.init = function() {
this.db.drop()
this.db.ensureIndex({'server' : 1, 'timestamp' : 1})
};
this.store = function( server_name, cpu_measurement, timestamp ) {
... | [
"function DocumentPerSample() { \n\n this.store = function( server_name, cpu_measurement, timestamp ) { \n // implement the mongodb method to store a sample\n\tdb.sample.insert({\"server_name\": server_name, \"cpu_measurement\": cpu_measurement, \"timestamp\": timestamp}); \n };\n\n this.query = fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this methods will be sent to every Reminder component to filling curRem in this.state | fillCurRem(tit,des,ddl,st){
// state of this component fills by Reminders in the ul for information window (linfting state up). //
this.setState({
curRem: {
title: tit,
desc: des,
deadLine: ddl,
status: st
}
... | [
"addReminder() {\n console.log('this.state.dueDate', this.state.dueDate);\n this.props.addReminder(this.state.text, this.state.dueDate, this.state.description);\n }",
"onEditReminder() {\n this.populateRemindersData();\n }",
"addReminder() {\r\n console.log('this.state.dueDate', th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
____ _ | _ \ __ _ _ __ __| | ___ _ __ ___ | |_) / _` | '_ \ / _` |/ _ \| '_ ` _ \ | _ < (_| | | | | (_| | (_) | | | | | | |_| \_\__,_|_| |_|\__,_|\___/|_| |_| |_| True with the chances of n in d | function chance(n, d) {
min1(n); // The numerator must be 1+
checkMin(d, n); // The denominator must be the numerator or larger
return _randomUnder(d) < n; // May the odds be ever in your favor
} | [
"function chance(n, total){\n var r = Math.floor(Math.random() * total);\n if (r < n){\n return true;\n } else {\n return false;\n }\n}",
"function randChance(odds) {\n return Math.random() < 1 / odds;\n}",
"function chance(probability) {\n return rand() < (1000.0 * probability);\n}",
"function ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
randomAction returns a random viable action based on role and location | randomAction() {
var action;
const role = this.role.toLowerCase();
switch (this.location.location.toLowerCase()) {
case 'throne':
if (role == 'advisor' && randomChoice([0,1,1]) == 1) {
action = new Action.Propose(randomChoice([100,150,200,300]),randomChoi... | [
"getRandomAction(){\n\t\tvar actionIndex = Math.floor((Math.random() * this.actions.length));\n\t\treturn this.actions[actionIndex]\n\t}",
"function selectRandomAction(){\n // all possible actions the ai can perform\n const actions = [MOVE_PLAYER, BUILD_WALL, SHOOT_PROJECTILE];\n // calculate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility for extracting border radii props from components | function radii(props) {
var r = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1];
var _ref = props || {};
var rounded = _ref.rounded;
var pill = _ref.pill;
var circle = _ref.circle;
var borderRadius = void 0;
if (rounded === true) {
borderRadius = r;
} else if (ro... | [
"calculateStyles() {\n const { color, size } = this.props;\n\n let rgba, intensity;\n\n if (color === Spinner.COLOR_DARK) {\n rgba = 0;\n intensity = 0.1;\n } else {\n rgba = 255;\n intensity = 0.6;\n }\n\n const thickness = size / 10;\n const border = `${thickness}rem solid... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
navigate to "Set Goal screen" | function onSetGoal() {
$state.go('app.setGoal');
} | [
"function gotoGoalsListScreen() {\n navigation.navigate('goalsListScreen');\n }",
"function gotoSettings() {\n navigation.navigate('settingsScreen');\n }",
"function setGoal(goal) {\n\t\tsetCurrentGoal(goal);\n\t}",
"function C001_BeforeClass_Amanda_Click() {\t\n\n\t// Regular interactions\n\tCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Array$prototype$traverse :: Applicative f => Array a ~> (TypeRep f, a > f b) > f (Array b) | function Array$prototype$traverse(typeRep, f) {
var xs = this;
function go(idx, n) {
switch (n) {
case 0: return of (typeRep, []);
case 2: return lift2 (pair, f (xs[idx]), f (xs[idx + 1]));
default:
var m = Math.floor (n / 4) * 2;
return lift2 (concat_, go (idx,... | [
"function Array$prototype$traverse(typeRep, f) {\n var xs = this;\n function go(idx, n) {\n switch (n) {\n case 0: return of(typeRep, []);\n case 2: return lift2(pair, f(xs[idx]), f(xs[idx + 1]));\n default:\n var m = Math.floor(n / 4) * 2;\n return lift2(concat_, g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Construct a Global version of the library | function constructGlobal() {
var library;
//create a library instance
library = init();
library.noConflict('KeyboardJS', 'k');
//spawns a library instance
function init() {
var library, namespaces = [], previousValues = {};
library = factory('global');
library.fork = init;
library.noConflict ... | [
"function constructGlobal() {\n\t\tvar library;\n\n\t\t//create a library instance\n\t\tlibrary = init(context);\n\n\t\t//spawns a library instance\n\t\tfunction init(context) {\n\t\t\tvar library, namespaces = [], previousValues = {};\n\n\t\t\tlibrary = factory(context, 'global');\n\t\t\tlibrary.fork = init;\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
build the tilemap Json file takes in 2 layer data, one for the bomb map, one for the cover map | function buildMapJson(data, map_height, map_width, tile_height, tile_width){
// create a layer
var layer1 = {
"data": data,
// height and width: row and column count; same as map height/width for fixed-size map
"height": map_height,
"width": map_width,
// name of t... | [
"getTile2DJSON() {\n let tile2DJSON = {\n \"height\":this.height,\n \"infinite\": false,\n \"layers\":[\n {\n \"id\": 1,\n \"data\": this.getMap(0),\n \"height\":this.height,\n \"name\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invoked when a Session button pressed specifying that the device has entered the session layout. | didSwitchToSessionLayout(clear) {
this.controllerState.viewMode = ViewMode.session;
this.didSwitchLayout(clear);
} | [
"function onButtonClicked() {\n if (xrSession) xrSession.end();\n else navigator.xr.requestSession(sessiontype).then(onSessionStarted);\n }",
"function onConfigButtonPress(){\n\talert(\"Coming soon...\");\n}",
"function eventsPressed() {\n\t\tnavigate(ROUTES.EVENTS);\n\t\tdispatch(setDetailsVie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1. Set activity content according to activity type, as defined in the activity schema | async function setActivityContent( itcb ) {
// for prescriptions, we presume that the content is
// already correct because we do not want to reload the
// attachments.
if(
!hasCustomUserContent &&
activity &&
... | [
"function setActivityType(){\n var panelNext = View.panels.get(\"panelNext\");\n panelNext.setFieldValue(\"activitytype.activity_type\", \"SERVICE DESK - \" + document.getElementById(\"activity\").value.toUpperCase());\n document.getElementById(\"activity\").value = document.getElementById(\"activity\").va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
list all styles templates | listStylesTemplates(api) {
// Style Sheets / CSS
console.log(color("Style Sheets:", this.colors.divider));
api.listCommands(api.tasks.styles);
} | [
"static get styles(){return[]}",
"static get styles() { return []; }",
"static get styles() {\n return [];\n }",
"style(...args) {\n const template = this.templateForName(args[0]);\n if (!template) {\n throw {\n message: \"Missing Template definition for '\" + args[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends the connect message | function _connect() {
if (!_isDisconnected()) {
var message = {
channel: "/meta/connect",
connectionType: _transport.getType(),
};
// In case of reload or temporary loss of connection
// we want the next successful connect to return immediately
// instead of being held... | [
"function _connect()\n {\n if (!_isDisconnected())\n {\n var message = {\n channel: '/meta/connect',\n connectionType: _transport.getType()\n };\n\n // In case of reload or temporary loss of connection\n // we want the next s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function handles preset input in the description form group | handlePresetInput(event) {
if (document.getElementById("presetMessages").value) {
this.setState({
description: document.getElementById("description").value.concat(" ")
});
this.setState({
description: document.getElementById("description").value.concat(document.getElementById("pres... | [
"function updatePreset() {\n switch(preset.value) {\n case 'person':\n storyInput.value = JSON.stringify(EXAMPLE_PERSON, null, 2);\n break;\n case 'product':\n storyInput.value = JSON.stringify(EXAMPLE_PRODUCT, null, 2);\n break;\n case 'place':\n storyInput.value = JSON.stringify... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Objects aren't restricted to containing only JavaScript primitive types. Remember, JavaScript primitive types include string, number, boolean, null... Here is an object which contains a nested array. Return the second item in the array favori... | function nestedArray () {
const bootcampInstructor = {
name: 'Susan',
favoriteColor: 'green',
favoriteFoods: [
'chicken pot pie',
'salmon',
'pho'
]
}
// Note that you can chain the bracket notation to reach into the Object AND into the Array.
console.assert(bootcampInstructor['... | [
"function getFoods(arr) {\n const foods = {};\n arr.forEach((obj) => {\n const favoriteFoods = Object.values(obj.favoriteFoods);\n favoriteFoods.forEach((foodKind) => {\n foodKind.forEach((food) => {\n if (foods[food]) {\n foods[food] += 1;\n } else {\n foods[food] = 1;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function depicts hopw the logger handles any 'unhandled exception' or runtime exception ins system. Preventing the server to fail | function testForUnHandledException() {
let loggerConfig = {
"log-level": customLogger.LOG_LEVEL.verbose
}
customLogger.setConfig(loggerConfig);
customLogger.logMessage("tion", customLogger.LOG_LEVEL.error, "some-business-tag", txnID);
} | [
"catchExceptions(){\n process.on('uncaughtException', function (err) {\n Logger.fatal(err);\n //var stack = new Error().stack;\n //Logger.exception(stack);\n });\n }",
"function _handleUncaughtException(err) {\n console.log(`Uncaught Exception: ${err}`);\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loadFacilityList() will setup the JSON object for list of Facilities. | function loadFacilityList() {
Facility.all(function(err, results){
this.facility_list = results;
var empty_facility = new Facility();
empty_facility.facility_name = 'Not Selected';
empty_facility.id = "";
this.facility_list.unshift(empty_facility); // add the new empty Not Selected list to the top of th... | [
"function getFacilities (){\n\tdocument.getElementById(\"waitingForFacilities\").style.display = \"block\";\n\tdocument.getElementById(\"facility\").value = \"\";\n\tdocument.getElementById(\"table\").style.display = \"none\";\n\n\turl = \"http://\" + window.location.host + \"/api/programs/\" + formID + \".json\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function receives a key seed and produces an appropriate StarkEx key from a uniform distribution. Although it is possible to define a StarkEx key as a residue between the StarkEx EC order and a random 256bit digest value, the result would be a biased key. In order to prevent this bias, we deterministically search ... | function grindKey(keySeed, keyValLimit) {
const sha256EcMaxDigest = new BN(
'1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000',
16
);
const maxAllowedVal = sha256EcMaxDigest.sub(sha256EcMaxDigest.mod(keyValLimit));
let i = 0;
let key = hashKeyWithIndex(keySee... | [
"function generateKey(seed) {\n var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxy'.split('');\n var length = 12;\n if (seed) {\n \tlength = seed.length;\n }\n var str = '';\n for (var i = 0; i < length; i++) {\n \tvar random = Math.random();\n \tif (seed) {\n \t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the customerFieldValues with values from currentValues. For fields that do not have a value in currentValues but have a defaultValue, we use it. | setCustomerFieldValues(currentValues) {
this.customerFieldValues.replace(currentValues);
this.props.business.customerFields.forEach((field) => {
if (this.customerFieldValues.has(field.id)) {
return;
}
if (typeof field.defaultValue === 'string' || typeof field.defaultValue === 'number') {
this.cus... | [
"function SetCustomerValues(customer) {\n $('#FirstName').val(customer.FirstName);\n $('#LastName').val(customer.LastName);\n $('#PhoneNumber').val(customer.PhoneNumber);\n $('#Email').val(customer.Email);\n $('#Address').val(customer.Address);\n $('#TripCount').val(customer.TripCount);\n $('#C... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display Exchange Rate to User on Front End | function displayExchangeRate() {
// Calc expected Rate in ETH not Wei
expectedRateEth = expectedRate / (10 ** 18);
// Calcualte user Exchange rate
expectedRateHTML.innerText = `1 ${srcSymbol} = ${expectedRateEth} ${destSymbol}`;
// expectedRate / (10 ** 18)
} | [
"function displayExchangeRate(currencyCode) {\n var exRate = sessionStorage.getItem(`${currencyCode}-ExRate`);\n\n if (exRate == null) {\n // Failed API call, notify user and disable input\n const msg = `Failed to fetch exchange rate for ${currencyCode}`;\n M.toast({\n html: ms... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Challenge 13: Create a function that takes two numbers as a parameters and checks if they are equal. | function myFunction( num1, num2){
if (num1 == num2 ){
console.log("both numbers are equal to each other")
}
else{
console.log("numbers are not equal to each other")
}
} | [
"function isEqualTo(num1, num2) {\n // code here\n}",
"function sameNum(num1, num2) {\r\n if (num1 === num2) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"function isNumEqual(num1,num2){\n if (num1 === num2){\n return true;\n }else{\n return false;\n }\n}",
"function isEqu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output a humanfriendly description of a given dependency relation | function describe(relation){
switch(relation){
case "auxpass":
return "-";
case "prep":
return "is related by a preposition to";
case "nn":
return "forms a compund";
case "advmod":
return "described as";
case "amod":
return "described as";
case "nsubj":
return "done by";
case "nsubjpass":
r... | [
"function htmlRelation (relation) {\n var string = '<p';\n string += ' name=' + relation.label;\n string += ' id=' + relation.uuid;\n string += ' class=\"relation\">';\n string += 'Label: ' + relation.label;\n string += '<br>';\n string += 'Uuid: ' + relation.uuid;\n string += '<br>';\n var temp = Object.k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if a wrapper element has padding. if there is no element that has the class padding that is used to pad elements inside the wrapper it returns the wrapper. if there is an element that is the first child and has the class padding that element is returned. any further operations could then be done on the padding e... | function checkPadding($element) {
var numberOfChildren = $element.children().size();
// if there are no children or the number of children is above one then the element must be returned
if ($element.children().size() <= 0 || numberOfChildren > 1)
return $element;
// if the... | [
"padding() {\n\t\tconst $ = this._$;\n\t\tconst regex = /p[btylrx]?-(lg-)?(\\d)/i;\n\n\t\twhile(true) {\n\t\t\tconst el = $('*[class*=p-], *[class*=pt-], *[class*=pr-], *[class*=pb-], *[class*=pl-], *[class*=px-], *[class*=py-]').first();\n\t\t\tif(!el.length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst paddingClasses ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the error for the next round, or reset it to its initial value. | function setError(reset) {
error *= ramp;
if (reset) error = 0.25;
if (Math.random() < 0.5) error *= -1;
} | [
"set _error(err) {\n if (err) {\n this._lastValueState = this.valueState;\n this.valueState = 'Error';\n } else if (this.valueState === 'Error') {\n this.valueState = this._lastValueState;\n }\n }",
"updateError() {\n var oldError = this.error;\n this.error = this.getErrorMessage();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inicializa las variables de memoria | function initMemVars()
{
params = [];
varTable = {}; //delete and renew var table
listElements = 0;
currentFuncName = "";
paramNumber = 0;
numberMem = 1000;
stringMem = 5000;
boolMem = 8000;
tmpNumMem = 10000;
tmpBoolMem = 20000;
} | [
"function initGlobals() {\n // Data related variables\n data = []\n flad = null\n fuda = []\n allvals = {}\n aggval = {}\n derailval = {}\n \n gol = {}\n gol.siru = null\n oresets = []\n derails = []\n hashhash = {}\n \n // All the in and out params are also global, via the gol hash\n for (const key... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterates through the grid and calls the callback at each element | _gridIterator(fn) {
this._grid.forEach( (row, i) => {
row.forEach( (col, j) => fn(col, i, j));
});
} | [
"loopThroughCells(callback) {\n for (let cell in this.cells) {\n let cellCoords = cell.split(',');\n callback(cell, Number(cellCoords[0]), Number(cellCoords[1]));\n }\n }",
"forEach(callback) {\n for (let row = 0; row < this.rows; row++) {\n for (let col = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FEATURE 4: Filter parts Filters the trips using a number of given operators and conditions (e.g. filter parts by distance > 20) FEATURE 14: Find a part given a search criterion The '=' operator can be used to search for a specific trip using the time or id field | filterTrips (type, operator, value) {
// Would like to solve this...currently unable to have the filter read values from tripList obj
// Read comparitors from the tripList obj tp make them available to the filter
const comparitors = this.comparitors
const tripFetch = this.tripFetch
// Gets which fun... | [
"function filterCutStation() {\nvar query2 = treeCuttingLayer.createQuery();\nquery2.where = treeCuttingLayer.definitionExpression; // use filtered stations\n}",
"filterByOperator(operatorId, isChecked) {\n let newFilters;\n let filtersUpdated = false;\n\n const { filters, results } = this.state;\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loops through each restaurant address in database and updates coordinates | function getRestaurantAdresses() {
// Create AJAX request
var xhttp = new XMLHttpRequest();
// when server gives OK and ready
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var addresses = JSON.parse(this.response);
... | [
"function populateRestaurants() {\n for (i = 0; i < restaurants.length; i++) {\n var isFavorite = false;\n\n //check if restaurant is a favorite one \n //create markers \n for (j = 0; j < userFavorites.length; j++) {\n if (userFavorites[j].restaurantID == restaurants[i].id) {\n j = userFavo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handler for sandbox initialization finished | function onSandboxReady(event) {
// config object containing buidler extension configuration, can be accessed via event
// or by shoutem.sandbox.config
const config = event.detail;
// Waiting for DOM to be ready to initialize shoutem.api and call app start function
$(document).ready(function() {
shoutem.... | [
"async _impl_afterInit() {\n // No action needed... yet.\n }",
"start (callback) {\n if (this.iframe) {\n throw new Error('The sandbox is already started. It must be stopped before starting again.')\n }\n\n this.iframe = document.createElement('iframe')\n this.iframe.srcdoc = '<html><head><sc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This code is not directly attached to Ribbon Funcitonality. It is meant for managing content on every page. Hide images that denote anchor tags. Use this when not in edit mode. | function hideAnchorImages() {
(function ($) {
$(document).ready(function () {
$('img.anchorImage').remove();
});
})(jQuery);
} | [
"function hideImageToolbar()\n{\n if (!ns_pos)\n {\n var images = document.getElementsByTagName(\"IMG\");\n\n for (var i = 0; i < images.length; ++i)\n images[i].setAttribute(\"galleryimg\", \"no\");\n }\n}",
"static hide() {\n var nav = EditImage.getNavigation();\n nav.classList.remov... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetching recent feeds from facebook | function getRecentFacebookFeeds(socialId, accessToken, since, callback) {
// Changing the input time to Unix format
var from = String(moment(since).unix());
var currentUnixTime = String(moment().unix());
// Setting access token
facebook.setAccessToken(accessToken);
// Calling graph-api for fetch... | [
"function getRecentFacebookFeeds(socialId, accessToken, since, callback) {\n // Changing the input time to Unix format\n var from = String(moment(since).unix());\n var currentUnixTime = String(moment().unix());\n // Setting access token\n facebook.setAccessToken(accessToken);\n // Calling graph-api for fetchi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads enrolled Security Questions. | getEnrolledQuestions() {
return this.context.enrollService
.GetEnrollmentData(this.context.getUser(), core.Credential.SecurityQuestions)
.then(data => JSON.parse(core.Utf8.fromBase64Url(data))
.map(item => core.Question.fromJson(item)));
} | [
"function readQuestions() {\n return readJsonFile(QUESTION_FILE_PATH, [])\n}",
"function readQuestions() {\n var data = fs.readFileSync(filePath, fileOptions);\n var questionData = JSON.parse(data);\n return questionData\n}",
"function readQuestion() {\n speak(`${questions[questionNumber].questio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para ejecutar las acciones del step 3 del proceso de subida de gif | function recordStep3( gifoId ){
if(gifoId){
// armo la url del gifo nuevo
let gifoURL = `${GIPHY_DIRECT_URL}${gifoId}/giphy.gif`;
// se hara el almacenamiento en local storage del nuevo gifo
let myGif;
myLocalStorage = window.localStorage;
creations = JSON.parse(myL... | [
"function displayGifs() {}",
"function makeGifs() {\n }",
"precargar(){\r\n this.gif = this.app.createImg('./Recursos/Balon.gif');\r\n this.gif.size(95, 95);\r\n }",
"function stopRecordingCallback() {\r\n image.src = URL.createObjectURL(recorder.getBlob());\r\n let form = new FormData()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks page on load to see if this_cookies_value already exists | function checkForOurCookiesValue() {
var allTheCookies = document.cookie;
console.log(allTheCookies);
if(allTheCookies.includes(this_cookies_value)) {
jQuery(".exampleSection").css("opacity",1);
} else {
jQuery(".exampleSection").css("opacity",0);
};
} | [
"function cookieExists() {\n return mojforms.cookie.get(COOKIE_POLICY);\n }",
"function KeepAlive_checkCookie()\n {\n if (this.inProgressCookieExists())\n {\n var j = SiteRecruit_Constants.cookieJoinChar;\n \n // Update the cookie with the current time and loc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of userdefined account tags. | getAccountTags() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.request("get_account_tags", {});
});
} | [
"async listTags() {\n const request = this._makeRequest('/tags/list');\n const response = await request.send();\n const result = await response.json();\n return result.tags;\n }",
"getTags() {\n const tagList = [];\n for (const tag in this.tagDictionary) {\n tagList... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete user's story fomr DOM and server | async function deleteUserStory(e){
if(e.target.nodeName !== "SPAN") return;
const storyId = $(e.target).parent().attr('id');
await currentUser.deleteUserStory(storyId);
storyList = await StoryList.getStories();
$storiesMyList.empty();
const storyUser = storyList.stories.filter(story => story.username ==... | [
"static async deleteMyStory(evt){\n const storyToDelete = evt.target.closest('li')\n let token = currentUser.loginToken\n await axios({\n url: `${BASE_URL}/stories/${storyToDelete.id}`,\n method: \"DELETE\",\n params: { token },\n });\n //follows the same process as... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function showhide to Show or Hide the cards. | function showhide() {
cardsWrapper.classList.toggle('hidden');
} | [
"function hideOrShow (){\n cardsWrapper.classList.toggle('hidden'); \n}",
"function toggleCards() {\n if (typeof data === 'undefined') {\n loadData();\n }\n flashcards.removeClass(showing ? 'cards-show' : 'cards-hide');\n flashcards.addClass(showing ? 'cards-hide' : 'cards-sh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles checked state of all tree nodes to false. | uncheckAll() {
this.toggleCheckedAll(false);
} | [
"function toggleAllChildrenChecked(children, checked) {\n children.forEach(child => {\n child.checked = checked;\n if (child.children.length > 0) {\n toggleAllChildrenChecked(child.children, checked);\n }\n });\n }",
"_clearAllChecked() {\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the babel configuration file for the project. | function getProjectBabelConfigFile(projectRoot) {
return _resolveFrom().default.silent(projectRoot, './babel.config.js') || _resolveFrom().default.silent(projectRoot, './.babelrc') || _resolveFrom().default.silent(projectRoot, './.babelrc.js');
} | [
"babelConfig() {\n let file = this.Paths.root('.babelrc');\n\n // If the user has defined their own .babelrc file,\n // the babel-loader will automatically fetch it.\n // Otherwise, we'll use these defaults.\n return this.File.exists(file) ? '?cacheDirectory' : '?' + JSON.stringif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Close the sidebar with the close button | function w3_close() {
mySidebar.style.display = "none";
} | [
"function w3_close() {\n mySidebar.style.display = 'none';\n }",
"function w3_close() {\n mySidebar.style.display = \"none\";\n }",
"function w3_close() {\r\n mySidebar.style.display = \"none\";\r\n }",
"function closeSidebar() {\n $menubutton.classed('active', fal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
populate a questionStream with instructor permissions for the currentClass | function questionStreamInstructor(currentClass) {
var title = document.createElement("H1");
title.innerHTML = currentClass
var questionWrapper = document.createElement("DIV");
questionWrapper.id = "questionWrapper";
var questionStream = document.createElement("DIV");
questionStream.id = "questionStream";
v... | [
"function setAccessibleQuestions() {\n\tconst totalQuestion = quiz.length;\n\tfor (let i = 0; i < totalQuestion; i++) {\n\t\taccessibleQuestions.push(quiz[i]);\n\t}\n}",
"constructor(){\n console.log(\"Constructing Template Quiz\");\n\n // Passive Properties ---------------------\n //Set of ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===========Overlay Function=========== This function preps the overlay for display by attaching a click event to every link item in the gallery. It is called when the page first loads and then every time the search bar reloads the gallery. Probably wouldn't have to be called so often if I'd attached a click handler to ... | function bootOverlay() {
$("#gallery a").click(function(event) {
// Prevent the default click behavior (which is maintained for users without JavaScript)
event.preventDefault();
// Record the clicked image.
current_image = $(this);
// Adjust caption based on clicked image.
var captionText = $(this).child... | [
"function initLightbox()\r{\r\tvar anchors = document.getElementsByTagName(\"a\");\n\t\r\t// loop through all anchor tags\r\tfor (var i=0; i<anchors.length; i++){\r\t\tvar anchor = anchors[i];\n\t\tif ( anchor.hasAttribute(\"href\") ) {\n\t\t if ( anchor.getAttribute(\"rel\") == \"lightbox\" ) break;\r ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders all messages for a channel | renderChannelMessages() {
console.log('props are', this.props);
let messages = this.props.channelMessages.map(message => {
return (
<ListGroup.Item className='color'>{message.username}: {message.content}</ListGroup.Item>
)
});
return messages;
... | [
"function renderCurrentChannelMessages() {\n //Render the messages of the current channel\n var messages = self.state.history.map(function(msg) {\n return ChatMessage({\n key: msg.mid,\n message: msg,\n username:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches loggedin user's saved recipes | function getSavedRecipes() {
$.get("/api/recipes/saved", function (data) {
if (!data) {
return;
}
renderSavedRecipes(data);
});
} | [
"function getRecipes() {\n var isNewUser = localStorage.length === 0 ? true : false;\n if (!isNewUser) {\n // parse local storage string into json\n var recipes = JSON.parse(localStorage.userRecipe);\n } else {\n var recipes = defaultRecipes;\n //turn json object to string and store it in local stora... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new view controller | function ViewController() {} | [
"initController() {\n var className = this.controller,\n initCmd = 'new ' + className + '({ view: this });';\n this._controller = eval(initCmd);\n }",
"_newController(path, value) {\n let ctrl = new InstanceController(path, value, this);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
equiv. quat_rotate(quat_conj(q), v): q must be a normalized quaternion | function quat_unrotate(out, q, v) {
// return quat_mul(quat_mul(quat_conj(q), vec4(v, 0)), q)[0]yz;
// reduced:
let p = vec4.fromValues(
q[3] * v[0] - q[1] * v[2] + q[2] * v[1], // x
q[3] * v[1] - q[2] * v[0] + q[0] * v[2], // y
q[3] * v[2] - q[0] * v[1] + q[1] * v[0], // z
q[0] * v[... | [
"function rotateVecByQuat(v, q) {\n qVec = new vec3(q.x, q.y, q.z);\n qS = q.w;\n // 2*(qVec . v)*qVec + (qS^2 - qVec . qVec)*v + 2*qS*(qVec x v)\n return qVec.uniformScale(2*qVec.dot(v))\n .add(v.uniformScale(qS*qS - qVec.dot(qVec)))\n .add(qVec.cross(v).uniformScale(2*qS));\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets column width with newWidth. If the newWidth is smaller than column's minWidth, use the minWidth value instead. | setColumnWidth(column, newWidth) {
let minWidth = get(column, 'minWidth') || 0;
set(column, 'width', Math.max(newWidth, minWidth));
} | [
"function setColumnWidth(column, newWidth) {\n let minWidth = get(column, 'minWidth') || 0;\n set(column, 'width', Math.max(newWidth, minWidth));\n}",
"setColumnWidth({ colKey, width }) {\n this.colgroups = this.colgroups.map((item) => {\n if (item.key === colKey) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add word to the database | addWord(word) {
return new Promise((resolve, reject) => {
word_id = undefined;
db.transaction(tx => {
tx.executeSql(
Word.Query.INSERT_WORD_QUERY,
[word.word_text, word.word_pronunciation, word.word_origin],
(_, ... | [
"function addword(word) {\n if (word.length > 1 || word == 'i' || word == 'a') {\n var a = alphabetize(word);\n db.get(a, function(err, value) {\n if (err && err.name == \"NotFoundError\") {\n addkey(a, word);\n } else if (err) {\n console.log('Da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decode image in base 64 | function decodeBase64Image(dataString) {
console.log("Decoding base 64 image");
var matches = dataString.match(/^data:([A-Za-z-+\/]+);base64,(.+)$/),
response = {};
if (matches.length !== 3) {
return new Error('Invalid input string');
}
response.type = matches[1];
response.data = new Buffer(matche... | [
"function decodeBase64Image(md) {\n\t\t\tvar matches = md.match(/^data:([A-Za-z-+\\/]+);base64,(.+)$/);\n\t\t\tvar response = {};\n\n\t\t\tif (matches.length !== 3) {\n\t\t\t\treturn new Error('Invalid input string');\n\t\t\t}\n\n\t\t\tresponse.type = matches[1];\n\t\t\tresponse.data = new Buffer(matches[2], 'base6... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bar Chart (horizontal) (also called: Bar Chart; Bar Graph) | function chartBarChartHorizontal () {
/* Default Properties */
var svg = void 0;
var chart = void 0;
var classed = "barChartHorizontal";
var width = 400;
var height = 300;
var margin = { top: 20, right: 20, bottom: 20, left: 80 };
var transition = { ease:... | [
"function renderBarChart() {\n drawAxisCalibrations();\n var i, j, p, a, x, y, w, h, len;\n\n if (opts.orient === \"horiz\") {\n rotate();\n }\n\n drawAxis();\n\n ctx.lineWidth = opts.stroke || 1;\n ctx.lineJoin = \"miter\";\n\n len = sets[0].length;\n\n // TODO fix right pad\n fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |