query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Returns the number of decimal digits for the given currency. Its value depends upon the presence of cents in that particular currency. | function getNumberOfCurrencyDigits(code) {
var digits;
var currency = CURRENCIES_EN[code];
if (currency) {
digits = currency[2 /* NbOfDigits */];
}
return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
} | [
"static getDecimalDigits(currency) {\n if (global.companyData.common.currencies != undefined) {\n let objCurrency = global.companyData.common.currencies.filter(currencyConfig => currencyConfig.code == currency);\n if (objCurrency.length > 0)\n return objCurrency[0].decima... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
action to be done when ajaxcall to save protocolentry finished | function protocolEntrySaved(data) {
checkAjaxResult(data);
enableInput(true);
$("#invid").val("-1");
$("#inventory,#price").val("");
loadProtocolList();
loadProtocolSumList();
loadInventoryList();
} | [
"function saveProtocolEntry() {\r\n clearErrors();\r\n var dataToSend = prepareDataForAddProtocolEntry();\r\n if(dataToSend == null) {\r\n return;\r\n }\r\n enableInput(false);\r\n execAjax(dataToSend, protocolEntrySaved);\r\n loadProtocolList();\r\n }",
"function prot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the next and previous SCO. | function calculateNextAndPreviousSco(scoId) {
$scope.previousSco = $mmaModScormHelper.getPreviousScoFromToc($scope.toc, scoId);
$scope.nextSco = $mmaModScormHelper.getNextScoFromToc($scope.toc, scoId);
} | [
"calculateTravelCost(previous, next) {\n if (next.row !== previous.row && next.col !== previous.col) {\n return 14;\n }\n return 10;\n }",
"function calcSpeed(prev, next) {\n\n var x = Math.abs(prev[1] - next[1]);\n var y = Math.abs(prev[0] - next[0]);\n\n var greatest = x > y ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A recursive function to search the javascript object/array looking for the first instance of the provided name use with caution | function searchObject(obj, name)
{
var k;
if (_.isObject(obj) || _.isArray(obj)) {
if (obj.hasOwnProperty(name)) {
return obj[name];
}
for (k in obj) {
var result = searchObject(obj[k], name);
if (result) return result;
}
}
} | [
"function select(array, name){\n\tfor(var i = 0; i<array.length; i++){\n\t\tif(array[i][\"name\"] == name){\n\t\t\treturn array[i];\n\t\t}else{\n\t\t\tcontinue;\n\t\t}\n\t}\n\treturn false;\n}",
"function getPerson(name){\r\n let peopleList = filter_people(name, people)\r\n if(peopleList.length === 0){\r\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONDITIONAL EXPRESSIONS conditional expressions are tagged with "conditional_expression" | function is_conditional_expression(stmt) {
return is_tagged_list(stmt,
"conditional_expression");
} | [
"enterConditionalOrExpression(ctx) {\n\t}",
"function conditional(){\n disjunction();\n if (globalTP < tokens.length && (tokens[globalTP] == \"bicond\" || tokens[globalTP] == \"cond\")){\n globalTP+=1;\n disjunction();\n }\n}",
"function analyze_conditional_expression(stmt) {\n\n const pred_func = a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawBackgroundText() put in a text display to subtly show the player the controls its not obvious, which is on purpose as its not always easy to know what to do in public | function drawBackgroundText() {
textSize(24);
fill(255);
textFont(promptFont);
text("<-- Brandish Your Mask -->", 50, 50);
} | [
"function drawPausePopup(){\n ctx.fillStyle = menu.background.color;\n ctx.fillRect(gameWindow.x,gameWindow.y,200,70);\n\n ctx.strokeStyle = menu.borderColor;\n ctx.lineWidth = menu.borderWidth;\n ctx.strokeRect(gameWindow.x,gameWindow.y,200,70);\n\n var pauseText = new Text(gameWindow.x+20,game... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pass this the action string, and the hiddenform will be submitted | function submitForm(actionStr) {
var formObj = document.hiddenform;
formObj.action = actionStr;
formObj.outerScroll.value = YAHOO.util.Dom.getDocumentScrollTop();
if (document.getElementById('divContScroll')) {
formObj.innerScroll.value = document.getElementById('divContScroll').scrollTop;
}... | [
"function submitForm(formid, task) {\n // get the form\n var f = $(formid);\n // set the action\n if(task && task != '') {\n f.action.value = task\n }\n f.submit();\n}",
"function ir_a_carga_masiva(){\n document.getElementById('frm_add_planeacion').actio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shows a spinner during accessibility analysis calculation | function showSearchingAtAccessibility(showSpinner) {
if (showSpinner) {
$('#accessibilityCalculation').show();
} else {
$('#accessibilityCalculation').hide();
$('#removeAccessibility').show();
}
} | [
"loadSpinner(display){\n document.querySelector(\".contenido-spinner\").style.display = display;\n document.querySelector(\"#resultado\").style.display = \"none\";\n }",
"function showSpinner() {\n $(options.selectors.placesContent).addClass('hidden');\n $(options.selectors.spinner).remo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for putV3ProjectsIdServicesHipchat | putV3ProjectsIdServicesHipchat(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKey = 'YOU... | [
"putV3ProjectsIdServicesIrker(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the given query with the order by statement appended to it. | function getOrderBy(query)
{
var orderBy = "";
var doOrder = false;
if(getProperty(propSortSelected) == "true")
{
doOrder = true;
if(orderBy.length > 0)
{
orderBy += ", ";
}
orderBy += SORT_SELECTED;
}
if(getProperty(propSort) == "... | [
"visitOrder_by_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"order(fields) {\n fields = Array.isArray(fields) && arguments.length === 1 ? fields : Array.prototype.slice.call(arguments);\n fields = this.statement().dialect().prefix(fields, this.alias());\n this.statement().order(fields);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fires a "pick" after a timeout period unless clearPickTimer is called before then. | function startPickTimer() {
if (pickTimer) {
clearPickTimer();
}
pickTimer = setTimeout(function () {
pickClicks = 0;
self.fire("pick", pickHit);
pickTimer = null;
}, 250);
... | [
"function delay() {\n const t = calculateDelay(selection.q.length) * 1000;\n setTimeout(function() {\n timerStart();\n }, t);\n}",
"setBakingTime() {}",
"function delay(){\n\tsetTimeout(makeShapeAppear, Math.random() * 2000);\n}",
"onTimeOut() {\n if (this.exhausted) {\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if form is submitting to secure server | function formIsInsecure(form) {
var action = form.getAttribute('action');
if ( action == null ) return false;
return ( action.substr(0, 8) !== 'https://' );
} | [
"function checkAgencyForm() {\n var cansubmit = true;\n\n // Check agency name\n if ($('#agency').val() === '')\n cansubmit = false;\n\n // Enable/disable submit button\n disableAgencySubmit(!cansubmit);\n}",
"function checkAttendeeForm() {\n var canSubmit = true;\n\n // Check first na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a background image to a plot (e.g., for the CMD) | addImageToPlot(plotObj, backgroundImage){
var main = plotObj.plot.select(".main"),
rect = plotObj.plot.select("defs").select(".clipPathMain").select("rect");
var width = parseFloat(rect.attr("width")),
height = parseFloat(rect.attr("height")),
left = parseFloat(rect.attr("x")),
top = parseFloat(rect.... | [
"function createBackground() {\n var background = this.add.image(256, 256, \"background\");\n background.setScale(2.2, 2.5);\n}",
"function drawBackground() {\n image(imgBackground, width / 2, height / 2); // dimensions: 100 X 56\n\n // table for tray\n rectMode(CORNER);\n fill(\"#B8F4FA\"); // light b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The following function gets the elements with class 'fullSizeImage', and loops through all the images with the class and blocking every image with a n value higher or lower than the one which is currently the 'images' value. [images1] is necessary since images starts at 1 and the loop starts at 0. | function full_image (n) {
var full_size = document.getElementsByClassName('fullSizeImage')
if(images <= 0) {
images = 1
return
}
if(images > image_gallery.length) {
images = image_gallery.length
return
}
if (n > full_size.length) {
}
if (n < 1) {
}
... | [
"function current_image(n) {\n full_image(images = n);\n}",
"function findAsyncImages(){\n var asyncImageHolders = document.getElementsByClassName(asyncImgClasses.asyncImgHolder);\n for(var q = 0; q < asyncImageHolders.length; q++){\n var asyncWrap = asyncImageHolders[q];\n // Get img data\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compute the points inside a given cube | function getPointsInCubeSparse(index, object, grid){
// var points = {
// index : [],
// gridIndex: [],
// };
var points_index = [];
var vertices = plyParticles.geometry.vertices;
var bbox = object.geometry.boundingBox;
var numVertice;
// for debugging
label_color_list = new Array(vertices.length);
// ne... | [
"function getPointsInCube(pos, object, grid){\n\tvar points = {\n\t\tindex : [],\n\t\tgridIndex: [],\n\t};\n\tvar bbox = object.geometry.boundingBox;\n\tfor( var v = 0, vl = pos.length; v < vl; v++ ) {\n\t\tvar local_pos = object.worldToLocal(pos[v]); \n\t\tif (local_pos.x<bbox.max.x && local_pos.x>bbox.min.x &&\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the browser's settings (e.g. extension's toolbar icon/title) for the current active tab without inverting its existing Javascript setting. | async function setToolbarForCurrentTab() {
await setForCurrentTab(false);
} | [
"_initProperties () {\n this.activeTab = null\n }",
"function assignBaseSettings(tabs, callback) {\n\tfor(var i = 0;i<tabs.length;i++){\n\t\ttabs[i].reload = (tabs[i].reload || settings.reload);\n\t\ttabs[i].seconds = (tabs[i].seconds || settings.seconds);\t\n\t};\n\tcallback(tabs);\n}",
"function a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an instance of NgxSpinnerService. | function NgxSpinnerService() {
/**
* Spinner observable
*
* \@memberof NgxSpinnerService
*/
this.spinnerObservable = new rxjs__WEBPACK_IMPORTED_MODULE_1__["ReplaySubject"](1);
} | [
"startSpinner() {\n if (this.viewports && this.viewports.length > 0) {\n this.viewports[0].startSpinner()\n }\n }",
"function demoFineCoarseSpinner( layoutBounds, options ) {\n\n const numberProperty = new NumberProperty( 0, {\n range: new Range( 0, 100 ),\n tandem: options.tand... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the key from the node's nearest offsetaware ancestor. | function findAncestorOffsetKey(node) {
var searchNode = node;
while (searchNode && searchNode !== document.documentElement) {
var key = getSelectionOffsetKeyForNode(searchNode);
if (key != null) {
return key;
}
searchNode = searchNode.parentNode;
}
return null;
} | [
"rightAncestor (node) {\r\n let parent = node.parent\r\n let currNode = node\r\n while (parent && parent.key < currNode.key) {\r\n parent = parent.parent\r\n currNode = currNode.parent\r\n }\r\n return parent\r\n }",
"nodeOffset(blockOffset, isFocusOffset) {\n isFocusOffset = isFocusO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets all values in the given array to zero and returns it. The fact that it sets bytes to zero can be relied on. There is no guarantee that this function makes data disappear from memory, as runtime implementation can, for example, have copying garbage collector that will make copies of sensitive data before we wipe it... | function wipe(array) {
// Right now it's similar to array.fill(0). If it turns
// out that runtimes optimize this call away, maybe
// we can try something else.
for (let i = 0; i < array.length; i++) {
array[i] = 0;
}
return array;
} | [
"function clear(array, start, stop) {\n if (start === void 0) { start = 0; }\n updateRange(array, null, start, stop);\n}",
"function fillReusableMemoryWithZeroes() {\n if (reusableWasmMemory) {\n var arr = new Uint8Array(reusableWasmMemory.buffer);\n arr.fill(0);\n }\n}",
"function zer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subtest for test_other_lang_link_hides that just waits for the provider list to be loaded, and then ensures that the "show me providers in other languages" link is not visible. | function subtest_other_lang_link_hides(w) {
wait_for_provider_list_loaded(w);
wait_for_element_invisible(w, "otherLangDesc");
} | [
"function subtest_can_display_providers_in_other_languages(w) {\n wait_for_provider_list_loaded(w);\n\n // Check that the \"Other languages\" div is hidden\n wait_for_element_visible(w, \"otherLangDesc\");\n let otherLanguages = w.window.document.querySelectorAll(\".otherLanguage\");\n for (let element of othe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an agent to a transaction edit form. Assumes the presence of an input numAgents holding a count of the number of agents in the transaction. Assumes the presence of an html table with an id loanAgents, to which the new agent line is added as the last row. | function addTransAgentToForm (id,name,role,formid) {
if (typeof id == "undefined") {
id = "";
}
if (typeof name == "undefined") {
name = "";
}
if (typeof role == "undefined") {
role = "";
}
jQuery.getJSON("/component/functions.cfc",
{
method : "getTrans_agent_role",
returnformat : "... | [
"function addAgency() {\n\tlocation = \"EditPage.php?mode=add&what=agency\";\n}",
"function agregarInvitado(){\r\n\t\tvar tablaLength = obtenTablaLength(\"invitado_table\");\r\n\t\tvar id = tablaLength+1;\r\n\t\tvar objeto = generaObjetoInvitados();\r\n\t\tvar renglon = creaRenglonInvitados(objeto, id);\r\n\t\tag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
WaitStatus() Purpose: 1.Wait signal in status bar. | function WaitStatus()
{
window.status = " ";
} | [
"function BAStatusMsg() {\n\t/** element node not needed.\n\t @type BAElement @private */\n\tthis.node = window.defaultStatus || '';\n\t/** default message of window.status.\n\t @type String @private */\n\tthis.msg = '';\n\t/** default message of window.status.\n\t @type String @private */... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function getBases(void): list Return a list containing all of the base stat input elements | function getBases()
{
return [
parseInt(document.getElementById('hp-base').value),
parseInt(document.getElementById('atk-base').value),
parseInt(document.getElementById('def-base').value),
parseInt(document.getElementById('spa-base').value),
parseInt(document.getElementById('spd-base').value),
parseInt(doc... | [
"getBaseTypes() {\r\n return this.getType().getBaseTypes();\r\n }",
"getBase(statEnum){\n verifyType(statEnum, TYPES.number);\n return this.stats.get(statEnum).getBase();\n }",
"function getAllUnits(){\r\n var townArray = uw.ITowns.getTowns(), groupArray = uw.ITowns.townGroups.getG... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resize current tab to be new left half tab and create new right window | function resize(win) {
prevWindow = win;
tabCount = win.tabs.length;
var screenWidth = window.screen.availWidth;
var screenHeight = window.screen.availHeight;
var leftWindow = {
left: 0,
top: 0,
width: screenWidth / 2,
height: screenHeight
};
var rig... | [
"replaceTabsWithWindow(contextTab, aOptions) {\n let tabs;\n if (contextTab.multiselected) {\n tabs = this.selectedTabs;\n } else {\n tabs = [contextTab];\n }\n\n if (this.tabs.length == tabs.length) {\n return null;\n }\n\n if (tabs.length == 1) {\n return this.replaceTabWi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get entries within an element (with tag name 'entry'), adds an `each` function | function entries() {
var each = function each(callback) {
for (var i = 0; i < this.length; i++) {
callback(this[i]);
}
};
var els = this.elsByTag('entry');
els.each = each;
return els;
} | [
"function processEntries(response) {\n\t\tfor (i=0; i<response[1].length; i++) {\n\t\t\tvar title = response[1][i];\n\t\t\tvar description = response[2][i];\n\t\t\tvar link = response[3][i];\n\t\t\t//creates new object with current article title, desc and link\n\t\t\tvar thisArticle = new createEntry(title, descrip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
override the slideNext method to add the fade effect | slideNext() {
super.slideNext();
this.slides[this.lastSlide].style.opacity = 0;
this.slides[this._index].style.opacity = 1;
} | [
"performSlide() {\n if (this.prevSlide) {\n this.prevSlide.removeClass('prev fade-out')\n }\n\n this.nextSlide.removeClass('next');\n this.prevSlide = this.nextSlide;\n this.prevSlide.addClass('prev');\n\n this.currentIndex++;\n if (this.currentIndex >= th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hides all speech paragraphs except first, adds a "read more" button | function hideP(speech){
$('#' + speech.author + ' p:not(:first)').hide();
$('#' + speech.author + ' p:first').after('<div class="more"><i class="fa fa-sort-desc"></i> <span>read more</span> <i class="fa fa-sort-desc"></i></div>');
} | [
"function clickMore(speech){\n $moreBtn = $('#' + speech.author + ' .more');\n $moreBtn.click(function(){\n $(this).hide();\n $('#' + speech.author + ' p:not(:first)').fadeIn(800);\n })\n }",
"function onLearnMoreClick(){\n $('#learnmoretext').slideDown();\n $('.learnmore').hide(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when load changepass.php popup complete | function setup_changepass(){
$("#alpha_background").show();
$("#btn_changepass_cancel").click(function(){
$("#alpha_background").hide();
$("#editprofile_popup").hide();
});
$("#btn_changepass_ok").click(function(){
$("#changepass_form").valid();
send_changepass();
});
... | [
"function cpsh_onTryAgain(evt) {\n evt.preventDefault();\n pin.focus();\n authFailureConfirmDialog.hidden = true;\n }",
"function askForPassword() {\n hideMenu();\n $(\"#imbaPasswordPrompt\").dialog(\"open\");\n $(\"#imbaPasswordPromptInput\").focus();\n}",
"function showPass() {\n const pas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LodLiveProfile constructor Not sure this is even necessary, a basic object should suffice I don't think it adds any features or logic | function LodLiveProfile() {
} | [
"constructor(userProfileObj){\n this._user = userProfileObj.user || userProfileObj._user || {};\n this._userConnections = userProfileObj.userConnections || userProfileObj._userConnections || []; \n }",
"toProfile(profile) {\n return { \"name\": profile.name, \"id\": profile.uuid, \"_ms... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the event receivers attached to this list | get eventReceivers() {
return SPCollection(this, "EventReceivers");
} | [
"getAllEvents(objectInstance) {\n if (!objectInstance) {\n return [];\n }\n let prototype = Object.getPrototypeOf(objectInstance);\n return prototype._espDecoratorMetadata\n ? prototype._espDecoratorMetadata._events\n : [];\n }",
"broadcastEvents() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
once abis for each action have been gathered, some processing must be done to get and return each contract | async function getContractsFlow(abiTypePairList){
try {
let contractList = [];
//iterate through each abi/type pairing and pass it to getContract helper function
for (let i = 0; i < abiTypePairList.length; i++){
getContract(abiTypePairList[i].abi, abiTypePairList[i].type... | [
"function GetLastActionData(req, callback) {\n\tcontractInfo.getContractInfo(req.params.contractAddress,(err,doc)=>{\n\t\tvar json = [];\n\t\tif(err){\n\t\t\tcallback(null,json);\n\t\t} else if (doc !== null) {\n trycatch(function() {\n var abiJson = JSON.parse(doc.abi);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns XPath node of the first form on page, or null if no form. | function getFormNode(doc)
{
var tag;
tag = find(".//form", XPFirst, doc);
if (tag == null)
return null;
return tag;
} | [
"function getFormElem() {\r\n\t\treturn _self.form.getFormElem();\r\n\t}",
"function first() {\n return _navigationStack[0];\n }",
"function getFormElement(frm,fldname, fieldType)\n{\n var returnMe = null;\n if ( frm != null )\n {\n if ( fldname == 'language' || (!isBackend && (f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
go to any of the common entityrelated modules from any page | function goToEntityModule(module, pk, entityName, entityType) {
var url = "?pk=" + pk +
"&entityName=" + encodeURIComponent(entityName) +
"&entityType=" + entityType;
if (module == 'address') {
// Go to the address page.
url = "ciAddressList.do" + url;
setWindowLoc... | [
"changeStep() {\n window.location.assign('#/eventmgmt/shop');\n }",
"function iglooActions () {\n\t//we should have things like pageTitle, user and revid\n\t//here- and the current page\n}",
"function _page2_page() {\n}",
"function cisEntityFolderIsOkToChangePages(id, url) {\r\n // contact tab pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
THIS FUCNTION WILL GO THROUGH THE LIST OF TASKS AND DELETE THE TASK AT POSITION GIVEN | function deleteTask(){
//DECLARE THE VARIABLE FOR THE POSITION OF THE TASK TO BE REMOVED
var position;
//LOOP THROUGH, GET POSITION, SPLICE FROM LIST
for(var i = 0; i < this.tasks.length; i++){
if(this.tasks[i]._id == id){
position = this.tasks[i].position;
... | [
"function deleteTask(){\n // get indx of tasks\n let mainTaskIndx = tasksIndxOf(delTask['colName'], delTask['taskId']);\n // del item\n tasks.splice(mainTaskIndx, 1);\n // close modal\n closeModal();\n // update board\n updateBoard();\n // update backend\n updateTasksBackend();\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show either the left or the right hint arrow based on the position of the ball as opposed to the correct answer | function showArrowHint(X,Y,answer){
//if the answer is less than the current location, show the left arrow
if (Y > answer){
var left = parseInt($("#blackarrowleft").css("margin-left"));
var width = parseInt($("#blackarrowleft").css("width"));
var newLeft = left + (Y - left) - width;
//does the arro... | [
"function showDenominatorHint(answer){\n\n\tvar decimalvalue;\n\tvar answer;\n\tvar showHint = 0;\n\t\n\tvar denom = currentProblem.denominator;\n\tvar numer = currentProblem.numerator;\n\t\n\t//if already present then return\n\tif (isScaffolded){\n\t\treturn;\n\t}\n\t\n\tif (denom == 0) {\n\t\t//alert(\"denom 0 2\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send TCP (actually sent to udptcpbridge.py via UDP, which relays the message to the IoT device via reliable TCP connection) | function send_tcp(addr, path, args) {
var toks = addr.split('.');
if (toks[toks.length-1] == '255') {
for (var dev_id in dev_dict) {
if (dev_dict.hasOwnProperty(dev_id)) {
for (var node_id in dev_dict[dev_id]) {
if (dev_dict[dev_id].hasOwnProperty(node_id))
send_tcp(dev_dict[dev_id][nod... | [
"function sendOSCMessage(clientIP, ip, port, addressp, type, value) {\n var msg = {\n address: addressp,\n args: [\n {\n type: type,\n value: value,\n },\n ],\n };\n console.log(\"Sending message\", msg.address, msg.args, \"to\", ip + \":\" + port);\n\n if (ip == \"localhost\") ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[ Constructors ] Creates an instance of Ubject. | constructor() {
super();
this.__avaliable = true;
this.__instanceID = Ubject.__nextInstanceID++;
this._uuid = Graphic_1.GL.Math.generateUUID();
Ubject.__ubjects[this._uuid] = this;
} | [
"function VaporObject(name) {\n if (typeof name === \"undefined\") { name = \"VaporObject\"; }\n this.Name = name;\n }",
"constructor() { \n \n InlineObject3.initialize(this);\n }",
"function Universe() {\n\n\t// the cached instance\n\tvar instance = this;\n\n\t// p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes all scheduled jobs for these temporal constraints. | function deleteJobsForConstraints(constraints) {
for (index in constraints) {
deleteJobsForConstraint(index);
}
} | [
"function manageTemporalConstraintJobs() {\n switch (request.method) {\n case \"create\":\n if (hasConstraints(newObject)) {\n createJobsForConstraints(newObject.temporalConstraints);\n }\n break;\n case \"patch\":\n case \"update\":\n if (hasConstraints(newObject... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that if an item is selected before decorate is called, the selection is preserved after decorate. | function testSetSelectedItemBeforeRender() {
select.addItem(new goog.ui.MenuItem('item 1'));
select.addItem(new goog.ui.MenuItem('item 2'));
var item3 = new goog.ui.MenuItem('item 3');
select.addItem(item3);
select.setSelectedItem(item3);
assertEquals(2, select.getSelectedIndex());
select.decorate(sandbo... | [
"function testSelectionIsClearedWhenSelectedItemIsRemoved() {\n select.render(sandboxEl);\n var item1 = new goog.ui.MenuItem('item 1');\n select.addItem(item1);\n select.addItem(new goog.ui.MenuItem('item 2'));\n\n select.setSelectedItem(item1);\n select.removeItem(item1);\n assertNull(select.getSelectedItem... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles tweets pagination which happens when a user scroll down at the end of the current display. | function handleTweetsPagination() {
let doc = document.documentElement;
window.addEventListener('scroll', () => {
// when a user scrolls it checks if the user is at the bottom of the current display
console.log(doc.scrollTop);
console.log(doc.scrollHei... | [
"function nextPage( callback ){\n // Get tweets from local archive if configured\n if( conf.archive ){\n if( ! archive ){\n archive = fs.readdirSync( conf.archive );\n }\n var filename = archive.pop();\n if( ! filename ){\n console.log('No more tweets in archi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API bool InputInt2(const char label, int v[2], ImGuiInputTextFlags extra_flags = 0); | function InputInt2(label, v, extra_flags = 0) {
const _v = import_Vector2(v);
const ret = bind.InputInt2(label, _v, extra_flags);
export_Vector2(_v, v);
return ret;
} | [
"function InputInt(label, v, step = 1, step_fast = 100, extra_flags = 0) {\r\n const _v = import_Scalar(v);\r\n const ret = bind.InputInt(label, _v, step, step_fast, extra_flags);\r\n export_Scalar(_v, v);\r\n return ret;\r\n }",
"function InputInt3(label, v, extra_flags = 0) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the signin button with the Google API | function renderButton() {
gapi.signin2.render('signinButton', {
scope: 'profile email',
width: 200,
height: 64,
longtitle: false,
theme: 'light',
onfailure: onSigninFailure,
});
gapi.load('auth2', () => {
gapi.auth2.init({
client_id: '99953346844-92b1h6oj22... | [
"function signIn() {\n var provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().signInWithPopup(provider);\n}",
"function signinCallback(authResult) {\n if (authResult['access_token']) {\n // Evitar el inicio de sesion automatico con el valor(PROMPT) de la propiedad \"METHOD\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
zoom delta (int) negative number for zoom out, positive for zoom in | set zoom(delta) {
// TODO: limit zoom
if (delta < 0 && this.zoom < 0.05) {
return null;
}
if (delta > 0 && this.zoom > 200) {
return null;
}
if (!this.dragEnabled) {
const oldZoom = this.zoomLevel;
if (delta !== undefined) {
this.zoomLevel += this.zoomLevel / (2... | [
"getZoomMult(){\n return this.state.distance * this.scale_zoom;\n }",
"getZoomLevel() {\n return this.dynamics.zoom.current;\n }",
"onZoomChange(pointer, zoomValue, prevValue)\n {\n return false;\n }",
"function applyZoomStep(step) {\n // Use smaller step sizes when zoomed less than 100%\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a timer is used to check the listener count; When it is 0, call the callback function. we don't do this in the event handler above for two reason: 1) all the listeners may not have been added and we might have 0 listerers before all the listeners have been set up 2) If an ajax call doesn't come back, we need a timeout ... | function checkTimeSinceLastAjaxUpdate() {
var timeSinceLastAjaxReturn = new Date().getTime() - lastReady;
if (listenerCount > 0 && timeSinceLastAjaxReturn < MAX_WAIT) {
//listeners are still present and we haven't reached our timeout
window.setTimeout(checkTimeSinceLastAjaxUpdate, TIMEOUT);
... | [
"function attachDefaultListeners() {\n\t\tvar listenerDiv = document.getElementById('listener');\n\t\tlistenerDiv.addEventListener('load', moduleDidLoad, true);\n\t\tlistenerDiv.addEventListener('message', handleMessage, true);\n\t\tlistenerDiv.addEventListener('error', handleError, true);\n\t\tlistenerDiv.addEvent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_readDeclarationPunctuation` reads the punctuation of a declaration | _readDeclarationPunctuation(token) {
// SPARQL-style declarations don't have punctuation
if (this._sparqlStyle) {
this._sparqlStyle = false;
return this._readInTopContext(token);
}
if (token.type !== '.') return this._error('Expected declaration to end with a dot', token);
return this._... | [
"function isPunctuation(input){\n\t\tvar lastChar = input.charAt(input.length-1);\n\t\tif((lastChar == ',') || (lastChar == '.') || (lastChar == ';')|| \n\t\t\t(lastChar == '!') || (lastChar == '?') || (lastChar == ':')){\n\t\t\treturn true;\t\t\n\t\t}\n\t\treturn false;\n\t}",
"declarations() {\n let declarat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A command that delegates its execution to another (source) command. | function SourcedCommand() {
var src, enabled = Utils.SourcedProperty();
// cmd with undefined source is disabled
enabled.setSource(Utils.ConstProperty(false));
var cmd = Utils.Command(function () {
return src.apply(null, arguments);
... | [
"addCommand(command) {\n this._commands.set(command.name, command);\n if (Array.isArray(command.aliases)) {\n command.aliases.forEach(alias => { this._commands.set(alias, command); });\n }\n }",
"registerCommand() {\n this._commander\n .command(this.command)\n .description(this.descrip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mutates simple literal addresses and identifiers | function mutateSimpleAddress(node){
const start = node.range[0]
const end = node.range[1]
mutations.push(new Mutation(file, start, end + 1, "address(this)"))
mutations.push(new Mutation(file, start, end + 1, "address(0)"))
//Swap the literal address with each declared literal add... | [
"static address(v) { return new Typed(_gaurd, \"address\", v); }",
"function setLiteral(source, key, rules) {\n const item = (source[key] || { type: 'literal' });\n item.rules = rules;\n source[key] = item;\n return item;\n}",
"cloneAttributes(target, source) {\n [...source.attributes].forE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connect tunnel to a remote agent | function connectTunnel(url) {
// Setup WebSocket options
var options = { rejectUnauthorized: false, checkServerIdentity: onVerifyServer }
// Setup the HTTP proxy if needed
if (args.proxy != null) { const HttpsProxyAgent = require('https-proxy-agent'); options.agent = new HttpsProxyAgent(require('url').... | [
"function connect(opts) {\n let out = fs.openSync('./out.log', 'a');\n let args = [\n '-fN',\n '-L',\n `${opts.port}:localhost:${opts.port}`,\n `${opts.moniker}@${opts.hostname}`,\n ];\n\n const tunnel = spawn('ssh', args, {\n stdio: ['ignore', out, out],\n shell: false,\n detach: true,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
INITIALISE AND CREATE THE ALL MARKETS MENU FUNCTION | function createAllMarketMenu() {
if (!fCustomiseFlag) {
splitSkeleton('popular');
document.getElementById("popularSportsTreeContainer").innerHTML = getMenuItems("popularSkeletonArray",0,0,"popularSportsTreeContainer","popularPathArray","popularParents1");
}
splitSkeleton('all');
meatArray.length = 0
splitSk... | [
"function createMyMarketMenu() {\n\tif (myMarketsString != \"\") {\n\t\tintegrateMyEventsAndMarkets();\n\t}\n\tsplitSkeleton('my');\n\tdomWrite('myMarketsTreeContainer',getMenuItems(\"mySkeletonArray\",0,0,\"myMarketsTreeContainer\",\"myPathArray\",\"myMarketsParents1\",null,true));\n}",
"function initializeMarki... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an itk.js image to a vtk.js image. Requires an itk.js image as input. | function convertItkToVtkImage(itkImage, options = {}) {
// Make sure we can handle input pixel type
// Refer to itk-js/src/PixelTypes.js for numerical values
switch (itkImage.imageType.pixelType) {
case 1: // Scalar
case 2: // RGB
case 3: // RGBA
break;
default:
vtkErrorMacro(
... | [
"function getImageJSON(){\n var elem = document.getElementById('canvasJSON');\n elem.value = stage.toJSON();\n}",
"function renderViz() {\n\n // Define variables for viz\n var mainVizDiv = $(\"#tableauViz\");\n var mainVizOptions = {\n hideTabs: true,\n hideToolbar: true,\n //t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes event object of employee submitting new star to add, and calls the DashboardServletAPI to use the form data and pass the results to handleAddStarResult function above | function submitAddStarForm(formSubmitEvent)
{
console.log("Submitting employee's star to be added");
formSubmitEvent.preventDefault();
$.post(
"api/_dashboard",
$("#add_star_form").serialize(),
(resultDataString) => handleAddStarResult(resultDataString)
);
} | [
"function createFormHandler(e) {\r\n e.preventDefault()\r\n const nameInput = document.querySelector('#input-name').value\r\n const gradeInput = document.querySelector('#input-grade').value\r\n const studentId = parseInt(document.querySelector('#students').value);\r\n //passing in the function postFe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds event listeners to alphabet buttons, both for mouse and keyboard The click event listener is added to the parent element and bubbling is used to listen to events. When the event fires the checkGuess function is called | function addAbcListeners() {
document.getElementById('abc-btns').addEventListener('click', function (event) {
if (!event.target.className.includes('btn')) return; // makes sure the element that was clicked is a button
let button = event.target; //sets button to the element that fired the... | [
"function enableButtons() {\n\t//event listener for the guess button\n\t$(\"#guess\").click(function () { \n\t\t//calls the guesser function and passes the value of the input box to the function \n\t\tguesser($(\"#letterHolder\").val()); \n\t\t//and clears the letter input box after guess button is clicked\n\t\t$(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: Create $SyncDoc under $service. | function createSyncDoc(service, SyncDoc) {
service.documents
.create({
uniqueName: SyncDoc,
data: {
temperature: '0',
humidity: '0'
},
ttl: 0
})
.then(response => {
// console.log(response);
console.log("== createSyncDoc ==");
});
} | [
"function updateSyncDoc(service, SyncDoc) {\n service\n .documents(SyncDoc)\n .update({\n data: { temperature: 30,\n humidity: 20 },\n })\n .then(response => {\n console.log(response);\n// console.log(\"== deleteSyncDoc ==\");\n})\n .catch(error => {\n console.log(error... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic function for sending a walk to the server | function walkSend(url, walk, method, cb) {
var xhr = new XMLHttpRequest();
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.open(method, url)
xhr.onload = function() {
var response;
try {
response = JSON.parse(this.responseText);
cb(null, response, url);
} catc... | [
"walk() {\n // Update position and velocity\n updateWalkerPosition(this.state, this.resolution, this.delimitTo);\n // Updtate walker acceleration (random)\n this.state.acc = this.accelerationRandomGenerator();\n }",
"send(...args) {\n this._send_handler(...args)\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add document excerpt to donut view | function addExcerpt(chart, text)
{
var excerpt = chart.selectAll(".excerpt")
.data(text)
.enter()
.append("text")
.attr("class", "excerpt")
.style("fill", "white")
.text(conditional_clip(text, 50))
.attr('transform', function(d, i) {
var horz = 200... | [
"function extractExcerpt(article) {\n if (!article.hasOwnProperty('templateContent')) {\n console.warn(\n 'Failed to extract excerpt: Document has no property \"templateContent\".'\n )\n return null\n }\n\n let excerpt = null\n const content = article.templateContent\n\n // The start and end sepa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add file to Map and asscociated container to DOM | function addFile(file) {
files.set(file._template, file);
fileView.appendChild(file.getTemplate());
} | [
"addFile(filePath, file) {\n filePath = this.#formatPath(filePath);\n if (this.map[filePath] === undefined) {\n const [folder, file] = this.#parse(filePath);\n this.map[folder].content.push(file);\n }\n this.map[filePath] = file;\n }",
"function addCenterfile() {\n var l_html = '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a single recipient from an ASN.1 object. | function _recipientFromAsn1(obj) {
// validate EnvelopedData content block and capture data
var capture = {};
var errors = [];
if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {
var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +
'ASN.1 object is not an PKCS#7 Recipien... | [
"isValidRecipient(name){}",
"constructor() { \n \n RecipientContact.initialize(this);\n }",
"function normalize(asn1) {\r\n return asn1\r\n .replace(/\\n\\s*?(--\\s*?(Need|Cond)\\s+?.+?)$/gm, '$1')\r\n .replace(/(--\\s*?(Need|Cond)\\s+?.+?)$/gm, ' $1')\r\n .replace(/--.*... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the given ticket, persisting the changes to the server. | delete(board, ticket) {
let token = UserStore.getToken();
let existing = BoardStore.getTicket(board.id, ticket.id).toJS();
this.dispatch(Action.Ticket.Remove, { board, ticket });
api.deleteTicket({ token, id: { board: board.id, ticket: ticket.id } })
.catch((err) => {
this.dispatch(Action.Ticket.Add... | [
"function deleteTicket(){\n var ticket_number = $('#selected_ticket_number').text();\n if (confirm(\"Are you sure you want to delete this ticket?\")) {\n $.post( '/newticket', { \"delete_ticket\": ticket_number } ).done(function(response) {\n $(`#ticket_row_${ticket_number}`).hide('fast');\n select... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function can be used to setup any static assets in the constructore, like dat.gui settings window. | setupStatic() {
} | [
"function init() {\n var test = AppConfig.testPaper;\n DataManager.loadJSON('/test_assets/' + test + '/' + test + '.json')\n .done(function(){\n\n // load assets\n DataManager.setAssetIndexes({ assetIndex: 0, fileIndex: 0 });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if elasticsearch is running | function checkES(index) {
var deferred = Q.defer();
client.ping({
requestTimeout: 1000,
hello: 'elasticsearch!'
}, function (error) {
if (error) {
// if it's not
deferred.reject(error);
} else {
// if runs
client.indices.exists({index: index}, function(err, response){... | [
"function createElasticConnection () {\n\n if (testing) {\n function genPromise() {\n return new Promise(function(resolve, reject) { reject(\"No els\"); });\n }\n\n els = {\n search: function() { return genPromise(); },\n index: fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A message handler invoked on a `'fitrequest'` message. | onFitRequest(msg) {
if (this.parent.isAttached) {
this._fit();
}
} | [
"function handleContextREQ (request) {\n\n\n\tsendResponse.call(this, \"ContextRESP\", request, 1, []);\n}",
"function webhook(req, res, next) {\n\n console.log(\"Made it to the webhook!\")\n\n switch(req.body.type) {\n case \"message-created\":\n messageCreated(req.body);\n console.log(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new insert / replace edit | function create(newText, insert, replace) {
return { newText: newText, insert: insert, replace: replace };
} | [
"function DocEdit_processNewEdit(index)\n{\n var dom = dw.getDocumentDOM();\n var allSBs = dw.serverBehaviorInspector.getServerBehaviors();\n\n\n if (this.weight==\"beforeNode\")\n {\n var nodeOffsets = dwscripts.getNodeOffsets(this.node);\n\n this.insertPos = nodeOffsets[0];\n this.replacePos = nodeO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a position at a direction relative to origin | static positionAtDirection(origin, direction) {
let offsetX = [0, 0, 1, 1, 1, 0, -1, -1, -1];
let offsetY = [0, -1, -1, 0, 1, 1, 1, 0, -1];
let x = origin.x + offsetX[direction];
let y = origin.y + offsetY[direction];
if (x > 49 || x < 0 || y > 49 || y < 0) {
return;
... | [
"function B_dir_pos(p) {\n var theta = Math.atan2(p[1], p[0]);\n var a = Math.atan2(3*Math.sin(2*theta), 1+3*Math.cos(2*theta));\n return vec3(Math.cos(a), Math.sin(a), 0);\n}",
"static position(pos, pointing, up) { \r\n\t\tvar z = normalize(pointing); \r\n\t\tvar x = normalize(cross(up,z)); \r\n\t\tvar y = cr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toggles the editability for the specified form | function toggleEdit (form) {
if (form.hasClass('enabled')) {
form.removeClass('enabled');
form.find('input').prop('disabled', true);
form.find('button.save-profile').remove();
} else {
form.addClass('enabled');
form.find('input').prop('disabled', false);
form.append('<button ... | [
"function disableEditing() {\n disableForm(true);\n}",
"toggleEdit() {\n this.toggleProperty('isEditing');\n }",
"setShowInEditForm(show) {\n return spPost(Field(this, `setshowineditform(${show})`));\n }",
"function swapAriaStatus(form) {\n\tif ($(form).attr(\"aria-hidden\") == \"false\") {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserfunctionLiteral. | enterFunctionLiteral(ctx) {
} | [
"function parseFuncInstr() {\n var startLoc = getStartLoc();\n maybeIgnoreComment();\n /**\n * A simple instruction\n */\n\n if (token.type === _tokenizer.tokens.name || token.type === _tokenizer.tokens.valtype) {\n var _name2 = token.value;\n var object;\n eatTo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursively execute task on model tree | static executeTaskOnModelTree(model, task) {
const taskResults = []
function executeTaskOnModelTreeRec(dbId) {
instanceTree.enumNodeChildren(dbId,
function (childId) {
taskResults.push(task(model, childId))
executeTaskOnModelTreeRe... | [
"function executeTree(options, input) {\n var tree = BehaviorTree.create(options)\n\n if (tree.error) {\n console.log(tree.error);\n throw tree.error;\n } else {\n console.log('START');\n return tree.run(input)\n .then(function success(result){\n consol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to remove all the locale data from `LOCALE_DATA`. | function unregisterAllLocaleData() {
LOCALE_DATA = {};
} | [
"function clearTranslations() {\n $localize.TRANSLATIONS = {};\n}",
"function _cleanSentences() {\n // look for empty tone_categories and set tone_categories to 0 values\n _rankedSentences.forEach(function(item) {\n if (item.tone_categories.length === 0)\n item.tone_categories = TONE_CATEGORI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the normal of the face | get normal() {
// Check if the face is bound to a mesh and if not throw an error
if (!this.mesh) throw new Error(`Cannot compute the normal of the face - the face is not bound to a Mesh`);
// Return the normal for the face
return this.plane.normal;
} | [
"function surfaceNormal(points) {\n var x = 0;\n var y = 0;\n var z = 0;\n\n // Do rest of points\n for(var i = 0; i < points.length - 1; i++) {\n x += (points[i][1] + points[i + 1][1]) * (points[i + 1][2] - points[i][2]); // x = y * z\n y += (points[i][2] + points[i + 1][2]) * (points[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 1: Check if the line is purely horizontal or purely vertical | function isVertOrHorz(startCoordinate, endCoordinate){
let status;
var startE = startCoordinate[0];
var startN = startCoordinate[1];
var endE = endCoordinate[0];
var endN = endCoordinate[1];
//console.log("startE: " + startE + " | endE: " + endE);
//console.log("startN: " + startN + " | endN: " + endN);... | [
"function LineOrVertical(line, x) {\n this.vertical = (line === null);\n if (this.vertical) {\n this.x = x;\n } else {\n this.m = line.m;\n this.c = line.c;\n }\n}",
"isVertical() {\r\n return !this.isHorizontal();\r\n }",
"function onLine(line, point) {\n\tif(point.x ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here's one example of how to modify a request to remove a specific prefix, in this case `/docs` from the url. This can be useful if you are deploying to a route on a zone, or if you only want your static content to exist at a specific path. | function handlePrefix(prefix) {
return request => {
// compute the default (e.g. / -> index.html)
let defaultAssetKey = mapRequestToAsset(request)
let url = new URL(defaultAssetKey.url)
// strip the prefix from the path for lookup
url.pathname = url.pathname.replace(prefix, '/')
// inherit a... | [
"setPrefix(prefix, uri) {\n if (prefix.slice(0, 7) === 'default') return // Try to weed these out\n if (prefix.slice(0, 2) === 'ns') return // From others inferior algos\n if (!prefix || !uri) return // empty strings not suitable\n\n // remove any existing prefix targeting this uri\n // for (let exi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subtest for test_can_switch_to_existing_email_account_wizard. This function simply clicks on the "Skip this and use my existing email" button, and then waits for itself to close. | function subtest_can_switch_to_existing_email_account_wizard(w) {
plan_for_window_close(w);
plan_for_new_window("mail:autoconfig");
// Click on the "Skip this and use my existing email" button
mc.click(new elib.Elem(w.window.document.querySelector(".existing")));
// Ensure that the Account Provisioner windo... | [
"function subtest_can_dismiss_account_provisioner(w) {\n plan_for_window_close(w);\n // Click on the \"I think I'll configure my account later\" button.\n mc.click(new elib.Elem(w.window.document.querySelector(\".close\")));\n\n // Ensure that the window has closed.\n wait_for_window_close();\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns random cards that have not yet been dealt | dealRandomCardsFromDeck(nb) {
let out = new Array(nb);
let temp = new Card();
for(var i = 0; i < nb; i++) {
do {
temp = this.deck.randomCardObject();
} while(this.cardsDealt.includes(temp));
// Add the card to the cards dealt and to the outp... | [
"function getRandomUnusedCard() {\n //if length of usedcards us equal to reuse factor\n if (cardIDsUsed.length == reuseFactor) {\n //remove last member of card ids used\n cardIDsUsed.pop();\n }\n //get unused cards list\n let unusedCards = getUnusedCardIDs();\n //select random card f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
items, given her budget. Given the price lists for the store's keyboards and USB drives, and Monica's budget, find and print the amount of money Monica will spend. If she doesn't have enough money to both a keyboard and a USB drive, print 1 instead. She will buy only the two required items. For example, suppose she has... | function getMoneySpent(keyboards, drives, b) {
let budgetKeys = keyboards
.sort((a, c) => a - c)
.filter(keyboard => keyboard < b);
let budgetDrives = drives.sort((a, c) => a - c).filter(drive => drive < b);
let k = budgetDrives.length - 1;
let max = -1;
let i = 0;
while (i < budgetKeys.length && k... | [
"function maximumToys(prices, budget) {\n prices = prices.sort((a, b) => a - b);\n let priceTotal = 0;\n let totalToys = 0;\n // assign index for while loop\n let index = 0;\n\n // // SOLUTION USING FOR EACH\n // prices.forEach((toy, index) => {\n // priceTotal += toy;\n // if (priceTotal <= budg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a position relative to the slider group to a nubmer in [0, 1] | function positionToNormalizedValue(sliderOpts, position) {
return Math.min(1, Math.max(0, (position - constants.stepInset - sliderOpts.inputAreaStart) / (sliderOpts.inputAreaLength - 2 * constants.stepInset - 2 * sliderOpts.inputAreaStart)));
} | [
"translateX() {\n if (this.slider.style.transform) {\n return parseInt(this.slider.style.transform.replace(/[^-.0-9]/g, ''));\n }\n\n return 0;\n }",
"function getSliderValue() {\n if (!AgeRecalculating) {//todo: weird bug that a second map-move is asked with strange params\n AgeRecalcula... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
of days. Here is how it works: upon first receiving the card, the system allocates you a 31day pass, which equals the number of days in January. The second time you pay for the card, your pass is extended by 28 days, i.e. the number of days in February (note that leap years are not considered), and so on. The 13th time... | function metroCard(lastNumberOfDays) {
let output = [];
(lastNumberOfDays === 30 || lastNumberOfDays === 28) && output.push(31);
lastNumberOfDays === 31 && output.push(28, 30, 31);
return output.sort((a, b) => a + b);
} | [
"function getDaysInMonth()\n{\n var daysArray = new Array(12);\n \n for (var i = 1; i <= 12; i++)\n {\n daysArray[i] = 31;\n\tif (i==4 || i==6 || i==9 || i==11)\n {\n daysArray[i] = 30;\n }\n\tif (i==2)\n {\n daysArray[i] = 29;\n }\n }\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collapse all box rules | function boxific_collapse_all(){
$('.boxific-rule').each(function(){
var rule = $(this);
var collapsed = rule.find('.boxific-rule-collapsed');
var fieldset = rule.find('fieldset');
collapsed.show();
fieldset.hide();
rule.addClass('collapsed');
});
} | [
"function boxific_expand_all(){\n\t$('.boxific-rule').each(function(){\n\t\tvar rule = $(this);\n\t\tvar collapsed = rule.find('.boxific-rule-collapsed');\n\t\tvar fieldset = rule.find('fieldset');\n\n\t\tcollapsed.hide();\n\t\tfieldset.show();\n\t\trule.removeClass('collapsed');\n\t});\n}",
"function _toggleExpa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AZ Check Page Attributes | function AZCheckPageAttributes()
{
if (this instanceof AZCheckPageAttributes === true)
{
var _Main = this;
_Main.Attributes = 0;
_Main.ObjPageAttributes = {};
try
{
_Main.Location = window.document.location.hostname;
_Main.PageName = window.docume... | [
"function isPageObjValid (PageObj)\n{\n\tvar bCommerce = IsCommerceEnabled();\n\tvar bService = IsServiceEnabled();\n\tvar licenseFor = PageObj[gLICENSE_FOR];\n\tbValid = false;\n\tif (licenseFor.toLowerCase() == \"all\" ||\n\t\t(licenseFor.toLowerCase() == \"powercommerce\" && bCommerce) ||\n\t\t(licenseFor.toLowe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the particle ready for deletion? | done() {
// Let's find the screen position of the particle
let pos = scaleToPixels(this.body.GetPosition());
// Is it off the bottom of the screen?
if (pos.y > .69*height + this.r * 2) {
this.killBody();
return true;
}
return false;
} | [
"remove(id) {\n if (this._particles.hasOwnProperty(id)) {\n this._particles[id].parent.removeChild(this._particles[id])\n delete this._particles[id];\n // update keys\n this._keys = Object.keys(this._particles);\n return true;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validationForm value of validation form function pageName name of page (ex: sitesnames.jsp) numberCriteria how many criteria will be insert into eunis_group_search_criterias table for this search formName form name attributeNames vector with attributes names elements witch will be insert into eunis_group_search_criteri... | function composeParameterListForSaveCriteria(
expand,
validationForm,
pageName,
numberCriteria,
formName,
attributesNames,
formFieldAttributes,
operators,
formFieldOperators,
booleans,
URL
)
{
if(validationForm)
{
var URL2 = URL + '?numberCriteria=' ... | [
"function create_supp_sec_search_parameter_MAP() {\n var map = {};\n var glblSearchEl = document.getElementById('globalsearch');\n var glblSearchInputEls = glblSearchEl.querySelectorAll('input');\n for (var i = 0; i < glblSearchInputEls.length; i++) {\n\n if (glblSearchInputEl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
closes all mysql connections | _closeMysql(){
this._mysqlDbNames.forEach((dbName) => {
this._closePromises.push(this[dbName].end().then(() => {
self._logger.info(`Mysql/${dbName} connection closed`)
})
.catch(()=>{
self._logger.info(`Mysql/${dbName} connection close error`)
return Promise.resolve() // re... | [
"function closeAllConnections() {\n var i;\n for (i = 0; i < _connections.length; i++) {\n try {\n _connections[i].disconnect();\n } catch (err) { console.error(err); }\n }\n _connections = [];\n }",
"async _closeConnections() {\n for (;;) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal Helper to clear out all STO memory registers | _clearMemory() {
for (let i = 0; i < this._memory.length; i++) {
this._memory[i] = 0;
}
} | [
"clearAll() {\n this._stack.length = 0;\n\n // stuff the stack to mimic always needed registers\n for (let i = 0; i < MINIMUM_STACK; i++) {\n this._stack.push(0);\n }\n\n this._lastX = 0;\n this._clearMemory();\n }",
"function clearMemory(){ memory = [] }",
"function resetRegisters () {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
manage timeout : beep, change session/break, reset time and start timer | timeout(){
document.querySelector("audio").play();
if (this.state.currentType ==="session"){
this.setState({
timeLeft:this.state.breakLength * 60,
currentType:"break"
})
}
else {
this.setState({
timeLeft:this.state.sessionLength * 60,
currentType:"session"
})
... | [
"function timer() {\n cov_g777u47x4().f[5]++;\n cov_g777u47x4().s[89]++;\n //Count down by decrementing seconds\n session_seconds--; //When timer has ended\n\n cov_g777u47x4().s[90]++;\n\n if (session_seconds < 0) {\n cov_g777u47x4().b[10][0]++;\n cov_g777u47x4().s[91]++;\n clearInterval(countdown);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a callback function which will maintain context across async calls. Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...) | function getCtxCallback(context, method) {
var params = [];
for (var _i = 2; _i < arguments.length; _i++) {
params[_i - 2] = arguments[_i];
}
return function () {
method.apply(context, params);
};
} | [
"getCallback(lcInstance) {\n\t return function(timeDelta) {\n\t\treturn lcInstance.tick(timeDelta);\n\t };\n\t}",
"function callback(callback){\n callback()\n}",
"function foo(callback){\n callback();\n}",
"dataUrlToCtx (dataUrl) { // async in some browsers?? http://goo.gl/kIk2U\n const img = this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds a generic content box for the right rail. | function buildRailBox() {
var theBox = $('<div />').addClass('rr_box');
return theBox;
} | [
"buildRight(){\n\t\tif(!this.canJump || this.ammo <= 0)\n\t\t\treturn;\n\t\tthis.moveRight();\n\t\tvar bpos = snapPoint(this.pos.plus(new vec2(0.4, 1).multiply(tilesize)));\n\t\tthis.placeBlock(bpos);\n\t\tvar dpos = this.tilePos().plus(vec2.right().multiply(tilesize / 1.5));\n\t\tfor(var i = blocks.length - 1; i >... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
highlights the score of the user playing when the leaderboard is displayed after the name submisson | function highlightUserScore(user) {
// searches the table rows for the entry that matches the user
for (var i = 1; i < leaderboardTable.rows.length; i++) {
var r = leaderboardTable.rows[i];
var c = r.cells;
if (c[1].textContent === user.name && parseInt(c[2].textContent) === user.score) ... | [
"function displayScore() {\n // Make the score disappear when a game over happens\n if (state === \"GAMEOVER\") {\n return;\n }\n push();\n // Setting the aesthetics\n fill(255);\n textFont(neoFont);\n textSize(64);\n // Show the score at the bottom left of the screen\n textAlign(LEFT, BOTTOM);\n text... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a ToneAudioBuffer from a URL, returns a promise which resolves to a ToneAudioBuffer | static fromUrl(url) {
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
const buffer = new ToneAudioBuffer();
return yield buffer.load(url);
});
} | [
"async function getBufferFromUrl(url) {\n let arrayBuffer;\n if (globalThis.fetch) {\n const response = await fetch(url);\n arrayBuffer = await response.arrayBuffer();\n } else {\n const fs = await import('fs');\n const uint8Array = await fs.promises.readFile(url);\n arrayBuffer = uint8Array.buffe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the transition function could have been done above using chaining but it's cleaner to have a separate function. the transition. Dash array expects "500, 30" where 500 is the length of the "dash" 30 is the length of the gap. So if you had a line that is 500 long and you used "500, 0" you would have a solid line. If you ... | function transition() {
linePath.transition()
.duration(90000)
.attrTween("stroke-dasharray", tweenDash)
.each("end", function() {
d3.select(this).call(transition); // infinite loop
})
} //end transition | [
"dash(){\n\n this.dashing=true;\n this.lrMaxSpeed=9;\n this.animate(1);\n setTimeout(function(tar){ tar.lrMaxSpeed=4; tar.animate(0); }, 3000, this );\n setTimeout(function(tar){ tar.dashing=false; }, 3500, this );\n }",
"function drawLine(svg){\t\n\t\t\tsvg.style.strokeOpacity = '0.6'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
B for downloading parameter table | function downloadParameterTable() {
let headers = $('#table-exploreModal .table-header th');
let columns = headers.map((i,d) => d.innerText).get();
let csv = 'data:text/csv;charset=utf-8,';
let parameters = ['area[cm^2]', 'run', 'l_neg[m]', 'l_sep[m]', 'l_pos[m]',
'Rp_neg[m]', 'Rp_pos[m]','eps... | [
"function renderParams() {\n \"use strict\";\n const table = document.getElementById(\"tableParams\");\n\n /* Clear the table */\n while (table.rows.length > 1) {\n table.deleteRow(-1);\n }\n\n params.forEach(function (value, key, map) {\n tableAppendRow(table, [key, value]);\n })... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collection data handlers Toggles advanced settings flag. | toggleAdvanced() {
if (this.advanced) {
this.advanced = false;
} else {
this.advanced = true;
}
} | [
"function toggleAdvanced() {\n var collapsible = document.getElementById(\"collapsible\");\n toggleAdv = document.getElementById(\"toggle-advanced\");\n if (collapsible.style[\"display\"] === \"block\") {\n toggleAdv.innerHTML = \"+ More options\";\n collapsible.style[\"display\"] = \"none\";... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes an array of options and the select selector | function setSelectOptions(options, selector) {
for (var i=0; i < options.length; i++) {
var newOption = document.createElement('option');
newOption.text = options[i];
selector.appendChild(newOption);
}
} | [
"renderSelects(optObject, multipleSelect){\n let selects = [];\n for(let key in optObject){\n let keyLength = optObject[key].length;\n let opts = [];\n opts.push(<option key=\"dummy\" value='unselected'>Select...</option>)\n for(let i = 0; i < keyLength; i++){\n opts.push(<option ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will remove a URL from a group | function removeFromGroup(url = "", groupName) {
isGroup(groupName, function(isGroup){
if (isGroup === true) {
chrome.storage.local.get("groups", function(data) {
groups = data["groups"];
for (tab of groups[groupName]["urls"]){
if (url === tab){... | [
"function removeUrlGroupFromDb(urlGroupId) {\n UrlGroups.remove({ id: urlGroupId }, function(urlGroupData) { });\n }",
"function removeUrlsFromDb(urlId, num, ofTotal) {\n Urls.remove({ id: urlId }, function(urlData) {\n if (num === ofTotal) {\n update... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This methods listen to window resize events in order to resize | function listenWindowResize() {
$(window).resize(_handleResize);
} | [
"onResize() {\n App.bus.trigger(TRIGGER_RESIZE, document.documentElement.clientWidth, document.documentElement.clientHeight);\n }",
"function ResizeHandler() {\n setMaxWindowWidth((window.innerWidth - 800) / 2);\n setMaxWindowHeight((window.innerHeight - 700) / 2);\n }",
"actOnWindowResize() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Import legacy links (custom commands) | importLegacyLinks() {
const legacyLinks = JSON.parse(localStorage.getItem("customCommands"));
if (legacyLinks) {
this.config.links = legacyLinks;
saveConfig();
}
} | [
"createVhostSymLinks() {\n let enabledVhostsPath = path.join(\n commons_constants.TARGET_DISPATCHER_SRC_FOLDER,\n Constants.CONF_D,\n Constants.ENABLED_VHOSTS\n );\n\n let conversionStep = this.createVhostSymLinksSummaryGenerator();\n let files =\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
equal Params: b1, b2 GameBoard Objects Returns: True if the GameBoards are identical False Otherwise | static equal(b1, b2) {
var i,j;
if (b1.size != b2.size) {
console.log('b1 and b2 are of different sizes');
return false;
}
for (i=0; i<b1.size; i++) {
for (j=0; j<b1.size; j++) {
if (b1.board[i][j] !== b2.board[i][j]) {
... | [
"function isEqual(board1, board2)\n{\n // iterate over each row index\n for (var i = 0; i < board1.length; i++)\n {\n // iterate over each column index\n for (var x = 0; x < board1[0].length; x++)\n {\n // check if corresponding cells are not equal\n if (board1[i]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the logged in state inside getMeteorData() so that the button is reactive with respect to loggedin state. | getMeteorData() {
return { isLoggedIn: !!Meteor.user() };
} | [
"function loginStatusToVars() {\n\tloggedIn = localStorage.loggedIn;\n\tloggedInID = localStorage.loggedInID;\n}",
"onLoggedIn(user) {\r\n this.setState({\r\n user\r\n });\r\n }",
"function mpLogIn() {\n mixpanel.identify(mixpanel.cookie.props.distinct_id)\n mixpanel.people.set({\"last page\":... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is copied almost verbatim from the V8 source code at The implementation of wrapCallSite() used to just forward to the actual source code of CallSite.prototype.toString but unfortunately a new release of V8 did something to the prototype chain and broke the shim. The only fix I could find was copy/paste. | function CallSiteToString() {
var fileName;
var fileLocation = "";
if (this.isNative()) {
fileLocation = "native";
} else {
fileName = this.getScriptNameOrSourceURL();
if (!fileName && this.isEval()) {
fileLocation = this.getEvalOrigin();
fileLocation += ", "; // Expecting source positi... | [
"toString() {\n return `${this.constructor.name}( ${this._stack\n .map((rc) => rc.toString())\n .join(', ')} )`;\n }",
"function stacktrace()\n{\n\tvar stackstring = \"stacktrace: \";\n\tvar history = [];\n\tvar func = arguments.callee.caller;\n\n\twhile (func !== null)\n\t{\n\t\tvar funcName = getF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts the music (from beginning) | start() {
this.isPlaying = true; // set the 'playing' boolean to true
this.playing = 0; // reset to the beginning
this.playCurrent(); // start playing the current track
} | [
"playRound1() {\r\n this.music1.play();\r\n }",
"static loadBeginning()\n {\n var path = game.load.path;\n\n game.load.path = 'assets/audio/music/';\n game.load.audio('beginning', 'beginning.mp3');\n\n game.load.path = path;\n }",
"function playFirstSong() {\n\tsetTrack... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Social Shareto icons to sidebar | function addSocialIcons(to) {
const url = document.head.querySelector("[property='og:url'][content]").content;
const title = document.head.querySelector("[property='og:title'][content]").content;
let flURL = 'https://faithlife.com/share?content=' + encodeURIComponent(title) + '&url=' + encodeURIComponent(ur... | [
"function initSocialPlugin() {\n \n}",
"function PopupShare(idx) {\r\n \r\n // SEE SAMPLES: https://gist.github.com/chrisjlee/5196139\r\n // https://github.com/Julienh/Sharrre\r\n \r\n var item=G.I[idx];\r\n\r\n var currentURL=document.location.protocol +'//'+document.location.hostnam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION Generar Fotos Segmento | function GenerarFotos(iSeg) {
// console.log('Desde GenerarFotos');
nSegAlbum = 50;
sFotoModelo.show();
var nFotosBus = listFotosBus.length;
var iFotoMax = ((iSeg + 1) * nSegAlbum < nFotosBus) ? (iSeg + 1) * nSegAlbum : nFotosBus;
for (var iFoto = iSeg * nSegAlbum; iFoto < iFotoMax; iFoto++) {
... | [
"function pasarFoto() {\r\n if(posicionActual >= IMAGENES.length - 1) {\r\n posicionActual = 0;\r\n } else {\r\n posicionActual++;\r\n }\r\n renderizarImagen();\r\n }",
"function generaFoto(cedula)\n\t{\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve a promised connection from a connection pool that will be released at the end of the promise chain | function getConnection() {
return pool.getConnection().disposer(function(connection) {
pool.releaseConnection(connection);
});
} | [
"open() {\n if (!this.pool) {\n this.pool = new pg_1.Pool({\n host: this.host,\n port: this.port,\n database: this.database,\n user: this.username,\n password: this.password,\n min: this.minPoolSize,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |