Are these dice nontransitive? Nontransitive dice are nice little toys that defy our intuition in probability theory. We'll need a few definitions for this challenge:

Consider two dice A and B which are thrown at the same time. We say that A beats B if the probability of A showing a larger number than B is strictly greater than the probability of B showing a larger number than A.

Now consider a set of three dice, with labels A, B, C. Such a set of dice is called nontransitive if

either A beats B, B beats C and C beats A
or C beats B, B beats A and A beats C.

As one of my favourite examples, consider the Grime dice, which have the following sides:

A: 3 3 3 3 3 6
B: 2 2 2 5 5 5
C: 1 4 4 4 4 4

Interestingly, the mean of each die is 3.5, just like a regular die.

One can show that:

A beats B with a probability of 7/12.
B beats C with a probability of 7/12.
C beats A with a probability of 25/36.

Now these particular dice are even weirder. If we roll each die twice and add up the results, the order of which beats which gets reversed:

B beats A with a probability of 85/144.
C beats B with a probability of 85/144.
A beats C with a probability of 671/1296.

Let's call a set of dice with this property Grime-nontransitive.

On the other hand, if the dice retain their original cycle when using two throws, we call them strongly nontransitive. (If there is no cycle at all for two throws, we simply call them nontransitive.)

The Challenge

Given three six-sided dice, determine which of the above properties this set has, and output one of the following strings: none, nontransitive, Grime-nontransitive, strongly nontransitive.

You may write a program or function, take input via STDIN, command-line argument, prompt or function argument, and write the result to STDOUT or return it as a string.

You may assume that all sides are non-negative integers. You cannot assume that the sides or the dice are in any particular order. You can take input in any convenient list or string format.

This is code golf, so the shortest answer (in bytes) wins.

Test Cases

none
1 2 3 4 5 6, 6 5 4 3 2 1, 1 3 5 2 4 6
1 1 1 6 6 6, 4 4 4 5 5 5, 5 5 5 5 5 5
1 1 2 5 6 6, 2 2 3 4 4 6, 2 3 3 4 4 5
0 1 2 3 4 5, 1 1 2 3 3 5, 1 2 2 2 3 5
3 13 5 7 13 7, 5 7 11 5 7 13, 5 9 13 5 7 9

nontransitive
1 2 2 4 6 6, 1 2 3 5 5 5, 2 3 4 4 4 4
1 4 4 4 4 4, 2 2 2 4 5 6, 2 3 3 3 5 5
1 2 1 6 5 6, 3 1 3 6 2 6, 2 4 2 4 4 5
3 4 6 6 7 7, 4 4 4 7 7 7, 5 5 5 5 6 7
2 5 11 11 14 14, 5 5 5 14 14 14, 8 8 8 8 8 17

Grime-nontransitive
3 3 3 3 3 6, 2 2 2 5 5 5, 1 4 4 4 4 4
1 1 4 5 5 5, 2 2 2 3 6 6, 3 3 3 4 4 4
2 1 4 6 4 4, 2 4 5 2 3 5, 3 3 6 3 3 3
11 11 13 15 15 16, 12 12 12 13 16 16, 13 13 13 14 14 14
4 4 7 16 19 19, 4 7 13 13 13 19, 4 10 10 10 16 19

strongly nontransitive
2 2 2 5 5 5, 2 3 3 3 5 5, 1 1 4 5 5 5
2 2 2 3 6 6, 2 2 2 5 5 5, 2 2 4 4 4 5
1 5 1 3 6 5, 6 6 4 2 2 1, 5 3 4 3 4 2
0 0 2 4 4 5, 0 1 1 3 5 5, 1 1 2 3 4 4
1 1 9 17 17 21, 1 5 5 13 21 21, 5 5 13 13 13 17

If you want to test your code even more thoroughly, Peter Taylor was kind enough to write a reference implementation, which classified all ~5000 sets of dice with sides 1 to 6 and a mean of 3.5. Pastebin link

Python 2, 269

Here's a nice little expression that evaluates to a function. It accepts three lists of integers. Passes all test cases.

lambda A,B,C,w=lambda A,B:cmp(sum(cmp(a,b)for a in A for b in B),0),x=lambda A,B:cmp(sum(cmp(a+c,b+d)for a in A for b in B for c in A for d in B),0): (w(A,B)==w(B,C)==w(C,A)!=0)*((x(A,B)==x(B,C)==x(C,A))*["","strongly ","Grime-"][x(A,B)*w(A,B)]+"nontransitive")or"none"


Find the overall period from a list of frequencies Inspired by http://xkcd.com/1331/

In this xkcd comic, there are several gifs that all blink with different frequency. I want to know what the period would be if was all a single GIF. Given a list of numbers representing the individual frequencies, output the period of the overall GIF.

Formal Definition

Input:

N
f1
f2
.
.
.
fN

Output:

P

Where N is the number of frequencies, fi is the ith frequency, and P is the resulting period of the total GIF.

You may choose to use any delimiting character you want(instead of \n), and you may exclude the N if you wish, and it will be inferred by the number of delimeters.

Some specifics

Frequencies are the closest double-precision floating point representation of the numbers provided as input.

The outputted period is a 64-bit unsigned integer, rounded(up on 0.5) to the nearest whole. Any input that would produce a period bigger than 2^64-1 is considered undefined behaviour.

Likewise any input <= 0 is considered undefined behaviour.

Win Condition

Code golf so shortest code wins!

APL, 4

∧/∘÷

∧ is both logical AND and numerical LCM (with domain over integers, floats, complex, rationals, whatever number stack is supported by the APL implementation) so ∧/ is reduction by LCM, or computing the LCM of an array.

Monadic ÷ is numeric inverse. So the composition ∧/∘÷ is the LCM of the inverses of the numbers supplied.

The other formula, inverse of the GCD, would be ÷∘(∨/), where the parentheses are needed to fix the precedence between ∘ and /.

You can try it online on http://tryapl.com/

Examples

      ∧/∘÷ .12 .02 3.9 .15 .99
100
      ∧/∘÷ (16÷5)(2÷3)(2.35)(1÷7)
420


Is this a valid Tichu play? Tichu is a card game in which players take turn playing sets of cards from a deck consisting of a standard 52-card deck, plus 4 additional cards:

the dragon, which has a greater value than any other card
the phoenix, which can act as a wildcard
the dog, which passes the turn to your partner
the Mah Jong, which has value 1 (and the person holding it plays first)

The first player (who is said to have "lead") can choose to play one of the following types of card combinations:

a single (e.g. 6)
a pair (JJ)
a triple (555)
a full house (QQQ33) - a triple and a pair
a straight (56789) - 5 or more consecutive cards
a tractor (223344) - any consecutive sequence of pairs

Subsequent players are then only allowed to play a set of cards of the same type, but strictly higher. For example, QQ can be played on top of JJ, but QQKK cannot (it is a tractor, not a pair). Full houses are ordered by the triple (e.g. 77722 > 44499), and straights and tractors must be the same length (456789 cannot be played on top of 23456). Aces are high.

There is one exception: any 4 of the same card is a bomb, and can be played on top of anything except a higher bomb.1

The dragon can be played by itself on top of any single or with lead (but nowhere else). The phoenix, aside from being a wildcard, can also be played on top of any single except the dragon.2 The dog can only be played by itself with lead and immediately ends the turn.3

Your challenge is to determine whether a given Tichu play is valid, given the previous play.

You may accept both plays in any order as either lists of integers or strings -- in either case, you may choose any mapping of cards to integers/characters.
If there was a previous play, it will always be valid, and if not (i.e. the player has lead), the first input will be the empty array/string (matching the type of the other input). The cards are not guaranteed to be given in any particular order.

Your output must be selected from a set of exactly two distinct values, one of which indicates the play is legal and one that indicates it is not.

There is no need to test for whether the set of cards actually exists in the deck (e.g. 77766 followed by 88877 is impossible because there are only four 7's) -- such cases will never be given.

In the following test cases, 234567890JQKA represent 2 through ace, and RPD1 represent the dragon, phoenix, dog, and Mah Jong respectively. The empty string is shown here as -. These plays are legal:

6 J
JJ QQ
555 KKK
44499 77722
23456 56789
223344 QQKKAA
49494 72727
A R
A P
P R
66 7P
P6 77
58304967 6P0594J7
5P304967 680594J7
57446765 788657P5
- D
- 1
- 12345
3344556677889900 JJJJ
5555 7777

And these are not:

9 3
66 55
888 444
44 888
77722 44499
44499 777
44499 777JJJ
45678 34567
34567 456789
556677 334455
5566 778899
72727 49494
A A
R A
R P
77 RP
77 6P
P7 66
680594J7 5P304967
6P0594J7 58304967
57446765 3645P536
1 D
2 D
2 1
- 1234
7777 5555
- 223355

1: actually, a straight flush is also a bomb, but since this is the only place in the game that the suit of the cards matter, I have chosen to leave it out for simplicity's sake

2: the value of the phoenix played on top of a card with value n is actually n+0.5 (a phoenix on a 9 is a 9 and a half); since this requires knowledge of additional history to adjudicate, no test cases involve a single played on top of a single phoenix

3: so the first input will never be dog

JavaScript (ES6),  274  273 bytes
Takes input as (a)(b), where \$a\$ and \$b\$ are arrays of integers with:

\$1\$ = dog
\$3\$ = Mah Jong
\$4..16\$ = 2 ... Ace
\$18\$ = dragon
\$19\$ = phoenix

Returns false for valid or true for invalid.
a=>b=>!(L='length',[A,B]=(g=a=>(h=n=>--n?[i=1,2,3,'(20*)3|30*2','1{5,}','22+',4].some(p=>m=o.join``.match(`9(0*)(${p})0*$`,i++),a.map(x=>o[x-19?x:x=n]=-~o[x],o=[...9e16+'']))?[i,m[1][L]+(m[3]||[])[L]]:h(n):[])(18))(a),[C,D]=g(b),a+a?A-C?C>7|+b>a:a[L]==b[L]&D>B|A<3&b==18:C)

Try it online!
How?
To evaluate a hand, we build an array o[] made of a leading \$9\$, initially followed by 16 zeros:
//       D  -  1  2  3  4  5  6  7  8  9  T  J  Q  K  A
o = [ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];

For each card rank in the hand, the corresponding slot in o[] is incremented. Once joined back to a string, we can apply the following regular expressions to detect each type of hand:
 hand        | pattern     | full regex              | example
-------------+-------------+-------------------------+-------------------
 single      | 1           | /9(0*)(1)0*$/           | 90000100000000000
 pair        | 2           | /9(0*)(2)0*$/           | 90000002000000000
 3-of-a-kind | 3           | /9(0*)(3)0*$/           | 90003000000000000
 full house  | (20*)3|30*2 | /9(0*)((20*)3|30*2)0*$/ | 90020000030000000
 straight 5+ | 1{5,}       | /9(0*)(1{5,})0*$/       | 90000111110000000
 tractor     | 22+         | /9(0*)(22+)0*$/         | 90000000000022200
 bomb        | 4           | /9(0*)(4)0*$/           | 90000000000000004

If the hand does not trigger any of these regular expressions, it's invalid.
The value of the hand is given by the number of zeros just after the leading \$9\$ (the higher, the better). A special case is a full house where the rank of the triple is higher than that of the pair, in which case we need to add the length of the (20*) pattern.
The phoenix (i.e. the wildcard) is simply replaced with each possible card rank, starting with the highest one, until a match is detected.


Area of a 2D convex hull You are given an array/list/vector of pairs of integers representing cartesian coordinates \$(x, y)\$ of points on a 2D Euclidean plane; all coordinates are between \$−10^4\$ and \$10^4\$, duplicates are allowed. Find the area of the convex hull of those points, rounded to the nearest integer; an exact midpoint should be rounded to the closest even integer. You may use floating-point numbers in intermediate computations, but only if you can guarantee that the final result will be always correct. This is code-golf, so the shortest correct program wins.

The convex hull of a set of points \$P\$ is the smallest convex set that contains \$P\$. On the Euclidean plane, for any single point \$(x,y)\$, it is the point itself; for two distinct points, it is the line containing them, for three non-collinear points, it is the triangle that they form, and so forth.

A good visual explanation of what a convex hulls, is best described as imagining all points as nails in a wooden board, and then stretching a rubber band around them to enclose all the points:

Some test cases:

Input: [[50, -13]]
Result: 0

Input: [[-25, -26], [34, -27]]
Result: 0

Input: [[-6, -14], [-48, -45], [21, 25]]
Result: 400

Input: [[4, 30], [5, 37], [-18, 49], [-9, -2]]
Result: 562

Input: [[0, 16], [24, 18], [-43, 36], [39, -29], [3, -38]]
Result: 2978

Input: [[19, -19], [15, 5], [-16, -41], [6, -25], [-42, 1], [12, 19]]
Result: 2118

Input: [[-23, 13], [-13, 13], [-6, -7], [22, 41], [-26, 50], [12, -12], [-23, -7]]
Result: 2307

Input: [[31, -19], [-41, -41], [25, 34], [29, -1], [42, -42], [-34, 32], [19, 33], [40, 39]]
Result: 6037

Input: [[47, 1], [-22, 24], [36, 38], [-17, 4], [41, -3], [-13, 15], [-36, -40], [-13, 35], [-25, 22]]
Result: 3908

Input: [[29, -19], [18, 9], [30, -46], [15, 20], [24, -4], [5, 19], [-44, 4], [-20, -8], [-16, 34], [17, -36]]
Result: 2905

SQL Server 2012+, 84 bytes
SELECT Round(Geometry::ConvexHullAggregate(Geometry::Point(x,y,0)).STArea(),0)FROM A

Makes use of the geometry functions and aggregates in SQL Server.
Coordindates are from table A with columns x and y.


Shortest code for longest output This one is pretty simple.

Write the shortest program you can, while generating the most output.

To make it fun, programs that produce infinite output will be disqualified.

The winner is the program with the largest output size/code size ratio.

The results are based on what works on my computer, which is a Mac running Mac OS X 10.7.5 with an Intel Core i5 and 8GB of memory.

Python: 8 chars code, 387420489 chars output -- Ratio: 48427561.125 : 1

'a'*9**9

We can have the ratio tend to infinity by adding more **9s:

'a'*9**9**9
'a'*9**9**9**9
etc.

For example:

'a'*9**9**9**9**9**9

which has a ratio of ~10101010108.568 (unimaginably large number).


Find the powertrain! The winner (pretty obviously) is Dennis ♦, who used Jelly with 10 bytes!

This challenge will still be up here, however results won't be taken anymore.

The powertrain of a number is a concept by John Conway (who is also notable for making Conway's Game of Life, but that's not the point). It is defined as so:

For any number ..., the powertrain of the number is ... (i.e. every 2nd digit, from left to right, is a power of the digit before that). This process is repeated until the result is a single digit.

EXAMPLES:

2592 => (2^5)(9^2) = 2592 <= Cannot be further decomposed
 135 => (1^3)5 = 5
 1234 => (1^2)(3^4) = 81 => (8^1) = 8
 1100 => (1^1)(0^0) = 1 # (0^0) = 1
 -42 => -42 # Negative numbers output the input

Your challenge is, for any number n in the input, return powertrain(n) (i.e. n after the powertrain decomposition is finished) as output.

This is code golf, so shortest amount of bytes wins.

DISCLAIMER-THINGS:

You can have an odd number of digits in the input, the last digit just won't have a power.
0^0 is 1, because if it was 0, then a lot of numbers would instantly collapse to 0 or 1.
If the number is indestructible in any part of the computation process (e.g. if it ends up with 2592), then you can just output the number.
If the input is < 10 (i.e. all single digit numbers and negatives), output the input.

I'll probably announce a winner after a few hours days.

Current leaderboard:

  Jelly (Dennis ♦): 10
  Pyth (DenkerAffe): 16
  MATL (Don Muesli): 21
  Perl (Ton Hospel): 42
  Haskell (Damien): 64
  Javascript ES6 (edc65): 71
  Mathematica (murphy): 74
  Mathematica (LegionMammal978) and Haskell (Renzeee): 77
  Python 2 (mathmandan): 111
  Python 3 (Erwan): 161
  Java 8 (Blue): 229
  Oracle SQL 11.2 (Jeto): 456
  Befunge '93 (Lex): 490

Haskell, 67 64 bytes

(>>=(==))>>=until$p.show is an unnamed function taking an integer as input and returning its powertrain.

Saved 3 bytes thanks to Zgarb

p(x:y:r)=p[x]^p[y]*p r;p[]=1;p x=read x
(>>=(==))>>=until$p.show


Is this board Latin-style? Inspired by Flow Fit: Sudoku, a brand-new mobile puzzle game (as of Nov 2019).

Background

A Latin square is a square grid of side length \$ n \$ filled with \$ n \$ different symbols, where each row and column contains each symbol exactly once.

Let's define a row (resp. a column) as a maximally consecutive group of cells in horizontal (resp. vertical) direction. For example, the following board (O is a cell, - is a hole) has 8 rows and 8 columns in total:

The board    |  Rows         |  Columns
O O O O O O  |  A A A A A A  |  A B C E G H
O O O O O O  |  B B B B B B  |  A B C E G H
O O - O O O  |  C C - D D D  |  A B - E G H
O O O - O O  |  E E E - F F  |  A B D - G H
O O O O O O  |  G G G G G G  |  A B D F G H
O O O O O O  |  H H H H H H  |  A B D F G H

Then, place the numbers \$ 1, \cdots, k \$ exactly once on each row and column, where \$ k \$ is the length of that row or column. For the board above, here is one solution:

3 4 1 2 5 6
4 3 2 1 6 5
1 2 - 3 1 2
2 1 3 - 2 1
5 6 1 2 3 4
6 5 2 1 4 3

A board is Latin-style if such a placement is possible.

Note that a row/column of size 1 is still a row/column, and therefore it can only have a single 1.

Challenge

Given a grid, determine if it is Latin-style, i.e. it is possible to place numbers on the grid so that each row/column of length \$ k \$ contains each of the numbers \$ 1, \cdots, k \$ exactly once.

Example Latin-style boards

O O O O O
- O O O O
- - O O O
- - - O O
- - - - O

- O O O -
O O O O O
O O O O O
O O O O O
- O O O -

- - O O O
- O O O O
O O O O O
O O O O -
O O O - -

O O - - O O
O O O O O O
- O O O O -
- O O O O -
O O O O O O
O O - - O O

O O O - O O O O
O O O O O O O O
O O O O O O O O
O O O O O O O -
- O O O O O O O
O O O O O O O O
O O O O O O O O
O O O O - O O O

O O O - O
O O - O O
O - O O O

- - O - -
- O O O -
O O - O O
- O O O O
O O O - O

Example non-Latin-style boards

- O -
O O O
- O -

O O O

O O - - -
O O - - -
O O - - -
O O O O O
O O O O O

O O O - -
O O O - -
O O O O O
- - O O O
- - O O O

- - - O O - -
- - O O O - -
O O O O O O -
O O O O O O O
- O O O O O O
- - O O O - -
- - O O - - -

O O - - - -
O O - O O O
O O - O O O

O O - - -
O O - - -
O O O - -
- - O O O
- - O O O

Input and output

You can take the grid input in any reasonable way. The grid's bounding box can be non-square, and the grid may contain multiple connected components.

You can give the output in one of two ways:

Truthy/falsy values following the language's convention

Swapping truthy/falsy is not allowed also allowed.

One consistent value for true, another consistent value for false

Scoring and winning criterion

The standard code-golf rules apply. The shortest code in bytes wins.

Jelly, 24 bytes

,ZµŒgaS$€F)Zṣ€0Ṣ<JƊ€€)FẸ

Try it online!

A monadic link taking as its argument the grid as a matrix with 1 representing squares needing a number and 0 representing the spacers. Returns 0 if the grid is Latin and 1 if not.

Explanation

Main link, takes a matrix of 1s and 0s as its argument, z

,                         | Pair with:
 Z                        | - z transposed
  µ                       | Start a new monadic chain
                     )    | For each matrix (z and transpose(z)):
          )               | - For each row:
   Œg                     |   - Group runs of equal elements
       $€                 |   - For each group:
     a                    |     - And with:
      S                   |       - Sum of group
         F                |   - Flatten
           Z              | - Transpose
            ṣ€0           | - Split each at zeros
                  Ɗ€€     | - For each group:
               Ṣ<         |   - Check whether sorted group is less than:
                 J        |     - Sequence along group
                      F   | Finally, flatten
                       Ẹ  | And check if any group returned true

Alternative in case true=true/false=false required:

Jelly, 24 bytes

,ZµŒgaS$€F)Zṣ€0Ṣ_JƊ€€)AƑ

Try it online!


Form tiles in a rectangular ring Given the input tilesX and tilesY create a method that would make a rectangular ring from the tiles.

The function must order the tiles in a ring like this:

tilesX and tilesY are always positive integer values, cannot be 0
tilesX and tilesY are not always equal, expect values like: 2x5, 6x3 etc.
Checking for invalid input is not necessary
You can use any way to display the tiles, including 2d arrays, ASCII art or printed text.
There's no strict way how the input is passed as long as it's two integers.
Cannot be a line, drawing a rectangle size of tilesX and tilesY pixels is not valid
The shortest code wins

Dyalog APL, 8 bytes

×/¨1<⊂|⍳

This monadic function train takes height and width as right arguments and returns a 2D array of 0's (border) and 1's (interior). Test it on TryAPL.

How it works

×/¨1<⊂|⍳  Right argument: h w

       ⍳  Generate all index pairs (1-based) of a h×w array.
     ⊂    Enclose (h w), so it depth matches the one of the index array.
      |   For each pair (i j) compute the remainders of the division by (h w).
   1<     Compare all remainders with 1.
×/¨       Reduce each pair of Booleans by multiplication.


Help me pair my socks Disclaimer: This challenge inspired by me trying to find pairs in a large pile of socks.

Disclaimer: This is looking for a very different process and output to Help me sort my socks!. Please don't claim it as a duplicate until you've read both ;)

So, I have a huge pile of socks. Of course I keep them categorized by compatibility number. Compatible socks, which I can wear together, have the same number. (Of course, every programmer does this).

My super-convenient plot device quickly scans the pile and outputs an array of compatibility numbers for the pile. It looks a bit like this:

[2, 3, 3, 6, 0, 4, 9, 1, 6, 7, 11, 3, 13, 3,
5, 12, 2, 1, 10, 2, 1, 11, 2, 13, 12, 10, 1,
7, 0, 0, 12, 12, 6, 2, 13, 6, 10, 0, 0, 12,
5, 0, 2, 3, 4, 0, 5, 8, 1, 6, 9, 7, 10, 14,
10, 8, 3, 8, 9, 8, 5, 11, 7, 9, 9, 9, 7, 14,
4, 2, 8, 14, 3, 11, 12, 14, 7, 13, 11, 13, 4,
7, 5, 12, 3, 1, 12, 4, 5, 13, 2, 13, 2, 14, 1,
13, 11, 1, 4, 8]

That's good data, but it's about as much use to me as scanning the pile myself by eye. What I want to know is how many compatible pairs I need to look for, and which are going to be 'odds', which I can discard for now.

In the above example, I am looking for these pairs of socks:

{3=>4, 6=>2, 2=>4, 1=>4, 11=>3, 13=>4, 12=>4, 10=>2, 7=>3, 0=>3, 5=>3, 4=>3, 9=>3, 8=>3, 14=>2}

(4 pairs of number 3, 2 pairs of number 6 etc.)

And these numbers will have 'odd ones out'. When I've found all the pairs for these, I can discard the last one.

[0, 6, 10, 7, 2, 14]

The challenge

Convert a list of compatible numbers to a count of pairs for each number and an array of 'odds'.

The pairs will be composed of a data structure (hash, or other) showing how many pairs can be made of each compatibility number (can be skipped if no pairs can be made).
The odds will be composed of a list of numbers which occur and odd number of times in the array.

The order of the outputs is not significant.
The size of my sock pile can, of course, be arbitrarily large.

The Rules

It's golf, make it short.
No standard loopholes.
Use any language you like.
Please include a link to an online interpreter.

Test Cases

Input: [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]

Output:

Pairs: {2=>1, 3=>1, 4=>2, 5=>2}

Odds: [1, 3, 5]

Input: [2, 3, 3, 6, 0, 4, 9, 1, 6, 7, 11, 3, 13, 3, 5, 12, 2, 1, 10, 2, 1, 11, 2, 13, 12, 10, 1, 7, 0, 0, 12, 12, 6, 2, 13, 6, 10, 0, 0, 12, 5, 0, 2, 3, 4, 0, 5, 8, 1, 6, 9, 7, 10, 14, 10, 8, 3, 8, 9, 8, 5, 11, 7, 9, 9, 9, 7, 14, 4, 2, 8, 14, 3, 11, 12, 14, 7, 13, 11, 13, 4, 7, 5, 12, 3, 1, 12, 4, 5, 13, 2, 13, 2, 14, 1, 13, 11, 1, 4, 8]

Output:

Pairs: {3=>4, 6=>2, 2=>4, 1=>4, 11=>3, 13=>4, 12=>4, 10=>2, 7=>3, 0=>3, 5=>3, 4=>3, 9=>3, 8=>3, 14=>2}

Odds: [0, 6, 10, 7, 2, 14]

Input: [1, 2, 1, 2]

Output:

Pairs: {1=>1, 2=>1}

Odds: []

Input: [1,2,3]

Output:

Pairs {}

Odds: [1,2,3]

Input: []

Output:

Pairs: {}

Odds: []

Perl 6, 46 bytes

{.kv.map(*=>*+>1),.keys.grep:{.{$^k}%2}}o*.Bag

Try it online!

Explanation

{                                      }o*.Bag  # Convert to Bag and feed into block
                 ,  # 2-element list
 .kv  # Key-value list (key is sock type, value is count)
    .map(       )  # Map to
         *=>*+>1   # Pair of sock type and count right-shifted by 1
                  .keys  # Keys (sock types)
                       .grep:  # Filter
                             {.{$^k}%2}  # Count is odd


How to Draw Melting Icicles A sculptor is tasked to creating icicle sculptures for the new museum in Greenland. He has been given specifications by his boss, which consists of two numbers: [s, m] or size and melt. Size must be an odd number. He was given some photos of real icicles:

vvvvv [5, 0]
 vvv
  v

vvvvvvv [7, 0]
 vvvvv
  vvv
   v

vvvvvvv [7, 2]
 vvvvv

vvvvvvv [7, 3]

vvv [3, 1]

He needs a program to help draw. Any language allowed. The program needs to take in S and M, any method of input acceptable. You must then print out an ascii art representation of it.

S is how many vs are on the first layer. M is how many layers are cut out from the bottom.

This is code-golf, so as usual this competition is byte based. White space does count for byte counting. Least bytes wins.

Edit:
You will never get a set of numbers that draws nothing, for example [5, 3]. Checking code is not required however.

V, 15 bytes

Àévò^lYp2x>òÀñd

Try it online!

Fairly straightforward.

À               " Arg1 times:
 év             "   Insert a 'v'
   ò       ò    " Recursively:
    ^l          "   Break if there is only one character on this line
      Y         "   Yank this line
       p        "   Paste it below us
        2x      "   Delete two characters
          >     "   Indent this line
            À   " Arg2 times:
             ñd "   Delete a line


Reversed Engineered from Uniqueness (Cop's Thread) Given the output of the cop's program (o), the byte-count (n) and the number of unique bytes (c) used, come up with a corresponding piece of code that is n bytes long with c unique bytes which matches the cop's output o.

This is the cops thread. Post solutions that are to-be-cracked here.
The robbers thread is located here.

Cops should post solutions like this:
#[Language], `n` Bytes, `c` Unique Bytes (c*n points) [Cracked](Link-To-Crack)

    [Output]

---

(Optional spoiler)

Rules

You may not take any input for your program.
The program must use at least 1 byte, but cannot exceed 255 bytes.
The output itself is also limited to 255 bytes.
The program must have consistent output results when executed multiple times.
If your submission is not cracked within 7 days, you may mark it as "safe".

When marking it safe, post the intended solution and score it as c*n.
Only mark an answer as "safe" if you really want the +15 for an accepted answer; it's more fun to see how long you can go.

Winning

The uncracked post with the lowest c*n score, wins the cop's thread.
This will be decided after 10 safe answers, or a few weeks.

Caveats

If you feel cocky, you may tell the user the algorithm using a spoiler tag.

Uncracked Submissions:

fetch("https://api.stackexchange.com/2.2/questions/147635/answers?order=desc&sort=activity&site=codegolf&filter=!.Fjs-H6J36vlFcdkRGfButLhYEngU&key=kAc8QIHB*IqJDUFcjEF1KA((&pagesize=100").then(x=>x.json()).then(data=>{var res = data.items.filter(i=>!/^#.*cracked/im.test(i.body_markdown)).map(x=>{const matched = /^ ?#{1,3} ?(?:(?:(?:\[|)([^\]]+)(?:\]|<\/a>)(?:[\(\[][a-z0-9/:\.]+[\]\)])?)|([^, ]+)).*[^\d](\d+) ?\[?(?:.*(?:byte|block|codel)s?)(?:\](?:\(.+\))?)? ?(?:\(?(?!no[nt][ -]competing)\)?)?/gim.exec(x.body_markdown);if(!matched){return;}return {link: x.link, lang: matched[1] || matched[2], owner: x.owner}}).filter(Boolean).reverse().forEach(ans=>{var tr = document.createElement("tr");var add = (lang, link)=>{var td = document.createElement("td");var a = document.createElement("a");a.innerHTML = lang;a.href = link;td.appendChild(a);tr.appendChild(td);};add(ans.lang, ans.link);add(ans.owner.display_name, ans.owner.link);document.querySelector("tbody").appendChild(tr);});});

Uncracked Submissions

Language	Author

Haskell, 173 bytes, 8 unique, 1384 points, safe

"[tag:reverse_engineering]"

It looks like this answer wants to provide a relevant tag to the question, while using only 8 different bytes.
As usual, your solution should work by being pasted in the code block on TIO: Try it online!

Solution
'[':___':_'':_':':':__':__:__'':__:__':____:__:'_':__:___:_':_'_:___:__:__:__':_'_:___:_':']':[]
_:_:_'':_:_:_:__:_:_':_:_'_:_:_:_:_:___:_:_:_:__':____:___':_:__'':_=['_'..]

Yes, this is valid Haskell code: Try it online!
How it works
The underscore _ is used as a wild card in Haskell's pattern matching. ' is used for characters, e.g. 'a'. However, both _ and ' are also part of the allowed characters for identifier names (Within some restrictions, e.g. ' cannot occur at the beginning of the name.). Therefore __, _', _'_, _'' and so on are all valid identifier names. Using some more descriptive names, the above code becomes
'[':t:a:g:':':r:e:v:e:r:s:e:'_':e:n:g:i:n:e:e:r:i:n:g:']':[]
_:_:a:_:_:_:e:_:g:_:i:_:_:_:_:n:_:_:_:r:s:t:_:v:_=['_'..]

The first line yields the string "[tag:reverse_engineering]" if each variable is assigned to the correct character. This assignment is achieved in the second line: ['_'..] yields the string "_`abcdefghijklmnopqrstuvwxyz{|}~ ... ", witch is matched on the pattern _:_:a:_:_:_:e:_:g:_:i:_:_:_:_:n:_:_:_:r:s:t:_:v:_ to get the desired assignment a='a', e='e' and so on.


Mathics, 24 bytes

#^#2&@@@FactorInteger@#&

Try it online!


Recover the prime from the prime power Definition: a prime power is a natural number that can be expressed in the form pn where p is a prime and n is a natural number.

Task: Given a prime power pn > 1, return the prime p.

Testcases:

input output
9     3
16    2
343   7
2687  2687
59049 3

Scoring: This is code-golf. Shortest answer in bytes wins.


Output the full name of titin Titin is a protein found in muscle tissue. It is a pretty big protein, and its full chemical name is giant as well. Comprising 189819 characters, the full name of titin would take about 3.5 hours to pronounce. Your task is to output this entire name!
Details
The full name can be found here: Gist (this file does not include the trailing newline)
The MD5 hash of the output is ec73f8229f7f8f2e542c316a41cbfff4 (without a trailing newline) or 628c6eb157eb1de675cfc5b91a8149ce (with a trailing newline).

You may not access an external resource, be it a file or an internet location.
You must output only the exact text from the pastebin to STDOUT or STDERR. Nothing else should be output to your chosen output stream; leading and trailing whitespace are acceptable.
You may not assume there will be any input, but you may assume that there will be no input if needed.
You may output anything to the other output stream (STDOUT if you chose to output to STDERR and vice versa)
Standard loopholes apply

This is a code-golf challenge, so the shortest program in bytes wins!
EDIT
This is NOT a duplicate of the Rick Astley "Never Gonna Give You Up" challenge. Besides the tags, they're not even similar. In that one, output is a multi-line song with a few sections that repeats the first two words of every line. In this one, output is a fairly compressible string with 189819 letters. Please don't close-vote this as a dupe of that.

JavaScript (ES6), 16840 16825 16814 bytes

Saved a couple of bytes by:

inserting the last acid prefix in the packed string as suggested by ETHproductions
choosing the next character group in a slightly more efficient way when there's a tie

Assumes Windows-1252 character encoding. Outputs without a trailing newline.

Below is a simplified version without any actual data.

[...Array(256)].map((_,i)=>i<52|i>126&i<161|i==92|i==96?0:s=s.split(String.fromCharCode(i)).join(`...dictionary...`.slice(j,j+=2)),j=0,s=`...packed_data...`)&&[...s].map(c=>'methion|threon|glutamin|alan|prol|phen|leuc|ser|val|glutam|glyc|histid|isoleuc|tryptoph|argin|aspart|lys|asparagin|tyros|cystein'.split`|`[c.charCodeAt()-32]).join`yl`+'ine'

And here is the full version:

Try it online!

The TIO link includes some additional code to print the MD5 of the output rather than printing the output itself:

ec73f8229f7f8f2e542c316a41cbfff4

How?

This was compressed by:

Mapping the 20 distinct amino acids to ASCII characters 32 to 51.
Repeatedly replacing the most frequent 2-character group by a new ASCII character in the following ranges:

52-91
93-95
97-126
161-255

Which leaves us with a dictionary of 336 bytes (168 entries of 2 characters) and a final compressed string of 16161 bytes.

The above code is doing the exact opposite.


How long till Halley's Comet returns? Halley's Comet is the only comet that may appear (i.e. become visible to the naked eye on Earth) twice in a human lifetime. The orbital period of Halley's Comet is not constant: it has varied between 75 to 79 Earth years since the first definite apparition was recorded in 240 BCE. This variability is mainly driven by gravitational interactions between the comet and the planets of the Solar System. For the three millennia up to the year 3000, Halley's Comet appeared, or is projected to appear, in the following years:
66, 141, 218, 295, 374, 451, 530, 607, 684, 760, 837, 912, 989, 1066, 1145, 1222, 1301, 1378, 1456, 1531, 1607, 1682, 1758, 1835, 1910, 1986, 2061, 2134, 2209, 2284, 2358, 2430, 2504, 2579, 2653, 2726, 2795, 2863, 2931, 3000
Apparitions beyond 2134 predicted using this orbit simulator. The simulations account for gravitational perturbations due to the planets but not for other effects, such as changes in the comet's outgassing rate, that also affect its orbit. See here for further discussion.
Task
Write a program or function that takes as input a positive integer up to 3000 (inclusive), representing a year, and outputs/returns the number of years until the next apparition of Halley's Comet. In other words, if the input year is \$y\$ and Halley's Comet next appears in year \$y_\text{H}\ge y\$, find \$y_\text{H}-y\$. The shortest code (in bytes) in each language wins.
Test cases
   1 -> 65
1066 ->  0
1067 -> 78
1986 ->  0
1987 -> 74
2021 -> 40

JavaScript (Node.js), 74 bytes

n=>Buffer("BKMMOMOMMLMKMMOMOMNKLKLMKLKIKKJHJKJIEDDE").every(c=>(n-=c)>0)-n

Try it online!
Commented
n =>              // n = input year
  Buffer(         // build a buffer consisting of
    "BKMM...EDDE" // the year deltas encoded as ASCII codes
  )               // 'B' -> 66, + 'K' (75) -> 141, etc.
  .every(c =>     // for each value c in there:
    (n -= c)      //   subtract c from n
    > 0           //   and go on while the result is positive
  )               // end of every(), which yields false
  - n             // return -n


Find the temperature closest to 0 In this exercise, you have to analyze records of temperature to find the closest to zero.

Write a program that prints the temperature closest to 0 among input data.

Input

N, the number of temperatures to analyse (optional). This will be nonzero.
The N temperatures expressed as integers ranging from -273 to 5526.

Output

Output the temperature closest to 0. If two temperatures are equally close, take the positive one. For instance, if the temperatures are -5 and 5, output 5.

Example

Input

    5
    1 -2 -8 4 5

Output

    1

This challenge is similar to this one on CodinGame, you can view the problem statement source here.
Some modifications have been made to the text.

JavaScript (ES6), 33 bytes

a=>a.reduce((m,n)=>n*n-n<m*m?n:m)

Demo

let f =

a=>a.reduce((m,n)=>n*n-n<m*m?n:m)

console.log(f([1, -2, -8, 4, 5]))


Tips for golfing in AWK What general tips do you have for golfing in AWK? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to AWK. Please post one tip per answer.

These are not in any particular order, and some of them might even apply to other languages too, but not to a lot of them I think.

You can sometimes use awk's simple string concatenation to assemble numbers

z=x*10+y and a=b*10

become

z=x y and a=b 0
You can use the ~ operator (match pattern on the right side) to compare numbers or strings if you know that the two parts meet certain conditions

for instance if you know that a will always be smaller than or equal to b, you can replace

a==b

with

a~b

or if you want to check for an empty string s (which means that s isn't allowed to be "0" either), and you haven's changed the variable X before, so that it is still undefined, you could use

X~s

instead of

s==""

if you want to check if i is an integer you can use

i!~/\./ (i doesn't contain a dot)

instead of

i==int(i)
You can swap two numbers in a single command

t=a;a=b;b=t

becomes

a+=b-(b=a)

saving one character
If you don't need them as input anymore, you can use the input variables $1, $2, $3, ... as an array. So instead of writing a[n] you can just write $n. Sometimes even while reading the input from these you can use the already handled ones as a stack for something.
You can make good use of the built-in separators FS (space, if not changed by you) and RS (newline) when concatenating strings

a=$1" "$2

becomes

a=$1FS$2

or even better

a=$1"\n"$2

becomes

a=$1RS$2
If there is no input and you use the BEGIN block, you can try to use the END block instead. Depending on the judge it works. If you test it, you have to press Ctrl-D (end of input) to access the END block.
If you want to skip the first line, you can use

C++

instead of

NR>1

if you won't be using C anywhere in your program.


Output the Source, One Bit at a Time Write a non-empty program or function that when called outputs a single value, 1 or 0, and when called
multiple times, the output numbers produce the binary representation of your program's source code
(in the same code page from which your code is compiled/interpreted).

For instance, if your source code was abc (in ASCII), the outputs would be:

1st call:  0           // ASCII letter 'a'
2nd call:  1
3rd call:  1
4th call:  0
5th call:  0
6th call:  0
7th call:  0
8th call:  1

9th call:  0           // ASCII letter 'b'
10th call: 1
11th call: 1
12th call: 0
13th call: 0
14th call: 0
15th call: 1
16th call: 0

17th call: 0           // ASCII letter 'c'
18th call: 1
19th call: 1
20th call: 0
21st call: 0
22nd call: 0
23rd call: 1
24th call: 1

After the 24th call, the behaviour is undefined.

The binary representation of the source must contain at least one 0 bit and one 1 bit.

Instead of 1 and 0, you can output any two distinct, consistent values (such as true and false).

Self-modifying programs that output the binary representation of the original source are allowed, provided that they don't read the source code to find out what to print next.

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

Bash, 105 bytes

trap -- 'trap|xxd -b -c1|cut -d\  -f2|tr -d \\n|cut -c`x=\`cat f||echo 1\`;echo $((x+1))>f;echo $x`' EXIT

NOTE: Make sure that you don't have an important file called f in the directory you're testing this.

If you want to test this, you can use the following command:

for i in $(seq 848); do bash path/to/script.sh 2> /dev/null; done | tr -d \\n

Which should give the same output xxd -c1 -b path/to/script.sh|cut -d\  -f2|tr -d \\n.

Explanation

This is using the trap trick - calling trap inside the trap action simply prints that line. Next that output gets piped to xxd which converts it to binary (unfortunately xxd -bp doesn't work - thus the workaround with cut & tr):

xxd -c1 -b $0|cut -d\  -f2|tr -d \\n

From that we're only interested in one bit (say N) which we can select with cut -cN.

To find out what N we're using (remember that's the part that needs to be incremented after each call), simply try to set x to the content of the file f and if it doesn't exist set it to 1:

x=`cat f||echo 1`

Last thing to do, is to update the file f - writing x+1 to it:

echo $((x+1))>f


Output all of printable ASCII using all of printable ASCII Output all 95 bytes from 0x20 to 0x7E inclusive (printable ASCII including space), in any order, each at least once. The source code of your program must use all of those bytes, each at least once.

Your program must be irreducible (meaning you cannot strictly remove some characters from the program and then have it still function correctly), so you can't just add a comment containing the remaining characters
Your program, and its output, can contain any additional bytes outside this range if you like (bytes, not characters), such as newlines
You must output them as bytes, not decimal code-points or anything else like that
Standard rules and loopholes apply
This is Code Golf, so the shortest program in bytes wins (even though all programs will be at least 95 characters)

Husk, 95 95 bytes
Edit: adjusted to fix bug pointed-out by Neil.  Same bytes
mcW=2`R\.5+46L" !#$%&'()*,-/013789:;<=?@ABCDEFGHIJKMNOPQSTUVXYZ[]^_abdefghijklnopqrstuvwxyz{|}~

Try it online!
Well, 96 bytes in Husk is trivial as a literal string, but 95 bytes was much more tricky.
The strategy that I've used is to (1) output all 95 printable ASCII characters using a program written using only non-repeating ASCII characters (this isn't completely straightforward, since many of the useful commands in Husk are encoded by non-ASCII characters), and then (2) to adjust it so that output is dependent on the length of a literal string containing all the unused characters: this second bit will ensure that all the characters are used, and also that the program is irreducible.
Here's how it works:
mcW=2`R\.5+46L"...
m                   # map this function:
 c                  # ASCII character
                    # across all the elements in this list:
  W                 # indexes of all elements that satisfy:
   =2               # are equal to 2
                    # among all the elements in this list:
     `R             # repeat this value:
       \            # reciprocal of
        .5          # .5
                    # this number of times:
          +46       # add 46 to
             L      # the length of
              "...  # this string
                    # the string consists of all the printable ASCII characters,
                    # with the characters of the program removed.  There are 15
                    # characters in the program, so the remaining 95-15=80 characters
                    # are all present in the string.
                    # So, to output all the ASCII characters up to
                    # 126, we need to add 126-80 = 46.


Find the minimum edit distance between two strings Explanation

The edit distance between two strings is a function of the minimum possible number of insertions, deletions, or substitutions to convert one word into another word.

Insertions and deletions cost 1, and substitutions cost 2.

For example, the distance between AB and A is 1, because deletions cost 1 and the only edit needed is the deletion of the B character.

The distance between CAR and FAR is 2, because substitutions cost 2. Another way to look at this is one deletion and one insertion.

Rules

Given two input strings (supplied however is convenient in your language), your program must find the minimum edit distance between the two strings.

You may assume that the strings only contain the characters A-Z and have fewer than 100 characters and more than 0 characters.

This is code golf, so the shortest solution wins.

Sample Test Cases

ISLANDER, SLANDER
> 1
MART, KARMA
> 5
KITTEN, SITTING
> 5
INTENTION, EXECUTION
> 8


Love Tester Code Golf Create program that counts the total number of letters common to two names, and finds the product of their lengths, to function as a "love tester."
Conditions: you may not get a 1:1 answer (being 3 out of 3, etc.) output.
Input
Two names from STDIN or closest alternative.
Output
Compute x as the total number of letters in common between the two names, ignoring case. Compute y as the product of the lengths of the names. Then the output, to STDOUT or closest alternative, is
Name1 and Name2 have x out of y chances of love.

Examples
Input:
Wesley
Polly

Output:
Wesley and Polly have 2 out of 30 chances of love.

Wesley and Polly have 2 letters in common, y and l, and the product of their lengths is 6 * 5 = 30.
Input:
Bill
Jill

Output:
Bill and Jill have 3 out of 16 chances of love.

Bonuses

Subtract 30 bytes for using simplified fractions, i.e. x out of y is in fully reduced form.

Scoring
This is code-golf answers will be scored in bytes with fewer bytes being better.

Pyth, 40 bytes

jd[z"and"Jw"have"/K-lzl.-rz0rJ0i=J*lzlJK"out of"/JiJK"chances of love.

The code is 70 bytes long and qualifies for the -30 bytes bonus.

Try it online.

  [                        Begin an array and fill it with the following:
   z                         The first line of input.
   "and"                     That string.
   Jw                        The second line of input, saved in J.
   "have"                    That string.
           rz0rJ0              Convert both lines to lowercase.
         .-                    Remove the characters form the second string
                               from the first, counting multiplicities.
        l                      Get the length.
     -lz                       Subtract it from the length of the first line.
    K                          Save in K.
                  =J*lzlJ      Save the lines' lengths' product in J.
                 i       K     Compute the GCD of J and K.
   /                         The quotient of K and the GCD.
   "out of"                  That string.
   /JiJK                     The quotient of J and the GCD of J and K.
   "chances of love.         That string.
jd                         Join the elements, separated by spaces.


A day at the Horse Races Background

Back in the late 90's / first 00's when Flash Web Design was so much cool that noone could live without having a full Flash website, or at least an animated widget, I was hired to develop a "horse races viewer" in Flash/Actionscript, in the shape of an 80's videogame style animation, so the site's visitors could not only read the race results, but they could see it in a moving animation! WOW! Impressive!

They provided me a CSV file with all the races details: start and arrival order, horse names, driver names, prizes, etc. My Flash app read that file for each race and displayed the above said animation.

Nowadays the Flash support is significantly declined, so we must revert to ascii-art!

Task

Your task is to create a full program or function that reads the race data in CSV format from standard input and outputs an ascii-art representation of the race as shown in the example below.

INPUT

CSV data with 2 fields: 1) start order; 2) arrival time at the Finish in the format 1.13.4 (1 minute, 13 seconds, 4 tenths of second). If the time reports R means that the horse is Retreated (didn't finish the race) due to incident, fall or other reason. Note: The arrival time could be the same for 2 or more horses, in this case they share the arrival position.

1,1.13.4
2,1.13.0
3,R
4,1.12.7
5,1.11.5
6,1.13.4
7,1.12.1
8,1.17.9

OUTPUT

For each CSV row, output a racetrack like this:

1_|______________4(1.13.0)___________________________

The racetrack is composed by:

1 which is the horses start order.
_| where _ is a spacer and the | is the finish line.
50 x _ that represents 50 tenths of second.
5(1.13.4) that is the arrival position followed by the arrival time. This must be positioned respecting the time differences between horses. For example: you position the 1st arrived on the Finish line at time 1.11.5, the second arrives at time 1.12.1, the difference is 1.12.1 - 1.11.5 = 6 tenths of second, so the second horse should be positioned at the 6th character, and so on. If the time difference is more than 50 tenths of seconds (or 5 seconds) you must position the horse at the end. The same if the horse is R (Retreated).

So the whole racetrack for the CSV data above should be:

  F=Finish line
1_|____________________________5(1.13.4)_____________
2_|______________4(1.13.0)___________________________
3_|__________________________________________________R
4_|___________3(1.12.7)______________________________
5_1(1.11.5)__________________________________________
6_|____________________________5(1.13.4)_____________
7_|_____2(1.12.1)____________________________________
8_|__________________________________________________6(1.17.9)
  012345678901234567890123456789012345678901234567890

There is no need to add F=Finish line, and the last line 0123456789... that is only for explaining purpose.

Test cases

RACE:
1,1.14.9
2,R
3,R
4,1.14.2
5,1.15.2
6,1.15.3
7,1.15.3

RACE:
1,1.13.6
2,1.13.8
3,R,
4,1.15.9
5,1.13.8
6,R,
7,1.14.4
8,1.15.6
9,1.14.1
10,1.13.9
11,1.13.2
12,1.14.3
13,1.15.0

RACE:
1,1.13.4
2,1.13.0
3,R
4,1.12.7
5,1.11.5
6,1.13.4
7,1.12.1
8,1.17.9

RACE:
1,1.17.3
2,1.20.4
3,1.17.0
4,1.18.8
5,1.18.5
6,1.18.4
7,1.18.4
8,1.17.8
9,1.18.3
10,1.18.7
11,R

RACE:
1,1.17.5
2,R
3,1.17.7
4,1.16.9
5,1.16.1
6,1.18.9

RACE:
1,1.12.8
2,1.13.0
3,1.13.2
4,1.12.7
5,1.11.5
6,1.13.0
7,1.12.1
8,1.12.8

Rules

Shortest code wins.

Python 2, 282 272 246 bytes

Similar to Arnauld the input is assumed to be already stripped from the starting number since it is implicit.
H=input().split("\n")
T=[float(c[2:])if c[2:]else 99for c in H]
P=[min(int(10*(t-min(T))),50)for t in T]
S=sorted(list(set(T)))
i=0
u="_"
for h,p,t in zip(H,P,T):i+=1;s=S.index(t)+1;print`i`+u+"|"*(s>1)+u*p+[h,"%d(%s)"%(s,h)][t<99]+u*(41-p+(s<2))


Coin Change Problem Enumeration Using N Coins And Each Denomination The coin change problem is very well documented. Given an infinite supply of coins of denominations x_1 to x_m you need to find the number of combinations which add up to y. For example, given x = {1,2,3} and y = 4 we have four combinations:

{1,1,1,1}
{1,1,2}
{1,3}
{2,2}

Introduction

There are several variations of the coin change problem. In this variation  we have two additional restrictions:

Every denomination must be used at least once.
Exactly a fixed number of coins must be used in total.

For example, given x = {1,2,3}, y = 36 and n = 15 where n is the total number of coins that must be used, we get four combinations:

{1,2,2,2,2,2,2,2,3,3,3,3,3,3,3} (1 ones, 7 twos, 7 threes)
{1,1,2,2,2,2,2,3,3,3,3,3,3,3,3} (2 ones, 5 twos, 8 threes)
{1,1,1,2,2,2,3,3,3,3,3,3,3,3,3} (3 ones, 3 twos, 9 threes)
{1,1,1,1,2,3,3,3,3,3,3,3,3,3,3} (4 ones, 1 twos, 10 threes)

Challenge

The challenge is to write a function enumerate in the language of your choice which enumerates all the combinations as described above given:

The list of denominations. For example {1,5,10,25}. You may use either lists or arrays.
A non-negative integer y that denotes the sum of every combination.
A non-negative integer n that denotes the total number of coins.

The order of the arguments doesn't matter. Pointfree functions are allowed.

The output of the enumerate function must be a list of combinations. Each combination must be unique and it must be a list of n integers which add up to y. Every denomination must appear at least once in each combination and no combination must be missing. The ordering of the integers and the combinations doesn't matter. You may use either lists or arrays for the output.

Keep in mind the following edge cases:

If both y and n are zero and the list of denominations is empty then the output is a list of one combination, the empty combination (i.e. {{}}).
Otherwise, if y is zero, n is zero or the list of denominations is empty then the output is a list of zero combinations (i.e. {}).
More generally, if y is less than the sum of the denominations or n is less than the number of denominations then the output is a list of zero combinations.

Scoring will be based on the size of the entire program in bytes. Note that this includes the enumerate function, helper functions, import statements, etc. It does not include test cases.

MATL, 22 bytes

Z^!S!Xu!tsi=Z)"1G@m?@!

Input order is: array of denominations, number of coins taken (n), desired sum (y).

Each combination is displayed on a different line. Empty output is displayed as an empty string (so nothing).

Try it online!

The code runs out of memory in the online compiler for the example in the challenge, but works offline with a standard, reasonably modern computer:

>> matl
 > Z^!S!Xu!tsi=Z)"1G@m?@!
 >
> [1 2 3]
> 15
> 36
1 1 1 1 2 3 3 3 3 3 3 3 3 3 3
1 1 1 2 2 2 3 3 3 3 3 3 3 3 3
1 1 2 2 2 2 2 3 3 3 3 3 3 3 3
1 2 2 2 2 2 2 2 3 3 3 3 3 3 3

Explanation

Z^      % Implicitly input array of denomminations and number of coins n. Compute
        % Cartesian power. This gives 2D array with each "combination"
        % on a different row
!S!     % Sort each row
Xu      % Deduplicate rows
!       % Transpose: rows become columns. Call this array A
ts      % Push a copy, compute sum of each column
i       % Input y (desired sum)
=       % Logical array that contains true if the "combination" has the desired sum
Z)      % Keep only those columns in array A
"       % For each column
  1G    %   Push array of denominations again
  @     %   Push current column
  m     %   Is each denomination present in the column?
  ?     %   If so
    @!  %     Push current column again. Transpose into a row
        %   End if
        % End for
        % Implicitly display stack contents


Implementing a firewall Your program reads from standard input and prints to standard output.

The first thing you'll be receiving on stdinput will be the ruleset for your firewall (until you encounter a double newline).

We'll start explaining the ruleset itself with some sample input:

/* header abbreviations added for demonstration purposes only */

 /> Allow (A) or Block (B)
|
|  /> Source (incl. mask)
| |
| |               /> Destination (incl. mask)
| |              |
| |              |          /> Source port(s)
| |              |         |
| |              |         |           /> Destination port(s)
| |              |         |          |

A 192.168.1.0/24 0.0.0.0/0 1024:65536 80
A 0.0.0.0/0 192.168.1.0/24 80 1024:65536
A 192.168.1.1/32 0.0.0.0/0 80 1024:65536
A 0.0.0.0/0 192.168.1.1/32 1024:65536 80
B 0.0.0.0/0 0.0.0.0/0 * *

Rules are processed in cascading order. Once you find a matching rule, determine the outcome and stop processing.
If a packet does not match any given rule, block it (sane defaults).
Elements of a rule are single-space delimited.
Source and destination adresses will provide a netmask. Be sure to filter accordingly.
The specification of the source and destinations ports must support the following syntax:

Single ports: e.g. "80"
Inclusive port ranges: e.g. "1024:65536"
All ports: e.g. "*"

You may assume input to be well-formed.

After the double newline, you'll receive (one or more) newline seperated input packets to test according to the ruleset you've now acquired.

Some sample input for the packets to clarify:

/* header abbreviations added for demonstration purposes only */

 /> Source
|
|             /> Source port
|            |
|            |     /> Destination
|            |    |
|            |    |              /> Destination port
|            |    |             |

192.168.1.18 1036 157.136.122.5 22
157.136.108.8 2400 192.168.1.1 80

You'll examine these input packets and determine the outcome of filtering according to the rules.

The above sample input (ruleset + packets) should thus yield the following output:

BLOCK 192.168.1.18 1036 157.136.122.5 22
ALLOW 157.136.108.8 2400 192.168.1.1 80

The output is basically no more than 'BLOCK' or 'ALLOW' followed by a space and the verbatim input line.

Some varia:

This is code golf, the shortest (source code, by byte count) solution wins. Have fun!
You are not allowed to use specific IP address handling features of your language.
Specialized languages for routing or firewalling will be excluded from contending for first place (if they exist).
If any part of the question is ambiguous or in need of further clarification, feel free to comment.

Haskell, 356 characters

main=interact$f.break null.lines;f(r,_:p)=unlines$map(foldr(g.w)(j"B"++)r)p
g[r,s,d,a,b]n x|and$zipWith3($)(cycle[k.('/'#),q.(':'#)])[s,a,d,b]$w x=j r++x|t=n x
k[y,z]x=y%z==x%z;y%z=foldl((.r).(+).(*256))0('.'#y)`div`2^(32-r z)
q["*"]x=t;q[y]x=x==y;q[a,b]x=r x>=r a&&r x<=r b
d#x=w$map(d?)x;d?x|d==x=' '|t=x;j"A"="ALLOW ";j"B"="BLOCK ";t=1<3;r=read;w=words


What date is that again? On my website, users enter their date of birth in the style xx.xx.xx - three two-digit numbers separated by dots. Unfortunately, I forgot to tell the users exactly which format to use. All I know is that one section is used for the month, one for the date, and one for the year. The year is definitely in the 20th century (1900-1999), so the format 31.05.75 means 31 May 1975. Also, I'm assuming everyone uses either the Gregorian or the Julian calendar.

Now, I want to go through my database to clear up the mess. I'd like to start by dealing with the users with the most ambiguous dates, that is, those where the range of possible dates is the biggest.

For example, the date 08.27.53 means 27 August 1953 in either the Gregorian or Julian calendar. The date in the Julian calendar is 13 days later, so the range is just 13 days.

In contrast, the notation 01.05.12 can refer to many possible dates. The earliest is 12 May 1901 (Gregorian), and the latest is 1 May 1912 (Julian). The range is 4020 days.

Rules

Input is a string in the format xx.xx.xx, where each field is two digits and zero-padded.
Output is the number of days in the range.
You can assume that the input will always be a valid date.
You may not use any built-in date or calendar functions.
Shortest code (in bytes) wins.

Testcases

01.00.31 => 12
29.00.02 => 0 (The only possibility is 29 February 1900 (Julian))
04.30.00 => 13
06.12.15 => 3291

Pyth, 118 bytes

M++28@j15973358 4G&qG2!%H4FN.pmv>dqhd\0cz\.I&&&hN<hN13eN<eNhgFPNaYK+++*365JhtN/+3J4smghdJthNeNInK60aY-K+12>K60;-eSYhSY

Try it online: Demonstration or Test Suite.

Necessary knowledge of Julian and Gregorian Calendars

Julian and Gregorian Calendar are quite similar. Each calendar divides a year into 12 months, each containing of 28-31 days. The exact days in a month are [31, 28/29 (depends on leap year), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]. The only difference between the calendars are their definition of a leap year. In the Julian Calendar any year divisible by 4 is a leap year. The Gregorian Calendar is a bit more specific. Any year divisible by 4 is a leap year, except the year divisible by 100 and not divisible by 400.

So in the 20th century only one year is different. The year 1900, which is a leap year in the Julian Calendar, but not a leap year in the Gregorian Calendar. So the only date, that exists in the one calendar but not in the other calendar is the day 29.02.1900.

Because of the different leap year definition, there's a difference between a date in the Julian Calendar and the Gregorian Calendar. 12 days difference for a date before the 29.02.1900, and 13 days difference for dates after the 29.02.1900.

Simplified Pseudo-Code

Y = []  # empty list
for each permutation N of the input date:
   if N is valid in the Julian Calendar:
      K = number of days since 0.01.1900
      append K to Y
      if K != 60:  # 60 would be the 29.02.1900
         L = K - (12 if K < 60 else 13)
         append L to Y
print the difference between the largest and smallest value in Y

Detailed Code Explanation

The first part M++28@j15973358 4G&qG2!%H4 defines a function g(G,H), which calculates the number of days in month G of a year H in the Julian Calendar.

M                            def g(G,H): return
      j15973358 4               convert 15973358 into base 4
     @           G              take the Gth element
  +28                           + 28
 +                &qG2!%H4      + (G == 2 and not H % 4)

And the next part is just the for loop, and the ifs. Notice that I interpret N in the format (month, year, day). Just because it saves some bytes.

FN.pmv>dqhd\0cz\.
             cz\.        split input by "."
    mv>dqhd\0            map each d of ^ to: eval(d[d[0]=="0":])
FN.p                     for N in permutations(^):

I&&&hN<hN13eN<eNhgFPN
I                          if
    hN                        month != 0
   &                          and
      <hN13                   month < 13
  &                           and
           eN                 day != 0
 &                            and
             <eNhgFPN         day < 1 + g(month,year):

aYK+++*365JhtN/+3J4smghdJthNeN
          JhtN                    J = year
     +*365J   /+3J4               J*365 + (3 + J)/4
    +              smghdJthN      + sum(g(1+d,year) for d in [0, 1, ... month-2])
   +                        eN    + day
  K                               K = ^
aYK                               append K to Y

InK60aY-K+12>K60
InK60                             if K != 60:
     aY-K+12>K60                    append K - (12 + (K > 60)) to Y

;-eSYhSY
;          end for loop
 -eSYhSY   print end(sorted(Y)) - head(sorted(Y))


Writing Phrases with Code This is my first contest, so please tell me what I can do to improve.

The object of this contest is to write program lines in your language of choice that are both valid code and self-descriptive in English, such as this Golfscript program:

This program outputs 4 twice.

You may use any language features, libraries, #defines, etc. that you want; however, a setup must not be over 10 lines (no, you can't cheat using ; or any such line separator :P).

The program with the most upvotes by midnight on October 1st wins.

Python
# This "program" does nothing and assumes "valid code" means it doesn't throw an error.

You might want to tighten up the rules a bit.


Base-2 integer logarithm of 64-bit unsigned integer Problem:

In your choice of language, write the shortest function that returns the floor of the base-2 logarithm of an unsigned 64-bit integer, or –1 if passed a 0. (Note: This means the return type must be capable of expressing a negative value.)

Test cases:

Your function must work correctly for all inputs, but here are a few which help illustrate the idea:

               INPUT ⟶ OUTPUT

                   0 ⟶ -1
                   1 ⟶  0
                   2 ⟶  1
                   3 ⟶  1
                   4 ⟶  2
                   7 ⟶  2
                   8 ⟶  3
                  16 ⟶  4
               65535 ⟶ 15
               65536 ⟶ 16
18446744073709551615 ⟶ 63

Rules:

You can name your function anything you like.
Character count is what matters most in this challenge.
You will probably want to implement the function using purely integer and/or boolean artithmetic. However, if you really want to use floating-point calculations, then that is fine so long as you call no library functions. So, simply saying return n?(int)log2l(n):-1; in C is off limits even though it would produce the correct result. If you're using floating-point arithmetic, you may use *, /, +, -, and exponentiation (e.g., ** or ^ if it's a built-in operator in your language of choice). This restriction is to prevent "cheating" by calling log() or a variant.
If you're using floating-point operations (see #3), you aren't required that the return type be integer; only that that the return value is an integer, e.g., floor(log₂(n)).
If you're using C/C++, you may assume the existence of an unsigned 64-bit integer type, e.g., uint64_t as defined in stdint.h. Otherwise, just make sure your integer type is capable of holding any 64-bit unsigned integer.
If your langauge does not support 64-bit integers (for example, Brainfuck apparently only has 8-bit integer support), then do your best with that and state the limitation in your answer title. That said, if you can figure out how to encode a 64-bit integer and correctly obtain the base-2 logarithm of it using 8-bit primitive arithmetic, then more power to you!
Have fun and get creative!

C 40 54
Edit Clever recursive trick by @Kyle - that's creative!
int l(uint64_t n){return n?l(n/2)+1:-1;}

(Previous version: That's the bare starting point - creativity level 0)
int l(uint64_t n){int r=-1;for(;n;n>>=1)r++;return r;}

Test: Ideone


Are these braids equal? If you are not familiar with Braid-Theory I recommend that you read this first.  This question assumes that you are at least familiar with the concepts at hand and assumes you are well familiar with group-theory

Let us define σn to be the braid in which the nth strand (One indexed) from the top crosses over the n+1th strand, and σn- to be the inverse of σn (That is the n+1th strand crosses the nth strand).

The braid group Bn is then generated by <σ1,σ2,σ3, . . . , σn-1>.  Thus every braid on Bn can be written as the product of the σ-braids.1

Determining if two braids on a group are equal is not a simple task.  It may be pretty obvious that σ1σ3 = σ3σ1, but it is a little less obvious that for example σ2σ1σ2 = σ1σ2σ1.2

So the question is "How can we determine if two braids are the same?".  Well the two examples above each represent a bit of this.  In general the following relations, called Artin's relations, are true:

σiσj = σjσi; i - j > 1
σiσi+1σi = σi+1σiσi+1

We can use these two relations in conjunction with the group axioms to prove that any equal braids are equal.  Thus two braids are equal iff the repeated application of these relations and the group axioms can demonstrate so.

Task

You will write a program or function to take two braids and determine whether or not they are equal.  You may also optionally take a positive integer representing the order of the group.

This is a code-golf question so answers will be scored in bytes, with less bytes being better.

Input and Output

You should represent a Braid as an ordered list of generators, (or any equivalent structure, e.g. vector).  You may represent the generators in any reasonable form (e.g. an integer, a two tuple of a positive integer and a boolean).

On par with standard descision-problem rules you should output one of two distinct values, an accept an reject.

Test Cases

[],       []              -> True
[1,-1],   []              -> True
[1,2,1],  [2,1,2]         -> True
[1,3],    [3,1]           -> True
[1,3,2,1],[3,2,1,2]       -> True
[1,4,-4,3,2,1], [3,2,1,2] -> True
[2,2,1],  [2,1,2]         -> False
[1,2,-1], [-1,2,1]        -> False
[1,1,1,2],[1,1,2]         -> False

1:  Note that while Bn satisfies all the properties of a group the operation on our braid group is not commutative, and thus our group is not abelian.

2: If you would like to verify this for yourself I suggest applying σ1- to both sides, If you draw the two out on paper, or model them with actual strings it should become apparent why this is the case.

Haskell, 190 bytes

i!j|j<0=reverse$map(0-)$i!(-j)|i==j=[i,i+1,-i]|i+1==j=[i]|i+j==0=[j+1]|i+j==1=[-j,-i,j]
_!j=[j]
j%(k:a)|j+k==0=a
j%a=j:a
i&a=foldr(%)[]$foldr((=<<).(!))[i]a
a?n=map(&a)[1..n]
(a#b)n=a?n==b?n

Try it online!

How it works

Let Fn be the free group on n generators x1, …, xn.  One of the first results in braid theory (Emil Artin, Theorie der Zöpfe, 1925) is that we have an injective homomorphism f : Bn → Aut(Fn) where the action fσi of σi is defined by

fσi(xi) = xixi + 1xi−1,
fσi(xi + 1) = xi,
fσi(xj) = xj for j ∉ {i, i + 1}.

The inverse fσi−1 is given by

fσi−1(xi) = xi + 1,
fσi−1(xi + 1) = xi + 1−1xixi + 1,
fσi−1(xj) = xj for j ∉ {i, i + 1}

and of course composition is given by fab = fa ∘ fb.

To test whether a = b ∈ Bn, it suffices to test that fa(xi) = fb(xi) for all i = 1, …, n.  This is a much simpler problem in Fn, where we only need to know how to cancel xi with xi−1.

In the code:

i!j computes fσi(xj) (where either i or j may be negative, representing an inverse),
foldr(%)[] performs reduction in the free group,
i&a computes fa(xi),
a?n computes [fa(x1), …, fa(xn)],
and (a#b)n is the equality test for a = b in Bn.


Tips for restricted source in Python Just like code-golf, restricted-source pushes one to exploit quirks and hidden features of the Python language.  We already have a place to collect all these tips for code-golf, those for restricted-source remain transmitted by word of mouth or hidden deep within the python documentation.
So today I would like to ask you what are some tips for solving restricted-source challenges in Python?
Please only include 1 tip per answer.

What makes a good tip here?
There are a couple of criteria I think a good tip should have:

It should be (somewhat) non obvious.
Similar to the code-golf tips it should be something that someone who has golfed in python a bit and read the tips page would not immediately think of.  For example "Replace a + b with a+b to avoid using spaces", is obvious to any golfer, since it is already a way to make your code shorter.  Thus it is not a good tip here.

It should not be too specific.
Since there are many different types of source restrictions, answers here should be at least somewhat applicable to multiple source restrictions, or one common source restriction.  For example tips of the form How to X without using character(s) Y are generally useful since banned characters is a common source restriction.  The thing your tip helps to do should also be somewhat general.  For example tips of the form How to create numbers with X restriction are useful since many programs utilize numbers regardless of the challenge.  Tips of the form How to implement Shor's algorithm with X restriction are basically just answers to a challenge you just invented and not very helpful to people solving other challenges.

Avoid "normal" letters
Identifiers are normalized by the Python 3 parser. This implies that cursive (Unicode) letters such as  are interpreted as their ASCII-compliant equivalents abcDEF. So the following code works (as was exploited here):
=123
()

Python versions in which this behaviour is confirmed:

Works: 3.4, 3.5, 3.6, 3.7, 3.8
Doesn't work: 2.7

Example source restriction:

Use no characters abc···xyz, ABC···XYZ.


How many Faro shuffles for a cycle? Background
Inspired by this video by Matt Parker
A Faro shuffle is a perfect riffle shuffle where the deck is exactly interleaved with its other half. This is how to perform one:

the deck of 52 cards is split into two piles of 26 cards each
the two piles are interleaved. In the case of an "in" shuffle, the bottom card of the top pile ends up on the bottom, and the top card of the bottom pile ends up on the top (the outer cards move inwards). In the case of an "out" shuffle, the top card of the top pile ends up on top and vice versa (the outer cards stay on the outside).

For example, with a demonstration deck of only 6 cards, the steps are as follows:

Start: [1, 2, 3, 4, 5, 6]
Split: [1, 2, 3] [4, 5, 6]
For an "in" shuffle, interleave like this: [4, 1, 5, 2, 6, 3] (zip the second half with the first half)
For an "out" shuffle, interleave like this: [1, 4, 2, 5, 3, 6] (zip the first half with the second half)

Challenge
Given a list of values representing "in" and "out" Faro Shuffles, determine the minimum number of times that list needs to repeat such that a deck of 52 distinct cards will return to its starting arrangement. Note that this is not the same value shown in Matt's video; it is divided by the length of the input.
If the deck returns to the starting arrangement part way through the list (for example, [0, 0, 0, 0, 0, 0] (6 out shuffles) would finish after 1 full set of 6 and then 2 more shuffles), it doesn't count as having finished the cycle because it wasn't completed at the end of the list (so the output for that example would be LCM(6, 8) / 6 = 4).
Example
Input: [0, 1, 1, 0, 1, 1, 1] (using 0 for "out" shuffles and 1 for "in" shuffles, and representing the starting deck is [0, 1, 2, 3, ... 48, 49, 50, 51])

First, we perform the shuffles as they are specified in the input: out, in, in, out, in, in, in. This gives the output:

[0, 26, 1, 27, 2, 28, 3, 29, 4, 30, 5, 31, 6, 32, 7, 33, 8, 34, 9, 35, 10, 36, 11, 37, 12, 38, 13, 39, 14, 40, 15, 41, 16, 42, 17, 43, 18, 44, 19, 45, 20, 46, 21, 47, 22, 48, 23, 49, 24, 50, 25, 51]

Now, we check if that has caused the list to return to its exact original arrangement
Repeat these steps, and output the number of times we've looped. In this case, it takes 1260 repetitions of [0, 1, 1, 0, 1, 1, 1], so our output is 1260

Test cases
Using 0 for "out" shuffles and 1 for "in" shuffles.
[0] 8
[1] 52
[0, 1] 252
[0, 0, 1] 20
[0, 1, 0] 20
[1, 0, 0] 20
[0, 1, 1, 0, 1, 1, 1] 1260
[0, 0, 0, 0, 0, 0, 0, 1] 2
[0, 0, 0, 0, 0, 0] 4
[0, 0, 0, 0, 0, 0, 0, 0, 0] 8
[0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1] 144
[1, 0, 1, 1, 1, 0, 1, 1, 1] 60
[0, 1, 1, 0] 44
[1, 1, 1, 1, 0, 1, 0, 1, 0] 306
[1, 1, 0, 1, 1, 0, 0, 1, 1, 0] 210
[1, 0, 0, 0, 0, 0, 0, 1] 2
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1] 168
[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1] 228
[1, 0, 1, 0, 1] 60
[1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1] 66
[0, 0, 0, 0, 1, 0] 252

Rules

The values that represent "in" and "out" in the input list can be any two distinct values, within reason. For example, 0 and 1 is allowed, but code_to_do_an_in_shuffle() and code_to_do_an_out_shuffle() are not
Standard loopholes are forbidden
You may use any sensible I/O method
This is code-golf, so the shortest code in bytes wins

Pyth, 63 53 bytes
J26AcU*J2JW=Y?@Q%ZlQ.iHG.iGH=+Z1AcYJI&qYSY!%ZlQB;/ZlQ

Try it online!
J26          # Set J to 26.
AcU*J2J      # Assign G and H to range(0, 26) and range(26, 52) respectively.
W            # While
?@Q%ZlK      # If the current element of Q (input list)
.iHG         # is 1, then interleave H and G
.iGH         # Otherwise, interleave G and H
=Y           # Assign that value to Y
=+Z1         # Increment Z by 1
AcYJ         # Now reassign G and H to the first and last 26 elements of Y respectively
I&qYSY!%ZlQB # If Y is already sorted and we are at the end of input list, then break
;/ZlQ        # Print Z divided by length of input list


Count the characters - bit by bit! The simple part: Given an input string containing only printable ASCII-characters (space - tilde), count the number of occurrences of each character and return the result on any convenient format. The result for a string a%hda7a should be something like: a:3, %:1, h:1, 7:1, d:1. Sorting is unnecessary, the delimiters and formats are optional but it must be easily understood which number corresponds to which character. You shall not include characters that are not in the input string (a:3, b:0, c:0, d:1, ... is not OK).

The real challenge:

Convert every character in your code to an 8-bit binary number (or 16-bit if you're using UTF-16 or similar), and enumerate every character starting at 0.

For every character (i is the enumerator), the i%7-bit1 must be 1. The bits are numbered from the right. All other bits can be whatever you want.

Let's use the following code as an example:

[f]-xif)#f

Converting this to binary we get the array below. The first number (representing [ has a 1 in the 0'th position, so that one is OK. The second number (representing f has a 1 in the 1'st position, so that one is OK too. Continue like this, and you'll see that the code above is valid.

C  76543210  Bit number
-  --------  ----------
[  01011011  0   - OK
f  01100110  1   - OK
]  01011101  2   - OK
-  00101101  3   - OK
x  01111000  4   - OK
i  01101001  5   - OK
f  01100110  6   - OK
)  00101001  0   - OK
#  00100011  1   - OK
f  01100110  2   - OK

If we change the code into: ]f[-xif)#f we'll get the following start of the sequence:

C  76543210  Bit number
-  --------  ----------
]  01011101  0   <- OK
f  01100110  1   <- OK
[  01011011  2   <- Not OK
-  00101101  3   <- OK

As we see, the third character [ doesn't have a 1 in the 2nd position (zero-indexed), and this code is therefore not valid.

Test cases:

Input:
This is a string containing some symbols: ".#!".#&/#

Output:
   !  "  #  &  /  :  T  a  b  c  e  g  h  i  l  m  n  o  r  s  t  y  .
7  1  2  3  1  1  1  1  2  1  1  1  2  1  5  1  2  4  3  1  6  2  1  2

Any reasonable output format is OK (whatever is most convenient to you). You could for instance have: :7, !:1, ":2, #:3, &:1, /:1, T:1, a:2 ... or [ ,7][!,1][",2][#,3][&,1].... The output is on any standard way (return from function, printed to STDOUT etc.)

1i modulus 7.

This is code-golf, so the shortest code in bytes will winref.


Sum my Fibonaccified divisors! The famous Fibonacci sequence is F(0) = 0; F(1) = 1; F(N+1) = F(N) + F(N-1) (for this challenge we are beginning with 0).

Your challenge: Given n, output the sum of all the dth Fibonacci numbers for all divisors d of the nth Fibonacci number. If you prefer more formal notation,

Input: a positive integer n

Output: the sum

For example, consider n=4. F(4) = 3The divisors of 3 are 1 and 3, so the output should be F(1) + F(3) = 1 + 2 = 3.

For n=6, F(6) = 8, and the divisors of 8 are 1, 2, 4, 8, so the output is F(1) + F(2) + F(4) + F(8) = 1 + 1 + 3 + 21 = 26.

Test Cases:

1 => 1
2 => 1
3 => 2
4 => 3
5 => 6
6 => 26

This is code-golf, shortest answer in bytes wins. Standard loopholes apply.

Jelly, 7 bytes

ÆḞÆDÆḞS

Try it online!

Explanation:

ÆḞÆDÆḞS Main link (Arguments: z)
ÆḞ      zth Fibonacci number's
  ÆD                           divisors'
    ÆḞ                                   Fibonacci numbers'
      S                                                     sum


Cut a triangle into equal-sized parts! Similar in spirit to Number of distinct tilings of an n X n square with free n-polyominoes and Partition a square grid into parts of equal area, this challenge will have you count ways of partitioning a triangle in a triangular grid. The goal of this code-golf challenge is to write a program that outputs \$ a(n,m)\$, the number of ways to partition a triangle of side length \$n\$ into equal parts containing \$m\$ cells each. The parts must contiguous, where two cells are considered touching if they share a side.
Examples
Up to rotation and reflection, there are two ways to partition the size-\$4\$ triangle into equal parts of size \$8\$, so \$a(4,8) = 2\$:

Up to rotation and reflection, there are three ways to partition the size-\$4\$ triangle into four parts of size \$4\$, so \$a(4,4) = 3\$:

Table
 n |  m | a(n,m)
---+----+-------
 1 |  1 | 1
 2 |  1 | 1
 2 |  2 | 0
 2 |  4 | 1
 3 |  1 | 1
 3 |  2 | 0
 3 |  3 | 1
 3 |  9 | 1
 4 |  1 | 1
 4 |  2 | 0
 4 |  3 | 0
 4 |  4 | 3
 4 |  8 | 2
 4 | 16 | 1

(I've made this table by hand, so comment if you spot any mistakes.)
Challenge
Write a program that takes an input \$n\$, which is the size of a triangle, and a parameter \$m\$, which is the size of each region, and return the number of ways to partition the size \$n\$ triangle into \$n^2/m\$ parts of size \$m\$ up to the rotations and reflections of the triangle.
Your code should be able to handle the inputs in the table on TIO, and it should be able to handle larger inputs in principle.
This is a code-golf challenge, so the shortest code wins.

JavaScript (ES7),  367 362 359  357 bytes
Saved 1 byte thanks to @Shaggy
Expects (n)(m).

n=>m=>(T=Array(n*n).fill(N=0),g=(A,P=[-1],k=T.findIndex(v=>!v),B=[...A,P[S='sort']()][S]())=>g[B]?0:~[1,1,0,1,1,0][M='map'](r=>g[B=B[M](P=>P[M](i=>~i?(y=i**.5|0)*y-i-(r?1-((~y*~y+~i>>1)-n)**2:y*~-~y):i)[S]())[S]()]=1)/P[m]?~k?g(B):++N:T[M]((v,j)=>v||(~P?P.every(i=>(y=i**.5|0)^j**.5|(i-j)**2-1&&j-i+2*(i+y&1?y:~y)):j-k)||T[T[j]++,g(A,[...P,j]),j]--))([])&&N

Try it online!
How?
TL;DR
This is a recursive search that keeps track of all the patterns that were already tried, transformed in all possible ways, in order to prune the search as soon as possible when a collision is found. This allows it to perform at a decent speed on small triangles despite an otherwise inefficient piece-building method.
Triangle description and cell indexing
A size-\$n\$ triangle is simply stored as an array of \$n^2\$ binary values. Empty cells are marked with \$0\$'s and occupied cells are marked with \$1\$'s.
JS initialization:
T = Array(n * n).fill(0)

By convention, the cells are numbered from \$0\$ to \$n^2-1\$, from left to right and top to bottom.

Below are some basic formulas:

The 0-indexed row of the cell \$c\$ is \$y_c=\lfloor\sqrt{c}\rfloor\$
The 0-indexed position of the cell \$c\$ within its row is \$c-{y_c}^2\$
The 0-indexed distance of the cell \$c\$ from the last cell in its row is \${(y_c+1)}^2-c-1\$

Testing whether 2 cells are neighbors
Two cells \$c\$ and \$d\$ are horizontal neighbors if \$y_c=y_d\$ and \$|c-d|=1\$ (e.g. \$c=10\$ and \$d=11\$, or the other way around).
Two cells \$c\$ and \$d\$ are vertical neighbors if either:

\$c+y_c\$ is even and \$d=c+2\times(y_c+1)\$ (e.g. \$c=3\$ and \$d=7\$)
\$c+y_c\$ is odd and \$d=c-2\times y_c\$ (e.g. \$c=7\$ and \$d=3\$)

Hence the following JS expression which is truthy if the cells i and j are not neighbors:
(y = i ** .5 | 0) ^ j ** .5 | (i - j) ** 2 - 1 && j - i + 2 * (i + y & 1 ? y : ~y)

Reflections
A vertical reflection is applied by doing:
$$d=2\times y_c\times (y_c+1)-c$$
Examples:
$$2\times y_{10}\times (y_{10}+1)-10=2\times 3\times 4-10=14\\
2\times y_{14}\times (y_{14}+1)-14=2\times 3\times 4-14=10$$

Rotations
A 120° rotation is applied by doing:
$$d=\left(n-\left\lfloor\dfrac{(y_c+1)^2-c-1}{2}\right\rfloor\right)^2+{y_c}^2-c-1$$
Examples:

\$c=0\$ is turned into \$d=15\$
\$c=7\$ is turned into \$d=12\$

Combining reflections and rotations
In the JS implementation, both formulas are combined into the following expression. This code applies a reflection to the cell i when r = 0 or a rotation when r = 1.
(y = i ** .5 | 0) * y - i - (
  r ?
    1 - ((~y * ~y + ~i >> 1) - n) ** 2
  :
    y * ~-~y
)

To get all possible transformations of a tiling, we apply 2 rotations, followed by a reflection, followed by 2 rotations, followed by a reflection.
Hence the loop:
[1, 1, 0, 1, 1, 0].map(r =>
  /* ... apply the transformation to each cell of each piece of the tilling ... */
)

Describing the tiling
Each piece of the tiling is stored in an array of \$m+1\$ entries consisting of a leading -1 followed by \$m\$ indices corresponding to the cells it contains.
The current piece is stored in P[]. The array A[] contains the previous pieces. The array B[] contains the previous pieces and the current piece, with all pieces sorted in lexicographical order and all indices also sorted in lexicographical order within each piece.
Example:
The following tiling:

would be described with:
B = [
  [ -1, 0, 1, 2, 3 ],
  [ -1, 10, 11, 4, 9 ],
  [ -1, 12, 5, 6, 7 ],
  [ -1, 13, 14, 15, 8 ]
]

Once coerced to a string, this gives a unique key that allows us to detect whether a similar configuration was already encountered and prune the search.
"-1,0,1,2,3,-1,10,11,4,9,-1,12,5,6,7,-1,13,14,15,8"

The purpose of the -1 markers is to make sure that an incomplete piece followed by another piece in the key is not mixed up with another complete piece.
The keys are stored in the underlying object of the function g.
Main algorithm
The recursive search function goes as follows:

find the position k of the first empty cell in the triangle
update B[]
abort if B[] was already encountered
apply all transformations to B[] and mark them as encountered
if P[] is complete:

if the triangle is full (k is set to -1): we've found a new valid tiling, so increment the number of solutions N
otherwise, append P[] to A[] and start building a new piece

if P[] is not yet complete:

if P[] does not contain any tile, append k to it
otherwise, try to append the index of each tile that has at least one neighbor in P[]


ROT-128 oscillating quine (Mutual Quine) ROT-128 is a variant of ROT-13, where instead of cycling through the 26 letters, you cycle through the 256 possible bytes.  Your task is to create a program that outputs the ROT-128 of its own source. The outputted program must also be a valid program and output the original program.

Scoring

This is code golf, so least number of bytes wins! Ties are broken by number of votes.

GolfScript, 64 48 bytes

{ºî»`'.~'+.{128^}%\](}.~û:n;à§®þ§«®û±²¸Þý¥ÜÝ¨ý®þ

Thanks to @MartinBüttner for golfing off 16 bytes!

Try it online!

Output

û:n;à§®þ§«®û±²¸Þý¥ÜÝ¨ý®þ{ºî»`'.~'+.{128^}%\](}.~

Try it online!

Verification

$ LANG=en_US

$ cat quine.gs
{ºî»`'.~'+.{128^}%\](}.~û:n;à§®þ§«®û±²¸Þý¥ÜÝ¨ý®þ
$ golfscript quine.gs
û:n;à§®þ§«®û±²¸Þý¥ÜÝ¨ý®þ{ºî»`'.~'+.{128^}%\](}.~
$ golfscript quine.gs | golfscript
{ºî»`'.~'+.{128^}%\](}.~û:n;à§®þ§«®û±²¸Þý¥ÜÝ¨ý®þ
$ diff -s quine.gs <(golfscript quine.gs | golfscript)
Files quine.gs and /dev/fd/63 are identical


Dollar Divisibility and Perfect Change I have $15 in my pocket.  Likewise, I am in a store which doesn't give change.  While browsing, I spot an item that costs $10 (tax included).  Can I buy that item without losing any money?

In this case, the answer is yes.  No matter how my $15 is divided up (one 10 and one 5, or three 5s, or something else), I will always have the exact $10 needed.

As a second example, I have $0.16 in my pocket.  What other amounts of money must I be able to pay exactly?

Possible Divisions:
0.01, 0.05, 0.10
0.01, 0.05 x 3
0.01 x 16
Guaranteed Exact Change:
0.01, 0.05, 0.06, 0.10, 0.11, 0.15, 0.16

What if I have $0.27 in my pocket?

Possible Divisions:
0.01 x 2, 0.25
0.01 x 2, 0.05, 0.10 x 2
0.01 x 2, 0.05 x 3, 0.10
0.01 x 2, 0.05 x 5
0.01 x 27
Guaranteed Exact Change:
0.01, 0.02, 0.25, 0.26, 0.27

In the above case, there were only a few amounts of money for which I would always have perfect change.

Your task

Write the shortest program (or named function) which takes A) an integer amount of money and B) a list of possible denominations as input, and outputs a list of the amounts of money for which I must have perfect change.  Input can be either STDIN or arguments for the program or function.  I'm not going to be super-strict on input formatting; it can match how your language formats arrays.

Perhaps a More Detailed Explanation

I have a certain amount of money in my pocket, which is formed from a set of possible demonstrations of currency.   If I have $8, and I know that the possible denominations are $2 and $3, then there's only so many different combinations of bills that could be in my pocket.  These are 2+2+2+2 and 3+3+2.  In order to be able to produce an exact amount of money, I have to be able to produce that quantity using the only the bills that are in my pocket.  If I had four 2s, I could produce 2, 4, 6, or 8. If I had two 3s and a 2, I could produce 2, 3, 5, 6, or 8 Since I don't know which of these combinations I actually have in my pocket, my final answer is reduced to 2, 6, 8.  These are the values I know I could produce from my pocket, given the total amount and the possible denominations.

Hand-Calculated Example I/O

7 [3, 4]
3, 4, 7        //only one possible division into 3 + 4

7 [3, 2]
2, 3, 4, 5, 7  //the only division is 3 + 2 + 2

6 [2, 3, 4]
6     //divisions are 2+2+2, 3+3, 2+4

16 [1, 5, 10, 25]          //this represents one of the examples above
1, 5, 6, 10, 11, 15, 16

27 [1, 5, 10, 25]          //another example from above
1, 2, 25, 26, 27

1500 [1, 5, 10, 25, 100, 500, 1000, 2000]
500, 1000, 1500

600 [100, 500, 1000, 2000]
100, 500, 600

600 [200, 1, 5, 10, 25, 100, 500, 1000, 2000]
600

Python 2, 200 197 193 140 bytes

f=lambda n,D,S={0}:sum([f(n-x,D,S|{x+y for y in S})for x in D],[])if n>0else[S]*-~n
g=lambda*a:(f(*a)and reduce(set.__and__,f(*a))or{0})-{0}

(Thanks to @Nabb for tips)
Here's a poorly golfed solution for now to get things started. Call with g(16, [1, 5, 10, 25]) — output is a set with the relevant denominations.
The approach is straightforward, and is broken down into two steps:

f looks at all ways of reaching n with denominations D (e.g. [1, 5, 10]), and for each one it works out all amounts that can be made with these denominations (e.g. set([0, 1, 5, 6, 10, 11, 15, 16])).
g calculates the intersections of the results of f, then removes 0 for the final answer.

The program solves cases 1-5 and 7 fine, stack overflows on 6 and takes forever on 8.
If there is no solution (e.g. g(7, [2, 4, 6])), then the program returns an empty set. If an error is allowed to be thrown for such a case, then here is a shorter g:
g=lambda*a:reduce(set.__and__,f(*a))-{0}


A program that ends but never ends Write a program that starts itself again when finishes.

There should be no more than one instance of the program running at same time.  Not even for a slightest moment of time.

You can ignore any instance that is manually started by user during your cycle.  But your code should not do it in your restart cycle.

Program can start after any amount of time, as long as it is guaranteed that it starts again.

The only way to stop the cycle is to kill the process.

Your solution should not involve restarting of the environment (in which program is running, includes OS, machine, VM, shell etc).  Only your program is allowed to restart.

Bash script, 3 chars (Shortest, possibly the most elegant, though admittedly controversial)
$0&

Simply places a new instance of itself in the background (new process), then quits.  The new instance likely will remain in the scheduler run-queue until the previous instance is done.
Warning - this is hard to kill, as the PID is continually changing.  Temporarily renaming the script file is probably the simplest way to break the cycle.
A single-core system is assumed.  Of course this is not realistic with Linux on modern bare-metal hardware, but it is easily configurable when running in a VM.  We could probably achieve a similar trick using taskset, but that would reduce the impact of the 3-char solution.
This answer bends the rules a little bit in that it applies a specific meaning of "running".  There will be moments when the new process has been fork()ed and the old process is still alive - i.e. it may be possible to observe more than one PID.  However the new process will be placed on the Linux scheduler run-queue to wait for CPU cycles, while the existing process will continue to execute.  At this point all that needs to be done by the existing process is for bash itself to exit().  This does take a finite amount of time, though I'm fairly confident that it will be done way before the current timeslice/scheduler quantum is done.  Supporting evidence is the fact that bash starts up and shuts down in 2ms on my VM:

$ time bash -c :

real    0m0.002s
user    0m0.000s
sys 0m0.000s
$

Further supporting evidence that the new process does not actually run until the previous process is done can be seen in strace output:
strace -f -tt -o forever.strace bash -c ./forever.sh

In the output, we see the original process has PID 6929.  We can see the fork() call (actually clone()), which returns a new PID of 6930.  At this point there are 2 PIDs, but only 6929 is currently running:

6929  12:11:01.031398 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f2f83ac49d0) = 6930
6929  12:11:01.031484 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
6929  12:11:01.031531 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
6929  12:11:01.031577 rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
6929  12:11:01.031608 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
6929  12:11:01.031636 rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
6929  12:11:01.031665 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
6929  12:11:01.031692 rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
6929  12:11:01.031726 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
6929  12:11:01.031757 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
6929  12:11:01.031803 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
6929  12:11:01.031841 read(255, "", 4)  = 0
6929  12:11:01.031907 exit_group(0)     = ?
6930  12:11:01.032016 close(255)        = 0
6930  12:11:01.032052 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0

Full strace output here.
We can see that 6930 does not issue any system calls until 6929 is completely done.  It is reasonable to assume that this means 6930 does not run at all until 6929 is done.  The perf utility would be the ultimate way to prove this.