query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
The purpose of this function is to establish a link between a role and an account. | function linkRoleAndAccount() {
showSpinner("modalSpinnerRoleAccountLink");
var baseUrl = getClientStore().baseURL;
var accessor = objCommon.initializeAccessor(baseUrl, cellName);
var context = objCommon.initializeAbstractDataContext(accessor);
var selectedAccountName = getSelectedAccount();
if (selectedAccount... | [
"linkAccount() {}",
"function assignRoleSelectorLink() {\r\n\t\t// Skip this, if there is only one role\r\n\t\tif (config.roles.length == 1)\r\n\t\t\treturn;\r\n\r\n\t\tswitch (state.role) {\r\n\t\t\tcase 'speaker':\r\n\t\t\t\t$('.footer .speakerLink').hide();\r\n\t\t\t\t$('.footer .listenerLink').show();\r\n\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rebinds event handlers to route links within this component fired both on mount and update | bindRouteLinks() {
const hasText = this.props.field && this.props.field.value;
const isEditing = this.props.editable && this.props.field.value.editable;
if (hasText && !isEditing) {
const node = ReactDOM.findDOMNode(this);
// selects all links that start with '/' - this logic may be inappropria... | [
"addLinkEvents() {\n for (let link of document.getElementsByTagName('a')) {\n let oldUrl = link.getAttribute('href');\n let hashPos = oldUrl.indexOf('#');\n\n if (hashPos === -1) {\n link.href = '#' + oldUrl;\n }\n\n // link.addEventListen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
play audio file using lowLag API | function playAudio(fileToPlay) {
lowLag.load(fileToPlay);
lowLag.play(fileToPlay);
} | [
"function fnplayaudio(audio_path){\n var audio_file = new Audio(audio_path);\n audio_file.play();\n }",
"playAudio(file) {\n //create audio element and set its source as the mp3 file requested\n const audio = new Audio('audio/' + file + '.mp3');\n //play the audio\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for cleaning title of the V39 for AMP | function omn_cleanTitle_withoutSeoAMP(stringWithPipes){
var array_stringWithPipes= stringWithPipes.split("|");
var punt1;
var arrayReal= Array.from(array_stringWithPipes[0]);
var cadenaSinPercent="";
var control=0;
if(arrayAmp['title'].indexOf("%") > -1){
for(var i=0; i<arrayReal.length;... | [
"function cleanTitle(title) {\n return title.replace(/(CRUX LGBTQ Climbing - ){1}/ig, '');\n}",
"function cleanTitle(str) {\r\n\tstr = tbr(str); // remove brackets content\r\n\tstr = str.replace(/[\\w]+ (remix|mix|rmx|edit).*/gi,''); // remove (this), 1 word before and everything after\r\n\tstr = str.replace(/( ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
represents a single round | function round(room)
{
this.room = room;
this.roundNumer = room.rounds.length+1;
this.id = this.room.id+"-"+randomString(window.config.numberOfDigitsForRandomStrings,'aA#')+'|roundNumber:'+this.roundNumer;
} | [
"getRound() {\n return this.currentRound;\n }",
"function getRoundNo(){\n return roundNo;\n }",
"get round() {\n let currentRound = this.rounds.at(-1);\n if (currentRound.isFinished) currentRound = this.addRound(this.options.roundLimit);\n\n return currentRound;\n }",
"$round() {\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
external of_int: int > t Provides: ml_z_of_int const Requires: bigInt | function ml_z_of_int(i) {
return i | 0;
} | [
"function ml_z_of_int32(i32) {\n return bigInt(i32);\n}",
"function ml_z_of_int32(i32) {\n return ml_z_of_int(i32);\n}",
"function ml_z_of_nativeint(z) {\n return ml_z_of_int(z)\n}",
"function ml_z_fits_int32(z1) {\n return ml_z_fits_int(z1);\n}",
"function ml_z_of_nativeint(z1, z2) {\n\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HTML template for filtered word | function filteredWordTpl(word) {
return `<span class="review__filtered-word">${word}</span>`;
} | [
"function wordHtmlTpl(word) {\n return `<span class=\"blacklist__word zoomIn animated\">\n ${word}<span class=\"blacklist__remove-icon\">x</span>\n </span>`;\n }",
"function textFilter() {\n scheduler.clear(\"filter\");\n scheduler.add(\"filter\", function() {\n var query ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Using transactions, read object from plates, add it to slates if it does not exist and then delete it from the plates. If any operation failes, all these will fail | function moveToslates(platesId) {
var transaction = $.indexedDB("PlateSlateDB").transaction(
[ "plates", "slates" ]);
transaction.done(function() {
loadFromDBAfterLoadSelectOptions("plates");
loadFromDBAfterLoadSelectOptions("slates");
});
transaction.progress(function(transaction) {
transaction.objectStor... | [
"function populateDatabaseOfSocs(database, dataToAdd){\n console.log(\"Database: populating database of SoCs\");\n return new Promise(function(resolve,reject){\n for (var i=0; i < dataToAdd.length; i++) {\n // Prepare the transaction\n let transaction = database.transaction([OBJECT_STORE_S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement` resource | function cfnWebACLRegexPatternSetReferenceStatementPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnWebACL_RegexPatternSetReferenceStatementPropertyValidator(properties).assertSuccess();
return {
Arn: cdk.stringToCloudFormation(properties.... | [
"function CfnWebACL_RegexPatternSetReferenceStatementPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Ex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create polygon selection. The polygon is an array of point arrays, e.g. [[20,30][40,30][40,60][20,30]] Potential DOM FIX | function createPolygonSelection( polygon, addTo )
{
var i;
var desc = new ActionDescriptor();
var ref = new ActionReference();
var listDesc = new ActionDescriptor();
var pointList = new ActionList();
addTo = (typeof addTo === "undefined") ? false : addTo;
ref.putProperty( typeChannel, charIDToTypeID('fsel')... | [
"function getPolygonPoints() {\n let angle = getAngleUsingXandY(mouseLoc.x, mouseLoc.y);\n let radiusX = shapedContainer.width;\n let radiusY = shapedContainer.height;\n let polygonPoints = [];\n\n // X = mouseLoc.x + radiusX*sin(angle);\n // Y = mouseLoc.y - radiusY*cos(angle);\n\n for(let i =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Post (add) a client | function addClient(full_name, email, phone, address, postcode, zone) {
const newClient = {
full_name: full_name,
email: email,
phone: phone,
address: address,
postcode: postcode,
completed: false,
zone: zone,
date: moment(),
managerId: 1,
};
axios
... | [
"function postClients(client) {\n // currentUser = UserFactory.getUser();\n currentUser.getToken().then(function(idToken) {\n $http({\n method: 'POST',\n url: '/clients',\n data: client,\n headers: {\n id_token: idToken\n }\n }).then(function(response){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adding text links to markers and calling listener function | function addMarkerInfo() {
for (var i = 0; i < markersOnMap.length; i++) {
var contentString = '<div id="content"><h1>' + markersOnMap[i].placeName +
'</h1><p>' + markersOnMap[i].description + ' <a href="walks.html">See our Walks page for further details</a>r</p></div>';
const marker ... | [
"function mapmyindia_text_on_marker() {\n mapmyindia_removeMarker();\n for (var i = 0; i < latitudeArr.length; i++) {\n var title = \"Text marker sample!\";\n var icon = L.divIcon({\n className: 'my-div-icon',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set of functions to go to specific locations paired with focusScrolling.html function to abstract smooth scroll call to london | function goToLondon(){
var position = findPos(document.getElementById("London"));
easingScrollAction(position,2000);
} | [
"function goToLondon(){\n\tvar position = findPos(document.getElementById(\"London\"));\n\tsmoothScrollAction(position,600);\n}",
"function goToLondon (){\n\twindow.scroll(0,findPos(document.getElementById(\"London\")));\n}",
"function focusMarkerPosition(direction , elName){\n\n var value = (direction === '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increase the current video speed by 25% each time the button is clicked and log the new speed to the console. | function increaseSpeed() {
video.playbackRate *= 1.25;
console.log("Speed is "+ video.playbackRate);
} | [
"function incSpeed() {\n var returnVal = getVideo();\n var video = returnVal[0], type = returnVal[1];\n if (video != null && type === \"main\") {\n var currSpeed = video.playbackRate;\n if (currSpeed <= 15.75) {\n var newSpeed = currSpeed + 0.25;\n } else {\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HSV idea from / returns random hex color | function hsv_random_color(h, s, v) {
var r = 0;var g = 0;var b = 0;
var h_i = parseInt(h*6);
var f = h*6 - h_i;
var p = v * (1 - s);
var q = v * (1 - f*s);
var t = v * (1 - (1 - f) * s);
switch(h_i) {
case 0:
r = v; g = t; b = p;
break;
case 1:
r = q; g = v; b = p;
break;
case 2:
r = p; g = v; b ... | [
"function rand_hsv() {\n\treturn Math.random();\n}",
"function hsv_random_color(h, s, v) {\n\n var r = 0;var g = 0;var b = 0;\n var h_i = parseInt(h*6);\n var f = h*6 - h_i;\n var p = v * (1 - s);\n var q = v * (1 - f*s);\n var t = v * (1 - (1 - f) * s);\n switch(h_i) {\n case 0:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Nos ayuda a mostrar las fotos de la lista una vez eliminada solamente una foto | function listaFotosAux() {
$(".foto").remove();
var j;
for (j = 0; j < listImages.length; j++) {
var html = getHtmlListaFotos(listImages[j].url_img, listImages[j].msg, listImages[j].id, listImages[j].secret, j, 2);
$('#muro').append(html);
}
} | [
"function removeImages(x) {\n listImages.splice(x, 1);\n $('#badgeFoto').text(listImages.length);\n listaFotosAux();\n}",
"function borrarFotos(fotos){\n if(!fotos) return;\n if(fotos instanceof Array){\n fotos.map(function(e){\n fs.unlink(e.path, (err) => {\n if (err... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
La funcion doorscube debe de crear las puertas laterales del cubo. Para ello hay que utilizar la funcion del drone door2(). Door2 crea dos puertas contiguas para dejar mas espacio | function doorscube(loc, size,material){
var f = new Drone( loc );
//Realiza el mismo movimiento para disponer la referencia en el centro del cubo
//...//
//Ahora vamos a movernos 4 veces para crear las puertas.
//Los movimientos se haran desde el centro. Ir hacia delante, crear puerta, ir hacia atras
for (v... | [
"function buildDoors(){\n // door( a, b, c, d,x1,x11,x12,x2,z1,z2);\n\n var x1 = -6707.36;\n var x11 =-6507.36;\n var x12 =-5740;\n var x2 = -5540;\n var z = 1126;\n for(var i = 0; i<4; i++){\n\n // front side\n door( 2,12,14,0 , x1, x11, x12, x2,z);\n door(12,13, 5,4 , x1,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the path of Slate node. | findPath(editor, node) {
var path = [];
var child = node;
while (true) {
var parent = NODE_TO_PARENT.get(child);
if (parent == null) {
if (Editor.isEditor(child)) {
return path;
} else {
break;
}
}
var i = NODE_TO_INDEX.get(child);
... | [
"findPath(editor, node) {\n var path = [];\n var child = node;\n while (true) {\n var parent2 = NODE_TO_PARENT.get(child);\n if (parent2 == null) {\n if (Editor.isEditor(child)) {\n return path;\n } else {\n break;\n }\n }\n var i15 = NODE_TO_INDEX... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the lower number on function Z and its column | function getLowerNumberAndColumn(matriz,rowCount,columnCount){
var column = 0;
rowCount -= 1;// rowCount now has the correct value to use
var lowerNumber = matriz[rowCount][0];
//loop functionZ array to find the lower number value
for (let j = 1 , i = rowCount ; j < columnCount - 1 ; j++) {
//make sure that ... | [
"get zMin() {\n return this.zRange.min;\n }",
"getZ() {\n return this.n >= 3 ? this.get(2) : 0;\n }",
"lower() {\n let lower = NMatrix.zeros(this.nRow);\n for(let i = 0; i < this.nRow; i++) {\n for(let j = 0; j <= i; j++)\n lower.set(i, j, this.get(i, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lists all globally installed npm packages. | function npmList(path) {
var global = false;
if (!path) global = true;
var cmdString = "npm ls --depth=0 " + (global ? "-g " : " ");
return new Promise(function (resolve, reject) {
exec(cmdString, { cwd: path ? path : "/" }, (error, stdout) => {
if (error) {
return re... | [
"function queryInstalledPackages() {\r\n // retrieve currently installed nodes\r\n var packageNodes = settings.selectNodes(\"package\");\r\n\r\n // create a string to append package descriptions to\r\n var message = new String();\r\n\r\n for (var i = 0; i < packageNodes.length; i++) {\r\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try doing init, otherwise hook into window.resize and document.scroll and try again then. | function tryInitOrHookIntoEvents(options, $that) {
var success = tryInit(options, $that);
if (!success) {
console.log('TSS: Body width smaller than options.minWidth. Init is delayed.');
$(document).scroll(function (options, $that) {
return fu... | [
"function tryInitOrHookIntoEvents(options, $that) {\r\r\n var success = tryInit(options, $that);\r\r\n\r\r\n if (!success) {\r\r\n console.log('TSS: Body width smaller than options.minWidth. Init is delayed.');\r\r\n\r\r\n $(document).scroll(function (options, $th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Click and drag the element by xAmount/yAmount to move it. | function dragElement(element, xAmount, yAmount) {
var $element = $(element);
var start = {
x: $element.offset().left + 5,
y: $element.offset().top + 5
};
var end = {
x: start.x + xAmount,
y: start.y + yAmount
};
// need to mouseover so that it sets up some internal state property
var mous... | [
"function moveElement() {\n simulateClick.addClass('move');\n window.setTimeout(function () {\n imageElement.addClass('move');\n window.setTimeout(mouseUpOnElement, 400);\n }, 200);\n }",
"drag(x, y) {\n this.doDrag(x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the given key and value to the connection properties. | addParam(key, value) {
const aliasKeyName = key.toLowerCase();
const propertyName = this.URL_PROPS_ALIAS.get(aliasKeyName);
if (propertyName != null) {
// if it is an URL alias then add to URL props
this.urlProps.set(propertyName, value);
} else {
this.connectionProps.set(propertyName,... | [
"function addProp(key, value) {\n if (key == 'location' || key == 'forecast_io_api_key'\n || key == 'philips_hue_bridge_ip') {\n json[key] = value;\n writeJson();\n console.log(\"Success: Added \\\"\" + key + \"\\\":\\\"\" + value + \"\\\" to properties.json.\");\n } else if (key == 'amazon_dash... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: implement the handleRemoveTag method to remove a tag from a card. Tips: Use the `this.setState` method to update the state (cards) | handleRemoveTag(cardId, tagId) {} | [
"handleRemoveTag(cardId, tagId) {\n const { cards } = this.state;\n cards[cardId].tags.splice(tagId, 1);\n this.setState({ cards });\n }",
"function removeTag() {\n let tag = $(this).text().trim();\n let tagList = State.tags.filter(t => t !== tag);\n State.tags = tagList;\n setState(State);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allows the owner of the airdrop smart contract to airdrop (or batch transfer) tokens. | function airdropTokens() {
//First check that the erc20Instance is defined.
if(erc20InstanceDefined()) {
//Now we need to check who is the owner of the airdrop contract by invoking the getOwner() function.
//The details of this funciton can be found in the Owned.sol smart contract code.
airdropInstance.getOw... | [
"async approveTokensForTransfer() {\n const { setProtocol } = this.state;\n const tokenAddresses = this.state.tokensToApprove;\n\n tokenAddresses.forEach(async function(address) {\n console.log(\"approving..\", address);\n const txhash = await setProtocol.setUnlimitedTransferProxyAllowanceAsync(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
login and registration page ////////////////////////////////////////////////////////////////////////////////////////////////////////////// Sets the click listener for the registerbutton. This function also performs some input tests in order to give one additional layer of security before data is actually sent to the se... | function setRegisterListener() {
$("#reg_submit").on("click", function () {
var fullname = $("#reg_fullname").val();
var username = $("#reg_username").val();
var pass = $("#reg_password").val();
var passVerification = $("#reg_password_verification").val();
// in case some ... | [
"addLoginEventListener() {\n\n\t\t$(\"#login_button\").click((e) => {\n\t\n\t\t\tlet isValid = this.validateUsername();\n\t\t\tif(!isValid) {\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tisValid = this.validatePassword();\n\t\t\tif(!isValid) {\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does the filter observe an acceptedTransmitterIdTypes parameter? | get hasAcceptedTransmitterIdTypes() {
return this.hasOwnProperty('acceptedTransmitterIdTypes');
} | [
"get hasAcceptedReceiverIdTypes() {\n return this.hasOwnProperty('acceptedReceiverIdTypes');\n }",
"get hasAcceptedTransmitterSignatures() {\n return this.hasOwnProperty('acceptedTransmitterSignatures');\n }",
"filterByType(type) {\n this.sendAction('filterByType', type);\n }",
"function _shou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the dispatcher object for the given property URI | function property(propertyUri) {
return propertyDispatcher(dispatch, propertyUri);
} | [
"get() {\n return dispatcher;\n }",
"get dispatcher() {\n return this._dispatcher;\n }",
"get dispatcher() {\n return this.mDispatcher;\n }",
"function getDispatcher(handler) {\n var dispatcher = dispatcherMap.get(handler);\n if (dispatcher === voi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hover popup utility starts input : parent_id, target_id, data | function hover_popup(tooltip_id, id, data){
$(tooltip_id).mouseenter(function(){
$(id).html(data);
$(id).dialog({ autoOpen: false });
$(id).dialog({
open: function(){
$(this).parents(".ui-dialog:first").find(".ui-widget-header")
.removeClass("ui-widget-header");
}
});
... | [
"function checkHoverAction(element){\n if (element.data('hover')){\n var data = element.data(\"hover\").split(\" \");\n\n // If the parent has sharedinfo we need to add this to our hover.\n if(element.parent().attr(\"data-sharedinfo\")){\n data = (element.data(\"hover\") + \" \"+ ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all the comments for a resource | function getComments() {
$http.get(CONFIG.API_BSE_URL+'resources/' + $stateParams.id + '/comments')
.success(function(response){
$scope.comments = response.data.comments;
});
} | [
"function getAllComments() {\n return CommentModel.find().exec();\n}",
"function getComments() {\n return new Promise((resolve, reject) => {\n // first connect to data base\n connect().then(() => {\n Comment.find().then(comments => {\n resolve(comments);\n }).c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines the lookup keys for all a cells neighbors | function getNeighborKeyArray(cell) {
var north, south, east, west;
var inc=10;
console.log("enter getNeighborKeyArray");
if(cell.yPos-inc<0) {
north=null;
} else {
north=cell.xPos+":"+(cell.yPos-inc);
}
if(cell.yPos+inc>590) {
south=null;
} else {
south=cell.xPos+":"+(cell.yPos+inc);
}
if... | [
"getNeighbors(){\n\n var offSetDir = [\n [[-1,-1], [-1, 0], [0,1], [1, 0], [1,-1], [0, -1]],\n [[-1, 0], [-1, 1], [0,1], [1,1], [1, 0], [0, -1]]\n ]\n var parity = this.index.row % 2;\n var neighbors = []\n for(var i = 0; i<6; i++){\n var assocNeighbor = {row: this.index.row + offS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a task from the DOM tree and from LocalStorage | function deleteTask(deleteButton) {
var task = deleteButton.closest("task");
var tasks = document.getElementsByTagName("task");
for (i = 0; i < tasks.length; i++) {
var currentTask = tasks[i];
if (currentTask === task) {
localStorage.removeItem(i);
... | [
"function deleteStoredTask(task) {\n let tasks;\n // Check if tasks exists\n // If null then create array\n if (localStorage.getItem(\"tasks\" ) === null) {\n tasks = [];\n }\n else\n {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n const taskIndex = task.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value. | get xAxisAnnotationStrokeThickness() {
return this.i.nk;
} | [
"get strokeThickness() {\n return this._strokeThickness;\n }",
"get axisAnnotationStrokeThickness() {\n return this.i.ng;\n }",
"get axisAnnotationStrokeThickness() {\r\n return this.i.md;\r\n }",
"get strokeThickness() {\n return this.strokeThicknessProperty;\n }",
"get ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If there is a city (city?) and a DailyForecast (DailyForecast?), map it, if the index is greater than 0, return a div with the content. Index 0 is not used due to being used in the main display. | function City({ city }) {
return (
<div className="city">
<div>
<h4>{city.cityName}</h4>
<div>
<h5>Today: {city?.DailyForecasts[0]?.Date}</h5>
<div>
<p>Min {city?.DailyForecasts[0]?.Temperature.Minimu... | [
"function showDetail(city){\n var forecast = \"\";\n for(i=0;i<4;i++){\n var text = city.forecast.txt_forecast.forecastday[i];\n var simple = city.forecast.simpleforecast.forecastday[i];\n var day = {\n title: text.title,\n icon_url: text.icon_url,\n fcttext_metric: text.fc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the slider settings for the current viewport | _getSettings(viewport) {
this._sliderSettings = SliderSettingsHelper.getViewportSettings(this.options.slider, viewport);
this._thumbnailSliderSettings = SliderSettingsHelper.getViewportSettings(this.options.thumbnailSlider, viewport);
} | [
"get sliderSettings() {\n const { maxVisibleItems, orientation } = this.props\n const sliderVertical = orientation === VERTICAL\n\n const numOfVisibleItems = Math.min(maxVisibleItems, MAX_VISIBLE_ITEMS)\n\n return {\n speed: 500,\n infinite: false,\n dots: false,\n arrows: true,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pull out the last node of a node list. | lastNode(list) {
if (list.length === 0) {
return null;
} else {
return list[list.length - 1];
}
} | [
"lastNode(list) {\n if (list.length === 0) {\n return null;\n } else {\n return list[list.length - 1];\n }\n }",
"function lastNode(nodeList) {\n\n if (nodeList.length == 0) return null;\n \n return nodeList[ nodeList.length - 1 ];\n}",
"function lastNode(nod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region Init Adds listeners for DOM events for the scheduler and its events. Which events is specified in SchedulerscheduledBarEvents and SchedulerschedulerEvents. | initDomEvents() {
const me = this;
// Set thisObj and element of the configured listener specs.
me.scheduledBarEvents.element = me.schedulerEvents.element = me.timeAxisSubGridElement;
me.scheduledBarEvents.thisObj = me.schedulerEvents.thisObj = me;
// same listener used for different eve... | [
"initDomEvents() {\n const me = this; // Set thisObj and element of the configured listener specs.\n\n me.scheduledBarEvents.element = me.schedulerEvents.element = me.timeAxisSubGridElement;\n me.scheduledBarEvents.thisObj = me.schedulerEvents.thisObj = me; // same listener used for different events\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does our fallback mode think that this event is the end of composition? | function isFallbackCompositionEnd(domEventName,nativeEvent){switch(domEventName){case'keyup':// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode)!==-1;case'keydown':// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return nativeEvent.k... | [
"function isFallbackCompositionEnd(domEventName,nativeEvent){switch(domEventName){case'keyup':// Command keys insert or clear IME input.\n\treturn END_KEYCODES.indexOf(nativeEvent.keyCode)!==-1;case'keydown':// Expect IME keyCode on each keydown. If we get any other\n\t// code we must have exited earlier.\n\treturn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Methods for generating the LHS filters Sector filter | function populateSectorFilters(sectorList){
if(sectorList.length > 0){
$('#sector-filter').show();
var tempSectors = '';
$.each(sectorList,function(i,val){
tempSectors = tempSectors + '<li><label for="activity_status_'+val[0]+'" title="'+val[0]+'"><input id="a... | [
"function getSelectedFiltersSectors() {\n\t\tvar filters = [];\n\t\tvar filters = $('select#course-sector').val();\n\t\t//console.log('Selected course-sector filters: ', filters);\n\t\treturn filters;\n\t}",
"function getFilterSelections() {\n var type_1 = Ext.getCmp('t_type').getValue();\n var label_1=Ext.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show certificate field value for a selected certificate field. | function showCertificateFieldValue() {
const item = $('cert-fields').selectedItem;
if (item && item.detail.payload.val) {
$('cert-field-value').textContent = item.detail.payload.val;
} else {
$('cert-field-value').textContent = '';
}
} | [
"function showCertificateFields() {\n clearCertificateFields();\n const item = $('hierarchy').selectedItem;\n if (item && item.detail.payload.index !== undefined) {\n chrome.send('requestCertificateFields', [item.detail.payload.index]);\n }\n }",
"function selectCertificate(txtCertificate)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A helper function to define our configure functions. Loops over all properties in obj, and creates a get/set method for [key + suffix] to set that property on obj. | function configure(obj, suffix) {
angular.forEach(obj, function (v, action) {
this[action + suffix] = function (param) {
if (param === undefined) {
return obj[action];
}
obj[action] = param;
return this;
};
}, this);
} | [
"function configure(obj, suffix) {\n angular.forEach(obj, function(v, action) {\n this[action + suffix] = function(param) {\n if (param === undefined) {\n return obj[action];\n }\n obj[action] = param;\n return this;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called when end date is changed | function OnEndDateChanged(sender, eventArgs) {
ClearTimeIfNoDate(endDatePickerId, endTimePickerId);
FireDateRangeValidator();
} | [
"function _endDateOnSetTime() {\n vm.$scope.$broadcast('end-date-changed');\n }",
"dateChange(){\n if (this.date.start.getTime() > this.date.end.getTime())\n this.date.end = this.date.start;\n }",
"function _aDateEndDateOnSetTime() {\n vm.$scope.$broadcast('ass-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIND LAST ORDERED ITEM // | function findLastOrdered(container) {
var lastitem;
container.find('>.mega-entry.tp-layout.tp-ordered').each(function () {
lastitem = $(this);
});
return lastitem;
} | [
"function findLastOrdered(container) {\n var lastitem;\n\n container.find('>.mega-entry.tp-layout.tp-ordered').each(function() {\n lastitem=$(this);\n });\n\n\n return lastitem;\n }",
"function getLastItem(arr) {\n var lastItem = arr[arr.length-1]\n return lastItem\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the edit customer modal. Fills out the information of the form | function openEditCustomerModal(customer) {
$("#editCustomerModal").modal("toggle");
$("#CustomerId").val(customer.CustomerId);
$("#editCustomerModal #CustomerName").val(customer.CustomerName);
$("#editCustomerModal #CustomerAddress").val(customer.CustomerAddress);
} | [
"function openDeleteCustomerModal(customer) {\n $(\"#deleteCustomerModal\").modal(\"toggle\");\n $(\"#CustomerId\").val(customer.CustomerId);\n $(\"#deleteCustomerModal #CustomerName\").text(customer.CustomerName);\n $(\"#deleteCustomerModal #CustomerAddress\").text(customer.CustomerAddress);\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_readBlankNodeTail` reads the end of a blank node | _readBlankNodeTail(token) {
if (token.type !== ']') return this._readBlankNodePunctuation(token); // Store blank node quad
if (this._subject !== null) this._emit(this._subject, this._predicate, this._object, this._graph); // Restore the parent context containing this blank node
var empty = this._predicate... | [
"_readBlankNodeTail(token) {\n if (token.type !== ']') return this._readBlankNodePunctuation(token);\n\n // Store blank node quad\n if (this._subject !== null) this._emit(this._subject, this._predicate, this._object, this._graph);\n\n // Restore the parent context containing this blank node\n const e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the name of the currency for the main country corresponding to a given locale. For example, 'US Dollar' for `enUS`. | function getLocaleCurrencyName(locale){var data=findLocaleData(locale);return data[16/* CurrencyName */]||null;} | [
"function getLocaleCurrencyName(locale) {\n var data = findLocaleData(locale);\n return data[16 /* CurrencyName */] || null;\n}",
"function country_from_locale(locale) {\n\t\t// Sanity check\n\t\tif (!locale) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar last_dash_index = locale.lastIndexOf('-');\n\t\tif (last_dash_in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate over alphabet array and create a button for each letter | function letterButtons() {
const lettersContainer = document.querySelector('#letters-container')
lettersContainer.innerHTML = ``
for (let i = 0; i < alphabet.length; i++) {
lettersContainer.innerHTML +=
`<button type="button" id="letter-button">${alphabet[i]}</button>`
}
lettersC... | [
"function generateLetters(arr) {\n for (let i = 0; i < arr.length; i++) {\n let button = document.createElement(\"button\");\n button.classList.add(\"letter\");\n button.setAttribute(\"id\", `btn-${i}`);\n button.innerText = `${arr[i]}`;\n button.addEventListener(\"click\", letterClicked);\n lett... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the widths on the featured products navigation so the bold hover state doesn't make them jump around. | function featured_products_nav_width() {
jQuery( '.featured-products-nav li' ).each(function() {
jQuery( this ).width( jQuery( this ).width() );
});
} | [
"function setWidths() {\n\t\t\tvar unitWidth = getUnitWidth();\n\t\t\tproductListing.children(\".product-item\").css({\n\t\t\t\twidth: unitWidth\n\t\t\t});\n\t\t}",
"function calcNavWidth(event){\n\t\t\t\tvar activeItemWidth = ideas.find(\".owl-item.active\").width();\n\t\t\t\tideas.find(\".owl-nav\").css({'width... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns index of horizontal FireMeshLine closest to y | horzIdxAt (y) {
const pt = this.bounds().snapY(y)
return Math.max(0, Math.min(this.bounds().yInterval(pt), this._horz.length - 1))
} | [
"idxAt (y) {\n const idx = (y - this._top) / this._hstep\n return Math.round(Math.max(0, Math.min(this._hlines.length - 1, idx)))\n }",
"function findNearest(x, y){\n var i = -1;\n var close = -1;\n board.forEach((film, j) => {\n // verify that there is a film which meets the condition of t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the current minheight value. | getMinHeight(){return this.__minHeight} | [
"get minHeight() {}",
"getMinHeightUnit(){return this.__minHeightUnit}",
"get minHeight() {\n if (this._minHeight || this._minHeight === 0) {\n return this._minHeight;\n }\n if (!this.inline) {\n let minHeight = 645;\n switch (this.displayDensity) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
attach a handler to get called when ANY scroll action happens on the page. this was impossible to do with normal on/off because 'scroll' doesn't bubble. returns `true` on success. | function bindAnyScroll(handler) {
if (window.addEventListener) {
window.addEventListener('scroll', handler, true); // useCapture=true
return true;
}
return false;
} | [
"_onScroll(e) {\n this._checkScroll();\n }",
"function bindAnyScroll(handler) {\r\n\tif (window.addEventListener) {\r\n\t\twindow.addEventListener('scroll', handler, true); // useCapture=true\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"function bindAnyScroll(handler) {\n\tif (window.addEventListen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called when the JSON data has been received, this method creates a new object to store the details in, and triggers the updateMessengerDetails event on the document if the data came back successfully, and the user's status is different from last time (or this is the first time) | function receiveStatus(data) {
//if the data was received successfully...
if ((data.result.code == "200") && (data.result.response == "OK")) {
//...and if either there are no current details, or the user's status has changed
if ((myMessengerDetails == null) || (data.status != myMessengerDetails.status)) {
... | [
"async handleUserCreatedEvent(data = {}) {\n let logger = Logger.create(\"handleUserCreatedEvent\", data.trackId);\n logger.info(\"enter\", data);\n\n // Try to create customer.\n try {\n let result = await this.customerHandler.create(\n data,\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Dino Compare Method 1 NOTE: Weight in JSON file is in lbs, height in inches. | function compareWeight (dinoWeight, weight) {
const factor = dinoWeight / weight
return `Weighs ${factor} times as much as you`
} | [
"function compareFilesMain(file) {\n let mainFile = [];\n let sumSimArr = [];\n let sumSim = 0;\n let objArr = [];\n\n let fileObject = JSON.parse(file);\n console.log(\"parse\" + fileObject);\n\n //Decides which file of the object is the main file.\n for (let item in fileObject) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a UniversalDate corresponding to the last millisecond of the day | getEndOfDay() {
const endOfDay = new UniversalDate(this.date);
endOfDay.date.setUTCHours(23);
endOfDay.date.setUTCMinutes(59);
endOfDay.date.setUTCSeconds(59);
endOfDay.date.setUTCMilliseconds(999);
return endOfDay;
} | [
"function maxDate() {\n return new Date(8640000000000000);\n }",
"function _date_to_utc_date(aDate)\r\n{\r\n\tif(aDate==undefined) aDate=new Date();\r\n\r\n\tvar intOsOffsetMilliseconds = aDate.getTimezoneOffset() * 60000;\r\n\tvar intDateMilliseconds = aDate.getTime();\r\n\tintDateMilliseconds ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: fnGetMaxLenString Purpose: Get the maximum strlen for each data column Returns: string: max strlens for each column Inputs: int:iCol column of interest | function fnGetMaxLenString( iCol )
{
var iMax = 0;
var iMaxIndex = -1;
for ( var i=0 ; i<_aaDataMaster.length ; i++ )
{
if ( _aaDataMaster[i][iCol].length > iMax )
{
iMax = _aaDataMaster[i][iCol].length;
iMaxIndex = i;
}
}
if ( iMaxIndex >= 0 )
return _aaDataMaster[... | [
"function _fnGetMaxLenString(oSettings, iCol) {\n\t\t\tvar iMax = -1;\n\t\t\tvar iMaxIndex = -1;\n\n\t\t\tfor (var i = 0; i < oSettings.aoData.length; i++) {\n\t\t\t\tvar s = oSettings.aoData[i]._aData[iCol];\n\t\t\t\tif (s.length > iMax) {\n\t\t\t\t\tiMax = s.length;\n\t\t\t\t\tiMaxIndex = i;\n\t\t\t\t}\n\t\t\t}\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads up the SSL credentials that can be used with the https module. If the key or certificate cannot be found, then an undefined is returned. | function loadSslCredentials() {
var privateKey = loadFileAsStringOrUndefined(config.privateKeyFilePath, 'utf8'),
certificate = loadFileAsStringOrUndefined(config.certificateFilePath, 'utf8');
if (!privateKey || !certificate) {
return undefined;
}
return {key: privateKey, cert: certificate}
} | [
"getHttpsCredentials() {\n if (this.configuration.https.privateKey && this.configuration.https.certificate) {\n try {\n const privateKey = fs.readFileSync(this.configuration.https.privateKey, 'utf8');\n const certificate = fs.readFileSync(this.configuration.https.cert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xGetCSSRules, Copyright 20062007 Ivan Pepelnjak ( Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL xGetCSSRules extracts CSS rules from the style sheet object (IE vs. DOM CSS level 2) | function xGetCSSRules(ss) { return ss.rules ? ss.rules : ss.cssRules; } | [
"function _getStyleSheetRules(doc)\n{\n\tvar ret = '';\n\n\t// get the all the css styles defined in the containing document\n\t// so they can be applied to the iframe\n\tif (this.m_isIE)\n\t{\n\t\tfor (var i = 0; i <= doc.styleSheets.length - 1; i++)\n\t\t{\n\t\t\tret += doc.styleSheets[i].cssText;\n\t\t}\n\t}\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compile a drop unique key command. | dropUnique(column, indexName) {
indexName = indexName ? this.formatter.wrap(indexName) : this._indexCommand('unique', this.tableNameRaw, column);
this.pushQuery(`alter table ${this.tableName()} drop index ${indexName}`);
} | [
"dropPrimary() {\n this.pushQuery(`alter table ${this.tableName()} drop primary key`);\n }",
"exitUnique_key_clause(ctx) {\n\t}",
"exitUniqueKeyColumnConstraint(ctx) {\n\t}",
"exitDrop_primary_key_or_unique_or_generic_clause(ctx) {\n\t}",
"dropPrimaryKey(tableName, oldName, options) {\n var LF, esc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an Alaw value to 16bit linear PCM function alaw2linear(unsigned char a_val) | function alaw2linear(a_val) {
var t;
var seg;
a_val ^= 0x55;
t = (a_val & QUANT_MASK) << 4;
//seg=((unsigned)a_val&SEG_MASK)>>SEG_SHIFT;
seg = (a_val & SEG_MASK) >> SEG_SHIFT;
switch (seg) {
case 0:
t... | [
"function linear2ulaw(pcm_val) // 2's complement (16-bit range)\n {\n var mask;\n var seg;\n //unsigned char uval;\n var uval;\n\n // Get the sign and the magnitude of the value.\n if (pcm_val < 0) {\n pcm_val = BIAS - pcm_val;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show questions and hide intro page | function showQuestion() {
var showQuestion = document.getElementById("showQuestion");
showQuestion.style.display = "block";
var intro = document.getElementById("intro");
intro.style.display = "none";
var currentQuestion = questions[currentQuestionIndex];
questionEl.innerHTML = currentQuestion.q... | [
"function showFirstQuestion() {\n document.getElementById('intro').style.display = \"none\";\n document.getElementById('pass').style.display = 'none';\n document.getElementById('fail').style.display = 'none';\n document.getElementById('q1').style.display = 'block';\n}",
"function showQuestions () {\n\t$(\".qu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
E.g. getSupportingHexagram('110011') > '100001' | function getSupportingHexagram(hexagramCode){
return hexagramCode.substring(1, 4) + hexagramCode.substring(2, 5);
} | [
"function hashAnagram(s){\n return s.split(\"\").sort().reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0); \n}",
"function hashAnagram(s) {\n return s\n .split(\"\")\n .sort()\n .reduce(function (a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
put menu object data into an array of arrays form: arrayIndex.items = [array of options where parentID = arrayIndex] | function buildMenuArray(){
menuArray = [];
tempArray = [];
for(var i=0; i<menuData.length; i++){
var id = menuData[i].id;
var label = menuData[i].label;
var parentID = menuData[i].parentID;
var temp = {'id':id,'label':label,'parentID':parentID};
if(tempArray[parentID]){
if(!(tempArray[parentID]... | [
"flattenMenuItems(menu) {\n const object = menu.items || {};\n let items = [];\n for (let index in object) {\n const item = object[index];\n items.push(item);\n if (item.submenu)\n items = items.concat(this.flattenMenuItems(item.submenu));\n }\n return items;\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to call in the event that the user selects a new program of study param newChosenProgram the name of the chosen program (e.g. SOENGeneralCoop); directly links to _id value of sequence in courseSequences DB | updateChosenProgram(newChosenProgram){
// remember the program selected by the user
newChosenProgram ? localStorage.setItem("chosenProgram", newChosenProgram) :
localStorage.removeItem("chosenProgram");
// clear the saved sequence to force a reloading of the user's ch... | [
"function clickedProgram(){\n\t $(\".program_table tbody .rows\").click(function(e){\n\t \tvar program_id = $(this).attr('id').trim();\n\t \tprogramInfo(program_id);\n\t });\t\n\t}",
"function addProgram(obj) {\n let prg = JSON.parse(JSON.stringify(obj));\n if (programExist(prg)) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Added by Luis in order to retrieve use the tpk layer Parse the zip file contents into a zip.Entries object | zipParser(blob){
var zip = O.esri.zip;
var _this = this;
/*O.esri.*/zip.createReader(new /*O.esri.*/zip.BlobReader(blob), function (zipReader) {
zipReader.getEntries(function (entries) {
_this.initMap(entries);
//if(entries)alert("TPK downloaded and unzipped!");
zipReader.close(f... | [
"async function getFile (zipFile, entryData) {\n const entryValues = {}\n Object.keys(entryData).forEach(k => {\n entryValues[k] = { value: entryData[k] }\n })\n const entry = Object.create(yauzl.Entry.prototype, entryValues)\n\n const readStream = await zipFile.openReadStreamAsync(entry)\n\n const fileDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Positions the specified row of nodes. Modifies `rect`. | function position(row, rowFixedLength, rect, halfGapWidth, flush) {
// When rowFixedLength === rect.width,
// it is horizontal subdivision,
// rowFixedLength is the width of the subdivision,
// rowOtherLength is the height of the subdivision,
// and nodes will be positioned from left ... | [
"function position(row,rowFixedLength,rect,halfGapWidth,flush){\n// When rowFixedLength === rect.width,\n// it is horizontal subdivision,\n// rowFixedLength is the width of the subdivision,\n// rowOtherLength is the height of the subdivision,\n// and nodes will be positioned from left to right.\n// wh[idx0WhenH] me... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether this region are positively selected. Region include the start and end point. And check whether correted located the selected causal sites. | function checkSelectionAndCheckLocating(start,end, s_index){
// console.log("-------------------");
var temp_arr = [];
var s_val = 0;
var n = 0;
for (var i = start; i <= end; i++) {
// console.log("I: " + val_array[i]);
temp_arr.push(Math.abs(val_array[i]));
if (i == s_index){
if(!isNaN(val_array[i])){
... | [
"function checkRegion(coordinates) {\n\n}",
"static NotInsideRegionVec(p, topLeft, botRight) {\n return (p.x < topLeft.x) || (p.x > botRight.x) || (p.y < topLeft.y) || (p.y > botRight.y);\n }",
"checkIntersectionRegion(region) {\n return this.checkIntersection(region.x, region.y, region.width, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================== get complete informations of selected affiliate ======================================================== | function getAffiliate(affiliate_value)
{
RMPApplication.debug("=> begin getAffiliate: affiliate_value = ", affiliate_value);
c_debug(dbug.init, "=> getAffiliate: affiliate_value = ", affiliate_value);
var options = {};
var input = {};
var query = {};
query.affiliate = { "$regex" : affiliate_valu... | [
"function getAffiliateInfo(generator, affiliatteID) {\n\tdb.query(\"SELECT * FROM `gaming`.`affiliates` WHERE `affiliate_id`=\\\"\"+affiliatteID+\"\\\" LIMIT 1\", generator);\n}",
"async function getAffData() {\n window.selectedaff = \"Select affiliaion\";\n var res = await get_all_affiliations();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns `true` if `node` is considered "empty", which means that it contains no nongenerated fields, and no ref query dependencies. | function isEmpty(node) {
if (!node.canHaveSubselections()) {
return node.isGenerated() && !node.isRefQueryDependency();
} else {
return node.getChildren().every(isEmpty);
}
} | [
"function isEmpty(node) {\n\t if (node.isScalar()) {\n\t return node.isGenerated() && !node.isRefQueryDependency();\n\t } else {\n\t return node.getChildren().every(isEmpty);\n\t }\n\t}",
"function isEmpty(node) {\n if (!node.canHaveSubselections()) {\n return node.isGenerated() && !node.isRefQueryDe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main function This implementation only creates and runs MFOR Mock Server | function main() {
mforServer.run(mforSnapshotsPath, mforGenerator.generateData(mforSnapshotsPath), mforPort)
} | [
"function HWorkerServerMock() {}",
"function run() {\n var ip = '127.0.0.1',\n port = 23542,\n server = express.createServer();\n\n server.use(express.bodyParser());\n server.get('/v1.1/token/:tokenId', handleRequest_v_1_1);\n server.post('/v2.0/tokens', getToken_v2_0);\n server.get('/v2.0/tokens/:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show / hide live icon | function showhideliveicon(unit, statushow) {
//ignore args
//Go through all icons hide/show as needed depending on checkbox status
placeliveicons();
} | [
"function showIcon(icon){\n //Clear Icons\n document.querySelector('.icon-remove').style.display = 'none';\n document.querySelector('.icon-check').style.display = 'none';\n\n //show icon\n document.querySelector(`.icon-${icon}`).style.display = 'inline-flex';\n}",
"iconInfoDisplay(iconInfo, clicked... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::Kendra::DataSource.InlineCustomDocumentEnrichmentConfiguration` resource | function cfnDataSourceInlineCustomDocumentEnrichmentConfigurationPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnDataSource_InlineCustomDocumentEnrichmentConfigurationPropertyValidator(properties).assertSuccess();
return {
Condition: cfnD... | [
"function cfnDataSourceCustomDocumentEnrichmentConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDataSource_CustomDocumentEnrichmentConfigurationPropertyValidator(properties).assertSuccess();\n return {\n InlineConfigurat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle project form submission | function handleProjectFormSubmit(event) {
event.preventDefault();
var projectName = projectNameInputEl.val().trim();
var projectType = projectTypeInputEl.val().trim();
var hourlyRate = hourlyRateInputEl.val().trim();
var dueDate = dueDateInputEl.val().trim();
printProjectData(projectName, projectType, hou... | [
"function handleProjectFormSubmit(event) {\n event.preventDefault();\n postProject();\n }",
"function handleProjectFormSubmit(event) {\n event.preventDefault()\n if (navigator.onLine){\n API.addProject({\n project: projectFormObject.project\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the cross filter such that only views data for the given custom list row id persists. Assumes crossfilter has been cleared. Adds the filters to filteredDimensions array. Has many side effects on crossftiler environment. This needs to be used in conjunction with accumulate group | function filterViewsOnlyForCustomListRowId(crossfilter, customListRowId) {
var userInputHeader = cf.dimension(function(d) {
return d.pcuihId;
});
userInputHeader.filter(function(p) {
return p == 13 || p == -1;
});
var arg1dimension = cf.dimension(function(d) {
return d.arg1;
});
arg1dimension.... | [
"function filterFavoritesOnlyForCustomListRowId(crossfilter, customListRowId) {\n\t\tvar userInputHeader = crossfilter.dimension(function(d) {\n\t\t\treturn d.pcuihId;\n\t\t});\n\n\t\tuserInputHeader.filter(function(p) {\n\t\t\treturn p == 1 || p == -1;\n\t\t});\n\n\t\tvar arg1 = crossfilter.dimension(function(d) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
animate the balls in survival mode | function animate(){
'use strict';
if (!active){
clear();
game = -1;
over = true;
screen = 3;
gameOver();
return;
}
//update
for (var i = 0; i < balls.length; i++){
balls[i].nextX = balls[i].x + balls[i].dx;
balls[i].nextY = balls[i].y + balls[i].dy;
}
//update to wall collisions
for (var i = 0... | [
"playBallAnimation() {\n\t\tthis.ballTimeDiff = new Date().getTime() - this.presentBallTime;\n\t\tif(this.ball.y < this.groundBoundary)\n\t\t\tthis.ballPathMovement();\n\t\telse \n\t\t\tthis.resetBowlingpositions();\n\t}",
"function animate() {\r\n\t\t// bounce off left or right wall\r\n\t\tball.dx = (ball.right(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Choose the correct function to display the answer for either the correct answers or the user answers for the answer screen /answerSet: the set of texts to be displayed either the correct answers or the user answers /idStem: the base of the answer box ids | function displayAnswerText(answerSet, idStem) {
//Variable
///The output of the function, returned at the end
var output = "";
//Display answer
///Depending on the type of question load an answer set in the correct format for the answer screen
switch (userSession.questionData.type){
... | [
"function displayBasicQuestion(answerSet, idStem) {\r\n //Variables\r\n ///An array to store all of the HTMl for the display - returned from the function as a joined string\r\n var answerBox = [];\r\n\r\n //Generate display\r\n ///For each question prompt\r\n for(var i = 0; i < answerSet.length; i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove the last character from the current keyboard value. | backspace() {
this.mutate(this.value.slice(0, this.value.length - 1));
} | [
"removeEndEventKey() {\n var lastChar = this.rawKeyEventArray[this.rawKeyEventArray.length - 1].key;\n console.log(lastChar);\n if(lastChar == \"Dead\") {\n this.rawKeyEventArray.pop();\n }\n }",
"updateLastChar() {\n char = this.state.resultText.split('').pop();\n if (isNaN(char)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes all percentage encoded strings within str. | function percent_decode (str)
{
var percent_index;
var search_index = 0;
var result_str = '';
var hex;
percent_index = str.indexOf("%", search_index);
while (percent_index != -1) {
/* Get the two hex digits that come immediately after the percent */
hex = str.slice(percent_index... | [
"function stringPercentDecode(input) {\n /**\n * 1. Let bytes be the UTF-8 encoding of input.\n * 2. Return the percent decoding of bytes.\n */\n return percentDecode(util_1.utf8Encode(input));\n}",
"function convertPercentage(string) {\n string.replace('%', '');\n string = parseFl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function that takes a number and calculates if the represented square should be dark or light. | lightOrDark(index) {
let x = index % 8;
let y = Math.floor(index / 8);
let oddX = x % 2;
let oddY = y % 2;
return (oddX ^ oddY) ? squareType.dark : squareType.light;
} | [
"function isdark(color){\r\n\tvar colr = parseInt(color.substr(1), 16);\r\n\treturn (colr >>> 16) // R\r\n\t\t+ ((colr >>> 8) & 0x00ff) // G \r\n\t\t+ (colr & 0x0000ff) // B\r\n\t\t< 500;\r\n}",
"function isdark (color) {\n var colr = parseInt(color.substr(1), 16)\n return (colr >>> 16) + // R\n ((colr >... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set up the function for the reload button. If the Puppeteer API isn't given enough time, this button helps display the correct screenshots, using a timestamp. | function reload() {
var source =
"http://localhost:3000/images/puppeteer.png?t=" + new Date().getTime();
var image = document.getElementById("PImage");
setTimeout(function () {
image.setAttribute("src", source);
}, 100);
var source2 =
"http://localhost:3000/images/puppeteer2.png?t=" + new Date().g... | [
"function refresh(time) {\n location.reload();\n}",
"function populateReloadButton()\n{\n// $( \"#Reload\" ).html( reload_button_values[Math.round( Math.random() * reload_button_values.length )] );\n}",
"function Refresh() {\n setTimeout(() => {\n location.reload();\n }, 50000);\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functionality: Receives the class key as input (Ex. "CSE3") and parses the url using the class key in order to generate the correct link to open | getSOEWebpage(classKey) {
classKey = classKey.replace(/\s/g, ''); // remove spaces
link = "https://courses.soe.ucsc.edu/courses/" + classKey
WebBrowser.openBrowserAsync(
link
);
} | [
"function changeLink() {\n let newLink = prompt(\"Enter the new link for \" + activeClass);\n if (newLink.startsWith(\"https://bca.schoology.com/course/\")) {\n classes[activeClass] = newLink;\n } else {\n alert(\"Invalid link!\");\n }\n exit();\n saveClasses();\n renderClasses();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========= MUD_SetMsgElements ============= PR20200802 PR20221231 | function MUD_SetMsgElements(response){
console.log( "===== MUD_SetMsgElements ========= ");
// TODO switch to render msg box
const err_dict = (response && "msg_err" in response) ? response.msg_err : {};
// was const validation_ok = get_dict_value(response, ["validation_ok"], false);
... | [
"function MENVIT_SetMsgElements(update_dict){\n //console.log( \"===== MENVIT_SetMsgElements ========= \");\n //console.log( \"update_dict\", update_dict);\n const error_dict = get_dict_value(update_dict, [\"error\"], []);\n const errordict_not_empty = !isEmpty(error_dict);\n\n// --- lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that the current `MatSort` does not already have a sortable header with the provided id. | deregisterId(context, id) {
const matSort = context.injector.get(MatSort);
const matSortHeader = matSort.sortables.get(id);
if (matSortHeader) {
matSort.deregister(matSortHeader);
}
} | [
"function MatSortHeaderColumnDef() {}",
"function MatSortHeaderColumnDef() { }",
"register(sortable) {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!sortable.id) {\n throw getSortHeaderMissingIdError();\n }\n if (this.sortables.has(sortable.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fade out old container | fadeOut() {
const self = this;
// "Unload" Animation - onComplete callback
TweenMax.to($(this.oldContainer), 0.4, {
opacity: 0,
onComplete: () => {
this.fadeIn();
}
});
} | [
"fadeIn() {\n const self = this;\n const $el = $(this.newContainer);\n // Hide old Container\n $(this.oldContainer).hide();\n\n $el.css({\n visibility: 'visible',\n opacity: 0\n });\n\n TweenMax.to($el, 0.4, {\n opacity: 1,\n onComplete: () => {\n this.done();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init map, Tiling, and Routing | function mapInit() {
map = L.map('map').fitWorld();
// Map tiling
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https... | [
"function initMap() {\n mapObj.initMap(45.753, 4.850);\n getStationLocations(refresh);\n}",
"function initMaps() {\n initMapChurch();\n initMapVilla();\n}",
"function initialize() {\n\tcreateMap();\n\tupdateMap();\n}",
"function initMapwithRoutes(idlist){\n initMap();\n get_stages_and_visual... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compares guessDigits with random numbers generated and stored in num variable. It displays output C for correct digit in correct place It diplays X for correct digit wron place It displays B for incorrect digit Each display is under the corresponding digit | function checkGuess(num1, num2, num3, num4, digitGuess1, digitGuess2, digitGuess3, digitGuess4, tryNumber, digitGuess, triesLeft) {
resetResultDisplay();
if (num1 == digitGuess1) {
document.getElementById("result1").value = "C";
result1 = "C ";
} else if (num1 == digitGuess2 || num1 == dig... | [
"function guess() {\r\n\r\nlet number = ((Math.random() * 1001) - 1).toFixed(0);\r\nlet guess = Number(prompt(\"Enter an integer between 1 and 1000.\"));\r\nwhile (guess > 1000 || guess < 1 || guess%1 != 0) {\r\n guess = Number(prompt(\"Please enter a valid INTEGER between 1 and 1000.\"));\r\n}\r\n let guessNumbe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to generate the pie chart | function generatePieChart() {
var pieChartOutline = {
"header": {
"title": {
"text": "Inheritance",
"fontSize": 20,
"font": "Helvetica Neue",
// "font-weight": "bold",
},
"subtitle": {
... | [
"function pieChart() {\n let results = countStates();\n let states = results[0];\n let total = results[1];\n\n // Draw pie chart\n let radius = 75;\n let lastAngle = 0;\n for (let i = 0; i < states.length; i++) {\n let angle = states[i] / total * TWO_PI;\n if (angle === 0) continu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copy_file: copy source to target, but only if the source is newer than the target. | function copy_file(source, target) {
if (fs.existsSync(target)) {
var sstat = fs.statSync(source);
var tstat = fs.statSync(target);
if (sstat.mtime <= tstat.mtime) {
return;
}
} else {
fs.ensureDirSync(path.dirname(target));
}
log("copy:", source, "->"... | [
"function copyFileSync(source, target) {\n fs.writeFileSync(target, fs.readFileSync(source));\n}",
"function CopyFile(source, destination, target)\n{\n if (source.length == 0)\n return false;\n \n var sourcefile = Components.classes[\"@mozilla.org/file/local;1\"]\n .createInstance(C... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unsubscribe to all functions within a namespace. | function unsubscribeAll(namespace, publicFunctions, observable){
var arr2, y;
for(y in publicFunctions){
//wildcard syntax
arr2 = y.match(/(.*)/);
if (arr2 != null) {
observable.unsubscribe(publicFunctions[arr2[0]]);
}
}
} | [
"function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }",
"function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }",
"unsubscribe() {\n mainLog.info('Unsubscribing from Lightning gRPC streams')\n this.mainWindow = null\n Object.keys(thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
don't do this stupid things : e.style.prop | function getProp(e, prop) {
return e.style[prop];
} | [
"function applyStyle(e, style) {\n for (var k in style) {\n var v = style[k];\n if (k == \"text\") e.appendChild(document.createTextNode(v));else if (k == \"html\") e.innerHTML = v;else if (k == \"attributes\") {\n for (var a in v) {\n e[a] = v[a];\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scrolls the suggestion box to the given position | function doScroll(to) {
autoScrolled = true;
if (to > -1) {
var pos = $suggestionBox.find('li:eq(' + to + ')').position().top -
$suggestionBox.find('li:eq(0)').position().top;
}
// find scroll position at to and set scroll bars to it
... | [
"function autocomplete() {\n element = document.getElementById('autocomplete-position');\n var top = $('#autocomplete-position').offset().top - $('#position-fixer').offset().top;\n var rect = element.getBoundingClientRect();\n var width = element.offsetWidth;\n $('.autocomplete-suggestions').css('top... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display BMPs Name or info | function displayBMPname(obj, Type) {
var objectDiv = document.getElementById(obj);
if (Type == 'show') { objectDiv.style.display = 'block';}
if (Type == 'hide') { objectDiv.style.display = 'none';}
} | [
"function printImageLB(fullImg, group, title, thumbImg, altText, height, width) {\n var s = getImageLBText(fullImg, group, title, thumbImg, altText, height, width);\n document.write(s);\n}",
"function displayInfo() {\n\tctx.fillStyle = '#FFFFFF';\n\tctx.font = '16px Times New Roman';\n\tfor (var i = 0; i < live... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create popup showing all users followed | function createAllFollowing(div, responseAsJson, apiUrl, authToken){
const array = createPopup("allfollowing", "Everyone you follow"); //popup has to be enlarged
const allDiv = array[0];
let content = array[1];
const close = array[2];
close.onclick = function(){ openEdit(allDiv, div)};
for (let id of responseAsJs... | [
"showFollowers() {\n this.user.$getFollowers(users => {\n this.openModal(`@${this.user.name}'s followers`, users);\n });\n }",
"showFollowing() {\n this.user.$getFollowing(users => {\n this.openModal(`People followed by @${this.user.name}`, users);\n });\n }",
"function follow_user_windo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defer the onetime calculation of a number value to synthesis time Use this if you want to render a number to a template whose actual value depends on some state mutation that may happen after the construct has been created. If you are simply looking to force a value to a `number` type and don't need the calculation to ... | static numberValue(producer) {
return token_1.Token.asNumber(new LazyNumber(producer, false));
} | [
"NumericLiteral() {\n const token = this._eat('NUMBER');\n return {\n type: 'NumericLiteral',\n value: Number(token.value),\n };\n }",
"function numberTransformer() {\n return context => {\n const visit = node => {\n if (ts.isNumericLiteral(node)) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluates, or attempts to evaluate, a VoidExpression | function evaluateVoidExpression({ node, environment, evaluate, statementTraversalStack }) {
evaluate.expression(node.expression, environment, statementTraversalStack);
// The void operator evaluates the expression and then returns undefined
return undefined;
} | [
"Evaluate() {}",
"static isVoidExpression(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.VoidExpression;\r\n }",
"visitVoidExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function evaluateOmittedExpression(_options) {\n return undefined;\n}",
"function evaluate(stm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cont(thunk) Continuation constructor. `thunk` is a nullary closure, resulting in a `done` or a `cont`. | function cont(thunk) {
if(!(this instanceof cont)) return new cont(thunk);
this.isDone = false;
this.thunk = thunk;
} | [
"function Cont(func, contList, done) {\n if (!(this instanceof Cont)) {\n return new Cont(func, contList, done);\n }\n this.func = func;\n this.contList = contList;\n this.done = done;\n}",
"function Trampoline(cont) {\n \n while(typeof cont == \"function\" && cont.type == \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to update SO status in cloudhub when Cash Sale is created in NetSuite. | function SyncSoCashSale(type) {
nlapiLogExecution('DEBUG', 'type', type);
try {
if (type != 'delete') {
var SO = nlapiGetFieldText('createdfrom');
if ((SO != null)&&(SO != '')&&(SO.search('Sales Order')!= -1)) {
var string1 = '{ '; //Creating the body with data as requested by CLoudhub to Update SO in SF... | [
"function updateSoStatus(dicLine,dicHeader){\n //use for capture current status of sales order\n getSOStatus(dicLine,dicHeader);\n var record = {};\n if(dicLine.SoStatus === '0'){\n var status = parseInt(dicLine.SoStatus ,10);\n var conn = $.db.getConnection();\n\tvar query2 = 'UPDATE \"MD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DISPLAY FAVOURITES SECTION (if there are any favourites) | function displayFavouritesSection(){
if(favourites == null){
favourites = [];
}
if(favourites.length == 0){
$('#favourites-section').empty();
$("#favourites-section").hide();
}
else{
displayFavouriteItems();
$("#favourites-section").show();
}
} | [
"function showFavorites() {\n printFavoritesPlaylists(user_playlists[0].songs, 0, 0);\n}",
"function displayFavorites() {\n favoritesService.getFavorites(function(favorites) {\n movieList.innerHTML = \"\";\n for(var i in favorites) {\n var movieElement = buildMovieElement(favorites[i], false)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The default fragment shader source | static get defaultFragmentSrc()
{
return [
'varying vec2 vTextureCoord;',
'varying vec2 vFilterCoord;',
'uniform sampler2D uSampler;',
'uniform sampler2D filterSampler;',
'void main(void){',
' vec4 masky = texture2D(filterSampler, v... | [
"fragmentShaderSource() {\n return `\n precision mediump float;\n\t\t\tvarying vec3 vPosition;\n\t\t\tvarying vec3 vNormal;\n\t\t\tvarying vec3 vColor;\n\n\t\t\tvoid main() {\n\t\t\t\tgl_FragColor = vec4(vColor, 1.0);\n\t\t\t}`;\n }",
"function ShaderFragment() {\n}",
"static get defaultV... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function to get the breakpoint name of bootstrap. | function getBreakpointClassName() {
var width = $(window).width();
var size = 'md';
// Reference the css defined breakpoint.
if (width >= 1300) {
size = 'lg';
}
return size;
} | [
"get breakpointClass() {\n if ((0, _runtime.macroCondition)((0, _runtime.config)(\"/home/emirpecanin/Public/Testing grounds/lib-app-bootstrap/node_modules/ember-bootstrap\").isBS3)) {\n return undefined;\n } else {\n let toggleBreakpoint = this.toggleBreakpoint;\n\n if (Ember.isBlank(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
At points table, this function quits the player from the total sum | function quitPlayerPoints( points ){
var totalPointsCell = document.getElementById("totalPointsCell"); //Obtain the cell with the sum
var total = totalPointsCell.textContent.split(":")[1]; //Only the number (TOTAL:22)
var totalInt = parseInt( total, 10 ); //Parse it
totalInt -= points; ... | [
"function addPlayerPoints( playerRow ){\r\n\t\t\r\n\t\t\tvar totalPointsTable = document.getElementById(\"totalPointsTable\");\t\t//Table where the sum it is\r\n\t\t\tvar totalPointsCell = document.getElementById(\"totalPointsCell\");\t\t//Cell of the total sum\r\n\t\t\t\r\n\t\t\tvar temp = playerRow.textContent.sp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |