text:
Truth Tables: Your great-grandfather's computer
If you remember back to your schooling years, you might remember learning about Truth Tables. They seemed boring, but they are basis for logic and (some would argue) all computing...

Problem
Your mission, should you choose to accept it is to write a program, function, or widget of code that can output a truth table given input.
Input
Input will be a string (like data structure) containing the logic statement to make the Truth Table into. For example:
p ∧ q

This means p and q(logical conjuction) and will output:
 p  q  p ∧ q
 T  T    T
 T  F    F
 F  T    F
 F  F    F

Notice the spacing: The item of the column is in the center of the header
Characters
Score via characters, not bytes
The logic comparison characters are special and not always what they look like. Use these characters:
Logical Conjunction (AND): ∧ U+2227
Logical Disjunction (OR): ∨ U+2228
Logical Negation (NOT) ~ or ¬ U+7e and U+ac respectively

Bonuses
All of these bonuses are optional, but will knock points off your score. Pick any.
Logical Negation
Logical Negation is a unary operator in truth tables. It is the equivalent of ! in most C-based languages. It makes false=>true and vise versa. It is notated with a ¬ or ~ (you must support both). Supporting this will knock off 10% of your score. You must, however, add an additional column to show its results:
For example:
~p ∧ q

will output:
p  ~p  q  ~p ∧ q
T  F   T     F
T  F   F     F
F  T   T     T
F  T   F     F

Pretty Print
The normal table notation is boring. Let's make it pretty! Pretty print format is as follows for p ∧ q is as follows:
+---+---+-------+
| p | q | p ∧ q |
+---+---+-------+
| T | T |   T   |
+---+---+-------+
| T | F |   F   |
+---+---+-------+
| F | T |   F   |
+---+---+-------+
| F | F |   F   |
+---+---+-------+

Special details for pretty printing:

There is a 1 space padding in each cell
Cell values are still centered

If you pretty print your tables, from your code and then multiply by 0.6. Use this function for this bonus:
score = 0.6 * code

Examples
p ∧ q:
p  q  p ∧ q
T  T    T
T  F    F
F  T    F
F  F    F

p ∨ q:
p  q  p ∨ q
T  T    T
T  F    T
F  T    T
F  F    F

~p ∧ q:
p  ~p  q  ~p ∧ q
T   F  T     F
T   F  F     F
F   T  T     T
F   T  F     F

~p ∨ q:
p  ~p  q  ~p ∧ q
T   F  T     T
T   F  F     F
F   T  T     T
F   T  F     T

Rules

Standard loopholes apply
No external resources
If you're going to break the rules, be clever ;)

Shortest Code (in characters) wins. Good Luck!

From the description it sounded like these were arbitrary Boolean expressions. But all the examples (without bonus) have only one operator. Is this restricted to a single operator? Also, the names of the values in the examples are all p and q. Unless they always have these names, you may want to show a few different options in the test examples. Are they always a single letter?

Since this uses non-ASCII characters, it might be good to specify if the length of the code is counted in characters or bytes. If it's bytes, it would be helpful to know how many bytes the unicode characters use.

Simplify :). score = 0.6 * (code - 15) = .6 * code - 9

@RetoKoradi Changed. Score by characters, not bytes

@RetoKoradi If what my geometry teacher tells me is correct you will never see more then p q and r in a truth table ;)

What?! No way! I was just thinking of making a challenge like this!

@SpeedyNinja You can easily see more than those in a truth table. You might not see it in a class, but that's like saying that you'll never see an equation with more than three variables.

@mbomb007 For the purposes of keeping a moderately difficult challenge simple, if an answer doesn't support more then p q or r that will be fine

I would like to state for the record that my great-grandfather's computer was a slide rule. I doubt that anyone's great-grandfather computed with truth tables: the jump was directly from slide rules to electronic computers.

May we pretty-print using box-drawing chars ┌─┬?

Does a symbolic expression count as a string-like data structure; i.e. can I take my input as P∨Q or does it have to be "P∨Q"?

May we take just the Boolean operator (∧ ∨ ~) instead of the full "p ∧ q" string?

@Adám String parsing is not the challenge, you may take the operator as input

Can we assume that 'p', 'q', etc. is just one character long?

Is each boolean (like p and q) necessarily in alphabetical order in the table?

JavaScript (ES6), 141
Simple function, no bonus, 141 chars. (140 uft8, 1 unicode wide)
Complex function handling ~ or ¬, 254 chars (253 utf, 1 unicode wide), score 229
Could save 6 bytes using alert instead of console.log, but alert is particularly unfit to display tables.
Test running the snippet below in an EcmaScript 6 compliant browser (tested with Firefox. Won't work in Chrome as Chrome does not support .... Also, the bonus version use an extension of split that is Firefox specific).

/* TEST: redirect console.log into the snippet body */ console.log=x=>O.innerHTML+=x+'\n'

// Simple
F=s=>{[a,o,b]=[...s],z='  ',r=a+z+b+z+a+` ${o} ${b}
`;for(w='FT',n=4;n--;r+=w[c]+z+w[e]+z+z+w[o<'∧'?c|e:c&e]+`
`)c=n&1,e=n>>1;console.log(r)}

// Simple, more readable
f=s=>{
   [a,o,b]=[...s]
   r=a+'  '+b+'  '+a+` ${o} ${b}\n`
   for(w='FT',n=4; n--; )
   {
     c = n&1, e = n>>1, x=o<'∧' ? c|e : c&e
     r += w[c]+'  '+w[e]+'    '+w[x]+'\n'
   }
   console.log(r)
}

// 10% Bonus
B=s=>{[a,o,b]=s.split(/([∧∨])/),t=a>'z',u=b>'z',z='  ',r=(t?a[1]+z:'')+a+z+(u?b[1]+z:'')+b+z+a+` ${o} ${b}
`;for(s=v=>'FT'[v]+z,n=4;n--;r+=s(c)+(t?s(d)+' ':'')+s(e)+(u?s(f)+' ':'')+(t?'   ':z)+s(o<'∧'?d|f:d&f)+`
`)c=n&1,d=c^t,e=n>>1,f=e^u;console.log(r)}

Test1 = ['q∨p','q∧p']
Test2 = Test1.concat([
  '~q∨p','q∨~p','~q∨~p','~q∧p','q∧~p','~q∧~p',
  '¬q∨p','q∨¬p','¬q∨¬p','¬q∧p','q∧¬p','¬q∧¬p'
])

console.log('SIMPLE')
Test1.forEach(t=>F(t));

console.log('BONUS')
Test2.forEach(t=>B(t));

+1, I love JavaScript and this solution deserves an upvote.

JavaScript is my native language, but I won't let that affect me! :D Good Job!

MediaWiki template - 2347 characters
MediaWiki has a built template function called {{#expr}} that can handle logical expressions. This must be the perfect challenge for MediaWiki templates! Features such as variables, loops and a readable syntax would have helped a bit, though. Also, the fact that there is no NOT operator for the expr function made it a bit more complex.
{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}} {{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}} {{{1}}}
T T  {{#if:{{#pos:{{#sub:{{#replace:{{{1}}}|~|¬}}|0|1}}|¬}}| |}} {{#replace:{{#replace:{{#expr:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|~|¬}}|{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}}}|0|1}}}}|{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}}}|0|1}}|0|1}}|¬|}}|∧|and}}|∨|or}}}}|1|T}}|0|F}}
T F  {{#if:{{#pos:{{#sub:{{#replace:{{{1}}}|~|¬}}|0|1}}|¬}}| |}} {{#replace:{{#replace:{{#expr:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|~|¬}}|{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}}}|0|1}}}}|{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}}}|1|0}}|1|0}}|¬|}}|∧|and}}|∨|or}}}}|1|T}}|0|F}}
F T  {{#if:{{#pos:{{#sub:{{#replace:{{{1}}}|~|¬}}|0|1}}|¬}}| |}} {{#replace:{{#replace:{{#expr:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|~|¬}}|{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}}}|1|0}}}}|{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}}}|0|1}}|0|1}}|¬|}}|∧|and}}|∨|or}}}}|1|T}}|0|F}}
F F  {{#if:{{#pos:{{#sub:{{#replace:{{{1}}}|~|¬}}|0|1}}|¬}}| |}} {{#replace:{{#replace:{{#expr:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{1}}}|~|¬}}|{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{#replace:{{#replace:{{{1}}}|~|}}|¬|}}|0|1}}}}|1|0}}}}|{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}|{{#if:{{#pos:{{#replace:{{{1}}}|~|¬}}|¬{{#sub:{{{1}}}|{{#expr:{{#len:{{{1}}}}}-1}}|{{#len:{{{1}}}}}}}}}|1|0}}|1|0}}|¬|}}|∧|and}}|∨|or}}}}|1|T}}|0|F}}

Test:
{{TemplateName|¬X ∧ ~Y}}

{{TemplateName|p ∨ q}}

Result:
X Y ¬X ∧ ~Y
T T    F
T F    F
F T    F
F F    T

p q p ∨ q
T T   T
T F   T
F T   T
F F   F

I'm assuming MediaWiki >= 1.18, where the ParserFunctions extensions comes bundled with the software.

Welcome to Programming Puzzles and Code Golf. Using MediaWiki is not something I would have thought of; +1. However, the extra column behaviour of the ¬ / ~ operator is missing; if you add it, you will qualify for a 10% bonus.

I just realized that, unless I can use nested templates (that might be stretching the rules a bit too far?), properly adding that column would actually increase the character count... :)

In which case, you should probably remove negation support, because you're not getting any bonuses for it.

Yup, will look into it. I don't think it will have a lot of impact on the final ranking though... :D

[tag:code-golf] is as much within languages as between them.

@leo This is great, and I think using nested templates would be fine if you just add the character count of the two of them, that seems to be the accepted practice nowadays.

Python - 288 characters (+10 penalty cause I couldn't get unicode to work :c)
No bonuses. This is my very first codegolf answer.
def f(i):
    i=i.split(" ")
    print i[0],i[2],
    for f in i[0:3]: print f,
    print ""
    for t in["TT","TF","FT","FF"]:
        p,q=t[0],t[1]
        y = t[0]+" "+t[1]
        if i[1]=="^": r=(False,True)[p==q]
        if i[1]=="v": r=(False,True)[p!=q]
        if r: y+="   T"
        else: y+="   F"
        print y

i is the input.
EDIT: Removed a few spaces and it now uses function args as input.

Welcome to PP&CG! Please make sure to have your code following the rules, according to the question. As the rule specification, your code must be a function, full program or bit of code. This implies that input MUST be STDIN or function arguments (or equivalent) Happy Coding!

Dyalog APL, 58 48 characters
Requires ⎕IO←0, which is default on many systems. Takes string as argument.
{('p q ',⍵)⍪'FT '[p,q,⍪⍎⍵]\⍨324⊤⍨9⍴≢p q←↓2 2⊤⌽⍳4}

No bonuses, but on the plus side, any operator works.
⍳4 first four indices (0 1 2 3)
⌽ reverse (3 2 1 0)
2 2⊤ two-bit Boolean table
↓ split into two-element list of lists (high-bits, low-bits)
p q← store as p and q
≢ tally them (2)*
9⍴ cyclically reshape that to length 9 (2 2 2 2 2 2 2 2 2)
324⊤⍨ encode 324 thusly, i.e. as 12-bit binary (1 0 1 0 0 0 1 0 0)
\⍨ use that to expand (insert a space for each 0)...
'FT '[...] the string "FT ", indexed by
 ⍎⍵ the executed argument (valid since p and q now have values)
 ⍪ make that into a column matrix
 q, prepend a column consisting of q (1 1 0 0)
 q, prepend a column consisting of p (1 0 1 0)
(...)⍪ insert a row above, consisting of
 ⍵ the argument
 'p q ', prepended with the string "p q "

* Please star this issue if you see ≢ as ≢ and not as ̸≡.

Julia, 161 bytes
No bonuses.
s->(S=split(s);P=println;p=S[1];q=S[3];a=[&,|][(S[2]=="∨")+1];c="  ";P(p,c,q,c,s);for t=["TT","TF","FT","FF"] P(t[1],c,t[2],c^2,"FT"[a(t[1]>'F',t[2]>'F')+1])end)

Ungolfed:
function f(s::String)
    # Split the input on spaces
    S = split(s)

    # Separate out the pieces of the statement
    p = S[1]
    q = S[3]
    a = [&, |][(S[2] == "∨") + 1]

    # Print the header
    println(p, "  ", q, "  ", s)

    # Create the table entries in a loop
    for t = ["TT", "TF", "FT", "FF"]
        println(t[1], "  ", t[2], "    ", "FT"[a(t[1] > 'F', t[2] > 'F') + 1])
    end
end

Python3, 145 139 120 119 Bytes
No bonus (with bonus at the end)
 def f(s):
 a,m,b=s.split(" ");print(a,b,s);F,T,c=0,1,"FT"
 for p in c:
  for q in c:print(p,q," ",c[eval(p+"+*"[m=="∧"]+q)>0])

Needing Python3 for Unicode support out of the box.
Based on DJgamer98 Python code, figuring out his table is not right.
Edit1: Splitting into distinct variables and ommiting the operator string variable
Edit2: (ab)using F and T as both variables and string characters
Edit3: Saving one space thanks to NoOneIsHere
With Bonus, 215 * 0.6 = 129
def f(s):
 r="+---"*3+"----+"
 a,m,b=s.split(" ");F,T,c=0,1,"FT"
 print("%s\n| %s | %s | %s |\n%s"%(r,a,b,s,r));
 for p in c:
  for q in c: print("| %s | %s |   %s   |\n%s"%(p,q,c[eval(p+"+*"[m=="∧"]+q)>0],r));

Welcome to PPCG! You can save a byte by removing the space after q in c:.

Edit2: That's not abuse. See here, where I use the first character of the file contents as filename!

C/C++ 302 Bytes
335 characters less 10% for handling negation. Formatting incomplete but submitting before I see what the impact of completion is.
Marked as C/C++ because my gcc and g++ accepts it with -fpermissive and it looks far more C like than C++ to me.
#include <stdio.h>
void T(char*S) { int (*P)(char*,...)=printf;char*v[2]={"F","T"};for(int m=4;m--;){P("|");char*s=S;int x=m&1;X:P(" %s |",v[x]);if(*++s!=' '){x=x^1;goto X;}char*o=++s;s+=3;int y=(m>>1)&1;Y:P(" %s |",v[y]);if(*++s){y=y^1;goto Y;}int g;for(g=o-S+1;g--;)P(" ");P(*++o==39?v[x&y]:v[x|y]);for(g=s-o;g--;)P(" ");P("|\n");}}

I'm sure there's probably a few tweaks that could be applied. In fact handling the nots adds more than the 10% bonus removes.
This does assume the input format is as stated, i.e. 2 input values (p and q), with or without the not prefix and nothing else, and all tokens delimited by a single space.
Ungolfed:
void ungolfed(char* S)
{
   int (*P)(char*,...) = printf;         // useful lookup stuff
   char* v[2] = {"F","T"};

   for(int m = 4; m--;) {                // loop over all 2 bit bit patterns (truth table inputs)

      P("|");                            // start of line format
      char* s=S;                         // iterator to start of equation for each bit pattern

      int x = m&1;                       // input 1 (aka. p which I called x here to be awkward)
X:    P(" %s |",v[x]);                   // input 1 output and format

      if(*++s!=' ') {                    // if next character is not a space then input must be prefixed with the not character
         x=x^1;                          // so negate the input
         goto X;                         // and redo input 1 output
      }

      char* o = ++s;                     // remember where the operator is
      s+=3;                              // and skip it and following space

      int y = (m>>1)&1;                  // input 2 (aka. q which I called y obviously) processing as for input 1
Y:    P(" %s |",v[y]);

      if(*++s) {
         y=y^1;
         goto Y;
      }

      int g;

      for(g=o-S+1;g--;) P(" ");         // pre-result value padding

      P(*++o==39?v[x&y]:v[x|y]);      // result

      for(g=s-o;g--;) P(" ");           // post-result value padding and format
      P("|\n");
   }
}

and the tests:
int main()
{
   T("p \x22\x27 q");  // p & q
   puts("");

   T("p \x22\x28 q");  // p | q
   puts("");

   T("\x7ep \x22\x27 q");  // ~p & q
   puts("");

   T("\xacp \x22\x28 q");  // ~p | q
   puts("");

   T("p \x22\x28 \xacq");  // p | ~q
   puts("");

   return 0;
}

Mathematica, 129 Bytes
Golfed:
t=InputString[];s=Append[StringCases[t,LetterCharacter],t];Grid[Prepend[Map[If[#,"T","F"]&,BooleanTable[ToExpression[s]],{2}],s]]

Ungolfed:
(*Take input*)
t=InputString[];
(* Find all occurrences of letters and append the final statement.*)
s=Append[StringCases[t,LetterCharacter],t];
(* Evaluate the list as expressions and create a boolean table of True/False values, then display as a table. *)
(* To satisfy the output conditions, we must convert each True/False to T/F *)
Grid[Prepend[Map[If[#,"T","F"]&,BooleanTable[ToExpression[s]],{2}],s]]

Not a Mathematica expert, but I found this rather elegant compared to having to do direct character comparison.
I had a solution that worked for negation, but it was longer than the score reduction would take off.
Depending on what qualifies for pretty printing, I might try for that bonus. I feel like outputting in ASCII in Mathematica would be far too expensive for the score reduction to compensate, but if the two main features are a dotted border and specified padding inside the cells, that's only a couple options in Grid.
With pretty printing, 171 * 0.6 = 102.6 Bytes
t=InputString[];s=Append[StringCases[t,LetterCharacter],t];Grid[Prepend[Map[If[#,"T","F"]&,BooleanTable[ToExpression[s]],{2}],s],Spacings->1,Frame->All,FrameStyle->Dashed]

Mathematica, 128 characters
TraditionalForm@Grid[({#}~Join~BooleanTable[#,Cases[b,_Symbol,{0,∞}]]&/@Cases[b=ToExpression@#,_,{0,∞}]/.{0<1->"T",0>1->"F"})]&

 is the private use character U+F3C7 representing \[Transpose].
Luckily for us Mathematica golfers, ∧ and ∨ already represent And and Or, so all we have to do is convert the input string into a Mathematica expression and we can do symbolic logical operations on it.
Note that this solution will also handle Not (¬), Implies (), Equivalent (⧦), Xor (⊻), Nand (⊼), Xor (⊻), and Nor (⊽), but it doesn't get the bonus because ~p is a syntax error in Mathematica. Meh.

Explanation
b=ToExpression@#

Converts the input string into a Mathematica expression and stores it in b.
Cases[b=ToExpression@#,_,{0,∞}]

This is a list every possible subexpression of the input. Each will receive its own column.
Cases[b,_Symbol,{0,∞}]

This is a list of all of the variables that appear in the input.
BooleanTable[#,Cases[b,_Symbol,{0,∞}]]&

Pure function which takes an input expression # and returns a list of truth values for all possible combinations of truth values for the variables.
{#}~Join~BooleanTable[...]

Prepends the expression itself to this list.
.../@Cases[b=ToExpression@#,_,{0,∞}]

Applies this function to each subexpression of the input.
.../.{0<1->"T",0>1->"F"}

Then replace true (0<1) with "T" and false (0>1) with "F".
(...)

Interchange rows and columns.
Grid[...]

Display the result as a Grid.
TraditionalForm@Grid[...]

Convert the Grid to traditional form so that it uses the fancy symbols.


text:
Person of Interest
Background
Person of Interest is a crime drama on CBS, and my favorite TV show, as of late.
The show is about a man named Harold Finch, a billionaire programmer, and his partner John Reese, a special forces veteran and ex-CIA operative. This programmer created a sentient AI called "The Machine" that predicts violent crimes before they happen. It tracks every person on Earth at all times by monitoring and analyzing all surveillance cameras and electronic communications across the globe.
Harold built The Machine for the United States government to detect terrorist activity before-the-fact. It divides the crimes that it predicts into lists based on whether or not they are relevant to national security. The relevant cases are handled by the government, while the "irrelevant" list is programmed to be deleted daily.
Harold made a small backdoor for himself in hopes to deal with the "irrelevant" list, himself. This backdoor causes The Machine to call the payphone nearest Harold (once every day or so) and read a Social Security number to him. This SSN belongs to someone whose life is in danger as part of a premeditated crime, or of someone who is planning such a crime.

The Challenge
Write a program that takes no input, and outputs 30 random phone numbers & SSNs (see below).

Output
There are two lines of text that will be printed every "day".

Crime predicted: 555-55-5555
Calling: 1-555-555-5555 followed by a newline

This process should repeat for one "month" (30 "days").

Phone Numbers
Every phone number must have the following elements:

Must have the United States country code (the first digit).
Must have a random area code (first set of three digits).
The first three digits of the phone number itself should be 555, followed then by 4 random digits.

Here is an annotated example:
1-814-555-3857
|  |   |   |
|  |   |   |
|  |   |   +---------->   random four digits
|  |   |
|  |   +-------------->   the set 555
|  |
|  +------------------>   area code
|
+--------------------->   country code

Social Security Numbers
Every SSN must be 9 random digits in the following format.
342-98-1613

Example
Crime predicted: 234-72-8311
Calling: 1-633-555-0188

Crime predicted: 135-77-0910
Calling: 1-202-555-4719

Crime predicted: 722-90-6653
Calling: 1-466-555-1069

...

Continuing for 27 more cycles.

Scoreboard
For your score to appear on the board, it should be in this format:
# Language, Bytes

Strikethroughs shouldn't cause a problem.

function getURL(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function getAnswers(){$.ajax({url:getURL(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){var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),useData(answers)}})}function getOwnerName(e){return e.owner.display_name}function useData(e){var s=[];e.forEach(function(e){var a=e.body.replace(/<s>.*<\/s>/,"").replace(/.*<\/strike>/,"");console.log(a),VALID_HEAD.test(a)&&s.push({user:getOwnerName(e),language:a.match(VALID_HEAD)[1],score:+a.match(VALID_HEAD)[2],link:e.share_link})}),s.sort(function(e,s){var a=e.score,r=s.score;return a-r}),s.forEach(function(e,s){var a=$("#score-template").html();a=a.replace("{{RANK}}",s+1+"").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SCORE}}",e.score),a=$(a),$("#scores").append(a)})}var QUESTION_ID=58199,ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",answers=[],answer_ids,answers_hash,answer_page=1;getAnswers();var VALID_HEAD=/<h\d>([^\n,]*)[, ]*(\d+).*<\/h\d>/;
body{text-align:left!important}table thead{font-weight:700}table td{padding:10px 0 0 30px}#scores-cont{padding:10px;width:600px}#scores tr td:first-of-type{padding-left:0}
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Scores

	User	Language	Score

{{RANK}}	{{NAME}}	{{LANGUAGE}}	{{SCORE}}

How the task is written now, the time delay is obsolete for the output or algorithm to be valid. If anything, it disqualifies a lot of languages...

Also, what are the valid values for US country codes / area codes?

I've removed the time restriction. In regards to your second question, the US country code is explicitly a 1. As for area codes, any three digits will do, for the purposes of this challenge. @minxomat

The Output section confuses me little. I've interpreted it as There are three lines of text [...] 1. [...] 2. [...] followed by a blank line. Is that correct?

Perhaps you should define "random" more carefully

@LuisMendo there is a consensus on meta about what random means if not fully defined

Of course, generating the numbers in the format they're actually transmitted by The Machine in the show would be even more complicated... ;)

"In fact, only 555-0100 through 555-0199 are now specifically reserved for fictional use; the other numbers have been reserved for actual assignment"

Who ya gonna call? @DTI-Matt

CJam, 68 66 64 bytes
Thanks to Dennis for saving 2 bytes!
"Crime predicted: --
Calling: 1--555-

"30*{_5<{iAa*:mr}&}/

Copypasting won't work since there are a few unprintables (one in place of each random group), so here's an xxd dump:
00000000: 2243 7269 6d65 2070 7265 6469 6374 6564  "Crime predicted
00000010: 3a20 032d 022d 040a 4361 6c6c 696e 673a  : .-.-..Calling:
00000020: 2031 2d03 2d35 3535 2d04 0a0a 2233 302a   1-.-555-..."30*
00000030: 7b5f 353c 7b69 4161 2a3a 6d72 7d26 7d2f  {_5<{iAa*:mr}&}/

To reverse it, paste it into a file and launch xxd -r in_file > out_file. You can also try it online.
Explanation
"..."30*     Push the string 30 times
{ ... }/     For each character in the string:
_5<{ ... }&    If the ASCII code is < 5:
iAa*             Push an array of as many 10s as the ASCII code
:mr              For each 10, choose a random 0-9 number

I would've never thought of this myself, but it seems to be two bytes shorter in Pyth.

@FryAmTheEggman I should probably learn Pyth, it's often shorter than CJam. You can post that answer if you want :)

Python 2, 129
from random import*
print''.join([c,`randint(0,9)`][c>'w']for c in'Crime predicted: xxx-xx-xxxx\nCalling: 1-xxx-555-xxxx\n\n'*30)

A naive method. Takes the message
Crime predicted: xxx-xx-xxxx
Calling: 1-xxx-555-xxxx

and copies it 30 times. Then, replaces each x with a random digit randint(0,9), keeping all other characters the same.

Python 2, 151 bytes
Thank the lord (and @Dennis) for %0nd :D
from random import randrange as r
for i in[1]*30:print"Crime predicted: %03d-%02d-%04d\nCalling: 1-%03d-555-%04d\n"%(r(1e3),r(100),r(1e4),r(1e3),r(1e4))

Perl, 85 Bytes, thanks to Dennis and grc!
$_="Crime Predicted: NNN-NN-NNNN
Calling: 1-NNN-555-NNNN

"x30;s/N/0|rand 10/eg;print

Original Perl, 91 92 Bytes
print"Crime Predicted: NNN-NN-NNNN
Calling: 1-NNN-555-NNNN

"=~s/N/int rand 10/egr for 1..30

@Dennis aw, I was about to post that until I saw this answer. I had $_="..."x30;s/_/0|rand 10/eg;print which saves the /r flag.

Thanks @Dennis and @grc! Is it customary to incorporate changes suggested in comments (with attribution of course)? If not I'll revert my edit. But, in any case, thanks! I'd totally forgotten about the 0|rand ... trick and the repetition operator I'm now using to repetitiously slap my head for missing that!

Yes, it's customary. If you haven't already, you should check out Tips for golfing in Perl?. It's a great resource.

CJam, 73 71 70 bytes
30{"Crime predicted: x-x-x
Calling: 1-x-555-x
"'x/[ZY4Z4]Aaf*::mr.+N}*

Try it online in the CJam interpreter.
How it works
30{     e# Repeat 30 times:

e# Push the following string:

"Crime predicted: x-x-x
Calling: 1-x-555-x
"

'x/     e# Split at x's.
[ZY4Z4] e# Push the array [3 2 4 3 4].
Aaf*    e# For each integer in that array, repeat [10] that many times.
        e# This pushes [[10 10 10][10 10][10 10 10 10][10 10 10][10 10 10 10]].
::mr    e# For each 10, select a random integer between 0 and 9 (inclusive).
.+      e# Vectorized concatenation.
        e# This places the digits at the spots of the x's.
N       e# Push a linefeed.
}*      e#

ß, 121 118 112 bytes
°/N=1°(30°/M°=ß$-ß$$'Crime predicted: 000-00-0000\nCalling: 1-000-555-0000\n\n'),'',3)µ€(M='0')?ß!G0,9,1):M)°)°)

Basically replaces 0 with a random number each and calls itself 30 times.
Test it using the online terminal:
sharps:~$ "<ctrl+v the code here>"
Crime predicted: 214-59-4707
Calling: 1-850-555-8529

Crime predicted: 722-97-6832
Calling: 1-864-555-6965

<and so on...>

Edit (112B): Using $$ (something like sprintf) & ternary operator.

Could you provide a link to this language's spec?

@LegionMammal978 Takes some time to write. In simple terms: Has every feature AutoIt has.

Pyth, 66
V30sX"Crime Predicted: v-w-x
Calling: 1-y-555-z
">5GmjkmOTdj32434T

Uses X to translate the last 5 letters of the alphabet (>5G == 'vwxyz') onto the 5 random numbers. Uses the same RNG as Sok found.
Try it online here

Pyth, 62
An implementation of Andrea's fantastic CJam answer.
sm?<Cd5jkmOTCdd*30"Crime Predicted: --
Calling: 1--555-

"

Note that there are several unprintable characters in the source, and there should not be a trailing ". That was added for SE so that it seems a bit more readable. I have not been able to get a hexdump yet, but the link below works and you should be able to copy-paste out of it.
Try it online here

Fourier, 166 142 bytes
45~d030(~i67a114a-9a+4a-8a32a112a^^a101ava+5a-6a116a101ava58a32a999roda99roda9999ro10a67a97a108aa-3a+5a-7a58a32a1oda999roda5oooda9999ro10aai^)

This has one of the highest byte counts, but I am a huge fan of Fourier and wanted to try my hand at a solution. Not very optimized.
Breaking it down:
45~d

Sets the variable d to 45, the ASCII code for a hyphen. This character is printed so much that it saves some bytes to declare it here.
030(...)

Sets the accumulator to zero and loops inside the parentheses until it reaches 30.
67a114a-9a+4a-8a32a112a^^a101ava+5a-6a116a101ava58a32a

Print "Crime predicted: ".
999roda99roda9999ro10a

Print a completely random SSN + newline.
67a97a108aa-3a+5a-7a58a32a

Print "Calling: ".
1oda999roda5oooda9999ro

Print a phone number that follows the guidelines: 1-xxx-555-xxxx
10aa

Print two newlines to start over.

Hey, you might be interested that there's now an online interpreter at http://fourier.tryitonline.net (and also https://labs.turbo.run/beta/fourier)

CJam, 74 bytes
30{[ZY4Z4]{Aa*:mrs}%"Crime predicted: %s-%s-%s
Calling: 1-%s-555-%s

"e%}*

Not a winner, but it's at least somewhat close to what Dennis has so far, and it's using a different approach. So I thought it was worth posting anyway.
This uses the CJam e% operator, which generates output with a printf style format string.
30      Repeat count for whole output.
{       Start loop.
  [ZY4Z4] Build list of random number lengths: [3 2 4 3 4].
  {       Start loop over all random number lengths.
    Aa*     Build list of [10 ... ] with the random number length.
            E.g. for length 3, this will be [10 10 10].
    :mr     Apply the random number operator to the list. This will generate
            a list of random numbers between 0 and 9, with the given length.
    s       Convert it to a string.
  }%      End of loop over random number lengths.
  "..."   Format string, with a %s for each random number.
  e%      Apply printf style formatting.
}*      End of main repeat loop.

Woah, I thought you were @DavidCarraher with that avatar!

@BetaDecay This? http://codegolf.stackexchange.com/users/3967/david-carraher. Not even the same animal! :) The colors are almost the same, though.

If we combine our approaches, we can get to 70 bytes: permalink

@Dennis Feel free to go for it. You have helped me plenty of times.

@RetoKoradi Close enough ;)

JavaScript (ES6), 142
Side note mixmat answer in ß shows a so better way to accomplish this task, and could easily implemented in JS giving a better score. I wish I had thought about it.
Edit Added the missing text (I misread the challenge)
Test running the snippet below in an EcmaScript 6 compliant browser

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

for(i=30;i--;)console.log(`Crime predicted: ${(R=d=>(1e-9+Math.random()+'').substr(2,d))(3)}-${R(2)}-${R(4)}
Calling: 1-${R(3)}-555-${R(4)}
`)

Very nice solution! However, the last part of the phone number occasionally has less than 4 digits; same with the second and third parts of the SSN.

@ETHproductions rats! Reverting to previous version!

Matlab / Octave, 108 172 bytes
disp(sprintf('Crime predicted: %i%i%i-%i%i-%i%i%i%i\nCalling: 1-%i%i%i-555-%i%i%i%i\n\n',randi(10,1,480)-1))

Try it online

GolfScript, 91 bytes
{9rand}+:r;{"Crime Predicted: "{r}3*"-"{r}2*"-"{r}4*"
Calling: 1-"{r}3*"-555-"{r}4*"

"}30*

Try it online.

Pyth, 67 bytes
V30s.ic"Crime predicted: |-|-|
Calling: 1-|-555-|
"\|mjkmOTdj32434T

The newlines are important, and are included in byte count. Try it out here.
                                Implicit: T=10, k=''
       "..."                    The output string
      c     \|                  Split on '|' placeholders
                     j32434T    32434 to base ten -> [3,2,4,3,4]
              m                 Map for d in the above:
                 mOTd             Generate d random numbers from 0-9
               jk                 Concatenate into string (join on empty string)
    .i                          Interleave segments of output string with random strings
   s                            Concatenate and output
V30                             Perform the above 30 times

Haskell, 150 bytes
import System.Random
p '#'=putChar=<<randomRIO('0','9')
p x=putChar x
main=mapM p$[1..30]>>"Crime predicted: ###-##-####\nCalling: 1-###-555-####\n\n"

R, 151 146 or 144 Bytes
Code
for(l in 1:30)cat(sep="","Crime predicted: ",(i=floor(runif(16,,10)))[1:3],"-",i[4:5],"-",i[6:9],"\nCalling: 1-",i[10:12],"-555-",i[13:16],"\n\n")

Test it online.
Ungolfed
for(l in 1:30) {
  i=floor(runif(16,,10))
  cat(sep="","Crime predicted: ",
      i[1:3],"-",i[4:5],"-",i[6:9],
      "\nCalling: 1-",i[10:12],"-555-",
      i[13:16],"\n\n")
  }

I think there is a lot of room to improve but I am no good messing with strings in R.
Edit 1: changed the runif(16,max=10) to runif(16,,10).
I've done another code (147 144 bytes) with sprintf but I don't think it is much a R-like code.
for(l in 1:30)cat(do.call(sprintf,as.list(c('Crime predicted: %s%s%s-%s%s-%s%s%s%s\nCalling: 1-%s%s%s-555-%s%s%s%s\n\n',floor(runif(16,,10))))))

Another approach (149 bytes):
for(p in 1:30)cat(sep="",replace(s<-strsplit("Crime predicted: '''-''-''''\nCalling: 1-'''-555-''''\n\n","")[[1]],which(s<"-"),floor(runif(16,,10))))

Java, 246 bytes
import java.util.*;class C{static{Random r=new Random();for(int i=0;i++<30;)System.out.printf("Crime predicted: %s-%s-%s\nCalling: 1-%s-555-%s\n\n",r.nextInt(900)+100,r.nextInt(90)+10,r.nextInt(900)+100,r.nextInt(900)+100,r.nextInt(9000)+1000);}}

With line breaks:
import java.util.*;
class C{
    static{
       Random r = new Random();
       for(int i = 0; i++<30;)
           System.out.printf("Crime predicted: %s-%s-%s\nCalling: 1-%s-555-%s\n\n",r.nextInt(900)+100,r.nextInt(90)+10,r.nextInt(900)+100,r.nextInt(900)+100,r.nextInt(9000)+1000);
    }
}

It's a start. Instead of producing random digits I used random 3-digit or 4-digit numbers.

JavaScript (ES6), 130 123 bytes
Taking minxomat's ß solution a step further, I've replaced the 0s with the number of 0s that would have been there. The code uses those numbers to pull the correct number of digits off of Math.random(), saving a good bit of bytes in the process.
for(i=30;i--;)console.log(`Crime predicted: 3-2-4
Calling: 1-3-555-4
`.replace(/[2-4]/g,x=>`${Math.random()}`.substr(2,x)))

Try it out:

// redirecting console.log() for this demonstration
console.log=x=>O.innerHTML+=x+'\n';
O.innerHTML='';

for(i=30;i--;)console.log(`Crime predicted: 3-2-4
Calling: 1-3-555-4
`.replace(/[2-4]/g,x=>`${Math.random()}`.substr(2,x)))

As always, suggestions welcome!

PHP, 144 143 Bytes
<?=preg_replace_callback('/x/',function($x){return chr(rand(48,57));},str_repeat("Crime predicted: xxx-xx-xxxx
Calling: 1-xxx-555-xxxx

",30));

C#, 280 263 246 bytes
Golfed:
using System;class C{static string G(){var r=new Random();var s="";n h=x=>r.Next(x).ToString("D"+x);for(int i=0;i++<30;){s+="Crime predicted: "+h(3)+"-"+h(2)+"-"+h(4)+"\nCalling: 1-"+h(3)+"-555-"+h(4)+"\n\n";}return s;}delegate string n(int x);}

Indented:
using System;
class C
{
    static string G()
    {
        Random r = new Random();
        string s = "";
        Func<int, string> f = x => r.Next((int)Math.Pow(10, x)).ToString("D" + x);

        for (int i = 0; i++ < 30;)
        {
            s += "Crime predicted: " + f(3) + "-" + f(2) + "-" + f(4) + "\nCalling: 1-" + f(3) + "-555-" + f(4) + "\n\n";
        }
        return s;
    }
}

New on Codegolf, tips are welcome!

Welcome to Programming Puzzles & Code Golf! I'm not intimately familiar with C#, but since it's predicated on .NET like PowerShell is, I think the h(999) will generate a number from 000 to 998 inclusive, so that means this doesn't quite hit the spirit of the specifications. I ran into the same issue.

You're right, I'll fix it now!

Went up to 280 bytes after the fix, then thought of doing the formatting in the delegate handler, reducing it back to 263 bytes.

Pyth, 73 bytes
V30FGPc"Crime predicted: xxx-xx-xxxx\nCalling: 1-xxx-555-xxxx"\xpGpOT)pb"

Demo

Ruby, 90 88 bytes
30.times{puts"Crime predicted: NNN-NN-NNNN
Calling: 1-NNN-555-NNNN

".gsub(?N){rand 10}}

Try it online.

No need for string notation, just character ?N is enough. No need for parenthesis, around rand's parameter.

Julia, 120 bytes
R(n)=lpad(rand(0:10^n-1),n,0)
for i=1:30 println("Crime Predicted: "R(3)"-"R(2)"-"R(4)"\nCalling: 1-"R(3)"-555-"R(4))end

Ungolfed:
# Define a function for returning a random number with a
# specified number of digits
function R(n::Int)
    lpad(rand(0:10^n-1), n, 0)
end

# Print 30 times
for i = 1:30
    println("Crime Predicted: " R(3) "-" R(2) "-" R(4)
            "\nCalling: 1-" R(3) "-555-" R(4))
end

Hassium, 230 Bytes
func main(){foreach(x in range(1,31){println("Crime predicted: "+r(3)+"-"+r(2)+"-"+r(4));println("Calling: 1-"+r(3)+"-555-"+r(4)+"\n");}}
func r(l){z=new Random();a="";foreach(y in range(1,l))a+=z.next(0,10).toString();return a;}

Expanded:
func main () {
        foreach (x in range(1, 31) {
                println("Crime predicted: " + r(3) + "-" + r(2) + "-" + r(4));
                println("Calling: 1-" + r(3) + "-555-" + r(4) + "\n");
        }
}
func r (l) {
        z = new Random();
        a = "";
        foreach (y in range(1, l))
                a += z.next(0, 10).toString();
        return a;
}

PowerShell, 120 108 103 102 Bytes
0..29|%{("Crime predicted: XXX-XX-XXXX`nCalling: 1-XXX-555-XXX"-split"X"|%{$_+(Random 10)})-join'';""}

Shortened a few more bytes by setting the split-loop to instead be a code block that outputs to an array @(..) and is re-joined.
Eliminated the @ by remembering that (...) designates a code block executed before the -join'' anyway.
This eliminates needing to assign the $a variable. Also noticed that due to how the -split functionality works, the previous code was spitting out too many digits for the phone number, so got a free byte saving there by shrinking to 1-XXX-555-XXX. That made up for the erroneous Random 9 that actually picks random from 0-8, so we instead need to specify Random 10.
Sooo dang close to double-digits, but I'm not sure where it's possible to golf off another four 3 bytes ...

Previous, 108
0..29|%{$a="";"Crime predicted: XXX-XX-XXXX`nCalling: 1-XXX-555-XXXX"-split"x"|%{$a+="$_$(Random 9)"};$a;""}

Shortened the code a couple bytes by instead splitting a string on X's, then re-looping through the resultant array of strings and concatenating each entry with a Random digit to build our final output string $a. Note that we couldn't do something like "string".replace("x",$(Random 9)) because then the Random would only get called once, so you'd have 1-222-555-2222 for a phone number, for example.

Previous-er, 120
0..29|%{"Crime predicted: "+(Random 1e9).ToString("000-00-0000");"Calling: "+(Random 1e7).ToString("1-000-555-0000");""}

Pretty dang competitive for a verbose language, thanks to generous output specifications (i.e., 000-00-0001 is treated as a valid SSN) and the really robust .ToString() formatting algorithm that PowerShell uses. PowerShell also outputs \r\n after every string output, so the requirement for a newline in between iterations is just a simple "".
Note that this uses an implied Get- in front of Random, so this may be really slow on some platforms/implementations.

Ruby, 98 characters
30.times{puts"Crime Predicted: DEF-GH-IJKL
Calling: 1-MNO-555-QRST

".tr"D-OQ-T",rand.to_s[2..-1]}

Sample run:
bash-4.3$ ruby -e '30.times{puts"Crime Predicted: DEF-GH-IJKL\nCalling: 1-MNO-555-QRST\n\n".tr"D-OQ-T",rand.to_s[2..-1]}' | head
Crime Predicted: 867-29-2637
Calling: 1-278-555-5424

Crime Predicted: 913-31-6306
Calling: 1-744-555-8188

Crime Predicted: 868-36-4612
Calling: 1-926-555-3576

Crime Predicted: 988-06-1643

JavaScript, 146 141
console.log(Array(30).join("Crime predicted: 3-2-3\nCalling: 1-3-555-4\n\n").replace(/[2-4]/g,function(m){return(m+Math.random()).substr(3,m)}))

there is already answer in same language with less characters than yours.

@Jakuje the other answer uses ES6 which isn't widely available yet

Then it is probably ok. Mentioning this in your answer would be good.

@Jakuje People can submit whatever they want! It's as much about the challenge as it is about beating others.

pre-ES6 Javascript, 128
for(i=30;i--;)console.log('Crime predicted: x-x-x\nCalling: x-555-x\n'.replace(/x/g, function(){return 1e3*Math.random()|0}))

I feel like the dashes could be removed somehow, but not sure.

Several errors:1) random parts are not of correct length (and not even trying to) 2) missing "1-".

Befunge-98, 170
I think this can still be golfed down a bit. But at least I beat C#. Tested at befungius.aurlien.net.
a3*>  82*v>":detciderp emirC">:#,_$...'-,..'-,....av
>1 -:!#;_v^;v,,,"-555-"...,,,,,,,,,,,"Calling: 1-",<
\  ^v< <2?1v,
+    ^;^3<;<,
^ <0?3vv....<
^;^6<;<>a,v
   v_@#:-1<

Python 2, 151 150 bytes
from random import*
p="Crime predicted: xxx-xx-xxxx\nCalling: 1-xxx-555-xxxx\n\n"*30
while'x'in p:p=p.replace('x',str(randint(0,9)),1)
print p.strip()

As golfed as I could get this method.

source: Stack Exchange

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

sort: votes


text:
Rugby scores code golf
The Rugby World Cup starts in a few hours!
Write a program or function which, given a rugby team score as input, outputs all possible ways the score could have been attained in a Rugby game.
Ways to score in Rugby

Penalty kick/Drop kick: Both penalty kicks and a drop kicks are worth 3 points (We regroup them in this challenge to reduce the number of possibilities).
Try: A try is worth 5 points.
Conversion: A conversion is worth 2 points. It can only occur if a try occurs too (i.e. there can never be more conversions than trys in a game).

Input
Input is a positive integer, which corresponds to the total score of one team at the end of the game. You may assume that the score is valid, i.e. it can be attained using at least one combination of ways to score described above.
Ouput
The output for one possible way of attaining the score must look like this:
2K,1T,1C

(the numbers can obviously change).
the number before K is the number of penalty kicks and/or drop kicks, the number before T is the number of Trys, and the number before C is the number of conversions.
Since you have to output all possible ways the score could have been attained, you may output them either inside a list, or separate them with line breaks (which is what I'll use in the examples below).
Test cases

Input: 9

Output:
3K,0T,0C

There are no other possibilites (For example, 0K,1T,2C would give 9 points but a conversion cannot happen without a corresponding try).

Input: 12

Output:
4K,0T,0C
0K,2T,1C

Input: 19

Output:
0K,3T,2C
4K,1T,1C
3K,2T,0C

Input: 42

Output:
14K,0T,0C
10K,2T,1C
9K,3T,0C
7K,3T,3C
6K,4T,2C
5K,5T,1C
4K,6T,0C
3K,5T,4C
2K,6T,3C
1K,7T,2C
0K,8T,1C
0K,6T,6C

Scoring
This is code-golf, so the shortest code in bytes wins.

Related, borderline-dupe

@PeterTaylor Score is fixed, and only the total number of possibilities is required to be output in this challenge.

I'm not sure what you mean by "score is fixed", but on reflection the constraint that tries >= conversions probably saves this from being a dupe.

(nevermind for score is fixed, he explains his challenge with 78 cents and only says a few lines below that the amount can actually change).

Tries >= conversions is a false constraint IMO. In reality you can have a Kick (3pts), a Try (5pts), or a Converted Try (7pts). Does this then make it a duplicate @PeterTaylor?

Pyth, 42 bytes
V^Q3I&g@K.[Z3jNQ1eKqQs*VKj352Ts.iKc2"K,T,C

Try it out here.
This uses the same heuristic as Andrea Biondo's answer, in that it generates every possible combination of kicks, tries and conversions from 0 to (n-1). It prints the formatted output only if (number of tries) >= (number of conversions) and the total score is correct.
                                              Implicit: Q=eval(input()), T=10, Z=0
V^Q3                                          For N in [0 - ((Q^3)-1)]:
             jNQ                                Convert N to base Q to get 3-tuple
         .[Z3                                   Left-pad the above with 0 to length 3
        K                                       Store in K
       @K       1                               K[1]
                 eK                             Last element of K (i.e. K[2])
      g                                         Rule 1: is K[1] >= K[2]?
                         j352T                  [3,5,2]
                      *VK                       By-element multiplication of K with the above
                     s                          Take the sum
                   qQ                           Rule 2: is that sum equal to the input?
    I&                                          If rules 1 & 2 are true:
                                  c2"K,T,C        ['K,', 'T,' 'C']
                               .iK                Interleave K with the above
                              s                   Concatenate into string and output

Python 3, 113 104 bytes
a=int(input());print(['%sK,%sT,%sC'%(i%a,i/a%a+i%a,i%a)for i in range(a**3)if i%a*3+i/a%a*5+i/a/a*7==a])

First attempt at code golf. Brute force list comprehension. I'm assuming the list output is acceptable?
Counting tries + conversion as 7 points removes the if statement. Inspired by xor's python 2 answer.
Try it here

Yes this type of output is fine. Well done!

Welcome to Programming Puzzles & Code Golf!

R, 135 126 124 bytes
n=scan();a=expand.grid(k=0:n,t=0:n,c=0:n);with(a[a$c<=a$t&3*a$k+5*a$t+2*a$c==n,],cat(sprintf("%iK,%iT,%iC",k,t,c),sep="\n"))

Quick explanation:
n=scan()                            # Takes input from stdin
a=expand.grid(k=0:n,t=0:n,c=0:n)    # Creates matrix of all possible combinations of 3 integers from 0 to n
with(a[a$c<=a$t&3*a$k+5*a$t+2*a$c==n,], # Only keeps the one that produced a correct score
     cat(sprintf("%iK,%iT,%iC",k,t,c),sep="\n")) # Prints

Usage:
> n=scan();a=expand.grid(k=0:n,t=0:n,c=0:n);with(a[a$c<=a$t&3*a$k+5*a$t+2*a$c==n,],cat(sprintf("%iK,%iT,%iC",k,t,c),sep="\n"))
1: 9
2:
Read 1 item
3K,0T,0C
> n=scan();a=expand.grid(k=0:n,t=0:n,c=0:n);with(a[a$c<=a$t&3*a$k+5*a$t+2*a$c==n,],cat(sprintf("%iK,%iT,%iC",k,t,c),sep="\n"))
1: 42
2:
Read 1 item
14K,0T,0C
9K,3T,0C
4K,6T,0C
10K,2T,1C
5K,5T,1C
0K,8T,1C
6K,4T,2C
1K,7T,2C
7K,3T,3C
2K,6T,3C
3K,5T,4C
0K,6T,6C

CJam, 48 bytes
Quite slow, just generates all possible combination of values from 0 to score - 1 for K, T and C. Then filters out the ones where the sum isn't right or C > T.
qi:X,3m*{_)\1=)<\[Z5Y].*:+X=&},::s"KTC"f.+',f*N*

Try it online.
Explanation
qi:X                                             e# Take input as integer, assign to X
    ,3m*                                         e# Cartesian power [0 ... input-1]^3
        {                    },                  e# Keep values if:
         _)\1=)<                                 e#    Conversions <= Tries
                            &                    e#    AND
                \[Z5Y].*:+X=                     e#    Sum([k t c]*[3 5 2]) == X
                               ::s               e# [k t c] -> ["k" "t" "c"]
                                  "KTC"f.+       e# Vector append -> ["kK" "tT" "cC"]
                                          ',f*   e# Join with comma
                                              N* e# Join outer list with newline

R, 113 101 bytes
Not quite as elegant as @plannapus's answer.  Go the All Blacks :)
n=scan();for(C in 0:n)for(T in 0:n)for(P in 0:n)if(C*7+T*5+P*3==n)cat(P,'K,',C+T,'T,',C,'C\n',sep='')

Test run
> n=scan();for(C in 0:n)for(T in 0:n)for(P in 0:n)if(C*7+T*5+P*3==n)cat(P,'K,',C+T,'T,',C,'C\n',sep='')
1: 9
2:
Read 1 item
3K,0T,0C
> n=scan();for(C in 0:n)for(T in 0:n)for(P in 0:n)if(C*7+T*5+P*3==n)cat(P,'K,',C+T,'T,',C,'C\n',sep='')
1: 12
2:
Read 1 item
4K,0T,0C
0K,2T,1C
> n=scan();for(C in 0:n)for(T in 0:n)for(P in 0:n)if(C*7+T*5+P*3==n)cat(P,'K,',C+T,'T,',C,'C\n',sep='')
1: 42
2:
Read 1 item
14K,0T,0C
9K,3T,0C
4K,6T,0C
10K,2T,1C
5K,5T,1C
0K,8T,1C
6K,4T,2C
1K,7T,2C
7K,3T,3C
2K,6T,3C
3K,5T,4C
0K,6T,6C

Uh I would have never guessed that using 3 nested for loop would take less characters. Well done!

@plannapus surprised me as well

Python 2, 93
lambda n:["%dK,%dT,%dC"%(k/n/n,k%n+k/n%n,k%n)for k in range(n**3)if k%n*7+k/n%n*5+k/n/n*3==n]

An anonymous function. Generates all possible triples of values by converting a value k from 0 to n^3-1 to base n. Filters for those with the right sum. Try+conversion is considered a separate 7-point play, and the number of tries includes those too.

Haskell, 102 88 bytes
a#b=show a++b
f n=[k#"K,"++t#"T,"++c#"C"|q<-[[0..n]],k<-q,t<-q,c<-q,3*k+5*t+2*c==n,t>=c]

Usage example: f 19 -> ["0K,3T,2C","3K,2T,0C","4K,1T,1C"].
Edit: output in list format seems to be ok ...

Ruby, 89
->s{(s*s).times{|i|c=s-3*(k=i%s)-5*t=i/s
c%2>0||c<0||c/2>t||puts("#{k}K,#{t}T,#{c/2}C")}}

call like this:
g=->s{(s*s).times{|i|c=s-3*(k=i%s)-5*t=i/s
c%2>0||c<0||c/2>t||puts("#{k}K,#{t}T,#{c/2}C")}}

g.call(gets.to_i)

Loops through all possible K and T and calculates the score from conversions that is required.
If the score for conversions is not invalid, print the K,T,C combination that has been found.

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


text:
Print a table of numbers in decimal and 2**i bases
Computers live by binary. All programmers know binary.
But the 2**x bases are often neglected as non-practical, while they have beautiful relations to binary.
To show you one example of such a beatiful relation, 19 will be my testimonial.
19 10011 103 23 13 j

19 is decimal, included for clarity.
10011 is 19 in binary.
103, in base 4 is made starting from binary this way:

log2(4) == 2, let us remember two.
Pad 10011 so that it has a multiple of 2 length -> 010011
Take digits 2 by 2 from left to right and treat them as 2-digits binary numbers:

01 -> 1
00 -> 0
11 -> 3

Done, 10011 in base-4 is 103.

For base 8, do the same but 3-by-3 as log2(8) = 3.

Pad 010011
010 -> 2
011 -> 3
23, Done.

For base 16, do the same but 4-by-4 as log2(16) = 4.

Pad 00010011
0001 -> 1
0011 -> 3
13, Done.

Task
Given a max number as input, you shall output a table
base-ten-i base-two-i base-four-i base-eight-i base-sixteen-i base-thirtytwo-i

for i that goes from 0 to n inclusive. Binary numbers are the epitome of the absolute minimum needed to work, so your code should be as short as possible.
Restrictions and bonuses

Base-ten -> binary and binary -> Base-ten built-ins are considered loopholes as Base-a -> Base-b are.
If you generate all the 2**i (for i > 2) bases by using the relations over mentioned you get a *0.6 bonus, but general base conversions (written by yourself) are allowed.

Example table
> 32
0 0 0 0 0 0
1 1 1 1 1 1
2 10 2 2 2 2
3 11 3 3 3 3
4 100 10 4 4 4
5 101 11 5 5 5
6 110 12 6 6 6
7 111 13 7 7 7
8 1000 20 10 8 8
9 1001 21 11 9 9
10 1010 22 12 a a
11 1011 23 13 b b
12 1100 30 14 c c
13 1101 31 15 d d
14 1110 32 16 e e
15 1111 33 17 f f
16 10000 100 20 10 g
17 10001 101 21 11 h
18 10010 102 22 12 i
19 10011 103 23 13 j
20 10100 110 24 14 k
21 10101 111 25 15 l
22 10110 112 26 16 m
23 10111 113 27 17 n
24 11000 120 30 18 o
25 11001 121 31 19 p
26 11010 122 32 1a q
27 11011 123 33 1b r
28 11100 130 34 1c s
29 11101 131 35 1d t
30 11110 132 36 1e u
31 11111 133 37 1f v
32 100000 200 40 20 10

Downvoted because of "You must generate all the 2**i (for i > 2) bases by using the relations over mentioned". Requiring a specific algorithm removes a lot of what makes code golf interesting. You can ban built-in base conversion functions while still allowing a choice of algorithm.

@xnor now using my method only gives a bonus, to give more freedom to golfers

I'm not a fan of the bonus either. It effectively means you have to use either a built-in or your algorithm, and no other algorithm can be viable.

@xnor built-ins are not allowed. A general converter will be shorter, so I give a bonus if you use my contrived conversion rules

CJam, 54 * 0.6 = 32.4 bytes
q~){_5,f{)L@{2md@+\}h(%/Wf%W%{{\2*+}*_9>{'W+}&}%S\}N}/

Test it here.
For reference, here is a shorter solution which doesn't qualify for the bonus (at 39 bytes):
q~){:X5{SLX{2I)#md_9>{'W+}&@+\}h;}fIN}/

I updated the challange, you may claim a 0.6* bonus if you used my method

Pyth, 52 * 0.6 = 31.2 bytes
L?b+%b2y/b2YVUhQjd+NmjkX|_uL++GGHZ_McyNd]ZUQ+jkUTGS5

Test it online
My non-bonus answer is 39 bytes
M?G+g/GHH@+jkUTG%GHkVUhQjd+N|R0gLN^L2S5

PHP, 232 230 233 217 * 0.6 = 130.2
no chance beating the golfing languages, but I liked the challenge.
for(;$d<=$n;$d++){echo'
',$d|0;for($k=$d,$b='';$k;$k>>=1)$b=($k&1).$b;for($w=1;$w<6;$w++,print" $z"|' 0')for($z='',$k=strlen($b);-$w<$k-=$w;$z=($e>9?chr($e+87):$e).$z)for($e=0,$y=1,$j=$w;$j--;$y*=2) $e+=$y*$b[$j+$k];}

usage: prepend $n=32; or replace $n with 32 (or any other non-negative integer); call via cli
If that is not accepted, replace $n with $_GET[n] (+6/+3.6) and call either in the browser
or on cli with php-cgi -f bases.php -n=32
Replace the line break with <br> or prepend <pre> to test in browser
may throw notices for undefined variables and unintialized string offsets in newer PHP versions.
Remove E_NOTICE from error_reporting (prepend error_reporting(0);) to suppress them.
tested in 5.6

break down:
for(;$d<=$n;$d++) // loop decimal $d from 0 to $n
{
    echo'
',$d|0; // print line break and decimal
    for($k=$d,$b='';$k;$k>>=1)$b=($k&1).$b; // convert $d to binary
    for($w=1;$w<6;$w++,
        print" $z"|' 0' // print number generated in inner loop (echo doesn´t work here)
    )
        for($z='',$k=strlen($b);-$w<$k-=$w; // loop from end by $w
            $z=($e>9?chr($e+87):$e).$z // prepend digit created in body
        )
            for($e=0,$y=1,$j=$w;$j--;$y*=2) $e+=$y*$b[$j+$k]; // convert chunk to 2**$w
}

major edit:

used some index magic to revamp the inner loop -> now works backwards on the whole string (no more padding, no more splitting or copying the binary)
moved parts of the loop bodies to the heads to eliminate braces
had to add 7 4 bytes to fix the decimal 0 results after the revamp

non-bonus version, 142 bytes
for(;$d<=$n;$d++,print'
',$d|0)for($w=1;$w<6;$w++,print" $z"|' 0')for($k=$d,$y=1,$z='';$k&&$y<<=$w;$k>>=$w)$z=(9<($e=$k%$y)?chr($e+87):$e).$z;

PHP beats Python?
Even if I added the 6 (3.6) bytes to make the snippet a program, I´d still beat Python (223*0.6=133.8 or 148 non-bonus vs. 158). Amazing.

I get an error 'Undefined variable: n :1' and I think that you can save 1 byte by removing a space after the for keyword in the outermost for-loop.

@TuukkaX: see usage: $n must be define before the snippet. I found that byte, but thanks. And one more: "\n" -> physical line break.

but I had to add 3 bytes to print the first 0. (that or 5 bytes to init the variable).

Python3 - 189, 167, 166 150 bytes
for i in range(int(input())+1):f=lambda b,n=i,c="0123456789abcdefghijklmnopqrstuv":n<b and c[n]or f(b,n//b)+c[n%b];print(i,f(2),f(4),f(8),f(16),f(32))

Saved 16 bytes with the help of @LeakyNun!
Bonus version - 296 * 0.6 = 177.6 279 * 0.6 = 167.4 bytes
p=lambda b,c:"".join(str(int(b[i:i+c],2))for i in range(0,len(b),c))
z=lambda s:len(s)%2 and s or "0"+s
for i in range(int(input())+1):f=lambda n,b,c="0123456789abcdefghijklmnopqrstuv":n<b and c[n]or f(n//b,b)+c[n%b];v=f(i,2);d=z(v);print(i,v,p(d,2),p(d,3),p(d,4),p(d,5),f(i,32))

Slightly more readable version of the bonus version.
p=lambda b,c:"".join(str(int(b[i:i+c],2))for i in range(0,len(b),c))
z=lambda s:len(s)%2 and s or "0"+s
for i in range(int(input())+1):
    f=lambda n,b,c="0123456789abcdefghijklmnopqrstuv":n<b and c[n] or f(n//b,b) + c[n%b]
    v=f(i,2)
    d=z(v)
    print(i,v,p(d,2),p(d,3),p(d,4),p(d,5),f(i,32))

I am pretty certain that the bonus does not apply. You are not using binary to produce the base 2**x numbers.

@Titus Oh, I understood the bonus wrong then. I'll edit the byte count. Thanks!

Pretty sure "0123456789abcdefghijklmnopqrstuv" is shorter than from string import* digits+ascii_lowercase

@LeakyNun Oops. You're right. I only thought of how short it is to write digits+ascii_lowercase :D. Thanks!

150 bytes: for i in range(int(input())+1):f=lambda n=i,b,c="0123456789abcdefghijklmnopqrstuv":n<b and c[n]or f(n//b,b)+c[n%b];print(i,f(2),f(4),f(8),f(16),f(32)) (one line)

I translated your recursive approach to PHP (1901) and modified it to work on binary chunks (2460.6=147.6). Dare to try?

@Titus Go for it! :)

@LeakyNun the n=i and b need to swap places in the parameter list, since i is being before b and being a default parameter.

Actually I was asking if You would dare to reach for the bonus. :D

@Titus Ohh :D I interpreted differently. I can give it a shot if I find a reasonable short way to do it :P

@LeakyNun Hmm. Ran your 150 byte solution and it sadly doesn't work :( The f lambda doesn't return binary values, because of the n=i. I have to edit it a bit.

@Titus There you go! A little bit long, but it's a beautiful craft :D

It works

@LeakyNun Yeah, you're right. I passed th arguments to the f lambda in the wrong order.

if I am not mistaken: -7 for c=lambda n:(n,chr(n+87))[n>9]

Ruby, 80 bytes (non-bonus version)
m=ARGV[0].to_i;(0..m).each{|n|puts [10,2,4,8,16,32].map{|b|n.to_s(b)}.join(' ')}


text:
Track listings to time tables
Introduction
Don't you hate it when someone uploads an album you like to YouTube, but the description only contains a track listing? Like this:
1. Everything in Its Right Place - 4:11
2. Kid A - 4:44
3. The National Anthem - 5:50
4. How to Disappear Completely - 5:55
5. Treefingers - 3:42
6. Optimistic - 5:16
7. In Limbo - 3:31
8. Idioteque - 5:09
9. Morning Bell - 4:29
10. Motion Picture Soundtrack - 6:59

Now you don't know when Morning Bell starts unless you sum a bunch of times in your head! Usually, some good soul will come by and leave a handy time table in the (dreaded) comments section, which looks something like this:
(0:00:00) Everything in Its Right Place
(0:04:11) Kid A
(0:08:55) The National Anthem
(0:14:45) How to Disappear Completely
(0:20:40) Treefingers
(0:24:22) Optimistic
(0:29:38) In Limbo
(0:33:09) Idioteque
(0:38:18) Morning Bell
(0:42:47) Motion Picture Soundtrack

Specification

Your task is to write a program or function that takes a track listing as input and a time table as output.

You may choose to read input from STDIN, or an argument string, or an argument list of lines. Similarly, you may choose to print output to STDOUT, or return a string, or return a list of lines. Failing these, do whatever makes sense for your language.

You may assume each input line has the format (\d+)\. [A-Za-z0-9 ]{1,100} - (\d+):(\d\d). For the regex-impaired, this essentially means you can assume each line is well-formatted (as above) and song titles consist only of alphanumeric ASCII characters and spaces, and are no longer than 100 bytes long.
A track's length is always at least 0:01 and no more than 59:59.
The track numbers are increasing order, starting from 1, and counting up to no more than 99.
The total length of an album is no more than 9:59:59.

This is code-golf, so shortest code (in bytes) wins.
Test case
Your program should correctly perform the conversion presented in the introduction (Radiohead's Kid A). Here is a bigger test case (Sufjan Stevens' Illinois1) with long strings your program should also work on:
1. Concerning the UFO Sighting Near Highland Illinois - 2:08
2. The Black Hawk War - 2:14
3. Come On Feel the Illinoise - 6:45
4. John Wayne Gacy Jr - 3:19
5. Jacksonville - 5:24
6. A Short Reprise for Mary Todd Who Went Insane but for Very Good Reasons - 0:47
7. Decatur or Round of Applause for Your Stepmother - 3:03
8. One Last Whoo Hoo for the Pullman - 0:06
9. Chicago - 6:04
10. Casimir Pulaski Day - 5:53
11. To the Workers of the Rock River Valley Region - 1:40
12. The Man of Metropolis Steals Our Hearts - 6:17
13. Prairie Fire That Wanders About - 2:11
14. A Conjunction of Drones Simulating the Way - 0:19
15. The Predatory Wasp of the Palisades Is Out to Get Us - 5:23
16. They Are Night Zombies They Are Neighbors They Have Come Back from the Dead Ahhhh - 5:09
17. Lets Hear That String Part Again Because I Dont Think They Heard It All the Way Out in Bushnell - 0:40
18. In This Temple as in the Hearts of Man for Whom He Saved the Earth - 0:35
19. The Seers Tower - 3:53
20. The Tallest Man the Broadest Shoulders - 7:02
21. Riffs and Variations on a Single Note - 0:46
22. Out of Egypt into the Great Laugh of Mankind and I Shake the Dirt from My Sandals as I Run - 4:21

The correct output is:
(0:00:00) Concerning the UFO Sighting Near Highland Illinois
(0:02:08) The Black Hawk War
(0:04:22) Come On Feel the Illinoise
(0:11:07) John Wayne Gacy Jr
(0:14:26) Jacksonville
(0:19:50) A Short Reprise for Mary Todd Who Went Insane but for Very Good Reasons
(0:20:37) Decatur or Round of Applause for Your Stepmother
(0:23:40) One Last Whoo Hoo for the Pullman
(0:23:46) Chicago
(0:29:50) Casimir Pulaski Day
(0:35:43) To the Workers of the Rock River Valley Region
(0:37:23) The Man of Metropolis Steals Our Hearts
(0:43:40) Prairie Fire That Wanders About
(0:45:51) A Conjunction of Drones Simulating the Way
(0:46:10) The Predatory Wasp of the Palisades Is Out to Get Us
(0:51:33) They Are Night Zombies They Are Neighbors They Have Come Back from the Dead Ahhhh
(0:56:42) Lets Hear That String Part Again Because I Dont Think They Heard It All the Way Out in Bushnell
(0:57:22) In This Temple as in the Hearts of Man for Whom He Saved the Earth
(0:57:57) The Seers Tower
(1:01:50) The Tallest Man the Broadest Shoulders
(1:08:52) Riffs and Variations on a Single Note
(1:09:38) Out of Egypt into the Great Laugh of Mankind and I Shake the Dirt from My Sandals as I Run

Leaderboard
For your score to appear on the board, it should be in this format:
# Language, Bytes

var QUESTION_ID=58231,OVERRIDE_USER=3852;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

1. Apologies to Sufjan, whose amazing track names I had to mangle a bit in order to make them fit the simple format this problem is limited to.

May the output contain trailing spaces?

Radiohead and Sufjan Stevens? Meh :-P

Nope; the format for each line is (h:mm:ss) Track Name, followed immediately by a newline.

@LuisMendo Feel free to demonstrate your superior music tastes in your answer...?

Hahaha. That's a good additional motivation to answer. BTW I liked the challenge and I've upvoted it

Is it disallowed to use (hh:mm:ss), for instance (01:01:22)?

Yes, that's disallowed. It must be (h:mm:ss) exactly.

CJam, 60 57 55 bytes
Thanks to Sp3000 for saving 2 bytes.
qN/{T60bZ0e["(%d:%02d:%02d) "e%\S/1>)':/60bT+:T;W<S*N}/

Test it here.
Explanation
qN/{      e# Read input and split into lines.
  T60b    e# Push T (initially zero, we use this to keep track of the total time in
          e# seconds), and convert it to base 60.
  Z0e[    e# Pad it with zeroes to 3 digits to get hours, minutes, seconds.
  "(%d:%02d:%02d) "e%
          e# Get the (h:mm:ss) part using a format string.
  \S/     e# Pull up the current line, split on spaces.
  1>      e# Discard the first segment, i.e. the track number.
  )':/    e# Pull off the last segment, i.e. the time, and split on colons.
  60b     e# Interpret the two parts as base-60 digits to get the amount of seconds
          e# for the track.
  T+:T;   e# Add this to T and discard it.
  W<      e# Discard the last segment of the remaining string (the hyphen).
  S*N     e# Join the song name back together with spaces and push a line feed.
}/

goddammit Martin

Perl, (93 chars plus -p) 94 bytes
s!\d+\. (.+) - (\d+:(\d+))!sprintf"(%d:%02d:%02d) $1",$n/3600,$n%3600/60,$n%60,$n+=$3+60*$2!e

To run:
perl -pe 's!\d+\. (.+) - (\d+:(\d+))!sprintf"(%d:%02d:%02d) $1",$n/3600,$n%3600/60,$n%60,$n+=$3+60*$2!e' <<< '<input>'

Python 2, 170 160 Bytes
Been a while since I've done a golf, hopefully this isn't too bad :P
t=0
for i in input().split('\n'):i=i.split(' - ');print'(%d:%02d:%02d)'%(t/3600,t%3600/60,t%60),i[0].split('. ')[1];k=i[-1].split(':');t+=int(k[0])*60+int(k[1])

The input should be surrounded by quotes, and split by newlines, like so:
"1. Concerning the UFO Sighting Near Highland Illinois - 2:08\n2. The Black Hawk War - 2:14\n3. Come On Feel the Illinoise - 6:45\n4. John Wayne Gacy Jr - 3:19\n5. Jacksonville - 5:24\n6. A Short Reprise for Mary Todd Who Went Insane but for Very Good Reasons - 0:47\n7. Decatur or Round of Applause for Your Stepmother - 3:03\n8. One Last Whoo Hoo for the Pullman - 0:06\n9. Chicago - 6:04\n10. Casimir Pulaski Day - 5:53\n11. To the Workers of the Rock River Valley Region - 1:40\n12. The Man of Metropolis Steals Our Hearts - 6:17\n13. Prairie Fire That Wanders About - 2:11\n14. A Conjunction of Drones Simulating the Way - 0:19\n15. The Predatory Wasp of the Palisades Is Out to Get Us - 5:23\n16. They Are Night Zombies They Are Neighbors They Have Come Back from the Dead Ahhhh - 5:09\n17. Lets Hear That String Part Again Because I Dont Think They Heard It All the Way Out in Bushnell - 0:40\n18. In This Temple as in the Hearts of Man for Whom He Saved the Earth - 0:35\n19. The Seers Tower - 3:53\n20. The Tallest Man the Broadest Shoulders - 7:02\n21. Riffs and Variations on a Single Note  - 0:46\n22. Out of Egypt into the Great Laugh of Mankind and I Shake the Dirt from My Sandals as I Run - 4:21"

I think you can just have %d for the hours counter (if I understand the rules correctly!) for -2!

Add 4 chars (input to raw_input) to accept the exact format; otherwise I believe it's invalid as it assumes lines in a different format.

C++, 212 209 202 189 bytes
C++ because.. why not?
#include<iostream>
long d,t,u;main(){std::string a,b(8,0);while(getline(std::cin>>t>>a[0],a,'-')>>t>>b[0]>>u){strftime(&b[0],9,"%T",gmtime(&d));b[0]='(';std::cout<<b+")"+a+'\n';d+=t*60+u;}}

Live:
212
209
202
189

Python 2, 207 206 bytes
h=m=s=0
for i in raw_input().splitlines():
 print("(%d:%.2d:%.2d) "%(h,m,s),i.split('-')[0].split('. ')[1])
 t=i.split('-')[1].split(':')
 m+=int(t[0]);s+=int(t[1]);r=s//60;s-=r*60;m+=r;r=m//60;m-=r*60;h+=r

Usage
$ python test.py
'1. Concerning the UFO Sighting Near Highland Illinois - 2:08\n2. The Black Hawk War - 2:14\n3. Come On Feel the Illinoise - 6:45'
(0:00:00) Concerning the UFO Sighting Near Highland Illinois
(0:02:08) The Black Hawk War
(0:04:22) Come On Feel the Illinoise

What version of Python 3 are you using? I thought raw_input only existed in Python 2.

Fixed. I guess I'm just used to typing "3". @Mauris

Gema, 151 characters
\B=@set{t;}
<D>. * - <D>\:<D>=(@div{$t;3600}:@fill-right{00;@div{@mod{$t;3600};60}}:@fill-right{00;@mod{$t;60}}) *@set{t;@add{@add{$t;$4};@mul{$3;60}}}

Sample run:
bash-4.3$ gema '\B=@set{t;};<D>. * - <D>\:<D>=(@div{$t;3600}:@fill-right{00;@div{@mod{$t;3600};60}}:@fill-right{00;@mod{$t;60}}) *@set{t;@add{@add{$t;$4};@mul{$3;60}}}' tracklist.txt
(0:00:00) Concerning the UFO Sighting Near Highland Illinois
(0:02:08) The Black Hawk War
(0:04:22) Come On Feel the Illinoise
(0:11:07) John Wayne Gacy Jr
(0:14:26) Jacksonville
(0:19:50) A Short Reprise for Mary Todd Who Went Insane but for Very Good Reasons
(0:20:37) Decatur or Round of Applause for Your Stepmother
(0:23:40) One Last Whoo Hoo for the Pullman
(0:23:46) Chicago
(0:29:50) Casimir Pulaski Day

awk, 119 101 bytes
{split($NF,t,":");$1=$(--NF)="";--NF;print"("substr(strftime("%H:%M:%S",s,1),2)")"$0;s+=t[1]*60+t[2]}

This is way longer than I wanted it to be. The problem is that %H doesn't format the hours like requested, so I needed to calculate the hours myself.
Ack, I'm stupid. The results of strftime were wrong because I needed to tell it to use UTC time. That cut 18 bytes off!
119-byte version
{split($NF,t,":");$1=$(--NF)="";--NF;print"("(h||0)":"strftime("%M:%S",s)")"$0;s=(r=s+t[1]*60+t[2])%3600;h=int(r/3600)}

Python 3 (3.8>=), 115 bytes
a=0
while 1:_,*s,_,t=input().split();print(f"({a//3600}:%02d:%02d)"%(a//60%60,a%60),*s);a+=int(t[0])*60+int(t[2:4])

Ungolfed version:
a = 0
while True:
    _,*s,_,t = input().split()                         # Skip firt element and the second to last
    print(f"({a//3600}:%02d:%02d)"%(a//60%60,a%60),*s) # Print time + what is between the number and the -
    a+=int(t[0])*60+int(t[2:4])                        # Increment time

Exit with error.
Attempt This Online!

Ruby, 112 109 bytes
-3 bytes thanks to Steffan
a=0
loop{_,*s,_,t=gets.split;puts "(%d:%02d:%02d) "%[a/3600,a/60%60,a%60]+s*' ';a+=t[0].to_i*60+t[2..4].to_i}

Exit with error
Attempt This Online!

(...)while 1 => loop{...}

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


text:
16-bit binary grid
Given any unsigned 16 bit integer, convert its decimal form (i.e., base-10) number into a 4x4 ASCII grid of its bits, with the most-significant bit (MSB) at the top left, least-significant bit (LSB) at bottom right, read across and then down (like English text).
Examples
Input: 4242
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+
|   |   |   |   |
+---+---+---+---+
| # |   |   | # |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+

Input: 33825
+---+---+---+---+
| # |   |   |   |
+---+---+---+---+
|   | # |   |   |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+

Specific Requirements

Input must be in decimal (base-10), however you may convert to binary any way you wish (including using language built-ins, if available).
Output table format must match  exactly. This means you must use the specific ASCII characters (-, +, and |) for the table grid lines as shown, each cell's interior is 3 characters, and true bits are represented by # while false is represented by a space ().
Leading or trailing whitespace is not permitted. Final newline is required.
Bit order must match the examples as described.

Allowances

Input must be a base-10 number on the command line, standard input, or user input, but must not be hard-coded into your source code.

May the clearest shortest code win! :-)

Related

The first sentence sounds confusing to me, where it says "convert its decimal form". Based on the rest of the post and the example, it looks like the input is given in decimal form, but you have to convert the binary form of the value into a grid.

@RetoKoradi you are essentially correct, but the question does require you to convert a decimal number into a binary grid. There is no explicit requirement to ever work with a binary number, only a likely implementation detail.

Does writing a function with the base-10 number as the function argument count as user input?

Since you say that the given number is an "unsigned 16 bit integer", it is  by definition in binary form. When I first read this, it actually sounded like the input would be given in binary form. It all becomes clear towards the end. But at least for me, the first paragraph really doesn't capture the problem at all.

@RetoKoradi OK, I understand the confusion now. You say "it is by definition in binary form", but in computing, saying something is an "N-bit integer" simply means it is an integer with a width of N bits (and usually the width is a common power of 2, such as an 8-bit integer (octet, byte), 16-bit, 32-bit, 64-bit). The integer size has nothing to do with its representation. A 16-bit integer can be expressed in any real base, including binary and decimal. See for example https://en.wikipedia.org/wiki/32-bit

@AlexA. Yes, that's acceptable

Then in the case of a function, can output be returned or must it be printed to STDOUT?

@AlexA. I was thinking printed output, as that seems to be the norm, but I don't see how allowing returned value instead of STDOUT would invalidate anyone's solution or give anyone an unreasonable advantage, so I'm inclined to allow either. What do you think?

In javascript return is better than the unreasonable console.log. But in javascript and many other languages you can avoid the return token at all in many cases.

J, 26 bytes
('   ';' # '){~4 4$_16{.#:

An anonymous verb. Thankfully, J is very good at drawing boxes. Let's try it out:
   f =. ('   ';' # '){~4 4$_16{.#:
   f 4242
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+
|   |   |   |   |
+---+---+---+---+
| # |   |   | # |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+

As some commenters have mentioned, the way J draws boxes is system-dependent: on some platforms, this code will work under the default settings, but on others, the boxes will be drawn using Unicode line drawing characters. (The commands 9!:6 and 9!:7 allow you to query and set the characters to draw boxed values with, respectively.)

Do you (or anyone else) know if there's a consensus on the box drawing command for golf scoring, then? I personally think the assumption with code golf is that solutions work on a majority of systems that the solution's language runs on, right? What would a solution look like that outputs the correct boxes on all (or almost all) J installations? I really like your solution, by the way! My brain is still working its way through, which is exactly what I like about code golf.

@type_outcast We don't require portability for code golf challenges. As long as it works with some implemenation on one platform, it's valid.

Thanks for the response @Dennis. I'm happy my presumption was incorrect, then, because I (still) really like Mauris' solution! :-)

JavaScript (ES6), 102
... or 96 using return instead of console.log.
Test running the snippet below in an EcmaScript 6 compliant browser.

f=n=>{for(o=h=`
+---+---+---+---+
`,z=16;z--;n/=2)o=(z&3?'':h+'|')+` ${' #'[n&1]} |`+o;console.log(o)}

// TEST
console.log=x=>O.innerHTML=x+O.innerHTML

function test(n) { f(n); console.log(n); }
<input id=I value=4680><button onclick='test(+I.value)'>-></button>

Is "JavaScripy" some strange javascript/python mashup? ;-)

@DigitalTrauma of course. But as the world is not ready (http://tvtropes.org/pmwiki/pmwiki.php/Main/TheWorldIsNotReady) for this new evolution, I'll revert to JavaScript

Cool, this works on Edge!

Must... not... click... tvtropes...

Befunge-93, 196 218 bytes
&00p12*v>>4>"---+",v v <
v*:*:*:<   | :-1,,,< #
>:*2/10p^  >"+",25*,10g|
     > #v^#         $< @
 25*,^  >4" |",,v ,*<>
v>"#",00g10g-00p 10g
 |`-1g01g00     <>48^
v>" ",10g
>2/10p>"| ",,1-:#^_$>^

To run the program...

Go to the online interpreter.
Paste this code in the big text box.
Click Show.
Input the desired number in the Input box.
Click Run. (Or change Slow to something like 5 milliseconds and then click Show.)
Ta-da!

Output for 4242:
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+
|   |   |   |   |
+---+---+---+---+
| # |   |   | # |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+

Output for 33825:
+---+---+---+---+
| # |   |   |   |
+---+---+---+---+
|   | # |   |   |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+

Explanation
Oh goodness, what have I got myself into? Well, here goes! (Irrelevant code is replaced with .s.)
Part 1: Get input (store in 0,0) and calculate 32768 (store in 1,0).
&00p12*v>
v*:*:*:<
>:*2/10p^

Part 2: Print out "+---+---+---+---".
>4>"---+",v
  | :-1,,,<

Part 3: Print "+" and a newline and check to see if (1,0) is 0 (i.e. we're done). If so, terminate. Otherwise, continue.
 ........... v <
   | ....... #
   >"+",25*,10g|
v.#         $< @
>4" |",,v ...

Part 4: Get binary digits of input, updating (0,0) and (1,0) as we go along. Print the right things. I take advantage of Befunge's wrap-around behavior.
 .....  >4" |",,v ,*<.
v>"#",00g10g-00p 10g
 |`-1g01g00     <>48^
v>" ",10g
>2/10p>"| ",,1-:#^_...

Part 5: Print a newline and go back to the part that prints "+---+---+---+---+". Wrap-around trick is used.
     > #.^.         .. .
 25*,^  ......... ...>
................ ...
 .........      .....
........
.................._$>^

Ta-da!

Julia, 156 143 bytes
n->(p=println;l="+"*"---+"^4;for i=1:4 p(l,"\n| ",join([j>"0"?"#":" "for j=reshape(split(lpad(bin(n),16,0),""),4,4)[:,i]]," | ")," |")end;p(l))

Ungolfed:
function f(n::Int)
    # Convert the input to binary, padded to 16 digits
    b = lpad(bin(n), 16, 0)

    # Split b into a 4x4 matrix
    m = reshape(split(b, ""), 4, 4)

    # Store the line separator for brevity
    l = "+" * "---+"^4

    # Print each column of the matrix as a row
    for i = 1:4
        println(l, "\n| ", join([j > "0" ? "#" : " " for j = m[:,i]], " | "), " |")
    end

    # Print the bottom of the table
    println(l)
end

Try it online

Python 2, 157 153 151 146 bytes
J=''.join;R='+---'*4;i=format(input(),'016b')
print J(R+'+\n|'+J(' '+('#'if int(l)else' ')+' |'for l in i[n*4:-~n*4])+'\n'for n in range(4)),R+'+'

Thanks to Morgan Thrapp for saving 4 bytes, and to Jonathan Frech for saving 5.
Usage
$ python test.py
33825
+---+---+---+---+
| # |   |   |   |
+---+---+---+---+
|   | # |   |   |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+

You can save two bytes if you pull '+---'*4 into a variable and two more if you do j=''.join

No problem! I was actually working on a very similar solution.

@downvoter Care to explain?

Since you do not use Python 3, you can replace int(input()) with input() and save five bytes.

Ruby, 118 114
b="%016b"%gets
l=?++"---+"*4
1.upto(16){|i|puts l if i%4==1
print"| #{b[i-1]==?0?' ':?#} "
puts ?|if i%4<1}
puts l

thanks for @w0lf for saving some characters.

You can save some bytes if you write literal characters using the ? notation (ex: ?| instead of '|'). This works for everything except space.

@w0lf I have found that ?\s works for space, however it is not actualy helpful here.

GNU sed + dc, 116
Score includes +1 for -r flags to sed:
s/.*/dc -e2o&p/e
:
s/^.{,15}$/0&/;t
s/./| & /g
s/.{16}/\n+---+---+---+---+\n&|/g
y/01/ #/
s/\n([-+]+)(.*)/\1\2\n\1/

Test output:
$ { echo 4242 ; echo 33825 ; } | sed -rf 16bitgrid.sed
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+
|   |   |   |   |
+---+---+---+---+
| # |   |   | # |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+
+---+---+---+---+
| # |   |   |   |
+---+---+---+---+
|   | # |   |   |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+
$

Alternatively:
Pure sed, 146
You might think it's cheating to use sed's GNU extension to eval a dc command.  In that case, we can do this a little differently, according to this meta-answer.  Of course the question clearly states that input must be in base 10, but here I'm attempting to claim that we can override that for sed answers and use unary (base 1) instead.
:
s/11/</g
s/<([ #]*)$/< \1/
s/1/#/
y/</1/
t
:a
s/^.{,15}$/0&/;ta
s/./| & /g
s/.{16}/\n+---+---+---+---+\n&|/g
y/01/ #/
s/\n([-+]+)(.*)/\1\2\n\1/

Test output
Using printf to generate the necessary unary string:
$ printf "%33825s" | tr ' ' 1 | sed -rf 16bitgrid.sed
+---+---+---+---+
| # |   |   |   |
+---+---+---+---+
|   | # |   |   |
+---+---+---+---+
|   |   | # |   |
+---+---+---+---+
|   |   |   | # |
+---+---+---+---+
$

Nice one. This looks somewhat similar to the Perl solution I came up with as a (private) proof of concept while fine-tuning the question.

@type_outcast BTW its perfectly OK to post your own solution as an answer :)

I know :-)  I didn't spend much time golfing it, as I was more focused on putting up a good question, but I may yet revisit it and post it if I can golf it into something at least halfway respectable. At the moment I'm having too much fun grokking everyone else's answers.

Pyth, 37 bytes
Jj*3\-*5\+JVc4_m@" #".>Qd16jd.i*5\|NJ

Try it online: Demonstration or Test Suite
Explanation:
Jj*3\-*5\+J
  *3\-                       the string "---"
      *5\+                   the string "+++++"
 j                           join second by first string:
                                "+---+---+---+---+"
J                            save in J
          J                  print J

Vc4_m@" #".>Qd16jd.i*5\|NJ
    m         16             map each d in [0, 1, ..., 15] to:
          .>Qd                 input number Q shifted to the right by d
     @" #"                     and take the ^th char in " #" (modulo 2)
   _                         reverse this list of chars
 c4                          split into 4 groups
V                            for each group N in ^:
                    *5\|       the string "|||||"
                  .i    N      interleave ^ with N
                jd             join chars with spaces and print
                         J     print J

C++11, 193 191 190 176 172 bytes
My first solution on codegolf ever, so do not blame me.
#include<iostream>
int n,j,i=65536;int main(){std::cin>>n;for(;j<9;){for(int k:{0,0,0,0})if(j%2)printf("| %s",n&(i/=2)?"# ":"  ");else printf("+---");puts(j++%2?"|":"+");}}

Ungolfed
#include <iostream>
int n, i = 65536, j;

int main()
{
    std::cin >> n;

    for (; j < 9;)
    {
        for(int k:{0,0,0,0})
        {
            if (j % 2)
            {
                printf("| %s", n & (i /= 2) ? "# " : "  ");
            }
            else
            {
                printf("+---");
            }
        }
        puts(j++ % 2 ? "|" : "+");
    }
}

Previous version
#include <iostream>
using namespace std;

int n, i = 65536, j;
int main()
{
    cin >> n;

    for (; j < 9;)
    {
        for(int k:{0,0,0,0})
        {
            if (j % 2)
            {
                cout << "| " << (n & (i /= 2) ? "# " : "  ");
            }
            else
            {
                cout << "+---";
            }
        }
        cout << (j++ % 2 ? "|\n" : "+\n");
    }
}

Hint: 0x10000 is 65536, having '0x' prefix, hex is always longer than decimal

Hint 2: youd should avoid using namespace std in production code. And it's not useful here too.

@edc65 dec->hex good idea, I always thought of hex having shorter representation, but forget about 0x. using namespace std saves few bytes, because I do not have to prefix cout and cin with std::. Even using just using std::cout; wont help.

Hey Zereges. You can remove the space between the include and the library.. and remove the return type for the main function.

C++ does not support auto int.

But can you use this syntax int n, i = 65536, j, main() { /* your code */ }? It looks cool and is likely to work.

@anatolyg Does not work for me. error: a function-definition is not allowed here before '{' token

CJam, 43 41 bytes
'+5*'-3**N+ri2bG0e[4/{" #"f='|5*.\S*N2$}/

Definitely golfable, but it's a start I guess. Generates the top row, then for each 4 bits it creates an even row and copies the previous odd row.
Try it online.

Python 2, 94
n=input()
s=();exec"s=(' #'[n%2],)+s;n/=2;"*16
a='+---'*4+'+\n'
print(a+'| %s '*4+'|\n')*4%s+a

The idea is to take the pattern
+---+---+---+---+
| _ | _ | _ | _ |
+---+---+---+---+
| _ | _ | _ | _ |
+---+---+---+---+
| _ | _ | _ | _ |
+---+---+---+---+
| _ | _ | _ | _ |
+---+---+---+---+

except with %s in place of blanks and perform tuple substitution. The tuple looks like
('#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ', '#')

It is created by taking taking off digits from the input in binary and adding the corresponding symbol to the front of the tuple. An expression with explicit tuple gave equal length.
%tuple(' #'[c>'0']for c in bin(input()+4**8)[3:])

Thanks to Sp3000 for 2 bytes.

PowerShell, 203 188 182 Bytes
param($a)$l="+---+---+---+---+";$l;$b=([int64][convert]::ToString($a,2)).ToString(@(,"0"*16)-join'');@(1..16|%{if($b[$_-1]-eq'1'){"| # "}else{"|   "};if($_%4-eq0){"|`n$l`n"}})-join''

Edit - saved 15 bytes by changing the order that | are drawn, so we can dump the .TrimEnd("|") on the output and instead convert the for-loop into a subcode block that produces an array
Edit2 - saved another 6 bytes by eliminating need for saving into the $o variable and just outputting with -join'' directly.
Ooooooooof.
Drawing in PowerShell is hard. Working with binary digits in PowerShell is hard.
Uses built-ins to [convert] the input integer to a string representation in binary, then re-cast back to an [int64] so we can re-call .ToString() in order to prepend/pad the appropriate number of zeroes. (Note that creating an array of strings and joining them @(,"0"*16)-join'' is 1 character shorter than the literal string "0000000000000000")
Then, take a simple for-loop 1..16|%{...} checking each digit to build up our output array, then finally -join'' that back together.

Previous, 188
param($a)$l="+---+---+---+---+";$l;$b=([int64][convert]::ToString($a,2)).ToString(@(,"0"*16)-join'');$o=@(1..16|%{if($b[$_-1]-eq'1'){"| # "}else{"|   "};if($_%4-eq0){"|`n$l`n"}});$o-join''

Previous-er, 203
param($a)$l="+---+---+---+---+`n|";$o=$l;$b=([int64][convert]::ToString($a,2)).ToString(@(,"0"*16)-join'');1..16|%{if($b[$_-1]-eq'1'){$o+=" # |"}else{$o+="   |"};if($_%4-eq0){$o+="`n$l"}};$o.TrimEnd('|')

I hope it was a "fun hard". :-) +1 for your explanation; it helped my limited understanding of PowerShell.

Python 2, 122 121 120 bytes
n=bin(4**8+input())[3:]
i=0
exec"print'| %s |'%' | '.join(' #'[x>'0']for x in n[:4])*i or'+---'*4+'+';n=n[4*i:];i^=1;"*9

-1 byte thanks to @xnor's neat 4**8+ trick. The main printing is done by looping 9 times, selecting the appropriate row for odd/even.

I think that bin(4**8+input())[3:] saves a byte over format

@xnor Oh, that's neat :)

Javascript (ES6), 216 207 bytes
Defines an anonymous function.
i=>(","+("0".repeat(16)+i.toString(2)).slice(-16).split``.map((v,l,a)=>l%4<1?"| "+a.slice(l,l+4).map(v=>v?"#":" ").join` | `+" |":"").filter(v=>!!v).join`,`+",").replace(/,/g, `
+---+---+---+---+
`).slice(1)

Thanks to ETHproductions for tips!

Nice work! Since you're using ES6, here's a few tips: 1. Anytime you need to use a string as a function's only parameter, you can use a template string, like so: .join` | ` 2. You can also use template strings for interpolating values: i=>`,${"0".repeat....join`,`},`.replace... 3. You can find more ES6 tips on this thread.

This seems to have stopped working, but by golfing it a bit more, I can get 197 with the correct result: i=>`,${("0".repeat(16)+i.toString(2)).slice(-16).split``.map((v,l,a)=>l%4?"":"| "+a.slice(l,l+4).map(v=>' #'[v]).join` | `+" |").filter(v=>v).join`,`},`.replace(/,/g,`<line break>+---+---+---+---+<line break>`).slice(1)

("0".repeat(16)+i.toString(2)).slice(-16)  --> (65536|i).toString(2).slice(1)

Keeping your exact logic, this can be golfed to 169, see https://jsfiddle.net/76fp7aw6/

Perl, 103 bytes
$_=(($l='+---'x4 .'+
').'| x 'x4 .'|
')x4 .$l;@n=(sprintf'%016b',<>)=~/./g;s/x/$n[$x++]?'#':$"/eg;print

Lots of string repetition to make a grid of xs, convert the input to binary and then s/// the xs to # or $" () depending on the flag at the specified position ($x).

PHP, 159 bytes
bingrid16.php:
<?$r=10;while(--$r){if($r%2){echo str_repeat('+---',4).'+';}else{$c=9;echo'|';while(--$c){echo' '.($c%2?'|':($argv[1]&pow(2,$r*2+$c/2-5)?'#':' '));}}echo"\n";}

Usage:
php bingrid16.php 4242

Nothing fancy, just brute-forced the rendering.
I tried another angle using arrays instead of loops, but it was longer at 224 bytes:
<?=implode(array_map(function($r)use($argv){return($r%2?str_repeat('+---',4).'+':'|'.implode(array_map(function($c)use($r,$argv){return' '.($c%2?'|':($argv[1]&pow(2,$r*2+$c/2-5)?'#':' '));},range(8,1))))."\n";},range(9,1)));

CJam, 62 bytes
"+---|   "4/{4*_c+N+}%4*_0=]sqi2bG0e[ee{~{_9*\4%5*-K+'#t0}&;}/

Try it online.

Pyth, 50 bytes
j.i*5]<3*5"+---"ms.i*5\|dc4mj@" #"qd\1*2\ .[Z16.BQ

Explanation will have to wait until another time, I'm posting this on my phone!

Ruby, 102
n=gets.to_i
print j="+---"*4+"+
"
19.downto(0){|i|print i%5>0?"| #{((n>>i*4/5)%2*3+32).chr} ":"|
"+j}

Algorithm
Print a horizontal divider
Loop 20 times (19..0)
If loop number does not divide by 5, convert into a number in the range 16..0 by multiplying by 4/5. Print a space (ascii 32) or # (ascii 32+3=35) preceded by |  and followed by a space.
If loop number divides by 5, print a terminating |, newline, and a horizontal divider identical to the first.

Perl 5, 85 84 bytes
84 83 bytes of code + -p flag
-1 byte after Dom reminded me to use a newline
say$\='+'."---+"x4,"
| ",map y/01/ #/r.' | ',/./g for(sprintf"%016b",$_)=~/..../g}{

Try it online!

Nice, much better approach than mine! A literal newline will save you an extra byte over $/ too!

Vyxal j, 47 bytes
b:L16-(0p)4ẇƛƛ‛ #$i`| % `$%;ṅ\|+;\+:3-4*pw5ẋf$Y

Try it Online!
A big mess

You sure there isn't a flag that can be used here?

@lyxal True, forgot

Japt -R, 40 36 bytes
This'll need another pass once I'm properly caffeinated!
5Æ17î-³i+ÃíUs'#iS)ùG ®û3 i|ÃòG)cf ú|

Try it
5Æ17î-³i+ÃíUs'#iS)ùG ®û3 i|ÃòG)cf ú|     :Implicit input of integer U
5Æ                                       :Map the range [0,5)
  17î                                    :  Repeat the following to length 17
     -³                                  :    "-" repeated 3 times
       i+                                :    Prepend a "+"
         Ã                               :End map
          í                              :Interleave with
           Us                            :  U converted to a string in the following base
             '#i                         :    "#" prepended with
                S                        :    A space
                 )                       :  End base conversion
                  ù                      :  Left pad with spaces to length
                   G                     :    16
                     ®                   :  Map each character
                      û3                 :    Centre pad with spaces to length 3
                         i|              :    Prepend a "|"
                           Ã             :  End map
                            òG           :  Partitions of length 16
                              )          :End interleave
                               c         :Flatten
                                f        :Filter out falsey elements (If the second array being interleaved is shorter than the first, it's padded with null)
                                  ú|     :Left pad each with "|" to the length of the longest
                                         :Implicit output joined with newlines

Vyxal, 31 bytes
\+3-4*\|?b16∆Z\#*2↳ʁ+4ẇṠv"fǏvǏ⁋

Try it Online!
        ?                       # Input
         b                      # To binary
          16∆Z                  # Pad to length 16 with 0s
              \#*               # That many #s, for each bit
                 2↳ʁ            # Pad to length 2 with spaces and mirror
      \|            +           # Prepend | to each
                     4ẇṠ        # Divide into rows and stringify each
                        v"f     # Interleave with...
\+3-                            # "+---"
    4*                          # Repeated four times
                           Ǐ    # Append the first line
                            vǏ  # For each line, append the firstt character
                              ⁋ # Join the result by newlines

Nice! Appreciate you de-golfing it for us mere mortals, not to mention coming back with another solution after so long.

c99 263 bytes
golfed:
main(int argc,char **argv){short i=atoi(argv[argc-1]);char *t="| # ", *f="|   ",*a[16],**p=a,*b="+---+---+---+---+\r\n";while(p<a+16){if((i|0x8000)==i)(*(p++))=t;else(*(p++))=f;i<<=1;}for(p=a;p<a+16;p+=4)printf("%s%s%s%s%s|\n",b,*p,p[1],p[2],p[3]);printf("%s",b);}

ungolfed:
main(int argc, char **argv)
{
    short i=atoi(argv[argc -1]);
    char *t ="| # ", *f="|   ",*a[16],**p=a,*b="+---+---+---+---+\r\n";

    while (p<a+16)
    {
        if((i|32768)==i)
            (*(p++))=t;
        else
            (*(p++))=f;

        i<<=1;
    }

    for (p=a;p0;){s+=i--%2!=0?"+---+---+---+---+\n":"| "+b[i*2+1]+" | "+b[i*2]+" | "+b[i*2-1]+" | "+b[i*2-2]+" |\n";}return s;}}

Indention:
class B
{
    public static string G(short v)
    {
        string s="",b=System.Convert.ToString(v, 2).PadLeft(16,'0');
        for(int i=9;i>0;)
            s+=i--%2!=0?"+---+---+---+---+\n":"| "+b[i*2+1]+" | "+b[i*2]+" | "+b[i*2-1]+" | "+b[i*2-2]+" |\n";
        return s;
    }
}

First time I'm trying something like this, tips would be welcome!

Firstly, I count 286 bytes and you can remove the indentation spaces.

How exactly do you count it? I've been going to the properties to see the file size there, but I'm not sure if that's the way to do it! Without indentation I've come down to 230 bytes!

Use something like https://mothereff.in/byte-counter, or if you're on linux, use the wc command

Ruby, 95
Nod to Mhmd for a concise String conversion, but I wanted to try using string methods instead of number methods.
->i{puts g='+---'*4+?+;("%016b"%i).scan(/.{4}/){puts$&.gsub(/./){"| #{$&<?1?' ':?#} "}+"|
"+g}}

Ruby, 93
A slightly shorter version using only numeric operations.
->i{n=g='+---'*4+"+
";15.downto(0){|m|n+="| #{[' ',?#][1&i>>m]} "
n+="|
"+g if m%4<1}
puts n}

Python 3, 145 144 Bytes
Inline:
a="|";b="+"+"---+"*4+"\n";r=0,1,2,3;(lambda x:print(b+b.join(a+a.join(" %s "%'# '[x&2**(i+j*4)<1]for i in r)+a+"\n"for j in r)+b))(int(input()))

With newlines:
a="|"
b="+"+"---+"*4+"\n"
r=0,1,2,3
lambda x:print(b+b.join(a+a.join(" %s "%'# '[x&2**(i+j*4)<1]for i in r)+a+"\n"for j in r)+b)
x(int(input()))

Edit: Tanks @manatwork for saving 1 byte

Based on gnibbler's tip, hardcoding r=0,1,2,3 is 1 character shorter than generating it with r=range(4).

x86-16 machine code, IBM PC DOS, 80 bytes
Binary:
00000000: b805 09ba 2801 cd21 fec8 741b be3e 01b1  ....(..!..t..>..
00000010: 04d1 e3c6 0420 7303 c604 2383 c604 e2f1  ..... s...#.....
00000020: ba3c 01cd 21eb dcc3 2b2d 2d2d 2b2d 2d2d  .<..!...+---+---
00000030: 2b2d 2d2d 2b2d 2d2d 2b0d 0a24 7c20 2020  +---+---+..$|
00000040: 7c20 2020 7c20 2020 7c20 2020 7c0d 0a24  |   |   |   |..$

Listing:
B8 0905         MOV  AX, 0905H              ; AH = DOS write string, AL = row counter
            ROW_LOOP:
BA 0128         MOV  DX, OFFSET SEP         ; show separator row
CD 21           INT  21H                    ; write to console
FE C8           DEC  AL                     ; displayed 5 separators?
74 1B           JZ   EXIT                   ; if so, exit
BE 013E         MOV  SI, OFFSET ROW+2       ; start SI at location of first bit in row
B1 04           MOV  CL, 4                  ; loop count 4
            BIT_LOOP:
D1 E3           SHL  BX, 1                  ; shift MSb into CF
C6 04 20        MOV  BYTE PTR[SI], ' '      ; reset to space char
73 03           JNC  BIT_DONE               ; if not CF, leave as a space
C6 04 23        MOV  BYTE PTR[SI], '#'      ; otherwise change to a #
            BIT_DONE:
83 C6 04        ADD  SI, 4                  ; increment index 4 bytes
E2 F1           LOOP BIT_LOOP               ; keep looping through bits
BA 013C         MOV  DX, OFFSET ROW         ; show bit column row
CD 21           INT  21H                    ; write to console
EB DC           JMP  ROW_LOOP               ; keep looping
            EXIT:
C3              RET                         ; return to caller
            SEP DB  '+---+---+---+---+',0DH,0AH,'$'
            ROW DB  '|   |   |   |   |',0DH,0AH,'$'

Callable function, input in BX output to STDOUT.
Example test program:

Kotlin, 192 bytes
{val v=it.toString(2).padStart(16,'0')
fun p(){(0..3).map{print("+---")}
println("+")}
(0..3).map{p()
v.subSequence(it*4,(it+1)*4).map{print("| ${if(it>'0')'#' else ' '} ")}
println("|")}
p()}

Beautified
{
    val v = it.toString(2).padStart(16, '0')
    fun p() {
        (0..3).map { print("+---") }
        println("+")
    }
    (0..3).map {
        p()
        v.subSequence(it *4, (it +1) *4).map {print("| ${if (it > '0') '#' else ' '} ")}
        println("|")
    }
    p()
}

Test
var b:(Int) -> Unit =
{val v=it.toString(2).padStart(16,'0')
fun p(){(0..3).map{print("+---")}
println("+")}
(0..3).map{p()
v.subSequence(it*4,(it+1)*4).map{print("| ${if(it>'0')'#' else ' '} ")}
println("|")}
p()}

fun main(args: Array<String>) {
    b(255)
}

05AB1E, 45 bytes
bDg16αúS4ôεεð.ø}õ.ø'|ý}õ.ø…+--3F.∞}¶.øý10„# ‡

Try it online!

Pip, 85 bytes
a:TBa
(("   "X16-#a).aR0"   "R1" # "<>3JW'|<>16J'|<>17JWn."+---+---+---+---+".n)@<-20

Does a straightforward bunch of splits and replacement to get the final grid.
Try it online!