text:
I spy with my little eye a number beginning with n++
If you have ever travelled with kids more than about 20 minutes, you will have no doubt heard cries of "Are we there yet?" and "How much further?"
So we play games like "I Spy" to help pass the time as the miles go by.
There is a variation on "I Spy" whereby instead of spotting arbitrary named things, you must spot integers in strictly ascending order.  Numbers are everywhere - licence plates, street names and numbers, street signs, adverts and so on - the list goes on; so this would appear to be a trivial game, so there are some restrictions to make this more challenging*:

Each number must be spied in isolation - if the next number you need to spy is 7 and you see house number 17 then this does not count.  However license plate 7ABC123 would be OK.
In general, numbers may be considered "in isolation" if they are separated by any non digit separator, though there are some exceptions
Fractions cannot be used.  For example if you see a road sign saying "Albuquerque ¾ mile"  (or even "Albuquerque 3/4 mile") you would not be able to spy either the "3" or the "4"
Conversely if you see a date written as "3/4/2015" you may spy any of the "3", "4" or "2015"
Decimals are a bit tricky.  If you see "Ford Escort 1.3 litre", the 1.3 here counts a non-integer and the "1" and "3" parts cannot be used in isolation.  However if you see "Ford Mustang 5.0 liter", you may spy this as a 5, because even though 5.0 is written as a decimal it is in fact a whole number.
You may only spy numbers seen outside of the vehicle - so the ascending seconds of a your car's digital clock may not be spied.  If you are lucky enough to see such a clock outside of the vehicle, then you may spy those ascending seconds until you can no longer see them (or they wrap to the next minute)
You may see descending countdown seconds at a pedestrian crossing.  Because numbers must be spied in ascending order, you will only be able to spy at most one number per pedestrian crossing.
Numbers with leading zeros can be spied - for example the "020" in a London phone number would be acceptable as 20.

Challenge
The kids have already got bored of this game, so they want a program to play it for them.  This program must do the following:

Read input from an unbounded stream.  This will most likely be STDIN or equivalent pipe, though (theoretically at least) something like a TCP session could be used.  Function parameters or command-line options generally won't work as there will be limits to how much data is passed.  However some kind of pointer or reference to an unbounded stream would be OK.
The input stream will consist of random printable ASCII characters, as generated by tr -dc '[:print:]' < /dev/urandom on Linux.  The input will generally not have newlines (these are control characters and not printable), so the input will effectively be one unbounded-length line.
Spy ascending integers appearing in the stream starting at 0.  This spying is subject the rules of the game above.  In particular:

Numbers may only be spied if they are isolated, i.e. separated by non-digits
Numbers with leading zeros must be spied
No numbers may be spied from a substring <sep>n/m<sep>, where <sep> is any legal separator other than /
Decimals of the form <sep>n.0*<sep> (where 0* indicates 0 or more zeros) should be spied, but decimals with non-zero fractional parts should not be spied.  Numbers in dotted decimals such as IP addresses where there is more than one . should be spied.

For output, we need to keep track of what we have spied to so far.  Every spied number should be output when it is spied.  However we don't want to see a long stream of ascending numbers, so each number output must overwrite the previous one in some way.  This may be achieved using escape characters, backspaces, output to some kind of textbox or any other method appropriate to your language.
The program will continue spying until either the input stream ends, or until interrupted by the user (e.g. CTRL-c or button click)
Your counter must be able to count up to at least 2^31-1.  Above that, behavior may be undefined.

Examples
0 1 2 3 4 5 6 7 8 9 10   will spy up to 10
0a1b2c3d4e5f6g7h8i9j10   will spy up to 10
10 9 8 7 6 5 4 3 2 1 0   will spy up to 0
0 1 1 1 1 1 2 2 2 2 2    will spy up to 2
00 01 023 4 5            will spy up to 1
0 1 2 3/4 5              will spy up to 2
0 1 2 3/4/2015 5 6       will spy up to 6
0 1 2 3.1415 4 5 6       will spy up to 2
0 1 2 3.000 4 5 6        will spy up to 6
0 1 2 192.168.0.3 4      will spy up to 4
Output from `tr -dc '[:print:]' < /dev/urandom` or equivalent will spy up forever (or until interrupted)

*This game is harder than you might think - I tried it yesterday driving through the Bay Area for 2 hours and only got as far as 14.

What if [my language of choice]'s STDIN is buffered on newline? Can each character be separated by a newline?

I would prefer removing the "overwirte previous output" requirement entirely. Instead, why not just have the program output the index of first occurrence of each number?

I don't think there's a good reason to require an "unbounded" input stream, because for most languages it's just impossible or impractical. for instance, in python, i believe i would have to override sys.stdin and sys.stdout. this requirement seems shockingly arbitrary.

@Doorknob冰 No - sorry - this is a hard requirement.  In fact the I/O requirements are what interested me most about this challenge.  The rest is just (likely) regex and counting, for which there are plenty of other challenges.

@quintopia Nope, sorry, I would prefer to keep this requirement ;-)

@DigitalTrauma Hmm... what seems far more complex about this challenge to me is the rules for when to count numbers.

@cat The "good reason" to me is that there are few, if any challenges that have this kind of stipulation.  I'm most interested in how different languages can handle this

@Doorknob冰 the counting rules certainly add some spice, but I'm pretty sure you regex wizards will handle them without too much difficulty (previous comment deleted and vulgar typo fixed in this version ;-))

I went on a 12 hour trip from CA to Oregon and found the whole alphabet and up to 171. :P

@RikerW I didn't know anyone else actually plays this game ;-)  Do you enforce any same or similar restrictions?  I probably missed a lot while negotiating traffic :-/

Some, I do dates are illegal too, and bonus points if you find a 5 zeros in a row. :P  That one almost never gets found, and is like an instant win.

I also do 1 point per number, and the highest points at the end wins.
You still have to count up, but there are different bonuses for long numbers, specific number sequences, and a couple others.  Like 10 extra points for a 3+ digit totient number. :P

Is 2 in 1.2/3/1015 part of a decimal and can't be spied, or part of a date and can?

Really easy way to do this: Wait until you get to Exit 1 on a highway, and count up until you get off of it. :P

@BlockCoder1392 - depends how your exits are numbered - in the US, most seem to be numbered as per the closest mile marker, so there are plenty of missed numbers

Not where I live... Anyway, what if a date is there without a year (e.g. 12/30 meaning december 30th?)

@BlockCoder1392 In that case, we just have to assume its a rational and ignore it

@nimi Part of a decimal, and thus can't be spied

What about times (eg.12:24 PM or 7:09 AM or 23:15)

@BlockCoder1392 Here the colons are like any other non-digit separator.  12, 24, 7, 09, 23 and 15 may all be treated as numbers in isolation

Thanks for lazy evaluation, in Haskell, we can call function with infinite length string. So I think the question should be restricted for full program, but allow functions. And in other language we can use generator as argument.

sh, 170
tr -cs 0-9/. '\n'|
grep -vxEe"[0-9]+/[0-9]+" -e"[0-9]*\.0*[1-9][0-9]*"|
sed -r 's/^([0-9]*)\.0+$/0\1/'|
tr -s /. '\n'|
awk -vORS="\r" '$1==l{l=$1+1;print l-1}END{print "\n"}'

Doesn't quite work on my Ubuntu 14.04 - seems to be a problem with the awk - I am getting output from the last tr, but nothing from the awk

Fixed. Does not delete last output when working on bounded streams now.


text:
Return prime factorization of a number
Yes, this is old and probably very simple, but I really want to be mindblown by things that I thought were obvious, so here's the challenge:
You're given a positive integer as the input and you need to output the exponents of all of the prime factors up to the highest factor in base 36 ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c ... z ). If there are some primes in between that are no factors, they have exponent 0. The output must be ordered can be either an array or a string separated by \n,  (space) or just outputs from different calls. The program should calculate correctly the output for exponents bigger than 36, but it's not required
Say you're given 42 as the input, its prime factorization is 2*3*7, all of which have 1 as the exponent, but there is also 5 with an exponent of 0, so your output would be [ 1, 1, 0, 1 ] because 2 is the first prime and has an exponent of 1, 3 is the second and has an exponent of 1, 5 is the third and has an exponent of 0 and so on. Here are the correct input/outputs for the first 30 numbers
2   1
3   0 1
4   2
5   0 0 1
6   1 1
7   0 0 0 1
8   3
9   0 2
10  1 0 1
11  0 0 0 0 1
12  2 1
13  0 0 0 0 0 1
14  1 0 0 1
15  0 1 1
16  4
17  0 0 0 0 0 0 1
18  1 2
19  0 0 0 0 0 0 0 1
20  2 0 1
21  0 1 0 1
22  1 0 0 0 1
23  0 0 0 0 0 0 0 0 1
24  3 1
25  0 0 2
26  1 0 0 0 0 1
27  0 3
28  2 0 0 1
29  0 0 0 0 0 0 0 0 0 1
30  1 1 1

and you can find a working expanded version of this on codepen
The solution with the lowest number of bytes wins. Feel free to send in languages who have built-in prime factorization functions, but I won't accept them as answers for pretty obvious reasons. If you send in a solution that doesn't use such functions I'll consider it. It's kind of a grey area, but we'll figure it out.
Edit:
If it's unclear what do I mean by "base", consider the number 3072. Its prime factors are 2 and 3. 2 has an exponent of 10, so in base 36 that's a. That means that the output would look like this:
a 1

or the number 732421875000 whose factorization is 2^3 * 3^1 * 5^15, whose output would be
3 1 f

Huh, where does base 36 come in?

@xnor it's what most languages support. I use JS as a baseline, and number.toString( base ) only works on a base up to 36 for example. Not really important, but again, you can use any base above 36 if you wish, it's not required for it to work after that :)

I still don't understand. What base?

@xnor number base. Ya know, binary, ternary, octal, decimal, hexadecimal,  7, 9, 36, 42, 34123432

What he's asking is what part of the challenge requires output in base 36?

For example, input 1024 should be output a, right?

I'd the output is to be base 36, that's totally arbitrary. It's trivial for languages with a built-in and annoyingly tangential otherwise.

downvoted for requiring base 36. if it's meant to be a twist, it isn't very interesting. also, for what xnor said

would base 16 be better? @xnor I agree with the fact that it may be a problem for a few languages

but 16 would be pretty short to implement, right?

@towc It would be the same, either there's a builtin or not. I don't see the reason for the twist.

Also, this might be a dupe of an existing factorization challenge. I wouldn't count just giving exponents or using a base as much different. Could someone please check existing challenges?

Related (@xnor – Is this the dupe you had in mind?)

@AlexA. Oh, nice, hadn't seen it

Octave, 51 bytes
@(n)dec2base(histc(factor(n),unique(factor(n))),36)

This defines an anonymous function that takes a number and returns a char array. Explanation to come.

Pyth, 15 bytes
VheSPQIP_NC/PQN

Try it here
Outputs in base 256.
(Base36 version, 33 bytes)
VheSPQIP_NjjkmC++48d*>hdT7j/PQN36

Try it here
(Base 10 version, 14 bytes)
VheSPQIP_N/PQN

Try it here
All versions are separated by newlines. There is some unclearness over whether not base 36 outputs are allowed so I included many versions. Uses factorisation functions and is_prime functions.

any base above 36 would have been fine :)

Base 256 isn't particularly readable though.

Mathematica, 80 bytes
#~IntegerExponent~Prime@Range@PrimePi@FactorInteger[#][[-1,1]]~IntegerString~36&

I tried. Without factorization:
Mathematica, 90 bytes
#~IntegerExponent~Prime@Range@PrimePi@Select[Divisors@#,PrimeQ][[-1,1]]~IntegerString~36&

source: Stack Exchange

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

sort: votes


text:
Explain the decimals
Given a decimal in the form of <float>, <precision>, you draw the graphical representation of the decimal part (i.e. fraction) of the float. Examples:

Input: 6.75, 4, output:
6||| 7
 ----

6.75 (first number from the input) is the number to explain, 4 (the second number from the input) is the number of dashes below the pipes.  6 is the floored 6.75, 7 is the ceiled 6.75. The number of pipes is the decimal part of first input number * second input number.
Input: 10.5, 6, output:
10|||   11
  ------

Input: 20.16, 12, output
20||          21
  ------------

.16 actually takes 1.92 pipes, but since I can't draw 1.92 pipes, I ceil it to 2.
Input: 1.1, 12, output:
1|           2
 ------------

.1 is 1.2 pipes in this case, so it's floored to 1 pipe.
Also, an edge case. Input: 5, 4 (i.e. the number is an integer), output:
5    6
 ----

The number to explain is the positive float, limited only by your language abilities.
The precision number is an even integer, greater than 2 (i.e. minimal required precision is 4). It can be arbitrary large too.
>= n.5 pipes are rounded up, to n+1 (i.e 1.5 is rounded to 2 and 2.5 is rounded to 3). < n.5 pipes are rounded to n (i.e. 1.4 is rounded to 1 and 2.4 is rounded to 2).
If it would be more convenient for your language, you can take the input as an array, e.g. [6.75, 4]. If you take the input in the reversed order, i.e. [4, 6.75], please specify it in your answer.

Can you be more specific about exactly what the desired output format is?

@isaacg I've shown four example outputs. What's unclear?

There seem to be a few corner cases uncovered. E.g. input 5.0 4: does it draw from 5 to 6 or from 4 to 5, or is either acceptable? Input 1.25 2: does it have 0 or 1 |s, and why (i.e. what's the rounding rule)? Does the first number in the input have to be positive? What's its maximum precision and magnitude? Does the second number in the input have to be positive? If it's negative, do we draw backwards?

@Peter Clarified.

I don't think you've covered the rounding rule.

@Peter If you are about "What's its maximum precision and magnitude?" - I don't understand why it should be limited by anything rather than the programming language float / int limits.

Re the rounding rule, consider 1.125 4 and this meta answer. If precision and magnitude should be bounded by the language limits, state so - although the question of what those limits are is a bit subtle for integer-only languages which might effectively need to multiply the fpart of the first input by the second input without overflow.

@Peter Tried to clarify.

Very sloppily expressed. You're using 'decimal' to mean (1) input string, (2) number, and (3) fractional part. It doesn't mean any of those things.

CJam, 32 bytes
l~1md@:X*mo'|*XSe]1$)NW$s,S*'-X*

Takes the precision first and the decimal second, separated by a space.
Run all test cases.
Explanation
l~   e# Read input and evaluate, pushing precision and decimal on the stack.
1md  e# Divmod 1, separating the decimal into integer and fractional part.
@:X  e# Pull up precision, store in X.
*mo  e# Multiply precision by fractional part and round.
'|*  e# Push that many vertical bars.
XSe] e# Pad with length X with spaces.
1$)  e# Copy integer part and increment.
N    e# Push linefeed.
W$   e# Copy integer part.
s,   e# Get number of digits as length of string representation.
S*   e# Push that many spaces, to indent the hyphens correctly.
'-X* e# Push X hyphens.

Yep, seems to work fine.

Mathematica, 119 bytes
a=ToString;b=Array;a[c=Floor@#]<>{b["|"&,d=Round[#2#~Mod~1]],b[" "&,#2-d],a[c+1],"
"," "&~b~IntegerLength@c,"-"&~b~#2}&

I tried... Testing:
In[1]:= a=ToString;b=Array;f=a[c=Floor@#]<>{b["|"&,d=Round[#2#~Mod~1]],b[" "&,#2-d],a[c+1],"\n"," "&~b~IntegerLength@c,"-"&~b~#2}&;

In[2]:= f[6.75, 4]

Out[2]= 6||| 7
         ----

In[3]:= f[10.5, 6]

Out[3]= 10|||   11
          ------

In[4]:= f[20.16, 12]

Out[4]= 20||          21
          ------------

In[5]:= f[1.1, 12]

Out[5]= 1|           2
         ------------

In[6]:= f[5, 4]

Out[6]= 5    6
         ----

Could you maybe provide a working demo, or it's not possible?

Javascript ES6, 105 104 bytes
(f,p)=>(i=f|0)+("|".repeat(j=(f-i)*p+.5|0)+" ".repeat(p-j))+(i+1)+(`
`+i).replace(/\d/g," ")+"-".repeat(p)

Saved 1 byte thanks to, um, how do you type ՊՓԼՃՐՊՃՈԲՍԼ anyway?

Sorry, I didn't realise the dashes were part of the output, I thought they were just there to visualise the spaces.

(f,p)=>(i=f|0)+("|"[r="repeat"](j=(f-i)*p+.5|0)+" "[r](p-j))+(i+1)+("\n"+i).replace(/\d/g," ")+"-"[r](p)

Oh yeah, replace \n with an actual newline. And make sure to wrap it in template strings.

Java, 253 206 181 bytes
Saved 47 bytes thanks to @Kenney by inlining conditions and variables used once, and sorting out redundant variables.
Saved 25 bytes again thanks to @Kenney by inlining 2 loops with ternary operators.
Pure String Manipulation:
Inlined loops version (181 bytes):
String m(float f,int p){int g=(int)f,i=0;String h="",q=""+g;int c=q.length();for(;i<c+p;)h+=i++<c?" ":"-";for(i=c;i<p+c;)q+=i++<c+Math.round((f-g)*p)?"|":" ";return q+(g+1)+"\n"+h;}

4 loops version (206 bytes):
String m(float f,int p){int g=(int)f,i=0;String h="",q=""+g;int c=q.length();for(;i++<c;)h+=" ";for(;i<=c+p;i++)h+="-";for(i=c;i<c+Math.round((f-g)*p);i++)q+="|";for(;i++<p+c;)q+=" ";return q+(g+1)+"\n"+h;}

Ungolfed version:
String m(float f,int p){
//initialize some useful values, d is the number of pipes needed
int g=(int)f,d=Math.round((f-g)*p),i=0;
String h="",q=""+g;//append the floored value to the pipe string first
int c=q.length();
for(;i<c;i++)h+=" ";//pad hyphen string with spaces for alignment
for(++i;i<=c+p;i++)h+="-";//append hyphens
for(i=c;i<c+d;i++)q+="|";//append pipes
for(;i<p+c;i++)q+=" ";//append spaces for padding
return q+(g+1)+"\n"+h;}//concatenate the strings in order, separating the strings with a UNIX newline, and return it.

Working example here at ideone.com. The full program accepts STDIN input as
<float>,<precision>.
NOTE: Java's Math.round(float) rounds using RoundingMode.HALF_UPas the default, which is the OP's required behaviour.
The output of the test cases provided was diff-matched to what the OP provided.

I hope you don't mind! You forgot to remove a (never used), setting you at 233. You could save another 23 to get at 210 bytes: replacing q.length() with b saves 13: int g=(int)f, b=(""+g).length(), c=b, i=0;. Incrementing the iterator in the condition of the for saves 6, and inlining d (used once) saves 4: int c = b; for(;i++<b;)h+=" ";  for(;i++<=b+p;)h+="-";  for(i=c;i<c+Math.round((f-g)*p);i++)q+="|";  for(;i++<p+b;)q+=" ";.

Also, someone suggested using an actual newline instead of the escape sequence, but since I'm on Windows, that's a CRLF, 2 bytes anyway given the \n

Nice - yes, b became obsolete aswell ;-) You can still save 1 byte in the 2nd for: for(;i++<=c+p;). You could save the file with unix line endings on windows, but unfortunately Java doesn't allow multiline strings..

@Kenney, no. I tried that. It leads to misaligned hyphens. Java is not the right man for the job, anyway.

I got it down to 181 bytes by using only 2 for loops: for(;i<c+p;)h+=i++<c?" ":"-";for(i=c;i<p+c;)q+=i++<c+Math.round((f-g)*p)?"|":" ";

@Kenney, looking at it, it did occur to me to use conditionals at the time, but I never got around to doing it. I (normally) prefer verbose code anyway. Perhaps you should post this on your own? I really don't want to plagiarize your effort.

@Kenney, I'll just copy-paste it then. I hope you don't mind, and I also hope you ran the tests correctly (bit short on time here).

Japt, 47 46 bytes
Uf +'|pA=ºU-Uf)*V c)+SpV-A +Uc +R+SpUk l)+'-pV

Just a bunch of adding and repeating.
Try it online

(U-Uf) is the same as U%1, saving two bytes.

Haskell, 113 bytes
(%)=replicate.round
s=show
x!y|(n,m)<-properFraction x=[s n,(y*m)%'|',(y-y*m)%' ',s$n+1,"\n",s n>>" ",y%'-']>>=id

Usage example:
*Main> putStrLn $ 20.16 ! 12
20||          21
  ------------

properFraction splits the decimal into it's integer and fraction part. The output is a list of the parts (initial number, bars, spaces, ...) which is concatenated into a single string (via >>=id).

Is it possible to see an online demo of this?

@nicael: demo (with a main wrapper for a full program).

Looks like everything's okay (btw: tested there, think that it's a more convenient compiler).

MATL, 49 bytes
2#1\tYUbiXK*Yo'|'1bX"tnKw-Z"hb1+YUhht4Y2m13*_45+c

Uses release 6.0.0 of the language/compiler. Runs on Matlab or Octave.
Takes numbers in the same order as in the challenge.
Examples
>> matl
 > 2#1\tYUbiXK*Yo'|'1bX"tnKw-Z"hb1+YUhht4Y2m13*_45+c
 >
> 20.16
> 12
20||          21
  ------------

>> matl
 > 2#1\tYUbiXK*Yo'|'1bX"tnKw-Z"hb1+YUhht4Y2m13*_45+c
 >
> 5
> 4
5    6
 ----

Explanation
2#1\       % implicit input 1st number. Separate decimal and integer part
tYU        % duplicate integer part and convert to string
biXK*Yo    % input 2nd number. Copy it. Multiply by decimal part of 1st number and round
'|'1bX"    % row vector of as many '|' as needed
tnKw-Z"    % row vector of as many spaces as needed
h          % concat horiontally
b1+YUhh    % integer part of 1st number plus 1. Convert to string. Concat twice
t4Y2m      % detect numbers in this string
13*_45+c   % transform numbers into spaces, and non-numbers into '|'
           % implicitly display both strings

Do you have an online interpreter?

Not yet :-( Runs on Matlab or Octave

Perl, 90 bytes
print$f,"|"x($d=.5+($b=pop)*(($a=pop)-($f=0|$a))),$"x(1+$b-$d),$f+1,$/,$"x length$f,"-"x$b

Expects input as commandline arguments. Save in a file (say 90.pl) and run as perl 90.pl 6.75 4
With comments
print $f,                        # floored input (initialized below due to expr nesting)
      "|" x ($d=.5+              # rounded pipe count (`x` operator casts to int)
             +($b=pop)           # second argument  (executed first)
             *( ($a=pop)         # first argument   (executed second)
               -($f=0|$a) )      # minus floored first argument = fractional part
            ),
      $"x(1+$b-$d),              # spaces
      $f+1,                      # floored + 1
      $/,                        # newline
      $"  x length $f,           # 2nd line alignment
      "-" x $b                   # the 'ruler'

Python 3, 116 108 bytes
def f(F,P):l=int(F);h,p=str(l+1),int((F-l)*P+.5);l=str(l);print(l+"|"*p+" "*(P-p)+h);print(" "*len(l)+"-"*P)

trinket.io link
Thank you to Seeq for saving a few characters.
First version:
def f(F,P):
 l=int(F)
 h,s,p=str(l+1)," ",int((F-l)*P+.5)
 l=str(l)
 print(l+"|"*p+s*(P-p)+h)
 print(s*len(l)+"-"*P)

Ungolfed version:
def frac(F,P):
        low = int(F)
        high = low+1
        pipes = int((F-low)*P+.5)
        print(str(low)+"|"*pipes+" "*(P-pipes)+str(high))
        print(" "*len(str(low))+"-"*P)

Could you please provide a working demo?

This trinket.io link should work: https://trinket.io/python/409b1488f8

It actually takes less characters to just use the space literal than store it. You can also just join all the lines with ;. You only use h once, so you should inline it, too.  Ought to save some chars.

@Seeq Good catch on the space literal.  Early on I was printing the white space padding at the end of the second line; after I realize that was unnecessary, I didn't double check the code for savings.  The h is trickier.  For the concatenation and len function in the last two rows to work, l has to be a string, so h would need to be replaced with str(int(l)+1).  Setting h before converting l saves a few characters.

Stackgoat, 31 27 bytes
CFv1%C*D'|^w1P-Y^vHXNY^w'-^

Similar to most of the other answers. I'll see if I can golf more. The input can be comma separated, space separated, or almost anything separated.
Explanation
CF   // Input, floored, push to stack
v1%  // Decimal part
C*   // Times second part
D    // Duplicate that result
'|^  // Repeat | by previous number
w    // Second input
1P   // Move # of |'s to the top of stack
-    // Subtract
Y^   // Repeat " " by above number
vH   // Ceil first input
X    // Newline
Z+   // Add to
N    // Get length of first #
Y^   // Repeat by spaces
w'-  // Repeat - second input times

Lua, 157 bytes
Long, but can't find a shorter solution
function f(d,n)r=""a=math.floor(d)d,s=d-a,a..r for i=1,#s do r=r.." "end for i=1,n do s,r=s..(i-.5>n*d and" "or"|"),r.."-"end s=s..a+1 return s.."\n"..r end

Ungolfed
function g(d,n)
  r=""
  a=math.floor(d)
  d,s=d-a,a..r                         -- d now contains its decimal part
  for i=1,#s do r=r.." "end            -- padding the hyphens
  for i=1,n
  do
    s,r=s..(i-.5>n*d and" "or"|"),r.."-"
    -- s is concatenated with a "|" if i-.5>n*d, a space otherwise
  end
  s=s..a+1
  return s.."\n"..r
end

You can test lua online, the following test cases could be useful :)
function f(d,n)r=""a=math.floor(d)d,s=d-a,a..r for i=1,#s do r=r.." "end for i=1,n do s,r=s..(i-.5>n*d and" "or"|"),r.."-"end s=s..a+1 return s.."\n"..r end
print(f(16.75,4))
print(f(5,4))
print(f(20.16,12))

C, 233 231 bytes
#include <stdlib.h>
#include <math.h>
i,n,l;main(c,v)char**v;{double m;l=atol(v[2]);n=(int)(modf(atof(v[1]),&m)*l+0.5);c=printf("%.f",m);for(;i++<l;)putchar(i>n?32:'|');printf("%.f\n",m+1);printf("%*s",c,"");for(;--i;)putchar(45);}

Ungolfed:
#include <stdlib.h>
#include <math.h>
i,n,l;

main(c,v)
char**v;
{
    double m;
    l=atol(v[2]); /* Get length from command line */
    n=(int)(modf(atof(v[1]),&m)*l+0.5); /* Get number of pipes and lower limit */
    c=printf("%.f",m); /* print lower limit */

    /* print pipes and spaces */
    for(;i++<l;)
            putchar(i>n?32:'|');

    /* print upper limit */
    printf("%.f\n",m+1);

    /* print spaces before dashes */
    printf("%*s",c,"");

    /* print dashes */
    for(;--i;)
            putchar(45);
}

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

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


text:
Visualize the greatest common divisor
Background
The greatest common divisor (gcd for short) is a convenient mathematical function, since it has many useful properties.
One of them is Bézout's identity: if d = gcd(a, b), then there exist integers x and y such that d = x*a + y*b.
In this challenge, your task is to visualize this property with simple ASCII art.
Input
Your inputs are two positive integers a and b, given in any reasonable format.
You may also take unary inputs (repetitions of a single printable ASCII character of your choice), but you must be consistent and use the same format for both inputs.
The inputs may be in any order, and they may be equal.
Output
Your output is a string s of length lcm(a, b) + 1 (lcm stands for lowest common multiple).
The characters of s represent integers from 0 to lcm(a, b).
The character s[i] is a lowercase o if i is a multiple of a or b, and a period . otherwise.
Note that zero is a multiple of every number.
Now, because of Bézout's identity, there will be at least one pair of characters o in s whose distance is exactly gcd(a, b).
The leftmost such pair is to be replaced by uppercase Os; this is the final output.
Example
Consider the inputs a = 4 and b = 6.
Then we have gcd(a, b) = 2 and lcm(a, b) = 12, so the length of s will be 13.
The multiples of a and b are highlighted as follows:
0  1  2  3  4  5  6  7  8  9 10 11 12
o  .  .  .  o  .  o  .  o  .  .  .  o

There are two pairs of os with distance two, but we will only replace the leftmost ones with Os, so the final output is
o...O.O.o...o

Rules and scoring
You can write a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.
Test cases
 1  1 -> OO
 2  2 -> O.O
 1  3 -> OOoo
 4  1 -> OOooo
 2  6 -> O.O.o.o
 2  3 -> o.OOo.o
10  2 -> O.O.o.o.o.o
 4  5 -> o...OO..o.o.o..oo...o
 8  6 -> o.....O.O...o...o.o.....o
12 15 -> o...........O..O........o.....o.....o........o..o...........o
19 15 -> o..............o...o..........o.......o......o...........o..o..............OO.............o....o.........o........o.....o............o.o..............o.o............o.....o........o.........o....o.............oo..............o..o...........o......o.......o..........o...o..............o

When taking unary input, can we choose any character? (In particular, how about ., o or O.) Or does it have to be 1? Or 0?

@MartinBüttner It can be any character, as long as you're consistent and use the same format for both inputs.

I'm surprised you didn't use 3 and 5 as one of your test cases.

Can I use buildin?

@ChristianIrwan Yes, all built-ins are allowed.

This is a super neat visualization; never seen it! Not to mention a great code golf problem. Wherever did you first see such a diagram... or did you come up with it on your lonesome?

@AviF.S. I came up with it on my own, or maybe I saw it somewhere else but forgot. I teach math so I think about this kind of stuff a lot.

Jolf, 52 bytes
on*'.wm9jJΡR m*Yhm8jJDN?<*%Sj%SJ1'o'.}"'o%o"n"O%O"n

I will split this code up into two parts.
on*'.wm9jJ
on         set n
  *'.       to a dot repeated
      m9jJ  the gcd of two numeric inputs

ΡR m*Yhm8jJDN?<*%Sj%SJ1'o'.}"'o%o"n"O%O"n
    *Y                                    multiply (repeat) Y (Y = [])
      hm8jJ                                by the lcm of two inputs + 1
  _m       DN              }              and map the array of that length
             ?<*%Sj%SJ1'o'.               "choose o if i%a*(i%b)<1; otherwise choose ."
 R                          "'            join by empty string
Ρ                            'o%o"n        replace once (capital Rho, 2 bytes): "o"+n+"o"
                                   "O%O"n   with "O"+n+"O"
                                          implicit printing

Try it here!

Shorter than everything else so far. :P

@RikerW Yes! I'm hoping Jolf will finally win, once.

Retina, 112 109 99 94 91 bytes
^
.
+r`(?<!^\1+). (.+)
$'$0
.(?=.* (.+) (.+))(?=\1* |\2* )
o
o(\.*)o((\1\.*o)*) .*
O$1O$2

Not very competitive, I think, but number theory in Retina is always quite fun. :)
Takes input as unary numbers using . as the unary digit.
Try it online.
Explanation
^
.

This inserts a . and a space in front of the input. This will ultimately become the output.
+r`(?<!^\1+). (.+)
$'$0

This prepends the LCM of a and b to the string. Since we already have a . there, we'll end up with lcm(a,b)+1. This is accomplished by repeatedly prepending b as long as a does not divide this new prefix. We capture a into a group one and then check if we can reach the beginning of the string by matching that capture at least once. b is then inserted into the string via the rarely used $' which inserts everything after the match into the substitution.
.(?=.* (.+) (.+))(?=\1* |\2* )
o

This one matches characters at positions which are divided by a or b. It makes use of the fact that the result is symmetric: since lcm(a,b) is divided by both a and b going left by subtracting instances of a or b yields the same pattern as going right from 0 by adding them. The first lookahead simply captures a and b. The second lookahead checks that there is a multiple of each a or b characters before the first space.
o(\.*)o((\1\.*o)*) .*
O$1O$2

As stated on Wikipedia, in addition to Bézout's identity it is also true that

The greatest common divisor d is the smallest positive integer that can be written as ax + by.

This implies that the GCD will correspond to the shortest gap between two os in the output. So we don't have to bother finding the GCD at all. Instead we just look for first instance of the shortest gap. o(\.*)o matches a candidate gap and captures its width into group 1. Then we try to reach the first space by alternating between a backreference to group 1 and os (with optional additional .s). If there is a shorter gap further to the right, this will fail to match, because we cannot get past that gap with the backreference. As soon as all further gaps are at least as wide as the current one, this matches. We capture the end of the LCM-string into group 2 and match the remainder of the string with .*. We write back the uppercase Os (with the gap in between) as well as the remainder of the LCM string, but discard everything starting from the space, to remove a and b from final result.

I don't know much about Retina number theory, but wouldn't setting the input character to something that does not require escaping save bytes? I.e. (\.*) => (a*)

@CᴏɴᴏʀO'Bʀɪᴇɴ Yes, but then I'd have to replace it with . later, which costs four bytes (and getting rid of the escapes only saves 3).

Ohh. Cool! Very interesting answer.

Julia, 111 110 107 103 96 bytes
f(a,b)=replace(join([i%a*(i%b)<1?"o":"."for i=0:lcm(a,b)]),"o$(d="."^(gcd(a,b)-1))o","O$(d)O",1)

This is a function that accepts two integers and returns a string.
Ungolfed:
function f(a::Int, b::Int)
    # Construct an array of dots and o's
    x = [i % a * (i % b) < 1 ? "o" : "." for i = 0:lcm(a, b)]

    # Join it into a string
    j = join(x)

    # Replace the first pair with distance gcd(a, b) - 1
    replace(j, "o$(d = "."^(gcd(a, b) - 1))o", "O$(d)O", 1)
end

Saved a byte thanks to nimi!

, 50 chars / 90 bytes
⩥Мū⁽îí+1)ⓜ$%î⅋$%í?⍘.:⍘o)⨝ċɼ(`o⦃⍘.ĘМũ⁽îí-1)}o”,↪$ú⬮

Try it here (Firefox only).
There must be a way to golf this further!
Explanation
This is a basic two-phase algorithm. It's actually quite simple.
Phase 1
⩥Мū⁽îí+1)ⓜ$%î⅋$%í?⍘.:⍘o)⨝

First, we create a range from 0 to the LCM+1. Then we map over it, checking if either of the inputs is a factor of the current item in the range. If so, we replace that item with an o; otherwise, we replace it with a . . Joining it gives us a series of o's and dots that we can pass to phase two.
Phase 2
ċɼ(`o⦃⍘.ĘМũ⁽îí-1)}o”,↪$ú⬮

This is just one big replace function. A regex is created as o[dots]o, where the amount of dots is determined by the GCD-1. Since this regex is not global, it will only match the first occurrence. After, the match is replaced by O[dots]O using a toUpperCase function.

MATL, 72 bytes
Uses version 6.0.0, which is earlier than this challenge. The code runs in Matlab and in Octave.
2$tZm1+:1-bbvtbw\A~otbZ}ZdXK1+ltb(3X53$X+1K2$lh*t2=f1)tK+hwg1+Ib('.oO'w)

Example
>> matl
 > 2$tZm1+:1-bbvtbw\A~otbZ}ZdXK1+ltb(3X53$X+1K2$lh*t2=f1)tK+hwg1+Ib('.oO'w)
 >
> 1
> 1
OO

>> matl
 > 2$tZm1+:1-bbvtbw\A~otbZ}ZdXK1+ltb(3X53$X+1K2$lh*t2=f1)tK+hwg1+Ib('.oO'w)
 >
> 2
> 3
o.OOo.o

>> matl
 > 2$tZm1+:1-bbvtbw\A~otbZ}ZdXK1+ltb(3X53$X+1K2$lh*t2=f1)tK+hwg1+Ib('.oO'w)
 >
> 12
> 15
o...........O..O........o.....o.....o........o..o...........o

Explanation
I have no idea how it works. I just typed characters randomly. I think there is some convolution involved.
Edit: Try it online! The code in the link has been slightly modified to conform to changes in the language (as of June 2, 2016).

You can't type a 72 byte program randomly. Will calculate probability later (after sleeping and ACTing for a while)

Javascript, 170 164 161 153 145 141 136 bytes
(a,b)=>[...Array(a*b/(c=(g=(a,b)=>b?g(b,a%b):a)(a,b))+1)].map((x,i)=>i%a&&i%b?'.':'o').join``.replace(`o${e='.'.repeat(c-1)}o`,`O${e}O`)

That's quite lonnnggggg....
Demo, explicitly defined variables because the interpreter uses strict mode.

Try replacing i%a<1||i%b<1?'o':'.' with i%a&&i%b?'.':'o'

Oh yeah, I think you can alias join.

@ןnɟuɐɯɹɐןoɯ thanks, also replacing arrays with simple repeat.

Oh, then in that case, you probably shouldn't alias join unless you have 3 occurrences of it.

[...Array((d=a*b/(c=(g=(a,b)=>b?g(b,a%b):a)(a,b)))+1).keys()].map(i=>i%a&&i%b?'.':'o') saves you two bytes. (I also tried to use string indexing to create the '.' and 'o' but that actually costs two bytes.)

Actually, you don't use the d variable, do you? That should save another 4 bytes.

@Neil Thanks, will edit in some hours, when back to computer.

@Neil Weird, your suggestion makes .replace() not replace anything.

For your range the best choice is [...Array(a*b/c+1)].map((_,i) ... it's shorter than using keys

@edc Thanks, this does work indeed.

Well, it worked for me in Firefox, although then again I thought I was saving more by using keys instead of (_,i), I guess I must have miscounted.

Japt, 83 bytes
'.pD=U*V/(C=(G=@Y?G$($YX%Y :X} $($UV)+1 £Y%U©Y%V?".:o"} $.replace($E=`o{'.pC-1}o`Eu

Not fully golfed yet... And doesn't want to be golfed :/

Can you not use r in place of $.replace($?

@Eth I haven't figured  out how to replace without g flag, so no, I can't.

Python 2, 217 200 191 bytes
This is a little blunt, but it works. Any golfing tips are appreciated, especially if you know how to fix that s[i] = s[v] = "o" problem I encountered, where that would overwrite "O"s Got it!
g=lambda a,b:b and g(b,a%b)or a
def f(a,b):
 h=g(a,b);x=1+a*b/h;s=["."]*x;v=k=0
 for i in range(x):
    if(i%a)*(i%b)<1:
     if k:s[i]="o"
     else:k=i==h+v;s[i]=s[v]="oO"[k]
     v=i
 return''.join(s)

Ungolfed:
def gcd(a,b):                           # recursive gcd function
    if b:
        return g(b,a%b)
    else:
        return a
def f(a,b):
    h = gcd(a,b)
    x = 1 + a*b/h                       # 1 + lcm(a,b)
    s = ["."] * x
    v = 0
    k = 0
    for i in range(x):
        if i%a == 0 and i % b == 0:
            if k == 0:
                k = (i == h+v)          # correct distance apart?
                if k:                   # if "O" just found
                    s[i] = s[v] = "O"
                else:
                    s[i] = s[v] = "o"
            else:
                s[i] = "o"              # if "O" already found, always "o"
            v = i                       # If we found an "o" or an "O", i is the new v
    return ''.join(s)


text:
Pi Day, Pi Minute, or Pi Second?
In this challenge you will need to determine whether it's Pi Day, Pi Minute, or Pi Second.
Because Pi is irrational, it wants your code to be as short as possible.
Examples
No input is provided, your program should use the system time. I've just added it for clarity
March 14, 2016 0:00:00
Pi Day
December 25, 2015 3:14:45
Pi Minute
December 29, 2015 0:03:14
Pi Second
January 1, 2016 0:00:00
<No Output>

What is Pi Day / Minute / Second

Pi Day is when the month is March, and the date is the 14th
Pi Minute is when the hour is 3, and the minute is 14
Pi Second is when the minute is 3, and the second is 14
Pi Day should be preferred instead of Pi Minute or Pi Second, and Pi Minute should be preferred instead of Pi Second.
For this challenge you should use 12-hour time (15:14 == 3:14). The date/time used to determine the Pi Day/Minute/Second should be based on system time.

Scoring & Bonus
-15 byte Bonus: If you print "No Pi Time" when it's not Pi time.

As always, standard loopholes are disallowed. This is code-golf shortest code in bytes wins!

I don't think Costco allows you to purchase the mathematical constant pi at any time of the year.

You've changed it to regular pie. That's also false because you can get pie from Costco all year.

@AlexA. Hmm, weird I can never find it in the summer...

Because pi is infinitely long and you want to be passive-aggressive?

Would "Pi day", "Pi month", etc. be accepted also?

@ZachGates Pi month doesn't exist but to answer your question, no, the output must be the correct case

I went to Costco today - they were closed.

@DigitalTrauma why did you go

@undergroundmonorail To buy pies

@AlexA. Sure you can - any time you buy a tire or any other circular object, you're buying 2π.

I think you can't have Pi Minute and Pi Second at the same time, so there's no point in preferring either one.

Nothing special if it's March 14 2015 9:26:53?

@DigitalTrauma but they were closed

@immibis Or March 14 1592 6:53:58?

CJam, 41 bytes
et[3E]#"
Pi Day

Pi Minute
Pi Second
"N/=

Test it here. Alternatively use this link to stub the result of et for easier testing.
Explanation
et   e# Get the current datetime as an array with the following elements:
     e#   - Year
     e#   - Month
     e#   - Day
     e#   - Hour
     e#   - Minute
     e#   - Second
     e#   - Millisecond
     e#   - Weekday
     e#   - Tickrate or something.
[3E] e# Push the array [3 14].
#    e# Find the position of this subarray in the current datetime array. Let's see
     e# what results we can get:
     e#   - Year 3 is in the past and there is no 14th month, so we can't get 0.
     e#   - Pi day will give result 1.
     e#   - Day 3, hour 14 would give 2.
     e#   - Pi minute will give result 3.
     e#   - Pi second will give result 4.
     e#   - Second 3, millisecond 14 would give 5.
     e#   - Weekday and tickrate won't be 14, so we'll never get 6 or 7.
     e#   - If [3 14] isn't found at all we get -1.
"\Pi Day\\Pi Minute\Pi Second\"
     e# Push this string (with linefeeds instead of backslashes.
N/   e# Split into lines.
=    e# Select the corresponding element. The non-existent "pi hour" and "pi millisecond"
     e# would map to empty strings as well as the -1.

Javascript (ES6), 114 112 - 15 = 97 bytes
x=>['Pi Day','Pi Minute','Pi Second'].find((x,i)=>[/ar 14/,/(03|15):14:/,/03:14/][i].test(Date()))||'No Pi Time'

Ungolfed:
x=>
['Pi Day', 'Pi Minute', 'Pi Second']  // array of outputs
.find(                                // find first element in the array
    (x, i)=>                          // which returns truthy for this function
    [/ar 14/, /(03|15):14:/, /03:14/] // array of regex patterns
    [i]                               // get corresponding regex based on index
    .test(Date())                     // test it against current date, date is automatically cast to string
) || 'No Pi Time'                     // if no result, then return "No Pi Time"

Thanks for -2 bytes @edc65

Could be Date() instead of new Date

'Pi '+['Day','Minute','Second'].find((x,i)=>................

@wizzwizz4 this won't work. If it's not Pi time, it returns "Pi undefined"

Would a check for undefined be shorter than 6 chars?

@wizzwizz4 its less bytes to just include "Pi " in all three strings :)

@nderscore It's fewer bytes to say nderscore than underscore.

Ruby, 125 124 chars
i=[*[(t=Time.new).month,t.day,t.hour,t.min,t.sec].each_cons(2)].index [3,14];i&&$><<['Pi Day','','Pi Minute','Pi Second'][i]

Alas, the cleverer %i[month day hour min sec].map{|x|Time.new.send x} is longer.
The key here is the use of each_cons to avoid repetition (see the last few lines of the explanation below).
i=                          # send i (index) to...
[*                          # convert to array (splat)...
 [
  (t=Time.new).month,       # the current month...
  t.day,t.hour,t.min,t.sec  # etc... (duh)
 ]
 .each_cons(2)              # each consecutive two elements
]                           # [[month, day], [day, hour], [hour, min], etc]
.index [3,14];              # first occurrence of [3, 14]
i&&                         # shorthand for "if i"...
$><<                        # output...
[
 'Pi Day',                  # [month=3, day=14] is Pi Day
 '',                        # [day=3, hour=14] isn't anything
 'Pi Minute',               # [hour=3, min=14] is Pi Minute
 'Pi Second'                # [min=3, sec=14] is Pi Second
][i]                        # index by index (obviously)

@Cole And what will you do with the second element?

Why isn't Pi Hour anything. What's wrong with 2 in the afternoon, tomorrow?

@ColeJohnson No, [(p='Pi ')+Day','',p+'Minute',p+'Second'] is longer.

Python 2, 219 186 183 Bytes (198-15)
I tried
Ungolfed:
from datetime import datetime

now = datetime.now()
output = ['Pi Day', 'Pi Minute', 'Pi Second', 'No Pi Time']

if now.month == 3 and now.day == 14:
    print output[0]
elif now.hour == 2 and now.minute == 13:
    print output[1]
elif now.minute = 2 and now.second == 13:
    print output[2]
else:
    print output[3]

Golfed:
from datetime import *
n=datetime.now()
a=n.minute
if n.month==3and n.day==14:print'Pi Day'
elif n.hour==2and a==13:print'Pi Minute'
elif a==2and n.second==13:print'Pi Second'
else:print'No Pi Time'

from datetime import*;n=datetime.now() is shorter. Also, there's no point in indexing into an array when you're printing constant strings.

@Doorknob冰 That's true :)

Shorter even: https://paste.ee/p/ebcSh

Made by swapping if/elses with [else,if][statement].

The latter numbers are wrong (2:13 instead of 3:14), and the 12-hour clock requirement isn't met. (Seems to apply to some other answers too) You can also get it shorter by indexing the result of time.localtime(); it comes down to 148-15 bytes (without the 12-hour fix). The 12-hour thing is unfortunate though; without it you could easily get it down to 129-15 bytes: import time;x=3,14;T=time.localtime();print{1:'Pi Day',3:'Pi Minute',4:'Pi Second'}.get((zip(T,T[1:])+[x]).index(x),'No Pi Time') (and 118-15 bytes on Python 3, by converting to bytes and using find, which makes things simpler)

Japt, 78 - 15 = 63 bytes
D=Ð)g ¥3©Df ¥E?"Pi Day":Dd %C¥3©Dc ¥E?`Pi M©e`:Dc ¥3©Db ¥E?`Pi SeÖ:No Pi Te

Pretty straightforward - just checks the date for every case.
Explanation:

D=Ð)g get the current date (Ð), store it in the variable D and get the month (g). Why store it in the variable, if it's already one-letter? Because since then you can dress any part of date with Da, where a is the function, returning year, month, date, etc. But otherwise you'd have to do Ð a, see the space.
¥3 is ==3, checking if the month is March.
© is &&, i.e. "and".
Df is the day of the month.
E is 14
?...:... - typical sets of ternary operators
Dd %C the reminder of dividing the hour (Dd) by 12 (C)
Dc is the minutes
Db are seconds

Try it online!

To emulate Pi Day:
D=Ð"3/14/11 11:11:11";
Dg ¥2©Df ¥E?"Pi Day":Dd %C¥3©Dc ¥E?`Pi M©e`:Dc ¥3©Db ¥E?`Pi SeÖ:No Pi Te

To emulate Pi Minute:
D=Ð"11/11/11 3:14:11";
Dg ¥2©Df ¥E?"Pi Day":Dd %C¥3©Dc ¥E?`Pi M©e`:Dc ¥3©Db ¥E?`Pi SeÖ:No Pi Te

To emulate Pi Second:
D=Ð"11/11/11 00:3:14";
Dg ¥2©Df ¥E?"Pi Day":Dd %C¥3©Dc ¥E?`Pi M©e`:Dc ¥3©Db ¥E?`Pi SeÖ:No Pi Te

TI-BASIC, 124 bytes
Thanks to FlagAsSpam for shaving a few bytes.
"→Str1
getTime
If min({3,14}={Ans(2),Ans(3
"Pi Second→Str1
getTime
If Ans(2)=14 and max(Ans(1)={3,14
"Pi Minute→Str1
getDate
If min({3,14}={Ans(2),Ans(3)
"Pi Day→Str1
Str1

Are you using i (imaginary unit) and e (Euler's constant) as shortcuts? If not, that could also save you some bytes.

@FlagAsSpam I thought about using those, but I wasn't sure if it counts.

@FlagAsSpam Whether or not they're valid here, e is actually two bytes!

@ThomasKwa Oh, right.

@FlagAsSpam It is no longer invalid. ^_^

@FlagAsSpam Oh, thank you for pointing that out.

Perl, 80 - 15 = 65 bytes
print'No 'x localtime!~/(ar | 15:|03:)14/,'Pi ',(Time,Day,Minute,Second)["@-"/4]

Take 2, parsing the string representation of localtime. At present, this looks something like this:
Sun Jan  3 15:14:15 2016

The position of the matched string is used to determine the correct Pi Time.

Perl, 100 bytes
@t=localtime;$t[2]%=12;3-/3/^{@t[$_,$_+1]}->{14}||exit!print'Pi ',(Second,Minute,_,Day)[$_]for 3,1,0

localtime returns the months zero indexed, hence the need for 3-/3/.

05AB1e, score: 31 (46 bytes - 15 bonus)
žfžeža12%žbDžc)2ôJƵÖk”€º‚Ž™Ù…Þ”#…Pi ìć…No ìªsè

Try it online or try it online with emulated datetime.
Adding the No Pi Time bonus costed 8 bytes, so it's worth the -15. Here it is without the bonus:
žfžeža12%žbDžc)2ôJƵÖk”‚Ž™Ù…Þ ”#„Pirèðý - Try it online or try it online with emulated datetime.
Explanation:
žf               # Push the current month
  že             # Push the current day
ža               # Push the current hours (24-hours format)
  12%            # Modulo-12 to make it a 12-hours format
     žb          # Push the current minutes
D                # Duplicate the current minutes
 žc              # Push the current seconds
)                # Wrap all values on the stack into a list
 2ô              # Split it into pairs
   J             # Join each pair together
    ƵÖ           # Push compressed integer 314
      k          # Get the first 0-based index of 314 in this list (or -1 if none are)
”€º‚Ž™Ù…Þ”       # Push dictionary string "Time Day Minute Second"
          #      # Split it on spaces: ["Time","Day","Minute","Second"]
           …Pi ì # Prepend "Pi " in front of each:
                 #  ["Pi Time","Pi Day","Pi Minute","Pi Second"]
ć                # Extract head; pop and push remainder-list and first item separately
 …No ì           # Prepend "No " in front of it: "No Pi Time"
      ª          # Append it to the remainder-list:
                 #  ["Pi Day","Pi Minute","Pi Second","No Pi Time"]
s                # Swap so the earlier index of 314 is at the top
 è               # Use it to index into the list of strings,
                 # where -1 would get the last item
                 # (after which the result is output implicitly)

See this 05AB1E tip of mine (sections How to use the dictionary? and How to compress large integers?) to understand why ”€º‚Ž™Ù…Þ” is "Time Day Minute Second" and ƵÖ is 314.

Python 3, 137 - 15 = 122 bytes
import time
T=list(time.localtime())
T[3]%=12
print({1:'Pi Day',3:'Pi Minute',4:'Pi Second'}.get(bytes(T[1:6]).find(b'\x03\x0e'),'No Pi Time'))

The 12-hour requirement was unfortunate, as this would've been 118-15=103 bytes without it:
import time
print({1:'Pi Day',3:'Pi Minute',4:'Pi Second'}.get(bytes(time.localtime()[1:6]).find(b'\x03\x0e'),'No Pi Time'))

AppleScript, 202 190 187 183 181 bytes
Hey, this isn't so bad after all.
set n to current date
set b to n's time string
if n's date string contains"March 14"
log"Pi Day"
else if b contains"3:14:"
log"Pi Minute"
else if b contains"3:14"
log"Pi Second"
end
I actually found a use for AppleScript's method calling. Go figure. Nope. Just turns out that I'm an idiot. Setting a variable is shorter.
(for those wondering, current date command returns a date-type with the contents "Saturday, January 2, 2016 at 2:46:01 PM" or the like)

PHP, 85 - 15 = 70 bytes
<?=['No Pi Time','Pi Day','Pi Minute','Pi Second'][strpos(@date(Ymdhi_is),'0314')/4];

The main trick use here is the Ymdhi_is date format, at the time of writing, date('Ymdhi_is') returns 201501030258_5828.

md, hi and is are the values who will be replaced by 0314 if it's Pi-something. Note that all those strings will be always be replaced by a 4-character long string.
They are put in that specific order since strpos will stop searching at the first occurrence of the needle, so we put them in the order of priority.
A separator between hi and is is necessary because we don't want strpos to match a value that would overlap both (thanks to primo for saving bytes here).
The needle is 0314 because 314 would wrongly match 10:31:42 as Pi-Second.

The Y part is the trickiest. We need a prefix to to offset the first occurrence of Pi-something, allowing us to distinguish strpos's return values between false (not found, Pi-nothing) and 0 (found at index 0, Pi-day).
And we want this prefix to be either 4 or 5-character long, since we are planning to divide strpos's return value by 4.
Y is 4-character long, but:

it will be 5-character long someday, and this will break the program (think about year 10314): the PHP documentation says that Y will be replaced by 4 digits, but it's not true.
if you come back in time, at year 314, it will break the program.

Since PHP didn't exist in year 314, and will likely not exist anymore in year 10314, I guess these bugs can be safely ignored.
Note that 0314 can overlap Ymd since:

Ymmd configuration: there's no 31st month.
YYmm configuration: there's no 14th month.
YYYm configuration: there are less than 40 months.

Also, there's a version without the bugs related to the year, which is 86 - 15 = 71 bytes:
<?=['No Pi Time','Pi Day','Pi Minute','Pi Second'][strpos(@date(D_mdhi_is),'0314')/4];

Great answer. If you use underscores rather than dots, you can drop the quotes around Ymd_hi_is. Also, I don't think a separator is necessary between md and hi, as the 12-hour h can never be 14, and never start with 3 or 4.

Pascal, 226 Bytes
See also FreePascal.
This program requires a processor complying to ISO standard 10206 “Extended Pascal”.
program p(output);var t:timeStamp;begin getTimeStamp(t);with t do write(subStr('Pi Day   ',1,9*ord(month=3))+subStr('Pi Minute',1,9*ord(hour in[3,15]))+subStr('Pi Second',1,9*ord(minute=3)):9*ord(14 in[day,minute,second]))end.

Ungolfed:
program piDMS(output);
    var
        ts: timeStamp;
    begin
        getTimeStamp(ts);
        { `with t do ` is two characters shorter than six times `t.` }
        with ts do
        begin
            writeLn(
                    { subStr(string, firstCharacterIndex, length) }
                    subStr('Pi Day   ', 1, 9 * ord(month = 3)) +
                    subStr('Pi Minute', 1, 9 * ord(hour in [3,15])) +
                    subStr('Pi Second', 1, 9 * ord(minute = 3))
                    : 9 * ord(14 in [day, minute, second])
                );
        end;
    end.

216 characters if

the implementation-defined value of maxChar has an ordinal value ≥ 59 and
neither chr(3) or chr(14) of the implementation-defined set of char values indicate an end of line (Pascal does not permit multiline strings).

program p(output);var t:timeStamp;begin getTimeStamp(t);with t do year:=index(chr(month)+chr(day)+chr(hour mod 12)+chr(minute)+chr(second),'');write(subStr('Pi SecondPi Minute         Pi Day   ',37-9*t.year):9)end.

NB:
The string literal '' is chr(3) + chr(14).

Go, 211 - 15 = 196 bytes
import."time"
func f(){N,s:=Now(),"Pi "
M:=N.Minute()
if _,m,d:=N.Date();m==3&&d==14{s+="Day"}else if N.Hour()%12==3&&M==14{s+="Minute"}else if M==3&&N.Second()==14{s+="Second"}else{s="No "+s+"Time"}
println(s)}

Attempt This Online!
Prints to STDERR.

Japt, 48 47 45 bytes
:\ I can definitely do better than this! Outputs undefined if it's not a Pi date/time. Second line include a trailing space.
`DÃÕsMÔSSeÖ`qÅæÏgKs6 f"%d+" ã2)e#;ìF
©i"Pi

Test it, or test:

Pi Day
Pi Minute
Pi Second

`...`qÅæÏgKs6 f"%d+" ã2)e#;ìF\n©i"Pi
`...`                                     :Compressed string "DaysssMinutesSecond"
     q                                    :Split on
      Å                                   :  "s"
       æ                                  :Get first element to return true
        Ï                                 :When its index is passed through the following function
         g                                :  Index into
          K                               :    Date
           s6                             :    To locale string (M/D/Y, h:m:s A/PM)
              f                           :    Match
               "%d+"                      :      RegEx /\d+/
                     ã2                   :    Sub-arrays of length 2
                       )                  :  End indexing
                        e                 :  Is equal to
                         #;               :    59
                           ì              :    Converted to digit array in base
                            F             :      15
                             \n           :Assign to variable U
                               ©          :Logical AND with
                                i"Pi      :  U prepended with "Pi "

Pascal (FPC), 263 229 bytes
uses sysutils,RegExpr;var x:array[0..2]of string=('.*:03:14','.* 03:14.*','14-3.*');y:array[0..2]of string=('Second','Minute','Day');i:word;begin
for i:=0to 2do if ExecRegExpr(x[i],DateTimeToStr(Now))then writeln('Pi ',y[i]);end.

Try it online!
263b
Might be shortened by using if..then..elseif.. instead of complicated arrays & loops.

Python 3, 179 bytes
import functools as F,datetime as D
T,G=D.datetime.now(),getattr
F.reduce(lambda i,j:print("Pi "+i.title())if G(T,i)/G(T,j)==3/14else j,"month day hour minute second".split(" "))

Zsh*, 93 88 83 (98-15) bytes
case `date` in *Mar\ 14*)t=Day;;*\ 03:14*)t=Minute;;*03:14\ *)t=Second;esac
<<<Pi\ ${t?No Pi Time}

Try it online! (98-15 bytes)
 103-15 bytes
 93 bytes
 107-15 bytes, using associative array
Used extendedglob for matching the case patterns. If $t wasn't set (${t?}), then it prints "No Pi Time" to stderr.


text:
It's Not 2015 Anymore!
The Rules

Each submission must be a full program or a function.
The program must take all instances of the string 2015 from the input (1 string), replace it with <s>2015</s>* (with <s> or ). At the end, if there has been at least one 2015 in the string, you must add a newline and this string: *2016. I'm a year early!
The program must not write anything to STDERR.
The input will not contain <s>2015</s> or 2015.
Note that there must be an interpreter so the submission can be tested.
Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.
This is code-golf, so shortest code wins

Examples
Input:
Hello! The date is 2015-12-24.
Output:
Hello! The date is 2015*-12-24.
*2016. I'm a year early!
Input:
foo bar baz quux
Output:
foo bar baz quux
Input:
12320151203205120151294201511271823
Output:
1232015*120320512015*12942015*11271823
*2016. I'm a year early!
Input:
 Hello. The year is 2015...
2015.5...
Output:
 Hello. The year is 2015*...
2015*.5...
*2016. I'm a year early!
The Snippet
The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a leaderboard and b) as a list of winners per language.
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=68372,OVERRIDE_USER=45162;function answersUrl(e){return"http://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"http://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

Can we use ?

I'm not sure if that would allow you to make it shorter.

@BlockCoder1392 It might. "asdf".strike() is javascript.

Hmm... sure. I'll add it to the post

Can the input contain <s>2015</s>*?

No. The input will not contain <s>2015</s> or 2015.

@downvoters what is wrong with this challenge?

I find the challenge boring. It's a find-replace followed by a conditional concatenated string. Also, I don't like when functions are disallowed for no particular reason.

@xnor ... To quote NBZ, "Because there are not enough simple code-golf challenges"

Yes, but a challenge can be simple without being straightforward. Replacement or regex is a built-in in most langs. It means that's likely just the way to do it.

Can we have any trailing whitespace?

Not everyone agrees with @NBZ on that. And there are certainly more than enough trivial questions. If you post questions which have a negative score in the sandbox, don't be surprised to see them downvoted.

@Doᴡɴɢᴏᴀᴛ No trailing whitespace.

Will the input have newlines

Your code has to accept new lines.

instead of "replace it with <s>2015</s> (with  or )and put an asterisk to the right of it" you could just say "replace it with <s>2015</s>*

Stax, 36 bytes
ç┼↕+∙n7↔Qq┼╩↓╣ÇÖú];ⁿX£╞bëi⌐ñ▼Z♀φ6╛(<

Run and debug it
Unpacked, ungolfed, and commented, it looks like this.
_               push all of standard input
2015X           push 2015 and store it in the x register
$/c             split string on "2015", and copy the result
"<s>`x</s>*"*P  join with "<s>2015</s>*" and print
D!C             stop executing if split resulted in more than 1 element
'*p             print "*" without newline
|Xp             increment x register and print without newline
                print unterminated compressed literal ". I'm a year early!"
`Q_RUWZ)O-C!

Run this one

JavaScript ES6, 84 76 75 bytes
s=>(q=s.replace(/2015/g,"<s>$&</s>*"))+(s<q?`
*2016. I'm a year early!`:"")

This is pretty well golfed for JavaScript imo.

This works by taking the input and replacing all instances of 2015 with <s>$&</s>* where $& is the value matched, but in this case, that's always 2015. Then, if the input is different from q, it'll add the *2016... string, otherwise, It'll add a blank string (nothing).

I think you can do (q!=s&&`\n*2016. I'm a year early!`)

@CᴏɴᴏʀO'Bʀɪᴇɴ That seems to add "false" to the string when the condition is false :(

Oh, dangit. That's bad :P

Very interesting. Never knew about $& or any of the other special replacement patterns.

Ruby, 69 bytes
$><<gets.gsub(/2015/,'<s>\&</s>*')
puts"*2016. I'm a year early!"if$&

Jolf, 60 bytes
Two parts, again.
oHρi"2015"+pd"s'$&'*"
oH                    set H
  ρi"2015"             to input string, replaced all 2015 with
           pd"s'$&'    $& crossed out. (pd is an apply tag function)
          +        *" append an asterisk

    v-- unprintable
+H|&?=Hi+S"*2016. I\'m a year early!'"
+H|&?=Hi                            '" add ↓ to H if H != i; otherwise add empty string ('")
        +S"*2016. I\'m a year early!'  a newline plus that string
                                       implicit printing

Try it here! Bonus points for actually crossing out the text and conforming to the output examples? :3

Technically against the rules. +1.

Python, 97 bytes
a=raw_input();b=a.replace('2015','<s>2015</s>*');print a;
if a!=b:print"*2016. I'm a year early!"

This takes input from stdin, replaces any instances of 2015 with a strike, and prints the 2016  message if the two strings don't match.

couldn't you use a"<s>2015</s>*"]<>If[#~StringCount~a>0,"
*2016. I'm a year early!",""]&

Once again, Mathematica's string processing uses many bytes...

Pyth, 52 51 50 bytes
I-
:z"2015""<s>2015</s>*"z." ytµbðï«»±é¢þnl¶Vû

Test Suite.

, 49 chars / 93 bytes
a=ïę ḟ*ṁ,`<s>$&</s>*”)+(a≠ï?ɘƂ联Ӏఈ쁬Πā␎䁛␐줄쁰ꖈᲠ䉠耀#:⬯

Try it here (Firefox only).
Really straightforward. a=ïę ḟ*ṁ,'<s>$&</s>*”) nests all instances of 2015 (represented here as the result of 31*65) in strikethrough tags. Then, append the last string ('compressed' here) accordingly.

TeaScript, 59 bytes
(q=xg2015,"<s>$&</s>*"))+(x<q?`
*2016. I'm a year early!`:u

Try it online
Explanation
(q=        // Assign `q` to...
   xg      // input.replace
     2015  // 2015 with.
     "..." // The string
)) +       // Add to..

(x<q?      // If the input is different from replacement
     "..." // Add string to the end
    :u     // Otherwise empty string

Downvote reason? This answer is perfectly valid, wth?

They'll always downvote downgoat!

@wizzwizz4 :( Maybe Upgoat is having better luck

How legal are sockpuppet accounts?

@wizzwizz4 I don't use them for evil, >:)  just chatbots so it's fine.

Japt, 51 bytes
Y=Ur2015"<s>$&</s>*")¥U?U:Y+`
*2016. I'm a ye e§!

Try it online!

05AB1E, 42 40 bytes
Ž7ç©åi®®"<s>ÿ</s>*".:®>“*ÿ. I'm€…‚Œ‰€!“»

Try it online!
-2 thanks to Grimy
Explanation
Ž7ç©åi®®"<s>ÿ</s>*".:®>“*ÿ. I'm€…‚Œ‰€!“» Full Program
Ž7ç©                                     Pushes 2015 and copies it to the register
    å                                    Checks if 2015 occurs in the input
     i                                   If yes, do the following steps, else
                                          finish and output the input
      ®®"<s>ÿ</s>*"                      Pushes 2015 and "<s>2015</s>*"
                   .:                    Replaces all instances of 2015 by
                                          </s>2015</s> in the input
                     ®>“*ÿ. I'm€…‚Œ‰€!“  Push "*2016. I'm a year early!"
                                       » Concatenate both strings with a newline in between

The » is not needed when there is no replacement, so you can just drop the } for -1.

40: Ž7ç©åi®®"<s>ÿ</s>*".:®>“*ÿ. I'm€…‚Œ‰€!“»

Arturo, 83 79 bytes
$[s][r:replace s"2015""<s>2015</s>*"if r<>s['r++"\n*2016. I'm a year early!"]r]

@Dr.Kameleon Suggested r<>s[suffix'r"\n*2016 ~> r<>s['r++"\n*2016.

@Dr.Kameleon Please read https://codegolf.meta.stackexchange.com/questions/1615/suggested-edits-reject-golfing.

@JonathanFrech I'm not sure I'm too familiar with CodeGolf posting standards, but given that I am the original author of the language (Arturo), I just found this and decided to post my own - slightly shorter - solution. :)

@Dr.Kameleon Nice to see you here and thank you for the golf! Here we usually suggest golfs in comments instead of editing the answer, so that, probably why you were received so harshly ;)

@xigoi Well, I guess I know now lol. In any case, great to see an Arturo example here! Needless to say, I was more than pleasantly suprised! :)

@Dr.Kameleon Had you "... decided to post my own - slightly shorter - solution." in form of writing a separate answer and triggered a First Post review job, I would have most likely accepted it. By editing another user's post, you alter their contribution (where the StackExchange system does not provide a convenient way to communicate with this user) and are not this post's author. Most golfing suggestions are incorporated into the post by its original author who then gives credit to the user who suggested it. Even though xigoi accepted your change, only the post's history gives you credit.

(f)lex, 104 bytes
File 2015.l:
 int n=0;
%%
"2015" ++n+puts("<s>2015</s>*");
%%
main(){yylex();n&&puts( "*2016. I'm a year early!\n");}

...no trailing newline.
Build:
$ flex -o 2015.c 2015.l
$ gcc 2015.c -o 2015 -lfl

Run:
$ ./2015 <<<'Hello! The date is 2015-12-24.'
Hello! The date is <s>2015</s>*-12-24.
*2016. I'm a year early!
$ ./2015 <<<'foo bar baz quux'
foo bar baz quux
$ ./2015 <<<'12320151203205120151294201511271823'
123<s>2015</s>*12032051<s>2015</s>*1294<s>2015</s>*11271823
*2016. I'm a year early!

I ran this using flex and gcc on Debian8, but I see no reason why it should fail in other environments using lex and/or a different C compiler.

Note it may bail out due to integer overflow.

C#, 152 bytes
class A{static void Main(string[]a){System.Console.Write(a[0].Replace("2015","<s>2015</s>*")+(a[0].Contains("2015")?"\n*2016. I'm a year early!":""));}}

Basic solution. Takes the string as the first argument.

Gema, 57 bytes
2015=<s>$0</s>*@set{a;*2016. I'm a year early\!}
\Z=${a;}

Sample run:
bash-4.3$ gema -f not-2015.gema <<< 'Hello! The date is 2015-12-24.'
Hello! The date is <s>2015</s>*-12-24.
*2016. I'm a year early!

bash-4.3$ gema -f not-2015.gema <<< 'foo bar baz quux'
foo bar baz quux

bash-4.3$ gema -f not-2015.gema <<< '12320151203205120151294201511271823'
123<s>2015</s>*12032051<s>2015</s>*1294<s>2015</s>*11271823
*2016. I'm a year early!

PowerShell, 81 79 bytes
-2 bytes thanks to mazzy
param($n)($z=$n-replace2015,'<s>$&</s>*')+"
*2016. I'm a year early!"*($z-ne$n)

Try it online!
Just a replace on the input and a conditional append with the 2016 line. You don't need many quotes or spaces in PowerShell either.

79 bytes :)

Retina, 49 45 64 61 60 54 bytes
s`2015.+
$&¶*2016. I'm a year early!
\`2015
<s>$&</s>*

After numerous attempts I think this is the shortest Retina solution

The first line matches 2015, the second line replaces the previous match (2015) with <s>$&</s>* where $& is the match's value or in this case, 2015.
The \ removes the trailing newline from the output. The ` starts the regex. $ matches the end specifying we're trying to add a string to the end. The last line simply adds the string where ¶ becomes a newline. Retina uses the ISO-8859-1 encoding in which the ¶ is one byte
Try it online

ROOP, 110 bytes
 1I
 CW
 |%|
 V !
H
' "<s>2015</s>*"
2R !
0 #V
1 G #
5V #"\n*2016. I'm a year early!"
'| M #
 -V #

  #W
   O#

This uses the R operator to replace all occurrences of the string 2015 in the input to <s>2015</s>*.Then, there is a comparison -- if the input string and the new one are different, then 1 is returned. Otherwise, 0 is returned. Then, M repeats the string \n*2016. I'm a year early that many times, i.e. if there are no changes, the string is blank, otherwise, the string is \n*2016. I'm a year early. Then, the strings are printed and the program terminates.
Above there is a 1 which is moved to the left and then falls to the operator H, which ends the program.

It should print "*2016. I'm a year early!" only once

That's what it does.

Oh. I misinterpreted the usage of M.

Use 1 or 0, sorry, English is not my native language. Feel free to improve the text if necessary.

Python 3.8 (pre-release), 80 bytes
lambda x:(b:=x.replace('2015','<s>2015<s>*'))+"\n*2016. I'm a year early!"*(b>x)

Try it online!
Saved 8 bytes thanks to squid

Unless I've missed a way that this breaks it, 84 bytes

80 bytes

@squid Okay, thanks!

Perl 5 -p, 53 bytes
$\="\n*2016. I'm a year early!"if s|2015|<s>$&</s>*|g

Try it online!

Literal newline instead of "\n" saves a byte

JavaScript: 62 bytes
x=>x.replace('2015','<s>2015</s>')+"\n*2016. I'm a year early!"

I'm afraid you missed a point: “\n*2016. I'm a year early!” has to be appended only if the input contained “2015” and your code actually made a replacement. So you must not append it to “foo bar baz quux”.


text:
Please Count ME!
Your task is simple. Post a snippet in any language that if the snippet is repeated n times, will output n in decimal, octal, and hexadecimal, in that order, separated in spaces. n is an integer larger than zero. There is no leading zeroes. Shortest answer wins
Example
If the snippet is ABC then the test case is
ABC
1 1 1
ABCABC
2 2 2
ABCABCABCABCABCABCABCABCABC
9 11 9
ABCABCABCABCABCABCABCABCABCABCABCABC
12 14 C
ABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABCABC
18 22 12

Is it ok if I print 1 01 0x1? (Includes prefixes)

If you have a language with implicit input/output, then you could have a 1 byte solution that just incremented the value...

Japt, 12 bytes
[°TTs8 TsG]¸

Thanks to @ETHproductions for saving 2 bytes!
Same as my  answer.

:O you beat Dennis!

Figured  couldn't do it, and you had already done Teascript, and I didn't know Jolf, so I used Japt.

Awesome :) Here's 2 bytes saved: [°TTs8 TsG]¸

Oh, didn't see that. Thanks!

Perl, 30 bytes
printf"\r%d %o %x",++$n,$n,$n;

Go back to the beginning of the line, increment counter and print counter overwriting the old output.

+1 for spotting a hole in specification, Output erasure make this challenge trivial.

@ChristianIrwan: actually it's not erasing, but overwriting (I've corrected my description)

That both ruins the challenge.

JavaScript, 54 53 51 47 bytes
Saved 4 bytes thanks to @user81655
var d=-~d;d+` ${d[b='toString'](8)} `+d[b](16);

I'm actually kinda surprised this works.
Explanation
var d=-~d;  // `var` let's `d` not throw an error if it's not defined
            // -~ essentially increments the variable
d+                    // decimal
` ${                  // space character
   d[b='toString'](8) // octal
} `                   // space character
+d[b](16)             // Hexadecimal

Try it online

Iirc you can remove the var

@CᴏɴᴏʀO'Bʀɪᴇɴ that causes an error: ReferenceError: Can't find variable: d, even on loose mode D:

Does d=d?d+1:1 work?

@CᴏɴᴏʀO'Bʀɪᴇɴ nope, still throws a reference error, weird considering loose mode is enabled...

Ohhhh because we're trying to access d though it is undefined

@BlockCoder1392 The reason it outputs 3 3 3 is that the variable d is not reset. Try refreshing the page if you want to run it again

C++, 205 179 bytes
int main(){};static int c=1;
#define v(x) A##x
#define u(x) v(x)
#define z u(__LINE__)
#include <cstdio>
class z{public:z(){++c;};~z(){if(c){printf("%d %o %x",--c,c,c);c=0;}}}z;//

(No trailing newline - when copied, the first line of the copy and last line of the original should coincide)
Basically, this works by making a sequence of static variables which, on construction, increment a global variable counter. Then, on destruction, if the counter is not 0, it does all its output and sets the counter to zero.
In order to define a sequence of variables with no name conflicts, we use the macro explained as follows:
#define v(x) A##x    //This concatenates the string "A" with the input x.
#define u(x) v(x)    //This slows down the preprocessor so it expands __LINE__ rather than yielding A__LINE__ as v(__LINE__) would do.
#define z u(__LINE__)//Gives a name which is unique to each line.

which somewhat relies on the quirks of the string processor. We use z many times to define classes/variables that will not conflict with each other when copied onto separate lines. Moreover, the definitions which must occur only once are placed on the first line, which is commented out in copies of the code. The #define and #include statements don't care that they get repeated, so need no special handling.
This code also features undefined behavior in the statement:
printf("%d %o %x",--c,c,c)

since there are no sequence points, but c is modified and accessed. LLVM 6.0 gives a warning, but compiles it as desired - that --c evaluates before c. One could, at the expense of two bytes, add the statement --c; before the outputs and change --c in printf to c, which would get rid of the warning.

Replaced std::cout with printf saving 26 bytes thanks to a suggestion of my brother.

CJam, 20 19 18 bytes
];U):USU8bSU"%X"e%

Thanks to @MartinBüttner for golfing off 1 byte!
Try it online!
How it works
]                  e# Wrap the entire stack in an array.
 ;                 e# Discard the array.
  U                e# Push U (initially 0).
   ):U             e# Increment and save in U.
      S            e# Push a space.
       U8b         e# Convert U to base 8 (array of integers).
          S        e# Push a space.
           U"%X"e% e# Convert U to hexadecimal (string).

, 14 chars / 28 bytes
[⧺Ḁ,Ḁß8,Ḁⓧ]ø⬭;

Try it here (Firefox only).
First answer! Although there are probably better ways to handle this.
Explanation
[⧺Ḁ,Ḁß8,Ḁⓧ]ø⬭; // implicit: Ḁ = 0
[⧺Ḁ,             // increment Ḁ by 1
    Ḁß8,         // octal representation of Ḁ
        Ḁⓧ]     // hex representation of Ḁ
            ø⬭; // join above array with spaces
                 // repeat as desired until implicit output

What even is this language?

A fun one.

MATL, 26 bytes
Uses current release (6.0.0). Works on Octave.
0$N1+ttYUb8YAb16YA3$XhZc1$

Examples
Once:
>> matl 0$N1+ttYUb8YAb16YA3$XhZc1$
1 1 1

Twice:
>> matl 0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$
2 2 2

16 times:
>> matl 0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$0$N1+ttYUb8YAb16YA3$XhZc1$
16 20 10

Explanation
The number of elements in the stack is used to indicate how many times we've run the snippet
0$         % specify zero inputs for next function, in case this is not the first
           % occurence of the snippet.
N          % number of elements in stack
1+         % add one
tt         % duplicate twice. We now have three copies of the number
YU         % convert to string (decimal)
b8YA       % bubble up number and convert to octal string
b16YA      % bubble up number and convert to hex string
3$XhZc     % join top three elements (strings) with a space
1$         % specify one input for next function. If the program ends here, that next
           % function will be implicit display, so it will print the top of the stack.
           % Else the stack will be left with one element more than at the beginning of
           % the current snippet

TeaScript, 21 20 bytes
[┼d,dT8),dT16)]j(p);

I should make it auto-close on ;
Try it online
Explanation
┼ becomes ++
    // Implicit: d = 0
[   // Start array
 ++d,  // Increment d, decimal value
dT8),  // d to base 8
dT16)  // d to base 16
]j(p); // Join by spaces
    // Implicit: Output *last* expression

Downvote? Is there something wrong with this answer? Does it have to do with ASCII Character Jumble as that also got downvoted within minutes of this if not less

OCaml, 198 bytes
;;open Char
;;(if Sys.argv.(0).[0]='~'then Sys.argv.(0).[0]<-'\000'else Sys.argv.(0).[0]<-chr(1+int_of_char Sys.argv.(0).[0]));let n=1+int_of_char Sys.argv.(0).[0]in Printf.printf"\r%d %o %x"n n n

Includes a trailing newline and requires that the filename starts with a tilde (I used ~.ml; you can run it with ocaml \~.ml) because it's the highest-valued standard printable ASCII character. Abuses the fact that all characters in a string are mutable and Sys.argv.(0).[0] is the first character in the filename.
It should only work for n = 1 to 126, because the ASCII code for ~ is 126 and I'm adding one to the output. It could be made two bytes shorter if we only want n = 1 to 125. After it's repeated 126 times, it'll cycle back to n = 1.
This is my first ever golf so any comments or improvements would be much appreciated.
Ungolfed version:
;; open Char
;; if Sys.argv.(0).[0] = '~'
   then Sys.argv.(0).[0] <- '\000'
   else Sys.argv.(0).[0] <- chr (1 + int_of_char Sys.argv.(0).[0])
;; let n = 1 + int_of_char Sys.argv.(0).[0] in
   Printf.printf "\r%d %o %x" n n n

+1 The ,many holes in my question make me choose to downvote my own question. (I can't do that, though.)

I'm suspicious about repeated Sys.argv.(0).[0]. I don't know much about OCaml, though.

Vyxal, 12 bytes
_&›¥D8τṅ$HWṄ

Try it Online!
Try it Online 10 times!

Perl, 40 bytes
$_=<<'';printf"%d %o %x",(1+y/z//)x3;
:

There's a final newline behind the colon.
Treats everything after the first line as a here document and counts the z in it. For every further copy of the code one z is added. We have to add 1 to the count, because there's none for the first snippet (the one that is executed).
If additional output to stderr is allowed, we can omit the 2 single quotes '' and can get down to 38 bytes. Without the '' perl emits a warning about a deprecated feature.

bash, 49 bytes
File count.bash:
((++n));trap 'printf "%d %o %x\n" $n $n $n' exit;

...no trailing newline.
Run:
$ bash count.bash
1 1 1
$ cat count.bash count.bash count.bash | bash
3 3 3
$ for i in $(seq 10) ; do cat count.bash ; done | bash
10 12 a

Mathematica, 76 bytes
Note that n should have no definitions before.
0;If[ValueQ@n,++n,n=1];StringJoin@Riffle[IntegerString[n,#]&/@{10,8,16}," "]

Here, the behaviour of ; is used. The snippet above is one single CompoundExpression, however, when a couple of snippets are put together, there is still one CompoundExpression as is shown below. (Some unnecessary rearrangements are made.)
0;
If[ValueQ@n,++n,n=1]; StringJoin@Riffle[IntegerString[n,#]&/@{10,8,16}," "] 0;
If[ValueQ@n,++n,n=1]; StringJoin@Riffle[IntegerString[n,#]&/@{10,8,16}," "] 0;
If[ValueQ@n,++n,n=1]; StringJoin@Riffle[IntegerString[n,#]&/@{10,8,16}," "]

(* 3 3 3 *)

So one cannot make such snippet works if writting explicit CompoundExpression. Also, almost everything you like can be put before the first ; such as E, Pi or MandelbrotSetPlot[],.

Python 2, 54 bytes
n=len(open(__file__).read())/54;print n,oct(n),hex(n)#

No trailing newline. Outputs in the form 1 01 0x1.
If that's not ok, 56 bytes
n=len(open(__file__).read())/56;print"%d %o %x"%(n,n,n)#

When pasted in front of each other, the length of the file gets longer by 1 line for each time pasted. The base case starts with 2 lines so you have to subtract 1 from the line length. Computation is suppressed by the comment.

"%d %o %x"%(n,n,n), that is pretty cool. I had no idea you could do that. If it turns out that leaving prefixes is not ok I'm going to have to borrow that.

Python 2.x 140 bytes
This was not meant to be an overly competitive solution, but a method that I found amusing, being for one thing, an attempt at a multithreaded code golf.
import thread;n=eval("n+1")if"n"in globals()else 1;
def t(c):99**99;print("%s "*3)%(n,oct(n),hex(n))*(c==n)
thread.start_new_thread(t,(n,));

Keeps a counter, spawns a thread for each count and if the counter has not changed when the counters timer goes off after a completing an expensive math problem (instead of a timer to save bytes), the formatted string is printed.
Some example configurations and their outputs:
import thread;n=eval("n+1")if"n"in globals()else 1;
def t(c):99**99;print("%s "*3)%(n,oct(n),hex(n))*(c==n)
thread.start_new_thread(t,(n,));

Outputs 1 01 0x1

and fifteen copy pastes:
import thread;n=eval("n+1")if"n"in globals()else 1;
def t(c):99**99;print("%s "*3)%(n,oct(n),hex(n))*(c==n)
thread.start_new_thread(t,(n,));import thread;n=eval("n+1")if"n"in globals()else 1;
def t(c):99**99;print("%s "*3)%(n,oct(n),hex(n))*(c==n)
thread.start_new_thread(t,(n,));import thread;n=eval("n+1")if"n"in globals()else 1;

...

Outputs 15 017 0xf

thread.start_new_thread Could python have thought of a worse method name for code golfing?

I would be interested to see if this works in python 3.x, I don't see anything that I'm aware would not, but I have never done threading in python 3.

Perl 5, 31 bytes
exit+printf"%d %o %x",(++$-)x3,

Uses the same approach as my answer for 'I double the source, you double the output!'.
Try it online!

APL (Dyalog APL), 30 bytes
Requires ⎕IO to be 0.
(+,8 16{(⎕D,⎕A)[⍺⊥⍣¯1⊢⍵]}¨⊢)⊃1

Attempt This Online!
The main idea is to use an ambivalent function, where the monadic variant would return the result, and the dyadic variant would keep track of the count.
(+,8 16{(⎕D,⎕A)[⍺⊥⍣¯1⊢⍵]}¨⊢)⊃1

(+,8 16{(⎕D,⎕A)[⍺⊥⍣¯1⊢⍵]}¨⊢)    # The ambivalent function:
 +                              #   monadic: identity (*); dyadic: left + right
  ,                             #   concatenated with
   8 16{(⎕D,⎕A)[⍺⊥⍣¯1⊢⍵]}¨⊢     #   octal and hexadecimal versions:
       {(⎕D,⎕A)[⍺⊥⍣¯1⊢⍵]}       #     dyadic function to convert int to base-n string:
        (⎕D,⎕A)                 #       digits concatenated to alphabet
               [       ]        #       indexed by
                      ⍵         #         right argument
                 ⊥⍣¯1           #         in base  (returns digit vector, e.g. 42 in base-16 is [2, 10])
                ⍺               #         left argument
                         ¨      #     applied to:
   8                      ⊢     #       8 and right argument,
     16                   ⊢     #       16 and right argument,

# To Summarize:
#   monadic version returns: [arg, oct(arg), hex(arg)]
#   dyadic version returns: [left + right, oct(right), hex(right)]
#     since left argument is always 1 when snippet is repeated, we can simplify it to
#     [1 + right, oct(right), hex(right)]

⊃   # pick first (extracts the current count)
    # when snippet is repeated this would be in front of all the dyadic calls
    # but not in front of the final monadic call

 1  # The initial count

Created with the help of Luminespire.
*monadic + is the conjugate, but can be treated as identity for non complex inputs

Awk, 33 bytes
{printf v" %o %x",v,v}BEGIN{v++}0

Try it online!
This solution abuses the BEGIN statements running before anything happens and the 0 at the end to prevent any other patterns from running.

Ruby, 35 bytes
1;$.+=1;$><<"#$. %1$o %1$x"%$.*-~-0

Each snippet increments $. (which starts as 0 if no files have been read), but only the last outputs anything. *-~-0 evaluates to *1, meaning print the string once, but with concatenation it becomes *-~-01, an octal expression evaluating to 0. Since $><< doesn't include a trailing newline, printing the empty string means printing nothing.