query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Registering the HTTP context | $registerHTTPContext() {
this.$container.bind('Adonis/Core/HttpContext', () => HttpContext_1.HttpContext);
} | [
"static async insertContext(req, res) {\n const contextDomain = new ContextDomain();\n contextDomain.insertContext(req, res);\n }",
"register() {\n this._container.instance('expressApp', require('express')())\n\n //TODO: add Socket.io here @url https://trello.com/c/KFCXzYom/71-socketio-adapter\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display Email Contact on Click | function emailFunction() {
var x = document.getElementById("contactMe");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
} | [
"function showContactInfo() {\n x$(\"#contact_name\")\n .html(contact.name.formatted || contact.displayName || \"Unknown Contact\");\n \n // display first email found\n if (contact.emails && contact.emails.length > 0) {\n x$(\"#contact_email\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the destination entity for a relationship. | getDestinationEntity () {
const definition = this.definition;
const entity = this.getEntity();
const objectGraph = entity.getObjectGraph();
return objectGraph.getEntitiesByName()[definition.entityName];
} | [
"oneRelation(destinationReference, options={}) {\n return this._relationalSet.resolveRelationProxy(\n OneSideRelationProxy, destinationReference, options\n );\n }",
"function resolveHasOneMetadata(relationMeta) {\n if (!type_resolver_1.isTypeResolver(relationMeta.target)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reduces the size of all mini containers (won't affect plot visual if only called once) LEGACY FUNCTION, NO LONGER USED | function reduceMiniSize() {
var plotContainers = document.getElementsByClassName("svg-container");
var dim = getContainerDim(1, plotContainers);
if (!miniReduced) {
for (var i = 1; i < plotContainers.length; i++) {
plotContainers[i].style.cssText = "position: relative; width: " + dim[0] * config.reduc... | [
"function resizedw(){\n resizegraph();\n plotWithOptions(wg(formatedData), options);\n}",
"function newGrid (newSize) {\n $('.row').remove();\n createGrid(newSize);\n // $('.column').outerHeight(oldSize*oldPixel/newSize);\n // $('.column').outerWidth(oldSize*oldPixel/newSize);\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the players in a game (lobby) | function getLobbyPlayers(lobby) {
return players.filter(player => player.lobby === lobby);
} | [
"function getAllPlayers() {\n var players = [];\n\n Object.keys(io.sockets.connected).forEach(function(socketId) {\n var player = io.sockets.connected[socketId].player;\n\n if (player) {\n players.push(player);\n }\n });\n\n return players;\n}",
"function getGame(lobby) {\n return games.find(ga... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns HTML string w/ onclick functions for dimension names used for a grid. Note that an index name is for a dimension, and they appear in the dimension order. | function getIndNames4Step(sO) {
var inames = "";
for (var d=0; d < sO.dimNameExprs.length; d++) { // for all dimensions
var cl = " class='indexName' "; // class name for index
//var onC = " onclick=\"addIndNameExpr(" + d + ")\" ";
//var onC = " onclick=\"indVarClic... | [
"function editIndNameExprs(dim) {\r\n\r\n var sO = CurStepObj;\r\n\r\n // STEP\r\n // Redraw code window without any focused box or any active\r\n // expression/space. This is important for the user so that the user\r\n // knows expression boxes are not where the input goes. \r\n // We redraw with... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The event handler that executes the steps to fetch and display student data | async function DisplayStudentData() {
let responseText = null;
let parsedData = null;
// Clear any table data
ClearAllChildElements(StudentCards);
// Clear any errors
StudentNotification.innerHTML = "";
// If no path is entered, do nothing
if (StudentFilePath.value === ""... | [
"readStudentData(){\r\n let url=\"https://maeyler.github.io/JS/data/Students.txt\";\r\n fetch(url)\r\n .then(res => res.text())\r\n .then(res => this.addStudentsToMap(res,this.students));\r\n }",
"function SBR_display_student() {\n //console.log(\"===== SBR_display_st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if a contract is undefined throws error if so | checkContract() {
if (!isDef(this.contract)) {
throw new Error('Contract not defined. It was probably never deployed');
}
} | [
"function isContractPayable(definition) {\n let fallback = definition.nodes.find(node => node.nodeType === \"FunctionDefinition\" &&\n functionKind(node) === \"fallback\");\n if (!fallback) {\n return false;\n }\n return mutability(fallback) === \"payable\";\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the `offset` for a line and columnbased `position` in the bound indices. | function positionToOffset(position) {
var line = position && position.line
var column = position && position.column
if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {
return (indices[line - 2] || 0) + column - 1 || 0
}
return -1
} | [
"function positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the update recorder for a given source file or resolved template. | getUpdateRecorder(filePath) {
throw new Error('MigrationRule#getUpdateRecorder is not implemented.');
} | [
"function getSource() {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const source = (urlParams.get(\"source\"));\n return source;\n}",
"getTrackedElement(key) {\n const memberRevision = this.getSourceMembers()[key];\n if (memberRev... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets category id by removing 'cat' before. | function getCategoryId(id) {
return id.replace(/^cat-/, '');
} | [
"function extract(url) {\n var index = url.lastIndexOf(\"category\");\n var cat = '';\n for(index+=9;index < url.length && url[index] != '/';index++) {\n cat += url[index];\n }\n return cat;\n }",
"function getSegmentId(category){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Repeatedly calls `f` at an interval defined by the modelSampleRate property, until f returns true. (This is the same signature as d3.timer.) If modelSampleRate === 'default', try to run at the "requestAnimationFrame rate" (i.e., using d3.timer(), after running f, also request to run f at the next animation frame) If mo... | function timer(f) {
var intervalID,
// When target support properties and it defines
// 'modelSampleRate', it will be used.
sampleRate = propertySupport && propertySupport.properties.modelSampleRate || 'default';
if (sampleRate === 'default') {
// use requestAnimationFrame via d3.timer
... | [
"set PreserveSampleRate(value) {}",
"set OptimizeSampleRate(value) {}",
"function loop(){\n requestAnimationFrame(loop);\n //Get waveform values in order to draw it.\n var waveformValues = waveform.analyse();\n drawWaveform(waveformValues);\n }",
"function setIntervalReal() {\r\n intervalR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wrap dialog and return content panel. | function wrapDialog(target) {
var t = $(target);
t.wrapInner('<div class="dialog-content"></div>');
var contentPanel = t.find('>div.dialog-content');
contentPanel.css('padding', t.css('padding'));
t.css('padding', 0);
new TaPanel(contentPanel).ta3panel({
border: false
});
return contentPa... | [
"function wrapDialog(target){ \n\t\tvar t = $(target); \n\t\tt.wrapInner('<div class=\"dialog-content\"></div>'); \n\t\tvar contentPanel = t.find('>div.dialog-content'); \n\t\t \n\t\tcontentPanel.css('padding', t.css('padding')); \n\t\tt.css('padding', 0); \n\t\t \n\t\tcontentPanel.panel({ \n\t\t\tborder:false \n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change text for single product add to cart button | function changeAddToCartText() {
$( document ).on( 'hide_variation', '.variations_form', function() {
$( 'button.wc-variation-selection-needed' ).text( WoonderShopVars.texts.select_an_option );
} );
$( document ).on( 'show_variation', '.variations_form', function() {
$( 'button.single_add_to_cart_button' ).text... | [
"function handleAddToCartPress() {\n productID = $(this).attr(\"product-id\");\n console.log(\"cart item id: \" + productID);\n\n productName = $(this).attr(\"name-id\");\n console.log(\"cart product name: \" + productName);\n $(\"#productSelected\").text(productName);\n\n productPrice1 = $(this).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies the class 'amplitudeactivesongcontainer' to the element containing visual information regarding the active song. TODO: Make sure that when shuffling, this changes accordingly. | function privateSetActiveContainer(){
var songContainers = document.getElementsByClassName('amplitude-song-container');
/*
Removes all of the active song containrs.
*/
for( i = 0; i < songContainers.length; i++ ){
songContainers[i].classList.remove('amplitude-active-song-container');
}
/*
Finds t... | [
"function privateDisplaySongMetadata(){\n\t\t/*\n\t\t\tSets all elements that will contain the active song's name metadata\n\t\t*/\n\t\tif( document.querySelectorAll('[amplitude-song-info=\"name\"]') ){\n\t\t\tvar metaNames = document.querySelectorAll('[amplitude-song-info=\"name\"]');\n\t\t\tfor( i = 0; i < metaNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls the on('connection) and on('error') methods of Peerjs | componentDidMount() {
this.props.localPeer.on('connection', (conn) => {
conn.on('open', () => {
this.receiveConnection(conn); // handles the connection from another peer
});
});
this.props.localPeer.on('error', (err) => {
this.set... | [
"assignCallbacks() {\n this.namespace.on('connection', (socket) => {\n this.onWhisper(socket);\n });\n }",
"initializeOnConnection() {\n this.webSocketServer.on('connection', (clientWebSocket) => {\n let client = this.getClient(clientWebSocket);\n this.init... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function draws the second bar chart. It's called when the grow() effect of the first bar chart completes. | function draw2() {
state.bar2 = new RGraph.Bar({
id: "cvs",
data: data[3],
options: {
// Stipulate 3d but no 3D axes
variant: "3d",
variantThreedYaxis: false,
variantThreedXaxis: false,
colorsStroke: "rgba(0,0,0,0)",
colors: [colors[3]],
// No background grid or... | [
"function drawUpdateBar(){\n\t\t\td3.select(\"#bar-cover #bar-chart\").selectAll(\"svg\").remove();\n\t\t\tdrawBar();\n\t\t}",
"function draw_barchart(caso) {\n\n //'Migration Flow' mode\n if (caso==\"splom\") {\n d3.select(\"#chart-container\").selectAll(\".chartjs-size-monitor\").remove();\n d3.select(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init player 1 punishment for step by step movement | function initp1punishment () {
if (oldPlayer1loc > player1loc) {
let curLocationX = waypointArray[oldPlayer1loc][0] - 42;
let curLocationY = waypointArray[oldPlayer1loc][1] - 123;
oldPlayer1loc = oldPlayer1loc - 1;
let newLocationX = waypo... | [
"function initp2punishment () {\r\n if (oldPlayer2loc > player2loc) {\r\n let curLocationX = waypointArray[oldPlayer2loc][0] - 42;\r\n let curLocationY = waypointArray[oldPlayer2loc][1] - 123;\r\n oldPlayer2loc = oldPlayer2loc - 1;\r\n let newLo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This functions parses through the geoName results to find cities in the country | function processResults(geoNamesResponse){
const cities = {capital: null, secondCity: null, thirdCity: null};
for (const location of geoNamesResponse){
if (location.fclName == 'city, village,...' && location.fcodeName == 'capital of a political entity'){
cities.capital = location.name.spl... | [
"async getCities(country) {\n // get yesterday's date\n const offset = new Date().getTimezoneOffset() * 60000;\n const yesterday = new Date(Date.now() - 86400000 - offset)\n .toISOString()\n .slice(0, -5);\n\n // complete request\n const query = `?country=${country}¶meter=pm25&date_from... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set decrementing timer to refresh leaderboard | function decrementLeaderboardTimer(){
GAME.masterLeaders(currLeaderboardVersion);
leaderboardDecrementor = leaderboardDecrementor + 1000;
// console.log("leaderboardDecrementor = " + leaderboardDecrementor);
setTimeout(function(){
decrementLeaderboardTimer();
},leaderboardDecrementor);
} | [
"function time() {\n timer = 63;\n timerId = setInterval(decrement, 1000);\n}",
"reset () {\n this.total = this.seconds * 1000.0;\n this._remaining = this.total;\n this._clearInterval();\n this.tick();\n }",
"function resetBoard() {\n clearInterval(interval);\n timer.innerHTML = '0 mins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for a given select list, returns the selected item's value | function getSelected(selectList){
var selectedItem;
var selLength = selectList.length;
for(i=0;i<selLength; ++i)
{
if(selectList.options[i].selected)
{
selectedItem = selectList.options[i].value;
break;
}
}
return selectedItem;
} | [
"function getValue(comboid) {\n return $('#' + comboid + ' option:selected').val();\n}",
"get select_value() {\n return (this.select == undefined) ? this.select_config.default : this.select.selectedOption;\n }",
"function getParcoursLabel(){\n return $(parcours_filter+\" option:selected\").html();\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
output the customer printout window | function customer_printout()
{
alert('This feature has been temporarily disabled.');
/*
if (trade_itemIDs.length) { open_window('/admin/pos/custprintout.php','custprint',725,500,'YES',true); }
else { alert('There are no trade items on this invoice.'); }
*/
} | [
"function PrintPage() {\n\t\t var windowName = \"PrintPage\";\n\t\t var wOption \t= \"width=1000,height=600,menubar=yes,scrollbars=yes,location=no,left=100,top=100\";\n\t\t var cloneTable \t= $(\"#viewTable\").clone();\n\t\t cloneTable.find('input[type=text],select,textarea').each(function(){\n\t\t\tvar elementType... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is called every time a word was successfully spelled. Updates user progress | async onWordCompletion () {
let { username, progress, currentAssignment, currentAssignmentIndex, currentWordIndex } = this.state
let didUpdate = true
// need to check if user is on an old letter, dont change progress if they are
if (currentAssignmentIndex === progress.currentAssignmentIndex && currentW... | [
"showWordProgress() {\n console.log(`The word now looks like this: ${this.currWord}`)\n }",
"function userRevealedWord() {\n level++;\n console.log('\\nCongratulations! Loading next level...');\n setTimeout(() => restartGame(), 2000);\n }",
"async onLetterCompletion () {\n let { u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper methods / Perform a linear interpolation between two "Points" | function linear_interpolate(x, x0, x1, y0, y1){
return y0 + ((y1 - y0)*((x-x0) / (x1-x0)));
} | [
"function lerp(x1,y1,x2,y2,y3) {\n\treturn ((y2-y3) * x1 + (y3-y1) * x2)/(y2-y1);\n}",
"function interpolate(x, xl, xh, yl, yh) {\n var r = 0;\n if ( x >= xh ) {\n r = yh;\n } else if ( x <= xl ) {\n r = yl;\n } else if ( (xh - xl) < 1.0E-8 ) {\n r = yl+(yh-yl)*((x-xl)/1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for a given submission link, store all found data in an object (game, subdomain, section, subsection, ID) | function getSubmissionLinkDetails(submissionLink) {
// recognized link examples:
// tf2.gamebanana.com/maps/187142 (submission, 3 parts after split)
// tf2.gamebanana.com/maps/flags/187142 (submission subsection, 4 parts after split)
// gamebanana.com/posts/7201865, gamebanana.com/members/37 (post/member, 3 parts a... | [
"function buildMatchData(submissionNodesIndexIndex, submissionNodes, matchEdges) {\n\n var currentIndex = 0;\n\n for (var matchIndex in matches) {\n if (matches.hasOwnProperty(matchIndex)) {\n\n var match = matches[matchIndex];\n\n // Get the indices the submission ids\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find empty menu's items and set them height accordingly to height of icon | function initMenuEmptyHeight(){
ResponsiveHelper.addRange({
'1024..': {
// on: function() {
// jQuery(document).ready(function(){
// jQuery('#nav .empty-description').each(function(){
// var heightImg = jQuery(this).find('i').height();
// var strong = jQuery(this).find('strong');
// str... | [
"function initializeMegaMenuHeight(currentStatus){\n currentStatus.heights=[]\n max=0;\n //console.log(\"before : \"+currentStatus.heights);\n $(\".data-depth-0>li.selected\").children(\".ul-reset\").each(function() {\n if(max<$(this).find(\".ul-reset\").height()){\n max = $(this).find(\".ul-reset\").heigh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `userDefined`. Returns true if `data` is an instance of `prototype`, false otherwise. Assumes `prototype` is a userdefined object and additionally checks the value of constructor.name. | function userDefined (data, prototype) {
try {
return instance(data, prototype) ||
data.constructor.name === prototype.name;
} catch (error) {
return false;
}
} | [
"static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === UserGroup.__pulumiType;\n }",
"static isDefined(input) {\n return typeof (input) !== 'undefined';\n }",
"static isInstance(obj) {\n if (ob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fn: [eqMaps?] in file: stdlib.ky, line: 1704 | function eqMaps_QMRK_(m1, m2) {
let ok_QMRK_ = true;
if( (m1.size == m2.size) ) {
if (true) {
m1.forEach(function(v, k) {
return ((!eq_QMRK_(m2.get(k), v)) ?
(ok_QMRK_ = false) :
null);
});
}
}
return ok_QMRK_;
} | [
"function ExprFindMapping(lhs, rhs, lhsFreeVars) {\r\n\t// getBoundVar, given a list of {lhs:'a', rhs:'a'} objects\r\n\t// and a variable, finds it on the lhs, and returns the\r\n\t// rhs if available.\r\n\tfunction getBoundVar(boundVars, lhs) {\r\n\t\tfor (var i = 0; i < boundVars.length; i++)\r\n\t\t\tif(boundVar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add solution here Create a function `theBeatlesPlay`, which accepts two parameters an array of musicians and an array of instruments. | function theBeatlesPlay(musicians, instruments) {
//create an empty array stored in a variable
var emptyArray = [];
// create for loop which loops over the array of musicians. set counter/i to 0(first index)
for (var i = 0; i <= musicians.length - 1; i++) {
emptyArray.push(`${musicians[i]} plays ${instrumen... | [
"function theBeatlesPlay(musiciansArr, instrumentsArr) {\n \n var musiciansAndInstruments = [];\n \n for (let i = 0; i < musiciansArr.length; i += 1) {\n \n var str = `${musiciansArr[i]} plays ${instrumentsArr[i]}`;\n musiciansAndInstruments = musiciansAndInstruments.concat(str);\n \n }\n \n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shared uiview code for both directives: Given scope, element, and its attributes, return the view's name | function getUiViewName(scope, attrs, element, $interpolate) {
var name = $interpolate(attrs.uiView || attrs.name || '')(scope);
var inherited = element.inheritedData('$uiView');
return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));
} | [
"function getUiViewName(attrs, inherited) {\n\t\t\tvar name = attrs.uiView || attrs.name || '';\n\t\t\treturn name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n\t\t}",
"function normalize(name) { // @param String: attr name, \"for\"\r\n // @return S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the tabs scrollers to show or not, dependent on the tabs count and width | function setScrollers(container) {
var header = $('>div.tabs-header', container);
var tabsWidth = 0;
$('ul.tabs li', header).each(function () {
tabsWidth += $(this).outerWidth(true);
});
if (tabsWidth > header.width()) {
$('.tabs-scroller-left', header).css('display', 'block');
$('.tabs-scroller-rig... | [
"function setScrollers(container) { \n\t\tvar header = $('>div.tabs-header', container); \n\t\tvar tabsWidth = 0; \n\t\t$('ul.tabs li', header).each(function(){ \n\t\t\ttabsWidth += $(this).outerWidth(true); \n\t\t}); \n\t\t \n\t\tif (tabsWidth > header.width()) { \n\t\t\t$('.tabs-scroller-left', header).css('displ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make animal function using object shorthand and computed property names | function makeAnimal(species,verb,sound) {
let animal = {
species,
[verb](){
return sound;
}
}
return animal;
} | [
"function createAnimal(species, noiseVerb, noiseNoun){\n return{\n species,\n [noiseVerb](){\n return `The ${[species]} says ${[noiseNoun]}.`\n }\n }\n }",
"function findAnimalInfo(obj){\n \nfor (let i = 0; i < animals.length; i++){\nconsole.log(obj[i])\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The scene's assistant class. | function GameScreenAssistant() { } | [
"giveAI() {\n\n this.isAI = true;\n\n this.AIcontroller = new AIController(this);\n\n\n }",
"function QuestBoard_Scene () {\n this.initialize.apply (this, arguments);\n }",
"function Scene_BattleTS() {\n this.initialize.apply(this, arguments);\n}",
"function SceneNode() {}",
"function sc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle visible block depend H.264 | function toggleH264VisibleBlocks() {
var switcher = checkH264();
if (switcher) {
$("#video-themes-coming-soon-note").css('display', 'none');
$("#video-themes-coming-soon-block").css('display', 'block');
}
else {
$("#video-themes-coming-soon-note").css('display', 'block');
... | [
"function toggleToCompBoard(evt) {\n gameBoard1.style.display = \"none\";\n gameBoard2.style.display = \"\";\n compHeader.style.display = \"\";\n playerHeader.style.display = \"none\";\n}",
"function _toggleVisibility() {\n\n\t\tvisible = !visible;\n\n\t\tif (true === visible) {\n\t\t\tpanel.show();\n\t\t\t$(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create auto complete entry click handler. | function handleAutoCompleteEntryClick(tag) {
// Get all tag entries
const tags = ref.current.value.split(/\s/);
// Set the input text to the clicked tag name.
ref.current.value = [
// Get the text content of the input, excluding the last word.
...tags.slice(0, -1),
// Append the tag name to the list of... | [
"function suggestionClickListener() {\n $('li.tax-suggestion').click(function (e) {\n // Stop propagation so that this does not count as a body click (and thereby remove the list).\n //e.stopPropagation();\n $(this).parent().children().removeClass('selected');... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hacky way of stripping out import statements from the excerpt TODO: Find a better way to do so, possibly by compiling the Markdown content, stripping out HTML tags and obtaining the first line. | function createExcerpt(fileString) {
const fileLines = fileString
.trimLeft()
// Remove Markdown alternate title
.replace(/^[^\n]*\n[=]+/g, '')
.split('\n');
/* eslint-disable no-continue */
// eslint-disable-next-line no-restricted-syntax
for (const fileLine of fileLines... | [
"function stripLessJS(contents) {\n\treturn contents.replace(/<script.*?\\bless\\b[^\"']*?\\.js.*?<\\/script>/g, \"\");\n}",
"function getCodeSnippets(mdContent) {\n return mdContent.replace(/\\r?\\n|\\r/, '').replace(/```[a-zA-Z]+|```/g, '').trim();\n}",
"function stripLessRel(contents) {\n\treturn contents... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
curry4 :: ((a, b, c, d) > e) > (a > b > c > d > e) | function curry4 (f) {
function curried (a, b, c, d) { // eslint-disable-line complexity
switch (arguments.length) {
case 0: return curried
case 1: return curry3(function (b, c, d) { return f(a, b, c, d); })
case 2: return curry2(function (c, d) { return f(a, b, c, d); })
case 3: return fun... | [
"function curry3$3(f) {\n function curried(a, b, c) {\n // eslint-disable-line complexity\n switch (arguments.length) {\n case 0:\n return curried;\n case 1:\n return curry2$3(function (b, c) {\n return f(a, b, c);\n });\n case 2:\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : checkIpEnable AUTHOR : Krisfen G. Ducao DATE : March 07, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS : | function checkIpEnable(val){
if (val!="") {
$("#newdevusername").removeAttr('disabled');
$("#newdevpassword").removeAttr('disabled');
$("#newdevmanageinterface").removeAttr('disabled');
$("#newdevportcheckbox").removeAttr('disabled');
$("#newdevportaddress").removeAttr('disabled');
}else{
$("#newdevuser... | [
"function isIpBlocked( )\n{\n //global config;\n result = false;\n ipaddress = _SERVER.REMOTE_ADDR; \n //foreach (config.BLOCKED_IPS as ip)\n //{\n // if (preg_match( \"/\"+ip+\"/\", ipaddress ))\n // {\n // error( \"Your ip address has been blocked from making changes!\" );\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main entry point Program : StatementList ; | Program() {
return factory.Program(this.StatementList());
} | [
"function parse_StatementList(){\n\t\n\n\t\n\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\n\tif (tempDesc == ' print' || tempType == 'identifier' || tempType == 'type' || tempDesc == ' while' || tempDesc == ' if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that the browser is on the accepted list of browsers; if not redirects to a "unsupportedbrowser" page | function checkBrowser() {
const browser = bowser.getParser(window.navigator.userAgent);
const isValidBrowser = browser.satisfies({
"edge": ">86.0",
"chrome": ">86.0",
"firefox": ">78.0",
"safari": ">14"
});
if (!isValidBrowser) window.location.replace('unsupported-browse... | [
"function checkBrowser(){\n\tvar browserInfo = navigator.userAgent;\n\tif(browserInfo.indexOf(\"Firefox\")!=-1)userBrowser=\"Firefox\";\n\tif(browserInfo.indexOf(\"Chrome\")!=-1)userBrowser=\"Chrome\";\n\tif(browserInfo.indexOf(\"Safari\")!=-1)userBrowser=\"Safari\";\n}",
"function verificarBrowser(){\n // Ver... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle state input change | function handleStateInput(){
$('#state-input').change(function(e){
var selectedState = $(this).find('option:selected').val();
setState({
STATE: selectedState
})
handleSubmit()
})
} | [
"function updateState(e){\r\n for (var i = 0; i < currentState.transitions.length; i++) {\r\n if (currentState.transitions[i].input == e.type){\r\n //based on input type and current state, do appropriate action\r\n currentState.transitions[i].action(e, elem);\r\n nextState... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the cart icon in the top right. Calculates total items based on numbers product list at the bottom of the page. | function updateCartItems(){
var totalItems = 0;
var productTotal = 0;
$('.numbers :input').each(function(){
productTotal += getPrice($(this).attr('id'),parseInt($(this).val(), 10));
totalItems += parseInt($(this).val(), 10);
});
$('#total').html('$' + productTotal.toFixed(2));
$('#cart').html('<img src="image... | [
"function updateCartQuantity() {\n let sum = null;\n for (let i = 0; i < order.length; i++) {\n sum += order[i].quantity;\n }\n cartCount = sum;\n $('#cartCount')\n .text(cartCount);\n orderSubTotal();\n }",
"function computeAndAppendTotalCartCostComponentToShoppingCart() {\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process HTTP request sent to server. We only respond to 2 HTTP requests: 1. /json/version returns Chrome debugger protocol version that we use 2. /json and /json/list returns list of page descriptions (list of inspectable apps). This list is combined from all the connected devices. | processRequest(
request: IncomingMessage,
response: ServerResponse,
next: (?Error) => mixed,
) {
if (
request.url === PAGES_LIST_JSON_URL ||
request.url === PAGES_LIST_JSON_URL_2
) {
// Build list of pages from all devices.
let result: Array<PageDescription> = [];
Arr... | [
"function handleGetRequest(request, response) {\n var queryParamObject = url.parse(request.url, true).query;\n var type = queryParamObject.type;\n\n switch (type) {\n case \"getStatus\":\n getStatus(queryParamObject, response);\n break;\n\n // Used when user's hifi client up... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redelegate illiquid tokens from one validator to another | redelegate(validatorSrcAddr, validatorDstAddr, amount, baseTx) {
return __awaiter(this, void 0, void 0, function* () {
const delegatorAddr = this.client.keys.show(baseTx.from);
const msgs = [
{
type: types.TxType.MsgBeginRedelegate,
... | [
"function validateTokens() {\n\t$('#inputValidate').on('keyup', function (event) {\n\t\tvar symbol = $(this).val();\n\n\t\tif (event.keyCode == 8) {\n\t\t\tif (symbol.length == 0) {\n\t\t\t\tresetValidate();\n\t\t\t} else {\n\t\t\t\tbacktrack(symbol);\n\t\t\t}\n\t\t} else {\n\t\t\tif (symbol.length == 0) {\n\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ensures that nick is present and has the given public key (buffer or base64 string) | function ensureNick(nick, pubkey, cb) {
if (!_.isString(nick) || (~nick.indexOf('::'))) return cb(new TypeError('invalid nick'));
if (_.isString(pubkey)) pubkey = new Buffer(pubkey, 'base64');
if (!(pubkey instanceof Buffer)) return cb(new TypeError('pubkey not a buffer'));
if (pubkey.length !== 32) return cb... | [
"validPublicKey(publicKey){}",
"function getPubkey(callback) {\n sbot.whoami(function(err, msg) {\n if(err) { \n console.log('getPubkey(callback) err', err, '\\n\\n\\n\\n')\n return callback(err)\n } else {\n console.log('getPubkey(callback) msg', msg, '\\n\\n\\n\\n')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A utility function that checks if a given element has already an event handler registered for an event with a specified name. The TView.cleanup data structure is used to find out which events are registered for a given element. | function findExistingListener(tView, lView, eventName, tNodeIdx) {
var tCleanup = tView.cleanup;
if (tCleanup != null) {
for (var i = 0; i < tCleanup.length - 1; i += 2) {
var cleanupEventName = tCleanup[i];
if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIdx) {
... | [
"function hasEvent(event, entry){\n return entry.events.indexOf(event) != -1;\n}",
"function hasEvent(eventsNames, oneEvent){\n\t\t for (var i=0; i<eventsNames.length; i++) {\n\t\t if ( eventsNames[i] == oneEvent ) {\n\t\t return true;\n\t\t }\n\t\t }\n\t\t return false;\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing RelationshipLink resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, opts) {
return new RelationshipLink(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"static get(name, id, state, opts) {\n return new ServiceLinkedRole(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) {\n return new EipAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(nam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getPendingReadings Get the Pending Readings from the user's object. | getPendingReadings(orgId, userId) {
return __awaiter(this, void 0, void 0, function* () {
return this.userDoc(orgId, userId).collection('pendingReadings').get()
.then((sn) => {
const readings = [];
//TODO: not sure if deser will work
sn... | [
"function getReadings(token) {\n\t\tvar readingsURL = \"https://api.readmill.com/v2/users/\"+userObj.id+\"/readings?states=reading,finished,abandoned&access_token=\"+token;\n\t\t$.getJSON( 'functions.php', { url: readingsURL, apiRequest: true, clientId: true }, function(data) {\n\t\t\t\treadingsObj = data.requested... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Patch remove(). On Safari 11, if you call remove() to remove the content up to a keyframe, Safari will also remove the keyframe and all of the data up to the next one. For example, if the keyframes are at 0s, 5s, and 10s, and you tried to remove 0s5s, it would instead remove 0s10s. Offsetting the end of the range seems... | static patchRemovalRange_() {
// eslint-disable-next-line no-restricted-syntax
const originalRemove = SourceBuffer.prototype.remove;
// eslint-disable-next-line no-restricted-syntax
SourceBuffer.prototype.remove = function(startTime, endTime) {
// eslint-disable-next-line no-restricted-syntax
... | [
"_clearRocketAnimation() {\n this._rocket._tl.clear();\n this.removeChild(this._rocket);\n }",
"remove (data, size = data.length) {\n if (!this.bfCntr)\n throw new Error(\"remove: removing elements requires counters\")\n for (let i = 0; i < this.nHashes; i++) {\n const i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : ipv4PopUp AUTHOR : James Turingan DATE : January 2, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : PARAMETERS : | function ipv4PopUp(){
if((globalIPV4Flag == false && globalApplyAll == "deactive") || globalApplyAll == "deactive" ){
return false
}
$.mobile.changePage($("#applyAllPop"),{
transition: "pop",
changeHash : false
});
} | [
"function ipFormat(current) {\n //var name=arguments[1]?arguments[1]:'';\n if(!current.ip) {\n current.ip = 'unknown';\n }\n var name = (typeof(arguments[1]) == \"undefined\") ? '' : ' (' + arguments[1] + ')';\n\n var httpStatus = (typeof(arguments[1]) == \"undefined\") ? '' :' / <a onclick=\"remo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LSTATUS RegCreateKeyW( HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult ); LSTATUS RegCreateKeyExW( HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, const LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition ); | function instrumentRegCreateKey(opts) {
if(opts.ex) {
var pRegCreateKey = opts.unicode ? Module.findExportByName(null, "RegCreateKeyExW")
: Module.findExportByName(null, "RegCreateKeyExA");
} else {
var pRegCreateKey = opts.unicode ? Module.findExportByName(null, "RegCr... | [
"function KeyCreateFolder(evt)\r\n{\r\n var nKeyCode;\r\n nKeyCode = GetKeyCode(evt);\r\n switch (nKeyCode)\r\n {\r\n case 13: //enter\r\n CreateFolder();\r\n break;\r\n default:\r\n //do nothing\r\n break;\r\n }\r\n}",
"function instrumentRegO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display advertise images on the slider | function display_advertise_images() {
} | [
"addNewImageToSlider(idx) {\n let addedImagedata = this.images[idx];\n let slide = '<div class=\"swiper-slide\"><img src=\"' +\n addedImagedata +\n '\" alt=\"Image\"/></div>';\n this.mySwiper.appendSlide(slide);\n }",
"function laadAfbeeldingen() {\n var html = '';... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listings organized by date | function setListings (listings, date) {
// has settings changed?
var listingsObj = {};
listingsObj[date] = listings;
// Check if listing's date has been stored
return this.listings = listingsObj;
} | [
"groupByDate(listOfPRs){\n\t\t// group by date\n\t\tlet groupedPRs = {}\n\t\tfor (let i = 0; i < listOfPRs.length; i++){\n\t\t\t// get date to set as key (need to convert into a readable string first)\n\t\t\tlet dateStr = new Date(listOfPRs[i].merged_time).toDateString();\n\t\t\tif (dateStr in groupedPRs){\n\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function deletes the previous grid | function delete_prev_grid() {
var table = document.getElementById("pixel_canvas");
var rowCount = table.rows.length;
while (table.rows.length > 0) {
table.deleteRow(0);
}
} | [
"deleteGrid() {\n this.gridArray.length = 0; // deleting the grid array\n let child = this.gridDOM.lastElementChild;\n\n // deleting all the squares from the grid\n while(child) {\n this.gridDOM.removeChild(child);\n child = this.gridDOM.lastElementChild;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete card by userId cardId | deleteCardByUserIdWalletId(userId, walletId) {
return http.delete(`/wallet/${userId}/${walletId}`);
} | [
"function deleteIDCard(req, res, next) {\n if (!req.decoded) {\n return next(new errs.ForbiddenError('Current user does not have access to the requested resource.'));\n }\n\n if (req.decoded.userId !== req.params.userId) {\n return next(new errs.ForbiddenError('Current user does not have access to the requ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines whether the passed item is of function type. | function isFunction(item) {
if (typeof item === 'function') {
return true;
}
var type = Object.prototype.toString(item);
return type === '[object Function]' || type === '[object GeneratorFunction]';
} | [
"function ISFUNCTION(value) {\n return value && Object.prototype.toString.call(value) == '[object Function]';\n}",
"function getType(item) {\n console.log(item + ' is a ' + typeof(item));\n}",
"function isCallback(node) {\n return node && node.type === typescript_estree_1.AST_NODE_TYPES.TSFunctionT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the first text node in the specified node | function findFirstTextNode(node) {
var walker;
if (node) {
walker = new TreeWalker(node, node);
for (node = walker.current(); node; node = walker.next()) {
if (node.nodeType === 3) {
return node;
}
}
}
} | [
"function findFirstTextNode(element, startIndex) {\n var index = null;\n startIndex = startIndex || 0;\n\n if (startIndex < textNodes.length) {\n for (var i = startIndex; i < textNodes.length; i++) {\n if ($.contains(element, textNodes[i])) {\n index = i;\n break;\n }\n }\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `function`. Returns true if `data` is a function, false otherwise. | function isFunction (data) {
return typeof data === 'function';
} | [
"function ISFUNCTION(value) {\n return value && Object.prototype.toString.call(value) == '[object Function]';\n}",
"function isValidFunctionExpression(node) {\n if (node && node.type === 'FunctionExpression' && node.body) {\n return true;\n }\n return false;\n}",
"function isCallback(node) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function looks through line l in the poem and counts how many words are replaceable in it... | function countReplaceableWordsInLine(l) {
var poemTerms = myString.match(regex); // join the poem then find curly-bracket-wrapped terms
return poemTerms.length;
} | [
"function countWords(paragraph, love, you) {\n\t// split the string by spaces in a\n\tlet a = paragraph.split(\" \");\n\n\t// search for pattern in a\n\tlet countlove = 0;\n let countyou = 0;\n\tfor (let i = 0; i < a.length; i++) {\n\t // if match found increase count\n\t if (a[i].includes(love))\n\t\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
private _name: string; private age: number; private breed: string; /question marks make the parameter optional: each parameter to the right of the question mark must ALSO be optional. giving an access modifier in the constructor's parameters declares the field FOR YOU and then sets the field equal to the argument we us... | constructor(_name, age, breed) {
this._name = _name;
this.age = age;
this.breed = breed;
/* this._name=_name;
this.age=age;
this.breed=breed; */
} | [
"constructor(id, name, price, wheels, doors, hasAc, owner, academy) {\n super(id, name, price, wheels, doors, hasAc);\n // setting value in constructor to private field (not recomended to set value send from outside to private field)\n // if(academy) this.#academy = academy;\n this._owne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the innerHTML value of button clicked and assign to userChoice | function getUserChoice(){
answer1.onclick = function(){userChoice = answer1.innerHTML};
answer2.onclick = function(){userChoice = answer2.innerHTML};
answer3.onclick = function(){userChoice = answer3.innerHTML};
answer4.onclick = function(){userChoice = answer4.innerHTML};
return userChoice;
} | [
"function btnChoice(e) {\n\tplayer.choice = e.target.id\n\tdisplayResults()\n}",
"function onPrompt(results) {\n\t\talert(\"You selected button number \" + results.buttonIndex + \" and entered \" + results.input1);\n\t}",
"function pressTheButton() {\n\tvalue = this.value;\n\tplayerInput(value);\n\tcpuInput();\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Index Route returns a response containing all packages | function indexRoute(req, res, next) {
Package
.find()
.then(packages => res.json(packages))
.catch(next)
} | [
"indexAction(req, res) {\n this.jsonResponse(res, 200, { 'message': 'Default API route!' });\n }",
"indexAction(req, res) {\n Robot.find((err, robots) => {\n if (err)\n this.jsonResponse(res, 400, { 'error': err });\n\n this.jsonResponse(res, 200, { 'robots': ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the filters will be used for routing the buildings to different layer | function initializeLayerFilters() {
for (var catogary in json) {
for (var type in json[catogary]) {
var models = json[catogary][type].model;
if (json[catogary][type].placement == 'base') {
for (var i = 0; i < models.length; i++) {
baseFilter.push(... | [
"apply_filters() {\n return this.data\n .filter(d => this.selected_towns[d.town])\n .filter(d => this.selected_categories[d.object_category])\n .filter(d => d.date_full >= this.selected_start && d.date_full <= this.selected_end);\n }",
"function applyFilterLayer() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle sentrycli configuration errors when the user has not done it not to break the build. | errorHandler(err, invokeErr) {
const message = err.message && err.message.toLowerCase() || '';
if (message.includes('organization slug is required') || message.includes('project slug is required')) {
// eslint-disable-next-line no-console
console.log('Sentry [Info]: N... | [
"validateServerlessConfigDependency(command) {\n if ('configDependent' in command && command.configDependent) {\n if (!this.serverlessConfigFile) {\n const msg = [\n 'This command can only be run in a Serverless service directory. ',\n \"Make sure to reference a valid config file in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eliminar un conjunto de matriz de decuentos seleccionadas | function accionEliminar() {
var arr = new Array();
arr = listado1.codSeleccionados();
eliminarFilas(arr,"DTOEliminarMatricesDescuento", mipgndo, 'resultadoOperacionMsgPersonalizado(datos)');
} | [
"function removeSelectVertices(uid_set) {\n uid_set.forEach((uid) => {\n const p = selected_indexes.indexOf(uid);\n if (p >= 0) {\n selected_indexes.splice(p, 1);\n }\n });\n }",
"function deleteMatrixRowOption(id) {\n $('#matrix_row_' + id).remo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert Yubico response body to params dictionary. | function bodyToParams(body) {
var params = {};
body = body.trim();
body.split('\n').forEach(function(line) {
var match = line.trim().match(/^(\w+)=(.*)$/);
if (match) {
params[match[1]] = match[2];
}
});
return params;
} | [
"get params() {\n return this._parsed.params || {};\n }",
"function decodeColonSeparatedResponse(response) {\n let result;\n\n if (response && typeof response === 'string') {\n const pairs = response.split(':') || response;\n result = {};\n\n pairs.forEach((pair) => {\n const keyValue = pair.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ToDo: very ugly!! wallMgr knows about internals of score, hiscore and places | process_scores(plane, score, hiscore) {
for (var i = 0; i < this.walls.length; i++) {
var temp_wall = this.walls[i];
if (plane.check_wall_passed(temp_wall) && !temp_wall.scored) {
score.increase();
temp_wall.scored = true; // do not score this wall ag... | [
"__score(){\n this.p1Score = 0;\n this.p2Score = 0;\n\n //Will be Used to Track Which Spaces Have Been Checked\n var visited = new GameBoard(this.size);\n\n for(var row = 0; row < this.size; row++){\n for(var col = 0; col < this.size; col++){\n var hasBla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to verify the callpath | function verifyPath(func) {
var real = callpath.shift();
if (real !== func) {
var msg = "Call path verification failure! Expected " + real + ", found " + func;
verificationError(msg);
}
} | [
"receivedCall(args, times) {\n const minRequired = times || 1;\n if (args.length === 0 && this.hasEmptyCalls(minRequired)) {\n return true;\n }\n const setupArgs = this.convertArgsToArguments(args);\n let matchCount = 0;\n for (const call of this.calls) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split the node into 4 subnodes | split_() {
let nextLevel = this.level_ + 1;
let subWidth = Math.round(this.bounds_.width / 2);
let subHeight = Math.round(this.bounds_.height / 2);
let x = Math.round(this.bounds_.x);
let y = Math.round(this.bounds_.y);
//top right node
this.nodes_[0] = new Quadt... | [
"split () {\n\n const subWidth = this.bounds.width / 2\n const subHeight = this.bounds.height / 2\n const x = this.bounds.x\n const y = this.bounds.y\n\n this.nodes[0] = new QuadTree(this.level+1, new Rectangle(x + subWidth, y, subWidth, subHeight) )\n this.nodes[1] = new Q... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: detect fnExoticToStringTag as function. | function fnExoticToStringTag() {} | [
"function headTagToString(head: Object): Function {\n /**\n * Calls `toString` on a given head tag\n */\n return function tagNameToString(tagName: string): string {\n return head[tagName].toString();\n };\n}",
"visitString_function_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"toSTRING() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override the default picking colors calculation | calculatePickingColors(attribute) {
attribute.value = this.state.polygonTesselator.pickingColors();
} | [
"getColor(value) {\n if (undefined == value) { return 'lightgrey'; }\n if (value < 0) {\n return this.negativeColorScale(value);\n } else {\n return this.selectedPosColorScale(value);\n }\n }",
"getColor() {\n if (this.state.erasing) { // This ensures that u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Nicely formats the rate for display in the rate chart. | function specificRateFormatter( obj, std_rate, rate, is_std ) {
std_rate = parseFloat(std_rate);
rate = parseFloat(rate);
// Does the standard rate apply?
if (!is_std && std_rate == rate) {
$(obj).addClass('subtle');
return 'Standard Rate Applies';
}
if (rate >= '1.00') {
return '$' + rate.toFixed(2) + ' ... | [
"function normConv(rate, symbol) {\n curPrice = parseFloat(basePrice * rate).toFixed(2);\n curDaily = parseFloat(baseChange * rate).toFixed(2);\n $price.text(symbol + curPrice);\n $daily.text(symbol + curDaily);\n}",
"function updateRateCharts( rateset ) {\n\n\tsingle_row = (rateset.subgpu.substr(1,3)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute `fsPath` for the given uri | function _makeFsPath(uri) {
var value;
if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {
// unc path: file://shares/c$/far/boo
value = "//" + uri.authority + uri.path;
}
else if (uri.path.charCodeAt(0) === 47 /* Slash */
&& (uri.path.charCodeAt(1) >= 65 /* A */... | [
"function _makeFsPath(uri) {\n var value;\n if (uri.authority && uri.path && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + uri.authority + uri.path;\n }\n else if (_driveLetterPath.test(uri.path)) {\n // windows drive letter: file:///c:/far/boo\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
binarystr is a binary string with 1..8 0/1 characters return same string padded with leading "0" chars up to 8 (byte length) does no error checking | function bytePad(binarystr) {
var padChar = "0";
var pad = new Array(1 + 8).join(padChar);
return (pad + binarystr).slice(-pad.length);
} | [
"function completeBinary(str) {\n\tlet a = str;\n\twhile (a.length % 8 !== 0) {\n\t\ta = \"0\" + a;\n\t}\n\treturn a;\n}",
"function parseBinary(str) {\n\t// SPEED IMPROVEMENT: Although it is cleaner to parse \n\t// the encoding this way, it might've been faster to\n\t// implement a parser like this:\n\t//\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
position object to FEN string returns false if the obj is not a valid position object | function objToFen (obj) {
if (!validPositionObject(obj)) return false
var fen = ''
var currentRow = 8
for (var i = 0; i < 8; i++) {
for (var j = 0; j < 8; j++) {
var square = COLUMNS[j] + currentRow
// piece exists
if (obj.hasOwnProperty(square)) {
fe... | [
"function objToFen (obj) {\n if (!validPositionObject(obj)) return false\n\n var fen = ''\n\n var currentRow = 8\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n var square = COLUMNS[j] + currentRow\n\n // piece exists\n if (obj.hasOwnProperty(square)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mirrors v with respect to this | mirror(v) {
return v.translate(v.split(this).perp.scale(2).inv);
} | [
"static translation(v) {\r\n\t\tres = identity(); \t\tres.M[3] = v.x; \r\n\t\tres.M[7] = v.y; \t\tres.M[11] = v.z; \r\n\t\treturn res; \r\n\t}",
"static scale(v) {\r\n\t\tres = identity(); \t\tres.M[0] = v.x; \r\n\t\tres.M[5] = v.y; \t\tres.M[10] = v.z; \r\n\t\treturn res; \r\n\t}",
"multiplyToRef(otherVector, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Proxy an event to hooked event handlers | function eventProxy(event) {
this._listeners[event.type](event);
} | [
"forward( obj, event, map ) {\n this.listenTo( obj, event, ( data ) => {\n if ( typeof map === 'function' ) {\n data = map( data );\n }\n\n this.trigger( event, data );\n } );\n }",
"function EventWrapper(evt_object){\n //the event holds enough i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set custom CSS property values and update the layout. | updateStyles(properties = {}) {
console.warn(
`WARNING: Since Vaadin 23, updateStyles() is deprecated. Use the native element.style.setProperty API to set custom CSS property values.`
);
Object.entries(properties).forEach(([key, value]) => {
this.style.setProperty(key, value);
});
this... | [
"_setCss(propertyName) {\n if (isPresent(get(this, propertyName))) {\n this.element.style[propertyName] = get(this, propertyName);\n }\n }",
"function setHtmlObjectsProperties(){\n\t\t \t\n\t\t\t//set size\t\t\n\t\t var objCss = {\n\t\t\t\t \"max-width\":g_options.gallery_width+\"px\",\n\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sidesteps, wie im Sportunterricht | function sidestepLinks() {
linksDrehen();
schritt();
rechtsDrehen();
} | [
"function mechanicsPublish() {\n\tnextTurn();\n}",
"function Tour() {\n\t}",
"constructor(newStitches, ct) {\n this.stitches = newStitches;\n this.count = newStitches.length;\n this.crochetType = ct;\n\n // this.count = 0;\n // for (Stitch stitch : newStitches) {\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fulfill the ResposeLines array of fight description based on server response object. | function CreateFightDescription(ojbJSON) {
ResposeLines = [];
var index = 0;
ResposeLines[index] = "Round " + ojbJSON.RoundNumber;
index++;
ResposeLines[index] = ojbJSON.Player.Name + "'s initiation: " + ojbJSON.Player.Initiation;
index++;
ResposeLines[index] = ojbJSON.Enemy.Name + "'... | [
"function DisplayFight() {\r\n var DivDisplay = document.getElementById(\"DivDisplayFight\");\r\n\r\n if (DisplayLine < ResposeLines.length) {\r\n DivDisplay.innerHTML += \"<h2>\" + ResposeLines[DisplayLine] + \"</h2>\";\r\n DisplayLine++;\r\n DivDisplay.scrollBy(0, 100);\r\n }\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Override the cursor for the entire document. Returns an IDisposable which will clear the override. | function overrideCursor(cursor) {
var body = document.body;
if (cursorStack.length === 0) {
body.classList.add(CURSOR_OVERRIDE);
}
var style = body.style;
if (style.cursor !== cursor) {
style.cursor =... | [
"__refreshCursor() {\n var currentCursor = this.getStyle(\"cursor\");\n this.setStyle(\"cursor\", null, true);\n this.setStyle(\"cursor\", currentCursor, true);\n }",
"function resetCursorPos(element) {\n element.selectionStart = 0;\n element.selectionEnd = 0;\n }",
"getCursor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function should find all the elements in the document that match the selector and change their style so that the text they contain is italic, underlined, and bold. | function changeSelectorStyle(selector) {
var selector = document.querySelectorAll(selector);
for (var i = 0; i < selector.length; i++) {
selector[i].style.fontStyle = "italic";
selector[i].style.fontWeight = "bold";
selector[i].style.textDecoration = "underline";
}
} | [
"function changeFirstParagraph() {\n $(document).ready(function() {\n $(\"div#test5 p\").eq(0).css(\"font-family\",\"Times New Roman, Times, serif\");\n $(\"div#test5 p\").eq(0).css(\"font-size\",\"20px\");\n });\n}",
"function styles_ptags(){\n $(\"#modu_main\").find(\"p\").each(function(){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a line view that corresponds to the given line number. | function findViewForLine(cm, lineN) {
if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) {
return cm.display.view[findViewIndex(cm, lineN)];
}
var ext = cm.display.externalMeasured;
if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) {
return ext;
}
} | [
"visualLineAt(pos, editorTop = 0) {\n return this.viewState.lineAt(pos, editorTop);\n }",
"function displayLineNumbers (currentLine, fragment) {\n var N = 5;\n var step = $(fragment.node).height() / fragment.lines;\n for (var line = currentLine + 1; line <= currentLine + fragment.lines; lin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call 'generateSitemaps' with some default options Also take care of the removing of the formatting characters | async function generate(options, pretty = false) {
const sitemaps = await generateSitemaps({
baseURL: '',
defaults: {},
routes: [],
urls: [],
...options,
});
if (!pretty) Object.keys(sitemaps).forEach(sitemap => sitemaps[sitemap] = sitemaps[sitemap].replace(/\t+|\n/g, ''));
return sitemaps;
} | [
"initStaticMapStrings() {\n this.defaultOptsString = \"size=1168x480&maptype=roadmap\";\n }",
"function createPlayShips(){\n // playShipOptions.forEach(ship => {\n // createShip(ship)\n // })\n formatPlayShips()\n }",
"function main() {\n\tconsole.log('Abacus iPad App Generator.');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to create a jquery dialog for warning the user of wrong elemnts being dragged and dropped into an area. | function openErrorDialog()
{
var message = $("<div id='msm_child_addition_error' title='Wrong child element type'>\n\
<p> This is not a valid child type. Please add acceptable child elements listed in the drop area.</p>\n\
</div>");
$(message).appendTo("#msm_c... | [
"function dragMove(evt) {\n\t\tdragX = evt.pageX;\n\t\tdragY = evt.pageY;\n\t\tif(draggingElem) {\n\t\t\t$(draggingElem).css('position', 'absolute');\n\t\t\t$(draggingElem).css('left', (dragX - ($(draggingElem).outerWidth()/2))+'px');\n\t\t\t$(draggingElem).css('top', (dragY - ($(draggingElem).outerHeight()/2))+'px... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push any value to the current parent | _push (val, hasChildren) {
const p = this._currentParent
p.values ++
switch (p.type) {
case c.PARENT.ARRAY:
case c.PARENT.BYTE_STRING:
case c.PARENT.UTF8_STRING:
if (p.length > -1) {
this._ref[this._ref.length - p.length] = val
} else {
this._ref.push(v... | [
"add (child) {\n this.contents.push(child);\n child.parent = this;\n }",
"addToParentView(parentView){\n parentView.children.push(this)\n this.parent = parentView\n }",
"push(val) {\n this._stack.push(val);\n }",
"addChild(value) {\n const newTreeNode = new Tree(value)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
11. Create a Date object for the current date and time. Extract the hours, reset the date object an hour ahead and finally display the date object in your browser. | function dateReset() {
var date = new Date();
document.write("Current date "+ date);
var hr = date.getHours();
date.setHours(hr-1);
document.write("<br> 1 hour ago, it was "+ date);
} | [
"function displayCurrentDate () {\n // Retrieve and display the current date\n $('#currentDay').text(moment().format(\"dddd, MMMM Do YYYY\"));\n // Retrieve and display the current hour (Need to refresh the page to update it)\n $('#currentHour').text(moment().format(\"LT\"));\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw a w this method is called in a loop to redraw the w | function draw_w(w) {
//convert the cv coordinate directions to cartesian coordinate direction by translating and scaling
ctx.fillRect(0, 0, cv.W(), cv.H())
ctx.save();
ctx.translate(0, cv_ht);
ctx.scale(1, -1);
w.DDD();
ctx.restore();
ctx.font = 'bold 18px arial';
ctx.textAlign = 'center';
ctx.fillS... | [
"draw() {\n for (const waveform of this.waveforms) {\n this.drawInCanvas(waveform.canvas, waveform.samples);\n }\n }",
"function draw() {\n // clear the canvas\n canvas.width = canvas.width;\n drawBlocks();\n drawGrid();\n }",
"draw() {\n push();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
not working yet, possibly not needed if after a booking we can just kick off render traveler info instead | renderNewTrip(newBooking, traveler) {
let totalCost = traveler.getTripCost(newBooking.id).total;
let destination = traveler.findDestination(newBooking.destinationID);
let tripStatus = determineStatus(newBooking);
cardContainer.innerHTML += `
<article class="travelCard">
<div class="h... | [
"function displayCurrentBooking() {\n\trebu.getCurrentBooking(function(booking) {\n\t\t// create vehicle marker\n\t\tbookedVehicle = booking.vehicle;\n\t\tbookedVehicle.marker = createVehicleMarker(bookedVehicle, map, true);\n\t\t\n\t\t// display the card\n\t\tvar currentBookingCard = view.currentBookingCard(bookin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a function called getHand() that returns a hand from the array using parseInt(Math.random()10)%3 | function getHand(){
return hands[parseInt(Math.random()*10%3)];
} | [
"static valueOfHand(hand) {\n // assumes that hands are arrays of Card instances\n const acesInHand = Deck.howManyAces(hand);\n let handVal = 0;\n hand.forEach(card => handVal += card.value);\n for (let i = 0; i<acesInHand; i++) {\n if (handVal > 21) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DELETE Method Condition checked to delete members in a community | function conditionCheckedDeleteMembers(domainName, values, dataExistCheckResult, done) {
logger.debug('condition checked to delete member');
logger.debug('dataExistCheckResult', dataExistCheckResult);
if (dataExistCheckResult === values.length) {
communityMembershipService.removeMembersFromCommunity(domainNam... | [
"function removeMemberFromCommunity(domainName, data, done) {\n /* const arr = [];\n const query = (`DELETE FROM ${MEMBERSHIP_TABLE} WHERE username =? AND domain = ? `);\n // console.log(data.length);\n // console.log(typeof (data));\n console.log(data);\n data.forEach((val) => {\n arr.push({ query, params... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is the parser function that uses the expression, operator, and index to find the expression slice. For 913, we want to find 13 from the expression. | parseExpressionByOperator(expression, operator, index) {
//startingIndex will be the index of where the expression slice will begin
let startingIndex = index;
//endingIndex will be the index of where expression slice ends.
let endingIndex = index;
const validOperators = ['-', '+', '/', '*']
//if... | [
"function ArrayIndex(){\n \t\t\tdebugMsg(\"ExpressionParser : ArrayIndex\");\n \t\t\tcheck(\"[\");\n \t\t\t \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\n \t\t\tcheck(\"]\");\n \t\t\t\n \t\t\treturn new ASTUnaryNode(\"arrayIndex\",expr);\n \t\t}",
"function parseExpression() {\n let expr;\n //lookahead = lex();\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decide if an object is a JWK | function isJWK(object) {
return !!object && !!object.kty;
} | [
"function isObject(thing) {\n return Object.prototype.toString.call(thing) === '[object Object]';\n}",
"function object (thing) {\n return typeof thing === 'object' && thing !== null && array(thing) === false && date(thing) === false;\n }",
"static isInstance(obj) {\n if (obj === undefined || ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `VirtualGatewayClientPolicyTlsProperty` | function CfnVirtualGateway_VirtualGatewayClientPolicyTlsPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected ... | [
"function CfnVirtualGateway_VirtualGatewayClientPolicyPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('E... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw the geologic symbol | function drawSymbol(p2, dist, dip, dipaz)
{
//draw the point with dip/dip azimuth
var dipF = Math.floor(dip);
var dipAzF = Math.floor(dipaz);
dipF = dipF.toString();
dipAzF = dipAzF.toString();
if(dipF.length == 1)
{
dipF = "0" + dipF.toString();
}
if(dipAzF.length == 2)
{
dipAzF = "0" + dipAzF.toStri... | [
"display() {\n //set the color\n stroke(this.element*255) ;\n //draw the point\n point(this.identity.x,this.identity.y)\n }",
"function drawX() {\n box.style.backgroundColor = '#fb5181'\n ctx.beginPath()\n ctx.moveTo(15, 15)\n ctx.lineTo(85, 85)\n ctx.moveTo(85, 15)\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dynamic Stock list display function | function displayStockList(filter, refresh) {
if (!!document.getElementById("listPlaceholder")) {
const newlist = document.createElement('div');
newlist.innerHTML = ' <div class="stock-selection-sect vertical_height margin-top" id="stockHeader"></div>';
document.getElementById('listPlacehold... | [
"function getStockDisplay(stockName, sharePrice, pointChange, percentageChange) {\n var stockTable = $(\"<table class='centered table-no-format'><tbody><tr>\" +\n \"<td><p class='stock-name'></p></td><td>\" +\n \"<p class='stock-performance'><i class='stock-icon material-icons'></i>\" +\n \"<span ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inner function to check readyState | function checkReadyState() {
if (doc.readyState == 'complete') {
// Clean-up
doc.detachEvent('onreadystatechange', checkReadyState);
win.clearInterval(explorerTimer);
win.clearInterval(readyStateTimer);
// Process function stack
process();
}
} | [
"function isReady(){\n if( events.length > 1 ){\n alert(\"Bitte nur eine auswählen\");\n return\n }\n \n if( selectedEvent.status === \"disabled\" ){\n alert(\"Eintrag ist disabled und kann nicht erstellt werden\");\n return\n }\n \n if( selectedEvent.status != \"\" ){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets and returns the classname for the body element | function getBodyClassName() {
return document.getElementsByTagName("body")[0].className;
} | [
"function removeBodyClasses() {\n dom.removeClass(\n [document.documentElement, document.body],\n [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown']]\n )\n}",
"function cls(body) {\n return \"class Foo { \" + body + \" }\";\n}",
"function ajax_getClas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the width of the offsettable area of the columned element. By definition, the number of pages is always this divided by the width of a single page (eg, the client area of the columned element). | function columnedWidth() {
var bd = columnedElement();
var de = p.page.m.activeFrame.contentDocument.documentElement;
var w = Math.max(bd.scrollWidth, de.scrollWidth);
// Add one because the final column doesn't have right gutter.
// w += k.GAP;
if (!Monocle.Browser.env.widthsIgnoreTranslate ... | [
"getCols() {\r\n let cols = Math.floor(Math.ceil(this.getWidth() / 100) / 2) * 2;\r\n\r\n return cols > 0 ? cols : 1;\r\n }",
"function getColWidth(items) {\n var colWidth;\n angular.forEach(items, function(item) {\n if (!colWidth || item.dimensions.width < colWidth) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the current screen angle. | setScreenAngle() {
this.screenAngle = this.getScreenAngle();
} | [
"initScreenAngle() {\n\n // Check for API.\n let angle = _.get(window, 'screen.orientation.angle')\n this.hasScreenAngleAPI = _.isNumber(angle);\n\n this.setScreenAngle();\n\n }",
"function angleReset() {\n\tturnWheelTo(50); // 50 is the middle angle of the G27 wheel. \n\tglobal.turnCounter = 0;\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |