query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Handles all actions at the start of a resize event event > The event variable ui > the ui element handed down from the jquery handler | function handleResizeStart(event, ui){
resizeStartX = parseInt(ui.element.attr('col'));
resizeStartSizeX = parseInt(ui.element.attr('sizex'));
resizeStartY = parseInt(ui.element.attr('row'));
resizeStartSizeY = parseInt(ui.element.attr('sizey'));
switch(resizeDir){
case 'n':
$('#'+ui.element.attr('id')... | [
"function UIResizeEvent(){\n\n}",
"function _resizeHandler() {\n }",
"function resizeit(){\nconsole.log(\"IN\");\n \t$( \".resizable\" ).resizable();\n}",
"onResizeStart() {}",
"onResizeEnd() {}",
"function initResizeHandler(){\r\n lyteboxResizeHandler();\r\n}",
"_onResizeMe(e) {\n this._refl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Locations from posts | function getPosts(posts) {
var i = 0;
var totalPost = parseInt($(`#total_posts`).val());
if (totalPost > 0) {
while (i < totalPost) {
posts.push($(`#post_${i}`).attr("location"));
i++;
}
}
} | [
"SET_POSTS(state, posts) {\n state.posts = posts\n }",
"function setCityLocs() {\n $.each(cities, function(key, value){\n var top = this.top,\n left = this.left,\n width = '1600',\n height = '824';\n value.topPos = ( $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Population AsyncStorage with default settings | _setInitialSettings() {
let settings = [
{
id: 'adrenaline_timer',
title: 'Minuteur d\'adrénaline',
value: '3'
},
{
id: 'adrenaline_unit',
title: 'Quantité d\'adrénaline injectée',
value: '1... | [
"async init() {\n // read local settings\n let { settings } = await storage.local.get('settings');\n\n // if there are no settings, set default\n if (!settings) {\n settings = Object.assign({}, DEFAULTS);\n storage.local.set({ settings });\n } else {\n // if the setting... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setInternalCampaignId: Internal Campaign ID where: all pages what: internal campaign ids | function setInternalCampaignId() {
if(!s.eVar10) {
s.eVar10=s.getQueryParam('intcid');
s.eVar10=s.getValOnce(s.eVar10,'s_eVar10',0);
return s.eVar10;
}
} | [
"function setInternal()\r\n{\r\n\tinternal = true;\r\n}",
"setCampaign(campaign) {\n dispatch(setCampaign(campaign));\n }",
"setCampaign(campaign) {\n dispatch(setCampaign(campaign));\n dispatch(campaignsRefetchRequire());\n }",
"setExternalId(externalId){this._externalId=externalId;return this;}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var newTrait = compose(trait_1, trait_2, ..., trait_N) | function compose(var_args) {
var traits = slice(arguments, 0);
var newTrait = {};
forEach(traits, function (trait) {
forEach(getOwnPropertyNames(trait), function (name) {
var pd = trait[name];
if (hasOwnProperty(newTrait, name) &&
!newTrait[name].required) {
... | [
"function compose () {\n \t// Create a new property descriptor `map` to which all own properties of the\n \t// passed traits are copied. This map will be used to create a `Trait`\n \t// instance that will be result of this composition.\n \tvar map = {};\n \n \t// Properties of each passed trait are copied to ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the latest quote price (in Ether) for any token by requesting it from the associated exchanger. Accepts: the address of the exchanger linked with the desired token | async function getPriceQuote(exchangerAddress) {
let exchangerContract = null
if (!exchangeUI.readonly)
exchangerContract = eth.contract(exchangerABI, "", { "from": myAddress }).at(exchangerAddress)
else
exchangerContract = eth.contract(exchangerABI).at(exchangerAddress)
let totalTokens... | [
"async function getExchangePrice(tokenAddress, vsCurrency) {\n try {\n const { data } = await CoinGeckoClient.simple.fetchTokenPrice({\n contract_addresses: tokenAddress,\n vs_currencies: vsCurrency,\n });\n return data[tokenAddress].usd;\n }\n catch(err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
randomSentenceHelper checks the complexity value against rolls of Math.random to decide if a given part of speech will be present in a sentence. If it is, randomWord is called to determine the word. randomSentence also compares rolls of Math.random against complexity values to decide if the sentence will contain a rela... | randomSentence () {
let sentenceArray = []
let sentence1 = this.randomSentenceHelper();
//sentence Array tracks each relative clause generated
sentenceArray.push(sentence1);
let num = Math.random();
//loop continues to generate relative clauses until it fails to meet
//the random check.
... | [
"function randomSentence() {\n var sentenceIndex = Math.floor(Math.random()*self.sentences.length)\n\n if (self.currentSentence !== sentenceIndex) {\n self.currentSentence = sentenceIndex\n } else {\n randomSentence()\n }\n }",
"function pickRandomS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sometimes we pass around hashes of connection id for various security reasons and then when returned we can use them to find the correct channel using this method. | function fetchDCSOByHash(hash) {
var ret;
for (var i = 0; i < window.DataChannels.length; i++) {
if (window.DataChannels[i]['connectionIdHash'] === hash) {
ret = window.DataChannels[i];
break;
}
}
console.assert(ret['connectionIdHash'] === hash, 'does not pick right channel');
return ret;
} | [
"getChannelID(activeChannel) {\n const channels = this.state.channels;\n let channelID;\n for (let i = 0; i < channels.length; i++) {\n const channel = channels[i];\n if (channel.name === activeChannel) {\n channelID = channel.id;\n break;\n }\n }\n return channelID;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check route for keyword | function checkRoute(route) {
if (route && route.type === "search" && route.params && (lastChange === "" || lastChange !== route.params.search)) {
$$invalidate(0, keyword = route.params.search);
lastChange = keyword;
return true;
}
return false;
} | [
"function checkRoute() {\n const serviceId = this.$state.params.serviceId;\n const providerId = this.$state.params.providerId;\n const searchTerm = this.$state.params.q;\n if (serviceId) {\n this.showService(serviceId);\n this.$location.search('');\n this.$location.path('/tool');\n return;\n }\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the top of the surface using three planes and three circleGeometry objects to fil in the gaps that were made at the corners. This code isn't modular at all because it was difficult to get the planes to fit the paths of the 3D vectors. Had to use magic constants to get the counter to fit well. | function createTop(){
var topCounter = new THREE.Object3D();
//first counter surface
var geometry = new THREE.PlaneGeometry( 7, 55, 32 );
var material = new THREE.MeshBasicMaterial( {color: sceneParams.counterTopColor, side: THREE.DoubleSide} );
var plane = new THREE.Mesh( geometry, material );
plane.rotation.x = Ma... | [
"function createTop(){\n\nvar topCounter = new THREE.Object3D();\n\n//first counter surface\nvar geometry = new THREE.PlaneGeometry( 7, 55, 32 );\nvar material = new THREE.MeshBasicMaterial( {color: 0x3C2B13, side: THREE.DoubleSide} );\nvar plane = new THREE.Mesh( geometry, material );\n\nplane.rotation.x = Math.PI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle a field's read/write status based upon the value of a checkbox | function CheckboxToggleField(chk, field) {
var checked = chk.attr("checked");
field.attr("readonly", !checked);
if (checked) {
field.removeClass("readonly");
} else {
field.addClass("readonly");
field.val("");
}
} | [
"_toggleChecked(isChecked) {\n if (this.disabled) return\n\n this.checked = !isChecked\n this._updateTextFieldsStyle()\n }",
"function editOnCheck(flag, editField) {\n\t\teditField.disabled = !flag.checked;\n\t}",
"toggle() {\n this.checked = !this.checked;\n this._onChange(this.checked)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copy attributes from img element to svg element | function copyAttributes(img, svg) {
var attributes = img.attributes;
for (var i = 0; i < attributes[LENGTH]; ++i) {
var attribute = attributes[i];
var attributeName = attribute.name;
if (ATTRIBUTE_EXCLUSION_NAMES.indexOf(attributeName) == -1) {
var attributeValue = attribute.value;
... | [
"function copyAttributes(imgElem, svgElem) {\n var attributes = imgElem.attributes;\n for (var i = 0; i < attributes[LENGTH]; ++i) {\n var attribute = attributes[i];\n var attributeName = attribute.name;\n // Only copy attributes not explicitly excluded from copying\n if (ATTRIBUTE_EXCLUSI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selects the product desired for modification. First creates an array with just the selected product, and then filters out other products and saves the data as searchData | function selectProd(e) {
const prodId = e.target.id
const prodData = searchData.map(ele => {
if (ele._id === prodId) {
console.log(ele)
return ele
} else {
return ''
}
})
const newProdData = prodData.filt... | [
"function selectProducts() {\n // If no search term has been entered, just make the finalGroup array equal to the categoryGroup\n // array — we don't want to filter the products further — then run updateDisplay().\n if(searchTerm.value.trim() === '') {\n finalGroup = categoryGroup;\n updateDispla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the function that gets information about a folder. | function getGetFolderInfo(services) {
return function (id) {
// Variables.
var url = services.formulateVars.GetFolderInfo;
var params = {
FolderId: id
};
// Get folder info from server.
return services.formulateServer.get(url, params, function (data) {
... | [
"get folder_name(){ return require('./folder').name }",
"function Folder() { }",
"getFolderData(){\n this.send(\"folder-data-get\");\n }",
"function CFolder() {\r\n}",
"function FromFolder(folder){\n result.getId=function(){\n var id = folder.getId();\n result.getId=function(){return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle failed add aircraft | function addAircraftFailed(err) {
vm.message = LOGBOOK_CONSTANT.MSG_AIRCRAFT_ADD_ERROR;
vm.working = false;
} | [
"function addAircraftSucceeded(response) {\n queryAircraft(0);\n vm.aircraftForm.$setPristine();\n vm.aircraftForm.$setUntouched();\n vm.tempAircraft = {};\n vm.message = LOGBOOK_CONSTANT.MSG_AIRCRAFT_ADDED;\n vm.working = false;\n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if the character is a delimiter | function isDelimiter(pointer) {
var i = 0;
var len = app.delimiter.length;
if (app.meaning.content[pointer] === '!' && isLetter(app.meaning.content[pointer+1])) {
// if it is a ! followed by a letter
// it is a delimiter
return true;
}
// loop through the array of delimiter
for (i = 0; i < len; ... | [
"function isSeparator(char) {\n return (char === \"-\") || (char === \"=\") || (char === \"~\");\n}",
"isDelimiter() {\n return /^\\s*:?-+:?\\s*$/.test(this.rawContent);\n }",
"isDelimiter() {\n return this._cells.every((cell) => cell.isDelimiter());\n }",
"function isThereDelimeter(input... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End editing about me | function endEditAboutMe() {
$save_or_cancel_edit_about_me.css("display", "none");
$link_edit_about_me.css("display", "inline");
$edit_about_me.css("display", "none");
$about_me.css("display", "block");
return false;
} | [
"endEdit() {\n const { parent, node } = this.editing;\n if (parent) {\n parent.creating = parent.renaming = false;\n }\n if (node) {\n node.creating = node.renaming = false;\n this.editing.node = this.editing.parent = null;\n }\n }",
"endEdit(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the background view. | get backgroundView() {
if (!this._backgroundView) {
this._backgroundView = BrowserHelper.getBackgroundPage();
}
return this._backgroundView;
} | [
"getBackgroundStage () {\n return this._background;\n }",
"function getBackground(){\n\t\treturn background;\n\t}",
"get background() {\n return this._data.background;\n }",
"get backgroundRenderer () {\n return this._backgroundRenderer = (this._backgroundRenderer || BackgroundRendererM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
it receives the brand field and the entire object. if Brand field is not empty, it asks if the value is contained in the defaultBrands array. if not, it compares every field of the object with the defaultBrands array (may be brand is on title field). | getNormalizedBrand(aValue, anObject) {
let brand = aValue;
let object = anObject;
if (brand) {
let result = this.itContainsDefaultBrand(brand);
if (result) return result;
} else {
for (let key of Object.keys(object)) {
let result = this.itContainsDefaultBrand(object[key]);
... | [
"function checkBrands() {\n let warnUncommon = [];\n let warnMatched = [];\n let warnDuplicate = [];\n let warnFormatWikidata = [];\n let warnFormatWikipedia = [];\n let warnMissingWikidata = [];\n let warnMissingWikipedia = [];\n let warnMissingTag = [];\n let seen = {};\n\n Object.ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Puts the scheduler in a `suspended` state and executes a task immediately. | function immediately(task) {
try {
suspend();
return task();
} finally {
redux_saga_core_esm_flush();
}
} | [
"function immediately(task){try{suspend();return task();}finally{flush();}}",
"resume() {\n this._suspended = false;\n this.run(undefined);\n }",
"function immediately(task) {\n try {\n suspend();\n return task();\n } finally {\n flush();\n }\n}",
"start() {\n this.schedule... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts the app Takes the first argument and decides which function to call | function startApp() {
switch (arg_1) {
case 'spotify-this-song':
getMusic();
break;
case 'my-tweets':
getTweets();
break;
case 'movie-this':
getMovie();
break;
case 'do-what-it-says':
readRandom();
break;
default:
console.log('Wrong entry! Please try again.');
}
} | [
"function index() {\n let args = require(\"minimist\")(process.argv.slice(2));\n //Get the function to call from the parameters. This way we avoid having a big switch case statement.\n let functionToCall = args.action;\n\n try {\n if (args.action !== undefined) {\n main[functionToCall](args);\n } els... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies necessary paddings to the track container. | _layout() {
const that = this,
containerStyle = that.$.container.style,
paddingStart = that._tickIntervalHandler.labelsSize.minLabelSize / 2 + 'px',
paddingEnd = that._tickIntervalHandler.labelsSize.maxLabelSize / 2 + 'px';
switch (that.orientation) {
cas... | [
"function applyPadding() {\n t.each(function(v) {\n coords[v][0] += padding;\n coords[v][1] += padding;\n });\n }",
"resize() {\n\t\t\toptions = Splide.options;\n\t\t\ttrack = Elements.track;\n\n\t\t\tthis.gap = toPixel( root, options.gap );\n\n\t\t\tconst padding = options.padding;\n\t\t\tcons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: _fnDetectType Purpose: Get the sort type based on an input string Returns: string: type (defaults to 'string' if no type can be detected) Inputs: string:sData data we wish to know the type of Notes: This function makes use of the DataTables plugin objct _oExt (.aTypes) such that new types can easily be added. | function _fnDetectType( sData )
{
var aTypes = _oExt.aTypes;
var iLen = aTypes.length;
for ( var i=0 ; i<iLen ; i++ )
{
var sType = aTypes[i]( sData );
if ( sType !== null )
{
return sType;
}
}
return 'string';
} | [
"function _fnDetectType(sData) {\n\t\t\tvar aTypes = _oExt.aTypes;\n\t\t\tvar iLen = aTypes.length;\n\n\t\t\tfor ( var i = 0; i < iLen; i++) {\n\t\t\t\tvar sType = aTypes[i](sData);\n\t\t\t\tif (sType !== null) {\n\t\t\t\t\treturn sType;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 'string';\n\t\t}",
"function _fnDetectTy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use the userdefined expression to announce changes each time a new item is selected | function announceItemChange () {
angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));
} | [
"function announceItemChange(){angular.isFunction($scope.itemChange)&&$scope.itemChange(getItemAsNameVal($scope.selectedItem));}",
"function announceItemChange() {\n angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n }",
"function annou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
private var cs1:testC; private var dataHandler:DataHandler; | function Start () {
old_color = GetComponent.<Renderer>().material.color;
// cs1 = GetComponent("testC");
// print("c#变量" + cs1.GetType().GetField("move_speed").GetValue(cs1) + "在js中调用 ");//调用C#变量
// cs1.PrintCS("testC");
DataHandler.handler = GetComponent("DataHandler");// = GetComponent("DataHandler");
... | [
"function Demo1(){\n this.aa = 'a';\n}",
"function testObject()\n{\n this.badSyntax = cnBadSyntax;\n this.goodSyntax = cnGoodSyntax;\n}",
"function TestFunctionC(){return \"private function - you can see me from a public class\"}",
"function initClassObjects() \n{\n var /*dataType, className,*/ classO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to decrease brightness of hex colour from: | function _decrease_brightness(hex, percent){
var r = parseInt(hex.substr(1, 2), 16),
g = parseInt(hex.substr(3, 2), 16),
b = parseInt(hex.substr(5, 2), 16);
return '#' +
((0|(1<<8) + r * (100 - percent) / 100).toString(16)).substr(1) +
((0|(1<<8) + g * (100 - percent) / 100).... | [
"function decreaseLightness(box){\n const NUMERIC_REGEXP = /\\d+/g; // Regex for numbers\n let rgbValue = box.style.backgroundColor.match(NUMERIC_REGEXP); //Stores each number from the rgb value into an array\n let red = rgbValue[0];\n let green = rgbValue[1];\n let blue = rgbValue[2]; \n\n //Dec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is used to open the shopping cart pop up: By Rakesh | function shoppingCartdetails() {
// DomainName = "localhost:50444";
openPopup("http://" + DomainName + "/ShoppingCart/Index?r=" + Math.floor(Math.random() * 10001), 960);
} | [
"show () {\n\n // send request to retrieve cart items\n this.fill();\n\n // display cart modal\n this.modal.classList.add('cart__modal--visible')\n\n // while showing the modal hide the main to avoid scroll\n document.getElementsByTagName('main')[0].classList.add('collapsed')\n\n // substitute ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function prepareOptions(options) returns GeneralOptions | function prepareOptions(options){
//if options isnt instance of GeneralOptions
if (!(options instanceof GeneralOptions)) {
//var generalOptions = new GeneralOptions
var generalOptions = new GeneralOptions();
//for each own property key,value in options
... | [
"finalizeOptions(options) {\n return options;\n }",
"function normalizeOptions (options) {\n if (!options.headers) {options.headers = {};}\n if (!options.query) {options.query = {};}\n return options;\n}",
"function normalizeOptions(options) {\n\n\t// convert string values for API paramet... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var _menu = $(".menu"), _megamenu = $(".megamenu"); _menu.find("li").has("ul").addClass("hasChild"); _megamenu.find("li").has("ul").addClass("hasChild"); | function menuAddClaass() {
_menu.find("li").has("ul").addClass("hasChild");
_megamenu.find("li").has("ul").addClass("hasChild");
} | [
"isChildItem($item) {\n return $item.classList.contains('menu-item-depth-1') || $item.classList.contains('menu-item-depth-2');\n }",
"function initDropDownClasses() {\r\n jQuery('#nav li').each(function() {\r\n var item = jQuery(this);\r\n var drop = item.find('ul');\r\n var link = ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new DriverLicence. | constructor() {
DriverLicence.initialize(this);
} | [
"function License(name, descritpion) {\n this.name = \"name\",\n this.descritpion = \"description\"\n}",
"function License() {\n this.name = \"\";\n this.logo = \"\";\n }",
"constructor() { \n \n RepoLicense.initialize(this);\n }",
"constructor() { \n \n M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open browser, repeat ITERATIONS times: open a tab and calculate Octane | async function run1BrowserNiterations({
headless,
iterations,
hostname,
port,
verbose,
}) {
const scores = await getOctane1BrowserNIterations({
headless,
iterations,
hostname,
port,
verbose,
});
displayResult({
description: `Open ${
headless ? "headless" : ""
} browser,... | [
"async function runNBrowserNiterations({\n headless,\n iterations,\n hostname,\n port,\n verbose,\n}) {\n const scores = await getOctaneNBrowserNIterations({\n headless,\n iterations,\n hostname,\n port,\n verbose,\n });\n displayResult({\n description: `repeat ${iterations} times: open ${... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
take in a color and return its brightness | function colorBrightness (color) {
var r = parseInt(color.slice(1, 3), 16);
var g = parseInt(color.slice(3, 5), 16);
var b = parseInt(color.slice(5, 7), 16);
return Math.round(((parseInt(r) * 299) + (parseInt(g) * 587) + (parseInt(b) * 114)) / 1000);
} | [
"function brightnessByColor(color) {\n\t// let color = '' + color;\n\tlet isHEX = color.indexOf('#') === 0;\n\t// let isRGB = color.indexOf('rgb') === 0;\n\tlet r, g, b;\n\n\tif (isHEX) {\n\t\tlet m = color.substr(1).match(color.length === 7 ? /(\\S{2})/g : /(\\S{1})/g);\n\t\tif (m) {\n\t\t\tr = parseInt(m[0], 16);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that adds the City component and InfoBox component | additionalContent() {
let info = this.state.data.info;
return (
<div key="inside_components" id="inside-contents">
<City key={guidGenerator()} name={info.current_observation.display_location.full} />
<InfoBox key="infoBoxDiv" data_obv={info.current_observation} metricState={this.state.metri... | [
"function addCity() {\n\tvar city = data.response.geocode.feature.name;\n\t//console.log(`function addCity - 4Sqaure data - city name${city}`);\n\t$(`#cityDisplay`).text(city);\n}",
"function addCityToDOM(id, city, description, image) {\n // TODO: MODULE_CITIES\n // 1. Populate the City details and insert those... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Depending on the event type color the appropriate cells in the event sheet | function colorEventCells(lngEventTypeId,lngEventId)
{
clearColors('F');
if(lngEventTypeId == CONSTANTS.EventDataTypeId.lngTime)
{
colorEventCell(COLORS.Red, CONSTANTS.cellEventMilesValue[0] , CONSTANTS.cellEventMilesValue[1], globalEventSheet.getSheetName());
colorEventCell(COLORS.Red, CONSTANTS.cellEven... | [
"function colorEventCell(str,r,c)\n{\n globalEventSheet.getRange(r , c).setBackground(str);\n}",
"function cellColorAlarm(s) {\n\t //e.g. A1 1~100 red\n\t $.each(s.cellBind.colorRangeData, function (i, e) {\n\n\t var cell,\n\t cellValue,\n\t sheetColorHash = s.sheet.colorhash,\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for getDeploymentForRepository / Retrieve a deployment | getDeploymentForRepository(incomingOptions, cb) {
const Bitbucket = require('./dist');
let apiInstance = new Bitbucket.DeploymentsApi(); // String | The account // String | The repository // String | The deployment UUID.
/*let username = "username_example";*/ /*let repoSlug = "repoSlug_example";*/ /*let de... | [
"getCurrentDeployment(projectId, environmentId) {\n return entities.Deployment.get({ projectId, environmentId });\n }",
"function getCurrentDeployment() {\n return getApiGatewayId().then((apiGatewayId) => {\n return apigateway.getExport({\n restApiId: apiGatewayId,\n stageName: API_GATEWAY_STAGE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filters connections for those that have a working channel. | getOpenConnections() {
return this.connections.filter(c => this.active(c.peerId));
} | [
"filterPublicChannel() {\n this.publicChannels = this.channels.filter((req) => {\n return req.name === 'public';\n });\n this.connectRooms(this.publicChannels);\n }",
"function filterChannel(channel){\n\t//WHITELISTING CHANNELS\n\tvar list = blacklist['whitelist'];\n\tvar whitelist = false;\n\tif(l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Export code to Codepad for remote execution | function codepad(lang) {
return function() {
document.export.action = run.href = 'http://codepad.org/';
document.export.lang.value = lang;
run.style.display = 'inline-block';
run.onclick = function(e) {
document.export.code.value = cm.getValue();
document.export.submit();
... | [
"function runCode()\n{\n\tvar codeFromEditor=editor.getValue().toUpperCase();\n\treadOut();\n\tcodeFromEditor=codeFromEditor.replace(/;(.*)/g,'');\t\t//remove comments\n\tcodeFromEditor=codeFromEditor.replace(/^\\s*$(?:\\r\\n?|\\n)/gm, '');\t//remove unnecessary new lines\n\tcodeFromEditor=codeFromEditor.split('\\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Broadcasts model changed and service variables | function modelChangedBroadcast() {
$rootScope.$broadcast('MODEL_CHANGED');
} | [
"broadcast() {\n\t\tconst message = this.getMessage();\n\t\tthis[_observers].forEach((observer) => {\n\t\t\tobserver.update(message);\n\t\t});\n\t}",
"broadcastForeign (){\n this.foreign_broadcasting = true;\n }",
"function broadcast() {\n $rootScope.$broadcast(\"donors_loaded\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes gift certificate from the basket payment instruments and generates a JSON response with a status. This function is called by an Ajax request. | function removeGiftCertificate() {
if (!empty(request.httpParameterMap.giftCertificateID.stringValue)) {
var cart = app.getModel('Cart').get();
Transaction.wrap(function () {
cart.removeGiftCertificatePaymentInstrument(request.httpParameterMap.giftCertificateID.stringValue);
cart.calculate();
... | [
"function redeemGiftCertificateJson() {\n var giftCertCode, giftCertStatus;\n giftCertCode = request.httpParameterMap.giftCertCode.stringValue;\n giftCertStatus = redeemGiftCertificate(giftCertCode);\n let responseUtils = require('~/cartridge/scripts/util/Response');\n if (request.httpParameterMap.format.strin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the source for the image element | get source() {
return this.imageSource;
} | [
"function getImageSrc() {\n return element[0].getAttribute('src');\n }",
"getSource() {\n return this.getAttribute('src');\n }",
"function getSourceOfImage(element) {\n var sourceStr;\n if(element.hasAttribute(\"data-original\")) {\n sourceStr = e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public: pjax on click handler Exported as $.pjax.click. event "click" jQuery.Event options pjax options Examples $(document).on('click', 'a', $.pjax.click) // is the same as $(document).pjax('a') Returns nothing. | function handleClick(event, container, options) {
options = optionsFor(container, options);
var link = event.currentTarget;
var $link = $(link);
if (link.tagName.toUpperCase() !== 'A') throw "$.fn.pjax or $.pjax.click requires an anchor element";
// Middle click, cmd click, and ctrl click should ... | [
"function a(t,a,n){n=p(a,n);var f=t.currentTarget,o=e(f);if(\"A\"!==f.tagName.toUpperCase())throw\"$.fn.pjax or $.pjax.click requires an anchor element\";\n // Middle click, cmd click, and ctrl click should open\n // links in a new tab as normal.\n if(!(t.which>1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds tasks matching the specified priority level to the current selection, even if they are hidden by collapsing. NOTE: this returns a function so that it can be used conveniently in the keybindings. | function selectPriority(level) {
return () => {
const actualLevel = invertPriorityLevel(level);
const allTasks = getTasks('include-collapsed');
const selected = getSelectedTaskKeys();
let modified = false;
for (const task of allTasks) {
if (getTaskPriority(task) === actualLevel... | [
"function setPriority(level) {\n return () => {\n const mutateCursor = getCursorToMutate();\n if (mutateCursor) {\n clickTaskEdit(mutateCursor);\n withQuery(document,\n '[data-action-hint=\"task-actions-priority-picker\"]',\n click);\n withUniqueClass(document... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by LUFileParsernewEntityDefinition. | exitNewEntityDefinition(ctx) {
} | [
"exitEntityDefinition(ctx) {\n\t}",
"exitEntityDeclaration(ctx) {\n\t}",
"exitNewEntitySection(ctx) {\n\t}",
"exitNewEntityLine(ctx) {\n\t}",
"exitNestedEntityMapping(ctx) {\n\t}",
"exitEntitySection(ctx) {\n\t}",
"exitNewEntityType(ctx) {\n\t}",
"exitImportDefinition(ctx) {\n\t}",
"exitNewEntityLis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if is inside the screen. | isInsideScreen() {
const enemyTop = this.y;
const screenBottom = 950;
const isInside = enemyTop < screenBottom;
return isInside;
} | [
"function isOnScreen() {\n\treturn true; \n}",
"function onScreen (el) {\n var rect = el.getBoundingClientRect()\n //off the top of the screen\n if(rect.bottom <= 0) return false\n if(rect.top > window.innerHeight) return false\n return true\n}",
"function isInsideScreen(block) {\n if (block.yPos + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends an error message back to the vTPM via postMessage. The error message will include the ERROR status followed by ": ". | function sendError(err, data) {
var msg = err;
if (data && data !== "") {
msg += ": " + data;
}
return postVTPMMessage(vtpmComm.worker.ST_ERROR, msg);
} | [
"function sendError() {\n messageDict = {};\n messageDict[messageKeys.Error] = 1;\n sendAppMessage(messageDict);\n}",
"function send_err(msg, input) {\n\t\t\tsendMsg({ msg: 'tx_error', e: msg, input: input });\n\t\t\tsendMsg({ msg: 'tx_step', state: 'committing_failed' });\n\t\t}",
"function _processError( t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of unicodes listed in glif | function fetchUnicodes(doc) {
var results = evaluateXPath(doc, x_unicodes).map(_getAttributeValue),
unicodes = { dict: {}, list: [] },
i = 0,
v;
for(; i<results.length; i++) {
v = parseInt(results[i], 16);
if(!isFinite(v) || v in unicodes.dict)... | [
"function getAvailableCyrillicChars()\r\n{\r\n\tvar list = new Array();\r\n\tvar a = '';\r\n\tfor (var item in Object.keys(chars)) {\r\n\t\tif (Object.keys(chars).hasOwnProperty(item)){\r\n\t\t\ta = Object.keys(chars)[item];\r\n\t\t}\r\n\t\t\r\n\t \tlist.push(chars[a].lower);\r\n\t \t\r\n\t \tif (chars[a].upper!==u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API test for 'GetLink', Get link configuration | function Test_GetLink() {
return __awaiter(this, void 0, void 0, function () {
var in_rpc_create_link, out_rpc_create_link;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log("Begin: Test_GetLink");
in_... | [
"async function getLink() {\n const res = await fetch('/link');\n const data = await res.json();\n return data.data\n }",
"get link() {\n this._logService.debug(\"gsDiggStoryDTO.link[get]\");\n return this._link;\n }",
"async function getLink (t, linkId, userSessionToken = '') {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles function's header and parameters | function functionHeader(data)
{
let name=(data.body)[0].id.name;
//insert the function declaration
tableInfo.push({Line:data.loc.start.line, Type:'function declaration',Name:name,Condition:'',Value:''});
//insert the parameters of the function
for( let i=0;i<((data.body)[0].params).length;i++)
{... | [
"function checkHeaderFunc (func) {\n\tif (typeof func != \"function\") {\n\t\tvar err = newErr(ERR.HEADER.FUNCTION.BAD_CONTENT, { func: func });\n\t\treturn [ err ];\n\t}\n\telse return [];\n}",
"insertHeader() {}",
"function header(){\n /*\n * // # this is header\n * // with some description\n *... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Not exactly the same as the executor's definition of getFieldDef, in this statically evaluated environment we do not always have an Object type, and need to handle Interface and Union types. | function getFieldDef(schema, parentType, fieldNode) {
var name = fieldNode.name.value;
if (name === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__["SchemaMetaFieldDef"].name && schema.getQueryType() === parentType) {
return _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_5__["SchemaMetaFieldDef"];
}
... | [
"function getField(_, ctx) {\n if (!_.$field) return null;\n const k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"field\"])(_.$field, _.$name, ctx.expr.codegen));\n}",
"function getField(_, ctx) {\n if (!_.$field) return null;\n const k... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle FF API call for bookmark creation parentId = String identifying the folder inside which to insert insertIndex = position in parent folder where to insert (undefined if append at end) title = String, title of created bookmark url = String, URL of created bookmark (undefined if folder) type = String, "bookmark", "... | function createBkmkItem (parentId, insertIndex, title, url, type, is_openProperties = false) {
let creating;
if (insertIndex == undefined) { // Create in a folder, at end
if (beforeFF57) {
if (type == "separator") { // Cannot create separators in FF 56
creating = new Promise (
(resolve, reject) => {
re... | [
"function createBookmark(parentId, index, title, url) {\n chrome.runtime.sendMessage(extension_id, \n {'operation': 'create', 'parentId': parentId, 'index': index, 'title': title, 'url': url});\n}",
"function addBookmark() {\n chrome.bookmarks.create(\n {\n parentId: '1',\n title: 'Goo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Randomises the tile positions IMPORTANT: Before you optimise this, know that there are starting positions in a 8 Puzzle that are impossible to solve. You must randomise within possible user interactions only to be safe or write a solver for it | function randomiseTiles(){
var ax, ay, bx, by;
while(complete() > 3){
ax = bx = (Math.random() * COLS) >> 0;
ay = by = (Math.random() * ROWS) >> 0;
if(tiles[ay][ax]) continue;
if(Math.random() < 0.5){
bx += Math.random() < 0.5 ? 1 : -1;
} else {
by += Math.random() < 0.5 ? 1 : -1;
}
... | [
"function randomiseTiles(){\n\t\tvar n = 20;\n\t\twhile(complete() > 1 || n-- > 0){\n\t\t\tif(Math.random() < 0.5){\n\t\t\t\tslideRow((Math.random() * ROWS) >> 0, Math.random() < 0.5 ? 1 : -1, true);\n\t\t\t} else {\n\t\t\t\tslideCol((Math.random() * COLS) >> 0, Math.random() < 0.5 ? 1 : -1, true);\n\t\t\t}\n\t\t}\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function clearing all searches visualization elements | function clearSearchesVisualization(){
g.selectAll('*').remove();
} | [
"function cleanSearchResults() {\n cleanMarkers();\n cleanSearchResultsPane();\n}",
"function clearSearchResults() {\n $(\".search-results\").empty();\n }",
"function clearResults() {\n $(RESULTS_CONTAINER).add(SEARCH_RESULTS).removeClass('open');\n $(RESULTS_CONTAINER).height('');\n $(SEAR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================================== Name : IsWithinInterestLocation Description : Calculate interest locations Credit : return value : Distance between two GPS coordinates ========================================================================= | IsWithinInterestLocation(position, location) {//two locations
let radLat1 = this.Rad(position.Latitude);
let radLat2 = this.Rad(location.Latitude);
let a = radLat1 - radLat2;
let b = this.Rad(position.Longitude) - this.Rad(location.Longitude);
let s = 2 * Math.asin... | [
"function isInside(questLat, questLon) {\n let distance = distanceBetweenLocations(questLat, questLon);\n console.log(\"distance: \" + distance);\n if (distance < 30) \n {\n return true;\n }\n else {\n return false;\n }\n}",
"IsWithinGeofence(position, location) {//coor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler to handle answer submitted when submit button is clicked Dependancy: checkAnswer render | function handleAnswerSubmitted() {
//console.log('Handling submit answer process');
$('.quiz').on('submit', function (event) {
event.preventDefault();
//console.log('Answer has been submitted');
checkAnswer();
STORE.view = 'questionResult';
render();
});
} | [
"function handleAnswerSubmitButton() {\n $('main').submit('.submit-button', function (event) {\n event.preventDefault();\n checkAnswerChoice();\n });\n}",
"function submitAnswer() {\n $('main').on('submit', function (event) {\n event.preventDefault();\n $('.altBox').hide();\n $('.response').show... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns include array without relationships that were already included in previous requests | _trimInclude(cache, include) {
if (!cache) {
return include;
}
const { alreadyIncluded } = cache;
return include.filter(relationshipName => {
return !alreadyIncluded.includes(relationshipName);
});
} | [
"getRequestedIncludes () {\n return this.requestedIncludes\n }",
"getAddToIncludesForResource(resource) {\n let relationshipPaths;\n\n if (this.hasQueryParamIncludes()) {\n relationshipPaths = this.request.queryParams.include.split(\",\");\n } else {\n let serializer = this.serializerFor(re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
middleware to check if incoming requests have valid API in their headers or not. | function checkForValidAPI(req, res, next) {
if (req.headers.apikey === API_KEY) {
next();
} else {
return res.status(400).send('Invalid API credentials');
}
} | [
"function headerCheck(req, res, next) {\n let bearerHeader = req.headers[\"bearer\"];\n\n if (typeof bearerHeader !== 'undefined') {\n let bearer = bearerHeader.split(\" \");\n let bearerToken = bearer[1];\n req.token = bearerToken;\n next();\n } \n else {\n res.status... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns smaller of (xMaxxMin)/inputScale or similar with yMax and yMin. | function getMinScale(inputScale) {
return Math.min(Math.abs((plot.xmax-plot.xmin)/inputScale),
Math.abs((plot.ymax-plot.ymin)/inputScale));
} | [
"function scale(input, inmin, inmax, outmin, outmax) {\n if(inmin > inmax) {\n var tmp = inmin;\n inmin = inmax;\n inmax = tmp;\n }\n\n if(outmin > outmax) {\n var tmp = outmin;\n outmin = outmax;\n outmax = tmp;\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the key for the values in this location | getKey(){
return this.x + "|" + this.y + "|" + this.z;
} | [
"function getLocationKey(location) {\n\t return typeof location.key === 'string' ? location.key : '';\n\t}",
"function getLocationKey(location) {\n return typeof location.key === 'string' ? location.key : '';\n}",
"function getLocationKey(location) {\n return typeof location.key === 'string' ? location.key :... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets the display to 00:00 | function reset() {
time = 0;
lap = 1;
$("#display").text("00:00");
} | [
"function reset() {\r\n sec = 0;\r\n min = 0;\r\n hr = 0;\r\n trigger('Stop');\r\n document.getElementById('time').innerHTML = '00 : 00 : 00';\r\n}",
"function resetTime(){\n\t$(\"#time\").html(\"25:00\");\n}",
"reset() {\n clearTimeout(this.watch);\n this.seconds = 0;\n this.minutes = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Popola e apre (se necessario) un bootbox di errore | function impostaErroriNelBootbox(errori){
var stringaErrori;
if(errori.length === 0) {
return false;
}
stringaErrori = errori.map(function(value) {
if(value.codice !== undefined) {
return value.codice + ' - ' + value.descrizione;
}
... | [
"function startupFailureClick () {\n var $errorButton = $(this);\n self.showStartupOptions(function () {\n self.$landing.startupStatusMessage.html(\"Sending startup request to server\");\n self.$landing.startupStatus.children(\"h2\").html('Starting Framework<div c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate map(array of array filled with "W" and with padding) padding is to avoid edge case(corner, edge) when count mines | generateMap(num) {
return [...Array(num + 2).keys()].map(i => Array(num + 2).fill("W"));
} | [
"function generateMineCntMap() {\n mineCntMap = zeros([height, width]);\n mineIdxArray.forEach(function(element){\n let r = Math.floor(element / width);\n let c = element % width;\n handleAdjacentCells(incrementMineCnt, [r, c]);\n });\n}",
"function createWalls(map)\n{\n //var n = [];\n for (var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorts the nodes so that in each quarter sort nodes from the center (in y) outwards first quarter before the second forth quarter before the third | function sortNodes(nodes) {
var q1 = [];
var q2 = [];
var q3 = [];
var q4 = [];
for (var i = 0; i < nodes.length; ++i) {
var _nodes$i$desc$slice = nodes[i].desc.slice,
start = _nodes$i$desc$slice.start,
end = _nodes$i$desc$slice.end;
var middle = normalize$1((start + end) / 2);
va... | [
"function sortNodes(nodes) {\n const q1 = [];\n const q2 = [];\n const q3 = [];\n const q4 = [];\n for (let i = 0; i < nodes.length; ++i) {\n const { start, end } = nodes[i].desc.slice;\n const middle = normalize((start + end) / 2);\n let section = Math.floor(middle / (Math.PI / 2));\n switch (sect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST new note from form data in new note modal | function postNoteForm(){
$.post({
url: index + "notes",
processData: false,
contentType: false,
data: NoteFormData('noteform'),
success: function(data){
$('#maincontent').prepend(note_template(data));
$('#newmodal').modal('hide');
... | [
"function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method: _createHistoryHTML This is an alternative to that is used by IE (and others if I can get it to work). This method will create the history page completely in memory, with no need to download a new file from the server. | function _createHistoryHTML($newHash) {
with (_historyFrameRef.document) {
open("text/html");
write("<html><head></head><body onl",
'oad="parent.unFocus.History._updateFromHistory(\''+$newHash+'\');">',
$newHash+"</body></html>");
close();
}
} | [
"function _createHistoryHTML($newHash) {\r\n\t\t\twith (_historyFrameRef.document) {\r\n\t\t\t\topen(\"text/html\");\r\n\t\t\t\twrite(\"<html><head></head><body onl\",\r\n\t\t\t\t\t'oad=\"parent.unFocus.History._updateFromHistory(\\''+$newHash+'\\');\">',\r\n\t\t\t\t\t$newHash+\"</body></html>\");\r\n\t\t\t\tclose(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DateWidget :: Integer Create a widget for inputting dates and times in HH:MM DDMMYYYY format. This widget's values are expressed in UNIXtimestamp format, as the number of seconds since the epoch. | function DateWidget(initVal) {
Widget.apply(this);
var theDate = new Date(initVal * 1000);
function twodigits(inint) {
if(inint <= 0 && inint < 10)
return '0' + inint;
else
return ''+inint;
}
var hoursBox = INPUT({type:'text',size:2,maxLength:2,value:initVal?theDate.getUTCHours():''});
var minutesBo... | [
"function generateClockWidget(){\n\tmydate = new Date();\n\tmyday = mydate.getDay();\n\tmymonth = mydate.getMonth();\n\tmyweekday= mydate.getDate();\n\tmyhours = mydate.getHours();\n\tmyminutes = mydate.getMinutes();\n\thour = myhours>12?myhours-12:myhours;\n\thoraActual = hour+\":\"+myminutes+(myhours>12?\" PM \":... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if phone number is Israeli | isIsraeli() {
return this.phoneNumber.match(/^((0[23489][356789]|0[57][1023458]\d|1(2(00|12)|599|70[05]|80[019]|90[012]|919))\d{6}|\*\d{4})$/) !== null;
} | [
"isPalestinian() {\r\n return this.phoneNumber.match(/^(0[23489]2|05[69]\\d|)\\d{6}$/) !== null;\r\n }",
"isErotic() {\r\n return this.phoneNumber.match(/^1919\\d{6}$/) !== null;\r\n }",
"function isItalianMobilePhoneNumber(value) {\n if (notEmpty(value)) {\n if (typeof value !== '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mirror implementation of the `classMap()` instruction (found in `instructions/styling.ts`). | function classMap(classes) {
_stylingMap(classes, true);
} | [
"function ɵɵclassMap(classes) {\n var index = getSelectedIndex();\n var lView = getLView();\n var stylingContext = getStylingContext(index, lView);\n var directiveStylingIndex = getActiveDirectiveStylingIndex$1();\n if (directiveStylingIndex) {\n var args = [stylingContext, classes, directiveS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO uncheck_parent_nodes and check_parent_nodes in one ??? | function uncheck_parent_nodes( node_checkbox ) {
if ( node_checkbox.hasClass( 'pl-tree-node-checked' ) ) {
var parent_node = node_checkbox.closest( 'section.pl-tree' );
uncheck_node( node_checkbox );
if ( parent_node.length === 1 ) {
var new_checkbox = parent... | [
"onCheck(node, event) {\n // prevent parent events\n event.stopPropagation();\n\n let { flatNodes } = this.state;\n // toogle checked tree node and its children\n toogleChecked(flatNodes, node, event.target.checked);\n\n this.setState({ flatNodes: flatNodes });\n }",
"checkAllParentsSelection(n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GETS SERIAL NUMBERS FROM DATABSE | static async getStoredSerialNumbers(){
const serialNums = await Seriall.allSerialNumbers();
return serialNums;
} | [
"static async allSerialNumbers(){\n const { rows } = await pool.query(\n 'SELECT * FROM episerialnumber'\n );\n return rows.map(row => new Serial(row));\n }",
"_getUniqueSerialNumbers() {\n const uniqueSetOfDaysWithTasks = new Set(this._listOfDaysWithTasks);\n\n return Array.from(uniqueSetOfD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When an opponent toon is picked by the player, the opponent's health is set for the game | function pickOpponent(toonId)
{
for (i = 0; i < toons.length; i++)
{
if (toons[i].id == toonId)
{
oppHealth = toons[i].hp;
console.log("Opp Initial Health: " + oppHealth);
}
}
} | [
"playerHealth(value) {\n if (value <= 0 && this.monsterHealth <= 0) {\n // a draw between monster and player\n this.winner = \"draw\";\n } else if (value <= 0) {\n //player lost , monster won\n this.winner = \"monster\";\n }\n }",
"playerHealth(value) {\n if (val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Directive. Allows you to localize content that requires AngularJS compilation. | function directive(localizationService, $compile) {
return {
restrict: "E",
replace: true,
link: getLocalizeLinker(localizationService, $compile)
};
} | [
"function localize () {\n var stream = gulp.src('www/{./,templates}/*.html')\n .pipe(l10n())\n .pipe(replace(/s18n[\\w\\-]*((=)?([\\\"\\'][^\\'^\\\"]*[\\\"\\'])?)?/g, ''));\n\n stream.pipe(gulpif('**/' + l10nOpts.base + '/**/**.*', rename(function (path) {\n path.dirname = path.dirname.replace(l10nOpts.b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the data of a model/collection from the given adapter | function deleteLocal(model, opt) {
if (model instanceof Backbone.Collection) {
// Call "delete" on every element if this is a Collection
return Q.all(model.map(function(mod) {
return Q.promise(function(resolve, reject) {
// TODO try/catch?
removeInfo(mod);
_.each(getSyncs(mod), removeSyncRow);
... | [
"delete (ctx, adapter) {\n // check for arguments\n if (!ctx) throw new ReferenceError('ctx')\n if (!adapter) throw new ReferenceError('adapter')\n\n // get body from context\n const body = this._getBody(ctx)\n\n // declare filter\n let filter = null\n\n // parse filter from body\n if (bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
empty Create empty payload from schema.create() This method WILL only create an JSObject, not a GenericModel In most cases, you want to use newFromTemplate instead | empty( data = {}, optional_data = null ) {
if ( !this.modelDefinition ) {
return null
}
if ( !( this.modelDefinition.schema && this.modelDefinition.schema.create ) ) {
return null
}
this._check_required_create_arg( data );
let payload = this.modelDefinition.schema.create( data, op... | [
"function generateEmptyPayload(){\n\tvar payload = {\n\t\t\"user\": null,\n \t\t\"dog\": {\n \t\t\t\"name\": null,\n \t\t\"sex\": null,\n \t\t\"age\": null,\n \t\t\"breed\": null,\n \t\t\"city\": null,\n \t\t\"state\": null,\n \t\t\"zipcode\": null,\n \t\t\"bio\": null\n \t\t},\n \t\t\"phys... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update ALL ability modifiers based on their ability scores. | function updateModifiers() {
const abilityScores = document.getElementsByClassName('ability-score');
for (let i = 0; i < abilityScores.length; i++) {
updateAbilityModifier(abilityScores[i]);
}
} | [
"function updateAbilityModifier(abilityScore) {\n const score = abilityScore.value;\n if (!isNaN(score)) {\n const abilityMod = document.querySelector('#' + abilityScore.id + '-modifier');\n const modifier = Math.floor((score - 10) / 2);\n abilityMod.textContent = (modifier >= 0) ? '+' + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mini version of original callPhp method to make this mail thing standalone | async function callPhpMail(name,subject,message,contact,mode,auth,callback)
{
var request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); // XMLHttpRequest instance
request.onload = function() {
eval(callback);
return;
... | [
"sendMail(options) {}",
"custom(toMail,fromMail,subject,htmlTemplate,text)\n {\n\n\n var mailData = {\n to: toMail,\n from: fromMail,\n subject: subject,\n text:text,\n html:htmlTemplate\n };\n\n sgMail.send(mailData);\n }",
"sendEmail(props) {\r\n const para... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTIONS// allows key presses, hides end of game message, resets game fields and chooses random word | function beginGame(){
noPressKey = false;
document.getElementById("endScreen").style.display = "none";
guesses = "";
turnsRemaining = 8;
randWord = word[Math.floor(Math.random() * word.length)].toLowerCase();
refreshDisplay();
} | [
"function runGame() {\n\tchooseWord();\n\tsetWordDisplay(currentHiddenWord);\n}",
"function newGame() {\n\tplaceholder = \"\";\n\tguessesLeft = 10;\n\tlettersGuessed = \"\";\n\taudio.play();\n\tword = wordList[Math.floor(Math.random() * wordList.length)];\n\tsplitWord = word.split(\"\");\n\tcurrentWord = 0;\n\t\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3.Write a function called rentalCar that takes a person's name and age as parmeters, and returns either 'You cannot have the keys, .', or "Have fun driving", depending on whether or not the person is old enough. In the US, most rental car companies do not allow you to rent a car until you are 21. | function rentalCar(person,age){
if(age>=21){
return "Have fun driving, " + person
}
return "You cannot have the keys, " + person + " ."
} | [
"function rentalCar(name,age) {\n\tif(name <= 21) {\n\t\treturn 'You cannot have the keys';\n\t}\n\n\treturn \"Have fun driving\";\n}",
"function rentalCar(name,age ){\nif ( age >=21){return name + \" Have fun driving\" }\n\treturn 'You cannot have the keys'\n}",
"function rentalCar(age){\n\tif(typeof(age)==='n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Age Calculator Forgot how old you are? Calculate it! Write a function named calculateAge that: takes 2 arguments: birth year, current year. calculates the 2 possible ages based on those years. outputs the result to the screen like so: "You are either NN or NN" Call the function three times with different sets of va... | function calculateAge (birthYear, currentYear){
var age = currentYear- birthYear;
console.log("You are either " + age + " or " + (age-1));
} | [
"function calculateAge(currentYear, birthYear) {\n var calc = currentYear - birthYear;\n var calc2 = calc + 1\n var age = \"You are either \" + calc + \" or \" + calc2;\n return console.log(age)\n}",
"function calculateAge(birthYear, currentYear) {\n\tage1 = currentYear - birthYear;\n\tage2 = currentYear - (birth... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Persegi panjang (panjang lebar) | function hitungLuasPersegiPanjang (panjang,lebar){
//tidak ada nilai balik
var luas = panjang * lebar
return luas
} | [
"function hitungLuasPersegiPanjang(panjang,lebar){\n //tidak memiliki nilai balik\n var luas = panjang * lebar;\n return luas;\n}",
"function hitungLuasPersegiPanjang(panjang,lebar){\n //tidak memiliki nilai balik\n var luas = panjang * lebar\n return luas\n}",
"function polecenia() {\n ust... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize current sorting order status for each field of the dataset | function initializeSortingState() {
let datasetFields = Object.values(classNameToKeyMap);
datasetFields.forEach(function(field) {
ascendingOrder[field] = false;
});
} | [
"set sortingOrder(value) {}",
"function BindSortingOrder() {\n\n\n if ($(\"table#ogrid thead tr [columnName='\" + sortAssignedColumn + \"']\").length > 0)\n $(\"table#ogrid thead tr [columnName='\" + sortAssignedColumn + \"']\").addClass(sortTypeClassName);\n\n sortAssignedColumn = \"\"; sortTypeClas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert to in game time string (1:02:33) | static convertToIGTString(time)
{
const t = parseInt(time);
//invalid time value
if(isNaN(t) || t===Number.MAX_SAFE_INTEGER)
{
return "N/A";
}
//add extra times
let ms = t%1000;
if(ms < 10)
{
ms = "00" + ms;
}
else if(ms < 100)
{
ms = "0" + ms;
}
... | [
"makeTimeStr() {\n let {breakSecondsLeft, sessionSecondsLeft, stateSession} = this.props;\n let minutes = (stateSession) ? ~~(sessionSecondsLeft / 60) : ~~(breakSecondsLeft / 60);\n let seconds = (stateSession) ? sessionSecondsLeft%60 : breakSecondsLeft%60;\n if(minutes < 10)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var lstIssueDts = []; var pValiDays = ""; lstIssueDts.push('19/02/2015', '26/03/2015', '26/02/2015'); pValiDays = '30'; chkValidityDays(lstIssueDts, pValiDays); to check whether list of issue dates user selected falls within valid days | function chkValidityDays(lstIssueDts, pValidDays) {
var blnValidDays = false;
var CntIssueDt = 0;
var currentDate = "";
currentDate = new Date().addDays(pValidDays);
$.each(lstIssueDts, function (ind, vall) {
if (new Date(vall.split('/')[1] + '/' + vall.split('/')[0] + '/' + vall.split... | [
"function validate_dates(startDate, endDate) {\n if (startDate === null || startDate === '' || endDate === null\n || endDate === '')\n {\n index = index + 1;\n errorsList[index] = 'Start date & Due date required';\n return false;\n }\n else if (startDate > endDate)\n {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
23.2.1 The Set Constructor 23.2.1.1 Set ( [ iterable ] ) | function Set(/*iterable*/) {
var set = strict(this);
var iterable = arguments[0];
if (Type(set) !== 'object') throw TypeError();
if ('[[SetData]]' in set) throw TypeError();
if (iterable !== undefined) {
var adder = set['add'];
if (!IsCallable(adder)) throw TypeError();
... | [
"toSet() {\n return new Set(this._iterable);\n }",
"function Set() {\n // Uses an object to store items\n this.data = {};\n this.length = 0;\n}",
"function Set() {\n this.keys = [];\n}",
"function Set(){\n\tvar set = {};\n\n\tthis.addSet = function(el){\n\t\tset[el] = null;\n\t};\n\tthis.getSet ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets and sorts an array of riderTrips based on similarity with the driver | async function getRiderTripSimilarity(driverTrip, riderTrips) {
if (typeof riderTrips === "undefined") {
return [];
}
if (typeof driverTrip === "undefined") {
return [];
}
/* get the driver user matching the username */
let driverUser;
driverUser = await UserStore.findById(driverTrip.userID);
for (const ... | [
"function cutTripsByDistance(driverTrip, riderTrips) {\n\tlet riderTripsDistance = [];\n\n\tif (typeof riderTrips === \"undefined\" || driverTrip === \"undefined\") {\n\t\treturn [];\n\t}\n\n\tlet newDriverRoute = driverTrip.tripRoute;\n\n\triderTrips.forEach(function(riderTrip) {\n\t\tlet newRiderRoute = riderTrip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asynch search for tweets returning promise. | function twitterSearchAsync(search, options) {
return new Promise(function(resolve,reject){
twitterClient.get('search/tweets',
{q: search, result_type: options.result_type, count: options.count},
function(error, tweets, response){
if(error) {
console.log(error);
reject(... | [
"function search(){\n var params = {\n q: 'Taylor Swift',\n count: '20'\n }\n\n T.get('search/tweets', params, gotData);\n function gotData(err, data, response){\n var tweets = data.statuses;\n for (var i = 0; i < tweets.length; i++){\n console.log(tweets[i].text)\n }\n };\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the styling for a particular attribute, using defaults if nothing overriden | function style(attribute) {
if (window.stylesheetOverride && attribute in stylesheetOverride) {
return stylesheetOverride[attribute];
} else {
return stylesheet[attribute];
}
} | [
"function GetDefaultAttrType(attrName, tagName) \n\t{ \n\tswitch (attrName) \n\t\t{ \n\t\tcase \"bgColor\": \n\t\tcase \"background\": \n\t\t\treturn \"color\"; \n\t\t \n\t\tdefault: \n\t\t\treturn \"text\"; \t\t \n\t\t} \n\t} //GetDefaultAttrType ",
"function GetCssAttribute(element, attribute) {\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fills out bam.chrToIndex and bam.indexToChr based on the first few bytes of the BAM. | function parseBamHeader(r) {
if (!r) {
return callback(null, "Couldn't access BAM");
}
var unc = unbgzf(r, r.byteLength);
var uncba = new Uint8Array(unc);
var magic = readInt(uncba, 0);
if (magic != BAM_MAGIC) {
return callback(null, "Not a BAM f... | [
"function parseBamHeader(r) {\n if (!r) {\n return callback(null, \"Couldn't access BAM\");\n }\n\n var unc = unbgzf(r, r.byteLength);\n var uncba = new Uint8Array(unc);\n\n var magic = readInt(uncba, 0);\n if (magic != BAM_MAGIC) {\n return callback(n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
process the targets supplied | function processTargets( contentsFolder, resource, callback ){
createOperationCollection( contentsFolder, resource, function( err, operations ){
//operations: [ { source:String, destination:String, isDirectory:Boolean } ]
writeOperations( operations, callback );
});
} | [
"function processTargets(checkTarget) {\n var start = new Date().getTime();\n var mode = (checkTarget && (checkTarget.tagName === 'IMG' || checkTarget.img)) ? 'image' : 'targets';\n var found = checkTarget ? false : true;\n var total = get('targets').length;\n var target;\n\n for (var t = 0; t < t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refreshes the palette to display new colors. | refreshPalette() {
// Remove old palette buttons.
this.shadowRoot.querySelectorAll('my-palette-button').forEach((button) => {
button.remove();
});
// Create and add new palette buttons.
this.createHSLColorArray(10, this.saturation, this.lightness).forEach(
(color) => {
let butto... | [
"paletteChangedForceRedraw() {\n this.redrawUsingPalette(this.constants);\n this.redrawUsingPalette(this.constantsPreview);\n }",
"refreshColors() {\n this.colors = this.palette.getColors();\n const elements = document.querySelectorAll(\".color\");\n for (let i = 0; i < elements.length; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the parent frame if both frames are part of the same process/target. | sameTargetParentFrame() {
return this.#sameTargetParentFrameInternal;
} | [
"parentFrame() {\n return this.sameTargetParentFrame() || this.crossTargetParentFrame();\n }",
"parentFrame() {\n return this._frameManager._frameTree.parentFrame(this._id) || null;\n }",
"crossTargetParentFrame() {\n if (!this.crossTargetParentFrameId) {\n return null;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call web service to get the idp data of forecast group. | async function getIdpFgData(idpSk, fgsk) {
let fgQuery = idpDetailsForGrp
.replace('@idpSk', idpSk)
.replace('@fgsk', fgsk);
try {
let idpFgData = await CallEWFMWebService('IDP', fgQuery);
return idpFgData;
} catch (err) {
throw err;
}
} | [
"function loadAllGroupIcal() {\n var idd = window.location.search.substr(1).split(\"=\")[1];\n $.post('http://vinci.aero/palendar/php/group/getAllGroupIcal.php', {id_group: idd}, function (data, status) {\n if (status === \"success\") {\n if (data){\n icalGroupData = $.extend(true, [], da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the Javascript wrapper for ActiveXexported methods, used by IE. This file contains the all following functions that can be used from a web page: cd_getFormula(objName, selection) cd_getAnalysis(objName, selection) cd_getMolWeight(objName, selection) cd_getExactMass(objName, selection) cd_getData(objName, dataTy... | function cd_isBlankStructure(objName, selection) {
if(cd_getSpecificObject(objName).Objects == undefined){
return true;
}
return (cd_getSpecificObject(objName).Objects.Count == 0);
} | [
"function cd_isBlankStructure(objName, selection) {\n return cd_getSpecificObject(objName).isBlankStructure();\n}",
"function checkEmptyness( winCurr, sFormName, aFormFields ) {\n\taEmptyFields=new Array();\n\tvar bIsValue=true;\n\tvar currElement;\n for( k=0;k<aFormFields.length;k++ ) {\n \tcurrElement = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fonction : gotoPage entrees: menu : identifiant du menu, position : position de la page sorties: rien description: redirige vers une autre page | function gotoPage(menu, position)
{
window.location.href = "index.php?p=sections&id="+menu+"&pos="+position ;
} | [
"function menu(page){\n\t\t loadPage(page,'');\n\t\t //CCT.index.menu(page,menuCallback);\n\t\t }",
"function pagesMenu() {\n var pages = memory.pages;\n for (var i = 0; i < pages.length; i++) {\n memory.pages[i].pageLink();\n };\n }",
"goT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retourne l'id de la room dans laquelle le joueur est inscrit | function getJoinedRoom(name)
{
var room_count = room.rooms.length
for (var i = 0; i < room_count ; i++)
{
var r = room.getRoomById(room.rooms[i].id)
if (r)
{
var p = r.isWaiting(name)
if (p) // le joueur est inscrit dans cette room
{
... | [
"function getRoomId() {\n\troom_id_unparsed = $(\".room\").attr('id');\n\troom_id = parseInt(room_id_unparsed.replace(\"room-\",\"\"));\n}",
"function getRoomId(roomname) {\n\t\tvar id = \"\";\n\t\tid = roomId[roomname]; //json lookup\n\t\treturn id;\n\t}",
"function findID(roomId){\n for (let i = 0; i < idA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4805 4806 4807 // 4808 Check if the default theme is being used. // 4809 4810 | function isUsingDefaultTheme( element ) { // 4811
// 4812
var theme, ... | [
"function FRESHTheme() {\n\n }",
"function chkTheme(){\r\n\ttry{\r\n\tvar hasTheme = JSON.parse($.jStorage.get(\"appTheme\"));\r\n\tif(hasTheme != null && hasTheme == true){\r\n\thappyDaysMode(hasTheme);}\r\n\t}\r\n\tcatch(e){\r\n\tconsole.log(\"error checking theme: \" + e.message);}\r\n\t}",
"_isThemeAvailab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for saving the editted paper in mode2.xsl use an XMLHTTPRequest to send the whole HTML page to the server to be converted | function savePaper() {
// get the paper with its annotations from the div
// alert($('mainpage').down(1));
// pass on the comments info
comments = $('comment').getValue();
title = $$('title').reduce().readAttribute('filename');
// alert(titleElem.readAttribute('filename'));
// objJSON={
// "conceptHash": concep... | [
"function saveXML_EProof__SID__() {\n\t//var vCrypt = this.getElementById(\"SELECTSAVETYPE\"+this.aQID).value;\n\t//checkENCRYPT\n\tthis.getElementById(\"tSAVEXML\"+this.aQID).value = this.createFileXML();\n}",
"function saveOfflineHTML_EProof__SID__(pEProofPath) {\n\t// pEProofPath not used in default Method\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert normalized Volume (0100) to Stream volume | _normalizedVolumeToStreamVolume(volume) {
return volume / 100 * this._control.get_vol_max_norm()
} | [
"_normalizeStreamVolume(streamVolume) {\n // plus 1 as parseInt rounds to next lower number\n return parseInt(streamVolume / this._control.get_vol_max_norm() * 100 + 1)\n }",
"function normaliseVolume(channelVol) {\n let tempVol = channelVol;\n tempVol = tempVol / 10;\n return parseInt(tempVo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper function ported from TinyColor.prototype.toHsv Keep it here because of `hsv.h 360` | function toHsv(_ref) {
var r = _ref.r,
g = _ref.g,
b = _ref.b;
var hsv = (0,conversion/* rgbToHsv */.py)(r, g, b);
return {
h: hsv.h * 360,
s: hsv.s,
v: hsv.v
};
} // Wrapper function ported from TinyColor.prototype.toHexString | [
"function toHsv(_ref) {\n var r = _ref.r,\n g = _ref.g,\n b = _ref.b;\n var hsv = (0,_ctrl_tinycolor__WEBPACK_IMPORTED_MODULE_0__/* .rgbToHsv */ .py)(r, g, b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v\n };\n} // Wrapper function ported from TinyColor.prototype.toHexString",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array with the selected days | async getSelectedDays() {
const selected = (await Promise.all(
weekDays.map(async weekDay => {
const input = await this.getInput(weekDay);
return (await input.isSelected()) ? weekDay : undefined;
}),
)).filter(value => value);
return selec... | [
"function getDaysSelected()\n{\n\tvar allvalues = 0;\n\n\t/* OR the values of all the weekdays checked */\n\t$.each($(\"#weekdaycheckboxid:checked\"),function() {\n\t\tswitch($(this).val()) {\n\t\t\tcase 'Sunday':\n\t\t\t\tallvalues |= gWeekDays.Sunday;\n\t\t\t\tbreak;\n\t\t\tcase 'Monday':\n\t\t\t\tallvalues |= gW... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"buildDialog function" Build the dropdown options based on what worksheets are available on the dashboard | function buildDialog() {
const dashboard = tableau.extensions.dashboardContent.dashboard;
dashboard.worksheets.forEach(function (worksheet) {
$("#selectWorksheet").append("<option value='" + worksheet.name + "'>" + worksheet.name + "</option>");
});
var worksheetNam... | [
"function populateSheetList() {\n console.log('Populating workSheet list.');\n document.getElementById('divWorksheetSelector').style.display = \"flex\";\n\n let options = \"\";\n let t = 0;\n for (ws of tableau.extensions.dashboardContent.dashboard.worksheets) {\n console.log(\"Sheet Name: \"+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |