text:
Has My Pie Been Bisected?
Write a program or function that takes in a nonempty list of positive integers. You may assume it is input in a reasonable convenient format such as "1 2 3 4" or [1, 2, 3, 4].
The numbers in the input list represent the slices of a full pie chart where each slice size is proportional to its corresponding number and all slices are arranged around the chart in the order given.
For example, the pie for 1 2 3 4 is:

The question your code must answer is: Is the pie chart ever bisected? That is, is there ever a perfectly straight line from one side of the circle to the other, splitting it symmetrically in two?
You need to output a truthy value if there is at least one bisector and output a falsy value if there are none.
In the 1 2 3 4 example there is a bisection between 4 1 and 2 3 so the output would be truthy.
But for input 1 2 3 4 5 there is no bisector so the output would be falsy:

Additional Examples
Arranging numbers differently may remove bisectors.
e.g. 2 1 3 4 → falsy:

If only one number is in the input list the pie is not bisected.
e.g. 10 → falsy:

There may be multiple bisectors. As long as there are more than zero the output is truthy.
e.g. 6 6 12 12 12 11 1 12 → truthy: (there are 3 bisectors here)

Bisections may exist even if they are not visually obvious.
e.g. 1000000 1000001 → falsy:

e.g. 1000000 1000001 1 → truthy:

(Thanks to nces.ed.gov for generating the pie charts.)
Test Cases
Truthy
1 2 3 4
6 6 12 12 12 11 1 12
1000000 1000001 1
1 2 3
1 1
42 42
1 17 9 13 2 7 3
3 1 2
10 20 10

Falsy
1 2 3 4 5
2 1 3 4
10
1000000 1000001
1
1 2
3 1 1
1 2 1 2 1 2
10 20 10 1

Scoring
The shortest code in bytes wins. Tiebreaker is earlier answer.

I believe you mean piesected?

@HelkaHomba, can you rearrange the sectors to make it work, and is that what you meant by "arranging numbers differently may remove bisectors"?

@SolomonUcko You may not rearrange the sectors.

Only [2 1 3 4] of the false cases has to actually be evaluated. The other false cases are easily rejected because their sum is odd (or their length is < 2).

J, 18 bytes
5 bytes thanks to Dennis.
+/e.[:,/2*+/\-/+/\

@HelkaHomba: Nope.
Usage
>> f =: +/e.[:,/2*+/\-/+/\
>> f 6 6 12 12 12 11 1 12
<< 4
>> f 10 20 10 1
<< 0

Ungolfed
black_magic  =: +/\-/+/\
doubled_bm   =: 2 * black_magic
flatten      =: ,/
sum          =: +/
is_member_of =: e.
f =: sum is_member_of monadic flatten doubled_bm

Previous 23-byte version:
[:+/[:+/+/=+:@-/~@(+/\)

Usage
>> f =: [:+/[:+/+/=+:@-/~@(+/\)
>> f 6 6 12 12 12 11 1 12
<< 4
>> f 10 20 10 1
<< 0

Ungolfed
black_magic =: -/~@(+/\)
double      =: +:
equals      =: =
sum         =: +/
monadic     =: [:
of          =: @
f =: monadic sum monadic sum (sum equals double of black_magic)

Explanation
The sum of all substrings is calculated by the black_magic. The +/\ calculate the partial sums.
For example, a b c d becomes a a+b a+b+c a+b+c+d.
The -/~ then constructs a subtraction table based on the input, so x y z becomes:
x-x x-y x-z
y-x y-y y-z
z-x z-y z-z

When applied to a a+b a+b+c a+b+c+d, the result would be:
    0  -b -b-c -b-c-d
    b   0   -c   -c-d
  b+c   c    0     -d
b+c+d c+d    d      0

This calculated the sums of all the substrings which does not contain a.
This guarantees to be enough, since if one bisection contains a, the other bisection will not contain a and also will not wrap around.

With some restructuring, you can get to 13 bytes: +/e.&,2*+/\\.

Jelly, 9 8 bytes
Ḥ+\©_Sf®

Return a non-empty list (truthy) or an empty list (falsy). Try it online! or verify all test cases.
How it works
Ḥ+\©_Sf®  Main link. Argument: A (list)

Ḥ         Double all integers in A.
 +\       Take the cumulative sum of 2A.
   ©      Copy; store the result in the register.
    _S    Subtract the sum of A from each partial sum of 2A.
      f®  Filter; intersect this list with the list in the register.

Julia, 34 30 29 bytes
!x=sum(x)∈cumsum!(x,2x).-x'

Thanks to @GlenO for golfing off 1 byte!
Try it online!
How it works
After storing the cumulative sum of 2x in x, we subtract the row vector x' from the column vector x, yielding the matrix of all possible differences. Essentially, this computes the sums of all adjacent subarrays of x that do not contain the first value, their negatives, and 0's in the diagonal.
Finally, we test if the sum of the original array x belongs to the generated matrix. If this is the case, the sum of at least one of the adjacent sublists is equal to exactly halve of the sum of the entire list, meaning that there is at least one bisector.

Let's watch as Dennis gives 5 answers before anyone else gives one.

Haskell, 41 bytes
f l=elem(sum l/2)$scanr(:)[]l>>=scanl(+)0

The idea is to check whether there is a sublist of l whose sum equals sum l/2. We generate the sums of these sublists as scanr(:)[]l>>=scanl(+)0. Let's look at how this works with l=[1,2,3]
>> scanr(:)[]l
[[1,2,3],[2,3],[3],[]]
-- the suffixes of l

>> scanl(+)0 [2,3,4]
[0,2,5,9]
-- the cumulative sums of the input

>> scanr(:)[]l>>=scanl(+)0
[0,1,3,6,0,2,5,0,3,0]
-- the cumulative sums of the suffixes of l, flattened to a single list

Old 43 bytes:
f l|c<-scanl1(+)l=elem(sum l/2)$(-)<$>c<*>c

Generates the list c of cumulative sums. Then, checks if any two of these sums differ by sum l/2 by checking if it is an element of the list of differences (-)<$>c<*>c.

Python 2, 64 bytes
f=lambda l,s=0:l>[]and(sum(l)==s)|f(l[1:],s+l[0])|f(l,s+l.pop())

Recursively tries to remove elements from the front or end until the sum of what remains equals the sum of what was deleted, which is stored is s. Takes time exponential in the list length.
Dennis saved 3 bytes with pop.

A weird alternative that gives lists: f=lambda l,s=0:l and(sum(l)==s)*l+f(l[1:],s+l[0])+f(l,s+l.pop())

Pyth, 10 9 bytes
}sQmysd.:

Test it in the Pyth Compiler.
How it works
       .:  Generate the list of all adjacent sublists.
   m       Map over the result:
     sd       Add the integers of the sublist.
    y         Double the sum.
 sQ        Compute the sum of the input.
}          Check if it belongs to the list of doubled sublist sums.

Python 2, 76 74 70 66 bytes
def f(x):n=sum(x);print n in[2*sum(x[k/n:k%n])for k in range(n*n)]

Thanks to @xnor for golfing off 4 8 bytes!
Test it on Ideone. (larger test cases excluded)

I realized you can do n=sum(x) to do n in ...; it doesn't hurt to use a larger value for n.

Ooh, that's clever. Thank you!

Actually, 21 bytes
;Σ@2*;lR@τ╗`╜V♂Σi`Míu

Try it online!
This program prints out a 0 for false cases, and a positive integer for true cases.
Explanation:
;Σ@2*;lR@τ╗`╜V♂Σi`Míu
;Σ                     sum of copy of input
  @2*                  double values in other copy
     ;lR               copy, range(1, len(input)+1)
        @τ             append other copy to itself
          ╗            save in reg0
           `╜V♂Σi`M    map: generate cyclic cumulative sums
                   íu  1-based index of sum of input (0 if not found)

Non-competing version, 10 bytes
;Σ@2*σ;)-∩

Try it online!
This program outputs an empty list for false cases and a non-empty list otherwise. It is essentially a port of Dennis's Jelly answer. It is non-competing because the cumulative sum and vectorized difference functionality post-date the challenge.
Explanation:
;Σ@2*σ;)-∩
;Σ          sum of copy of input
  @2*       multiply values in other copy by 2
     σ;     two copies of cumulative sum
       )-   subtract sum of input from each element in one copy
         ∩  set intersection with other copy

Python 2, 47 bytes
k=t=1
for x in input():t<<=x;k|=t*t
print k&k/t

Try it online!
I'm back 2.75 years later to beat my old solution by over 25% using a new method.
This 1-byte longer version is a little clearer.
k=t=0
for x in input():t+=x;k|=4**t
print k&k>>t

Try it online!
The idea is to store the set of cumulative sums t as bits of k, setting bit 2*t to indicate that t is a cumulative sum. Then, we check if any two cumulative sums differ by half the list sum (final t) by bit-shifting k this much and doing bitwise & with the original to see the result is nonzero (truthy).

MATL, 10 bytes
EYst!-Gs=z

The output is the number of bisectors.
Try it online!
Explanation
Same approach as Dennis' Julia answer.
E       % Implicit input. Multiply by 2 element-wise
Ys      % Cumulative sum
t!-     % Compute all pairwise differences. Gives a 2D array
Gs      % Sum of input
=       % Test for equality, element-wise
z       % Number of nonzero elements. Implicit display

Ruby, 60 53 bytes
->a{a.any?{r=eval a*?+;a.rotate!.any?{|i|0==r-=2*i}}}

Generates all possible partitions by taking every rotation of the input array and then taking all slices of length 1..n, where n is the size of the input array. Then checks if there exists any partition with a sum half the total sum of the input array.

Vyxal, 6 bytes
¦Dt½-∩

Try it Online!
As in Jelly, a list is falsy iff it is empty.
¦         Push the cumulative sums
 D        three times.
  t       Take the last one,
   ½      halve it,
    -     subtract it from each of the cumulative sums,
     ∩    and take the intersection of the differences and the cumulative sums.

JavaScript (ES6), 83 bytes
a=>a.map(_=>a.slice(--n).map(m=>s.push(t+=m),t=0),s=[],n=a.length)&&s.includes(t/2)

Generates all possible sums, then checks to see whether half of the last sum (which is the sum of the whole list) appears in the list. (Generating the sums in the slightly awkward order to arrange for the sum I need to be last saves 4 bytes.)

Dyalog APL, 12 bytes
+/∊2×+\∘.-+\

Test it with TryAPL.
How it works
+/∊2×+\∘.-+\  Monadic function train. Right argument: y (vector)

     +\   +\  Yield the cumulative sum of y.
       ∘.-    Compute all differences of all partial sums.
              This computes the sums of all adjacent subvectors of y that do not
              contain the first value, their negatives, and 0's in the diagonal.
   2×         Multiply all differences by 2.
+/            Yield the sum of y.
  ∊           Test for membership.

Jelly, 6 bytes
ÄḤf_¥S

Try it online!
Jelly has gained a single-byte builtin for cumulative sums since Dennis posted his solution, making it trivial to golf to 7 bytes. Turns out there's a lot of creative ways to tie 7, but to hit 6 all it takes is restructuring it with a dyadic chain.
 Ḥ        Double
Ä         the cumulative sums,
  f       then filter them by membership in
   _¥     the differences between them and
     S    the total sum.

As Dennis presumably observed, a difference of partial sums is the sum of a substring, and if a difference of partial sums is half the total sum, the difference of a partial sum and the total sum is another partial sum.

C, 161 145 129 bytes

saved few bytes thanks to @LeakyNun
saved few bytes thanks to @ceilingcat

i;j;k;t;r;s;f(x,n)int*x;{for(t=i=k=r=0;i<n;)t+=x[i++];for(;++k<n;i=n)for(;i--;r|=2*s==t)for(s=0,j=i;j<i+k;)s+=x[j++%n];return r;}

Ungolfed try online
int f(int*x,int n)
{
    int t=0;

    for(int i=0;i<n;i++)
    {
        t += x[i];
    }

    for(int k=1;k<n;k++) // subset-size
    {
        for(int i=0,s;i<n;i++) // where to start
        {
            s=0;

            for(int j=i;j<i+k;j++) // sum the subset
            {
                s+=x[j%n];
            }

            if(2*s==t) return 1; // TRUE
        }
    }

    return 0; // FALSE
}

Perhaps you can save some bytes by moving the declarations of the variables to the first level, and changing i<n;i++ to i++<n (though you may need to deal with some offsets.

Haskell, 68 bytes
f l|x<-[0..length l]=any(sum l==)[2*(sum$take a$drop b l)|a<-x,b<-x]

The function f first creates a list of the sums of all the possible slices of the given list. Then it compares to the total sum of list elements. If we get at some point half of the total sum, then we know that we've got a bisection. I'm also using the fact that if you take or drop more elements than there are in the list, Haskell does not throw an error.

APL, 25 chars
Assuming the list is given in X ← 1 2 3 4.
(+/X)∊∘.{2×+/⍺↑⍵↓X,X}⍨⍳⍴X←⎕

Explanation:
First note that APL evaluates form right to left. Then:

X←⎕ takes the user input and stores it in X
⍴X gives the length of X
⍳⍴X the numbers from 1 to ⍴X
The ⍺ and ⍵ in {2×+/⍺↑⍵↓X,X} are the left and right argument
to a dyadic function we are defining inside the braces.

Now for the ⍺↑⍵↓X,X part:
X,X just concatenates X with itself; ↑ and ↓ are take and drop.
+/ reduces/folds + over the list on its right

So 2 {2×+/⍺↑⍵↓X,X} 1 = 2×+/2↑1↓X,X = 2×+/2↑1↓1 2 3 4 1 2 3 4 =
= 2×+/2↑2 3 4 1 2 3 4 = 2×+/2 3 = 2×5 = 10.
∘.brace⍨idx is just idx ∘.brace idx. (⍨ is the diagonal map; ∘. is the outer product)
So this gives us a ⍴X by ⍴X matrix which contains twice the sums of all connected sublists.
 4  6  8  2
10 14 10  6
18 16 14 12
20 20 20 20

The last thing we have to do is to check if the sum of X is somewhere inside this matrix.
Which we do with (+/X)∊matrix.

Brachylog, 6 bytes
sj+~+?

Try it online!
Outputs through success or failure, printing true. or false. if run as a program.
s         A contiguous sublist of the input
 j        with all of its items duplicated
  +       sums to
   ~+     the sum of the elements of
     ?    the input.

Mathematica, 48 bytes
!FreeQ[Outer[Plus,#,-#],Last@#/2]&@Accumulate@#&

Anonymous function, similar in action to the numerous other answers.
Outer[Plus, #, -#], when acting on Accumulate@# (which in turn acts on the input list, giving a list of successive totals) generates essentially the same table, as at the bottom of Leaky Nun's answer.
!FreeQ[..., Last@#/2] checks if (Last@#)/2 is not absent from the resulting table, and Last@# is the last of the successive totals, i.e. the sum of all elements of the input list.
If this answer is somewhat interesting, it is not because of a new algorithm, but more about the tricks specific to Mathematica; e.g. !FreeQ is nice, compared to MemberQ, since it does not require a flattening of the table it checks and it saves a byte.

I think !FreeQ[2Tr/@Subsequences@#,Tr@#]& should work, but I won't have 10.4 available to test it for the next 10 days or so.

@MartinEnder It certainly looks like it'd work, but I'm on 10.2, so that's what I have

APL(NARS), chars 95, bytes 190
{1≥k←≢w←⍵:0⋄s←+/⍵⋄∨/{s=2×s-+/⍵}¨↑¨{⍵⊂w}¨{(k⍴2)⊤⍵}¨{1≥≢⍵:⍵⋄⍵,∇{(1+2×(↑⍵))×2*0..¯2+≢⍵}⍵}2*0..k-1}

Consider one array of input of 4 elements: 1 2 3 4. How we can choose the useful for this exercise partition of that set?
Afther some think the partition of these 4 elements we can use are descrived in the binary number on the left:
0001,0010,0100,1000 2^(0..4) 1 2 4  8
0011,0110,1100,                3 6 12
0111,1110,                       7 14
1111                               15

(1001 or 1011 ecc could be in that set but already we have 0110 and 0100 ecc)
so one hat just to write one function that from the number of element of the input array build
these binary numbers... it would be:
c←{1≥≢⍵:⍵⋄⍵,∇{(1+2×(↑⍵))×2*0..¯2+≢⍵}⍵}

that from input 1 2 4 8 [2^0..lenBytesArgument-1] find 3 6 12, 7 14, 15; so find binary of
these numbers and using them find the right partitions of the input array...I tested c function only for that input 4 elements, but seems it is ok for other number of elements...
test:
  f←{1≥k←≢w←⍵:0⋄s←+/⍵⋄∨/{s=2×s-+/⍵}¨↑¨{⍵⊂w}¨{(k⍴2)⊤⍵}¨{1≥≢⍵:⍵⋄⍵,∇{(1+2×(↑⍵))×2*0..¯2+≢⍵}⍵}2*0..k-1}
  f¨(1 2 3 4)(6 6 12 12 12 11 1 12)(1000000 1000001 1)(1 2 3)(1 1)(42 42)
1 1 1 1 1 1
  f¨(1 2 3 4 5)(2 1 3 4)(,10)(1000000 1000001)(,1)(1 2)(3 1 1)
0 0 0 0 0 0 0


text:
Swap prime exponents with their neighbours
(Follow-up to my question about swapping bits with their neighbours.)
Task
Given a positive integer x = (2a · 3b) · (5c · 7d) · (11e · 13f) · …, print the integer obtained by swapping the exponents in this factorization for each successive pair of primes, y = (2b · 3a) · (5d · 7c) · (11f · 13e) · …
A061898 in the OEIS. This is code-golf, so the shortest program (in bytes) wins!
Test cases
1 -> 1
2 -> 3
3 -> 2
10 -> 21
37 -> 31
360 -> 756
12345 -> 11578
67895678 -> 125630871

Can we return True instead of 1?

@Dennis After some consideration, I’ve decided my answer is no. The output must at least look like a number.

Jelly, 10 bytes
ÆE;0s2UFÆẸ

Try it online! or verify all test cases.
How it works
ÆE;0s2UFÆẸ  Main link. Argument: n

ÆE          Yield the exponents of n's prime factorization.
  ;0        Append a zero.
    s2      Split into pairs.
      U     Upend; reverse each pair.
       F    Flatten the resulting list of pairs.
        ÆẸ  Convert the prime exponents to integer.

Jelly, 17 16 11 bytes
5 bytes thanks to Dennis.
ÆfÆC’^1‘ÆNP

Try it online!
Explanation
ÆfÆC’^1‘ÆNP   Main monadic chain. Argument: n

Æf            Yield the prime factors of n.
  ÆC          For each factor, count the number of primes below it.
              This effectively yields their indices.
    ’         Decrement [each] by 1.
     ^1       Xor with 1
       ‘      Increment [each] by 1.
        ÆN    Find their corresponding primes.
          P   Yield their product.

Previous 16-byte version
ÆnÆRiÐ€Æf’^1‘ÆNP

Try it online!
Explanation
ÆnÆRiÐ€Æf’^1‘ÆNP   Main monadic chain. Argument: n

Æn                 Yield the next prime from n.
  ÆR               Yield all primes from 2 to it.
       Æf          Yield prime factors of n
    iÐ€            Yield their index in the prime list.
         ’         Decrement [each] by 1.
          ^1       Xor with 1
            ‘      Increment [each] by 1.
             ÆN    Find their corresponding primes.
               P   Yield their product.

Previous 17-byte version:
ÆnÆR©iÐ€Æf’^1‘ị®P

Try it online!
Explanation
ÆnÆR©iÐ€Æf’^1‘ị®P   Main monadic chain. Argument: n

Æn                  Yield the next prime from n.
  ÆR                Yield all primes from 2 to it.
    ©               Store to register.
        Æf          Yield prime factors of n
     iÐ€            Yield their index in the prime list.
          ’         Decrement [each] by 1.
           ^1       Xor with 1
             ‘      Increment [each] by 1.
              ị®    Find their corresponding primes in
                    the list in register.
                P   Yield their product.

Python 2, 149 139 bytes
10 bytes thanks to Dennis.
n=input()
p=f=1;w=[2]
while w[-1]<=n:f*=p;p+=1;w+=[p]*(-~f%p<1)
r=p=1;w=w[1:]
while n>1:
    p+=1
    while n%p<1:n/=p;r*=w[w.index(p)^1]
print r

input() works in Python 2?

@NoOneIsHere Yes, it is the equivalent of eval(input()) in Python 3.

Mathematica, 70 69 bytes
1##&@@(Prime[BitXor[PrimePi@#+1,1]-1]^#2&)@@@FactorInteger@#/._@_->1&

An unnamed function which takes and returns an integer. It throws an error on input 1 but still computes the correct result.
Explanation
As usual, due to all the syntactic sugar, the reading order is a bit funny. A & on the right defines an unnamed function and its arguments are referred to by #, #2, #3, etc.
...FactorInteger@#...

We start by factoring the input. This gives a list of pairs {prime, exponent} e.g. input 12 gives {{2, 2}, {3, 1}}. Somewhat inconveniently, 1 gives {{1, 1}}.
(...&)@@@...

This applies the function on the left to the list of integers at level 1, that is the function is called for each pair, passing the prime and exponent in as separate arguments, and then returns a list of the results. (This is similar to mapping the function over the list, but receiving two separate arguments is more convenient than receiving a pair.)
...PrimePi@#...

We compute the number of primes up to and including the (prime) input using the built-in PrimePi. This gives us the index of the prime.
...BitXor[...+1,1]-1...

The result is incremented, XOR'ed with 1 and decremented again. This swaps 1 <-> 2, 3 <-> 4, 5 <-> 6, ..., i.e. all 1-based indices. Note that input 1 will yield 0 for PrimePi which is then mapped to -1 in this process. We'll deal with that later.
 ...Prime[...]^#2...

We now obtain the nth prime (where n is the result from the previous computation), which is the correctly swapped prime, and raise it to the power of the original prime in the factorisation of the input. At this point Prime[-1] will throw an error but will return itself unevaluated. The power in this case is 1 so that the entire process so far yields {Prime[-1]} for input 1 and a list of correct prime powers for all other inputs.
 1##&@@...

Next, we just multiply up all prime powers. 1##& is a standard golfing trick for the Times function. See this tip (section "Sequences of arguments") for how it works.
Finally, we need to take care of input 1 for which all of the above resulted in Prime[-1]. We can easily fix that with a simple replacement rule. Remember that f@x is short for f[x]. We just want to match any expression of that form (since all other results will be integers, i.e. atomic expressions), and replace it with a 1:
.../._@_->1

Here, /. is short for ReplaceAll, _@_ is a pattern for anything of the form f[x] (i.e. any compound expression with a single child) and ->1 says "replace with 1".

Python 2, 112 109 108 95 94 bytes
f=lambda n,k=4,m=6,p=[3,2]:1/n or n%p[1]and f(n,k+1,m*k,m*m%k*[k]+p)or p[len(p)*2%4]*f(n/p[1])

Test it on Ideone.
How it works
When f is called, it first computes 1/n. If the result is non-zero, n is 1 and f returns 1.
If n > 1, the following happens.

If n is not divisible by p[1] (initially 2), n%p[1] yields a truthy value and
  f(n,k+1,m*k,m*m%k*[k]+p)

gets called.
This branch generates prime number until the penultimate one evenly divides n. To do so, it uses the following corollary of Wilson's theorem.

At all times, m is equal to the factorial of k - 1 (initially 6 = 3! and 4. In each iteration, the result of m*m%k*[k] gets prepended to the list of primes p. By the corollary, m*m%k is 1 if k is prime and 0 if not, so this prepends k to p if and only if k is a prime number.

If n is divisible by p[1], n%p[1] yields 0 and
  p[len(p)*2%4]*f(n/p[1])

gets executed.
If p contains an even amount of prime numbers, len(p)*2%4 will yield 0 and the first multiplicand takes the value of p[0]. If p contains an odd amount of prime numbers, len(p)*2%4 will yield 2 and the first multiplicand takes the value of p[2].
In either case, this is the prime whose exponents has to get swapped with the one of p[1], so we divide n by p[1] (decreasing the exponent by 1) and multiply the result of f(n/p[1]) by the corresponding prime (increasing the exponent by 1).
Note that f(n/p[1]) resets k, m and p to their default values. f(n/p[1],k,m,p) would improve efficiency, at the cost of six extra bytes.

MATL, 17 bytes
EZqGYfy&mt2\Eq+)p

Try it online!
Explanation
This doesn't use the exponents directly. Instead, it swaps each (possibly repeated) prime factor by the next or the preceding prime.
EZq    % Implicit input. Multiply by 2
Zq     % Array with sequence of primes up to that (this is more than enough)
GYf    % Prime factors of input, with possible repetitions
y      % Duplicate array with sequence of primes
&m     % Indices of prime factors in the sequence of primes
t2\    % Duplicate, modulo 2. Gives 0 for even indices, 1 for odd
Eq     % Multiply by 2, add 1. Transforms 0 / 1 into -1 / 1
+      % Add. This modifies the indices to perform the swapping
)      % Apply the new indices into the sequence of primes
p      % Product. Implicit display

Julia, 64 bytes
~=primes
!n=prod(t->(~3n)[endof(~t[1])+1$1-1]^t[2],factor(2n))/3

Try it online! The last test case requires too much memory for TIO, but I've verified it locally.
How it works
To avoid special-casing input 1 – the product of an empty dictionary is not defined – we multiply the input n by 2 and divide the final result by its pair 3.
factor(2n) gives all positive exponents of prime factors of 2n as a dictionary. When iterating over the dictionary, we'll get key-value/prime-exponent pairs. The function prod will take these pairs, apply the anonymous function t->... to them and return the product of the results.
For each pair t = (p,e), endof(~t[1]) or endof(primes(t[1])) return k, the number of primes that are less or equal to p, meaning that p is the kth prime.
+1$1-1 will increment k, XOR k + 1 with 1 and decrement the result. If k is odd, k + 1 is even, so the XOR increments and the final result is k + 1. If k is even, k + 1 is odd, so the XOR decrements and the final result is k - 1.
Finally, we compute all prime numbers less or equal to 3n with (~3n) or primes(3n) (the highest prime factor of 2n is less or equal to n if n > 2, and there's always a prime between n and 2n), select the one at index k + 1 or k - 1, and elevate it to the eth power with ^t[2].

Pyth, 25 bytes
JfP_TSfP_ThQ*F+1m@Jx1xJdP

Test suite.
Explanation
JfP_TSfP_ThQ*F+1m@Jx1xJdP

           Q    get input
          h     add one
      fP_T      find the first prime after it
     S          range from 1 to that prime
 fP_T           filter for the primes
J               assign to J

                        P  prime factorize input
                m      d   for each factor
                     xJ    find its index in J
                   x1      xor with 1
                 @J        find the corresponding entry in J
            *F+1           product of the whole list

Julia, 155 131 127 bytes
n->(x=[sort([merge([p=>0for p=primes(n+1)],factor(n))...]);1=>0];prod([x[i-1][1]^x[i][2]*x[i][1]^x[i-1][2]for i=2:2:endof(x)]))

This is an anonymous function that accepts an integer and returns an integer. To call it, assign it to a variable. It requires a Julia version < 0.5 because the prime functionality has been removed from Base in 0.5.
Ungolfed:
function f(n::Int)
    # Create an array of pairs by merging the Dict created from factoring n
    # with all primes less than n+1 with a 0 exponent. Append an extra pair
    # to account for 1 and situations where x would otherwise have odd length.
    x = [sort([(merge([p=>0 for p in primes(n+1)], factor(n))...]); 1=>0]

    # Compute a^d * c^b, where a and c are primes with b and d as their
    # respective exponents.
    prod([x[i-1][1]^x[i][2] * x[i][1]^x[i-1][2] for i = 2:2:endof(x)])
end

Try it online! (Includes all test cases)

Actually, 15 bytes
w`i;r♂Pí1^Pn`Mπ

Try it online!
Explanation:
w`i;r♂Pí1^Pn`Mπ
w                prime factorization
 `          `M   map (for (p,e) in factorization):
  i;               flatten, make a copy of p
    r♂P            [prime[i] for i in range(p)]
       í           index (essentially the 0-based prime index of p)
        1^         XOR with 1
          P        prime[n]
           n       repeat e times
              π  product

05AB1E, 22 bytes
Ó¾‚˜2ô€R˜DgL<Ø)øvy`smP

Explained
Ó¾‚˜                    # list of primeexponents with a 0 appended: n=10 -> [1,0,1,0]
    2ô                  # split into pairs: [[1,0],[1,0]]
      €R˜               # reverse each pair and flatten: [0,1,0,1]
         DgL<Ø          # get list of primes corresponding to the exponents: [2,3,5,7]
              )ø        # zip lists: [[0,2],[1,3],[0,5],[1,7]]
                vy`sm   # raise each prime to its new exponent: [1,3,1,7]
                     P  # product: 21

Try it online

J, 21 bytes
([:,_2|.\,&0)&.(_&q:)

Gets the prime exponents of n as prime powers with zeros. Then partition them into nonoverlapping sublists of size 2 while filling with an extra zero. Then reverse each sublist, and flatten them into a list. Finally, convert back from prime exponents to a number.
Usage
   f =: ([:,_2|.\,&0)&.(_&q:)
   (,.f"0) 1 2 3 10 37 360 12345
    1     1
    2     3
    3     2
   10    21
   37    31
  360   756
12345 11578
   f 67895678x
125630871

Explanation
([:,_2|.\,&0)&.(_&q:)  Input: n
                _&q:   Obtain the list of prime exponents
(           )&.        Apply to the list of prime exponenets
         ,&0           Append a zero to the end of the list
    _2  \              Split the list into nonoverlapping sublists of size 2
      |.               Reverse each sublist
 [:,                   Flatten the list of sublists into a list
             &.(    )  Apply the inverse of (Obtain the list of prime exponents)
                       to convert back to a number and return it

Stax, 16 bytes
â↕ÿ╓d8‼Qlì"┌nq╟ì

Run and debug it

05AB1E, 13 bytes
Ó0ª2ôí˜ā<ØsmP

Try it online or verify all test cases.
Or alternatively:
xÅPsÓ0ª2ôí˜mP

Try it online or verify all test cases.
Explanation:
Ó              # Get all prime exponents of the (implicit) input-integer
 0ª            # Append a 0
   2ô          # Split it int parts of size 2
     í         # Reverse each inner pair
      ˜        # Flatten the list
       ā       # Push a list in the range [1,length] (without popping the list)
        <      # Decrease each by 1 to the range [0,length)
         Ø     # Get the n'th prime of each value
          s    # Swap so the earlier list is at the top
           m   # Take the primes to the power of the exponents
            P  # And then take the product
               # (after which the result is output implicitly)

x              # Double the (implicit) input-integer (without popping)
 ÅP            # Pop and push a list of all prime numbers <= this doubled input
   s           # Swap so the input is at the top of the stack
    Ó0ª2ôí˜    # Same as above
           m   # Take each prime to the power of the exponents
               # (any additional trailing primes will be discarded)
            P  # And then take the product
               # (after which the result is output implicitly)

source: Stack Exchange

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

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

sort: votes


text:
Color count, sorted by occurences
This one is simple to describe and I could hardly believe that this was not golfed before:
For a given image (whatever format is supported by your language), find the unique colors and output a list of the colors.

Print the color code in hex RGB, that is a hash sign # followed by 2 digits for R, 2 digits for G and 2 digits for B. (#xxxxxx where x can be 0-9, A-F and/or a-f).
The hex code shall be followed by a space  and the decimal pixel count, then a newline (\n or \r\n).
The list shall be sorted by count descending (most frequent color at the top).
If there's a tie (two colors with the same amount), the order is not important.
The image will not contain transparency, so any alpha value is not important. The alpha value may not be part of the output.
An image size of 4000x3000 must be supported (that may matter to type definitions)

Sample image "10red 20blue 30black 40white":
Expected output:
#FFFFFF 40
#000000 30
#0000FF 20
#FF0000 10

Sample image "blue gradient":
One of the expected outputs (since the order of same colors may vary):
#718DFF 19
#5571FF 15
#3855FF 11
#8DAAFF 11
#1C38FF 7
#AAAAFF 7
#8D8DFF 6
#AAC6FF 6
#C6C6FF 5
#C6E2FF 4
#001CFF 3
#E2E2FF 3
#FFFFFF 3

Sample image "testImage", kindly provided by @Luis Mendo:

Expected output:
#FFFFFF 18042
#000000 1754
#FF3300 204

Similar to this question, but the output is text, not an image.

count descending is a bit unclear. How do we sort it?

@EᴀsᴛᴇʀʟʏIʀᴋ: descending: most frequent color at the top

Okay, I would say that needs to be a bit more clear. Maybe say something like the most frequent colors at the top?

@EᴀsᴛᴇʀʟʏIʀᴋ: I agree, just updated the question for both

A couple of test cases would be good.

If your language doesn't support any image formats (no file support) what input can we take?

Some image formats are indexed, which means each pixel contains a pointer to a color in the colormap. Is that accepted?

@LuisMendo: you can look up the hex value in that color table, that's fine. It's not allowed to print the index instead of the hex value.

@muddyfish Not sure if that's allowed for challenges tagged image-processing. I asked a question on meta

@ThomasWeller This image is a nice test because it only has three colours an it's visually obvious what the order should be

Is the leading # required?

Can I additionally output transparency, even though it doesn't matter? For example, ffff0000 instead of ff0000 for pure red? Also, echoing Luis' question about the leading # being required.

@LuisMendo: yes, the hash is required, as shown in all the expected outputs. I clarified that in the question.

@TimmyD: the alpha value may not be part of the output as shown in all the expected outputs. I clarified that in the question.

PowerShell v2+, 187 bytes
$a=New-Object System.Drawing.Bitmap $args[0]
$b=@{}
0..($a.Height-1)|%{$h=$_;0..($a.Width-1)|%{$b["#"+-join($a.GetPixel($_,$h).Name[2..7])]++}}
$b.GetEnumerator()|Sort value -des|FT -h -a

Re-uses almost all of the code from my answer on Get the most dominant color. So, please reference that for full explanation.
The changes here are in indexing $b in the third line to match the explicit output format requirements, and in the last line we sort by value in -descending order, then pipe to Format-Table with -HideTableHeaders and -AutoSize as parameters. It's very rare to actually use FT here on PPCG, since output is implicit at the end of execution, but here it's very useful to ensure we get only the correct parts output.
Examples
The first is the "red" test image from the Dominant Color challenge, the second is the "testimage" from this challenge.
PS C:\Tools\Scripts\golfing> .\color-count.ps1 C:\Tools\Scripts\golfing\img\red.png

#ff0000 139876
#dcd9cf 3056
#f2f1ed 1512
#ffffff 1508
#ffe6e6 1488
#ffe3e3 8
#eae8e2 4
#fffbfb 4

PS C:\Tools\Scripts\golfing> .\color-count.ps1 C:\Tools\Scripts\golfing\img\z07VA.gif

#ffffff 18042
#000000 1754
#ff3300 204

Bash + coreutils, 54

7 bytes saved thanks to @manatwork

grep -oE '#\w+'|sort|uniq -c|sort -nr|awk '$0=$2" "$1'

This assumes STDIN input of Imagemagick's .txt format.
Ideone.

If the above input format is too much of a stretch, then we can add Imagemagick conversion from any format:
Bash + coreutils + Imagemagick, 71
convert $1 txt:-|grep -oE '#\w+'|sort|uniq -c|sort -nr|awk '$0=$2" "$1'

Here, the input image filename is passed in as a command-line parameter.

awk's default OFS is a space, you can trade " " for ,

Or even shorter awk part: awk '$0=$2" "$1'.

Mathematica, 91 bytes
StringRiffle@SortBy[Tally["#"<>IntegerString[#,16,2]&/@Join@@#~ImageData~"Byte"],-Last@#&]&

Uses a completely different method from @DavidC's answer. Unlike that one, this can support images with any size and color count. Explanation:
#~ImageData~"Byte"                   Take the RGB values of the image...
Join@@(...)                          Flatten to a list of colors...
"#"<>IntegerString[#,16,2]&/@(...)   Convert each color to #012def format...
Tally[(...)]                         Convert to a list of {color, multiplicity}
                                      pairs (this does most of the work)...
SortBy[(...),-Last@#&]               Order by the multiplicity descending...
StringRiffle@(...)                   And create a string with the desired format.

Nice. I like how  "Byte" returns the image data.

JavaScript (ES6), 359 355 bytes
Saved 4 bytes thanks to @Neil
u=>{i=new Image;i.src=u;e=document.createElement`canvas`;c=e.getContext`2d`;i.onload=_=>{w=e.width=i.width;h=e.height=i.height;c.drawImage(i,0,0);d=c.getImageData(0,0,w,h).data;for(o={},i=0;i<d.length;i+=4)++o[s='#'+`00000${(d[i]<<16|d[i+1]<<8|d[i+2]).toString(16)} `.slice(-7)]?0:o[s]=1;Object.keys(o).sort((a,b)=>o[b]-o[a]).map(c=>console.log(c+o[c]))}}

Demo

f=u=>{i=new Image;i.crossOrigin='';i.src=u;e=document.createElement`canvas`;c=e.getContext`2d`;i.onload=_=>{w=e.width=i.width;h=e.height=i.height;c.drawImage(i,0,0);d=c.getImageData(0,0,w,h).data;for(o={},i=0;i<d.length;i+=4)++o[s='#'+`00000${(d[i]<<16|d[i+1]<<8|d[i+2]).toString(16)} `.slice(-7)]?0:o[s]=1;Object.keys(o).sort((a,b)=>o[b]-o[a]).map(c=>console.log(c+o[c]))}}
f('http://i.imgur.com/acPudA9.gif')
<input value="https://i.imgur.com/acPudA9.gif" onchange="console.log('-------');f(this.value)">

Other test cases I uploaded to imgur to support CORS:

https://i.stack.imgur.com/T95xA.png
https://i.stack.imgur.com/OMLlA.png

The specific color data on these two seems to have altered slightly when uploading for some reason but it still prints the same amount of occurrences for those two test cases.

I think | has lower precedence than << so if you use it instead of + then you won't need so many ()s.

@user2428118 next time I'd appreciate if you left concerns in a comment and asked me to edit my own answer rather than editing it yourself. You actually broke my demo by removing <!-- language: lang-js --> from the snippet, effectively disabling the JavaScript.

@Patrick Sorry, I will be more careful next time. Also, I just found a way to save some bytes: u=>{document.write`<img src=${u} id=i><canvas id=e>`;c=e.getContext`2d`;i.onload=_=>{w=e.width=i.width;h=e.height=i.height;c.drawImage(i,0,0);d=c.getImageData(0,0,w,h).data;for(o={},i=0;i<d.length;i+=4)++o[s='#'+`00000${(d[i]<<16|d[i+1]<<8|d[i+2]).toString(16)} `.slice(-7)]?0:o[s]=1;Object.keys(o).sort((a,b)=>o[b]-o[a]).map(c=>console.log(c+o[c]))}}

Pyth, 29 bytes
jmj;_d_SrSm+\#.[\06.Hid256'Q8

Try it online!
(The online interpreter cannot read image, so I stripped of that part and inputted the result of reading that image, which is a list of color triplets. The part responsible for reading the image is ', a single colon.)
Proof of functionality of ' a single colon

You need a s before 'Q, since an image is represented as list of lists of triplets.

Here's a correct (and shorter) solution V_SrS%L+\#*3"%02X"s'z8jd_N

Mathematica 103 92 bytes
{"#"<>IntegerString[255Round[List@@#],16,2],#2}&@@@DominantColors[#,9999,{"Color","Count"}]&

Example

Explanation
DominantColors normally returns a list of colors and counts representing the main clusters in a picture.
When the number of colors requested exceeds the number of colors in the image, the exact pixel colors are returned.  (I am assuming that fewer than 10 000 colors will be in the input image.)

 {"#"<>IntegerString[255Round[List@@#],16,2],#2} converts the base 10 color values with hexadecimal values.

Note: there are only 5 colors in the mandrill image. (I used ColorQuantize[<image>,5] to reduce the number of colors in the standard mandrill image.)

Just out-golfed you ;)

By a little bit.  But your approach takes an unlimited number of colors.

Java (1.4+), 483 428 bytes
import java.util.*;class I {public static void main(String[] a) throws Exception {java.awt.image.BufferedImage i = javax.imageio.ImageIO.read(new java.io.File(a[0]));Map m=new HashMap();String s;for(Integer x=0,y=0,c;y<i.getHeight();y++)for(x=0;x<i.getWidth();m.put(s=x.toHexString(((c=i.getRGB(x++,y))&0xff0000)>>16)+x.toHexString((c & 0xff00)>>8)+x.toHexString(c&0xff),m.get(s)==null?1:(int)m.get(s)+1));System.out.print(m);}}

Try it online! (Doesn't work online)

Ungolfed:
import java.util.*;

class I {
    public static void main(String[] a) throws Exception {
        java.awt.image.BufferedImage i = javax.imageio.ImageIO
                .read(new java.io.File(a[0]));
        Map m = new HashMap();
        String s;
        for (Integer x = 0, y = 0, c; y < i.getHeight(); y++)
            for (x = 0; x < i.getWidth(); m
                    .put(s = x.toHexString(((c = i.getRGB(x++, y)) & 0xff0000) >> 16)
                            + x.toHexString((c & 0xff00) >> 8)
                            + x.toHexString(c & 0xff), m.get(s) == null ? 1
                            : (int) m.get(s) + 1))
                ;
        System.out.print(m);
    }
}

The toString() of map outputs like this:
{7c7c7c=6, 1d57a5=20468, 121212=7, d3d3d3=3, bdbdbd=9, 949494=2, 333=14, 626262=3, cacaca=2, 141414=5, fff=11, c9c9c9=1, e8e8e8=1, 919191=4, 161616=5, c2c2c2=1, 646464=7, 979797=12, fafafa=2, 808080=1, 7b7b7b=1, 484848=4, b9b9b9=2, f1f1f1=2, 6b6b6b=6, 363636=15, 262626=4, d8d8d8=2, 868686=4, 757575=1, 575757=3, a7a7a7=2, cecece=2, dcdcdc=2, c3c3c3=2, 1d1d1d=5, 727272=9, 656565=2, 3a3a3a=3, 7d7d7d=10, 393939=5, 797979=3, 222=31, 8f8f8f=2, 454545=4, 181818=9, 2e2e2e=2, 222222=1, 1c1c1c=19, b8b8b8=2, e1e1e1=5, 232323=5, 8a8a8a=3, 959595=7, 6a6a6a=9, 434343=7, 5c5c5c=3, 111=20, 909090=3, 424242=4, 212121=1, 1a1a1a=6, 202020=7, efefef=1, 565656=5, 6e6e6e=7, 767676=3, 323232=2, eee=5, 444=18, 2c62ab=1, 717171=2, b1b1b1=3, 6c6c6c=3, 545454=7, 515151=17, 2f2f2f=2, 4a4a4a=3, 888888=6, 6d6d6d=3, 898989=3, a3a3a3=5, 7e7e7e=9, ddd=9, b6b6b6=3, 2b2b2b=5, 313131=5, 8d8d8d=1, a2a2a2=2, 696969=3, a5a5a5=3, 4f4f4f=5, 828282=7, 191919=5, 606060=4, 6f6f6f=4, 8b8b8b=3, ebebeb=2, 555=19, 929292=3, 131313=11, 999999=5, d2d2d2=2, 444444=9, 474747=4, dddddd=1, 585858=8, 5a5a5a=3, 000=9887, afafaf=2, dfdfdf=3, 747474=3, 666666=4, a1a1a1=4, 2a2a2a=11, 4d4d4d=6, 818181=2, 878787=5, 215aa6=1, d9d9d9=4, b5b5b5=3, b4b4b4=3, 737373=4, aeaeae=3, bbb=15, 242424=4, 2d2d2d=8, 888=19, c1c1c1=1, 494949=9, dbdbdb=5, ccc=19, 5d5d5d=3, 5f5f5f=1, 414141=6, c8c8c8=3, aaa=16, 1e1e1e=3, 707070=2, 9e9e9e=2, 373737=7, 9d9d9d=2, 1b1b1b=4, 303030=7, 535353=10, 595959=2, 8e8e8e=3, 383838=5, 939393=18, 616161=2, 686868=6, dadada=1, e3e3e3=2, 5b5b5b=3, a4a4a4=5, 8c8c8c=5, a6a6a6=11, 292929=6, 4c4c4c=3, 151515=6, fefefe=2, 787878=2, 505050=2, e2e2e2=1, 1f1f1f=9, adadad=2, ababab=1, 5e5e5e=6, 252525=4, 4e4e4e=3, 282828=7, a8a8a8=4, 9c9c9c=3, aaaaaa=1, 101010=5, b7b7b7=2, 969696=6, 7f7f7f=4, 555555=2, a9a9a9=5, 343434=8, 999=17, 777777=3, ffffff=76669, f0f0f0=4, bbbbbb=1, 1e58a5=1, b3b3b3=4, 777=20, 636363=2, d4d4d4=1, 2c2c2c=5, 848484=1, 3c3c3c=3, bfbfbf=2, 3e3e3e=9, 333333=4, 7a7a7a=3, 858585=4, 4b4b4b=3, 272727=7, 111111=6, 666=13, 9b9b9b=1, bcbcbc=4, cfcfcf=2, 9a9a9a=1, 404040=21, 525252=3, 989898=4, 171717=5, 3b3b3b=2, c4c4c4=1, 3f3f3f=7, 464646=1, cdcdcd=2, b2b2b2=33, c5c5c5=2, bababa=2}

Please don't post 1.8 specific golfs suggestions, unless it works in older Java, me no want.
Example: Lambdas don't work in more versions of Java than they do work in.

"Please don't post 1.8 specific golfs suggestions, unless it works in older Java, me no want." Out of curiosity: why Java 4 while Java 10 is already available?

Some golfs that should work in Java 4 (I think): import java.util.*;class M{public static void main(String[]a)throws Exception{java.awt.image.BufferedImage i=javax.imageio.ImageIO.read(new java.io.File(a[0]));Map m=new HashMap();String s;for(Integer x=0,y=0,c;y<i.getHeight();y++)for(x=0;x<i.getWidth();m.put(s=x.toHexString((c&0xff0000)>>16)+x.toHexString((c&0xff00)>>8)+x.toHexString(c&0xff),m.get(s)==null?1:(int)m.get(s)+1))c=i.getRGB(x++,y);System.out.print(m);}} (419 bytes)

@KevinCruijssen Because 1.8 was, arguably, the biggest release in terms of code that will not run with previous versions. Most other releases were fixes and additions of classes to the JRE. 1.8 was the least compatible with previous JRE's.

@KevinCruijssen x.toHexInteger was smarter than a static import.

Also not Java 3, because Java 3... really... has so few shortcuts...

You can still golf 8 spaces in your current answer. :)

Tcl/Tk, 134 bytes
console s
lmap s [concat {*}[[image c photo -fi $argv] d]] {dict inc D $s}
dict fo k\ v [lsort -int -s 2 -inde 1 -de $D] {puts $k\ $v}

d is for data.

Tcl/Tk, 232 bytes
console s
set I [image c photo -fi $argv]
set i 0
time {set j 0
time {dict inc D #[join [lmap s [$I g $i $j] {format %02X $s}] ""]
incr j} [image h $I]
incr i} [image w $I]
dict fo k\ v [lsort -int -s 2 -inde 1 -de $D] {puts $k\ $v}

wish sort_pix.tcl QTE4O.png

wish sort_pix.tcl 5s1Ob.png

wish sort_pix.tcl z07VA.gif

Brain-Flak, 1110 bytes
{{}({}[(()()()()()){}])}{}(<>)<>([]){{}({}()<({}()<({}()<>)>)>)<>([])}{}<>{({}<({}<({}<(()()<>)>)>)>)<>{(<>)<>(()()()){({}[()]<<>({}<([([(({})<>[({})]<>)])]<>)<>{({}()<([{}])<>({}<>)<>>)<>}{}<>{}<>>{})({}<({}<({}<>)<>({}<>)<>({}<>)<>>)<>({}<>)<>({}<>)<>({}<>)>)<>({}<({}<>)<>({}<>)<>>)<>({}<>)<>({}<>)>)}{}<>((){[()](<{}>)}{})((){[()](<{}({}())<>{}{}{}>)}{}){{}(<<>(()()()){({}[()]<({}<(([])<{{}({}<>)<>([])}{}<>>)<>>)<>{({}[()]<({}<>)<>>)}{}<>>)}{}>)}{}<>({}<({}<>)<>({}<>)<>({}<>)<>>)<>({}<>)<>({}<>)<>({}<>)<>}({}<(([])<{{}({}<>)<>([])}{}<>>)<>>)<>{({}[()]<({}<>)<>>)}{}(()()()()){((({}[()])<{({}[()]<({}<({}<>)<>>)>)}{}>)<{({}[()]<<>({}<>)>)}{}>)}{}<>}{}<>(()()()())([][()])({}(<>))<>([()]{()<(({})){({}[()])<>}{}>}{}<><{}{}>){({}[()]<(<(()()()())([][()])({}(<>))><>([()]{()<(({})){({}[()])<>}{}>}{}<><{}{}>)<{({}[()]<([([({}<({}<({}<({}<(({})<>)<>>)>)>)>)<><({}<>)>]{}<(())>)](<>)){({}())<>}{}({}<><{}{}>){{}<>(<({}<({}<({}<({}<({}<({}<({}<({}<>)>)>)>)<>>)>)>)>)<>({}<({}<({}<({}<<>>)>)>)>)>)}{}({}<({}<({}<({}<>)>)>)>)<>>)}{}<>{}{}{}{}>[()]){({}[()]<({}<({}<({}<({}<>)>)>)>)<>>)}{}<>>)}{}{({}[()]<>)<>}<>

Try it online!
Well that was an adventure. Turns out, Brain-Flak is not very good at image processing. Who knew?
I'll start off by noting that this technically doesn't meet the strict output format requested. If you want that enforced let me know and I'll try to add translation code. For now it outputs decimal numbers: each 4 numbers represents a color in the order RED GREEN BLUE COUNT.
Next up, input. Allowed input formats were more flexible so I used the format easiest for Brain-Flak to parse (that I could find): Netpbm P6. Unfortunately, Brain-Flak could not parse decimal numbers from the P3 format because all Netpbm images start with the character P and Brain-Flak can't handle decimal input from files containing non-numeral characters. So P6 was used instead, because P6 stores color information as bytes, which are treated as numbers in ASCII input mode. There remained a challenge because the header information was not encoded usefully, but fortunately I didn't need any of that information so it is just discarded. This program doesn't fully adhere to the Netpbm standard because it does not allow newlines within the header, but newlines are not required by the standard so the inputs are valid Netpbm files.
Last caveat, the version on TIO is actually not correctly configured for "official" operation because (to my knowledge) I can't supply files as input on TIO, nor could I supply bytes corresponding to unprintable ASCII in the direct input. For official operation the -a flag is needed to take input as raw bytes and -f to take input from a file. The sample input on the TIO link was instead manually translated from the example on the Netpbm wiki page.
Additionally, I'd like to thank the Brain-Flak wiki for providing helpful snippets of code to work from. In particular, the Bubble-Sort implementation here was instrumental to the final step once I had gotten a count for every color, since I didn't really have any idea where to start otherwise. It took heavy modification, but I'm glad I didn't have to start from scratch.
Here is the ungolfed and commented version of the code. Brain-Flak is a bit too verbose to include a usefully formatted explanation right in this post, but the ungolfed version on TIO contains everything I would include in one with better formatting than I could manage here, so if you're interested please take a look.
There may be golfing yet to do, my previous Brain-Flak answer went through a lot of revisions, but hopefully the lessons learned there gave this a better starting point.

Python 2, 186 bytes
import Image
I=Image.open(input()).convert('RGB')
w,h=I.size
r=['#'+('%0.2X'*3)%I.getpixel((i%w,i/h))for i in range(w*h)]
for a,b in sorted(set((r.count(v),v)for v in r))[::-1]:print b,a

Try it online!
Disclaimer: Presented outputs are one-liners for readability. Code outputs result with space and line separation as requested by challenge.
Output for 10red 20blue 30black 40white:
[('#FFFFFF', 40), ('#000000', 30), ('#0000FF', 20), ('#FF0000', 10)]

Ouput for blue gradient:
[('#718DFF', 19), ('#5571FF', 15), ('#8DAAFF', 11), ('#3855FF', 11), ('#AAAAFF', 7), ('#1C38FF', 7), ('#AAC6FF', 6), ('#8D8DFF', 6), ('#C6C6FF', 5), ('#C6E2FF', 4), ('#FFFFFF', 3), ('#E2E2FF', 3), ('#001CFF', 3)]

Output for test image
[('#FFFFFF', 18042), ('#000000', 1754), ('#FF3300', 204)]

Explanation:
w,h=I.size # field size stores tuple of values of width and height of image

I.getpixel((i%w,i/h)) # returns tuple of base10 RGB values

('%0.2X'*3) # format string to convert int into hex

set((r.count(v),v)for v in r) # generate set of unique pairs count-color

sorted(set(...))[::-1] # apply sorted(), as it sorts set of tuples by firts elements and reverse sort

print b,a  # swap values in tuples and print

SmileBASIC, 165 bytes
DEF C A
L=LEN(A)DIM C[L],N[L]FOR J=0TO L-1FOR I=0TO U-1ON A[J]-C[I]GOTO@L
NEXT
U=U+1@L
C[I]=A[J]INC N[I]NEXT
RSORT.,U,N,C
FOR I=0TO U-1?"#";HEX$(C[I],6),N[I]NEXT
END

Image is given as an array of 32 bit ARGB color values (the alpha value is trimmed when the number is converted to a 6 digit hex string)

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


text:
What's the Binary Time?
What's the Binary Time?
Everybody knows what the normal time is. It's up there in the top-right (or wherever you put it) of your screen. But a question people rarely seem to ask themselves is this: What's the binary time?
Binary Time
Binary Time (True Binary Time) works by first reading the most significant bit (MSB) of the number. If that number is 0, the time expressed is before noon. If that number is 1, the time expressed is after noon. The next bit splits the half of the day the first bit expressed into two more equal halves, this time of 6 hours. The following bit splits into 3 hours, the next 90 minutes, and so on. Times like 12:00:00, where it seems it should be neither, become 1.
I can only understand this strange system of timing, so I need a program to convert to that for me. But as binary numbers are Base-2, and 2 is a small number, your program must be as short as possible.
Requirements

Your program should take a time (as 24-hour-time) as input and output the corresponding binary time number.
The output number should have 16-bit precision (the number should be 16 digits long).
You cannot use a builtin that does all of that conversion for you.
You should floor if it needs to be rounded.

Rules

Standard loopholes are forbidden.
Your program should not write anything to STDERR.

Test Cases
00:00:00 ==> 0000000000000000
12:00:00 ==> 1000000000000000
01:30:00 ==> 0001000000000000
10:33:06 ==> 0111000010001101
09:57:30 ==> 0110101000111000
06:00:00 ==> 0100000000000000
18:00:00 ==> 1100000000000000
Scoring
To win, as I mentioned earlier, you must have the least bytes.
Submissions
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

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

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

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

Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 81057; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

Can I input as [hour, minute, second]? We don't like restricting input format.

How does 09:57:30 make 0110110000000000?

16 bits can only represent 65536 values. There are 86400 seconds in a day. How should we represent anything that does not exactly match a binary representation?

Can we return the result as a list of 16 numbers?

@Adám Yes, you can.

@LeakyNun Yes, I will edit.

Can numbers in output be separated by spaces?

Are leading zeroes required or optional?

If input cat be an array you should state that in the challenge, not just in comments

MATL, 15 bytes
YOtk-KWW*k16&YB

Uses a builtin for converting a string representing time to a serial date/time number, which is allowed by the challenge.
Try it online!
Explanation
YO       % Input time string. Convert to serial date/time. Time is fractional part
tk-      % Duplicate, round down, subtract. This keeps fractional part only
KWW      % 34, 2 raised to, 2 raised to (`16W` would require an extra space)
*        % Multiply
k        % Round down
16&YB    % Convert to binary string with 16 digits. Display

CJam, 20 bytes
l':/60b9m<675/2bG0e[

Test suite.
Explanation
Makes use of the fact that 65536 (216) over 86400 (the number of seconds in a day) simplifies to 512 over 675.
l     e# Read input.
':/   e# Split around ':', so we get ["hh" "mm" "ss"].
60b   e# Interpret as base-60 digits, which computes hh*60^2 + mm*60 + ss,
      e# i.e. it computes the total number of seconds. Note that this implicitly
      e# converts all three strings to integers.
9m<   e# Bitwise left-shift by 9 positions, which is the same as multiplying by
      e# 2^9 = 512.
675/  e# Divide by 675, flooring the result.
2b    e# Convert to binary.
G0e[  e# Left-pad with zeros to 16 digits.

Pyth, 31 27 bytes
.[\016.Bs*512cisMcQ\:60 675

Test suite.
Converts the input into number of seconds passed, multiply by a factor of 2^16 / 24*60*60, and then floor and convert to 16-bit binary.
Saved 4 bytes by simplifying 65536/86400 into 512/675 (stupid me).
Input/output
00:00:00    0000000000000000
11:00:00    0111010101010101
12:00:00    1000000000000000
01:30:00    0001000000000000
10:33:06    0111000010001101
09:57:30    0110101000111000
06:00:00    0100000000000000
18:00:00    1100000000000000
23:59:59    1111111111111111

Can you justify "and then floor"?

@PeterTaylor What should I do instead?

Wait until the spec has been disambiguated before posting an answer.

@PeterTaylor The right way of rounding is apparent by 10:33:06.

@Adám, not really, because that gives the same output with floor and round-to-nearest.

I've clarified.

TSQL(sqlserver 2012), 103 bytes
DECLARE @d datetime = '10:33:06'

DECLARE @ char(16)='',@x INT=cast(@d as real)*131072WHILE
len(@)<16SELECT @x/=2,@=concat(@x%2,@)PRINT @

Try it online
Ungolfed
DECLARE @d datetime = '10:33:06'

DECLARE @ char(16)='',
        @x INT=cast(@d as real)*131072
WHILE len(@)<16
SELECT @x/=2,@=concat(@x%2,@)
PRINT @

TSQL(sqlserver 2012), 119 106 bytes
Also included a different version without the variable @x, however it was a few bytes longer. Including the ungolfed version for those interested:
DECLARE @d datetime = '23:59:59'

DECLARE @ varchar(16) =''
WHILE LEN(@)<16
SET @+=LEFT(CAST(@d as decimal(9,9))*2*POWER(2,LEN(@))%2,1)
PRINT @

That doesn't look golfed. Can't you remove a lot of whitespace?

@Adám it is very goolfed, I used different methods than the standard to make the script shorter and even tried a different method. I just had an accidental whitespace put in when coping my answer into codegolf(only one extra). I wanted to put a linebreak there, but decided to put it after WHILE instead. Removing the space and wondering if you really downvoted me for that single extra space

@Adám and if you are looking at the second method, it is not golfed(except the character count), since it is not my actual answer. Just a different more calculating method of solving it

No, I didn't downvote. It was probably someone who has a principle to downvotes all answers that are posted before the OP clarifies outstanding rule questions. All but the very newest answer has exactly one downvote. (It was probably Peter Taylor, because he was last here just before that post, and he has been complaining about this.) You can see this when you get enough rep. Here, have some!

JavaScript (ES6), 72 76 bytes
Edit 4 bytes save thx @Neil
Still unclear about the rounding. This one truncates and that's ok.
t=>(t.split`:`.map(v=>t=+v+60*~~t),t*512/675|65536).toString(2).slice(1)

Test

f=t=>(t.split`:`.map(v=>t=+v+60*~~t),t*512/675|65536).toString(2).slice(1)

function test() {
  var v=I.value
  R.textContent=f(v)
}

test()

;`00:00:00 ==> 0000000000000000
12:00:00 ==> 1000000000000000
01:30:00 ==> 0001000000000000
10:33:06 ==> 0111000010001101
09:57:30 ==> 0110101000111000
06:00:00 ==> 0100000000000000
18:00:00 ==> 1100000000000000`
.split('\n').forEach(t=>{
  [i,k]=t.split(' ==> ')
  r=f(i)
  ok=r==k
  O.textContent += (ok ? 'OK ':'KO ')+ i + ' -> ' + r + (ok? '\n' : ' Expected '+k+'\n')
})
<input id=I value='12:34:56' oninput=test()>

am trying to figure out why this was downvoted

t=>([h,m,s]=t.split\:`,(+h+m/60+s/3600)8192/3|65536).toString(2).slice(1)saves you 2 bytes, butreducegoes one byte further:t=>(t.split`:`.reduce((n,m)=>+m+n60)*512/675|65536).toString(2).slice(1)`

Downvote without a comment is not cool, upvoted

@Neil thank you very much! And with .map 1 more byte saved

Huh, I was wondering where you were going to get the 0 from for the map...

Had a little play with this, if you can use Date to parse the time (looks like some other answers are), you might be able to save some bytes, this solution might be locale dependent though: s=>(new Date('1 '+s)/1e3*512/675|65536).toString(2).slice(14) for 61, else: s=>(Date.parse('1 '+s+' UTC')/1e3*512/675|65536).toString(2).slice(14) for 70 (or maybe something in-between)?

APL (Dyalog), 24 21 bytes
The rules have now been clarified.
Prompts for time as 3-element list.
(16/2)⊤⌊512×675÷⍨60⊥⎕

Edit: Updated (⌈ → ⌊) to match new result for 10:33:06.
Try it online!
⎕ prompt for input
60⊥ evaluate in base-60
675÷⍨ divide by 675
512× multiply by 512
⌊ floor
(…)⊤ convert to (mnemonic: upside-down base is anti-base) the following number system:
 16/2 replicate 2 sixteen times (i.e. 16-bit binary)

Q, 32 Bytes
48_0b\:_(512%675)*60/:"I"$":"\:

Test
   t "00:00:00"
0000000000000000b
   t "12:00:00"
1000000000000000b
   t "01:30:00"
0001000000000000b
   t "10:33:06"
0111000010001101b
   t "09:57:30"
0110101000111000b
   t "06:00:00"
0100000000000000b
   t "18:00:00"
1100000000000000b

In order to reduce display cluttering, i assume a slight modification
to the original expression, that gives name t to the lambda
b suffix indicates binary

Explanation
NOTE.- read left to right, evaluates right to left
Reads as: 48 drop from binary representation of floor of 512 divideb by 675 and multiplied by 60 scalarFromVector over integer cast from splits at ":" original string
Evaluation:
":"\:x    splits string x (implicit arg of the lambda) at ":" character (Q uses "" to denote char)
"I"$x     cast string(s) x to int(s) -> hours, minutes, seconds
60/:x     uses base 60 to calculate a single value from a sequence of ints -> seconds total
(512%675)*x  calculates ratio 512%675 (% is divide) and multiplies seconds. 512%675 is the simplified form of the fraction (totalSecondsPerDay%64K)
_ x        indicates floor of float x
0b\:x      calculates binary representation of x (64 bits)
48_ x      drop first 48 bits, so we have our 16 bits representation
Example (x="01:30:00"). NOTE.- "/" indicates comment to end of line
":"\:"01:30:00"    /-> ("01";"30";"00")
"I"$                /-> 1 30 0
60/:                /-> 5400
(512%675)*          /-> 4096.0
_                   /-> 4096
0b\:                /-> 0000000000000000000000000000000000000000000000000001000000000000b
48_                 /-> 0001000000000000b

PHP, 47 46 43 bytes
Uses IBM-850 encoding.
printf(~┌Ø,strtotime($argn.UTC,0)*512/675);

Run like this:
echo "18:00:00" | php -nR 'printf(~┌Ø,strtotime($argn.UTC,0)*512/675);';echo

Tweaks

Saved a byte by using IBM-850 encoding.
Saved 3 bytes by using $argn

Ruby, 75 bytes
h,m,s=t.split(':').map &:to_i;((h*3600+m*60+s<<9)/675).to_s(2).rjust 16,'0'

I feel like there must be a shorter method of converting the time to seconds, but this is all I could think of.

Python, 45 bytes
lambda h,m,s:bin((s+m*60+h*3600)*512/675)[2:]

Came up with the 512/675 factor myself, then saw others did it the same.

C, 91 bytes
f(h,m,s,n,i){i=0;n=(s+m*60+h*3600)*512/675;while(i<16)printf((n&32768)?"1":"0"),n<<=1,i++;}


text:
Cosmic ray-proof programming
Cosmic rays are bad for computers. They corrupt RAM, and that causes problems. Computer chips are shrinking, and that makes them more vulnerable to the cosmic rays. We will not give in to these high-energy particles. Turing-completeness shall live on!
Task
Your task is to write a Turing machine. But not just any Turing machine: your Turing machine has to be cosmic ray-proof! At any time in your program's execution, exactly one bit will be flipped in its memory-space. Your program must continue executing normally regardless.
Your Turing machine must have an arbitrarily-sized tape (in both directions), initialised to NUL (0).
Input
The input will be a list of tuples, each conforming to the following format:
state value new-value direction new-state

The items of each tuple are as follows:

state, new-state: States are strings of arbitrary length. In practice they won't be very long. A blank space will not be used in a state name.
value, new-value: Each value is exactly one byte. It may be any character from NUL to DEL.
direction: The direction to move. Can be l (left), r (right) or n (stay still).

Output
Output should be the blocks of tape that have been written to, from left to right.
Scoring
Your program will be scored by number of errors / number of rays. Cosmic rays are simulated by randomly changing one bit in the program's working memory whilst it is running. Only one ray will hit the program per execution. Lowest score wins.
Your program must run without cosmic rays hitting it.
Cosmic Ray algorithm
prog = debug.run("program");
for (states = 0; !prog.exited; states++) {
    prog.step(1);
}
output = prog.output;

raystate = randint(0, states); // [0 - states)
prog = debug.run("program");
prog.step(raystate);
addr = prog.memory.randaddress();
bit = randint(0, 8);           // [0 - 8)
addr.flipbit(bit);
prog.run();
if (output != prog.output) {
    print("Failed");
} else {
    print("Succeded");
}

What's the objective? I don't see any winning criterion.

This is still in dire need of the sandbox.

@feersum I'm working on csmcry32 and csmcry64. Once I've done that, I'll make the *nix version.

Since two people have voted to reopen, I presume that they think it's clear what the task is. Could one of them state it in their own words? Because I have no idea what the Turing machine we're being asked to write is supposed to do.

@PeterTaylor It's meant to run a program which is given as input.

So are you asking for a universal Turing machine which is capable of executing TMs with arbitrary symbol sets? Or a schema for creating a universal Turing machine given the symbol set over which the machines it emulates will execute? And in any case, given that every reasonable answer will get a perfect score, what's the tie-breaker?

@PeterTaylor ... Why will every reasonable answer get a perfect score?

And no, I just want a Turing machine that supports 256 symbols and an infinite tape. But the tape doesn't actually have to be infinite, and the program has to output the used sections of the tape.

Re scoring: if you're going to go to the hassle of writing a universal Turing machine for a complex symbol set, adding a basic best-of-3 error correcting code isn't much more work. Re output: hang on. The question asks us to write a Turing machine. Turing machines do all I/O via their infinite tape. "Output the used sections of the tape" doesn't make any sense. It will leave a representation of the emulated machine's tape (and probably the machine itself) on its own tape, surely?

@PeterTaylor Emulated machine?

How should output work then?

Let us continue this discussion in chat.


text:
Fairly rank values
Task
Given an input list of integers x1…xn, compute a list of ranks r1…rn (a permutation of {1…n}) so that xr1 ≤ xr2 ≤ … ≤ xrn. Then, for each xi, replace its rank by the arithmetic mean of the ranks of all values in x that are equal to xi. (That is, whenever there is a tie between equal values in x, fairly redistribute the ranks among all of them.) Output the modified list of ranks r’1…r’n.
(For statistics geeks: such a ranking of observations is used in the Mann–Whitney U test (method two, step 1.))
Example
Given an input list [3, -6, 3, 3, 14, 3], the first list of ranks would be [2, 1, 3, 4, 6, 5], which would sort the list into [-6, 3, 3, 3, 3, 14]. Then, the ranks for all 3s in the input list are evened out into (2 + 3 + 4 + 5) ÷ 4 = 3.5. The final output is [3.5, 1, 3.5, 3.5, 6, 3.5].
Test cases
[4, 1, 4] -> [2.5, 1.0, 2.5]
[5, 14, 14, 14, 14, 5, 14] -> [1.5, 5.0, 5.0, 5.0, 5.0, 1.5, 5.0]
[9, 9, -5, -5, 13, -5, 13, 9, 9, 13] -> [5.5, 5.5, 2.0, 2.0, 9.0, 2.0, 9.0, 5.5, 5.5, 9.0]
[13, 16, 2, -5, -5, -5, 13, 16, -5, -5] -> [7.5, 9.5, 6.0, 3.0, 3.0, 3.0, 7.5, 9.5, 3.0, 3.0]

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

Somewhat disgusting values

Jelly, 10 8 bytes
ð_'Ṡ‘S‘H

Saved 2 bytes by using the cmp trick from @xnor's answer.
Try it online! or verify all test cases.
How it works
ð_'Ṡ‘S‘H  Main link. Left argument: A (list of values)

ð         Make the chain dyadic, setting the right argument to A.
 _'       Spawned subtraction; compute the matrix of differences.
   Ṡ      Apply the sign function to each difference.
    ‘     Increment.
     S    Sum across columns.
      ‘   Increment.
       H  Halve.

Pyth, 12
m+l<#dQ.OS/Q

Test Suite
For each value this computes the arithmetic mean of [1..frequency] and adds the count of values less than the current one.
This works because for each value we would compute:
(1 / frequency) * sum (i = 1..frequency) i + count_less

which we can simplify to:
(1 / frequency) * [ frequency * (frequency + 1) / 2 + count_less * frequency ]

and again to:
(frequency + 1) / 2 + count_less

However, in Pyth it was golfier to compute the first summand by using the mean builtin, rather than this other formula.

Python 2, 51 bytes
lambda l:[-~sum(1+cmp(y,x)for x in l)/2.for y in l]

For each element y, the cmp expression gives 2 points for each smaller x and 1 point for each equal x. This sum is rescaled into the right range by adding 1 and halving. The 2. is needed to avoid integer division.
Python 3, 52 bytes
Python 3 lacks cmp, requiring a Boolean expression (+2 bytes), but it has float division (-1 byte).
lambda l:[-~sum((y>x)+(y>=x)for x in l)/2for y in l]

MATL, 14 bytes
7#utG&S&S2XQw)

Try it online! Or verify all test cases (slightly modified version of the code; each result is on a different line).
      % Implicit input. Example: [5 14 14 14 14 5 14]
7#u   % Replace each value by a unique, integer label. Example: [1; 2; 2; 2; 2; 1; 2]
t     % Duplicate
G&S   % Push input again. Sort and get indices of the sorting. Example: [1 6 2 3 4 5 7]
&S    % Sort and get the indices, again. This gives the ranks. Example: [1 3 4 5 6 2 7]
2XQ   % Compute mean of ranks for equal values of the integer label. Example: [1.5; 5]
w     % Swap top two elements in stack
)     % Index the means with the integer labels. Example: [1.5; 5; 5; 5; 5; 1.5; 5]
      % Implicit display

05AB1E, 13 bytes
Code:
v¹y‹O¹yQO>;+ˆ

Uses the CP-1252 encoding. Try it online!.

R, 17 12 bytes
Takes the input from STDIN outputs to STDOUT.  If the output is flexible then we can ditch the cat().
rank(scan())

Fairly simple, uses the builtin rank that defaults to average for a tie breaker.
In use:
> rank(scan())
1: 5 14 14 14 14 5 14
8:
Read 7 items
[1] 1.5 5.0 5.0 5.0 5.0 1.5 5.0
> rank(scan())
1: 3 -6 3 3 14 3
7:
Read 6 items
[1] 3.5 1.0 3.5 3.5 6.0 3.5
>

You may drop the cat(), if it’s up to me. I don’t know what the community consensus is, though.

@Lynn Thanks I will.  I can always put it back.

J, 18 bytes
1-:@+1+/"1@:+*@-/~

Based on Dennis' solution using xnor's method.
Using a straight-forward approach requires 24 bytes for me.
(i.~~.){](+/%#)/.1+/:@/:

Usage
   f =: 1-:@+1+/"1@:+*@-/~
   f 3 _6 3 3 14 3
3.5 1 3.5 3.5 6 3.5
   f 4 1 4
2.5 1 2.5
   f 5 14 14 14 14 5 14
1.5 5 5 5 5 1.5 5
   f 9 9 _5 _5 13 _5 13 9 9 13
5.5 5.5 2 2 9 2 9 5.5 5.5 9
   f 13 16 2 _5 _5 _5 13 16 _5 _5
7.5 9.5 6 3 3 3 7.5 9.5 3 3

APL, 17 chars
(y+.×⍋X)÷+/y←∘.=⍨X

Assuming the list is stored in X.
Explanation:
Note that APL evaluates expressions from right to left. Then:

∘.=⍨X = X∘.=X where ∘.= is the outer product using = as dyadic function. (Where you normally would multiply. So the mathematical outer product may be written as ∘.×.)
The resulting matrix is stored in y and y is directly folded using + to give a vector of the number of equal objects for each rank (lets call it z←+/y).
⍋X returns the ranks of X
y+.×⍋X gives the inner product of our matrix y with this vector.
The result is divided (component wise) by z.

Actually, 18 bytes
;╗`╝╜"╛-su"£MΣu½`M

Try it online!
This is essentially a port of xnor's Python solution.
Explanation:
;╗`╝╜"╛-su"£MΣu½`M
;╗                  push a copy of input to reg0
  `             `M  for x in input:
   ╝                  push x to reg1
    ╜                 push input from reg0
     "    "£M         for y in input:
      ╛                 push x from reg0
       -s               cmp(y,x) (sgn(y-x))
         u              add 1
             Σu½      sum, add 1, half

Julia, 30 bytes
!x=-~sum((x.>x')+(x.>=x'),2)/2

This uses an approach from @xnor's answer. Julia has cmp, but it doesn't vectorize.
Try it online!

JavaScript (ES6), 49 48 bytes
a=>a.map(n=>a.reduce((r,m)=>r+(n>m)+(n>=m),1)/2)

Edit: Saved 1 byte by reformulating the expression so it now looks like @xnor's Python 3 answer.


text:
Oneliner to merge lines with same first field
This is my first codegolf question, so I apologize in advance if it's not appropriate, and I welcome any feedback.
I have a file with this format:
a | rest of first line
b | rest of second line
b | rest of third line
c | rest of fourth line
d | rest of fifth line
d | rest of sixth line

The actual contents vary, as does the delimiter. The contents are just text. The delimiter only appears once per line. For this puzzle, feel free to change the delimiter, e.g. use "%" as the delimiter.
Desired output:
a | rest of first line
b | rest of second line % rest of third line
c | rest of fourth line
d | rest of fifth line % rest of sixth line

I already have both ruby and awk scripts to merge this, but I suspect it's possible to have a short oneliner. i.e. a one-liner that can be used along with pipes and other commands on the command line. I can't figure it out, and my own script is to long to just compress on the command line.
Shortest characters preferred. Input is not necessarily sorted, but we are only interested in merging consecutive lines with matching first fields. There are unlimited lines with matching first fields. Field 1 could be anything, e.g. names of fruits, proper names, etc.
(I run on MacOS, so I am personally most interested in implementations that run on the mac).

Here is a second example/test. Notice "|" is the delimiter. The space before the "|" is irrelevant, and if resent should be considered part of the key. I am using "%" as a delimited in the output, but again, feel free to change the delimiter (but don't used square brackets).
Input:
why|[may express] surprise, reluctance, impatience, annoyance, indignation
whom|[used in] questions, subordination
whom|[possessive] whose
whom|[subjective] who
whoever|[objective] whomever
whoever|[possessive] whosever
who|[possessive] whose
who|[objective] whom

Desired output:
why|[may express] surprise, reluctance, impatience, annoyance, indignation
whom|[used in] questions, subordination%[possessive] whose%[subjective] who
whoever|[objective] whomever%[possessive] whosever
who|[possessive] whose%[objective] whom

Is a newline at the beginning of the output allowed?

added comments into original question. And, @mIllIbyte, a newline is irrelevant to me. But in my idea, there are no blank lines, and no error checking. I assume all lines have text, and at least the first column and the delimiter.

Judging by the test cases, is it save to assume that all keys are grouped? I.e.: ["A|some text", "B|other text", "A|yet some other text"] isn't a desired input to test, since the keywords for A aren't one after another in the list.

I assumed all keys are grouped. I'm not concerned with the case where they are not, though in theory, it not they would be treated like unique keys.

Retina, 17 bytes

12 bytes saved thanks to @MartinEnder
1 byte saved thanks to @jimmy23013

Scored in ISO 8859-1 encoded bytes.
Uses ; instead of | as the input field separator.
(?<=(.+;).+)¶\1
%

Try it online.

http://retina.tryitonline.net/#code=KD88PSguKzspLispwrZcMQol&input=dHRlc3Q7IHdoeSBkb2Vzbid0IHRoaXMKdGVzdDsgYnJlYWsgeW91ciBjb2RlPw

@LeakyNun Because lookarounds are atomic. The first time the lookaround is used it captures the entire prefix of the line, and afterwards the regex engine won't backtrack into it any more.

V, 16 13 bytes
òí^¨á«©.*úsî±

Try it online!
You said

Feel free to change the delimiter

So I picked | as the delimiter. If this is invalid, let me know and I'll change it.
Explanation:
ò                #Recursively:
 í               #Search for the following on any line:
  ^¨á«©          #1 or more alphabetic characters at the beginning of the line
       .*        #Followed by anything
         ús      #Mark everything after this to be removed:
           î±    #A new line, then the first match again (one or more alphabetic characters)

Let you know???

@ΈρικΚωνσταντόπουλος Yes? Is that a problem?

For this puzzle, feel free to change the delimiter, e.g. use "%" as the delimiter. not i.e.

The "|" delimiter is fine.

@MichaelCodes Could you add some more test cases so we can verify if a solution counts or not?

added another example. thanks.

SQL (PostgreSQL), 43 72 bytes
COPY T FROM'T'(DELIMITER'|');SELECT a,string_agg(b,'%')FROM T GROUP BY A

This takes advantage of the handy string_agg aggregate function in PostgreSQL.  Input is from a table called T with 2 columns A and B.  To comply with the question better I have included to command to load data from a file into the table.  The file is T as well.  I haven't counted the table create statement.
The output will be unordered, but if that is a problem it can be fixed with an ORDER BY A
SQLFiddle didn't want to play for me, but this is what I get in my setup.
CREATE TABLE T (A VARCHAR(9),B VARCHAR(30));

COPY T FROM'T'(DELIMITER'|');SELECT a,string_agg(b,'%')FROM T GROUP BY A
a   string_agg
--- ----------------------------------------
c   rest of fourth line
b   rest of second line%rest of third line
a   rest of first line
d   rest of fifth line%rest of sixth line

To be fair, I'd suggest including a COPY command to read the contents of the file format specified into the table, too, otherwise you're not solving the same problem as everyone else.

@Jules Fair enough, I was thinking of this default i/o concensus when I answered.  Rereading the question though I'll edit the answer.

Perl -0n, 2 + 43 = 45 bytes
s/
.*\|/%/g,print for/(.*\|)((?:
\1|.)*
)/g

Demo:
$ perl -0ne 's/
> .*\|/%/g,print for/(.*\|)((?:
> \1|.)*
> )/g' <<EOF
> why|[may express] surprise, reluctance, impatience, annoyance, indignation
> whom|[used in] questions, subordination
> whom|[possessive] whose
> whom|[subjective] who
> whoever|[objective] whomever
> whoever|[possessive] whosever
> who|[possessive] whose
> who|[objective] whom
> EOF
why|[may express] surprise, reluctance, impatience, annoyance, indignation
whom|[used in] questions, subordination%[possessive] whose%[subjective] who
whoever|[objective] whomever%[possessive] whosever
who|[possessive] whose%[objective] whom

C, 127 bytes
o[99],n[99],p=n;main(i){for(;gets(n);strncmp(o,n,i-p)?printf(*o?"\n%s":"%s",n),strcpy(o,n):printf(" /%s",i))i=1+strchr(n,'|');}

Works with gcc. Changed delimiter to /. Takes input from stdin and writes output to stdout, so call with input redirection ./a.out <filename
Ungolfed:
o[99],n[99] //declare int, to save two bytes for the bounds
,p=n; //p is an int, saves one byte as opposed to applying an (int) cast to n,
//or to declaring o and n as char arrays
main(i){for(;gets(n);strncmp(o,n,i-p //an (int)n cast would be needed;
// -(n-i) does not work either,
//because pointer arithmetics scales to (int*)
)?printf(*o?"\n%s":"%s" //to avoid a newline at the beginning of output
,n),strcpy(o,n):printf(" /%s",i))i=1+strchr(n,'|');}

Pyth - 15 bytes
Making a few assumptions about the problem, will change when OP clarifies.
jm+Khhd-sdK.ghk

Try it online here.

This doesn't work if the "key" is a word, rather than a single letter. (OP clarified in the comments)

Python 3 - 146 Bytes
Input is the filename or file path of the file, output is to stdout. Could be a lot shorter if I could take input as raw text from command line
Takes input from stdin and outputs to stdin. Setup with separator "|". To test the first example input use the separator " | "
from itertools import*
for c,b in groupby([x.split("|")for x in input().split("\n")],key=lambda x:x[0]):print(c,"|"," % ".join((a[1]for a in b)))

The challenge doesn't explicitly require the input to be read from a file, so I guess our Default I/O methods apply here. And since other answers also take the input from STDIN, I suppose the OP is fine with it.

@DenkerAffe Alright i'll edit it, it will just be completely useless because I don't think you can even give actual multiline input from stdin.

But you can do input redirection when you run the script.

Java 7, 167 bytes
It can probably be golfed more by using a different approach..
import java.util.*;Map c(String[]a){Map m=new HashMap();for(String s:a){String[]x=s.split("=");Object l;m.put(x[0],(l=m.get(x[0]))!=null?l+"%"+x[1]:x[1]);}return m;}

NOTE: The method above creates and returns a HashMap with the desired key-value pairs. However, it doesn't print it in the exact output as in OP's question with | as output-delimiter between the keys and new values. Judging by MickeyT's SQL answer where he returned a database table I figured this is allowed; if not more bytes should be added for a print function.
Ungolfed & test code:
import java.util.*;

class Main{

    static Map c(String[] a){
        Map m = new HashMap();
        for(String s : a){
            String[] x = s.split("\\|");
            Object l;
            m.put(x[0], (l = m.get(x[0])) != null
                            ? l + "%" + x[1]
                            : x[1]);
        }
        return m;
    }

    public static void main(String[] a){
        Map m = c(new String[]{
            "why|[may express] surprise, reluctance, impatience, annoyance, indignation",
            "whom|[used in] questions, subordination",
            "whom|[possessive] whose",
            "whom|[subjective] who",
            "whoever|[objective] whomever",
            "whoever|[possessive] whosever",
            "who|[possessive] whose",
            "who|[objective] whom"
        });

        // Object instead of Map.EntrySet because the method returns a generic Map
        for (Object e : m.entrySet()){
            System.out.println(e.toString().replace("=", "|"));
        }
    }
}

Output:
whoever|[objective] whomever%[possessive] whosever
whom|[used in] questions, subordination%[possessive] whose%[subjective] who
why|[may express] surprise, reluctance, impatience, annoyance, indignation
who|[possessive] whose%[objective] whom

PowerShell, 85 bytes
Strings are merged using hashtable:
%{$h=@{}}{$k,$v=$_-split'\|';$h.$k=($h.$k,$v|?{$_})-join'%'}{$h.Keys|%{$_+'|'+$h.$_}}

Example
Since PowerShell doesn't support stdin redirection via <, I'm assuming that Get-Content .\Filename.txt | will be used as default I/O method.
Get-Content .\Filename.txt | %{$h=@{}}{$k,$v=$_-split'\|';$h.$k=($h.$k,$v|?{$_})-join'%'}{$h.Keys|%{$_+'|'+$h.$_}}

Output
whoever|[objective] whomever%[possessive] whosever
why|[may express] surprise, reluctance, impatience, annoyance, indignation
whom|[used in] questions, subordination%[possessive] whose%[subjective] who
who|[possessive] whose%[objective] whom

APL, 42 chars
{⊃{∊⍺,{⍺'%'⍵}/⍵}⌸/↓[1]↑{(1,¯1↓'|'=⍵)⊂⍵}¨⍵}

⌸ isn't one byte in the APL encoding.

Sed, 55 bytes
:a N;:b s/^\([^|]*\)|\([^\n]*\)\n\1|/\1|\2 %/;ta;P;D;tb

Test run :
$ echo """why|[may express] surprise, reluctance, impatience, annoyance, indignation
> whom|[used in] questions, subordination
> whom|[possessive] whose
> whom|[subjective] who
> whoever|[objective] whomever
> whoever|[possessive] whosever
> who|[possessive] whose
> who|[objective] whom""" | sed ':a N;:b s/^\([^|]*\)|\([^\n]*\)\n\1|/\1|\2 %/;ta;P;D;tb'
why|[may express] surprise, reluctance, impatience, annoyance, indignation
whom|[used in] questions, subordination %[possessive] whose %[subjective] who
whoever|[objective] whomever %[possessive] whosever
who|[possessive] whose %[objective] whom

q/kdb+, 46 bytes
Solution:
exec"%"sv v by k from flip`k`v!("s*";"|")0:`:f

Example:
q)exec"%"sv v by k from flip`k`v!("s*";"|")0:`:f
who    | "[possessive] whose%[objective] whom"
whoever| "[objective] whomever%[possessive] whosever"
whom   | "[used in] questions, subordination%[possessive] whose%[subjective] who"
why    | "[may express] surprise, reluctance, impatience, annoyance, indignation"

Explanation:
`:f            // assumes the file is named 'f'
("s*";"|")0:   // read in file, assume it has two columns delimitered by pipe
flip `k`v      // convert into table with columns k (key) and v (value)
exec .. by k   // group on key
"%"sv v        // join values with "%"