query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Set stamina, health and dead flag for winner and loser | function winnerIs(player) {
console.log(player == "player1" ? "Player 1 wins" : "Player 2 wins");
showMessege(player == "player1" ? "#" + player1.short + "-hits" : "#" + player2.short + "-hits");
if(player == "player1") {
setStamina(player1, "player-1-stamina", "add");
setStamina(player2, "player-2-stamina", "su... | [
"stare(victim){\n // In order to have medusa turn people into stone we have a victim that will turn to stone. We are taking the variable of victim and then creating the attribute of stoned which we also defined on the Person file. Since this is taking place within the stare mechanic we treat it as though the act... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Esta es la funcion que se encarga de solicitar los badges obtenidos al API | function get_badgesObtenidos() {
fct_MyLearn_API_Client.query({ type: 'Proyectos', extension1: 'Badges', extension2: $routeParams.IdTrabajo }).$promise.then(function (data) {
$scope.ls_badgesObtenidos = data;
});
} | [
"function get_badgesNoOtorgados() {\n fct_MyLearn_API_Client.query({ type: 'Proyectos', extension1: 'BadgesNoOtorgados', extension2: $routeParams.IdCurso, extension3: $routeParams.IdTrabajo }).$promise.then(function (data) {\n $scope.ls_badgesSA = data;\n });\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepares the endpoint output for one nasdaq value and key | formatResponseObject(nasdaqValue, nasdaqKey) {
return {
'key' : 'key' in nasdaqValue ? nasdaqValue['key'] : '',
'name' : 'name' in nasdaqKey ? nasdaqKey['name'] : '',
'time' : parseInt(nasdaqValue['time_point']) || 0,
'value' : parseFloat(nasdaqValue['value']) || ... | [
"_renderTask() {\n return {\n Resource: (0, task_utils_1.integrationResourceArn)('athena', 'startQueryExecution', this.integrationPattern),\n Parameters: sfn.FieldUtils.renderObject({\n QueryString: this.props.queryString,\n ClientRequestToken: this.props.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function checks the entire board for all possible moves. It takes as inputs the current board and the player (1 or 3) for which we are checking. Returns an array of all possible moves, expressed by a starting and landing index for each move. | function jump_possible(board, player)
{
// initiate array to contain all possible moves
var Moves = [];
// ensure game is not over
if (hasWon(board) != 0)
{
return Moves;
}
// check if player 2
if (player == 2)
{
// treated player incorrectly throughout function, if p... | [
"function getPossibleBoards(board, player)\n{\n // what we'll ultimately return\n var allBoards = [];\n // retrieving move list\n var Moves = jump_possible(board, player);\n for (var i = 0; i < Moves.length; i++)\n {\n // don't want to modify originally passed in board\n var board1=c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the function looks to confirm if the Current Temperature is in Celsius | function confirmUnitC(event) {
let currentTempUnit = document.querySelector("#cur-temp").innerHTML;
let currentUnit = currentTempUnit.slice(-1);
if (currentUnit === "C") {
calculateFahrenheit();
} else {
}
} | [
"function toCelsius () {\n var tempValue = Number(document.getElementById('temperature').value);\n var celsius = Math.round((tempValue-32)*(5/9));\n return celsius;\n}",
"function displayFahrenheitMessage() {\n document.getElementById(\"message1\").innerHTML = \"\";\n\n try {\n var temp = Number(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get table of matches | function getMatchesTable(matches) {
let table = [['Mode'], ['Matches'], ['Wins'], ['Kills'], ['Time']];
let m, w, k, mode, date, diffSecs;
for (let data of matches) {
// Make it plural if not 1
m = data.matches === 1 ? 'match' : 'matches';
w = data.top1 === 1 ? 'win' : 'wins';
k = data.kills === 1... | [
"function drawMatchesTable(result) {\r\n let table = document.getElementById('matched-stats');\r\n let tableBody = document.getElementsByTagName('tbody');\r\n let tr = document.createElement('tr');\r\n tableBody[0].appendChild(tr);\r\n\r\n for (let i = 0; i < result.length; i++) {\r\n /** addi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filters mounts have nothing to cache | _filterMounts(mounts) {
const filteredMounts = ["sys", "html5"];
this._mounts = [];
for (let mount of mounts) {
if (filteredMounts.includes(mount.name)) continue;
this._mounts.push(mount);
}
} | [
"_checkMounts() {\n focalStorage.getItem(\"lively4mounts\").then(\n (mounts) => {\n if (mounts === null) {\n // Warn about missing mounts\n let mountList = this.get(\"#mountList\");\n mountList.innerHTML = \"\";\n let ul = document.createElement(\"ul\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funtion for 2 radio button and one span | function showSpanOnRadio(s1,s2,s3){
var s1 = document.getElementById(s1);
var s2 = document.getElementById(s2);
var s3 = document.getElementById(s3);
var x = s1.checked;
var y = s2.checked;
if(x == true){
s3.style.visibility = 'visible';
}else if(y == true){
s3.style.visibility = 'hidden';
... | [
"function radioWithText(d) {\r\n\r\n document.getElementById('one').style.display = \"none\";\r\n document.getElementById('two').style.display = \"none\";\r\n document.getElementById(d).style.display='inline';\r\n document.getElementById(\"qwe\").reset();\r\n}",
"static set radioButton(value) {}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a custom cls to the owner component | addCss() {
const me = this,
owner = me.owner,
inputEl = owner.getInputEl(),
labelEl = owner.getLabelEl();
owner .addCls(me.ownerCls);
inputEl.cls.push(me.inputCls);
labelEl.cls.push(me.labelCls);
} | [
"function Component() {\n this._m_data = null;\n this._m_refs = null;\n this._m_children = null;\n var ctor = this.constructor;\n this._m_node = document.createElement(ctor.tag);\n this._m_node.classNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return module options as module_arg_spec | function GetModuleArgSpec(model, options, appendMainModuleOptions, mainModule, useSdk) {
var argSpec = GetArgSpecFromOptions(model, options, "", mainModule, useSdk);
if (appendMainModuleOptions) {
argSpec.push(argSpec.pop() + ",");
//if (this.NeedsForceUpdate)
//{
// argSpec.p... | [
"instantiateModule(name, ModClass, options) {\n if (typeof ModClass === 'object') {\n options = _.cloneDeep(ModClass)\n ModClass = Module\n } else if (ModClass === undefined) {\n ModClass = Module\n }\n\n options = options || {}\n\n if (this['$' + name]) {\n throw new Error('Modul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only check for up to 20 seconds, then stop. Checks to see if the overlay exists and removes it if it does | function checkOverlay() {
if (attempts++ > maxAttempts || alreadyRemoved) {
// be nice
clearInterval(overlayCheckId);
return;
}
var overlay = document.getElementById('haasOverlay');
if (overlay && overlay.style.display != 'none') {
removeOverlay();
}
} | [
"function removeLoadingOverlay() {\n if(document.getElementById('overlay') !== null) {\n body.removeChild( document.getElementById('overlay') );\n }\n }",
"function stopTimer () {\r\n\tif (showCardsTime === 5) {\r\n\t\tremoveShow();\r\n\t\tclearInterval(showCardsTimer);\r\n\t}\r\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function to wait until either times up, or until a pass in "funct" returns "true", which ever occured first. funct callback function, to be returned true or false. done an optional callback function for notify when waiting is over. timeout the amount of time in millionsecond to wait. caller string, optional to identi... | function waitToSync(funct, done, timeout, caller) {
//This is a hack synchronize to wait until funct() returns true or timeout becomes < 0.
caller = caller || '';
if ((funct === undefined) || typeof (funct) != 'function') return;
function waiting() {
if (!funct()) {
var dt = new Date();
console... | [
"function waitFor(test, onReady, timeOutMillis, onTimeout) {\n var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 30001, //< Default Max Timeout is 30s\n start = new Date().getTime(),\n condition = false,\n interval = setInterval(\n function() {\n if ( (new Date().getTime() - sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : connSanityData AUTHOR : James Turingan DATE : January 3, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS : | function connSanityData(data){
var connStat='';
var connSanityStat='';
var mydata = data;
if(globalInfoType == "XML"){
var parser = new DOMParser();
var xmlDoc = parser.parseFromString( mydata , "text/xml" );
var row = xmlDoc.getElementsByTagName('MAINCONFIG');
var uptable = xmlDoc.getElementsByTagName('DE... | [
"function connQueryRunSanity(){\n}",
"function accSanityData(data){\n\tvar accStat='';\n\tvar accSanityStat='';\n\tvar mydata = data;\n\tif(globalInfoType == \"XML\"){\n\t\tvar parser = new DOMParser();\n\t\tvar xmlDoc = parser.parseFromString( mydata , \"text/xml\" );\n\t\tvar row = xmlDoc.getElementsByTagName('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================= Get Season Parking Information Based on Postal Code ========================================================= | function getseasonparkinginformation(postalcodeinput)
{
//var getpostalcodefromuser = 310100;
var getpostalcodefromuser = postalcodeinput;
var getseasonparkingoptionfromuser = 0;
var seasonparkingtype;
var seasonparkingbranchoffice;
var seasonparkinggroup;
var seasonparkingcarparkwithingroup... | [
"function displayParkSearchData(item) {\n const campgroundStringArray = [];\n if (item.data.length == 0) {\n campgroundStringArray.push(`<div class=\"expanded-info\"><p class=\"no-info\">This park does not have any campgrounds.</p></div>`);\n } else {\n $.each(item.data, function (itemkey, itemvalue) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 476 Given an array of math expressions, create a function which sorts the array by their answer. It should be sorted in ascending order. | function sortByAnswer(arr) {
return arr.map(x => x.replace("x", "*")).sort((a, b) => eval(a) - eval(b)).map(x => x.replace("*", "x"));
} | [
"order(words){cov_25grm4ggn6.f[7]++;cov_25grm4ggn6.s[40]++;if(!words){cov_25grm4ggn6.b[15][0]++;cov_25grm4ggn6.s[41]++;return[];}else{cov_25grm4ggn6.b[15][1]++;}//ensure we have a list of individual words, not phrases, no punctuation, etc.\nlet list=(cov_25grm4ggn6.s[42]++,words.toString().match(/\\w+/g));cov_25grm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if Point is a counter | static validateIsCounter(binding) {
if (binding.hasOwnProperty('IsCounter')) {
return binding.IsCounter === 'X';
} else {
return binding.MeasuringPoint.IsCounter === 'X';
}
} | [
"function check_point(p) {\n if (p.x < 0 || p.x > 9) {\n return false;\n } else if (p.y < 0 || p.y > 9) {\n return false;\n } else if (spielfeld[p.y][p.x]) {\n //console.log(\"point already in use:\", p);\n return false;\n } else {\n //console.log(\"point ok:\", p);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check type and expected type. throws an error if types isn't matching. | static _type_assert (type, expected_type) {
var _types = { number: 1, string: "s", object: {} };
if ((!_types[expected_type]) && (typeof type != typeof _types[expected_type])) {
throw new Error('Type Error. Expected: ' + typeof _types[expected_type] + ', Received: ' + typeof type + '.');
... | [
"typesMatch(t1, t2) {\n doCheck(\n this.typesAreEquivalent(t1, t2),\n `Type ${util.format(t1)} is not compatible with type ${util.format(t2)}`\n );\n }",
"function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cancel typed keyword and reset to whatever the previous state This operation does not cause new network request. | cancelTypedKeyword() {
this.searchControl.setValue('');
// Auto focus the search input
this.searchControlElem.nativeElement.focus();
} | [
"function cancel() {\n\t\t//i've pressed cancel so don't save changes and tell all clients its open\n\t\t$(document).on('click', '.word-cancel', function () {\n\t\t\tvar id = $(this).data('link_id');\n\t\t\tsocket.emit('cancelword', id);\n\n\t\t\tuiObj.alertsOpen();\n\t\t});\n\n\t\t//response to cancelling the edit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function should be executed every game frame. It will call all of it's movableObjects's frame functions (which will update their physics), and handle any collision that happened. | frame () {
// Call the frame function on all movableEntities
this.movableEntities.forEach(entity => entity.frame());
for (let i = 0; i < this.movableEntities.length; i ++) {
const entity1 = this.movableEntities[i];
for (let j = i + 1; j < this.movableEntities.length; j ++) {
// Verify collision between... | [
"_setupCollision () {\n this.PhysicsManager.getEventHandler().on(this.PhysicsManager.getEngine(), 'collisionStart', (e) => {\n\n for (let pair of e.pairs) {\n let bodyA = pair.bodyA\n let bodyB = pair.bodyB\n\n if (bodyB === this.body) {\n this.onCollisionWith(bodyA)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the file blobs from the input event to the bug's attachments and render the attachment list. | function inputChanged(e) {
var files = e.target.files;
var attachments = [];
for (var i = 0; i < files.length; i++) {
pushAttachment(files.item(i));
}
bugChanged();
} | [
"function setAttachButtonHandler() {\n const attachmentButton = document.getElementById('attachmentButton');\n const attachmentInput = document.getElementById('attachmentInput');\n const attachmentSaveA = document.getElementById('attachmentSaveA');\n const deleteImg = document.getElementById('deleteImg'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if point or box is outside hull | function outsideHull(obj, hull) {
var points = [];
if (obj.hasOwnProperty('min')) {
points = getCorner(obj, 'all');
}
else {
points.push(obj);
}
for (var i = 0; i < points.length; i++) {
//Loop over all the edges of the convex hull, if the point is right of at least one edge its outside the hull
var nLef... | [
"function insideHull(obj, hull) {\n\tvar points = [];\n\tif (obj.hasOwnProperty('min')) {\n\t\tpoints = getCorner(obj, 'all');\n\t}\n\telse {\n\t\tpoints.push(obj);\n\t}\n\n\tvar pointsOnEdge = 0;\n\tfor (var i = 0; i < points.length; i++) {\n\t\t//Loop over all the edges of the convex hull, if the point is left of... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
input is of the form [n, i_1, i_2, ... i_n], where each element contains space separated integers which we want to sum | function sumArray(input) {
var operands = [];
var result = [];
var sum = 0;
for (var i = 1; i < input.length; i++) {
operands = (input[i].split(' '));
sum = parseInt(operands[0]) + parseInt(operands[1]);
result.push(sum);
}
return result;
} | [
"function sumOfSums(inputArray) {\n let listOfNums = inputArray;\n let outputArray = [];\n let arrayOfNums = String(listOfNums).split(',');\n \n // iterate through arrayOfNums and accumulatively add the current number to the previous number\n for (let index = 1; index <= arrayOfNums.length; index += 1) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns off looping for all videos on the page | function disableVideoLoop()
{
var targetNodeList;
// Find lazy load video nodes and update them to turn off auto play and looping
// They are stored as <img> with data tags that get replaced with a <video> tag
//targetNodeList = document.querySelectorAll('div.js_lazy-image > div > i... | [
"function play_stop() {\n if(playing) {\n //video[v_index].play();\n video[v_index].loop();\n } else\n video[v_index].pause();\n\n playing = !playing;\n}",
"function resetPlayed() {\n for (i = 0; i < videoList.length; i++) {\n videoList[i][1] = false;\n }\n}",
"function setLoopProper() {\n\t\ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts that the flying carpet does not appear in the first or last viewport. | assertPosition_() {
const layoutBox = this.element.getLayoutBox();
const viewport = this.getViewport();
const viewportHeight = viewport.getHeight();
// TODO(jridgewell): This should really be the parent scroller, not
// necessarily the root. But, flying carpet only works as a child of the
// roo... | [
"function testNormalElementsAreVisible(item) {\n testElementsVisibility(item, normalElements, true);\n }",
"function assert_element_not_visible(aElt, aWhy) {\n folderDisplayHelper.assert_true(!element_visible(aElt), aWhy);\n}",
"function out_of_screen(){\r\n ax = airplane_pos.worldMatrix[6];\r\n ay =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST add a new app | static add(req, res) {
// Make sure we have everything
if(req.body.name && req.body.assertion_endpoint) {
// Add the application into database
let app = new Application({
userId: req.user._id,
name: req.body.name,
assertionEndpoint:... | [
"function addApplication(admin, app, applicationName) {\n //will find the application with the name in params\n app.db.models.applications.find({\n where: { applicationName: applicationName }\n })\n .then(appToAdd => {admin.addApplications([appToAdd]);})\n .catch(error => res.status(41... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets any pixel channels < 0.3 to 0 blackenLow(img: Image): Image | function blackenLow(img){
const epsilon = 0.002;
function blacken(img, x, y) {
let pixel = img.getPixel(x, y);
if ((pixel[0] - 0.3) < -epsilon) { pixel[0] = 0;}
if ((pixel[1] - 0.3) < -epsilon) { pixel[1] = 0;}
if ((pixel[2] - 0.3) < -epsilon) { pixel[2] = 0;}
return pixel;
}
return imageMap... | [
"function saturateHigh(img) {\n const epsilon = 0.002;\n function saturate(img, x, y) {\n let pixel = img.getPixel(x, y);\n if ((pixel[0] - 0.7) > epsilon) { pixel[0] = 1;}\n if ((pixel[1] - 0.7) > epsilon) { pixel[1] = 1;}\n if ((pixel[2] - 0.7) > epsilon) { pixel[2] = 1;}\n return pixel;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The number of failures detected by the IP re assembly algorithm (for whatever reason: timed out, errors, etc). Note that this is not necessarily a count of discarded IP fragments since some algorithms (notably the algorithm in RFC 815) can lose track of the number of fragments by combining them as they are received. | async getIpReasmFails()
{
return Promise.resolve()
.then(() => getNetSnmpInfo4())
.then((info) => +info.Ip.ReasmFails % COUNTER_WRAP_AT);
} | [
"function diagnosticCount(state) {\n let lint = state.field(lintState, false)\n return lint ? lint.diagnostics.size : 0\n }",
"error() {\n\t\tlet totalError = 0;\n\t\tfor (var j = 0; j < this.neurons.length; j++) {\n\t\t\ttotalError += this.neurons[j].error;\n\t\t}\n\t\treturn totalError;\n\t}",
"a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the gain nodes and the osc nodes objects that need to be played given a custom preset TODO: what about ADSR envelopes!? | function getNodeNamesFromCustomPreset(currPreset){
//console.log(currPreset);
let nodes = [...Object.keys(currPreset)];
let oscNodes = nodes.filter((nodeName) => {
return nodeName.indexOf("Osc") >= 0 || nodeName.indexOf("AudioBuffer") >= 0;
});
let gainNodes = nodes.filter((nodeName) =>... | [
"function collectSND_Preset() {\n collect_bank([88,88],[64,64],[0,25],'snd');\n}",
"function initOscillator(gain){\n\tvar o = context.createOscillator();\n\to.type = \"sine\"; // sine wave by default \n\to.connect(gain); \n\to.start(0);\n\treturn o;\n}",
"function Instrument (options) {\n\tvar i, waveForm, arr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return sun's true longitude in degrees for t | function calcSunTrueLong(t) {
var l0 = calcGeomMeanLongSun(t);
var c = calcSunEqOfCenter(t);
var O = l0 + c;
return O; // in degrees
} | [
"function calcGeomMeanLongSun(t) {\n var L0 = 280.46646 + t * (36000.76983 + 0.0003032 * t);\n while(L0 > 360.0) {\n L0 -= 360.0;\n }\n while(L0 < 0.0) {\n L0 += 360.0;\n }\n return L0; // in degrees\n}",
"function calcSunApparentLong(t) {\n var o = calcSunTrueLong(t);\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a new array of objects, being plots with the greatest value that do not overlap, from given plot array of objects | function getUniquePlots(plots) {
var uniquePlots = [];
for (var i = 0; i < plots.length; i++) {
var ovrlp = false; // gpi = greaterPlotIndex
for (var gpi = i - 1; gpi > -1 && !ovrlp; gpi--)
if (overlap(plots[i], plots[gpi])) ovrlp = true;
if (!ovrlp) uniquePlots.push(plots[i]... | [
"function identify_plots_to_update (i) {\r\n\r\n\t// make a list of plots to update\r\n\tvar plots_to_update = [0, 0, 0];\r\n\tif (link_plots[i] == 0) {\r\n\r\n\t\t// zoomed plot is not linked\r\n\t\tplots_to_update[i] = 1;\r\n\r\n\t} else {\r\n\r\n\t\t// zoomed plot is linked\r\n\t\tplots_to_update = link_plots;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
api_deleteCalendarEvent(token, calEvent) HTTP DELETE deletes the given event from the calendar | function api_deleteCalendarEvent(token, calEvent){
var delURL = "https://www.googleapis.com/";
delURL += "calendar/v3/calendars/primary/events/";
delURL += calEvent.id;
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.open('DELETE', delURL);
xhr.setRequestHeader('Authorization', 'Bearer ' + token)... | [
"deleteEvent (eventId) {\n assert.equal(typeof eventId, 'number', 'eventId must be number')\n return this._apiRequest(`/event/${eventId}`, 'DELETE')\n }",
"async delete ({ params, response }) {\n const event = await Event.find(params.id)\n\n await event.delete()\n\n return response.status(200).js... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
With the index of a field in map.fields open the field | function exposeField(index, map){
// if bomb add bomb img and show
// if number add number
var field = map.fields[index];
if(!field.opened){
$('#'+index).removeClass('closed');
map.fields[index].opened = true;
if(field.mine){
$('#'+index).append("<img src='im... | [
"loadFieldInfo(){\n let fieldInfo = [];\n this.props.orderStore.currentOrder.templateFields.fieldlist.field.forEach(field =>\n this.props.orderStore.fieldInfo.push([field, '']));\n this.props.orderStore.fieldInfo.forEach(field =>\n {\n if(field[0].type == \"SEPARATOR\"){\n field[1] = \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redraw layout menu (Safari bugfix) | _redrawLayoutMenu() {
const layoutMenu = this.getLayoutMenu()
if (layoutMenu && layoutMenu.querySelector('.menu')) {
const inner = layoutMenu.querySelector('.menu-inner')
const { scrollTop } = inner
const pageScrollTop = document.documentElement.scrollTop
layoutMenu.style.display = 'no... | [
"relayoutNavigationElements(){\n\t\treturn;\n\t}",
"function bbedit_components_draw_menu() {}",
"positionMenu_() {\n positionPopupAroundElement(\n this, this.menu, this.anchorType, this.invertLeftRight);\n }",
"function updateMenu() {\n\t//console.log(\"*&*&*&*&*&*&* Updating menu\");\n// pas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purpose: Determine if the General Model a certain tag or tags Args: theseTags an array of tags to check for | function generalHas(theseTags) {
for(var i=0; i < generalTags.length; i++) {
if(theseTags.includes(generalTags[i].name))
return true;
}
return false;
} | [
"function check_tags(requiredTags, meta) {\n if (requiredTags.artist && meta.artist.length < 1)\n return false;\n if (requiredTags.album && !meta.album)\n return false;\n if (requiredTags.title && !meta.title)\n return false;\n if (requiredTags.trackno && !meta.track.hasOwnProperty('no'))\n return f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper for the reselect "createSelector" function. This maintains compatability in that a memoized selector is returned, but adds a $$factory function to the selector that allows further instances to be created. This is used to that, where a selector is used multiple times in the state tree (eg., with arrays of slices... | function createSelector() {
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
var selector = _reselect.createSelector.apply(undefined, args);
selector.$$factory = function () {
return _reselect.createSelector.a... | [
"function selectorFactory(dispatch, mapStateToProps, mapDispatchToProps) {\n //cache the DIRECT INPUT for the selector\n //the store state\n let state\n //the container's own props\n let ownProps\n\n //cache the itermediate results from mapping functions\n //the derived props from the state\n let stateProps... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add link to github and append to topContacts and footer | function displayGithubLink() {
var formattedGithub = HTMLgithub.replace('%data%', bio.contacts.github).replace('#', bio.contacts.githubURL);
$('#topContacts').append(formattedGithub);
$('#footerContacts').append(formattedGithub);
} | [
"function displayWebsiteLink() {\n\t\tvar formattedWebsite = HTMLwebsite.replace('%data%', bio.contacts.website).replace('#', bio.contacts.websiteURL);\n\t\t$('#topContacts').append(formattedWebsite);\n\t\t$('#footerContacts').append(formattedWebsite);\n\t}",
"function repoLink(name) {\n return '<a class=\"rep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: buildNavDiv Description: Create div and add innerHTML content to create links for navigation Input: None Output: 1 div is created and returned | function buildNavDiv()
{
var newDiv = document.createElement("div");
var displayContent = "<nav class='navbar navbar-default navbar-fixed-top'><div class='container'><div class='navbar-header'><button type='button' class='navbar-toggle collapsed' data-toggle='collapse' data-target='#navBarCollapsed' aria-expanded='... | [
"function buildNav() {\n for (section of sections) {\n target = section.id;\n sectionTitle = section.dataset.nav;\n createMenuItem(target, sectionTitle);\n }\n}",
"function add_navigation_bar() {\n\tlet nav=document.createElement('nav');\n\tnav.setAttribute('id','minitoc');\n\tdocument.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
String Function Meet Trainer. | function meetTrainer (id, name ){
var trainerInfo;
trainerInfo == id + "" + name;
return trainerInfo;
} | [
"function greeters(Person) {\n return \"Hello\" + Person;\n}",
"function greeter (name) {\n return \"hoi \" + name + \"!\";\n}",
"function processSentence(nama, age, address, hobby){\n \n return 'Nama saya ' + nama +', umur saya '+ age +' tahun, alamat saya di ' +address +', dan saya punya hobby yaitu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the measured input voltage, in V. | get_inputVoltage()
{
return this.liveFunc._inputVoltage;
} | [
"get_measuredVoltage()\n {\n return this.liveFunc._measuredVoltage;\n }",
"get_voltageSetPoint()\n {\n return this.liveFunc._voltageSetPoint;\n }",
"function circuitPower(voltage, current) {\r\n var Power = voltage * current;\r\n return Power;\t\r\n}",
"getVelocity() {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes x coordinate from stage and returns unitscale global x position | function stageToGlobalX(xCoordIn){
return (xCoordIn-currentZeroX)/(globalScale)
} | [
"function getSceneXCoordinate(x) {\n\treturn x * blockSize + blockSize / 2 - getCityWidth() / 2;\n \n }",
"pos_x() {\n return(this.pos.x);\n }",
"wrapx()\n\t{\n\t\t//if the right hand edge of the sprite is less than the left edge of screen\n\t\t//then position its left edge to the right hand side of... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
star shape function start | function star(x, y, radius1, radius2, npoints) {
let angle = TWO_PI / npoints;
let halfAngle = angle / 2.0;
beginShape();
for (let a = 0; a < TWO_PI; a += angle) {
let sx = x + cos(a) * radius2;
let sy = y + sin(a) * radius2;
vertex(sx, sy);
sx = x + cos(a + halfAngle) * r... | [
"function showStars() {background(\n\t0, 0, 40, sparkle_trail);\n\n\t////moon///\n\tif (started) {\n\t\tfill(255);\n\t\tellipse(100, 100, 150, 150);\n\t\tfill(0, 0, 40);\n\t\tellipse(130, 90, 130, 130);\n\t}////moon///\n\n\tif (!showingStars) {showingStars = true;\n\t\tfor (let i = 0; i < 300; i++) {stars[i] = new ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
work on icalreader1 source display the calendar of the day by hour, like a schedule with the detail of each and the hour in top on the zone1 (main) the content is modified but the logo and the title are the same given the name of the calendar function uses : transform_in_days(tableau) > renderers/utils/calendar.js rend... | function glc_render_ICalReader_for_main_edt_with_detail_hour_top(collection, zone, timeInfo) {
timeInfo = typeof timeInfo !== 'undefined' ? timeInfo : 7;
var logo = '<img src="img/logos/calendar.png"/>';
zone.loadImage("img/logos/calendar.png");
var title = collection.name;
var tableau = collection.... | [
"function buildCalParts() {\n\n calendarBegin = \"\";\n \n // GENERATE WEEKDAY HEADERS FOR THE CALENDAR\n weekdays = createWeekdayList();\n\n // BUILD THE BLANK CELL ROWS\n blankCell = \"<td align=\\\"center\\\" bgcolor=\\\"\" + cellColor + \"\\\"> </td>\";\n\n // BUILD THE TOP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes node configuration keys | removeConfigurationKeys(keys) {
for (const key of keys) {
if (key in this.options.nodeConfiguration) {
delete this.options.nodeConfiguration[key];
}
}
this.configFilePath = path.join(this.options.configDir, 'initial-configuration.json');
fs.writeF... | [
"removeKeys () {\n this._eachPackages(function (_pack) {\n _pack.remove()\n })\n }",
"resetNodeCache() {\n this.configs.clear();\n this.attributes.clear();\n this.children.clear();\n }",
"function removeNode(node, key, index) {\n Array.isArray(node[key])\n ? node[key].splice(index, 1)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: docEdits.sortInserts DESCRIPTION: After the edit nodes have been processed, and their insert position has been set, this function sorts the edit nodes based on this position. ARGUMENTS: none RETURNS: nothing | function docEdits_sortInserts()
{
var i,j,k,a,b,temp;
//shift-sort inserts by insert position
for (i=0; i<docEdits.editList.length-1; i++)
{
for (j=i+1; j<docEdits.editList.length; j++)
{
a = docEdits.editList[i].insertPos;
b = docEdits.editList[j].insertPos;
//if a should insert bef... | [
"function docEdits_sortWeights()\n{\n //var msg=\"presort -------------\\n\";\n //for (i=0; i<docEdits.editList.length; i++) {\n // msg += i+\":\" +docEdits.editList[i].weight+\"=\"+docEdits.editList[i].text+\"\\n\";\n //}\n //alert(msg);\n\n //shift-sort algorithm. Keeps same-weight chunks together\n for (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert six number (05) to rgb number (0255) | function sixToRgb(s) {
return s * 51;
} | [
"function rgbToSix(r) {\n return r / 51;\n}",
"function rgbToCmy(n) {\n return Math.round((rgbInvert(n) / 255) * 100);\n}",
"function convert_RGB(code) {\r\n var round = Math.round, data = /(\\d+),\\s*(\\d+),\\s*(\\d+)|#(\\w{1,2})(\\w{1,2})(\\w{1,2})/.exec(code), result;\r\n // N... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save value to the iframe | function updateIFrame(value) {
iDoc().open();
iDoc().close();
iDoc().location.hash = value;
} | [
"function load_iframe() {\n latest_contents = textarea.val();\n // Change the form's target to point to the iframe, and\n // POST to it by submitting the form:\n form.attr('target', iframe_name)\n .attr('action', preview_url)\n .submit()\n .attr('target',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom type guard for ModelLocation. Returns true if node is instance of ModelLocation. Returns false otherwise. Also returns false for super interfaces of ModelLocation. | function isModelLocation(node) {
return node.kind() == "ModelLocation" && node.RAMLVersion() == "RAML10";
} | [
"isLocation() {\n return this.truthObject.constructor.name == 'Location'\n }",
"isLocation(value) {\n return Path.isPath(value) || Point.isPoint(value) || Range.isRange(value);\n }",
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a script that prints all the numbers from 1 to N, that are not divisible by 3 and 7 at the same time. | function funcNumbers02() {
var numberN = document.getElementById('num02').value;
for (var i = 1; i <= numberN; i++) {
if (i % 3 != 0 || i % 7 != 0) {
console.log(i);
}
}
} | [
"function divisibleBy3And7() {\n 'use strict';\n var resultContainer = document.getElementById('resultContainer'),\n n = getValue('number'),\n resultStr = '';\n\n if (!isNaN(n)) {\n for (var i = 1; i <= n; i++) {\n if (i > 1) {\n if (i % 3 !== 0 || i % 7 !== 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addDef adds an assertion to the model. | addDef(sec, key, value) {
if (value === '') {
return false;
}
const ast = new assertion_1.Assertion();
ast.key = key;
ast.value = value;
if (sec === 'r' || sec === 'p') {
const tokens = value.split(',').map(n => n.trim());
for (let i = ... | [
"addAssertion({ assertion: assertion }) {\n if( this.currentExpressionIsABinaryConnector() ) {\n this.assertionExpression.setRightExpression( assertion )\n\n return\n }\n\n if( this.assertionExpression !== undefined ) {\n this.addAndThenExpression()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Not need to set default operator as there is no operator for contains only set on load if value is not empty | function setOperandOnLoad() {
if (!_.isEmpty(scope.query._value)) {
if (scope.query._value instanceof Object) {
if (scope.operator === '$in' || scope.operator === "$not") {
scope.operand['regex'] = filterRegex(scope.query._value['$regex']);
scope.opera... | [
"isQueryOperator (qs = null) {\n return queryOperators.hasOwnProperty(qs) == true;\n }",
"function add_empty_search_condition () {\n var c = new Condition (default_field, COND_LIKE);\n \n // push and add\n conditions.push (c);\n add_search_condition (c, search_cond_next);\n sea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Comment by Sagar at 26/7/19 6:56 PM Shows Veu template notification | function showVeuNotification(notif_type='pg_new_request',text, placementFrom, placementAlign, timer=2000, notf_target='#', allowDismiss = true,
animateEnter = 'animated fadeInDown', animateExit = 'animated fadeOutUp') {
if (text === null || text === '') { text = 'A notification just ... | [
"notify(){\n new Notification(this.tache, {body:`Commence à ${this.hstart} et finit à ${this.hend}.`, icon:ICON_PATH})\n this.notified = true\n }",
"function show_notification() {\n Log.info('show_notification');\n chrome.storage.sync.get('notifications', function(data) {\n if (data.notifications && d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// Public functions // // /////////////////////////// Increase step count on step init. | function increaseStepCount() {
lx.stepCount++;
} | [
"setStepperStep(state, step){\n\t\t\tVue.set(state, 'stepper_current_step', step);\n\t\t}",
"function initCurStep() {\r\n\r\n // First set the current step number (before we push below, since\r\n // curStepNum starts from 0\r\n //\r\n CurFuncObj.curStepNum = CurFuncObj.allSteps.length;\r\n //\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace URLs with shortened versions if surrounded by S> eslintdisablenextline classmethodsusethis | async urlShorten(s) {
return replaceAsync(
s,
/<S<(.*?)>S>/g,
async (match, name) => this.shortener.getShortlink(name),
)
} | [
"static async UrlShortener() {\n\n }",
"function shortenUrl ( url , length ) {\n\n if( !Ember.isBlank( url ) && url.length > length) {\n url = url.substr( 0 , length ) + \"...\";\n }\n\n return url;\n}",
"function minifyUrl(url) {\n var tinyUrl = '';\n\n console.log({\n c: 'rest_api',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the currency values for the locale | function getLocaleCurrencies(locale) {
var data = findLocaleData(locale);
return data[17 /* Currencies */];
} | [
"function leh_get_currency_list() {\n return JSON.parse(decodeURIComponent(leh_var('currencies')));\n}",
"function getCurrencies () {\n if ( $( \"#currency_eur_to_usd\" ).length != 0 ) {\n $.getJSON('/admin.json?token=get_currencies', function(json){\n $currency_eur_to_usd = json['currency_eur_to_usd']\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a bucket for our project. bucket Name is currently set when function is called | function createBucket(bucketName, _callback){
storage
.createBucket(bucketName, {
location: 'us-central1',
storageClass: 'Regional',
})
.then(results => {
console.log(`Bucket ${bucketName} created`);
_callback(bucketName);
})
.catch(err => {
console.error('ERROR:', ... | [
"static async createBucketIfNotExists(bucketName) {\n var s3 = new AWS.S3();\n try {\n await s3.headBucket({ Bucket: bucketName }).promise();\n } catch (e) {\n if (e.statusCode != 404) throw e;\n // If HTTP status code is 404, S3 bucket does not exist\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BOUNDARY COLLECTION OBJECT ========================== | function BoundaryCollection(points, distanceThreshold) {
var _this = this;
this.distanceThreshold = distanceThreshold;
this.points = points;
this.rays = function () {
var boundaries = [];
for (var i = 0; i < points.length; i++) {
var polygon = points[i];
for (var j = 0; j < polygon.length -... | [
"setBoundingBox() {\n /**\n * Array of `Line` objects defining the boundary of the Drawing<br>\n * - using these in `View.addLine` to determine the end points of {@link Line} in the {@link model}\n * - these lines are not added to the `Model.elements` array\n */\n this.boundaryLines = []\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find specific user by email/password | async findUser(email, password) {
const data = await fetch(`${Settings.remoteURL}/users?email=${email}&password=${password}`)
return await data.json()
} | [
"function matchingID(email, pass) {\n for (let key in users) {\n if ((users[key].password === pass) && (users[key].email === email)) {\n return users[key].id;\n }\n }\n}",
"static findUserByEmail(email, callback) {\n Account.findOne({'email': email}, (err, data) => {\n if(err) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses an image extension from an image name. param image: The image whose name is to be parsed. returns: The image extension (.png, .jpg, etc.). | function GetImageExtension(image) {
var partsOfImageName = image.name.split(".");
var extension = (partsOfImageName.length > 1) ? partsOfImageName[partsOfImageName.length - 1] : "jpg";
return extension;
} | [
"function getExt(filename) {\n if (!filename) return \"\";\n var parts = filename.split(\".\");\n if (parts.length === 1 || (parts[0] === \"\" && parts.length === 2)) return \"\";\n return parts.pop().toLowerCase();\n }",
"function productNameFromImagePath(imagePath) {\n\t// This is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function handles showing the input box for a user to edit a burger | function editBurger() {
var currentBurger = $(this).data("burger");
$(this).children().hide();
$(this).children("input.edit").val(currentBurger.text);
$(this).children("input.edit").show();
$(this).children("input.edit").focus();
} | [
"function finishEdit(event) {\n var updatedBurger = $(this).data(\"burger\");\n if (event.which === 13) {\n updatedBurger.text = $(this).children(\"input\").val().trim();\n $(this).blur();\n updateBurger(updatedBurger);\n }\n }",
"function cancelEdit() {\n var currentBurger = $(this).d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deactivate the label for the cover photo. | function deactivateLabelCoverPhoto() {
if (labelCoverPhoto != null) {
labelCoverPhoto.classList.remove("active");
}
} | [
"function activateLabelCoverPhoto() {\n if (labelCoverPhoto != null) {\n labelCoverPhoto.classList.add(\"active\");\n }\n}",
"deselectAnnotation() {\n if (this.activeAnnotation) {\n this.activeAnnotation.setControlPointsVisibility(false);\n this.activeAnnotation = false;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stream that emits whenever the hovered dropdown item changes. | hovered() {
const itemChanges = this.directDescendantItems.changes;
return itemChanges.pipe(startWith(this.directDescendantItems), switchMap((items) => merge(...items.map((item) => item.hovered))));
} | [
"onListItemMouseEnter() {\n // update the state\n this.setState({\n hover: true\n });\n }",
"onListItemMouseLeave() {\n // update the state\n this.setState({\n hover: false\n })\n }",
"setHoverMode() {\n this.hoverMode = !this.items.some(item => item.$toggle && item.$toggle.is('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a template with the given parameters, and then reply the given message with the resulting content | renderAndReply(originalMessage, templateName, params = null) {
var content = "";
this.mu.compileAndRender(templateName, params)
.on('data', function (data) {
content += data.toString();
})
.on('end', () => {
originalMessage.reply(content);
});
... | [
"function showTemplate(template, data){\r\n\tvar html = template(data);\r\n\t$('#content').html(html);\r\n}",
"function sendGenericMessage(recipientId,senderId,elements){var messageData={recipient:{id:recipientId},message:{attachment:{type:\"template\",payload:{template_type:\"generic\",elements:elements}}}};retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function For Flag and Hand Buttons | function flagActive(){
let flagBtns = document.querySelectorAll('.flag_btn');
let handBtns = document.querySelectorAll('.hand_btn');
flagBtns.forEach(flagbtn => {
flagbtn.addEventListener('click', (e) => {
let currentRow = e.currentTarget.parentElement.parentElement;
if(currentRow.classList.contai... | [
"function flags(evt) {\n //disable default right click menu to show up\n evt.preventDefault()\n if (evt.target.classList.contains('active')) {\n return;\n }\n if (flagged) {\n evt.target.style.background = \"rgb(67, 206, 199)\"\n flagged = false\n } else {\n flagged = t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mobile menu: move the seach form into mainnav (when it becomes the mobile menu) and move it back when switching to desktop (works only on browsers with media queries) | function moveSearchForm(mq) {
var searchForm;
if (mq.matches) {
// move search form back into tools menu
searchForm = $('#main-nav .search-form').detach();
$('.heading-first .tools').append(searchForm);
}
else {
... | [
"function hideNavOnScrollMobile() {\n nav.style.top = window.pageYOffset > 200 ? \"-6em\" : \"2em\";\n}",
"function mobileNav() {\n\n $('<select />', {\n \"id\": \"mobile-nav\"\n }).prependTo('#type-select');\n\n $('span.chart-type a').each(function() {\n var $el = $(this);\n $('<option /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions that animate the title and lines. | function titleLoad() {
$("#title")
.hide()
.slideDown(750)
.animate(
{ opacity: 1 },
{ queue: false, duration: 'slow' }
)
lineLoad();
} | [
"animate () {\n if (this.multiStep) this.animateSteps()\n this.animateDraws()\n }",
"function drawTitle() {\n\n\t\t// title line 1\n\t\tsvg.append(\"text\")\n\t\t\t.attr(\"id\", \"titleLine1\")\n\t\t\t.attr(\"x\", width / 2)\n\t\t\t.attr(\"y\", 0 - margin.top / 2)\n\t\t\t.attr(\"text-anchor\", \"middle\")\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new ``uint240`` type for %%v%%. | static uint240(v) { return n(v, 240); } | [
"static uint120(v) { return n(v, 120); }",
"static uint248(v) { return n(v, 248); }",
"static uint160(v) { return n(v, 160); }",
"static uint216(v) { return n(v, 216); }",
"static uint(v) { return n(v, 256); }",
"static uint24(v) { return n(v, 24); }",
"static uint168(v) { return n(v, 168); }",
"stati... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fumction to create Deaths list | function createDeathlist(deaths) {
let outputString = document.createElement("div");
outputString.setAttribute("class", "death-info");
outputString.innerHTML = `<h3>${deaths.death}</h3>
<hr>
<p><span>Cause :</span> ${deaths.cause}</p>
<p><span>Responsible :</span> ${deat... | [
"function creatingList(list) {\n let tournaments = []\n list.forEach(element => {\n let tourney = new Event(element)\n if(tourney.game == 'dragon ball fighterz' || tourney.game == 'street fighter v arcade edition 1' || tourney.game == 'tekken 7'){\n tournaments.push(tourney)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search for file IDs. | function searchFileId(searchText) {
if (searchText in cache.indexes) {
return cache.content.files[cache.indexes[searchText]];
}
return false;
} | [
"function scanFiles(){\n\tlet fileList = new Array();\n\n\tfor(let file of trackedFiles.values()){\n\t\tfileList.push(file);\n\t}\n\n\t$('#dev-scan-files-loading-modal').modal({closable: false}).modal('show');\n\tipcRenderer.send('dev-scan-files:find-difference', fileList);\n}",
"getFiles(id) {\r\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse an inline template binding. ie `">` | parseInlineTemplateBinding(tplKey, tplValue, sourceSpan, absoluteOffset, targetMatchableAttrs, targetProps, targetVars) {
const bindings = this._parseTemplateBindings(tplKey, tplValue, sourceSpan);
for (let i = 0; i < bindings.length; i++) {
const binding = bindings[i];
if (bindi... | [
"function InlineParser() {\n this.preEmphasis = \" \\t\\\\('\\\"\";\n this.postEmphasis = \"- \\t.,:!?;'\\\"\\\\)\";\n this.borderForbidden = \" \\t\\r\\n,\\\"'\";\n this.bodyRegexp = \"[\\\\s\\\\S]*?\";\n this.markers = \"*/_=~+\";\n\n this.emphasisPattern = this.buildEmphasis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set coordinates in fileds | function setCoordinatesFiled(lat, lng) {
$locationCoords[0].value = lat;
$locationCoords[1].value = lng;
} | [
"updateAttributes(newCoords, newDims) {\n let newX, newY, newW, newH;\n if (newCoords) {\n newX = newCoords[0];\n newY = newCoords[1];\n this.setCoordinates(newX, newY);\n }\n if (newDims) {\n newW = newDims[0];\n newH = newDims[1];\n this.setDimensions(newW, newH);\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
8 Create a function called muti2 that take two parameter and will return the multiplication from the first number to the second number Ex: muti2(4, 5); => 4 5 => 20 Ex: muti2(3, 6); => 3 4 5 6 => 360 | function muti2( num,num2)
{
if(num>num2)
{
return " you have to but the smaller number first ";
}
if(num == num2)
{
return num2;
}
return num*muti2(num+1,num2);
} | [
"function calculateMultiply(num1, num2){\n \n return num1 * num2 \n}",
"function multiplicacion(a, b) {\n //tu codigo debajo\n let resultado = a * b;\n return resultado;\n}",
"function multiplizieren(a,b) {\r\n return a * b ;\r\n}",
"function multiplyBy2(item) {\n console.log(item * 2);\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete the element from the canvas and jsPlumbInstance | function deleteElementFromCanvas(element, savingModel) {
$timeout(function() {
vm.clickedComponent = {};
jsPlumbInstance.remove(element);
if (savingModel) {
saveModel().then(function(response) {
vm.processing.message = element.data("name") + " deleted";
... | [
"destroyElement() {\n if (this.dom) {\n this.dom.remove();\n }\n }",
"delete() {\n\t\t// Remove all edge relate to vertex\n\t\tthis.vertexMgmt.edgeMgmt.removeAllEdgeConnectToVertex(this)\n\n\t\t// Remove from DOM\n\t\td3.select(`#${this.id}`).remove()\n\t\t// Remove from data container... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the mimetype of the notebook. | _updateMimetype() {
var _a;
const info = (_a = this._model) === null || _a === void 0 ? void 0 : _a.metadata.get('language_info');
if (!info) {
return;
}
this._mimetype = this._mimetypeService.getMimeTypeByLanguage(info);
each(this.widgets, widget => {
... | [
"set contentType(aValue) {\n this._logService.debug(\"gsDiggThumbnailDTO.contentType[set]\");\n this._contentType = aValue;\n }",
"function NotebookRenderer(model, rendermime) {\n _super.call(this);\n this._model = null;\n this._rendermime = null;\n this._mimetype = 'text/plain'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extension to enable bracketclosing behavior. When a closeable / bracket is typed, its closing bracket is immediately inserted / after the cursor. When closing a bracket directly in front of that / closing bracket, the cursor moves over the existing bracket. | function closeBrackets() {
return EditorView.inputHandler.of(handleInput);
} | [
"function findBracket(lexer, matched) {\n if (!matched) {\n return null;\n }\n matched = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_1__[\"fixCase\"](lexer, matched);\n var brackets = lexer.brackets;\n for (var i = 0; i < brackets.length; i++) {\n var bracket = brackets[i];\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
monitorSupportsOutputValues returns a promise that when resolved tells you if the resource monitor we are connected to is able to support output values across its RPC interface. When it does, we marshal outputs in a special way. | function monitorSupportsOutputValues() {
return __awaiter(this, void 0, void 0, function* () {
return monitorSupportsFeature("outputValues");
});
} | [
"function registerResourceOutputs(res, outputs) {\n // Now run the operation. Note that we explicitly do not serialize output registration with\n // respect to other resource operations, as outputs may depend on properties of other resources\n // that will not resolve until later turns. This would create a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ENDOF PAGE SEAMLESS TRANSTION FUCNTIONS | / | Playlist jQuery methods and AJAX call functions createPlaylist() creates a new playlist by displaying popup to prompt for playlist name | function createPlaylist() {
var popup = prompt("Please enter the name of your playlist");
if(popup != null) {
$.post("includes/handlers/ajax/createPlaylist.php", { name: popup, username: userLoggedIn })
.done(function(error) {
if(error != "") {
alert(error);
return;
}
openPage("your-music.ph... | [
"function pollPlaylist()\n{\n\tvar xhttp = new XMLHttpRequest();\n\txhttp.onreadystatechange = function()\n\t{\n\t\tif ((this.readyState === 4) && (this.status === 200))\n\t\t{\n\t\t\tvar resp\n\t\t\ttry\n\t\t\t{\n\t\t\t\tresp = JSON.parse(this.responseText);\n\t\t\t}\n\t\t\tcatch (err)\n\t\t\t{\n\t\t\t\tconsole.lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This directive allows us to use the review form template | function review() {
return {
templateUrl: '/views/components/review/review.tpl.html',
controller: reviewController,
controllerAs: 'review'
};
} | [
"function createReviewHTML(review) {\n const li = document.createElement('li');\n const name = document.createElement('p');\n name.innerHTML = review.name;\n li.appendChild(name);\n\n // const date = document.createElement('p');\n // date.innerHTML = review.date;\n // li.appendChild(date);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start the robot simulation. Read sensor data and calculate the path. | async startRobotSimulation() {
this.status = true;
// send initial data to the user interface
this.#updateUI();
// make initial path
this.path.calculatePath(this.map, this.sim_manager.getPosition(), this.sim_manager.getDirection());
let currentPosition, nextPosition, currentDirection,
positioning, haz... | [
"function robot_rrt_planner_init() {\n\n // form configuration from base location and joint angles\n q_start_config = [\n robot.origin.xyz[0],\n robot.origin.xyz[1],\n robot.origin.xyz[2],\n robot.origin.rpy[0],\n robot.origin.rpy[1],\n robot.origin.rpy[2]\n ];\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare two rail type names or rail userfriendly names so they are sorted in R,A,I,L order. Capitalization is ignore. Non rail names are sorted lexicographically after rail names. | function railCompare(name1, name2) {
var i1 = RAIL_ORDER.indexOf(name1.toUpperCase());
var i2 = RAIL_ORDER.indexOf(name2.toUpperCase());
if (i1 == -1 && i2 == -1)
return name1.localeCompare(name2);
if (i1 == -1)
return 1; // i2 is a RAIL name but not i1.
if (i2 == -1)
return -1; ... | [
"function typeComparator(auto1, auto2) {\n // converting to lowercase to avoid case sensitivity\n var t1 = auto1.type.toLowerCase();\n var t2 = auto2.type.toLowerCase();\n // first case is equal models that must resort to yr comparison\n if (t1 == t2) {\n if (auto1.year > auto2.year) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserlock_mode. | visitLock_mode(ctx) {
return this.visitChildren(ctx);
} | [
"visitLock_table_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitUser_lock_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
size of the deck tends to be referenced a lot, so this is a getter for that | get size(){
return this.cards.length;
} | [
"function get_item_size() {\n var sz = 220;\n return sz;\n}",
"get tileSize() {}",
"getSize() {\n return this.queue.length;\n }",
"get capacity() {\n return this.getNumberAttribute('capacity');\n }",
"function getDependencySize(dependencyDump) {\n var numeric = dependencyDump.nu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add new directory to the tree | addToTree({ state, commit, getters }, { parentPath, newDirectory }) {
// If this directory is not the root directory
if (parentPath) {
// find parent directory index
const parentDirectoryIndex = getters.findDirectoryIndex(parentPath);
if (parentDirectoryIndex !== -1)... | [
"function insertNode(currentPath, remainingPath, parent, firstLevel) {\n var remainingDirectories = remainingPath.split('/');\n var nodeName = remainingDirectories[0];\n var newPath = firstLevel ? nodeName : (currentPath + '/' + nodeName);\n // console.log('=== inserting: '+ nodeName);\n if (remainin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an alternate angular so that subsequent call to angular.module will queue up the module created for later processing via the .processQueue method. This delaying processing is needed as angular does not recognize any newly created module after angular.bootstrap has ran. The only way to add new objects to angular ... | function setAlternateAngular() {
var alternateModules = {};
// This method cannot be called more than once
if (alt_angular) {
throw Error( "setAlternateAngular can only be called once." );
} else {
alt_angular = {};
}
// Make sure that bootstrap has been called
checkAngularAMDInitialized();
// ... | [
"function setAlternateAngular() {\n // This method cannot be called more than once\n if (alt_angular) {\n throw Error(\"setAlternateAngular can only be called once.\");\n } else {\n alt_angular = {};\n }\n\n // Make sure that bootstrap has been called\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cancel the long touch timer if any | __cancelLongTouch() {
if (this.data.longtouchTimeout) {
clearTimeout(this.data.longtouchTimeout);
this.data.longtouchTimeout = null;
}
} | [
"__cancelTwoFingersOverlay() {\n if (this.config.touchmoveTwoFingers) {\n if (this.data.twofingersTimeout) {\n clearTimeout(this.data.twofingersTimeout);\n this.data.twofingersTimeout = null;\n }\n this.viewer.overlay.hide(IDS.TWO_FINGERS);\n }\n }",
"cancel(__p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the column for a given variable | function getColumnForVariable (columns, variableNT) {
for (const predicateUri in columns) {
const column = columns[predicateUri]
if (column.variable.toNT() === variableNT) {
return column
}
}
throw new Error(`getColumnForVariable: no column for variable ${variableNT}`)
// retur... | [
"function getCol(id) {\n\treturn /spot\\d(\\d)/.exec(id)[1];\n }",
"function findSpotForCol(x) {\n const y = board.findIndex((row) => row[x] === null)\n return y !== -1 ? y : null; \n}",
"function col(numCol) {\n return numCol * COL + COL_OFFSET;\n}",
"function COLUMN(value) {\n\n // Return `#VALUE!`... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iteratively assign the breadth (xposition) for each node. Nodes are assigned the maximum breadth of incoming neighbors plus one; nodes with no incoming links are assigned breadth zero, while nodes with no outgoing links are assigned the maximum breadth. | function computeNodeBreadths() {
var remainingNodes = nodes,
nextNodes,
x = 0;
while (remainingNodes.length) {
nextNodes = [];
remainingNodes.forEach(function(node) {
... | [
"traverseBreadth(){\n let queue = new Queue();\n let arr = [];\n let current = this.root;\n\n queue.enqueue( current );\n\n while( queue.size > 0 ){\n\n current = queue.dequeue().val;\n arr.push( current.value );\n\n if( current.left !== null ) que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When a user runs `git cz`, prompter will be executed. We pass you cz, which currently is just an instance of inquirer.js. Using this you can ask questions and get answers. The commit callback should be executed when you're ready to send back a commit template to git. By default, we'll deindent your commit template and ... | prompter(cz, commit) {
// console.log('\nLine 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.\n');
console.log(
'\n1行目は100文字で切り取られ、超過分は次行以降に記載されます。\n'
);
// Let's ask some questions of the user
// so that we can populate our commit
... | [
"function prompter(cz, commit) {\n // Let's ask some questions of the user\n // so that we can populate our commit\n // template.\n //\n // See inquirer.js docs for specifics.\n // You can also opt to use another input\n // collection library if you prefer.\n inquirer\n .prompt([\n {\n type: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
speed.addEventListener('mousemove', moveSpeed); functions run function if mousedown | function selectBar(e){
this.addEventListener('mousemove', moveSpeed);
} | [
"function mouseDown(e) {\n // Here we changing isMoving from false to true, and depicting that now we are moving the mouse over the wheel\n setMoving(true);\n }",
"move() {\n // Derive mouse vertical direction.\n let touchYPosition = touches.length > 0 ? touches[touches.length - 1].y : this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the cached pages and reloads data from dataprovider when needed. | clearCache() {
if (!this.dataProvider) {
return;
}
this._pendingRequests = {};
const filteredItems = [];
for (let i = 0; i < (this.size || 0); i++) {
filteredItems.push(this.__placeHolder);
}
this.filteredItems = filteredItems;
if (this._shouldFetchData())... | [
"function clearHomepage() {\n //TODO Change the homepage from empty context to user defined\n data.getPage(space.homepage.id, function (response) {\n let oldPage = JSON.parse(response);\n\n let updatePage = {\n version: {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deletes the parent node (li) | function deleteListItem(){
this.parentNode.remove();
} | [
"function deleteListItem()\n{\n\t// Selects button's parent node, the li\n\tvar liItem = event.target.parentNode;\n\t// Selects the li's parent node, the ul\n\tvar liParent = liItem.parentNode;\n\t// Removed the ul's child node, the li\n\tliParent.removeChild(liItem);\n}",
"function deleteHistory(event){\n eve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions to display pages index.html body.onload = display_index_page() | function display_index_page() {
} | [
"async function main() {\n\t// Have to wait for this to finish since commonMain loads the STORE and we need it to populate the page\n\tawait commonMain();\n\n\tSTORE.entriesPerPage = ENTRIES_PER_PAGE;\n\tSTORE.pagePrefix = 'projects';\n\tSTORE.displayed = [];\n\tSTORE.projects.forEach( p => p.id = cuid() );\n\n\t$(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used to hide the popup question window doneText: string, text to show in place of the question when hiding the window type: string, default '', 'hide' to use this function to hide the popup box and not display animations | function hidePopUp(doneText = "Done!", type = '')
{
if (type == 'hide')
{
$("#timerStopPageOverlay > .popUpContainer").removeClass("showPopUp");
setTimeout(function() {
$("#timerStopPageOverlay").removeClass("timerStopQuestion");
}, 1000);
... | [
"function hideCreateDialog() {\n if (document.getElementById('editID').value != '-1') {\n $('#rfelement' + document.getElementById('editID').value).show();\n document.getElementById('editID').value = '-1';\n }\n $('#textarea_preview').hide();\n $('#singlechoice_preview').hide();\n $('#m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new AbstractSetRemovalTimeDto. | constructor() {
AbstractSetRemovalTimeDto.initialize(this);
} | [
"constructor(title,days,time,duration,relative_time,relative_to,till,relative_to_till)\r\n {\r\n this.m_start = '' //moment object for start time\r\n this.title = title;\r\n this.days = days;\r\n this.time = time;\r\n this.duration = duration;\r\n this.relative_time = re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert URLs to clickable links. URLs to handle: magnet:?xt.1=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C&xt.2=urn:sha1:TXGCZQTH26NL6OUQAJJPFALHG2LTGBC7 | function urls2links(element) {
var re = /((http|https|ftp):\/\/[\w?=&.\/-;#@~%+-]+(?![\w\s?&.\/;#~%"=-]*>))/ig;
element.html(element.html().replace(re,'<a href="$1" rel="nofollow">$1</a>'));
var re = /((magnet):[\w?=&.\/-;#@~%+-]+)/ig;
element.html(element.html().replace(re,'<a href="$1">$1</a>'));
} | [
"function ConvertUrlToAnchor(s) {\n var description = s;\n var whitespace = \" \";\n var anchortext = \"\";\n var words;\n var splitList = [whitespace, '\\n', '\\r\\n'];\n words = splitString(description, splitList);\n \n var regexp = /^((https?|ftp):\\/\\/|(www|ftp)\\.)[a-z0-9-]+(\\.[a-z0-9... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====== updateDefender() ====== / Description: This updates the defebder object and element based on the users selection. It also tuns off the ability for the Player to pick more that one defender. | function updateDefender(){
// Update the remaining characters to be enemies
$(".character").each(function(index, value){
// Clear their click events
$(value).off();
// Add the enemy class.
$(value).addClass("enemies");
// Append to the enemies div
$("#enemies").append($(".enemies"));
});
// A... | [
"function setDefenderStats(defenderId){\n switch(defenderId) {\n case \"mario\":\n return {\n health: mario.health,\n counter: mario.counter,\n damage: mario.damage\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines whether a url is requesting a search. | function isSearch(url)
{
if(url.indexOf("search?") >= 0) return(true)
return(false);
} | [
"function checkURL()\n{\n if (/\\bfull\\b/.test(location.search)) toggleMode();\n if (/\\bstatic\\b/.test(location.search)) interactive = false;\n}",
"function findURL (url)\n{\n\tvar stringURL = url;\n\tvar urlPosition; \n\tvar isURL;\n\t\n\t//get index of http should start at 0\n\turlPosition = stringURL.inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates the node looking for aliases, callbacks and literals. | function validateTypeAliases(node, isTopLevel, compositionType) {
if (isCallback(node)) {
if (allowCallbacks === 'never') {
context.report(getMessage(node, compositionType, isTopLevel, 'callbacks'));
}
}
else if (isLiteral(node)) {
... | [
"function initHardcodedValidators() {\n // MemverExpression.property can either be an expression or an identifier\n // This depends on the context and is not visible in NODE_FIELDS\n // So we hardcode it for now\n lpe_babel.types.NODE_FIELDS.MemberExpression.property.validate.oneOfNodeTypes = [\n \"Expressio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion which catches and send to parse the link of the first result of a search. Unused due to some problems. | function get_first_result(msg, destiny, sender_function)
{
var dest = destiny;
var flag=0;
console.log(dest + ' destino');
var options = {
url: 'http://www.metacritic.com/search/movie/' + dest + '/results',
headers: {
'User-Agent': 'request'
},
enconding: 'ascii'
... | [
"function parseLink( rawLink ) {\n if ( rawLink && rawLink.length ) {\n rawLink = rawLink[ 0 ];\n return {\n phrase: rawLink.match( urlPhraseRegex )[ 2 ],\n url: rawLink.match( urlLinkRegex )[ 2 ]\n };\n }\n\n return null;\n }",
"function parseLink(response... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle all LTR/RTL markers for tweet features | function setMarkers (plainText) {
var matchedRtlChars = plainText.match(rtlChar);
var text = plainText;
if (matchedRtlChars || originalDir === "rtl") {
text = replaceIndices(text, twttr.txt.extractEntitiesWithIndices, function (itemObj) {
if (itemObj.entityType === "screenName") {
... | [
"function applyLatinLigatures() {\n\t var this$1 = this;\n\n\t var script = 'latn';\n\t if (!this.featuresTags.hasOwnProperty(script)) { return; }\n\t var tags = this.featuresTags[script];\n\t if (tags.indexOf('liga') === -1) { return; }\n\t checkGlyphIndexStatus.call(this);\n\t var ranges = th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pops up an Open File dialog with the given options. After the user selects files / folders, shows the Create Torrent page. | function showOpenSeed (opts) {
setTitle(opts.title)
const selectedPaths = dialog.showOpenDialogSync(windows.main.win, opts)
resetTitle()
if (!Array.isArray(selectedPaths)) return
windows.main.dispatch('showCreateTorrent', selectedPaths)
} | [
"function openTorrentFile () {\n if (!windows.main.win) return\n log('openTorrentFile')\n const opts = {\n title: 'Select a .torrent file.',\n filters: [{ name: 'Torrent Files', extensions: ['torrent'] }],\n properties: ['openFile', 'multiSelections']\n }\n setTitle(opts.title)\n const selectedPaths ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |