query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
`STANDARD` Creates a `object` schema with the given properties. | Object(properties, options = {}) {
const property_names = Object.keys(properties);
const optional = property_names.filter(name => {
const candidate = properties[name];
return (candidate.modifier &&
(candidate.modifier === exports.OptionalModifier ||
... | [
"function ObjectProperties (schema) {\n schema.add({\n\n\t\t// GUID: a unique identified for an object\n 'guid': {\n 'type': String,\n 'index': true,\n 'unique': true\n },\n\n\t\t// Date Created: this time this object was created\n\t\t'dateCreated': {\n\t\t\t'type':... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hitSuccess: To handle all events on successive hit | function hitSuccess() {
score++;
return (userSelector, systemSelector) => {
$(userSelector).addClass('circle-success circle-read-only');
$(systemSelector).addClass('circle-success circle-read-only');
$(userSelector).removeAttr('style');
$(systemSelector).removeAttr('style');
... | [
"hit() {\r\n }",
"function hit() { /* can be overwritten */ }",
"function successfulHit() {\n hitSound.play();\n hitDom.text(hitCounter);\n}",
"handlePlayerWasHit(report){\n this.showHitExplosion(this.players[report.playerIndex].dynamic.posX, this.players[report.playerIndex].dynamic.posZ);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A custom label formatter used by several of the plots | function labelFormatter(label, series) {
return "<div style='font-size:0.7rem; text-align:center; padding:2px; color:white;'>" + label + "<br/>" + Math.round(series.percent) + "%</div>";
} | [
"function labelFormatter(label, series) {\n return '<div style=\"font-size:13px; text-align:center; padding:2px; color: #fff; font-weight: 600;\">'\n + label + '<br>' + series.data[0][1] + '</div>';\n }",
"function labelFormatter(label, series) {\n return \"<div style='font-size:8pt; tex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate values for and draw the force arrows in the game | function drawForces(){
//Thrust
if (upPressed == true && thrustCount<80 ){
thrustCount += 0.5;
} else if (thrustCount>1){
thrustCount -= 0.5;
}
if (arrowvisible == true){
//Gravitational Potential Energy
//4.15 is basically just the number tha... | [
"drawDebug() {\n\n this.velocity.drawArrow({\n p:p5Obj,\n center: this.position,\n multiple: 1,\n arrowSize: 6,\n color: [0, 0, 0],\n }) \n \n\n let forceDisplayMultiple = 1\n\n this.gravity.drawArrow({\n p:p5Obj,\n center: this.position,\n multiple: forceDis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if getShowtimes AJAX request has been done intially | function checkInitialRequest(){
showtimeFactory.getInitialShowtime(function (status){
// console.log('showtime status', status)
if(status == false){
getShowtimes();
}else{
//get the saved showtime if AJAX request already been done
showtimeFactory.getSavedShowtimes(function ... | [
"function ajaxd_timed() {\n let time = new Date(),\n seconds = time.getSeconds()\n if (seconds == 0) {\n loadDepartures();\n }\n}",
"function check_if_teams_ready() {\n $.ajax({\n data: {\n check: 'teams_ready',\n period: get_period()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates current state if activities by calculating total cost and disabling Conflicting activities | function updateActivities () {
showCost();
strikeOutMatches();
} | [
"function updateActivityCost(activity) {\n $('.activities').append('<span id=\"total-cost\"></span>')\n if (activity.attr('name') != 'all') {\n if (activity.is(':checked')) {\n totalCost += 100;\n } else {\n totalCost -= 100;\n }\n } else if (activity.attr('name') === 'all') {\n if (activit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Logs a new navigation sreenexiting event in the application. | function trackNavigationExit(options, successCallback, errorCallback) {
var args = [];
if (!checkStringOption('eventName', options, true, errorCallback)) {
return;
}
args.push(options['eventName']);
args.push(options['props']);
execWithCallbacks(Command.TRACK_NAVIGATION_EXIT, successCall... | [
"function logout() {\n sendEvents({\n navigation_logout: true,\n navigation_logout_screen: StateManagement.getPageTitle()\n });\n }",
"function navigationEndHandler(event) {\n _debug();\n \n if ($.support.animationEvents && animat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Dealer 21 Modal | function dealerTwentyOne() {
dealerTwentyOneModal.style.display = "block";
} | [
"static createModal() {\n const modal = document.createElement(\"div\");\n modal.id = \"uwu__modal1312\";\n modal.classList.add(\"uwu__hide1312\");\n\n modal.onmousedown = function (e) {\n if (e.currentTarget !== e.target) return;\n modal.classList.remove(\"uwu__show1312\");\n };\n\n doc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles control shift end key. | handleControlShiftEndKey() {
let documentEnd = undefined;
if (!isNullOrUndefined(this.owner.documentEnd)) {
documentEnd = this.owner.documentEnd;
}
if (!isNullOrUndefined(documentEnd)) {
this.end.setPosition(documentEnd.currentWidget, false);
this.fire... | [
"handleShiftEndKey() {\n this.extendToLineEnd();\n this.checkForCursorVisibility();\n }",
"handleControlShiftDownKey() {\n this.extendToParagraphEnd();\n this.checkForCursorVisibility();\n }",
"handleControlShiftRightKey() {\n let isForward = this.isForward ? this.start.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search the string for a match starting at the given position | search(string, startPosition, callback) {
if (startPosition == null) {
startPosition = 0;
}
if (typeof startPosition === 'function') {
callback = startPosition;
startPosition = 0;
}
try {
const ret = this.searchSync(string, startPos... | [
"search(string, startPosition, callback) {\r\n if (startPosition == null) {\r\n startPosition = 0;\r\n }\r\n if (typeof startPosition === 'function') {\r\n callback = startPosition;\r\n startPosition = 0;\r\n }\r\n try {\r\n const ret = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
round up an unsigned number str, like: 1.4 > 2, 1.5 > 2 | function roundUpUnsignedDecimal(numStr, precision) {
var _trimNumber2 = (0,_numberUtil__WEBPACK_IMPORTED_MODULE_2__.trimNumber)(numStr),
integerStr = _trimNumber2.integerStr,
decimalStr = _trimNumber2.decimalStr;
var advancedDecimal = getMiniDecimal(integerStr + '.' + decimalStr).add("0.".concat('0'.repeat(... | [
"function roundNum(unrounded, roundUp) {\n\n if (roundUp) {\n if (unrounded - Math.floor(unrounded) < 0.01) {\n return Math.floor(unrounded);\n } else {\n return Math.ceil(unrounded);\n }\n } else if (Math.ceil(unrounded) - unrounded < 0.01) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chunked uploads to crossdomain server once we have acquired an upload token | function startChunkUploads( inputItem, progressItem, onFinish )
{
return function ( initResults )
{
// check and fire up the actual upload
var blob = inputItem.files[0];
// lol, const.
var BYTES_PER_CHUNK = 2 * 1024 * 1024; // 2MB chunk sizes.
var SIZE = blob.size;
... | [
"uploadChunk(file) {\r\n const HandlerClass = this.chunkOptions.handler;\r\n file.chunk = new HandlerClass(file, this.chunkOptions);\r\n return file.chunk.upload().then((res) => { return file; });\r\n }",
"function uploadLoop(cookie, passCallback, failCallback) {\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Popup a window at the center of the screen with size of 600(w)480(h) and resizable. | function ui_popupCenter(str_url,str_winname,str_winparms){
var _screen_ht = screen.availHeight;
var _screen_wd = screen.availWidth;
var _win_ht = 480;
var _win_wd = 600;
w_top = Math.round((_screen_ht - _win_ht)*0.5);
w_left= Math.round((_screen_wd - _win_wd)*0.5);
str_winparms = ( ui_trim(str_winparms).length==... | [
"function resize_popup()\n{\n\tvar aw = screen.availWidth;\n\tvar ah = screen.availHeight;\n\n\tif (aw != screen.width || ah != screen.height) {\n\t\twindow.resizeTo(aw,ah);\n\t\twindow.moveTo(0,0);\n\t}\n}",
"function PopupCenter(a,d,b,c){var e=void 0!=window.screenLeft?window.screenLeft:screen.left,f=void 0!=wi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the base URL of the API, onto which endpoint components can be appended. | function getAPIBaseURL() {
let baseURL = window.location.protocol
+ '//' + window.location.hostname
+ ':' + window.location.port
+ '/api';
return baseURL;
} | [
"function getRequestBaseURL() {\n\n var url;\n\n if (useProxy) {\n url = proxyURL;\n } else if (oauth && oauth.instance_url) {\n url = oauth.instance_url;\n } else {\n url = serverURL;\n }\n\n // dev friendly API: Remove trailing '/' if any so url + path concat alw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the appropriate default protocol for a given port | function defaultProtocolForPort(port) {
switch (port) {
case 80:
case 8000:
case 8008:
case 8080:
return enums_1.ApplicationProtocol.HTTP;
case 443:
case 8443:
return enums_1.ApplicationProtocol.HTTPS;
default:
throw new Err... | [
"function defaultPort(protocol) {\n return {'http:':80, 'https:':443}[protocol];\n }",
"function defaultPort (protocol) {\n return { 'http:': 80, 'https:': 443 }[protocol]\n }",
"function defaultPort(protocol) {\n return { 'http:': 80, 'https:': 443 }[protocol]\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add all carsts of a playlist to carsts queue | function addPlaylistToQueue(playlist, channel) {
playlist = JSON.parse(JSON.stringify(playlist));
playlist.carsts.forEach(function(carst) {
carst.channel = channel;
addCarstToQueue(carst);
});
} | [
"function addPlaylist(playlistId, title)\n{\n retrievePlaylistitems(playlistId).then(function(res){\n console.log(res);\n let id = 0;\n \n for(let i=0; i<50; i++)\n {\n addtoQueue(res.items[i].snippet.resourceId.videoId)\n }\n\n })\n\n playlistToast(title);\n}",
"_addToQueu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that fills dataStore variable with device.id, timestamp, count value and capacity | function createData(device, date_internal, count) {
dataStore = { "device": device.id, "date": date_internal, "count": count, "capacity": device.capacity};
//console.log(typeof(dataStore))
return dataStore;
} | [
"function DeviceData(message){\n\n // These needed to be invoke by event notifications from the set handlers\n this._updateMetadata = function(valueUpdated){\n if (!this._message._Metadata[valueUpdated]){\n debug(\"Metadata cannot be found for \" + valueUpdated);\n return false;\n }\n this._mes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle when offline survey submit button is clicked | function lpOnOfflineSurveySubmit(data) {
logger.debug("lpOnOfflineSurveySubmit", "...");
var question = lpChatGetSurveyAnswers(data);
var surveyResult = {
id : getTrimmedValue("lpSurveyID", false),
question : question
}
logger.debug("lpOnOfflineSurveySubmit.surveyResult", surveyResult);
... | [
"function offlineSurveyBtnClick(data){\n\t\t\t\tlogger.debug(\"offlineSurveyBtnClick\", \"submitted\");\n\t\t\t\tmyChatWiz.validateSurvey(data, lpOnOfflineSurveySubmit);\n\t\t\t}",
"function handleSubmitAnswerButtonClicked() {\n $('.page').on('submit', 'form', function (event) {\n\n event.preventDefault();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate the games_current page | function load_games_current(data) {
var view_link = function(id) {
if(obj.status == 'waiting')
return '<a href="javascript:void(0);" class="btn disabled">View</a>';
else
return '<a href="javascript:void(0);" class="btn primary" ' + 'onclick="get_game_overview(' + id + ')">Vie... | [
"function renderCurrentGamePage( meta ) {\n\t\tvar idx = 0,\n\t\t\tcanvasPage = meta.pages[ meta.pageNo ];\n\n\t\t/**\n\t\t* Render a specific game page (no scrolling, no pagination control, just render the games into the page)\n\t\t*/\n\t\tfunction renderGamePage( canvasPage ) {\n\t\t\tif( !canvasPage ) {\n\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the money field value | function moneyValue(moneyField) {
var functionName = "moneyValue";
var money = null;
try {
if (isValid(moneyField) && isValid(moneyField.Value)) {
//money = kendo.format("{0:c2}", parseFloat(moneyField.Value));
money = moneyField.Value;
} else {
money = ke... | [
"function getMoney() {\n\treturn parseInt(currentMoney);\n}",
"getFormatedAmount() {\n const entity = this.props.entity;\n return currency(entity.wire_threshold.min, entity.wire_threshold.type, 'suffix');\n }",
"function getAmount() {\n const inputAmount = document.querySelector('#amount').value;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlights a user when box is checked on group management page | function HighlightUser(){
$('.tborder input:checkbox').live('change', function(){
if($(this).is(':checked')){
$(this).parent().siblings().andSelf().css("background","#242424");
} else {
$(this).parent().siblings().andSelf().css("background","");
}
});
$('.tborder input:checkbox').each(f... | [
"function highlightGroups() {\n if (!($('#confirmingAvailability').val() === 'true')) {\n $('div.group').each(function() {\n\n var groupParts = $(this).find('input.MasterKitPart');\n var partParents = groupParts.parent();\n var groupName = $(this).attr('id');\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `ServiceNowKnowledgeArticleConfigurationProperty` | function CfnDataSource_ServiceNowKnowledgeArticleConfigurationPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Exp... | [
"function CfnDataSource_SalesforceKnowledgeArticleConfigurationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.Validation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and returns a Texture object that will read its image from the specified URL. If the second parameter is provided, the texture will be applied to the material when the | function makeTexture( imageURL, material )
{
function callback()
{
if (material) {
material.map = texture;
material.needsUpdate = true;
}
// not necessary to call render() since the scene is continually updating.
}
let loader = new THREE.TextureL... | [
"function makeTexture(imageURL, temp, material) {\r\n function callback() {\r\n if (material) {\r\n material.map = texture;\r\n material.needsUpdate = true;\r\n }\r\n // not necessary to call render() since the scene is continually updating.\r\n }\r\n let loader =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Spawneamos a los fantasmas | spawnFantasma(fantasma) {
// Establecemos que el fantasma ha spawneado
fantasma.setSpawned(true);
// Establecemos su velocidad
fantasma.setVelocidad(this.game.getFantasmaSpeed());
} | [
"spawnearFantasmas(){\n this.deleteFantasmas();\n\n this.fantasmas = [\n new Fantasma(this.game.getFantasmaSpeed(), 0xFF0000),\n new Fantasma(this.game.getFantasmaSpeed(), 0xFFB8FF),\n new Fantasma(this.game.getFantasmaSpeed(), 0x00FFFF),\n new Fantasma(this.game.getFantasmaSpeed(), 0xFFB8... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an upstream that has been registered with a given name | getUpstream (name) {
return this[_upstreams][name];
} | [
"registerUpstream (name, upstream) {\n\t\tif (typeof name === 'object') {\n\t\t\treturn Object.keys(name).map((k) => {\n\t\t\t\tthis.registerUpstream(k, name[k]);\n\t\t\t});\n\t\t}\n\n\t\t// Require name and upstream to add\n\t\tif (!name) {\n\t\t\tthrow new TypeError('upstream name cannot be undefined');\n\t\t}\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
true if object has own PolymerBase api | function isBase(object) {
return object.hasOwnProperty('PolymerBase')
} | [
"function PolymerBase() {}",
"_isRegistered(tag) {\n return document.createElement(tag) instanceof PolymerElement;\n }",
"checkShadowDomSupport() {\n return typeof(document.documentElement.attachShadow) !== 'undefined';\n }",
"function inPolymerFlavorContext(context) {\n var _a, _b;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::CodeDeploy::Application` resource | function cfnApplicationPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnApplicationPropsValidator(properties).assertSuccess();
return {
ApplicationName: cdk.stringToCloudFormation(properties.applicationName),
ComputePlatform: cdk.stri... | [
"function cfnApplicationDeployAsApplicationConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnApplication_DeployAsApplicationConfigurationPropertyValidator(properties).assertSuccess();\n return {\n S3ContentLocation: cfnAp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of games won and played by all teams | function gamesPlayedAndWon (allGames, teamNames) {
var teamData = [];
for (var teamIndex = 0; teamIndex<teamNames.length; teamIndex++){
teamData[teamData.length] = {
name:teamNames[teamIndex],
played:0,
won:0,
drew:0
};
}
var startIndex = 1;
var endIndex = 17;
if (seasonPart === "Season"){
... | [
"function gamesPlayed(team, games) {\n var count = 0;\n for(var i in games) {\n if(games[i].team1 == team.teamName || games[i].team2 == team.teamName) {\n count += 1;\n }\n }\n return count;\n}",
"static numGames() {\n return Object.keys(games).length;\n }",
"static numGames() {\n return O... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates a bracket with the current state of the tournament, call this once all your participants are added If you end up adding more participants after the bracket has been generated, just call this once more and the bracket will be updated | GenerateBracket() {
this._bracket = BracketHelper.GenerateBracket(this._participants);
} | [
"function getCurrentBracket() {\n let userBracket = {\"matchups\":[]};\n let rounds = document.querySelectorAll(\".round\");\n //For each round in the tournament, add a series of matchups\n for(let i=0; i<rounds.length; i++) {\n let round = rounds[i];\n //For each m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
10. Write a function called multiplyAll(array) that takes in an array of numbers and returns the result of multiplying all the numbers | function multiplyAll(array) {
var result = 1;
for (var i = 0; i < array.length; i++) {
result *= array[i];
}
return result;
} | [
"function multiplyAll(array){\n return function(multiple) {\n return array.map(function(currentValue){\n return currentValue * multiple\n })\n }\n}",
"function multiplyAll(array) {\n return function (num){\n return array.map(el => el*num)\n }\n}",
"function multiplyAll(numbers) {\n var prod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if PW and email match DB | function UserPWVerifier (email, pw){
for (var user in users){
let comparingPW = users[user]['password'];
if ( (users[user]['email'] === email) && (bcrypt.compareSync(pw, comparingPW)) ){
const CheckID = users[user]['id'];
return CheckID;
}
}
return false
} | [
"checkEmailPassword(email, password) {\n // FIXME Connection with first fake user only\n return email === fakeUsers[0].email && password === fakeUsers[0].password;\n }",
"function matchedCredentials(datum, emailInput, passwordInput) {\n if (datum.email === emailInput && datum.password === passwordInput)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a map, update all pointOnPath postimage objects found in the map to either new or cached random values. This function must be called in the same order every constraint so that an individual cache index will always refer to the same iterated image. Relies on the closure: rerandomizeCounter | function updateRandomPointsOnPath(aMap) {
var numToRandomize = aMap.onPathPostImages.length,
i,
gobj,
path,
animationRange;
for (i = 0; i < numToRandomize; i++) {
gobj = aMap.onPathPostImages[i];
if (aMap.randomValueCache[reran... | [
"function randomizeMap(map, density=0.5) {\n // traverse through each tile and generate a resource node with probability P=density\n\n console.log(map);\n for(let x=0; x<map.xExtent; x++) {\n for(let y=0; y<map.yExtent; y++) {\n // clear the tile\n map.removeResourceNode(x, y);\n\n // generate ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move Dynamic Content This section allows dynamically created content (through JavaScript) to be inserted into the widget panel. This allow us to bypass the restrictions on loading dynamic content through an AJAXloaded page. This functions runs after the widget page gets loaded | function moveDynamicContent()
{
// Identify the proper divs, if available
var mvRight = document.getElementById("move-content-wrapper");
var dynRight = document.getElementById("dynamic-content-loader");
// Move any content in the "move-content-wrapper" div to the right panel
if(mvRight !== null)
{
if(dynRight... | [
"function loadContent() {\n var section = widgetObj.getElement('e2wget5section');\n if (section && section.getAttribute('data-force-reload') !== '1') {\n try {\n if (document.characterSet.toLowerCase() !== 'utf-8') {\n fixEncoding();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signed angle of a cartesian point relative to [cr, 0, 0]. | function d3f_geo_circleAngle(cr, point) {
var a = d3f_geo_cartesian(point);
a[0] -= cr;
d3f_geo_cartesianNormalize(a);
var angle = d3f_acos(-a[1]);
return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
} | [
"function getAngle(c, p) {\n var dy = p.y - c.y;\n var dx = p.x - c.x;\n\n if (floatEq(dy, 0.0))\n return dx > 0 ? 0 : Math.PI;\n if (floatEq(dx, 0.0))\n return dy > 0 ? Math.PI/2 : 3 * Math.PI/2;\n\n if (dy > 0 && dx > 0)\n return Math.atan(dy/dx);\n if (dy > 0 && dx < 0)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create a series Array of permit types. The array splits the permit in the different types and count them. | createPermitSeries() {
const arr = this.state.permits
const colors = { 'RE-EXPORT': 'warning', EXPORT: 'ok', OTHER: 'critical' }
const result = Object.values(
arr.reduce((c, { permitType }) => {
c[permitType] = c[permitType] || {
label: permitType,
value: 0,
color... | [
"function gettypes(x) {\n var animal_counts = {}, i, value;\n for (i = 0; i < x.length; i++) {\n value = x[i];\n if (typeof animal_counts[value] === \"undefined\") {\n animal_counts[value] = 1;\n } else {\n animal_counts[value]++;\n }\n }\n return animal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this creates a green circle at a random Y that moves across the canvas right to left. at the end of animation it calls circles2() which creates an orange circle. | function circles(){
randomY = Math.floor(Math.random()*460)+20;
var x = r.circle(680,randomY,30).attr({fill: fillColor,"fill-opacity": .4});
//if stop on the html has been clicked...global variable stopped is now 1. thus stopping this and circles2() animations
if(stopped===0){
x.animate({transform:"t... | [
"function animate() {\n requestAnimationFrame(animate);\n c.clearRect(0, 0, innerWidth, innerHeight);\n\n circle.update();\n circle1.update();\n circle3.update();\n\n // c.beginPath(); \n // c.arc(x, y, radius, 0, 2 * Math.PI, false);\n // c.fill();\n // c.strokeStyle = randomHue;\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transpose the data in the summary list and copy to another sheet | function copyAndTranspose() {
var s = SpreadsheetApp.getActiveSpreadsheet();
var a = s.getSheetByName("All Licenses").getDataRange().getValues();
var t = a[0].map(function(col, i) {
return a.map(function(row) {
return row[i];
});
});
s.getSheetByName("All Licenses (T)").clearContents()
.ge... | [
"function pivotOverviewData(data){\n if (data.rows.length < 1){\n console.log(\"No rows found\");\n return;\n }\n\n var keys = Object.keys(data.rows[0]);\n\n var output_rows = keys.map(function(key){\n var row = [key, data.rows[0][key]];\n return row;\n });\n\n return{\n headers: data.headers,\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new number sequence | function createNumberSequence(database, sequenceKey) {
return database.create('NumberSequence', {
id: generateUUID(),
sequenceKey: sequenceKey,
});
} | [
"function sequence(number) {\n let newArr = [];\n for (let i = 1; i <= number; i++) {\n newArr.push(i);\n }\n return newArr;\n}",
"function initiateSequence(num, length) {\r\n let seq = [num];\r\n\r\n for (i = 0; seq.length < length; i++) {\r\n seq.push(seq[seq.length - 1] * 3);\r\n }\r\n\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize status divs for all GUIDs in "dataguidlist" attribute in body tag. | function initAdminStatusDivs() {
var guid_list = $('body').data('guid-list').split(",");
if (guid_list instanceof Array) {
guid_list.forEach(function(entry) {
addStatusDiv(entry);
});
$('#short-status-info-header').show();
$('#'+guid_list[guid_list.length - 1]).show();
}
updateAllStat... | [
"function fillStatusBoxes() {\n\n $('#pendingNum').html(items.length);\n $('#approved').html(approve.length);\n $('#denied').html(denied.length);\n $('#futureE').html(futureMap.length);\n $('#views').html(eventViews);\n $('#past').html(pastMap.length);\n}",
"function initializeDivTags() {\n\tif (meetings.me... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
constructor for feed object | function Feed(name, url){
this.name = name;
this.src = url;
this.connection = new google.feeds.Feed(url);
window.user_feeds.push(this);
} | [
"function FeedItem() {\n this._init.apply(this, arguments);\n}",
"function FeedParser() {\n this.parsedItems = [];\n this.mSerializer = new XMLSerializer();\n}",
"function FeedViewer() {\n this._init.apply(this, arguments);\n}",
"function RSSData() {}",
"function FeedParser() {\n this.mSerializer =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To refresh the context keys at level below the current depth | function needRefresh(context, startDepth, keyCount) {
console.log('findBOTResponse : replaceKeyValues : needRefresh : a refresh is done for keys below in hierarchy');
let nextItems = keyCount - (startDepth + 1);
if (nextItems > -1) {
context.keys.splice(startDepth + 1... | [
"_unsetAndRelinkContext(contextKey) {\n const contextKeys = Array.isArray(contextKey) ? contextKey : [contextKey];\n\n contextKeys.forEach((key) => {\n delete this._providingContext[key];\n });\n\n const closestDbuiParent = this.closestDbuiParent;\n const valuesToSet =\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Consolidate all achievements from an array, destroying unknown achievements and generating missing ones. | async consolidate_all(achievements) {
// Update known achievements and destroy unknown ones
for (let a of achievements) {
try {
this.consolidate(a)
} catch(e) {
achievements.removeObject(a)
a.destroyRecord()
}
}
// Now, handle the maybe missing achievements
... | [
"function consolidateAddOns(){\n console.log('consolidating...');\n allItemsArray = finalAllItemsArray;\n for(var i=0;i<allItemsArray.length;i++){\n for(var j=0;j<addOnsArray.length;j++){\n if(allItemsArray[i].id == addOnsArray[j].id){\n allItemsArray.splice(i, 1);\n }\n }\n }\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ad is not displaying when gallery is initialized until we refresh the gallery ad. so we are implementing in a way to refresh ad when you initialize gallery. Note: Ad was not making double click request until ad is refreshed so we don't get duplicate requests/impressions. | function buildAds(){
jQuery(".gallery-ad").attr("id","GalleryAd");
jQuery(".gallery-ad img").hide();
overlayAd("GalleryAd", __GEEK.currentAds[1].adUnit, __GEEK.currentAds[1].adZdid);
refreshAd();
} | [
"function galleryAdRefresh() {\n\t var adSlots = new Array();\n\t // Adding the adslot for desktop & tablet.\n\t if (detect_device == 'desktop' || detect_device == 'tablet') {\n\t if (jQuery('div#ad-multi_ad_leaderboard').length > 0) {\n\t adSlots.push(\"ad-multi_ad_leaderboard\");\n\t }\n\t if (jQ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set custom error on lookup field using message or a label as default | @api
setCustomError(message) {
if (isEmpty(message)) {
message = this.CUSTOM_LABELS.geErrorCompleteThisField;
}
this.errorMessage = message;
this.valid = false;
} | [
"function setError(err) {\n if (err === undefined) {\n err = 'Please enter a search term';\n }\n return o.term.addClass('error').attr('placeholder', err);\n }",
"setError(field, message){\n const errorOld = this.errors[field + 'Error'];\n\n //concatenate ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
abstract resolveEvent :: Generator Event?> | *resolveEvent(eventID) {
return this.events[eventID];
} | [
"function resolveEvent(data) {\n return resolve(data);\n }",
"getUniversalEvent (): EventBase {\n return thenChainEagerly(this.getPremiereStory(), getActionFromPassage);\n }",
"_registerEvent() {}",
"function Event() {}",
"function Event () {}",
"getUniversalEvent (): EventBase {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Note: global systemExecuteFile called by explorer | function systemExecuteFile(file_path) {
// execute file with default handler
// like the START command in CMD.EXE
withFilesystem(function () {
var fs = BrowserFS.BFSRequire("fs");
fs.stat(file_path, function (err, stats) {
if (err) {
return alert("Failed to get info about " + file_path + "\n\n" + err);
... | [
"function executeFile(file_path){\n\t// execute file with default handler\n\t// like the START command in CMD.EXE\n\t\n\twithFilesystem(function(){\n\t\tvar fs = BrowserFS.BFSRequire(\"fs\");\n\t\tfs.stat(file_path, function(err, stats){\n\t\t\tif(err){\n\t\t\t\treturn alert(\"Failed to get info about \" + file_pat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract item type from scrobble data | static typeFromData(data) {
if (!data) return null;
if (data.movie) return 'movie';
if (data.show && data.episode) return 'episode';
return null;
} | [
"function getEntryItemType(entry) {\n var itemType = jQuery(entry).find('zapi\\\\:itemType, itemType').text();\n\n return itemType;\n}",
"function getItemType(item) {\n\tvar itemType = item.frameType;\n\tvar name = item.typeLine;\n\n\tif (itemType == 6 && item.properties[\"Stack Size\"]) {\n\t\t// type 6 is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transforms the certificateProvider SignRequest instance into a JSONifiable value that may be sent to the C++ handler. | function jsonifiableFromSignRequest(signRequest) {
const transformedSignRequest = Object.assign({}, signRequest);
transformedSignRequest.digest = byteListFromArrayBuffer(signRequest.digest);
transformedSignRequest.certificate =
byteListFromArrayBuffer(signRequest.certificate);
return transformedSignReques... | [
"function jsonifiableFromSignRequest(signRequest) {\n const transformedSignRequest = Object.assign({}, signRequest);\n transformedSignRequest.input = byteListFromArrayBuffer(signRequest.input);\n transformedSignRequest.certificate =\n byteListFromArrayBuffer(signRequest.certificate);\n return transformedSi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function display the Serching result for hosts. Related With: None Parameter: event: This contain the keyup event object. Return: None Output: This function return a searching result in html unorder list format and display the output on side panel . How to Use: pass json format and div id for display the result . ... | function searchHostResult(event)
{
result=[];
var hostResult=getHost(nmsresult);
var flag=0;
var html="";
html+="<ul>";
//var chCode = ('charCode' in event) ? event.charCode : event.keyCode;
srchStr=$("#searchHost").val().toLowerCase().toString();
for(i in hostResult){
if ((hostResult[i].toLowerCase... | [
"function searchNMSResult(event)\r\n{\r\n\tvar flag=0;\r\n\tvar html=\"\";\r\n\thtml+=\"<ul>\";\r\n\t\tfor( i in nmsData){\r\n\t\t\t\tif (((nmsData[i].name).toLowerCase().indexOf($(\"#searchNMS\").val().toLowerCase()))>=0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\thtml+=\"<li id=\"+nmsData[i].name+\"><a href=# style=\\\"text-dec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cleanup the dirty connections in a connections array. This will remove any connection with a `null` signal. This function should only be invoked asynchronously, when the stack frame is guaranteed to not be on the path of user code. | function cleanupConnections(connections) {
algorithm_1.ArrayExt.removeAllWhere(connections, isDeadConnection);
} | [
"function cleanupConnections(connections) {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }",
"function cleanupConnections(connections) {\n algorithm_1.ArrayExt.removeAllWhere(connections, isDeadConnection);\n }",
"function cleanupDirtySet() {\n dirtySet.forEach(cleanupC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to generate a datastructure that specifies which region's boundaries are supposed to be drawn to the canvas according to the slider's position. Slices by View is an object with the 3 brain view fields, and a list of all the geojson filenames sorted as entries. Also creates the sliderMeasurements that po... | prepRangeData() {
let slicesByView = {
"sagittal": [],
"axial": [],
"coronal": []
}
for (let n in this.paneOb.regionBoundaryData) {
if (n.search(/cor/) == 0) {
slicesByView["coronal"].push(n)
}
if (n.search(/... | [
"createSlider() {\n // make a slider div\n let sliderDiv = document.createElement(\"div\")\n sliderDiv.id = \"sliderdiv\"\n //initiate the slider\n let range = document.createElement(\"input\")\n range.id = \"rangeslider\"\n let label = document.createElement(\"label... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE: if name == "" that mean treeNode is a forest, not a simple tree | function treeNode(name, expanded, hasChild){
this.name = name
this.expanded = expanded
this.child = new Array(maxNumberOfChild)
this.childCount = 0;
this.id= "";
this.subtree = null
this.addChild = addChild
this.getHeight = getTreeHeight
this.getHTMLTable = getHTMLTable
this.getH... | [
"function FBXTree() { }",
"function FBXTree() {}",
"function navigateTree(object,name)\n{\n if(object!=null)\n \t{\n \t\tif(object.name == name)\n \t\t{\n \t\treturn 1;\n \t\t}\n \t\tfor (var i = 0; i<numofchildren(object); i++)\n \t\t{\n \t\t\tnavigateTree(object.children[i],name);\n \t\t}\n \t}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an object id for all s | function createObjectId(id) {
return 'object_' + id;
} | [
"function generateNewID(obj, base) {\n\t\tvar number = 1;\n\t\tbase = base || 'id';\n\t\tvar id = ('' + base + number);\n\t\twhile (obj.hasOwnProperty(id)) id = ('' + base + (++number));\n\n\t\treturn id;\n\t}",
"createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get a favorite by id | function getFavoriteById(id){
return db('livereviews')
.where({id})
.first()
} | [
"function getUserFavorites(id) {\n return userdb('users').select('favorites').where({ id }).first();\n}",
"function getFavourite(){\n return favouriteService.getFaveByModelId(model.id);\n }",
"static fetchFavoriteById(id, callback) {\n DBHelper.fetchFavorites((error, restaurants) =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if it's "Hot" and add a class accordingly to reflect the heat. | function isHot(){
console.log(temperature_measurement);
if((temperature >= 8 && temperature_measurement === "c") || (temperature >= 46.4 && temperature_measurement === "f")){
$('table').addClass('glow');
}
} | [
"function hotOrNot (temp) {\n\tif (temp > 75) {\n\t\t$('.temperature').html('Hot!');\n\t} else {\n\t\t$('.temperature').html('Not hot!');\n\t}\n}",
"setWater() {\n this.water = true;\n this.moist = false;\n if (this.classList.contains('moist')) {\n this.classList.remove('moist');\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default config for a remove format button | get removeFormatButton() {
return {
command: "removeFormat",
icon: "editor:format-clear",
label: "Erase Format",
type: "rich-text-editor-button",
};
} | [
"get removeFormatButton() {\n return {\n ...super.removeFormatButton,\n label: this.t.removeFormatButton,\n };\n }",
"function deleteFormat(format)\n{\n}",
"function removeFormatting() {\n document.execCommand(\"removeFormat\", false, null);\n document.execCommand(\"unlink\", fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mouseReleased function to launch the bird | function mouseReleased() {
console.log("Hello")
launcher.fly();
} | [
"function mouseReleased(){\r\n\tboy.fly()\r\n}",
"function mousePressed() {\n this.bird.flap();\n}",
"mouseReleased() {\n if (this.wasBirdDragged == true) {\n this.mouseButtonUp = true;\n this.wasBirdDragged = false;\n }\n }",
"function mouseReleased() {\n slingshot.fl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to persist ViewModel into the local storage of the browser | function saveData() {
localStorage.storefinder = ko.toJSON(vm);
} | [
"save() { localStorage.setItem(this.constructor.localStorageName, JSON.stringify(this)); }",
"function updateStorage () {\n localStorage.setItem('restaurants', ko.toJSON(self.restaurants()));\n }",
"persistLocalStorage() {\n console.log(\"persist\");\n localStorage.setItem(this.localStorage_ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replace cut layers insequence (to maintain layer indexes) append any additional new layers | function replaceLayers(dataset, cutLayers, newLayers) {
// modify a copy in case cutLayers == dataset.layers
var currLayers = dataset.layers.concat();
utils.repeat(Math.max(cutLayers.length, newLayers.length), function(i) {
var cutLyr = cutLayers[i],
newLyr = newLayers[i],
idx = cu... | [
"function pushLayers(){\t\r\n\tif(oldLayer.features[0] != null){ oldLayer.removeAllFeatures();\t}\r\n\tif(currentLayer.features[0] != null){\r\n\t\toldLayer.features = currentLayer.features \t// old layer is set to current\r\n\t\tcurrentLayer.removeAllFeatures();\t\t\t// remove all features from current layer\r\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create source element for selected chart | function createSource(targetData){
//define chart constants
let svg = d3.select(".chart");
let source = svg.append("g")
.attr("class", "source");
source.append("text")
.attr("x", 10)
.attr("y", 310)
.attr("text-anchor", "left")
.style("font", "10px monospace")
.text("Source: " + targetData.source);
} | [
"static createIn(container) {\n return internal.instancehelpers.createElement(container, OqlDataSetSource, \"source\", false);\n }",
"_buildChart(source) {\n\n const { rootNode, getSVG, treeInstance, element } = this.getProperties('rootNode', 'getSVG', 'treeInstance', 'element');\n\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the Route as a child to the current route | function addRoute(parent, child) {
var childRoute = parent.addChild(child.path);
for (var i = 0; i < child.actions.length; i++) {
var action = child.actions[i];
childRoute.addAction(action.verb, action.handlers);
}
for (i = 0; i < child.children.length; i++... | [
"function addRoute(el, parent) {\n\t validate(el);\n\n\t var type = el.type;\n\t var attributes = el.attributes;\n\t var children = el.children;\n\t var component = attributes.component;\n\n\n\t if (type.name == 'Redirect') {\n\t var path = (0, _normalizePath2.default)(join(attributes.from, p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loads all records (recursive with paging cookie) and returns promise | function fetchAll(fetchxml, opt_page, opt_allRecords) {
var allRecords = opt_allRecords || [],
pageNumber = opt_page || 1;
return fetchMore(fetchxml).then(function(result){
var pagingFetchXml;
// add the elements to the collection
allRecords = allRecord... | [
"_fetchPage(page, pageSize) {\n if (this._hasPageProvider()) {\n const options = {\n skipAggregates: page && page > 1,\n };\n if (page) {\n this.nxProvider.page = page;\n }\n if (pageSize) {\n this.nxProvider.pageSize = pageSize;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
contructing an instance of the Data class | constructor() {
super();
this.data = new Data();
} | [
"constructor() {\n super();\n this.data = new Data();\n }",
"constructor(values) {\n /*\n Contructor for Data class \n */ \n\n this._values = values;\n }",
"constructor(type, data) {\n this.type = type;\n this.data = data;\n }",
"constructor(data) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Administration: test email notification | function handleTestEmailNotification(urlParts, response) {
var email = urlParts.query.email;
if(!config.email) {
response.end(JSON.stringify({status: "Email system is not configured"}));
return;
}
if(!config.email.enabled) {
response.end(JSON.stringify({status: "Email system is n... | [
"function testEmail() {\n _sendEmail(\"Tom\", EMAIL_DEBUG_ADDRESS, \"Yes\");\n}",
"function emailTests() {\n var log = $.test_output.value;\n if (log && log.length > 0) {\n var promise = emailLogs(log);\n Alloy.Router.showActivityIndicator(promise);\n notify(_L('Email of testing log ha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for a set of trips, sum all riders that exit at a specified dest station | function sumExits (trips, dest) {
var ridersCount = trips.reduce(function(sum, x) {
if (x.dest == dest) {
return sum + x.riders;
}
return sum;
}, 1);
return ridersCount;
} | [
"destinationsVisitedByUser(travelerID, destinationData) {\n const allTrips = this.findUsersTrips(travelerID);\n return destinationData['destinations'].filter(destination => allTrips.find(trip => trip.destinationID === destination.id))\n }",
"function sumMyTrip() {\n var trips = [{ distance: 34 }, { dista... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================================================================= Materialize refresh compound modal form ========================================================================= ============================================================================================... | function refresh_Materialize_compound()
{
$('select').material_select();
Materialize.updateTextFields();
$('#textarea1').val('New Text');
$('#textarea1').trigger('autoresize');
$('.timepicker').pickatime({
default: 'now',
twelvehour: false, // change ... | [
"function ft_form_refresh() {\n // \n}",
"_reloadFull() {\n this.el.submit();\n }",
"function refreshModal () {\n setCourseUpdated (!courseUpdated)\n }",
"function updateForm() {\n $('body').on('click', '.btn--edit', function() {\n $('.plant__form__container').addClass('js__modal--... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Count the number of zeroes in present in the factorial of n Example : 10! = 10987654321 = 3628800 i.e two Zeroes are present in 10! So, Output = 2 | function countZeroInFactorial(n){
let count = 0;
for (let i = 1; n/Math.pow(5,i) > 1; i++) {
count += i-2;
}
return Math.floor(n/5) + count*(count+1)/2;
} | [
"function zeros(n) {\n\tvar count = 0;\n\tfor (i = 1; i <= Math.log(n) / Math.log(5); i++) {\n\t\tcount = count + Math.floor(n / Math.pow(5, i));\n\t}\n\tconsole.log(count);\n\treturn count;\n}",
"function findTrailingZeros(N) {\n // Number of zeros of any number factorial will have factor of 5\n let div = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HTTP call used to delete Elements | deleteElement(requestData) {
return axios({
url: '/delete/elements',
method: 'delete',
baseURL: API_LOCATION + '/api/v1/',
headers: {
'Content-Type': 'application/json'
},
data: {
'viewsiteId': requestData.viewsiteId,
'viewpageId': requestData.vi... | [
"deleteElement(requestData) {\n return axios({\n url: '/delete/elements',\n method: 'delete',\n baseURL: API_LOCATION + '/api/v1/',\n headers: {\n 'Content-Type': 'application/json'\n },\n data: {\n 'viewsiteId': ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class: mxSwimlane Extends to implement a swimlane shape. This shape is registered under in . Use the to define the size of the title region, for the content area fill, to draw an additional vertical separator and to hide the line between the title region and the content area. The affects the orientation of this shape, ... | function mxSwimlane(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function mxSwimlane(bounds, fill, stroke, strokewidth)\n{\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}",
"function mxSwimlaneManager(graph, horizontal, addEnabled, resizeEnabled)\n{\n\tthis.horizontal = (horizontal != nul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true if input is in the form of: PR6005 .H4 for callnumbers. | function validateCallNumbers(data){
// TODO: update rgx to allow for cn like pr6003.3 a899
return /(\w{2})(\d+)(\.\w{1}\d+)/.test(data);
} | [
"isKosher() {\r\n return this.phoneNumber.match(/^0([23489]80|5041|5271|5276|5484|5485|5331|5341|5832|5567)\\d{5}$/) !== null;\r\n }",
"function isCardNumber() {\r\nvar argv = isCardNumber.arguments;\r\nvar argc = isCardNumber.arguments.length;\r\nvar cardnumber = (argc > 0) ? argv[0] : this.cardnumber;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add likes / If person's is not in the array, then add is If person's name is in the array then remove it | function addLikes() {
if (propLike?.includes(user.username)) {
let index = propLike.indexOf(user.username);
let removeLike = [
...propLike.slice(0, index),
...propLike.slice(index + 1),
];
setLikeGet(removeLike);
setPropLike(removeLike);
setRedLike("");
add... | [
"function addMeToLikeArray() {\n likeArray.push({\n id: session.uid,\n name: user_name\n });\n}",
"function setNewUsersArray(book) {\n let bookLikers = book.users\n if (userLikes.includes(book.id)) {\n let index = bookLikers.indexOf(userLoggedIn)\n bookLikers.splice(index, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Useless Java integration example: exiting the interpreter process | function exit() {
console.print("Exiting from module");
Java.type('java.lang.System').exit (0);
} | [
"function quit() {\n java.lang.System.exit(0);\n}",
"function quit() { [native code] }",
"end() {\n process.exit();\n }",
"function exit() {\n process.exit();\n }",
"function exit() {\n\t\trunner.exit();\n\t}",
"function quitTest() {\n console.log(\"Goodbye! 👋\")\n //s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new transition to the blinking sequence, the move will be performed in the HSL space. | addHslMoveToBlinkSeq(HSLcolor, msDelay) {
this.liveFunc.addHslMoveToBlinkSeq(HSLcolor, msDelay);
return _yocto_api.YAPI_SUCCESS;
} | [
"blinky(step, sequence) {\n for (let i = 0; i < step; i++) {\n this.nextBlink(sequence[i], i);\n };\n this.setState({ player: true });\n }",
"function addTransition(delayMS, rule) {\n var props = [];\n rule.names.forEach(function (name) {\n props.push(View.cssName(name) + ' ' + delayMS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears specified row of output | function clearRow(rowNumber) {
var arrayIndex = parseInt(rowNumber) - 1;
var children = output.childNodes;
output.removeChild(children[arrayIndex]);
} | [
"function clearRow(tableid,rownum)\n{\n\tfor(var j=0;j<getColumnCount(tableid);j++)\n\t{\n\t\tsetCellValue(tableid,rownum,j,\"\");\n \t}\n}",
"function renderClearRow(row) {\r\n notifyController(0 /* ReplaceRow */, row);\r\n}",
"eraseBuffer() {\n this.row_ = (this.scrollRows_ > 0) ? this.scrollRows_ : 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the list of registered commands and returns one whch is known by a given name. | commandForName(name) {
return this.commands.find(c => c.names.includes(name)) || null;
} | [
"function findCommand(name, list = coreList) {\n\t// If `name` is not a string or there's nothing in it, return null.\n\tif(typeof name !== 'string' || !name.length) {\n\t\treturn null;\n\t}\n\t\n\t// Try to find the command.\n\tlet command = list.find(n =>\n\t\t\t// If the action is a function.\n\t\t\ttypeof n.act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert div to text area | function changeToTextarea() {
var divHTML = jQuery(this).html(),
$editableText = jQuery("<textarea style='width: 100%; height: 300px'/>");
$editableText.html(divHTML);
jQuery(this).replaceWith($editableText);
$editableText.focus();
$editableTex... | [
"function renderTextArea(widg, content) {\r\n widg.value = content; \r\n}",
"function copyTextToDiv() {\n var instyle = $('#textInput').css();\n var styleView = $('#textInputViewer').css();\n \n var fixedText = instyle.value.replace(/\\n/g,'<br/>');\n \n var multiSpaces = fixedText.match(/\\s{2,}/g);\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When `auto` is `true`, the parse function will infer and initialize and add the appropriate `Searcher` instance | function parse(query,options,{auto=true}={}){const next=query=>{let keys=Object.keys(query);const isQueryPath=isPath(query);if(!isQueryPath&&keys.length>1&&!isExpression(query)){return next(convertToExplicit(query));}if(isLeaf(query)){const key=isQueryPath?query[KeyType.PATH]:keys[0];const pattern=isQueryPath?query[Key... | [
"function parse$1(query, options, { auto = true } = {}) {\n const next = (query) => {\n let keys = Object.keys(query);\n\n const isQueryPath = isPath(query);\n\n if (!isQueryPath && keys.length > 1 && !isExpression(query)) {\n return next(convertToExplicit(query))\n }\n\n if (isLeaf(query)) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send the email to the Administrator and then record the history/update the sheets | function sendEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("All Staff");
var id = SpreadsheetApp.getActiveSpreadsheet().getId();
var spreadsheetFile = DriveApp.getFileById(id);
//make temp copy
var today = new Date();
var tmpname = (today.getMonth()+1)+'-'+toda... | [
"function NotifyStaffCompleteTS(){\n var res = Browser.msgBox(\"完成したシフトを送信しますか?\", Browser.Buttons.OK_CANCEL);\n if(res === \"ok\"){\n var sheet = SpreadsheetApp.getActiveSpreadsheet();\n var ss_ad = sheet.getSheetByName(s_address);\n var ss_inf = sheet.getSheetByName(s_SetInfo);\n var ss1 = shee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hide the active screen (if any) and show the screen with the specified id TODO refactor this to be more testable | function showScreen(id) {
var activeScreen = $('#game .screen.active')[0],
screen = $(id)[0];
if (activeScreen) {
dom.removeClass(screen, 'active');
}
dom.addClass(screen, 'active');
} | [
"function showScreen(id) {\n //\n // Remove the active state from all screens. There should only be one...\n let active = document.getElementsByClassName('active');\n for (let screen = 0; screen < active.length; screen++) {\n active[screen].classList.remove('active');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::Serverless::Function.DeadLetterQueue` resource | function cfnFunctionDeadLetterQueuePropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnFunction_DeadLetterQueuePropertyValidator(properties).assertSuccess();
return {
TargetArn: cdk.stringToCloudFormation(properties.targetArn),
Type: ... | [
"function CfnFunction_DeadLetterQueuePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('targetArn', cdk.requiredValidator)(properties.targetArn));\n erro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle a server response success If successTest return true, then this function is call; Within this function this is place in proper context and allow us to properly eval the response. Furthermore, the dom element responsible of the api call is returned if needed. Change in response object property from eval to atkjs.... | onSuccess(response, element) {
let result;
try {
if (response.success) {
if (response && response.html && response.id) {
result = $('#'+response.id).replaceWith(response.html);
if (!result.length) {
throw({messag... | [
"function successHandler() {\n if (response.get_statusCode() == 200)\n onSuccess(response.get_body());\n else\n onError(response.get_body());\n }",
"onSuccess(response) {\n try {\n if (response.success) {\n if (response.ht... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create html products section | function generateProductsHTML(index, item) {
return `<div class="product-container" position=${index}>
<img class="product-image" id="image${item.id}" src="${item.image}">
<div class="productInfo-container">
<div class="product-name">${item.name}... | [
"function createProductPage(type, products){\n\n\t// get the body element\n\tvar body = document.getElementById(\"body\");\n\n\t// create a container for the main guitar jumbotron\n\tvar jumbotron = generateProductPageHeaderJumbotron(type);\n\tbody.appendChild(jumbotron);\n\n\t// create a container for the products... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set focus on search and go to /posts/1 . | onFocus() {
this.setState({
goToPosts: true
});
} | [
"function startSearch() {\r\n\tif (window.location.hash.indexOf('#search=') > -1) {\r\n\t\tsearchInput.value = window.location.hash.substring(8);\r\n\t\tsearchPosts(searchInput.value.toLowerCase());\r\n\t} else {\r\n\t\tsearchInput.value = '';\r\n\t\tsearchPosts('');\r\n\t}\r\n}",
"function focusOnSearch() {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createNewEntry gets a form object form the frontend dialog and saves it into a new row in the sheet. The encrypted password object (json) is base64 encoded. | function createNewEntry(form) {
blob = Utilities.base64Encode(form.password);
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow([form.name, form.url, form.username, blob]);
} | [
"function createNewExternal (form) {\r\n\tif (form.altKey!=undefined)\t// For some reason this method get called twice\r\n\t\treturn;\r\n\r\n\tif (form.password.value.length<6) {\t\t// Password must be at least six characters\r\n\t\talert (\"Passordet må være minst 6 tegn.\");\r\n\t\tform.password.focus;\r\n\t\tret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves the tweets in JSON format with the query, time and page number in the file name. | function saveTweets(tweets, query, page) {
return new Promise((resolve, reject) => {
const timestamp = moment().format('L')
const filename = `${timestamp}.json`
const filepath = `./data/twitter/${month}-${query.query}-p${page}-${filename}`
const data = JSON.stringify(tweets)
fs.writeFile(filepath... | [
"function writeTweets(tweets) {\n\tfs.writeFile('limaa-tweets.json', JSON.stringify(tweets), function(err) {\n\t\tif (err) {\n\t\t\treturn console.log(err)\n\t\t}\n\t})\n}",
"function saveJson() {\n mongo.init(function (err) {\n if (err) throw err;\n\n mongo.findAll('twitterColl', {}, (err, docs)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CSSClassList is a JavaScript class that simulates DOMTokenList | function CSSClassList(e) {
this.e = e;
} | [
"get classList() {\n if (!this.hasAttribute(\"class\")) {\n return new DOMTokenList(null, null);\n }\n const classes = this.getAttribute(\"class\", true)\n .filter((attr) => attr.isStatic)\n .map((attr) => attr.value)\n .join(\" \");\n return n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the routes for getting or updating offline notification preferences. | function createPreferencesRoutes () {
router.route('/preferences/:org')
.get(handler.getPreferences())
.put(handler.updatePreferences())
} | [
"routes()\n {\n return {\n 'ServiceStatus':\n {\n inboundTypes: this.inboundTypes,\n method: '/ServiceStatus',\n callback: this.serviceStatus,\n note: 'Used for requesting service details.'\n },\n 'Init... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Y translation of target. | get targetTranslateY() {
return +this.getAttribute('target-translate-y') || 0;
} | [
"set targetTranslateY(value) {\n const newValue = (Math.round(+value) || 0).toString();\n this.setAttribute('target-translate-y', newValue);\n }",
"function setTargetTransformY(elem, y) {\n setTargetTransform(elem, 0, y);\n }",
"function translateY(y) {\n return Object(__WEBPACK_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if user pressed tab/enter on input to submit search | handleKeyPress(e) {
if (e.keyCode === 9 || e.keyCode === 13)
this.submitSearch();
} | [
"function _handleSearch() {\n $('input[type=\"search\"]').on('keydown', function(e) {\n if (e.which == 13) {\n $('#search').click();\n }\n });\n}",
"function performSearchWhenEnter(event){\n if(event.keyCode == \"13\"){\n performSearch();\n }\n}",
"function isEnter(e) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validated Entity Functions ////////////////////////////////////////////////////////////////////// Checks that nextPos is a neighbor of entity's current position entity can move to nextPos without a collision not already at the position nextPos is inside the world returns whether or not the entity got moved | function maybeMoveEntity(game, entity, nextPos, debug) {
var distVec = subtract(nextPos, entity.position);
if (distVec.x > 1 || distVec.y > 1 || distVec.x == 1 && distVec.y == 1) {
if (debug) console.log("too far", distVec);
return false; // too far
}
if (equals(entity.position, nextPos)) {
if (debu... | [
"isValid () {\n // Check that the move stays on the board.\n if (!validPosition({ x: this.x, y: this.y })) return false\n\n // Check that the target location is empty.\n if (!this.allowOverlap) {\n if (this.state.getPieceAtPosition({ x: this.x, y: this.y }) !== null) return false\n }\n\n // C... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks if the dog is next to an obstacle or box Return [obstacle_num and box_num] where obstacle_num is the number of obstacles and box_num is the number of boxes | check_beside(){
var obstacle_num = 0;
var box_num = 0;
for(var i=0;i<this.stage.squares.length;i++){
if (this.stage.squares[i] != this){
// the following expression is left || right || above || below. If all of them are false, two squares must intersect.
if (!( this.position.x + this.length < this.stag... | [
"function getAroundBombsCount (x, y){\n var bombsCount = 0;\n \n // Y-X coordinats of rel boxes \n\n // UP-LEFT BOX\n if ( (x - 1 >= 0) && (y - 1 >= 0) && (field [y - 1][x - 1] == BOMB_VALUE) )\n bombsCount += 1;\n\n // UP-MIDDLE BOX\n if ( (y - 1 >= 0) && (field [y - 1][x] == BOMB_VAL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Description The getParentElemId method returns the ELEM ID of the parent. | getParentElemId() {
if (this.isNullOrUndefined(this.parent.getSubviewId)) {
return this.parent.elemId || 0;
}
else {
return this.parent.getSubviewId();
}
} | [
"function findParentByElementId(elementId) {\n return findElementRecursive(elementId, fsStorage[0], null).parent;\n }",
"function getParentQuestionId(){\n\t\treturn parentQuestionId;\n\t}",
"getParent(element) {\n return element.parent;\n }",
"get parentSpanId() {\n if (!this.parent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the first item of the array. | function first(array) {
return array[0];
} | [
"function accessFirstItem(array) {\n return array[0];\n}",
"function Array_first(array) {\n return array[0];\n}",
"function first(array) {\r\n return array[0];\r\n}",
"function getFirstItem(arr) {\n var firstItem = arr[0]\n return firstItem\n}",
"function first(array){\n return array[0];\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of all the properties defined on an object. | function getObjectProps(obj) {
var ret = [];
for (var p in obj) {
ret.push(p);
}
return ret;
} | [
"function getEnumerableProperties(object) {\n\t\t\t\tvar result = [];\n\t\t\t\tfor (var name in object) {\n\t\t\t\t\tresult.push(name);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}",
"function getProperties(obj)\n{\n var props = [];\n var cur = obj;\n var alreadySeen = new Set();\n while (cur && (cur =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make absolute urls from urls with FileLocation + ' in their strings | function makeURLsAbsolute(html){
return html.replace(/FileLocation \+ \'([^\']*)\'/g, FileLocation + '$1');
} | [
"function makeUrl (url) {\n url = url.replace(/\\/$/,'');\n return [ARCHIVE_BASE_URL, '*', url].join('/');\n }",
"function formatFileUrl(pathname) {\n const result = new url.URL(\"file:///\");\n result.pathname = encodeURI(pathname);\n return result;\n}",
"function fromFileUrl(url) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send ajax request to get data from an specific invoice | function requestInvoice(id) {
$.ajax({
type: "POST",
url: "invoice/select",
datatype: "html",
data: {'id': id},
success: function (data) {
// check list
if (data) {
fillFieldsInvoice(data);
}
},
error: functi... | [
"function requestInvoices() {\n $.ajax({\n type: \"POST\",\n url: \"invoices/select\",\n success: function (data, textStatus, xhr) {\n // clear the table body before inserting rows\n clearInvoicesTable();\n // check if returned 204 status code = no invoices f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if matrices A and B can be multiplied and adjusts controls accordingly | function checkMultiplicability() {
var rowsCount = matrixB.rows.length;
var colsCount = matrixA.rows[0].cells.length;
if (rowsCount != colsCount) {
sidebar.classList.add("controls--error");
errMsg.classList.remove("visually-hidden");
calcBtn.setAttribute("disabled", "");
} else {
... | [
"function isMatrixMultiplyValid(A,B)\n{\n var returnVal = false;\n var demA = u.matrix_demension(A);\n var demB = u.matrix_demension(B);\n\n if(demA[1] == demB[0])\n {\n returnVal = true;\n }\n return returnVal;\n}",
"static multiply(A, B) {\n let R = new Matrix3D;\n let ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Quaternions always obey: a^2 + b^2 + c^2 + d^2 = 1.0 If they don't add up to 1.0, dividing by their magnitued will renormalize them. Note: See the following for more information on quaternions: Shoemake, K., Animating rotation with quaternion curves, Computer Graphics 19, No 3 (Proc. SIGGRAPH'85), 245254, 1985. Pletinc... | function
normalize_quat(q)
{
var v = [];
var i, mag;
mag = Math.sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
for (i = 0; i < 4; i++) q[i] /= mag;
v[0] = q[0];
v[1] = q[1];
v[2] = q[2];
v[3] = q[3];
return v;
} | [
"function quaternion_normalize(q) {\n let norm = 0;\n for(let i = 0; i < 4; ++i) norm += q[i] ** 2;\n for(let i = 0; i < 4; ++i) q[i] /= norm;\n\treturn q;\n\n}",
"function quaternion(v0, v1) {\n\n\tif (v0 && v1) {\n\t\t\n\t var w = cross(v0, v1), // vector pendicular to v0 & v1\n\t w_len = Math.sqr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Animates the game at 60 FPS using the requestAnimFrame script. | function animate() {
game.update();
game.draw();
window.requestAnimFrame(animate);
} | [
"function startAnimation() {\n animationLoop = setInterval(render, 1000/60);\n }",
"static setupAnimFrame(): void {\n window.requestAnimFrame = (() =>\n window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plot all the points (P) | function drawPoints(){
for (var i=0; i<p.length; i+=1){
p[i].pplot(1);
}
} | [
"function plotAll() {\n for (var x in data.allPoints) {\n data.allPoints[x].forEach(function(y) {\n plot([x, y]);\n });\n }\n}",
"function plotPoints() {\n\t\t// Go through all wells and create markers for them\n\t\tfor (var i = 0; i < currentWells.length; i++) {\n\t\t\tcreateMarker... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |