text:
The sum is always 15
Write a program or function that takes an array of non-negative integers as input and outputs a set of vectors/arrays with the elements of the input array in order, split so that each vector sums up to 15. If the sum of the first N elements doesn't "hit 15", then the number that made it pass 15 must be cut off, and the remainder will be the first element of the next vector. This goes on until you reach the end of the input array. If the sum of the final vector is less than 15, then a number must be added at the end to make the sum go up.
I think the rules are more easily understood by looking at the examples:
Input: 3 7 5 10
Output:
3 7 5           <- Sum is 15
10 5            <- 5 is added to make the sum 15

Input: 2 4 5 9 2 3 5 0 2 4 5 0 3
Output:
2 4 5 4          <- Sum 15. 9 is split in two.
5 2 3 5          <- The first 5 is the remainder of 9
0 2 4 5 0 3 1    <- The last number is added to make the sum 15

Input: 1 1 1
Output:
1 1 1 12         <- The number 12 is added to make the sum 15

Input: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Output:
1 2 3 4 5
6 7 2           <- 2 is the first part of 8
6 9             <- 6 is the remainder of 8
10 5            <- 5 is first part of 11
6 9             <- 6 is remainder of 11. 9 is first part of 12
3 12            <- 3 is remainder of 12. 12 is first part of 13
1 14            <- 1 is remainder of 13. 14 is 14
15
15              <- 15 is first part of 16
1 14            <- 1 is remainder of 16. 14 is first part of 17
3 12            <- 3 is remainder of 17. 12 is added to make the sum 15

Input: 20 20
Output:
15
5 10           <- 5 is remainder from the first 20
10 5           <- 10 is remainder from second 20. 5 is added to make the sum = 15.

Input: 100
Output
15
15
15
15
15
15
10 5

Both the input and the output format is optional. Whatever is best in your language.
The shortest code in bytes wins.

Leaderboard
The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:
## [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=65577,OVERRIDE_USER=44713;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

when i hit exactly 15 my programm puts a 0 like Input 15 Output 15 0 is that ok?

@Eumel, it has to be only 15. Sorry...

is kicking out 0s from input allowed?

No, the zeros must be included. See the second example.

This should definitely replace the FizzBuzz test

What should we output for 15 0 ? 15 0 or 15; 0 15? Also for input 15 0 15 which one is correct, 15 0;15 or 15; 0 15? (In retrospect question would have be cleaner with only positive integers.) (You should state that only non-negative integers are in the input, if that is the case.)

The correct output for 15 0 is 15; 0 15. This is according to example 2, where the zero is carried on to the next line. But this wasn't very clear from the question, so existing answers outputting 15 0 will not be invalidated. Outputting only 15 however, is not valid.

It's all 15s, all the way down

Pyth, 37 bytes
K15VQ=+ZNIgZK=-ZK-NZbIZZ)).?N;I>KZ-KZ

Explained
This is an implementation of Noah's equation in Pyth
K15              Store 15 in K (the max) (K is Autoinitializing, no = needed here)
VQ              For N in the evaluated input
  =+ZN           Set Z(Which in pyth defaults to 0) to Z+N
  IgZK           If Z(row total) is greater than or equal to K (row max)
    =-ZK         Set Z to Z-K (How much the max was exceeded)
    -NZ          Implicitly print N-Z
    b            Implicitly print b (in pyth defaults to a newline)
    IZ         If Z > 0 (There was excess to carry to the next row)
      Z          Implicitly print Z (the excess)
  .?N            Else(the current row count is < the max(15)) output the current number
;                Use infinite )'s in place of )) (to save 1 character)
I>KZ             If K > Z (The max is greater than the current row count)
  -KZ           Implicitly print K-Z (The amount needed for the row to equal 15)

This was my first pyth, so feel free to suggest improvements.
Example:
Input
[1, 3, 4, 5, 9, 8]

Output
1
3
4
5
2

7
8

Note: Much thanks to Isaacg for several bytes of size reduction advice and creating pyth in the first place!  Please upvote his comments below :)

Else was recently changed to be .? instead of E, but I forgot to update the docs. Sorry about that.

@isaacg Thanks isaacg!  I should have that working now.  Though it only saves 1 byte since the else is 2 characters now.

@isaacg If you have anything to do with https://pyth.herokuapp.com you could update it's character reference as well.

Fixing it as we speak.

A couple of other suggestions: =Z+ZN and =+ZN are the same. It's a bit like Python's +=. Likewiese, =Z-ZK -> =-ZK. Also, you don't need the ) at the end - it's filled in automatically. Finally, FNQ and VQ are the same.

@isaacg Awesome, thanks for everything isaacg!

You can save another 2 byte by replacing I>Z0 with IZ - Z can't be negative, so you're really just checking if Z is not zero, and zero is falsy, while all other numbers are truthy.

@isaacg How did I miss that? :)  Thanks again, that makes our Pyth the shortest (though the previous competitor had a small logic flaw anyway).

You should be able to replace FNQ with VQ.

Oh wait, never mind, it seems the explanation doesn't match the code...

Java - 229 200 192 181 172 170 168 bytes
Had already begun, not for the win but for the fun :)
Any suggestion is welcome.
Saved 8 bytes thanks to @ThomasKwa
Saved 20 bytes thanks to @corsiKa
Saved 2 bytes thanks to @Ypnypn
Saved 2 bytes thanks to @user902383
String p(int[]a){int c=0,j;String s="";f:for(int i:a){for(j=i;j-->0;)if(++c>14){s+=(i-j)+"\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}s+=i+" ";}return s+(15-c);}

170 bytes
String p(int[]a){int c=0,j;String s="";f:for(int i:a){for(j=i;j-->0;){if(++c>14){s+=(i-j)+"\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}}s+=i+" ";}return s+(15-c);}

172 bytes
String p(int[]a){int c=0,j;String s="";f:for(int i:a){for(j=i;j>0;){j--;if(++c>14){s+=(i-j)+"\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}}s+=i+" ";}return s+(15-c);}

181 bytes
void p(int[]a){int c=0,j;String s="";f:for(int i:a){for(j=i;j>0;){j--;if(++c>14){s+=(i-j)+"\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}}s+=i+" ";}System.out.print(s+(15-c));}

192 bytes
void p(int[]a){int c=0,j;String s="";f:for(int i:a){for(j=i;j>0;){j--;c++;if(c==15){s+=(i-j)+"\n";c=0;if(j>=15)continue;if(j>0)s+=j+" ";c+=j;continue f;}}s+=i+" ";}System.out.print(s+(15-c));}

200 bytes
void p(int[]a){int c=0,j;String s="";f:for(int i:a){j=i;while(j>0){j--;c++;if(c==15){s+=(i-j)+"\n";c=0;if(j>=15)continue;else{if(j!=0)s+=j+" ";c+=j;continue f;}}}s+=i+" ";}System.out.print(s+(15-c));}

229 bytes
void p(int[]a){int c=0,j;f:for(int i:a){j=i;while(j>0){j--;c++;if(c==15){System.out.print(i-j+"\n");c=0;if(j>=15){continue;}else{if(j!=0)System.out.print(j+" ");c+=j;continue f;}}}System.out.print(i+" ");}System.out.print(15-c);}

String p(int[] a) {
    int c = 0, j;
    String s = "";
    f: for (int i: a) {
        for (j = i; j-- > 0;)
            if (++c > 14) {
                s += (i - j) + "\n";
                c = 0;
                if (j < 15) {
                    if (j > 0) s += j + " ";
                    c += j;
                    continue f;
                }
            }
        s += i + " ";
    }
    return s + (15 - c);
}

Wow, hadn't seen continue actually used in a Java program until now.

Haskell, 126 107 102 100 bytes
[]#c=[]
(h:t)#c|s<0=t#u|s<1=u:t#[]|1<2=(c++[h-s]):(s:t)#[]where s=sum c+h-15;u=c++[h]
(#[]).(++[14])

Usage example: (#[]).(++[14]) $ [1..17] -> [[1,2,3,4,5],[6,7,2],[6,9],[10,5],[6,9],[3,12],[1,14],[15],[15],[1,14],[3,12]]
Edit: @Stewie Griffin helped me saving 19 bytes. Thanks!

Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 1̶3̶3̶ 113
s=0
i=15
p=print
for e in eval(input()):
 if s>=i:p()
 s=s%i+e
 if s>i:s-=i;p(e-s);p();e=s
 p(e)
if s!=i:p(i-s%i)

Edit 5 Truly golfed thanks to @poke *removed line breaks etc
Edit 4 Aliased print, and replaced a = with a -= to save a byte.  Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment
Edit 3 Found savings in different OO inside second if
Edit 2 Fixed bug
Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp
First time poster here.  Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

You can get it down to 122 by assigning 15 to a variable and only using one space for indentation.

Also, you fail the second test case, I get 2 3 5, but it should be 5 2 3 5.

@Morgan Thrapp Fixed I think

What is the point of eval(input()) when input() already evaluates the input?

@AdamMartin You may be interested in my Pyth version of your code

@TanMath The input is assumed to be a string without the eval.  If it were a def, I could have the input be a list, but input() always returns a string afaik.

you are correct. Nvm my suggestion then

Switched to my own pyth.  Here is your code in pyth: =G15=k0FNQIgkGb)=k+%kGNI>kG=k-kG-Nkb=Nk)N)InkG-G%kG)

Since you’re using print so often, you should save it as a variable: p=print. Saves you another 14 characters.

Change s=s-i to s-=i and save another byte :)

Your current byte count is 149

@Celeo Weird, my website was giving me the bigger number

@poke Good call!

Current count is 132, but you can get it down to 113 if you remove some of the line breaks. You can combine every if into a single line, e.g. if s>i:s-=i;p(e-s);p();e=s for the second one. That saves you line breaks and indentation characters.

You can put all the lines setting the variables on one line, like this:s,i,p=0,15,print

@nedla2004 How does that save any bytes?

Sorry, I was confused

Python2powered by RegEx: 158 155 bytes
Made in python with love and almost no math.
Or Regex Math if you will, unary math.
'Real' math used only to 'fix' the last requirement:

If the sum of the final vector is less than 15, then a number must be added at the end to make the sum go up.

Codegolfed:
import re
def f(i):o=[map(len,p.split())for p in re.findall('((?:x *){15}|.+)',' '.join(['x'*c for c in i]))];l=sum(o[-1]);o[-1]+=([],[15-l])[l<15];print o

The way this works is by converting each number N into a string of length N (x chosen as the char to fill up the string) and joining them all into a space separated string. Resulting string is split via RegEx BLACK MAGIC into something like:
['x xx xxx xxxx xxxxx ', 'xxxxxx xxxxxxx xx', 'xxxxxx xxxxxxxxx', 'x']

for an input like: f([1, 2, 3, 4, 5, 6, 7, 8, 10])
That's then split again, and the length of consecutive xes is used to create the numbers again, everything packed nicely in a list comprehension.
Ungolfed:
import re
o = [map(len, p.split()) for p in re.findall('((?:x *){15}|.+)', ' '.join(['x'*c for c in i]))]
l = sum(o[-1])
o[-1] += ([], [15-l])[l<15]
print o

Output:
>>> f([30, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16])
[[15], [15], [1, 2, 3, 4, 5], [6, 7, 2], [6, 9], [15], [1, 14]]

Note: there wasn't enough magic for the 0s so this entry disqualifies

zeros must be included. See the second example

All those function names are rather expensive.  Makes using something like regex nearly impossible in code golf.  Still, your byte size isn't bad considering

CJam, 39 bytes
q~0af*Sf*N*30/{S-N/:,F1$:+-+0+e`W<e~p}/

Test it here.
This feels very suboptimal, but so far all my attempts at a shorter solution have been foiled by the presence of zeros in the input.

Seriously, 88 bytes
,`'!*'0`M' j0╗`;;;'|ε35*('!=╜+;╗%(' =|('0=|I)`Mεj'|@s`ôl`╝`ö'0@s╛M`Md;Σ35*-;`X``@q`Iƒ@q.

Try it online
It's my first Seriously answer! Now I'm intimately familiar with all the language's shortcomings!
Hex Dump:
2c6027212a2730604d27206a30bb603b3b3b277cee33352a2827213dbd2b3bbb252827203d7c2827303d7c49
29604dee6a277c407360936c60bc609427304073be4d604d643be433352a2d3b60586060407160499f40712e

Explanation:
,`'!*'0`M' j         Replace all the numbers by "0"+"!"*n, separated by " "
0╗                   Initialize an accumulator in register 0
` ... `M             Map the string with the following function:
   ;;;'|ε                Put three extra copies of the character, a pipe, an empty string
   35*                   and a 15 on the stack.
   ('!=                  Move one copy of the character to the top and push 1 if it's a !
   ╜+                    Load the accumulator, add the 1 or 0 from the preceding test
   ;╗                    Make a copy, and save it back to register 0
   %                     Modulo the sum by 15
   (' =|                 Or the result with whether the dug-up character is " "
   ('0=|                 Or the result with whether the dug-up character is "0"
   I                     If we're at " " or "0" or the current sum is not divisible by 15,
                         push empty string, else push "|"
   )                     Bury the new character under the original character.
εj                   Join the list that resulted from the map into a single string.
'|@s                 Resplit the string on occurrences of "|" (after every 15 "!"s)
`ôl`╝                Store a function in register 1 which trims whitespace
                     and returns the length of the remaining string
` ... `M             Map the list with the following function:
   ö                     Trim leading spaces.
   '0@s                  Split the string on occurrence of "0"
   ╛M                    Map the resulting list with the function stored in register 1
d;                   Push the last sublist from the resulting list and make a copy.
Σ                    Find the sum of the list.
35*-                 Subtract it from 15
;`X``@q`Iƒ           Duplicate it, drop it if it's zero, put it in the list otherwise.
@q.                  Put the list back in the big list and print it.

If Unicode code points are used, then do those characters count as 2 bytes each? :P

I'm using the unicode in the depicted source so that it can be read the way it is meant to look. Otherwise it would look like random garbage full of unprintables. The official source is the hex dump.

It was meant to be a humorous question

It was also a reasonable question another reader might wonder about, so I answered it humorlessly.

@quintopia +1 For trying a new golfing language!  New languages are fun ;)  I tried pyth for my first time on this question as well.

Javascript, 138 128 bytes
i=>eval("for(o=z=n='',m=15,t=q=0;q=m?(t-=m,z+=c-t,o+=z+`\n`,z=t>0?t+' ':n):z+=c+' ';t<m?o+z+(m-t):o")

With whitespace:
i => eval("
  for(o=z=n='', m=15, t=q=0; q =m
      ?(
        t-=m,
        z+=c-t,
        o+=z+`\n`,
        z=t>0?t+' ':n)
      :
        z+=c+' '
    ;
  t<m ? o+z+(m-t) : o
")

Example:
Assign the function to a variable
sumFifteen=i=>eval("for(o=z=n='',m=15,t=q=0;q=m?(t-=m,z+=c-t,o+=z+`\n`,z=t>0?t+' ':n):z+=c+' ';t<m?o+z+(m-t):o")

Then evaluate like so:
console.log(sumFifteen([1,4,11,4,5]))

1 4 10
1 4 5 5

Revision history:
12/3/2015 00:02 - Thanks to user81655(+1 him in the comments) for 10 byte improvement
12/2/2015 21:44 - Switched to use functional style in-order to reduce size.

You could improve this with these: f= is not needed according to site rules, remove the parentheses from (i), surround with eval so you don't need return or the brackets and replace the if with a ternary so that o is returned and change '\n' to \\n`, merge t+=...witht>=mto remove for loop brackets. Here's your solution in 127 bytes with all these improvements:i=>eval("for(o=z=n='',m=15,t=q=0;q<i.length;q++)(t+=c=+i[q])>=m?(t-=m,z+=c-t,o+=z+`\n`,z=t>0?t+' ':n):z+=c+' ';t<m?o+z+(m-t):o")`

@user81655 I'll implement some of those changes!  When I try yours I get a SytaxError: Unexpected token ILLEGAL(...).  Note, in order to test function I added f=

SO adds some symbols after o+ at the end of the line. Delete o+=z and write it again and it will work. :P

@user81655 I don't see how \n makes any difference

You mean the \\n`? It won't work without it because the code is inside "..."because of theeval`.

Perl, 86 bytes
#!perl -p
s|\d+( ?)|($i+=$&)<15?$&:($a=$&-($i%=15)).$/.($&>$a&&$&-$a.$1)|ge;$\=$".(15-$i)if$i

Counting the shebang as three, input is taken from stdin, space separated.

Sample Usage
$ echo -n 2 4 5 9 2 3 5 0 2 4 5 0 3 | perl sum15.pl
2 4 5 4
5 2 3 5
0 2 4 5 0 3 1

R, 155 bytes
n=scan();while(S<-sum(n)){C=cumsum(n);if(S>14){w=which(C>14)[1];N=n[1:w];n=n[-(1:w)];r=C[w]-15;N[w]=N[w]-r;if(r)n=c(r,n);cat(N,"\n")}else{cat(n,15-S);n=0}}

With indents and linebreaks:
n=scan()
while(S<-sum(n)){
     C=cumsum(n)
     if(S>14){
         w=which(C>14)[1]
         N=n[1:w]
         n=n[-(1:w)]
         r=C[w]-15
         N[w]=N[w]-r
         if(r) n=c(r,n)
         cat(N,"\n")
         }else{
            cat(n,15-S)
             n=0
             }
      }

Usage:
> n=scan();while(S<-sum(n)){C=cumsum(n);if(S>14){w=which(C>14)[1];N=n[1:w];n=n[-(1:w)];r=C[w]-15;N[w]=N[w]-r;if(r)n=c(r,n);cat(N,"\n")}else{cat(n,15-S);n=0}}
1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18:
Read 17 items
1 2 3 4 5
6 7 2
6 9
10 5
6 9
3 12
1 14
15
15
1 14
3 12
> n=scan();while(S<-sum(n)){C=cumsum(n);if(S>14){w=which(C>14)[1];N=n[1:w];n=n[-(1:w)];r=C[w]-15;N[w]=N[w]-r;if(r)n=c(r,n);cat(N,"\n")}else{cat(n,15-S);n=0}}
1: 20 20
3:
Read 2 items
15
5 10
10 5
> n=scan();while(S<-sum(n)){C=cumsum(n);if(S>14){w=which(C>14)[1];N=n[1:w];n=n[-(1:w)];r=C[w]-15;N[w]=N[w]-r;if(r)n=c(r,n);cat(N,"\n")}else{cat(n,15-S);n=0}}
1: 10 5
3:
Read 2 items
10 5
> n=scan();while(S<-sum(n)){C=cumsum(n);if(S>14){w=which(C>14)[1];N=n[1:w];n=n[-(1:w)];r=C[w]-15;N[w]=N[w]-r;if(r)n=c(r,n);cat(N,"\n")}else{cat(n,15-S);n=0}}
1: 2 4 5 9 2 3 5 0 2 4 5 0 3
14:
Read 13 items
2 4 5 4
5 2 3 5
0 2 4 5 0 3 1

Python 2, 117 bytes
i=input()
while i:
 s=15;r=[]
 while s>0:n=i.pop(0)if i else s;s-=n;r+=[n]if s>=0 else[n+s]
 if s<0:i=[-s]+i
 print r

Takes input as list:
>>[2,4,5,9,2,3,5,0,2,4,5,0,3]
[2, 4, 5, 4]
[5, 2, 3, 5]
[0, 2, 4, 5, 0, 3, 1]

Python 3: 139 bytes
Slightly different approach than the other answer. Produces the actual output from the question because I initially assumed that was a requirement.
def f(l):
 m=15;r,s=sum(l)%m,0
 if r:l+=[m-r]
 while l:
  x=l.pop(0)
  if s+x>m:y=m-s;l[0:0]=[x-y];x=y
  s+=x;print(x,end=' \n'[s==m]);s%=m

Example usage:
>>> f([2, 4, 5, 9, 2, 3, 5, 0, 2, 4, 5, 0, 3])
2 4 5 4
5 2 3 5
0 2 4 5 0 3 1

Perl, 76 bytes
Includes +3 for -p (normally +1, but +3 to play fair with the other perl solution)
Run with the input on STDIN (final newline on input is optional, but MUST be absent for the empty input)
sum15.pl <<< "1 2 3"

sum15.pl:
#!/usr/bin/perl -p
s/$/ 15/;s/\d+/1x$&/eg;s/( *1){15}\K ?/
/g;s/
1*
*$//;s/1+|\B/length$&/eg

Look ma, no calculations whatsoever...

Better late than never! Very nice solution though :)

0s are rather tricky in this solution (represented by extra spaces) and I have to be very careful to properly handle spaces to keep the number of 0s correct. In particular consider inputs where a partial sum is exactly 15, like 1 14 2 13. Try them without the  ? and see what happens

Yes, I tried it and saw that 0's where added at the begining of some lines like you say (that's why I deleted my comment 30 seconds after posting it). Thanks

Java - 158 155 bytes
Lambda version of https://codegolf.stackexchange.com/a/65590/46866 by yassin-hajaj, Not sure if a valid submission, but dont have enough rep to add a comment on the linked answer. Counted using http://meta.codegolf.stackexchange.com/questions/4944/byte-counter-snippet
a->{int c=0,j;String s="";f:for(int i:a){for(j=i;j-->0;)if(++c>14){s+=(i-j)+"\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}s+=i+" ";}return s+(15-c);}

158 Bytes
a->{int c=0,j;String s="";f:for(int i:a){for (j=i;j-->0;)if(++c>14){s+=(i-j)+ "\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}s+=i+ " ";}return s+(15-c);}

Ungolfed
a ->
    {
        int c=0, j;
        String s = "";
        f:
        for (int i : a) {
            for (j = i; j-- > 0; )
                if (++c > 14) {
                    s += (i - j) + "\n";
                    c = 0;
                    if (j < 15) {
                        if (j > 0) s += j + " ";
                        c += j;
                        continue f;
                    }
                }
            s += i + " ";
        }
        return s + (15 - c);
    }

can be used like
Function<int[], String> func =a->{int c=0,j;String s="";f:for(int i:a){for (j=i;j-->0;)if(++c>14){s+=(i-j)+ "\n";c=0;if(j<15){if(j>0)s+=j+" ";c+=j;continue f;}}s+=i+ " ";}return s+(15-c);};
System.out.println(func.apply(new int[]{2, 4, 5, 9, 2, 3, 5, 0, 2, 4, 5 ,0 ,3}));

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Resolving the Date Format Dispute
The formatting order of dates is one of the most complex and divisive issues the world faces today. Some of us vehemently argue that Month/Day/Year is appropriate, considering that's how we say dates out loud. Others loudly proclaim that Day/Month/Year is best, because it puts the terms in ascending order of the duration they represent.
Enough is enough. Computers can resolve this dispute simply and fairly. Your code, a complete function or program, will take a date string delimited by slashes, e.g. 12/1/2015. Note this is the exact format, without leading zeroes and with a four-digit year at the end.

If it's definitely Month/Day/Year, e.g. 10/31/1998, output a text representation of that date in this exact format, with the full month name, day, and year: October 31, 1998
If it's definitely Day/Month/Year, e.g. 25/12/1989, output the same sort of text representation: December 25, 1989.
If it's ambiguous whether it's Month/Day/Year or Day/Month/Year, output a date that resolves the ambiguity by combining the two possible dates as follows:

Create a new month name by taking the first half of the name of the earlier month and append the second half of the later month. For months with odd length, the first half gets the extra letter. To be explicit, the first halves of the months are Janu, Febr, Mar, Apr, Ma, Ju, Ju, Aug, Septe, Octo, Nove, and Dece and the second halves are therefore ary, uary, ch, il, y, ne, ly, ust, mber, ber, mber, and mber.
Calculate the day by averaging the two possible days, taking the floor when the average is not an integer.
Output the text representation of this date, e.g. for 10/8/2011, output Augber 9, 2011.

If the input date cannot be Month/Day/Year or Day/Month/Year (e.g. 13/13/2013 or even 2/30/2002), any behavior is acceptable. This code golf, shortest code wins!
Test cases:
10/31/1998 gives October 31, 1998
25/12/1989 gives December 25, 1989
10/8/2011 gives Augber 9, 2011
8/5/1957 gives Maust 6, 1957
9/12/2012 (oddly enough) gives September 10, 2012
1/1/2000 gives January 1, 2000

Related - http://codegolf.stackexchange.com/questions/33033/has-my-milk-expired

For what it's worth, a lot of those who argue for day-month-year also say dates in that order. (Of course, Real Programmers argue for year-month-day).

Just to be sure: without leading zeroes and with a four-digit year at the end implies year >= 1000

That's correct.

+∞ for September 10, 2012

Pyth - 156 bytes
Really bad code, and will need to use packed strings, but its something.
Kc"January February March April May June July August September October November December"dJhM.g>k12=GsMcz\/?<eJ32++@KthJdtP`,eJeGss[@VCcL2KStMPGdPt`,s.OPGeG

Test Suite.

Mathematica 341 304 298 288 293 bytes
This uses a pure or anonymous function, that is, a function without its own name.
DateString returns an error message if the date is ambiguous. Checkcatches the ambiguity and sends the offending date to DateList, which transforms it into list of 3 integers (which it believes to be {year, month, day}). The month and day integers are sorted by size and used to determine the month and day as per the OP's instructions.
Quiet silences error printing.
t=StringSplit;v=ToString;x=t[#,"-"]&/@t["Janu-ary Febr-uary Mar-ch Apr-il Ma-y Ju-ne Ju-ly Aug-ust Septe-mber Octo-ber Nove-mber Dece-mber"];
Quiet@Check[#~DateString~{"MonthName"," ","DayShort",", ","Year"},
{m,n,o}=DateList@#;{p,q}=Sort@d[[2;;3]];x[[p,1]]<>x[[q,2]]<>" "<>v@Floor@Mean@{n,o}<>", "<>v@d[[1]]]&

t=StringSplit;v=ToString;x=t[#,"-"]&/@t["Janu-ary Febr-uary Mar-ch Apr-il Ma-y Ju-ne Ju-ly Aug-ust Septe-mber Octo-ber Nove-mber Dece-mber"];
Quiet@Check[#~DateString~{"MonthName"," ","DayShort",", ","Year"},
{m,n,o}=DateList@#;{p,q}=Sort@d[[2;;3]];x[[p,1]]<>x[[q,2]]<>" "<>v@Floor@Mean@{n,o}<>", "<>v@d[[1]]]& /@
{"10/31/1998","25/12/1989", "10/8/2011", "8/5/1957", "9/12/2012", "1/1/2012"}

{"October 31, 1998", "December 25, 1989", "Augber 9, 2011", "Maust 6,
1957", "September 10, 2012", "January 1, 2012"}

I personally would love to see you eliminate that 0, but I'll let the votes fall as they may.

It now returns "January 1, 2012" as requested.

Javascript (ES6), 311 295 282 274 246 238 bytes
a=>(a=a.split`/`,b=c=>e(c).length+1>>1,d=' ',e=f=>new Date(99,a[+f]-1).toLocaleString('en',{month:'long'}),g=+a[0],h=+a[1],i=g>h,j=g>12,k=h>12,(j&&!k?e(1)+d+g:k&&!j?e(0)+d+h:e(i).slice(0,b(i))+e(1-i).slice(b(1-i))+d+((g+h)>>1))+', '+a[2])

Edit: Uses toLocaleString to generate month names. Change the locale to get results using month names in different locales!
Edit 2: Now generates two month names instead of all 12!
Ungolfed:
func = inp => (
    inp = inp.split `/`,
    get = arg => months(arg).length + 1 >> 1,
    space = ' ',
    months = key => new Date(99, inp[+key] - 1).toLocaleString('en', { month: 'long' }),
    tmp1 = +inp[0],
    tmp2 = +inp[1],
    first = tmp1 > tmp2,
    t1greater = tmp1 > 12,
    t2greater = tmp2 > 12,
    (t1greater && !t2greater ?
        months(1) + space + tmp1
    :
        t2greater && !t1greater ?
            months(0) + space + tmp2
        :
            months(first).slice(0, get(first)) + months(1 - first).slice(get(1 - first)) + space + ((tmp1 + tmp2) >> 1)
    )
    + ', ' + inp[2]
)

Example:
console.log(
    func('10/31/1998') + '\n' +
    func('25/12/1989') + '\n' +
    func('10/8/2011') + '\n' +
    func('8/5/1957') + '\n' +
    func('9/12/2012') + '\n' +
    func('1/1/2000')
);

Thanks to:
@user81655, 274 => 246 bytes
@edc65, 246 => 238 bytes

I haven't looked very thoroughly but here's a few improvements you could make:
change Math.ceil(e[c].length/2) to (r=e[c].length/2)+r%1,
Array(2).fill().map((_,f)=>...) to f=>... and every e[n] to e(n),
i=+(g>h) to i=g>h and e[i] to e[+i],
remove the unnecessary brackets in the last ternary operator,
Also, newDate should be new Date.

Avoid Math.ceil using b=c=>e(c).length+1>>1

JavaScript ES6, 204
x=>(s=x=>x.split`/`,[a,b,y]=s(x).sort((a,b)=>a-b),(c=b)>12?c=a:b=a- -b>>1,s('/Janu/Febr/Mar/Apr/Ma/Ju/Ju/Aug/Septe/Octo/Nove/Dece')[a]+s('/ary/uary/ch/il/y/ne/ly/ust/mber/ber/mber/mber')[c]+` ${b}, `+y)

Test snippet:

F=x=>(
  s=x=>x.split`/`,
  [a,b,y]=s(x).sort((a,b)=>a-b),
  (c=b)>12?c=a:b=a- -b>>1,
  s('/Janu/Febr/Mar/Apr/Ma/Ju/Ju/Aug/Septe/Octo/Nove/Dece')[a]
  +s('/ary/uary/ch/il/y/ne/ly/ust/mber/ber/mber/mber')[c]+` ${b}, `+y
)

console.log=x=>O.innerHTML+=x+'\n'

;['10/31/1998','25/12/1989','10/8/2011','8/5/1957','9/12/2012','1/1/2000']
.forEach(x=>console.log(x+' -> '+F(x)))

Python 3 (290 bytes)
Similar to Ashwin Gupta's answer, but taking advantage of Python's calendar module to avoid writing out all of the month names.
import calendar as C
M,I,P,S,L,A=C.month_name,int,print," ",len,", "
def d(i):
 w=i.split("/")
 f,s,y=I(w[0]),I(w[1]),w[2]
 if(f>12):P(M[s]+S+w[0]+A+y)
 elif(s>12):P(M[f]+S+w[1]+A+y)
 else:l,h=min(f,s),max(f,s);P(M[l][:I(L(M[l])/2+.5)]+M[h][I(L(M[h])/2+.5):]+S+str(I((f+s)/2))+A+y)

Python 2 should trim a few bytes with integer division and losing the parentheses for print.

Python, 558 554 bytes
A really, really, really horribly golfed example of how to do this in python. Sorry, I'm super bad at this golfing stuff D: . It works though. I'm sure there are plenty of ways to simplify this so let me know in the comments.
Golfed:
import math
def d(i):
 l=["","January","February","March","April","May","June","July","August","September","October","November","December"]
 w=i.split('/')
 f=int(w[0])
 s=int(w[1])
 S=" "
 y=w[2]
 if(f>12):
  e=int(w[1])
  print(l[e]+S+w[0]+", "+y)
  elif(f<=12 and s>12):
   e=int(w[0])
   print(l[e]+S+w[0]+", "+y)
   else:
    if(f<s):
     o=l[f]
     t=l[s]
    else:
     o=l[s]
     t=l[f]
    o=o[0:int(math.ceil(len(o)/2))]
    t=t[int(math.ceil(len(t)/2)):len(t)]
    print(o+t+S +  str(math.floor((f + s)/2)) + ", " + y)

Ungolfed
import math
def d(i):
    l = ["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
    w = i.split('/')
    f = int(w[0])
    s = int(w[1])
    y = w[2]
    if(f > 12):
        e = int(w[1])
        print(l[e] + " " + w[0] + ", " + y)

    elif(f <= 12 and s > 12):
         e = int(w[0])
         print(l[e] + " " + w[0] + ", " + y)
    else:
         if(f < s):
            o=l[f]
            t=l[s]
         else:
            o=l[s]
            t=l[f]
         o = o[0:int(math.ceil(len(o)/2))]
         t = t[int(math.ceil(len(t)/2)):len(t)]
         print(o+t+" " +  str(math.floor((f + s)/2)) + ", " + y)

Screenshot:

put S=" " at the top, then replace every instance of " " with S -- that will shave off some bytes

there's a few unnecessary spaces after assignments (e= int[..., o = o...). also, it might prove adventageous to set often-used calls like int to single-letter uppercase vars

This has a few problems: it gives me one decimal place in the ambiguous case, and doesn't split the month names correctly: 10/8/2011 gives Augober 9.0, 1957 and 8/5/1957 gives Must 6.0, 1957.

@Luke really? I tried your test cases and that worked, let me double check again. And it should be printing the numbers as ints because I type cast f and s to int.

@sysreq Ok thanks for the tips, Ill regolf it after school. What do you mean by setting often used calls to an uppercacse variable? How do I do that?

@Luke ok just tried it, seems to be working great for me. (See question body for a screen shot.) Just in case though, I'll copy/paste the code back in, maybe something got deleted or its an older version.

@Luke I just retried all of the test cases, they all work for me.

Here's 447 bytes: from math import* I=int S=" " C="," L=len P=print def d(i):  l=["","January","February","March","April","May","June","July","August","September","October","November","December"];w=i.split('/');f=I(w[0]);s=I(w[1]);y=w[2]  if f>12:e=I(w[1]);P(l[e]+S+w[0]+C+S+y)  elif f<13and s>12:e=I(w[0]);P(l[e]+S+w[0]+C+S+y)  else:   if f<s:o=l[f];t=l[s]   else:o=l[s];t=l[f];o=o[0:I(ceil(L(o)/2))];t=t[I(ceil(L(t)/2)):L(t)]   P(o+t+S+str(floor((f+s)/2))+C+S+y)

@sysreq ok my mind is officially blown. I didn't know you could store functions to a variable. Thank you. I will edit that in. Also, could you do me a favor and try running my code (golfed one) and see if it's working like it should because Luke seems to be getting different results than me so I just want to see.

As far as I can tell, your program works as expected in all test cases: d("8/5/1957") -> Maust 6, 1957, d("10/8/2011") -> Augber 9, 2011

@sysreq yeah idk. Why it's different for him. Anyways, thanks again for the tips, it really helps not only for golfing but in general since I'm still new to Python. Also, I just realized I can remove my initial assignments of o and t and save 4 bytes by putting he array element directly in my splitter. I will make all of these changes this afternoon. Thanks to you the new byte count will be significantly less!

PHP, 301 294 bytes
function r($t){$e='return date("F",mktime(0,0,0,$o));';list($a,$b,$c)=explode('/',$t);$o=min($a,$b);$m=eval($e);$o=max($a,$b);$n=eval($e);echo(($a|$b)<13)?substr($m,0,ceil(strlen($m)/2)).substr($n,ceil(strlen($n)/2))." ".floor(($a+$b)/2).", $c":date("F j, Y",strtotime(($a>12)?"$b/$a/$c":$t));}

I thought I could compete with the Javascript answer. Oh well.
I think I could make it smaller and I don't like the code I used for the ambiguous dates. I think there is a better way to do it.
Ungolfed:
function r($t){
    // Eval'd code to reduce char count
    $e='return date("F",mktime(0,0,0,$o));';

    // Split the date
    list($a,$b,$c)=explode('/',$t);

    // Get the earliest month
    $o=min($a,$b);
    $m=eval($e);

    // Get the latest month
    $o=max($a,$b);
    $n=eval($e);

    // If ambiguous
    if ($a<13 && $b<13) {
        print substr($m,0,ceil(strlen($m)/2)).substr($n,ceil(strlen($n)/2))." ".floor(($a+$b)/2).", $c";
    }
    else {
        print date("F j, Y",strtotime(($a>12)?"$b/$a/$c":$t));
    }
}

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Interpret StackyMath!
Time for you to implement my new stack based language! It's called StackyMath. This will be a stack based language with 8 operations on the stack and ways to add numbers to the stack.
List of operations:

/: Division. Performed on the top 2 numbers of the stack. Pushes the result back on the stack.
*: Multiplication. Performed on the top 2 numbers of the stack. Pushes the result back on the stack
-: Subtraction. Performed on the top 2 numbers of the stack. Pushes the result back on the stack
+: Addition. Performed on the top 2 numbers of the stack. Pushes the result back on the stack
^: Exponentiation. Performed on the top 2 numbers of the stack. Pushes the result back on the stack
%: Modulo. Performed on the top 2 numbers of the stack. Pushes the result back on the stack
!: Factorial. Performed on the top number on the stack. Pushes the result back on the stack
D: Duplicate the top number on the stack

Operations defined in pseudo code:

/: push(pop divided by pop)
*: push(pop times pop)
-: push(pop minus pop)
+: push(pop plus pop)
^: push(pop to the pop)
%: push(pop mod pop)
!: push(factorial pop)
D: t = pop; push(t); push(t)

How to push numbers to the stack:
Adding numbers to the stack is easy, just put the raw number in your program where you need it. If you need to put multiple numbers on the stack you can separate them with a comma (,). Your program will not need to process - numbers in the input, If the user wants one they should push the number they want negated, zero, and -. Numbers in the input of the program are also constrained to positive integers.
Input:
Your program should take the input on the command line, or from std in. Input will only consist of numbers (no scientific notation or decimals) delimited by , as needed, and the operations defined above.
Output:
Your program should print the number on the top of the stack.
Error cases:

If the program tries to over-pop the stack, you should print StackUnderflowException!!! .
If you have division by zero, print DivisionByZeroException!!!
If a number that exceeds 64-bits, either while executing the program or processing a number in the input, print NumberOverflowException!!!
If somehow you get a negative number on the top of the stack and you need to do a factorial, print NegativeFactorialException!!!
If you have a floating point number on the tops of the stack and the next operation is factorial, print FloatingFactorialException!!!
If no numbers are on the stack when the program exits (i.e. the program was empty) print EmptyProgram!!!

Notes:

All error output to should got yo std err or closest equivalent.
All numbers are constrained to 64-bit floating point.

Example programs:
50,47*                 -> 2350
50,47/                 -> 0.94
100,8!                 -> 40320
100D*                  -> 10000
!                      -> StackUnderflowException!!!
5,2/!                  -> FloatingFactorialException!!!
4,3!2*/                -> 3
654,489,48,43/5*7D+-*% -> 77.68749999999909
                       -> EmptyProgram!!!

(I can add more if needed)

If it weren't for the Error cases, Vitsy could do this naturally (except converting ! to F).

I figured, that's partly why I included them.

Yours is somewhat broader in scope, though it may be arguable that its a duplicate: http://codegolf.stackexchange.com/questions/221/reverse-polish-notation

Wow, I forgot about that one. But I don't think they are dupes since you have to process errors and more operators are defined in mine.

654,489,48,43/5*7D+-*% should return 77.6875. (43/48*5-(7+7) should be (7+7)-43/48*5)

Aww crap. Quite right, I messed it up. Fixing now.

Is it fine if we throw an exception with the correct text? Example: throw 'EmptyProgram!!!';

Shoulda thought of that. No, you can't. This may seem arbitrary but kinda the idea is to create your own language with its own exceptions, you don't want to see the interpreter throwing exceptions.

Does that mean my answer is invalid? I designed it to be run without needing a console, so the error message is displayed, but if you looked at the console you would see that it threw an exception also.

No, I think its fine. Just as long as the user can't see it by default.

In the requirement you only mentioned that in case of error a message has to be printed to STDERR. However your answer also exits in case of error. Is exiting mandatory or optional?

Optional. I did it because exiting was the shortest way to stop the program. I didn't want to continue processing the program if it has errors

Ruby, 412 410 404 392 380 377 characters
def e m,x='Exception';warn m+x+?!*3;exit;end
def o;e'StackUnderflow'if$*==[];$*.pop;end
u=->n{e'DivisionByZero'if n.infinite?;e'NumberOverflow'if n>2**64;$*<<n}
f=->n{e'NegativeFactorial'if n<0;e'FloatingFactorial'if n.to_i<n;n<2?1:f[n-1]*n}
gets.gsub(/(\d+)|([+*\/%^-])|(!)|D/){$1?u[$1.to_f]:$2?u[eval"o#{$2>?A?:**:$2}o"]:$3?u[f[o]]:u[x=o]+u[x]}
e'EmptyProgram',''if$*==[]
p o

This is regular precision version using Float. The result precision is as in the sample code, but numeric overflow detection is not exact.
Sample run:
bash-4.3$ ruby StackyMath.rb <<< '654,489,48,43/5*7D+-*%'
77.68749999999909

Ruby, 378 377 characters
def e m,x='Exception';warn m+x+?!*3;exit;end
def o;e'StackUnderflow'if$*==[];$*.pop;end
u=->n{e'NumberOverflow'if n>2**64;$*<<n}
f=->n{e'NegativeFactorial'if n<0;e'FloatingFactorial'if n.to_i<n;n<2?1:f[n-1]*n}
gets.gsub(/(\d+)|([+*\/%^-])|(!)|D/){$1?u[Rational$1]:$2?u[eval"o#{$2>?A?:**:$2}o"]:$3?u[f[o]]:u[x=o]+u[x]}rescue e'DivisionByZero'
e'EmptyProgram',''if$*==[]
p o.to_f

This is high precision version using Rational. The result precision is not always the same as in the sample code, but numeric overflow detection is exact.
Sample run:
bash-4.3$ ruby StackyMath-hi.rb <<< '654,489,48,43/5*7D+-*%'
77.6875

JavaScript (ES6), 430 bytes
422 bytes with ES7 by changing Math.pow(2,2) to 2**2
e=m=>{throw alert(m)};u=prompt();u?alert(eval('u.match(/\\d+|[^,]/g).map(o=>s.push(t=o=="/"?(b=p(a=2))?a/b:e`DivisionByZero43*"?2*23-"?2-23+"?2+23%"?2%23^"?Math.pow(2,2)3D"?s.push(r=2)&&r3!"?eval("for(r=i=2;i<0?e`Negative54:i%1?e`Floating54:--i;)r*=i;r"):+o)&&t==Infinity&&e`NumberOverflow4,s=[],p=_=>s.length?s.pop():e`StackUnderflow4);t'.replace(/[2-5]/g,x=>[,,'p()',':o=="','Exception!!!`','Factorial'][x]))):e`EmptyProgram!!!`

Explanation
Uses eval to replace certain common phrases. Ungolfed and without the eval it looks like this:
e=m=>{throw alert(m)};                           // e = throw error, alert displays
                                                 //     message, throw stops execution
u=prompt();                                      // u = received input
u?alert(                                         // display the result
  u.match(/\d+|[^,]/g)                           // get array of numbers and operators
    .map(o=>                                     // iterate over operators
      s.push(t=                                  // t = last pushed value

        // Execute operator
        o=="/"?(b=p(a=p()))?a/b:                 // make sure argument B is not 0
          e`DivisionByZeroException!!!`:
        o=="*"?p()*p():
        o=="-"?p()-p():
        o=="+"?p()+p():
        o=="%"?p()%p():
        o=="^"?Math.pow(p(),p()):
        o=="D"?s.push(r=p())&&r:
        o=="!"?eval("                            // eval to enable for loop in ternary
          for(                                   // no factorial in JS so do this manually
            r=i=p();
            i<0?e`NegativeFactorialException!!!` // check for errors
              :i%1?
                e`FloatingFactorialException!!!`
                :--i;
          )
            r*=i;
          r"):                                   // return r
        +o                                       // if not an operator cast as a number
      )&&t==Infinity&&                           // JS turns anything over 64 bit float
        e`NumberOverflowException!!!`,           //     max value into Infinity
      s=[],                                      // s = stack array
      p=_=>s.length?s.pop():                     // p = check stack then pop
        e`StackUnderflowException!!!`
    )&&t                                         // return top stack element
  ):e`EmptyProgram!!!`                           // error if input length is 0

If you want to upgrade to ES7, you could use the ES7 exponentiation operator to replace Math.pow(p(),p()) with p()**p().

@usandfriends I was thinking about it, but it meant that it would not work in my browser so I left it out. :P I'll add a note saying that.

Candy, 298 348 392 bytes
Although Candy is stack based, I'm not sure that really helped...
&{|"EmptyProgram!!!\n"(;).}(=bYZay0=zx4k"!%*+,-/D^"(iYe{Z=x})aYb=z=ya=X{Y{cZ0=yza}b212202221(i=ZXe{y})a0=zcY0j{XjZ{|D1b#64R(=c2*)c>{b"NumberOverFlow"(;)i}}|i}aZ{(=)"Exception!!!\n"(;).}0=yz|A#48-Z#10*+=z1=y})c?(=).@0&<{1|b"StackUnderflow"(;)c0}.@1~ALe{A0<{b"Negative"(;)i|1bAR(=cA*)}|b"Floating"(;)i}Z{b"Factorial"(;)}.@2W%.@3*.@4+@5.@6W-.@7WD{/|b"DivisionByZero"(;)i}.@8~A.@9=xK=y=1bA_(cX*).

Formatted a bit reveals a bit of structure:
&{|"EmptyProgram!!!\n"(;).}
(=bYZay0=zx4k
  "!%*+,-/D^"
  (iYe{Z=x})
  aYb=z=ya=X
  {
    Y{cZ0=yza}b
    212202221(i=ZXe{y})
    a0=zcY0j
    {XjZ{|D1b#64R(=c2*)c>{b"NumberOverFlow"(;)i}}|i}
    aZ{(=)"Exception!!!\n"(;).}
    0=yz|A#48-Z#10*+=z1=y
  }
)c?(=).
@0&<{1|b"StackUnderflow"(;)c0}.
@1~ALe{A0<{b"Negative"(;)i|1bAR(=cA*)}|b"Floating"(;)i}Z{"Factorial"(;)}.
@2W%.@3*.@4+@5.@6W-.@7WD{/|"DivisionByZero"(;)i}.@8~A.@9=xK=y=1bA_(cX*).

The actual math occurs on the last two lines.  It's driven there by a jump table on the third line.

Dang, I see that I missed DivisionByZero, NegativeFactorial, and Overflow.  I was just looking at the test cases!

Wow, this is cool. I just might need to look up candy.

I'm still working on how exactly to define overflow.

Actually I had the same problem in my answer. See the comments below my answer.

Fixed the Overflow now.  I used the same approach as the Ruby, which is just to compare to 2^64 at the end of each operation.

Groovy, 718 bytes. Fore!
May as well post my impl golfed. Meet my big wall of code:
g='Exception!!!'
a={System.err.print(it);System.exit(1)}
b=new Stack()
c={b.push(it)}
v=2d**64d
d={b.pop()}
e={if(b.size()<it)a('StackUnderflow'+g)}
f={a('NumberOverflow'+g)}
h={e(2)
c(Eval.xy(d(),d(),"x$it y"))
if(b.peek()>v)f()}
k={i->if(i<0)a('NegativeFactorial'+g)
if(Math.abs(i-(i as long))>1E-6)a('FloatingFactorial'+g)
(2..i).inject{x,y->(v/x<y)?f():x*y}}
l=['/':{e(2)
m=d()
n=d()
if(n==0)a('DivisionByZero'+g)
c(m/n)},'!':{e(1)
c(k(d()))},'D':{e(1)
c(b.peek())}]
System.in.newReader().readLine().findAll(~/\d+|[^,]/).each{x->if(x.matches(/\d+/))try{c(x as double)}catch(Exception e){f()}
else if("+-*%^".contains(x))h(x.replace('^','**'))
else l[x]()}
if(b){o=d()
if(Double.isInfinite(o))f()
println o}else a('EmptyProgram!!!')

Ungolfed:
error = {System.err.print(it);System.exit(1)}

stack = new Stack()
maxVal = 2d**64d

push = {stack.push(it)}
pop = {stack.pop()}

checkAtLeast = {if (stack.size() < it) error('StackUnderflow'+exception)}
numberOverflow = {error('NumberOverflow'+exception)}

exception = 'Exception!!!'

def dArgOp(i) {
    checkAtLeast(2)
    push(Eval.xy(pop(), pop(), "x$i y"))
    if(stack.peek() > maxVal) numberOverflow
}

factorial = {i->
    if (i < 0)
        error('NegativeFactorial'+exception)
    if (Math.abs(i - (i as long)) > 1E-6)
        error('FloatingFactorial'+exception)
    (2..i).inject {acc, it ->
        (maxVal/acc < it)?numberOverflow():acc*it
    }
}

ops = [
'/' : {
    checkAtLeast(2)
    first = pop()
    second = pop()
    if (second == 0)
        error('DivisionByZero'+exception)
    push(first / second)
},
'!' : {
    checkAtLeast(1)
    push(factorial(pop()))
},
'D' : {
    checkAtLeast(1)
    push(stack.peek())
}]

input = System.in.newReader().readLine()
tokens = input.findAll(~/\d+|[^,]/)

tokens.each {
    print "current token: $it  \t stack before eval: $stack "
    if (it.matches(/\d+/))
        try {
            push(it as double)
        } catch (Exception e) {
            numberOverflow()
        }

    else if ("+-*%^".contains(it))
        dArgOp(it.replace('^','**'))
    else
        ops[it]()
    println "result: ${stack.peek()}"
}

if (stack) {
    top = pop()
    if (Double.isInfinite(top))
        numberOverflow()
    println top
} else
    error('EmptyProgram!!!')

Edit 1: save ~15 bytes thanks to @Doorknob
Edit 2: drop ~130 bytes with a few more tricks

I don't know Groovy, but you seem to have lots of unnecessary whitespace. For example, around operators, after for/if, etc

Whoops, just noticed many more places to remove whitespace. Thanks for the tip.

You can use System.in.text instead of System.in.newReader().readLine().

Not really. .text is greedy and as long as data in in the reader, it won't return.

Right, but this is code-golf. It's not a big deal if people have to type Control-D after their input.

Right, forgot about Ctrl-D. I almost never use the command line. It doesn't matter since I will remove this shortly in favor of the python answer I'm working on.

@quartata as it turns out my skills + python + this challenge is more than 900 bytes, so I plan to keep this one. Oh and for some reason Ctrl-D quits the process, not end the std in. Do you use OSX or lunix?

I use Linux. I'm not sure why Ctrl-D would quit the process (it just means EOF). Try giving your input like this: groovy script <<< INPUT

Nope, still doesn't work. Perhaps it's a bash feature.

Does it require a specific version of Groovy? The 1.8.6 I use raises exception on factorial: “groovy.lang.MissingMethodException: No signature of method: groovy.lang.ObjectRange.inject()”.

It looks like you would need 1.8.7 min (from the docs) but I'm not sure. I am using groovy 2.4.5 right now.

Not getting NumberOverflowException when calculating 65,2^ is also a version difference?

I'm not sure what is going on when I do that. It would seem that I'm using big decimal instead of double.... I'll see if I can fix that soon.

Quite odd. It looks like I'm using double (getClass().getSimpleName() is Double) but increasing the value has no effect. Is double replaced with BigDecimal in groovy?

@manatwork Weird, Double has Double.MAX_EXPONENT, set to 1023. So 2d**1024d is Infinity, but 2d**64d is just fine...

If you ask me, that 64 bit thing is the requirement's issue. ;) In a certain degree it should appear in most of the languages. (For my Ruby solution there would be a trick to use Rational instead, but then you get higher precision for the result too, not just the error checking. I mean, 654,489,48,43/5*7D+-*% would result 77.6875.)

I'm not sure I can fix it now, It's a little late to change the question ;) I will go ahead and fix my answer though.

@manatwork That should fix it. Thanks for catching that problem.

Now it works like in Ruby: 64,2^1000+ passes and gets calculated, 64,2^10000+ raises the exception. I strongly believe there is no better solution given the machine's internal floating point representation.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/