query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
PlotNoisePath will generate the bezier curve of the noisefloor path inNoiseX is the inital starting x coordinate of the noisefllor; inNoiseY is the initial Y starting point for each channel in ChSignalHigh, append a bezier curve of the noisefloor level stored in ChSignalHigh[ch][2] using x coordinate of a channel cente... | function PlotNoisePath(inNoiseX, inNoiseY, tier, ChSignalHigh) {
var nline="M"+inNoiseX+","+inNoiseY;
for (var ch=0; ch < ChSignalHigh.length; ch++) {
if (tier == null && ChSignalHigh[ch][1] > 13) { continue }
if (ChSignalHigh[ch][0] == tier) {
var anoiseX = GetChannelCenter(ChSignalHigh[ch][1]);
var anoise... | [
"function PlotStationPath(stations, idx, chanWidth, tier, container) {\n\tvar spath=\"\";\n\tvar signal_height = GetHeightFromSignal(stations[idx][3]);\n\tvar channel_center = GetChannelCenter(GetChannelInfo(stations[idx][1]));\n\tvar chanSpread = chanWidth * 0.8125; /* 16.25MHz utilized / 20MHz */\n\tvar chanSprea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inputs: None Outputs: None Returns: None / Opens the navbar as a block when called | function navbar_open() {
document.getElementById("myNavbar").style.display = "block";
} | [
"function navbarinfo(path, loc){\r\r\n\tnavbarhead();\r\r\n\tnavbarhome();\r\r\n\tnavbariter(path);\r\r\n\tnavbarend(loc);\r\r\n}",
"function navbar(path){\r\r\n\tnavbarhead();\r\r\n\tnavbarhome();\r\r\n\tvar ctr = 0;\r\r\n\twhile (ctr < (path.length - 1)) {\r\r\n\t\tnavbarnav(path[ctr].uri, path[ctr].str);\r\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para mostrar los tours | function showTours(){
$('#respuesta').html("");
$.ajax({
url:"../Controlador/ajax/gestion-Tours.php?accion=mostrar",
dataType:'json',
success:function(res){
console.log(res);
var estrella='';
var img = '';
for (var i = 0; i < res.length; i++) {
img = '../Public/img/tours/' + res[i].idTours + '_01.png... | [
"function mostrarListaTiempos(listaTiempos) {\n\n\tconsole.debug(\"Carga lista de tiempos en pantalla\");\n\n\tvar htmlTiempos = '';\n\n\t// Control de resultados\n\tif (listaTiempos == null || listaTiempos.length == 0) {\n\n\t\thtmlTiempos = \"<div style='text-align:center'><h3>\" + navigator.mozL10n.get('l10n_sin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Precompute index map for pooling function | _createIndexMap() {
if (this.poolIndexMap) {
return;
}
let [inputRows, inputCols, inputChannels] = this.inputShape;
const rowIndices = new Tensor([], [inputRows, inputCols]);
let index = 0;
for (let i = 0; i < inputRows; i++) {
for (let j = 0; j < inputCols; j++) {
rowIndice... | [
"function rebuildIndexMapBruteForce() {\n var i;\n indexMap = {};\n\n for (i = 0; i < array.length; i += 1) {\n indexMap[array[i].id] = i;\n }\n }",
"resetIndexes()\n {\n const self = this;\n self[_reducedIndexes] = null;\n self[_optimizedIndexes] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parses level value according to details above num = which number level (if doesn't exist throws error) returns [playerPlace, enemyTypesPlaces, gateplace] object | function parseLevel(num) {
// check if that level exists
if (num > levels.length) {
throw Error("Invalid level.");
}
return parseConfig(levels[num]);
} | [
"function getLevel(points, callback) {\n gameDb.find('config', 'game', function(err, doc){\n var levels = doc.game_levels;\n for (var i in levels) {\n //check is above lower lower limit\n if(points >= levels[i].points_needed) {\n //check ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse egg png link from dex page Inputs: html HTML of a full dex page (from Outputs: eggUrl Partial UTL to the png of the egg from the dex page. ' is removed from the URL since it is always the same | static parseEggPngFromDexPage(html) {
const eggUrl = (html.find('.eggspr').find('img')
.attr('src') || '')
.replace('https://pfq-static.com/img/', '');
return eggUrl;
} | [
"function getElements() {\n\n for(let i = 0; i < 6; i++) {\n var idxBeg = $(\"source\").value.indexOf(begSubstrings[i]);\n eoeElements[i] = $(\"source\").value.substring(idxBeg + begSubstrings[i].length - 1);\n var idxEnd = eoeElements[i].indexOf(\"</\");\n eoeElements[i] = eoeElements[i].substring(i,i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the constructor will take in a length of a word to create the board | constructor(length){
this.board = new Array(length).fill("_")
} | [
"constructor (size) {\n\n var i,j;\n var board = [];\n\n //Initialize each space to 0\n for (i=0; i<size; i++) {\n\n var row = [];\n\n for (j=0; j<size; j++) {\n row.push(0);\n }\n\n board.push(row);\n }\n\n this.bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para guardar la informacion del DNA recibido | async function guardarMutante(dna, n, start, mutacion, method, countMutations){
// Finalizo el tiempo
const end = performance.now();
// Calculo la diferencia
let diff = end - start;
// Guardo en la base de datos .
let result = await applicationModel.saveDNA(n, dna, mutacion, method, diff, countMutations);
/... | [
"function borrarRegistro(){\n \n /*aId.splice(posicion,1);\n aDireccion.splice(posicion,1);\n aLatitud.splice(posicion,1);\n aLongitud.splice(posicion,1);\n */\n\n aContenedor.splice(posicion,1)\n contador--;\n\n\n posicion=0;\n mostrarRegistro(posicion);\n\n}",
"function saveChar(na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the visibility of the drop down button. | get dropDownButtonVisible() {
return this.i.dropDownButtonVisible;
} | [
"function show() {\n const dropdown = this;\n if (window.dropdown && window.dropdown != dropdown) {\n window.dropdown.hide();\n }\n window.dropdown = dropdown;\n dropdown.style.display = 'block';\n }",
"show() {\n\t\tthis.element.style.visibility = '';\n\t}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For IE. Restore tabindexes. | function restoreTabIndexes() {
if (document.all) {
var i = 0;
for (var j = 0; j < gTabbableTags.length; j++) {
var tagElements = document.getElementsByTagName(gTabbableTags[j]);
for (var k = 0 ; k < tagElements.length; k++) {
tagElements[k].tabIndex = gTabIndexes[i];
tagElements[k].tabEnabled = true;... | [
"function _setTabIndex() {\n\t$(\":input\").each(function (i) { \n\t\t$(this).attr('tabindex', i + 1);\n\t\tif ($(this).hasClass('datepicker') || $(this).hasClass('month')) {\n\t\t\t$(this).next().attr('tabindex', i + 1);\n\t\t}\n\t\t\n\t});\n\t$('.btn-add-row').attr('tabindex', '-1')\n\t$('.remove-row').attr('tabi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to Reset Activity | function resetActivity() {
displayActivity(MESSAGE);
} | [
"function reactivate() {\n enableIntervals();\n dynamicActivity = regularActivityMonitor;\n }",
"reset() {\r\n\t\tthis.changeState(this.initial);\r\n\t}",
"function resetOwnActionTimer() {\n actionTimer = new Date()\n }",
"function resetTour(){\n \n yourtourids = []... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copyright (c) 20122017 The ANTLR Project. All rights reserved. Use of this file is governed by the BSD 3clause license that can be found in the LICENSE.txt file in the project root. A DFA walker that knows how to dump them to serialized strings. | function DFASerializer(dfa, literalNames, symbolicNames) {
this.dfa = dfa;
this.literalNames = literalNames || [];
this.symbolicNames = symbolicNames || [];
return this;
} | [
"function DynabuffersVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}",
"function ProgramParser() {\n \t\t\n \t\t this.parse = function(kind) {\n \t\t \tswitch (kind) { \t\n \t\t \t\tcase \"declaration\": return Declaration();\n \t\t \t\tbreak;\n\t \t\t\tdefault: return Program();\n\t \t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the list is empty, show the large logo, otherwise show the small logo. | function checkLogo() {
var logo = document.querySelector('.logo');
var fontSize = 90;
if (toDoList.innerHTML.includes('li') === true) {
logo.classList.add("logo-small");
//Make the logo decrease in size with each added list item
var smallLogoH1 = document.querySelector('.logo-small').getElementsByTa... | [
"function addFillersToEmptyImages(item) {\n if (item.image.localeCompare(\"\") == 0 ) {\n item.image = \"https://www.universitycounselingjobs.com/institution/logo/logo2(4).png\"\n }\n}",
"function logoArt() {\n console.log(\n logo({\n name: \"Employee DB\",\n font: \"Speed\",\n lin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
runGameOver() this is used to run the "game over" game hides away the regular play screen and displays other this gameover game which involves shooting water at a cat (the cat stole your ball, dude) | function runGameOver(){
// overwrite ball position
ball.x=width/2;
ball.y=width/2;
// draw new background to hide the regular game screen
background(0);
// show score so we can keep in mind who won
displayScore();
// now load cat
moveCat();
drawCatHead();
// display paddles
displayPaddle(lef... | [
"function gameOver() {\n update($question, \"Game Over. You scored \" + score + \" points.\");\n }",
"gameOver(result) {\n document.getElementById('overlay').style.display = '';\n if (result === 'win') {\n document.getElementById('game-over-message').className = 'win';\n document.getElementB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
text = the text which has to be added destinationId = unordered list Id where the text will be added no = number of items in the destination unordered list objNo = number of the correct dish from allDishes | function addInside(text,destinationId,objNo,no){
if(text == ""){
return;
}
else{
for (var i = 0; i < items.length; i++) {
if (text == items[i]) {
var ingredList = document.getElementById(destinationId);
var liElem = document.createElement('li');
var divElem = document.createEle... | [
"function agregarElementoListaTxt(txt) {\n var tableTxt = document.getElementById(\"ul-txt\");\n var li = document.createElement(\"li\")\n li.className=\"list-group-item item-list-txt\";\n li.id = txt.nombre;\n li.style.cursor = \"pointer\";\n //li.style.height = \"50px\";\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserpragma_clause. | visitPragma_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitPragma_declaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"declarations() {\n let declarationList = [];\n // starts with a var followed by bunch of var declarations\n if (this.currentToken.type === tokens.VAR) {\n this.eat(tokens.VAR);\n while (this.currentToken.type === token... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves the content of a DOM element to a PDF file. | function savePDF(domElement, options, callback) {
if (options === void 0) { options = {}; }
new __WEBPACK_IMPORTED_MODULE_2__KendoDrawingAdapter__["a" /* default */](__WEBPACK_IMPORTED_MODULE_0__progress_kendo_drawing__["b" /* drawDOM */], __WEBPACK_IMPORTED_MODULE_0__progress_kendo_drawing__["c" /* exportPDF *... | [
"function Write()\n{\n /* prirazeni weboveho prvku dropdown list ktery obsahuje stroje do promenne DropDownMachines */\n var DropDownMachines = document.getElementById(\"3\");\n /* prirazeni hodnoty VALUE zvoleneho stroje do promenne SelectedMachine */\n var SelectedMachine = DropDownMachines.options[Dr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Automatically generated. Tests for the `Finalize` constructor of the `:exceptioninfo` type. | function finalize_ques_(exception_info) /* (exception-info : exception-info) -> bool */ {
return (exception_info._tag === _tag_Finalize);
} | [
"exitExceptionType(ctx) {\n\t}",
"exitExplicitConstructorInvocation(ctx) {\n\t}",
"exitConstructorBody(ctx) {\n\t}",
"exitConstructorDeclarator(ctx) {\n\t}",
"exitExceptionTypeList(ctx) {\n\t}",
"function assert_ques_(exception_info) /* (exception-info : exception-info) -> bool */ {\n return (exception_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
These types may describe types which may be leaf values. | function isLeafType(type) {
return isScalarType(type) || isEnumType(type);
} | [
"visitType_definition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitObject_type_def(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitType_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitXmltype_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitRecord_type_def(ct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Throttle the window scroll event | function throttleWindowScroll() {
if (scrollTimer) {
// Ensure that we catch and execute that last invocation.
wasScrolled = true;
return;
}
handleWindowScroll();
scrollTimer = this.setTimeout(function () {
scrollTimer = null;
if (wasScrolled) {
handleWindowScroll();
wasScrolle... | [
"handleWindowScroll() {\n const sectionHTMLElement = this.sectionHTMLElement.current;\n const { top } = sectionHTMLElement.getBoundingClientRect();\n\n const shouldUpdateForScroll = Section.insideScrollRangeForUpdates.call(this, top);\n if ( shouldUpdateForScroll ) {\n\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assumes the last NAL unit in this buffer is in complete form | splitIntoNALUnits(buffer) {
let nalUnits = [];
while (true) {
var nalUnit;
let startCodePos = Bits.searchBytesInArray(buffer, [0x00, 0x00, 0x01], 0);
if (startCodePos !== -1) {
nalUnit = buffer.slice(0, startCodePos);
buffer = buffer.slice(startCodePos+3);
} else {
... | [
"available() {\n return this.buf.byteLength - this.n;\n }",
"removeEmulationPreventionByte(nalUnit) {\n let searchPos = 0;\n let removeBytePositions = [];\n while (true) {\n let emulPos = Bits.searchBytesInArray(nalUnit, [0x00, 0x00, 0x03], searchPos);\n if (emulPos === -1) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Node class A node has an id, a value, coordinates for the location on the screen, and a list of neighbor ids | function Node(theId, theLabel, val, coords, neighbors){
//properties
//id of the node
this.nodeId = theId;
//label on the node
this.nodeLabel = theLabel;
//the value of the node
this.val = val;
//coordinates of the node (where it will be on the screen)
this.coordinates = coords;
//list of node ids that ... | [
"function Node(value, id, line, posi) {\n\tthis.id = id;\n\tthis.value = value;\n\tthis.line = line;\n\tthis.posi = posi;\n\tthis.father = this;\n\tthis.sons = [];\n\t\n\tthis.registerSon = function(s) {\n\t\tthis.sons.push(s);\n\t}\n\tthis.registerFather = function(f) {\n\t\tthis.father = f;\n\t}\n}",
"construct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function returns the position of the last character of match within attrStr | function getPositionFromMatch(attrStr, match) {
return attrStr.indexOf(match) + match.length;
} | [
"function substrWithAttrCodes(pStr, pStartIdx, pLen)\n{\n\tif (typeof(pStr) != \"string\")\n\t\treturn \"\";\n\tif (typeof(pStartIdx) != \"number\")\n\t\treturn \"\";\n\tif (typeof(pLen) != \"number\")\n\t\treturn \"\";\n\tif ((pStartIdx <= 0) && (pLen >= console.strlen(pStr)))\n\t\treturn pStr;\n\n\t// Find the re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle user file selection | function handleFileSelect(evt) {
console.log("Handling file selection");
files = evt.target.files;
fileCount = files.length;
fileIndex = 0;
handleFile(files[0]);
} | [
"function fileSelected(file) {\n\tif (file.type == \"text\" && file.subtype == \"plain\") {\n\t\tgetData(file.data);\n\t} else {\n\t\tcreateP(\"I need a text file.\");\n\t}\n}",
"function displayFile() {\n if (changed) {\n let fileName = $(this).val().split(\"\\\\\").pop();\n $(this).siblings(\".... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether file size is correct based on its type. | function isValidFileSize(type, file) {
const supportedFile = supportedFileMap[type];
return file.size < supportedFile.maxSize;
} | [
"function cs_check_file_size(files, max_upload_size){\r\n\t\r\n\tvar uploaded_files = files;\r\n\t\r\n\tvar invalid_file_sizes = 0;\r\n\t\r\n\tfor(var i = 0; i < uploaded_files.length; i++){\r\n\t\tif(uploaded_files[i].size > max_upload_size)\r\n\t\t\tinvalid_file_sizes++;\r\n\t}\r\n\t\r\n\treturn (invalid_file_siz... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a state change to the client | function sendStateChange(newState, reason) {
if (heartbeat.timeout) {
clearTimeout(heartbeat.timeout);
heartbeat.timeout = false;
}
if (state != newState) {
stateChange(newState, reason);
state = newState;
}
} | [
"function stateSampler() {\n // Determine if the user is active\n const timestamp = Date.now();\n const timeElapsed = timestamp - state.lastTimestamp;\n state.userActive = timeElapsed < config.userActiveTimeout;\n\n // Create message for transmission to server\n const packet = {\n source: 'client',\n ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
! Pointer Events Polyfill: Adds support for the style attribute "pointerevents: none" to browsers without this feature (namely, IE). (c) 2013, Kent Mewhort, licensed under BSD. See LICENSE.txt for details. | function PointerEventsPolyfill(t){if(this.options={selector:"*",mouseEvents:["click","dblclick","mousedown","mouseup"],usePolyfillIf:function(){if("Microsoft Internet Explorer"==navigator.appName){if(null!=navigator.userAgent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/)){if(parseFloat(RegExp.$1)<11)return!0}}return!1}},t){var ... | [
"function ignoreMouseEvents() {\n if ( $webSiteContainer==null ) return;\n\n $webSiteContainer.css(\"pointer-events\", \"none\");\n }",
"function isReallyTouch(e){//if is not IE || IE is detecting `touch` or `pen`\nreturn typeof e.pointerType==='undefined'||e.pointerType!='mouse';}",
"function o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if styling needs to be worked on import PokeList from './' | function App() {
return (
<div className="App">
<h1>PokeList</h1>
<VisibilityButton/>
<PokeList />
</div>
);
} | [
"function JokeApp() {\n var jokeComponents\n\n //this de hua more longer\n //jokeComponents = jokesData.map(joke => <Meme id={joke.id} question={joke.question} punchLine={joke.punchLine} />)\n\n //this de hua shorter, but need add something in the Meme.js --> add 'jd'\n jokeComponents = jokesData.map(j... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Migrate new data from bills to productSalesInfo | async migrate() {
const ts = await this.maxTs();
const str = `insert into productSalesInfo(shopId, transId, productId, ts, price, quantity, amount)
select b.shopId, b.transId, b.productId, b.ts, b.price, b.quantity, b.amount from bills b
where t... | [
"function setSorAttributes(basket, obj) {\n for each (var pli in basket.productLineItems) {\n if (Object.keys(obj).indexOf(pli.productID) >= 0) {\n pli.custom.hasSmartOrderRefill = true;\n pli.custom.SorMonthInterval = obj[pli.productID].SorMonthInterval;\n pli.custom.S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn a path as a flat array into a tree with a single branch | function pathToTree(path) {
var doc = path.shift();
var root = [doc.id, doc.opts, []];
var leaf = root;
var nleaf;
while (path.length) {
doc = path.shift();
nleaf = [doc.id, doc.opts, []];
leaf[2].push(nleaf);
leaf = nleaf;
}
return root;
} | [
"function ternary_tree_paths(root) {\n let res = [];\n if (root) dfs(root, [], res);\n return res;\n}",
"function ternary_tree_paths(root) {\n let res = [];\n if(root) dfs(root, [], res)\n return res;\n}",
"function buildTree(P, arg, path)\n{\n if (!path)\n path = \"/\";\n report(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test endpoint Cameras with an id 10 will have large image counts | function test_endpoint(camera_id){
if(camera_id <= 10)
return large_data_camera_fixture(camera_id);
else
return large_count_camera_fixture(camera_id);
} | [
"function setCountOfImageToBeFetch(countOfImage) {\n apiUrl = `https://api.unsplash.com/photos/random/?client_id=${apiKey}&count=${countOfImage}`;\n}",
"function countImages() {\r\n // console.log('Init images count');\r\n var $galleryTiles = $('.gallery-tile');\r\n var imagesLen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
' Name : handle_cm_add_payment_card ' Return type : None ' Input Parameter(s) : req, startTime, apiName ' Purpose : Creating a class to handle the CM_ADD_PAYMENT_CARD API error with following members ' History Header : Version Date Developer Name ' Added By : 1.0 28th Apr,2012 Ravi Raj ' | function handle_cm_add_payment_card(req, startTime, apiName) {
this.req = req; this.startTime = startTime; this.apiName = apiName;
} | [
"function handle_cm_get_payment_card(req, startTime, apiName, fromSubmittPay) {\n this.req = req;\n this.startTime = startTime;\n this.apiName = apiName;\n this.fromSubmittPay = fromSubmittPay;\n}",
"function Create(card) {\n var dfd = $q.defer();\n var token = OrderCloud.Auth.ReadToken(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: loadImportProject Params: json, filename | function loadImportProject(json, filename) {
if (!tmp_storage)
{
tmp_storage = {
filenames: [],
jsons: []
};
}
//var length = tmp_storage.filenames.length;
tmp_storage.filenames[tmp_storage.filenames.length] = filename;
tmp_storage.jsons[tmp_storage.jsons.length] = json;
//conso... | [
"function handleJsonImport(evt) {\r\n\t\t// Loop through the FileList and render image files as thumbnails.\r\n\t\t//project = new Project();\r\n\t\tvar files = evt.target.files; // FileList object\r\n\t\tfor (var i = 0, f; f = files[i]; i++) {\r\n\t\t\tvar reader = new FileReader();\r\n\t\t\treader.onload = (funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reports a list of PR and their merge status base on the input array of github PR json objects | reportPRListDetailed( dataPR ) {
if( dataPR === undefined ) {
return(
<div><h3>Array was undefined</h3></div>
);
}
if( dataPR.length === 0 ) {
return(
<div><h3>Found no data</h3></div>
);
}
var githubPRsDataDetailed;
githubPRsDataDetailed = dataPR.map(
... | [
"reportPRList( dataPR ) {\n if( dataPR === undefined ) {\n return(\n <div><h3>Array was undefined</h3></div>\n );\n }\n\n if( dataPR.length === 0 ) {\n return(\n <div><h3>Found no data</h3></div>\n );\n }\n\n return(\n dataPR.map( eachElement => (\n <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merges the security config provided with the current security config | function mapSecurityConfig(currentConfig, config) {
if (!config)
return currentConfig;
var validatedConfig = getValidatedSecurityConfig(config);
return __assign({}, currentConfig, validatedConfig, { captcha: __assign({}, currentConfig.captcha, validatedConfig.captcha) });
} | [
"static merge (config) {\n currentConfig = assign({}, currentConfig, config);\n }",
"function mapApiConfig(currentConfig, config) {\n if (!config)\n return currentConfig;\n var validatedConfig = getValidatedApiConfig(config);\n return __assign({}, currentConfig, validatedConfig);\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tokenize `text` using language `languageId` | function tokenize(text, languageId) {
var modeService = __WEBPACK_IMPORTED_MODULE_5__standaloneServices_js__["b" /* StaticServices */].modeService.get();
// Needed in order to get the mode registered for subsequent look-ups
modeService.getOrCreateMode(languageId);
var tokenizationSupport = getSafeTokeni... | [
"function tokenize($text) {\n\tvar tokens = [], lemmatokens = [];\n\tvar doc = nlp($text);\n\tvar sentences = doc.sentences().json();\n\t//console.log(sentences)\n\n\t// each sentence in semantic\n\tsentences.forEach(obj => {\n\t\tlet sentence = obj.text.replace(/[.]/g, '');\t// clear .\n\t\tlet subsentences = sent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
EXPERIMENTAL: trying to derive a surfaceId for a property in a specific node exploiting knowledge about the implemented view structure: in metadata every node is toplevel (card) in manuscript it is either toplevel (title, abstract) or part of a container (body) | _getSurfaceId (node, propertyName, viewName) {
if (viewName === 'metadata') {
return `${node.id}.${propertyName}`
} else {
let xpath = node.getXpath().toArray()
let idx = xpath.findIndex(entry => entry.id === 'body')
let relXpath
if (idx >= 0) {
relXpath = xpath.slice(idx)
... | [
"get id() {\n this._id = getValue(`cmi.objectives.${this.index}.id`);\n return this._id;\n }",
"function getFieldIdFromCurrentNode(node){\n\t\n\tfoundId = false;\n\twhile((node.parentNode != null) && (foundId == false)){\n\t\tnode = node.parentNode;\n\t\tif (jQuery(node).attr('class')=='smartcolor-containe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to convert a tabele into a csv format | function convertTableToCsv(table){
var content = '';
//check if the table heade paramete is present.
//just get all the row item on the table and process it into csv
var rows = table[0].rows;
for (var i = 0; i < rows.length; i++) {
content+=extractRow(rows[i]);
}
return content;
} | [
"function Csv () {}",
"function exportToCSV(data, type) {\n\tlet csvContent = \"data:text/csv;charset=utf-8,Email,Start,End,Number of Riders,Time,Wait Time,ETA,End Time,Vehicle\\r\\n\";\n\tdata.forEach(function(rowArray) {\n\t\trowArray[0] = rowArray[0].replace(\",\", \".\");\n\t\tcsvContent += rowArray.join(\",\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===== End of update not being used ====== /============================================= = destroy not bing used = ============================================= delets individualWorkouts | function destroy(req, res) {
IndividualWorkouts.findById(req.params.id)
.then(function(individualWorkouts){
if(!individualWorkouts) res.send(" individualWorkouts is not found ");
else return individualWorkouts.destroy();
})
.then(function(){
res.send("indi... | [
"function workoutFinished(){\n\n }",
"removeWorker(worker){\n console.log(worker);\n let workers = ODWorker.ListOfWorkers.filter( w => {\n return w.fullName.toUpperCase() !== worker;\n });\n ODWorker.ListOfWorkers = workers;\n }",
"destruct() {\n var action;\n\n fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mensaje dinamico creado con Sweetalert 2 para dar respuesta a los procesos,p_=Parametro de entrada | function f_mensajeProceso(p_titulo,p_mensaje,ptipo_mensaje) {
Swal.fire({
title: ""+p_titulo,
text: ""+p_mensaje,
icon: ""+ptipo_mensaje,
showCancelButton: true,
cancelButtonText: 'Cerrar',
showClass: {
popup: 'animated fadeInDown faster'
},
hide... | [
"function mensaje_advertencia(titulo, mensaje){\n swal({ title: titulo, text: mensaje, type: \"error\", confirmButtonText: \"Aceptar\" });\n }",
"function mensaje(titulo, mensaje){\n swal(titulo, mensaje); \n }",
"function registerSuccessAlert(data) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieve values from datagrid panel. | function retrieveValues(target){
var opts = $.data(target, 'combogrid').options;
var grid = $.data(target, 'combogrid').grid;
var rows = grid.datagrid('getSelections');
var vv = [],ss = [];
for(var i=0; i<rows.length; i++){
vv.push(rows[i][opts.idField]);
ss.push(rows[i][opts.textField]);
}
... | [
"function retrieveValues(target){\n\t\tvar opts = $.data(target, 'combogrid').options;\n\t\tvar grid = $.data(target, 'combogrid').grid;\n\t\tvar rows = grid.datagrid('getSelections');\n\t\tvar vv = [],ss = [];\n\t\tfor(var i=0; i<rows.length; i++){\n\t\t\tvv.push(rows[i][opts.idField]);\n\t\t\tss.push(rows[i][opts... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a gaussian random function with the given mean and stdev. Note that this returns a function, not a value. | function gaussian(mean, stdev) {
var y2;
var use_last = false;
return function() {
var y1;
if(use_last) {
y1 = y2;
use_last = false;
}
else {
var x1, x2, w;
do {
x1 = 2.0 * Math.random() - 1.0;
x2... | [
"function getRandomGaussian(){\n\treturn NormSInv(Math.random());\n}",
"static gaussRand() {\n return Math.sqrt(2 * Ex.expRand()) * Math.sin(2 * Math.PI * Math.random());\n }",
"calculateStdDevFitness(gen) {\n const x = gen.generation;\n const fitnessArr = gen.individuals.map((cur) => cur.fitn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Abort and signal to any observers that the associated activity is to be aborted. | abort() {
abortSignal(getSignal(this));
} | [
"abortTransaction() {\n\t\tthis.isTransacting = false;\n\t\tthis.restoreToPreviousState();\n\t}",
"abortSession() {\n if (this.isRunning) {\n this.abort = true;\n }\n }",
"abort() { \n this.reset = true;\n }",
"abort(transaction_id) {\n this.sendCommand('ABORT', {'transaction': tran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an svg line from element1 to element2 | function createLine(element1, element2) {
let line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
let x1 = getOffset(element1).left + (getWidth(element1) / 2);
let y1 = getOffset(element1).top + (getHeight(element1));
let x2 = getOffset(element2).left + (getWidth(element2) / 2);
/... | [
"function GenerateLineElement(x2len, y2len, stroke_width, stroke_color) {\n\tvar aline = document.createElementNS(svgNS, \"line\");\n\taline.setAttribute(\"x2\", x2len);\n\taline.setAttribute(\"y2\", y2len);\n\taline.setAttributeNS(null, 'stroke-width', stroke_width);\n\taline.setAttributeNS(null, 'stroke', stroke_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Array retrieve ( Array arr , Rectangle rect ) returns an array of stored (Rectangle)objects in the QuadTree, check recursively into subquads. arr the result container. rect the searching scope. | retrieve ( arr , rect ) {
const index = this.getIndex(rect)
if (index !== -1 && this.nodes[0]) {
arr = arr.concat( this.nodes[index].retrieve( arr , rect ) )
}
arr = arr.concat( this.objects )
return arr
} | [
"getShapesInRange(pos) {\n let arr = [];\n for (let i = draEng.shapes.length - 1; i >= 0; i--) {\n if (draEng.shapes[i].inRange(pos)) arr.push(draEng.shapes[i]);\n }\n return arr;\n }",
"getIndex (rect){\n\n var index = -1\n //\n const verticalMidPoint = this.bounds.x + this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
progress backward thru the rest of the input, counting any left [ and ] brackets it passes to find the [ that this function was called for | function rightbracket(input, i){
if(memory[pointer] != 0){
var bracketCount = 0;
for(var j =i-1; j > 0; j--){
switch(input.charAt(j)) {
case ']': //]
bracketCount++;
break;
case '[': //[
if(bracketCount == 0){
return j;
}else{
bracketCount--;
}
break;
}
... | [
"function leftbracket(input, i){\n\tif(memory[pointer] == 0){\n\tvar bracketCount = 0;\n\tfor(var j=i+1; j<input.length; j++){\n\t\tswitch(input.charAt(j)) {\n\t\t\tcase '[':\n\t\t\t\tbracketCount++;\n\t\t\t\tbreak;\n\t\t\tcase ']':\n\t\t\t\tif(bracketCount == 0){\n\t\t\t\t\treturn j;\n\t\t\t\t}else{\n\t\t\t\t\tbra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the deepest cached node whose ID is a prefix of `targetID`. | function findDeepestCachedAncestor(targetID) {
deepestNodeSoFar = null;
ReactInstanceHandles.traverseAncestors(
targetID,
findDeepestCachedAncestorImpl
);
var foundNode = deepestNodeSoFar;
deepestNodeSoFar = null;
return foundNode;
} | [
"function rootNode(obj, target_var){\n var pos = 0;\n var neg = 0;\n for(var i = 0; i < obj.length; i++){\n if(obj[i][target_var] == 1){\n pos = pos + 1;\n } else {\n neg = neg + 1;\n }\n }\n tot = pos + neg;\n pos1 = Math.log2(pos/tot)*pos/tot\n neg1 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return: void Logs a failure message as error failureMessage: string = Failure message to log as error | static Failure(failureMessage) {
if (failureMessage === null) {
console.log("Test Failure");
return;
}
if (typeof failureMessage === 'object')
failureMessage = JSON.stringify(failureMessage);
console.error(`Test Failure: ${failureMessage}`);
} | [
"errorMsg (title, expected, actual) {\n console.log(colors.red(`FAILED ${title.toUpperCase()}`))\n\n if (arguments.length === 4) {\n expected = JSON.stringify(expected)\n actual = JSON.stringify(actual)\n console.log(` Expected ${expected}\\n but got ${actual}`)\n }\n }",
"failure(co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show or Hide Leave Quota View Sub Div | function showHideLeaveQuotaRoleDiv(){
if(document.getElementById('leaveQuotaMenuViewId').checked==true){
document.getElementById('leaveQuotaMenuSubTableDivId').style.display = "block";
}else{
document.getElementById('leaveQuotaMenuSubTableDivId').style.display = "none";
}
} | [
"function showHideWorkExperienceRoleDiv(){ \n\tif(document.getElementById('empExperienceMenuViewId').checked==true){\n\t\tdocument.getElementById('workExperienceMenuSubTableDivId').style.display = \"block\";\n\t}else{\n\t\tdocument.getElementById('workExperienceMenuSubTableDivId').style.display = \"none\";\n\t}\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displays that player 1 starts the game. displays the variable 'turn' (which is set at player 1 or player 2). is called at the bottom of the script. | function playerTurn() {
setMessage(turn + "'s turn");
} | [
"function gameStart() {\n let random = Math.random();\n if (random > 0.5) {\n playerTurn = true;\n playerMessage.text('Your Turn');\n } else {\n playerTurn = false;\n loader.show();\n computerAction();\n }\n}",
"function initState() {\r\n var player1, player2, p1tag, p2tag;\r\n\r\n document.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Void > Void Adds the radio buttons for selecting gender | function addGender() {
addLabel("Gender");
var genForm = document.createElement("form");
genForm.id = "GenderText";
var br = document.createElement("br");
var male = document.createElement("input");
male.name = "gender";
male.type = "radio";
male.id = "Male";
male.value = "Male";
... | [
"static set radioButton(value) {}",
"function handleSex(){\n defaultHandler();\n var selectSex = document.getElementById( gSexId );\n var sex = selectSex.options[selectSex.selectedIndex].value;\n \n //hide all the questionaries firs\n HideElements(gaAllElements);\n \n if (sex == \"1\"){ ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Performs text detection on the local file | function detectMe(fileName) {
vision.textDetection({ source: { filename: fileName } })
.then((results) => {
const detections = results[0].textAnnotations;
console.log('Text:');
detections.forEach((text) => console.log(text));
})
.catch((err) => {
console.error('ERROR:', err);
});
} | [
"function Load_Stop_Words_File(evt)\n{\n if(evt.target.files[0]) //if the file is available\n {\n var reader = new FileReader(); //create new reader file\n reader.readAsText(evt.target.files[0]); //get file\n reader.onload = function(e) //wait for the file to load\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a transition and apply the transition to the gl state. There is no order to the elements in each transition object, for ordering, create separate transitions and order them at the top level glstate array. | function parseTransition(gl, transitionJSON) {
checkParameter("parseTransition", gl, "gl");
checkParameter("parseTransition", transitionJSON, "transitionJSON");
for (item in transitionJSON) {
var value = transitionJSON[item];
if (item === "width") {
gl.canvas.width = value;
gl.viewport(0, 0, v... | [
"setTransition(T){ \r\n\t\tfor(var i=0;i<this.nStates;i++){\r\n\t\t\tfor(var j=0;j<this.nInputs;j++){\r\n\t\t\t\tthis.stateHolder[i].transitions[this.inputs[j]] = new Array();\r\n\t\t\t\tfor(var k=0;k<T[i][j].length;k++){\r\n\t\t\t\t\tif(T[i][j][k] == -1){\r\n\t\t\t\t\t\tthis.stateHolder[i].transitions[this.inputs[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove extra underscore from escaped identifier. See | function unescapeIdentifier(identifier) {
return identifier.startsWith('___') ? identifier.substr(1) : identifier;
} | [
"function addunderscores( str ){ return str.replace(/\\'|\\\"| /g, '_'); }",
"function fixID(field)\n{\n field.value = field.value.replace(/[^0-9A-Z_]/gi, '');\n}",
"function _g_chr_2(str) {\n\tlen=str.indexOf(\"_\");\n\tstr=str.substring(len+1);\n\tlen=str.indexOf(\"_\");\n\tstr=str.substring(len+1);\n\tret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets Adapter State and name and list of paired devices The names are then entered in the dropdowns for selection of RHO and LHO Initial connection state set to "disconnected" Called when Phonegap event "deviceready" has been fired | function getBtDevices() {
// The status of the local adapter
networking.bluetooth.getAdapterState(function (adapterInfo) {
// The adapterInfo object has the following properties:
// address: String --> The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'.
// name: String --> The hum... | [
"scan(){\n // TODO : scan for new devices\n let ret=\"\", dev=[], device=null,re=null,id=null;\n\n this.count = 0;\n if(this.Bridges.ADB.isReady()){\n dev = this.Bridges.ADB.listDevices();\n this.count += dev.length;\n\n for(let i in dev){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
section: mockreq.js Class MockRequest I use mock HTTP requests (and responses) for tests. In some situations, I also use them in production. The MockRequest object actually implements both the ServerRequest and the ServerResponse inferfaces. It is an EventEmitter with some additional events: 'data' when emitData() is i... | function MockRequest( response ){
Events.EventEmitter.call( this)
this.uniqueId = MockRequest.id++
if( !response ){
this.model = "ServerRequest"
this.url = ""
this.headers = {}
this.method = "GET"
this.connection = {}
}else{
this.model = "ServerResponse"
}
} | [
"function mock({ request = {}, response = {} }) {\n return nock(/\\.authy\\.com/)\n .get('/protected/json/app/stats')\n .query(request.query ? request.query : true)\n .reply(response.code, response.body);\n}",
"function GenericRequest() {}",
"function MockCuriousClient() { }",
"request(options, call... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert rgb array e.g.([218, 82, 82]) to hex e.g.'DA5252' | rgbToHex (array) {
var hexChars = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'};
var result = '';
for (var i = 0; i < array.length; i++) {
var d1 = parseInt(array[i] / 16);
result += hexChars[d1];
var d2 = array[i] - (d1 ... | [
"function rgb2hexa(str) {\n colors=/^rgb\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/.exec(str);\n hexa = \"#\";\n for (i=1; i<colors.length; i++) {\n color = colors[i];\n if (color>255) color=255;\n hexacolor = parseInt(color, 10).toString(16).toLowerCase();\n hexacolor = (hexacolo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to generate csv formatted string of example data, x and y are lengths | function generateTestData(x, y) {
var buffer = "";
for (var i = 0; i < y; i++) {
for (var j = 0; j < x; j++) {
if (j != 0) buffer += ',';
buffer += Math.floor(Math.random() * 49);
}
buffer += '\n';
}
return buffer;
} | [
"function createBlob() {\n\tblob = [];\n\tfor (let i = 0; i < xValues.length; i++) {\n\t\tblob.push(\"x: \" + String(xValues[i]) + \", y: \" + String(yValues[i]))\n\t}\n\tsaveStrings(blob, 'coodrinateList.txt');\n}",
"function createCSV(state, data) {\n let string = stateToCSV(state) + '\\n\\n';\n let keys ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an active cursor value at a given mapIndex location. | function getCurrentSyncCursor(mapIndex) {
if (mapIndex >= MAP_CURSORS.length) {
MAP_CURSORS.push(1 /* ValuesStartPosition */);
}
return MAP_CURSORS[mapIndex];
} | [
"cursorIndex(){\n if (this.cursorContainer && this.cursorX && this.cursorY && !this.lockPosition){\n return this.cursorContainer.getIndex(this.cursorX,this.cursorY)\n }\n return null\n }",
"function get_value(loc, mode, intcode) {\r\n if (mode == 0) {\r\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculate the "measure" M of a word. M is the count of VC sequences dropping an initial C if it exists and a trailing V if it exists. | function measure(token) {
if(!token)
return -1;
return categorizeGroups(token).replace(/^C/, '').replace(/V$/, '').length / 2;
} | [
"function parseMeasure(m) {\n var o = parseMeasure2(m);\n if (isNaN(o.value)) {\n stop('Invalid parameter:', m);\n }\n return o;\n}",
"function totalWC(word) {\n\t\t\treturn word.split(\"\").filter(char => char == \"*\").length;\n\t\t}",
"function normalizeMeasures(part) {\n const measuresLengths = part... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to create a shallow wrapper around SearchPanelNavigation | function createWrapper(props) {
return render(
<SearchPanelNavigation
companionWindowId="cw"
direction="ltr"
windowId="window"
{...props}
/>,
);
} | [
"configureSearch() {\n // If the filterable setting is disabled, no events should be applied automatically\n // (This behavior is intended for allowing custom filtering applications)\n if (this.settings.filterable) {\n accordionSearchUtils.attachFilter.apply(this, [COMPONENT_NAME]);\n accordionSe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds points for the launches of a given day to the display list, after clearing the previous display | function displayDate(year, month, day) {
var entries = [];
// Loads launches from current day's launch data
if(launchData[year] && launchData[year][month] && launchData[year][month][day]) {
entries = launchData[year][month][day];
}
// Right now this clears the points completely
// Later we may change... | [
"fill () {\n for (let i = 0; i < ScheduleList.DAY_HOURS; i++) {\n this.list[i] = []\n }\n }",
"function stopwatchLap(){\n // event.preventDefault();\n console.log(\"lap time!\");\n\n //throw current time into an array\n lapTime = formatTime(rawTime);\n // console.log(lapTime);\n laps.push(lapTim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pop all selection events off the end of a history array. Stop at a change event. | function clearSelectionEvents(array) {
while (array.length) {
var last = lst(array);
if (last.ranges) array.pop();
else break;
}
} | [
"ShiftHistoryArray()\n {\n for(let i = 0; i < this.state.cellStateHistory.length-1; ++i)\n {\n this.state.cellStateHistory[i] = this.state.cellStateHistory[i+1].slice();\n };\n }",
"selectionSetDidChange() {}",
"function clearHistory() {\n // don't clear the history if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lower cases an element's localName property | function LC(element) {
return element.localName.toLowerCase();
} | [
"function cleanTagName( name ) {\n\t\treturn name.split( ':', 1 )[ 0 ].replace( /[^a-zA-Z]/g, '' ).toLowerCase();\n\t}",
"function getLocalName(iri) {\n return splitIri(iri)[1];\n}",
"function convert_attr_name_to_lowercase(code)\n{\n\tr = /(style=[\"'][^\"']*?[\"'])/gi;\n\treturn code.replace(r,function(s1,s2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
declarar funcion nueva funcion para hacer muchas elipses en lugares aleatorios | function muchasElipses(){
//for loop
//for(inicio; condicion; refresco) {}
for (var i = 0; i < 100; i++) {
//elipse en posicion aleatorio
ellipse(random(width), random(height), 100, 100);
}
} | [
"function Morse(letra)\n{\n var codificacion;\n\n /* SOLUCION BRUTA\n switch(letra)\n {\n \tcase \"A\":\n \t\tcodificacion=\"·-\";\n \t\tbreak;\n \tcase \"B\":\n \t\tcodificacion=\"-···\";\n \t.....\n }*/\n //USANDO ARRAY A B C D E F\n var tabla=[\"·-\",\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For all requires where the context (the path to the file issuing the require statement) matches the specified regular expression, replace require('net') with TcpPolyfill. When used with the rethinkdb driver, TCP connections to a rethinkdb database will be proxied through a WebSocket. | function TcpPolyfillPlugin(contextPattern) {
this.contextPattern = contextPattern;
} | [
"function readFileSyncReplacingUrl(fileName, req) {\n var port = app.get('port');\n var host = req.protocol + '://' + req.hostname + (port == 80 || port == 443 ? '' : ':' + port);\n var data = fs.readFileSync(fileName, defaultCharset);\n return data.replace(/http:\\/\\/localhost:8080/g, host);\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh an individual report | function refreshReport(event) {
const refresher = event.target
actions.loadReport(selectedTripId, true).finally(() => refresher.complete())
} | [
"function refreshWorksheetData(){\n const worksheet = props.selectedSheet;\n worksheet.getDataSourcesAsync().then(sources => {\n for (var src in sources){\n sources[src].refreshAsync().then(function () {\n console.log(sources[src].name + ': Refreshed Successf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take in an SVG element, dissect it into its pieces and create a constraints system that can be steered. Restrictions: only certain elements are supported ('line', 'a', 'ellipse', 'circle', 'path') no groups no inner translations | function init(svg) { // (SvgSvgElement) => ()
const coll = svg.children; // HTMLCollection
const items = Array.from(coll); // convert 'HTMLCollection'
const constraints = new Map(); // Map of name -> [{ cType: string, params: [writable of, ...] }]
items.forEach( item => {
const nodeType = item.n... | [
"static childBounds(svgElement) {\n var result \n svgElement.childNodes.forEach(ea => {\n var r = ea.getBoundingClientRect() \n var b = rect(r.x, r.y, r.width, r.height)\n result = (result || b).union(b)\n })\n return result\n }",
"function calculateConstraintsFromDom(constrain... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the maximum size of the points in the data, before any scaling | _getMaxPointSize() {
const e = this.encoders.size;
if (e.constant) {
return e(null);
} else {
return /** @type {number[]} */ (e.scale.range()).reduce((a, b) =>
Math.max(a, b)
);
}
} | [
"@computed\n get maxDistancePx() {\n return Math.sqrt(\n Math.pow(this.windowDimensions.width / 2, 2) +\n Math.pow(this.windowDimensions.height / 2, 2),\n );\n }",
"function getBubbleSizeRange(values) {\n var sizeMinMax = [];\n sizeMinMax = d3.extent(values, function (obj) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cardio Training Box margin from Gym Box | function marginCardioBox() {
var gymCol = $('.col--gym').outerHeight();
var gymLinkBox = $('.offers__link--gym').outerHeight();
var diffHeight = gymCol - gymLinkBox;
var cardioLinkBox = $('.offers__link--cardio');
$(cardioLinkBox).css('margin-top', -(diffHeight - 30));
} | [
"function getMargin(bed) {\n\tif(!bed.hasOwnProperty('margin') || bed.margin == undefined){\n\t\tbed.margin = 1;\n\t}\n\treturn bed.margin;\n}",
"_getBreakBox(){\n\t\tvar c = new box(0, 0, tilesize / 2, tilesize / 2);\n\t\tc.centerAt(this.pos.plus(this.aimDir.multiply(tilesize)));\n\t\treturn c;\n\t}",
"goalPan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines a transition between a start and end value that takes ms milliseconds and uses func as a timing function (from the list above, or of a custom creation). manual animation thewayilikeit | function Tween(start, end, ms, func) {
this.start = start;
this.end = end;
this.duration = ms;
this.startTime = -1;
this.timingFunction = func || TimingFunctions.linear;
// fun fact: I used this.start() before, not knowing that it was already defined as a property
// a few lines above
/... | [
"function Transition() {}",
"function tween(duration, fn) {\n if (!fn) return;\n var start = +new Date, duration = duration||1000, finish = start+duration\n var interval = setInterval(function(){\n var time = +new Date, pos = time>finish ? 1 : (time-start)/duration;\n if (fn(pos) || (time>finish)) { clea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`saveQueryState` saves to localstorage data related to the data table state. | saveQueryState() {
this.localStorageObj.put('queryState', {
pageSize: this.state.pageSize,
currentPage: this.state.currentPage,
sort: this.state.sort,
searchTerm: this.state.searchTerm,
filterType: this.state.filterType
});
} | [
"function stateSaveCallback(settings, data) {\n var stado = $('#tablaConsultaBecariosInternos').DataTable().state();\n localStorage.setItem('tablaConsultaBecariosInternos' + window.location.pathname, JSON.stringify(stado))\n }",
"saveState() {\n\t\tlocalStorage.setItem(\"state\", JSON... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the change interval will contain any new (added) drawables | function intervalHasNewInternalDrawables( interval, firstStitchDrawable, lastStitchDrawable ) {
if ( interval.drawableBefore ) {
return interval.drawableBefore.nextDrawable !== interval.drawableAfter; // OK for after to be null
}
else if ( interval.drawableAfter ) {
return interval.drawableAfter.previousD... | [
"function intervalHasOldInternalDrawables( interval, oldFirstStitchDrawable, oldLastStitchDrawable ) {\n if ( interval.drawableBefore ) {\n return interval.drawableBefore.oldNextDrawable !== interval.drawableAfter; // OK for after to be null\n }\n else if ( interval.drawableAfter ) {\n return interval.draw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete G Suite Identity Provider | deleteIdentityprovidersGsuite() {
return this.apiClient.callApi(
'/api/v2/identityproviders/gsuite',
'DELETE',
{ },
{ },
{ },
{ },
null,
['PureCloud OAuth'],
['application/json'],
['application/json']
);
} | [
"deleteIdentityprovidersPurecloud() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/purecloud', \n\t\t\t'DELETE', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"dele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================================// ParameterSnegNovi ========================================================================// visina novozapadlega snega klima, padavine | function ParameterSnegNovi(parent, name, id, mval, bval) {
Parameter.apply(this, [parent, name, id, mval, bval]);
this.min = -1;
var h = parseInt(this.parent.nadm_visina);
this.max = 300;
this.maxW = ((parseInt(this.parent.nadm_visina) <= 1500))? 200 : null;
} | [
"function ParameterSnegSkupaj(parent, name, id, mval, bval) {\n Parameter.apply(this, [parent, name, id, mval, bval]);\n this.min = -1;\n var h = parseInt(\"\" + this.parent.nadm_visina);\n\tthis.max = (h >= 3000)? null : ((h >= 2000)? 1400 : ((h >= 1500)? 1000 : ((h >= 1000)? 800 : ((h >= 500)? 500 : 300))));\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a function that acts as decorator annotation object | function createDecoratorAnnotation(annotation) {
function decorator(target, property) {
storeAnnotation(target, property, annotation);
}
return Object.assign(decorator, annotation);
} | [
"function ClassDecoParm(NAME) {\r\n return function (target) {\r\n console.log(`Class Decorator`);\r\n console.log(`My Name is :${NAME} Target ${target}`);\r\n };\r\n}",
"function makePropertyDecorator(typeFunction) {\n return function(object, propertyName) {\n if (typeof typeFunction !== ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This JavaScript makes capitalizes the initial letter of all words and the rest of the letters lowercase. It also removes extra space between words. Two values need to be specified, the form name and the field name to be processed. | function CapitalizeNames(myform,fieldname) {
var ValueString = new String();
eval('ValueString=document.'+FormName+'.'+FieldName+'.value');
ValueString = ValueString.replace(/ +/g,' ');
var names = ValueString.split(' ');
for(var i = 0; i < names.length; i++) {
if(names[i].length > 1) {
names[i] = names[i... | [
"function allCapsTitleTrimmed(originalText) {\n\tvar text = originalText.trim();\n\ttext = text.toUpperCase();\n\tdocument.getElementById(\"txtTitle\").value = text;\n}",
"function caps(str){\n return str.replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the survival mode is activated. Spawns enemies repeatedly if there are less than 10 alive at once. | function survival() {
ui.setText("EnemyCounter", "");
if (game.enemiesAlive == 0 && !game.waveActive) {
waveCooldown();
} else if (game.waveActive) {
if (game.enemiesAlive < 10) {
gameWorld.createEnemy();
}
}
} | [
"generateEnemies() {\n // Run the spawn timer\n this.timer++;\n if (this.enemies.length == 0) {\n this.timer += 2;\n } else if (this.enemies.length == 1) {\n this.timer += 1;\n }\n\n if (\n this.timer >= this.spawnDelay &&\n this.enemies.length < MAX_ENEMIES.value\n ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getChromeURI converts a URL to a URI url: string of a URL ( returns: a nsiURI object representing the given URL | function getChromeURI(url) {
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
return ios.newURI(url, null, null);
} | [
"function getResolvedURI(url) {\n var chromeURI = getChromeURI(url);\n var resolvedURI = Components.classes[\"@mozilla.org/chrome/chrome-registry;1\"].\n getService(Components.interfaces.nsIChromeRegistry).\n convertChromeURL(chromeURI);\n\n try {\n resolvedURI = resolved... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy properties from jqXhrToCopy to fakeJqXhr. This is makes fakeJqXhr behave properly. | function fakeJqXhrInheritance(fakeJqXhr, jqXhrToCopy) {
Object.keys(jqXhrToCopy).forEach((key) => {
if (typeof jqXhrToCopy[key] === 'function') {
fakeJqXhr[key] = jqXhrToCopy[key].bind(jqXhrToCopy);
} else {
fakeJqXhr[key] = jqXhrToCopy[key];
}... | [
"function copyObjectJQuery (obj) {\n return jQuery.extend(true, {}, obj);\n}",
"function IAjaxCloneable() {}",
"function patchXhrSend() {\n if(_xhrSendIsPatched) {\n return;\n }\n\n var prototypeSplash = getHH(XMLHttpRequest.prototype);\n prototypeSplash.oldXhrSend = XML... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
places 16 tiles in the puzzle area, the first 15 using background.jpg, the 16th blank | function placeTiles() {
var i = 1;
for (var t = 0; t < 400; t += 100) {
for (var left = 0; left < 400; left += 100) {
var tile = document.createElement("div");
tile.className = "tile";
document.getElementById("puzzlearea").appendChild(tile);
tile.style.top = t + "px";
tile.style.left ... | [
"function setBg () \r\n\t{\r\n\t\tvar x = '0px';\r\n\t\tvar y = '0px';\r\n\r\n\t\tfor (var i = 0; i < puzzlePieces.length; i++) //iterates over the puzzle piece and specifies the part of the image to be shown\r\n\t\t{\r\n\t\t\tpuzzlePieces[i].style.backgroundPosition = x + \" \" + y;\r\n\r\n\t\t\tif (parseInt (x, 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Splits a URI into its component parts. Each component can be accessed via the component indices; for example: goog.uri.utils.split(someStr)[goog.uri.utils.CompontentIndex.QUERY_DATA]; | function _split(uri) {
return uri.match(_splitRe);
} | [
"function splitPath( path, scheme, first ) {\n return path.split('/')\n .slice( first||0 )\n .map(function splitOp( op ) {\n return new ContentOp( scheme, op.split(';').map( decodeURIComponent ) );\n });\n}",
"routeSplitter(url) {\n if (url === '/' || url === '*' || url === 'global') return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
play animation on click and check corectness | function playStuff() {
gsapAnimation(this);
userClicks.push("#"+this.id);
checkCorrectness();
} | [
"function gifClicked() {\n largeGifAppears(this);\n automatedSpeech();\n}",
"function checkAnimation() {\n var $elems = $('.animate_when_in_view:not(.start)');\n\n // If the animation has already been started\n // if ($elem.hasClass('start')) return;\n\n $elems.each(function(){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delegates to the locationDelegate.current method. This should return the current location of the app. | function current() {
return locationDelegate.current()
} | [
"getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(this.saveLocation)\r\n } else {\r\n let error = \"Unable to locate you.\"\r\n alert(error)\r\n }\r\n }",
"function getLocation() {\n //If browser supports geoloc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the TimeSeries with one or more Point. | getTimeSeries(now) {
return {
labelValues: this.labelValues,
points: [{ value: this.value, timestamp: now }],
startTimestamp: this.startTimestamp,
};
} | [
"slice(begin, end) {\n const size = this.size();\n const b = resolveBegin(begin, size);\n const e = resolveEnd(end, size);\n\n if (b === 0 && e === size ) {\n return this;\n }\n\n const events = [];\n for (let i = b; i < e; i++) {\n events.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checkAt(): se fija si existe alguna entidad en las coordenadas que se le pasan como argumentos (xa , ya). | function checkAt(xa, ya)
{
for (var i = 0; i < entidades.length; i++)
{
var c = entidades[i];
if (c.x == xa && c.y == ya)
return c;
}
return null;
} | [
"function isAt(x, y){\n for(var i = 0; i < tileArray.length; i++){\n if(tileArray[i]._x == x && tileArray[i]._y == y){\n return true;\n }\n }\n return false;\n }",
"function check_point(p) {\n if (p.x < 0 || p.x > 9) {\n return false;\n } e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get next records pages | function GetRecordsNext(){
CleanTable('available_records_table');
GetRecords(records.next_page);
} | [
"async getNext() {\n if (this.hasNext) {\n const items = Items([this.parent, this.nextUrl], \"\");\n return items.getPaged();\n }\n return null;\n }",
"nextPage(){\n BusinessActions.nextPage();\n }",
"function visitNextPage() {\n\t var _url = _this.visitableL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the closest variable from a node | function getClosestVariable(name, node, opts) {
var variables = getVariables(node);
var variable = variables[name];
if (requiresAncestorVariable(variable, node)) {
variable = getClosestVariable(name, node.parent, opts);
}
if (requiresFnVariable(variable, opts)) {
variable = getFnVariable(name, node, opts.va... | [
"function rootNode(obj, target_var){\n var pos = 0;\n var neg = 0;\n for(var i = 0; i < obj.length; i++){\n if(obj[i][target_var] == 1){\n pos = pos + 1;\n } else {\n neg = neg + 1;\n }\n }\n tot = pos + neg;\n pos1 = Math.log2(pos/tot)*pos/tot\n neg1 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to cancel equip an equipment | function cancelEquipItem(itemIndex) {
player.items[itemIndex]["eq"] = false;
player.equipments[player.items[itemIndex].part] = null;
calculateEquipmentStat();
rebuildItemTable(player.items, controller.itemTableOffset, controller.itemTableLimit);
} | [
"function Sequence$cancel(){\n\t cancel();\n\t action && action.cancel();\n\t while(it = nextHot()) it.cancel();\n\t }",
"function inspectorCancel(e) {\r\n if (e.which === 27) {\r\n cancelInspector();\r\n }\r\n }",
"cancel(invitation) {\n axios.delete(`/settings/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlight the result list item at a given index | function highlightFromList(index) {
$('.' + column + '-result-li').css({ 'background':'#fff' });
$('.' + column + '-result-li').eq(index).css({ 'background': '#eee'});
} | [
"function theClickedItem(item) {\n setHighlightItem(item);\n }",
"function highlightItems(color, items){\n items.style({\"stroke\":color, \"opacity\": \"1\"});\n}",
"highlightSelected() {\n\n this.highlighter.setPosition(this.xStart + this.selected * this.distance, this.yPosition + this.highlighterO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
recibe por parametro un proveedor y vuelve sus atributos a un formato de row en html | function stringRowsHtmlProveedor(proveedor){
let respuesta = "<tr>\n";
respuesta += "<td>" + proveedor.idproveedor + "</td>\n";
respuesta += "<td>" + proveedor.nombrecompania + "</td>\n";
respuesta += "<td>" + proveedor.nombrecontacto + "</td>\n";
respuesta += "</tr>\n";
return respuesta;
... | [
"function stringRowsHtmlCliente(cliente){\r\n let respuesta = \"<tr>\\n\";\r\n respuesta += \"<td>\" + cliente.idCliente + \"</td>\\n\";\r\n respuesta += \"<td>\" + cliente.NombreCompania + \"</td>\\n\";\r\n respuesta += \"<td>\" + cliente.NombreContacto + \"</td>\\n\";\r\n respuesta += \"</tr>\"\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the site script syntax (JSON) for a specific list | getSiteScriptFromList(listUrl) {
return SiteScriptsCloneFactory(this, "GetSiteScriptFromList").run({ listUrl });
} | [
"function ExtractSenseInformation(list, color) {\n var result = [];\n $.each(list, function(_, item) {\n result.push(\n '<span class=\"highlight-' +\n color +\n \" \" +\n color +\n '-highlight\" rel=\"tooltip\" data-original-title... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
10 Se tiene el nombre y la edad de tres personas. Se desea saber el nombre y la edad de la persona de menor edad | function Ejercicio10() {
var persons = [
{ nombre: "Bruno Sánchez ", edad: 21 },
{ nombre: "Wendy Flores ", edad: 22 },
{ nombre: "Maritza Escajadillo ", edad: 15 },
];
var keyMenor = 0;
var edadMenor = 0;
console.log("----- Respuesta 10 -----");
for (let index = 0; index < persons.lengt... | [
"function adios(nombre,edad){\n console.log(`hasta luego ${nombre} recuerda que tengo ${edad} años!`)\n}",
"bornInThe70() {\n let content = this.title(\"Entrepreneurs né dans les 70's \") +\n this.people\n .filter(person => /^197\\d$/.test(String(person.year)))\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter tasks for text and return sum from it | function array_filter_from_text_sum(array, text, key_name, sum_field) {
sum_field = sum_field || 'duration'
array = array_filter_from_text(array, text, key_name)
var sum_total = sum_float_convert_from_array_underscore(array, sum_field)
return sum_total
} | [
"function task_filter_text_calculate_sum(array, text, sum_field) {\n sum_field = sum_field || 'duration'\n array = array.filter(function(D) {\n return D.content.toLowerCase().indexOf(text.toLowerCase()) !== -1\n })\n var sum_total = sum_float_convert_from_array_underscore(array, sum_field)\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to check the file type and open the file previews accordingly. | function Viewer() {
if (acceptedFileTypes.includes(fileType)) return PdfViewer()
else if (acceptedMsOfficeTypes.includes(fileType))
return DisplayUsingOfficeApps()
else return error()
} | [
"loadPreviews () {\n this.files.map(file => {\n if (!file.previewData && window && window.FileReader && /^image\\//.test(file.file.type)) {\n const reader = new FileReader()\n reader.onload = e => Object.assign(file, { previewData: e.target.result })\n reader.readAsDataURL(file.file)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test a stream with the following process: 1. take input as array 2. turn the array into a stream 3. pipe through stream to be tested 4. pass output of that stream to a callback function 5. assertions can then be made in that callback Callback signature should be something like function callback(error, result) | function test_stream(input, testedStream, callback) {
var input_stream = event_stream.readArray(input);
var destination_stream = event_stream.writeArray(callback);
input_stream.pipe(testedStream).pipe(destination_stream);
} | [
"function testIntegerStreamWithData(data) {\n\t\t//We have to wrap all this in a promise so that the test runner\n\t\t//will wait until the asynchronous code has had a chance to complete\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t//Create a Node.js read stream with the test data\n\t\t\tconst readStream =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A comparator takes two arguments and uses some algorithm to compare them. If the first argument is larger or greater than the 2nd it returns true, otherwise it returns false. Here is an example that works on integers | function exComparator( int1, int2){
if (int1 > int2){
return true;
} else {
return false;
}
} | [
"function isGreaterThan (first, second) {\n if (first > second) {\n return true;\n }\n}",
"function isGreaterThan (first,second){\n\tif (first > second){\n\t\treturn true;\n\t}\n}",
"function compareValues(val1, val2){\r\n\tif (val1 > val2) {\r\n\t\treturn -1;\r\n\t} else if(val2 > val1) {\r\n\t\treturn 1;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a single point for controlling game timer, start, stop, and pause are controlled via this function. | function timerControl( pAction ) {
console.log( "Entered timer control, action = '" + pAction + "'" );
if ( pAction === "start" ) {
ptrTimer.innerHTML = secondsPerQuestion;
secondsRemaining = secondsPerQuestion;
window.clearInterval( timer ); // Ensure that the timer has stopped
timer = window.setInterval... | [
"function update_timer() {\n seconds = Math.floor(game.time.time / 1000);\n milliseconds = Math.floor(game.time.time);\n elapsed = game.time.time - starting_time;\n}",
"function startGame() {\n initialise();\n setInterval(timer, 10);\n}",
"function startGameTimer()\n{\n var start = new Date().ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides the album creator on completion | albumModalFinished() {
this.setState({showAlbumCreationModal: false});
} | [
"function shownewalbum(){\n document.getElementById('hidenewalbum').style.visibility=\"hidden\";\n document.getElementById('hidenewalbum').style.display=\"none\";\n document.getElementById('shownewalbum').style.display=\"block\";\n document.getElementById('shownewalbum').style.visibility... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grant currency to a specific user I need to send this function a specific user to add and the requester. Not the command object/context. | function grantCurrency(command, context, callback) {
if (isMod(context)) {
if (["gold", "silver"].indexOf(command[2])) {
new Banking.Account(context["user-id"], account => {
console.log("accountExists: " + account.accountExists);
let twitch = new Twitch('mjy60l6upiqb62b46kq1hyp6gwo... | [
"async approveNewUser(ctx, name, aadhar) {\n // Verify the CLient is an registar or not\n let cid = new ClientIdentity(ctx.stub);\n let mspID = cid.getMSPID();\n if (mspID !== \"registrarMSP\") {\n throw new Error('You are not authorized to invoke this fuction');\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |