query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Adds main element to sub element's usedBy set | addToUsedBy(fqn, element) {
if (fqn in this.elements) {
let subElement = this.get(fqn);
subElement.usedBy.add({
name: element.name,
fqn: element.fqn,
path: element.namespacePath
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupUselessElement() {}",
"add(element) {\n element.children = [];\n element.overridden = [];\n element.usedBy = new Set();\n if(element.isGroup) {\n element.cssClass = 'group';\n element.displayTitle = 'Group';\n } else if(element.isAbstract) {\n element.cssClass = 'abstract';\n ... | [
"0.5890793",
"0.57753426",
"0.577352",
"0.5480557",
"0.5372038",
"0.53471386",
"0.53425646",
"0.5297821",
"0.5243703",
"0.5212172",
"0.5162229",
"0.51575637",
"0.51575637",
"0.5154678",
"0.51163983",
"0.5108197",
"0.50992423",
"0.50893474",
"0.5059059",
"0.5056613",
"0.504440... | 0.75899225 | 0 |
Iterates over fields adding constraints and checking for natively defined and overridden attributes | updateFields(element) {
if (!('fields' in element)) return;
// Build map of ancestors to track field origins
let hierarchyFields = {};
element.hierarchy.forEach((a) => {
hierarchyFields[a.fqn] = [];
});
// Iterate over fields, handle valueType TBD separately
element.fields.forEach((fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_defineFields () {\n let {fields} = this.$schema;\n\n for (let name in fields) {\n this._defineField(name);\n }\n }",
"async validateAttributes () {\n\t\tfor (let i = 0, length = Object.keys(this.attributes).length; i < length; i++) {\n\t\t\tconst attribute = Object.keys(this.attributes)[i];\n\t\t... | [
"0.6513651",
"0.5966506",
"0.58370006",
"0.58198196",
"0.57951975",
"0.5648954",
"0.5627106",
"0.56093407",
"0.56001306",
"0.5508519",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607",
"0.5469607"... | 0.64057016 | 1 |
Function to create the menu to be displayed at Spreadsheet | function createSpreadsheetMenu() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Facebook')
.addItem('Business', 'Copy')
.addToUi();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onOpen() {\r\n var spreadsheet = SpreadsheetApp.getActive();\r\n var menuItems = [\r\n {name: 'Generar distribucion de notas por grado para todos las clases.', functionName: 'all_courses'},\r\n {name: 'Generar distribucion de notas por grado para MATE,INGL,CIEN,ESPA.', functionName: 'MICE_courses'... | [
"0.7972858",
"0.76966375",
"0.7599166",
"0.7589436",
"0.75218654",
"0.72625077",
"0.72451514",
"0.72349423",
"0.7226047",
"0.72068363",
"0.71825475",
"0.7179214",
"0.7168365",
"0.71323615",
"0.7129904",
"0.7120652",
"0.71174145",
"0.70951104",
"0.7016879",
"0.70070416",
"0.70... | 0.77655315 | 1 |
Initialization Function to copy from one spreadsheet to another using parameter data as sheet ID | function Copy() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var parametersSheet = ss.getSheetByName(PARAMETERS_SHEET_NAME);
//Fetch the range of cells B2:B10
var parametersDataRange = parametersSheet.getRange(2, 1, 9, 2);
//Fetch cell value for each row in the range
var parametersData = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function copySheetToSpreadsheet () {\n var ssSource = \n SpreadsheetApp.getActiveSpreadsheet(),\n ssTarget = \n SpreadsheetApp.create(\n 'CopySheetTest'),\n sourceSpreadsheetName =\n ssSource.getName(),\n targetSpreadsheetName = \n ssTarget.getName();\n Logger.log(\n ... | [
"0.6207831",
"0.5962786",
"0.5957139",
"0.57730937",
"0.5599964",
"0.55912566",
"0.554961",
"0.5536596",
"0.5533954",
"0.544299",
"0.54358274",
"0.53871197",
"0.5373462",
"0.53529304",
"0.53380775",
"0.5326604",
"0.53016865",
"0.52865154",
"0.52712375",
"0.52710944",
"0.52670... | 0.7070373 | 0 |
cancel the previous number | function cancelPrev(){
if ($total.text() === '0') return;
$list.children('li:last').remove();
ary.pop();
console.log('after cancel: ' + ary);
$total.text(ary.length - doneNum);
$waiting.text(++waiting);
if ($total.text() === '0'){
$cancel.addClass('na'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cancel() {\n if (!elation.utils.isNull(this.lastvalue) && this.lastvalue != this.value) {\n this.value = this.lastvalue;\n this.dispatchEvent({type: 'cancel', data: this.value});\n }\n this.blur();\n }",
"async _cancelClick() {\n\t\tthis.value = this.previousValue;\n\t\tthis.close... | [
"0.6907393",
"0.6819418",
"0.6545202",
"0.64844537",
"0.64602864",
"0.6456276",
"0.6446589",
"0.64289427",
"0.64289427",
"0.64187294",
"0.6405331",
"0.6404294",
"0.6377915",
"0.6354747",
"0.63257706",
"0.6277816",
"0.6253616",
"0.6242738",
"0.62213725",
"0.62123",
"0.6209679"... | 0.7857845 | 0 |
RElayout all the annotations | function relayout() {
// Reset display
generateAnnotationPanels(null);
// Then re-fill with model
generateAnnotationPanels(dataModel);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetAnnotations() {\n anno.removeAll();\n for(var i = 0; i < annotations.length; i++) {\n anno.addAnnotation(annotations[i]);\n }\n}",
"function removeAnnotations(){\n for (i=annotations.length-1;i>=0;i--) {\n mapView.removeAnnotation(annotations[i]);\n }\n annotations =... | [
"0.7121546",
"0.64091104",
"0.63363534",
"0.61835974",
"0.61187524",
"0.6091392",
"0.6080041",
"0.60499173",
"0.6042515",
"0.60039914",
"0.58685005",
"0.5831466",
"0.5817835",
"0.5775883",
"0.57410026",
"0.5735137",
"0.5702974",
"0.56480837",
"0.56050694",
"0.5574595",
"0.557... | 0.80633086 | 0 |
Layout of the entire graph entire element representing the entire graph (svg element) data element representing the data of the graph (group element) margin margins that define the data area dataWidth how wide is the data area | function GraphLayout(entire, data, margin, dataWidth) {
this.entire = entire;
this.data = data;
this.margin = margin;
this.dataWidth = dataWidth;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mainLayout(chart){\n var e = FloriaDOM.getElement(chart.id);\n chart.margin = {top: 25, right: 20, bottom: (50+(chart.maxXLayout+20)), left: (50+chart.maxYLayout+25), front: 0, back: 0};\n chart.width = e.offsetWidth - chart.margin.left - chart.margin.right - 7; \n chart.height = e.off... | [
"0.6749204",
"0.64623606",
"0.6423795",
"0.6320901",
"0.6246206",
"0.6166132",
"0.61399806",
"0.61258125",
"0.6079012",
"0.6079012",
"0.60134757",
"0.60061866",
"0.60008216",
"0.59423643",
"0.5939557",
"0.5932425",
"0.5883326",
"0.5850925",
"0.5847212",
"0.580856",
"0.5785209... | 0.69441015 | 0 |
Represents a layout of a single "lane" y where does the lane start (top edge) height how high the lane is (when hidden, the height is truncated) hidden if true, the lane is collapsed | function LaneLayout(y, height, hidden) {
this.y = y;
this.requestedHeight = height;
this.height = hidden ? 10 : height;
this.hidden = hidden;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getLayoutType() {\n const that = this,\n orientation = that.orientation,\n inverted = that.inverted;\n\n that._normalLayout = orientation === 'horizontal' && !inverted || orientation === 'vertical' && inverted;\n }",
"function mxLeanFifoLane(bounds, fill, stroke, strokewid... | [
"0.55986667",
"0.54333174",
"0.5378313",
"0.531218",
"0.51506734",
"0.5139857",
"0.50587285",
"0.5043332",
"0.50323385",
"0.5002898",
"0.5002898",
"0.499724",
"0.49476686",
"0.49185604",
"0.49107853",
"0.48869702",
"0.4874413",
"0.4859076",
"0.48515332",
"0.48485026",
"0.4848... | 0.73528904 | 0 |
write an array of bytes to a string | function writeString(array){
try { return char.apply(null, array) } catch (e) {}
var string = '',
cycles = array.length % 8,
index = 0;
while (cycles--) {
string += indices[array[index++]];
}
cycles = array.length >> 3;
while (cycles--) {
stri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function str( arr, enc ) {\n return Buffer.from( arr ).toString( enc );\n}",
"function bytesToString(bytes) {\n var s = '';\n for (var i = 0; i < bytes.length; i += 1) {\n s += String.fromCharCode(bytes[i]);\n }\n \n retur... | [
"0.70248204",
"0.6906413",
"0.6873111",
"0.6780067",
"0.6703887",
"0.6600345",
"0.6561135",
"0.6529066",
"0.6414441",
"0.6393864",
"0.63869035",
"0.63099885",
"0.6286422",
"0.6232113",
"0.61575645",
"0.61082965",
"0.610649",
"0.6105273",
"0.6096625",
"0.60483056",
"0.60483056... | 0.69180983 | 1 |
create a new array of given size where each element is 0 | function zerodArray(size){
var data = new Array(size);
for (var i=0; i < size; i++) {
data[i] = 0;
}
return data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zero_fill_array(n) {\n var o = new Array(n);\n\n for (var i = 0; i < n; ++i) {\n o[i] = 0;\n }\n\n return o;\n }",
"function ZeroArray(Length){\n var ReturnArray=[];\n\tfor (var i=0; i<Length; i++){\n\t\tReturnArray[i]=0;\n\t}\n return ReturnArray;\n}",
"function ze... | [
"0.7636802",
"0.75859004",
"0.7528159",
"0.7528159",
"0.7528159",
"0.7528159",
"0.7528159",
"0.7528159",
"0.7528159",
"0.7528159",
"0.7524198",
"0.74436444",
"0.7343447",
"0.73380184",
"0.7335041",
"0.72959346",
"0.7231153",
"0.7101861",
"0.6982526",
"0.6965263",
"0.69455755"... | 0.76208353 | 1 |
Decorator containing the methods to construct a neural netowrk using a build design pattern | build(...layerSizes) {
// Provides the main function and API to build new neural networks. This is the preferred
// method of creating and initializing the neural network object. Since there are no
// tools added here, it is recommended to use the generator
return this._buildLayers(...layerSizes)._build... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"build(graph) {\n }",
"build(){}",
"build(){}",
"buildCustomNeuralNetwork(xDataPoints, yDataPoints, outputS, dataSize, layersN, actFunc, lossFunc, neuronPerLayer) {\n //we store this info, to later save the network config\n this.dataSize = dataSize;\n this.layersN = layersN;\n t... | [
"0.6323113",
"0.62137455",
"0.62137455",
"0.6029116",
"0.5946906",
"0.5817657",
"0.5764956",
"0.57208145",
"0.56396693",
"0.56091523",
"0.54884857",
"0.54236007",
"0.54091954",
"0.5402383",
"0.53929484",
"0.5388817",
"0.5383223",
"0.5373063",
"0.5365293",
"0.5337029",
"0.5334... | 0.6882327 | 0 |
Return editor block tools | get blockTools() {
// eslint-disable-next-line no-unused-vars
const tools = Object.entries(this.available).filter( ([name, tool]) => {
if (tool[this.apiSettings.IS_INLINE]) {
return false;
}
return true;
});
/**
* collected block tools with key of tool name
*/
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render (blocks, cursor, activeBlocks, matches) {\n const selector = `${LOWERCASE_TAGS.div}#${CLASS_OR_ID['AG_EDITOR_ID']}`\n\n const renderBlock = block => {\n const type = block.type === 'hr' ? 'p' : block.type\n const isActive = activeBlocks.some(b => b.key === block.key) || block.key === cursor.... | [
"0.6363843",
"0.5911094",
"0.58464587",
"0.5840662",
"0.58201873",
"0.578773",
"0.5780649",
"0.5778827",
"0.5778608",
"0.57732564",
"0.5697359",
"0.56733406",
"0.5660173",
"0.5611484",
"0.5593033",
"0.5582074",
"0.5582053",
"0.54957676",
"0.54656935",
"0.5435903",
"0.5427317"... | 0.7186797 | 0 |
Extract links from selected text and bookmark them to the designated folder. | function bookmarkSelectedLinks() {
var links = extractLinksFromSelection();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extractLinksFromSelection() {\n var parser = Cc['@mozilla.org/xmlextras/domparser;1'].createInstance(Ci.nsIDOMParser);\n var selection = require('sdk/selection');\n var bookmarks = Cc[\"@mozilla.org/browser/nav-bookmarks-service;1\"].getService(Ci.nsINavBookmarksService);\n var history = Cc[\"@mozilla... | [
"0.647118",
"0.6192769",
"0.60688365",
"0.60267377",
"0.59689134",
"0.59295654",
"0.5845484",
"0.57254815",
"0.57056844",
"0.5702622",
"0.5597472",
"0.55872196",
"0.5560499",
"0.5560038",
"0.552819",
"0.5435972",
"0.53567684",
"0.5343917",
"0.5296792",
"0.52503103",
"0.524340... | 0.7511144 | 0 |
Open links from selected text in new tabs. | function openSelectedLinks() {
var links = extractLinksFromSelection();
for (var [uri, link] of links) {
//console.log('Opening ' + link.text + ' [' + uri + ']');
tabs.open(uri);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClickHandler(info, tab) {\n var sText = info.selectionText;\n sText = sText.replace(/\\./g,\"\"); // Jisho.org doesn't handle periods (.); 404 Page\n var url = \"http://jisho.org/search/\" + encodeURIComponent(sText); \n window.open(url, '_blank');\n}",
"function openLinksNewTab() {\n const ... | [
"0.65320545",
"0.65156806",
"0.64487034",
"0.63800323",
"0.6282149",
"0.62572825",
"0.6186465",
"0.6167183",
"0.61603165",
"0.615093",
"0.611641",
"0.6098878",
"0.6051256",
"0.6028957",
"0.5982931",
"0.5978669",
"0.5969968",
"0.5967833",
"0.59432286",
"0.5926393",
"0.5923199"... | 0.81764853 | 0 |
Callback to extract links from selected text. | function extractLinksFromSelection() {
var parser = Cc['@mozilla.org/xmlextras/domparser;1'].createInstance(Ci.nsIDOMParser);
var selection = require('sdk/selection');
var bookmarks = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
var history = Cc["@mozilla.org/browser... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bookmarkSelectedLinks() {\n var links = extractLinksFromSelection();\n}",
"function extractLinksFromText(text) {\n var regEx = /(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig;\n return text.match(regEx);\n}",
"function text2links(text)\r\n\t{\r\n\t\tvar exp = ... | [
"0.70206755",
"0.6642216",
"0.64868337",
"0.6440238",
"0.63087976",
"0.59402287",
"0.5905439",
"0.58551323",
"0.5831917",
"0.57736695",
"0.5683306",
"0.56677914",
"0.5663963",
"0.5617974",
"0.5597384",
"0.5572316",
"0.55661637",
"0.5496691",
"0.5495802",
"0.5488131",
"0.54833... | 0.66509444 | 1 |
Function: _updateUIandDBWithDiagnoseAndClassificationData Role: Inserts all Diagnose Item Details and Categories Details in DB This is called from Diagnose Tab | function _updateUIandDBWithDiagnoseAndClassificationData(clientId, diagnoseId, diagnoseName,
_newDiagnose, SelectedControls)
{
var diagnoseItemDetailsArray = [];
$.each(SelectedControls, function (key, selectedControlDetails) {
// console.log(selectedControlDetails);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveDeviceCategory() {\n console.log($scope.addCategoryFormData);\n devicesService.saveDeviceCategory($scope.addCategoryFormData)\n .then(function (data) {\n if (data == 201) {\n $scope.closeModal(true);\n ... | [
"0.54616827",
"0.5380932",
"0.5369999",
"0.52079976",
"0.5149879",
"0.5065896",
"0.5048768",
"0.5047173",
"0.5044852",
"0.50429195",
"0.5017901",
"0.5009897",
"0.50096303",
"0.5009021",
"0.50025994",
"0.4941845",
"0.4927085",
"0.48711303",
"0.48435524",
"0.48167315",
"0.48149... | 0.78978354 | 0 |
Updates the theme to the passed theme name | setTheme(state,themeName){
state.currentTheme = themeName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeTheme(name) {\n\n}",
"function setTheme(themeName) {\n switch (themeName) {\n case 'light':\n theme = 'light';\n break;\n case 'dark':\n theme = 'dark';\n break;\n }\n}",
"function setTheme(themeName) {\n standaloneServices_Stati... | [
"0.83413154",
"0.78366137",
"0.77639407",
"0.77288353",
"0.7617631",
"0.7598537",
"0.7475169",
"0.73989177",
"0.73971397",
"0.73971397",
"0.7290078",
"0.7249277",
"0.72131515",
"0.7078431",
"0.7027068",
"0.70219296",
"0.6987033",
"0.69844806",
"0.69844806",
"0.6904619",
"0.68... | 0.7909584 | 1 |
Get Client Id Of The Asp Control | function getclientId(controlid) {
return $('[id$=' + controlid + ']').attr('id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetRootId(ControlID)\n{\n var id = ControlID.split('_');\n var idlen = id.length - 1;\n var target = \"\";\n for (var i = 0; i < idlen; i++) {\n target = target + id[i] + \"_\";\n }\n return target;\n}",
"function getClientID() {\n if (typeof (Storage) !== \"undefined\") ... | [
"0.6237082",
"0.59744",
"0.5933531",
"0.59147435",
"0.5822296",
"0.580247",
"0.5794007",
"0.55588377",
"0.5548914",
"0.5483217",
"0.54668784",
"0.54530156",
"0.538773",
"0.5382572",
"0.53720284",
"0.53113824",
"0.52963126",
"0.52845913",
"0.5273193",
"0.52568734",
"0.5230299"... | 0.75674504 | 0 |
Used To Get The Saved Filed Name From IFrame | function getSavedFileName(i) {
var childiFrame = document.getElementById("frame" + i);
var innerDoc = childiFrame.contentDocument
|| childiFrame.contentWindow.document;
var yourChildiFrameControl = innerDoc.getElementById("txtSavePath");
return yourChildiFrameControl.value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCurrentContentName () {\n return window.iframeWindow.getFileName(window.iframeWindow.PDFView.url)\n }",
"function getFilename() {\n let namePtr = cpu.memory.readWord(FLOPPY_NAME_PTR);\n let filename = '';\n do {\n const tt = cpu.memory.read(namePtr);\n if (tt === 0) {\n bre... | [
"0.6995346",
"0.6204857",
"0.59981793",
"0.5930034",
"0.58830017",
"0.5842814",
"0.5838145",
"0.57927215",
"0.57851565",
"0.57793546",
"0.56352854",
"0.5634529",
"0.56276566",
"0.5626327",
"0.5579946",
"0.55517256",
"0.55294156",
"0.55104697",
"0.54817927",
"0.54641837",
"0.5... | 0.70615447 | 0 |
Navigation links click scroll page | function navigationScroll() {
$navLinks = $("#navigation-nav > li > a");
$navLinks.each(function() {
$(this).on("click", function (e) {
$linkName = $(this).attr('id').split('-')[1];
$pageSection = $("#page-" + $linkName).attr('id');
$pageSectionPosition = $("#" + $pag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleLinkClicked(e){\n if(toggleNav && toggleNav.classList.contains('active')){\n toggleNav.click()\n }\n // subTitles.forEach(title => {\n // if(e.target.dataset.to === \"home\"){\n // $([document.documentElement, document.body]).animate({\n // scrollTop: 0\n // }, 1000);... | [
"0.7218745",
"0.7186765",
"0.7122554",
"0.70706546",
"0.70304227",
"0.70207405",
"0.69920635",
"0.69832826",
"0.69136226",
"0.6893437",
"0.6863965",
"0.6856119",
"0.6849884",
"0.68391395",
"0.6834095",
"0.6826174",
"0.68167436",
"0.6792532",
"0.67756253",
"0.676624",
"0.67526... | 0.7358649 | 0 |
A method used to get provider core. | providerCore() {
return new Promise((resolve, reject) => {
if (!this.initialized) {
reject(NgxLineLiffService.ERR_NOT_INITIALIZED);
}
else if (!this._user) {
reject(NgxLineLiffService.ERR_NOT_LOGGED_IN);
}
else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchCore() {\n\treturn core;\n}",
"function get_provider() {\n return web3.currentProvider\n}",
"get provider() {\n\t\treturn this.__provider;\n\t}",
"get provider () {\n\t\treturn this._provider;\n\t}",
"providerCore() {\n return new Promise((resolve, reject) => {\n try {\n ... | [
"0.6968439",
"0.6682161",
"0.65088457",
"0.6359612",
"0.6232071",
"0.61454755",
"0.6029416",
"0.59690344",
"0.5860275",
"0.58537793",
"0.5800395",
"0.5800395",
"0.5787825",
"0.5787825",
"0.5787825",
"0.5787825",
"0.5755538",
"0.5738692",
"0.57191914",
"0.5651605",
"0.5645154"... | 0.75676924 | 0 |
Running in LIFF browser only. | providerCore() {
return new Promise((resolve, reject) => {
try {
if (liff.isInClient()) {
resolve(liff);
}
else {
reject('Running in LIFF browser only.');
}
}
catch (error)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFF() {\r\n var userAgent = navigator.userAgent;\r\n var appName = navigator.appName;\r\n return appName == 'Netscape';\r\n}",
"function sendAlertIfNotInClient() {\r\n alert('This button is unavailable as LIFF is currently being opened in an external browser.');\r\n}",
"function Browser()... | [
"0.59940857",
"0.5703191",
"0.5675953",
"0.5675953",
"0.56346774",
"0.5631843",
"0.5575192",
"0.55653733",
"0.55653733",
"0.55646896",
"0.55097497",
"0.54879093",
"0.54681206",
"0.54517865",
"0.5430408",
"0.54082495",
"0.5375157",
"0.53743744",
"0.53617054",
"0.5360892",
"0.5... | 0.57071775 | 1 |
Dynamic's special and normal process | wrapperProcess() {
this.processDynamic();
this.process();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"process() {}",
"process() {}",
"getProcess(proc){\n\n return proc[this.random(1,config.workers)];\n\n }",
"process() {\n this.notifySystems();\n this.processSystems();\n }",
"process () {\n }",
"process() {\n return (\n processCategories(this) ||\n processActions(this) ||\n... | [
"0.65107363",
"0.65107363",
"0.6050138",
"0.5952324",
"0.59140223",
"0.55039674",
"0.54129577",
"0.5411657",
"0.5407903",
"0.5407903",
"0.53764987",
"0.53414136",
"0.5332166",
"0.52931124",
"0.5277061",
"0.52522796",
"0.52310354",
"0.5229958",
"0.5229958",
"0.5229958",
"0.517... | 0.670054 | 0 |
it is just a custom method for fixing its visual to real position | posfix() {
this.vis.style.left = this.pos.x + "px";
this.vis.style.top = this.pos.y + "px";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateRealPosition() {\n this.bounds.x = this.positionX * 50;\n this.bounds.y = this.positionY * 50;\n }",
"fixPosition() {\n const scale = this.defaultWidth ?\n Math.min(1, this.app.renderer.width / this.defaultWidth,\n this.app.renderer.height / this.defaultHeight)\n : 1;\n\n ... | [
"0.6841446",
"0.6835724",
"0.6827145",
"0.6773989",
"0.6749928",
"0.6666097",
"0.6666097",
"0.65923274",
"0.6587346",
"0.6581452",
"0.6539118",
"0.64261365",
"0.6418376",
"0.6410457",
"0.6406271",
"0.63831395",
"0.6356475",
"0.6352484",
"0.6302013",
"0.6301995",
"0.6289792",
... | 0.7560008 | 0 |
do whatever you want here without calling super.process() | process() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"process(node, result) {\n return super.process(node, result)\n }",
"process(node, result) {\n return super.process(node, result)\n }",
"wrapperProcess() {\n this.processDynamic();\n this.process();\n }",
"process() {\n return false;\n }",
"process () {\n }",
"process() {\n ... | [
"0.68695563",
"0.68695563",
"0.6694899",
"0.65700394",
"0.63819516",
"0.6380701",
"0.6211948",
"0.58693063",
"0.5864815",
"0.5666353",
"0.56484276",
"0.56392586",
"0.56392586",
"0.56392586",
"0.563608",
"0.5619435",
"0.56080586",
"0.5606636",
"0.56036806",
"0.5592863",
"0.556... | 0.6957051 | 1 |
Create a function called `numberGuess` that takes in an integer as an argument. If the number is 42, console.log(true). If it isn't 42, console.log(false) | function numberGuess(int) {
// --------- code starts --------------
if (int === 42) {
console.log(true);
} else {
console.log(false);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkGuess(guess){\n if ((guess < 1) || (guess > 10)){\n console.log(\"Your guess must be between 1 and 10. Try again.\".red)\n return false;\n }else {\n return true;\n }\n}",
"function checkGuess(){\r\n // add code here\r\n if (winningNumber == playersGuess) {\r\n return true;\... | [
"0.718571",
"0.7134113",
"0.7045289",
"0.6978765",
"0.6951431",
"0.6913464",
"0.6806196",
"0.67911726",
"0.6781911",
"0.66647905",
"0.6651891",
"0.6571629",
"0.65567183",
"0.6546759",
"0.6502456",
"0.64957327",
"0.6416506",
"0.6347672",
"0.6324369",
"0.6298253",
"0.6283468",
... | 0.8193598 | 0 |
Write a function that takes in three arguments: a high value, a low value and an array of numbers. The function should console.log a new array of numbers where none of the elements are less than the low value and none of the elements are greater than the high value | function filterArray(high, low, arr){
// --------- code starts --------------
let hold = []
for (let i=0; i<arr.length; i++) {
if (arr[i] <= high && arr[i] >= low) {
hold.push(arr[i])
}
}
console.log(hold)
// --------- code ends --------------
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pLowrHigh(arr){\n\n var low=arr[0];\n var high=arr[0];\n\n\n for (var i=1;i<arr.length;i++){\n if(arr[i]<low){\n low=arr[i];\n }\n else if(arr[i]>high){\n high=arr[i];\n }\n\n }\n\n console.log(low);\n return high;\n \n\n}",
"functio... | [
"0.72464436",
"0.7138391",
"0.70523846",
"0.7037157",
"0.70365864",
"0.698876",
"0.6911318",
"0.68955755",
"0.68795794",
"0.6800574",
"0.67888945",
"0.6768736",
"0.67420596",
"0.6727562",
"0.66615534",
"0.66279405",
"0.6613193",
"0.6597815",
"0.65844923",
"0.6551766",
"0.6531... | 0.76953894 | 0 |
Ajax request to search for users | function searchUsers(searchTerm){
$.get("/api/users" , {search: searchTerm} , results => {
outPutSelectableUsers(results , $(".resultsContainer"))
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchUsers(){\n $.get({url: \"https://api.github.com/search/users?q=\" + query + \"&page=\" + page + \"&per_page=\" + rows,\n type: \"GET\",\n headers: { \"Authorization\": \"token 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\" }})\n .done(processData)\n .fa... | [
"0.7597814",
"0.7345484",
"0.7131772",
"0.6961211",
"0.6866585",
"0.6866258",
"0.6839575",
"0.6823064",
"0.6796016",
"0.6782843",
"0.67802894",
"0.67663187",
"0.6739194",
"0.67339945",
"0.66361034",
"0.6634202",
"0.6626518",
"0.660968",
"0.6608368",
"0.6590612",
"0.6590261",
... | 0.78160566 | 0 |
selected the searched user and put it in the selectedUsers array | function userSelected(user){
selectedUsers.push(user)
updateSelectedUsersHtml()
$("#userSearchTextBox").val("").focus()
$(".resultsContainer").html("");
$("#createChatButton").prop("disabled" , false)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userSelected(user) {\n selectedUsers.push(user);\n const userSearchTextbox = document.querySelector('#userSearchTextbox');\n const resultsContainer = document.querySelector('.resultsContainer');\n const createChatButton = document.querySelector('#createChatButton');\n updateSelectedUsersHtml();\n\n ... | [
"0.7615142",
"0.6762829",
"0.6564985",
"0.6556643",
"0.6522376",
"0.6470764",
"0.6435582",
"0.6418312",
"0.6417497",
"0.6415615",
"0.6395858",
"0.6360703",
"0.6321487",
"0.62910706",
"0.6233719",
"0.6160839",
"0.61308414",
"0.611635",
"0.6057005",
"0.60475546",
"0.60323185",
... | 0.7192316 | 1 |
prepend the seletdUsers array into the html | function updateSelectedUsersHtml(){
let elements = []
selectedUsers.forEach((user) => {
let name = user.firstName + " " + user.lastName
let userElment = $(`<span class='selectedUser'>${name}</span>`)
elements.push(userElment)
})
$(".selectedUser").remove()
$("#selectedUsers"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addusers(user) {\n userList.innerHTML = `${user.map(user => `<li>\n ${user.username}\n </li>`).join('')} `\n}",
"function existingUsers(users) {\n const active = Object.entries(users);\n active.forEach((user) => {\n if (user[0] != '_locals') {\n let name_tag =`... | [
"0.6804797",
"0.6799476",
"0.6737779",
"0.67088014",
"0.6705951",
"0.6674854",
"0.66413355",
"0.6638067",
"0.6625563",
"0.6624204",
"0.66121745",
"0.65979975",
"0.6595975",
"0.65799206",
"0.6576881",
"0.6557213",
"0.65510523",
"0.6548702",
"0.6539021",
"0.6522081",
"0.6514982... | 0.7293847 | 0 |
get the post Id from element There is two scenarios: 1 Is when the user clicked on the root element ie the post itself (.post) 2 Is when the user clicked the chlid element (heart , retweet ,button) | function getPostIdFromElement(element) {
//get the root element
const isRoot = element.hasClass("post");
// get the root element based on what the user clicked
//closest is a jquery function that goes throw the tree to find the parent element
const rootElement = isRoot ? element : element.close... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPostIDfromPostObject(postObj){\r\n\tvar comment=postObj.getElementsByClassName(\"commentable_item\"); //comment is used to find the post id\r\n\t\t \t\r\n\tvar post_id=\"\";\r\n\tif(comment.length>0){\r\n\t\tvar idStart = comment[0].className.indexOf(\"_\");\r\n\t\tvar idEnd = comment[0].className.i... | [
"0.73321146",
"0.66931623",
"0.65173185",
"0.63430613",
"0.62107396",
"0.62103",
"0.60411185",
"0.6023051",
"0.60147405",
"0.5981353",
"0.5923112",
"0.5894427",
"0.5855261",
"0.5783922",
"0.57736754",
"0.5741489",
"0.57413244",
"0.5735007",
"0.5731357",
"0.5703189",
"0.569183... | 0.8503924 | 0 |
outputtin post with replies | function outPutPostsWithReplies(results, container){
// we clear all the old content
container.html("");
// we load all the results.replyTo
if(results.replyTo !== undefined && results.replyTo._id !== undefined){
const html = createPostHtml(results.replyTo)
container.append(html)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeNewReply(userInput, newpost){\n\t\tnewpost.style.display = \"flex\";\n\t\tvar textNode = document.createTextNode(userInput);\n\t\tvar origin = document.getElementsByClassName(\"commentSkeleton\")[0].childNodes[3];\n\t\torigin.insertBefore(textNode, origin.childNodes[3]);\n\t\tdocument.getElementsByCl... | [
"0.64000404",
"0.6306587",
"0.6209482",
"0.6186882",
"0.61658317",
"0.6157262",
"0.6073348",
"0.6008565",
"0.59661996",
"0.59474635",
"0.590455",
"0.58829236",
"0.5831598",
"0.5763795",
"0.56941247",
"0.5686101",
"0.5665891",
"0.56420267",
"0.56352943",
"0.5634807",
"0.559290... | 0.66246164 | 0 |
get the chat Name | function getChatName(chatData){
let chatName = chatData.chatName ;
if(!chatName){
let otherChatUsers = getOtherChatUsers(chatData.users)
let namesArray = otherChatUsers.map(user => user.firstName + " " + user.lastName )
chatName = namesArray.join(", ")
}
return chatName
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chatName() {\n return function (chat) {\n if (!chat) return;\n let otherId = _.without(chat.userIds, Meteor.userId())[0];\n let otherUser = Meteor.users.findOne(otherId);\n // console.log(otherUser, otherUser.profile, otherUser.profile.name)\n let hasName = otherUser && otherUser.profile &... | [
"0.7816306",
"0.6659978",
"0.66551584",
"0.6651453",
"0.6601415",
"0.657847",
"0.65647066",
"0.64951414",
"0.6471745",
"0.6376393",
"0.63083315",
"0.6303117",
"0.62790036",
"0.62703794",
"0.6260624",
"0.62533784",
"0.62533677",
"0.62282616",
"0.62091905",
"0.619472",
"0.61864... | 0.76287323 | 1 |
Compilation form is filled with random value, except date fields. | function fillForm() {
try {
var form = $(".panel-body form");
// Random compilation of select boxes.
form.find("select").each(function () {
var options = $(this).find("option");
var selectValue = "";
while (typeof selectValue === "undefined" || selectVa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setNewValues () {\n planCreatedAt.val(moment().format(\"MM/DD/YYYY\")).css('background', 'ghostwhite').attr('readonly', true);\n }",
"setInitFormValues() {\n const { name, description, importance, progress, dueDate } = this.props;\n const { formValues } = this.state;\n formValues.name = nam... | [
"0.65690225",
"0.6307589",
"0.62696904",
"0.6252138",
"0.60204434",
"0.5988633",
"0.5924444",
"0.59128803",
"0.5878331",
"0.579143",
"0.578327",
"0.5684064",
"0.56767946",
"0.5667392",
"0.5658669",
"0.56579745",
"0.5642125",
"0.5641083",
"0.5606553",
"0.559599",
"0.55921185",... | 0.6682272 | 0 |
Issue the XMLHttpRequest object to call webserver and retrieve ThegooniesList.html JSON file | function getJSONFile() {
var xhttp = createAJAXObj();
xhttp.open("GET", "/JSON/ThegooniesList.html", true);
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//Convert the JSON text back to an object
goonies = JSON.parse(this.responseTe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ajaxGetJSON () {\n\n\n\n var hr = new XMLHttpRequest();\n\n hr.open(\"GET\", \"mylist.json\", true);\n hr.setRequestHeader(\"Content-type\", \"application/json\", true);\n hr.onreadystatechange = function() {\n if(hr.readyState == 4 && hr.status == 200) {\n \t\t var data = JSON.parse(hr.responseTe... | [
"0.7153772",
"0.69418025",
"0.6939151",
"0.6889359",
"0.68788654",
"0.67778397",
"0.6756849",
"0.67490745",
"0.67467713",
"0.6734098",
"0.6711562",
"0.6678889",
"0.6663986",
"0.6652403",
"0.6639529",
"0.66226405",
"0.65909934",
"0.6585041",
"0.65759736",
"0.65322423",
"0.6530... | 0.8049976 | 0 |
Generate the select goonies drop down element with all the data from the goonies object | function buildGoonies(){
var result = "<br><select id=\"select_goonie\" onchange=\"showGoonie(this.selectedIndex)\"><option value=\"-1\">Please Select a Goonie Name...</option>";
for(var i = 0; i < goonies.records.length; i++){
result += "<option value=\"0\">" + goonies.records[i].firstName + " " + goo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateOptions(data) {\n // Use map to iterate over array and return an option element from each item in the array, stored in the options variable\n // Use interpolation to insert each returned breed as the option and as text\n const options = data.map(item => `\n <option value='${item}'>... | [
"0.7162734",
"0.7122463",
"0.71158236",
"0.7021314",
"0.70114714",
"0.69263756",
"0.6872423",
"0.6837391",
"0.68001133",
"0.67828786",
"0.6775925",
"0.67498136",
"0.6737151",
"0.6687236",
"0.6668143",
"0.66617167",
"0.6637786",
"0.66299224",
"0.6605959",
"0.65934867",
"0.6584... | 0.7608418 | 0 |
If need you can declare private method | _privateMethod() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function private_function()\n\t {\n\n\t }",
"function private() {\n // do something internal\n }",
"function private_function()\n {\n\n }",
"function _privateFunction(param1, param2) {}",
"function privateMethod(){\n console.log( \"I am private\" );\n }",
"function _privateMethod(... | [
"0.79441094",
"0.76895356",
"0.76253384",
"0.7186731",
"0.7160571",
"0.71505857",
"0.7052859",
"0.70416033",
"0.70207584",
"0.6876355",
"0.66275096",
"0.6563252",
"0.65447503",
"0.65074396",
"0.6441427",
"0.64333856",
"0.6369776",
"0.63537496",
"0.62894493",
"0.62894493",
"0.... | 0.7916384 | 1 |
GET adverts from the DB | async function getAdverts (req, next) {
try {
validationResult(req).throw();
// Filters by
const name = req.query.name;
const forSale = req.query.for_sale;
const tag = req.query.tag;
const price = req.query.price;
// Other filters
const page ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetAllAdverts() {\n debugger;\n var getAdvertData = crudAJService.getAdverts();\n getAdvertData.then(function (book) {\n $scope.books = book.data;\n }, function () {\n alert('Error in getting book records');\n });\n }",
"function get_all_ads() ... | [
"0.6537504",
"0.6105237",
"0.5916662",
"0.5897025",
"0.5763556",
"0.573566",
"0.5685642",
"0.55946887",
"0.5565224",
"0.5561666",
"0.55436635",
"0.55051655",
"0.5470285",
"0.5415544",
"0.5399025",
"0.5397386",
"0.5367518",
"0.5327104",
"0.53170145",
"0.5292969",
"0.52654374",... | 0.65657246 | 0 |
Aux methods Get the filename of the advert photo | function getPhotoFileName(file) {
const filePath = file.photo.path;
const fileName = filePath.split('/')[3];
return fileName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static imageFileNameOfRestaurant(restaurant) {\r\n if (restaurant.photograph){\r\n return (restaurant.photograph); //removing the slice , at this does not have the extension return (restaurant.photograph.slice(0,-4))\r\n }\r\n return (restaurant.id);\r\n }",
"extractImageName() {\n if (this.sta... | [
"0.6902434",
"0.67811686",
"0.66924787",
"0.66924787",
"0.6569516",
"0.6509477",
"0.65061337",
"0.6403488",
"0.63996047",
"0.6383747",
"0.6190474",
"0.61014044",
"0.6051291",
"0.60093135",
"0.6007875",
"0.5996306",
"0.5955614",
"0.5865619",
"0.5864939",
"0.5810542",
"0.580055... | 0.6832612 | 1 |
String for displaying the traits | prettyTraits () {
const traits = this.traits();
return ``;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getDisplayString() {\n var outString = \"\";\n for (var i = 0; i < this.questions.length; i++) {\n outString += `<p>` + this.questions[i].question + `</p>`\n\n if (this.questions[i].type === \"multichoice\") {\n for (var j = 0; j < this.questions[i].choice_list.le... | [
"0.64769226",
"0.58153087",
"0.5803379",
"0.5784887",
"0.57687455",
"0.5743271",
"0.5673565",
"0.5663164",
"0.5643431",
"0.5639784",
"0.5638296",
"0.563783",
"0.56191266",
"0.55527866",
"0.55350775",
"0.5504636",
"0.54821783",
"0.5479446",
"0.54498005",
"0.54421806",
"0.54125... | 0.8022753 | 0 |
Helper function that makes translucent rectangles. | function makeTranslucentRectangle(/*Node*/ parent, /*int*/ left, top, width, height, /*String*/ color, /*float*/ opacity) {
var doc = parent.ownerDocument
var div = doc.createElement("div");
div.setAttribute("style",
"position: absolute; "
+"width: " + width + "px; "
+"height: " + heigh... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeTranslucentRectangle(/*Node*/ parent, /*int*/ left, top, width, height, /*String*/ color, /*float*/ opacity) {\r\n var doc = parent.ownerDocument\r\n var div = doc.createElement(\"div\");\r\n div.setAttribute(\"style\",\r\n \"position: absolute; \"\r\n +\"width: \" + width + \"px; \"... | [
"0.70515865",
"0.65060437",
"0.61279863",
"0.6014557",
"0.5923928",
"0.58739316",
"0.5800042",
"0.57894415",
"0.5775707",
"0.56936723",
"0.56396794",
"0.55922294",
"0.5556598",
"0.5540343",
"0.55125874",
"0.55094916",
"0.54845864",
"0.54551977",
"0.5419021",
"0.54154813",
"0.... | 0.70835847 | 0 |
getCurrentObj() getter of our model | getCurrentObj() {
return this.model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCurrentUserObj() {\n return this.model;\n }",
"getCurrent() {\n return this.current;\n }",
"getCurrentCubObj() {\n return model.cubToDisplay;\n }",
"getCurrent() {\n return this.current;\n }",
"getCurrentEntity () {\n return this.currentEntity\n }",
"get current() {\n\t\tr... | [
"0.76678425",
"0.7135353",
"0.7061704",
"0.7047974",
"0.68674845",
"0.6835186",
"0.66064864",
"0.66064864",
"0.6540514",
"0.6455888",
"0.6420257",
"0.6420257",
"0.6411868",
"0.6398005",
"0.6325164",
"0.6257195",
"0.624917",
"0.6236569",
"0.6184078",
"0.6181381",
"0.61747295",... | 0.89058703 | 1 |
I set the selected editor mode, removing or adding corresponding toolbard elements, as well as adding editor helpers/utilities. | setEditorMode(mode){
let toolbarElementNames = ["insertorderedlist", "insertunorderedlist", "justifyleft", "justifycenter", "justifyright"];
let display = "inherit";
this.editorCompleter = undefined;
// spellcheck
this.textarea.setAttribute("spellcheck", "true");
if(mode ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupEditor() {\r\n switch ($.editor.control) {\r\n case 'light':\r\n this.setupEditorLight();\r\n break;\r\n case 'light-editor':\r\n this.lightEditor();\r\n break;\r\n case 'collisi... | [
"0.736662",
"0.70491993",
"0.65743226",
"0.6557347",
"0.64157337",
"0.64147085",
"0.6368627",
"0.6364972",
"0.63074756",
"0.62970746",
"0.6287217",
"0.6247336",
"0.624458",
"0.6237956",
"0.6233607",
"0.6193624",
"0.61864716",
"0.6165956",
"0.6165956",
"0.61525106",
"0.6149263... | 0.75159526 | 0 |
I convert raw text to html respecting the Firefox contenteditable attribute guidelnes. This means that single lins of text are left as is; multiline text, i.e. text which includes "\n", is wrapped in for every line; and the last line gets a tag inserted before the to reflect the "onenterkey" behavior. | textToHtml(text){
if(text){
if(text.includes("\n")){
text = "<div>" + text + "<br></div>";
return text.replace(/\n/g, "</div><div>");
} else {
return text;
}
} else {
return "";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function plainTextToHtml(html) {\n html = html.replace(/\\s+/g, ' ')\n .replace(/> +</g, '><')\n .replace(/<br ?\\/>/gi, '<br>');\n\n // no tags\n if (html.match(/^[^<]$/)) {\n return html;\n }\n\n // Webkit.\n if (UA.webkit && html.indexOf... | [
"0.7028148",
"0.63271517",
"0.63201636",
"0.62473625",
"0.60773474",
"0.6050183",
"0.5987689",
"0.5960471",
"0.58927083",
"0.5877119",
"0.58684254",
"0.5864758",
"0.57387066",
"0.5736796",
"0.57250255",
"0.5717618",
"0.5706679",
"0.5641327",
"0.5638491",
"0.5630489",
"0.56286... | 0.6886042 | 1 |
I toggle the editing mode of field, by setting the 'mode' partProperty to either "viewing" or "editing." | toggleModePartProperty(){
let currentMode = this.model.partProperties.getPropertyNamed(this.model, "mode");
let nextMode = 'editing'; // By default, set to editing
if(currentMode === 'editing'){
nextMode = 'viewing';
}
this.model.partProperties.setPropertyNamed(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleEditToggle() {\n this.editMode = !this.editMode;\n }",
"_enterEditMode() {\r\n this.saveDisabled = true;\r\n this.editMode = true;\r\n }",
"function toggleEdit(){\n vm.editEnabled = !vm.editEnabled;\n if(!vm.editEnabled){\n vm.edition = Object.assign({},vm.reservatio... | [
"0.75313324",
"0.74278337",
"0.74257225",
"0.742242",
"0.72061837",
"0.7093934",
"0.7001731",
"0.6952379",
"0.6905682",
"0.6863151",
"0.68118167",
"0.67763925",
"0.67763925",
"0.6753429",
"0.67520714",
"0.6751528",
"0.67063814",
"0.66911995",
"0.6689806",
"0.6613348",
"0.6560... | 0.8384696 | 0 |
I toggle the editing mode of field and toolbar, by setting the opacity of toolbar to 0 or 1 and conteneditable of textarea to false or true, respectively. | toggleMode(mode){
let toolbar = this._shadowRoot.querySelector('.field-toolbar');
if(mode === "viewing"){
toolbar.style.opacity = "0";
this.textarea.setAttribute("contenteditable", "false");
} else if(mode === "editing") {
toolbar.style.opacity = "1";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleEdit() {\n $('.edit-mode').toggleClass(\"invisible\");\n}",
"function editClicked() {\n toggleEditButton();\n toggleContentEditable();\n toggleBorder();\n}",
"handleEditToggle() {\n this.editMode = !this.editMode;\n }",
"_enterEditMode() {\r\n this.saveDisabled = true;\r\n... | [
"0.7095654",
"0.7045419",
"0.67930245",
"0.6744693",
"0.6651551",
"0.6546831",
"0.65427244",
"0.65017766",
"0.6460065",
"0.6430957",
"0.6426395",
"0.6403458",
"0.63682145",
"0.6339179",
"0.63314784",
"0.6331033",
"0.6299058",
"0.62705773",
"0.62693995",
"0.62636876",
"0.62508... | 0.7973561 | 0 |
Write row values (Leetcode Problem attributes) from received input (Problem number and name) | function receiveText(resultsArray){
var title = resultsArray[0].split(".");
var problem_number = parseInt(title[0]);
var problem_name = title[1].trim();
var problem_url = "https://leetcode.com/problems/" + problem_name.toLowerCase().replace(/\s+/g, '-');
console.log(problem_number);
console.log(probl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_row(problem_number, problem_name, problem_url){\r\n data_scheme[\"properties\"][\"#\"][\"number\"] = problem_number;\r\n data_scheme[\"properties\"][\"Name\"][\"title\"][0][\"text\"][\"content\"] = problem_name;\r\n data_scheme[\"properties\"][\"URL\"][\"url\"] = problem_url;\r\n fetch(api_url,... | [
"0.5716209",
"0.5245161",
"0.49037912",
"0.48204702",
"0.4820403",
"0.480479",
"0.48045573",
"0.476902",
"0.47661683",
"0.47206464",
"0.4681622",
"0.46513787",
"0.4646938",
"0.46357638",
"0.46229175",
"0.46065366",
"0.45949736",
"0.4592015",
"0.4588933",
"0.4587605",
"0.45798... | 0.5792602 | 0 |
When `child_process.spawn` isn't provided a full path to the command binary, it behaves differently on Windows than other platforms. For Windows, discover the full path to the binary, otherwise fallback to the command provided. | async resolveCommandPath(command, options) {
if (utils_terminal_1.TERMINAL_INFO.windows) {
try {
return await this.which(command, { PATH: options.env && options.env.PATH ? options.env.PATH : process.env.PATH });
}
catch (e) {
// ignore
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for... | [
"0.6121403",
"0.6111341",
"0.6023261",
"0.6021669",
"0.6007362",
"0.599361",
"0.595945",
"0.5927544",
"0.59044284",
"0.59019065",
"0.5881872",
"0.58268225",
"0.57755804",
"0.5770179",
"0.57067937",
"0.56604207",
"0.5622145",
"0.56129307",
"0.5563745",
"0.5563745",
"0.5563745"... | 0.61511296 | 0 |
Sets a class and removes it after [duration] ms. | function addClassFor(element, className, duration) {
if (duration > 0) {
addClass(element, className);
setTimeout(function() {
removeClass(element, className);
}, duration);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addClassFor ( element, className, duration ) {\n if (duration > 0) {\n addClass(element, className);\n setTimeout(function(){\n removeClass(element, className);\n }, duration);\n }\n }",
"function addClassFor(element, className, duration) {\n if (duration > 0) {\n ... | [
"0.68397576",
"0.6783086",
"0.6783086",
"0.6783086",
"0.6783086",
"0.6783086",
"0.6764092",
"0.6662944",
"0.6660423",
"0.6660423",
"0.6660423",
"0.6660423",
"0.6660423",
"0.6660423",
"0.6660423",
"0.6660423",
"0.6602864",
"0.65865135",
"0.6581034",
"0.6403242",
"0.6403242",
... | 0.679736 | 1 |
send an insult flyer | async function insultFlyer(recipient){
var email = {
to: recipient,
subject: "New Flyer ✔",
text: "",
html: ""
}
fetch("https://www.evilinsult.com/generate_insult.php?type=plain&lang=en&_=1616109722882")
.then(res => res.text())
.then(insultText => {
email.te... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendInsult(app) {\n\tapp.ports.sendInsult.subscribe(function(comm) {\n\t\tconsole.log('sending insult')\n\t\tconsole.log(comm)\n\t\tvar word = comm[0]\n\t\tvar progress = comm[1]\n\t\tsocket.emit(js_to_flask.SEND_INSULT, {\n\t\t\tword: word,\n\t\t\tprogress: progress\n\t\t})\n\t})\n\n}",
"function sendT... | [
"0.62775135",
"0.61097556",
"0.6058549",
"0.5916518",
"0.5887852",
"0.58738077",
"0.5830926",
"0.57994324",
"0.5788785",
"0.5756483",
"0.57256824",
"0.5724628",
"0.5670697",
"0.56677437",
"0.56530344",
"0.56129676",
"0.5611371",
"0.5599982",
"0.5596615",
"0.5581808",
"0.55589... | 0.61854845 | 1 |
Checking for matches Row of five | function checkRowForFive () {
let scored = false
for (let i = 0; i < 60; i++) {
const rowOfFive = [i, i + 1, i + 2, i + 3, i + 4]
const decideColor = squares[i].style.backgroundImage
const isBlank = squares[i].style.backgroundImage === ''
const notValid = [4, 5, 6, 7, 12, 13, 14, 15, 20,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnitTestFiveOrMoreInARow(){\n\tvar valid = false;\n\tfor(var i = 0; i < 9; i++) {\n\t\tboardStateArray[y] = [9];\n\t\tfor(var j = 0; j < 9; j++) {\n\t\t\tboardStateArray[y][x] = 0;\n\t\t}\n\t}\n\tboardStateArray[5][5] = 1;\n\tboardStateArray[5][4] = 1;\n\tboardStateArray[5][3] = 1;\n\tboardStateArray[5][2... | [
"0.6816471",
"0.6709158",
"0.67048955",
"0.66910064",
"0.6672063",
"0.6637463",
"0.6628344",
"0.6617438",
"0.6582667",
"0.65567446",
"0.653892",
"0.65227944",
"0.6486537",
"0.64742607",
"0.6473104",
"0.6470778",
"0.6435685",
"0.6434909",
"0.642322",
"0.6368921",
"0.635836",
... | 0.72414076 | 0 |
retrieve the list of license classes from the web service and populate the license class dropdown | function loadClasses() {
ajax = new sack(WS_ROOT_URL);
function updateUi() {
// get a handle to the <select> tag
var select = document.getElementById('licenseClass');
// create a parser and parse the result
xdoc = new DOMParser().parseFromString(ajax.response, 'text/xml');
xp_result = xdoc.evaluate('//l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLicences() {\n //these are the licenses provided from the spec that the user can select in a dropdown format\n const licenses = [\"None\", \"CC BY\", \"CC BY-NC\", \"CC BY-NC-ND\", \"CC BY-NC-SA\", \"CC BY-SA\", \"EMUCL\", \"GFDL\", \"GGPL\", \"OPL\", \"PD\"]\n const licenseList = document.getElemen... | [
"0.6428519",
"0.62415236",
"0.6112506",
"0.6080935",
"0.5845683",
"0.5797461",
"0.5782327",
"0.57280594",
"0.5709776",
"0.5709776",
"0.559528",
"0.558845",
"0.5559872",
"0.55556333",
"0.554723",
"0.5544534",
"0.5521615",
"0.55010486",
"0.5489074",
"0.5487631",
"0.5485219",
... | 0.7862256 | 0 |
Create standard test environment with (controllable) camera, light, and background. | function WTDriver.prototype.TestEnv()
{
var cam = new Camera();
cam.MoveTo(0,0,-300);
new SlewController(cam, "Camera");
this.SetBackColor([240, 230, 140]); // Khaki
var lgt = new Light;
lgt.SetColor([100,100,100]);
lgt = new Light(3);
lgt.Turn(-45);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createEnvironment(){\n col[0] = new THREE.Color(\"rgb(255, 0, 152)\");\n col[1] = new THREE.Color(\"rgb(152, 102, 255)\");\n col[2] = new THREE.Color(\"rgb(255, 204, 0)\");\n col[3] = new THREE.Color(\"rgb( 50, 50, 230)\");\n col[4] = new THREE.Color(\"rgb( 20, 255, 173)\");\n col[5] = new THRE... | [
"0.70080966",
"0.7007913",
"0.69200003",
"0.62787664",
"0.6274575",
"0.6217303",
"0.6055837",
"0.6033496",
"0.599993",
"0.59713614",
"0.5964075",
"0.5953668",
"0.59524626",
"0.5940965",
"0.5937951",
"0.59170187",
"0.5900354",
"0.58888245",
"0.5837229",
"0.583612",
"0.57999504... | 0.7200674 | 0 |
StOnce.St() will return contained string ONE TIME when called and empty string on all successive calls. | function StOnce(st)
{
this.st = st;
this.fOnce = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function one() { return s; return s; }",
"function immediateSuccessor(s) {\n // Return the input string, with an additional NUL byte appended.\n return s + '\\0';\n}",
"function immediateSuccessor(s) {\n // Return the input string, with an additional NUL byte appended.\n return s + '\\0';\n}",
"f... | [
"0.6714102",
"0.6057012",
"0.6057012",
"0.6052679",
"0.60382843",
"0.582333",
"0.5578127",
"0.55380803",
"0.5292674",
"0.52515316",
"0.52444774",
"0.5239648",
"0.5239566",
"0.52352834",
"0.5227797",
"0.52038467",
"0.52038467",
"0.52038467",
"0.52032024",
"0.518392",
"0.517788... | 0.65646553 | 1 |
The entire SVG world as a string. Returns a string containing the current SVG for the entire world. To be called by each client as they start the game. | function getCurrentSVGString()
{
svgString="";
svgString += "<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\"";
svgString += " xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\"";
svgString += " viewBox=\"0 0 750 480\"";
svgString += " id=\"svg-canvas\" width=\"750px\" height=\"480px\">";
svgStrin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toSVG(){\n return '';\n \n /* Note: Support for SVG is suspended \n * \n var canvas = getCanvas();\n //@see http://www.w3schools.com/svg/svg_example.asp\n var v2 = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n v2 += \"\\n\" + '<svg xmlns=\"http://www.w3.org/20... | [
"0.6541566",
"0.6483079",
"0.6466207",
"0.6351477",
"0.6343248",
"0.62929064",
"0.59065443",
"0.5770723",
"0.57318753",
"0.5634218",
"0.56117237",
"0.5573748",
"0.55384916",
"0.55302304",
"0.5484742",
"0.5479032",
"0.5473632",
"0.54719126",
"0.5462693",
"0.5446908",
"0.542103... | 0.74331385 | 0 |
setupGameArea() Sets up distinct area on canvas for active game play | function setupGameArea() {
// Set relative width and position of game field
gameWidth = width * 0.75;
gameHeight = height;
gameX = gameWidth/2;
gameY = gameHeight/2;
// Create game area as a new block object
gameArea = new Block(gameX,gameY,gameWidth,gameHeight,255,255,255,255);
// Create another block... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setup() {\n\n window.canvas = createCanvas(500, 500);\n\n // myGameArea.start();\n\n}",
"function gameSetup(){\n background(255);\n gamebackground();\n stroke(4, 40, 96)\n strokeWeight(4);\n fill(0);\n rect(0, height/2, width/3, height);\n rect(width, height/2, width/3, height);\n player();\n ... | [
"0.76160777",
"0.71774507",
"0.7142349",
"0.69510657",
"0.6949858",
"0.6765064",
"0.6719102",
"0.6719102",
"0.6710797",
"0.67005885",
"0.6697826",
"0.6684942",
"0.6652634",
"0.65955555",
"0.6566232",
"0.65605843",
"0.65462995",
"0.65443796",
"0.6483231",
"0.64788824",
"0.6471... | 0.77563536 | 0 |
setupInfoArea() Sets up distinct are on canvas to display descriptions, instructions and health meters | function setupInfoArea() {
// Set relative width and position of info area
infoWidth = width - gameWidth;
infoHeight = height;
infoX = infoWidth/2 + gameWidth;
infoY = infoHeight/2;
// Create info area as new block on right hand side of canvas
infoArea = new Block(infoX,infoY,infoWidth,infoHeight,255,255,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupInstructions() {\n // Create and style a div to contain instructions\n instructionsDiv = createDiv();\n instructionsDiv.id(\"infotext\");\n instructionsDiv.style(\"width\", infoArea.w * 0.75 + \"px\");\n instructionsDiv.style(\"padding\", 25 + \"px\");\n instructionsDiv.position(infoArea.left, ... | [
"0.65656006",
"0.630814",
"0.60606337",
"0.60201544",
"0.60068",
"0.5978834",
"0.5972608",
"0.5946274",
"0.59443223",
"0.5944196",
"0.5915119",
"0.58925945",
"0.5884761",
"0.58549005",
"0.5825679",
"0.5819001",
"0.5815155",
"0.57987636",
"0.57851547",
"0.5773816",
"0.5773501"... | 0.73311806 | 0 |
setupInstructions() Sets up text instructions / game descriptions within info area | function setupInstructions() {
// Create and style a div to contain instructions
instructionsDiv = createDiv();
instructionsDiv.id("infotext");
instructionsDiv.style("width", infoArea.w * 0.75 + "px");
instructionsDiv.style("padding", 25 + "px");
instructionsDiv.position(infoArea.left, 25);
// Create a sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showInstructions() {\n // Black rectangle for readibility\n fill(0);\n rect(0, 0, 500, 72);\n textFont(patrickHandFont);\n fill(\"#ffc240\");\n textSize(22);\n textAlign(CENTER);\n // Instructions text (top center)\n text(instructionsText, 250, 28);\n fill(255);\n // Warning text (top center)\n... | [
"0.681966",
"0.6473773",
"0.6416628",
"0.6324515",
"0.63166046",
"0.62940073",
"0.62427354",
"0.6212429",
"0.6081798",
"0.6026668",
"0.5994705",
"0.5935818",
"0.5933489",
"0.59240156",
"0.5906529",
"0.59015816",
"0.5897651",
"0.5857091",
"0.5846863",
"0.58401746",
"0.5831443"... | 0.81783575 | 0 |
ALARM LEVEL findAlarm() Handles alarm minigame | function findAlarm() {
if (playGame) {
// Map the volume of the alarm sound inverse to distance of alarm from player
alarm.updateSound(alarm.distanceFrom(player),alarm.minDistance,alarm.maxDistance);
alarm.update();
alarm.displace();
alarm.display();
if (playAlarm) {
alarm.sound.play();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAlarmFunc(currentAlarm)\r\n {\r\n let alarm = currentAlarm;\r\n //alarm.alarmActual24Hr = hr > 12 ? Number(alarm.hr) + 12 : (hr == 0 ? alarm.hr;\r\n if (alarm.am_pm == \"PM\")\r\n alarm.alarmActual24Hr = Number(alarm.hr) < 12 ? Number(alarm.hr) + 12 : Number(alarm.hr);\r\n else\r\n ... | [
"0.68325895",
"0.6641429",
"0.6568696",
"0.6431053",
"0.640636",
"0.63960075",
"0.6371001",
"0.6306165",
"0.6282858",
"0.62311304",
"0.61826473",
"0.61797404",
"0.6119976",
"0.60578215",
"0.5907043",
"0.5892804",
"0.58666223",
"0.58244765",
"0.5814586",
"0.5803818",
"0.577655... | 0.7920154 | 0 |
wakeUp() Turn off the alarm sound and play the sound of chirping birds | function wakeUp() {
instructionsText.html(wakeUpText);
playAlarm = false;
birdsSound.playMode("untilDone");
birdsSound.play();
playGame = false;
gameOver = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bubbleUp() {\n var bubbler = Scene.loadSound(\"jbROmHBPoaM5RYH0eNfIMOLyNXB7egazkUWiBiFWHld\");\n bubbler.play(false);\n Scene.schedule(bubbler.stop, 2);\n }",
"function beeper(){\n\t$.playSound('http://jinnanen.bcitwebdeveloper.ca/Game/media/beep.wav');\n}",
"function silentAla... | [
"0.7183116",
"0.7168039",
"0.69808173",
"0.68878776",
"0.6878191",
"0.6793007",
"0.6778207",
"0.6756043",
"0.67482674",
"0.6737268",
"0.673717",
"0.6736982",
"0.6683289",
"0.6679821",
"0.6675575",
"0.6667444",
"0.6664558",
"0.66314626",
"0.66297686",
"0.66157097",
"0.6605708"... | 0.80488706 | 0 |
SHOWER LEVEL takeShower() Handles shower minigame | function takeShower() {
if (playGame) {
// Turn shower on (play sound and display water animation)
showerOn();
}
// Release bubbles
releaseBubbles();
if (playGame) {
soap.handleCollision(player);
soap.handleCollision(playerLeftControl);
soap.checkIfDropped();
player.handleInput();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function C012_AfterClass_Pool_Shower() {\n\tCurrentTime = CurrentTime + 290000;\n\tCommon_PlayerPose = \"Showering\";\n}",
"processShoweringState(gym) {\n // TODO: If they are already in the machine showering, then skip this step.\n // Otherwise, the customers will go between multiple showers if mo... | [
"0.68249834",
"0.6750958",
"0.6662412",
"0.65932786",
"0.6362647",
"0.6242546",
"0.62281376",
"0.6084782",
"0.59529287",
"0.58968174",
"0.58241546",
"0.5819777",
"0.57937926",
"0.5792987",
"0.57926905",
"0.5787022",
"0.5766058",
"0.5759799",
"0.5717207",
"0.5702423",
"0.56952... | 0.76943177 | 0 |
releaseBubbles() Using an array, create and display multiple bubble objects floatin downt he canvas, including some that have ducks in them | function releaseBubbles() {
// If soap hasn't been dropped, slowly move bubbles down from top of screen
if (!soap.dropped) {
// Every interval add new bubble object to the array
if (frameCount % bubbleRate === 0) {
bubbles.push(new Bubble(random(0,gameWidth),-30,random(0,1000),random(0,1000),random(30,8... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeBubbles() {\n\tfor (var i = 0; i < num_of_bubbles; i ++) {\n\t\tvar name = band_names[i];\n\t\tbubbles[name] = addBubble(name, rand_x_in_cvs(), rand_y_in_cvs());\n\t\tconsole.log(bubbles[name].x, bubbles[name].y);\n\t\tbubbles[name].draw();\n\t}\n}",
"popBubleWithCandy(){\n for(let bb of bub... | [
"0.7001243",
"0.6989065",
"0.6939575",
"0.69043165",
"0.6861631",
"0.68426704",
"0.68269867",
"0.6700603",
"0.6367549",
"0.634128",
"0.63222325",
"0.6293135",
"0.624308",
"0.62317204",
"0.62295157",
"0.6228549",
"0.6228077",
"0.6011637",
"0.5981715",
"0.5953541",
"0.59522754"... | 0.83873874 | 0 |
showerOn() Simulates the water of a shower by creating multiple shower objects as individual shower streams in an array | function showerOn() {
// Continuously append new shower objects to the shower streams array
showerStreams.push(new Shower(random(0,gameWidth),0,random(1,2),50,103,241,255,random(25,60)));
// Cycle through the array to display and update all shower streams
for (var i = 0; i < showerStreams.length; i++) {
sho... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function takeShower() {\n if (playGame) {\n // Turn shower on (play sound and display water animation)\n showerOn();\n }\n\n // Release bubbles\n releaseBubbles();\n\n if (playGame) {\n soap.handleCollision(player);\n soap.handleCollision(playerLeftControl);\n soap.checkIfDropped();\n\n play... | [
"0.59073335",
"0.5510032",
"0.54575205",
"0.534862",
"0.53437227",
"0.53427076",
"0.5336273",
"0.53360593",
"0.53226024",
"0.52386576",
"0.5237957",
"0.52309316",
"0.5210034",
"0.5208594",
"0.520753",
"0.52066606",
"0.51953",
"0.517499",
"0.5168498",
"0.51600754",
"0.5157479"... | 0.7947358 | 0 |
Reorder SLQueue values to alternate first half values with second half values, in order. For example: (1,2,3,4,5) becomes (1,4,2,5,3). You may create one additional SLQueue, if needed. | function interleaveQueue(queue){
var midpt = Math.ceil(queue.size()/2);
var tempQueue = new SLQueue();
for (var i = 1; i <= midpt; i++){
tempQueue.enqueue(queue.dequeue());
}
// tempQueue.displayQueue();
// queue.displayQueue();
var length = tempQueue.size();
for (var i = 1; i <=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function swapFirstAndLast(){\r\n let temp = innerQue[1];\r\n let lastIndex = innerQue.length - 1\r\n innerQue[1] = innerQue[lastIndex];\r\n innerQue[lastIndex] = temp;\r\n \r\n }",
"swap() {\n const fistItem = this._items[this._top];\n const secondItem = this._items[this._top - 1];\n\n t... | [
"0.65037096",
"0.6347052",
"0.61794937",
"0.60962015",
"0.60153514",
"0.59717715",
"0.5959962",
"0.59349275",
"0.5854812",
"0.5838417",
"0.58253026",
"0.57717174",
"0.57692134",
"0.5765855",
"0.57405347",
"0.57386786",
"0.5733561",
"0.5733104",
"0.57163775",
"0.5715448",
"0.5... | 0.64961857 | 1 |
If bullet hits something or time runs out remove it from the array | updateBullets() {
for (let i = this.bullets.length - 1; i >= 0; i--) {
if (this.bullets[i].update() == false) {
this.bullets.splice(i, 1);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearBullets() {\n this.bullets = this.bullets.filter(function(obstacle) {\n return obstacle.y >= 0;\n });\n }",
"die() {\r\n\t\t\tplayer1.bullets.splice(player1.bullets.indexOf(this), 1);\r\n\t\t}",
"function playerHit(player, bullet) {\n if (player == \"player1\") {\n player1.re... | [
"0.7205323",
"0.68468034",
"0.6794603",
"0.6751992",
"0.6732966",
"0.6676331",
"0.66541547",
"0.6594507",
"0.6581428",
"0.65608805",
"0.65120643",
"0.6460799",
"0.6456463",
"0.6367825",
"0.6359439",
"0.6314272",
"0.6311519",
"0.63074076",
"0.63032997",
"0.6294184",
"0.6286073... | 0.7005257 | 1 |
Dispatch that we would like to render Loading when this component has mounted | componentDidMount() {
this.props.dispatch({type: "MANAGE_LIST_LOADING", data: true});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n const { isLoading, dispatch } = this.props;\n if (isLoading === true) {\n dispatch(loadingStop());\n }\n }",
"render() {\r\n const { isLoading } = this.state;\r\n if (isLoading)\r\n return (\r\n <View style={Styles.loader}>\r\n ... | [
"0.7527136",
"0.70844865",
"0.7051316",
"0.6989978",
"0.6985836",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
"0.69786114",
... | 0.71817607 | 1 |
Data type for deferred create action result | function DeferredCreateActionResultData(autogeneratedId, realId, data) {
this.autogeneratedId = autogeneratedId;
this.realId = realId;
this.data = data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resultify(msg,res,dest,type,data){\n\tdata = {};\n\tdata.msg = msg;\n\tdata.res = res;\n\tdata.dest = dest;\n\tdata.type = type;\n\tdata.e = (data.data,data.type)|| null\n\treturn data;\n}",
"create() {\n return new this.type;\n }",
"create (type, schemaDef, cb) {\n\n var payload = {};\... | [
"0.6096546",
"0.5880166",
"0.5707133",
"0.56807643",
"0.5622166",
"0.5560402",
"0.54891026",
"0.54749334",
"0.5468259",
"0.5439003",
"0.54389876",
"0.54238075",
"0.54135114",
"0.5382079",
"0.5378543",
"0.5376393",
"0.53460425",
"0.53292596",
"0.52843547",
"0.52720416",
"0.525... | 0.7220336 | 0 |
parks is a mapping of id => stuff I need a mapping of park => id, but sorted | function _sorted_parks() {
var sorted = { };
var list = [ ];
var parks = bip._park;
for (var id in parks) {
if (isNaN(parseInt(id))) continue;
sorted[parks[id].name] = id;
list.push(parks[id].name);
}
list.sort(function(a, b) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function K(a){var b=[];return a.forEach(function(a){b.push(a.id)}),b}",
"function _groupPerk(allData) {\n allData.push({resourceId:-1,perk:''})\n let prevId = undefined\n let curId = undefined\n let orgs = [];\n let perks = [];\n if (allData.length > 0) {\n prevId = allData[0].resourceId\n } else... | [
"0.58538413",
"0.5508463",
"0.5484188",
"0.5234215",
"0.5134906",
"0.5133812",
"0.5065381",
"0.5041369",
"0.50383484",
"0.50255",
"0.4989464",
"0.49633905",
"0.4962052",
"0.495477",
"0.49335977",
"0.49017903",
"0.48521113",
"0.48431596",
"0.47972777",
"0.4775586",
"0.47682062... | 0.7541305 | 0 |
Constructor function to create the bookshelf | function Bookshelf() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Shelf(name){\n\tthis.name = name;\n\t\n\tthis.books = [];\n}",
"constructor() {\n this.isOpen = false;\n\n this.knex = setUpKnex();\n\n this.bookshelf = bookshelf(this.knex);\n this.bookshelf.plugin('registry');\n this.bookshelf.plugin('virtuals');\n this.bookshelf.plugin(bookshelfGeoj... | [
"0.69417226",
"0.65222025",
"0.6353965",
"0.5849037",
"0.5842835",
"0.58265936",
"0.5732538",
"0.56085044",
"0.5550254",
"0.54974484",
"0.5439355",
"0.54207206",
"0.53941536",
"0.5288994",
"0.52557755",
"0.5246624",
"0.5229053",
"0.51841795",
"0.51753944",
"0.5161034",
"0.515... | 0.7792667 | 0 |
Gender functions generateGender but using Pokemon ID | static generateGenderById(id) {
const pokemon = PokemonHelper.getPokemonById(id);
return this.generateGender(pokemon.gender.femaleRatio, pokemon.gender.type);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static generateGender(chance, genderType) {\n let gender;\n switch (genderType) {\n case GameConstants.Genders.Genderless:\n gender = GameConstants.BattlePokemonGender.NoGender;\n break;\n case GameConstants.Genders.MaleFemale:\n if (... | [
"0.7076987",
"0.69342464",
"0.6874474",
"0.6563202",
"0.64605606",
"0.62691164",
"0.6196426",
"0.61733496",
"0.6120257",
"0.61051625",
"0.6092981",
"0.60799754",
"0.60793823",
"0.6071225",
"0.6008927",
"0.5980811",
"0.59142154",
"0.58886576",
"0.5881087",
"0.5878247",
"0.5852... | 0.8273903 | 0 |
Attacks with clicks and checks if the enemy is defeated. | static clickAttack() {
var _a;
// click attacks disabled and we already beat the starter
if (App.game.challenges.list.disableClickAttack.active() && player.starter() != GameConstants.Starter.None) {
return;
}
// TODO: figure out a better way of handling this
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enemyAttack() {\n\tdamageDealt = enemies[activeEnemy.title].atk_dmg - player.def;\n\tif(damageDealt < 1) damageDealt = 1;\n\n\tplayer.health.now -= damageDealt;\n\tif(player.health.now <= 0) combatLoss();\n\n\tdisplayPlayer();\n}",
"function enemyAttack() {\n if (slapService.getPlayer().dead != \... | [
"0.73977757",
"0.7354347",
"0.7293036",
"0.72352046",
"0.7096776",
"0.6993659",
"0.6937257",
"0.6898648",
"0.68480676",
"0.68090314",
"0.6804167",
"0.67900735",
"0.6789653",
"0.6741669",
"0.6704133",
"0.6688181",
"0.6682473",
"0.6646932",
"0.664375",
"0.66332966",
"0.6603115"... | 0.74479383 | 0 |
Generate a new enemy based on the current route and region. Reset the counter. | static generateNewEnemy() {
this.counter = 0;
this.enemyPokemon(PokemonFactory.generateWildPokemon(player.route(), player.region, player.subregionObject()));
const enemyPokemon = this.enemyPokemon();
PokemonHelper.incrementPokemonStatistics(enemyPokemon.id, GameConstants.STATISTIC_ENCOUN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addEnemy() {\n let enemySpots = GAME_WIDTH / ENEMY_BASE_RADIUS;\n let enemySpot;\n // Keep looping until we find a free enemy spot at random\n while (!enemySpot && this.enemies[enemySpot]) {\n enemySpot = Math.floor(Math.random() * enemySpots);\n }\n \n t... | [
"0.6481507",
"0.63669497",
"0.6357627",
"0.6273718",
"0.6122484",
"0.6053079",
"0.6048736",
"0.6047155",
"0.60440236",
"0.6035778",
"0.6025893",
"0.6004849",
"0.59888715",
"0.5965476",
"0.5928925",
"0.5927863",
"0.5921771",
"0.5916225",
"0.5912776",
"0.59098285",
"0.5909396",... | 0.7260108 | 0 |
check if save version is newer or equal to version | minUpdateVersion(version, saveData) {
var _a;
return !this.isOlderVersion((_a = saveData.update) === null || _a === void 0 ? void 0 : _a.version, version);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkIfUpdate(){\n\tif(Number(activeCharacter.fileVersion) == Number(formatVersion)){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}",
"get isNewVersion() {\n return compareVersion(this.lastVersion, VERSION_SCRIPT) < 0;\n }",
"checkCurrVersionIsOldOrNew(theno) {\n const curcon... | [
"0.7083446",
"0.70000744",
"0.67504716",
"0.67189085",
"0.6687259",
"0.66591597",
"0.65404963",
"0.65404963",
"0.65404963",
"0.65092945",
"0.6457094",
"0.640052",
"0.6352878",
"0.635109",
"0.6319351",
"0.6268639",
"0.62639415",
"0.6250707",
"0.6226619",
"0.62161696",
"0.62009... | 0.7536579 | 0 |
Override pokemon attack method so we can ignore the region multiplier | static pokemonAttack() {
var _a;
// attack twice as fast if we have defeated this stage
this.alternateAttack = !this.alternateAttack;
if (this.alternateAttack && BattleFrontierRunner.stage() > App.game.statistics.battleFrontierHighestStageCompleted()) {
return;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"attackInfantry(target, city) {\n if (this.infantry < 1) {\n alert(\"No infantry left!\");\n return;\n } else if (this.moved === true) {\n alert(this.name + \" has already moved!\");\n return;\n } else if (target[city] < 1) {\n alert(\"That... | [
"0.6490946",
"0.63556606",
"0.63369596",
"0.6240948",
"0.61491907",
"0.6124666",
"0.6114904",
"0.6106871",
"0.6091832",
"0.60846597",
"0.6017955",
"0.6017555",
"0.5988634",
"0.59622675",
"0.59440947",
"0.59255594",
"0.5901873",
"0.58888143",
"0.5881434",
"0.5821699",
"0.58165... | 0.65662766 | 0 |
String for currency in Notifications and Logs | currencyString() {
switch (GameConstants.Currency[this.cost.currency]) {
case 'money':
return 'Pokédollars';
default:
return `${GameConstants.camelCaseToString(GameConstants.Currency[this.cost.currency])}s`;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"currency(num) {\n return `$${B.number.commify2(num)}`;\n }",
"function getCurrency(c) {\r\n switch (c) {\r\n case 0: { return \"¥\" }\r\n case 1: { return \"$ \" }\r\n case 2: { return \"€ \" }\r\n }\r\n}",
"get formattedPrice() {\n return `CAD$ ${this.price.toFixed(... | [
"0.6772662",
"0.6616163",
"0.6556962",
"0.63343966",
"0.6284217",
"0.62318903",
"0.62192476",
"0.6179947",
"0.6172804",
"0.61713856",
"0.6166442",
"0.6156203",
"0.61136025",
"0.60674393",
"0.6048649",
"0.60223585",
"0.60195947",
"0.6000288",
"0.59987473",
"0.5993859",
"0.5987... | 0.7658997 | 0 |
Retrieves the weights for all the possible enemies | get weightList() {
return this.availableMinions().map((enemy) => {
var _a, _b, _c;
if (typeof enemy === 'string') {
return 1;
}
else if (enemy.hasOwnProperty('pokemon')) {
return (_a = enemy.options.weight) !== null && _a !== void 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getWeights() {\n const weightsCount = this.getWeightsCount()\n\n const result = prefilledVector(weightsCount, 0.0)\n\n let k = 0;\n\n for (var i = 0; i < this.inputHiddenWeights.length; ++i) {\n for (var j = 0; j < this.inputHiddenWeights[0].length; ++j) {\n result[k++] = this.inputHiddenWe... | [
"0.63862294",
"0.6381276",
"0.6220112",
"0.6160019",
"0.6092516",
"0.6033831",
"0.5981629",
"0.5900421",
"0.5845885",
"0.5828412",
"0.57793474",
"0.577542",
"0.57478005",
"0.57188606",
"0.5712855",
"0.5708584",
"0.5700022",
"0.56529474",
"0.56027013",
"0.55794317",
"0.5568422... | 0.72275805 | 0 |
Returns the possible minion Pokemon in the dungeon. Filters out Trainers and collapses DetailedPokemon | get pokemonList() {
// Filtering out Trainers
return this.enemyList.filter((enemy) => {
return !enemy.hasOwnProperty('name');
}).map((enemy) => {
// Collapsing DetailedPokemon
if (typeof enemy === 'string') {
return enemy;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"allAvailablePokemon() {\n const encounterInfo = [];\n // Handling minions\n this.enemyList.forEach((enemy) => {\n var _a;\n // Handling Pokemon\n if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {\n let pokemonName;\n ... | [
"0.6568641",
"0.62910086",
"0.61068124",
"0.60369766",
"0.5994622",
"0.59921503",
"0.57381773",
"0.56818104",
"0.56818104",
"0.5658757",
"0.56363934",
"0.5612333",
"0.5515583",
"0.55067915",
"0.55045086",
"0.54483825",
"0.5423906",
"0.54168636",
"0.5413032",
"0.540208",
"0.54... | 0.6627282 | 0 |
Returns the possible boss Pokemon in the dungeon. Filters out Trainers | get bossPokemonList() {
// Filtering out Trainers
return this.bossList.filter((enemy) => {
return enemy instanceof DungeonBossPokemon;
}).map((enemy) => {
return enemy.name;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"allAvailablePokemon() {\n const encounterInfo = [];\n // Handling minions\n this.enemyList.forEach((enemy) => {\n var _a;\n // Handling Pokemon\n if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {\n let pokemonName;\n ... | [
"0.6571969",
"0.654868",
"0.6286927",
"0.61705047",
"0.581016",
"0.5658526",
"0.5577397",
"0.54763114",
"0.53955615",
"0.53929216",
"0.5378562",
"0.5358195",
"0.53458816",
"0.52829295",
"0.5275644",
"0.5252398",
"0.5249537",
"0.52259403",
"0.52216876",
"0.52084804",
"0.519380... | 0.76468134 | 0 |
Gets all nonboss Pokemon encounters in the dungeon Used for generating the dungeon encounter list view | get normalEncounterList() {
const encounterInfo = [];
// Handling minions
this.enemyList.forEach((enemy) => {
var _a, _b, _c, _d;
// Handling Pokemon
if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {
let pokemonName;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"allAvailablePokemon() {\n const encounterInfo = [];\n // Handling minions\n this.enemyList.forEach((enemy) => {\n var _a;\n // Handling Pokemon\n if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {\n let pokemonName;\n ... | [
"0.6865137",
"0.68438464",
"0.6302876",
"0.6204798",
"0.6086027",
"0.562009",
"0.562009",
"0.56194",
"0.55596673",
"0.55426323",
"0.5373643",
"0.5371008",
"0.5347575",
"0.5344651",
"0.5256591",
"0.5190273",
"0.5167473",
"0.51516527",
"0.51465654",
"0.5073483",
"0.5061665",
... | 0.7242569 | 0 |
Gets all boss encounters in the dungeon Used for generating the dungeon encounter list view | get bossEncounterList() {
const encounterInfo = [];
// Handling Bosses
this.bossList.forEach((boss) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
// Handling Pokemon
if (boss instanceof DungeonBossPokemon) {
const pok... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get normalEncounterList() {\n const encounterInfo = [];\n // Handling minions\n this.enemyList.forEach((enemy) => {\n var _a, _b, _c, _d;\n // Handling Pokemon\n if (typeof enemy === 'string' || enemy.hasOwnProperty('pokemon')) {\n let pokemonNam... | [
"0.6355966",
"0.5959576",
"0.5570389",
"0.5423095",
"0.5359312",
"0.5099385",
"0.5036161",
"0.5003027",
"0.49800363",
"0.49730474",
"0.4961968",
"0.48939848",
"0.48824444",
"0.48555112",
"0.4831412",
"0.47953287",
"0.47860113",
"0.47826362",
"0.47688687",
"0.47460663",
"0.471... | 0.7187175 | 0 |
Handles defeating a trainer Pokemon | static defeatTrainerPokemon() {
this.enemyPokemon().defeat(true);
GameHelper.incrementObservable(this.trainerPokemonIndex);
App.game.breeding.progressEggsBattle(DungeonRunner.dungeon.difficultyRoute, player.region);
player.lowerItemMultipliers(MultiplierDecreaser.Battle);
// No P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static defeatPokemon() {\n this.enemyPokemon().defeat(true);\n // Make gym \"route\" regionless\n App.game.breeding.progressEggsBattle(this.gym.badgeReward * 3 + 1, GameConstants.Region.none);\n this.index(this.index() + 1);\n if (this.index() >= this.gym.pokemons.length) {\n ... | [
"0.6468057",
"0.6382365",
"0.63240534",
"0.6258519",
"0.61125255",
"0.60612494",
"0.60287875",
"0.5974809",
"0.5904531",
"0.58983433",
"0.58969784",
"0.5890666",
"0.58897525",
"0.58645034",
"0.5837163",
"0.5742453",
"0.57419556",
"0.5740386",
"0.5725601",
"0.5722705",
"0.5718... | 0.6912644 | 0 |
Handles generating the enemy Trainer Pokemon | static generateTrainerPokemon() {
this.counter = 0;
const pokemon = this.trainer().team[this.trainerPokemonIndex()];
const baseHealth = DungeonRunner.fightingBoss() ? pokemon.maxHealth : DungeonRunner.dungeon.baseHealth;
const level = DungeonRunner.fightingBoss() ? pokemon.level : Dungeo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static generateNewEnemy() {\n this.counter = 0;\n this.enemyPokemon(PokemonFactory.generateWildPokemon(player.route(), player.region, player.subregionObject()));\n const enemyPokemon = this.enemyPokemon();\n PokemonHelper.incrementPokemonStatistics(enemyPokemon.id, GameConstants.STATIST... | [
"0.746927",
"0.6707713",
"0.6673929",
"0.6575139",
"0.6393866",
"0.63601154",
"0.633273",
"0.62812895",
"0.6218893",
"0.61953974",
"0.6145805",
"0.6138788",
"0.6114829",
"0.6100879",
"0.6098742",
"0.60832244",
"0.6045282",
"0.60078156",
"0.59921014",
"0.5984529",
"0.59838927"... | 0.77241427 | 0 |
Handles the click event in the dungeon view | static handleClick() {
if (DungeonRunner.fighting() && !DungeonBattle.catching()) {
DungeonBattle.clickAttack();
}
else if (DungeonRunner.map.currentTile().type() === GameConstants.DungeonTile.entrance) {
DungeonRunner.dungeonLeave();
}
else if (DungeonRun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function click() {\n var d = datum();\n var target = d && d.properties && d.properties.entity;\n\n if (target && target.type === 'node') { // Snap to a node\n dispatch$$1.call('clickNode', this, target, d);\n return;\n\n } else if (target && target.ty... | [
"0.6858667",
"0.67309785",
"0.64877164",
"0.6469824",
"0.6399554",
"0.63887084",
"0.6371686",
"0.63679194",
"0.634636",
"0.62938243",
"0.629292",
"0.62786674",
"0.6272652",
"0.62318206",
"0.6221429",
"0.6203072",
"0.6192299",
"0.6187398",
"0.61869204",
"0.61575556",
"0.615507... | 0.7218793 | 0 |
Try to harvest all plots | harvestAll() {
this.plotList.forEach((plot, index) => {
this.harvest(index);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exportPlots(){ for(var i = 0; i < plots.length; i++) { exportPlot(plots[i]); } }",
"showGraphs(){\n\t\tthis.data = this.normalizedValuesService.getDataForElephantPlot();\n\t\tthis.series = this.data.series;\n\t\tthis.labels = this.data.labels;\n\t\tthis.renderPlot();\n\t}",
"function graphAll() {\n ... | [
"0.68087995",
"0.6037622",
"0.585827",
"0.57562226",
"0.575036",
"0.57268775",
"0.5627274",
"0.56189543",
"0.5615941",
"0.5592357",
"0.5568942",
"0.55202395",
"0.55036706",
"0.54857343",
"0.5468106",
"0.5447951",
"0.5432127",
"0.54113245",
"0.5392077",
"0.53388757",
"0.532144... | 0.62705845 | 1 |
Handles using the Mulch Shovel to remove mulch from a plot | shovelMulch(index) {
const plot = this.plotList[index];
if (!plot.isUnlocked || plot.isSafeLocked) {
return;
}
if (this.mulchShovelAmt() <= 0) {
return;
}
if (plot.clearMulch()) {
GameHelper.incrementObservable(this.mulchShovelAmt, -1);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mulchAll(mulch, amount = 1) {\n const mulchPlots = this.plotList.filter((_, index) => this.canMulch(index, mulch));\n amount *= mulchPlots.length;\n amount = Math.min(this.mulchList[mulch](), amount);\n const sharedMulch = Math.floor(amount / mulchPlots.length);\n if (sharedMulch... | [
"0.62951374",
"0.57798886",
"0.5672776",
"0.56327194",
"0.5618882",
"0.5489576",
"0.5429357",
"0.53367656",
"0.5313862",
"0.5292799",
"0.5239237",
"0.5217334",
"0.5190826",
"0.51905775",
"0.51378",
"0.51325864",
"0.51315105",
"0.5125693",
"0.5124053",
"0.51205224",
"0.5119064... | 0.68597865 | 0 |
Adds mulch to a plot | addMulch(index, mulch, amount = 1) {
const plot = this.plotList[index];
if (!this.canMulch(index, mulch)) {
return;
}
amount = Math.min(this.mulchList[mulch](), amount);
GameHelper.incrementObservable(this.mulchList[mulch], -amount);
GameHelper.incrementObserv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mulchAll(mulch, amount = 1) {\n const mulchPlots = this.plotList.filter((_, index) => this.canMulch(index, mulch));\n amount *= mulchPlots.length;\n amount = Math.min(this.mulchList[mulch](), amount);\n const sharedMulch = Math.floor(amount / mulchPlots.length);\n if (sharedMulch... | [
"0.6355178",
"0.5584351",
"0.55227983",
"0.54829526",
"0.5412221",
"0.52737963",
"0.52653253",
"0.52237797",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
"0.52219623",
... | 0.68469214 | 0 |
Attempts to add mulch to all plots | mulchAll(mulch, amount = 1) {
const mulchPlots = this.plotList.filter((_, index) => this.canMulch(index, mulch));
amount *= mulchPlots.length;
amount = Math.min(this.mulchList[mulch](), amount);
const sharedMulch = Math.floor(amount / mulchPlots.length);
if (sharedMulch <= 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addMulch(index, mulch, amount = 1) {\n const plot = this.plotList[index];\n if (!this.canMulch(index, mulch)) {\n return;\n }\n amount = Math.min(this.mulchList[mulch](), amount);\n GameHelper.incrementObservable(this.mulchList[mulch], -amount);\n GameHelper.inc... | [
"0.636308",
"0.5336105",
"0.5238845",
"0.5226819",
"0.5144338",
"0.5105484",
"0.5092147",
"0.50686795",
"0.50388294",
"0.5025698",
"0.5019393",
"0.50050515",
"0.49927846",
"0.49891597",
"0.49888688",
"0.49532753",
"0.49494457",
"0.49455357",
"0.49150938",
"0.48903063",
"0.487... | 0.7141482 | 0 |
Gets the growth multiplier for this plot | getGrowthMultiplier() {
var _a;
let multiplier = (_a = {
[MulchType.Boost_Mulch]: GameConstants.BOOST_MULCH_MULTIPLIER,
[MulchType.Amaze_Mulch]: GameConstants.AMAZE_MULCH_GROWTH_MULTIPLIER,
[MulchType.Freeze_Mulch]: GameConstants.FREEZE_MULCH_MULTIPLIER,
}[thi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getExpMultiplier() {\n return 1 + (this.getStat(STATS.MEME) * MEME_EXP_MODIFIER)\n }",
"function growth(metric,interval){\n return metric[def.c()]/metric[def.c()-interval]-1;\n }",
"get multiplier() {\r\n return this.i.multiplier;\r\n }",
"gainMult() { // Calculate the multiplier for ... | [
"0.64076495",
"0.6267475",
"0.61854064",
"0.5985088",
"0.59443057",
"0.5924829",
"0.5908898",
"0.59075576",
"0.5900449",
"0.5894895",
"0.5894895",
"0.5894895",
"0.5894895",
"0.5894895",
"0.58549225",
"0.58176064",
"0.5770982",
"0.5753542",
"0.5753542",
"0.5753542",
"0.5753542... | 0.67931455 | 0 |
Gets the harvest multiplier for this plot | getHarvestMultiplier() {
let multiplier = 1;
if (this.mulch === MulchType.Rich_Mulch) {
multiplier = GameConstants.RICH_MULCH_MULTIPLIER;
}
else if (this.mulch === MulchType.Amaze_Mulch) {
multiplier = GameConstants.AMAZE_MULCH_PRODUCE_MULTIPLIER;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeGetUpgradeMultiplier(){\n\tif (this.imagination_has_upgrade(\"vendors_higher_buy_price_4\")){\n\t\treturn 0.1;\n\t}\n\telse if (this.imagination_has_upgrade(\"vendors_higher_buy_price_3\")){\n\t\treturn 0.07;\n\t}\n\telse if (this.imagination_has_upgrade(\"vendors_higher_buy_price_2\")){\n\t\treturn... | [
"0.66553307",
"0.66259676",
"0.6550034",
"0.650255",
"0.63801855",
"0.631672",
"0.6277466",
"0.6265078",
"0.6255701",
"0.61404586",
"0.610322",
"0.609919",
"0.60597515",
"0.5981488",
"0.5981488",
"0.5972489",
"0.5957303",
"0.5933565",
"0.588144",
"0.58558685",
"0.5810896",
... | 0.7753638 | 0 |
Gets the replant multiplier for this plot | getReplantMultiplier() {
let multiplier = 1;
if (this.mulch === MulchType.Rich_Mulch) {
multiplier = GameConstants.RICH_MULCH_MULTIPLIER;
}
else if (this.mulch === MulchType.Amaze_Mulch) {
multiplier = GameConstants.AMAZE_MULCH_PRODUCE_MULTIPLIER;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get multiplier() {\r\n return this.i.multiplier;\r\n }",
"getMutationMultiplier() {\n let multiplier = 1;\n if (this.mulch === MulchType.Surprise_Mulch) {\n multiplier = GameConstants.SURPRISE_MULCH_MULTIPLIER;\n }\n else if (this.mulch === MulchType.Amaze_Mulch) ... | [
"0.6645275",
"0.6418676",
"0.61008006",
"0.6013438",
"0.59471196",
"0.5893147",
"0.58796567",
"0.58796567",
"0.58796567",
"0.58796567",
"0.58796567",
"0.58599675",
"0.58351314",
"0.5831934",
"0.5826244",
"0.5822163",
"0.5775884",
"0.57551986",
"0.57551986",
"0.5728666",
"0.57... | 0.70818675 | 0 |
Gets the mutation multiplier for this plot | getMutationMultiplier() {
let multiplier = 1;
if (this.mulch === MulchType.Surprise_Mulch) {
multiplier = GameConstants.SURPRISE_MULCH_MULTIPLIER;
}
else if (this.mulch === MulchType.Amaze_Mulch) {
multiplier = GameConstants.AMAZE_MULCH_MUTATE_MULTIPLIER;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get multiplier() {\r\n return this.i.multiplier;\r\n }",
"getExpMultiplier() {\n return 1 + (this.getStat(STATS.MEME) * MEME_EXP_MODIFIER)\n }",
"getReplantMultiplier() {\n let multiplier = 1;\n if (this.mulch === MulchType.Rich_Mulch) {\n multiplier = GameConstants.RICH_... | [
"0.6963166",
"0.64455086",
"0.63606066",
"0.6188183",
"0.6132185",
"0.59954077",
"0.59811145",
"0.5896505",
"0.5848231",
"0.5848231",
"0.5804255",
"0.57475877",
"0.57309216",
"0.56414056",
"0.5621931",
"0.5590597",
"0.557422",
"0.5571403",
"0.5553264",
"0.5510142",
"0.5491342... | 0.7818998 | 0 |
returns true if the plot had mulch. | clearMulch() {
const wasMulched = this.mulch != MulchType.None;
if (wasMulched) {
this.mulch = MulchType.None;
this.mulchTimeLeft = 0;
}
return wasMulched;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canZoomIn() {\n return GenericWorkflowDesigner.ZoomConstants.currentZoomRatio <\n GenericWorkflowDesigner.ZoomConstants.maxZoomRatio;\n }",
"function canZoomOut() {\n return GenericWorkflowDesigner.ZoomConstants.currentZoomRatio >\n GenericWorkflowDesigner.ZoomCons... | [
"0.5914437",
"0.58808094",
"0.5816944",
"0.5718759",
"0.5623889",
"0.56105864",
"0.5562023",
"0.55320257",
"0.55320257",
"0.55320257",
"0.55320257",
"0.55110174",
"0.55053514",
"0.54749364",
"0.5404146",
"0.5389703",
"0.5362293",
"0.5360701",
"0.5326129",
"0.53158575",
"0.523... | 0.60486144 | 0 |
Finds the plot indices that are around the plot in a 3x3 square | static findNearPlots(index) {
const plots = [];
const posX = index % GameConstants.FARM_PLOT_WIDTH;
const posY = (index - posX) / GameConstants.FARM_PLOT_HEIGHT;
for (let y = posY - 1; y <= posY + 1; y++) {
for (let x = posX - 1; x <= posX + 1; x++) {
if (y < ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whereAmI(x,y) {\n var s = gridPixelSize;\n var i = Math.floor(x/s);\n var j = Math.floor(y/s);\n return [i,j]\n}",
"function calculateGridPos(i) {\n const perRow = Math.floor(svgWidth / rectWidth)\n return [(i % perRow) * rectWidth, (Math.floor(i / perRow)) * rectHeight]\n }",
"functi... | [
"0.57978624",
"0.57852364",
"0.57561505",
"0.5749504",
"0.5713088",
"0.5698195",
"0.56865215",
"0.56515914",
"0.55920434",
"0.55620176",
"0.5529167",
"0.5514056",
"0.55110526",
"0.5508852",
"0.5507176",
"0.5494105",
"0.549348",
"0.54390883",
"0.5438881",
"0.54380053",
"0.5432... | 0.6654145 | 0 |
Finds the plot indices that are directly next to the plot (aka a plus sign) | static findPlusPlots(index, filter) {
const posX = index % GameConstants.FARM_PLOT_WIDTH;
const posY = (index - posX) / GameConstants.FARM_PLOT_HEIGHT;
const possiblePlots = [[posY - 1, posX], [posY, posX - 1], [posY, posX + 1], [posY + 1, posX]];
return possiblePlots.filter(([y, x]) => ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static findNearPlots(index) {\n const plots = [];\n const posX = index % GameConstants.FARM_PLOT_WIDTH;\n const posY = (index - posX) / GameConstants.FARM_PLOT_HEIGHT;\n for (let y = posY - 1; y <= posY + 1; y++) {\n for (let x = posX - 1; x <= posX + 1; x++) {\n ... | [
"0.59939617",
"0.5540847",
"0.54129666",
"0.5313178",
"0.5276841",
"0.526707",
"0.5241851",
"0.51855993",
"0.5156114",
"0.5085046",
"0.50154275",
"0.49914703",
"0.498732",
"0.49759054",
"0.49711722",
"0.4959388",
"0.4956748",
"0.4956748",
"0.49528158",
"0.49501723",
"0.493817... | 0.56567806 | 1 |
Handles getting the mutation chance | mutationChance(idx) {
return this._mutationChance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mutate() {\n if (!this.unlocked) {\n return false;\n }\n const plots = this.getMutationPlots();\n if (!plots.length) {\n return false;\n }\n let mutated = false;\n plots.forEach((idx) => {\n const willMutate = Rand.chance(this.mutati... | [
"0.6377384",
"0.6373699",
"0.60495245",
"0.60362047",
"0.59289056",
"0.58909464",
"0.5879832",
"0.5703063",
"0.5687293",
"0.5664036",
"0.5642754",
"0.5618358",
"0.5583955",
"0.5548652",
"0.55349594",
"0.5514175",
"0.55110615",
"0.5494173",
"0.54681855",
"0.5461063",
"0.545156... | 0.6571466 | 0 |
Returns a list of 4 Berry types to cause the mutation | static getReqs() {
SeededRand.seed(+App.game.discord.ID());
// Getting possible Berries
// Only Gen 3 and 4 Berries so there isn't as big of a growth discrepancy (e.g. Cheri and Haban)
let berryTypes = Farming.getGeneration(2).concat(Farming.getGeneration(3));
// Remove parasite ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllTypes(){\n\t\tvar types = [\"Bug\",\"Dark\",\"Dragon\",\"Electric\",\"Fairy\",\"Fighting\",\"Fire\",\"Flying\",\"Ghost\",\"Grass\",\"Ground\",\"Ice\",\"Normal\",\"Poison\",\"Psychic\",\"Rock\",\"Steel\",\"Water\"];\n\n\t\treturn types;\n\t}",
"function createWeaknessesList(types){\n var vulnera... | [
"0.6064141",
"0.54153836",
"0.5222217",
"0.5162259",
"0.5072951",
"0.50612396",
"0.504074",
"0.50355816",
"0.49911186",
"0.4989008",
"0.49677342",
"0.49617046",
"0.49583587",
"0.49342424",
"0.49183318",
"0.48974437",
"0.48868522",
"0.48830792",
"0.48691943",
"0.48690712",
"0.... | 0.57690364 | 1 |
Handles getting the hint for this mutation for the Kanto Berry Master | get partialHint() {
if (!App.game.discord.ID()) {
return 'There is a Berry that requires a linked <u>Discord</u> account to appear...';
}
const idx = this.hintIndex;
return `There's a mysterious berry that requires ${this.getHint(idx)}.`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get hint() {\n return this.args.hint;\n }",
"get hintLabel() { return this._hintLabel; }",
"get hint() {\n if (super.hint) {\n return super.hint;\n }\n return `I've heard that using the ${App.game.oakItems.itemList[this.oakItem].displayName} can cause ${BerryType[this.... | [
"0.6738848",
"0.62247956",
"0.6151767",
"0.60801166",
"0.602556",
"0.60174066",
"0.59859174",
"0.590586",
"0.5828975",
"0.56483954",
"0.5569158",
"0.5520016",
"0.5520016",
"0.5478571",
"0.54210573",
"0.5388775",
"0.5333051",
"0.5327504",
"0.52867573",
"0.52629346",
"0.5254872... | 0.6372783 | 1 |
Handles updating the farm with the mutation. Mutations will keep the new Berry plant in the same stage as it was previously | handleMutation(index) {
const plot = App.game.farming.plotList[index];
const currentStage = plot.stage();
let newAge = 0;
if (currentStage !== PlotStage.Seed) {
newAge = App.game.farming.berryData[this.mutatedBerry].growthTime[currentStage - 1] + 1;
}
plot.ber... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleMutation(index) {\n const plot = App.game.farming.plotList[index];\n plot.berry = this.mutatedBerry;\n plot.age = 0;\n plot.notifications = [];\n App.game.farming.unlockBerry(this.mutatedBerry);\n }",
"function update(farm, full_update){\n\t\t// Received year, expected... | [
"0.6187602",
"0.5926304",
"0.5554668",
"0.5527215",
"0.5457964",
"0.5410128",
"0.5362347",
"0.5353616",
"0.5331756",
"0.53214735",
"0.53181595",
"0.53041995",
"0.5284274",
"0.5283367",
"0.52448213",
"0.5237084",
"0.5235025",
"0.5200652",
"0.51989764",
"0.51976436",
"0.5180303... | 0.6779965 | 0 |
Checks an individual plot for a Berry requirement | checkRequirement(index, berryReq) {
const plot = App.game.farming.plotList[index];
if (!plot.isUnlocked) {
return false;
}
if (plot.berry !== berryReq) {
return false;
}
if (plot.stage() !== PlotStage.Berry) {
return false;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"plotFitRequirements(plot, idx) {\n if (!App.game.oakItems.isActive(this.oakItem)) {\n return false;\n }\n if (this.originalBerry && plot.berry !== this.originalBerry) {\n return false;\n }\n return true;\n }",
"function checkAndPlotData() {\n if (loc... | [
"0.6837698",
"0.60401887",
"0.60112786",
"0.5883436",
"0.5883436",
"0.5701848",
"0.5520253",
"0.5515364",
"0.5490171",
"0.5447596",
"0.5447596",
"0.5424788",
"0.5410245",
"0.5371586",
"0.5369236",
"0.5340096",
"0.5281461",
"0.52573687",
"0.52573687",
"0.52573687",
"0.52573687... | 0.76160645 | 0 |
Constructor for a FlavorMutation | constructor(mutationChance, mutatedBerry, originalBerry, flavorReqs, options) {
super(mutationChance, mutatedBerry, originalBerry, options);
this.flavorRatio = [0.5, 0.75, 1]; // Determines how much flavor a Berry plant has before fully mature.
this.flavorReqs = flavorReqs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(mutationChance, mutatedBerry, flavorReqs, options) {\n super(mutationChance, mutatedBerry, options);\n this.flavorRatio = [0.5, 0.75, 1]; // Determines how much flavor a Berry plant has before fully mature.\n this.flavorReqs = flavorReqs;\n }",
"constructor(color, mutationStre... | [
"0.6021693",
"0.5058663",
"0.5007943",
"0.49995616",
"0.48803833",
"0.48227066",
"0.47711775",
"0.47655407",
"0.46943575",
"0.46553716",
"0.46485916",
"0.46166447",
"0.46157643",
"0.46154073",
"0.46154073",
"0.46154073",
"0.46154073",
"0.45836723",
"0.45679685",
"0.45492762",
... | 0.5732598 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.