query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
; public static const ISSUE_BLOCK:BEMBlock = | function ISSUE_BLOCK$static_(){IssuesPanelBase.ISSUE_BLOCK=( new com.coremedia.ui.models.bem.BEMBlock("cm-issue"));} | [
"function TODO_BLOCK$static_(){ProjectsTodosWidgetProject.TODO_BLOCK=( new com.coremedia.ui.models.bem.BEMBlock(\"cm-projects-todos-widget-todo\"));}",
"static get DEFAULT_END_BLOCK() {\n return 99999999999999;\n }",
"function addBlock() {\r\n return {\r\n type: ActionTypes.Program.ADD_BLOCK,\r\n ins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create cells from this.board array | makeCells() {
let cells = [];
for (let y = 0; y < this.rows; y++) {
for (let x = 0; x < this.cols; x++) {
if (this.board[y][x]) {
cells.push({ x, y });
}
}
}
return cells;
} | [
"initializeBlankBoardArray() {\n this.boardArray = [];\n for (let i = 0; i < this.numRows; i++) {\n const rowsArray = [];\n this.boardArray.push(rowsArray);\n for (let j = 0; j < this.numColumns; j++) {\n this.boardArray[i][j] = {};\n cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eof Import Users Import Blogs | async importBlogs() {
this.log("Импортируем блоги", "Info");
// throw new Error("Test");
const {
source,
target,
ctx,
} = this;
const query = source.getQuery("site_content", "source")
;
query
.leftJoin(target.getTableName("Resource", "target"), "target.oldID"... | [
"async _importUsers()\n {\n // add users\n for (let user of data.users) {\n await this._knex\n .insert(user)\n .into('users');\n }\n }",
"function AssignImport()\n{\n\ttry\n\t{\n\t\tdocument.getElementById(\"feedback\").innerHTML = \"Submitted....\";\n\t\tvar qrystring = \"?\";\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new child function of the current function. | createChildFunction(functionName, parentFunction = this.currentFunction) {
if (!parentFunction) {
throw Error('Entering child function without registering a root function');
}
const { name: childName, fullName, fullPathWithNamespace } = this.getUniqueChildName(functionName, parentFun... | [
"createEnterChildFunction(functionName) {\n const { childFunction, functionName: realFunctionName } = this.createChildFunction(functionName);\n this.currentFunction = childFunction;\n // Return its full minecraft name\n return realFunctionName;\n }",
"function Child() {\n\t}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load transform definition. When loading completes, the next tooltip shown will have the correct description. | function loadTransformDefinition() {
var path = $('pre').attr('data-transformpath');
$.ajax({ url: path }).done(function (result) {
getTransformDescription.definition = result;
});
} | [
"handleLoadTransformEvent() {\n //body of parent element used to display the alert created by webutil.createAlert\n const self=this;\n webutil.createhiddeninputfile('.matr, .grd', (f) => {\n transformationutil.loadTransformation(f).then( (obj) => {\n self.currentTransf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pop up navigation for each polygon centroid | function onEachFeatureCentroid(feature, layer) {
console.log('34',feature.geometry)
// // use d3 to desgin pop up window
// d3.select(".popupContainer").style("pointer-events", "auto");
// does this feature have coordinates?
if (feature.geometry) {
var popupContent = '<p><a target="_blank" href="https://w... | [
"function popupPlygon() {\n polygonsComunas.forEach(polygon => {\n polygon.on('mouseover', function(e) {\n let popup = e.target.getPopup();\n popup.setLatLng(e.latlng).openOn(besafeMap)\n });\n polygon.on('mouseout', function(e) {\n e.target.closePopup();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns basic information on the Discord guild like id, name, icon code, command_prefix, owner, joined_on, screenshot_channel | async getInfo() {
let userResult = await this.request("guild");
return userResult.guild;
} | [
"function _getInfoMenu() {\n return new Discord.MessageEmbed()\n .setColor(\"0x54f542\")\n .setTitle(\"📋 Information Commands Menu 📋\")\n .setAuthor(\"Dungeon Master\", \"https://i.imgur.com/MivKiKL.png\")\n .setThumbnail(\"https://imgur.com/bYatIYu.png\")\n .setDescription(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable "start" button and input textarea while enable the "stop" button. Process the input text as an array splited by white space. If the element in the array ends with a punctuation, remove the last punctuation and add the processed element to the array at that index again. Set an interval to display the elements ar... | function startGame() {
id("start").disabled = true;
id("stop").disabled = false;
qs("textarea").disabled = true;
text = qs("textarea").value.split(/[ \t\n]+/);
let i = 0;
while (i < text.length) {
if (endWithPunc(text[i])) {
text[i] = text[i].substr(0, text[i].length - 1);
... | [
"function start(){\r\n let tempText = \"\";\r\n\r\n document.getElementById(\"start\").disabled = true;\r\n document.getElementById(\"textCOntent\").disabled = true;\r\n document.getElementById(\"stop\").disabled = false;\r\n\r\n tempText = document.getElementById(\"textCOntent\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
onClickMarker open a report for selected item | function onClickMarker(title, attributes) {
var attributes = eval("(" + attributes + ")");
View.getOpenerView().siteId = attributes.values['bl.site_id'];
View.getOpenerView().blId = title
View.getOpenerView().openDialog('ab-msds-rpt-drawing.axvw', null, false, null, null, 1200, 600);
} | [
"function onClickMarker(title, attributes) {\n\tvar selected_item = title;\n\tView.openDialog('ab-waste-rpt-map-bl-loc-details.axvw', null, true, {\n\t\twidth : 1280,\n\t\theight : 600,\n\t\tbl_id:\"\",\n\t\tsite_id:\"\",\n\t\tcloseButton : true,\n\t\tafterInitialDataFetch : function(dialogView) {\n\t\t\tvar dialog... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if path="" is not provided, the library will take the first device | static open(path) {
return Promise.resolve().then(() => {
if (path) {
return new TransportNodeHid(new _nodeHid.default.HID(path));
}
const device = (0, _hwTransportNodeHidNoevents.getDevices)()[0];
if (!device) throw new _errors.TransportError("NoDevice", "NoDevice");
return n... | [
"function determineDevicePath (path) {\n if (!path || path.indexOf('/sys/') !== 0) return path\n try {\n var files = fs.readdirSync(path)\n var device = _.find(files, startsWithUSB)\n return device ? '/dev/' + device : null\n } catch (e) {\n console.log('hub path not connected: ' + path)\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query the PriorAuth server for the most updated ClaimRespnose Sets this.state.claimResponseBundle | async getLatestResponse() {
const claimResponseUri = this.state.priorAuthBase + "/Claim/$inquiry";
console.log("polling: " + claimResponseUri);
this.setState({
subscribeMsg: "Last updated " + new Date()
});
const options = {
headers: {
Accept: "application/json"
}
};
... | [
"getLatestResponse() {\n let priorAuth = this; // Save this context to use in the onload function\n const claimResponseUri =\n this.props.priorAuthService.BASE +\n this.props.priorAuthService.CLAIM_RESPONSE +\n \"?identifier=\" +\n this.props.priorAuthId +\n \"&patient.identifier=\" +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns object containing game rating and color | function getRating(rating){
if (rating && rating > 0){
var result = {
number: Math.ceil(rating),
color: getRatingColor(rating)
};
return result;
}
} | [
"function rateColor(color,rating) {\n color.rating = rating;\n return color;\n}",
"function rateColor(color, rating) {\n color.rating = rating;\n return color;\n}",
"function getRiskRatingColourCode(rating) {\n var objToReturn = {};\n $.each(allRatingsColours, function (index, ratingColour... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bind an arbitrary set of keys by calling bindKeyCombo on each triggering key combo. A string like "abc 123" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another. | function bindKeys(keys) {
var keyCombos = keys && keys.split ? _jquery2.default.trim(keys).split(' ') : [keys];
keyCombos.forEach(function (keyCombo) {
bindKeyCombo(keyCombo);
});
} | [
"function bindKeys(keys) {\n var keyCombos = keys && keys.split ? _jquery2.default.trim(keys).split(' ') : [keys];\n \n keyCombos.forEach(function (keyCombo) {\n bindKeyCombo(keyCombo);\n });\n }",
"bindKeys(strMapping) {\n this.GAMEPAD_KEYMAP_STANDARD = [\n {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saving the map location to a hidden input form if found / [ very convenient for say telling server about location of a search form submission ] | function mapper_save_location(center) {
if(map == null ) return;
var center = map.getCenter();
if(center == null) return;
var x = document.getElementById("longitude");
var y = document.getElementById("latitude");
if(x && y) {
x.value = center.lat();
y.value = center.lng();
}
var x = document.get... | [
"function findLocation(address) {\n document.forms[0].q.value = address;\n showLocation();\n}",
"function findLocation(address) {\n\tdocument.forms[0].q.value = address;\n\tshowLocation();\t\n}",
"function getLocation(evt) {\n evt.preventDefault();\n $('#search-results').empty();\n $('#search-results').css('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function which determines if a question field has associated data that is not associated with a table question from the Collector | function isAssociatedWithNonFormTableData( qId ) {
var qIdMetaData = formTableMappings[ qId ];
if ( qIdMetaData ) {
for ( var i = 0; i < qIdMetaData.length; ++i ) {
var tableType = '' + qIdMetaData[i][FORMTABLE_MAPPING_VIEW_TABLETYPE_INDEX];
var isEmptyVal = arrayContains( ['null','undefined',''], tableType... | [
"function questionNotAnswering() {\n return db.raw('(q.help_time IS NULL OR q.off_time IS NOT NULL)');\n}",
"function isAssociatedWithBothTableAndNonTableData( qId ) {\n\treturn isFormTableQuestion( qId ) && isAssociatedWithNonFormTableData( qId );\n}",
"get tieExists() {\n const flatten = arr => \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach` and `__detach`. However, this is more complicated because `AnimatedProps` uses reference counting to determine when to recursively detach its children nodes. So in order to optimize this, we avoid detaching until the next attach unless we are ... | function useAnimatedPropsLifecycle(node) {
var prevNodeRef = useRef(null);
var isUnmountingRef = useRef(false);
useEffect(() => {
// It is ok for multiple components to call `flushQueue` because it noops
// if the queue is empty. When multiple animated components are mounted at
// the same time. Only ... | [
"detachedCallback() {\n\t\t// update attached status\n\t\tthis._componentAttached = false;\n\t\t// will unmount\n\t\tthis.componentWillUnmount();\n\t\t// wait next frame\n\t\tthis.mutate(() => {\n\t\t\t// unmount only if the component is mounted\n\t\t\tif ( ! this._componentMounted) return;\n\t\t\t// unmount\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import_ajax_call make import ajax call | function import_ajax_call(action,group,seq_selector,which){
jQuery.post(ajaxurl,
{
group: group,
rnd: microtime(false), //hack to avoid request cache
action: action,
seq: jQuery(seq_selector).val(),
imp: jQuery("#import_code").val(),
},
function(data) {
if (data){
... | [
"function importAjax(url){\n\t //$.get(url, importXML, 'text');\n\t $.ajax({\n\t\t type: \"GET\",\n\t\t async:false,// 设置为同步请求\n\t\t url: url,\n\t\t //data: {ParentID: pid},\n\t\t success: importXML\n\t\t});\n }",
"function requestImportRun(event) {\n\tjQuery('#importWidget').unbind('click').toggleCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifying Show Cart Page Header When User Logged In And Not Logged In | verifyCartPageHeader() {
browser.waitForUrlContains("showCart");
if (browser.isDisplayed(eval(loginPageLocator.dd_myAccount))) { // If user logged in
logger.log("***** The Header of Cart Page: " + eval(locator.accountPageHeader).getText() + " *****");
assert.assertElementContains... | [
"function isLoggedIn() {\n $(\"#menu\").show();\n showView(\"Catalog\");\n getCatalog();\n $(\"#profile\").show();\n $(\"#profile\").find(\"span\").text(sessionStorage.getItem(\"username\"));\n }",
"verifyHeaderOnCartPage()\n {\n browser.waitForUrlContains(\"showCar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a 2radio toggle to show/hide a collapse. | function set_radio_collapse_toggle(radio_hide, radio_show, div_to_toggle) {
radio_hide.click({'div': div_to_toggle}, function (e) {
var div = e.data.div;
if (this.checked) {
div.collapse('hide');
}
});
radio_show.click({'div': div_to_toggle}, function (e) {
var div = e.data.div;
if (this... | [
"toggleCollapse() {\n this.setCollapsed(!this.collapsed);\n }",
"toggle() {\n this.collapsed = !this.collapsed;\n }",
"function toggleMpgTypeRadio(){\n $( \"#radio_2\" ).click();\n}",
"function toggleMpgTypeRadio() {\n $(\"#radio_2\").click();\n}",
"function secondaryToggle() {\n\tif($('#Dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returning base folder of bundle which suppose to be included or used | getBundleFolderPath(bundleName)
{
if (this.bundlesFoldersPathsCache.hasOwnProperty(bundleName)) {
return this.bundlesFoldersPathsCache[bundleName];
}
this.bundlesFoldersPathsCache[bundleName] = path.dirname(require.resolve(bundleName));
return this.bundlesFoldersPathsCach... | [
"function getBundlePath(bundleName, basePath) {\n var relativeBundlePath = 'bundles/' + bundleName;\n if (isRunningWithIvy) {\n relativeBundlePath = '__ivy_ngcc__/' + relativeBundlePath;\n }\n return (basePath || '') + '/' + relativeBundlePath ;\n}",
"getInstallDirectoryRoot() {\n let installDirFrom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets url visits from given cookie | function getUrlVisits(docCookie){
initialIndex = docCookie.indexOf(";")
restAnalyze = docCookie
//initialAnalyze = docCookie.substring(0,initialIndex+1)
//restAnalyze = docCookie.substring(initialIndex+1)
while(initialIndex!=-1){
restAnalyze = restAnalyze.substring(initialIndex+1)
initialIndex = restAnalyze.in... | [
"function getCookieUrl(cookie){\n\tvar cookieUrl = cookie.secure ? 'https://' : 'http://';\n\tcookieUrl += cookie.domain + cookie.path;\n\treturn cookieUrl;\n}",
"function getLastVisitPageUrl(){\r\n\tvar lastVisitPageCookie = readCookie(lastVisitPageCookieName);\r\n\tif(lastVisitPageCookie != \"\"){\r\n\t\treturn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Align all pipes in the document if the button Align is clicked. | function alignClick() {
experior.editor.alignAllPipesOnPageLoad( experior.getText() );
experior.editor.highlightDocument('init', hidden.value);
} | [
"function alignmentCommandsSetup(event) {\n var editor = event.editor\n , alignments = ['left', 'right', 'center', 'block']\n , sideAlignments = ['left', 'right']\n , i, command, image;\n\n for (i = 0; i < alignments.length; i++) setupCommand(alignments[i]);\n\n /**\n * Setup the command... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts the custom class from the element. | function get_custom_class(ele) {
var classes = ele.attr('class');
var class_list;
if (classes != null) {
class_list = classes.split(' ');
for (var i = 0; i < class_list.length; i++) {
var item = class_list[i];
if (item.includes('_')) {
return item;
}
}
}
return '';
} | [
"function parse (element) {\n return classStringToArray(element.getAttribute(\"class\") || \"\");\n}",
"function card_class(element) {\n return element.children[0].className;\n}",
"function getClassName(el) {\r\n var cl = el.attributes.getNamedItem(\"class\")\r\n if(cl != null)\r\n return cl.value;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fonction qui permet de filtrer les navettes selon ce que l'on tape dans le champs de recherche (e) | function filter(e, car, tabName){
// On remplace le tableau des navettes par un nouveau tableau vierge
var table = document.getElementById(tabName);
var newTab = document.createElement('table');
newTab.id = tabName;
newTab.className = "table table-striped table-bordered table-hover";
table.paren... | [
"function navigate() {\n \n var s = '!search/s=' + freetext();\n\n if (datebegin() != null) {\n var d = datebegin();\n s += '&d=' + format.getQueryDateStr(d);\n }\n if (dateend() != null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
valid_upgrade_targets computed: true, optional: false, required: false | get validUpgradeTargets() {
return this.getListAttribute('valid_upgrade_targets');
} | [
"validTargets() {\n return this.targets.filter((v) => v.provider && v.instance && v.cpu && v.memory);\n }",
"validateTarget(target) {\n let errs = {};\n if (!target) {\n errs = 'Not defined';\n }\n return errs;\n }",
"validateTarget() {\n // validate\n }",
"function isValidMultiT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a unique nsIFile object with a sanitized name, based on the engine name. | function getSanitizedFile(aName) {
var fileName = sanitizeName(aName) + "." + XML_FILE_EXT;
var file = getDir(NS_APP_USER_SEARCH_DIR);
file.append(fileName);
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
return file;
} | [
"function sanitize_filename(name) {\n\n log.info('sanitizing... ' + name)\n\n var n = name.lastIndexOf('/')\n\n if (n < 0) return name\n\n name = name.substr(name.lastIndexOf('/')+1)\n\n if (name == '')\n name = 'd3ck_suspicious.txt'\n\n log.info('newer, cleaner filename: ' + name)\n\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
switches state to grades | switchToGrades() {
this.setState(this.studentAndGradesArray)
} | [
"function sv_changeSortViewGradeStateAndSort() {\n\n\n switch (sortGradeState) {\n case 0: \n sortStudentCollectionByGradeDescending();\n sortGradeState = 1;\n break;\n case 1:\n sortStudentCollectionByGradeAscending();\n sortGradeState = 0;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a config filter | addFilter(filter) {
this.configFilterList.push(filter);
} | [
"function registerCustomFilter(filter) {\n customFilters.push(filter);\n}",
"function registerFilter(fn) {\n filter = fn;\n}",
"initFilters() {\n this.config.filter = {\n initialized: false,\n filterNames: ['Blur', 'Brightness', 'Contrast', 'Grayscale', 'Hue rotate', 'Opacity'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
is angle a between b>c | function angleCheck(a, b, c){
if(b+TWO_PI == c) return true;
a = (a%TWO_PI+TWO_PI)%TWO_PI
b = (b%TWO_PI+TWO_PI)%TWO_PI
c = (c%TWO_PI+TWO_PI)%TWO_PI
return (b <= c ? b <= a && a <= c : b <= a || a <= c);
} | [
"function angle(a,b,c) {\n return a==c ? 0 : JXG.Math.Geometry.rad(c,b,a);\n}",
"function angle(b, c, a) {\n return acos((b * b + c * c - a * a) / (2 * b * c));\n}",
"function angle(b, c, a) {\n return acos((b * b + c * c - a * a) / (2 * b * c));\n }",
"function compareBiggerAngle(a1, a2)\n{\n if(a2 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cette fonction affiche la liste de contact sur la page web | function listCarnetContact(){
checkLocalStorage() /* appel à la fonction "checkLocalStorage" */
$('#contactList').html('<ul>') /* Création d'une ul pour y insérer les li correspondant à nos contacts enregistrés */
for(i=0; i < liste.length; i++){ /* pour chaque objets contenus dans le tableau "liste" */... | [
"function listeDesContacts(){\n\tif (listesContact.length > 0){\n\t\tlistesContact.forEach(contact => {\n\t\t\tconsole.log(contact.afficher());\n\t\t})\n\t}else{\n\t\tconsole.log(\"la liste est vide\");\n\t}\n}",
"function listContacts(){\n getContacts().forEach(contact => {\n let contactComponent = cre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses for strike laco active mouse move event in external hover mode | _strikeActiveMouseMove() {
for (let i = 0; i < this._mouseActiveMoveCallbacks.length; i++) {
let currentCallback = this._mouseActiveMoveCallbacks[i][0];
currentCallback(this, event);
}
for (let i = 0; i < this._mouseActiveMoveCallbacks.length; i++) {... | [
"_strikeMouseMove() {\n for (let i = 0; i < this._mouseMoveCallbacks.length; i++) {\n let currentCallback = this._mouseMoveCallbacks[i][0];\n\n currentCallback(this, event);\n }\n\n for (let i = 0; i < this._mouseMoveCallbacks.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs the gold text in RS format: 1m = 1000k, 10m = green text, 1b = 1000m | displayGold(gold) {
// Pick gold image based on # of coins
let stack = "";
switch (true) {
case gold < 25:
stack = "5";
break;
case gold < 100:
stack = "25";
break;
case gold < 250:
... | [
"function drawGold() {goldCountText.innerHTML = numeral(gold).format('0.00a');}",
"function FormatGold (gold) {\n\tvar formatted = FormatComma(gold);\n\tif (gold.toString().length > 6) {\n\t\treturn FormatGold(gold.toString().substring(0, gold.toString().length - 5) / 10) + 'M';\n\t} else if (gold.toString().leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
After the framework have checked if the player has enough money to buy the item the method OnItemBought is called. It them acts as necessary for each item. The default behavior is to update its price and play an audio. | OnItemBought ()
{
this.quantity++;
this.buyPrice = this.CalculatePrice();
//var audio = new Audio("game/assets/sounds/OnItemBought.mp3"); //play audio of being bought
var audio = new Audio(this.sounds.OnItemBought); //play audio of being bought
audio.play();
... | [
"function buyItem(item) {\n\t\tif (clicks >= item.price) {\n\t\tupdateBoughtItems(item);\n\t\taddClicks(-item.price);\n\t\taddClicksPerSecond(item.cps);\n\t\t// I'll use a standard multiplier for this for now\n\t\titem.price = Math.floor(item.price*1.3);\n\t\t//update the new price to the item\n\t\t$(\"#kauppa\"+it... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the slide at position `idx`. | show(idx)
{
if (this.sliding) return false;
if (idx < 0 || idx >= this.slides.length) return false;
this.sliding = true;
this.hide(this.current);
this.rem_class(this.slides[idx], this.slide_hidden);
this.add_class(this.slides[idx], this.slide_active);
this.add_class(this.buttons[idx], this.button_act... | [
"function showSlide(index) {\n hideAllSlideSections(); // start by hiding all slides sections\n activeSlide = index;\n slideSections[activeSlide].style.display = \"block\"; // display slide section by activeSlide number\n}",
"function setCurrentSlide(idx) {\n slideIndex = idx;\n showCurrentSlide(slideIndex);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets an array of regions that are currently in the view starting from top left to bottom right | getRegionsInView()
{
var bottomLeftPos = this.screenToWorldPos(0, window.innerHeight);
var bottomLeftRegion = WORLD.getRegionPositionFromWorldPosition(bottomLeftPos.x, bottomLeftPos.y);
var xRegionMax = Math.floor(((bottomLeftRegion.x + window.innerWidth) / REGION_WIDTH) / this.zoom.x) + 2;... | [
"function calculateRegions() {\n\t\tvar regions = [];\n\n\t\tvar numX = Math.ceil(canvas.width / 300),\n\t\t\tnumY = Math.ceil(canvas.height / 300);\n\n\t\tvar width = canvas.width / numX,\n\t\t\theight = canvas.height / numY;\n\n\t\tfor(var x = 0; x < numX; x++) {\n\t\t\tfor(var y = 0; y < numY; y++) {\n\t\t\t\tre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The number of pixels per unit that is considered the default. | get referencePixelsPerUnit() {} | [
"get spritePixelsPerUnit() {}",
"numPixels() {\n const int = Math.floor(this.rate);\n const dec = int - this.rate;\n const numPixels = int + Math.round(Math.random() * dec);\n return numPixels;\n }",
"set referencePixelsPerUnit(value) {}",
"get pixelWidth() {}",
"_getMaxN() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of checknum function Draw 4 random numbers and append to draw array. Use Math.random for numbers in nums array, then remove number at that index. Loop 4 times. | function drawNums(guess){
var nums = [1,2,3,4,5,6,7,8,9,10];
var drawResult = [];
for (i = 0; i < 4; i++) {
var drawIndex = Math.floor(Math.random() * nums.length);
//console.log(draw);
drawResult[i] = nums[drawIndex];
nums.splice(drawIndex, 1);
}
console.log(drawResu... | [
"function generateRandomGameBoard(game_token_array, main_div) {\n var randomArray = [];\n main_div.append('<img id=\\'reset\\' src=\\'reset.jpg\\'> <h1>Memory</h1>');\n while (randomArray.length < game_token_array.length) {\n var num = Math.floor(Math.random() * (game_token_array.length));\n // alert(num);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add markers to bin locations | function addMarker(mymap, binArray){
binArray.forEach(function(obj){
L.marker([obj["latitude"],obj["longitude"]]).addTo(mymap).bindPopup("Level: "+obj["level"]+" .")
.openPopup();
});
} | [
"function addMarker(mymap, binArray){\n\tfor(var obj in binArray){\n\t\tif(binArray.hasOwnProperty(obj)){\n\t\t\tlet marker=L.marker([binArray[obj][\"latitude\"],binArray[obj][\"longitude\"]]).addTo(mymap);\n\t\t\tmarker.setIcon(redIcon);\n\t\t\tmarkerlist[obj]=marker;\n\t\t\tmarker.bindPopup(\"Level : \"+ binArray... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
expands form, adds weight text field and requires user to fill them, deletes unnecessary information from other special attribute fields | function AddWeight(){
specAttribute.style.cssText = "height: 85px;";
size.style.cssText = "height:0; opacity:0;";
dimentions.style.cssText = "height:0; opacity:0;";
weight.style.cssText = "height: 85px; width:100%; opacity:1; overflow: visible;";
weight.getElementsByTagName("input")[0].required = t... | [
"function cleanUpForm() {\n $(weighting).val(100);\n $(grade).val('').focus();\n}",
"function AddSize(){\n specAttribute.style.cssText = \"height: 85px;\";\n \n weight.style.cssText = \"height:0; opacity:0;\";\n dimentions.style.cssText = \"height:0; opacity:0;\";\n size.style.cssText = \"hei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates if the right key is pressed | isRightPressed() {
return this.currentKeys.get(RIGHT);
} | [
"function keyPressedForNodeRight(node) {\n return kd.X.isDown();\n }",
"get isRightArrowKeyDown() {\n return this._isRightArrowKeyDown;\n }",
"function keyDownHandler(e) {\n if (e.key == \"Right\" || e.key == \"ArrowRight\") {\n rightPressed = true;\n } else if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validating /////////////////////////////////////////////////////////////////// validate strain | function validateStrain(id) {
console.log("validateStrain()");
if (vm.apiDomain.strain == undefined || vm.apiDomain.strain == "") {
vm.apiDomain.strainKey = "";
vm.apiDomain.strain = "";
return;
}
if (vm.apiDomain.strain.includes("%")) {
vm.... | [
"function validateStrain() {\n console.log(\"validateStrain()\");\n console.log(\"vm.apiDomain.probeSource.strain: \" + vm.apiDomain.probeSource.strain);\n if (vm.apiDomain.probeSource.strain == undefined || vm.apiDomain.strain == \"\") {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build a Variable Hint if the supplied node contains a Variable affectation. | buildVariableHints(node) {
let varNode = EsprimaHelper_1.EsprimaHelper.reduceNodeToVarDeclaration(node);
if (!varNode) {
return new Map();
}
let varNames = EsprimaHelper_1.EsprimaHelper.getVariableNames(varNode);
let varHints = varNames.map(varName => {
le... | [
"function VariablePlugin(opts) {\n const name = 'variable';\n const options = opts;\n\n const tags = [\n {\n html: 'variable',\n slate: 'variable',\n md: 'variable'\n }\n ];\n\n /**\n * Augment the base schema with the variable type\n * @param {*} schema\n */\n const augmentSchema =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribe a target to an event. | subscribe(event, target) {
if (!this.subscriptions[event]) {
this.subscriptions[event] = []
}
this.subscriptions[event].push(target)
} | [
"function Subscription (target, event, handler) {\n this.target = target;\n this.event = event;\n this.handler = handler;\n\n this.target.addEventListener(event, handler, true);\n }",
"function signalFromEvent (target, event) {\n return new QuickSignal(function (subscriber) {\n var handler = func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert the amount of times to put the roman numeral | function insertRoman(num, rn){
var roman = "";
for(let i = 0; i < num; i++){
roman = roman.concat(rn);
}
return roman;
}//insertRoman | [
"function solution(num) {\n key = {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n };\n var roman = \"\";\n for (var entry in key) {\n while (num >= key[entry]) {\n roman += entry;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assuming we're loaded, return manifest `info` for a file specified by `filePath`. `filePath` can be any of: | getFileInfo(filePath) {
const location = this.getFileLocation(filePath)
if (location) return this.manifest[location.path]
} | [
"static loadAssetManifest(filePath) {\n return this.loadManifest(filePath, ASSETS_SCHEMA);\n }",
"static loadIntegManifest(filePath) {\n return this.loadManifest(filePath, INTEG_SCHEMA);\n }",
"static loadAssemblyManifest(filePath, options) {\n try {\n jsiiDeprecationWarnin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Import another module into the current runtime module. | importModule(mod) {
this.lib.checkCall(this.lib.exports.TVMModImport(this.handle, mod.handle));
} | [
"import(moduleInstanceObject) {\n throw Error('Not implemented');\n }",
"importModule(module_path) {\n if(!module_path.startsWith('./') && !module_path.startsWith('.\\\\')) {\n module_path = './' + module_path;\n }\n let module = require(module_path)\n this.modules[modul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instruksi ========= Buatlah sebuah function bernama drawLadder yang menerima satu parameter bernama row, dan akan menampilkan x ke samping di baris ganjil, dan o di baris genap. Function drawLadder tidak perlu mereturn apapun. Contoh 1 input: 3 x oo xxx Contoh 2 input: 6 tampilan: x oo xxx oooo xxxxx oooooo | function drawLadder(row) {
//code goes here!
for (var i = 1; i <= row; i ++) {
var output = "";
if (i%2!==0) {
for (var k = 1 ; k <= i; k++){
output += `x`;
}
}
else {
for (var j = 1 ; j <= i; j++){
output += `o`;
... | [
"function drawLadder(row) {\n // hanya code disini\n var j = '';\n var x = []\n for (i = 1; i <= row; i++) {\n if (i % 2 === 0) {\n j = j + 'o';\n } else {\n j = j + 'x'\n }\n x.push(j)\n }\n return x\n}",
"function drawLadder(row) {\n // hanya code disini\n var baru = ''\n for(var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creating Setlist view SetlistFromURI('spotify:user:lindstrom_official:playlist:6GqaLK88iH6XliGziOijCS'); | function SetlistFromURI(uri){
trackList = new Array();
trackInfo = new Array();
models.Playlist.fromURI(uri)
.load(['name','tracks'])
.done(function(pl){
playlist = pl;
var list = List.forPlaylist(pl);
pl.tracks.snapshot()
.done(function(t){
trackList = t.toArray();
list.init()... | [
"function buildSetlistUrl(mbid){\r\n return proxyUrl + 'https://api.setlist.fm/rest/1.0/artist/' + mbid + '/setlists';\r\n}",
"addPlaylistSongs(playlistUris) {\n let parsed = queryString.parse(window.location.search);\n let accessToken = parsed.access_token;\n if (!accessToken)\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here's everything you need to run a python program in skulpt grab the code from your textarea get a reference to your pre element for output configure the output function call Sk.importMainWithBody() | function runit() {
var prog = simple_coding.getTextArea().value;
console.log("************code"+prog)
var mypre = document.getElementById("output");
console.log("************mypre "+mypre)
mypre.innerHTML = '';
Sk.pre = "output";
// console.log("-----------------... | [
"function runit() {\n var prog = document.getElementById(\"yourcode\").value;\n var mypre = document.getElementById(\"output\");\n mypre.innerHTML = \"\";\n Sk.pre = \"output\";\n Sk.configure({ output: outf, read: builtinRead });\n (Sk.TurtleGraphics || (Sk.TurtleGraphics = {})).target = \"mycanvas\";\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes set inline style. | _removeInlineStyle() {
const that = this,
tabStrip = that.$.tabStrip;
if (that._inlineStyleTabStripChildren) {
const tabStripChildren = tabStrip.children;
for (let i = 0; i < tabStripChildren.length; i++) {
tabStripChildren[i].removeAttribute('style'... | [
"clearInlineStyles() {\n this.players.forEach(player => {\n // player.row.removeAttribute('style');\n asArray(player.row.childNodes)\n .filter(node => node.nodeType === Node.ELEMENT_NODE)\n .forEach(child => child.removeAttribute('style'));\n });\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
imitates the messenger application's status box and displays the status of the user in it | function showStatusBox() {
//insert the status box right at the end of the page's body, with all of the divs inside
$("body")
.append("<div id='statusBox'><div id='statusBoxTop'><div id='statusBoxTopLeft'></div><div id='statusBoxTopRight'></div><div class='statusBoxClear'></div></div><div id='statusBoxMain'><div... | [
"function show_status(msg, busy) {\n $(\"#top-status-box\").text(msg);\n $(\"body\").css(\"cursor\", busy ? \"progress\" : \"default\");\n }",
"function status(msg) {\n if (platform_1.isMacintosh) {\n alert(msg); // VoiceOver does not seem to support status role\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter suggested values for tag search | _filter(value) {
const filterValue = value.toLowerCase();
return this.tags_all.filter(option => option.text.toLowerCase().includes(filterValue));
} | [
"function filterData(tag){\n\t\t\tautocompleteOpen = true;\n\n\t\t\tfor (var i = vm.filteredData.length - 1; i >= 0; i--) {\n\t\t\t\tvar filter = true;\n\t\t\t\tfor(var j = vm.filteredData[i].tags.length - 1; j >= 0; j--){\n\t\t\t\t\t\n\t\t\t\t\tvar searchTag = tag.text.toLowerCase();\n\t\t\t\t\tvar postTag = vm.fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
refreshes the count indicator for requests and approvals | function refreshCount() {
setCount('manager');
setCount('employee');
} | [
"_updateTotalRequestsCount() {\n const count = this._httpSupervisor.totalRequests;\n\n if (count > 0) {\n this._el.logIsNotEmpty();\n } else {\n this._el.logIsEmpty();\n }\n\n this._el.updateCalls(this._httpSupervisor.onGoingCallsCount, this._httpSupervisor.totalRequests);\n }",
"onUpdat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
iframe generator for couch mode | function arte_vp_couch_mode_iframizator(couchmode_param)//jquery object
{
var playlist_url = "";
var prefix = arte_vp_getCurrentHost("main.js");
var autostart = "";
var rendering_place = "";
var start_index = 0;
if(typeof(couchmode_param.attr("arte_vp_json_playlist_url")) !== "undefined")
... | [
"function genEmbedCode( item )\n{\n var code = \"<iframe src="\"+item[\"outputFiles\"][\"krpano\"]+\"/index.html" seamless=true width="100%" height="500px"></iframe>\";\n\n return code;\n}",
"function generatePreview(){\n prepareContent();\n var iframe = $(\"#preview\");\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Date = datetime obejct. Interval = number of minutes (number) | function roundToInterval(date, interval) {
p = interval * 60 * 1000; // milliseconds in an hour
return new Date(Math.round(date.getTime() / p ) * p);
} | [
"function oneDayInterval(date) {\n let start = new Date(date.getTime());\n start.setHours(0, 0, 0);\n let end = new Date(date.getTime());\n end.setHours(23, 59, 59);\n return {start, end};\n}",
"function startOfInterval(date, interval) {\n\tconst datesInterval = intervalName(date, interval)\n\tretu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the table properties dialog | showTablePropertiesDialog() {
if (this.tablePropertiesDialogModule && !this.isReadOnlyMode && this.viewer) {
this.tablePropertiesDialogModule.show();
}
} | [
"function showTableConfig() {\n\t\t\tvar tableProp = getTableProp(); \n\t\t\ttemplates.render('table-config', {prop: tableProp}, function(html){ \n\t\t\t\tpopup.create(html);\n\t\t\t});\n\t\t\t\n\t\t}",
"showTableDialog() {\n if (this.tableDialogModule && !this.isReadOnlyMode && this.viewer) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the blinking sequence signature. Since blinking sequences cannot be read from the device, this can be used to detect if a specific blinking sequence is already programmed. | get_blinkSeqSignature() {
return this.liveFunc._blinkSeqSignature;
} | [
"getSignature() {\r\n const bodyEnd = this.soundDataOffset + this.soundDataLength + 32;\r\n return this.bytes.subarray(bodyEnd, bodyEnd + 128);\r\n }",
"get_blinkSeqSize() {\n return this.liveFunc._blinkSeqSize;\n }",
"get lastSeqNo() {\n return this.seqNo & 0x20 === 0x20\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new color based on the given color Calculated based on the pitch of the audio | function getColorFromSound(oldColor) {
var color = oldColor;
var pitch = detectPitch();
if (pitch) {
var hex = Math.floor(pitch).toString(16);
hex = ("000" + hex).substr(-3);
color = new THREE.Color("#" + hex);
var r = 0.9 * oldColor.r + 0.1 * color.r;
var g = 0.9 * oldColor.g + 0.1 ... | [
"function getColorFromSound(oldColor) {\n\t var color = oldColor;\n\t var pitch = detectPitch();\n\t if (pitch) {\n\t var hex = Math.floor(pitch).toString(16);\n\t hex = (\"000\" + hex).substr(-3);\n\t color = new THREE.Color(\"#\" + hex);\n\t\n\t var brt = 0.6; // Brightness\n\t var lgt = 0.4; //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a number (07) for each limit combination lower/target/upper | limitsToNumber() {
const { target, lowerLimit, upperLimit } = this.props;
const L = lowerLimit !== null ? 1 : 0;
const T = target !== null ? 2 : 0;
const U = upperLimit !== null ? 4 : 0;
return L + T + U;
} | [
"getBound(threshold) {\n let l = 0;\n let r = this.l;\n while (r > l) {\n const m = Math.floor((l + r) / 2);\n const sumM = this.sum(m);\n if (sumM > threshold) {\n r = m;\n continue;\n } else if (sumM < threshold) {\n if (l =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to toggle between inline and flyout modes, we change the elements that the targetImg, zoomParent, and zoomContain vars refer to | function updatePlacement(){
if( o.placement === "inline" ){
targetImg = initialImg;
$zoomParent = $parentPane;
$element.data("zoomParent", $zoomParent);
$zoomContain = $contain;
} else {
targetImg = $flyout.find( "img" )[ 0 ];
$zoomParent = $zoomContain = $flyout;
$el... | [
"function setupZoom(){prepZooms(),insertZoomHTML(),zoomdiv=document.getElementById(zoomID),zoomimg=document.getElementById(theID)}",
"setUpImageZooming(imgWrapper, imgCell, zoom, url, w, h, selBox, scale) {\n const zoomW = 600;\n const zoomH = 200;\n const box = {x: 0, y: 0, w: zoomW, h: zoomH};\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory method to create a estate object | static createInstance(id, owner, tenant, price, metadata) {
return new Estate({ id, owner, tenant, price, metadata });
} | [
"function createEstate() {\n let estate = {\n roseArbor: [],\n perennialGarden: [],\n slopePlanters: [],\n };\n return estate;\n}",
"function makeRealEstate() {\n var id = randomNumber(1000,9999);\n var area = randomNumber(1000,9999);\n var price = randomNumber(15,30);\n return new RealEst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
User defined field 2 | function setUserDefined2( userVal ) {
this.user_defined_fld2 = userVal;
} | [
"function Field(_crc2) {\n this.crc2 = _crc2;\n }",
"static Field(name, type, def, array) { return ModelFormat.from([name, type, def, array]); }",
"get fieldInfo() {}",
"getFirstInvalidField() {\n\n }",
"function newFieldSelect2Object() {\n\n return _.merge(newBaseFieldObject(), ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts numeric audio types in a textual relation | function mapAudioType(type) {
switch (type) {
case 'normal': return ("normal audio");
case 'alt. voiceover': return ("alternative voiceover");
default: return (type);
}
return (type);
} | [
"function _handleWaveType(int){\n var rawWaveValue = parseInt(int);\n switch (rawWaveValue) {\n case 0:\n stringWaveValue = 'sine';\n break;\n case 1:\n stringWaveValue = 'square';\n break;\n case 2:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to: can be an element or one of "end" "start" scrollBox: can be the window object or an element direction: can be one of "horizontal" "vertical" offset: is a number by which to scroll beyond a target, scrolling will stop before the target if a negative number is provided duration: is a number which describes the animat... | function animatedScrollTo(_ref) {
var to = _ref.to,
_ref$scrollBox = _ref.scrollBox,
scrollBox = _ref$scrollBox === void 0 ? window : _ref$scrollBox,
_ref$direction = _ref.direction,
direction = _ref$direction === void 0 ? 'vertical' : _ref$direction,
_ref$offset = _ref.offset,
off... | [
"function scrollTo(to, options) {\n\n // Making args flexible\n //\n // Allow for element or y-coordinates\n if(typeof(to) === 'object') { to = fromTop(to) }\n\n // Default duration = 500\n options.duration = options.duration || duration\n\n var start = position(),\n change = to - start,\n currentTime ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes sure the `left` values of all three frames are set correctly. focusedFrame is in the center, displaying pageIndex. | function repositionFrames() {
if (focusedFrame === 0) {
frames[2].element.css('left', page * 100 - 100 + '%');
frames[0].element.css('left', page * 100 + '%');
frames[1].element.css('left', page * 100 + 100 + '%');
frames[2].pageId = page === 0 ? scop... | [
"set left(left) {\n this._frame.origin.x = Math.round(left);\n }",
"function resetLeft(){\n\t\t\t\tvar iframeX = editorIFrame.getDocumentPosition().x,\n\t\t\t\t\twinX = win.getScrollPosition().x;\n\t\t\t\t\ttoolbarSpan.setStyle('left', (iframeX-winX)+'px');\n\t\t\t}",
"function setLeftPosition() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the file system where the current executable was started from is caseinsensitive, otherwise returns false. | async function isCaseInsensitiveFS() {
if (typeof module.exports._caseInsensitiveFS === 'undefined') {
let lcStat;
let ucStat;
try {
lcStat = await fse.stat(process.execPath.toLowerCase());
} catch (err) {
lcStat = false;
}
try {
ucStat = await fse.stat(process.execPath.toUpp... | [
"isCaseInsensitive() {\n return !!this._options['case-insensitive'];\n }",
"function matchCase(file) {\r\n var parts = file.split('/');\r\n var dir = '.';\r\n for (var i=1; i<parts.length; i++) {\r\n var names = fs.readdirSync(dir);\r\n if (names.indexOf(parts[i]) < 0) return false;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the user toggling the selected/deselected state of a file or folder. | handleToggleSelect(event, item) {
if (this.props.selectedFiles.indexOf(item.id) === -1) {
this.props.actions.gallery.selectFiles([item.id]);
} else {
this.props.actions.gallery.deselectFiles([item.id]);
}
} | [
"function onFolderSelectChange() {\n\n\t// Get the folder name if any.\n\tfolderName = getSelected(folderSelect);\n\n\t// Null out the module and service names.\n\tmoduleName = null;\n\tserviceName = null;\n\n\t// Enable or disable the folder Go button.\n\tdisableButton(goFolderButton, !folderName);\n\n}",
"click... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function that recursively discovers the configured size for a given renderNode. | function _resolveConfigSize(renderNode) {
if (renderNode instanceof RenderNode) {
var result = null;
var target = renderNode.get();
if (target) {
result = _resolveConfigSize(target);
if (result) {
return result;
... | [
"function _resolveNodeSize(node) {\n\t var localItemSize = itemSize;\n\t if (getItemSize) {\n\t localItemSize = getItemSize(node.renderNode, size);\n\t }\n\t if ((localItemSize[0] === true) || (localItemSize[1] === true)) {\n\t var result = context.resolveSize(node,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
emps who are not managers | allEmplyoeesNamesNotManager(connection) {
return new Promise((resolve, reject) => {
connection.query(
`SELECT id ,first_name , last_name FROM employees AS e WHERE e.manager_id != e.id`,
(err, res) => {
if (err) {
reject(err);
}
resolve(res);
}
... | [
"giveValidUsers(employees) {\n\t\tif (this.props.role === 'chief') {\n\t\t\treturn employees.filter(employee => {\n\t\t\t\tif (this.props.departmanID === employee.departmanID) return true;\n\t\t\t});\n\t\t} else {\n\t\t\t// give all amployee's\n\t\t\treturn employees;\n\t\t}\n\t}",
"function listManagersAndSubord... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the range that covers the name of the image used by this instruction. | getImageNameRange() {
let range = this.getImageRange();
if (range) {
let registryRange = this.getRegistryRange();
if (registryRange) {
range.start = this.document.positionAt(this.document.offsetAt(registryRange.end) + 1);
}
let tagRange = t... | [
"getImageRange() {\n let args = this.getArguments();\n return args.length !== 0 ? args[0].getRange() : null;\n }",
"getImageRange() {\r\n let args = this.getArguments();\r\n return args.length !== 0 ? args[0].getRange() : null;\r\n }",
"getImageNameRange() {\r\n let rang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This functions creates the music for each scene. | function initGameMusic(){
musicTheme = new THREE.AudioListener();
scene.add( musicTheme );
var sound = new THREE.Audio( musicTheme );
// global audio source
if (gameState.scene=='start') {
var audloader = new THREE.AudioLoader();
audloader.load( 'libs/sounds/MainThemeV2.m4... | [
"function createSounds(Scene){\n Scene.soundFX = Scene.sound.add('game_music', {loop: 'true',volume: 0.05});\n Scene.soundFX.rate = 1;\n Scene.soundFX.play();\n}",
"addSound() {\n // creates the menu music, using the current chord progression (sequence)\n this.musicMenu = new MusicPlayer(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NEXT FUNCTION RANDOMLY RETURNS A CHARACTER FROM 'code_character_array' | function create_code_character()
{
const code_character_array =
["0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z"];
let random_array_index = Math.floor(
... | [
"function randomChar(array) {\n return array[Math.floor(Math.random() * array.length)]\n}",
"function generateRandomCode() {\n var length = config.CODE_LENGTH;\n var charsetLength = config.CHARSET.length;\n var code = '';\n\n while (length > 0) {\n code += config.CHARSET[Math.floor(Math.random... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
code TODO: new_naat_youtubeCtrl | controller_by_user controller by user | function controller_by_user(){
try {
$ionicConfig.backButton.text("");
} catch(e){
console.log("%cerror: %cPage: `new_naat_youtube` and field: `Custom Controller`","color:blue;font-size:18px","color:red;font-size:18px");
console.dir(e);
}
} | [
"function controller_by_user(){\r\n\t\ttry {\r\n\t\t\t\r\n\r\n \r\n$ionicConfig.backButton.text(\"\");\r\n$scope.pauseVideo = function() {\r\n var iframe = document.getElementsByTagName(\"iframe\")[0].contentWindow;\r\n iframe.postMessage('{\"event\":\"command\",\"func\":\"' + 'pauseVideo' + '\",\"args\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to make the layer and the message disapear | function closeLayer() {
document.querySelector(".layer").remove();
document.querySelector(".messageBox").remove();
// Store in session that user has seen the message
sessionStorage.setItem("informed", true);
} | [
"function layerOff() {\n throttledRedraw.cancel();\n drawLayer.interrupt();\n touchLayer.selectAll('.qaItem.improveOSM')\n .remove();\n\n drawLayer\n .transition()\n .duration(250)\n .style('opacity', 0)\n .on('end interrupt', () => {\n editOff();\n dispatch.call('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GAME Declaration and "constructor" of GAME CLASS: It is necessary to introduce the size of the board | function Game(size){
this.size = size; // Size of the (square)board
this.board = []; // Initializes the array which will contain the board
this.createBoard(); // Creates the board
} | [
"function Game(boardSize) {\n var player1 = new Player(\"X\", true);\n var player2 = new Player(\"O\", false);\n var board = new Board(boardSize);\n this.player1 = player1;\n this.player2 = player2;\n this.board = board;\n}",
"function Game(boardLengthPx, boardLengthBlocks, boardColor) {\n var canvas = doc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a list of namespaces where the user can perform this particular action | getUserAccessAllNamespaces(variables) {
return client.query({ query: Query.userAccessAnyNamespaces, variables })
} | [
"apiGetNamespaces() {\n return this._apiGet('namespaces')\n }",
"function request_namespaces() {\n return (client.openshift ? client.projects().get() : client.namespaces().get())\n .then(response => {\n namespaces = JSON.parse(response.body.toString('utf8'));\n if (namespaces... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that add the bump to the moons or planets | addBump(mapUrl, bumpMapUrl) {
// Create a textre phong material for the cube
// First, create the texture map
this.texture = new THREE.TextureLoader().load(mapUrl);
this.bumpMap = new THREE.TextureLoader().load(bumpMapUrl);
this.material = new THREE.MeshPhongMaterial({
... | [
"levelBump() {\n\n level++;\n\n // bump speed every 5 levels\n if(level % 7 == 0) {\n console.log(`level: ${level}, speed: ${this.obstacleSpeed}`); \n if(this.obstacleSpeed >= this.maxSpeed) { // increase barrier speed\n this.obstacleSpeed -= 25;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the string is a valid identity card code. locale is one of ['ES', 'zhTW', 'heIL', 'arTN'] OR 'any'. If 'any' is used, function will check if any of the locals match. Defaults to 'any'. If given value is not a string, then it returns false. | function isIdentityCard(value, locale) {
return typeof value === 'string' && validator_lib_isIdentityCard__WEBPACK_IMPORTED_MODULE_1___default()(value, locale);
} | [
"function isIdentityCard(value, locale) {\n return typeof value === 'string' && isIdentityCard_1.default(value, locale);\n}",
"function isIdentityCard(value, locale) {\n return typeof value === \"string\" && validator.isIdentityCard(value, locale);\n}",
"function isIdentityCard(value, locale) {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actualizar el balance, los ingresos y las expensas | function updateValues() {
//Toma los valores de cada transaccion ingresada
const amounts = transactions.map(transaction => transaction.amount);
//Sumando y restando todos los valores
const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);
//Ingresos totales
const income = amounts
... | [
"function updateValues() {\n const amounts = transactions.map(transaction => transaction.amount);\n const total = amounts.reduce((acc, item) => (acc += item), 0).toFixed(2);\n //calculating total remaining income\n const income = amounts\n .filter(item => item > 0)\n .reduce((acc, item) => (acc += item), ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes in TWO callback functions! | function doTogether(firstCallback, secondCallback){
firstCallback(); //execute the first function
secondCallback(); //execute the second function
console.log('at the same time!');
} | [
"function callback(){}",
"function runCallback() {\n if (resultA && resultB) {\n callback(resultA, resultB);\n }\n }",
"function multiplesCallbacks(callback1, callback2, callback3){\n\n\tcallback1('Primer paso');\n\n\tcallback2('Segundo paso');\n\n\tcallback3('Ultimo paso');\n}",
"function callbac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make all markers visible on the map | function setMarkersVisible() {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(map);
}
} | [
"function showMarkers() {\n setAllMap(map);\n }",
"function showMarkers() {\n\t\t\tsetAllMap(map);\n\t\t}",
"function showMarkers() {\n\t setMapOnAll(map);\n\t}",
"function showMarkers() {\n\t setAllMap(map);\n\t}",
"function showMarkers() {\n\t\t setAllMap(map);\n\t\t}",
"function showAllM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tested on: IE, Chrome, Mozilla Depends on: Returns the first valid funtion | function validFuncOf() {
var returnValue;
for (var i = 0, length = arguments.length; i < length; i++) {
var lambda = arguments[i];
try {
returnValue = lambda();
break;
} catch (e) { }
}
return returnValue;
} | [
"function returnFirstArgument(param1, param2, param3) {}",
"function getFunctionThatReturns123() {}",
"function firstMatch(code, functions) {\n var firstMatch = null;\n for (var _i = 0, functions_1 = functions; _i < functions_1.length; _i++) {\n var func = functions_1[_i];\n var match = func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the from field f a particular transaction | function getFrom(transaction) {
} | [
"function extractFieldValueFtn(obj, field) {\n $log.info('from object : ' + JSON.stringify(obj));\n if(typeof obj.getField === \"function\") {\n return obj.getField(field); \n } else {\n return 0;\n }\n }",
"static get Transaction () {\n return bcoin.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a random result from available bitcoin address types | function randomType () {
const addressTypes = [
'bech32',
'legacy',
'p2sh-segwit'
]
const randomIndex = [Math.floor(Math.random() * 3)]
return addressTypes[randomIndex]
} | [
"async function GetRandomRestaurant(address, foodType, priceRange) {\n const businesses = await QueryYelp(address, foodType, priceRange);\n return getRandomArrayEntry(businesses);\n}",
"async newAddress (multiple, addressType, label = '') { \n const addressTypes = [\n 'legacy',\n 'p2sh-segwit',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if the player is pressing the block button to block projectiles | function playerBlocking(){
if(blockKey._justDown && !leftMoveKey.isDown && !rightMoveKey.isDown){
blocking=true;
if(playerFacingRight==true){
player.anims.play('blockingAnim', true);
player.setOffset(0, 45);
}
else if(playerFacingR... | [
"function blockAttack() {\r\n itemSelect.play(null,null,1,false,true);\r\n //If false, player can't do another action.\r\n if (isContinue == true)\r\n {\r\n //Player 1 block action.\r\n if (player1 == true && player2 == false)\r\n {\r\n isBlockR = true;\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drag the modal around // | function startDrag () {
dragElement(document.getElementById("gamesModal"));
} | [
"function movermodal() {\n\n $(\".modal-header\").on(\"mousedown\", function (mousedownEvt) {\n var $draggable = $(this);\n var x = mousedownEvt.pageX - $draggable.offset().left,\n y = mousedownEvt.pageY - $draggable.offset().top;\n $(\"body\").on(\"mousemove.draggable\", function (mousemov... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends information about an external dependency (outgoing call) in the application. | trackDependency(telemetry) {
this.defaultClient.trackDependency(telemetry);
} | [
"function depend () {\n\tvar args = Array.prototype.slice.call(arguments, 0);\n\tvar comp = args.shift();\n\tcomponents[comp] = {\n\t\tdependencies: args\n\t}\n\tprettyLog('info','COMPONENT ' + comp + ' DEFINED WITH DEPENDENCIES ' + (args.length ? args.join(', ') : '-NONE-'));\n\t\n}",
"depend() {\n if ( Dep.t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate over an array of tests for a given function and run them | function runTestArray(testArray, functionToTest) {
console.log("Testing " + functionToTest.name);
for (let i=0; i<testArray.length; i++) {
const test = testArray[i];
const testNumber = i + 1;
runTest(functionToTest, test, testNumber);
}
} | [
"function runAllTests() {\n var testFunctions = _getAllTestFunctions();\n\n for (var i=0; i<testFunctions.length; i++) {\n console.log('-- ' +testFunctions[i]+ ' --');\n eval(testFunctions[i]+ '()'); // Call the function\n\n str = 'Passed: ' +testsPassed+ '. Failed: ' +testsFailed+ '.';\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
judge if the targerWord has one word form the compareWord | function ifDiffOneWord(word, compareWord) {
if (word.length != compareWord.length) return false;
let diffWordsCount = 0;
for (var i = 0; i < word.length; i++) {
if (word[i] != compareWord[i]) {
diffWordsCount++;
}
if (diffWordsCount > 1) return false;
}
if (diffW... | [
"function compareWords(oneWord, anotherWord) {\n // if one word is longer than another word, send it to the back\n if (oneWord.length < anotherWord.length)\n return -1;\n // if one word is shorter than another word, send it to the front\n else if (oneWord.length > anotherWord.length)\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ajax load list color in dropdownbox | function loadDropDownColor(){
$.ajax({
dataType: "json",
type: 'GET',
data:{},
contentType: "application/json",
url: getAbsolutePath() + "color/list",
success: function(data){
if(data.status == "ok"){
$.each( data.list, function( key, value ) {
$('#dialogEditP... | [
"function loadDropDownAccGroup(){\n\t\t$.ajax({\n\t\t\tdataType: \"json\",\n type: 'GET',\n data:{},\n url: getAbsolutePath() + \"accessorygroup/list\",\n success: function (data) {\n \t$.each(data.list, function( key, value ) {\n $(\"#sltAc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trigered when click on remove question from question field | function hideAndRemoveQuizQuestion(event) {
var jQuestionForm = $(this);
var jQuestionFormListItem = jQuestionForm.closest("li");
var id = jQuestionFormListItem.attr("data-id");
quiz.DeleteQuestion(id);
jQuestionFormListItem.slideUp(animationTime,function () {
jQues... | [
"function remove_answer_evt(){\n\t\t\tif(confirm('Bạn có chắc chắn ?')){\n\t\t\tdelete answers[id];\t//delete from manager\n\t\t\tcurrent_index--;\n\t\t\tanswers_container.removeChild(main);\n\t\t\treset_answers();\t//reset elements\n\t\t\tif(typeof answer_delete_event=='function') answer_delete_event(data); //call... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the user has changed the car in some way by choosing a different body, colour, wheels and flags. | function onBodyChanged()
{
//Update the display showing which indices these are.
updateSelectorBox();
//Set flag, body, colour and wheels images
flagImage.src = flagImages[flagIndex];
carbodyImage.src = carbodyImages[carbodyIndex];
colourImage.src = colourImages[colourIndex];
wheelImage.src = wheelImages[wheel... | [
"changeVehicle() {\n if (this.userData.vehicle = 'car') {\n this.vehicles.motorcycle.position.copy(this.vehicles.car.position);\n this.scene.remove(this.vehicles.car);\n this.scene.add(this.vehicles.motorcycle);\n this.userData.vehicle = 'motorcycle';\n } else {\n this.vehicles.car.po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: makeVariableToken Given a variable index, creates a token holding that variable index. | function makeVariableToken(varIndex, start, end) {
return { type: "variable",
index: varIndex,
"start": start,
"end": end };
} | [
"function createVariable() {\n var id = nextVariableId++;\n var name = '$V';\n\n do {\n name += variableTokens[id % variableTokensLength];\n id = ~~(id / variableTokensLength);\n } while (id !== 0);\n\n return name;\n }",
"function createVariable() {\n var id = nextVariableId++;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end current chat session | function endChat() {
logger.debug("endChat", "...chatState="+chatState);
if (chat && (chatState == chat.chatStates.CHATTING || chatState == chat.chatStates.RESUMING
|| chatState == chat.chatStates.WAITING)) { //|| chatState == chat.chatStates.NOTFOUND
var endChatParam = {
disposeVi... | [
"function endChat() {\n\tconsole.log('Removing self from chat');\n}",
"function endChat() {\n\tconsole.log('Removing self from chat');\n\n\twebChatApi.deleteWebchatGuestConversationMember(chatInfo.id, chatInfo.member.id)\n\t\t.then(() => {\n\t\t\tconsole.log('disconnected');\n\n\t\t\t// Enable the form again\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for updateRepositoryHostedPropertyValue / Update an application property value stored against a repository. | updateRepositoryHostedPropertyValue(incomingOptions, cb) {
const Bitbucket = require('./dist');
let apiInstance = new Bitbucket.PropertiesApi(); // String | The account // String | The repository // String | The key of the Connect app // String | The name of the property.
/*let username = "username_example... | [
"updatePullRequestHostedPropertyValue(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PropertiesApi(); // String | The account // String | The repository // String | The pull request ID // String | The key of the Connect app // String | The name of the propert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================ | GSAP Animations | ================================================================ Animating main menu links | function animateMainMenuLinks() {
var main_menu_links = $(".main_menu .links.normal").find("ul.main > li");
TweenMax.staggerFromTo( main_menu_links, 2,
{
opacity : 0,
},
{
opacity : 1,
delay : 0.5
}, 0.1 );
} | [
"function menu_animation() {\n\n var transform = '50% 50%';\n\n if (!Modernizr.excludedplatforms) {\n transform = '25px 25px';\n }\n\n tl.add([\n TweenMax.to('.menu-bkg', .5, {height: win_height}), //Need to come up with a dynamic way to control this\n Tw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an array of bytes representing a Sherlock file into an array of lines representing the useful data from the file. | function sherlockBytesToLines(aBytes, aCharsetCode) {
// fileCharsetFromCode returns the default encoding if aCharsetCode is null
var charset = fileCharsetFromCode(aCharsetCode);
var dataString = bytesToString(aBytes, charset);
if (!dataString)
FAIL("sherlockBytesToLines: Couldn't convert byte array!", Cr.... | [
"_getLinesArray(fileContent) {\n return fileContent.split(`\\n`);\n }",
"function readFileLinesIntoArray(filename) {\n let fileContents = fs.readFileSync(filename, 'uft8');\n return fileContents.split('\\n');\n}",
"function storeLineInArray(file_dr) {\n let text = fs.readFileSync(file_dr, 'utf-8');\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Hinge constraint between objA and objB | setHingeConstraint(objA, objB, constraintPos, constraintLimitsUpper, constraintLimitsLower, constraintAxes) {
if (constraintAxes == 'x')
constraintAxes = new THREE.Vector3(1,0,0);
else if (constraintAxes == 'y')
constraintAxes = new THREE.Vector3(0,1,0);
else if (constr... | [
"attach(body)\n {\n this.constraint.bodyA = body;\n }",
"function HingeJoint(config, lowerAngleLimit, upperAngleLimit) {\n Joint.call(this, config);\n this.type = JOINT_HINGE;\n // The axis in the first body's coordinate system.\n this.localAxis1 = config.localAxis1.clone().normalize();\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Question Text return the HTML for each question based on its type | function getQuestionText( question ) {
var output = "";
switch(question.question_type) {
case "calculated_question":
output = calculatedQuestion(question)
break;
case "essay_question":
output = essayQuestion(question)
break;
case "file_upload_question":
... | [
"function getQuestionText(question){\n var text = question[\"body\"];\n return makeEntry(\"question\",text)\n}",
"function makeHTMLQuestion() {\n let annoucementText = determineAnnoucementText();\n let answer_1 = STORE[questionNumber].answer_1;\n let answer_2 = STORE[questionNumber].answer_2;\n let answer_3... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
has the markdown changed since loading? | get changed() {
return this.markdown !== this.initialMarkdown;
} | [
"isMarkdown(){\n if(this.getCurrentTitle().split('.').pop()==='md'){\n return true;\n }\n else{\n return false;\n }\n }",
"isUserChange() {\n let lastLoadTimestamp = this.lastLoadTimestamp;\n let lastResetTimestamp = this.lastResetTimestamp;\n let currentTimestamp = Date.now();\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |