text:
Summation from a to b
The program has an input of a and b, and outputs the sum of numbers from a to b, inclusive. Score is in bytes. As always, standard loopholes are disallowed.
If your input is in the format [a,b], +3 bytes

Can b be smaller than a, and if so, what should the output be?

If b is greater than or equal to a There's a closed-form solution to this problem: (b-a+1)*(b+a)/2

Can we take input as a two-element list?

4 hours, 25 answers and 46 answer votes after posting, you change it so that b>a must error? Ugh. Is that an allowed codegolf thing? (I guess that's a wrong change as well - or is it intended to be a countdown now?)

You are penalizing people for taking input in the format of [a,b]? Why? How does this improve the question?

B/c [a,b] uses 2 more bytes than a b

The overwhelming consensus regarding defaults for reading several pieces of input is that two integers can be read in list from with no penalty. You can obviously override those defaults in your challenge, but it would be preferable to do so when posting the question, not 5 hours later. In case you didn't know, we have a Sandbox where you can get feedback from the community and iron out the details before posting the actual challenge.

@Hurricane996 [a,b] in concept doesn't always use 2 more bytes than a b. What's meant is a list/vector/pair/whatever you want to call it, which doesn't have to look like [a,b]. Such a collection is a more convenient means of input in some languages rather than two separate inputs.

If I were to make a program in brainf***, how would I take input?

-1 because of numerous modifications.

Stuck, 4 Bytes
I'm amazed Stuck finally is winning something! The inclusive range function checks to see if the top of the stack is a list of length 2, and uses it for the parameters of the range function if so.
t]R+

Input is | separated, as t takes a bunch of inputs separated by |s and places them on the stack. ] just wraps the elements in a list, and lets the range function do it's job.
If that still falls in the penalty, then this works (5 Bytes): ii]R+

Dammit. I was going to try to make a Stuck solution but the docs on Esolang didn't say that you could use the inclusive range function like that and so I gave up....

@quartata Sorry, I haven't updated the docs in a while.. :P

Pyth, 6 4 bytes + 3 = 7 5 bytes
s}vzQ

Avoids the 3-byte penalty imposed by the new input requirements via an extra byte.
Takes input separated from stdin separated by newlines.
Live demo.

Python, 26
lambda a,b:(a+b)*(b-a+1)/2

Assumes b>=a. Uses the formula of mean * #summands. The result is a whole number, so it doesn't matter if the / is Python 2's floor division.
Shorter by 2 chars than the direct expression
lambda a,b:sum(range(a,b+1))

I feel like there should be a char save with ~. Expanding gives the same length (b*b-a*a+a+b)/2. So is -b*~b/2-a*~-a/2.

What about (a-a*a-~b*b)/2?

Julia, 15 bytes
s(a,b)=sum(a:b)

This creates a function s that sums the range a:b. This assumes a ≤ b.

Upvote for a short answer that is completely legible.

Dyalog APL, 8 7 bytes
+÷2÷1--

This is a dyadic function train which is equivalent to
{(⍺+⍵)÷2÷1-⍺-⍵}

Try it online.
How it works
        ⍝ Left argument: a, right argument: b
      - ⍝ Calculate a-b.
    1-  ⍝ Subtract the difference from 1 to calculate 1-(a-b) = b-a+1.
  2÷    ⍝ Divide 2 by the difference to calculate 2/(b-a+1).
+       ⍝ Calculate a+b.
 ÷      ⍝ Divide the sum by the quotient to calculate (a+b)/(2/(b-a+1)),
        ⍝ i.e., (a+b)(b-a+1)/2.

Matlab/Octave, 14 bytes
@(a,b)sum(a:b)

Javascript ES6, 21 bytes
a=>b=>(a+b)*(b-a+1)/2

Used the same approach to that problem that's almost everywhere: "Add up all of the numbers between 1 and 100, inclusive."

I didn't know you could use lambda's in Javascript!

Oh, it's in the new ES6 specs.

You can save a byte with currying (a=>b=> …)

Java, 44 42 bytes
An approach I haven't seen here so far: Via gaussian sums you can derive that the sum of all numbers from a to b is (b-a+1)*(b+a)/2
If you only have to implement a function, you could do it in 42 bytes:
int s(int a,int b){return(b-a+1)*(b+a)/2;}

The conventional approach is 3 bytes longer:
int s(int a, int b){for(;b>a;a+=b--);return a;}

A full program is 142 bytes:
public class S{public static void main(String[]a){int n=Integer.parseInt(a[0]),m=Integer.parseInt(a[1]);System.out.println((m-n+1)*(m+n)/2);}}

You really should try something other than Java. ;)

Would it work to remove the space in int a, int b? Perhaps the space after return as well?

@AlexA. Thanks=) Do you know about the Java8 lambdas? I haven't installed it yet but I think (int a,int b)->(b-a+1)*(b+a)/2 should work as a lambda?

Even without lambdas, public static isn't usually required for functions here. Just int s(...args...) is fine for the signature.

you could reduce it by 3 characters, if you use long instead int, i'm talking about full program here

I know it's been almost 2 years ago.. But, the conventional approach is 4 bytes longer, not 3 (after you've removed the space at int a,int b. The full class can be 118 bytes: class S{public static void main(String[]a){long n=new Long(a[0]),m=new Long(a[1]);System.out.print((m-n+1)*(m+n)/2);}}. And all three can be lowered if you use Java 8: a->b->(b-a+1)*(b+a)/2 (21 bytes); a->b->{for(;b>a;a+=b--);return a;} (34 bytes); and interface S{static void main(String[]a){long n=new Long(a[0]),m=new Long(a[1]);System.out.print((m-n+1)*(m+n)/2);}} (115 bytes)

APL, 9 bytes
-⍨/2!⎕+⍳2

Takes input as a two-element list . Set your index origin to 0 (⎕IO←0) before running.
This is longer than the answer by @Dennis but in my opinion more stylish.
It calculates (B+1 nCr 2)-(A nCr 2) = B(B+1)/2-A(A-1)/2.

Does ⍨ actually take only one byte in some encoding?

@RobertoBonvallet I believe APL uses a special encoding

TI-BASIC, 8 bytes
mean(Ans+Ansmin(ΔList(Ans

Takes input in the form {A,B}.
                      Ans    ; {A,B}
                ΔList(       ; {B-A}
            min(             ;  B-A
         Ans                 ; (B-A)*{A,B}
     Ans+                    ; (B-A+1)*{A,B}
mean(                        ; (B-A+1)*(A+B)/2

By comparison, the shortest two-variable solution is 11 bytes:
Prompt A,B
sum(randIntNoRep(A,B   ;random permutation of integers between, inclusive

SH, 16 bytes
seq $1 $2|numsum

Where $1 and $2 are the values of two args passed to this program on the command line. numsum is from the num-utils package. Another version that is also 16 bytes is:
seq -s+ $1 $2|bc

CJam, 7 bytes
q~),>:+

Test it here.
q~  e# Read and eval input, pushing a and b onto the stack.
),  e# Increment b and turn into the range [0 1 2 ... b-1 b].
>   e# Discard the first a elements to get [a a+1 ... b-1 b].
:+  e# Reduce + onto the list, computing the sum.

Mathematica, 9 bytes
Tr@*Range

This evaluates to an unnamed function taking two integers. I was going to use the built-in Sum, but it's 4 bytes longer:
x~Sum~{x,##}&

><>, 14 bytes
This assumes that the stack has already been populated with a and b, so this is basically a function. I'm using this online interpreter which lets you put values onto the stack before the program runs. An extra three bytes for -v (plus a space, for running from a terminal) would put this answer at 17 bytes.
:r:@-1+@+*2,n;

Explanation:
-v  ab                 (initial stack)
:   abb                duplicates top of stack (b)
r   bba                reverses stack
:   bbaa               duplicates top of stack (a)
@   baba               rotates top three elements clockwise (baa -> aba)
-   ba,(b-a)           subtraction (ba -> b-a)
1+  ba,(b-a+1)         adds 1 (b-a -> b-a+1)
@   (b-a+1),ba         rotates top three elements clockwise
+   (b-a+1),(b+a)      addition (ba -> b+a)
*   (b-a+1)*(b+a)      multiplication
2,  (b-a+1)*(b+a)/2    division by 2 (/ is a mirror, so , is used instead)
n;  <integer, quit>    output top of stack as an integer and quit

This assumes that 0 <= a <= b and uses this closed-form solution (b-a+1)(b+a)/2 to directly calculate the answer.

This code below goes the route of trying to be a full program, but only works for 0 <= a <= b <= 9. That you have to do integer parsing in ><> is annoying. Thanks to Cole, if we assume the input is two single digits, then four bytes can be shaved off. 20 bytes.
ic%:ic%:@$-1+@+*2,n;

The trick is that instead of 68*-, use c% (take the modulus with respect to 12). This will indeed work because 48+x (mod 12) is x (mod 12), which is 0-9 if x is 0-9.

For your second program, you can shave off some bytes by changing 68*- to c% since we only expect input from 0 to 9. EDIT: also, division is ,, not /.

It was not originally clear to me where the number 48 was coming from.  I see now that it's because the ASCII codes for the characters 0 through 9 are 48 through 57, but I'm mentioning it in case someone else is mystified.

R - 24 Bytes
f=function(a,b) sum(a:b)

You can save yourself 3 by making it an unnamed function and remove the space from it.

You can save 1 byte because you don't really need the space. Also, is it really necessary to declare a function? I see a lot of submissions that doesn't have them so I am getting  confused about it.

@AndréMuta Submissions on this site have to use one of our standard input formats. That means that a and b can be function arguments (as is the case here), they can come from user input like from scan(), or they can be read as command line arguments.

O, 8 7 bytes
Hjmr]+o

Explanation
H   Start an array with a number from input
 j  Get input as number
 mr Range between
]
+   Sum the array
o   print it

Try it here

I was trying an O answer, but I forgot about mr and ended up with some REALLY long crap. +1

Haskell, 13 bytes
x#y=sum[x..y]

Usage example: 10 # 12 -> 33

Brain-Flak, 32 30 bytes
([{({}[()])}{}]{()({}[()])}{})

Try it online!
Explanation
This uses the triangulation algorithm to calculate T(a-1) and T(b) then pushes the difference.  I actually golfed 2 bytes off the existing world record triangulation algorithm while making this solution.
To push T(a-1) it uses a modified version of the original algorithm.  Instead of the simple:
({}[()])({()({}[()])}{})

I removed both the first ({}[()]) and the ().
The reason () was there in the first place was that ({({}[()])}{}) quite conveniently calculates T(n-1) for us so there is no need to decrement if we remove the ()
This first portion is made negative and put next to the second portion which performs standard triangulation inside of the outer push.
([{({}[()])}{}]{()({}[()])}{})

Befunge-93, 18 16 bytes
&:1-*&:1+*\-2/.@

Explanation
&   a                      input as integer (a)
:   aa                     duplicate top of stack (a -> a,a)
1-  a,(a-1)                subtract 1 from top of stack (a -> a-1)
*   a*(a-1)                multiply top two values of stack (a,a-1 -> a*(a-1))
&   a*(a-1),b              input as integer (b)
:   a*(a-1),bb             duplicate top of stack (b -> b,b)
1+  a*(a-1),b,(b+1)        add 1 to top of stack (b -> b+1)
*   a*(a-1),b*(b+1)        multiply top two values of stack (b,b+1 -> b*(b+1))
\   b*(b+1),a*(a-1)        swap top two values of stack (c,d -> d,c)
-   b*(b+1)-a*(a-1)        subtract top two values of stack (d,c -> d-c)
2/  (b*(b+1),a*(a-1))/2    divide top of stack by 2
.@  <output, exit>         output as integer and stop

This uses the following formula:
b(b+1)   (a-1)(a-1+1)   b(b+1) - a(a-1)
------ - ------------ = ---------------
  2            2               2

Unfortunately, the shorter (b-a+1)(b+a)/2 cannot be done in Befunge easily because it requires accessing b and a twice, which is impossible to do when working only with the top two values of the stack. Storing a value in "memory" would take more characters.

C++, 42 bytes
As a function (42 bytes):
int s(int a,int b){return(a+b)*(b-a+1)/2;}

As a full program that reads from STDIN and writes to STDOUT (86 bytes):
#include<iostream>
main(){int a,b;std::cin>>a;std::cin>>b;std::cout<<(a+b)*(b-a+1)/2;}

Both approaches compute the sum using the Gaussian formula.
Ungolfed:
#include <iostream>

int s(int a, int b) {
    return (a + b) * (b - a + 1) / 2;
}

int main() {
    int x, y;
    std::cin >> x;
    std::cin >> y;
    std::cout << s(x, y) << std::endl;
    return 0;
}

Try it online

You can save few bytes if you use lambda instead. Requires changing tag to C++11 though.

@Zereges I don't know much about C++ lambdas. Would it be something like [](int a,int b){return(a+b)*(b-a+1)/2;}?

yes, exactly like that. Sorry, but I for some reason can address this post to you using @

@Zereges You don't need to ping me since this is my post; I'll always get notified of a comment on it. And thanks! :)

You can save 9 bytes from the full program by using std::cin>>a>>b; to get your inout from one line with a space in the middle (eg 1 10)

hehe, 42 bytes => +1!!

Rust, 27 bytes
Creates a closure s that takes two unsigned 8-bit integers and returns another.
let s=|m,n|(n-m+1)*(m+n)/2;

PowerShell, 32 31 29 Bytes
$args-join'..'|iex|measure -s

Thanks to TessellatingHeckler for the alternate way to make a range and sum it. Works for any combination of a and b so long as the difference between them is less than 50,000.

Previous version (31):
param($a,$b)($b-$a+1)*($b+$a)/2

Uses the same formula as others, assumes that b>=a.

Previous version (32):
param($a,$b)($a..$b)-join'+'|iex

Pretty trivial. Generates a range of numbers from $a to $b, -joins them with a +, then pipes that to Invoke-Expression which performs the summation. Yay verbosity. Note: This function will break if the two numbers are > 50,000 apart, as that's the (hard-coded) limit of dynamically generated ranges in PowerShell, but it correctly handles b<a, so, y'know...

I'll throw in $f={$args-join'..'|iex|measure -s} used like & $f 5 10 -> 45 - measuring just the inner function content as you are, it hits 29 bytes. The rules don't say it must only output the sum. Cool idea with the join/iex,

@TessellatingHeckler Oh, interesting. Note that you don't need the $f={ } if you save it as a ps1 file and execute it as a script from the PS command line. Same with the param() versions. That's why I've only ever measured "just the inner function content" because it's a complete program.

Jelly, 2 bytes
rS

Try it online.
r   Yields inclusive range [a, b]
 S  Sum

Java, 19 bytes
a->b->a-a*a-b*~b>>1

Thanks to ceilingcat
Try it online!
Explanation
Expand the numerator:
$$(a+b)*(b-a+1) = a*b - a*a + a + b*b - a*b + b = b * b - a * a + a + b$$
>> 1 is equivalent to divide by 2, but it has lower precedence than addition and subtraction, so no parentheses are required. ~x is the same as -x - 1. Thus,
a-a*a-b*~b>>1 = (a-a*a-b*(-b-1))/2
              = (a-a*a+b*b+b)/2
              = (b*b-a*a+a+b)/2

Java, 21 bytes
a->b->(a+b)*(b-a+1)/2

Try it online!

Awk, 24 bytes
$0=""($1+$2)*($2-$1+1)/2
Incorporated manatwork's suggestion.

Is shorter if you make it pattern instead of action: $0=""($1+$2)*($2-$1+1)/2.

Applescript, 147 137 Bytes
Welp. I'm not winning.
set a to(text returned of(display dialog""default answer""))
set b to(text returned of(display dialog""default answer""))
(b-a+1)*(b+a)/2

Since I'd never seen an Applescript answer before, I decided I'd make one, then immediately realized why it never had been done.
The explanation is fairly straightforward -
set ... to (text returned of (display dialog "" default answer ""))
            ^
            Get the text of                     ^ the user inputs an answer here

(b-a+1)*(b+a)/2
^ with nothing else below this, Applescript recognizes it as the final
  value and prints to console.

Yes, I recognize that on compile, Applescript "helpfully" spaces everything out - this will still compile and run as is, however.

PHP, 29 bytes
Based on standard stricks to set variables (eg register_globals oldSkool)
while($b>=$a)$r+=$b--;echo$r;

R, 18 Bytes
sum(scan():scan())

05AB1E, 2 bytes
ŸO

Explanation:
      # Implicit input
      # Implicit input
  Ÿ   # Push [a...b]
   O  # Sum list
      # Implicit print

Try it online!

Groovy, 19 Bytes
{a,b->(a..b).sum()}

Vyxal s, 1 byte
ṡ

Try it Online!
(2 bytes flagless)
Explanation:
ṡ  # Push the range from a to b
   # s flag sums the top of the stack
   # Implicitly print

Ruby, 22 bytes
->a,b{eval [*a..b]*?+}

Just as long as using the expression in @xnor's Python answer:
->a,b{(a+b)*(b-a+1)/2}

Test it:
->a,b{eval [*a..b]*?+}[10,20] #=> 165

Not everyone is posting incomplete snippets. When not otherwise specified, one should assume that answers must use one of our default input methods.

@AlexA. yup, but I think the challenge is poorly worded. I'll check back later and update if it's been rephrased. Gotta run.

Math++, 23 bytes
?>a
?>b
(b-a+1)*(b+a)/2

Squirrel, 21 bytes
@(a,b)(b-a+1)*(b+a)/2

Creates an anonymous function.

J, 19 bytes
   f=:4 :'+/x+i.1+y-x'
   1 f 1
1
   1 f 2
3
   5 f 10
45

It would be longer if it calculated the answer directly, because it would need some parentheses. I can't quickly find a builtin way to "range from a to b", so it does:
                    # The parameters are x on the left, y on the right
f=:4 : '            # f is a dyad verb defined as...

 +/                  # The sum of ...
   x +               # x added to the list of ...  (turns 0 1.. to x x+1..)
       i.            # the integers from 0 to ...
          1+y-x      # 1 + y -x                    (sequence length)

'                    # end definition string.

5 f 10 ->

1 + 10 - 5 =
6

i. 6 =
0 1 2 3 4 5

5 + 0 1 2 3 4 5 =
5 6 7 8 9 10

+/ 5 6 7 8 9 10 =
5 + 6 + 7 + 8 + 9 + 10 =
45

Have you tried the algorithms from Dennis' and my APL answers?

@ThomasKwa Not yet, I can't even follow them. (Your APL answer has one character which my browser can't render and can't copy into the TryAPL site, one that I can't follow the TryAPL cheat sheet explanation, and I don't know what an index origin is. Dennis's answer - sounds like a train might become a J hook or fork, but I haven't tried to follow what it's doing).

you don't need to count f=: so this is really 16 bytes

PHP, 39 bytes
As usual not even close to the shortest answer:
<?=array_sum(range($argv[1],$argv[2]));

Runs from command line like:
php sum.php 10 20

Not a wonderfull solution, but +1 for doing the same thing I thought of

@Martijn Thanks. I couldn't think of anything shorter even using the calculation ($a+$b)*($b-$a+1)/2 isn't shorter than using the long function names.

I base my php answers on register_globals in the old settings, so $_GET['a'] would be accessable via $a, saving bytes

@Martijn Yeah, but you can't post any answer that runs in PHP 5.4 or better, right?

Nope. 'luckily' I've got a 5.2 test environment so I can apply this. Then again, I cant use the funky new possibilities

Swift 2, 27 bytes
Swift seems to be able to infer types much more easily these days...
let f={($0+$1)*($1-$0+1)/2}
Called with f(a, b)

C++11 lambda, 37 bytes
[&b](int a,int&b){b=(a+b)*(b-a+1)/2;}

Invocation:
int main()
{
    int a,b;
    std::cin >> a; std::cin >> b;
    std::cout << ([&b](int a,int&b){b=(a+b)*(b-a+1)/2;}(a,b),b) << std::endl;
    return 0;
}

Do you really need [&b]? You're still taking it as a reference in the argument list.

even if it did, [&] is one byte shorter

Perl 6 (14 chars / bytes)
The only obvious solution is to create a list from a to b, and then to reduce it with the addition operator.
[+] a..b

That would be a snippet, so let's place it in a pointy block.
( One of the ways to create a lambda expression. )
-> \a, \b { [+] a..b } # 22 chars

->\a,\b{[+] a..b} # 17 chars

Or better yet use a placeholder parameterized block.
{[+] $^a..$^b} # 14 chars

Examples of it's use:
say {[+] $^a..$^b}(4,7) # 22␤

# store it as a subroutine and in a scalar
my &s = my $s = {[+] $^a..$^b};

say s 4,8; # 30␤
say $s.(3,8); # 33␤

say ( {[+] $^a..$^b} for 4,7, 4,8, 3,8, ); # (22 30 33)␤

If you wanted to be cheap, you could modify the parser by adding a list summation operator. Which technically could be considered a new language at that point. Although that would be a made up language so wouldn't be a valid answer anyway.
( This is actually how it might be written in the Rakudo implementation if it was added )
sub prefix:<∑> (+@a) is looser(&[,]) {
  [+] @a
}

### new language starts here ###

{∑$^a..$^b} # only 11 chars / 12 bytes in UTF8

( Scoring it with bytes feels wrong because Perl 6 and thus this new anonymous language only deal with graphemes in strings. )

Minkolang 0.8, 14 bytes (INVALID)
Minkolang was created after this challenge was posted, so I post this answer only in the sense of contributing to a catalog.
nndr-[d1-]$+N.

Explanation
n     input as integer (stack: a)
n     input as integer (stack: a,b)
d     duplicate top of stack (stack: a,b,b)
r     reverses stack (stack: b,b,a)
-     subtraction (stack: b,b-a)
[     starts a For loop that will run b-a times
 d    duplicates top of stack
 1-   subtracts 1
]     closes For loop (stack: b,b-1,b-2,...,a+1,a)
$+    sums the stack
N.    outputs as integer and stops

Try it here.

The formula-based solutions like what I used in my Befunge and ><> answers are 2 and 3 bytes longer, respectively:
nd1-*nd1+*r-2:N.
ndnd3R-1+1R+*2:N.

Jolf, 4 bytes
Try it here!
usjJ
u    sum of
 s   the inclusive range between
  jJ two inputs

jq, 25 characters
(24 characters code + 1 character command line option)
[range(.[0];.[1]+1)]|add

Sample run:
bash-4.3$ jq -s '[range(.[0];.[1]+1)]|add' <<< '10 15'
75

jq, 27 characters
(24 characters code + 3 character penalty)
[range(.[0];.[1]+1)]|add

Sample run:
bash-4.3$ jq '[range(.[0];.[1]+1)]|add' <<< '[10,15]'
75

On-line test
Not specifically interesting, just the -s option which comes handy here: it interprets raw input as array. (Yes, the code itself is identical in both solutions.)

PlatyPar, 2 bytes
_s

Try it online!

Lua, 40 Bytes
Used the same method as the Javascript answer, but in Lua.
function y(a,b)return(a+b)*(b-a+1)/2 end

You use this as such
y(3, 6) --3 + 4 + 5 + 6 == 18

K (oK), 14 12 bytes
Solution:
+/^/!:'|0 1+

Try it online!
Examples:
> +/^/!:'|0 1+2 7
27
> +/^/!:'|0 1+5 10
45

Explanation:
Slightly different to doing .5*(x+y)*1+y-x. Instead, calculate ranges, take largest except smallest and then sum up:
+/^/!:'|0 1+ / solution
        0 1+ / vectorised addition of 0 1 / 2 7 -> 2 8
       |     / reverse:                   / 2 8 -> 8 2
    !:'      / til (!:) each (')          / (8;2) -> (0 1 2 3 4 5 6 7;0 1)
  ^/         / except (^) over (/)        / (0 1 2 3 4 5 6 7;0 1) -> 2 3 4 5 6 7
+/           / add (+) over (/) aka sum   / 2 3 4 5 6 7 -> 27

I think 9 bytes is possible with {y+/x_!y}

J-uby, 9 Bytes
:!~|:/&:+

Explanation:
:!~         generate range a..b
   |        then
    :/&:+   sum it together

Expansion:
:!~|:/&:+
->(a,b){ (:/&:+).(a!~b) }
->(a,b){  :+ / (a !~ b) }
->(a,b){ (a..b).reduce(:+) }

Bash + bc, 13 bytes
Even shorter bash solution:
seq -s+ $@|bc

Try it online!
Explanation
seq -s+ $@ called with for example 2 7 prints 2+3+4+5+6+7, this gets piped to bc which evaluates it & prints the result.

Symbolic Python, 49 bytes (46 + 3 penalty)
_=(_[_==_]*-~_[_==_]-_[_>_]*~-_[_>_])/-~(_==_)

Try it online!
Anything involving range, len, or loops would be too difficult in Symbolic Python, and so I decided the easiest way was to use the formula:
$$ \sum_{r=a}^b r = \frac{b(b+1) - a(a-1)}{2}  $$

33, 20 bytes
OcaxcmszOcaxaclaz2do

Try it online!
Explanation
This answer uses the following formula to calculate it: $$a + (a+1) + (a+2) + \cdots + b = {a-a^2+b+b^2 \over 2}$$
O       O            | Get a and b as two integers delimited by whitespace
 ca                  | (a                  )
   xcm               | (  - a^2            )
      sz      la     | (        + (       ))
         ca          | (          (b      ))
           xac       | (          (  + b^2))
                z2d  | (                   ) / 2
                   o | Print it

APL(NARS), 8 chars, 16 bytes
{+/⍺..⍵}

test:
  f←{+/⍺..⍵}
  1 f 2
3
  2 f 10
54

This it is 6 chars but I not find a way to assign a name to it
+/↑../

Using as function 2 3

Reg (a.k.a Unofficial Keg), 17 bytes
Try it online behavior is unknown.
¿¿ï_'(:|_)(+).

This takes 2 inputs separated by newlines.

Keg, 7 bytes (SBCS is on Keg wiki)
¿¿ɧ∑+).

Explanation
¿¿#      Two nice inputs
  ɧ#     Generate range
   ∑+)#  Summation (looks quite weird because ∑ translates to (!;|. )
      .# Output as integer

TIO

Desmos, 21 bytes
f(a,b)=(a+b)(b-a+1)/2

Try It On Desmos!

Alice, 23 bytes
/@M\-:2*t.{
\MO/.h*2:~{

Try it online!
Flattened
/MM/.h*2:~.t*2:-\O@
/                      Switch to Ordinal
 MM                    Read the two command line arguments
   /                   Back to cardinal
    .h*2:              (a*a+1)/2, the sum of all the integer between 0 and a
         ~             Swap the stack values
          .t*2:        (b*b-1)/2, the sum of all the integer between 0 and b-1
               -       Diff between the two sums
                \      Switch to Ordinal
                 O     Print the result to the output
                  @    Bye

Knight, 19 bytes
O/*+E=aP=bP+1-b a 2

Try it online!
Uses the formula (a+b)*(b-a+1)/2.

Factor + math.unicode, 12 bytes
[ [a,b] Σ ]

Try it online!
Interesting tidbit: sum (and therefore Σ) is a generic (polymorphic) word that specializes on ranges to efficiently calculate arithmetic sums.

C, 32 28 bytes
f(a,b){a=a==b?a:a+f(a+1,b);}

Easier to read
int f(a,b){

  // This ends the recursion by returning the current number
  if(a == b) return a;

  // This recursively returns the sum of the
  // current low number and the next low number.
  return a + f(a+1,b);
}

C preprocessor, 40 bytes
#define S(a,b) (((a)+(b))*((b)-(a)+1)/2)

This submission doesn't add anything particularly useful, and is similar to multiple submissions already here. What makes your post different? Perhaps adding that would make it a more popular solution.

Is codegolf useful? C/C++ cannot compete with interpreted languages in that way, so avoiding typenames and return keyword was the deal.

Bash/GNU, 21 Bytes
expr `seq -s" + " $@`

called with arguments a and b

seq generates a sequence from a to b, separated by " + "
expr evaluates and prints the resulting expression

gs2, 5 bytes
WÉ'Od          57 90 27 4f 64

Read two numbers, dump them on the stack, increment the top one, take the range between them, sum it.

Hassium, 60 Bytes
func main(){s=0;for(x=input();x<=input();x++)s+=x;print(s);}

Run online and see expanded here

Burlesque - 6 bytes
per@++ usage:
$ echo "10 20" | blsq --stdin "per@++"
165

DUP, 15 bytes
[^^+^3ø-1+*2/.]

Try it here!
Anonymous lambda. Usage:
1 10[^^+^3ø-1+*2/.]!

Explanation
Uses the formula (a+b)*(b-a+1)/2.

Elixir, 37 bytes
fn(a,b)->Enum.reduce(a..b,0,&+/2)end

poster child example for reduce, i guess. allows b > a.

Seriously, 5 bytes
,u,xΣ

Try it online!

Pylons, 3 bytes
iks
How it works:
i # Take command line input.
k # Push the inclusive range(stack[-2]..stack[-1])
s # Sum the stack.

Forth, 27 bytes
0
: f 1+ SWAP DO I + LOOP ;

The parameters much be pushed smallest first. Run like this:
1 4 f .

Try it online

Detour, 11 bytes
{+(}-!>)*d.

This uses the (a+b)*(b-a+1)/2 formula.
+ encodes (a+b), -!> encodes (b-a+1) (really -(a-b)+1), and *d. multiplies (*) the two together, halves it (d), and outputs it (.). {…} makes two copies of a and b and (…) manipulate where the two copies go so that the result of (a+b) doesn't get fed into the (b-a+1) section.
Try it online!

J, 11 bytes
-:@<:@-*-@+

This is a tacit verb. Example usage:
    v =: -:@<:@-*-@+
    5 v 10
45

This verb is a fork of three verbs: -:@<:@-, *, and -@+. A fork x (f g h) y is equivalent to (x f y) g (x h y). Thus, x (-:@<:@-*-@+) y = (x(-:@<:@-)y) * (x (-@+) y). Likewise, the composition of two verbs x (f @ g) y equals f (x g y). Using this rule, given that <: decrements, and -: divides its argument by two, x(-:@<:@-)y = (x - y - 1)/2 and x(-@+)y = -(x+y). Therefore x(-:@<:@-*-@+)y = (x - y - 1) / 2 * -(x+y), and by moving the sign from -(x+y) to (x-y-1), we get (y - x + 1) / 2 * (x + y).

Dennis's APL solution translated into J for 7 bytes: +%2%1--

QBIC, 15 bytes
::[a,b|d=d+c]?d

:: takes two command line parameters and names them a and b. Then, we create a FOR loop (using iterator c) from a to b. We keep adding c to d, then print d and exit.

What is QBIC?  Where can I find out about it?  A google search brings up this answer.

@WheatWizard This is basically the most complete repository on what QBIC is and where to get it.

Proton, 17 bytes
a=>b=>sum(a..b+1)

Try it online!

Japt, 4 bytes
Input order is irrelevant.
òV x

Test it

In 2023, this is 2 bytes òV -x

TI-Basic, 14 bytes
Input :.5(YY+Y+X-XX

Bonus: no lists or list commands.

The X-value should be smaller.

Perl 5, 19 bytes
18 bytes of code + 1 for -p
map$\+=$_,$_..<>}{

Try it online!

Excel, 20 bytes
=(B1^2+B1-A1^2+A1)/2

Husk, 2 bytes
Σ…

Try it online!
Explanation
    -- implicit inputs: A B   |  2 7
 …  -- inclusive range [A,B]  | [2,3,4,5,6,7]
Σ   -- sum                    |  2+3+4+5+6+7  == 27

RProgN 2, 2 bytes
R+

Boring solution, Range from a to b, then sum.
Try it online!

Casio Basic, 20 bytes
sum(seq(x,x,a,b))

Simple function. 17 bytes for the program, 3 bytes to enter a,b as arguments.

LOLCODE, 184 bytes
HAI 1.3
I HAS A B
I HAS A J
GIMMEH J
I HAS A Q
GIMMEH Q
MAEK Q A NUMBR
IM IN YR L UPPIN YR i TIL BOTH SAEM DIFF OF Q AN SUM OF i AN J AN -1
	VISIBLE SUM OF i AN J
IM OUTTA YR L
KTHXBYE

Try it online!

In some interpreters, you can exclude the "HAI" and "KTHXBYE"

Python 2, 28 bytes
lambda x,y:sum(range(x,y+1))

Try it online!

Japt -x, 3 bytes
Nrò

Try it online!
Explanation
I use N to avoid the +3 input penalty.
I would normally format the input as \$[a,b]\$ and my code would be rò.
N reads the entire input.
r reduces that by: ò, which creates the range from \$a\$ to \$b\$.
-x sums the output.

Alchemist, 135 bytes
_+a->
0_+0m+a+b->u+x+v+y
0m+0a+b->v+y
0a+0b+0m+u+v->m
0a+0b+0m+0u+v->m
m+u+v->a+b+m
m+0u+v->b+m
m+0u+0v->
0a+0b+x+y->
0a+0b+0x+y->Out_I

Output in unary, try it online or view the remaining \$\texttt{y}\$-atoms here!
Explanation
Pretty similar to this answer, uses that \$a \leq b\$: Basically we ensure with 0_ on the second rule that the first rule must always be applied first (initially the universe always contains one
\$\texttt{_}\$-atom), removing one \$\texttt{a}\$-atom and then summing both \$\texttt{#x} = [1\dotsc \texttt{#a}]\$ and \$\texttt{#y} = [1\dotsc \texttt{#b}]\$ in parallel, once there are no \$\texttt{a}\$- or \$\texttt{b}\$-atoms left, we subtract them and finally print the remaining \$\texttt{y}\$-atoms.
Ungolfed
# Remove one a-atom:
_+a->
# Sum [1..#a] (to out_a) and [1..#b] (to out_b) in parallel:
0_+0mov+ a+b->u+out_a+v+out_b
0mov+0a+b->v+out_b
0a+0b+0mov+ u+v->mov
0a+0b+0mov+0u+v->mov
mov + u+ v->a+b+mov
mov +0u+ v->b+mov
mov +0u+0v->
# If we're done with that:
0a+0b+ out_a+out_b->         # difference: out_b - out_b
0a+0b+0out_a+out_b->Out_I    # output rest in unary

invalid now, arg format appears to be different now

106

104

102

101

JavaScript, 21 bytes
Input is taken in currying syntax: f(a)(b)
a=>b=>b*b-a*a-(a+b)*2

Try it online!

Stax, 4 bytes
╖c╟Y

Run and debug it

Pip, 13 bytes
Fia\,q{Yy+i}y

Attempt This Online!
Can't find a "sum" operator in Pip's documentation.
Explanation
Fia\,q{Yy+i}y  # Implicit input. A on the command line, B on STDIN.
  a\,q         # Inclusive range, A to B
Fi    {    }   # Loop through, with variable i:
        y+i    #  Add i to y (implicitly defaults to 0)
       Y       #  And store the result in y
            y  # After the loop, push y
               # Implicit output.

Pyt, 3 bytes
⇹ŘƩ

Try it online!
⇹        implicit inputs; swap order
 Ř       Řangify
  Ʃ      Ʃum; implicit print

If the input can be taken in the opposite order (B, then A), then a two-byte solution works:
Pyt, 2 bytes
ŘƩ

Try it online!

sed, 54 bytes
s/>$/!>/
:a
s/<(!*)><((\1)!+)>/\1<\1!><\2>/
ta
s/<.*//

Each number is inputed as unary exclamation marks surrounded by <> signs.
Output is just exclamation marks.
For example: <!><!!!> gives !!!!!!.
Try it online!

J-uby, 8 bytes
:!~|:sum

Attempt This Online!

Thunno 2 S, 1 byte
I

Attempt This Online!
Built-in for Inclusive range. The flag Sums the resulting list.


text:
RTTTL Obfuscation
RTTTL, or Ring Tone Text Transfer Language is a music format that was invented by Nokia in the dawn of time when dinosaurs roamed the land. It allows for fairly crude pieces of music (no chords or anything), and the format is pretty simple which is why I think it's pretty cool. Take a look at this one:
DejaVu: d=8,o=5,b=200: e, e, c, e, g, 2g4

Let's dissect the format. The "DejaVu" part at the beginning is the title -- this cannot be longer than ten characters. The d and o are the default values for duration and octave -- if a note doesn't specify duration or octave, it'll use these. Finally, the b is the beats per minute.
After that, the actual notes of the song are listed. The format of a note is DPO, where D is the duration of the note (1, 2, 4, 8, 16), P is the pitch (A,B,C,D,E,F,G,A#,B#,C#,D#,E#,F#,G#), and O is the octave (4-8 in the Nokia implementation, however it is different for other implementations. For the purposes of the challenge we'll say it is 1-8). If the duration or the octave is not specified, the defaults are used. Additionally, a note can have a dot after it -- this essentially multiplies the duration by 1.5.
In our example here, we have two E notes with no duration and octave, which mean that they have the default duration and octave (8, or eighth-note and octave 5), a C with no duration and octave, an E and a G. The final note is a G note with a duration of 2 (half-note) and an octave of 4.
Now that we've gone over the format, what's the challenge? The challenge actually doesn't have too much to do with RTTTL. Your task is to create an obfuscated program that outputs "Hello, World!" (exactly) that is also a valid RTTTL song that is at least five seconds long.
In order to test your RTTTL song, you can use this site to convert your song to a MIDI file, then listen to it in a MIDI player. This is popularity-contest. Good luck!
EDIT: Here's a website for converting MIDIs to RTTTLs if you so desire. Link
EDIT2: This shiny bounty will be awarded to the winner (most upvoted post) in 7 days.

Can the beats per second be a decimal?

No. Also that was supposed to be beats per minute, I've fixed that.

Is there any way to convert a midi file to an RTTTL song?

I'm sure there is. Maybe try googling it? (You'd have to make sure the MIDI file doesn't contain chords, which RTTTL doesn't support.)

Found one that works: http://midi.mathewvp.com/midi2RTTL.php

Would the person who downvoted this challenge please explain why they downvoted it? It's really important that I get feedback so I can make better challenges in the future.

The challenge itself looks pretty hard, so instead I wrote a script to play the tunes. (It's not golfed). PowerShell / Console Beep based Play-RTTTL.ps1, and found some example songs online.

Updated the question to make octaves 1-8. If you guys are writing any RTTTL players I recommend you change them. The Nokia implementation does indeed use 4-8 but the format can handle 1-8.

Whitespace, 2748 Bytes
(replace \t with actual tabs)
Hello:d=4, o=5, b=120:2p, 16a2,
16p, 16a2, 16p, 16a3,\t16p, 16a3, 16p,\t16g2, 16p, 16g2, 16p,
16g3,\t16p,\t16g3, 16p, 16a2, 16p, e3,\td3,
16b2, 16c3, 16b2, 16a2,\t8g2,\t16a2, 16p, 16a2,\t16p, 16a3,\t16p,
16a3,\t16p,\t16g2, 16p, 16g2, 16p, 16g3,\t16p, 16g3,
16p, 16a2, 16p, e3,\td3,\t16b2, 16c3,\t16b2,\t16a2, 8g2, 16a2,
16p,\t16a2,\t16p, 16a3, 16p, 16a3, 16p,\t16g2,\t16p,
16g2, 16p, 16g3, 16p,\t16g3,\t16p, 16a2,\t16p,\te3, d3, 16b2,
16c3,\t16b2,\t16a2, 8g2, 16a2, 16p, 16a2,\t16p, 16a3, 16p,
16a3, 16p, 16g2, 16p,\t16g2,\t16p, 16g3,\t16p,\t16g3,\t16p,\t16a2,
16p,\te3,\td3, 16b2, 16c3, 16b2, 16a2,\t8g2, 16a2,\t16p,
16a2, 16p, 16a3, 16p,\t16a3, 16p,\t16g2,\t16p, 16g2, 16p,
16g3,\t16p,\t16g3, 16p, 16a2, 16p, e3,\td3,\t16b2, 16c3,
16b2, 16a2, 8g2, 16a2,\t16p, 16a2, 16p, 16a3, 16p, 16a3,
16p,\t16g2,\t16p, 16g2, 16p, 16g3, 16p,\t16g3,\t16p,\t16a2,
16p, e3, d3, 16b2,\t16c3,\t16b2,\t16a2, 8g2,\ta2,\t8c#3,\t8e3,
g2,\t8b2,\t8d3, a2, 8c#3, 8e3, g2,\t8b2, 8d3, a2, 8c#3,
8e3, g2, 8b2, 8d3,\ta2,\t8c#3, 8e3,\tg2,\t8b2,\t8d3,\ta2,
8c#3,\t8e3,\tg2, 8b2, 8d3, a2, 8c#3,\t8e3, g2, 8b2,\t8d3,
a2, 8c#3, 8e3, g2,\t8b2,\t8d3,\ta2, 8c#3, 8e3,\tg2, 8b2,
8d3,\t16a2,\t16p, 16a2, 16p, 16a3, 16p,\t16a3, 16p,\t16g2, 16p,
16g2, 16p, 16g3, 16p,\t16g3,\t16p, 16a2,\t16p,\te3, d3, 16b2,
16c3,\t16b2,\t16a2, 8g2, 16a2, 16p, 16a2,\t16p, 16a3,\t16p,\t16a3,
16p, 16g2, 16p, 16g2,\t16p,\t16g3, 16p, 16g3,\t16p, 16a2, 16p,
e3,\td3,\t16b2, 16c3, 16b2, 16a2, 8g2,\t16a2,\t16p, 16a2, 16p,
16a3, 16p, 16a3, 16p,\t16g2, 16p, 16g2, 16p, 16g3,\t16p,
16g3,\t16p,\t16a2, 16p, e3, d3, 16b2,\t16c3,\t16b2, 16a2,\t8g2,
16a2, 16p, 16a2, 16p,\t16a3,\t16p, 16a3,\t16p,
16g2,\t16p,\t16g2, 16p, 16g3, 16p, 16g3,\t16p,\t16a2,\t16p, e3,
d3, 16b2, 16c3, 16b2,\t16a2, 8g2,\ta2, 8c#3,
8e3,\tg2,\t8b2, 8d3, a2, 8c#3, 8e3,\tg2,\t8b2,\t8d3,\ta2,
8c#3, 8e3, g2, 8b2, 8d3,
a2,\t8c#3,\t8e3, g2, 8b2, 8d3, a2, 8c#3,
8e3,
g2, 8b2, 8d3, a2, 8c#3,\t8e3,
g2, 8b2,
8d3, a2,\t8c#3,\t8e3,\tg2, 8b2,
8d3, a2,
8c#3,\t8e3, g2, 8b2,\t8d3, 1a3,
1a2,\td3,
8f#3, 8a3, c3, 8e3, 8g3, d3,\t8f#3,
8a3,\tc3, 8e3, 8g3, d3,
8f#3, 8a3,
c3, 8e3, 8g3,\td3,
8f#3,
8a3, c3, 8e3, 8g3,\td3, 8f#3,
8a3,
c3,
8e3,
8g3,d3,8f#3,8a3,c3,8e3,8g3,d3,8f#3,8a3,c3,8e3,8g3,d3,8f#3,8a3,c3,8e3,8g3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,8c3,274p,8b2,274c3,8p,8c#3,8d3,274p,8f3,274p,8d3,8c#3,

It's a horrible ringtone version of The Doors with Hello, I love you.
Download converted MIDI

My player doesn't like it octave: 2, Cannot index into a null array.. The question said only octaves 4-8 are valid, so that's all I coded it for. Sounds good on the linked website, though.

Ah yes I forgot about this. Some players will support more octaves and some won't. The standard Nokia one only supports 4-8 which is why I mentioned that.

H9+, 157,007 bytes
MIDI!!!!
Is too long for the post. So here, have a pastebin. (The pastebin doesn't have proper capitalization, FYI.) I used the following softwares:

.MP3 => .MID
.MID => .RTL

The song is "Anthem of our Dying Day", by Story of the Year. It is the full, 3.5 minute song. ^-^.
It starts out with:
ANTHEM:d=4,o=5,b=120:172c#,86f#,86a4,172p,16p,43a4,86p,43f#4,172a4,10p,57a4,...

H, of course, prints Hello, World!. And there are no 9s nor +s in the code, I made sure. Good thing this isn't a code-golf.

Magnifique. +1 for you

@quartata Merci!

Hmm, it sounds like a herd of llamas are running around on 10 pianos, is that intended, or some playback problem on my side?

@aditsu It sort of is; it's just a rather intense rock song.

-1 doesn't implement spec ("that outputs "Hello, World!" (exactly)") and isn't written in a programming language.

@PeterTaylor Acknowledged.

Most of your note durations are invalid

@aditsu ANd yet, somehow, it still works. There's a MIDI, isn't there?

That's because that site can handle some invalid values, not because you are using the correct format.

123, 816 Bytes
H:d=4,o=4,b=400:2a,2b,2a,2b,1a,1b,2a,1b,1a,2b,1a,1b,1a,2b,1a,1b,2a,2b,2a,2b,2a,2b,2a,2b,1a,1b,2a,1b,1a,1b,1a,2b,1a,1b,1a,2b,1a,1b,2a,1b,1a,2b,2a,2b,2a,2b,2a,2b,2a,1b,1a,2b,1a,1b,2a,1b,1a,3b,3a,1b,2a,1b,1a,2b,1a,3b,1a,2b,1a,2b,1a,1b,2a,2b,2a,2b,2a,2b,2a,2b,1a,1b,1a,2b,1a,1b,2a,1b,3a,3b,1a,2b,1a,1b,2a,1b,3a,1b,2a,2b,2a,2b,2a,2b,2a,2b,1a,1b,1a,2b,1a,1b,3a,3b,2a,1b,1a,3b,3a,1b,2a,1b,1a,2b,2a,2b,2a,2b,2a,1b,1a,1b,2a,1b,1a,2b,3a,3b,1a,1b,2a,3b,3a,2b,2a,2b,2a,2b,2a,2b,1a,1b,1a,1b,2a,1b,1a,1b,1a,1b,2a,1b,1a,2b,2a,2b,2a,2b,1a,1b,1a,1b,2a,1b,1a,2b,1a,1b,2a,2b,2a,2b,2a,2b,2a,2b,1a,1b,2a,1b,1a,1b,1a,1b,2a,1b,1a,2b,1a,1b,2a,1b,1a,2b,2a,2b,2a,2b,2a,2b,1a,1b,1a,1b,1a,2b,1a,1b,2a,1b,1a,2b,1a,1b,2a,2b,2a,2b,2a,1b,3a,3b,1a,2b,1a,1b,2a,1b,3a,1b,2a,2b,2a,2b,2a,2b,2a,2b,1a,1b,2a,1b,1a,1b,3a,3b,2a,1b,1a,3b,3a,1b,2a,1b,1a,2b,1a

Download tune
This one is just rhythmic beeping, but the language surely has more potential for this challenge, since in 123, all characters except 1, 2 and 3 are ignored. Credits for the original 123 code go to Martin Büttner.

Wow, never seen this language before. Nice one!

Python 2.7, 1606 bytes
Okay, so it's not amazingly obfuscated, but it does work. I've converted it to a midi file and it does play.
The tune is Still Alive from Portal. I got the tune as a midi file from here, which I then converted into a RTTL. The last few notes are off, but I think that's okay.
print[':d=4,o=5,b=120:2p,8g,8f#,8e,8e,2f#,1p,8a4,8g,8f#,8e,e,f#.,d,8e,1a4,8p,8a4,e,8f#,g.,8e,c#,d.,e,8a4,a4,1f#,2p,8g,8f#,8e,8e,2f#,1p,8a4,8g,8f#,8e,e.,8f#,d.,8e,2a4,2p,e,8f#,g.,8e,c#.,8d,e,8a4,8d,8e,8f,8e,8d,8c,p,8a4,8a#4,c,f,8e,8d,8d,8c,8d,8c,c,c,8a4,8a#4,c,f,8g,8f,8e,8d,8d,8e,f,f,8g,8a,8a#,8a#,a,g,8f,8g,8a,8a,g,f,8d,8c,8d,8f,8f,e,8e,8f#,8f#,8a,8d6,8f#6,8d6,8b,8d6,8f#6,8d6,8a,8d6,8f#6,8d6,8b,8d6,8f#6,8d6,8a,8d6,8f#6,8d6,8b,8d6,8f#6,8d6,p.,8a4,8g,8f#,8e,8e.,2f#,1p,8a4,8g,8f#,8e,e.,8f#,d,e,2a4,2p,e,8f#,g.,e,c#,8d,e.,8a4,a4,2f#,2p,8a4,8p,8b,8p,8a,8p,8g,8p,8g,8p,a,1p,8a4,8p,8b,8p,8a,8p,8g,8p,g.,p.,8a,8p,f#.,p.,8g,8p,2d,2p,e,8f#,g.,e,c#,8d,e,8a4,8d,8e,8f,8e,8d,c.,8a4,8a#4,c,f,8e,8d,8d,8c,8d,8c,c,c,8a4,8a#4,c,f,8g,8f,8e,8d,8d,8e,f,f,8g,8a,8a#,8a#,8a,8a,g,8f,8g,8a,8a,8g,8f,f,8d,8c,8d,8f,8f,e,8e,8f#,2f#,1p,8a4,8g,8f#,8e,8e.,2f#,1p,8a4,8g,8f#,8e,e.,8f#,d,e,2a4,2p,e,8f#,g.,e,c#,8d,e.,8a4,a4,2f#,2p,8a4,8p,8b,8p,8a,8p,8g,8p,8g,8p,a,1p,8a4,8p,8b,8p,8a,8p,8g,8p,g.,p.,8a,8p,f#.,p.,8g,8p,2d,2p,e,8f#,g.,e,c#,8d,e,8a4,8d,8e,8f,8e,8d,c.,8a4,8a#4,c,f,8e,8d,8d,8c,8d,8c,c,c,8a4,8a#4,c,f,8g,8f,8e,8d,8d,8e,f,f,8g,8a,8a#,8a#,8a,8a,g,8f,8g,8a,8a,8g,8f,f,8d,8c,8d,8f,8f,e,8e,8f#,8f#,2a,8p,8a,8a,512p,8a,512p,8b,512p,8a,512p,8f#,512p,d,p,8g,8p,8a,8p,2a,8p,8a,8a,512p,8a,512p,8b,512p,8a,512p,8f#,512p,d,p,8g,8p,8a,8p,2a,8p,8a,8a,512p,8a,512p,8b,512p,8a,512p,8f#,512p,d,p,8g,8p,8a,8p,2a,8p,8a,8a,512p,8a,512p,8b,512p,8a,512p,8f#,512p,d,p,8g,8p,8a,8p,2a,8p,8a,8a,512p,8a,512p,8b,512p,8a,512p,8f#,512p,d,p,8g,8p,8a,8p,a.,p.,8g,8a,a.,p.,8g,8f#,2f#',''.join(map(chr,[72,101,108,108,111,44,32,87,111,114,108,100,33]))][1]

Looks like it switched around the melody and backing/counter-melody parts in various places. There might be a version with just the melody somewhere.

Um.. your program doesn't seem to be a valid RTTTL song

@aditsu The only way I can check if its valid is by converting it to a midi file, so uh... you'll have to tell me how it's invalid.

Well, 2f#' doesn't seem to be a valid note, and neither is ''.join(map(chr, etc.

@aditsu I can not locate any documentation on RTTTL that suggests such characters are invalid. I don't know how to load it into a phone, but I can convert the entire code to a midi file and that plays without crashing.

It's right here in the challenge text: "The format of a note is DPO, where D is the duration of the note […]" - read the whole paragraph.

Lenguage
Hello: d=8,o=4,b=130: a, b, 4e5, a, b, 4e5, g, b, 4e5, g, b, 4e5, f, a, 4e5, f, a, 4e5, g, b, 4e5, f, a, 4e5, a, b, 4e5, a, b, 4e5, g, b, 4e5, g, b, 4e5, f, a, 4e5, f, a, 4e5, g, b, 4e5, f, a, e5, e, 4e, a, 4a., b, 4b., c5, 4c.5, 4d.5, 4c5, 2d5, p, g, b, 4e5, f, a, e5, e, e, 4a, 4a, 4b, 4b, 4c5, 2c5, b, c5, 4b, 2a, p, g, b, 4e5, f, a, e5, e, 4e, a, 4a., b, 4b., c5, 4c.5, 4d.5, 4c5, 2d5, p, g, b, 4e5, f, a, e5, d5, 2e5, a, b, 4e5, g, b, 4e5, g, b, d5, c5, e5, 4d.5, d5, c5, 4e5, a, c#5, 4e5, a, c#5, d5, e5, f5, e5, e5, d5, 2d5, g, b, 4d5, g, b, c5, d5, e5, d5, d5, c5, c5, g, 4a, f, a, 4c5, f, a, a#, c5, 4d.5, 4c.5, c5, a#, 4a, 2g#, f#, g#, 4a, a, 4b, a, 4c5, a, c5, 4e5, a, c5, d5, e5, 4f5, f5, 4f5, e5, 4d5, g, b, 4d5, g, b, c5, d5, 4e5, f5, 4e5, d5, c5, g, 2a, f, a, a#, c5, 4d5, c5, 4c5, 4a#, 4a, 2g#., 2p., p, f#, g#, 2a, a, b, 4e5, g, b, 4e5, g, b, 4e5, f, a, 4e5, f, a, 4e5, g, b, 4e5, f, a, 4e5, 4a, 4c#5, 1e5

Followed by many gazillions of spaces so that the total length is 150306725405247424813082671095009555930972306375297366901721134222563463360025683976401363734706798738542991492
Convert and download (note: the code is truncated to save bandwidth, but the resulting midi should be the same)

Lionel Richie - "Hello" ?

@LukStorms yes! :)

source: Stack Exchange

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

sort: votes


text:
Standard loopholes only
So, you're browsing Programming Puzzles & Code Golf, and you see a new challenge. The author (gasp) forgot to say "No standard Loopholes". You decide to take advantage of this situation, and you read the answer from a file/network. However, you need to make sure that your answer is actually shorter than the legitimate answers, so you golf it, too.
The Challenge
Write a complete program that prints out the contents of the file definitelynottheanswer.txt to STDOUT. This text file only contains valid ASCII characters. Alternatively, the program can get the file location from STDIN or command line args. The only input allowed is the file location if you choose to get the location from the user; otherwise, no input is allowed. There is no reward for getting the file location from the user, but the user input of the file location does not count against the byte total (in other words, definitelynottheanswer.txt wouldn't be included in the byte score).
The program must not write to STDERR.
Bonus
Retrieve the file from the internet instead of a file (the URL must be user-supplied). Reward: multiply source length by 0.85
Scoring

This is code-golf, so the lowest score,program length (bytes) * bonus, wins.
No (other) standard loopholes.
If the language does not support reading files from disk, it cannot be used (sorry).

So the task is... read a file?

No- it's "getting the solution from an external source" .
This idea sounded a lot better when I was writing it...

I'll try writing my next one earlier than 11 pm

I recommend using the Sandbox for future challenges. That way you can get feedback before the challenge is posted.

It should be noted that if a poster doesn't say "No standard loopholes" in their question, they are still forbidden by default unless the OP explicitly allows them.

How many only use standard loopholes have their been in the past? It seems like there have been many

@BetaDecay I searched it and there wasn't anything similar in the first few pages.

I'm voting to close this question as off-topic because it is [tag:underhanded].

I'm voting to close this question as off-topic because this is basically like code-trolling, but without the tag.

GNU sed, 0 bytes

Even better..

Right tool for the job.

Well, this is the shortest it can go...

@DanielM. No, you could make one that's so short it closes the console window, which would make it -1 bytes... not really

Bash, 7 bytes * .85 = 5.9 bytes
curl $1

zzz

Pyth - 2 bytes * .85 = 1.7
'z

Does not work online.

Bash, 6 bytes
cat $1

Provide filename as a command line argument. Probably breaks if the argument contains spaces or newlines or weird chars or whatever.

CJam, 1.7 bytes
qg

For security reasons, this does not work in the online interpreter.

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


text:
Transpose columns in table
Let's say you've got a table of data:
meter_id date   0000 0600 1200 1800
0        030915 10   20   30   40
1        030915 15   7    49   2

where the last four columns are meter readings at different times. You want to output
meter_id date   time reading
0        030915 0000 10
0        030915 0600 20

etc.
Your input and output will not have headers, unlike in this example. The set of columns you'll transpose will be provided as numeric arguments to your program, from 1 onwards. Input is stdin and output is stdout.
So here's an example of it actually being used.
$ ./tpose 3 4 5 6

Stdin:
0        030915 10   20   30   40
1        030915 15   7    49   2

Stdout:
0       030915  3       10
0       030915  4       20
0       030915  5       30
0       030915  6       40
1       030915  3       15
1       030915  4       7
1       030915  5       49
1       030915  6       2

The third column contains values from 3 to 6. This is because the reading is from columns 3 to 6 from the input table.
Happy golfing.

Can you post some example inputs and outputs?

Is 0600 30 in the example just wrong (1200 is 30), or are you trying to do cumulative readings (so adding the current 20 to the previous 10)?

@Geobits Fixed.

You say in the text that the values in the third column of the output are 3 to 6, but they are actually 2 to 5. Which one is right? Right now, it looks like you're using 1-based column indices in the input, and 0-based in the output.

@RetoKoradi fixed

Can the input and output columns be separated by a single space? Or a single tab?

@kirbyfan64sos whichever

Do the columns to be transposed always form a contiguous range? Can other columns appear after them? If yes, where should the transposed columns appear in the output? Are the columns to be transposed always given in ascending order, and can they contain the same column twice? And if so, can we reorder them in the output, or collapse duplicates?

@IlmariKaronen The argument is a list of individual columns. They do not have to be contiguous. The new columns should be at the end. As far as the same column being supplied twice, that case is pathological and you don't need to worry about that.

@IlmariKaronen Order is otherwise unimportant.

not to be pedantic, but isn't the more normalizing than transposing?

Can we take the table as an argument instead of from stdin?

Can we assume the input table's records are unique?

@Adám I'd prefer it from stdin. You can assume the records are unique.

@manandlaptop How about as JSON (or other format) from stdin? Or via stdin getting a filename to read from?

@Adám JSON, no. Getting a filename from stdin, if it helps, you may do that.

Does the list of column numbers have to come from the command line, or can it be a function argument?

Can you give an example of what is permitted when the selected columns are not contiguous?

@dfeuer What in numeric arguments to your program makes you think that function arguments are disallowed?

@Adám, nothing. I just noticed almost all the answers used command line arguments.

kdb k, 101 bytes
1@"\n"/:{"\n"/:{" "/:(r@&{~#&x=a}'!#r),(,$1+a@x),,c@x}'!#c::(r::" "\:x)@a::-1+.:'.z.x}'-1_"\n"\:0::0;

Me: (reads the word "transpose" in the title) K will be perfect for this! It'll kick everything else's hind!
20 minutes and 101 bytes later
Me: Idiot.

Ruby, 88 84 bytes
Input is tab-separated. Annoyingly, Ruby gets pulls from files whose names match those from ARGV, but those don't exist so the program errors out. To work around this, I have to use STDIN.gets to get the actual correct input.
-4 bytes by remembering that I don't actually need to use scan since I'm only matching the pattern once per line anyways, so =~ for a single regex match saves bytes.
($_=~/(\d+	\w+	)(.*)/;i=-1;puts$2.split.map{|s|"#$1#{$*[i+=1]}	"+s})while STDIN.gets

Try it online!

Haskell (195 bytes)
import System.Environment
main=do s<-getArgs>>=return.map(\a->read a-1);interact$unlines.map unwords.t s.map words.lines
t g r=[[a!!j|j<-[0..length a-1],not$j`elem`g]++show(j+1):[a!!j]|a<-r,j<-g]

Ungolfed Haskell (398 bytes):
import System.Environment
import Prelude

main = do js <- getArgs >>= return . map (\a -> read a - 1)
          interact $ unbr . (`tpose` js) . br

br = map words . lines

xs `excludingFrom` es = [xs !! j | j <- [0..length xs - 1], not $ j `elem` es]

tpose rows js = [row `excludingFrom` js ++ [show (j+1)] ++ [row !! j] | row <- rows, j <- js]

unbr = unlines . map (foldr1 $ \t a -> t++"\t"++a)

p>>=return.f should generally be written f<$>p. In this case, though, you can golf more by just using s<-getArgs and applying the parsing inline. Since you use map three times, you should write m=map on its own line and use that.

Perl 5, 87 bytes
perl -E'while(<STDIN>){@f=(0,split);@i=0..$#f,@i[@ARGV]=0;say"@f[grep$_,@i] $_ $f[$_]"for@ARGV}'

PHP, 90 bytes
while($r=fgetcsv(STDIN,0,' '))foreach($argv as$a)if($a|0)echo"$r[0] $r[1] $a {$r[$a-1]}
";

Input and output with single space delimiter.
Try it online!
PHP, 109 bytes
while($r=preg_split("/\s+/",fgets(STDIN),0,1))foreach($argv as$a)if($a|0)echo"$r[0]\t$r[1]\t$a\t{$r[$a-1]}
";

Or with I/O exactly as shown above, using fixed width columns.
Try it online!

APL (Dyalog Unicode), 56 bytesSBCS
Anonymous prefix lambda. Takes column numbers for "transposition" as right argument and prompts via stdin for filename of table.
{(t[;⍵~⍨⍳≢⍉t]⌿⍨≢⍵),(⍪,⍨⍵⍴⍨≢),t[;⍵]⊣t←↑(∊∘⎕D⊆⊢)¨⊃⎕NGET⍞1}

Try it online!
{…} "dfn"; right argument (column numbers) is ⍵:
 ⍞1 prompt for file name from stdin and juxtapose with 1 (indicating that we want a list of strings)
  ["tpose",1]
 ⎕NGET get the native file's (content,encoding,newline)
  [["0 030915 10 20 30 40","1 030915 15 7 49 2"],"UTF-8-NOBOM",[10]]
 ⊃ pick the first of those (content)
  ["0 030915 10 20 30 40","1 030915 15 7 49 2"]
 (…)¨ apply the following tacit function to each line:
  ∊ the characters that are members
  ∘ of
  ⎕D the set of digits
   [[1,0,1,1,1,1,1,1,0,1,1,0,1,1,0,1,1,0,1,1],[1,0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,0,1]]
  ⊆ indicate the sub-partitions of
  ⊢ the line
   [["0","030915","10","20","30","40"],["1","030915","15","7","49","2"]]
 ↑ up the rank by mixing the list (rank 1) of lists into a matrix (rank 2)
  [["0","030915","10","20","30","40"],
   ["1","030915","15","7" ,"49","2" ]]
 t← assign that to t (for table)
 ⊣ discard that in favour of
 t[;⍵] all rows of the subset of columns of t enumerated in the argument
  [["10","20","30","40"],
   ["15","7" ,"49","2" ]]
 , ravel (flatten that)
  ["10","20","30","40","15","7","49","2"]
 (…) apply the following tacit function to that:
  ≢ the tally of elements
   8
  ⍵⍴⍨ use that to reshape the number of columns to be "transposed"
   [3,4,5,6,3,4,5,6]
 ,⍨ to that, append
 ⍪ the table-fied (made into single-column table) argument (the "transposed" columns)
  [[3,"10"],
   [4,"20"],
   [5,"30"],
   [6,"40"],
   [3,"15"],
   [4,"7" ],
   [5,"49"],
   [6,"2" ]]
 (…), prepend the following:
  ≢⍵ the tally of columns to be "transposed"
   4
  …⌿⍨ use that to vertically replicate the rows of…
   t[;…] all rows of the following columns of the table:
    ⍉t transpose the table
     [["0"     ,"1"     ],
      ["030915","030915"],
      ["10"    ,"15"    ],
      ["20"    ,"7"     ],
      ["30"    ,"49"    ],
      ["40"    ,"2"     ]]
    ≢ the tally of rows
     6
    ⍳ ɩndices until that
     [1,2,3,4,5,6]
    ⍵~⍨ except the "transposed" column numbers
     [1,2]
   [["0","030915"],
    ["1","030915"]]
  [["0","030915"],
   ["0","030915"],
   ["0","030915"],
   ["0","030915"],
   ["1","030915"],
   ["1","030915"],
   ["1","030915"],
   ["1","030915"]]
 [["0","030915",3,"10"],
  ["0","030915",4,"20"],
  ["0","030915",5,"30"],
  ["0","030915",6,"40"],
  ["1","030915",3,"15"],
  ["1","030915",4,"7" ],
  ["1","030915",5,"49"],
  ["1","030915",6,"2" ]]

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


text:
Time-Sensitive Echo
Background
The echo program is so neat. You can say anything to it, and it repeats your words perfectly, every time! How cool is that! Disappointingly, it repeats the input all at once, regardless of your typing speed, which is not very realistic. We'll have to fix that.
The Task
Your program shall take its input from STDIN or closest equivalent.
It shall read lines from the user one by one, possibly displaying some prompt, until they enter an empty line.
After that, it shall print the lines to STDOUT or closest equivalent, in the same order as they were given.
The last (empty) line is not printed, and the last printed line doesn't need to have a trailing newline.
Additionally, the program shall preserve the time intervals between each line: if it took the user x seconds to enter a line, it shall take x seconds for the program to print it.
This applies to the first and last lines too; the empty line is not printed, but the program waits anyway before terminating.
Example
Here's an example session with the program.
All actions that don't produce text are described in brackets, and the (optional) prompt is displayed as >.
[begin program]
> fhtagn[enter; 1.48s passed since starting program]
> yum yum[enter; 3.33s passed since previous enter]
> so cool![enter; 2.24s passed since previous enter]
> [enter; 0.23s passed since previous enter]
[wait 1.48s]fhtagn
[wait 3.33s]yum yum
[wait 2.24s]so cool!
[wait 0.23s, then end program]

Without the actions, the session looks like this:
> fhtagn
> yum yum
> so cool!
>
fhtagn
yum yum
so cool!

Rules and Scoring
The waiting times should be accurate to within 0.01 seconds (in practice, if the average human can't tell the difference, you're fine).
The lowest byte count wins, and standard loopholes are disallowed.
If your language has a built-in function for precisely this task, you may not use it.

Next step up: Golf a program that plays a basic rhythm game :P

Can we disregard the time the program takes to output characters? I mean, If I can measure that my language takes 0.1 sec to output a char, should I take it into account? Full disclosure, I'm planning to use ><> interpreters' tick time to implement the delay ; in this case, can I have a loop elapsing the input time then disregard the time elapsed by my display loop?

@AaronGOUZIT I'll allow that, as long as you're consistent: either the time intervals between the moments your program begins to print a line are all taken from the user, OR the waiting times between finishing printing a line and beginning to print the next are all taken from the user.

if it took the user x seconds to enter a line, it shall take x seconds for the program to print it. - does this mean character by character with pauses in between, or print line / pause / print line / pause ?

@TessellatingHeckler The latter; see the example session.

How is typing so cool! shorter than typing yum yum?  :)

@KritixiLithos I only used my right hand for yum yum, which was rather cumbersome.

CJam, 45 41 39 36 34 bytes
{eslN1$}g;es](es-fm3/{){_es>}g;o}/

This doesn't really make sense in the online interpreter of course, but it works in the Java interpreter.
It doesn't display a prompt.
Explanation
{        e# Do while... (popping the condition from the stack)
  es     e#   Get the current timestamp.
  l      e#   Wait for a line to be entered and read it.
  N      e#   Push a linefeed.
  1$     e#   Copy the line we read - this terminates if the line is empty, because
         e#   empty strings/arrays are falsy.
}g
;        e# Discard the last linefeed (the one after the empty input).
es       e# Push the current timestamp (corresponding to the last, empty, input).
]        e# Wrap everything in an array. This is now a flat array containing:
         e#   - The initial timestamp.
         e#   - Three elements for each line: the line, a linefeed, the timestamp.
         e#   - Two elements for the last line: the empty string and the timestamp.
(        e# Pull off the initial time.
es-      e# Subtract the current time, which gives (minus) the difference between
         e# when a line was entered and when it should be printed back.
fm       e# This maps "minus that value" onto each element in the array. Now the lines
         e# and linefeeds are strings (arrays) - so minus is set difference, but they
         e# only contain characters, not any integers (like the difference value), so
         e# none of the strings will be affected.
         e# The timestamps on the other hand will be incremented by the time difference
         e# between reading and printing, giving the time at which each line should be
         e# printed back.
3/       e# Split the array into chunks of 3 (where the remaining two elements are
         e# just grouped as a pair).
{        e# For each of those chunks...
  )      e#   Pull off the timestamp.
  {      e#   Do while... (popping the condition from the stack)
    _    e#     Duplicate the target time.
    es>  e#     Check if it's still greater than the current time.
  }g
  ;o     e# Discard the target time and print the rest of the current chunk, which will
         e# automatically be flattened/concatenated into a single string.
}/

JavaScript, 119 112 bytes
k=(d=Date.now)(i=j=[]);do{i[++j]=[prompt(),d()-k]}while(i[j][0]);i.map(a=>setTimeout(b=>console.log(a[0]),a[1]))

Hoping to find a couple more bytes to cut out.

You could save a couple of bytes with j=i=[] (++ will still work!) also, your while doesn't need !='' as it's falsy! So disappointed I missed map! +1

Good note on the !=''. Was concerned if the input was 0, but it seems to handle that fine. I had noticed the [] increment possibility before, but I had been silly and tried to do j++ with it. Doing ++j works, since []++ is apparently 0 XD Thanks!

Mark this the day that I learnt that there were do...while loops in JS

JavaScript, 120 bytes
No chance of getting near to CJam with this approach, but a straightforward script.
a=[];t=+new Date;while(s=prompt()){a.push({s:s,t:+new Date})}while(v=a.pop()){setTimeout(`console.log('${v.s}')`,v.t-t)}

Seems we both went for JS at the same time haha, though you got yours in a little before mine. Still, different approaches.

@Mwr247 Indeed, yours is more elegant though!

Ruby, 74
t,*a=Time.now
a<<[$_,t-t=Time.now]while$/<gets
a.map{|l,i|sleep -i;puts l}

Tricks: *a on the first line initalizes an empty array. I could use $* instead but it's mildly sketchy since it's populated with some invocations and only saves me a byte. $/ is a newline, and $_ is the last line retrieved by gets.
Edit: Sleeping at the end costs 20 more bytes, probably a way to golf it down
t,*a=Time.now
a<<[$_,t-t=Time.now]while$/<gets
t-=Time.now
a.map{|l,i|sleep -i;puts l}
sleep -t

I think you need to sleep on the last line, depending on how long it took the user to provide an empty line.

For sleeping at the end (solution 2), you call Time.now enough times that using def n;Time.now;end, saving a whole 2 bytes

Pyth, 68 bytes
M&p+Gb$__import__('time').sleep(H)$J].dZWeaYwaJ.dZ)aJ.dZp&gVPY-VtJJk

Wasted a lot of bytes on the call to sleep, since Pyth has no sleep function.

Maybe you should suggest that as an addition to Pyth.

I believe you have an off-by-one error in the waiting. Try starting the program, waiting around, then typing something and press enter twice rapidly. It will immediately print the first line, then wait a while before terminating.

SWI-Prolog, 185 bytes
a:-b([],S),reverse(S,T),c(T),!.
b(R,S):-get_time(X),read_string(user_input,"\n","",_,A),get_time(Y),Z is Y-X,(A="",S=[A:Z|R];b([A:Z|R],S)).
c([A:Z|T]):-sleep(Z),T=[];(write(A),nl,c(T)).

There is probably a lot to golf here but this will do for now...

Python 3, 124
Only works on Windows platforms
from time import*
s=[(1,clock())]
while s[-1][0]:s+=[(input(),clock()-s[-1][1])]
[sleep(y)or x and print(x)for x,y in s[1:]]

Keeping the input and times in separate lists cost me 3 more bytes. Probably not the best approach.
An 129 byte Unix friendly version, with credit to Mego:
from time import*
t=time
s=[(1,t())]
while s[-1][0]:s+=[(input(),t(),t()-s[-1][1])]
[sleep(y)or x and print(x)for x,z,y in s[1:]]

Can't you use time() instead of clock() to save 2 bytes?

PowerShell, 261 190 121 95 Bytes
$(do{Measure-Command{$l=read-host};$l}while($l))|%{($_,(sleep -m($_.Ticks/1e4)))[($b=!$b+!$_)]}

Props to TessellatngHeckler and tomkandy for the golfing assistance and inspiration
This is very similar in concept to the 121-byte version below, we're just dynamically creating and building a list of objects, instead of going through a while loop to store them into an explicit array $a. In both cases, that list of objects gets pipelined into the same foreach loop |%{...}. The indexing into the result-array-selector ($b=!$b+!$_) is this time formulated to eliminate the if($_){$_} of the below iterations, which saves a few more bytes.

Previous, 121 Bytes
$l,$a=1,@();while($l){$t=Measure-Command{$l=read-host};$a+=$t,$l}$a|%{($(if($_){$_}),(sleep -m($_.Ticks/1e4)))[($b=!$b)]}

Expanded and explained:
$l,$a=1,@()                        # Set variable $l and create array $a
while($l){                         # So long as we don't have a blank line
  $t=Measure-Command{$l=read-host} # Read the input and measure time to input
  $a+=$t,$l                        # Add those values into the array
}
$a|%{                              # For each item in $a, do
  ($(if($_){$_}),(sleep -m($_.Ticks/1e4)))[($b=!$b)]
  # Magic happens here ... first, we set $b to the NOT of it's uninitialized
  # value, so $b is initially set to truthy
  # This value in [...] selects which of the two elements ( , ) get selected
  # Truthy to start means the second command, sleep, gets chosen first, and
  # then it alternates every next item, so it sleeps, then prints, then
  # sleeps, then prints, etc., until we run out of $a
}

Previous-er, 190 Bytes
function f {param($m)sleep -m $a[$m].totalmilliseconds}$a=1,1;while($a[-1]-ne""){$a+=Measure-Command{$b=read-host};$a+=$b}if(!($a[3])){f 2;exit}$i=2;while($i-lt$a.length){f($i++);$a[($i++)]}

function f {                        # Define a new function
  param($m)                         # with $m as input
  sleep -m $a[$m].totalmilliseconds # sleep for $a[$m] milliseconds
}
$a=1,1                              # Create new array with two elements
while($a[-1]-ne""){                 # While the last element isn't empty
  $a+=Measure-Command{$b=read-host} # Read into $b and measure how long that took,
                                    # and add the time into $a
  $a+=$b                            # Then add the input into $a
}
if(!($a[3])){                       # If the third element is empty, the user entered
                                    # a blank as the only input, so...
  f 2                               # sleep for $a[2] ms (how long it took them to hit enter)...
  exit                              # and exit the script
}                                   # Else ...
$i=2                                # Set a counter variable
while($i-lt$a.length){              # While we haven't reached the end of $a
  f($i++)                           # Sleep
  $a[($i++)]                        # Write the output
}

Previous-er-er, 261 Bytes
$a=$d=@();$d+=,@(date);$x=Read-Host
while($x){$a+=,@($x);$d+=,@(date);$x=Read-Host}
if($x){0..($a.Length-1)|%{sleep -m((($d[$_+1]).ticks-($d[$_]).ticks)/1e4);$a[$_]};sleep -m((($d[-1]).ticks-($d[-2]).ticks)/1e4)}
else{sleep -m(((date).Ticks-($d[0]).Ticks)/1e4)}

Holy verbosity, Batman! Let's break it down:
$a=$d=@()                  # Create two empty arrays
$d+=,@(date)               # Add the current time into $d
$x=Read-Host               # Read the first line
while($x){                 # So long as it's not empty
  $a+=,@($x)               # Add it into our output array
  $d+=,@(date)             # Add the current time into $d
  $x=Read-Host             # Get the next line
}
if($a){                    # So long as $a exists (i.e., the first input wasn't blank)
  0..($a.Length-1)|%{      # For-loop over the length
                           # Sleep for how long it took to do input
    sleep -m((($d[$_+1]).ticks-($d[$_]).ticks)/1e4)
    $a[$_]                 # Print out the input
  }
                           # Sleep the length it took for the final blank
  sleep -m((($d[-1]).ticks-($d[-2]).ticks)/1e4)
}
else{
                           # If we're here, the initial input was blank, so just sleep
  sleep -m(((date).Ticks-($d[0]).Ticks)/1e4)
}

144 $a=1,1;while($a[-1]-ne""){$a+=Measure-Command{$b=read-host};$a+=$b};$i=2;while($i-lt$a.length){sleep -m $a[($i++)].totalmilliseconds;$a[($i++)]}

@tomkandy Thanks! Updated with improvements.

@TessellatingHeckler Excellent! I was struggling with a way to control the alternating effectively, and indexing into an array like that is the obvious choice now that I see it. Incidentally, I golfed another byte by removing the @ from that array, as it's not needed in this context, so down to 121.

@TimmyD what I was trying for yesterday was to put ($t,$l) pairs into $a making a nested array. I couldn't make it work, but today I could and it helps a bit because there's no need to toggle, just read every pair and use them. Then I realised - we have a perfectly good pipeline which can queue things, why keep an array at all? $($l=1;while($l){Measure-Command{$l=read-host};$l})|%{($_,(sleep -m($_.Ticks/1e4)))[($b=!$b+!$_)]} - and with a change to the toggle, so that when the string is empty it doesn't toggle, and sleeps instead - 98

(Make it a do{...}while($l) loop and drop $l=1; to get 95)

Perl 6, 70 characters
repeat {$/=now;.push($!=get,now -$/)}while $!;.map:{sleep $^b;say $^a}

Perl 6 interpreter only defines three symbolic variables (unlike the craziness of Perl 5). To be exact, $/, $!, and $_. This program uses them all, to avoid the cost of declaring variables using my.
get reads a line from STDIN. It doesn't contain a newline, unlike Perl 5.
now builtin returns a current time. When subtracted, it gives an interval that can be passed to a string.
A method with nothing on the left of it (like .push and .map in this code) works on $_.
Using repeat while loop (known as do while in other programming languages), Perl 6 is writing current timestamp to $/, and pushes the received line (which it also stores to $!), and difference between current time and timestamp in $/. Because of parameter order, now is not calculated until a line is received.
The while condition checks if the line is not empty (in Perl 6, "0" is a true value, unlike Perl 5).
After I get all timestamps and lines, I just provide those to map callback which sleeps a bit and says what was said.

MATLAB, 107 99
tic;a={};i=1;while nnz(i);i=input('','s');a=[a;{i,toc}];tic;end;for b=a';pause(b{2});disp(b{1});end

And ungolfed:
tic; %Start timer
a={};
i=1; %Make us enter the while loop
while nnz(i); %While i has some non-zero elements (this is used to detect a zero length input where we end)
    i=input('','s'); %Get an input string
    a=[a;{i,toc}]; %Append the string and current time as a new cell in a
    tic; %Restart timer
end
for b=a' %For each input
    pause(b{2}); %Wait for the required time
    disp(b{1}); %Then print the string
end

This won't be 100% accurate in timing as it doesn't account for the time taken to display each string but that should be pretty quick so timing-wise it should be pretty close.

After a quick revisit, I've saved a few bytes by removing the double layer deep cell array. Turns out all I needed was a ; to get it to split up correctly when packing.

Maybe you could make a version that's golfed in MATL.

Groovy, 202 bytes
def b={System.currentTimeMillis()};def h=[];for(;;){def t=b();def s=System.console().readLine();h.add(s+" "+(b()-t));if(s=="")break};for(def s:h){Thread.sleep((s=s.split(" "))[1].toLong());println s[0]}

Radical.
Ungolfed version:
def b = {System.currentTimeMillis()}; // Creates a closure (short function) b that returns the current time since the epoch in milliseconds.
def h = []; // Makes an empty list
for(;;) { // Infinite loop
  def t = b(); // Get the time
  def s = System.console().readLine(); // Read a line
  h.add(s + " " + b()-t); // Add the string plus the amount of time elapsed to the list
  if(s=="") // If the string is blank
    break; // Exit loop
}
for(def s : h) { // Iterate through array
  Thread.sleep((s=s.split(" "))[1].toLong()); // Splits s into an array and puts the value in s, then takes the second element (the time), converts into a long and sleeps for that time.
  println s[0] // Print the first element (text)
}

JavaScript (ES6) 102
Putting together the efforts of Mwr247 and Dom Hastings (CW)

/* for TEST */ console.log=x=>O.innerHTML+=x+'\n'

for(k=new Date,i=[];p=prompt();i.push([p,new Date]));i.map(a=>setTimeout(b=>console.log(a[0]),a[1]-k))

Java, using version 1.04 of this library, 385 bytes
import sj224.lib.util.*;import java.util.*;class E{static long t(){return System.currentTimeMillis();}public static void main(String[]a) throws Exception{List<Pair<?,Long>>l=new ArrayList();Scanner i=new Scanner(System.in);while(true){long t=t();String s=i.nextLine();if(s.isEmpty())break;l.add(new Pair(s,t()-t));}for(Pair<?,Long>p:l){Thread.sleep(p.two);System.out.println(p.one);}}}

Caché ObjectScript, 123 bytes
w() q $P($ZTS,",",2)
r f  s i=i+1,t=$$w() r x,! q:x=""  s g(i,x)=$$w()-t
    f i=1:1 s s=$O(g(i,"")) q:s=""  w s,! h g(i,s)
    q

As usual, this assumes a clean symbol table before running d r.
This problem cannot be solved in ANSI MUMPS, since the ANSI standard only requires second-level resolution for the time intrinsic $H[OROLOG]. Luckily, Intersystems Caché, which is currently the industry-leading platform for MUMPS, provides the implementation-defined $ZT[IME]S[TAMP] intrinsic, which provides microsecond-level resolution.
(Score was formerly 105 bytes, but there was a bug.)

VBA , 233 228bytes
I'm Sure this can be golfed a lot. they didn't specify how many inputs so i hard coded my array lengths because its shorter then Redim preserve.
Input is via popup, output is debug.print because msgbox produces a MODAL and halts code.
I don't know how to test if this is accurate to the 0.01s. Maybe someone can test but I am giving the wait command the number in a way that it SHOULD use the milliseconds, But VBA isn't known for doing what it should.
The If goto may be able to be substituted by a well golfed Do Loop While.
Sub a()
Dim k(99) As String
Dim h(99) As Date
b:
t=Now()
i=i+1
k(i)=InputBox("")
h(i)=Now()-t
If k(i)<>"" Then GoTo b
For u=1 To i
Application.Wait (Now()+(Format(h(u),"s")&Format(h(u),"ms"))/10^8)
Debug.Print k(u)
Next
End Sub

Will not work in Access VBA, because access doesn't have a wait command because Microsoft hates consistency

Bash, 91 90 bytes
while r=`\time -fsleep\ %e head -1`
[[ $r ]]
do printf{,\ %%b\ %q\;} "$r
"
done>t 2>&1
. t

This creates a temporary file t. It will overwrite an existing file with the same name.
The idea itself is pretty short, but dealing with special characters in the input adds around 15 bytes...

Bash, 22 bytes
nc -l 3|nc localhost 3

Then type in the input and press enter.

C++ 11, 343 338 bytes
Wanted to see how many bytes a code for that in c++ would need. A lot more than I expected. Maybe I over complicated the solution.
#include<iostream>
#include<vector>
#include<chrono>
int i;using namespace std;int main(){auto n=chrono::system_clock::now;auto t=n();string s{1};vector<string>r;vector<decltype(t-t)>w;while(s.size())getline(cin,s),r.push_back(s),w.push_back(n()-t),t=n();while(i<r.size()){while((n()-t)<w[i]);t=n();cout<<r[i++]<<(i<r.size()-1?"\n":0);}}

Lets see if I can reduce this somehow.

You can remove the spaces in the #includes and the type declaration for main. That's 7 bytes--not much, but a start. You might also be able to use auto rather than string for s.

Thanks for the feedback. I will keep the return type for the main. If I remember correctly, only for c that we dont have to specify it. I tried initially to use auto s... but looks like it is converted to const char * and not std::string. I wonder if I can create an alias for while.

Removing the return type works for C++ even though it "shouldn't" per the standard. You could try creating an alias for while using a #define maybe.

SmileBASIC, 122 bytes
DIM A$[0],T[0]@L
C=MAINCNT
LINPUT S$PUSH A$,S$PUSH T,MAINCNT-C
IF""<S$GOTO@L@P
WAIT SHIFT(T)IF""<A$[0]THEN?SHIFT(A$)GOTO@P

I think this could be made slightly shorter.

C UNIX, 272 bytes
#include <stdio.h>
#include <unistd.h>
#define P printf
i;r;c;main(){char*L[99]={0};size_t s;long T[99]={0};while(1){P(">  ");T[c]=time(0);r=getline(&L[c],&s,stdin);T[c]=time(0)-T[c];if(r==-1|!(*L[c]-10))break;c++;}while(i<c){P("> ");usleep(T[i]*1000);P("%s", L[i]);i++;}}

Detailed
#include <stdio.h>
#include <unistd.h>

int main(void)
{
    int i = 0, c = 0, r;
    char * L[99] = {0};
    size_t size;
    long T[99] = {0L};

    while(1)
    {
        printf("> ");
        T[c] = time(0);
        r = getline(&L[c], &size, stdin);
        T[c] = time(0) - T[c];
        if(r == (-1)) break;
        if(*L[c]=='\0' || *L[c]=='\n') break;
        c = c + 1;
    }

    while(i < c)
    {
        printf(" %ld > ",T[i]);
        usleep(T[i]*1000);
        printf("%s", L[i]);
        i = i + 1;
    }

    return 0;
}


text:
How are you doing?
Martin has created a nice snippet that can be used to keep track of the score for answers to challenges. That's great and all, but wouldn't it be better if you could keep track of it yourself?
Create a program that compares the byte counts in itself with the rest of the answers to this question, and returns "I'm answer number n".
Rules:

The byte count in your own answer can be hardcoded in the code
The function can take the url as input, or it can be hardcoded. The chars for the url will not count toward the byte count, so it's not necessary to use a url-shortener.
url-addresses to answers cannot be hardcoded
The score for the answers can be found from the header, (the same way Martin's snippet does).
The answer header must have the correct format (described below).
If it's possible to run the program online, please share a link to an online compiler (or a code snippet that can be executed from the answer). If it's not possible, please show how to call the function, and show the output from your own compiler (at the time you posted the answer. You don't need to update it unless you want to of course).
You have to actually compare the answer with the other answers to this question. Simply writing a script I'm answer number 1. in some language is not legal.
If other answers have the same number of bytes as your own, you can choose if you want to be best or worse of them.

The header must be formatted:
# Language Name, N bytes

Strike-through etc cannot be used, so if the code size is changed, show it in bold text below the header or indicate it in some other way.
The output must be I'm answer number n., where the number n is the position (trailing newline/spaces are OK). So, the shortest answer will output: "I'm answer number 1.", the second will be "I'm answer number 2." etc.
This is code golf, so the shortest answer in bytes will win.

If other answers have the same number of bytes as your own, you can choose if you want to be best or worse of them. Maybe post date should be a tie-breaker, so you don't have two answers claiming to be the same number. Or, you could use the standard that if they're tied, they're both tied for the higher place.

I'm not sure this is going to work. Most (good) online interpreters don't allow curling other webpages, but in the challenge it says that the code has to run on an online interpreter.

Let's talk about this in chat.

Do any quotes around the URL need to be counted? Some answers currently exclude them from the count, others include them.

Perl, 107 bytes
use LWP;print"I'm answer number ",1+grep($_<107,LWP::UserAgent->new->get('http://codegolf.stackexchange.com/q/60204')->content=~/<h1>.+, (\d+)/g),'.';

Slightly less golfed:
use LWP;
$agent = new LWP::UserAgent();
$response = $agent->get('http://codegolf.stackexchange.com/q/60204');
@answers = $response->content =~ m/<h1>.+, (\d+)/g;
print "I'm answer number ", 1+grep($_<107, @answers), '.';

Sample Usage
$ perl my_rank.pl
I'm answer number 1.

Python 2, 145 bytes
from requests import*
print"I'm answer number %s."%(sorted([int(a["body"].split(",")[1].split()[0])for a in get('http://api.stackexchange.com/2.2/questions/60204/answers?pagesize=99&order=desc&sort=activity&site=codegolf&filter=!SWJ_BpAceOT6L*G2Qa').json()["items"]]).index(145)+1)

Output from 2015-10-10 17:30:00 UTC:
I'm answer number 1.

I didn't count any of the URL for my score, if I should please comment on how much I should add to it. Has own score hardcoded in it, assumes that it's already posted. Will break if ever more than 99 answers are posted.

AutoIt, 175 bytes
(202 bytes - 27 for the URL)
#include<String.au3>
$0=_StringBetween
$1=1
For $2 In $0(BinaryToString(InetRead("http://q.codegolf.xyz/60204")),'<h1>',' b')
$1+=$0($2,', ','')[0]<175?1:0
Next
ConsoleWrite("I'm answer number "&$1&".")

Output from 2015-10-09 17:47:00 UTC:
I'm answer number 1.

I've never even heard of Autolt, but it is correct that this won't work if the language name has a comma in it? (I don't know if there are any such languages, so I'm not sure if it matters)

@StewieGriffin Yes, but I don't recall any language with a comma in it either ;-) . If one comes up I'll change it.

@minxomat The name looks like it has an l instead of an I, so I misread it. The only reason I realized that is by seeing the Wikipedia article, which has a serif.

Just waiting for someone to invent a language with a comma in it just to sabotage this answer...

@DarrelHoffman Well, it would have to have a comma and a space consecutive in it's name ^^

That would sabotage my answer, too...

JavaScript (ES7), 149 bytes
283 bytes - 134 for the URL. I've never use HTTP requests before, but here goes...

x=z=>alert(`I'm answer number ${[for(y of z.items)y.body.match(/, (\d+)/)[1]].sort().indexOf("149")+1}.`);document.write('<script src="//api.stackexchange.com/2.2/questions/60204/answers?pagesize=100&order=desc&sort=votes&site=codegolf&filter=!--pn9sqW9y0T&callback=x">\x3C/script>')

Tested successfully in Firefox 41.
First it looks through the headers of all the answers to find their byte-counts, then it finds the first position with byte-count 243 149. It's currently set up to check only the first 100 answers, and will break if someone gets under 100 bytes, but it works for now. ;)
Thanks to @GeorgeReith for the much shorter technique. Old version using AJAX (243 bytes):
x=new XMLHttpRequest,x.onreadystatechange=_=>{if(x.readyState==4&&x.status==200)alert(`I'm answer number ${[for(y of JSON.parse(x.responseText).items)y.body.match(/, (\d+)/)[1]].sort((a,b)=>a-b).indexOf("243")+1}.`)},x.open("GET","//api.stackexchange.com/2.2/questions/60204/answers?pagesize=100&order=desc&sort=votes&site=codegolf&filter=!--pn9sqW9y0T",!0),x.send()

Looking good... although will possibly break if someone posts another 151 byte answer

@GeorgeReith Nah, it shouldn't. The OP says that ties can be broken either way, and this'll just place itself ahead of the other.

Ah he edited that out. Still its probably better to sort by creation date instead to make it more likely it finds yours instead of one of the few who posted before and edit their answer.

@GeorgeReith If other answers have the same number of bytes as your own, you can choose if you want to be best or worse of them. That's still in the main post; am I misunderstanding something?

No apologies I was reading the edit history and got confused.

PHP, 158 159 164 bytes
I'm answer number <?for(;$h[]=json_decode(fread(gzopen('http://api.stackexchange.com/2.2/questions/60204/answers?pagesize=99&order=desc&sort=votes&site=codegolf&filter=!--pn9sqW9y0T',r),1e4),1)[items][+$i++][body];);echo array_sum(preg_filter(~„ÑÕß×£›ÔÖß†‹šŒÃÐ—ÎÑÕ‚Œš,~ÛÎÃÎÊÇ,$h)),~Ñ;

127 bytes from 'http://api.stackexchange.com/2.2/questions/60204/answers?pagesize=99&order=desc&sort=votes&site=codegolf&filter=!--pn9sqW9y0T' not counted
Formatted version with ungolfed strings:
<?
for(;
    $h[]=json_decode(
        fread(
            gzopen(
                'http://api.stackexchange.com/2.2/questions/60204/answers?pagesize=99&order=desc&sort=votes&site=codegolf&filter=!--pn9sqW9y0T',r
            ), 1e4
        ), 1
    )[items][+$i++][body];
);
echo"I'm answer number ",
    array_sum(
        preg_filter('{.* (\d+) bytes</h1.*}se','$1<159', $h)
    ),
    ".";

Loads the JSON response (one time per answer actually to save 5 bytes, thanks to @Blackhole)
Collects answer bodies in $h
replaces whole text with "1" (true) if the byte count is <=159, or "" (false) otherwise
sums the results

The character sequences like ¶Ø’ßž‘Œˆšß‘Š’šß are valid constant names in PHP, but because the constants do not exist are treated as string literal. ~ inverts them, this one to "I'm answer number " (saving a byte for one quotation mark each)
Usage
php -derror_reporting=0 howareyou.php

I'm answer number 1.

Is the $a variable really necessary? Why don't you simply do $h[]=json_decode(…)[items][+$i++][body]? What are this strange characters, by the way?

Good point. This will make a new request for each answer but who cares :) The strange characters are bitwise inverted strings. They are valid constant names in PHP that are used as string literals if they don't exist, so I can save the quotation marks. For example " " (3 bytes) can be reduced to ~ß (2 bytes)

Indeed, I've found your explanation on this answer. Since that's an unusual method, I think it could be a good idea to explain it again here in your post :).

I think you can do a lot better if you skip the json_decode and just split on ':' or something, e.g.: http://codepad.org/7rZg06by

Good idea but I fear it might be unreliable as there will be lots of colons in the source codes. Putting "I'm answer number" before the opening PHP tag saves at least two bytes, thanks for that!

The ?>. at the end should save a byte as well (rather than ,~Ñ;). It doesn't matter where or how often colon matches, so long as the header of the answers are colon-free.

Javascript (ES6), 186 bytes
(335 - 149 bytes for the URL)

a=d=>alert(`I'm answer number ${d.items.map(q=>(y=[q.body.match(/, (\d+)/)[1],(x=q.owner.user_id==11182)])&&x?z=y:y).sort().indexOf(z)+1}.`)
document.write(`<script src="https://api.stackexchange.com/questions/60204/answers?pagesize=100&order=desc&sort=activity&site=codegolf&filter=!)Q2B_A19OPkd2j8JforD00f5&callback=a">\x3C/script>`)

I had no clue you could do it that way! May I ask why you used \x3C instead of <?

@ETHproductions Because the browser looks for the closing script tag right away and won't execute the script otherwise, this defers the closing of the script tag until post insertion. It uses JSONP with a callback and is up to the API whether it supports it but luckily stackexchange does. Honestly I don't fully understand the reasoning for it but it is a legitimate issue.

Awk, 153 bytes
BEGIN{if(u){print"I\047m answer number "system("curl -s "u"|awk -f a")".";exit}FS="1>.*,|es<\/h"}NF==3{r+=($2+0)<153?1:0}END{exit(r<1?1:r)}

This should be saved to a file a and run like:
awk -v u=http://codegolf.stackexchange.com/questions/60204/how-are-you-doing -f a

I'm subtracting the 68 bytes for http://codegolf.stackexchange.com/questions/60204/how-are-you-doing and adding 13 to the code for the bootstrapping awk -v u= and -f a.
Less golfed, this can be even shorter:
curl -s http://codegolf.stackexchange.com/questions/60204/how-are-you-doing | awk -F"1>.*,|es<\/h" 'NF==3{r+=(0+$2)<103?1:0}END{print"I\047m answer number "(r<1?1:0)"."}'

It always prefers itself in ties.  The byte count is hard coded in each.
The more golfy version has the script calling itself and outputting the exit value via system.  In each case only counts lower than the hard-coded value increment r, which then has to be adjusted back to 1 if it's leading.
This will fail to correctly find bytes if there's whitespace between bytes and </h1> and probably a number of other cases I haven't considered.
As of Sun Oct 11 05:17:51 UTC 2015, this gives:
I'm answer number 3.

Since this is my first time golfing please let me know if I've violated any rules, loopholes, counts etc or what improvements I could make.

I think you need to print "I'm answer number" rather than "I am number".

@ThomasKwa Hah! I knew it was too good to be true.  Thanks and fixed.  Does adding bytes back require a strike-through?

You don't need one, just like you don't need a strikethrough when you golf off bytes.

GNU Awk, 156 bytes
(Inspired by n0741337's Awk solution.)
This one does it all itself, without running external command.
BEGIN{d="/inet/tcp/0/"h"/80"
print"GET "p" HTTP/1.1\nHost:"h"\n"|&d
while(d|&getline)n+=match($0,/1>.*, ([0-9]+)/,m)&&m[1]<156
print"I'm answer number",n+1}

Expects hostname and path as separate values. Given they are available for free, hopefully this not breaks the rules.
Sample run:
bash-4.3$ awk -v h=codegolf.stackexchange.com -v p=/questions/60204/how-are-you-doing -f number.awk
I'm answer number 4