Questions tagged [accumulate]

Accumulation refers to the process of repeatedly combining the previously calculated result with the next item, until the supply of items is exhausted.

Accumulation refers to the process of repeatedly combining the previously calculated result with the next item, until the supply of items is exhausted.

When we are interested only in the final result, it is equivalent to left folding; and if we keep the whole sequence of results progressively calculated, it is known as left scan.

319 questions
0
votes
1 answer

How to union result in drools

I want to get one result only in drools. I tried to use "from" and "from accumulate" but It did not work. Main.java // Main class KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); KnowledgeBase kbase =…
user3429028
0
votes
1 answer

What parameters this formula takes when in "accumulate"?

This code is copied from another user question and I`m curious how accumulate works here. I get the correct result from this code, but would like to know what parameters lcm takes when in "accumulate". The init as A and the sum of the range as b?…
Vallerious
  • 570
  • 6
  • 13
0
votes
2 answers

Accumulating multiple totals

I have just started to learn looping, and I don't understand how to accumulate more than one total in my output using a for or while statement. My code is meant to represent three families (A, B and C) having a garage sale. When they enter their…
0
votes
1 answer

Cumulate values in Crystal Reports

I've got a Crystal Reports report for accounting the status of invoices. Now I want to make a cross-tab and count how many invoices were valid in one given month. This is the easy part. The difficulty comes now: How can I count how many invoices are…
aks69cw
  • 11
  • 3
0
votes
1 answer

Subtract accumulated values in SQL Server 2008

I have one ATM machine that has information below: - --Date-----|--Withdraw---|---CashLoad - 01/15/13--|----10----------|-------300 - 01/16/13--|----20 - 01/17/13--|----50 - 01/18/13--|---120 - 01/19/13--|----20----------|-------400 - …
0
votes
1 answer

Scala: iterating / accumulating List for an integer range

I'm a novice in Scala. I am trying to do the following stuff: def foo(n: Int): List[Int] = { def worker(i: Int, acc: List[Int]): List[Int] = { if (i == 0) acc else worker(i - 1, compute(i) :: acc) } worker(n, List[Int]()) } foo…
minjang
  • 8,860
  • 9
  • 42
  • 61
0
votes
1 answer

VB.NET - Accumulating Numbers and Calculating Average

I have started over and everything is working as intended except for 2 of the accumulating totals, the calculation is not working the way I need it to. Instead of adding previous sales to the total it tacks the new sale on the end... for example: I…
Rebekah R.
  • 5
  • 1
  • 4
0
votes
4 answers

javascript jquery callback accumulates

Issue: Each time div.a is clicked, the number of callbacks when div.b is clicked,accumulates by 1. var $=jQuery; $(function(){ $("div.a").click(function(){cbf(trgmsg);}); }); function trgmsg(){ alert($.now()); } function cbf(cb){ …
0
votes
1 answer

Matlab: Using Accumarray

If I have a column of dates and a corresponding column of volume data, like this: 31,3 31,2 31,1 31,5 07,2 07,3 07,4 07,2 07,3 07,5 07,3 07,1 07,1 07,2 07,3 30,5 06,4 I want to add up the data in the right hand column, for each date. If I use…
siegel
  • 819
  • 2
  • 12
  • 24
0
votes
2 answers

Using a template Lambda expression inside a std::accumulate c++?

Is there to templatize the "ints" in the lambda function below in the case that there was a standard container of doubles or floats, etc.? I have searched the world over for help with this. I even asked for the help of my professor who says it is…
OakleyMaster
  • 41
  • 1
  • 3
0
votes
1 answer

R Accumulate equity data - add time and price

I have some data formatted as below. I have done some analysis on this and would like to be able to plot the price development in the same graph as the analyzed data. This requires me to have the same x-axes for the data. So I would like to…
Morten
  • 223
  • 1
  • 5
  • 15
0
votes
2 answers

How To Accumulator All The Values

the output i would like to display was accumulator of total EMPL_NUM. For example, the value show in the field TOTAL_FEBRUARY=TOTAL_JANUARY+TOTAL_FEBRUARY,while for the value exist in field TOTAL_MARCH=TOTAL_MARCH+TOTAL_JANUARY+TOTAL_FEBRUARY. I…
goh6319
  • 137
  • 1
  • 3
  • 20
0
votes
2 answers

Iterate through loop and add variables together

I have the following loop which shows the fields money and percent. I want to add all the money together as it iterates through, how can I do this and echo out a total outside the loop? while(the_repeater_field('income')) { …
Rob
  • 6,304
  • 24
  • 83
  • 189
0
votes
1 answer

How to accumulate struct as value type in multimap?

I have a multimap with string as key and Cnode struct as the value: struct Cnode { Cnode() : wtA(0), wtC(0), wtG(0), wtT(0) { } Cnode(int newA, int newC, int newG, int newT) : wtA(newA), wtC(newC), wtG(newG), wtT(newT) { } int…
snazziii
  • 471
  • 2
  • 10
  • 23
0
votes
2 answers

How to reduce mysql UPDATEs when viewing forum topics

Every time a topic/thread on a forum is viewed by members, an update is done on the topic table to increase the total views by one. I am after answers on possible ways to not do an update on every view, but to accumulate the views for each topic and…
Competitions
  • 37
  • 1
  • 9