query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
function to reverse italics. In contexts where a paragraph is in italics, 'em' elements should not be italic. | function reverseItalics(elm){
var ems = elm.evaluateXPathExpression("//em");
for (var i = 0; i < ems.length; i++){
try{
var tag = ems[i];
var parentStyle = tag.parent.paragraphs[0].fontStyle;
if(parentStyle == "Italic"){
tag.applyCharacterStyle("em-rev... | [
"function makeItalic(string) {\n\tstring = cleanString(string);\n\tstring = '<em>' + string + '</em>';\n\treturn string;\n}",
"function textItalic() {\n if (colorParagraph.style.fontStyle === \"italic\") {\n cancel();\n } else {\n colorParagraph.style.fontStyle = \"italic\"\n }\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sourceMappingURL=scheduleArray.js.map PURE_IMPORTS_START _Observable,_util_subscribeToArray,_scheduled_scheduleArray PURE_IMPORTS_END | function fromArray(input, scheduler) {
if (!scheduler) {
return new Observable(subscribeToArray(input));
}
else {
return scheduleArray(input, scheduler);
}
} | [
"function SourceMap(){\n this.lines = [];\n }",
"get schedules() {\n return Array.from(this._schedules.values());\n }",
"__init() {\n\t\tthis.sourcemap_list = [];\n\t}",
"function fromArray(input, scheduler) {\n if (!scheduler) {\n return new Observable_Observable(subscribeToArray(in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Chain" a function that returns a context and flattens it into this context and gives us a way to chain functions together that return Maybes a.k.a. "FlatMap", "bind" chain :: (a > Maybe b) > Maybe a > Maybe b | chain(fn) {
//Lifts the function into our context, calls it with our wrapped value(fmap) and then flattens it(join)
return this.map(fn).join();
} | [
"map(fn) {\n //If our context is wrapping nothing, return a context wrapping nothing\n if (this.isNothing) return Maybe.of(null); \n\n //Otherwise apply the function argument to our wrapped value and wrap it up in a new context\n return Maybe.of(fn(this.value));\n }",
"chain (fn, va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MAIN DRAW METHOD Draws an arc diagram for the provided undirected graph | function arcDiagram() {
//debugger;
d3.selectAll("svg#arc").remove();
//d3.select("#plot").remove();
// create svg image
var svg = d3.select("#relationships")
.append("svg")
.attr("id", "arc")
.attr("width", width)
.attr("height", height);
// create plot area wi... | [
"function arcDiagram(graph) {\n\n\t\t\td3.select(\"#\" + currentSettingsID)\n\t\t\t\t.attr(\"width\", \"100%\")\n\t\t\t\t.attr(\"height\", \"100%\")\n\t\t\t\t.style(\"text-align\", \"center\")\n\t\t\t\t.style(\"margin\", \"0 auto\");\n\t\t\t\t\n\t\t\tvar divArc = d3.select(\"#\" + currentSettingsID)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Have the function BasicRomanNumerals(str) read str which will be a string of Roman numerals. The numerals being used are: I for 1, V for 5, X for 10, L for 50, C for 100, D for 500 and M for 1000. In Roman numerals, to create a number like 11 you simply add a 1 after the 10, so you get XI. But to create a number like 1... | function BasicRomanNumerals(str) {
let roman = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000 };
let result = 0;
for (let i = 0; i < str.length; i++) {
if (roman[str[i]] < roman[str[i + 1]]) {
result += roman[str[i + 1]] - roman[str[i]];
i++;
} else {
result += roman[str[i]];
}
... | [
"function convertRomanNumeralToInteger(str){\r\n if(validate(str.toUpperCase())){\r\n //if the input string is valid\r\n let strArr = str.split(\"\");\r\n var result = 0;\r\n for(var i=0; i<strArr.length; i++){\r\n //get the value of the roman character at the current index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads a littleendian short (twobyte) integer. | readShort(allowEofAfterFirstByte) {
const low = this.read();
if (low === exports.EOF) {
return exports.EOF;
}
const high = this.read();
if (high === exports.EOF) {
return allowEofAfterFirstByte ? low : exports.EOF;
}
return low + high * 256... | [
"readShort() {\n const off = this.offset;\n const buf = this.buffer;\n bf_wba[0] = buf[off];\n bf_wba[1] = buf[off + 1];\n this.offset += 2;\n return bf_wsa[0];\n }",
"readShort() {\n if (!this.validate(ByteArray.SIZE_OF_INT16))\n return null;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is called to determine if the lookup should be displayed when the mouse is clicked. The first parameter is the event that triggered the function. The second parameter is the current state of the look up. | function displayNavigationControl(event, isLookupVisible) {
var retValue = false;
var source = sourceCtrl;
var id = "#" + $(source).attr("id");
var visible = isLookupVisible;
var clickedCaret = $(event.target).hasClass("ds-bc-nav-lu-caret");
var clickedOnBC = $(id + "... | [
"function checkClickLocation(e){\n\tvar theTarget = getTarget(e);\n\tif (theTarget.name != \"suggestions\"){\n\t\tdocument.getElementById(\"suggestions\").style.display = \"none\";\n\t}\n}",
"function mouseClicked() {\n // If it has been clicked return true\n return true;\n }",
"function verify... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines what to do with the cursor based on radio button values | function getCursorMode() {
cursorMode = {
brush: $('#brushRadio').is(':checked'),
select: $('#selectRadio').is(':checked'),
};
} | [
"radiosetter(event){\n console.log(event.target.value)\n switch (event.target.value) {\n case \"TRUE\":\n window.$attend = event.target.value\n break;\n case \"FALSE\":\n window.$attend = event.target.value\n break;\n case \"Public\":\n window.$classi = event.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try starting gRPC subscription for production engine state on a particular machine | function startPeSubscription(m) {
peSubcription = peSubcriptions.find( s => s.getMachine().id === m.id)
if(!peSubcription) {
peSubcription = new ProductionEngineSubscription(m)
peSubcriptions.push(peSubcription);
}
grpcConnection = grpcConnections.find( c => c.machineId === m.id)
... | [
"function startMagSubscription(m) {\n \n magSubcription = magSubcriptions.find( s => s.getMachine().id === m.id)\n if(!magSubcription) {\n magSubcription = new MagazineSubscription(m);\n magSubcriptions.push(magSubcription);\n }\n\n grpcConnection = grpcConnections.find( c => c.machineI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
crearCurso(); find nos sirve para realizar consultas | async function listarCurso(){
// api/Cursos?numeroPage=4&sizePage=10
const numeroPage = 2;
const sizePage = 10;
// -----------------------------------------------------------------------------------
// OPERADORES DE COMPARACION
// eq (equal, igual)
// ne (not equal, no igual)
// gt (gr... | [
"function consulta(query, inicio) {\n query.find({\n success: function(results) {\n procesarResultados(results, inicio);\n },\n error: function(error) {\n alert(\"Error en la Conexion a la Base de Datos\");\n }\n });\n}",
"async function getCursosSe(req, res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
api get humidity return array of humidity 12 elements call 1 time per 15 minutes | async function getHumidityIntensity() {
// get hum upper safe level
let upperArr = [];
let upperData = await fetch('https://api.thingspeak.com/channels/866214/fields/7',
{
method: 'GET',
})
upperData = await upperData.json();
let upperFeed = upperData.feeds.reverse().filt... | [
"loadTurbidity() {\n\t\tthis.loadMaxCurrentMinTurb();\n\t\tapiCall('iot/api/turbidity/hour')\n\t\t\t.then((response) => {\n\t\t\t\tthis.turbidityData = response;\n\t\t\t\tthis.drawChartTurb();\n\t\t\t});\n\t\twindow.clearInterval(this.interval);\n\t\tthis.interval = window.setInterval(this.loadMaxCurrentMinTurb.bin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
redo jumpToFuture: jump to requested index in future history | function jumpToFuture(history, index) {
if (index === 0) return redo(history);
var past = history.past;
var present = history.present;
var future = history.future;
return {
future: future.slice(index + 1),
present: future[index],
past: past.concat([present]).concat(future.slice(0, index... | [
"function jumpToFuture(history, index) {\n\t\t if (index === 0) return redo(history);\n\t\t\n\t\t var past = history.past;\n\t\t var present = history.present;\n\t\t var future = history.future;\n\t\t\n\t\t\n\t\t return {\n\t\t future: future.slice(index + 1),\n\t\t present: future[index],\n\t\t past:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that populate blocks in "Explore". | function populateExploreBlock() {
var explore = [
{
"link": "documents/contract-as-automaton.pdf",
"img": "img/explore/contract-as-automaton.png",
"title": "Live Contracts — What’s all the fuss about?",
"intro": "We show that the fundamental legal structure of a well-written financial contract follo... | [
"function populateExploreBlock() {\n\tvar explore = [\n\t\t{\n\t\t\t\"link\": \"documents/contract-as-automaton.pdf\",\n\t\t\t\"img\": \"img/explore/contract-as-automaton.png\",\n\t\t\t\"title\": \"Live Contracts — What’s all the fuss about?\",\n\t\t\t\"intro\": \"We show that the fundamental legal structure of a w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles the special character modal. | handleToggleSpecialCharacterModal() {
const { activeBlockKey, editorState, modalComponent } = this.state;
if (modalComponent) {
this.handleCloseModal();
} else {
const selectionState = editorState.getSelection();
const insertingIntoNonActiveBlock = selectionState.getAnchorKey() !== active... | [
"function toggleCharModal() {\n charModal.classList.toggle('hide');\n }",
"function toggle() {\n setModal(!modal);\n }",
"_onToggleUnicodeCharsClicked(e) {\n const $el = this.$el;\n const $button = $(e.target);\n const ducsShown = !$el.hasClass('-hide-ducs');\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HELPERS Additional functions that adds to the original jam function. | function includeHelpers(func) {
// ## jam.identity()
// Simple function that passes the values it receives to the next function.
// Useful if you need a `process.nextTick` inserted in-between your call chain.
func.identity = function(next) {
function _identity(next) {
var args = argument... | [
"function includeHelpers(func) {\n\n // ## jam.identity()\n\n // Simple function that passes the values it receives to the next function.\n // Useful if you need a `process.nextTick` inserted in-between your call chain.\n func.identity = function(next) {\n function _identity(next) {\n var ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if an arrow has been clicked | checkClick() {
//click is only possible if count > 0 and within distance
if (dist(mouseX, mouseY, this.x, this.y) <= 25 && this.count > 0) {
//change arrow directions
if (this.direction == "up") {
this.direction = "right";
}
else if (this.direction == "right") {
this.direction = "down";
}
... | [
"isClicked() {\n return this.isSelected() && mouseIsPressed;\n }",
"function mouseClicked() {\n // If it has been clicked return true\n return true;\n }",
"function isArrowButton(ele) {\n if (ele.tagName === 'LI' && (ele.classList.contains('prev_page') || ele.classList.contains('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get restaurants by type | function getRestaurantsByType (type) {
var request = {
location: selectedCoords,
radius: $radius.val(),
query: type + " restaurant"
};
$('.bg_overlay_alt').addClass('is_show');
$('body').addClass('no_scroll');
placeService.textSearch(request, function (results, status, pagina... | [
"function getAllRestaurantsByType(type_id)\n{ \n if(!helpers._isPositiveOrZeroInteger(type_id))\n return {error: \"Type restaurant ID is not valid\"}\n\n var query = format(` SELECT\n restaurants.email, restaurants.avaliability, restaurant... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the dialog UI | function buildUI() {
var _ = this,
cbs = _.config.callbacks,
wrapper,
header,
content,
footer,
dialogPulse = function dialogPulse() {
_.dialog.classList.add('dlg--pulse');
setTimeout(function () {
_.dialog.classList.remove('dlg--pulse');
}, 200);... | [
"function buildUI(){\t\n\t\t\n\t\treturn;\n\t\t\n\t}",
"buildUI() {}",
"function buildDialogs() {\n\tDIALOGS = {\n\t 1: {id: 'help', html: buildHelpDialog, functions: null, height: '36', width: '50'}, //help\n\t 2: {id: 'YN', html: YNdialog, functions: null, height: '6', width: '30'}, //yes or no dialog\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a vector that normalizes the input vector of v1 | function vector_normalize(v1) {
let sum = 0;
let v1_norm = [];
for (let i = 0; i < v1.length; i++)
sum += v1[i] ** 2;
sum = Math.sqrt(sum);
for (let i = 0; i < v1.length; i++)
v1_norm[i] = v1[i]/sum;
return v1_norm;
} | [
"static Normalize(v) {\n var m = Vector.Magnitude(v);\n if (m > 0) {\n Vector.Divide(v, new Vector(m, m));\n }\n return v;\n }",
"normalize(outVector, inVector) {\r\n // @todo\r\n }",
"function normalizeVector (vector)\r\n{\r\n //Find the length of the inpu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
|=====================================================================================| Given a string, sourceStr, write some code that will split this string using comma as your delimiter, and producing an empty array if the string is empty. | function splitListStrUsingComma(sourceStr) {
if (!sourceStr.length) {
return [];
}
return sourceStr.split(',');
} | [
"function splitListStrUsingComma(sourceStr) {\n if(_.isEmpty(sourceStr)) {\n return [];\n } else {\n return sourceStr.split(\",\");\n }\n }",
"function splitListStrUsingComma(sourceStr) {\n if(sourceStr === \"\") return []\n return sourceStr.spli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rearrange Adjust an index based on the number of hidden cards that come before it | adjustIndex(index) {
return index - this.hiddenIndices.filter(i => i < index).length;
} | [
"arrangeCards(indexAdder, rowData){\n let k = 0;\n this.state.cards.map((x, index) => {\n if (index == 3 * k + indexAdder) {\n rowData.push(x);\n k++;\n }\n });\n return rowData;\n }",
"reorganizeCards() {\n // Move card to ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle user request to add an exception for the specified cert | function addException() {
if(!gCert || !gSSLStatus)
return;
var overrideService = Components.classes["@mozilla.org/security/certoverride;1"]
.getService(Components.interfaces.nsICertOverrideService);
var flags = 0;
let confirmBucketId = gNsISecTel.WARNING_BAD_CERT_CONFIRM_... | [
"function BadCertHandler() {\n}",
"function nsMsgBadCertHandler() {\n}",
"function addCertificateFailed(err) {\n vm.certificateMessage = LOGBOOK_CONSTANT.MSG_CERTIFICATE_ADD_ERROR;\n vm.working = false;\n }",
"function SSLExceptions() {\n this._overrideService = Cc[\"@mozilla.org... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads all the counties and shows them on the page | function populateCounties() {
var searchCounty = "";
request_url = COUNTIES_URL;
request_params = ACTION_TYPE + "=" + ACTION_QUERY + "&" + SEARCH_KEY + "="
+ searchCounty + "&" + RESULT_FORMAT + "=" + RESULT_FORMAT_DROPDOWN;
request_intent = INTENT_QUERY_COUNTIES;
sendPOSTHttpRequest(request_url, request_par... | [
"function getCounties(){\n apiService.counties().get({}, function (response) {\n console.log(\"SERVER RESPONSE: counties: \", response);\n dataService.setCounties(response);\n $localStorage.$default({\n 'counties': response\n });\n }, function (error) {\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Are the bottoms of the pin and base aligned? | _isBottomAligned(align) {
const [pinAlign, baseAlign] = align.split(' ');
return pinAlign[0] === 'b' && pinAlign[0] === baseAlign[0];
} | [
"function checkBaseline() {\n var isBottom = false;\n for (var i = 0; i < shape.length; i++) {\n if(shape[i].row === 39) {\n isBottom = true;\n return isBottom;\n }\n }\n }",
"_isRightAligned(align) {\n const [pinAlign, baseAlign] = align.split(' ');\n return pinAli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
how many degrees is latWidth meters at a certain latitude | function getDegreeWidthOfWidthAtLat(latWidth, lat){
return latWidth/getMeterWidthAtLat(1, lat);
} | [
"mapLength(){\n let length = 0;\n let A = this.getPoint(0);\n for(let i = 1; i<this.size(); i++){\n if(this.getPoint(i).getOrigin() === 'ORIGINAL'){\n let B = this.getPoint(i);\n length += B.groundDistance(A);\n A = B;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that validates phone numbers. Takes as input the form input element that contains the phone number. It is called by validateFormFields() function | function validatePhoneNumber(el){
/* in order for a phone number to be valid, it must have at least 10 digits.
Also, only digits and spaces are allowed. This means that the sum of the number of digits and the number of spaces
should be equal to the total number of characters*/
//get the length of the phone ... | [
"function val_input_phone() {\n val_checkblank(val_getid('input-phone'),'err-phone-blank');\n val_setformok();\n}",
"function simplePhoneValidation(phoneNumber) {\n\n}",
"function validatePhone() {\r\n var content = $(\"#number\").val();\r\n if (content != \"\" && (content.length < 11 || content... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I give the value of the choosen Sign to mark After that, the gridBuilder function will start. | function setPlayer() {
mark = this.value;
// this.checked = false;
gridBuilder();
} | [
"function changeSign()\n {\n currentInput = currentInput * 1\n displayCurrentInput();\n }",
"function setSign(e){\n\n //change opr triger value\n opr = true;\n\n s.push(e.path[0].attributes.value.nodeValue);\n\n // onclick second time\n value.onclick = (e) => setNum(e);\n \n // se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_ESAbstract.ArrayCreate 9.4.2.2. ArrayCreate ( length [ , proto ] ) | function ArrayCreate(length /* [, proto] */) { // eslint-disable-line no-unused-vars
// 1. Assert: length is an integer Number ≥ 0.
// 2. If length is -0, set length to +0.
if (1 / length === -Infinity) {
length = 0;
}
// 3. If length>2^32-1, throw a RangeError exception.
if (length > (Math.pow(2, 32) - ... | [
"function ArrayCreate(length /* [, proto] */) { // eslint-disable-line no-unused-vars\n\t// 1. Assert: length is an integer Number ≥ 0.\n\t// 2. If length is -0, set length to +0.\n\tif (1 / length === -Infinity) {\n\t\tlength = 0;\n\t}\n\t// 3. If length>2^32-1, throw a RangeError exception.\n\tif (length > (Math.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
W08288149 COSC 3020 Assignment 2 11/15/19 This was helpful to me: The nodes are labeled 0 through n 1 Edges go from row to column 0 denotes no edge Here is a sample of acceptable input: / a = [ [0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [1, 0, 0, 0, 1, 0, 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0, 0]... | function augmentingPaths (graph, start, end) {
// Keep track of vertices with that have been visited with "processedList" to avoid cycles
// If a cycle existed and "end" could not be found the code would execute forever
// Also, using "processedList" may be faster in graphs with a large edges/vertices ratio
processed... | [
"function findAugmentingPath() {\r\n\r\n // Node and corresponding label\r\n var node;\r\n var nodeLabel;\r\n\r\n // Initialise queue front and back (queue is empty)\r\n queueFront = 0;\r\n queueBack = 0;\r\n\r\n // For each vertex\r\n for (var i = 0; i < nodes.length; i++) {\r\n\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the place details from the autocomplete object. | function fillInAddress() {
var place = autocomplete.getPlace();
} | [
"async function getPlaceDetails(Place) {\n // Use place ID to create a new Place instance.\n const place = new Place({\n id: \"ChIJN1t_tDeuEmsRUsoyG83frY4\",\n requestedLanguage: \"en\", // optional\n });\n\n // Call fetchFields, passing the desired data fields.\n await place.fetchFields({ fields: [\"dis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides the insert indicator. | function hideInsertIndicator() {
currentDropTarget = null;
currentInsertionIndicatorPosition = null;
if (!insertIndicatorElement) {
return;
}
insertIndicatorElement.hide();
} | [
"function hideInsertIndicator() { \n if (!insertIndicatorElement) {\n return;\n }\n\n insertIndicatorElement.hide();\n }",
"function showInsertIndicator() {\n if (!insertIndicatorElement) {\n return;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initiate the system from local files Just for the test purpose. init("matching.json","corpusStatistics.json","articlesStatistics.json","corpusStr.json","corpusTxt.json"); | function init(file1,file2,file3,file4,file5){
d3.json(file1, function(error, txt) {
matching=txt;
//console.log(matching[2].name);
d3.json(file2, function(error, txt) {
corpusStatistics=txt;
totalNum=txt.articles;
totalPages=txt.totalPages;
//console.log(corpusStatistics);
d3.json(file3, function(... | [
"function loadFiles () {\n\t\tvar language;\n\t\tfor (i=0; i <= languages.length; i++) {\n\t\t\t\n\t\t\tif (i == languages.length) {\n\t\t\t\t//singal initDataCompleted\n\t\t\t\tconsole.log('initDataCompleted!');\n\t\t\t\tinitDataCompleted = true;\n\t\t\t\tconsole.log('data[language]', data.en);\n\t\t\t\tconsole.lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dust helper for url creation that helps deal with domain and port changes | function dust_url(opts, chunk, ctx, bodies, params) {
var url = dust.helpers.tap(params.url, chunk, ctx);
// Only prepend our base url if we're looking for something relative to it
if (url[0] == '/')
return chunk.write(opts.base_url + url);
else
return chunk.write(url);
} | [
"function genFullUrl(req, url) { \n //return `${req.protocol}://${req.hostname}:${getPort()}/${url}`;\n return `${req.protocol}://${req.hostname}/${url}`;\n}",
"function urlBuilder(domain) {\n return proxyFluentApi((parts) => `${domain}${parts.join('/')}`);\n}",
"#buildUrl() {\n let { url } = this.#r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
questa funzione allo scroll della pagina cambia il logo | function scrollLogo() {
// il logo è composto da due immagini loghino più scritta. allo scroll della finestra (window) se scrollTop() cioè quanti pixel ho scrollato dall'alto è >10 nascondo la scritta. se è <10 cioè son tornato su ricompare la scritta
$( window ).scroll(function() {
if($(window).scrollTop... | [
"function smoothScrollSection() {\n jQuery('a.logo').smoothScroll();\n }",
"function watchScroll(e) {\n let pagePosY = window.scrollY;\n if (pagePosY < 200) {\n NAVBAR.classList.remove('solid');\n LOGO.setAttribute('src', whiteLogo);\n } else {\n NAVBAR.cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
instantiate js objects for all elements that have 'datajsclass' defined | function instantiateObjects(event) {
$("*[data-jsclass]").each( function () {
if(!$(this).data('iowajsinstance')) {
var handler = null;
try {
handler = new window[$(this).data('jsclass')](this);
$(this).data('iowajsinstance',handler);
if($(this).data('iowajsinstance').start) {
$(this).da... | [
"parseJavaScript() {\n let comments = dox.parseComments(this.contents, { raw: true });\n let sections = this.sections;\n let docs = this.docs;\n let currentClass;\n for (const annotationObject of comments) {\n let a = new annotation_1.Annotation(annotationObject, this);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start by visiting the root | traverse() {
this.root.visit(this.root);
} | [
"function goToRoot() {\n goTo();\n }",
"visitStart(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function traverseTree(tree, startNode) {\r\n\t//alert(startNode.text);\r\n\tif(startNode.isLeaf()) {\r\n\t\t// Call File Import Function\r\n\t\treturn;\r\n\t} else {\r\n\t\tif(startNode != tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that updates wrapping mode in quadMaterial | updateTextureWrapping()
{
this.quadMaterial.setTextureWrap(this.wrappingMethods[this.wrapS], this.wrappingMethods[this.wrapT]);
} | [
"updateTextureWrapping() {\r\n this.quadMaterial.setTextureWrap(this.wrappingMethods[this.wrapS], this.wrappingMethods[this.wrapT]);\r\n }",
"updateAppliedTexture() {\r\n this.quadMaterial.setTexture(this.textures[this.selectedTexture]);\r\n }",
"updateAppliedTexture()\n {\n this.q... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the URL required for a "get places" query. | static buildGetPlacesQuery(lat, lng) {
return "https://maps.googleapis.com/maps/api/place/textsearch/json"
+ "?query=" + relevantPlaceTypes
+ "&language=en"
+ "&fields=formatted_address,geometry,icon,id,name,permanently_closed,photos,place_id,plus_code,types,user_ratings_total,price_level,ra... | [
"getPlacesUrl(lat, long, radius, type, apiKey) {\n const baseUrl = `https://maps.googleapis.com/maps/api/place/nearbysearch/json?`;\n const location = `location=${lat},${long}&radius=${radius}`;\n const typeData = `&types=${type}`;\n const api = `&key=${apiKey}`;\n return `${baseUrl}${location}${type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts a vector from a category from a specified rowIndex. _category.matrix[1][1] v11 .... .... _category.matrix[rows][cols] vRowsCols | function getVector(category, field, rows, cols, rowIndex) {
var ret = [];
for (var i = 1; i <= rows; i++) {
ret[i - 1] = category.getColumn(field + "[" + i + "]").getFloat(rowIndex);
}
return ret;
} | [
"function getMatrix(category, field, rows, cols, rowIndex) {\n var ret = [];\n for (var i = 1; i <= rows; i++) {\n var row = [];\n for (var j = 1; j <= cols; j++) {\n row[j - 1] = category.getColumn(field + \"[\" + i + \"][\" + j + \"]\").getFlo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load All Event Listeners | function loadAllEventListeners() {
// Buttons click event (Event Delegation)
buttons.addEventListener("click", calculate);
} | [
"function loadAllEventListeners() {\n\n serviceAdd.addEventListener('click', submitService);\n serviceCollection.addEventListener('click', deleteListItem);\n}",
"function loadEventHandlers ( ) {\n\t\n\t}",
"registerListeners() {\n for (var event in this.events) {\n this.on(event, (..... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to determine the type of sort based on the URL | function checkURL() {
// Try URL first
var param = loc.search;
if (param) {
// Most Recent: ?sk=h_chr
// Top Stories: ?sk=h_nor
// Not currently sorted by most recent
if (param.indexOf('sk=h_chr') === -1) {
changeSort();
... | [
"function sortBy(sortType) {\n var currentPath = window.location.href;\n var basePath = currentPath.split('&');\n var siteIndexVal = basePath[0].indexOf('site=');\n var urlQuery = siteIndexVal > 0 ? basePath[0] + '&' + basePath[1] : basePath[0];\n window.location.href = urlQuery + '&sort=' + sortTyp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable or disable the terms of usage content in the analyserpanel | function toggleTerms() {
toggleAnalyserPanel('terms');
} | [
"function enableManualPlot(){\n document.getElementById('Plot').disabled = false;\n document.getElementById('manEquation').disabled = false;\n}",
"function disableManualPlot(){\n document.getElementById('Plot').disabled = true;\n document.getElementById('manEquation').disabled = true;\n}",
"function enableU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns maximum size allowed for job files. | get_jobMaxSize()
{
return this.liveFunc._jobMaxSize;
} | [
"function getMaxFileSize() {\n return maxFileSize;\n }",
"function YI2cPort_get_jobMaxSize()\n {\n var res; // int;\n if (this._cacheExpiration == 0) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_JOBMAXSIZ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
switch profile type by changing the userProfile Ex: shelterProfile, businessProfile, newBusinessProfile and petOwnerProfile | function updateProfileHandler(type, value) {
if (type === 'address' || type === 'phone' || type === 'hours') {
setUserProfile(() => ({
...userProfile,
contactInfo: {
...userProfile.contactInfo,
[type]: value
}
... | [
"function setProfileType(profileType) {\n defaultProfileType = profileType\n}",
"function changeProfile() {\n var userId = CQ_Analytics.ProfileDataMgr.getProperty(\"authorizableId\");\n debug(\"User id \"+userId+\" currentUser id \"+currentUserId);\n if (c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove formatting upon pasting text into the editable area. | function plainTextOnPaste() {
editors.forEach(function (editor) {
editor.querySelector('.text').addEventListener('paste', function () {
var _self = this;
setTimeout(function () {
// Set textContent with the result of textContent, which effectively
... | [
"function removeFormatting() {\n document.execCommand(\"removeFormat\", false, null);\n document.execCommand(\"unlink\", false, null);\n\n cur_contentdiv.focus(); // return focus back to editing field\n }",
"paste (event) {\n event.preventDefault();\n event.stopPropagation();\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of beta testers contained in a specific beta group. | function listAllBetaTestersForBetaGroup(api, id, query) {
return api_1.GET(api, `/betaGroups/${id}/betaTesters`, { query })
} | [
"function listBetaTesters(api, query) {\n return api_1.GET(api, `/betaTesters`, { query })\n}",
"function getAllBetaTesterIDsForBetaGroup(api, id, query) {\n return api_1.GET(api, `/betaGroups/${id}/relationships/betaTesters`, {\n query,\n })\n}",
"function listAllBetaGroupsForBetaTester(api, id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an new array and deduplicate the years | function createUniqueArr(movArr) {
const uniqueArr = [];
movArr.map(element => {
if (!checkYear(element, uniqueArr)) {
uniqueArr.push({
year: element.year
});
}
})
return uniqueArr;
} | [
"removeYear(year) {\n for (let i = 0; i < this.tableInformation.dataset.length; i++) {\n let a = this.tableInformation.dataset[i];\n if (a.year === year) {\n this.tableInformation.dataset.splice(i, 1);\n i--;\n }\n }\n }",
"function n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that generates the initial coin flips (smallest length of the two substrings) | function firstFlips() {
var firstFlipsString = "";
for (var i = 0; i < minLength; i++) {
firstFlipsString += getFlipValue();
}
//console.log(firstFlipsString)
return (firstFlipsString);
} | [
"function headsTailsSubStrings(subString1, subString2)\r\n{\r\n var length1 = subString1.length;\r\n var length2 = subString2.length;\r\n var minLength = Math.min(length1, length2);\r\n var numberOfTests = 1000;\r\n var numbersOfString1 = 0;\r\n var numbersOfString2 = 0;\r\n\r\n //function that... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw State if each node represents a state. | drawState(){
if(this.getTracer().stateStructure && this.getNode(this.currentId)){
NodeStateService.process(this.getNode(this.currentId).state_variables);
}
} | [
"function paintState() {\n selectedState = d3.select(\"#state\").node().value;\n let stateID;\n data[dataRender].forEach((element) => {\n if (element.estado == selectedState) {\n stateID = `#${element.id}`;\n }\n });\n d3.selectAll(\".bars\").style(\"fill\", \"#02A196\");\n d3.select(stateID).style... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find tickets that match the criteria of the watcher | function findWatcherMatches(ticketRecord){
// console.log('findTicketMatches: called');
db.Watcher.findAll({
where: {
OrganizationId: ticketRecord.OrganizationId,
eventDate: ticketRecord.date
}
}).then(function(dbWatchers) {
cons... | [
"function findTicketMatches(watcherRecord){\n // console.log('findTicketMatches: called');\n\n db.Ticket.findAll({\n where: {\n OrganizationId: watcherRecord.OrganizationId,\n date: watcherRecord.eventDate\n }\n }).then(function(dbTickets) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setWireFromGateToConnector() This function is called to set a connection from a gate to a connector. We are passed the connector that we will be connecting the gate (selectedComp) to. We are also passed the start line and end line. We will make a wire (line) from the end point of the start line to the start point of th... | function setWireFromGateToConnector(connect, start, end, pluginNum) {
start = start.getPoints()[1]; // get the end point of the start line
end = end.getPoints()[0]; // get the start point of the end line
if (pluginNum == 1) points = getWirePoints3(start, end);
else points = getWirePoints(start, end); /... | [
"function setWireFromConnectorToGate(gate, start, end, plugoutNum, pluginNum) {\n\t\tstart = start.getPoints()[1];\t\t\t\t\t\t\t\t\t\t// get the end point of the start line\n\t\tend = end.getPoints()[0];\t\t\t\t\t\t\t\t\t\t\t// get the start point of the end line\n\t\t\n\t\t// if the plugoutNum of the connector is ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: scannerFail Triggers a failure of the scanner on the specified range of characters. | function scannerFail(why, start, end) {
throw { "description": why,
"start": start,
"end": end };
} | [
"function failAction(exitCode) {\n core.setFailed(`Scan finished with exit code: ${exitCode}. Please check output.`);\n}",
"function failFn () {\n stageStatusMap[ aliasStr ] = false;\n catchFn( arguments );\n }",
"function failFn () {\n stageStatusMap[ aliasStr ] = false;\n warnFn( arguments );\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts the toplevel bundle banner if specified. | function extractBannerIfConfigured() {
if (!bannerFile) {
return undefined;
}
let banner = fs.readFileSync(bannerFile, 'utf8');
if (stampDataFile) {
const versionTag = fs.readFileSync(stampDataFile, 'utf8')
.split('\n')
.find(s => s.startsWith('BUILD... | [
"function createBanner(pkg) {\n var banner = pkg.name + ' v' + pkg.version;\n if (pkg.homepage) {\n banner += ' - ' + pkg.homepage;\n }\n if (pkg.license) {\n banner += '\\n' + pkg.license + ' Licensed';\n }\n return banner;\n}",
"function createBanner(pkg) {\n let banner = `${pkg.name} v${pkg.versio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a DOMNode representing the first direct child node or `null` if the node has no children. | get firstChild() {
return this.childNodes[0] || null;
} | [
"get firstElementChild() {\n const children = this.childElements;\n return children.length > 0 ? children[0] : null;\n }",
"function getFirstChildElement(node){\n\t\tvar childNodes = node.childNodes;\n\t\tvar index = 0;\n\t\tvar countChildNodes = childNodes.length;\n\t\tdo {\n\t\t\tif (index>=cou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get course name, id, and code from a csv | function getCoursesFromCsv (csvLocation) {
// TODO Read Only ID from CSV, then get other info from an API Call to ensure accuracy
let course = d3.csvParse( fs.readFileSync(csvLocation, 'utf8'), (d) => {
return limitObjectKeys(d, outputKeys);
} );
delete course.columns;
... | [
"function convertCSV(csvString) {\n var data = d3.csvParse(csvString).map(course => {\n return course.ID;\n });\n return data;\n}",
"function parseCsvData(data) {\n // console.log(data);\n let parsedData = {};\n for (var i = 1; i < data.length; i++) {\n let cc = data[i][0]; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts the |data| from an URLsafe base64 encoded string to an ArrayBuffer holding the same information. | function fromBase64Url(data) {
var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')
.replace(/\-/g, '+')
.replace(/_/g, '/');
return toArrayBuffer(atob(input));
} | [
"function fromBase64(data) {\n const buffer = new Buffer.from(data, 'base64')\n\t// const buffer = new Buffer(data, 'base64')\n\n return buffer.toString('utf8')\n}",
"function getArrayBufferFromBase64String(base64String) {\n const binaryString = window.atob(base64String);\n const byteArray = new ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`remove` is a global convenience method that will remove any sprite, or an argument list of sprites, from its parent. | remove(...sprites) {
//Remove sprites that's aren't in an array
if (!(sprites[0] instanceof Array)) {
if (sprites.length > 1) {
sprites.forEach(sprite => {
sprite.parent.removeChild(sprite);
});
} else {
sprites[0].parent.removeChild(sprites[0]);
}
}
... | [
"remove(...sprites) {\n this.spriteUtilities.remove(...sprites);\n }",
"function removeSprite(sprite) {\n sprite.parent.removeChild(sprite);\n}",
"removeSprite() {\n if (!this.sprite) return;\n this.remove(this.sprite);\n this.sprite.destroy();\n }",
"function remove( s ) {\n var index = tem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes appointment from storage | removeAppointment() {
this.props.handleRemove(this);
AsyncStorage.removeItem("Appointment" + this.props.id);
} | [
"function deleteAppointment() {\n\n transition(\"DELETING\", true)\n \n // Async call to initiate cancel appointment\n props.cancelInterview(props.id).then((response) => {\n\n transition(\"EMPTY\")\n }).catch((err) => {\n\n transition(\"ERROR_DELETE\", true);\n });\n }",
"function r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to put robot data in array form in this.totalRobotData | insertRobotData(object) {
let array = Object.keys(object)
let array1 = []
for (let i = 0; i < array.length; i++) {
array1.push(object[array[i]])
}
this.totalRobotList.push(array1)
for (let i = 0; i < this.totalRobotList.length; i++) {
if (this.tota... | [
"function adjustData(){\n for (let i = 0; i < item.length; i++) {\n storedVotes[i] = Number(pollProducts[i].votes + totalVotesArray[i]);\n storedViews[i] = Number(pollProducts[i].views + totalViewsArray[i]);\n }\n // console.log('votes after adjust: ' + storedVotes);\n}",
"getRadarValue(data) {\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Comparison function that determines whether the 2nd pos object passed in is within "margin" degrees of pos1. | function isPos2WithinMarginOfPos1(pos1, pos2, margin) {
var lat1 = pos1.latitude;
var lat2 = pos2.latitude;
var long1 = pos1.longitude;
var long2 = pos2.longitude;
var maxLat = lat1 + margin;
var minLat = lat1 - margin;
var maxLong = long1 + margin;
var minLong = long1 - margin;
if (lat2 <= maxLat && lat2 ... | [
"function areEqual(pos1, pos2) {\n if (pos1 && pos1.length >= 2 && pos2 && pos2.length >= 2) {\n var offset = 1000000;\n return (Math.round(pos1[0] * offset) / offset) === (Math.round(pos2[0] * offset) / offset) &&\n (Math.round(pos1[1] * o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stringPolyfills polyfills for String prototype | static stringPolyfills() {
if ( !String.prototype.isEmpty ) {
String.prototype.isEmpty = function() {
return 0 === this.valueOf().length
}
}
if ( !String.prototype.isNumber ) {
String.prototype.isNumber = function() {
return !i... | [
"function String() {}",
"function string() {}",
"function Strings() {}",
"function patchStringPrototype () {\n String.prototype.getDirection = function() {\n return getDirection(this.valueOf());\n };\n }",
"function SafeString(string){this.string = string}",
"function extendString(helperName, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A helper function transforms the two input types to an instance of Tensor1D, so the return value can be fed directly into various TF.js Core functions. | function toArray1D(array) {
array = Array.isArray(array) ? new Float32Array(array) : array;
return tfjs_core_1.tensor1d(array);
} | [
"function toArray1D(array) {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return Object(_tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"tensor1d\"])(array);\n}",
"function toArray1D(array) {\n array = Array.isArray(array) ? new Float32Array(array) : array;\n return (0,_tens... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the heading background color every 5 seconds | function changeHeadingColor() {
document.getElementById("heading").style.backgroundColor = colors[colorIndex];
colorIndex = (colorIndex + 1) % colors.length; // Alternates the next heading background color.
} | [
"function headerColor() {\n //putting setInterval into global vaiable\n colorInterval = setInterval(function () {\n console.log(\"in headerColor function\");\n //initializing random int for color display\n let randomInt = Math.floor(Math.random() * headerColorArray.length);\n //using random int to pic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute the ongoings skills and reclculate status if needed | handleOnGoingSkills() {
let gameInstance = this;
for (let key in this.onGoingSkills) {
let skill = gameInstance.onGoingSkills[key];
let invoker = skill.invoker;
if (skill.isSelfBuff) {
gameInstance.toSend.push(invoker.name);
invoker.KE... | [
"function ExecuteSkill(skill, hero){\n \n switch (skill.name)\n {\n case \"Starch Strength\":\n preloads.Skill.StarchStrenghtActive = true;\n setTimeout(function(){\n preloads.Skill.StarchStrenghtActive = false;\n }, ski... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert from Javascript ISO Date format (20140725T07:00:00.000Z) to what Postgres is looking for (20140725 07:00:00) | function ISOtoPostgres(data) {
if (data) {
if (typeof data !== 'string')
data = data.toISOString();
// return date only. get rid of the time just for now
return data.slice(0, 10).replace('T', ' ');
} else {
return '__NULL__';
}
} | [
"javascriptDateObjectToISOString(date) {\n day = date.getDate().toString();\n day = ((day.length === 1) ? '0' + day : day); // add zero in front if necessary \n month = (date.getMonth() + 1).toString(); // +1 because .getMonth returns int 0-11\n month = ((month.length === 1) ? '0' + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Problem9: Write demethodize, a function that converts a method to a binary function. | function demethodize(func) {
return function(that, y) {
return func.call(that, y)
};
} | [
"function demethodize(protoMethod){\n return function(x,y){\n return protoMethod.call(x,y);\n };\n }",
"function demethodize(func) {\n return function(that, y) {\n return func.call(that, y);\n };\n}",
"function demethodize(fn) {\n return function(a, b) {\n return fn.call(a, b);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete an existing pokemonType by the unique ID using model.destroy() | delete(req, res) {
PokemonType.destroy({
where: {
id: req.params.id
}
})
.then((deletedRecords) => {
res.status(200).json(deletedRecords);
})
.catch((error) => {
res.status(500).json(error);
});
} | [
"static delete(pokemonId) {\n AppContainer.pokemons = AppContainer.pokemons.filter(pokemon => parseInt(pokemonId) !== pokemon.id)\n }",
"function removePokemon(element) {\n const pokemonID = parseInt(element.getAttribute(\"data-pokemon-id\"), 10);\n destroyPokemon(pokemonID);\n }",
"async del... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Title image with parallax effect | function initParallaxTitle(){
"use strict";
if(($j('.title').length > 0) && ($j('.touch').length === 0)){
if($j('.title.has_fixed_background').length){
var $background_size_width = parseInt($j('.title.has_fixed_background').css('background-size').match(/\d+/));
var title_holder_height = $j('.tit... | [
"function edgtfParallaxTitle() {\n\t\tvar parallaxBackground = $('.edgtf-title-holder.edgtf-bg-parallax');\n\t\t\n\t\tif (parallaxBackground.length > 0 && edgtf.windowWidth > 1024) {\n\t\t\tvar parallaxBackgroundWithZoomOut = parallaxBackground.hasClass('edgtf-bg-parallax-zoom-out'),\n\t\t\t\ttitleHeight = parseInt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the state when we're not in an email address | function stateNonEmailAddress(char) {
if (char === 'm') {
beginEmailMatch(1 /* Mailto */);
}
else if (localPartCharRegex.test(char)) {
beginEmailMatch();
}
} | [
"function stateNonEmailAddress(char) {\n if (localPartCharRegex.test(char)) {\n beginEmailAddress();\n }\n else {\n // not an email address character, continue\n }\n }",
"checkEmailForEDU() {\n\t\tvar res = this.state.email.substring... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the utxo with the biggest balance from an array of utxos. | function findBiggestUtxo(utxos) {
let largestAmount = 0
let largestIndex = 0
for (var i = 0; i < utxos.length; i++) {
const thisUtxo = utxos[i]
if (thisUtxo.satoshis > largestAmount) {
largestAmount = thisUtxo.satoshis
largestIndex = i
}
}
return utxos[largestIndex]
} | [
"findBiggestUtxo (utxos) {\n try {\n let largestAmount = 0\n let largestIndex = 0\n\n for (var i = 0; i < utxos.length; i++) {\n const thisUtxo = utxos[i]\n\n if (thisUtxo.value > largestAmount) {\n largestAmount = thisUtxo.value\n largestIndex = i\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints InterfaceDeclaration, prints node. | function InterfaceDeclaration(node, print) {
this.push("interface ");
this._interfaceish(node, print);
} | [
"function InterfaceDeclaration(node, print) {\n this.push(\"interface \");\n this._interfaceish(node, print);\n}",
"function _interfaceish(node, print) {\n\t print.plain(node.id);\n\t print.plain(node.typeParameters);\n\t if (node[\"extends\"].length) {\n\t this.push(\" extends \");\n\t print.join(node... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make a function with the JavaScript expression given as its body and $ as its only argument. The code is evaluated in strict mode. | function make_expr_fun(expr: string): Function {
return new Function('$', '"use strict"; return (' + expr + ')');
} | [
"function _v(expr) {\n\treturn 'function(_){return '+expr+'}';\n}",
"function FunctionExpression() {\n}",
"function scopeExprToFunc(expr) {\n /*jshint evil: true */\n var func = new Function(\"with (this) {return (\" + expr + \");}\");\n return function (scope) {\n return func.call(scope);\n };... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove from map all params with names from array namesOfParamsToRemove | function removeParams(map, namesOfParamsToRemove) {
for (var i in namesOfParamsToRemove) {
delete map[namesOfParamsToRemove[i]];
}
return map;
} | [
"function filterParams(map, namesOfParamsToFilter) {\n var filteredMap = clone(map);\n\n for (var paramName in map) {\n if (namesOfParamsToFilter.indexOf(paramName) == -1) {\n delete filteredMap[paramName];\n }\n }\n\n return filteredMap;\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the Y value using the gradient method. | function getY(d, i, j, x) {
var diy = d[i].y,
dix = d[i].x,
gradient = (d[j].y - diy) / (d[j].x - dix);
if (!_.isNumber(diy)) {
// The back-end returns "Nan" when it could not compute the
// value of a point (e.g., "select m1 / m2" and m2 is 0). We
// will return 0 here. Hoveri... | [
"get yValue() {\r\n return this.i.d;\r\n }",
"function Y(d) {\n return yscale(d[1]);\n }",
"function yY(d) {\n\t\t\treturn yScale(d[1]);\n\t\t}",
"function y(d) { return d.yVar; }",
"accumulate() {\n // delta this.output - target\n const gradient = this.source.output * this.targe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================================ delete existing course Note: 'double click' on delete button needn't to be handled second click runs on a not existing firebase path Firebase doesn't complain about this ... | function onDeleteCourse() {
'use strict';
if (lastCheckedCourse === -1) {
window.alert("Warning: No course selected !");
return;
}
var course = FirebaseCoursesModule.getCourse(lastCheckedCourse);
txtCourseToDelete.value = course.name;
dialogDelet... | [
"function removeCourseId() {\n $(\".removeCourse\").unbind().click(function(event) {\n course = event.currentTarget.attributes[0].nodeValue;\n \tdbRefUsers.child(user).child('courses').once('value', snap => {\n for(var key in snap.val()) {\n if (snap.val()[key].course == cours... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change map style to street | streetStyle() {
this.map.setStyle('mapbox://styles/mapbox/streets-v9');
this.load();
} | [
"streetStyle() {\n this.map.setStyle(this.styleStreet);\n this.markerLayerload();\n this.$store.state.styleMap = this.styleStreet;\n }",
"function styleMap() {\n var style = [\n {\n stylers: [\n {\n hue: \"#2c3e50\"\n },\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
input: string output: 2d array with highest frequency followed by sort character | function characterFrequency(str) {
//find frequency
let array = [];
let count = {};
for (let x = 0; x < str.length; x++) {
if (count[str[x]]) {
count[str[x]]++;
} else {
count[str[x]] = 1;
}
}
console.log(count);
//sort highest frequency, sort by charcater
//return in 2d array
... | [
"function highestFreq (str) {\n\t// Create an object displaying the character count for each character.\n \tlet count = str.split('').reduce((a,b) => {\n \ta[b] ? a[b] ++ : a[b] = 1;\n \treturn a;\n \t},{});\n \t// Reduce the keys of our count object\n \treturn Object.keys(count).reduce((a,b,c) => {\n \t\t// ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function draws the next blocks to the nextBlocksAreaCanvas | function drawNextBlocksArea() {
// let's draw the block
const c = document.getElementById("nextBlocksAreaCanvas");
const ctx = c.getContext("2d");
ctx.clearRect(0, 0, c.width, c.height);
for (let i = 0; i < gameLevelEnvironment.numberOfBlocksDisplayedInTheNextBlocksArea; i++) {... | [
"function drawNextBlock() {\n sidebarCtx.beginPath();\n for (var i = 0; i < nextBlock.size; i++) {\n sidebarCtx.drawImage(nextBlock.squares[i].img, \n nextBlock.squares[i].x - GRID_SIZE * 2, \n nextBlock.squares[i].y + GRID_SIZE * 2);\n } \n sidebarCtx.closePath();\n}",
"function drawNextBlock(){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populates the upper right 3x3 submatrix the given 4x4 (row major) TR matrix so that it represents the same rotation as this, leaving the final row and final column entirely untouched. | toRotMatRows3x4(m) {
//--------------
return RQ.setRotMatRows3x4FromQV(m, this.xyzw, false, false, false);
} | [
"function matrixRotation(matrix, r) {}",
"transpose() {\n let result = new Matrix(this.width, this.height);\n\n for (let i = 0; i < this.height; i++) {\n for (let j = 0; j < this.width; j++) {\n // current (i, j) position is (j, i) position in new Matrix\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given Twitter ID number and callback, feeds callback the array of tweets | function getTweets(idNum, callback, lastTweet, tweetsArray) {
//console.log("In get tweets. IdNum is :" + idNum);
if (!lastTweet) {
this.theLastTweet = null;
}
var params = getParam(lastTweet, idNum)
maxCalls++;
if (maxCalls<300) {
//can do 300 / 15mins wit... | [
"function tweets(tweet) { cb(tweet) }",
"function getAndManipulateTweets() {\n //searching tweets\n T.get('search/tweets', params, function(err, data, response) {\n //throw error message\n if (err) console.log(err);\n\n if (!err) {\n //get tweetId\n let tweets = data.statuses;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE: There's an extra requirement in the type signature of behClosure, much like behDisjoin and behMerge: The closure's parameter signal must be active in enough (partition, time offset) coordinates to act as a filter for the encapsulated signal. If the behavior is called conditionally (thanks to having been split thr... | function behClosure( beh ) {
var inputPairType = beh.inType;
if ( beh.inType.op !== "times" )
throw new Error();
var encapsulatedType = beh.inType.first;
var paramType = beh.inType.second;
if ( !typesSupplyActivityEvidence(
[ paramType ], encapsulatedType ) )
th... | [
"function behClosure( beh ) {\r\n var inputPairType = beh.inType;\r\n if ( beh.inType.op !== \"times\" )\r\n throw new Error();\r\n var encapsulatedType = beh.inType.first;\r\n var paramType = beh.inType.second;\r\n \r\n if ( !typesSupplyActivityEvidence(\r\n [ paramType ], encapsula... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if the stock passes all the C Tests | function allTests(stock, stocksAlert, stockDiffPctC) {
if (priorDayGreenTestC(stock) && priorDayRangeTest(stock, stockDiffPctC) && midPointTest(stock) && belowPriorDayTest(stock)) {
return true;
}
} | [
"function allTests(stock, stocksAlert, cfg) {\n if (volTestE(stock)) {\n return true;\n }\n }",
"function allTests(stock, stocksAlert, cfg) {\n console.log(stock);\n if (priorDayCandle(stock)) {\n return true;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by LUFileParsernestedIntentBodyDefinition. | enterNestedIntentBodyDefinition(ctx) {
} | [
"visitNestedIntentBodyDefinition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"enterNestedIntentNameLine(ctx) {\n\t}",
"enterNestedIntentSection(ctx) {\n\t}",
"exitNestedIntentBodyDefinition(ctx) {\n\t}",
"enterNestedIntentName(ctx) {\n\t}",
"enterIntentBody(ctx) {\n\t}",
"enterNormalIntentBody(ct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assocObject :: Trie > Object > Trie Given an object with keys and deltas return a new trie with the deltas applied to it. | function assocObject(trie, object) {
var keys = Keys(object)
for (var i = 0; i < keys.length; i++) {
var key = keys[i]
var value = object[key]
trie = assocValue(trie, key, value)
}
return trie
} | [
"function exchangeKeys(object, compress) {\n function getNewKey(oldKey, isArray) {\n if (isArray) return oldKey;\n return compress ? String.fromCharCode(FIELDS.get(oldKey).value) : FIELDS.get(oldKey.charCodeAt(0)).key;\n }\n\n function replaceKeys(key, oldOject, newObject, isArray) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE Convert to Base 10 if possible. If not, return NaN | function toBase10(number) {
var x = number.toLowerCase();
Logger.debug("x = " + x)
if (!x.startsWith('0b') && !x.startsWith('0x') && parseInt(x, 10).toString(10) == x.replace(/^0+/, '')) {
Logger.debug('>>> Base 10: ' + parseInt(x, 10).toString(10) + ' = ' + x);
return parseInt(x, 10);
} else if (x.st... | [
"toBase10() {\r\n return this.base10Val;\r\n }",
"function convertToBase10(string) {\n if (parseInt(string, 10)) {\n return parseInt(string, 10);\n } else if (string === '0' || string === '1') {\n return NaN;\n } else if (string.startsWith('0b') && parseInt(string.substr(2), 2)) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the garden status. | async displayGarden(channel) {
let embed = new Discord.RichEmbed();
let garden = await sql.getGarden(channel);
embed.setTitle('The Garden')
.setColor(0x00AE86);
let plants = garden.plants.map(p => this.getPlantStatus(p));
let plantStatus = '';
for(let i = 0; i < 3; i++) {
plantStatus += `Plant #${... | [
"function displayStatus() {\n Reddcoin.messenger.getconnectionState(function(data){\n Reddcoin.viewWalletStatus.getView(data);\n\n Reddcoin.messenger.getReleaseVersion( function(data) {\n Reddcoin.viewWalletStatus.getView(data);\n });\n });\n}",
"_displayStatus() {\n\t\t// TO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Additionally, the "level_start" and "level_end" select menus will be used to control which table rows are highlighted, and only the highlighted rows will be included when calculating the totals. We are using a more bruteforce approach in this app than we did for the Stardew PPJA reference because we know this table is ... | function updateRows(e) {
// Prepare some varables (total gold and total scrolls for each situation)
var totals = [0, 0, 0, 0, 0, 0, 0, 0];
var e_start = document.getElementById("level_start");
var val_start = e_start.options[e_start.selectedIndex].value;
var e_end = document.getElementById("level_end");
var... | [
"function gotoLevel(){\n\t\tmodalScrollControl =1;\n\t\tcrntY = window.scrollY;\n\t\tcrntX = window.scrollX;\n\t\tvar levelInput = document.getElementById(\"vGoto\");\n\t\tvar displayCon = document.querySelector(\".vGridToolDisplay table tbody\");\n\t\tvar level = levelInput.value;\n\t\tvar baseHeight = height;\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detaches label from object | _detachLabel () {
this._label && this._label.detachFromObject();
} | [
"removeLabel() {\n this._label = null;\n }",
"removeLabel(label) {\n // remove 3d object\n this.remove(label);\n\n // remove dom label\n this.domElements.labels.dom.removeChild(label.content);\n }",
"_destroyLabel () {\n this._label && this._label.dispose();\n }",
"unsel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the minDistance between target and exit | function GetMinDistance(targetRow, targetCol) {
return Math.abs(exitRow - targetRow) + Math.abs((exitCol - targetCol));
} | [
"get minDistance () {\n return this.__dMinimum\n }",
"getDistance(x, y, target){\n let hDiffernce = Math.abs(target.x - x);\n let yDifference = Math.abs(target.y - y);\n\n let min = Math.min(hDiffernce, yDifference);\n\n //Using Diagnal Distance and Biasing the h value of each squa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get product in stock tag element | getProductInStockTag() {
return cy.get("#availability > span");
} | [
"function getPriceByProduct(itemNode){\n var productPrice = itemNode.getElementsByClassName('unit-cost')[0].innerHTML;\n \n return productPrice;\n}",
"function getActiveProduct(){\n var activeProduct = $('[data-active-product]').data('active-product');\n return site.context.activeVariant;\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes any diagnostics in otherDiagnostics, where there is a diagnostic in buildDiagnostics on the same line. | function deDupeDiagnostics(buildDiagnostics, otherDiagnostics) {
const buildDiagnosticsLines = buildDiagnostics.map((x) => x.range.start.line);
return otherDiagnostics.filter((x) => buildDiagnosticsLines.indexOf(x.range.start.line) === -1);
} | [
"getDiagnostics() {\n //combine all remaining diagnostics\n let finalDiagnostics = [];\n for (let key in this.byFile) {\n let fileDiagnostics = this.byFile[key];\n for (let diagnostic of fileDiagnostics) {\n if (finalDiagnostics.includes(diagnostic)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ID of port as defined in Port | get portId() {
return this.data[3];
} | [
"function setPortId(id) {\n\t\tthis.id = PORT + id + this.ne.id;\n\t}",
"function getTabId( port ) {\n return port.name.substring( port.name.indexOf( \"-\" ) + 1 );\n }",
"function getProcessIdOnPort(port) {\n return child_process_1.execSync(`lsof -i:${port} -P -t -sTCP:LISTEN`, execOptions)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fromRau is a function to convert Rau to Iotx. | function fromRau(rau, unit) {
return convert(rau, unit, "div");
} | [
"function toRau(num, unit) {\n return convert(num, unit, \"multipliedBy\");\n}",
"static convertFromMetersToAU(r){\r\n\t\tlet t=new Array();\r\n\t\t\r\n\t\tt[0]=r[0]/1.49597870691E+11;\r\n\t\tt[1]=r[1]/1.49597870691E+11;\r\n\t\tt[2]=r[2]/1.49597870691E+11;\r\n\t\t\r\n\t\treturn t;\r\n\t}",
"toRIFX() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INNER METHODS Synchronizes all location object properties. User is allowed to change properties, so after property change, location object is not in consistent state. Properties are synced with the following precedence order: `$location.href` `$location.hash` everything else | function sync() {
if (!equals(location, lastLocation)) {
if (location.href != lastLocation.href) {
update(location.href);
return;
}
if (location.hash != lastLocation.hash) {
var hash = parseHash(location.hash);
updateHash(hash.hashPath, hash.hashSearch);
} els... | [
"_setLocation(location){\n this.location = location;\n this.notify(UpdateMessage.Relocated);\n }",
"set location(location){\n this._location = location\n }",
"updateLocation(newLocation) {\n this.location = newLocation;\n }",
"set location(value){\n this._location =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Passes each child to a function, breaking when the function returns `false`. | eachChild(func) {
var attr, child, j, k, len1, len2, ref1, ref2;
if (!this.children) {
return this;
}
ref1 = this.children;
for (j = 0, len1 = ref1.length; j < len1; j++) {
attr = ref1[j];
if (this[attr]) {
ref2 = flatten([this[attr]]);
for (k = 0, len2... | [
"eachChild(func) {\n var attr, child, j, k, len1, len2, ref1, ref2;\n if (!this.children) {\n return this;\n }\n ref1 = this.children;\n for (j = 0, len1 = ref1.length; j < len1; j++) {\n attr = ref1[j];\n if (this[attr]) {\n ref2 = flatten([t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checking if url matches given route pattern | isMatch(url, routePattern) {
routePattern = "^" + routePattern + "$";
return (new RegExp(routePattern.trimAll("/").replaceAll("(<(.+?)>)", "(.+?)"))).test(url.trimAll("/"));
} | [
"static match(route, req) {\n return (req.url == route);\n }",
"matchesRoute(route) {\n const path = this.getAttribute(\"path\");\n const isDefault = this.isDefault();\n const isExact = path === route;\n const isPartial = route.startsWith(path) && this.childMatchesRoute(route.slice(path.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for changing the league select | function selectLeague(e){
var allowed = [500, 1500, 2500, 10000];
var cp = parseInt($(".league-select option:selected").val());
var levelCap = parseInt($(".league-select option:selected").attr("level-cap"));
if(allowed.indexOf(cp) > -1){
battle.setCP(cp);
battle.setLevelCap(levelCap);
/... | [
"function selectLeague(e){\n\t\t\t\tvar vals = $(\".league-cup-select option:selected\").val().split(\" \");\n\t\t\t\tvar cp = vals[0];\n\t\t\t\tvar cup = vals[1];\n\n\t\t\t\tbattle.setCP(cp);\n\t\t\t\tbattle.setCup(cup);\n\n\t\t\t\tif(! battle.getCup().levelCap){\n\t\t\t\t\tbattle.setLevelCap(50);\n\t\t\t\t}\n\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signals that the |player| has won. They will be removed from the game. | async playerWon(player, score) { await this.#runtime_.playerWon(player, score); } | [
"function __playerWon(player) {\n var playerScores = [], winningPlayer, lostPlayers = [];\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i],\n playerScore = p.getScore();\n\n if (p === player) {\n playerScore++;\n }\n\n playerScores.pus... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to create a basket | function basket() {
var base = CUBOID([1, 1, 0.1]);
var rodsbase = T([0,1])([0.02,0.02])(STRUCT(REPLICA(7)([tubeLittle(0.02, 0.9), T([0])([0.16])])));
var rodsVtmp = ROTATE([2,0])(PI/2)(tubeLittle(0.02, 1));
var rodsbase2 = T([1,2])([0.02,0.24])(STRUCT(REPLICA(5)([rodsVtmp, T([2])([0.16])])));
var rods1 = STRUCT([... | [
"addItem(values) {\n basket.push(values);\n }",
"function CreateBasket() {\n var scriptResult = Transaction.wrap(function() {\n return CreateBasketForCustomer.createBasket(session.customer);\n });\n scriptResult ? ISML.renderTemplate('responses/json', {\n JSONResponse : {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function takes an event ID and displays information about attending hiring partners and any attendees associated with a given event | async function displayHiringPartnersAttending(event){
let data = {
event_id: event.id
}
let hiringPartnersDiv = document.querySelector(`.hiring-partners[data-eventId='${event.id}']`)
fetch('./api/getHpsByEventId', {
credentials: 'same-origin',
headers: {
'Accept': '... | [
"function displayAttendees () {\n\t\tvar id = 0;\n\n\t\tattendees.forEach(function(attendee) {\n\t\t\tvar formattedAttendeeCard = HTMLattendeeCard.replace('%attendeeID%', id).replace('%avatar%', attendee.avatar).replace(/%name%/g, attendee.name)\n\t\t\t\t\t\t\t\t\t\t.replace(/%occupation%/g, attendee.occupation).re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |