Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
this calculates the descent speed using the same formulas found in worker.js ~ line 164
function findDescentSpeed (thisFlight) { // see if we have enough descent points to calculate if ((thisFlight.keypoints.touchdown.id - thisFlight.keypoints.burst.id) < 7) { alert("Not enough samples in the decent to calculate the descent rate."); return 5.0812; // 1000 f/m in meters ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcSpeed(){\n\treturn this.distance/(this.time/60);//miles per hour\n }", "getspeed() {\n\t\tif(this.vars.alive){\n\t\t\treturn distance(this.vars.x,this.vars.y,this.vars.px,this.vars.py);\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "function calculateSpeed() {\n var sp = valueWithVariance(script.api.spe...
[ "0.6732992", "0.65874505", "0.655584", "0.6420995", "0.62063897", "0.61933947", "0.61867017", "0.6162877", "0.61515087", "0.6120728", "0.6110096", "0.60879326", "0.60139924", "0.5986553", "0.59784836", "0.59619063", "0.59485936", "0.5942456", "0.59421533", "0.59392965", "0.59...
0.7096002
0
This function returns the air density in kg/m^3 when given the alt. in meters
function getDensity (alt) { if (alt <= 0) { return 1.22500000} else if (alt <= 500 ) { return 1.16730000; } else if (alt <= 1000) { return 1.11170000; } else if (alt <= 1500) { return 1.05810000; } else if (alt <= 2000) { return 1.00660000; } else if (alt <= 2500) { return 0.956...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function altcalc(a, k, i) {\n // a= sea level in atmospheres\n // k= temperature in kelvin\n // i= pressure in pascals\n if ((a / i) < (101325 / 22632.1)) {\n var d = -0.0065;\n var e = 0;\n var j = Math.pow((i / a), (R * d) / (g * M));\n return e + ((k * ((1 / j) - 1)) / d)...
[ "0.6784951", "0.6319006", "0.6319006", "0.60912204", "0.5860188", "0.58581454", "0.5853267", "0.56272537", "0.55763716", "0.5549266", "0.55428594", "0.55391014", "0.553606", "0.55107486", "0.5489871", "0.5475528", "0.5441477", "0.5409245", "0.53999853", "0.5336231", "0.532236...
0.72386694
0
helper function to set the attribute of something to a value or removes it if the value is undefined.
function setOrUnset(obj, key, value) { if (value === undefined) delete obj[key]; else obj[key] = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "safeSetAttribute(name, value) {\n if (this.getAttribute(name) !== value) this.setAttribute(name, value); \n }", "setAttribute(element, attributeName, value) {\n if (value === null || value === undefined) {\n element.removeAttribute(attributeName);\n } else {\n element.setAttribute(attribute...
[ "0.7068221", "0.69594353", "0.6807179", "0.6633338", "0.6587625", "0.6579918", "0.64090955", "0.6405468", "0.64053226", "0.63940287", "0.63940287", "0.63940287", "0.63940287", "0.63690406", "0.63479275", "0.6293133", "0.62396914", "0.6224495", "0.6224495", "0.62125796", "0.62...
0.6562131
7
gets the own property of an object
function getOwnProperty(obj, name) { return Object.prototype.hasOwnProperty.call(obj, name) ? obj[name] : undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOwnProperty(obj, name) {\n\t\t\t\treturn Object.prototype.hasOwnProperty.call(obj, name)\n\t\t\t ? obj[name] : undefined;\n\t\t\t}", "function getPropertyOwner(obj, prop) {\n var chainObj = null\n walkChain(obj, prop)\n return chainObj\n\n function walkChain(obj, prop) {\n if (Object.prototyp...
[ "0.68861115", "0.68486303", "0.6739999", "0.65617895", "0.64802355", "0.6315631", "0.6191407", "0.6178341", "0.6104007", "0.6078663", "0.6074002", "0.6066547", "0.60248613", "0.60248613", "0.60248613", "0.6019003", "0.60170615", "0.59970236", "0.59940654", "0.59940654", "0.59...
0.675652
2
instanciate a class without calling the constructor
function cheapNew(cls) { disable_constructor = true; var rv = new cls; disable_constructor = false; return rv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "static Instantiate() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function construct() { }",...
[ "0.75136423", "0.72990495", "0.72990495", "0.72990495", "0.72990495", "0.72990495", "0.72990495", "0.7168771", "0.7168771", "0.7168771", "0.7051977", "0.6908456", "0.6908456", "0.6908456", "0.69048417", "0.69048417", "0.6865427", "0.6865427", "0.6865427", "0.6865427", "0.6865...
0.66743034
67
The constructed object should have a `fullText` property that contains _only_ the full text. The constructor should throw or log an error when the cloze deletion does _not_ appear in the input text.
function getClozePosition(fullText, cloze){ var start = fullText.indexOf(cloze); console.log("\nstart: ", start); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClozeCard = function(text, cloze) {\n\n this.text = text; \n this.cloze = cloze; \n //ClozeCard should have a property or method that contains or returns only the partial text.\n //ClozeCard should have a property or method that contains or returns only the full text.\n //ClozeCard should t...
[ "0.666282", "0.64901006", "0.56112665", "0.5524204", "0.54761946", "0.5455756", "0.5352796", "0.5269773", "0.5260287", "0.52296907", "0.5216643", "0.51541597", "0.51338565", "0.51042914", "0.51042914", "0.51042914", "0.51042914", "0.51042914", "0.51042914", "0.51042914", "0.5...
0.0
-1
You can enable the strict mode commenting the following line 'use strict'; This function will contain all our code
function myLibrary() { var _myLibraryObject = {}; // Just create a property to our library object. _myLibraryObject.myCustomLog = function (thingToLog) { console.log("My-Custom-Log > Type of variable : " + typeof (thingToLog)); console.log("My-Custom-Log > Is number : "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strictMode() {\n 'use strict';\n\n //..\n //..\n }", "function strictly() {\n 'use strict';\n\n}", "function forUseStrict() {\n \"use strict\";\n // start coding from here\n console.log(\"hello world\");\n}", "function foo() {\n \"use strict\";\n}", "function nonStrictMode() {\n le...
[ "0.85410553", "0.8077599", "0.78513527", "0.77402127", "0.76288086", "0.7462265", "0.7369846", "0.72910106", "0.70753837", "0.69697076", "0.67981297", "0.66685754", "0.66685754", "0.6660238", "0.6548352", "0.65333056", "0.6436932", "0.6436932", "0.6349246", "0.6342906", "0.63...
0.0
-1
Test debug event for break point.
function f() { var i; // Line 1. for (i = 0; i < 1000; i++) { // Line 2. x = 1; // Line 3. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listener(event, exec_state, event_data, data) {\n try {\n if (event == Debug.DebugEvent.Break) {\n if (state == 3) {\n assertEquals(expected_source_line_text,\n event_data.sourceLineText());\n assertEquals(expected_function_name, event_data.func().name());\n ...
[ "0.7329247", "0.6390925", "0.6372868", "0.6339779", "0.6323832", "0.6092277", "0.57776487", "0.57224864", "0.5705947", "0.5702143", "0.5608254", "0.5522236", "0.54968226", "0.5478846", "0.54788065", "0.54567283", "0.5407044", "0.53953356", "0.5394728", "0.53906006", "0.53465"...
0.0
-1
label one side of the box
function label_side(x, label, date) { label.move(x, bbox.cy); var hour_mins = pad(date.getHours(),2) + ""+pad(date.getMinutes(),2); label.text(hour_mins); var pbbox = label.bbox(); label.dx(-pbbox.w/2).dy(-pbbox.h/2); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLabel() {\n p.push();\n p.textFont('Courier New');\n p.textStyle(p.BOLD);\n p.textAlign(p.LEFT);\n p.textSize(15);\n p.fill('black');\n p.noStroke();\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight - 20);\n p.pop();\n }", "fun...
[ "0.6205865", "0.6161747", "0.6010886", "0.6000186", "0.58896196", "0.5885067", "0.5871883", "0.583887", "0.58190155", "0.5783099", "0.57646036", "0.5724692", "0.5682303", "0.56815714", "0.56671554", "0.5664189", "0.5637253", "0.5608873", "0.56082684", "0.5600625", "0.55985916...
0.67528576
0
Genera la tabla productos
function validaSelects(idForm) { idForm.validate({ rules: { idComTipoClt: { required: true, number: true } }, messages: { idComTipoClt: { required: "Selecciona una opción valida", number: "S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateProductsTable (size) {\n var productsTable = [];\n for (let i = 0; i < size; i++) {\n productsTable.push(Data.newProduct());\n }\n return productsTable;\n}", "function generateTable() {\n var data = [];\n\n for (var i = 0; i < 30; i++) {\n var row = [];\n row.push(commands[Math.ro...
[ "0.74915004", "0.7066148", "0.70532686", "0.7053155", "0.6897856", "0.68966687", "0.68661714", "0.68661714", "0.6840556", "0.6836795", "0.67892736", "0.67892325", "0.67807746", "0.67723864", "0.6763024", "0.6644165", "0.6643685", "0.6629772", "0.66245645", "0.6622652", "0.661...
0.0
-1
Function Creates catgirl and returns the configured object.
function makeCat() { VCAT = new Catgirl(); return VCAT; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCat(){\n var cat = {\n\tname: nameList[getRandomInt(0,nameList.length-1)],\n\tage: getRandomInt(0,100),\n\tcolor: getColor()\n };\n return cat;\n}", "function createCats(cats) {\n\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function c...
[ "0.62168956", "0.59915465", "0.57989866", "0.57989866", "0.57989866", "0.57989866", "0.5725601", "0.56049025", "0.5553077", "0.55161774", "0.54815006", "0.54792327", "0.54774743", "0.5383028", "0.5329696", "0.53011316", "0.5294901", "0.5283264", "0.5260357", "0.525011", "0.52...
0.6410227
0
HTML FUNCTIONS Creates a cat girl then exports it to a new html card
function exportToCatCard() { //Gets the card template var wrapper = $(".catcard-container"); var container = $("#CatCardTemplate").clone(); wrapper.empty(); //Loops through array of catgirls and makes each a seperate card with their info in it. for (var i in catArrayMain) { //creat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardCreate(){\n'<div class=\"well\">' +\n'<h3>' + \"name\" + '</h3>' +\n'<p>' + 'content' + '</p>' + \n'</div>'; \n}", "function generateCat() {\n let image = document.createElement(\"img\");\n let div = document.getElementById(\"flex-cat-gen\");\n image.src =\n \"https://thecatapi.com/api/images...
[ "0.68911743", "0.68668205", "0.685338", "0.68443733", "0.6836863", "0.68319213", "0.67861855", "0.674326", "0.674089", "0.6700449", "0.6683338", "0.6659662", "0.66297466", "0.6593544", "0.6582662", "0.65797037", "0.6565245", "0.6562302", "0.65544575", "0.6532566", "0.6519147"...
0.61557037
58
Updates an existing html cat girl card
function exportCatToHTMLCard(index) { var elemID = "#catCard" + index; exportInfo(index, $(elemID)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editingCat(name) {\n\tlet cat = catList.find(\n\t\tcatInList => {\n\t\t\treturn catInList.name === name;\n\t\t}\n\t);\n\tdocument.querySelector(\"#catTitle\").innerHTML += cat.name;\n\tdocument.querySelector(\"#name\").setAttribute(\"value\", cat.name);\n\tdocument.querySelector(\"#url\").setAttribute(\"v...
[ "0.6754422", "0.6609395", "0.6570546", "0.65534765", "0.647439", "0.64535826", "0.62948406", "0.623829", "0.6200438", "0.61864334", "0.6150482", "0.61326885", "0.6052057", "0.60362136", "0.60284376", "0.59546137", "0.59335446", "0.59312665", "0.59031713", "0.5874", "0.5847698...
0.0
-1
Exports directly to html if it exists or returns the cloned html container to be used.
function exportInfo(cat) { var wrapper = $(".catcard-container"); var container = $("#CatCardTemplate"); wrapper.empty(); container.id = "NewCatCard"; container.css("display", "block"); $(".name", container).text(cat.name); $(".age", container).text(cat.age); $(".hieght", container).t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exportPage() {\n // generate html page\n const page = `<html><head><style>${css}</style></head><body>${html}</body></html>`;\n \n // create html blob with html we created\n const blob = new Blob([ page ], { type: \"text/html\" });\n\n // create a download link\n const el = window.docu...
[ "0.6449974", "0.6205173", "0.60484046", "0.60415345", "0.5798612", "0.57768506", "0.57439125", "0.57288414", "0.5711059", "0.5708385", "0.561836", "0.5569838", "0.5563291", "0.5558088", "0.55460304", "0.55276966", "0.5490968", "0.54881245", "0.5469662", "0.54381883", "0.54320...
0.0
-1
this class displays the list containing all the piece cards
render() { return ( <div> {this.props.list.map(piece => <div key={piece.name} className="image_div"> <img src={piece.src} alt="blah" className="image" /> <div className="image_desc"> <div>...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayCards() {\n jQuery('.card-image').animate({left:-2000},1000,function(){$(this).remove()});\n var cols = board.showColumns();\n /*els.column1.innerHTML = cols[0].listCards(\"column1\");\n els.column2.innerHTML = cols[1].listCards(\"column2\");\n els.column3.innerHT...
[ "0.70368856", "0.70151585", "0.6990646", "0.6877991", "0.685126", "0.68461484", "0.6796733", "0.6787706", "0.67339104", "0.67023706", "0.6663238", "0.6657329", "0.66487205", "0.66151583", "0.6584535", "0.657083", "0.65698755", "0.65693986", "0.65686804", "0.6560488", "0.65467...
0.0
-1
Finding Factorials / Do you know what a factorial of a number is? You can get the factorial of a number by multiplying all the numbers less than or equal to that number. As an example, 5! (5 factorial), is equal to 5 X 4 X 3 X 2 X 1 = 120. Would you please write a solution for Robin that returns the factorial of that n...
function factorial(num) { if (num <= 1) { return 1; } return num * factorial(--num); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorial(number) { // Recibe un valor entero positivo\n if (number < 0) // Si es valor es un numero negativo entonces devuelve un -1 para hacer saber al usuario que se ingreso un valor invalido\n return -1; // retorno de valor invalido \n else if (number == 0) // Si el valor es 0, por defin...
[ "0.8272374", "0.81475157", "0.80426997", "0.8012145", "0.7967978", "0.79666936", "0.7958629", "0.79345226", "0.7931281", "0.79295504", "0.7904547", "0.78984874", "0.7898452", "0.78975296", "0.78872895", "0.7877819", "0.7873268", "0.78698426", "0.786746", "0.7860674", "0.78594...
0.0
-1
More Binary Search! / Now is the time for review! If you have been solving problems daily, then you've been solving problems for around two months now. Rather than let your practice go to waste, it's always good to refresh your memory. That being said, why don't you take another stab at creating a function that perform...
function recursiveBinarySearch(array, target, start = 0, end = Number.POSITIVE_INFINITY) { if (start >= end) { return `${target} not found`; } if (end > array.length) { end = array.length; } let midPoint = Math.floor((start + end) / 2); let value = array[midPoint] if (value === target) { retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binarySearch(list, item) {\n let min = 0;\n let max = list.length - 1;\n let guess = null;\n\n while (min <= max) {\n guess = Math.floor((min + max) / 2);\n\n if (list[guess] === item) {\n return guess;\n } else {\n if (list[guess] < item) {\n ...
[ "0.83872384", "0.829284", "0.8073904", "0.7988935", "0.79841924", "0.7966478", "0.7838738", "0.7746538", "0.7741371", "0.77305657", "0.77261937", "0.77202517", "0.7642861", "0.76384586", "0.76128244", "0.76060283", "0.75978374", "0.75941", "0.75925064", "0.758253", "0.7558629...
0.0
-1
Get Reference Data from Baseline
function generateRefencedData() { data_array = ['BmaImFn']; var dl_model1 = null; var dl_model2 = null; angular.forEach(data_array, function(value, key) { obj_array = $scope.bs_data[value]; model_name = value; var particular_value_1 = null; var particular_value_2 = null; if(model_name == 'BmaImFn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getReference(){\n\t\treturn this.reference;\n\t}", "function get_refcon_data(resultMap, refconDataPath) {\n\n // Load EVE reference data from tab file \n var loadResult;\n glue.inMode(\"module/hepadnaviridaeTabularUtility\", function() {\n\t loadResult = glue.tableToObjects(glue.command([\"load-tabu...
[ "0.60589963", "0.5973026", "0.5918988", "0.5884503", "0.5665452", "0.5659107", "0.564364", "0.56034064", "0.56034064", "0.55536133", "0.5549221", "0.55061734", "0.5486163", "0.5454947", "0.5407814", "0.5372703", "0.5366105", "0.5351416", "0.53490824", "0.5316657", "0.5298744"...
0.0
-1
x values of letters: 0 80 67 77
function mouseOver(){ console.log("mouseOver by EventListener. "+ this.$rectRed); //this.$rectRed.innerHTML = '<rect y="66" x="0" height="81" width="80" id="rect3" style="display:inline;fill:#e23b3b;fill-opacity:1;stroke-width:1.26025" />'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stringX() {return this.x - 0.5*this.r/2;}", "function countXx(value){\n var count = 0;\n for(var i =0;i<value.length;i++){\n \n if(value.charAt(i) == \"x\" && value.charAt(i+1) == \"x\"){\n count = count+1;\n }\n }\n return \"count of xx is : \"+ count;\n}", "functio...
[ "0.66078895", "0.6169659", "0.6124355", "0.6059175", "0.6031731", "0.6031731", "0.6031731", "0.59489954", "0.59124213", "0.58084035", "0.5768094", "0.5765068", "0.5759723", "0.5723816", "0.57227415", "0.56934977", "0.5669367", "0.5641767", "0.56229454", "0.5614893", "0.561407...
0.0
-1
const SERVER = " const proxyurl = "
function App() { // var socket = io.connect(proxyurl+'http://localhost:5000'); // socket.on('connection',()=>{ // console.log("socket connected"); // }) return ( <> <Router> <Switch> <Route path='/' exact component={Home} /> <Route path='/features' component={Features}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getServerUrl() {\n const {\n host,\n port\n } = this.serverConfig;\n return `//${host || 'localhost'}:${port}`;\n }", "function getProxy() {\n var url = '';\n var d = new Date();\n var day = d.getDate();\n if(day < 18) url = 'https://temp-proxy.herokuapp.com/';\n else url = 'ht...
[ "0.66276646", "0.6432256", "0.64178944", "0.6136629", "0.6097863", "0.6033489", "0.6033489", "0.6033489", "0.6033489", "0.6033489", "0.6033489", "0.6033489", "0.6033489", "0.6033489", "0.6019797", "0.6019797", "0.6019797", "0.6019797", "0.6019797", "0.6019797", "0.6019797", ...
0.0
-1
With alpha set to false on 2d context for optimized performance, set bg color styles.
_setBackgroundLayerStyles() { this.b.fillStyle = "white"; this.b.fillRect(0, 0, WORLD.WIDTH, WORLD.HEIGHT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setBackground()\n{\n canvas.style.backgroundColor = 'rgb(' + [paintColor[0],paintColor[1],paintColor[2]].join(',') + ')';\n}", "background(r, g, b) {\n this.ctx.canvas.style.backgroundColor = getColorString(this.palette, r, g, b);\n }", "function drawBackground() {\n context.fillStyle = \"gray...
[ "0.68111813", "0.6742155", "0.65646154", "0.655866", "0.65499413", "0.6545556", "0.6526794", "0.64276373", "0.6419432", "0.64056814", "0.6385124", "0.6363523", "0.6351794", "0.6316888", "0.631312", "0.6298229", "0.62503266", "0.62499076", "0.623774", "0.6122158", "0.61084217"...
0.68917066
0
Static store of oauth clients
function ostore(config) { var base = this; //Init the store base.store = []; //Create the store from the config file for(var kind in config) { base.store[kind] = new oauth(config[kind]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getOauthClients() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/oauth/clients', \n\t\t\t'GET', \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}", "function getOauth() {\n return init()...
[ "0.68526876", "0.6463709", "0.6187562", "0.60629606", "0.58596534", "0.57516164", "0.5672941", "0.56667954", "0.56065094", "0.55921745", "0.55644", "0.555381", "0.55200654", "0.55191636", "0.5481025", "0.5465613", "0.5462721", "0.54489666", "0.54199946", "0.54159814", "0.5410...
0.65966314
1
callback is another function function asyncCode(arg1, arg2, callback)
function printMessage(timeout, message, callback) { let error = null; setTimeout(() => {return callback(error, message);}, timeout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "AsyncCode()\n {\n\n }", "function someAsyncApiCall(callback) { callback(); }", "async function helloCatAsync(callback) {\n console.log(\...
[ "0.7305843", "0.7305843", "0.7305843", "0.7305843", "0.7305843", "0.7265756", "0.7111273", "0.70530427", "0.6874253", "0.6869451", "0.6858781", "0.6677735", "0.66542697", "0.66064006", "0.65761137", "0.6572835", "0.6399396", "0.639326", "0.6362232", "0.6362232", "0.6361041", ...
0.0
-1
claim an async function
async function statusVerified(err, payload){ if (err) { _handle_ErrCatched(new authorizedError("invalid token detect at /stattus, "+err, 32), req, res); } else { try{ let userId = payload.user_Id; let userInfo = await _DB_users.findOne({ where: {id: userId}, attri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function MyAsyncFn () {}", "async function test() {}", "async function myFn() {\n // wait\n}", "async function asyncFn(){\n\n return 1;\n}", "async method(){}", "async function func() {\n return 1;\n}", "static async method(){}", "async function myFunc() {\n // Function body here...
[ "0.65005463", "0.64413184", "0.63048136", "0.61881083", "0.61204314", "0.60929775", "0.6050661", "0.604159", "0.6024887", "0.60074574", "0.5879364", "0.58133656", "0.57793176", "0.57793176", "0.57708645", "0.57201594", "0.5688626", "0.56847584", "0.5667841", "0.56137526", "0....
0.0
-1
constructor: include properties to be exposed when class is instantiated including injected dependencies
function ServiceRequestCreateController(serviceTypeOwnerGroupListResolved, serviceTypeSearchSharingService) { //methods to be executed immediately //serviceTypeOwnerGroupListResolved is resolved in ui-router and injected into constructor this.serviceTypeOwnerGroupListRes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.init();\n }", "constructor() {\n super();\n this._init();\n }", "constructor() {\n\t\t// ...\n\t}", "constructor() {\n // Data / properites / state\n // The difference between the properties and regular\n // variables is that the properie...
[ "0.6590732", "0.6584008", "0.65170264", "0.64989173", "0.64960074", "0.64829504", "0.64829504", "0.6456733", "0.639209", "0.6358025", "0.6355839", "0.6339428", "0.6316753", "0.6300826", "0.6300826", "0.6277185", "0.625461", "0.62446314", "0.6213836", "0.62091935", "0.62091076...
0.0
-1
end adornment clicking the button inserts a new node to the right of the selected node, and adds a link to that new node
function addNodeAndLink(e, obj) { adorn = obj.part; if (adorn === null) return; e.handled = true; diagram = adorn.diagram; diagram.startTransaction("Add State"); // get the node data for which the user clicked the button fromNode = adorn.adornedPart; fromData = fromNode.data; if(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNodeAndLink(e, obj)\n {\n adorn = obj.part;\n if (adorn === null) return;\n e.handled = true;\n diagram = adorn.diagram;\n diagram.startTransaction(\"Add State\");\n // get the node data for which the user clicked the button\n fromNode = adorn.adorned...
[ "0.7134418", "0.68706596", "0.6857733", "0.6737213", "0.66726536", "0.65030724", "0.6414104", "0.6412203", "0.6396506", "0.62775815", "0.624616", "0.618729", "0.6111183", "0.6093403", "0.6078782", "0.60616356", "0.60341585", "0.6022313", "0.60177183", "0.60160583", "0.600828"...
0.70511705
1
Make all ports on a node visible when the mouse is over the node
function showPorts(node, show) { diagram = node.diagram; if (!diagram || diagram.isReadOnly || !diagram.allowLink) return; it = node.ports; while (it.next()) { port = it.value; port.stroke = (show ? "black" : null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPorts(node, show) {\n var diagram = node.diagram;\n if (!diagram || diagram.isReadOnly || !diagram.allowLink) return;\n node.ports.each(function(port) {\n port.stroke = (show ? \"white\" : null);\n });\n }", "function showPorts(node, show) {\r\n\t\tvar dia...
[ "0.68384296", "0.67273575", "0.659803", "0.64467794", "0.64108294", "0.61795866", "0.6176805", "0.61339134", "0.60739774", "0.60619694", "0.60558134", "0.60349154", "0.60311496", "0.60307926", "0.59918165", "0.5984783", "0.5984783", "0.5887099", "0.5882776", "0.58646333", "0....
0.67514795
1
Show the diagram's model in JSON format that the user may have edited
function save() { str = myDiagram.model.toJson(); document.getElementById("mySavedModel").value = str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showModel() {\n document.getElementById(\"mySavedModel\").textContent = myDiagram.model.toJson();\n }", "function setupDiagram() {\n myFullDiagram.model = go.Model.fromJson(document.getElementById(\"mySavedModel\").value);\n}", "function save() {\n str = myDiagram.model.toJson();\n...
[ "0.78591186", "0.7041924", "0.7032448", "0.69939476", "0.6973279", "0.6969131", "0.6894306", "0.6678446", "0.6243406", "0.6140354", "0.6111954", "0.5966898", "0.59575176", "0.5869838", "0.5815336", "0.5734586", "0.5722795", "0.56941074", "0.56903404", "0.56835866", "0.5565994...
0.7118658
1
color parameterization When a Link is selected, highlight it and both connected Nodes.
function linkSelectionChanged(link) { if (link.isSelected) { highlightLink(link, highlightColor); // highlightNode(link.fromNode, highlightColor); // highlightNode(link.toNode, highlightColor); } else { highlightLink(link); // highlightNode(link.fromNode); // h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignLinkColor(link) {\t\t\r\n\tif(link.type === \"npe\") {\r\n\t\t// Non-provenance edges are styled as blue.\r\n\t\treturn d3.rgb('rgb(0,0,255)').toString();\r\n\t} else { \r\n\t\treturn d3.rgb('rgb(0,0,0)').toString();\r\n\t}\r\n\t\r\n\t// Alternatively, we could return a color depending on whether th...
[ "0.7239056", "0.70825535", "0.69259804", "0.6693035", "0.66590416", "0.6623291", "0.66183025", "0.65877205", "0.65670604", "0.64411306", "0.6433396", "0.6362178", "0.6360043", "0.63379425", "0.63282436", "0.63099974", "0.63067466", "0.629783", "0.62960696", "0.62939924", "0.6...
0.76408935
0
Highlight a Link by changing its Shape.stroke and strokeWidth.
function highlightLink(link, color) { if (link === null) return; shape = link.findObject("LINKSHAPE"); if (shape === null) return; if (color !== undefined) { if (!shape.previousStroke) shape.previousStroke = shape.stroke; shape.strokeWidth = 3; shape.stroke = color; } else {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightLink() {\r\n // Extract dimensions / coord from highlighted element\r\n const linkCoords = this.getBoundingClientRect();\r\n // Set the highlight elements dimensions and coords based on THIS' data\r\n highlight.style.width = `${linkCoords.width}px`;\r\n highlight.style.height = `${...
[ "0.70818263", "0.68019336", "0.64731807", "0.6134637", "0.6045406", "0.6025002", "0.6004742", "0.59987813", "0.5990956", "0.59823865", "0.5952225", "0.5894865", "0.5882235", "0.58809286", "0.57734704", "0.57554984", "0.5733758", "0.5719973", "0.5713425", "0.56872994", "0.5687...
0.7876129
0
prefixed function name with underscore because delete is a reserved word in javascript
function _deleteStory(id) { const requestOptions = { method: 'DELETE', url: `story/delete/${id}` }; return api(requestOptions) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DELETE(){\n\n}", "delete() {\n\n }", "deleteTattoo () {\n\n }", "delete() {}", "function _() { undefined; }", "deleteAction() {}", "function cleanFunctionName(functionName) {\n var ignoredPrefix = 'non-virtual thunk to ';\n if (functionName.startsWith(ignoredPrefix)) {\n return function...
[ "0.7140352", "0.6536662", "0.6408207", "0.6400776", "0.63786656", "0.6142274", "0.61331004", "0.60533977", "0.60481656", "0.6043114", "0.6017167", "0.6017167", "0.6017167", "0.6017167", "0.6017167", "0.5994116", "0.5933315", "0.5909854", "0.59088683", "0.58877385", "0.5881809...
0.0
-1
region Ajax Call And create table
function GetAllFindInBomAjaxCall() { if (requestQueryForFindInBom.pageNumber === 1) { disableButton(PreviousButtons.findInBom); ActiveButton(NextButtons.findInBom); } else { ActiveButton(PreviousButtons.findInBom); ActiveButton(NextButtons.findInBom); } requestQuery...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillTable(base_url, tblname) {\n $.ajax({\n url: base_url,\n type: 'POST',\n data: {param: 'static'},\n success: function(response) {\n //Parseamos el json y lo asignamos a una variable\n $data = jQuery.parseJSON(response);\n //hacemos una ll...
[ "0.7413668", "0.72625685", "0.7082285", "0.69938195", "0.6962054", "0.6951777", "0.69149876", "0.6897888", "0.6879086", "0.6830747", "0.68249124", "0.6816442", "0.68115157", "0.6778048", "0.67716646", "0.6676931", "0.665744", "0.6638108", "0.66249645", "0.6622204", "0.6614331...
0.0
-1
The nextSibling attribute points also to "text nodes" which might be created by spaces or even newlines in the HTML code and not to the next painted dom object. This works around the problem and really returns the next object.
function real_next_sibling(o) { var n = o.nextSibling; while (n.nodeType != 1) n = n.nextSibling; return n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get nextSibling() {\n return this._nextSibling;\n }", "function next(n){\t\n while((n = n.nextSibling) && n.nodeType != 1);\n return n;\n }", "nextSibling() { return this.sibling(1); }", "function nativeNextSibling(renderer,node){return isProceduralRenderer(renderer)?renderer.nextS...
[ "0.7892698", "0.75427693", "0.7526954", "0.74491674", "0.7335714", "0.73004603", "0.7279789", "0.7182373", "0.71233994", "0.7117356", "0.7112825", "0.7112825", "0.71025956", "0.70698565", "0.70698565", "0.70698565", "0.704553", "0.704553", "0.704553", "0.704553", "0.704553", ...
0.75696355
1
simple string replace that replaces all occurrances. Unbelievable that JS does not have a builtin way to to that.
function replace_all(haystack, needle, r) { while (haystack.search(needle) != -1) haystack = haystack.replace(needle, r); return haystack; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceAll(x, y, z){\n return x.toString().replace(new RegExp(y, \"g\"), z);\n }", "function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n }", "function spiffingReplaceAll(str, find, replace)...
[ "0.70043904", "0.6956317", "0.69197506", "0.69119686", "0.6854206", "0.6841653", "0.68390304", "0.6805771", "0.6805771", "0.67898285", "0.6778821", "0.67707133", "0.6739394", "0.6599462", "0.6599079", "0.65988886", "0.65417", "0.64752805", "0.6457485", "0.6457485", "0.6452212...
0.66839516
13
Updates the contents of a snapin or dashboard container after get_url
function updateContents(id, code) { var obj = document.getElementById(id); if (obj) { obj.innerHTML = code; executeJS(id); obj = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshContainer(container, url, timeout) {\r\n $.get(url, \"\", function(data) {\r\n container.html(data);\r\n });\r\n window.setTimeout(function() {\r\n refreshContainer(container, url, timeout);\r\n }, timeout);\r\n }", "function updateSearchArea(c...
[ "0.6174716", "0.588147", "0.5796007", "0.55981046", "0.53427225", "0.5334276", "0.5331417", "0.52662194", "0.5252854", "0.5164826", "0.5133016", "0.51238436", "0.51148033", "0.50999004", "0.50864327", "0.5084856", "0.50758034", "0.50450337", "0.50194776", "0.50011504", "0.499...
0.0
-1
There may be some javascript code in the html code rendered by sidebar.py. Execute it here. This is needed in some browsers.
function executeJS(objId) { // Before switching to asynchronous requests this worked in firefox // out of the box. Now it seems not to work with ff too. So now // executing the javascript manually. // if (!isFirefox()) { var obj = document.getElementById(objId); executeJSbyObject(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeCode(e) {\n let frame = document.getElementById(\"explore-show\");\n let frameDoc =\n frame.contentWindow ||\n frame.contentDocument.document ||\n frame.contentDocument;\n let body = jar.toString();\n frameDoc.document.write(\n '<html><head><link rel=\"stylesheet\" href=\"st...
[ "0.6015833", "0.5828112", "0.5828112", "0.57527065", "0.57510597", "0.57504207", "0.5749551", "0.57329166", "0.57291985", "0.572443", "0.5709509", "0.56771976", "0.5671195", "0.56670314", "0.56661314", "0.5649124", "0.5646311", "0.5646311", "0.5646311", "0.5642878", "0.563872...
0.0
-1
Function gets the value of the given url parameter
function getUrlParam(name) { var name = name.replace('[', '\\[').replace(']', '\\]'); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); var results = regex.exec(window.location); if(results === null) return ''; else return results[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getURLParameter(param){\n var pageURL = window.location.search.substring(1); //get the query string parameters without the \"?\"\n var URLVariables = pageURL.split('&'); //break the parameters and values attached together to an array\n for (var i = 0; i < URLVariables.length; i++) {\n...
[ "0.77929455", "0.77073497", "0.76600665", "0.75497586", "0.75477564", "0.750239", "0.7487821", "0.74246407", "0.7391725", "0.73540974", "0.73514646", "0.7346183", "0.7323002", "0.7320931", "0.7314043", "0.73047245", "0.7301623", "0.73015314", "0.72988635", "0.72948575", "0.72...
0.0
-1
Function creates a new cleaned up URL Can add/overwrite parameters Removes _ parameters
function makeuri(addvars) { var tmp = window.location.href.split('?'); var base = tmp[0]; if(tmp.length > 1) { // Remove maybe existing anchors tmp = tmp[1].split('#'); // Split to array of param-strings (key=val) tmp = tmp[0].split('&'); } else { // Uri has no pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlFix(url){\r\n var _url = url;\r\n\r\n //delete params\r\n _url = url.replace(delParamReg, '');\r\n\r\n //overwrite and add params\r\n _url = _url.replace(overwriteParamReg, '').replace(/&$/, '');\r\n _url += '&' + addParams.join('&') + '&urlfixed=1';\r\n\r\n return _url;\r\n}", "...
[ "0.68206483", "0.6706345", "0.66959053", "0.6542465", "0.6426286", "0.64193904", "0.627804", "0.624967", "0.6239195", "0.62385005", "0.6209945", "0.61619455", "0.61487246", "0.6110145", "0.6099724", "0.60882396", "0.6086079", "0.60792255", "0.60602", "0.6033324", "0.6018039",...
0.59852135
22
Fallback bei doofer/keiner Antwort
function fallback_graphs(data) { for(var s = 0; s < 8; s++) { create_graph(data, '&host=' + data['host'] + '&srv=' + data['service'] + '&source=' + s); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fallback(agent) {\n\n agent.add(`Sorry, ich weiß gerade nicht was genau du suchst. Könntest du das noch mal anders formulieren?`);\n\n}", "function fallback(agent) {\r\n agent.add(`I didn't understand`);\r\n agent.add(`I'm sorry, can you try again?`);\r\n }", "function fallback(agent) {\r\n ...
[ "0.63393223", "0.5848649", "0.5848649", "0.5802271", "0.5802271", "0.57898384", "0.57391965", "0.5690425", "0.56119365", "0.54873747", "0.54491955", "0.5308008", "0.5120351", "0.5102631", "0.5090302", "0.5063596", "0.5039339", "0.50390077", "0.5032962", "0.5032731", "0.501027...
0.0
-1
Renders contents for the PNP hover menus
function pnp_hover_contents(url) { var c = get_url_sync(url); // It is possible that, if using multisite based authentication, pnp sends a 302 redirect // to the login page which is transparently followed by XmlHttpRequest. There is no chance // to catch the redirect. So we try to check the response con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank...
[ "0.5905613", "0.5895788", "0.5748572", "0.57443243", "0.57439935", "0.57380414", "0.56902707", "0.5683583", "0.56605095", "0.56360626", "0.55356437", "0.55190575", "0.5515605", "0.55110264", "0.55000633", "0.5445313", "0.5436588", "0.54267657", "0.5419146", "0.5418621", "0.54...
0.52202415
43
Handle Enter key in textfields
function textinput_enter_submit(e, submit) { var keyCode = e.which || e.keyCode; if (keyCode == 13) { if (submit) { var button = document.getElementById(submit); if (button) button.click(); } if (e.preventDefault) e.preventDefault(); e.retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleEnter(e) {\n if (e.key === \"Enter\") {\n handleInputSubmit();\n }\n }", "function enter(event){\r\n if (!textoEntrada.value==\"\"){\r\n if (event.keyCode == 13 || event.which == 13){\r\n analizar();\r\n }\r\n }\r\n}", "function pressEnter (event) {\n ...
[ "0.7759452", "0.7725058", "0.76957506", "0.7554145", "0.7471126", "0.7438869", "0.7377107", "0.7361559", "0.73592174", "0.7298578", "0.7287599", "0.7247535", "0.7240577", "0.7202738", "0.7178047", "0.7167228", "0.7158792", "0.71064496", "0.7104355", "0.7101012", "0.7093385", ...
0.71726984
15
Synchronous action handling Protocol is: For regular response: [ 'OK', 'last check', 'exit status plugin', 'output' ] For timeout: [ 'TIMEOUT', 'output' ] For error: [ 'ERROR', 'output' ] Everything else: Unknown format. Simply echo.
function actionResponseHandler(oImg, code) { var validResponse = true; var response = null; try { response = eval(code); } catch(e) { validResponse = false; } if(validResponse && response[0] === 'OK') { oImg.src = 'images/icon_reload.gif'; window.location.relo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function systemCommandResponseCallback(error, stdout, stderr)\n {\n var responseString =\n 'stdout: ' + pipeToString(stdout)\n + 'stderr: ' + pipeToString(stderr)\n + 'error: ' + error;\n console.log(\"command found \" + responseString);\n showForm(serverRequ...
[ "0.5702753", "0.5702753", "0.5702753", "0.5702753", "0.5680045", "0.55425024", "0.5511751", "0.5476264", "0.5360202", "0.51939213", "0.5158501", "0.51450706", "0.51438326", "0.5138523", "0.51197225", "0.5108758", "0.51047105", "0.5046156", "0.5034724", "0.49772945", "0.494585...
0.4623525
91
Highlights/Unhighlights a refresh button
function toggleRefreshButton(s, enable) { var o = document.getElementById('button-refresh-' + s); if(o) { if(enable) { o.setAttribute("className", "left w40 selected"); o.setAttribute("class", "left w40 selected"); } else { o.setAttribute("className", "left w4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_refresh()\n{\n refresh_con = refresh_con == 1 ? 0 : 1;\n $('refresh').innerHTML = refresh_con == 1 ? 'Refresh On' : 'Refresh Off';\n new Effect.Highlight( 'refresh', { duration: 3, endcolor: \"#2d2d2d\" } );\n}", "function refreshbtn() {\n clearInterval(timerId);\n myAnimantion()...
[ "0.74322885", "0.6465756", "0.6406878", "0.6384485", "0.631995", "0.630012", "0.6251001", "0.61998457", "0.6141926", "0.60626155", "0.6040394", "0.5994109", "0.59258294", "0.5917827", "0.59134674", "0.5911119", "0.58908564", "0.5887555", "0.5877211", "0.5867582", "0.5867241",...
0.6141181
9
When called with one or more parameters parameters it reschedules the timer to the given interval. If the parameter is 0 the reload is stopped. When called with two parmeters the 2nd one is used as new url.
function setReload(secs, url) { if (typeof url === 'undefined') url = ''; if (gReloadTimer) { toggleRefreshButton(0, false); toggleRefreshButton(gReloadTime, false); clearTimeout(gReloadTimer); } toggleRefreshButton(secs, true); toggleRefreshFooter(secs); if (s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reload()\n{\n clearInterval(interval);\n interval=setInterval(update,speed);\n}", "function reload_later(interval_seconds)\n{\n setTimeout(check_server_and_reload, (interval_seconds * 1000));\n}", "function refresh() {\r\nsetInterval(\"location.reload()\",2000);\r\n}", "function refresh() {\...
[ "0.67406833", "0.6428289", "0.63647217", "0.6151757", "0.6113547", "0.60573524", "0.60499364", "0.6005642", "0.5999832", "0.5998387", "0.5930063", "0.5880403", "0.58299136", "0.58299136", "0.58299136", "0.58033514", "0.57810414", "0.5739652", "0.57234067", "0.57147926", "0.57...
0.64346856
1
Check if an element has a certain css class.
function has_class(o, cn) { var parts = o.className.split(' '); for (x=0; x<parts.length; x++) { if (parts[x] == cn) return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasClass(element, cls) {\n return element.classList.contains(cls);\n}", "function hasClass(element, clas)\n{\n return (' ' + element.className + ' ').indexOf(' ' + clas + ' ') > -1;\n}", "function hasClass(css_class, element) {\r\n checkParams(css_class, element, 'hasClass');\r\n v...
[ "0.83023924", "0.8264901", "0.81263983", "0.8093305", "0.8093305", "0.8093305", "0.80609155", "0.8048739", "0.8041213", "0.8019472", "0.7980369", "0.7979883", "0.79705244", "0.79457444", "0.79374844", "0.79266787", "0.79220164", "0.79220164", "0.7919045", "0.7905854", "0.7898...
0.7480767
94
Is used to select/deselect all rows in the current view. This can optionally be called with a container element. If given only the elements within this container are highlighted. It is also possible to give an array of DOM elements as parameter to toggle all checkboxes below these objects.
function toggle_all_rows(obj) { var checkboxes = get_all_checkboxes(obj || document); var all_selected = true; var none_selected = true; var some_failed = false; for(var i = 0; i < checkboxes.length; i++) { if (g_selected_rows.indexOf(checkboxes[i].name) === -1) all_selected = f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectAll(target, notCheck){\r\n\t\tvar state = $.data(target, 'datagrid');\r\n\t\tvar opts = state.options;\r\n\t\tvar rows = state.data.rows;\r\n\t\tvar selectedRows = $.data(target, 'datagrid').selectedRows;\r\n\t\t\r\n\t\tif (!notCheck && opts.checkOnSelect){\r\n\t\t\tcheckAll(target, true);\t// don't...
[ "0.66418564", "0.6558926", "0.64860964", "0.63785917", "0.6277337", "0.6254934", "0.6215142", "0.6200202", "0.61483455", "0.6142582", "0.6115219", "0.6082456", "0.60820365", "0.60784745", "0.6056264", "0.5963767", "0.59524065", "0.5910295", "0.58962345", "0.5873076", "0.58662...
0.64843893
3
Iterates over all the cells of the given checkbox and executes the given function for each cell
function iter_cells(checkbox, func) { var num_columns = parseInt(checkbox.value); // Now loop the next N cells to call the func for each cell // 1. Get row element // 2. Find the current td // 3. find the next N tds var cell = checkbox.parentNode; var row_childs = cell.parentNode.childNodes;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCheckboxChanged(){\n this.onCheckboxChange({\n row: this.row\n });\n }", "function HandleCheckBox(tx) {\n\n CellData.ComponentType = \"checkbox\";\n CellData.ComponentSaveMode = \"bool\"; // puo salvare true/false o 1/0 bit\n CellData.ComboSelectedValue = '';\n CellData.ComboSelectedT...
[ "0.6209752", "0.61767817", "0.61609703", "0.59857106", "0.59600645", "0.5933491", "0.5899321", "0.58980376", "0.5893331", "0.5871677", "0.5846689", "0.5838094", "0.5838036", "0.58184946", "0.58105356", "0.5791622", "0.578862", "0.5785975", "0.5760648", "0.57560074", "0.574176...
0.72157055
0
Container is an DOM element to search below or a list of DOM elements to search below
function get_all_checkboxes(container) { var checkboxes = []; if(typeof(container) === 'object' && container.length) { // Array given - at the moment this is a list of TR objects // Skip the header checkboxes for(var i = 0; i < container.length; i++) { var childs = container...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchWidgets(pincode,container,results){\n let children = container.children;\n let temp = [],flag = true;\n for(let i=0;i<children.length;i++){\n if(this.checkIfContainer(children[i]))this.searchWidgets(pincode,children[i],results);\n else{\n if(!this.checkForPincode(pincode,children[i]...
[ "0.6392709", "0.61777693", "0.6100423", "0.60784554", "0.6070845", "0.6070845", "0.6070845", "0.6070845", "0.6070845", "0.6070845", "0.6070845", "0.6070845", "0.60405016", "0.6040231", "0.59980404", "0.59672904", "0.59438264", "0.59114295", "0.58369863", "0.58317894", "0.5819...
0.0
-1
convert percent to angle(rad)
function rad(g) { return (g * 360 / 100 * Math.PI) / 180; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function angleForPercentage(percentage) {\n var PI = 3.1415; // 2 * PI = 360\n return (percentage * 1.61 * PI);\n}", "degreeToRad(angle){\n return Math.PI*angle/180;\n }", "function toDegrees(angle){return angle*180/Math.PI}", "function convertAngle(c,x) { return c._useDegrees ? (x*pi/180) : ...
[ "0.8119852", "0.6995133", "0.68853825", "0.68623513", "0.68271935", "0.6779151", "0.6771211", "0.6761858", "0.67483336", "0.67422944", "0.67319024", "0.67199904", "0.671163", "0.6706058", "0.668798", "0.6677311", "0.66703427", "0.6662067", "0.66487914", "0.6639313", "0.661069...
0.64753306
52
.. | __ __ _ ____ | | \ \ / /_ _| |_ _ ___/ ___| _ __ ___ ___ | | \ \ / / _` | | | | |/ _ \___ \| '_ \ / _ \/ __| | | \ V / (_| | | |_| | __/___) | |_) | __/ (__ | | \_/ \__,_|_|\__,_|\___|____/| .__/ \___|\___| | | |_| | ++ | Functions needed by HTML code from ValueSpec (valuespec.py) | ''
function valuespec_toggle_option(oCheckbox, divid, negate) { var oDiv = document.getElementById(divid); if ((oCheckbox.checked && !negate) || (!oCheckbox.checked && negate)) oDiv.style.display = ""; else oDiv.style.display = "none"; oDiv = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function html() { return exports.htmlSyntax.extension; }", "function valueDescription(text) { }", "function value() { }", "static definition() {\n return 'A tree is a perennial plant with an elongated stem, or trunk, supporting branches and leaves.'\n }", "getHTML(){const e=this.strings.length-1;let t=...
[ "0.57262295", "0.56901556", "0.5425421", "0.5398672", "0.5367623", "0.5335741", "0.5258613", "0.52374125", "0.5212319", "0.52100444", "0.51671535", "0.516303", "0.5153164", "0.5143275", "0.51369566", "0.5113951", "0.5107674", "0.5104605", "0.5098114", "0.50855047", "0.5071823...
0.0
-1
This function is called after the table with of input elements has been rendered. It attaches the onFocusfunction to the last of the input elements. That function will append another input field as soon as the user focusses the last field.
function list_of_strings_init(divid) { var oContainer = document.getElementById(divid); var numChilds = oContainer.childNodes.length; var oLastChild = oContainer.childNodes[numChilds-1]; list_of_strings_add_focus(oLastChild); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "focusLastElement() {\n this.trapFocus(true);\n }", "doFocus() {\n this.__focusOnLast();\n }", "function Add_Input(){\r\n\tAppend_Row('#input_list');\r\n\tAppend_Row('#input_state');\r\n\tAppend_Row('#input_rules');\r\n\tApp_Reset();\r\n}", "function userInputField() {\n if (displayCompleted ...
[ "0.63075507", "0.62415236", "0.62305635", "0.60002375", "0.5948275", "0.5845038", "0.58045954", "0.57534873", "0.57388526", "0.56877506", "0.5686443", "0.56667405", "0.56614673", "0.5637577", "0.56310546", "0.5630803", "0.56212", "0.5620802", "0.5614728", "0.56129855", "0.559...
0.0
-1
Is called when the last input field in a ListOfString gets focus. In that case a new input field is being appended.
function list_of_strings_extend(oInput, j) { /* The input field has a unique name like "extra_emails_2" for the field with the index 2. We need to convert this into "extra_emails_3". */ var oldName = oInput.name; var splitted = oldName.split("_"); var num = 1 + parseInt(splitted[splitted.length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidUpdate(prevProps){\n this.nameInputs = this.nameInputs.filter(item => item !== null); //HACK: after removing, there is a null at last pos\n if(this.props.text.length > prevProps.text.length){\n this.focus = this.nameInputs[this.props.text.length-1];\n this.focus.focus();\n }\n els...
[ "0.67609817", "0.67175436", "0.66580886", "0.663766", "0.6588365", "0.6551623", "0.65039617", "0.64859927", "0.6483379", "0.6424639", "0.6418624", "0.64164156", "0.6414157", "0.6414157", "0.6414157", "0.6414157", "0.64038616", "0.6399592", "0.6399592", "0.6399592", "0.6378177...
0.5860177
44
When deleting we do not fix up indices but simply remove the according table row and add an invisible input element with the name varprefix + "_deleted_%nr"
function valuespec_listof_delete(oA, varprefix, nr) { var oTr = oA.parentNode.parentNode; // TR var oTbody = oTr.parentNode; oInput = document.createElement("input"); oInput.type = "hidden"; oInput.name = "_" + varprefix + '_deleted_' + nr oInput.value = "1" var oTable = oTbody.parentNode; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRow(i) {\r\n document.getElementById(\"mijntabel666\").deleteRow(i);\r\n }", "function deleteRow(id) {\n\n var buttonNro = id.toString().substring(14, 16);\n //console.log(\"id: \" + id + \", buttonNro: \" + buttonNro);\n\n var olderInputs = \"\";\n\n // if row clicked is not 0 (= ...
[ "0.6774529", "0.6716412", "0.6642727", "0.6568649", "0.65298516", "0.65245086", "0.646695", "0.64417195", "0.64112717", "0.6408052", "0.6404874", "0.63926166", "0.63880724", "0.6334319", "0.6325295", "0.63157666", "0.6303068", "0.62528014", "0.6250961", "0.6239873", "0.621080...
0.74767846
0
Switch filter, commands and painter options
function view_toggle_form(oButton, idForm) { var oForm = document.getElementById(idForm); if (oForm) { if (oForm.style.display == "none") { var display = ""; var down = "down"; } else { var display = "none"; var down = "up"; } }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showToolsFromButton(){\r\n\tactFilterNum = this.filterId;\r\n\t\r\n\t// this is still a hack:\r\n\t// unbind mouse from draw modus\r\n\t$('#image_canvas').unbind('mousedown');\r\n\t// reset draw filter radio button\r\n\tfor (var i = 0; i < filter.length; i++){\r\n\t\tif (filter[i].name == 'Draw'){\r\n\t\t...
[ "0.61733025", "0.61340445", "0.6050899", "0.59413826", "0.5886879", "0.58500654", "0.58385843", "0.5791838", "0.5769079", "0.5753986", "0.57454646", "0.57011163", "0.5661244", "0.56256396", "0.56115025", "0.55982035", "0.55687255", "0.5564089", "0.55356896", "0.5534334", "0.5...
0.0
-1
used for refresh und num_columns
function view_dial_option(oDiv, viewname, option, choices) { // prevent double click from select text var new_choice = choices[0]; // in case not contained in choices for (var c=0; c<choices.length; c++) { choice = choices[c]; val = choice[0]; title = choice[1]; if (has_class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColumnsCount() {\r\n}", "function onChangeColumns() {\n // Update selected rows\n if (component.initialized) {\n component.reportChangedColumns();\n // Reposition save buttons\n component.repositionSaveButton();\n }\n }"...
[ "0.6624466", "0.648557", "0.6329797", "0.63193274", "0.62386054", "0.62234586", "0.6178516", "0.6176507", "0.6176507", "0.61383444", "0.61030424", "0.61030424", "0.6084137", "0.60585815", "0.6039443", "0.6039019", "0.60108733", "0.59850687", "0.5984425", "0.59781104", "0.5977...
0.0
-1
way ranges from 10 to 10 means centered (normal place)
function turn_dial(option, text, way, direction) { var oDiv = document.getElementById("optiondial_" + option).firstChild; if (text && oDiv.innerHTML != text) oDiv.innerHTML = text; oDiv.style.top = (way * 1.3 * direction) + "px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set center(value) {}", "set Center(value) {}", "function centerTree(){\n moveForward(5);\n turnRight(47);\n moveForward(10);\n turnRight(133);\n moveForward(30);\n}", "function drawCenterStars(num)\n{\n \n}", "function conway(space) {\n //expand by 1 on active cell\n Object.entries(...
[ "0.5655068", "0.5608145", "0.54553664", "0.54130554", "0.5337149", "0.5328984", "0.532857", "0.5279021", "0.5265695", "0.5258853", "0.52549744", "0.5245921", "0.5242641", "0.52181816", "0.52033454", "0.5190137", "0.5189417", "0.5183063", "0.5177557", "0.5162948", "0.51627254"...
0.0
-1
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode, /* vue-cli only */ components, // fixed by xxxxxx auto components renderjs // fixed by xxxxxx renderjs ) { // Vue.extend constructor expo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (...
[ "0.584921", "0.57292086" ]
0.0
-1
Gnuplot version 4.6.0 short forms of commands provided by gnuplot_common.js
function DT (dt) {gnuplot.dashtype(dt);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plotScript(input, cb, op){\n\n\tvar options = {\n\t\tstream: 'all',\n\t\tterminal: defterminal, \n\t\toutput: false,\n\t\tframes: false,\n\t\tcolors:{\n\t\t\tI: '#ff0000',\n\t\t\tP: '#00ff00',\n\t\t\tB: '#0000ff',\n\t\t\tA: '#d200ff',\n\t\t\taverage: '#000000',\n\t\t\tbitrate: '#ff9016',\n\t\t},\n\t\tstyl...
[ "0.69897616", "0.5614913", "0.55009884", "0.49157798", "0.48730367", "0.4808895", "0.47869614", "0.47282785", "0.47133413", "0.46825966", "0.4654576", "0.46314922", "0.4623807", "0.46170178", "0.46128443", "0.46011412", "0.45935467", "0.4570918", "0.45692983", "0.45686245", "...
0.5979334
5
Whether we have reached EOF.
constructor(rbIter: any, nextFunc: string) { this.rbIter = rbIter; this.nextFunc = nextFunc; this.done = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eof() {\n return peek() == null;\n }", "function eof() {\n return peek() == \"\";\n }", "eof(): boolean {\n return this.position >= this.input.length;\n }", "function eof() {\n return peek() === \"\";\n }", "isEOF() {\n return this._cursor === this._string.leng...
[ "0.85807264", "0.8363994", "0.8363575", "0.826044", "0.821797", "0.8049754", "0.80494964", "0.79928124", "0.79866695", "0.7516677", "0.7515897", "0.7515897", "0.69857645", "0.67623186", "0.6688587", "0.6583111", "0.64304185", "0.63179314", "0.63179314", "0.62942964", "0.62745...
0.0
-1
$FlowIssue: Computed property keys not supported.
[Symbol.iterator]() { return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ComputedProperty() {}", "function toComputedKey() {\n var node = this.node;\n\n var key;\n if (this.isMemberExpression()) {\n key = node.property;\n } else if (this.isProperty()) {\n key = node.key;\n } else {\n throw new ReferenceError(\"todo\");\n }\n\n if (!node.computed) {\n if (t...
[ "0.75052106", "0.6697101", "0.66353875", "0.66353875", "0.65243924", "0.6355209", "0.6355209", "0.6272014", "0.62522167", "0.58202845", "0.58061457", "0.57893944", "0.5750434", "0.5679263", "0.5667131", "0.56609124", "0.56603086", "0.56576246", "0.5642457", "0.56221175", "0.5...
0.0
-1
$FlowIssue: It doesn't like what's going on here.
next() { let item = this.rbIter.data(); if (item) { let ret = { value: item, done: false }; this.rbIter[this.nextFunc](); return ret; } else { return { done: true } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "static transient final priv...
[ "0.65029454", "0.64078707", "0.6358187", "0.63021296", "0.60819864", "0.60238", "0.5941904", "0.5883666", "0.584224", "0.5827124", "0.57586455", "0.5753793", "0.5659001", "0.561033", "0.5582724", "0.5582724", "0.55639255", "0.5502794", "0.5496371", "0.5486911", "0.54581624", ...
0.0
-1
Sets the given key/value pair in the map, throwing an error if this key is already in the map.
add(key: K, val: V) { var ok = this.tree.insert([key, val]); if (!ok) { throw "Key was already present."; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set(key, value) {\n if (this.store) {\n // TODO: evict aldest keys when \n this.store.setItem(key, typeof value === 'string' ? value : JSON.stringify(value));\n this.map[key] = typeof value;\n } else this.map[key] = value;\n }", "set(key, value) {\n let index = this.hash(key);\n if (!...
[ "0.6970177", "0.6925931", "0.68721867", "0.68395495", "0.6824897", "0.6816828", "0.6724374", "0.669282", "0.6646561", "0.664412", "0.6639666", "0.6584458", "0.6563149", "0.6479245", "0.641063", "0.641063", "0.641063", "0.641063", "0.641063", "0.6398328", "0.6383055", "0.625...
0.0
-1
Sets the given key/value pair in the map, overwriting any previous value for "key".
set(key: K, val: V) { this.tree.remove([key, null]); this.tree.insert([key, val]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set(key, value) {\n let index = this._hash(key);\n if (!this.keyMap[index]) {\n this.keyMap[index] = [];\n }\n this.keyMap[index].push([key, value]);\n }", "set(key, value) {\n let index = this._hash(key);\n if (!this.keyMap[index]) {\n this.keyMap[index] = [];\n ...
[ "0.7414935", "0.7385123", "0.7316588", "0.72500896", "0.7045197", "0.68416137", "0.66670704", "0.6654592", "0.6654592", "0.6654592", "0.6654592", "0.6654592", "0.65480155", "0.64858866", "0.6469192", "0.6431631", "0.6431631", "0.6379873", "0.6332327", "0.6232873", "0.622201",...
0.55460095
77
Removes the given key from the map, if present. for "key".
delete(key: K) { this.tree.remove([key, null]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(key) {\n log.map(\"Deleting key '%s' from the map\", key);\n return this._map.delete(key);\n }", "remove(key) {\n this._remove(this._translateKey(key));\n }", "remove(key) {\n let index = this._hash(key);\n if (this.keyMap[index] && this.keyMap[index].length) {\n ...
[ "0.75925165", "0.73682326", "0.73158926", "0.7276359", "0.72613937", "0.691384", "0.69088674", "0.6886747", "0.6854733", "0.68502754", "0.6841779", "0.67968076", "0.67968076", "0.67968076", "0.67968076", "0.67968076", "0.66615725", "0.66062814", "0.65749896", "0.65742713", "0...
0.5602368
83
Returns true if the given key is in the map.
has(key: K): boolean { return this.tree.find([key, null]) != null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "has(key) {\n return this._has(this._translateKey(key));\n }", "function IsInHash(object, key) {\n\treturn key in object;\n}", "containsKey(key) {\n return this.getKeys().includes(key);\n }", "hasKey(key) {\n return this.id2Value[key.id] != null;\n }", "has(key) {\n return this.keys...
[ "0.7405918", "0.739956", "0.7370999", "0.73444587", "0.72322804", "0.7221448", "0.72055525", "0.7195649", "0.71355826", "0.7086066", "0.7077326", "0.7074292", "0.7059407", "0.6924001", "0.6859746", "0.6859746", "0.6859746", "0.6859746", "0.6859746", "0.68488514", "0.68385553"...
0.621553
80
Returns the value for this key if it exists, otherwise null.
get(key: K): ?V { var val = this.tree.find([key, null]); return val ? val[1] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(key) {\n return this.has(key)\n ? this.items[key].value\n : null;\n }", "get(key) {\n let index = this.getIndex(key);\n let data = this.data[index].value;\n if (!data.value) {\n return null;\n }\n return data.value;\n }", "get(key) {\n const item = th...
[ "0.738996", "0.6887647", "0.675879", "0.6731613", "0.66461605", "0.6599099", "0.65453166", "0.6535094", "0.65132445", "0.64691067", "0.6457487", "0.640256", "0.63737524", "0.6254934", "0.6247701", "0.6182333", "0.61506164", "0.61320114", "0.6100065", "0.6085074", "0.6074162",...
0.66913915
4
Returns an iterator over the map's entries, in key order. If a key is provided, iteration starts at or immediately after this key.
iterator(key: ?K): SortedMapIterator<K, V> { if (key) { return new SortedMapIterator(this.tree.lowerBound([key, null]), "next"); } else { let iter = this.tree.iterator(); iter.next(); // Advance from null iterator to one pointing at first elem. return new SortedMapIterator(iter, "next")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "riterator(key: ?K): SortedMapIterator<K, V> {\n if (key) {\n let iter = new SortedMapIterator(this.tree.iterator(), \"prev\");\n iter.next(); // Skip element after this key.\n return iter;\n } else {\n let iter = this.tree.iterator();\n iter.prev(); // Advance from null iterator to...
[ "0.6159142", "0.581019", "0.5553605", "0.5471698", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0.5387879", "0...
0.6770436
0
Returns an iterator over the map's entries, in reverse key order. If a key is provided, iteration starts immediately before this key.
riterator(key: ?K): SortedMapIterator<K, V> { if (key) { let iter = new SortedMapIterator(this.tree.iterator(), "prev"); iter.next(); // Skip element after this key. return iter; } else { let iter = this.tree.iterator(); iter.prev(); // Advance from null iterator to one pointing ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_reverse_iterator(it) {\r\n return it.reverse();\r\n}", "iterator(key: ?K): SortedMapIterator<K, V> {\n if (key) {\n return new SortedMapIterator(this.tree.lowerBound([key, null]), \"next\");\n } else {\n let iter = this.tree.iterator();\n iter.next(); // Advance from null i...
[ "0.58526444", "0.58487684", "0.5447103", "0.526705", "0.50943834", "0.5070987", "0.50025386", "0.4969999", "0.48867378", "0.4867549", "0.47863317", "0.47705397", "0.46905503", "0.46905503", "0.4680394", "0.46276227", "0.46197906", "0.46141183", "0.46141183", "0.46141183", "0....
0.6262908
0
Sets the given key/value pair in the map, throwing an error if this key is already in the map.
add(low: K, high: K, val: V) { if (this.members.has(val)) { throw "Value was already present."; } this.members.set(val, [low, high]); if (this.members.size > 1000) { throw "Whoa, whoa"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set(key, value) {\n if (this.store) {\n // TODO: evict aldest keys when \n this.store.setItem(key, typeof value === 'string' ? value : JSON.stringify(value));\n this.map[key] = typeof value;\n } else this.map[key] = value;\n }", "set(key, value) {\n let index = this.hash(key);\n if (!...
[ "0.6970177", "0.6925931", "0.68721867", "0.68395495", "0.6824897", "0.6816828", "0.6724374", "0.669282", "0.6646561", "0.664412", "0.6639666", "0.6584458", "0.6563149", "0.6479245", "0.641063", "0.641063", "0.641063", "0.641063", "0.641063", "0.6398328", "0.6383055", "0.625...
0.0
-1
Removes the given key from the map, if present. for "key".
delete(val: V) { this.members.delete(val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(key) {\n log.map(\"Deleting key '%s' from the map\", key);\n return this._map.delete(key);\n }", "remove(key) {\n this._remove(this._translateKey(key));\n }", "remove(key) {\n let index = this._hash(key);\n if (this.keyMap[index] && this.keyMap[index].length) {\n ...
[ "0.7591988", "0.73685217", "0.7315056", "0.7275039", "0.726143", "0.69140553", "0.69076663", "0.68857515", "0.68550515", "0.68496704", "0.6841756", "0.6796039", "0.6796039", "0.6796039", "0.6796039", "0.6796039", "0.6660448", "0.66062874", "0.6574887", "0.65745217", "0.652401...
0.0
-1
Returns true iff the value is zero.
isZero() { return this.value == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isNonZero(): boolean {\n return this.value !== 0;\n }", "function sc_isZero(x) {\n return (x === 0);\n}", "function zero (x) {\n\t return typeof x === 'number' && x === 0\n\t}", "function isZero(num) {\n return num == 0;\n }", "isZero() { return (this.#val === BN_0); }", "isZero() {\n ...
[ "0.8203923", "0.811031", "0.7884336", "0.7859818", "0.7852786", "0.78243256", "0.7734696", "0.7654844", "0.7248785", "0.72369754", "0.7201272", "0.7159903", "0.7132436", "0.71310896", "0.709484", "0.70494527", "0.70494527", "0.70494527", "0.70494527", "0.69992703", "0.6977743...
0.8691518
0
Returns a new value that has the value zero, but with this instance's precision.
newZero() { let ret = new Decimal("0"); ret.precision = this.precision; return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setZero() {\n _instance.setZero()\n }", "static set zero(value) {}", "zero() {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }", "function DecimalImply(value, precision) {\n return DecimalPad(value, precision).replace('.', '');\n}", "makeEmpty() {\n this.setValue(0);\n }", "zer...
[ "0.5844349", "0.5745646", "0.5737133", "0.57327276", "0.5638785", "0.55957854", "0.55662066", "0.5478649", "0.5388426", "0.53349257", "0.526049", "0.52531147", "0.52061176", "0.52061176", "0.52061176", "0.5205525", "0.51793754", "0.5162006", "0.5162006", "0.5156242", "0.51562...
0.74793774
0
Adds a period to the global list of available periods. For use at startup time only.
static add(name, roundDown, dateNext) { let period = new Period() period.name = name; period.roundDown = roundDown; period.dateNext = dateNext; period.datePrev = function(d) { let roundedDown = roundDown(d); roundedDown.setMilliseconds(-1); return roundDown(roundedDown); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPeriod (periodType,num,consoleName,dateToAddField,dateToUpdateField) {\n\tvar console = View.panels.get(consoleName);\n\tvar record = console.getRecord();\n\n\tvar date_start = record.getValue(dateToAddField);\n\n\tif (console.getFieldValue(dateToAddField) != '') {\n\n\t\tif (periodType == \"MONTH\") {...
[ "0.64634836", "0.62519217", "0.5823", "0.5823", "0.5823", "0.5823", "0.5823", "0.5771612", "0.56633216", "0.562696", "0.5333267", "0.5327297", "0.5327297", "0.5327297", "0.5237562", "0.5237562", "0.5237562", "0.5237562", "0.5237562", "0.52331924", "0.52066696", "0.51898146"...
0.5689455
8
Adds a period to the global list of available summing periods. For use at startup time only.
static add2(name, aggregateKey: string, strLength, onBoundary) { let period = Period.periods.get(name); if (!period) { throw "Must have previously been declared as a period."; } let new_period = new SummingPeriod(); new_period.name = period.name; new_period.roundDown = period.roundDown;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPeriod (periodType,num,consoleName,dateToAddField,dateToUpdateField) {\n\tvar console = View.panels.get(consoleName);\n\tvar record = console.getRecord();\n\n\tvar date_start = record.getValue(dateToAddField);\n\n\tif (console.getFieldValue(dateToAddField) != '') {\n\n\t\tif (periodType == \"MONTH\") {...
[ "0.61381274", "0.55191255", "0.55132306", "0.55132306", "0.55132306", "0.55132306", "0.55132306", "0.5451813", "0.5385382", "0.5345798", "0.5290311", "0.52229476", "0.51354647", "0.5102653", "0.5097775", "0.50841045", "0.5062719", "0.50502753", "0.50402033", "0.50402033", "0....
0.66036767
0
Gets a sum key for this date and period. The date should be on a boundary for this period.
getSumKey(date) { if (!this.onBoundary(date)) { throw "Not on proper boundary!"; } return this.aggregateKey + date.toISOString().substr(0, this.strLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_sumKey(array, begin, n) {\r\n return begin.toString() + \"-\" + n.toString();\r\n }", "function dateToBucketKey(date) {\n let min = date.getUTCMinutes();\n const diff = min % 5;\n\n if(diff > 2) {\n min += diff;\n }\n else if(diff > 0 && diff < 3) {\n min -= diff;\n }\n\n ...
[ "0.58809435", "0.51749235", "0.5012369", "0.48035556", "0.4775237", "0.47738847", "0.47473428", "0.47473428", "0.47370213", "0.46728772", "0.4602525", "0.46018317", "0.46013045", "0.45951757", "0.45951757", "0.45921057", "0.45038837", "0.4502515", "0.44614565", "0.44186884", ...
0.7680191
0
Called by the DB when a transaction is being populated with updates. This object should add its updates to objectStore (which will be for the collection specified in this.collection).
_addToTransaction(objectStore, version) { let data = this.obj.toModel(); if (data[objectStore.keyPath] != this.key) { throw "Update should not change key."; } switch (this.state) { case ObjectStates.ADD_PENDING: // Use put() to make sure the write fails if the key already exists. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_update() {\n return this.store.findAll(this.modelName, { reload: true });\n }", "update() {\n // Prepare collection with bundle schema.\n this.collection.simpleSchema = () => {\n return this.schema;\n };\n return this.collection.update.apply(this.collection, arguments);\n }", "update() {...
[ "0.59507424", "0.5945315", "0.57925206", "0.5781736", "0.57052845", "0.5680601", "0.5676872", "0.56226325", "0.55835474", "0.5574735", "0.5574735", "0.55694836", "0.5539347", "0.553061", "0.55197316", "0.5500781", "0.55000836", "0.54748386", "0.5455432", "0.54479116", "0.5432...
0.6114067
0
Call to indicate that this object should be upated in the DB. The object's toModel() function will be called to obtain the actual data.
update() { this.checkOkToUpdate(); if (true) { let key = DB._getDbKey(this.obj.toModel(), this.collection); if (key != this.key) { console.log("Old key: ", this.key, "New key: ", key); throw "Update should not change key!"; } } if (this.state == ObjectStates.COMMITTE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "toUpdateSafeDBModel() {\n\t\tvar updateModel = {}\n\t\t// non-nullable fields\n\n\t\t// nullable fields\n\t\tif(this.acceptedBid !== undefined) updateModel.accepted_bid = this.acceptedBid\n\t\tif(this.name !== undefined) updateMod...
[ "0.6465685", "0.5927528", "0.5827187", "0.57909197", "0.57699984", "0.5699587", "0.56954634", "0.56593126", "0.56578296", "0.56568885", "0.55959314", "0.55959034", "0.55743265", "0.5548796", "0.553894", "0.55358416", "0.55276364", "0.5525624", "0.5507999", "0.549658", "0.5491...
0.0
-1
Constructor is not public: clients should create new accounts with db.createAccount(). This constructor is for use of the DB only.
constructor(db: DB, data: Object, existsInDb: ?boolean) { super(); this.db = db; this.data = data; this.parent = null; this.children = new SortedMap(); if (!Account.isValid(data)) { throw "invalid account"; } if (data.guid) { if (this.db.getAccountByGuid(data.guid)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Account(client) {\n this.client = client;\n}", "function Account() {\n\tthis._kind = Account.kind;\n}", "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "constructor(db) {\n this.db = db\n }", "constructor(base, client, db) {\n thi...
[ "0.66841847", "0.6612986", "0.65844136", "0.65844136", "0.6435907", "0.6427662", "0.6402812", "0.63927245", "0.6374883", "0.63448274", "0.6338489", "0.6277027", "0.6269503", "0.62616014", "0.6254564", "0.6225418", "0.6225418", "0.6221689", "0.6137969", "0.6137393", "0.6123544...
0.62165266
18
Returns true if the given account is valid in isolation. Does not validate things external to this account, like that the parent account must exist.
static isValid(accountData) { var ret = typeof accountData.name == "string" && typeof accountData.type == "string" && typeof rootForType(accountData.type) == "string"; if (!ret) { console.log("Invalid account: ", accountData); } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static accountIsValid(account) {\n return true;\n }", "requiresAccountId(stat) {\n const stackAccount = core_1.Stack.of(this).account;\n // if stat.account is undefined, it's by definition in the same account\n if (stat.account === undefined) {\n return false;\n }\n ...
[ "0.7277262", "0.6569553", "0.589725", "0.58484584", "0.5829109", "0.5827033", "0.58107615", "0.57890934", "0.5772813", "0.5673131", "0.5602835", "0.5579054", "0.5549672", "0.54411805", "0.53008014", "0.5259913", "0.52507144", "0.52014184", "0.5178047", "0.51572543", "0.513476...
0.581901
6
Updates an account with the given data.
update(newData: Object) { this.dbUpdater.checkOkToUpdate(); if (!Account.isValid(newData)) { throw "invalid account"; } if (this.data.guid == rootForType(this.data.type)) { throw "Cannot update a root account."; } if (newData.guid) { if (newData.guid != this.data.guid) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateAccount(req, res, next) {\n // console.log(req.body)\n var bodyParams = req.body;\n \n // console.log(currentAccount)\n\n Account\n .findOneAndUpdate(\n { _id: ObjectId(bodyParams._id) },\n { '$set': {\n 'platform': bodyParams.platform,\n 'accountT...
[ "0.71393573", "0.70200396", "0.69470054", "0.6853671", "0.68518203", "0.68495315", "0.6742003", "0.67114854", "0.6710331", "0.6630707", "0.66154706", "0.6444379", "0.6414813", "0.62692297", "0.6254553", "0.6172324", "0.6152407", "0.6126691", "0.61090106", "0.6082115", "0.6019...
0.69691837
2
Deletes an existing account. The account must not have any transactions that reference it.
delete() { this.dbUpdater.checkOkToDelete(); // TODO: What is the right way to test this? //if (this.last) { // throw "cannot delete account with any transactions"; //} if (this.parent) { let parent = this.parent; parent.children.delete(this.data.name); parent._notifySubscri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteAccount (accountName) {\r\n let accountIndex = this.findAccountIndex(accountName);\r\n if (accountIndex !== -1) {\r\n this._accountList.splice(accountIndex, 1);\r\n } else {\r\n console.log('Account by the name' + accountName + ' not found');\r\n }\r\n }", "function deleteAccount() {...
[ "0.70294714", "0.68698364", "0.67202455", "0.64393854", "0.6393837", "0.63103724", "0.6299061", "0.62116545", "0.6163274", "0.6086668", "0.6066258", "0.6060942", "0.60492456", "0.60218275", "0.6019484", "0.58521575", "0.5797907", "0.57708836", "0.5693356", "0.5615248", "0.556...
0.69815135
1
Returns a promise for a new Reader that vends balance/delta information for a series of equallyspaced time windows (for example, every day for seven days).
newBalanceReader(options: BalanceReaderOptions): BalanceReader { return new BalanceReader(this, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getTrending() {\n // Get start and end time, 15 minutes in between\n var startDate = new Date(Date.now() - 900000 * 60);\n var endDate = new Date(Date.now());\n\n return new Promise((resolve, reject) => {\n trendingModel\n .findOne({ time: {'$gte': startDate, '$lte': endDate}})\n .t...
[ "0.5417887", "0.5360838", "0.5245766", "0.51754886", "0.515847", "0.50707734", "0.5039348", "0.5028438", "0.4987046", "0.49676993", "0.4944882", "0.4920086", "0.48558602", "0.48215535", "0.48166615", "0.47981882", "0.47936273", "0.4786616", "0.47836825", "0.47539103", "0.4748...
0.0
-1
Returns a new EntryReader that vends a sequence of Entry objects for this
newEntryReader(options: EntryReaderOptions): EntryReader { return new EntryReader(this, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get entries() {\n if (!loadedEntries) {\n readEntries();\n }\n return entryList;\n }", "get entries() {\n\t\t\tif (!loadedEntries) {\n\t\t\t\treadEntries();\n\t\t\t}\n\t\t\treturn entryList;\n\t\t}", "function ReaderFactory() {}", "serial() {\n re...
[ "0.5174643", "0.504025", "0.49978948", "0.4964787", "0.47831532", "0.47781506", "0.47278118", "0.47142678", "0.47116092", "0.4596624", "0.45587847", "0.45315304", "0.4528649", "0.4520353", "0.45000714", "0.44890335", "0.44626448", "0.44307595", "0.44185746", "0.43887675", "0....
0.6841232
0
Returns the date of this Entry.
getDate(): Date { return this.txn.getDate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDate()\n\t\t\t{\n\t\t\t\tvar date = new Date();\n\t\t\t\treturn date.toDateString();\n\t\t\t}", "get enteredDate() {\n\t\treturn this.__enteredDate;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", "get date() {\n\t\treturn this.__date;\n\t}", ...
[ "0.6991103", "0.6978028", "0.69622487", "0.69622487", "0.69622487", "0.69622487", "0.69622487", "0.69622487", "0.6873819", "0.6832178", "0.6832178", "0.6832178", "0.6832178", "0.6832178", "0.6832178", "0.6663249", "0.6661322", "0.6622645", "0.6619632", "0.65808094", "0.653707...
0.0
-1
Adds to the current amount
_addAmount(amount) { this.amount.add(amount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addMoney(value) {\n\t\tthis.money = this.money.plus(new Decimal(value));\n\t}", "function gameAdd(target, amount){\n target.amount = new Decimal(target.amount).add(amount);\n }", "increment() {\n\t\t++this.amount;\n\t}", "deposit(amount)\n {\n this.accountBalance += amount;\n }", "function...
[ "0.76147693", "0.75238645", "0.74009955", "0.7116434", "0.70296824", "0.701564", "0.6952947", "0.69364387", "0.69272196", "0.69272196", "0.68914545", "0.68555", "0.68413377", "0.6837584", "0.681636", "0.6783446", "0.67579824", "0.6742002", "0.67260885", "0.6717171", "0.670591...
0.7952757
0
Adds our amount to our sums.
_addToSums() { for (let sum of this.sums) { sum.add(this); } this.txn.db._invalidateEntryLists(this.account, this.txn.data.date); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToSum(sum, amount) {\n\t\tdispatch({\n\t\t\ttype: 'ADD_TO_SUM',\n\t\t\tpayload: {\n\t\t\t\tsum,\n\t\t\t\tamount,\n\t\t\t},\n\t\t});\n\t}", "_addAmount(amount) {\n this.amount.add(amount);\n }", "function addToWorkAndTotalCounters(amount) {\n workCounter += amount;\n totalCounter +...
[ "0.75186193", "0.73652154", "0.69735473", "0.69702715", "0.67655754", "0.6760495", "0.6760495", "0.67561394", "0.6754031", "0.6722629", "0.6690033", "0.6628048", "0.657441", "0.6545009", "0.6532067", "0.6523682", "0.65231687", "0.6519336", "0.6503159", "0.6501437", "0.6499122...
0.7092795
2
Subtracts our amount from our sums.
_subtractFromSums(dateStr: string) { for (let sum of this.sums) { sum.sub(this); } this.txn.db._invalidateEntryLists(this.account, dateStr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subtract(num1, num2) {\n var subtractTotal = num1 - num2;\n return subtractTotal;\n}", "function subtract(number1, number2) {\r\n var sum = number1 - number2;\r\n console.log(sum);\r\n}", "sub(entry) {\n this.amount.sub(entry.amount);\n this.count -= 1;\n this.dbUpdater.up...
[ "0.6497505", "0.6368382", "0.6357112", "0.6343633", "0.63434124", "0.630907", "0.6275893", "0.6237521", "0.6226007", "0.622549", "0.6205193", "0.6170303", "0.61549693", "0.6153495", "0.6145334", "0.6085214", "0.60809124", "0.60783035", "0.6063298", "0.60602504", "0.603948", ...
0.6756699
0
Constructor is not public: clients should create new transactions with db.createTransaction(). This constructor is for use of the DB only.
constructor(db: DB, txnData: Object, existsInDb: ?boolean) { super() this.db = db; this.data = txnData; this.date = DB.parseDate(txnData.date); if (!this.db.transactionIsValid(txnData)) { throw "invalid transaction"; } if (txnData.guid) { if (this.db.transactionsByGuid.get(txn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "constructor(db) {\n this.db = db\n }", "constructor(db) {\n this.db = db;\n }", "constructor() {\n this.db = level(chainDB);\n }", "constructor (record) {\n super(record);\n ...
[ "0.72313946", "0.72313946", "0.6854417", "0.6853007", "0.67251486", "0.6659967", "0.6512152", "0.64936507", "0.64936507", "0.64936507", "0.64936507", "0.64032936", "0.6372821", "0.6331971", "0.6293778", "0.627731", "0.62707204", "0.6257469", "0.6207182", "0.61533207", "0.6126...
0.7328707
0
If the transaction is unbalanced, returns the unbalanced balance. Otherwise, (if the transaction is balanced), returns null.
static unbalancedAmount(txnData) { var unbalanced = new Amount(); for (var i in txnData.entry) { unbalanced.add(new Amount(txnData.entry[i].amount)); } if (unbalanced.isZero()) { return null; } else { return unbalanced; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "balance() {\n return this.contract.methods.balanceOf(this.contract.defaultAccount).call();\n }", "outstandingBalance() {\n const amountPaid = this.amountPaidOnInvoice();\n const invoiceTotal = this.amount;\n const tip = this.tip || 0;\n return (invoiceTotal + tip) - amountPaid;\n }", "fu...
[ "0.7009463", "0.7006717", "0.6999056", "0.6943715", "0.664178", "0.6634126", "0.6633237", "0.663206", "0.662031", "0.65890443", "0.6576332", "0.6525065", "0.6452197", "0.6426509", "0.6389565", "0.634535", "0.63411224", "0.6329249", "0.62917435", "0.62734693", "0.62730545", ...
0.68340844
4
Returns true if the given transaction is valid in isolation. Does not validate things external to this transaction, like that all of the accounts must exist.
static isValid(txnData) { if (typeof txnData.date != "string" || typeof txnData.description != "string" || !isArray(txnData.entry) || txnData.entry.length < 2) { return false; } if (Transaction.unbalancedAmount(txnData)) { return false; } for (var i in txnData.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasValidTransaction(){\n for(const tx of this.transactions){\n if(!tx.isValid()){\n return false;\n }\n }\n\n return true;\n }", "hasValidTransactions() {\n for (const tx of this.transactions) {\n if (!tx.isValid()) {\n return false;\n ...
[ "0.78630066", "0.77932954", "0.7718897", "0.72261095", "0.6899259", "0.6853188", "0.67353463", "0.66003996", "0.65532255", "0.6465734", "0.6387179", "0.6217382", "0.61895514", "0.6136338", "0.61227953", "0.6089596", "0.6064433", "0.6021432", "0.59016436", "0.5884647", "0.5811...
0.6408748
10
Returns the entry for the given account in this transaction, or null if there is no entry for this account. TODO(haberman): will need to add a date parameter if/when transactions can have multiple entries for the same account, but on different days.
getEntry(account: Account): Entry { return this.entries.get(account); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAccount(accountKey) {\n const account = this.getItem(accountKey);\n if (msalCommon.AccountEntity.isAccountEntity(account)) {\n return account;\n }\n return null;\n }", "function getAccount() {\n const config = zxeth.getConf();\n\n return config.accounts[0];\n}", "function getEntry(entrie...
[ "0.68907994", "0.5809942", "0.5789726", "0.5647171", "0.55979604", "0.559666", "0.5459453", "0.54563004", "0.5412292", "0.540662", "0.53920627", "0.5372152", "0.5331624", "0.5304681", "0.5266222", "0.5264988", "0.51598895", "0.5142339", "0.50777435", "0.5064273", "0.50442535"...
0.7577393
0
Returns the date of this transaction. TODO(haberman): will need to add a date parameter if/when transactions can have multiple entries for the same account, but on different days.
getDate(): Date { return this.date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDate(): Date {\n return this.txn.getDate();\n }", "function getDate()\n\t\t\t{\n\t\t\t\tvar date = new Date();\n\t\t\t\treturn date.toDateString();\n\t\t\t}", "function getDate() {\n\t\tvar ret, month, day;\n\n\t\tret = new Date();\n\n\t\tmonth = ret.getMonth();\n\n\t\tif (month.length < 2) {\n\t\t\tmon...
[ "0.65377855", "0.61638707", "0.6041921", "0.5896229", "0.5894166", "0.58575255", "0.5838794", "0.5795613", "0.5794665", "0.57656705", "0.5764434", "0.5739312", "0.5739312", "0.5739312", "0.5739312", "0.5739312", "0.5739312", "0.57365394", "0.56843656", "0.56843656", "0.568436...
0.5245275
61
Updates an existing transaction. Transaction guid must be set, and the transaction must be valid. This will completely overwrite the previous value of this transaction.
update(newData: Object) { this.dbUpdater.checkOkToUpdate(); if (!this.db.transactionIsValid(newData)) { throw "invalid transaction"; } if (newData.guid) { if (newData.guid != this.data.guid) { throw "Cannot change transaction GUID."; } } else { // Specifying GUID in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateWalletTransaction(idTransaction, payload) {\n return this.request.put(`transaction/${idTransaction}`, payload);\n }", "updateTransaction(params) {\r\n return Api().post('/updatetransactions', params)\r\n }", "updateOrAddTransaction(transaction) {\n let transactionWithId = this.transactions.fin...
[ "0.60071254", "0.58840764", "0.58009356", "0.58009356", "0.56750786", "0.5417029", "0.5256566", "0.5216716", "0.5178558", "0.5177228", "0.51676387", "0.5166359", "0.51154", "0.5110408", "0.51010895", "0.51010895", "0.51010895", "0.5079703", "0.5020966", "0.4884265", "0.485363...
0.60458946
0
Internal only method to calculate the key for this transaction in the sorted map.
_byTimeKey(): string { return this.data.date + this.data.guid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_hash(key) {\n let total = 0;\n let PRIME_NUMBER = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * PRIME_NUMBER + value) % this.keyMap.length;\n }\n return ...
[ "0.6285936", "0.61562264", "0.60978943", "0.6071263", "0.60695946", "0.5869311", "0.578319", "0.57702696", "0.56957", "0.5641194", "0.56317645", "0.56152475", "0.5614315", "0.55992115", "0.5588578", "0.5560295", "0.5556719", "0.55468774", "0.5541768", "0.5505728", "0.5505728"...
0.0
-1
Implements the interface IGetAmount.
toIGetAmount(): IGetAmount { return ((this: any): IGetAmount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get amount() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty * item.price)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "function getTotalAmount()\n {\n return ((getSubTotalByProductAmountAndQuantity() - getTotalDiscountAmount()).toFixed(2));\n }", "function am...
[ "0.630321", "0.6118206", "0.60669935", "0.6005715", "0.59959555", "0.59353334", "0.5765719", "0.5749181", "0.57136387", "0.5665359", "0.56524163", "0.56431633", "0.5578565", "0.5561375", "0.5552578", "0.55490077", "0.55437255", "0.55437255", "0.55401736", "0.55346", "0.552016...
0.6644972
0
Adds an entry to our sums.
add(entry) { this.amount.add(entry.amount); this.count += 1; this.dbUpdater.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addToSums() {\n for (let sum of this.sums) { sum.add(this); }\n this.txn.db._invalidateEntryLists(this.account, this.txn.data.date);\n }", "function addToSum(sum, amount) {\n\t\tdispatch({\n\t\t\ttype: 'ADD_TO_SUM',\n\t\t\tpayload: {\n\t\t\t\tsum,\n\t\t\t\tamount,\n\t\t\t},\n\t\t});\n\t}", "function ad...
[ "0.7221386", "0.645659", "0.64336246", "0.6317063", "0.6311382", "0.6275168", "0.6235771", "0.62041247", "0.6189709", "0.61624396", "0.60356957", "0.59053314", "0.5877563", "0.5877563", "0.58670264", "0.56832576", "0.5659542", "0.56319106", "0.56104386", "0.55743706", "0.5572...
0.767554
0
Subtracts an entry to our sums.
sub(entry) { this.amount.sub(entry.amount); this.count -= 1; this.dbUpdater.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_subtractFromSums(dateStr: string) {\n for (let sum of this.sums) { sum.sub(this); }\n this.txn.db._invalidateEntryLists(this.account, dateStr);\n }", "subtract(subtrahend) {\n if (!Long.isLong(subtrahend))\n subtrahend = Long.fromValue(subtrahend);\n return this.add(subtrahend.ne...
[ "0.7001508", "0.6067038", "0.60309243", "0.6004527", "0.59516513", "0.59240514", "0.58911794", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", "0.58616525", ...
0.75297564
0
Implements the interface IGetAmount.
toIGetAmount(): IGetAmount { return ((this: any): IGetAmount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get amount() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty * item.price)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "function getTotalAmount()\n {\n return ((getSubTotalByProductAmountAndQuantity() - getTotalDiscountAmount()).toFixed(2));\n }", "function am...
[ "0.6302852", "0.6117963", "0.6066002", "0.60043865", "0.59950286", "0.59349394", "0.576496", "0.5747888", "0.5712658", "0.56642157", "0.56508785", "0.56432045", "0.55779403", "0.5560175", "0.555172", "0.5548688", "0.5541975", "0.5541975", "0.5538752", "0.5533375", "0.5518253"...
0.66449314
1
Returns the sum of the amounts for all entries in the list. We compute it lazily, since it is not always required.
getAmount(): Amount { if (this.amount) { return this.amount; } else { let amount = new Amount(); for (let entry of this.entries) { amount.add(entry.getAmount()); } this.amount = amount; return amount; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentSum(sumlist) {\n var total=0;\n for (var i=0;i<sumlist.length;i++) {\n var entry = sumlist[i];\n if (entry.amt>0) {\n total += entry.amt;\n }\n }\n return total;\n}", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n ...
[ "0.7132731", "0.71203154", "0.7048074", "0.6744438", "0.67435426", "0.6728547", "0.67041", "0.6590353", "0.6576214", "0.657154", "0.6519249", "0.6459902", "0.6436487", "0.64279866", "0.6393642", "0.6332453", "0.6293713", "0.6276604", "0.62665224", "0.6258769", "0.6183281", ...
0.61680907
21
Returns the list of entries for these criteria. Entries are returned in ascending date order.
getEntries(): Array<Entry> { return this.entries; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEntriesByDate(date) {\n return rest.one('date', date).get();\n }", "function getEntries() {\n\t\t//Variables\n\t\tvar lvQuery,\n\t\t\titem,\n\t\t\tstatus,\n\t\t\tlvType,\n\t\t\tlvAmount = 0,\n\t\t\tlvBSAmount = 0,\n\t\t\tlvPLAmount = 0,\n\t\t\tlvCompanyCode,\n\t\t\tl...
[ "0.6476107", "0.6155556", "0.5961646", "0.5960797", "0.578778", "0.5786169", "0.57117647", "0.5704931", "0.5663728", "0.5544944", "0.55329496", "0.5522847", "0.549397", "0.5484859", "0.54796654", "0.54548013", "0.5434278", "0.53806454", "0.53431904", "0.533011", "0.5326003", ...
0.52175915
31