query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Handle thumbnail load / failure for an individual thumbnail | function loadThumbnail($thumbnail, success)
{
var $thumbnailContainer = $thumbnail.closest(".thumbnail-container");
var $thumbnails = $thumbnailContainer.find(".thumbnail-img");
$thumbnails.toggle(success);
// Render a custom "no thumbnail" image when image load fails
$thumb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setItemThumbLoadedError(objThumb){\n\t\t\t\n\t\t\tvar objItem = t.getItemByThumb(objThumb);\n\t\t\t\n\t\t\tobjItem.isLoaded = true;\n\t\t\tobjItem.isThumbImageLoaded = false;\t\t\n\t\t\t\n\t\t\tif(g_temp.customThumbs == true){\n\t\t\t\t\n\t\t\t\tg_objThis.trigger(t.events.IMAGELOADERROR, objThumb);\n\t\t\... | [
"0.7381883",
"0.67061734",
"0.6610706",
"0.65576774",
"0.63936883",
"0.63801533",
"0.63712275",
"0.6208223",
"0.6181231",
"0.6146044",
"0.6128894",
"0.6123711",
"0.6116116",
"0.60549057",
"0.6011601",
"0.6000076",
"0.59492105",
"0.5910152",
"0.5891394",
"0.58618546",
"0.58618... | 0.72144425 | 1 |
Final step in the POST `/html` route, retrieves and sends the HTML content of the selected email | emailContent (req, res) {
self.find(req, {_id: req.body.id}).toObject((err, data) => {
res.send({html: err || !data ? '' : self.render(req, 'email', data)});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHtmlBody_() {\n var t = HtmlService.createTemplateFromFile(\"email\");\n return t.evaluate().getContent();\n}",
"async function sendDataHTML() {\n let formData = new FormData(document.forms[0]); //generiert FormData Ohjekt aus <form> in das Dokument\n let url = \"https://gissose20... | [
"0.6393646",
"0.6380916",
"0.63432205",
"0.62643564",
"0.61782",
"0.6030235",
"0.6010271",
"0.5952451",
"0.59476864",
"0.5938192",
"0.592658",
"0.5902912",
"0.5892179",
"0.5875052",
"0.58285654",
"0.58218104",
"0.5810463",
"0.5803918",
"0.57980764",
"0.5788012",
"0.574637",
... | 0.64706564 | 0 |
Final step in the POST `/contactgroup` route, retrieves and returns the selected contacts | async contactGroup (req, res) {
const data = await self.getContacts(req, !!req.body['contact-subscribed'],
{'contact-event-source': req.body['contact-group']}, 'contact-email', 'contact-subscribed');
if (!data || !data.length) {
return res.status(404).send(new Error('Cannot fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getContacts(req, res){\n return res.send({\n data: contactList\n })\n }",
"function manageContactgroupContacts(contactGroup) {\n showManageContactsPage();\n loadContactsFromCG(contactGroup);\n}",
"function getContacts (req, res) {\n var ownerId = req.query.ownerId;... | [
"0.6485284",
"0.6400663",
"0.62013113",
"0.6132404",
"0.6010749",
"0.5928145",
"0.5866086",
"0.5815007",
"0.581143",
"0.57677644",
"0.5758646",
"0.5744112",
"0.57394403",
"0.57234824",
"0.5710103",
"0.57066786",
"0.56882876",
"0.5670681",
"0.5644907",
"0.56311786",
"0.5621615... | 0.73069173 | 0 |
check if account is valid | function invalidAccount(account) {
if (account.length != 11) return true;
if (!isNumeric(account)) return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validSignup(){\n\tlet isUsernameValid = checkUser(),\n isEmailValid = checkEmail(),\n\t\tisPhoneNumberValid = checkPhoneNumber(),\n isPasswordValid = checkTruePassword(),\n isConfirmPasswordValid = checkConfirmPassword();\n\tlet isFormValid = isUsernameValid && isPasswordValid&& isEma... | [
"0.68062836",
"0.67111546",
"0.66822165",
"0.65869623",
"0.6580979",
"0.6573596",
"0.6507309",
"0.6507309",
"0.64123774",
"0.63992697",
"0.63470805",
"0.6345025",
"0.6335329",
"0.6291203",
"0.62611115",
"0.6261092",
"0.6243507",
"0.62323254",
"0.6231954",
"0.62212217",
"0.621... | 0.7132267 | 0 |
asignamos a cada video la funcion que al hacer click se ponga como video principal | function iniciarVideos() {
video = document.querySelector("video");
let videos = document.getElementById("videos").children;
videos[0].addEventListener("click", videoPrincipal);
videos[1].addEventListener("click", videoPrincipal);
videos[2].addEventListener("click", videoPrincipal);
videos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clickVideo(e){if(-1<(\" \"+e.className+\" \").indexOf(\" playing \")){e.className=e.className.replace(/(?:^|\\s)playing(?!\\S)/g,\"\");var t=e.getElementsByTagName(\"video\")[0];for(t.setAttribute(\"src\",\"\"),t.pause();t.firstChild;)t.removeChild(t.firstChild)}else{e.className+=\" playing\";var s=docume... | [
"0.7258297",
"0.7202792",
"0.7073668",
"0.6986466",
"0.6979185",
"0.6934384",
"0.6876011",
"0.6792053",
"0.67884034",
"0.67702496",
"0.67442685",
"0.66797453",
"0.6676499",
"0.6568355",
"0.65646434",
"0.6561067",
"0.6549873",
"0.65457195",
"0.6535241",
"0.65320134",
"0.652816... | 0.79405135 | 0 |
Get last Row from above lines | function getLastLine(matrix) {
var column = 0;
var row = [];
while (column < 9) {
var temp = [1, 2, 3, 4, 5, 6, 7, 8, 9];
matrix.forEach(function(v, i) {
var index = temp.indexOf(v[column]);
temp.splice(index, 1);
});
column++;
row.push(temp[0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get lastLine(){\n return this.linePane.lastChild;\n }",
"function getLastOffset() {\r\n\t\t\t\tif (rowTotal > totalLines) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn (totalLines - rowTotal) * charCount;\r\n\t\t\t}",
"function getMaxRow() {\n return conRowAttr.length - 1;\n }",
"... | [
"0.68488955",
"0.66586316",
"0.64793754",
"0.64763093",
"0.6419975",
"0.6403015",
"0.63558185",
"0.6354118",
"0.63419926",
"0.62914187",
"0.62912416",
"0.6272135",
"0.62630033",
"0.6238225",
"0.618792",
"0.6169779",
"0.616787",
"0.61501914",
"0.6117935",
"0.60964066",
"0.6037... | 0.6759576 | 1 |
decorate a single rule with property info | decorateRule(rule){if(rule.propertyInfo){return rule.propertyInfo}let info={},properties={},hasProperties=this.collectProperties(rule,properties);if(hasProperties){info.properties=properties;// TODO(sorvell): workaround parser seeing mixins as additional rules
rule.rules=null}info.cssText=this.collectCssText(rule);rule... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get rule() {\n return this.prop.rule;\n }",
"function addRuleProperty(id, element, domain, range) {\n ++graphJson.metrics.objectPropertyCount;\n ++graphJson.metrics.propertyCount;\n graphJson.propertyAttribute.push({id: id, // new id for this property. unique number\n element: element, ... | [
"0.63102317",
"0.6117713",
"0.5937089",
"0.59078336",
"0.56163263",
"0.55969006",
"0.55969006",
"0.55969006",
"0.5592512",
"0.55356646",
"0.5473209",
"0.54346555",
"0.5430348",
"0.5363863",
"0.53545564",
"0.5307601",
"0.5307601",
"0.5287803",
"0.5287803",
"0.52478653",
"0.524... | 0.73308897 | 0 |
collects the custom properties from a rule's cssText | collectProperties(rule,properties){let info=rule.propertyInfo;if(info){if(info.properties){Object.assign(properties,info.properties);return!0}}else{let m,rx=RX.VAR_ASSIGN,cssText=rule.parsedCssText,value,any;while(m=rx.exec(cssText)){// note: group 2 is var, 3 is mixin
value=(m[2]||m[3]).trim();// value of 'inherit' or... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"collectCssText(rule){return this.collectConsumingCssText(rule.parsedCssText)}",
"get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\... | [
"0.7610341",
"0.6875347",
"0.6875347",
"0.68470687",
"0.68470687",
"0.674461",
"0.650043",
"0.62613404",
"0.6089061",
"0.5955027",
"0.5866952",
"0.5843715",
"0.5843715",
"0.583096",
"0.5821078",
"0.5815599",
"0.5815599",
"0.5815599",
"0.5794584",
"0.5773636",
"0.57314473",
... | 0.76178205 | 0 |
Apply keyframe transformations to the cssText of a given rule. The keyframeTransforms object is a map of keyframe names to transformer functions which take in cssText and spit out transformed cssText. | applyKeyframeTransforms(rule,keyframeTransforms){let input=rule.cssText,output=rule.cssText;if(null==rule.hasAnimations){// Cache whether or not the rule has any animations to begin with:
rule.hasAnimations=RX.ANIMATION_MATCH.test(input)}// If there are no animations referenced, we can skip transforms:
if(rule.hasAnima... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applyCssTransform(element, transformValue) {\n // It's important to trim the result, because the browser will ignore the set operation\n // if the string contains only whitespace.\n var value = transformValue.trim();\n element.style.transform = value;\n element.style.webkitTransform = value... | [
"0.538633",
"0.538633",
"0.53525066",
"0.5042026",
"0.48116094",
"0.48008296",
"0.47997677",
"0.47997677",
"0.47997677",
"0.47997677",
"0.47997677",
"0.47997677",
"0.4783535",
"0.4783535",
"0.4783535",
"0.4755846",
"0.4740344",
"0.4740344",
"0.47345498",
"0.47202682",
"0.4679... | 0.8188085 | 0 |
Position components of a flow control statement. | positionFlowControlCompoundStatementComponents(node) {
const viewState = node.viewState;
const x = viewState.bBox.x;
let y;
if (TreeUtil.isBlock(node)) {
y = viewState.bBox.y + viewState.components['block-header'].h;
} else {
y = viewState.bBox.y;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Position() {\n this.line = tokCurLine;\n this.column = tokPos - tokLineStart;\n }",
"function Position() {\n this.line = tokCurLine;\n this.column = tokPos - tokLineStart;\n }",
"function startPosition() {\n //get the half height of div\n //separate in fourths\n let vertical = Math.ro... | [
"0.55084676",
"0.55084676",
"0.5343996",
"0.51481706",
"0.5128754",
"0.5111897",
"0.5085913",
"0.50822765",
"0.50800693",
"0.5046428",
"0.5033427",
"0.5027322",
"0.50152063",
"0.49993446",
"0.49993446",
"0.49993446",
"0.4992268",
"0.4992268",
"0.4992268",
"0.4992268",
"0.4992... | 0.70661885 | 0 |
This is a wrapper class for a peerjs connection. It gracefully handles making the connection, reopening the connection when it drops, saving and loading connection state, and reliably transferring data over the connection. peer The Peer object representing our client dstId The peer id we want to connect with dataCallba... | function MaqawConnection(peer, dstId, conn) {
var that = this;
this.peer = peer;
this.dstId = dstId;
// Callback arrays //
this.closeDirectives = [];
this.openDirectives = [];
this.dataDirectives = [];
this.errorDirectives = [];
this.changeDirectives = [];
console.log("inside ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DataConnection(peer, provider, options) { // 18\n if (!(this instanceof DataConnection)) return new DataConnection(peer, provider, options);\n EventEmitter.call(this); // 20\n ... | [
"0.6476937",
"0.6370383",
"0.6143796",
"0.60591936",
"0.60335207",
"0.5686942",
"0.5611968",
"0.55873835",
"0.5536844",
"0.5533031",
"0.54299426",
"0.5427964",
"0.5346703",
"0.53059596",
"0.52764386",
"0.52626896",
"0.52606195",
"0.5254547",
"0.52061903",
"0.51696694",
"0.516... | 0.74018675 | 0 |
Tries to open a DataChannel with our peer. Will retry at a set interval for a set number of attempts before giving up. | function attemptConnection() {
// how many milliseconds we will wait until trying to connect again
/* TODO: Exponential backoff instead? */
var retryInterval = 8000;
// The max number of times a connection will be attempted
var retryLimit = 5;
var numAttempts = 0;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function retryConnection() {\r\n setTimeout(reconnect.bind(this), this.retryDelay);\r\n }",
"function openGroupChannelWithRetry(backoffTime) {\n\t\tif (typeof backoffTime !== \"number\") backoffTime = jatos.channelOpeningBackoffTimeMin;\n\t\topenGroupChannel().fail(function () {\n\t\t\tif (backoffTime < jato... | [
"0.6210643",
"0.60806483",
"0.6044265",
"0.6006852",
"0.5839356",
"0.57424086",
"0.5725786",
"0.5645993",
"0.5645993",
"0.56150144",
"0.55881846",
"0.5586197",
"0.55170727",
"0.545468",
"0.5450184",
"0.5437721",
"0.54291826",
"0.53992915",
"0.53948236",
"0.53807527",
"0.53802... | 0.6678768 | 0 |
Joining users to workouts | function getWorkoutsList(id){
return db("user-workouts as uw")
.join("users as u", "uw.user_id", "u.id")
.join("workouts as w", "uw.workout_id", "w.id")
.where("u.id", id)
.select("w.id as workoutId", "u.name", "w.workoutName", "uw.date");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function index(req, res) {\n Workout.find( {'user' : req.user.id} )\n .populate('user').exec(function (err, workouts) {\n res.render('workouts/index', { workouts, title: 'My Workouts'});\n });\n}",
"join({gameId,role,userId,userName}) { this.$publish('join', {gameId,role,userId,userName})}",
... | [
"0.6095376",
"0.59462374",
"0.58891594",
"0.58754694",
"0.5832877",
"0.58098423",
"0.57657087",
"0.57554585",
"0.572771",
"0.57266146",
"0.57250327",
"0.5720269",
"0.5671098",
"0.56530416",
"0.5618216",
"0.55497193",
"0.55496544",
"0.5547716",
"0.5531093",
"0.5530958",
"0.551... | 0.6235607 | 0 |
Get a sampling from the RNN given a seed and a sample length. | function getSampling(seed, l) {
return new Promise((resolve, reject) => {
let str = '';
// Start the sample script.
const p = child_process.spawn('th', [
path.join(CHAR_RNN_PATH, 'sample.lua'), // Path to sample script
path.join(__dirname, '..', 'data', 'checkpoint.t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sample(batchSize) {\n return getRandomSubarray(this.memory, batchSize);\n }",
"function getRandom(len) {\n let r = Math.floor(Math.random() * len)\n return r\n}",
"function getRandomIndex(len) {\r\n return Math.floor(Math.random() * len);\r\n}",
"function generate_from (length, seed) {\n if (length... | [
"0.600908",
"0.60016316",
"0.5745631",
"0.5685026",
"0.55811715",
"0.5559411",
"0.54645926",
"0.544434",
"0.54278916",
"0.54141253",
"0.53862387",
"0.5379365",
"0.5370392",
"0.53419733",
"0.53000873",
"0.5289274",
"0.5248285",
"0.52397346",
"0.5214227",
"0.5213049",
"0.520831... | 0.6095103 | 0 |
Exctracts a tweet from a given sample. | function extractTweet(sample) {
let tweet = '';
// Extract lines of dialog.
const lines = sample.match(DIALOG_REGEX);
// Get rid of lines that do not follow basic rules of punctuation or are
// otherwise bad to tweet.
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tweetIt() {\n\tvar tweet = new Tweet(false);\n\t//Seleccionamos la fuente\n\ttweet.source = randomSource();\n\tconsole.log(\"source: \"+tweet.source);\n\t//GET tweet\n\tvar count = randomCount();\n\tT.get('statuses/user_timeline', { screen_name: tweet.source, count: count, tweet_mode: 'extended' }, functi... | [
"0.5987758",
"0.5899476",
"0.57616234",
"0.5631094",
"0.5604003",
"0.5558947",
"0.55514085",
"0.55210006",
"0.5520085",
"0.5511266",
"0.54981196",
"0.5467088",
"0.5438991",
"0.5430974",
"0.5416978",
"0.538252",
"0.53739774",
"0.53511",
"0.5341251",
"0.5337342",
"0.53366673",
... | 0.69558984 | 0 |
Sign in to the Twitter API. Resolves a twitter client object. | function signIn() {
return new Promise((resolve, reject) => {
// Read the credential file.
fs.readFile(path.join(__dirname, '..', 'secret', 'twitter-keys.json'), (err, data) => {
if (err) {
reject(err);
}
else {
try {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initTwitterOauth(){\n\tvar OAuth = require('oauth').OAuth;\n\toa = new OAuth( \n\t\t\t\t\t\"https://twitter.com/oauth/request_token\",\n \t\t\t\"https://twitter.com/oauth/access_token\", \n \tconfig.consumerKey,\n \tconfig.consumerSecret, \n \t\"1.0A\", ... | [
"0.6261159",
"0.6229129",
"0.61149824",
"0.6064242",
"0.5724446",
"0.57109743",
"0.5629929",
"0.55909634",
"0.55290675",
"0.54801863",
"0.542476",
"0.54065967",
"0.5403371",
"0.5359803",
"0.5353163",
"0.53253627",
"0.5282446",
"0.5266332",
"0.52632606",
"0.5257477",
"0.525465... | 0.62606996 | 1 |
uploading and assigning an id verification document | _assignIdentityVerificationDocument(stripeConnectAccount, stripeFileUploadId) {
set(stripeConnectAccount, 'legalEntityVerificationDocument', stripeFileUploadId);
return stripeConnectAccount
.save()
.then(RSVP.resolve)
.catch(() => this._wrapError(VERIFICATION_DOCUMENT_ERROR));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadDocument() {\n // Todo: Implementation\n }",
"function setPublication(id) {\n\tarquivoId = id;\n\tsetRequestUri(id);\n\tdocument.uploadForm0.arquivoId.value = arquivoId;\n\tdocument.thumbFormM.arquivoId.value = arquivoId;\n}",
"async function Add_user_Document_CostumID(){\r\n var ref = doc(... | [
"0.6742811",
"0.64782405",
"0.642618",
"0.6414869",
"0.6407714",
"0.6322502",
"0.6224576",
"0.6100023",
"0.60777974",
"0.6005948",
"0.5977287",
"0.5943669",
"0.5872696",
"0.5797424",
"0.57909274",
"0.5789072",
"0.5775507",
"0.5766436",
"0.5737364",
"0.5708714",
"0.569684",
... | 0.74475616 | 0 |
numbering NonEmpty take a variable for numbering on nonEmpty content | function numberingnonEmpty(strarr){
let num = 1 ;
// let strarr = data.toString().split('\n') ;
for(let k = 0 ; k < strarr.length ; k++){
var trimmed = strarr[k].trim();
if(strarr[k].length != 0){
if (trimmed .length !== 0) {
consol... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEltNumber() {\n return holder.replace(HOLDER_HEADER, \"\").split(HOLDER_DIVIDER).length - 1;\n}",
"function nonEmpty(data){\n\n var count = 0; /**Variable that stores the number of element that are not empty.*/\n\n for(var i = 0; i < data.length; i++) /**For loop iteration through the datase... | [
"0.57647425",
"0.5543435",
"0.55078775",
"0.55078775",
"0.55078775",
"0.55078775",
"0.55078775",
"0.55078775",
"0.5378614",
"0.5335862",
"0.52843803",
"0.5234443",
"0.5197327",
"0.5186282",
"0.5182392",
"0.51773214",
"0.5168465",
"0.51260376",
"0.50977725",
"0.50587606",
"0.5... | 0.67051846 | 0 |
check if new entry is unique | function unique_check( obj, field_id ){
var exists=false;
var u = JSN.forEach(
function(v,i){
if( v[field_id].toString() == $(obj).text() && $(obj).text() != "" ){
console.log( field_id, "unique" );
exists=true;
}
}
);
return exists;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkDuplicates(email) {\n this.props.firebase.emailList(encode(email.toLowerCase())).once(\"value\", object => {\n if (object.val() !== null) {\n return true;\n }\n return false;\n })\n }",
"isUnique(alarm) {\n if (this.alarmList.length === 0) return true;\n const ... | [
"0.6647472",
"0.6367263",
"0.6355697",
"0.6304488",
"0.62901527",
"0.6206719",
"0.61834306",
"0.61596066",
"0.61496407",
"0.61294895",
"0.6102974",
"0.610031",
"0.60846967",
"0.60560584",
"0.60458094",
"0.60365593",
"0.6020904",
"0.6011883",
"0.60085213",
"0.59941715",
"0.598... | 0.65521127 | 1 |
get history of all approved and canceled changes requests | function get_history(){
// get history of changes from datasource
var J=json_load( $().source_path() + "/get_history.php");
J.forEach(
function(v,i){
$(".history .row ul").append( "<li><a href='" + v + "'>" + v + "</a></li>")
}
);
// show number of all approved and canceled requests
$("#histo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SwitchRequestHistory() {\n var switchRequests = []; // running total\n var srHistory = []; // history of each switch\n function push(switchRequest) {\n if (switchRequest.newValue === _SwitchRequestJs2['default'].NO_CHANGE) {\n switchRequest.newValue = switchRequest.oldValue;\n }if (!switchRe... | [
"0.66190827",
"0.62462217",
"0.6161508",
"0.6143683",
"0.6095812",
"0.60616446",
"0.60616297",
"0.6031299",
"0.60155135",
"0.6008661",
"0.5877866",
"0.5866469",
"0.58384764",
"0.5837374",
"0.5793876",
"0.5739674",
"0.566742",
"0.56155354",
"0.5512647",
"0.55019665",
"0.549302... | 0.673494 | 0 |
create umapJSON from template.umap.json | function create_umap_from_template(UMAP){
UMAP.properties.name = SOURCE.title;
UMAP.properties.description = SOURCE.description;
UMAP.layers[0]._storage.name = SOURCE.title;
UMAP.layers[0]._storage.description = SOURCE.description;
UMAP.layers[0]._storage.popupContentTemplate = "{{{icon}|100}}\n\n" + SOURCE.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convert_template_to_string(template_json,unshown_values)\n{\n if (unshown_values)\n template_json = $.extend({}, template_json, unshown_values);\n\n\n var template_str = \"\\n\";\n $.each(template_json, function(key, value)\n {\n // value can be an array\n if (!value) retur... | [
"0.5453177",
"0.5432017",
"0.53590554",
"0.53053147",
"0.5301079",
"0.5280976",
"0.5177022",
"0.5162714",
"0.51030177",
"0.50995713",
"0.506537",
"0.5059666",
"0.5050709",
"0.50260025",
"0.50231147",
"0.50158244",
"0.5013843",
"0.5013807",
"0.50080085",
"0.4986319",
"0.498421... | 0.73008513 | 0 |
Returns KumarHassebrook similarity between vectors a and b | function kumarHassebrook(a, b) {
let p = 0;
let p2 = 0;
let q2 = 0;
for (let i = 0; i < a.length; i++) {
p += a[i] * b[i];
p2 += a[i] * a[i];
q2 += b[i] * b[i];
}
return p / (p2 + q2 - p);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static cosineSimilarity(vector1, vector2) {\n const v1 = Array.from(vector1.values());\n const v2 = Array.from(vector2.values());\n let dotProduct = 0.0;\n let ss1 = 0.0;\n let ss2 = 0.0;\n const length = Math.min(v1.length, v2.length);\n for (let i = 0; i < length; i++) {\n // Ignore pai... | [
"0.6967097",
"0.6598287",
"0.6560754",
"0.6546016",
"0.6513449",
"0.6462036",
"0.6427878",
"0.6367342",
"0.63549745",
"0.6306882",
"0.6301595",
"0.62848186",
"0.6261436",
"0.6202819",
"0.6202776",
"0.6191456",
"0.6174519",
"0.61488533",
"0.6072616",
"0.6066172",
"0.60376734",... | 0.70276767 | 0 |
The method handles dynamically generating the pagination counter based on total data count | function displayPaginationCounter(dataCount) {
// Refresh the original list with new list
var pagination = document.querySelector('#nav-pagination');
pagination.innerHTML = "";
// Get the total page number
var page = Math.ceil(dataCount / 10);
for (var i = 1; i <= page; i++) {
// Insert each page ite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populatePaginationPage(data, resultcount){\n $('.search-pagination').empty();\n \n //Add pagination_count div\n var pageCountHTML = '<div class=\"pagination_count\"></div>',\n pageULHTML = '<ul id=\"sp-pagination-ul\"></ul>';\n ... | [
"0.69525427",
"0.68218637",
"0.68083256",
"0.6722857",
"0.6712397",
"0.6683485",
"0.6644039",
"0.66200906",
"0.65744376",
"0.6572272",
"0.6559378",
"0.6472771",
"0.6466983",
"0.64641154",
"0.6364782",
"0.6357244",
"0.6354943",
"0.6339096",
"0.6327583",
"0.63260806",
"0.632566... | 0.73709166 | 0 |
ten cac loai tai khoan theo ma tai khoan | static getTenLoaiTaiKhoan(MaLoaiTaiKhoan){
let TenLoaiTaiKhoan = "";
switch (MaLoaiTaiKhoan) {
case 0:
TenLoaiTaiKhoan = "Tài Khoản Thanh Toán";
break;
case 1:
TenLoaiTaiKhoan = "Tài Khoản Tiết Kiệm";
break;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LFasTNMeczSL0Nma4X8IUw(){}",
"function bondaa(etunimi,sukunimi){\n\tvar lause=etunimi+' '+sukunimi+': \"<i>Ravistettuna, ei sekoitettuna.</i>\"';\n\treturn lause;\n\n }",
"function country1(mark) {\n var masini = {//facem un obiect\n \"toyota\": \"Japonia\",\n \"hiunday\": \"China\",\... | [
"0.6342417",
"0.62690324",
"0.62634027",
"0.6232458",
"0.62312376",
"0.6179616",
"0.61597556",
"0.6151738",
"0.61467946",
"0.612274",
"0.6122118",
"0.6109035",
"0.6100389",
"0.60825044",
"0.607822",
"0.60630655",
"0.6033895",
"0.60326976",
"0.6006868",
"0.59931374",
"0.599313... | 0.63840437 | 0 |
Move hoop to right side animation | function moveRight() {
$("#hoop").animate({
left: '900px'
}, 5000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"turnSnakeRight() {\r\n this.slitherer_.turnRight();\r\n }",
"function toRight() {\n $(\".loader_holder\").animate({\n left: \"40px\",\n }, 300, toLeft);\n }",
"function moveRight () {\n globalVariables.fluttershy.body.velocity.x = globalConstants.RIGHT_VELOCITY;\n ... | [
"0.68769914",
"0.6814356",
"0.6699065",
"0.6698615",
"0.66948676",
"0.66813844",
"0.6666541",
"0.66538227",
"0.6652638",
"0.66411614",
"0.6608034",
"0.6604185",
"0.65897495",
"0.6582517",
"0.6582123",
"0.65599954",
"0.655454",
"0.6541601",
"0.653397",
"0.6522048",
"0.65205824... | 0.6904081 | 0 |
Function that allows the other balls that appear to be animated | function shootOtherBalls(e) {
e.preventDefault();
if (secondsLeft > 59) {
showSwoosh();
} else if (secondsLeft < 53.5 && secondsLeft > 51.5) {
showSwoosh();
} else if (secondsLeft < 48.5 && secondsLeft > 46.5) {
showSwoosh();
} else if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animate(){\n ctx.fillStyle = 'rgba(0,0,0,0.25)';\n ctx.fillRect(0,0,width,height);\n for(i=0;i<balls.length;i++){\n balls[i].draw();\n balls[i].update();\n balls[i].collisionDetect();\n }\n requestAnimationFrame(animate);\n}",
"function animate() {\n if (tx != window.innerWidth || ty != w... | [
"0.69948226",
"0.6934899",
"0.6840285",
"0.68164045",
"0.67436534",
"0.67170185",
"0.67090845",
"0.67030436",
"0.66951233",
"0.667746",
"0.6673626",
"0.66539824",
"0.6643216",
"0.6637309",
"0.6637309",
"0.66355026",
"0.66269803",
"0.6598578",
"0.6569877",
"0.6563045",
"0.6561... | 0.6970716 | 1 |
Submits a new user and brings user to the score page | function submitUser(User) {
$.post("/api/users/", User, function () {
window.location.href = "/scores";
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitScore() {\n event.preventDefault();\n\n var user = JSON.parse(localStorage.getItem(\"user\"));\n if (!user) {\n user = [];\n }\n\n var person = { initials: initialsInput.value, score: score };\n user.push(person);\n\n localStorage.setItem(\"user\", JSON.stringify(user));\n viewHighScores(... | [
"0.73774725",
"0.7162981",
"0.7094417",
"0.67253786",
"0.6694811",
"0.66583055",
"0.664457",
"0.6600564",
"0.6568931",
"0.65330434",
"0.6515131",
"0.64717644",
"0.6471242",
"0.64194167",
"0.63725406",
"0.63609743",
"0.63536984",
"0.63536286",
"0.63535446",
"0.63532525",
"0.63... | 0.7399575 | 0 |
Creates a new enumeration to define the authorization actions. | constructor() {
super();
/**
* The user tries to retrieve the values of a model from the repository.
* @constant {number} bo.rules.AuthorizationAction#fetchObject
* @default 0
*/
this.fetchObject = 0;
/**
* The user tries to save the values of a new model to the repository.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function actions(obj_type) {\r\n return new Actions(obj_type);\r\n}",
"getActions() {\n if (!this.actions)\n this.actions = new ActionModule.Actions(this.driver);\n return this.actions;\n }",
"function Enums() {\n}",
"createActions() {\n debug('\"createActions\" must be impl... | [
"0.5323805",
"0.5313892",
"0.52264357",
"0.5215766",
"0.5205112",
"0.5205112",
"0.5141546",
"0.51278836",
"0.51278836",
"0.5117428",
"0.5113852",
"0.48794478",
"0.48395008",
"0.4826859",
"0.4823442",
"0.48219854",
"0.48120177",
"0.47879845",
"0.4759554",
"0.4745803",
"0.47383... | 0.576453 | 0 |
Returns the currently active army. | getCurrentArmy(): ?Tile {
const oldCurrentArmy = this.gameState.tiles[this._currentArmyIndex];
if (!oldCurrentArmy || !oldCurrentArmy.isOwnedBy(this.playerIndex) || oldCurrentArmy.getArmies() < 2) {
const largestArmy = this.getLargestArmy();
if (largestArmy) {
this._currentArmyIndex = larges... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getActiveItem() {\n return this._activeItem\n }",
"getActiveItem() {\n const items = this.getItems();\n const index = this.findActiveIndex(items);\n return items[index];\n }",
"getActiveId() {\n return this.getValue().active;\n }",
"get active() {\n return this._isActive... | [
"0.5707082",
"0.56447583",
"0.5505178",
"0.53995806",
"0.53960603",
"0.5376981",
"0.5376981",
"0.536133",
"0.5341636",
"0.5331378",
"0.5330189",
"0.5314835",
"0.53118217",
"0.53118217",
"0.53118217",
"0.53118217",
"0.5302638",
"0.52957106",
"0.5265193",
"0.52500606",
"0.52440... | 0.5772626 | 0 |
Return the best city to take. | getBestCity() {
const cities = this.gameState.tiles.filter((tile) => tile.isCity());
if (cities.length == 0) {
return null;
} else {
cities.sort((a, b) => a.getArmies() - b.getArmies());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bestCollectionSite() {\n if (!this.job) {\n return null;\n }\n\n return this.city.bestCollectionSite(this.creep.pos);\n }",
"function getNearestCity(data,distance) {\n\tvar nearestCity=\"\";\n\tfor(i=0;i<data.length;i++)\n\t{\n\t\tif(data[i].distance==distance)\n\t\t{\n\t\t\tnearestCity=data[i].ci... | [
"0.6751605",
"0.6705019",
"0.6684046",
"0.6505045",
"0.6421578",
"0.63571745",
"0.63322604",
"0.6176687",
"0.60995424",
"0.6060349",
"0.594782",
"0.5913606",
"0.590716",
"0.59056187",
"0.5896466",
"0.5892792",
"0.58894247",
"0.5865232",
"0.58640283",
"0.58454645",
"0.5836381"... | 0.7963969 | 0 |
Remove any textfields or drop downs from the page and clear usemap | function clearPage() {
$('#textAreas').html("");
$('.img').attr('usemap', '');
$('#filter-expand-img').attr('usemap', '');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearMap() {\n drawing_layer.getSource().clear();\n highlight_overlay.getSource().clear();\n\n $('#list').empty()\n $('#list').append('<p>Select a property on the map.</p><hr>');\n\n $('#summary').empty()\n $('#summary').append('<p>Select a property on the map to view a summary of the pr... | [
"0.6920484",
"0.6749921",
"0.6705175",
"0.66739166",
"0.666118",
"0.6641729",
"0.6636044",
"0.6559837",
"0.6559837",
"0.6559837",
"0.6522119",
"0.6497693",
"0.6455082",
"0.6409039",
"0.63940424",
"0.6376981",
"0.63743466",
"0.6367556",
"0.6350326",
"0.6349188",
"0.6323086",
... | 0.7814941 | 0 |
round: int (starts at 1) region: shortcode of region region_match: int match number relative to region and round (starts at 1) result: int 0 or 1 | function makePick(round, region, region_match, result) {
initamt = 32;
for (i = 0; i < round - 1; i++) {
initamt = initamt / 2;
}
// Get region relative position
if (initamt >= pickorder.length) {
region_rel = -1;
for (i = 0; i < pickorder.length; i++) {
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"nearestDiscRegion(currRegion){\n var text = \"\";\n switch (currRegion) {\n case \"Arts and Social Sciences\":\n text = \"General\"; // or computing?\n break;\n case \"Business\":\n text = \"Business\";\n break;\n case \"Computing\":\n tex... | [
"0.54433674",
"0.5308306",
"0.5285232",
"0.52198064",
"0.5206167",
"0.514854",
"0.5071614",
"0.50600576",
"0.50600576",
"0.50600576",
"0.50600576",
"0.50376487",
"0.5034391",
"0.5033839",
"0.50326973",
"0.50326973",
"0.50326973",
"0.50326973",
"0.50326973",
"0.50326973",
"0.5... | 0.59470445 | 0 |
Given a JSON object of wincounts for all players convert into nodes and links JSON object | function convertToGraphData(res, wincounts) {
// Arrays to store nodes and links needed for D3.js graph
var nodes = [];
var links = [];
var sourceIndex, targetIndex;
// Get distinct set of players
Player.findAsync()
.then(function(players) {
players.forEach(function(player) {
nodes.push({ '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function outputParser(json){\n\tvar graph = {\"nodes\":[],\"links\":[]}; //\n\tvar myJSON = json.results.bindings;\n\tvar iName = xhrEntityName(parseEntity(formatUri()), parseMbid(formatUri()));\n\tvar queriedNode = {\"mbid\":parseMbid(formatUri()),\"uri\":formatUri(),\"type\":parseEntity(formatUri()),\"name\": iN... | [
"0.5871218",
"0.5813911",
"0.55087596",
"0.5462772",
"0.5206985",
"0.52036476",
"0.52019763",
"0.51644325",
"0.513342",
"0.5091028",
"0.50477195",
"0.5042434",
"0.5036109",
"0.5017412",
"0.50155723",
"0.50075436",
"0.500613",
"0.49990836",
"0.49862996",
"0.4971683",
"0.491058... | 0.71102655 | 0 |
GET route to /api/jokes | function getJokes(req, res) {
const requestOptions = { headers: { accept: 'application/json' }}
axios
.get('https://icanhazdadjoke.com/search', requestOptions)
.then(response => {
return res.status(200).json(response.data.results);
})
.catch(error => {
setTimeout(function () {
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getJokes(req, res) {\n const requestOptions = {\n headers: { accept: 'application/json' },\n };\n\n axios\n .get('https://icanhazdadjoke.com/search', requestOptions)\n .then(response => {\n res.status(200).json(response.data.results);\n })\n .catch(err => {\n res.status(500).js... | [
"0.712883",
"0.62359744",
"0.61834735",
"0.6119414",
"0.5694689",
"0.5603347",
"0.5523624",
"0.54563206",
"0.5428955",
"0.5366807",
"0.53225857",
"0.53012884",
"0.5297533",
"0.52939385",
"0.52930933",
"0.528978",
"0.5271807",
"0.52178496",
"0.51862335",
"0.5176536",
"0.514297... | 0.6510588 | 1 |
calculateBonusRate returns the raw bonus rate without any if/ands/or buts | function calculateBonusRate(dataArray){
var rating = dataArray[3];
if (rating <= 2){
return bonus = 0.0;
console.log(bonus);
}else if(rating == 3){
return bonus = .04;
console.log(bonus);
}else if(rating == 4){
return bonus = .06;
console.log(bonus);
}else if(rating == 5){
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBonusRate(timestamp) {\n \n const len = this.config.bonuses.length;\n\n for (let i = 0; i < len - 2; i++) {\n if (timestamp < this.config.bonuses[i + 1].time) {\n return this.config.bonuses[i].bonus;\n }\n }\n\n ... | [
"0.65773857",
"0.6393493",
"0.6319022",
"0.6262732",
"0.6240746",
"0.6205941",
"0.6188107",
"0.61560994",
"0.61325836",
"0.60694355",
"0.604338",
"0.6021069",
"0.5916074",
"0.5911933",
"0.5898866",
"0.5898866",
"0.58980125",
"0.5880868",
"0.58712775",
"0.5863177",
"0.5859923"... | 0.72884935 | 0 |
end of calculateBonusRate function calculateBonusRate(robert); tenureAdjustedRate returns the actual rate based off of years with company up to .13 | function tenureAdjustedRate(dataArray){
if (dataArray[1].length == 4){
if (calculateBonusRate(dataArray) + .05 > .13){
return .13;
}else {
return calculateBonusRate(dataArray) + .05;
}
}else{
return calculateBonusRate(dataArray);
};
}//end of whole tenure function | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calculateR(wantRate) {}",
"function calculateBonusRate(dataArray){\n var rating = dataArray[3];\n\n if (rating <= 2){\n return bonus = 0.0;\n console.log(bonus);\n }else if(rating == 3){\n return bonus = .04;\n console.log(bonus);\n }else if(rating == 4){\n return bonus = .06;\n console.... | [
"0.6676407",
"0.6515007",
"0.6439686",
"0.643909",
"0.6435405",
"0.6379201",
"0.63038814",
"0.62714046",
"0.62247235",
"0.6198732",
"0.61717933",
"0.61589766",
"0.6143146",
"0.6119419",
"0.61188066",
"0.6079974",
"0.6062269",
"0.6048191",
"0.6022662",
"0.601298",
"0.59859157"... | 0.7523347 | 0 |
tenureAdjustedRate(scout); calculateTotalBonus returns base + adjusted bonus | function calculateTotalBonus(dataArray){
var income = dataArray[2];
var extraCheck = income * tenureAdjustedRate(dataArray);
var hugeCheck = +income + +extraCheck;
console.log(hugeCheck);
} //end of calculateTotalBonus function | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tenureAdjustedRate(dataArray){\n if (dataArray[1].length == 4){\n if (calculateBonusRate(dataArray) + .05 > .13){\n return .13;\n }else {\n return calculateBonusRate(dataArray) + .05;\n }\n }else{\n return calculateBonusRate(dataArray);\n\n };\n}//end of whole tenure functio... | [
"0.6643681",
"0.65383935",
"0.63316715",
"0.6251278",
"0.6188569",
"0.6099555",
"0.6071555",
"0.6043779",
"0.5980782",
"0.5980157",
"0.59680784",
"0.5941474",
"0.59379935",
"0.58772105",
"0.58031297",
"0.58029157",
"0.58012056",
"0.57842934",
"0.5772639",
"0.5769834",
"0.5769... | 0.65566474 | 1 |
Finds a control given the tagName and ControlID. This function is necessary for instances where the clientID for a given control may have changed due to be embedded in another object such as a MasterPage ContentPlaceHolder | function findControl(tagName, controlId)
{
var aControls = document.getElementsByTagName(tagName);
if (aControls==null)
return null;
for (var i=0; i< aControls.length; i++)
{
var j = aControls[i].id.lastIndexOf(controlId);
if ((j -1) && (j == (aControls[i].id.length - con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getclientId(controlid) {\n return $('[id$=' + controlid + ']').attr('id');\n}",
"function fgetControl() {\n\t\t// as with jQuery 1.4.3 and 1.4.4 there is a big problem here, we increase checks here\n\t\tif(!this || !this.nodeType || this.nodeType === 9) {\n\t\t\treturn null;\n\t\t} // in this case, w... | [
"0.63831156",
"0.63710463",
"0.5869617",
"0.56419",
"0.55456376",
"0.5363015",
"0.53271616",
"0.53096986",
"0.5281361",
"0.52174115",
"0.5210764",
"0.5195981",
"0.5187306",
"0.5150186",
"0.5141712",
"0.5133288",
"0.5130661",
"0.5052811",
"0.50285006",
"0.50041336",
"0.4974348... | 0.8323805 | 0 |
TODO: Deve excluir os times vinculados | _excluirTime() {
db.child(`time/${this._recuperaChaveTime()}`).remove();
$(location).attr('href', 'home.html');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prunelocalTemporalUniq() {\n if (CliqzSecureMessage.localTemporalUniq && Object.keys(CliqzSecureMessage.localTemporalUniq).length > 0) {\n const currTime = Date.now();\n let pi = 0;\n Object.keys(CliqzSecureMessage.localTemporalUniq).forEach(e => {\n const d = ... | [
"0.65233946",
"0.6116818",
"0.607325",
"0.6030135",
"0.5989577",
"0.59871155",
"0.59718966",
"0.5935842",
"0.58607787",
"0.5836068",
"0.5800667",
"0.5787164",
"0.5757611",
"0.57506865",
"0.57493985",
"0.5743471",
"0.5727994",
"0.57111067",
"0.5692821",
"0.5690864",
"0.5683927... | 0.61739284 | 1 |
function to load and add census block layers | function addCensusBlocks(map){
const datasource = "data/chicagoCensusBlocks.geojson";
let data = $.ajax(datasource, {
dataType: "json",
success: function(response){
// return response;
censusBlocksLayer = createCensusBlocks(response, map);
activeLayers.push(c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadLayers() {\n // Read the configuration data and create layers from it.\n const edt = this;\n const linkMaterial = new Cesium.Color(\n edt.configData.cesiumParams.linkColor.red,\n edt.configData.cesiumParams.linkColor.green,\n edt.configData.cesiumParams.linkColor.blue,\n edt.config... | [
"0.6834753",
"0.6068222",
"0.6047423",
"0.60469186",
"0.60426474",
"0.5884526",
"0.5793759",
"0.57750267",
"0.5746339",
"0.57092786",
"0.56968594",
"0.5636791",
"0.56298417",
"0.5625672",
"0.5618911",
"0.5571513",
"0.5551502",
"0.5527038",
"0.5509112",
"0.5493667",
"0.5484531... | 0.73426807 | 0 |
Called at the end of the configuration sequence. Indicates that all breakpoints etc. have been sent to the DA and that the 'launch' can start. | configurationDoneRequest(response, args) {
super.configurationDoneRequest(response, args);
// notify the launchRequest that configuration has finished
this._configurationDone.notify();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handlePostInitTasks() {\n //Notify the container / platform that AM load is complete\n if (namespace && namespace.containerApis && namespace.containerApis.notifyAMLoaded && typeof namespace.containerApis.notifyAMLoaded === \"function\") {\n namespace.containerApis.notifyAMLoaded({... | [
"0.5505556",
"0.54855824",
"0.54513955",
"0.52870417",
"0.52266747",
"0.51972747",
"0.51853687",
"0.51698196",
"0.5052956",
"0.5029677",
"0.49846452",
"0.49643874",
"0.49589634",
"0.49495155",
"0.49423188",
"0.49358344",
"0.49331182",
"0.4930557",
"0.4882459",
"0.48752758",
"... | 0.5711403 | 0 |
end of function / this function ask about delete Inbox Message by JobSeeker from admin panel | function deleteInMsgByJobSeeker(m_id)
{
var retVal = confirm("Do you want to DELETE this Inbox Message ? message id="+m_id);
if( retVal == true ){
window.location="deleteInboxMessageByJobseeker?m_id="+m_id+"&action=deleteInMessage";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteOutMsgByJobSeeker(m_id)\r\n { \r\n\t\t\t\t\r\n\t\t\t\t\r\n var retVal = confirm(\"Do you want to DELETE this OutBox Message ? message id=\"+m_id);\r\n if( retVal == true ){\r\n window.location=\"deleteOutboxMessageByJobseeker?m_id=\"+m_i... | [
"0.7644088",
"0.6864624",
"0.662662",
"0.65920997",
"0.6434122",
"0.64010876",
"0.6340102",
"0.62788546",
"0.61644363",
"0.61290747",
"0.6101885",
"0.6091203",
"0.5973248",
"0.5957503",
"0.59543514",
"0.5946494",
"0.5943843",
"0.59415096",
"0.59345716",
"0.5927024",
"0.592647... | 0.7699507 | 0 |
end of function / this function ask about delete Inbox Message by JobSeeker from admin panel | function deleteOutMsgByJobSeeker(m_id)
{
var retVal = confirm("Do you want to DELETE this OutBox Message ? message id="+m_id);
if( retVal == true ){
window.location="deleteOutboxMessageByJobseeker?m_id="+m_id+"&action=deleteOutMessage";... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteInMsgByJobSeeker(m_id)\r\n { \r\n\t\t\t\t\r\n\t\t\t\t\r\n var retVal = confirm(\"Do you want to DELETE this Inbox Message ? message id=\"+m_id);\r\n if( retVal == true ){\r\n window.location=\"deleteInboxMessageByJobseeker?m_id=\"+m_id+\... | [
"0.7699507",
"0.6864624",
"0.662662",
"0.65920997",
"0.6434122",
"0.64010876",
"0.6340102",
"0.62788546",
"0.61644363",
"0.61290747",
"0.6101885",
"0.6091203",
"0.5973248",
"0.5957503",
"0.59543514",
"0.5946494",
"0.5943843",
"0.59415096",
"0.59345716",
"0.5927024",
"0.592647... | 0.7644088 | 1 |
Build an AWS CLIcompatible credential chain provider This is similar to the default credential provider chain created by the SDK except: 1. Accepts profile argument in the constructor (the SDK must have it prepopulated in the environment). 2. Conditionally checks EC2 credentials, because checking for EC2 credentials on... | static async credentialChain(profile, ec2creds, containerCreds, httpOptions) {
await forceSdkToReadConfigIfPresent();
profile = profile || process.env.AWS_PROFILE || process.env.AWS_DEFAULT_PROFILE || 'default';
const sources = [
() => new AWS.EnvironmentCredentials('AWS'),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async credentialChain(options = {}) {\n var _a, _b;\n // To match AWS CLI behavior, if a profile is explicitly given using --profile,\n // we use that to the exclusion of everything else (note: this does not apply\n // to AWS_PROFILE, environment credentials still take precedence... | [
"0.77802557",
"0.6581005",
"0.5677772",
"0.5397674",
"0.5337286",
"0.5078905",
"0.50312394",
"0.50000197",
"0.49375734",
"0.48878843",
"0.48056144",
"0.47268146",
"0.47268146",
"0.47238353",
"0.46958366",
"0.46790904",
"0.46378848",
"0.4635106",
"0.45779774",
"0.45562395",
"0... | 0.74659497 | 1 |
Return the default region in a CLIcompatible way Mostly copied from node_loader.js, but with the following differences to make it AWS CLI compatible: 1. Takes a profile name as an argument (instead of forcing it to be taken from $AWS_PROFILE). This requires having made a copy of the SDK's `SharedIniFile` (the original ... | static async region(profile) {
profile = profile || process.env.AWS_PROFILE || process.env.AWS_DEFAULT_PROFILE || 'default';
// Defaults inside constructor
const toCheck = [
{ filename: credentialsFileName(), profile },
{ isConfig: true, filename: configFileName(), profil... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async region(options = {}) {\n var _a;\n const profile = options.profile || process.env.AWS_PROFILE || process.env.AWS_DEFAULT_PROFILE || 'default';\n // Defaults inside constructor\n const toCheck = [\n { filename: credentialsFileName(), profile },\n { isCo... | [
"0.69096285",
"0.64289993",
"0.61847097",
"0.58918005",
"0.58147043",
"0.56895494",
"0.5406757",
"0.54053485",
"0.54047334",
"0.53736395",
"0.5288662",
"0.5264031",
"0.5246862",
"0.5221273",
"0.498834",
"0.4959693",
"0.4883475",
"0.47888416",
"0.4774727",
"0.47697145",
"0.474... | 0.7946675 | 0 |
Return whether it looks like we'll have ECS credentials available | function hasEcsCredentials() {
return AWS.ECSCredentials.prototype.isConfiguredForEcsCredentials();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function credentialCheck () {\n let creds = aws.config.credentials\n let invalidCreds = Array.isArray(creds) && !creds.length\n let noCreds = !creds || invalidCreds || process.env.ARC_AWS_CREDS == 'missing'\n if (noCreds && needsValidCreds) {\n // Set missing creds flag and let consuming... | [
"0.6737611",
"0.6710156",
"0.6647585",
"0.6457558",
"0.62386817",
"0.6218055",
"0.62102723",
"0.6200608",
"0.6131014",
"0.6130226",
"0.61142135",
"0.61112046",
"0.6093452",
"0.6005508",
"0.59206337",
"0.58810836",
"0.58109075",
"0.57712317",
"0.5747796",
"0.571395",
"0.570600... | 0.852464 | 1 |
Return whether we're on an EC2 instance | async function hasEc2Credentials() {
logging_1.debug("Determining whether we're on an EC2 instance.");
let instance = false;
if (process.platform === 'win32') {
// https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/identify_ec2_instances.html
const result = await util.promisify(child_pro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function isEc2Instance() {\n if (isEc2InstanceCache === undefined) {\n logging_1.debug(\"Determining if we're on an EC2 instance.\");\n let instance = false;\n if (process.platform === 'win32') {\n // https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/identify_ec2_insta... | [
"0.7831838",
"0.6230131",
"0.609296",
"0.6003583",
"0.579951",
"0.57743543",
"0.57613015",
"0.5715391",
"0.56831497",
"0.5574448",
"0.5569626",
"0.556909",
"0.556909",
"0.55508286",
"0.55508286",
"0.5545693",
"0.55049586",
"0.5483292",
"0.5476673",
"0.5474153",
"0.5474153",
... | 0.7439999 | 1 |
Force the JS SDK to honor the ~/.aws/config file (and various settings therein) For example, ther is just NO way to do AssumeRole credentials as long as AWS_SDK_LOAD_CONFIG is not set, or read credentials from that file. The SDK crashes if the variable is set but the file does not exist, so conditionally set it. | async function forceSdkToReadConfigIfPresent() {
if (await fs.pathExists(configFileName())) {
process.env.AWS_SDK_LOAD_CONFIG = '1';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function configureAws() {\n\n if (!fs.existsSync('./aws-config.json')) {\n JSON_STRING = '{ \"accessKeyId\":\"' + ACCESS_KEY + '\", \"secretAccessKey\": \"' + SECRET_KEY + '\", \"region\": \"us-east-1\" }';\n fs.writeFile(\"./aws-config.json\", JSON_STRING, function(err) {\n console.log... | [
"0.7176453",
"0.6635744",
"0.644927",
"0.6166981",
"0.6166981",
"0.55868703",
"0.5560958",
"0.5500127",
"0.54302704",
"0.5401831",
"0.5362245",
"0.5330588",
"0.5291802",
"0.5195609",
"0.5195189",
"0.51929754",
"0.51443666",
"0.5121958",
"0.5101181",
"0.50860167",
"0.5019894",... | 0.80685925 | 1 |
Converts a value to a JSONable object or returns it unchanged if it has no custom converter method. | function safeToJSON(value) {
var method = value.toJSON;
return method ? value.toJSON() : value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"convertToPublic(value) {\n if (value && value.toJSON)\n value = value.toJSON();\n return value;\n }",
"convertToPublic(value) {\n if (value && value.toJSON)\n value = value.toJSON();\n return value;\n }",
"function toJson(value){\n\treturn JSON.parse(valu... | [
"0.6753704",
"0.6753704",
"0.672053",
"0.66916627",
"0.6261415",
"0.6260685",
"0.610855",
"0.60746694",
"0.6069252",
"0.60354674",
"0.6021479",
"0.6017139",
"0.6010711",
"0.6008203",
"0.6008203",
"0.6008203",
"0.6008203",
"0.6008203",
"0.6008203",
"0.60072345",
"0.60067236",
... | 0.747775 | 0 |
Returns the color to use for the specified severity. | function getSeverityColor(severity) {
return RGB.gradient(severity, SEVERITY_GRADIENT);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function determineDamageColor(severity) {\r\n \t if(severity > 7){\r\n\t \t \ticoncolor = 'redHome.png';\r\n\t \t }\r\n\t \t else if(severity <= 7 && severity > 4){\r\n\t \t \ticoncolor = 'yellowHome.png';\r\n\t \t }\r\n\t \t else if(severity <= 4 && severity >0){\r\n\t \t \ticoncolor = 'greenHome.png'... | [
"0.65331733",
"0.64469177",
"0.63795197",
"0.6375309",
"0.6335735",
"0.6313151",
"0.6285152",
"0.62443686",
"0.6116556",
"0.60593057",
"0.60495806",
"0.60293394",
"0.6027461",
"0.60240436",
"0.6009398",
"0.5990091",
"0.5988756",
"0.5987828",
"0.5985148",
"0.59815043",
"0.5973... | 0.8358372 | 0 |
A read/write map connected to local storage. | function MapStorage(key, map) {
this.key = key;
this.map = map;
this.listeners = [];
addEventListener("storage", this.onChange.bind(this), false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"readLocal() {\n // Get data from the local storage\n const saved = JSON.parse(localStorage.getItem('savedlocations'));\n\n // If local storage has data, save to the object\n if (saved) this.saved = saved;\n }",
"function memSaveMap() {\n localStorage.setItem(\"selectedMap\", Game.currentMap.toStr... | [
"0.6522305",
"0.62957513",
"0.59834546",
"0.5871684",
"0.57387185",
"0.57245356",
"0.56851715",
"0.56371325",
"0.55995506",
"0.55607873",
"0.55358434",
"0.55186737",
"0.55186737",
"0.55186737",
"0.55186737",
"0.55186737",
"0.55186737",
"0.55186737",
"0.55186737",
"0.55186737",
... | 0.64077574 | 1 |
Web browser has sent us a command to forward to the Arduino client. Try to process it immediately or remember it for when the client next connects. | function setNextCmd(req_url, res) {
var id = req_url.query.id;
res.writeHead(200, {'Content-Type': 'text/plain'});
if (knownClients[id]) {
var overrode = !!nextCmds[id];
nextCmds[id] = req_url.query.cmd;
processCmds(id);
res.end('Command ' + (overrode ? 'overridden' : 'accepted') + '.\n');
} els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forward() {\n sendRemoteControlRequest(\n 'forward',\n SAP_MUSIC_REMOTE_CONTROL_REQ_STATUS_BOTH\n );\n }",
"function onDocumentReady() {\r\n\r\n\r\n var socket = new ReconnectingWebsocket(\"ws://\" + location.host + \"/serial\");\r\n var s... | [
"0.61149365",
"0.5688611",
"0.5680747",
"0.5677236",
"0.56765187",
"0.55514574",
"0.5534479",
"0.5507295",
"0.5499282",
"0.5494735",
"0.54583156",
"0.53502",
"0.53485996",
"0.52719724",
"0.5239871",
"0.52397764",
"0.52383083",
"0.5218022",
"0.52050835",
"0.5199754",
"0.519975... | 0.583415 | 1 |
========================================================== process phone number | processPhone() {
let input = this.phone
resetError(input)
if (isEmpty(input)) {
this.valid = false
} else if (isNumber(input)) {
this.valid = false
} else if (exact(input, 11)) {
this.valid = false
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_phoneNumber(number) {\n let phone = document.querySelector('input[type=\"tel\"]');\n var val = phone.value;\n\n if (number || number === 0) {\n if (!val) {\n val = '+1 (';\n }\n\n if (val.match(/\\((\\d*)/)[1].length === 2) {\n va... | [
"0.7163799",
"0.69978213",
"0.6986184",
"0.69790554",
"0.692772",
"0.6838043",
"0.6835017",
"0.6776261",
"0.6753999",
"0.67418534",
"0.6735872",
"0.6721941",
"0.66978073",
"0.6669892",
"0.6660306",
"0.6656706",
"0.66520953",
"0.6651287",
"0.6642207",
"0.66297835",
"0.66135395... | 0.7418924 | 0 |
========================================================== process birth date | processBirthDay() {
let input = this.birthDate.day
resetError(input)
if (isEmpty(input)) {
this.valid = false
} else if (smallerThan(input, 1)) {
this.valid = false
} else if (biggerThan(input, 31)) {
this.valid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateDateOfBirth() {\n if (helperService.isValidDateOfBirth(vm.uidata.dob) == false) {\n vm.isValidDateInd = false;\n }\n else {\n vm.isValidDateInd = true;\n }\n }",
"function getAge(dt,format) {\n var date=checkDate(d... | [
"0.7301532",
"0.7207868",
"0.7156438",
"0.70421225",
"0.70107776",
"0.6995685",
"0.69362855",
"0.6923621",
"0.68945223",
"0.68756795",
"0.6867244",
"0.68487865",
"0.6845822",
"0.6842625",
"0.68207264",
"0.6814932",
"0.68135583",
"0.6813275",
"0.68097305",
"0.67784435",
"0.676... | 0.747429 | 0 |
================================================================================== final submit and sending the values ================================================================================== | submit() {
this.processAll()
if (this.valid) {
ipcRenderer.send('teacherCreation', {
fullName: this.name.value,
socialID: this.sid.value,
sex: this.sex.value,
degree: this.degree.value,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleSubmit(e) {\n e.preventDefault()\n if (validateForm()) {\n \n setLoading(true)\n\n createAPIEndpoint(ENDPIONTS.POSTEMPLOYEES13).createPrison( customers.EmployeeFormID, \"0\" ,values)\n .then(res => {\n setLoading(false)\n notify()\n resetFormControls(... | [
"0.6814072",
"0.6734298",
"0.6728597",
"0.6663561",
"0.6657388",
"0.66349244",
"0.65719634",
"0.65535116",
"0.6465824",
"0.64398235",
"0.63975066",
"0.6392299",
"0.6373334",
"0.6366847",
"0.6362608",
"0.6359462",
"0.63196003",
"0.6307245",
"0.63049114",
"0.62895757",
"0.62803... | 0.68932015 | 0 |
Metodos que se ejecutaran para poder generar los calculos | calcularInformacionMeses(){
/** Se calcula el valor de precio contado */
var precioContado = (parseFloat(this.props.objInformacionTotal.total) / (parseInt(1) + ((parseFloat(this.props.objConfiguracion.tasafinanciamiento) * parseFloat(this.props.objConfiguracion.plazomaximo)) / parseInt(100)))).toFixed(2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gerarFuncao() {\n atualizarCampos();\n esvaziarTabelas();\n desativarCamposIniciais();\n inicializarTabelaCoeficientes();\n \n}",
"function bundleTestMetricCal() {\n hours = '{{test_metric_config.hours_per_week}}';\n hourly_rate = '{{test_metric_config.costs_per_hour_staff}}';\n ... | [
"0.59666246",
"0.5773308",
"0.57232517",
"0.57056147",
"0.56389534",
"0.5637364",
"0.5612905",
"0.55381054",
"0.5536807",
"0.5521656",
"0.5486231",
"0.5457442",
"0.542565",
"0.54247224",
"0.54065406",
"0.5387296",
"0.53849393",
"0.53688943",
"0.53653365",
"0.5335047",
"0.5324... | 0.5933097 | 1 |
Metodo que se ejecutara al dar click en los radio button | onClickRadioButton(){
/** Se obtiene el valor que se selecciono */
var radio = document.getElementsByName('example');
/** Se recorre el arreglo de radio buttons */
for(var i=0; i<radio.length; i++){
if(radio[i].checked){
this.props.onClickRadioButton(radio[i].... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRadioClicked(event) {\n var args = this.id.split(\"--\");\n if (viewer[args[0]] && viewer[args[0]].radioClicked) {\n viewer[args[0]].radioClicked(event.target);\n }\n }",
"function handlerClickRadio (e) {\n svl.tracker.push(\"ModalSkip_ClickRadio\");\n enableClic... | [
"0.694913",
"0.68592954",
"0.68309325",
"0.68203515",
"0.6818603",
"0.66953474",
"0.669073",
"0.66780704",
"0.6588764",
"0.65276045",
"0.6511052",
"0.6425608",
"0.64155716",
"0.63661",
"0.6339773",
"0.6338497",
"0.628204",
"0.6263965",
"0.62545353",
"0.6215224",
"0.6215081",
... | 0.7244589 | 0 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Write a function called "split" that does the same thing as String.split It should take two inputs: (1) a string and (2) a delimiter string Do not use the native .split() method for this. Your task is to reverseengineer .split() and write you... | function split (str, delimiter) {
let resultArray = []
let delimiterIdx = str.indexOf(delimiter)
while (delimiterIdx !== -1) {
const chunk = str.substring(0, delimiterIdx)
resultArray.push(chunk)
str = str.substring(chunk.length)
str = str.substring(delimiter.length)
delimiterIdx = str.indexO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function useSplitMethod() {\n var string = \"How are you today?\";\n var result = string.split(\" \"); \n return result;\n //returns [\"How\", \"are\", \"you\", \"today?\"]\n }",
"function split(string, delimiter){\n // Words by splitting a string with a predetermined delimiter\n var res = [];... | [
"0.77742475",
"0.7620466",
"0.7492765",
"0.74552375",
"0.74536955",
"0.7394728",
"0.73864317",
"0.7373961",
"0.7355777",
"0.7346249",
"0.7339897",
"0.7323558",
"0.73048395",
"0.72807443",
"0.72463137",
"0.7239635",
"0.7225956",
"0.719628",
"0.7172321",
"0.71625227",
"0.714269... | 0.7930231 | 0 |
setTimeout(printToken,5000); // Use a promise or similiar instead | function printToken(){
//console.log("After time out :"+token);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printBot(message) {\n sleep(1000);\n printMessage(message, \"botMessage\");\n //window.setTimeout(printMessage, BOT_DELAY, message, \"botMessage\");\n}",
"function delayedPrint () {\n\n var intervalID = window.setInterval(printQuote, 15000);\n\n}",
"function printTimeout(str, n) { \n setTimeout... | [
"0.6641695",
"0.6619069",
"0.6612843",
"0.6513866",
"0.62952197",
"0.62760216",
"0.62687355",
"0.6236223",
"0.62191755",
"0.6154002",
"0.6126531",
"0.5840653",
"0.5831309",
"0.5799879",
"0.5776872",
"0.5775754",
"0.57474065",
"0.574668",
"0.57362264",
"0.5734769",
"0.57165694... | 0.78794724 | 0 |
Prompt the user to input N scores and show him the lowest, the highest and the average number. Also show him all the numbers higher than the average one. | function score()
{
var nScores = prompt('Enter the # of scores:', 3);
var arrScores = new Array();
var message;
for (var i = 0; i < nScores; i++)
{
arrScores[i] = parseInt(prompt('Enter score number ' + (i + 1)));
}
message = 'Lucas Vieira\'s Output\n';
message += 'Lowest = ' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playStatistics3(num) \n{ \n var arr = [];\n\n for(var i = 0; i < num; i++)\n {\n arr.push(rollOne());\n }\n\n var max = 0;\n var min = arr[arr.length-1];\n var sum = 0;\n\n for(var j = 0; j < arr.length; j++)\n {\n if(max < arr[j])\n {\n max = a... | [
"0.7052776",
"0.7008893",
"0.6677049",
"0.6633294",
"0.6518455",
"0.6340504",
"0.6316074",
"0.6312862",
"0.6273376",
"0.6235329",
"0.6191298",
"0.61564595",
"0.6142254",
"0.6111402",
"0.6101579",
"0.60966206",
"0.6079794",
"0.6069124",
"0.6066686",
"0.599816",
"0.59922993",
... | 0.7219728 | 0 |
Get the lowest score on the array. | function getLowestScore(arrScores)
{
var lowestScore = arrScores[0];
for (var i = 1; i < arrScores.length; i++)
{
if (arrScores[i] < lowestScore)
lowestScore = arrScores[i];
}
return lowestScore;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLowest(array) {\n return Math.min.apply(null, array);\n}",
"function getLowest(array){\n\tvar currentLowest = array[0];\n\n\tfor(var i = 1; i <= array.length; i++){\n\t\tif((array[i] - currentLowest) < 0) currentLowest=array[i];\n\t}\n\n\treturn currentLowest;\n}",
"function minScore(){\n var... | [
"0.77682805",
"0.75773793",
"0.73366916",
"0.72831786",
"0.72192395",
"0.72192395",
"0.7211391",
"0.7201217",
"0.715961",
"0.7121866",
"0.7106659",
"0.7106659",
"0.70428085",
"0.7040867",
"0.70321625",
"0.70183015",
"0.69971484",
"0.6976074",
"0.6970882",
"0.69598866",
"0.695... | 0.8088554 | 0 |
Get the highest score on the array. | function getHighestScore(arrScores)
{
var highestScore = arrScores[0];
for (var i = 1; i < arrScores.length; i++)
{
if (arrScores[i] > highestScore)
highestScore = arrScores[i];
}
return highestScore;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHighest(array) {\r\nlet highestNumber = 0;\r\n for(let i = 0 ; i < array.length ; i++) { //loop through the array, check if each number is higher, reassign highestNumber if it is.\r\n if(array[i] >= highestNumber) {\r\n highestNumber = array[i];\r\n }\r\n }\r\n // As... | [
"0.8004155",
"0.76924145",
"0.7528425",
"0.7431784",
"0.73544765",
"0.72204065",
"0.70861346",
"0.7035172",
"0.7035172",
"0.69663775",
"0.69663775",
"0.69580257",
"0.6904622",
"0.6899646",
"0.68552727",
"0.68407506",
"0.68367124",
"0.6813925",
"0.68064505",
"0.67945915",
"0.6... | 0.7846276 | 1 |
Get the average score on the array. | function getAverageScore(arrScores)
{
var sum = 0;
for (var i = 0; i < arrScores.length; i++)
{
sum += arrScores[i];
}
return sum / arrScores.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMean( scoreArray ) {\n if (!Array.isArray(scoreArray)) {\n\treturn 0;\n }\n var numValues = scoreArray.length;\n if (numValues == 0) {\n\treturn 0;\n }\n var sum = 0;\n for (var index = 0; index < numValues; ++index) {\n\tsum += scoreArray[index].finalscore;\n }\n return sum ... | [
"0.8296582",
"0.8213111",
"0.808292",
"0.7798641",
"0.77927184",
"0.7792018",
"0.7785865",
"0.7785359",
"0.7782999",
"0.7741026",
"0.77181816",
"0.7700557",
"0.76695037",
"0.7660429",
"0.7627548",
"0.7582468",
"0.7581183",
"0.7577608",
"0.7577608",
"0.75754595",
"0.75754195",... | 0.82321334 | 1 |
Prompt the user for some variables necessary to calculate how much an employee should be paid based on his hours worked and rate of pay. | function employee()
{
var name = prompt('Insert your name');
var ssn = prompt('Insert your SSN');
var rateOfPay = parseFloat(prompt('Insert your rate of pay'));
var hoursWorked = parseFloat(prompt('Insert hours worked'));
var message = name + ' - ' + ssn + '\n';
message += 'Rate of pay: $' + ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function promptBillInfo() {\n\n var total = prompt('Please input the total bill: $');\n var percentage = prompt('Please input the tip level: ');\n percentage = percentage / 100;\n alert('Your tip amount is: $' + calculateTip(percentage, total).toFixed(2));\n\n }",
"function main(){... | [
"0.637636",
"0.6338081",
"0.6241066",
"0.62016857",
"0.6157546",
"0.6135257",
"0.611553",
"0.61101747",
"0.6109526",
"0.6093111",
"0.6083192",
"0.60815847",
"0.60780317",
"0.60767305",
"0.6054333",
"0.6025432",
"0.59988314",
"0.59719646",
"0.5968193",
"0.5963432",
"0.59527117... | 0.7562361 | 0 |
Do the math necessary to get the total pay based on hoursWorked and rateOfPay variables. | function getTotalPay(hoursWorked, rateOfPay)
{
if (hoursWorked > 40) {
return 40 * rateOfPay + (hoursWorked - 40) * rateOfPay * 1.5;
}
return hoursWorked * rateOfPay;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function payRollCalculator() {\n let overtimeHoursWorked, grossPayPerYear, medicareTax, grossPayPerWeek;\n let personHrsOfWorked = parseFloat(inputHrsWorkedField.value);\n let perPayRate = parseFloat(inputPayRateField.value);\n let myWithHoldingCode = parseFloat(inputNoOfWithholdField.value);\n\n //... | [
"0.6793898",
"0.65367573",
"0.6492237",
"0.6389803",
"0.63496196",
"0.6315343",
"0.6265722",
"0.6102151",
"0.6090213",
"0.6088967",
"0.6043186",
"0.6016444",
"0.6012365",
"0.6011111",
"0.599163",
"0.5990675",
"0.5990675",
"0.5975678",
"0.59604716",
"0.5936982",
"0.5926435",
... | 0.80157197 | 0 |
Converts 16 bit signed PCM formatted wav file from stereo to mono | async function convertAudio(buffer) {
try {
const stereo = new Int16Array(buffer);
const mono = new Int16Array(stereo.length/2);
let j = 0;
for (let i = 0; i < stereo.length; i += 4) {
mono[j++] = stereo[i];
mono[j++] = stereo[i+1];
}
return Buffer.from(mono);
} catch (e) {
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buffer2wav (buffer) {\n\n\t/* define a few helper functios */\n\n\t// dump binary data\n\tfunction xxd (buffer) {\n\t\tfor (var i=0; i<buffer.length; i+=8) {\n\t\t\tvar line = '';\n\t\t\tfor (var j=i; j<Math.min(i+8, buffer.length); j+=1) {\n\t\t\t\tvar n = buffer[j];\n\t\t\t\t// to big-endian (?)\n\t\t\t... | [
"0.66507727",
"0.6431268",
"0.63305134",
"0.6071513",
"0.6022697",
"0.60074854",
"0.59779793",
"0.59021455",
"0.584786",
"0.5814517",
"0.5613706",
"0.5577273",
"0.547805",
"0.5474119",
"0.54281867",
"0.5414911",
"0.54111564",
"0.5410372",
"0.5406317",
"0.5394809",
"0.5384764"... | 0.7136405 | 0 |
Prepare a map style object for diffing If immutable convert to plain object Work around some issues in the styles that would fail Mapbox's diffing | function normalizeStyle(style) {
if (!style) {
return null;
}
if (typeof style === 'string') {
return style;
}
if (style.toJS) {
style = style.toJS();
}
var layerIndex = style.layers.reduce(function (accum, current) {
return Object.assign(accum, _defineProperty({}, current.id, current))... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateLayerStyles() {\n layerStyles = document.sharedLayerStyles;\n let arrayLayerStyleIDs = layerStyles.map(\n (sharedstyle) => sharedstyle[\"id\"]\n );\n let arrayLayerStyleNames = layerStyles.map(\n (sharedstyle) => sharedstyle[\"name\"]\n );\n let arrayLayerStyleStyles ... | [
"0.657657",
"0.6562873",
"0.634303",
"0.61607933",
"0.6156939",
"0.61304224",
"0.61149216",
"0.6075522",
"0.60456586",
"0.59946287",
"0.5989456",
"0.5989456",
"0.5989456",
"0.5973278",
"0.5973278",
"0.59729517",
"0.594128",
"0.5904466",
"0.5896779",
"0.58672094",
"0.5866189",... | 0.70440006 | 0 |
Returns true if props are within the constraints | function checkVisibilityConstraints(props) {
var constraints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MAPBOX_LIMITS;
for (var constraintName in constraints) {
// in the format of min* or max*
var type = constraintName.slice(0, 3);
var propName = decapitalize(constraintName.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkDisplayConstraints(props) {\n const capitalize = s => s[0].toUpperCase() + s.slice(1);\n\n const {displayConstraints} = props;\n for (const propName in props) {\n const capitalizedPropName = capitalize(propName);\n const minPropName = `min${capitalizedPropName}`;\n const maxPropName = ... | [
"0.6636673",
"0.64638567",
"0.62665707",
"0.62665707",
"0.62665707",
"0.62665707",
"0.62665707",
"0.62665707",
"0.62665707",
"0.62665707",
"0.61490333",
"0.6125815",
"0.6125815",
"0.6125815",
"0.6125815",
"0.6087067",
"0.6084291",
"0.6039064",
"0.60368073",
"0.60349894",
"0.5... | 0.71436137 | 0 |
crops the old easing function from x0 to 1 where x0 is the interruption point returns a new easing function with domain [0, 1] and range [0, 1] | function cropEasingFunction(easing, x0) {
var y0 = easing(x0);
return function (t) {
return 1 / (1 - y0) * (easing(t * (1 - x0) + x0) - y0);
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function easing (x){\n return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;\n}",
"static LerpUnclamped() {}",
"function backEaseInOut (p) {\n var f;\n if(p < 0.5) {\n f = 2 * p;\n return 0.5 * (f * f * f - f * Math.sin(f * Math.PI));\n } else {\n f = (1 - (2*p - 1));... | [
"0.69234616",
"0.57911366",
"0.55361557",
"0.55300474",
"0.5520803",
"0.5473801",
"0.5471584",
"0.54635155",
"0.54208857",
"0.54006463",
"0.5392536",
"0.53899556",
"0.5387346",
"0.5385998",
"0.53772396",
"0.5365856",
"0.5318182",
"0.5318182",
"0.5318182",
"0.5318182",
"0.5315... | 0.7448572 | 0 |
This function will be called when the browser attempts to access the passive property. | get passive() {
passiveSupported = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get passive() {\n /* istanbul ignore next: will never be called in JSDOM */\n passiveEventSupported = true;\n }",
"get passive() {\n /* istanbul ignore next: will never be called in JSDOM */\n passiveEventSupported = true;\n }",
"get passive() {\n /* i... | [
"0.7948349",
"0.7948349",
"0.7948349",
"0.7948349",
"0.762273",
"0.73592913",
"0.7315359",
"0.7315359",
"0.7315359",
"0.7315359",
"0.7315359",
"0.727125",
"0.72405183",
"0.7180626",
"0.7013944",
"0.6826948",
"0.66162354",
"0.65080076",
"0.65080076",
"0.6490089",
"0.6469129",
... | 0.82359594 | 0 |
Checks props object for any prop that is deprecated and insert a console warning to the user. This will also print out the recommended new prop/API if one exists. | function checkDeprecatedProps() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
/* eslint-disable no-console, no-undef */
DEPRECATED_PROPS.forEach(function (depProp) {
if (props.hasOwnProperty(depProp.old)) {
var warnMessage = getDeprecatedText(depProp.old);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkDeprecatedProps() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n /* eslint-disable no-console, no-undef */\n DEPRECATED_PROPS.forEach(function (depProp) {\n if (props.hasOwnProperty(depProp.old)) {\n var warnMessage = getDeprecatedText(depProp.o... | [
"0.853207",
"0.71240187",
"0.7111975",
"0.7099483",
"0.7099483",
"0.70416385",
"0.6416209",
"0.6332534",
"0.6332534",
"0.6242733",
"0.6221001",
"0.6218501",
"0.62121654",
"0.6146892",
"0.6146892",
"0.6146892",
"0.6146892",
"0.6146892",
"0.6146892",
"0.6146892",
"0.610201",
... | 0.85448295 | 0 |
grabs a specific comic | function fetchSpecificComic(comicId){
fetch(`http://localhost:3000/comic_books/${comicId}`)
.then(response => response.json())
.then(comic => displayComicDetailPage(comic))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getComicWithId(id) {\n return new Promise(function(resolve, reject) {\n try {\n const requestUrl = (id == 'latest') ? siteUrl : `${siteUrl}comic/${id}`;\n\n axios.get(requestUrl)\n .then(function(response) {\n if (resp... | [
"0.61312795",
"0.6125424",
"0.59689194",
"0.582025",
"0.5542918",
"0.5429105",
"0.5379176",
"0.5339135",
"0.5338022",
"0.53280056",
"0.53112245",
"0.52269965",
"0.5211714",
"0.51968634",
"0.5177443",
"0.515689",
"0.5139797",
"0.5095613",
"0.50344974",
"0.5029721",
"0.5016413"... | 0.663931 | 0 |
Catch the bubbledup event from the Ionic's back button | catchIonicGoBack(event) {
// We only care for the event coming from Ionic's back button
const backButton = event.target && event.target.closest('ion-back-button')
if (!backButton) return
let defaultHref
// Explicitly override router direction
// This will always trigger a back tran... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onBack_() {\n this.userActed('back');\n }",
"function goBackHandler() {\n navigate(prevState);\n }",
"function backKeyDown() {\n debug && console.log( \"init.backKeyDown: Back button tapped\" );\n UIFrame.navigateToPreviousPage();\n }",
"function onBackPressed() {\n if (typeof... | [
"0.71410775",
"0.70598835",
"0.6987303",
"0.6927306",
"0.6762383",
"0.6759839",
"0.6756088",
"0.6748566",
"0.66804266",
"0.6666515",
"0.6648263",
"0.6636833",
"0.66203344",
"0.6559953",
"0.65428334",
"0.6538116",
"0.6528185",
"0.6516977",
"0.6493697",
"0.6493697",
"0.6493697"... | 0.71879494 | 0 |
Fetch a new question when the component mounts | componentDidMount() {
this.fetchNewQuestion();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n this.getNewQuestion();\n }",
"componentDidMount() {\n this.getNewQuestion();\n }",
"componentDidMount() {\n this.getNewQuestion();\n }",
"getNewQuestion() {\n return this.client.getQuestion().then((result) => {\n this.setState({\n data: result.data... | [
"0.7225179",
"0.72125447",
"0.72125447",
"0.702009",
"0.69932663",
"0.69932663",
"0.69718915",
"0.69426227",
"0.6882349",
"0.6782502",
"0.6779571",
"0.667368",
"0.66711134",
"0.66367155",
"0.66363895",
"0.66271263",
"0.660948",
"0.65795255",
"0.65623957",
"0.65452373",
"0.653... | 0.76091856 | 0 |
LockCommand basically, a zero initialized 18 byte Buffer | function LockCommand() {
var cmd = new Buffer(0x12);
cmd.fill(0x00);
return cmd;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"lock()\n {\n this._buffer.lock();\n }",
"lock() { this.locked = true; }",
"changeLock() {\n this.locked = false;\n }",
"lock() {\n this._locked = true;\n }",
"lock() {\n this._locked = true;\n }",
"_lock() {\n this._locked = true;\n }",
"function lock()\n{... | [
"0.6766982",
"0.66331595",
"0.6393319",
"0.6298063",
"0.6298063",
"0.6228266",
"0.6060793",
"0.60236555",
"0.6017501",
"0.5997522",
"0.5980752",
"0.5965992",
"0.5931445",
"0.5900484",
"0.5896491",
"0.5894938",
"0.5823221",
"0.58213454",
"0.58208776",
"0.5817874",
"0.5813713",... | 0.8385205 | 0 |
Calculates the security checksum of a command buffer. | function securityChecksum(buffer) {
return (0 - (buffer.readUInt32LE(0x00) + buffer.readUInt32LE(0x04) + buffer.readUInt32LE(0x08))) >>> 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calcChecksum() {\n // Dropping the last byte, holding the checksum.\n let seqHex = this.seq.toString('hex').slice(0, NUM_BYTES);\n let buf = Buffer.from(seqHex);\n\n // Hashing the buffer, returning the first byte of the hash\n // as the checksum.\n let h = crypto.createHash(HASH_ALG).update(buf)... | [
"0.70721084",
"0.6393561",
"0.6009653",
"0.59505963",
"0.5858415",
"0.5736761",
"0.5650565",
"0.5623181",
"0.55787694",
"0.54492134",
"0.5409484",
"0.54092014",
"0.5391624",
"0.537909",
"0.53683245",
"0.5361981",
"0.51363134",
"0.509885",
"0.509236",
"0.5082823",
"0.5079876",... | 0.76544505 | 0 |
check menu element function when not login | function checkRecruiterHomeMenuNotLogin(menuUL, menuElements) {
browser.expect.element(menuUL).to.be.present;
browser.click(buttonDropdown, function (response) {
browser.waitForElementVisible(menuUL, 2000);
});
for (i in menuElements) {
var curentEl = menuElements[i];
bro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showLoggedInMenu(access_level){\r\n // hide login and sign up from navbar & show logout button\r\n $(\"#login, #sign_up\").hide();\r\n $(\"#logout\").show();\r\n\r\n //if(access_level==\"Admin\") { \r\n $(\"#read_users\").show(); \r\n //}\r\n}",
"function checkMenu(){\n\tif (menuOp... | [
"0.6678108",
"0.653697",
"0.6520667",
"0.64899105",
"0.6471802",
"0.64481926",
"0.6327891",
"0.63235986",
"0.6293617",
"0.6292677",
"0.62245834",
"0.6198831",
"0.6174487",
"0.61541766",
"0.6135105",
"0.61259747",
"0.61233276",
"0.611347",
"0.61066425",
"0.610302",
"0.61014116... | 0.7012836 | 0 |
==================================================================================================================== / ALL SECTIONS > Forms and Input/textarea behavior. / ==================================================================================================================== / Print at labels placeholder's ... | function placeholderToLabel() {
$('input, textarea').not('.field-newsletter').each(function(){
var labelText = $(this).attr('placeholder');
$(this).prev('label').text(labelText);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_renderLabels() {\n\t const fragment = document.createRange().createContextualFragment( '<div class=\"label-content widget\"></div>' );\n\t const wrapper = fragment.querySelector( '.label-content' );\n\n\t this.question.querySelectorAll( '.question-label, .or-hint, .or-required-msg, .or-constr... | [
"0.6634569",
"0.65095437",
"0.64393395",
"0.62200177",
"0.6211094",
"0.61743146",
"0.60992146",
"0.60423136",
"0.59958166",
"0.5925905",
"0.59057504",
"0.58801043",
"0.58665514",
"0.581583",
"0.58111405",
"0.58104366",
"0.57953495",
"0.57909316",
"0.5784697",
"0.5773141",
"0.... | 0.6796673 | 0 |
================== Private functions ================== Updates size paramterers to match the current size of the canvas | function updateSize() {
radius = radiusArg * canvas.width / 2;
centerX = centerXArg * canvas.width;
centerY = centerYArg * canvas.height;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateCanvasSize() {\n this.canvas.width = this.config.container.clientWidth;\n this.canvas.height = this.config.container.clientHeight;\n }",
"function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\... | [
"0.8174679",
"0.8111729",
"0.80591565",
"0.7979893",
"0.7966808",
"0.7966104",
"0.7852055",
"0.7843059",
"0.7689674",
"0.7606566",
"0.75971305",
"0.7532215",
"0.7476499",
"0.73951715",
"0.7374801",
"0.73557323",
"0.7354081",
"0.73157614",
"0.7300524",
"0.7278938",
"0.7243386"... | 0.8160493 | 1 |
functions to count the clicks/moves | function moves(){
counter++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clicks() {\n count = 0;\n img.addEventListener(\"click\", function() {\n count++;\n counter.innerText = count;\n })\n}",
"function countMoves(){\n\tmoves++;\n\t$('#moves').text(moves);\n}",
"function countUpAndDown () {}",
"function movesCounterFunc() {\n movesCounter++;\n mov... | [
"0.681097",
"0.67953825",
"0.6772432",
"0.6764798",
"0.6763496",
"0.6760845",
"0.67489725",
"0.6743636",
"0.6711511",
"0.6702252",
"0.6685694",
"0.6684583",
"0.66675234",
"0.66496164",
"0.65569615",
"0.6540427",
"0.6539204",
"0.6510774",
"0.6509275",
"0.65001196",
"0.64662033... | 0.70485777 | 0 |
kill the delay timer | function _kill_delay_timer() {
clearTimeout(t.timers.delay); delete t.timers.delay;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function kill(){}",
"function killBannerTimer(opt,container) {\n\t\t\t\t\t\topt.cd=0;\n\n\t\t\t\t\t\t\tvar bt=\tcontainer.find('.tp-bannertimer');\n\t\t\t\t\t\t\t\tif (bt.length>0) {\n\t\t\t\t\t\t\t\t\tbt.stop(true,true);\n\t\t\t\t\t\t\t\t\tbt.css({'width':'0%'});\n\t\t\t\t\t\t\t\t\t//bt.animate({'width':\"100%\... | [
"0.7614255",
"0.7214873",
"0.719618",
"0.7176515",
"0.71747303",
"0.71661264",
"0.71392757",
"0.7123612",
"0.7123612",
"0.707622",
"0.70747954",
"0.6992713",
"0.69874144",
"0.698103",
"0.6958273",
"0.69232154",
"0.6897923",
"0.68929124",
"0.6828747",
"0.68217725",
"0.6806379"... | 0.8474639 | 0 |
frames object (This is the animation engine.) | function _frames(animation) {
let t = this;
t.animation = animation;
let animator = animation.animator;
t.timestamp=0;
t.startTime=0;
t.time=0;
t.reverseTime = null;
t.opposite=0;
t.reverse = false;
t.paused = false;
t.stopped = true;
t.lastDir = 'forwards';
t.loop = new _loop(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"playAnimatedState(frames) {//play certain animation state \n this.stop(); //stop the current animation\n \n\n if (frames.length) //check is an animation state consists of multiple frames (either array or string)\n { \n if(typeof frames==='string')//check if string\n \tframes=this._animationS... | [
"0.70016855",
"0.6928258",
"0.68118614",
"0.6791838",
"0.6786793",
"0.6762157",
"0.6600013",
"0.658561",
"0.65818244",
"0.65644467",
"0.65474653",
"0.65299004",
"0.65122724",
"0.65077144",
"0.6492913",
"0.6472761",
"0.64701515",
"0.64605427",
"0.64375955",
"0.6432744",
"0.641... | 0.7478736 | 0 |
return true if the play direction is reversed | function _is_reverse() {
return t.opposite?!t.reverse:t.reverse;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isDirectionBackward(dir) {\r\n return (typeof dir == \"string\") ? (dir == \"backward\") : !!dir;\r\n }",
"function isDirectionBackward(dir) {\n\t return (typeof dir == \"string\") ? /^backward(s)?$/i.test(dir) : !!dir;\n\t }",
"function _get_reverse_status() {\r\n\t\t\tlet... | [
"0.7029692",
"0.7010632",
"0.70105106",
"0.7006384",
"0.7006384",
"0.6949358",
"0.69260275",
"0.68839645",
"0.64004517",
"0.6158346",
"0.6156602",
"0.6156602",
"0.6156602",
"0.61468214",
"0.61468214",
"0.61468214",
"0.61468214",
"0.6095559",
"0.60650694",
"0.6040026",
"0.6025... | 0.7432659 | 0 |
get or initialize animator data on the object (objects are react components, or dom elements) | function _get_object_data(obj, isFirst) {
let data = obj.PU_data; if (!data) {
data = obj.PU_data = {
isElm:(obj instanceof Element),
vals:{},
tweens:{}
};
}
if (isFirst) {
let vals = data.vals[animation.id] = (obj.state||{})[animation.id]||animation.params.vals;
//loop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get animatorStateInfo() {}",
"function TextAnimatorDataProperty(elem,animatorProps,container){var defaultData={propType:false};var getProp=PropertyFactory.getProp;var textAnimatorAnimatables=animatorProps.a;this.a={r:textAnimatorAnimatables.r?getProp(elem,textAnimatorAnimatables.r,0,degToRads,container):defaultD... | [
"0.66725856",
"0.627673",
"0.61228275",
"0.61228275",
"0.60109043",
"0.6007729",
"0.58217984",
"0.5818588",
"0.5663597",
"0.5661365",
"0.5635542",
"0.56331134",
"0.5582292",
"0.55613536",
"0.55356675",
"0.5524832",
"0.5522966",
"0.54558575",
"0.54265565",
"0.5424037",
"0.5422... | 0.64604026 | 1 |
returns key data (start and end vals, time, duration, etc...) | function _get_key_data(frameData, valData) {
let keys = valData.keys||valData;
let rData = {};
let rVals = rData.vals = {};
let pos = frameData.pos;
let startPos=0, endPos=0;
//let isLast = frameData.status.isLast;
let keyNames = Object.keys(keys); for (let i=0;i<keyNames.length;i++) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function datakey(data, time){\n\tthis.data = data;\n\tthis.time = time;\n}",
"function calculateEqKey(){\n\tvar key = \"lat\" + Math.round(detail.geometry.coordinates[1]) + \"long\" + Math.round(detail.geometry.coordinates[0]) + \"time\" + detail.properties.time;\n\treturn key;\n}",
"makeMarker(keyValueMap,tim... | [
"0.6345914",
"0.5870917",
"0.5648408",
"0.5641749",
"0.5541919",
"0.5482269",
"0.5482269",
"0.5482269",
"0.54548085",
"0.54548085",
"0.5453417",
"0.5449814",
"0.5449814",
"0.5449814",
"0.54296905",
"0.5428291",
"0.5377778",
"0.53555626",
"0.5346609",
"0.53430194",
"0.5339428"... | 0.6575385 | 0 |
get the key pos from the id (e.g. 'start', 'end', 'pos_12.5', 'pos_50', etc...) | function _get_key_pos_from_id(id) {
return id==='from'?0:id==='to'?100:parseFloat(id.substring(id.indexOf('_')+1));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getKeyFromID(id){return'.'+id;}",
"function getKeyFromID(id){return'.'+id;}",
"function getKeyFromID(id){return'.'+id;}",
"function getKeyFromID(id){return'.'+id;}",
"function getKeyFromID(id){return'.'+id;}",
"function getKeyFromID(id){return'.'+id;}",
"function getKeyFromID(id){return'.'+id;... | [
"0.6673137",
"0.6673137",
"0.6673137",
"0.6673137",
"0.6673137",
"0.6673137",
"0.6673137",
"0.6490733",
"0.64143956",
"0.6290651",
"0.6202322",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
"0.6085603",
... | 0.85455734 | 0 |
event store object (note: the event store gets attached to the target object as an eventStore property 'PU_eventStore'. the event store is called upon to fire events for the src object it is attached to.) | function _event_store (animator, src) {
let t = this;
var events={};
//add event
t.addEvent = function(name, fn, requestingObj) {
//get or init the event functions object (init the event name array with an empty object - this is so that if the first event is added with a requesting object... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Store () {\n\t EventEmitter.call(this)\n\t}",
"get record() {\n return this.event.source;\n }",
"addEvent(event) {\n // call write repo to save to event store\n writeRepo.enqueueEvent(event, function(offset) {\n handler.sendEvent(event, offset);\n });\n }",
"function St... | [
"0.5685265",
"0.5509527",
"0.54592794",
"0.5448774",
"0.544548",
"0.544548",
"0.544548",
"0.544548",
"0.544548",
"0.5429859",
"0.53881806",
"0.5370101",
"0.534726",
"0.52821",
"0.52716476",
"0.5167112",
"0.5164883",
"0.5162621",
"0.5160192",
"0.5157654",
"0.51184493",
"0.51... | 0.6742821 | 0 |
reverse points direction form clockwise to counter clockwise or vice versa (part of normalization) NOTE: this is a Plutonium added feature | function _reverse_points_direction(ns) {
var reversed = [];
//loop the buffer
var px=ns[0],py=ns[1]; for (let i=2;i<ns.length;i=i+6) {
//add the cubic bezier points to the beginning of the return array
reversed.unshift(ns[i+2], ns[i+3], ns[i], ns[i+1], px, py);
//save previous x and y
px = ns[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reverseDirection() {\n\t\t\tnaturalDir = -naturalDir;\n\t\t}",
"function reversePoints(points) {\n\n\tfor (var i = 0; i < points.length / 2; i++) {\n\t\tvar tmp = points[i];\n\t\tpoints[i] = points[points.length - 1 - i];\n\t\tpoints[points.length - i - 1] = tmp;\n\t}\n}",
"function inverseDirection(p... | [
"0.70426613",
"0.6900563",
"0.67638063",
"0.65800184",
"0.6546873",
"0.64295894",
"0.6335591",
"0.6296978",
"0.6268698",
"0.6261323",
"0.62145835",
"0.61725146",
"0.6151228",
"0.608781",
"0.60490555",
"0.60466576",
"0.6017724",
"0.60078514",
"0.60055166",
"0.5962567",
"0.5948... | 0.7159699 | 0 |
format numbers to 6 decimal places note: this was added by Plutonium | function formatter(n) {return util.round(n,6);} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatNum(n) {\n return Number((Number(n)).toFixed(6));\n}",
"function formatNum(n) {\n return Number((Number(n)).toFixed(6));\n}",
"function format( num ){\n return ( Math.floor(num * 100000)/100000 ) // slice decimal digits after the 2nd one\n .toFixed(4) // format with two decimal pla... | [
"0.7567105",
"0.7567105",
"0.7016856",
"0.6844892",
"0.68242806",
"0.67966455",
"0.6794004",
"0.6783112",
"0.6777007",
"0.670808",
"0.66870034",
"0.66861874",
"0.6638149",
"0.65915823",
"0.658203",
"0.657256",
"0.65718323",
"0.656262",
"0.6550824",
"0.6543458",
"0.65373325",
... | 0.80995446 | 0 |
NOTE adds the subscriber function to the array based on the property it is watching | addSubscriber(propName, fn) {
_subscribers[propName].push(fn)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"subscribe1(type, fn) {\n //let subscribers = this.subscribers;\n // (6) We first want to check to see if we have a property with our type parameter\n // that's means if we do not have that property then we simply want to create it\n if (!this.subscribers[type]) {\n this.subsc... | [
"0.6864462",
"0.684178",
"0.6198642",
"0.6197129",
"0.6197129",
"0.61781704",
"0.61652046",
"0.61047286",
"0.6010984",
"0.5982463",
"0.59693086",
"0.59673506",
"0.59480363",
"0.59403396",
"0.5926613",
"0.5910237",
"0.5873173",
"0.5851364",
"0.5839107",
"0.5821432",
"0.5783692... | 0.73187524 | 1 |
This class defines a complete generic visitor for a parse tree produced by ECMAScriptParser. | function ECMAScriptParserVisitor() {
antlr4.tree.ParseTreeVisitor.call(this);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ECMAScriptVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}",
"function VtlVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}",
"visitor() {}",
"function ExprVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}",
"visit(node, c... | [
"0.71542215",
"0.6175714",
"0.6124864",
"0.61198664",
"0.610123",
"0.6047991",
"0.5975232",
"0.58944345",
"0.58094966",
"0.57834184",
"0.5755815",
"0.57506025",
"0.57116354",
"0.5698457",
"0.568952",
"0.56794596",
"0.5665194",
"0.56624216",
"0.5621387",
"0.5601399",
"0.556745... | 0.75289285 | 0 |
Command line interface object. | function CLI() {
this.hastings = new Hastings();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get cli() {\n return require('./cli');\n }",
"function Console(){\n\tthis.parameters = this.formatParameters(process.argv);\n}",
"constructor() {\n super();\n (0, _util.declareCLIKitClass)(this, 'ArgumentList');\n }",
"function initialize( ar ) {\n\n var o = initOptions( ar );\n\n o.s... | [
"0.7174292",
"0.64064497",
"0.62955844",
"0.6248511",
"0.6206312",
"0.6167772",
"0.6152496",
"0.61491036",
"0.61004364",
"0.60835147",
"0.60805255",
"0.6063061",
"0.6013526",
"0.6005913",
"0.5994303",
"0.5994303",
"0.5994303",
"0.5994303",
"0.5994303",
"0.5994303",
"0.5994303... | 0.7115617 | 1 |
Get the angle of the left/top coordinate from the center of the width.height box | function getAngle(left, top, width, height) {
var x = (width / 2) - left;
var y = (height / 2) - top;
// tan O = y / x
var angle = x ?
Math.atan(y / x) :
y < 0 ? -_90 : _90;
if (x < 0) {
// reflect along vertical axis
angle = -angle + (2 * (_90 + angle));
}
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findAngle(bBox) {\n const ANGLE_CALIBRATION_MULTIPLIER = 0.75;\n \n // Find horizontal center of the object\n let centerX = parseFloat(bBox.x) + (parseFloat(bBox.w) / 2);\n // console.log(\"findAngle(): centerX=\" + centerX);\n \n // Find offset of the center of the object relative to the midd... | [
"0.68516725",
"0.68192667",
"0.657188",
"0.6436384",
"0.64146703",
"0.6351649",
"0.6336029",
"0.63304484",
"0.6315521",
"0.63131344",
"0.6312846",
"0.63048726",
"0.63040954",
"0.6302066",
"0.62843865",
"0.62741596",
"0.6231658",
"0.62229496",
"0.6188448",
"0.6164144",
"0.6152... | 0.74616313 | 0 |
Calculate the hour from the hand angle | function getHours(handAngle, amPm) {
handAngle = snap(handAngle, _30);
var hour = parseInt((((handAngle - time_90) % time_360) / _30).toFixed());
if (hour < 0)
hour += 12;
if (hour >= 12)
hour -= 12;
if (!hour) {
if (amPm === AmPm.am)
hour = 12;
}
else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tohourdegrees() {\n\treturn (360 / 12) * (hour)\n}",
"function angle_between_hour_and_minute_hand(hour, minute) {\n return Math.abs(((hour*30.0 + minute*0.5) - minute*6.0) % 360)\n}",
"function clockHandAngles(time){\n let hours = 0;\n let hourHand = 0;\n let minuteHand = 0;\n let secon... | [
"0.7564795",
"0.7389346",
"0.7087082",
"0.69415504",
"0.6863997",
"0.6838928",
"0.6806289",
"0.6790841",
"0.6789699",
"0.67476946",
"0.67330563",
"0.6719756",
"0.66919404",
"0.6658706",
"0.6582625",
"0.6582625",
"0.65159976",
"0.65083754",
"0.64889634",
"0.64841944",
"0.64619... | 0.7813746 | 0 |
Calculate the minute from the hand angle | function getMinutes(handAngle) {
handAngle = snap(handAngle, _12);
var minute = parseInt((((handAngle - time_90) % time_360) / _12).toFixed());
while (minute < 0)
minute += 60;
while (minute >= 60)
minute -= 60;
return {
minute: minute,
handAngle: handAngle
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function angle_between_hour_and_minute_hand(hour, minute) {\n return Math.abs(((hour*30.0 + minute*0.5) - minute*6.0) % 360)\n}",
"toMinute() {\n\t\t\tconst rate = Dinero({ amount: hourlyRate }).divide(60);\n\t\t\treturn wrapDinero(rate);\n\t\t}",
"function clockHandAngles(seconds){\n var hour_hand = sec... | [
"0.73243064",
"0.67782164",
"0.6734073",
"0.6646625",
"0.6604288",
"0.65402824",
"0.651505",
"0.6484523",
"0.6425771",
"0.6401816",
"0.6393268",
"0.6392991",
"0.6382637",
"0.6382637",
"0.6382637",
"0.6382637",
"0.63556635",
"0.63450414",
"0.62368274",
"0.62033975",
"0.6171904... | 0.794405 | 0 |
Increase a numer with loop back over the max value | function increase(val, max) {
var v = parseInt(val) + 1;
return v > max ? 0 : v;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function inc () {\n\t// increment and output\n\tif ((cnt + 1) <= maxVal) {\n\t\tcnt++;\n\t} else if (cnt < minVal) {\n\t\tcnt = minVal;\n\t} else {\n\t\tcnt = maxVal;\n\t}\n\tif (cnt < minVal) {\n\t\tcnt = minVal;\n\t}\n\toutputMinMax();\n\toutlet(0, cnt);\n}",
"function increment(max, target) {\n if(max == 0){... | [
"0.7089972",
"0.6904016",
"0.66027516",
"0.6561946",
"0.644271",
"0.6403703",
"0.63788",
"0.63629466",
"0.6304158",
"0.62991905",
"0.6262558",
"0.61369294",
"0.61236006",
"0.61218333",
"0.61218333",
"0.6113622",
"0.60784346",
"0.60523254",
"0.60399914",
"0.60032845",
"0.60011... | 0.7675063 | 0 |
Decrease a numer with loop back over the min value | function decrease(val, max) {
var v = parseInt(val) - 1;
return v < 0 ? max : v;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decrementMin(target) {\n let currentMin = parseInt($(target).text());\n if (currentMin > 1) {\n $(target).html(currentMin-1);\n }\n }",
"decrement () {\n this.value = this._clampValue(this.value - this.step)\n }",
"function decrement() {\n incrementBy(-1);\n }",
"functio... | [
"0.7150905",
"0.70915014",
"0.67345065",
"0.65722954",
"0.6478994",
"0.6350133",
"0.6348454",
"0.6252806",
"0.6251989",
"0.6143785",
"0.6106455",
"0.607511",
"0.6060968",
"0.6060968",
"0.60337895",
"0.59981585",
"0.59812367",
"0.5979137",
"0.59501487",
"0.59472",
"0.59139353"... | 0.7150297 | 1 |
CONCATENATED MODULE: ./src/init/publicTimePicker.ts Wrap a DI context in a new public TimePicker object. The pulic TimePicker is more fault tolerant and is made to interact with js rather than ts It also has dispose logic and an onDispose event | function publicTimePicker(context) {
var timePicker = context.buildTimePicker();
var element = context.getRootElement();
var onDispose = [];
function dispose() {
context.dispose();
onDispose
.splice(0, Number.MAX_VALUE)
.forEach(function (f) { return f(); });
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function timePicker_create(input) {\n var _input = parseTimePickerData(input);\n var context = new di_DiContext(_input.config, _input.element);\n return publicTimePicker(context);\n}",
"_initTimePickerWorkHours() {\n if (document.querySelector('#timePickerWorkHours')) {\n new TimePicker(document... | [
"0.7143939",
"0.6657514",
"0.65665",
"0.6565041",
"0.6464697",
"0.64538354",
"0.6395733",
"0.63244295",
"0.63206744",
"0.63154626",
"0.63027334",
"0.63027334",
"0.63027334",
"0.63027334",
"0.62904555",
"0.6242195",
"0.6208849",
"0.608189",
"0.60794157",
"0.6025048",
"0.590783... | 0.79961354 | 0 |
Create a new time picker. The timepicker lives in the "element" return value which can then be appended to the DOM | function timePicker_create(input) {
var _input = parseTimePickerData(input);
var context = new di_DiContext(_input.config, _input.element);
return publicTimePicker(context);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initTimePickerFilled() {\n if (document.querySelector('#timePickerFilled')) {\n new TimePicker(document.querySelector('#timePickerFilled'), {dropdownClassname: 'time-filled-dropdown'});\n }\n }",
"function setupTime(element) {\n $(element).timepicker({\n showPeriod: true,\n ... | [
"0.7340931",
"0.714201",
"0.701894",
"0.7001073",
"0.697018",
"0.69528955",
"0.69416434",
"0.6939617",
"0.6890125",
"0.68633705",
"0.6763961",
"0.66971177",
"0.66722476",
"0.66583914",
"0.66583914",
"0.66583914",
"0.66583914",
"0.66057897",
"0.660415",
"0.6591342",
"0.6551890... | 0.7474396 | 0 |
Create a new time picker and render in a modal | function timePickerModal_create(input) {
var _input = parseInputs(input);
var context = new di_DiContext(_input.config);
var timePicker = publicTimePicker(context);
var modal = createModal(timePicker.element);
modal.onClickOrEsc(function () { return timePicker.cancel(); });
timePicker.onDispose(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initTimePickerFilled() {\n if (document.querySelector('#timePickerFilled')) {\n new TimePicker(document.querySelector('#timePickerFilled'), {dropdownClassname: 'time-filled-dropdown'});\n }\n }",
"function timePickerInput_create(input) {\n if (!input || !(input.inputElement instanceof HTMLInputEl... | [
"0.7319979",
"0.7212243",
"0.71258986",
"0.71158886",
"0.7010607",
"0.69142294",
"0.6821327",
"0.67708725",
"0.6709909",
"0.6709896",
"0.66922635",
"0.6648058",
"0.6648058",
"0.6648058",
"0.6648058",
"0.6640069",
"0.6608734",
"0.6578858",
"0.65582985",
"0.6537508",
"0.6529063... | 0.77463603 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.