text:
Iterated partial sums
The partial sums of a list of integers [a1, a2, a3, ..., an] are
s1 = a1
s2 = a1 + a2
s3 = a1 + a2 + a3
...
sn = a1 + a2 + ... + an
We can then take the list of partial sums [s1, s2, s3, ..., sn] and compute its partial sums again to produce a new list, and so on.
Related: Iterated forward differences
Input:

A non-empty list of integers
A positive number of iterations,

Output: Print or return the list of integers that results from taking the partial sums that many times.
Fewest bytes wins. Built-ins are OK even if they outright solve the problem.
Test cases:
f([-3, 4, 7, -1, 15], 1) == [-3, 1, 8, 7, 22]
f([-3, 4, 7, -1, 15], 3) == [-3, -5, 1, 14, 49]

Leaderboard:

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

Do the arguments need to be in the same order, or can the number of iterations come before the list of numbers?

@kirbyfan64sos Either order.

J, 5 bytes
+/\^:

Try it online on J.js.
How it works

/\ is an adverb (function that takes a left argument) that cumulatively reduces by its argument.
Thus +/\ is the cumulative sum verb.
^: is the power conjunction; (f ^: n) y applies f a total of n times to y.
The verb-conjunction train +/\^: forms an adverb that repeats +/\ as many times as specified in its (left) argument.
x (+/\^:) y gets parsed as (x (+/\^:)) y, which is equivalent to executing (+/\^:x) y.

Thanks to @Zgarb for his help with the explanation.

Mathematica, 19 bytes
Well, if built-ins are okay...
Accumulate~Nest~##&

Defines a function with the same signature as the examples in the challenge. I'm pretty sure, thanks to the long name Accumulate that this will be easily beaten by the golfing languages and the APL-family, though. :)
To elaborate on LegionMammal978's comment for those who don't Mathematica:
## represents a sequence of the function's parameters (which is like a list that automatically "splats" wherever it's inserted, if you're more familiar with that term from your language's of choice). The ~ are syntactic sugar for infix function invocation, so if we call the function with parameters list and n and expand everything, we get:
Accumulate~Nest~##
Nest[Accumulate, ##]
Nest[Accumulate, list, n]

Which happens to be exactly the argument order expected by Nest.

That's interesting, using infix notation for 3 arguments using SlotSequence...

APL, 9 8 bytes
{+\⍣⍺⊢⍵}

This defines a dyadic function that accepts the iterations and list as left and right arguments.
Thanks to @NBZ for golfing off 1 byte!
Try it online on TryAPL.
How it works

⍺ and ⍵ are the left and right arguments to the function.
+\ is cumulative reduce by sum.
⍣⍺ repeats the preceding operator ⍺ times.
⊢⍵ applies the identity function to ⍵.
This is a shorter way of parsing the code as (+\⍣⍺)⍵ instead of +\⍣(⍺⍵).

In conjunction, we apply +\ a total of ⍺ times to ⍵

@AlexA.: Then wouldn't +\⍣⎕⊢⎕ be acceptable? (⎕ is like Python input()).

@marinus Does that actually print outside a REPL? The only desktop interpreters I have would require assigning to ⎕ afterwards.

Haskell, 26 23 bytes
(!!).iterate(scanl1(+))

This defines an anonymous function, invoked as follows:
> let f = (!!).iterate(scanl1(+)) in f [-3,4,7,-1,15] 3
[-3,-5,1,14,49]

Thanks to @nimi for saving 3 bytes.
Explanation
(!!).                    -- Index by second argument from
     iterate(         )  -- the infinite list obtained by iterating
             scanl1(+)   -- the partial sums function (left scan by +) to first argument

Matlab, 41 bytes
function f(l,n);for i=1:n;l=cumsum(l);end

Quite straightforward. I still think it is quite annoying not having a built in way of making piecewise defined anonymous functions, or anchors in recursions.
Ungolfed:
function f(l,n);
for i=1:n;
    l=cumsum(l);
end

K, 7 3 bytes
{y+\/x}

Very similar to the J solution. +\ precisely performs a partial sum, and when / is provided with a monadic verb and an integer left argument it iterates a specified number of times, like a "for" loop. The rest is just wrapping it up neatly to suit the order of arguments.
  {y+\/x}[-3 4 7 -1 15;1]
-3 1 8 7 22
  {y+\/x}[-3 4 7 -1 15;3]
-3 -5 1 14 49

Tested in Kona and oK.
Edit:
If I'm allowed to reverse the arguments, as @kirbyfan64sos determined, I can dispense with the function wrapping entirely:
+\/

Invoked like:
+\/[3;-3 4 7 -1 15]

This works properly in both k2.8 and k5. It doesn't work in oK since that interpreter does not yet support curried (aka "projected") adverbs, and it doesn't appear to work properly in Kona for less clear reasons.
edit: As of a few days ago, the +\/ formulation also works in oK.

The arguments can be reversed, so I think you may be able to shave a few bytes.

3 +\/ -3 4 7 -1 15 works just fine in Kona, but you can't assign it to a function. Weird...

Yeah, Kona is clearly not treating 3+\/-3 4 7 -1 15 the same as +\/[3;-3 4 7 -1 15]- makes me wonder if they handle the former as a special syntactic case.

JavaScript (ES6) 38
Surprisingly small using .map recursively

f=(l,n,t=0)=>n?f(l.map(x=>t+=x),n-1):l

function test()
{
  var n, v, i = I.value
  v = i.match(/\-?\d+/g).map(x=>+x)
  n = v.pop()
  console.log(v,n)
  O.innerHTML = I.value + ' -> ' + f(v,n) + '\n' + O.innerHTML;
}

test()
<input id=I value='[-3, 4, 7, -1, 15], 3'><button onclick="test()">-></button>

R, 75 bytes
It's long but a different take...computing the desired sequence directly instead of cumulative sums:
function(x,n)sapply(1:length(x),function(i)sum(x[1:i]*choose(i:1+n-2,n-1)))

Noting that the coefficients of the terms of xi for cumsum^n(x) are diagonals of Pascal's triangle. i.e.
cumsum^3(x) = choose(2,2) * x1, choose(3,2) * x1 + choose(2,2) *x2, choose(4,2) * x1 + choose(3,2) * x2 + choose(2,2) * x3, ....

edit: to make a function

Pyth, 9 bytes
usM._GvwQ

Try it online: Demonstration or Test Suite
Explanation
usM._GvwQ  implicit: Q = input list
      vw   input number
u       Q  repeat the following instruction ^ times to G = Q
   ._G        sequence of prefixes of G
 sM           sum them up

Python, 113 93 89 76 bytes
def f(l,n):
 for i in[0]*n:l=[sum(l[:j+1])for j in range(len(l))];
 print(l)

It works for both of the test cases. Thanks to Status, Morgan Thrapp, and Ruth Franklin for helping me golf the program down to 93, 89, and 76 bytes respectively.

You can cut out a number of bytes by changing the second loop into a list comprehension. That is, k=[sum(l[:j+1])for j in range(len(l))]. Then with ;k=l tacked on the end of that you can push this all onto one line with the for i loop.

You can move the k=[sum(l[:j+1])for j in range(len(l))];l=k onto the same line as the for loop to save 2 bytes and remove the space between f's arguments to save another byte.

As you don't use the value of i, you can replace for i in range(n) with for i in[0]*n (because all you care about is the length not the elements of the list).  And I think you can do it without using the auxiliary list k, just modifying the argument l.

Julia, 29 bytes
f(x,y)=y>0?f(cumsum(x),y-1):x

This really doesn't need much explanation. It's a recursive function, if y==0 then just output x. Otherwise decrement y, perform a cumsum, and recurse. Probably not the most golfed possible Julia solution, I'm still working on it.

Gol><> 0.3.10, 22 bytes
SI
C>rFlMF:}+
NRl<C}<;

The first integer is taken to be the iteration number and the rest make up the list. The final list is outputted newline-separated.
The language is still quite young and unstable, but since I'm pretty set on these operators I thought it'd be okay.
Explanation
SI            Read integer, moving down on EOF (first line runs as loop)
r             Reverse stack, putting iteration number on top

[outer loop]
F             Do #(iterations) times

[inner loop]
lMF           Do #(length of stack - 1) times
:             Duplicate top of stack
}             Rotate stack rightward (top goes to bottom)
+             Add the top two elements of the stack
C             Continue inner loop, moving down from F when loop is over

}             Rotate once more
C             Continue outer loop, moving down from F when loop is over

lRN           Print stack as (num + newline)
;             Halt

To see why this works, let's try a small example [5 2 1]:
[5 2 1] -- : --> [5 2 1 1] -- } -->  [1 5 2 1]  -- + --> [1 5 3]
[1 5 3] -- : --> [1 5 3 3] -- } -->  [3 1 5 3]  -- + --> [3 1 8]

-- } --> [8 3 1]

Labyrinth, 73 bytes
;?
,"
;
#
#;}=
;  #
"#;(
_  ;={()"
#;; ( { "
  ; { !\(@
+=( =
" " "
":{:"

It's been a while since I answered something in Labyrinth, and this seemed doable. :)
Input format is a flat list with the number of iterations first (and then the list to apply the partial sums to). Delimiters don't matter all, as long as there is no character after the last integer, so you can use something readable like:
3 | -3, 4, 7, -1, 15

Output is newline-separated:
-3
-5
1
14
49

Python 2, 67
This uses the same summation as Anthony Roitman, and the same recursion as Morgan Thrapp.
f=lambda l,n:f([sum(l[:i+1])for i in range(len(l))],n-1)if n else l

I developed this solution before I saw theirs, and then it just seemed easier to post it as an answer rather than a comment to either or both of them.

R, 32 bytes
function(l,i)diffinv(l,,i)[0:-i]

Try it online!
diffinv is the inverse of diff, with optional parameters lag, differences, and xi; lag defaults to 1 so we skip it and we compute the the inverse of the \$n^\text{th}\$ difference; xi defaults to 0, so it prepends i instances of 0 to the inverse difference list, which we discard by negative indexing.

Python, 52 bytes
f=lambda l,n:n*l and f(f(l[:-1],1)+[sum(l)],n-1)or l

A recursive function that recurses both on the list l and the number of iterations n. Let's break it down.
First, let's consider a recursive function g that iterated the partial sum just once.
g=lambda l:l and g(l[:-1])+[sum(l)]

For an empty list l, this returns l itself, the empty list. Otherwise, the last entry of the partial sums of l is the overall sum of l, which is appended to the recursive result for all but the last element of l.
Now, let's look at a function f that applies g for n iterations.
f=lambda l,n:n and f(g(l),n-1)or l

When n is 0, this returns the list l unchanged, and otherwise, applies g once, then calls f recursively with one fewer iteration remaining.
Now, let's look again at the actual code, which combines the two recursions into a single function. The idea is to treat g(l) as the special case f(l,1).
f=lambda l,n:n*l and f(f(l[:-1],1)+[sum(l)],n-1)or l

We took f(g(l),n-1) from the previous definition, expanded g(l) into g(l[:-1])+[sum(l)], and then replaced g(_) with f(_,1) to confined the recursive calls to f.
For the base case, we want to return l whenever n==0 or l==[]. We combine these by noting that either one makes n*l be the empty list, which is Falsy. So, we recurse whenever n*l is non-empty, and return l otherwise.
Even though there are two recursive calls to f, this does not cause an exponential blow-up the recursive definition of the Fibonacci numbers, but remains quadratic.

C++ (61 + 17 = 78 bytes)
#include<numeric>
void f(int*a,int*e,int n){for(;n--;)std::partial_sum(a,e,a);}

Test case:
#include <iostream>
#include <iterator>

int main() {
    int a[] { -3, 4, 7, -1, 15 };
    f(a, std::end(a), 3);
    for (auto i : a)
        std::cout << i << " ";
}

This takes a slight liberty with the specification: it uses a C-style array, passing pointers to the beginning and end of the array. Internally, as you can see, it's only an extremely thin wrapper around the std::partial_sum in the standard library. Rather than actually return the resulting value, it just modifies the array that's passed in.
If we don't mind pushing definitions of things to the limit (and, arguably, a bit beyond) we can define a "function" in a lambda expression:
#include<numeric>
#include <iostream>
#include <iterator>

int main() {
    int a[] { -3, 4, 7, -1, 15 };
    int *e = std::end(a);
    int n=3;

    auto f=[&]{for(;n--;)std::partial_sum(a,e,a);};

    f();
    for (auto i : a)
        std::cout << i << " ";
}

This reduces the definition of the function(-like object) to this piece:
[&]{for(;n--;)std::partial_sum(a,e,a);};

...for 40 bytes (+17 for the #include).

Wau, I didn't expect of STL to have alg for counting partial sums.

@Zereges: Nobody expects the Spanish Inquisit....oh, wait, we're doing C++, not Python. My apologies.

Jelly, 3 bytes
SƤ¡

Try it online!
This is my (Mr Xcoder's) method.
Jelly, 3 bytes
+\¡

Try it online!
This is caird coinheringaahing's solution.
Jelly, 2 bytes
Ä¡

Try it online!
This is a newer solution.
Method #1

SƤ¡  - Full program, dyadic.

  ¡  - Apply repeatedly, N times.
 Ƥ   - Map the preceding link over the prefixes of the list.
S    - Sum.
     - Output implicitly

Method #2

+\¡  - Full program, dyadic.

  ¡  - Apply repeatedly, N times.
 \   - Cumulative reduce by:
+    - Addition.

Method #3

Ä¡  - Full program, dyadic.

 ¡  - Apply repeatedly, N times.
Ä   - Cumulative sums.

Haskell, 52 47 bytes
First ever code golf 'attempt', and I'm very much a Haskell beginner, so comments are gladly welcomed! It was not clear in the question as to any necessary format of the function call, or whether it was taken by an argument to the program, so I used the exclamation mark as the function identifier to save a couple of spaces.
0!a=a
i!a=(i-1)![sum$take j a|j<-[1..length a]]

Usage (GHCi):
$ ghci partialsums.hs
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( partialsums.hs, interpreted )
Ok, modules loaded: Main.
*Main> 1![-3, 4 ,7 ,-1 ,15]
[-3,1,8,7,22]
*Main> 3![-3, 4 ,7 ,-1 ,15]
[-3,-5,1,14,49]

Welcome to code golf! It's usually shorter to pattern match than to use guards, like 0!a=a i!a=....

Thanks @xnor - I had previously used 'xs' when building the initial code and must have missed it out when I modified the code in the post. Edited.

For sum(take j a), you can avoid parens by doing sum$take j a, using the high precedence of $.

Thank you for your help! I was, for some reason, under the impression that $ would take precedence over syntax (and try to evaluate the rest of the line as it stands). Of course, that wouldn't even make sense.

CJam, 13 bytes
q~{{1$+}*]}*p

Test it here.

C++14, 102 103 94 + 17 (include) = 111 bytes
#include<vector>
auto f(std::vector<int>a,int n){for(;n--;)for(int i=0;i<a.size()-1;++i)a[i+1]+=a[i];return a;}

Ungolfed, with test case
#include <vector>
#include <iostream>

auto f(std::vector<int> a, int n)
{
    for (; n--;)
        for (int i = 0; i < a.size() - 1; ++i)
            a[i + 1] += a[i];
    return a;
}

int main()
{
    auto t = f({-3, 4, 7, -1, 15}, 3);
    for (int i : t)
        std::cout << i << " ";
}

Relies on order of evaluation. Not sure if it is UB or not, but works It's compiler dependent, so I changed it.

Instead of counting j up from 0 to n, count n down to 0. Gives 97 bytes by my count.

@JerryCoffin Thanks..

R, 41 bytes
function(x,n){for(i in 1:n)x=cumsum(x);x}

C#, 52 + 85 = 148 137 bytes
using E=System.Collections.Generic.IEnumerable<int>;

and
E I(E s,int i){int t=0;return i<1?s:I(System.Linq.Enumerable.Select(s,v=>t+=v),i-1);}

It uses unorthodox practices (v=>t+=v), but this is PPCG. Also note the stack depth constraint.

Python 3, 73
Could probably be golfed down a bit further.
def f(n,i):
 p=0;c=[]
 for m in n:p+=m;c+=[p]
 f(c,i-1)if i else print(n)

This version uses numpy, which feels a little like cheating, but here it is:
Python 3 (with numpy), 72
from numpy import*
def f(n,i):
 if i:c=cumsum(n);f(c,i-1)
 else:print(n)

Octave, 24 bytes
@(l,n)l*triu(0*l'*l+1)^n

Burlesque, 10 bytes
{q++pa}jE!

it's not very efficient in general but it does the trick.
blsq ) {-3 4 7 -1 15} 1 {q++pa}jE!
{-3 1 8 7 22}
blsq ) {-3 4 7 -1 15} 3 {q++pa}jE!
{-3 -5 1 14 49}

C++14, 67 bytes
As unnamed lambda modifying its input, requiring c as a random-access-container like vector<int>.
[](auto&c,int n){while(n--)for(int i=0;i++<c.size();c[i]+=c[i-1]);}

05AB1E, 4 bytes
F.pO

Explanation
F    # Implicitly take first input and loop n times.
 .p  # Generate prefixes of input.
   O # Sum all prefixes (implicitly vectorized).

Try it online!

Husk, 4 3 bytes
Saved 1 byte thanks to Dominic Van Essen
!¡∫

Try it online!
!¡∫
 ¡   Repeatedly apply the following function to the first argument, making an infinite list
  ∫  Cumulative sum (one cycle)
!    Index into this list with the second argument

3 bytes...

@DominicvanEssen Nice! Husk seems to have a function for everything.

You spelt Mathematica wrong

@Razetime Sorry, is "Husk seems to have a function for Mathematica" better?

Lua (67 bytes)
function x(t,n)return load("return "..table.concat(t,"+",1,n))()end

Explanation:
table.concat(t,"+",1,n) gives the string formed by concatenation of elements of t from 1 to n using + as connector, i.e. t[1]+...+t[n].
load(<string>)(), as its name suggests, loads a string to be executed as a function. In this case, a function with zero arguments given by table.concat.

Vyxal, 2 bytes
(¦

Try it Online!

Factor, 21 bytes
[ [ cum-sum ] times ]

Try it online!

Ruby, 52 38 bytes
-14 bytes thanks to south
F=->a,n{x=0;n<1?a:F[a.map{x+=_1},n-1]}

Attempt This Online!

38 bytes

@south Nice work. Thanks!

Raku, 27 bytes
{(@^l,{[\+] @$_}...*)[$^n]}

Try it online!
[\+] @array is how to get a list of partial sums in Raku.  Here we construct an infinite sequence of sequences of partial sums and then select the one at the desired index.

Japt -h, 5 bytes
ÆV=å+

Try it
ÆV=å+     :Implicit input of integer U & array V
Æ         :Map the range [0,U)
 V=       :  Reassign to V
   å+     :  Cumulatively reduce V by addition
          :Implicit output of last element

Go, 120 bytes
func f(s[]int,n int)(o[]int){if n<1{return s}
o=[]int{s[0]}
for i:=range s[1:]{o=append(o,s[i+1]+o[i])}
return f(o,n-1)}

Attempt This Online!

Thunno 2, 2 bytes
{ṡ

Try it online!
Explanation
{ṡ  # Implicit input
{   # Input number of times:
 ṡ  #  Cumulative sums
    # Implicit output

Axiom 213 47 bytes
m(a,b)==(for i in 1..b repeat a:=scan(+,a,0);a)

ungolf and some example
 (3) -> [m([-3,4,7,-1,15],1), m([-3,4,7,-1,15],3)]
    Compiling function l with type List Integer -> List Integer
    Compiling function m with type (List Integer,Integer) -> List
       Integer

    (3)  [[- 3,1,8,7,22],[- 3,- 5,1,14,49]]
                                                       Type: List List Integer

PARI/GP, 31 bytes
f(a,n)=Vec(Ser(a)/(1-x)^n+.5)\1
Attempt This Online!
Converts the list to a power series, divides it by \$(1-x)^n\$, and then converts it back to a list.
PARI/GP would drop the leading zeros when converting a power series into a list. So I need to do Vec(...+.5)\1.

PARI/GP, 31 bytes
f(a,n)=a*matrix(#a,,i,j,i<=j)^n
Attempt This Online!
Multiples the \$n\$-th power of the upper triangular matrix of ones. A port of my octave answer.

Nim, 64 bytes
import math
proc s[I](x:var seq[I],n:I)=
 for _ in 1..n:x.cumsum

Attempt This Online!
Outputs by mutating the array in place.


text:
Generate a hexdump of a file!
In this task, your goal is to write a program for generating hexdumps of files of arbitrary types.
Input
The input consists of a (relative or absolute) path to the file to be processed. It may be taken from STDIN, a function argument, or a command line argument.
Output
The output (which may be written to a separate plaintext file or to STDOUT) should contain a hexdump of the file, formatted as follows:

A-F may be uppercase or lowercase, but should be consistent throughout the output
Spaces between bytes on the same line
16 bytes per line (the last line may be shorter, depending on the input file)
A trailing newline at the end of the output is permissible
A single trailing space at the beginning or end of each line is permissible, but should be consistent throughout the output.

Some test cases:
Input text file:
Hello, World!

Output (STDOUT or separate text file):
48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21

Input text file:
"Look behind you! It's a three-headed monkey!"

Output (STDOUT or separate text file):
22 4C 6F 6F 6B 20 62 65 68 69 6E 64 20 79 6F 75
21 20 49 74 27 73 20 61 20 74 68 72 65 65 2D 68
65 61 64 65 64 20 6D 6F 6E 6B 65 79 21 22

Input JVM class file:
https://googledrive.com/host/0B66Q2_YrkhNnQkYzY0hyck04NWc/HelloWorld.class
Output (STDOUT or separate text file):
CA FE BA BE 00 00 00 34 00 1D 0A 00 06 00 0F 09
00 10 00 11 08 00 12 0A 00 13 00 14 07 00 15 07
00 16 01 00 06 3C 69 6E 69 74 3E 01 00 03 28 29
56 01 00 04 43 6F 64 65 01 00 0F 4C 69 6E 65 4E
75 6D 62 65 72 54 61 62 6C 65 01 00 04 6D 61 69
6E 01 00 16 28 5B 4C 6A 61 76 61 2F 6C 61 6E 67
2F 53 74 72 69 6E 67 3B 29 56 01 00 0A 53 6F 75
72 63 65 46 69 6C 65 01 00 0F 48 65 6C 6C 6F 57
6F 72 6C 64 2E 6A 61 76 61 0C 00 07 00 08 07 00
17 0C 00 18 00 19 01 00 0D 48 65 6C 6C 6F 2C 20
57 6F 72 6C 64 21 07 00 1A 0C 00 1B 00 1C 01 00
0A 48 65 6C 6C 6F 57 6F 72 6C 64 01 00 10 6A 61
76 61 2F 6C 61 6E 67 2F 4F 62 6A 65 63 74 01 00
10 6A 61 76 61 2F 6C 61 6E 67 2F 53 79 73 74 65
6D 01 00 03 6F 75 74 01 00 15 4C 6A 61 76 61 2F
69 6F 2F 50 72 69 6E 74 53 74 72 65 61 6D 3B 01
00 13 6A 61 76 61 2F 69 6F 2F 50 72 69 6E 74 53
74 72 65 61 6D 01 00 07 70 72 69 6E 74 6C 6E 01
00 15 28 4C 6A 61 76 61 2F 6C 61 6E 67 2F 53 74
72 69 6E 67 3B 29 56 00 21 00 05 00 06 00 00 00
00 00 02 00 01 00 07 00 08 00 01 00 09 00 00 00
1D 00 01 00 01 00 00 00 05 2A B7 00 01 B1 00 00
00 01 00 0A 00 00 00 06 00 01 00 00 00 01 00 09
00 0B 00 0C 00 01 00 09 00 00 00 25 00 02 00 01
00 00 00 09 B2 00 02 12 03 B6 00 04 B1 00 00 00
01 00 0A 00 00 00 0A 00 02 00 00 00 03 00 08 00
04 00 01 00 0D 00 00 00 02 00 0E

Input ICO image file:
http://cdn.sstatic.net/codegolf/img/favicon.ico
Output (STDOUT or separate text file):
340 lines starting with 00 00 01 00 02 00 10 10 00 00 01 00 20 00 68 04
Input PNG image file:
https://i.stack.imgur.com/xPAwA.png
Output (STDOUT or separate text file):
7982 lines starting with 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52
Input MP3 Audio file:
http://www.newgrounds.com/audio/download/142057
(CC BY-NC-SA NemesisTheory 2008)
Output (STDOUT or separate text file):
300769 lines starting with 49 44 33 03 00 00 00 00 1F 76 54 49 54 32 00 00

Isn't this trivial using xxd?

It'd be easier with hexdump.

Yes, it says in the specs that A-F may be uppercase or lowercase, but should be consistent throughout the output

Bash/sed, 35 bytes
xxd -p -c16 $1|sed 's/\(..\)/\1 /g'
Basically.

Nope. echo "Hello, World" | xxd generates some junk, then clumps of every 2 bytes strung together, then the actual text.

The challenge says the input is a filename not a string.

Oh wait I see what you mean. Fair enough

Same applies for xxd test.txt given test.txt contains Hello, World!

Fixed that. Now it should output pretty

source: Stack Exchange

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

sort: votes


text:
N-queen-and-equine quine
There is a variant of the well-known N-queens problem which involves queens and knights and is said to be "considerably more difficult" 1. The problem statement is as follows:

You must place an equal number of knights ♞ and queens ♛ on a chessboard
  such that no piece attacks any other piece. What is the maximum number
  of pieces you can so place on the board, and how many different ways
  can you do it?

In this code-golf challenge, you will be given an input n between 3 and 32 (in a way that is the most suitable for your language). For a given n, there might be zero or more solutions to the above problem. In case there is no solution, you must output/return nothing (nil, empty string, false, ...). Otherwise, you must give two results:

A solution board (see below) for size n where it is not possible to add a queen or a knight chess piece without having any piece being under attack. There must be an equal number of queens and knights.
The source of a program to be run which accepts no input and gives (i) another solution (or nothing) for the same size n, in the same format, as well as (ii) another program for the next solution (and so on...).

Note that:

The sequence of programs must never return the same board twice, must cover all possible solutions for the problem of size n and eventually has to terminate (producing no output).
You can either return two values, return one and print the other, or print the two return values.
However, if you print both the board and the next program, the board must not be considered to be a part of the next program (I'd recommend printing the board in comment, or use both standard output and error streams).
The program-as-a-return-value must be a string, not a closure.

Board format

A board is a square of size n.
A board cell can be empty, a queen or a knight.
You must choose distinct values for each kind of cells (i.e. you can use other symbols than Q, N when printing the board).
If you return a non-string board, it must be an ordered collection of the n2 values of the board (e.g. matrix, vector or list in row/column-major order, ...).
If you print the board, you can either print it squared, or as a line.
For example, a solution board of size 4 can be printed as follows (spaces not required; symbols at your discretion):
Q - - -
- - - -
- - - -
- - N -

If you feel so, you can also output:
♛ · · ·
· · · ·
· · · ·
· · ♞ ·

... but this is sufficient:
Q-------------N-

It does not matter if you iterate through cells in a row-major or column-major order, because there are symmetrical solutions.
For example, the solutions for n=4 are:
Q------N--------
Q----------N----
Q------------N--
Q-------------N-
-Q----------N---
-Q------------N-
-Q-------------N
--Q---------N---
--Q----------N--
--Q------------N
---QN-----------
---Q----N-------
---Q---------N--
---Q----------N-
---NQ-----------
----Q------N----
----Q----------N
N------Q--------
-------QN-------
-------Q----N---
---N----Q-------
-------NQ-------
--------Q------N
N----------Q----
----N------Q----
-----------QN---
-N----------Q---
--N---------Q---
-------N----Q---
-----------NQ---
N------------Q--
--N----------Q--
---N---------Q--
N-------------Q-
-N------------Q-
---N----------Q-
-N-------------Q
--N------------Q
----N----------Q
--------N------Q

You can also look at the solutions for n=5 as matrices; the boards contains #, q and n symbols, which are empty cells of different kinds (see my answer below).
I count 2836 boards for n=6, like in Sleafar's answer (I introduced a bug when reducing byte count, but it is fixed now).
Many thanks to Sleafar for finding not one but two bugs in my code.
Score
Shortest code in bytes win.
We measure the size of the first program, the one which accepts n.

1. Queens and Knights, by Roger K.W. Hui (beware! contains a solution)

Maybe you should put a bounty on this. Honestly, the problem is hard enough without the quine part.

Can we use any symbols other than Q, N and - to denote Queens and Knights and empty, as long as they are distinct?

@Fatalize Yes, sure

@coredump Could you please give some example outputs for a board with a solution? Especially examples of what the second output would look like?

@R.Kap The second output depends heavily on which language you use. It should be a program or function that can produce the next solution as well as yet another program. I just posted an answer to give an example of what I have in mind.

We don't need to produce a "true quine", do we? Because that would be very ungolfy.

@wizzwizz4 (1) This is not a "true" quine. Programs (textual source code) are generated in sequence, and the first generated one does not need to be in any way similar to the one you submit. It is inspired from questions like https://codegolf.stackexchange.com/questions/68521/growing-quine-sequence and https://codegolf.stackexchange.com/questions/69504/generate-programs-in-increasing-size. (2) There should be an objective winning criterion, and code-golf is sufficient here (and I think some people here are able to come up with an answer below, say, 200 bytes)

@coredump I meant reading the contents of the function. And I'll take that as a "yes, you are allowed to read your own source code and / or function contents". (My solution relies on it, so...)

@wizzwizz4 As long as your 1st function takes one arg. and the generated ones take none, as stated. I am curious about your solution, now...

@coredump If I understand the challenge correctly, then your reference solution for n=6 contains invalid entries (e.g. -------------------------N--------Q- is invalid because more pieces can be added: Q--------N---------------N--------Q-).

@Sleafar Thank you very much, that's true. I'll investigate my answer and edit the question.

@coredump If you are still on, could you have a look at my solution so far? https://jsfiddle.net/wizzwizz4/c0v7pn73/

@coredump There are still invalid entries (e.g. --N--------------------------------Q -> --N-------------N-------Q----------Q). My current solution for n=6 contains 2836 entries (0=empty, 1=queen, 2=knight).

@Sleafar I tried to check, but I missed that. Back to the whiteboard, thanks.

Groovy, 515 bytes
X=0;Y="N="+args[0]+";M=N*N;S=[];def f(b,i,j,v){(i..<j).findAll{k->!(0..<M).any{l->w=b[l];r=(k.intdiv(N)-l.intdiv(N)).abs();c=(k%N-l%N).abs();s=v+w;w>0&&(k==l||(r==0||c==0||r==c?s<4:r<3&&c<3&&s>2))}}.collect{a=b.clone();a[it]=v;[it,a]}};def r(b,q,n){f(b,q,M,1).each{i->f(i[1],n,M,2).each{j->if(f(j[1],0,M,1).any{f(it[1],0,M,2)}){r(j[1],i[0],j[0])}else{S.add(j[1])}}}};r(new int[M],0,0);if(x<S.size()){sprintf('//%s%cX=%d;Y=%c%s%c;print(Eval.xy(X,Y,Y))',S[x].toString(),10,x+1,34,y,34)}else{''}";print(Eval.xy(X,Y,Y))

Testing
Provide n as a command line argument:
groovy qak.groovy 4

The first line of the output is always a solution as a comment (0=empty, 1=queen, 2=knight), followed by the code in the second line:
//[1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0]
X=1;Y="N=4;M=N*N;S=[];def f(b,i,j,v){(i..<j).findAll{k->!(0..<M).any{l->w=b[l];r=(k.intdiv(N)-l.intdiv(N)).abs();c=(k%N-l%N).abs();s=v+w;w>0&&(k==l||(r==0||c==0||r==c?s<4:r<3&&c<3&&s>2))}}.collect{a=b.clone();a[it]=v;[it,a]}};def r(b,q,n){f(b,q,M,1).each{i->f(i[1],n,M,2).each{j->if(f(j[1],0,M,1).any{f(it[1],0,M,2)}){r(j[1],i[0],j[0])}else{S.add(j[1])}}}};r(new int[M],0,0);if(x<S.size()){sprintf('//%s%cX=%d;Y=%c%s%c;print(Eval.xy(X,Y,Y))',S[x].toString(),10,x+1,34,y,34)}else{''}";print(Eval.xy(X,Y,Y))

The following script can be used for automated testing (provide n as an argument again):
#!/bin/bash
set -e
test -n "$1"
groovy qak.groovy "$1" > t
while test -s t; do
    head -n1 t
    groovy t > t2
    mv t2 t
done

Because I tried to make the solution as small as possible, it is very slow (see below for details). I tested only n=4 with this version to see if the quineification works.
Results
n=4: 40 solutions (converted format)
n=5: 172 solutions (converted format)
n=6: 2836 solutions (converted format)
Algorithm
This is a slightly ungolfed non-quine version of the solution:
N=args[0] as int
M=N*N
S=[]

/**
 * Generate a list of valid posibilities to place a new piece.
 * @param b Starting board.
 * @param i Start of the index range to check (inclusive).
 * @param j End of the index range to check (exclusive).
 * @param v Value of the new piece (1=queen, 2=knight).
 * @return A pair with the index of the new piece and a corresponding board for each possibility.
 */
def f(b,i,j,v){
    (i..<j).findAll{k->
        !(0..<M).any{l->
            w=b[l]
            r=(k.intdiv(N)-l.intdiv(N)).abs()
            c=(k%N-l%N).abs()
            s=v+w
            w>0&&(k==l||(r==0||c==0||r==c?s<4:r<3&&c<3&&s>2))
        }
    }.collect{
        a=b.clone();a[it]=v;[it,a]
    }
}

/**
 * Recursively look for solutions.
 * @param b Starting board.
 * @param q Start of the index range to check for queens.
 * @param n Start of the index range to check for knights.
 */
def r(b,q,n){
    f(b,q,M,1).each{i->
        f(i[1],n,M,2).each{j->
            if(f(j[1],0,M,1).any{f(it[1],0,M,2)}){
                r(j[1],i[0],j[0])
            }else{
                S.add(j[1])
            }
        }
    }
}

r(new int[M],0,0)
S.each{println(it)}

Quineification
I used a very simple approach here to keep the code size low.
X=0;Y="...";print(Eval.xy(X,Y,Y))

The variable X holds the index of the solution to print next. Y holds a modified copy of the algorithm above, which is used to calculate all solutions and then select only one of them, which is the reason for it being so slow. The advantage of this solution is, that it doesn't require much additional code. The code stored in Y is executed with help of the Eval class (a true quine is not required).
The modified code prints the solution pointed to by X, increases X and appends a copy of itself:
//[...]
X=1;Y="...";print(Eval.xy(X,Y,Y))

I also tried to output all solutions as code for the second step, but for n=6 it was producing too much code for Groovy to handle.

Common Lisp, 737
self-answer
(lambda(n &aux(d 1))#2=(catch'$(let((s(* n n))(c d))(labels((R(w % @ b ! &aux r h v a)(loop for u from % below s do(setf h(mod u n)v(floor u n)a #4=(aref b u))(when(< 0(logand a w)4)(and(= 6 w)!(throw'! t))(let((b(copy-seq b))(o 5))(loop for(K D)on'(-1 -2 -1 2 1 -2 1 2)for y =(+ K v)for x =(+(or D -1)h)for u =(and(< -1 y n)(< -1 x n)(+(* y n)x))if u do #1=(if(< #4#4)(setf #4#(logand #4#o(if(= w o)3 0)))))(#8=dotimes(y N)(#8#(x N)(let((u(+(* y n)x))(o 6))(if(or(= x h)(= y v)(=(abs(- h x))(abs(- v y))))#1#))))(setf #4#w r(or(cond((= w 5)(R 6 @ U b !))((R 5 @ U b())t)((catch'!(R 5 0 0 b t))t)(t(and(=(decf c)0)(incf d)(or(format t"~%(lambda(&aux(n ~A)(d ~A))~%~S)"n d'#2#)(throw'$ B)))t))r)))))r))(R 5 0 0(fill(make-array s)3)())))))

Example
Paste the above in the REPL, which returns a function object:
#<FUNCTION (LAMBDA (N &AUX (D 1))) {1006D1010B}>

Call it (the star is bound to the last returned value):
QN> (funcall * 4)

This prints the following to the standard output:
(lambda(&aux(n 4)(d 2))
#1=(CATCH '$
 (LET ((S (* N N)) (C D))
   (LABELS ((R (W % @ B ! &AUX R H V A)
              (LOOP FOR U FROM % BELOW S
                    DO (SETF H (MOD U N)
                             V (FLOOR U N)
                             A #2=(AREF B U)) (WHEN (< 0 (LOGAND A W) 4)
                                                (AND (= 6 W) !
                                                     (THROW '! T))
                                                (LET ((B (COPY-SEQ B))
                                                      (O 5))
                                                  (LOOP FOR (K D) ON '(-1
                                                                       -2
                                                                       -1 2
                                                                       1 -2
                                                                       1 2)
                                                        FOR Y = (+ K V)
                                                        FOR X = (+
                                                                 (OR D -1)
                                                                 H)
                                                        FOR U = (AND
                                                                 (< -1 Y N)
                                                                 (< -1 X N)
                                                                 (+ (* Y N)
                                                                    X))
                                                        IF U
                                                        DO #3=(IF (< #2# 4)
                                                                  (SETF #2#
                                                                          (LOGAND
                                                                           #2#
                                                                           O
                                                                           (IF (=
                                                                                W
                                                                                O)
                                                                               3
                                                                               0)))))
                                                  (DOTIMES (Y N)
                                                    (DOTIMES (X N)
                                                      (LET ((U
                                                             (+ (* Y N) X))
                                                            (O 6))
                                                        (IF (OR (= X H)
                                                                (= Y V)
                                                                (=
                                                                 (ABS
                                                                  (- H X))
                                                                 (ABS
                                                                  (- V
                                                                     Y))))
                                                            #3#))))
                                                  (SETF #2# W
                                                        R
                                                          (OR
                                                           (COND
                                                            ((= W 5)
                                                             (R 6 @ U B !))
                                                            ((R 5 @ U B
                                                                NIL)
                                                             T)
                                                            ((CATCH '!
                                                               (R 5 0 0 B
                                                                  T))
                                                             T)
                                                            (T
                                                             (AND
                                                              (= (DECF C)
                                                                 0)
                                                              (INCF D)
                                                              (OR
                                                               (FORMAT T
                                                                       "~%(lambda(&aux(n ~A)(d ~A))~%~S)"
                                                                       N D
                                                                       '#1#)
                                                               (THROW '$
                                                                 B)))
                                                             T))
                                                           R)))))
              R))
     (R 5 0 0 (FILL (MAKE-ARRAY S) 3) NIL)))))

Also, the value returned by this function is:
#(5 0 0 0 0 0 0 6 0 0 0 2 0 2 0 0)

... which is an array literal. Number 5 represents queens, 6 is for knights and anything else stands for an empty cell, except there are more informations stored internally. If we copy-paste the returned function to the repl, we obtain a new function.
#<FUNCTION (LAMBDA (&AUX (N 4) (D 2))) {100819148B}>

And we can call it to, without arguments:
QN> (funcall * )

This call returns a new solution #(5 0 0 0 0 0 0 2 0 0 0 6 0 0 2 0) and the source of another function (not shown here). In case the original function or the last generated one does not find a solution, nothing is printed and nothing is returned.
Internal values
|----------+--------+---------+--------+-----------------|
|          | Binary | Decimal | Symbol | Meaning         |
|----------+--------+---------+--------+-----------------|
| Empty    |    000 |       0 | -      | safe for none   |
|          |    001 |       1 | q      | safe for queen  |
|          |    010 |       2 | n      | safe for knight |
|          |    011 |       3 | #      | safe for both   |
|----------+--------+---------+--------+-----------------|
| Occupied |    101 |       5 | Q      | a queen         |
|          |    110 |       6 | K      | a knight        |
|----------+--------+---------+--------+-----------------|

I used to generate too few solutions. Now, I propagate what cell is safe for a queen and for a knight, independently. For example, here is an output for n=5 with pretty-printing:
Q - - - -
- - - n N
- q - n n
- # n - n
- n # # -

When we placed the queen Q, positions that are a knight-move away from this queen are still safe for queens and denoted q. Likewise, knights that are reachable only by queens are safe for other knights.
Values are bitwise and-ed to represent the possible moves and some cells are reachable by no kind of piece.
More precisely, here is the sequence of boards leading to the following solution (from left to right), where free cells are gradually constrained with different values:
# # # # # #     q - - - q #     - - - - - #     - - - - - #     - - - - - n
# # # # # #     - - Q - - -     - - Q - - -     - - Q - - -     - - Q - - -
# # # # # #     q - - - q #     q - - - - -     Q - - - - -     Q - - - - -
# # # # # #     - q - q - #     - q - - - n     - - - - - n     - - - - - n
# # # # # #     # # - # # -     n n - n N -     - - - n N -     - - - - N -
# # # # # #     # # - # # #     # # - n n n     - # - - n n     - n - - n N

Non-quine approach
Ungolfed, commented version
(defun queens-and-knights
    (n    ; size of problem
     fn   ; function called for each solution

     ;; AUX parameters are like LET* bindings but shorter.
     &aux
       ;; total number of cells in a board
       (s (* n n)))

  (labels
      ;; Define recursive function R
      ((R (w      ; what piece to place: 5=queen, 6=knight
           %      ; min position for piece of type W
           @      ; min position for the other kind of piece
           b      ; current board
           !      ; T iff we are in "check" mode (see below)
           &aux
           r      ; result of this function: will be "true" iff we can
                  ; place at least one piece of type W on the board b
           h      ; current horizontal position
           v      ; current vertical position
           a      ; current piece at position (h,v)
           )

         (loop
            ;; only consider position U starting from position %,
            ;; because any other position below % was already visited
            ;; at a higher level of recursion (e.g. the second queen
            ;; we place is being placed in a recursive call, and we
            ;; don't visit position before the first queen).
            for u from % below s

            do
              (setf h (mod u n)         ; Intialize H, V and A
                    v (floor u n)       ;
                    a (aref b u))       ;

            ;; Apply an AND mask to current value A in the board
            ;; with the type of chess piece W. In order to consider
            ;; position U as "safe", the result of the bitwise AND
            ;; must be below 4 (empty cell) and non-null.
              (when (< 0 (logand a w) 4)

                ;; WE FOUND A SAFE PLACE TO PUT PIECE W

                (when (and ! (= 6 w))
                  ;; In "check" mode, when we place a knight, we knwo
                  ;; that the check is successful. In other words, it
                  ;; is possible to place an additional queen and
                  ;; knight in some board up the call stack. Instead
                  ;; of updating the board we can directly exit from
                  ;; here (that gave a major speed improvement since
                  ;; we do this a lot). Here we do a non-local exit to
                  ;; the catch named "!".
                  (throw '! t))

                ;; We make a copy of current board b and bind it to the
                ;; same symbol b. This allocates a lot of memory
                ;; compared to the previous approach where I used a
                ;; single board and an "undo" list, but it is shorter
                ;; both in code size and in runtime.
                (let ((b (copy-seq b)))

                  ;; Propagate knights' constraints
                  (loop
                     ;; O is the other kind of piece, i.e. queen here
                     ;; because be propagate knights. This is used as
                     ;; a mask to remove knights pieces as possible
                     ;; choices.
                     with o = 5

                     ;; The list below is arranged so that two
                     ;; consecutive numbers form a knight-move. The ON
                     ;; iteration keyword descend sublist by sublist,
                     ;; i.e. (-1 -2), (-2 -1), (-1 2), ..., (2 NIL). We
                     ;; destructure each list being iterated as (K D),
                     ;; and when D is NIL, we use value -1.
                     for (K D) on '(-1 -2 -1 2 1 -2 1 2)

                     ;; Compute position X, Y and index U in board,
                     ;; while checking that the position is inside the
                     ;; board.
                     for y = (+ K v)
                     for x = (+ (or D -1) h)
                     for u = (and (< -1 y n)
                                  (< -1 x n)
                                  (+(* y n)x))

                     ;; if U is a valid position...
                     if u
                     do
                     ;; The reader variable #1# is affected to the
                     ;; following expression and reused below for
                     ;; queens. That's why the expression is not
                     ;; specific to knights. The trick here is to
                     ;; use the symbols with different lexical
                     ;; bindings.
                       #1=(when (< (aref b u) 4) ; empty?
                            (setf (aref b u)

                                  (logand
                                   ;; Bitwise AND of current value ...
                                   (aref b u)

                                   ;; ... with o: position U is not a
                                   ;; safe place for W (inverse of O)
                                   ;; anymore, because if we put a W
                                   ;; there, it would attack our
                                   ;; current cell (H,V).
                                   o

                                   ;; ... and with zero (unsafe for
                                   ;; all) if our piece W is also a
                                   ;; knight (resp. queen). Indeed, we
                                   ;; cannot put anything at position
                                   ;; U because we are attacking it.
                                   (if (= w o) 3 0)))))

                  ;; Propagate queens' constraints
                  (dotimes (y N)
                    (dotimes (x N)
                      (let ((u(+(* y n)x))(o 6))
                        (if (or (= x h)
                                (= y v)
                                (= (abs(- h x)) (abs(- v y))))

                            ;; Same code as above #1=(if ...)
                            #1#))))

                  (setf
                   ;; Place piece
                   (aref b u) w

                   ;; Set result value
                   r (or (cond
                           ;; Queen? Try to place a Knight and maybe
                           ;; other queens. The result is true only if
                           ;; the recursive call is.
                           ((= w 5) (R 6 @ U b !))

                           ;; Not a queen, so all below concern
                           ;; knights: we always return T because
                           ;; we found a safe position.
                           ;; But we still need to know if
                           ;; board B is an actual solution and
                           ;; call FN if it is.
                           ;; ------------------------------------

                           ;; Can be place a queen too? then current
                           ;; board is not a solution.
                           ((R 5 @ U b()) t)

                           ;; Try to place a queen and a knight
                           ;; without constraining the min positions
                           ;; (% and @); this is the "check" mode that
                           ;; is represented by the last argument to
                           ;; R, set to T here. If it throws true,
                           ;; then board B is a duplicate of a
                           ;; previous one, except that it is missing
                           ;; pieces due to constraints % and @. The
                           ;; "check" mode is a fix to a bug where we
                           ;; reported as solutions boards where there
                           ;; was still room for other pieces.
                           ((catch'!(R 5 0 0 b t)) t)

                           ;; Default case: we could not add one more
                           ;; layer of pieces, and so current board B
                           ;; is a solution. Call function FN.
                           (t (funcall fn b) t))

                         ;; R keeps being true if it already was for
                         ;; another position.
                         r)))))

         ;; Return result R
         r))

    ;; Start search with a queen and an empty board.
    (R 5 0 0 (fill (make-array s) 3)  nil)))

Duplicates and bugs
My very first solution outputted duplicate solutions. In order to solve it, I introduced two counters for queens and knights. The counter for queens (resp. knights) keep track of the first position in the board where a queen (resp. knight) exists: I add a queen (resp. a knight) only at positions that follow that minimal position.
That methods prevents me from revisiting solutions that were already found in previous iterations, because I iterate with an increasing queen (resp. knight) position.
However, Sleafar noticed that there were solutions for which there could be room for queens and knights, which is against the rules. For a while I though I had to revert to a normal search and store all the known solutions to prevent duplicates, which felt too costly (both in terms of bytes and memory usage).
Instead, here is what I do now: when a potential solution board is found, I try to add exactly one queen and one knight, without taking into account the counters (i.e. for all cells on the board). If this is possible, then current board is a duplicate of a previous one, and I reject the solution.
Tests
|---+---------+------------+--------------|
| N |  boards |    seconds |        bytes |
|---+---------+------------+--------------|
| 3 |       0 |          0 |        32768 |
| 4 |      40 |          0 |       360416 |
| 5 |     172 |          0 |      3440016 |
| 6 |    2836 |   0.085907 |     61251584 |
| 7 |   23876 |   1.265178 |    869666288 |
| 8 |  383586 |  24.991300 |  17235142848 |
| 9 | 6064506 | 524.982987 | 359952648832 |
|---+---------+------------+--------------|

Quine-ification
I had different ideas to make successive quines.
The easiest one is probably to generate all solutions first as a list of strings and write sequential quines which pop from that list at each generation. However this did not seem to be shorter than current approach.
Alternatively, I tried to rewrite the recursive code with a custom stack and dump all the state variables each time I find a solution; the goal is that the next step can be processed as a continuation of current step.
 Maybe this would be better suited for a stack based language.
The current one is quite simple and rely on Common Lisp reader variables, which are always fun to use.

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


text:
Detect Time Travel
Computers are everywhere nowadays - in cars, trains, skateboards, even nuclear reactors. The possibility that your software will run in a time travelling device is just a matter of time. Can you deal with it? Can you at least detect it?
Your task:

Write a program that loops and keeps querying the system time, in order to detect time travel.
If time moves forward a day or more between two consecutive queries, it's forward time travel. In this case, your program should print:
TS TS: YYYY? You mean we're in the future?
If time moves back, by any amount, between two consecutive queries, it's backward time travel. In this case, your program should print:
TS TS: Back in good old YYYY.
TS TS are the timestamps before and after the time travel. YYYY is the destination year.
Timestamps may be in any format, that includes at least the 4-digit year, month, day, hour, minute and second, separated by non-digits.

Limitations:

You must support dates in the 19th, 20th and 21st centuries, at least.
You must use a language that existed before this challenge was posted.
You must post your answers only after this challenge was posted.
You must use a language that existed before your answer was posted.
You may edit your answer only after you've posted it.
Your program must not print any output other than the required output. An occasional "Great Scott!" is allowed.

This is code-golf. The shortest answer wins.
Relevant movie references will probably make your answer too long, but might get you upvotes.

More falsehoods programmers believe about time, #36: "Time always goes forwards."

Could you be a bit more specific about #5?

Am I correct to assume that each message should be followed by a newline?

So, my computer jumps in time whenever I set it to sleep mode? Also, once per year due to the daylight saving time?

system time is local time or UTC?

separated by nondigits? boo. YYYYMMDDHHmmSS is my favorite timestamp format.

@Dennis, yes, it seems obvious to me, but I should clarify.

@SztupY, Whatever you wish. Pacific Daylight Saving Time is also good.

@JanDvorak, Sleep would break this algorithm. But you have to start somewhere. I should have dealt with daylight saving by requiring backward travel to be more than an hour, but I won't edit now because it will break existing answers.

@Sparr, It must be both separated and with nondigits. In your format the nondigits don't separate anything.

@ugoren I recognize that, and I don't like it. Hence the "boo".

@Doorknob, If my question made 11 people (as of now) read your link, I think I did a good job.

What if I change my computer's system time, that's not time travel!

@Aequitas how do you know? maybe the system clock is actually immutable and "setting" it is actuallly time traveling

Limitation 2,3,4,5 are really harsh, I don't know if I can handle that.

+1 for posing a problem that seems to be unsuitable to be solved with a few chars in one of the esoteric golf scripting languages!

@FelixDombek, Yet CJam is the leader...

Wait, no references to Doctor Who in the question? What is this?

CJam, 118 bytes
et:Tes{es_@-[TS*Set:TS*':S]\_864e5<{[1$et0="? You mean we're in the future?"N]o}|0<{[_"Back in good old "et0='.N]o}&}g

This does not work with the online interpreter.
Sample output after adjusting my computer's time twice:
2015 10 21 11 2 45 1 3 -10800000 2015 10 23 11 2 45 0 5 -10800000: 2015? You mean we're in the future?
2015 10 23 11 2 53 448 5 -10800000 2015 10 21 11 2 52 0 3 -10800000: Back in good old 2015.

Why doesn't it work with the online interpreter (except that it doesn't let you fiddle with the time)?

Because this is an infinite loop, and the online interpreter shows output only after the program has finished.

So how do you test that it works?

Using the Java interpreter.

Python 2, 210 bytes
from datetime import*
o=0
while 1:n=datetime.now();o=o or n;print"%s;%s: %s? You mean we're in the future?"%(o,n,n.year)if(n-o).days>=1else"%s;%s: Back in good old %s."%(n,o,n.year)if(n<o)else"Great Scott!";o=n

Timestamps are printed in in YYYY-MM-DD HH:MM:SS format, separated with semicolons. Switched to Python 2 from 3 since it's 2 chars shorter to print. Spams stdout with Great Scott! for normies non-time-travellers, since it's easier and cheaper to do that than set up a conditional print.

Does it expect the time as input? This is not what's asked (maybe it's vague). Also, it seems to print blank lines when time behaves well.

I meant asking the OS, not the user. I'll clarify.

JavaScript (ES6), 263 bytes
n=Date;o=n.now();(function g(){k=new n;j=new n(o);s=`${k} ${o} `;if(n.now()-o>86400)console.log(`${s}${k.getFullYear()}? You mean we're in the future?`);if(o-n.now()>84600){console.log(`${s}Back in good old ${k.getFullYear()}.`);}o=n.now();setTimeout(g,100);}());

This could probably do with some rewriting to make it more efficient/small.
Source:
n=Date;
o=n.now();

(function go() {
   k=new n;
   j=new n(o);
   s=`${k} ${o} `;
   if (n.now() - o > 86400) {
      console.log(`${s}${k.getFullYear()}? You mean we're in the future?`);
   }
   if (o - n.now() > 84600) {
      console.log(`${s}Back in good old ${k.getFullYear()}.`);
   }
   o=n.now()
   setTimeout(go,100);
}());

Backwards travel is defined as moving back by any amount, not one day. Also, due to the multiple now() calls it may miss a travel event.

An attempt at golfing this:
n=Date,o=n.now();setInterval("d=new n,s=d+\` ${new n(o)} \`;f=d.getFullYear();if(n.now()-o>8.64e+7)console.log(s+f+\`? You mean we're in the future?\`);if(o>n.now())console.log(s+\`Back in good old ${f}.\`);o=n.now()",100);

I think you can golf the first part to o=(n=Date).now().

+Stefnotch 8.64e+7 is two characters longer than 86400.

@towerofnix Use the @ symbol to ping someone.

@CᴏɴᴏʀO'Bʀɪᴇɴ Oops! I was wondering why it didn't work.

@Stefnotch See above, 8.64e+7 is two characters longer than 86400.

@towerofnix Well, Date.now() returns milliseconds. 86400 ms is not one day: https://www.google.com/search?q=milliseconds+to+days&ie=utf-8&oe=utf-8
Also, update the code please?

@towerofnix I managed to golf it even more:
n=Date;o=n.now();setInterval("d=new n,s=d+` ${new n(o)} `;f=d.getFullYear();n.now()-o>8.64e+7&&console.log(s+f+`? You mean we're in the future?`);o>n.now()&&console.log(s+`Back in good old ${f}.`);o=n.now()",100) //Would it be ok to crash the browser? (Having a function that calls itself/a loop without any delay.)

Saved 4 more bytes:
n=Date;z=n.now;o=z();setInterval("d=new n,s=d+` ${new n(o)} `;f=d.getFullYear();n.now()-o>8.64e+7&&console.log(s+f+`? You mean we're in the future?`);o>z()&&console.log(s+`Back in good old ${f}.`);o=z()",100)

If you're using ES6, I'm pretty sure you could save a few bytes here by using arrow functions. (Though it looks like others have already eliminated the function part entirely by passing strings to setInterval instead.)

Bash + coreutils, 177
d()(date -d@"$@")
for((b=`date +%s`;a=`date +%s`;b=a)){
t=`d $a`\ `d $b`
((a<b))&&d $b "+$t: Back in good old %Y."
((a>b+86400))&&d $b "+$t: %Y? You mean we're in the future?"
}

Python 3, 195
from datetime import*
n=datetime.now
p=n()
while 1:
 c=n();f=(p,c,p.year);s=(0,("%s %s: %s? You mean we're in the future?"%f,"%s %s: Back in good old %s."%f)[p.day>c.day])[p>c];p=c
 if s:print(s)

Currently doesn't print Great Scott because I can't find a good way of only making it occasional.

Lua 5.3, 179 178 173 171 169 168 163 bytes
q="%Y %c: "c=os.date::a::d=f f=os.time()_=d and(f-d>86399or f<d)and print(c(q,d)..c(q..(f<d and"Back in good old %Y."or"%Y? You mean we're in the future?")))goto a

Side note: If you take out the need for a full year number then subtract six bytes. The reason is that lua's (or windows' or someone's!) %c doesn't output the full year. Because of this, the timestamps may look weird!
This also takes advantage of timestamps being able to be seperated by any non digit characters!
Thanks for notifying me of my old math.abs reference and other improvements @thenumbernine :)
Lua 5.3, 151 bytes
This is 'copying' off of @thenumbernine's method of displaying time by just showing the timestamp instead of the actual date. This isn't competitive since I think it is a bit of cheating, just posting it here to display my work :)
::a::d=f f=os.time()_=d and(f-d>86399or f<d)and print(d.." "..f..os.date(f<d and": Back in good old %Y."or": %Y? You mean we're in the future?"))goto a

We posted both our Lua answers at nearly the exact same time.  That has to say something about time travel.

Ahah, Thanks @thenumbernine! I finally got my ability to comment :)

Lua 5.3, 174 bytes
T=os.time P=print l=T()::a::t=T()b=l.." "..t..": "y=os.date('%Y',t)_=t<l and
P(b.."Back in good old "..y)or t>l+86399 and
P(b..y.."? You mean we're in the future?")l=t goto a

This is playing heavily off of the "Timestamps may be in any format" rule ... which I took the liberty of using the format of "seconds since Jan 1, 1970"

If I keep my shoddy interpretation of printing timestamps, and adopt the structure of MeepDarknessMeep, I can (unethically) squeeze this down to ...
155 bytes
T=os.time::G::l=t or T()t=T()_=(t>l+86399or t<l)and
print(l.." "..t..": "..os.date(t<l
and"Back in good old %Y"or"%Y? You mean we're in the future?"))goto G

Timestamps may be in any format, that includes at least the 4-digit year, month, day, hour, minute and second, separated by non-digits. - that doesn't allow seconds since epoch.

good thing it didn't "exclude" any formats

@ugoren Really that requirement should be more specific as to your intention

I'm not fully familiar with lua so I may be wrong, but it looks like this prints Back in good ol YYYY but it should print Back in good old YYYY.  (Note the d in old)

nope good catch, I was trying to shave bytes wherever I could :-p

@mego I was going to use the (days since 2000) for a Scratch answer, but I saw this :o

Ruby, 194 bytes
I haven't had the time to really cut this down to size yet. I'm sure there are a few optimizations hiding in there.
require 'time';t=nil;while 1;n=Time.now;if t;s="#{t} #{n}: ";y=n.year;puts t>n ? "#{s}Back in good old #{y}" : (n>t+86400 ? "#{s}#{y}? You mean we're in the future?": "Great Scott!");end;t=n;end

Ungolfed (and a lot more readable):
require 'time'
t=nil
while 1
  n=Time.now
  if t                                             # on second or later pass
    s="#{t} #{n}: "                                # prepare the timestamp
    y=n.year
    puts t>n ?                                     # if we go back
      "#{s}Back in good old #{y}" :                # timestamp + phrase
      (n>t+86400 ?                                 # else, more than one day forward
        "#{s}#{y}? You mean we're in the future?": # timestamp + future
        "Great Scott!")                            # Great Scott!
  end
  t=n                                              # set a new jump point
end

Edit: corrected to ask OS for time, rather than a human.

A few recommendations: Use loop{} instead of while 1...end, and try using + for string concatenation instead of interpolation.

Python, 170 165 bytes
from datetime import*
n=datetime.now
c=n()
while 1:
 p=c;c=n()
 if(c-p).days:print p,"%s:"%c,["%s? You mean we're in the future?","Back in good old %s."][c<p]%c.year

This owes a lot to Morgan Thrapp's answer.  The main trick here is timedelta normalization, which conveniently makes timedelta.days negative when moving even slightly towards the past, and 0 when moving less than a day to the future.

After import* you don't need the datetime. prefix.

@ugoren: import* allows one to write datetime.now() instead of datetime.datetime.now().  It kind of makes sense, in a way...

In a confusing way, it does.

Caché ObjectScript, 199 bytes
l s k=86400 f  s e=+$H,t=$P($H,",",2) s:'d d=e,s=t s z=$ZDT(h)_" "_$ZDT($H)_": ",y=h\365+1841 w:e>d !,z,y,"? You mean we're in the future?" w:(k*t+e)<(k*s+d) !,z,"Back in good old ",y s h=$H,d=e,s=t

This problem is solvable in plain old MUMPS, but would be unreasonably lengthy, since ANSI MUMPS lacks the $ZD[ATE]T[IME] intrinsic function for formatting dates into human-readable timestamps.
This program will probably not detect time-travel to before 1 Jan 1841, nor time-travel to after 31 Dec 9999, since these are the bounds of the $H[OROLOG] timekeeping intrinsic. This program also only has second-level precision; sub-second-level backwards time glitches will likely escape its notice.

TSQL, 355 bytes
At the work so no fancy cool languges stick with your SQL Server production server =)
Golfed version
declare @a datetime=getdate(),@b datetime,@d float,@ char(99),@y char(4)while 0=0begin select @b=getdate(),@d=cast(@b as float)-cast(@a as float),@y=' '+DATEPART(y,@b),@=cast(@a as char(20))+' '+cast(@a as char(20))+': 'if @d>=1set @=@+@y+'? You mean we''re in the future?'if @d<0set @=@+'Back in good old '+@y+'.'print @ set @a=@b end

More readable version with minor changes.
declare @t0 datetime = getdate(), @t1 datetime, @d float, @m varchar(99), @y char(4)

while 0=0
begin

    set @t1 = getdate()
    set @d = cast(@t1 as float) - cast(@t0 as float)
    set @y = ' ' + DATEPART(yy, @t1)
    set @m = cast(@t0 as varchar(30)) + ' ' + cast(@t0 as varchar(30)) + ': '

    if @d >= 1 set @m = @m + @y + '? You mean we''re in the future?'
    if @d < 0 set @m = @m +  'Back in good old ' + @y + '.'

    print @m

    set @t0 = @t1
end

SQL is not that bad in respect to timestamps since it's a first class data type.
For the golf's sake we are using a type with 3 milliseconds precision. The loop itself takes less that that to iterate (depending of your server). The key here is internaly that time stamp is a float and the integer type counts how many days passed. It ill work fine in January 1, 1753, through December 31, 9999 date range.

 VBA, 258 Bytes
 Ran with:Excel 2007 in Windows 7
305 bytes if Usability is required

WARNING This MAY Max your CPU and Crash Excel/Windows if you are on a Single Threaded single core computer (Most likely found in 1985)

Sub q()
h=CDbl(Now())
While 1
t=CDbl(Now())
If t>h+1 Then Debug.Print (CDate(t) & " " & CDate(h) & ":" & Year(t) & "? You mean we're in the future?")
If t<h Then Debug.Print (CDate(t) & " " & CDate(h) & ": Back in good old " & Year(t) & ".")
h=t
Wend
End Sub

If you want this Code to be "Testable" then add Application.Wait (Now() + TimeValue("0:00:01")) after h=t
Output
10/22/2015 3:04:45 PM 10/22/2015 3:04:43 PM:2015?You mean we're in the future?
10/22/2015 3:06:48 PM 10/22/2015 3:06:46 PM: Back in good old 2015.

Below is the test file I used. I'm Honestly Amazed at how little security Windows has sometimes. May not run as expected on all computers

 Run at Own Risk Could Have Major lasting Side Effects!!!!
Sub DOC()
 t = 31346.6868055556
 Date = DateSerial(Year(t), Month(t), Day(t))
 Time = TimeSerial(Hour(t), Minute(t), Second(t))
 q
 End Sub

JavaScript (ES6) 181 174 170 Bytes
for(a=Date;c=b||a.now(),b=d();e=new a(b).getFullYear(),f=`${a(c)} ${a(b):`})b>c+864e5?(g=alert)`${f} ${e}? You mean we're in the future?`:c>b&&g`${f} Back in good old `+e

Note: Has not been tested with a real time machine.
This code runs in Firefox, Chrome, Edge, Node.js Harmony (or io.js for that matter). But, I use alert, so that will have to be replaced by console.log for Node and Io Suport: (187 Bytes)
for(a=Date,b=0;c=b||(d=a.now)(),b=d();e=new a(b).getFullYear(),f=`${a(c)} ${a(b):`})b>c+864e5?(g=console.log)`${f} ${e}? You mean we're in the future?`:c>b&&g`${f} Back in good old ${e}.`

Explained:
// Using for like a while loop, defining relevant variables:
  for (a = Date, b = 0;
// Defing b and c: c becomes b, b becomes now. Also defining a shorthand for Date.now:
  c = b || a.now(),
  b = d();
// Defining Variables Relevant to this loop: e is the year according to b, f is the "TS TS:" string:
  e = new a(b).getFullYear(),
  f = `${a(c)} ${a(b):`
  )
// If b is greater than c plus a day (in milliseconds):
  b > c + 864e5 ?
  // Alert Time Forwand String:
    (g = alert)
    `${f} ${e}? You mean we're in the future?`:
// else if c is greater than b:
  c > b &&
  // Alert Time Back String:
    g `${f} Back in good old `+e

I managed to write an even shorter one, you might want to have a look at it and possibly make yours better. Also, I think it is great!

How big was your solution, I want to see if I can beat it? ;)

Scroll down or click on the link: codegolf.stackexchange.com/a/61544/33160 Also, you are pretty close to beating it! :D

C: 363 bytes
Minified using this handy script:
#include<stdio.h>
#include<time.h>
void p(time_t*t){char b[64];strftime(b,64,"%FT%T",localtime(t));printf("%s ",b);}int main(void){time_t a,b,d=60*60*24;int y;time(&a);while(1){time(&b);y=localtime(&b)->tm_year+1900;if(b<a){p(&a);p(&b);printf("Back in good old %d\n",y);}else if(b>a+d){p(&a);p(&b);printf("%d? You mean we're in the future?\n",y);}a=b;sleep(1);}}

Original:
#include <stdio.h>
#include <time.h>

void p(time_t * t) {
  char b[64];
  strftime(b, 64, "%FT%T", localtime(t));
  printf("%s ", b);
}

int main(void) {
  time_t a, b, d = 60*60*24;
  int y;

  time(&a);
  while(1) {
    time(&b);
    y = localtime(&b)->tm_year+1900;
    if (b < a) {
      p(&a); p(&b); printf("Back in good old %d\n", y);

    } else if (b > a + d) {
      p(&a); p(&b); printf("%d? You mean we're in the future?\n", y);
    }
    a = b;
    sleep(1);
  }
}

Example run:
2015-10-23T23:30:03 1985-06-14T16:27:00 Back in good old 1985
1985-06-14T16:27:07 1999-02-09T14:15:00 1999? You mean we're in the future?
1999-02-09T14:15:09 2015-02-09T14:15:00 2015? You mean we're in the future?
2015-02-09T14:15:36 2015-10-21T07:28:00 2015? You mean we're in the future?
2015-10-21T07:29:06 1985-10-26T09:00:00 Back in good old 1985
1985-10-26T09:00:28 2055-11-12T06:38:00 2055? You mean we're in the future?
2055-11-12T06:38:12 1919-10-07T00:09:57 Back in good old 1919
1919-10-07T00:09:57 2055-11-12T06:38:14 2055? You mean we're in the future?  # tried to go to 1955 - fail.
2055-11-12T06:39:09 2015-10-23T23:32:03 Back in good old 2015  # auto-time back to 2015 because my laptop didn't like the jump to 2055!

I could get rid of 10 bytes by removing the sleep I guess.
By the way, some time-jumping handiness for Mac/Linux:
sudo date 1026090085  # Sat 26 Oct 1985 09:00:00
sudo date 1021072815  # Wed 21 Oct 2015 07:28:00
sudo date 1112063855  # Intended to be 1955 but is 2055. Don't use!

Feel free to drop the sleep.

Processing, 270 bytes
int p;long x=System.currentTimeMillis();void draw(){int q=millis(),y=year();if(q<p){t(p);print("Back in good old "+y+".");}if(q>p+86400000){t(p);print(y+"? You mean we're in the future?");}p=q;}void t(int m){print(new java.util.Date(x+m)+" "+new java.util.Date()+": ");}

Expanded:
int p;
long x=System.currentTimeMillis();
void draw() {
  int q=millis(), y=year();
  if (q<p) {
    t(p);
    print("Back in good old "+y+".");
  }
  if (q>p+86400000) {
    t(p);
    print(y+"? You mean we're in the future?");
  }
  p=q;
}
void t(int m) {
  print(new java.util.Date(x+m)+" "+new java.util.Date()+": ");
}

Sample output:
Wed Oct 21 13:21:59 EDT 2015 Mon Oct 19 13:21:59 EDT 2015: Back in good old 2015.
Mon Oct 19 13:22:08 EDT 2015 Wed Oct 21 13:22:08 EDT 2015: 2015? You mean we're in the future

Javascript 173 169 162 bytes
Javascript is pretty popular...
for(e=Date,n=e.now;o=n(a=alert);)d=new e,f=d.getFullYear(n(o>n(s=d+` ${e(o)}:`)&&a(s+`Back in good old ${f}.`))-o>864e5&&a(s+f+`? You mean we're in the future?`))

Explanation (Older version of the code):
for(e=Date,n=e.now,a=alert,o=n();;o=n()) //Set up the variables and update o, the previous time

d=new e,s=d+` ${e(o)} `,f=d.getFullYear(), //d is the date, s is a string with the 2 timestamps, f is the year
n()-o>8.64e7&&a(s+f+`? You mean we're in the future?`), //Future check
o>n()&&a(s+`Back in good old ${f}.`) //Past check

Ruby, 160 157 155 154 bytes
A lot of things to golf here
a=Time.new;loop{b,s,y=Time.new,"#{a} #{b}: ",b.year;$><<(a>b ? s+"Back in good old #{y}.\n":b>a+86400 ? s+"#{y}? You mean we're in the future?\n":"");a=b}

Mathematica, 295 bytes
The program asks the OS every second for new TS.
f:=LocalTime[]
p=Print;
y:=DateString[#,"Year"]&
s:=ToString[#]<>" "&
d:=QuantityMagnitude@DateDifference[a,b]
j=StringJoin;
While[True,
  a=b;
  b=f;
  Pause@1;
  Which[d>=0,
   p@(j@@{s@a,s@b,": ",y@b,
       "? You mean we are in the future?"}),
   d<0,
   p@(j@@{s@a,s@b," Back in good old ",y@b,"."})]];

Output
Tested by manually feeding in date/time.
DateObject[{2015, 10, 23}, TimeObject[{18, 36, 17.9618}], TimeZone -> \
-4.] DateObject[{2015, 10, 25}, TimeObject[{18, 42, 0.264913}], \
TimeZone -> -4.] : 2015? You mean we are in the future?

DateObject[{2015, 10, 23}, TimeObject[{18, 43, 0.141572}], TimeZone -> -4.] DateObject[{2015, 10, 23}, TimeObject[{18, 42, 3.30681}], TimeZone -> -4.]  Back in good old 2015.

Definitely could have format the output better. It does fulfill the requirements as stated.

why do you shortcut LocalTime[]? It appears only once in the following code.

At one point, I was using it twice. Good catch though.

Remove it and you save three characters.

Groovy, 244 bytes
def s=9999,d={new Date()},y={it.year+1900},f={t,n->"$t $n: ${y(n)}? You mean we're in the future?"},p={t,n->"$t $n: Back in good old ${y(n)}."},t=d()
while(!sleep(s)){n=d()
c=n.time-t.time
println c<0?p(t,n):c>s*2?f(t,n):'Great Scott!'
t=n}


text:
Operations of order
Introduction
There comes a point in childhood when you think you've mastered adding and multiplying, then someone comes along and informs you that:
a * b + c = (a * b) + c != a * (b + c),
and that it wasn't as simple or linear a process as you were earlier taught. You learn that there exists something called the order of operations. This is a very important way of keeping some level of consistency and in expressions, without having parentheses getting in the way of everything.
Generic storyline
One day, you wake up to the sound of panic in the streets. An extremist group under the name "The 2560" (Short for "Organisation Against the Order of Operations", with a dorky hex-ish twist) have used their evil methods to take control over all of the nuclear weapons in the world. They are holding the whole planet hostage, and they have a simple demand: reverse the accepted order of operations or face eradication (parentheses are to maintain their priority). The new system is called PSADME (parentheses, subtraction/addition, division/multiplication, exponents), and expressions evaluate right-to-left:
a - b - c = a - (b - c) = a + c - b

Days pass, and the transition is in progress. Whilst mathematicians and physicists are all busy rewriting their equations, the computer scientists are faced with the task of changing the fashion in which mathematical expressions are interpreted by computers. You belong to a secret rebel programming group which aims to cause as much torment for the new global overlords - and, by chance, you are randomly selected by The 2560 and tasked to produce the benchmark calculation program.
Your mission
Write a program (or function) which takes a (numerical) mathematical expression as input, calculates the expression using PSADME as the order of operations and outputs the result. Expressions should evaluate right-to-left, so $$1 - 3 + 4 = 1 - 7 = -6.$$
For simplicity, all numbers provided will be integers, and the calculations will produce integer outcomes.
Rules and scoring

The program should accept input up to 128 characters in length - if your language/platform has a lower maximum input length, that is an acceptable excuse.
Standard loopholes are forbidden.
The winning code will be chosen on 18th November (4 weeks from this post date).
Feel free to post code that would not be considered golf-worthy. This is about fun. If you have an interesting way of doing this but can't golf it yourself (or by the nature of your method), you can post it anyway.

As per usual, the winning code is the one with least number of bytes, with some entertainment-value bonuses:

-5 for avoiding any use of the characters in the provided expression: +,-,(,),^,*,/
-5 for making the calculations take more than 5 minutes (but no more than 10 minutes) to calculate on a standard computer, without the method being obvious (using the clock or unnecessary loops); The aim is to convince the new overlords that you are not trying to disrupt their calculations of doom.
-(5+N) for a direct offensive message (of length N, not including leading/trailing whitespace) about the members of The 2560 to be written in plain sight within your code, with some ridiculous explanation as to why it needs to be there. If it is removed, the code must not function correctly. Yes, free points for entertainment value.

Examples and explanations
[program] 2 - 2 - 2
2

2 - (2 - 2) = 2
[program] (2 + 2 * 3 + 3) / 3 + 3
4

(4 * 6)/(3 + 3) = 4
[program] 3 + 2 + 1 ^ 3
216

(3 + 2 + 1)^3 = 216
[program] -5^2
25

(-5)^2 = 25
[program] 32 / 8 * 3 - 1
2

32 / (8 * (3 - 1)) = 32 / 16 = 2

1 - 3 + 4 = 1 - 7? Right to left would suggest so, but that's putting addition ahead of subtraction, contrary to PSADME, no?

@LLlAMnYP Addition and subtraction are in the same "group", just like in PEMDAS, so they happen right to left. Same with multiply/divide. It's more like P(SA)(DM)E.

The statement isn't meant to be processed right-to-left - rather, operations of equal precedence are evaluated right-first. So 4/2 = 2, 2-1 = 1, but a/bc = a/(bc) rather than the usual (a/b)*c. I hope this clears things up.

Probably the easiest way to do this is to write up a flex/bison or lex/yacc grammar.

Can we always guarantee that operators have a space on either side?  If so, the -5^2 example needs fixing.

I hadn't intended on making the spaces guaranteed, but I will leave that up to you. So you may have the freedom of requiring spaces, requiring NO spaces or allowing arbitrary input - the latter is preferable, but I do not wish to invalidate your answer.

What, 3+3=9? (Example 2)

Maybe I'm actually part of The 2560 and wish to make addition and multiplication interchangeable in my next domination plan - or perhaps 6 and 9. Or maybe I'm more clumsy than I realised. Nevertheless, I will fix that. The result of the full expression is actually 4, of course - I checked that with the elite members of The 2560.

You should change the acronym to PADME, since members of such an evil organisation would most certainly like the newer Star Wars trilogy more than the originals. It's also easier to remember.

@JArkinstall yes, that clears stuff up. Awesome challenge.

Haskell, 134 bytes
import qualified Prelude as P
infixl 6 ^
(^)=(P.^)
infixr 8 +
(+)=(P.+)
infixr 8 -
(-)=(P.-)
infixr 7 /
(/)=P.div
infixr 7 *
(*)=(P.*)

Redefining the math operators with new fixities and priorities. Now:
*Main> 32 / 8 * 3 - 1
2

Wow. Just, wow. Is this even possible in any other language? +1

I was quite sure, it was possible in Mathematica, or at least a similar approach, but quickly realized, I lack the knowledge to make it.

I am new enough here to be unsure as to whether the following suggestion is usually acceptable on this forum. It is based entirely on your code, but is a bash script which uses Perl to generate the Haskell file and pass it to GHCi. By doing so, I save a WHOLE BYTE.
perl -e'$_="import qualified Prelude as Pl 6^r 8+r 8-r 7*r 7/";s/(. \d(.))/\ninfix\1\n(\2)=(P.\2)/g;s~\./~.div~;print'>a.hs;ghci a.hs
Unfortunately, a typo made the generated code lack a space between the digit and the symbol, but still runs fine. This means your code can lose 5 bytes, and beats my 'improvement'.

@JArkinstall For what its worth, my answer is effectively using sed to generate and evaluate shell code.  Probably a good meta question.

That is true, and I really like your approach - however, using a tool (perl or sed) to generate a file in a language which is then read into another language seems one step further. I wouldn't be overly surprised if there exists a way of producing the above code via another generator (although the method isn't obvious to me!), and we would find ourselves in parse-ception. If this is allowable, one could even apply this approach to your code (and a few examples I have seen in some of the more readable-language answers to some challenges on this board).

Definitely a question for meta. I don't like the idea. People will start using preprocessors for their actual source code, like 7bit encodings or specialized Huffman encodings for different languages, etc.  In this case here I'd go for patching the Prelude source code and calling ghci.

@LLlAMnYP It's no longer directly possible in Mathematica, since Plus uses built-in rules before user-defined ones as of (I think) Version 7.

@ETHproductions Perl 6 can do this as well, but it is significantly longer as you have to define new operator subs in the current lexical scope and call out to the ones in outer scopes.

GNU sed -r with exec extension, 398
s@ *\^ *@ ** @
:
s@\((-?[0-9]+)\)@\1@
t
s@(-?[0-9]+ - )+(-?[0-9]+ - -?[0-9]+)@\1(\2)@
t
s@(.*(^| |\())(-?[0-9]+ [-+] -?[0-9]+)(.*)@echo '\1'$((\3))'\4'@e
t
s@(-?[0-9]+ / )+(-?[0-9]+ / -?[0-9]+)@\1(\2)@
t
s@(.*(^| |\())(-?[0-9]+ [*/] -?[0-9]+)(.*)@echo '\1'$((\3))'\4'@e
t
s@(-?[0-9]+ \*\* )+(-?[0-9]+ \*\* -?[0-9]+)@\1(\2)@
t
s@(.*(^| |\())(-?[0-9]+ \*\* -?[0-9]+)(.*)@bash -c 'echo \1$[\3]\4'@e
t

Not especially short, but gets the job done.
sed is OK for parsing out the precedence but doesn't do arithmetic.  So we use the GNU sed exec extension to the s command to outsource the necessary arithmetic to the shell.
For now assumes all operators, with the exception of ^ have exactly one space in front and behind.
Test output:
$ cat psadme.txt
2 - 2 - 2
(2 + 2 * 3 + 3) / 3 + 3
3 + 2 + 1 ^ 3
-5^2
32 / 8 * 3 - 1
$ sed -rf psadme.sed psadme.txt
2
4
216
25
2
$

Nice profile picture. xD

JavaScript (ES6) 287 300
Edit Bug fixed (just a typo, 6 should have been 4) - Added a complete explanation at the end of the snippet
Edit 2 Found some improvement working on another challenge
Yet another porting of the same parser with just some minimal difference. (compare with this)

f=(x,W=[],Q=['('],z=1,h=p=>'+-*/^^))('.indexOf(p)>>1,C=n=>{for(;h(q=Q.pop())<h(n);W.push(q=='^'?Math.pow(a,b):eval(`a${q}b`)))a=W.pop(b=W.pop());z&&Q.push(q,n)})=>((x+')').replace(/\d+|\S/g,t=>t>'('?t>'('?~h(t)?z&&t=='-'?z=-z:C(t,z=1):(W.push(z*t),z=0):C(t,z=0):(Q.push(t),z=1)),W.pop())

// More readable
U=(x,W=[],Q=['('],z=1,
  h=p=>'+-*/^^))('.indexOf(p)>>1,
  C=n=>{
    for(;h(q=Q.pop())<h(n);
        W.push(q=='^'?Math.pow(a,b):eval(`a${q}b`)))
      a=W.pop(b=W.pop());
    z&&Q.push(q,n)
  }
)=>(
  (x+')')
  .replace(/\d+|\S/g,t=>
       t>'('
       ?t>'('
       ?~h(t)
       ?z&&t=='-'?z=-z:C(t,z=1)
       :(W.push(z*t),z=0)
       :C(t,z=0)
       :(Q.push(t),z=1)
  ),
  W.pop()
)

// TEST
console.log=(...x)=>O.innerHTML+=x.join` `+'\n'

console.log(f('1 - 3 + 4')) // -6
console.log(f('2-2-2')) // 2
console.log(f('(2 + 2 * 3 + 3) / 3 + 3')) // 4
console.log(f('3 + 2 + 1 ^ 3')) // 216
console.log(f('-5^2')) // 25
console.log(f('32 / 8 * 3 - 1')) // 2

// Explained
X=(x,W=[],Q=['('],z=1,
  h=p=> // operator priority '+-:1, */:3, ^:5, ):7, (:9. If an operand then -1
     '+-*/^^))('.indexOf(p)>>1,
  C=n=>{ // Evaluate operators present on stack if they have upper priority, then push new operator on stack
    //console.log('Operand '+n)
    while( h(q = Q.pop()) < h(n) ) // pop operator from op stack and compare priority with current
    {
      // Pop operands from stack and push result
      b = W.pop();
      a = W.pop();
      r = q=='^' ? Math.pow(a,b) : eval('a'+q+'b')
      // console.log('Evaluate '+a+q+b+'='+r)
      W.push(r);
    }
    // if z == 0 do nothing, because the current operands are '(' and ')' that must be discarded
    // else Push again the last operator popped and the current one
    z && Q.push(q, n) //
  }
)=>(
  (x+')')
  .replace(/[\d.]+|\S/g,t=> {
    //console.log('Q:'+Q,'W:'+W,'T:'+t,'U:'+h(t),'Z:'+z), // display status
    if (t == '(')
    { // open parenthesis
      z = 1
      Q.push(t) // push a operator, its the highest priority
    }
    else if (t == ')')
    { //close parenthesis
      z = 0
      C(t)
    }
    else if (h(t) < 0)
    { // operand
      W.push(z*t) // push operand with right sign
      z = 0 // set z to 0 to mark that we just pushed an operand, so next '-' (if present) is a binary operator
    }
    else
    { // operator
      if (z && t=='-') // the minus is an unary operator (the only unary operator allowed is '-', '+' will not work)
        z =-z // change the sign
      else
        z = 1, // no unary minus
        C(t)
    }
  }),
  W.pop() // return the value at top of operand stack
)


text:
Energy levels of electrons
Energy levels of electrons
Electrons are ordered into "shells". However, sometimes electrons get excited, for example by heat, and leave their shell to go to another! These electrons will go back at some point, but they cannot go back to their original shell without emitting energy in the form of radio waves.
For example, the energy levels for hydrogen look like this:

The base energy level of an electron in hydrogen is at n = 1. If it gets 'excited', it might go to n = 4. However, on the way back, the electron does not always simply go from n = 4 to n = 1, it has different options. See the example.
Task
Write a program or function that takes an integer and outputs the amount of options the electron has to get back to its un-excited state. For this task, you can take granted that an electron can only emit energy from its excited state. It will not get more energy once it has been excited.
This is code-golf, the answer with the least amount of bytes wins.
If you are interested in these type of questions, check out this similar question. Also check out this for more info on these matters.
Input
The input of your function/program is a whole integer. It is greater than 0 and less than 2^31.
Output
An integer, the amount of options the electron has to return to its original state, which is n = 1 (for hydrogen). When the input is 1, return 0, as it is already in its original energy level.
Examples
Input: 4
Output: 4

Because the options are:
4 -> 3 -> 2 -> 1
4 -> 3 -> 1
4 -> 2 -> 1
4 -> 1

Visualised:

When I saw "the electron does not always simply go from n = 4 to n = 1" http://i.imgur.com/FNxsSSC.png

@DanTheMan I didn't get the joke...

The simple mathematical expression for the solution makes the whole problem rather silly. Before posting a challenge, you should write code to generate test cases, and here it would have let you catch the pattern.

To add to what @xnor said, it's also a good idea to post challenges to the Sandbox. That way people can offer useful feedback before the challenge goes live.

Thanks for the feedback, ill make use of your proposals next time.

I'm voting to close this question as off-topic because it's too narrow - there's a simple mathematical formula to solve it, no ingenuity involved.

Pyth, 5 bytes
/^2Q4

I integer-divide by 4 instead of subtracting two from the power and flooring.

CJam, 6 8 7 bytes
1li2-m<

Try it online
Unless I completely misunderstood the question, the result is simply 2^(n-2). For each level between n and 1, you can either skip or not skip it on the way back.
Using the left shift operator instead of the power operator is one byte more, but gives the specified result 0 for n=1, while the power operator gives 0.5 for that case.
Explanation:
1     Push 1 for later shift operator.
li    Get input and convert to int.
2-    Subtract 2.
m<    Left-shift 1 by (n-2).

If I shamelessly stole Thomas Kwa's approach, this would be 6 bytes in CJam:
2li#4/

Ouch. Did not realize the answer was that simple. Nice work though.

Dyalog APL, 6 bytes
⌊2*-∘2

This is a monadic function train. It is equivalent to the following, trainless function.
{⌊2*⍵-2}

Try it online on TryAPL.
How it works
   -∘2  Take the right argument and subtract 2.
 2*     Elevate 2 to the difference.
⌊       Round down to the nearest integer.

Note to self: If you beat Dennis to a CJam answer, he's just going to find something else that's shorter. ;)

6 bytes? What character encoding are you using?

@ev3commander There are legacy APL code pages (that predate Unicode by a few decades) where one character is one byte.

JavaScript ES7, 12 11 bytes
i=>2**(i-2)

Defines an anonymous function.

Anonymous functions are fine. I'm pretty sure that ^ is bitwise XOR though, not power.

@Dennis Frick, you're right! Gotta add another byte :(

Gives the wrong result for i=1

the ** Opererator is ES7 and presently supported in almost nothing

i=>(1<<i)>>2 1 char more, works everywhere, correct for i=1

Python, 29 22 16 bytes
lambda n:2**n//4

Technique shamelessly stolen from Thomas's answer.
Try it online

Stuck, 6 bytes
2i2-^)

Hey look I almost outgolfed Pyth outgolfed CJam

Does Stuck implicitly floor? Interesting.

I didn't execute this, but from the documentation, 2^ seems to square instead of calculating a power of 2

^ pops off two values x and y and calculates x^y. So this does do power of 2 not square.

I wish Stuck had an online interpreter...

@ThomasKwa Actually it appears to implicitly ceiling since an input of 1 outputs 1. I'll have to fix that...

That prints 1 because you're squaring. x y ^ calculates x^y, not y^x.

Oh, you are correct. I got confused because my test case was 4... probably a bad choice. Fixed

dc, 6
2?^4/p

Algorithm expertly lifted from other correct answers.
Testcases:
$ for t in 1 4; do dc -e'2?^4/p' <<< $t; done
0
4
$

Julia, 9 bytes
n->2^n÷4

Like several other answers, this uses Thomas's approach. ÷ performs integer division in Julia (but unfortunately is 2 bytes in UTF-8).

Does Julia support the ISO 8859-1 encoding?

@Dennis I have no idea.

PHP, 28 bytes
I hope I got it right. floor handles the case for 1 where it should output 0
<?=floor(pow(2,$argv[1]-2));

Works from command line like:
electrons.php 4

+1 and thanks to Reto Koradi for providing the formula. ;)

Note that you can left-shift 1 to simulate a power of 2 (as is the nature of binary). The result is necessarily an integer. For the n=1 case, this would imply a negative number - so you can simply compare with zero. Suggestion:
<?=max(0,1<<$argv[1]-2);
(24 chars)

Never mind. This doesn't work with the full range defined by the question. Neither does pow, as it assumes large numbers are infinity, but it works for a larger scope than the left shift. If PHP allowed one to specify a var as a long, that would be more useful.

@JArkinstall Yeah, even with 64 bit int it will return INF. It's not made for this domain.

Minkolang 0.9, 7 bytes
Copying Thomas like everyone else...
2n;4:N.

This is a full program, and the first five characters are equivalent to 2**n//4 in Python 3. Try it online.