Ordering an array of negatives, zero and positives integers with one iteration

C, 92
This could probably be reduced by at least 10 bytes; there are many expressions going to waste.
The first argument should point to the beginning of the array; the second should point after the end of the array.
*x;f(b,e)int*b,*e;{for(x=b;x<e;x++)*x>0&&--e-x?*x--^=*e^=*x^=*e:*x<0?b-x?*x^=*b=*x:0,b++:0;}

Ungolfed with random test generator:
*x;
f(b,e)int*b,*e;{
    for(x=b;x<e;x++) {
        if(*x<0) {
            if(b == x)
                b++;
            else
                *b++ = *x, *x=0;
        } else if(*x>0 && x != --e) {
            *x^=*e^=*x^=*e;
            x--;
        }
    }
}

int main()
{
    int a[999];
    srand(time(0));
    int n = rand() % 50;
    int i;
    for(i = 0; i < n; i++) printf("%d ", a[i] = rand() % 9 - 4);
    f(a, a+n);
    puts("");
    for(i = 0; i < n; i++) printf("%d ", a[i]);
    return 0;
}


Bash (22)

read X;printf %d\\n $X  (thanks to manatwork but without literal NL)

30 read -aX;printf "%d\n" ${X[*]}
26 read X;echo -e ${X// /\n}
28 printf "%d\n" $(</dev/stdin)
27 printf "%d\n" $(</dev/fd/0)
26 printf %d\n $(</dev/fd/0)
23 read X;printf "%d\n" $X


C, 358 bytes
(There are only three lines of code, but I've broken up line 3 for legibility)
#define x putchar
#define y random()
c,n;main(){char*s[26]={"QS","HNV","FVX","EFSX","DRW","CDGR","FHTV","BGJY","KOU","HKNU",
"IJLM","KO","KN","BJM","ILP","OO","AW","EFT","ADWZ","GRY","IJY","BCG","ESQ","CDZ","HTU",
"SX"};while((c=getchar())>0){if(y%10>0&&x(c))continue;if(isalpha(c)&&y%3<1){n=(c&31)-1;
x(s[n][y%strlen(s[n])]|(c&32));continue;}if (y&1)x(x(c));}}

The array of strings at the beginning lists the possible adjacent keys for each letter of the alphabet. I had to double up the "O" (adjacent to "P") to avoid calculating random()%1 when selecting a shifted character.
Test run:
$ echo "This is some correct text. It is too correct. Please un-correctify it." |./a.out
This is some  cofrect teext. It is too correct.. Plleaase un-correctify it..

Update:
Here's an expanded and commented version of the same source code:
#include <stdio.h>
#include <string.h>
/* ^^ These should be included, but the code compiles without them */

int c,n;

void main() {

  /* Adjacent keys for each letter of the alphabet (A, B, C, ..., Z): */
  char *s[26] = { "QS","HNV","FVX","EFSX","DRW","CDGR","FHTV","BGJY","KOU","HKNU",
                  "IJLM","KO","KN","BJM","ILP","OO","AW","EFT","ADWZ","GRY","IJY",
                  "BCG","ESQ","CDZ","HTU","SX" };

  /* Fetch input until null character or EOF reached */
  while ((c=getchar())>0) {

    /* For 90% of the time, just echo the character unchanged */
    if (random()%10>0 && putchar(c)) continue;

    /* If it's a letter of the alphabet, shift with 33% probability */
    if (isalpha(c) && random()%3<1) {
      /* Calculate offset to adjacent keys data */
      n=(c&31)-1;
      /* Choose a random adjacent key, and change to lower case if needed */
      putchar(s[n][random()%strlen(s[n])]|(c&32));
      continue;
    }

    /* If we reach this point, either we didn't fetch an alphabet character, or   */
    /* we did but chose not to shift it. Either way, we now need to either repeat */
    /* the character or delete it, with 50% probability for each. */

    /* This repeats the character by printing the return value from putchar() */
    if (random()&1) putchar(putchar(c));

    /* To delete the character, we don't have to do anything. */
  }
}


win a virtual fencing match (against your fellow stack exchangers)

Python

En garde!

My warrior combines unpredictability with a keen eye for weakness in his opponent's stance.  He's pretty confident he'll be able to dispose of aggressive foes but his trainer (me) may have failed to anticipate certain scenarios or, perhaps more worrying, may have misinterpreted the rules (bugs!!).

Anyway I'm new so hopefully this is an ok format for the code:

from random import choice, random

def cleverly_pick_move(me_allowed,op_allowed,opp_last_move=None) :
    """ Behold the genius you're up against!
    Pretty much everything else is just flavour text or match rules
    so you'll probably only want to read this...
    """
    heights = ['head','chest','feet']
    rand_choice = lambda a,h : {'type':choice([t for t in a if a[t]]),
                                'height':choice(h)}

    if opp_last_move is None or feeling_like_a_lucky_punk():
        return rand_choice(me_allowed,heights)

    if sum(1 for x in op_allowed if op_allowed[x]) == 3 :
        for i in op_allowed:
            if not op_allowed[i] :
                weakness = i
                break
        return {'type':exploit_weakness(weakness,me_allowed),
                'height':choice(heights)}
    return rand_choice(me_allowed,heights)

def exploit_weakness(weakness,me_allowed) :
    moves = ['attack','parry','lunge','block']
    for i,move in enumerate(moves) :
        if move == weakness :
            if me_allowed[moves[(i+1) % 4]] :
                return moves[(i+1) % 4]
            break
    if me_allowed[weakness] :
        return weakness
    return choice([x for x in me_allowed if me_allowed[x]])

def feeling_like_a_lucky_punk() :
    return random() > 0.8

def main():

    this_round = 1
    opp_last_move = None
    score   = {'myself':0, 'the blaggard':0}
    quips   = ['blaggard', 'fool', 'scum', 'raggamuffin']
    adverbs = ['deftly', 'skillfully', 'gracefully', 'clumsily']

    me_allowed = {'attack':True,'block':True,'lunge':True,'parry':True}
    op_allowed = {'attack':True,'block':True,'lunge':True,'parry':True}

    while (this_round <= 50 and
           all([points < 3 for points in score.values()])) :

        if this_round == 1 :
            move = cleverly_pick_move(me_allowed,op_allowed)
        else:
            move = cleverly_pick_move(me_allowed,op_allowed,
                                      opp_last_move=opp_last_move)

        print "Our hero %s %ss at the %s's %s" % (
            choice(adverbs),
            move['type'],
            choice(quips),
            move['height']
            )
        print "We await the %s's response..." % choice(quips)
        print "Our hero's move: " + (move['type'][0]+move['height'][0]).upper()

        opp_move = parse_move(raw_input("Opponent's move: "))

        outcome,me_allowed,op_allowed = get_outcome(move,opp_move,me_allowed,
                                                    op_allowed)
        if outcome == 'WIN' :
            print "Our hero pulls off an excellent round!"
            score['myself'] += 1
        elif outcome == 'LOSE' :
            print "Never before have we seen such blatant cheating!"
            score['the blaggard'] += 1
        else :
            print "Our hero is clearly toying with his opponent as he allows \
a drawn round."

        print ("""The score after round %d:\nOur hero:\t%d\nHis opponent:\t%d"""
                % (this_round, score['myself'], score['the blaggard']))
        opp_last_move = opp_move
        this_round += 1

    print "Match over, surely the victory is mine!"
    print """Final score:\n
             Our hero:\t%d\nOpponent:\t%d""" % (score['myself'],
                                                score['the blaggard'])

    if score['myself'] > score['the blaggard'] :
        print "My victory was inevitable!"
    elif score['myself'] == score['the blaggard'] :
        print "An even match! Huzzar!"
    else :
        print ""
    return

def reset_allowed(dictionary) :
    return dict((x,True) for x in dictionary)

def get_outcome(mymove,opmove,me_allowed,op_allowed) :
    result = ''

    if not me_allowed[mymove['type']] :
        print "Whoops, I forgot I couldn't do that..."
        result = 'LOSE'

    if not op_allowed[opmove['type']] :
        print "Haha! What a clutz!"
        result = 'WIN'

    if mymove['height'] != opmove['height'] :
        print "The combatants flail at each other with little effect!"
        print "They'll have to try something else next round!"
        result = 'DRAW'

    if mymove['type'] == opmove['type'] :
        if mymove['type'] in ['attack','lunge']:
            print "The combatants' blades clash dramatically!"
        else :
            print "Both combatants take a moment to practice their \
defensive stance..."
        result = 'DRAW'

    if result :
        me_allowed, op_allowed = (reset_allowed(me_allowed),
                                  reset_allowed(op_allowed))
        if mymove['height'] != opmove['height'] :
            me_allowed[mymove['type']] = op_allowed[opmove['type']] = False
        return (result, me_allowed,op_allowed)
    else :
        return compare_attacks(mymove,opmove,me_allowed,op_allowed)

def compare_attacks(mymove,opmove,me_allowed,op_allowed) :
    """
    0 A > P 1
     ^  x  v
    3 B < L 2
    """
    print "Our hero %ss, his opponent %ss!" % (mymove['type'],opmove['type'])

    move_val = {'attack':0,'parry':1,'lunge':2,'block':3}
    result_num = (move_val[opmove['type']] - move_val[mymove['type']]) % 4
    results = ['DRAW','WIN','DRAW','LOSE']

    me_allowed, op_allowed = (reset_allowed(me_allowed),
                              reset_allowed(op_allowed))
    if result_num == 1 :
        print "Our hero easily outwits his foe! *Huge cheers from crowd*"
        return ('WIN',me_allowed,op_allowed)
    elif result_num == 3 :
        print "Our hero graciously allows his opponent a charity point.\
*A torrent of boos from the crowd*"
        return ('LOSE',me_allowed,op_allowed)
    else:
        # Combatants drew and will have their moves restricted next round.
        if mymove['type'] in ['attack','parry'] :
            me_allowed['attack'] = me_allowed['lunge'] = False
            me_allowed['parry']  = me_allowed['block'] = True
            op_allowed['parry']  = op_allowed['block'] = False
            op_allowed['attack'] = op_allowed['lunge'] = True
        else :
            me_allowed['parry']  = me_allowed['block'] = False
            me_allowed['attack'] = me_allowed['lunge'] = True
            op_allowed['attack'] = me_allowed['lunge'] = False
            op_allowed['parry']  = op_allowed['block'] = True
        return ('DRAW',me_allowed,op_allowed)

def parse_move(move_string) :
    m_types = {'A':'attack','B':'block','L':'lunge','P':'parry'}
    m_heights = {'C':'chest','H':'head','F':'feet'}

    move_string = move_string.strip().upper()
    if not move_string :
        print "Couldn't understand your input: %s" % move_string
        return parse_move(raw_input("Opponent's move: "))

    if move_string[0] not in m_types :
        move_string = move_string[::-1]

    try :
        move = {'type':m_types[move_string[0]],
                'height':m_heights[move_string[1]]}
        return move
    except KeyError :
        print "Couldn't understand your input: %s" % move_string
        return parse_move(raw_input("Opponent's move: "))

if __name__ == '__main__' :
    main()


Dim Variables implicitly as variants

VB.NET is capable of assuming object type at compile time - with numerics being dimmed into 32-bit spaces this means that

Module M
Sub Main
Dim i As Byte
Dim j As Short
Dim k As Integer
Dim l As Long
For i=128To 2^8-1 Step 64
For j=2^7*i To 2^15-1 Step 64^2
For k=2^16*j To 2^31-1 Step 2^24
For l=2^31*k To 2^62-1 Step 2^48
Console.Write(i & j & k & l)
Next
Next
Next
Next
End Sub
End Module

Try it online! (266 bytes)

May be trimmed down by dimming i, j, k as variants, (note that because the default numeric type of a variant is a 32 Bit Integer l must still be dimmed as a Long as it shall hold a 64 bit value)

Module M
Sub Main
Dim i,j,k,l As Long
For i=128To 2^8-1 Step 64
For j=2^7*i To 2^15-1 Step 64^2
For k=2^16*j To 2^31-1 Step 2^24
For l=2^31*k To 2^62-1 Step 2^48
Console.Write(i &j &k &l)
Next
Next
Next
Next
End Sub
End Module

Try it online! (226 bytes)

or even further to 218  bytes by combining Next statements

Module M
Sub Main
Dim i,j,k,l As Long
For i=128To 2^8-1 Step 64
For j=2^7*i To 2^15-1 Step 64^2
For k=2^16*j To 2^31-1 Step 8^8
For l=2^31*k To 2^62-1 Step 2^48
Console.Write(i &j &k &l)
Next l,k,j,i
End Sub
End Module

Try it online! (218 bytes)
For a total savings of 40 bytes without impacting the output.


MATL, 4 bytes
15XO

Try it online!
Explanation
Built-in function: date string conversion with automatic detection of input format and with output format 15, which corresponds to 'HH:MM'. This is equivalent to @StewieGriffin's Octave answer.


Jelly, 14 bytes
⁼þµḤ+Ṛị“/\X#”Y

A monadic link taking a number and returning a list of characters; or a full program printing the result.
Try it online! or see [1-12] in one go.
How?
⁼þµḤ+Ṛị“/\X#”Y - Link: number, n
 þ             - outer product (implicit range build on left AND right from n) with:
⁼              -   is equal (yields a table of 0s except the main diagonal is 1s)
  µ            - monadic chain separation, call that I
   Ḥ           - double (change all the 1s to 2s)
     Ṛ         - reverse I (a table of 0s with 1s as the anti-diagonal)
    +          - add (vectorises to make a table of zeros with 2s on the diagonal,
               -      1s on the anti-diagonal and, if the meet, a 3 at the centre)
       “/\X#”  - literal list of characters ['/','\','X','#']
      ị        - index into (replaces... 1:'/'; 2:'\'; 3:'X'; and 0:'#')
             Y - join with newline characters
               - as a full program: implicit print


Output integers in negative order, increase the maximum integer everytime

05AB1E, 6 bytes

L€LíJJ

Try it online!

Explanation

Example input 4

L       # range [1 ... input]
        # STACK: [1,2,3,4]
 €L     # map: range
        # STACK: [[1],[1,2],[1,2,3],[1,2,3,4]]
   í    # reverse each
        # STACK: [[1],[2,1],[3,2,1],[4,3,2,1]]
    J   # join inner lists
        # STACK: ['1','21','321','4321']
     J  # join list
        # OUTPUT: 1213214321


Okay, it's been a while since I wrote any C but I'll give it a go:

m,y,*q="%d/%d/%d";
main(d){
scanf(q,&d,&m,&y);
++d>30+(m+(m>7))%2-(m^2?0:2-!(y%4))?(m+=d=1)>12?y+=m=1:0:0;
printf(q,d,m,y);}

120 characters.
With a bit of formatting(not that it makes it any more readable any more...):

m,y,*q="%d/%d/%d";
main(d)
{
    scanf(q,&d,&m,&y);
    ++d>30+(m+(m>7))%2-(m^2?0:2-!(y%4))?(m+=d=1)>12?y+=m=1:0:0;
    printf(q,d,m,y);
}

The compiler throws out warnings like nobody's business, but it works.

I'm not sure I can get it any smaller than this now without stealing a couple of tricks from Griffin. With those tricks I can get to 116 characters:

m,y,*q="%d/%d/%d";
main(d){
scanf(q,&d,&m,&y);
printf(q,d,m,++d>30+(m>7^m&1)-(m^2?0:2-!(y%4))?(m+=d=1)>12?y+=m=1:y:y);}


Python, 30 bytes

lambda s,l:min(map(l.count,s))

Try it online!


The jumping digits to letters transformation

Python 3, 60

i=b=0
for c in input():b and print(chr(97+i%26));b^=c<1;i+=c

Takes a list of numbers and prints the chars on separate lines.

Basically just follows the instructions. The index is i and the should_write flag is b. The expression b and short-circuits to print only when b is true.


Javascript (ES6), 121 120 119 bytes
(y,s,d)=>[(d=new Date(y,m=s[2]=='s'?1:'r.sune0oapti'.search(s[4]||0),23+d-'343322110012'[m])).getDate(),d.getMonth()+1]

Format for the sign of the zodiac is either:

all lower case except the first character
all lower case

Test cases

let f =
(y,s,d)=>[(d=new Date(y,m=s[2]=='s'?1:'r.sune0oapti'.search(s[4]||0),23+d-'343322110012'[m])).getDate(),d.getMonth()+1]

console.log(f(1791, 'Capricorn',  5)); // -->  (26, 12)
console.log(f(1815, 'Scorpio',   10)); // -->  ( 2, 11)
console.log(f(1860, 'Pisces',    10)); // -->  (29,  2)
console.log(f(1890, 'Pisces',    20)); // -->  (11,  3)
console.log(f(1900, 'Pisces',    17)); // -->  ( 8,  3)
console.log(f(1938, 'Capricorn', 20)); // -->  (10,  1)
console.log(f(2000, 'Pisces',    17)); // -->  ( 7,  3)


05AB1E, 16 14 13 11 10 bytes
∞×0KJ‚€{íË

Takes the medals input in the order [bronze, silver, gold] as first input, and reputation as second input.
-1 byte thanks to @Grimy.
Try it online or verify all test cases.
Explanation:

∞           # Push an infinite positive list: [1,2,3,...]
 ×          # Repeat the values in the (implicit) input-list that many times as string
            # (since the input-list contains just 3 values, the rest of the infinite
            #  list is ignored)
  0K        # Remove all 0s (so all "0", "00" and "000")
    J       # Join the strings in the list together
     ‚      # Pair this string with the (implicit) second input
      €{í   # Sort the digits in both strings in descending order
         Ë  # And check if both are now equal
            # (after which the result is output implicitly as result)


Bookkeeping for the Sex Bob-ombs (check if a running sum ever gets too low)

Haskell, 22 bytes

f t=all(>=t).scanl(+)0

Usage: f (-5) [4,-3,-6] which outputs True.

Make a list of sub-totals and check if all elements are >= t.

Edit: Bugfix for empty list and positive ts


Take advantage of string formatting
One of the easiest ways to create a quine is to define a string, then put the string inside itself with string formatting.

s='s=%r;print s%%s';print s%s

So in this example Python quine, we declare a string with the first part equal to whatever is before the string s=, then we allow for the string to be inserted with formatting with %r, and finally we put what comes after the string to print and format it. The trailing newline is because print prints a trailing newline.
So the template is really this, in Python:
<A>'<A>%r<B>'<B>

To expand the existing quine with more code:
<more A>s='<more A>s=%r;print s%%s<more B>';print s%s<more B>


Underload, 4 bytes
N=1: Try it online.
 ()S

N=2: Try it online.
 ( ()S)S

N=3: Try it online.
 ( ( ()S)S)S

Explanation:
Self-explanatory, but I add it anyway.

(...)S prints anything between the parenthesis to STDOUT
The space before it is a no-op to make the byte-count even and comply to the rules of the challenge.


I give you Nth permutation, you give me N

Python 2, 69 bytes

Try it online

from itertools import*
lambda S:sorted(set(permutations(S))).index(S)


Reduce html to n characters while keeping the formatting

This answer is no longer valid with the latest rule.

Javascript (ES6) 94 91

f=(s,l)=>s.split(/(<[^>]+>)/).map(x=>x[0]=='<'?x:[l-->0?y:''for(y of x)].join('')).join('')

f('more complicated', 7);
// 'more co'

Ungolfed:

f=(s,l)=>
    s.split(/(<[^>]+>)/). // split string s by <*>, capture group is spliced into the array
    map(x=> // map function to every item in the array
        x[0]=='<'? // if first character is a <
            x // don't modify the string
        : // else
            [ // array comprehension
                for(y of x) // for every character y in x
                    l-->0? // if l > 0 (and decrement l)
                        y // character y
                    : // else
                        '' // empty string
            ].join('') // join characters in array
        ).
    join('') // join all strings in array


Generate unique non-sequential string of length n without memory of previously generated strings

C(++) - we don't need no friggin' primes

The problem is to generate a different permutation of n characters taken from an a size alphabet for each seed value.

There are an such permutations, and they can be represented as values of a n digits number in base a.

The number of bits necessary to represent all these values is log2(an), rounded up.

We have at most 8 characters per code, and the alphabet contains at most 256 characters, so a 64 bits word is just what we need to cover all possible codes with all possible alphabets.

Now we just need something that maps all possible 232 seed values to the possible range of code values (and looks random enough).

I settled for a basic 32 bits reversal, which gives highest variability for low seed values.

If the possible codes range is smaller than the seed's, there will be duplicates anyway, and the codes will be like the n first digits of a greater number.

If the 232 seed values are not enough to cover all code values, the scrambled seed is extended to the smallest power of two inferior to code max value, by injecting 0s in the lower bits.

This should spread the range of code values while guaranteeing no duplicates.
However, the last digit will have a slightly lower frequency due to the rounding to a power of 2.
If alphabet size is much greater than 2, the difference will be hardly noticeable.

The scrambled seed is then converted as a number in base a, the digits being the symbols of the alphabet.

A few (pseudo) random thoughts

The big weakness of this method is that it won't work well with alphabets whose size is a power of two. The apparent randomness is due to the non-integer number of bits needed to encode a digit.

On second thought maybe we do need some friggin primes after all...

At any rate, even the most magnificent pseudo-random repartition is useless as far as data protection is concerned, since the encryption method is stateless and could be easily cracked by brute-force.

The code

I used the excellent bit shuffling generator of Mr. Jasper Neumann to produce the bit reverser, though other solutions are possible.

I compiled with g++4.8 under MinGW/Win7, but the code is nothing but glorified C and should work with any C++ compiler.

#include <cstdlib> // atoi
#include <cstdio>  // printf
#include <cmath>   // pow

#define Alphabet "ABCDEFGHKLMNOPQRSTUVWXYZ0123456789"
#define Length 8

unsigned bit_permute_step_simple(unsigned x, unsigned m, unsigned shift)
{
  return ((x & m) << shift) | ((x >> shift) & m);
}

unsigned shuffle (unsigned x)
{
    x = bit_permute_step_simple(x, 0x55555555, 1);  // Bit index complement 0
    x = bit_permute_step_simple(x, 0x33333333, 2);  // Bit index complement 1
    x = bit_permute_step_simple(x, 0x0f0f0f0f, 4);  // Bit index complement 2
    x = bit_permute_step_simple(x, 0x00ff00ff, 8);  // Bit index complement 3
    x = bit_permute_step_simple(x, 0x0000ffff, 16);  // Bit index complement 4
    return x;
}

#define Base (sizeof(Alphabet)-1)
typedef char Code[Length+1];

void gen_code (unsigned seed, Code code)
{
    // shuffle seed bits (the inversion is to avoid zero value for seed = 0)
    unsigned long long scrambled = shuffle(~seed);

    // if maximal code size is less than seed max value, there will be duplicates anyway
    int extra_bits = floor(Length * log(Base)/log(2)) - 32;
    if (extra_bits > 0) scrambled <<= extra_bits;

    // basic base conversion.
    // The last code digit might have a slightly lower frequency than others
    int i;
    for (i = 0 ; i != Length ; i++)
    {
        int digit = scrambled % Base;
        code[i] = Alphabet[digit];
        scrambled /= Base;
    }
    code[i] = '\0';
}

int main (int argc, char * argv[])
{
    if (argc != 2) exit(-1);
    unsigned seedm = atoi(argv[1]);
    Code code;

    for (unsigned seed = 0 ; seed != seedm ; seed++)
    {
        gen_code (seed, code);
        printf ("code (%u) = %s\n", seed, code);
    }

    return 0;
}

The main() prints a specified number of codes for consecutive seeds.

Sample output:

n=8, alphabet = ABCDEFGHKLMNOPQRSTUVWXYZ0123456789

code (0) = 215GVK7B
code (1) = MPPT46CX
code (2) = 4AF2E28Y
code (3) = GLGGAS6W
code (4) = U3MSPN2Y
code (5) = CR42Y97H
code (6) = WCWB943L
code (7) = CZW2XAAB
code (8) = UBHMSV6C
code (9) = CZ0W1HCY
code (10) = WMS5BD8Z
code (11) = 8UTL725X
code (12) = MDYVMY1Z
code (13) = 40F6VM7K
code (14) = OO7E6F3M
code (15) = U5L28BA5
code (16) = 08GMUH56
code (17) = KW0W35AS
code (18) = 2HS5D16T
code (19) = ESTL9Q4R

n=4, alphabet = ABCDE

code (0) = AEBD
code (1) = CEAE
code (2) = BEDD
code (3) = DECE
code (4) = DBAB
code (5) = ACEB
code (6) = EBCB
code (7) = BCBC
code (8) = ECDE
code (9) = BDCA
code (10) = ADAA
code (11) = CDEA
code (12) = CACC
code (13) = EABD
code (14) = DAEC
code (15) = ABDD
code (16) = CDCB
code (17) = EDBC
code (18) = DDEB
code (19) = AEDC


Retina, 33 29 bytes

T`d`w
)`\d
$0.
_

p.{7}(..)?P

To run the code from a single file, use the -s flag.

Should be easily beatable by something like Perl where the expansion of digits into strings of spaces (or other characters) doesn't take up 17 bytes.

The output is positive (truthy) if there is a possible capture and zero (falsy) if there isn't.

Explanation

T`d`w
)`\d
$0.

This is a loop of two stages. The first one is a transliteration stage which decrements each digit, and turns zeroes to underscores. Why? Because d and w expand to the following two lines:

0123456789
_0123456789AB...YZab...yz

If the target set of a transliteration stage is longer than the source set, the extraneous characters are ignored, hence the decrementing behaviour (honestly, it was just luck that I decided to put the underscore in front of the digits when expanding the w character class).

Then the second stage is a replacement, which appends a . to each digit. That means that for each digit n, n periods are added before that digit is turned into an underscore.

_
<empty>

This just gets rid of the underscores.

p.{7}(..)?P

Finally, we find the matches. Since we're ignoring en passant, captures are only possible if there is a p and then a P diagonally below it. In the linear string, this simply means that there must be 7 or 9 characters between the two pawns. This matched with .{7}(..)? (i.e. match 7 characters and then, optionally, match another two).

Such a match stage returns the number of matches it found.


Write a Vim command that reads as English text

Score 60

:s/foo/bar/incerepellingliceingreeceIgrillripeninggreenpepperinniceice

  since repelling lice in Greece I grill ripening green pepper in nice ice

You can repeat flags arbitrarily in the :s command so this can get as long as you care to come up with a sentence/phrase/word using only the letters c,e,g,i,I,n,p,l,r and starting with an s.


Jelly, 54 53 bytes

J×$ÆrAƑƇ«⁹;⁹*€J{ḋ⁸ŻṀ
Œcz€0ḢṂç@I0;ⱮFƲƲ€ṚṁL’R€Ɗ;+Ṁ¥¥ƒ0Ṁ

Try it online!

A monadic link that takes as its argument the list of bowls from top to bottom in the format [[b1_radius, b1_coef1, ...], [b2_radius, b2_coef1, ...]] and returns the y position of the bottom of the top bowl.

Now correctly handles bowls which meet at places other than the minimal radius.

Explanation

Helper link: takes as left argument l the differences in coefficients of the polynomials representing the bowls from 1 upwards, and its right argument r the minimum radius; returns the maximum y value where the two bowls meet

  $                   | Following as a monad:
J                     | - Sequence from 1..<len(l)>
 ×                    | - Multiply (by l)
   Ær                 | Roots of polynomial
     AƑƇ              | Keep only those invariant when passed through absolute function (excludes negative, imaginary and complex numbers)
        «⁹            | Min of these filtered roots and r
          ;⁹          | Concatenate r to the list
            *€        | Each root/radius to the power of:
              J{      | - Sequence from 1..<len(l)>
                ḋ⁸    | Dot product with l
                  Ż   | Prepend zero
                   Ṁ  | Maximum

Main link, takes a bowl pile as its argument and returns y value of base of top bowl

Œc                               | Combinations length 2
  z€0                            | Transpose each using 0 as a filler
               Ʋ€                | For each one, do the following as a monad:
     Ḣ                           | - Take the head (the radii)
      Ṃ                          | - Minimum
       ç@     Ʋ                  | - Call the helper link with this (min radius) as right argument and the following as left argument:
         I                       |   - Increments (difference between second and first polynomial for each coefficient)
          0;Ɱ                    |   - Prepend each with a zero (odd coefficients are all zero)
             F                   |   - Flatten
                 Ṛ               | Reverse
                  ṁ    Ɗ         | Mould to the following as a monad:
                   L             | Length
                    ’            | Decrease by 1
                     R€          | Range of each (e.g. [1],[1,2],[1,2,3],[1,2,3,4]
                            ¥ƒ0  | Reduce using the following as a dyad and starting with 0
                        ;  ¥     | - Concatenate the following as a dyad
                         +       |   - Add
                          Ṁ      |   - Take the maximum
                               Ṁ | Finally take the overall maximum

Python reference

Finally, here’s a TIO version of the Python reference that @pasbi included for the main problem.  It reads from stdin.


shortest progam to scan a line and print it using befunge!

Befunge-98, 4

~,#@

Try it online!

It works because ~ acts like r when there is no more input (credit to David Holderness for finding this in the funge-98 spec)


Which were the latest 13 consecutive years with the most friday 13. in total?

Wolfram Language 171 bytes
Any modern 13-year interval will have between 20 and 24 Friday the 13ths.
SortBy[{{#[[1,1]],#[[-1,1]]},Total[#[[2]]&/@#]}&/@Partition[Table[{y,Length@Cases[DateObject@{y,m,13}~Table~{m,12},x_/;DayName@x==Friday]},{y,1900,2019}],13,1],Last][[-1]]

* {{2007, 2019}, 24} *)

The above generates all the Friday the 13ths for each year between 1900 and 2019, partitions the results into intervals of 13 years, and finds the total for each such interval.  The interval of 2007-2019 has 24, the maximum number of Friday the 13ths.
If 2019 cannot be used, the correct answer will be the interval of 200-2018, which also contains 24 Friday the 13ths.


There is no 'right' way to golf. You've done well, and the process you've used is fairly standard. Making the program into one statement isn't usually a requirement though.

If it helps, here's how I would approach golfing down your program...

In the hashing function, the for statement can be replaced with a sum:

def h(s):
    r = 0
    r = sum(ord(s[i]) << (i * len(s)) for i in range(len(s)))
    return r

This can then be defined as a lambda function:

h = lambda s: sum(ord(s[i]) << (i * len(s)) for i in range(len(s)))

And now we remove unnecessary spaces and brackets:

h=lambda s:sum(ord(s[i])<<i*len(s)for i in range(len(s)))

As Sp3000 pointed out, this can be shortened further with enumerate:

h=lambda s:sum(ord(x)<<i*len(s)for i,x in enumerate(s))

Moving on to the test function, we merge its first two lines:

def test():
    sums = list(map(h, permutations(sample(ascii_lowercase, 9))))
    ...

Since both functions are only used once, we can move everything inline:

sums = list(map(lambda s:sum(ord(x)<<i*len(s)for i,x in enumerate(s)), permutations(sample(ascii_lowercase, 9))))
...

This is shorter as a list comprehension:

sums = [sum(ord(x)<<i*len(s)for i,x in enumerate(s)) for s in permutations(sample(ascii_lowercase, 9))]

Next, we give it a shorter name and remove unnecessary spaces again:

x=[sum(ord(x)<<i*len(s)for i,x in enumerate(s))for s in permutations(sample(ascii_lowercase,9))]

The if statement can be moved inside the print function:

print('unique...' if len(set(x)) == len(x) else 'duplicate...')

However, it's usually shorter to use and/or:

print(len(set(x)) == len(x) and 'unique...' or 'duplicate...')

Since len(x) doesn't change, we can calculate and hardcode its value:

print(len(set(x)) == 362880 and 'unique...' or 'duplicate...')

After removing unnecessary spaces and switching around the comparison, we get:

print(len(set(x))<362880and'duplicate...'or'unique...')

This lets us move everything into one statement:

print(len(set([sum(ord(x)<<i*len(s)for i,x in enumerate(s))for s in permutations(sample(ascii_lowercase,9))]))<362880and'duplicate...'or'unique...')

And now we can use a set comprehension instead:

print(len({sum(ord(x)<<i*len(s)for i,x in enumerate(s))for s in permutations(sample(ascii_lowercase,9))})<362880and'duplicate...'or'unique...')

The result is 210 bytes, excluding imports. The next step would probably be to golf down the imports or the long strings.


Python 2, 29 bytes

lambda n:1j**(n/2)*(1+n%2*1j)

Returns the coordinates as a complex number.


Ruby, 308 303
puts a='Work It|Make It|Do It|Makes Us|Harder|Better|Faster|Stronger|More Than|Hour|Our|Never|Ever|After|Work Is|Over

'.split(?|),a
56.times{|i|puts a[j=i%4/2*4+i%4*2]+' '+a[j+4]+[[' ',', ','
']["l4yq62lhgnizb0kfu".to_i(36)/3**i%3]+a[j+1]+' ',''][i%51/48]+[a[j+5],['','Af-'][i%44/32]][7619655>>i-28&1]}

Algorithm
Song intro: Take 16 tokens, and print them twice (last one bears an extra newline)
Verses: Riffle the tokens together to make the verses, 4 tokens per line, in the following order:
 0  4  1  5
 2  6  3  7
 8 12  9 13
10 14 11 15

In some lines, the last token is omitted, or exchanged for Af-. These lines are noted with a 1 bit in the magic number 0x744447=7619655.
In three lines, the penultimate token is also omitted, those where i%51/48==1
The punctuation in the middle of the line can be one of ' ' ', ' '\n'. These are encoded in the number 02220010000200100010001001110010001000100010001000100010 (base 3) = "l4yq62lhgnizb0kfu" (base 36.)
With comments
puts a='Work It|Make It|Do It|Makes Us|Harder|Better|Faster|Stronger|More Than|Hour|Our|Never|Ever|After|Work Is|Over

'.split(?|),a                                                    #Set up array containing all 16 tokens, print it, and print it again (note newlines at end of last token.)

56.times{|i|                                                     #14 verses, 4 lines each

puts a[j=i%4/2*4+i%4*2]+                                         #expression cycles through 0,2,8,10. Print the first token on the line.

' '+a[j+4]+                                                      #print a space, and the second token on the line.

[[' ',', ','
']["l4yq62lhgnizb0kfu".to_i(36)/3**i%3]+a[j+1]+' ',''][i%51/48]+ #if i%51/48==1,print nothing. Otherwise print the 3rd token, followed by a space, and preceded by one of ' ' or ', ' or '\n'

[a[j+5],['','Af-'][i%44/32]][7619655>>i-28&1]                    #if 7619655>>i-28&1==0 print the fourth token. Otherwise print either nothing or Af- depending on the value of i%44/32

}


Mathematica, 9 bytes

Fibonacci

Yes, this built-in function supports negative numbers.


Jelly, 5 bytes
ṙJṚæ.

Try it online!
Explanation
Firstly:
$$\left[\begin{matrix}
\vec{v}_1 \\
\vec{v}_2 \\
\vec{v}_3 \\
\vec{v}_4 \\
\end{matrix}\right] \vec{x} =
\left[\begin{matrix}
\vec{v}_1 \cdot \vec{x} \\
\vec{v}_2 \cdot \vec{x} \\
\vec{v}_3 \cdot \vec{x} \\
\vec{v}_4 \cdot \vec{x} \\
\end{matrix}\right]$$
where \$\vec{v}_k\$ are row vectors and \$x\$ is a column vector.
This demonstrates that matrix multiplication is just dot product between rows and columns.
Then, \$\vec{v}_1\$ is actually \$\vec{v}\$ rotated \$0\$ to the right, and \$\vec{v}_k\$ is \$\vec{v}\$ rotated \$k-1\$ to the right, etc.
From another angle, \$\vec{v}_1\$ is \$\vec{v}\$ rotated \$n\$ to the left, and \$\vec{v}_n\$ is \$\vec{v}\$ rotated \$1\$ to the left, etc.
How it works
ṙJṚæ.   input: z (a list of length n)
ṙJ      [rot(z,1), rot(z,2), ..., rot(z,n)] (to the left)
  Ṛ     [rot(z,n), ..., rot(z,2), rot(z,1)]
   æ.   [rot(z,n).z , ..., rot(z,2).z , rot(z,1).z] (dot product)


J, 27 23 bytes

-4 bytes thanks to Bubbler!

;@(<@({.\);.1~1,2</\}.)

Try it online!

CLK is the left argument; D is the right one. When CLK doesn't start with 01, the starting bits are the same as the first bit of D.

                       ;.1  - cut
                          ] - the right argument (D)
   (          )             - where
         2 /\               - the previous element
             [              - of the left argument (CLK)
          <                 - is smaller than the next one
       }.                   - drop
      1                     - the first item
    1,                      - prepend with 1 (for cutting)
               (     )      - for each cut group
                   $        - make a list
                #           - of the same length as the group
                    {.      - with elements same as the first one
                 <@         - and box the list
  ;                         - unbox the sublists and flatten them
[:                          - function composition

K (oK), 27  23bytes

-4 bytes thanks to ngn!

{,/&\'|\'(0,&1_>':x)_y}

Try it online!


1: 96 Characters, Haskell

abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXY:z=['`'..'z']++'A':['C'..'Y']
main=putStr$z++z

Try it online!

I was feeling silly, and saw nothing forbidding the first entry starting with the exact same 50 characters as the initial string.

['`'..'z']++'A':['C'..'Y'] is an expression evaluating to the string of those characters, with a ` prepended.
The result is pattern matched on,
making the variable abcdefghijklmnopqrstuvwxyzACDEFGHIJKLMNOPQRSTUVWXY equal to '`', and z equal to the 50 characters.
main=putStr$z+z then does the actual output.


Codegolf the sequence of distance-3 Hamming Codewords (A075926)

Python 2, 98 97 bytes

-1 byte thanks to Mr. Xcoder

x=input()
l=[]
i=0
while len(l)<x:s=any(bin(i^n).count('1')<3for n in l);i+=s;l+=[i]*-~-s
print l

Try it online!

Straightforward implementation, using xor to calculate the hamming distance.
The inner loop is equivalent to :

if any(bin(i^n).count('1')<3 for n in l):
   i+=1
else:
   l.append(i)


This challenge is about recursion (Cops' thread)

Python 3, 65 bytes (Safe)

f=lambda n,a=3,b=0,c=6,d=6:n*[1]and[a+b]+f(n-1,c,d,2*c+d,2*a+3*b)

Try it online!

Another try in Python.

The sequence is "the number of ways to fill a 2-by-n board with dominoes in three colors, so that no two same-colored dominoes touch each other". Not on OEIS.

Let's say n=6. The board looks like:

######
######

and these are valid domino tilings in three colors (1-3 represent a color each):

123123 122331 212332 212121 113311
123123 133221 212112 212121 331133

but these are not (two same-colored dominoes are touching each other):

112323 332333 211113
112323 112311 233223

The sequence counts all possible domino tilings that satisfy the rules for each n.

Intended solution, 58 bytes

n=int(input());a=3;b=12
for _ in[0]*n:print(a);a,b=b,a*4+b

Try it online!

Unfortunately it looks like no one bothered to simplify the recurrence relation, which was clearly shown in the recursive code. Making a program with the given double recurrence as-is doesn't work since it's Python 3.


Distinguish English and Spanish with regular expressions

Any Language, 0.3677 (60.6064%, 1 byte)
a

No, I'm not joking. The single-character regular expression a successfully identifies Spanish words over English given your input files 60.6064% of the time, which makes it a valid submission.
Here's a complete, runnable Perl script that checks the percentage of this regular expression, assuming you've downloaded english.json and spanish.json into the same folder as the script.
#!/usr/bin/perl

use strict;
use warnings;
use 5.010;

my @english;
my @spanish;

my $fh;
open $fh, '<', 'english.json';
while (<$fh>) {
    push @english, $1 if /"(\w+)"/;
}
close $fh;

open $fh, '<', 'spanish.json';
while (<$fh>) {
    push @spanish, $1 if /"(\w+)"/;
}
close $fh;

my $correct = 0;
my $total = 0;

my $re = qr/a/;

for (@english) {
    $total++;
    $correct++ unless /$re/;
}
for (@spanish) {
    $total++;
    $correct++ if /$re/;
}

say "$correct / $total (@{[100*$correct/$total]}%)";


JavaScript (ES6), 270 246 221 bytes
Takes input in currying syntax (a)(d) where a is the attacking type as a string and d are the defending type(s) as an array of strings. The case doesn't matter.
Returns a standard multiplier as a float.

a=>d=>d.map(d=>r*='0124'["ijfkj{jjnjjJ[kefjiZj[jxnjni^YnEW]vfeziiz]okjZmniV{oZvjhjnmj[zrfijij[yVzej[jjejjhujkmjZkZ[fjiuznjjz~zjfRjbkjy".charCodeAt((i=g(d)*18+g(a))/3)>>i%3*2&3]/2,g=s=>parseInt(s,36)*64%97%54%21%18,r=1)&&r

Try it online! or check the whole chart
How?
The base-36 interpretation \$N\$ of a given Pokemon type string is converted to a coordinate \$C\$ in \$[0..17]\$ using the following minimal perfect hash function:
$$C=((((N\times64)\bmod97)\bmod54)\bmod21)\bmod18$$
The chart is rearranged using the new coordinates and encoded as a single string with 6 bits of payload data per character, using ASCII codes in the range \$[64..127]\$.
There are 2 bits per cell, so the length of the string is \$(18\times18\times2)/6=108\$ characters.
For the curious, here is the code that encodes the string.


Print the phrase "And she said, 'But that's his.'" using only the alphabet

Whitespace, 417 414 349 265 bytes

265 bytes thanks to Kevin Cruijssen

Try it online!

Explained:

[S S T  T   T   T   T   T   T   N
_Push_-63_'][S S T  T   T   T   S S S N
_Push_-53_.][S S S T    T   S T N
_Push_13_s][S S S T T   N
_Push_3_i][S S S T  S N
_Push_2_h][S S T    T   S S S T T   S N
_Push_-70_space][S T    S S T   T   N
_Copy_0-based_3rd_s][S T    S S T   T   S N
_Copy_0-based_6th_'][S S S T    T   T   S N
_Push_14_t][S S T   T   S T N
_Push_-5_a][S S S T S N
_Push_2_h][S T  S S T   S N
_Copy_0-based_2nd_t][S T    S S T   T   S N
_Copy_0-based_6th_space][S T    S S T   N
_Copy_0-based_1st_t][S S S T    T   T   T   N
_Push-15_u][S S T   T   S S T   S S N
_Push_-36_B][S S T  T   T   T   T   T   T   N
_Push_-63_'][S T    S S T   S S N
_Copy_0-based_4th_space][S S T  T   T   T   S T S N
_Push_-58_,][S S T  T   S N
_Push_-2_d][S S S T T   N
_Push_3_i][S S T    T   S T N
_Push_-5_a][S S S T T   S T N
_Push-13_s][S T S S T   S T N
_Copy_0-based_3rd_space][S S T  T   N
_Push_-1_e][S S S T S N
_Push_2_h][S T  S S T   T   N
_Copy_0-based_3rd_s][S T    S S T   T   N
_Copy_0-based_3rd_space][S S T  T   S N
_Push_-2_d][S S S T S S S N
_Push_8_n][S S T    T   S S T   S T N
_Push_-37_A][N
S S N
_Create_Label_LOOP][S S S T T   S S T   T   S N
_Push_102][T    S S S _Add][T   N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]


Redraw an image with just one closed curve

Python: Hilbert curve (373 361)

I decided to draw a Hilbert curve with variable granularity depending on the image intensity:

import pylab as pl
from scipy.misc import imresize, imfilter
import turtle

# load image
img = pl.flipud(pl.imread("face.png"))

# setup turtle
levels = 8
size = 2**levels
turtle.setup(img.shape[1] * 4.2, img.shape[0] * 4.2)
turtle.setworldcoordinates(0, 0, size, -size)
turtle.tracer(1000, 0)

# resize and blur image
img = imfilter(imresize(img, (size, size)), 'blur')

# define recursive hilbert curve
def hilbert(level, angle = 90):
    if level == 0:
        return
    if level == 1 and img[-turtle.pos()[1], turtle.pos()[0]] > 128:
        turtle.forward(2**level - 1)
    else:
        turtle.right(angle)
        hilbert(level - 1, -angle)
        turtle.forward(1)
        turtle.left(angle)
        hilbert(level - 1, angle)
        turtle.forward(1)
        hilbert(level - 1, angle)
        turtle.left(angle)
        turtle.forward(1)
        hilbert(level - 1, -angle)
        turtle.right(angle)

# draw hilbert curve
hilbert(levels)
turtle.update()

Actually I planned to make decisions on different levels of detail, like "This spot is so bright, I'll stop the recursion and move to the next block!". But evaluating image intensity locally leading to large movements is very inaccurate and looks ugly. So I ended up with only deciding whether to skip level 1 or to draw another Hilbert loop.

Here is the result on the first test image:

Thanks to @githubphagocyte the rendering is pretty fast (using turtle.tracer). Thus I don't have to wait all night for a result and can go to my well-deserved bed. :)

Some code golf

@flawr: "short program"? You haven't seen the golfed version! ;)

So just for fun:

from pylab import*;from scipy.misc import*;from turtle import*
i=imread("f.p")[::-1];s=256;h=i.shape;i=imfilter(imresize(i,(s,s)),'blur')
setup(h[1]*4.2,h[0]*4.2);setworldcoordinates(0,0,s,-s);f=forward;r=right
def h(l,a=90):
 x,y=pos()
 if l==1and i[-y,x]>128:f(2**l-1)
 else:
  if l:l-=1;r(a);h(l,-a);f(1);r(-a);h(l,a);f(1);h(l,a);r(-a);f(1);h(l,-a);r(a)
h(8)

(373 361 characters. But it will take forever since I remove the turte.tracer(...) command!)

Animation by flawr

flawr: My algorithm is slightly modified to what @DenDenDo told me: I had to delete some points in every iteration because the convergence would slow down drastically. That's why the curve will intersect itself.


How many points does my license plate give?

05AB1E, 25 22 20 18 bytes

Accepts a string of lower-case alphabetic chars and numbers with no spaces.

Ç¥0Kγ€gXK>OIγ€g<OO

Try it online!
or as a Test Suite


Pi Hunting - find an index of Pi whose value matches its index

Python 2, 64 bytes

i=1
while i<len(P):
	if int(P[i:i+len(str(i))])==i:print i
	i+=1

As you said, pi's digits are given, so I chose the variable P to contain the entire digit string.
The full code first downloads one billion digits of pi to a file using cURL and then reads in that file to process it.

"Setting up pi's digits."; exec'import os\nN,f=200000000,"pi.txt"\nif not os.path.exists(f):os.system("curl https://stuff.mit.edu/afs/sipb/contrib/pi/pi-billion.txt>"+f)\nP=open(f,"r").read()[1:N+2][:-1]'
"Search through pi.";      exec'i=1\nwhile i<len(P):\n\tif int(P[i:i+len(str(i))])==i:print i\n\ti+=1'

Though, when one knows the answer, a simple plaintext output is actually shorter (29 bytes).

print"1,16470,44899,79873884"

This series of numbers is also known to the OEIS (http://oeis.org/A057680).


35 Lines

f=
0[
c=
'\
c\
o\
n\
s\
t\
r\
u\
c\
t\
o\
r'
][
c]
`
r\
e\
t\
u\
r\
n\
'\
b\
a\
r\
b\
a\
r\
i\
a\
n'
`

Try it online!

Uses the fact that 0 is a number, the constructor of 0 is Number, and the constructor of Number is Function.

32 Lines

0[
c=
'\
c\
o\
n\
s\
t\
r\
u\
c\
t\
o\
r'
][
c]
`
f=
_\
=>
'\
b\
a\
r\
b\
a\
r\
i\
a\
n'
`(
)

Try it online!

This essentially runs

Function(`
f=
_=>
'barbarian'`)()

which uses the IIFE structure. Added bonus is that we can line-break some parts in the function body to reduce the line count.

24 Lines

f=
''
[
'\
t\
r\
i\
m'
][
'\
b\
i\
n\
d'
]`
b\
a\
r\
b\
a\
r\
i\
a\
n`

Try it online!

Inline version:

f=''['trim']['bind']`
barbarian`

Since all we want is to return a string, we can get away with a string method bound to a string. By using trim, we can also safely leave a beginning newline.


Haskell, 162 bytes

l=length
((m,f)%n)s|n>=l s=[]|n>0,(p,c:r)<-span(/=m(f$take(n+1)s))s=c:((m,id)%(n-l p)$r)|1>0=s
(x#y)z=[p%z$show=<<[x..y]|p<-[(maximum,id),(minimum,filter(>'0'))]]

Try it online!

Uses the algorithm described by jafe. Might be shorter to use a less efficient method, but this was more fun to write :)

The % operation takes 4 arguments (actually 3, but whatever): m which is a function that selects the "optimal" member from a list (either maximum or minimum depending on what we want); f which is a "filter" function; n the number of digits left to drop; and s the string. First we check whether n is equal to the number of digits left in the string (I used >= for safety) and drop the rest of s if so. Otherwise we check if we still need to drop digits (n>0), then we use span to break our string into three pieces: p the digits to drop, c the optimal reachable digit, and r the remaining string. We do this by passing span a predicate that checks for equality against our optimal digit. To find that digit we take the first n+1 digits of the string, filter it, then pass it to our "chooser" function. Now we just yield our optimal digit and recur, subtracting the length of p (the number of digits dropped) from n. Notice that we do not pass our filtering function to the recursive call, and, instead, we replace it with id. That's because the filter is only there to avoid selecting leading 0s in the minimum case which is only relevant on the first iteration. After that we no longer need any filter.

% is really only a helper function for # which is our "real" function, taking x, y, and z. We use a list comprehension just to avoid a bit of repetition, iterating over our function tuples and passing them to % along with z and the concatenated string. That string is created using the magic monad operator (=<<) which, in this context, works like concatMap.


R, 97 bytes

function(n)"if"(n>1,{while({T=T+1;x=paste(c(1:T,T:2-1),collapse="");nchar(x)<nchar(n)})0;x==n},T)

Try it online!

Takes n as a character or an integer; using character will give correct results for integers that can't be held precisely as a 64-bit double.

Generates staircase numbers until it finds one at least as long as n is, then tests for equality.

Equivalent to:

function(n)
    if(n > 1){
        T <- T + 1
        x <- paste(c(1:T,T:2-1),collapse="")
        while(nchar(x) < nchar(n)){
            T <- T + 1
            x <- paste(c(1:T,T:2-1),collapse="")
        }
        return(x == n)
    } else
        return(TRUE)


C, 212 195 193 181 171 132 103 98 bytes
Saved 1 byte thanks to @FryAmTheEggman, 5 bytes thanks to @orlp
Call f() with the position to play (must be capitalized), and it prints out the resulting board.
i;f(char*p){for(i=380;i--;)putchar(i%20?i^20*atoi(p+1)+64-*p+(*p>72)?i%6^4|i/20%6^3?46:42:79:10);}

Try it on ideone.


Where to point a low-orbit ion cannon (asking for a friend)

Python 3.8, 116 110 bytes

lambda p:[x:=min(p)[0]+.1,sum(sorted(b+(d-b)*(x-a)/(c-a)for(a,b),(c,d)in zip(p,p[-1:]+p)if(a<x)^(c<x))[:2])/2]

Try it online!
Input: A list of points, each is a tuple of 2 integers.
Output: A point as a list of 2 numbers.
Approach
Draw a vertical line through the polygon. Select the first 2 points where the line intersects with the polygon edges. Any point between those 2 points must be inside the polygon.

Note that the line should be chosen such that it doesn't intersect any polygon vertex.
Code explanation
The x-coordinate of the line is selected as the minimum x of all vertices, plus a small amount (0.1 is used in this case):
x:=min(p)[0]+.1

This ensures that the line intersects the polygon, and that it doesn't pass through any vertex (since vertices all have integer coordinates).
For each edge through vertices \$(a,b)\$ and \$(c,d)\$, the line intersects the edge if \$a<x<c\$ or \$a>x>c\$. Golfed using xor trick:
if (a<x)^(b<x)

The y-coordinate of each intersection is calculated using the following formula:
$$\frac{y-b}{x-a}=\frac{d-b}{c-a}$$
or b+(d-b)*(x-a)/(c-a)
The y-coordinate of the final point is calculated as the average of the smallest 2 y-coordinates.


55 chars

{~.0<"-"*\abs 10.?..3$@%+`-1%~`)[3-]1$,!!*+-1%@@/\++}:F

Negative numbers are a bit of a pain - responsible for about 13 chars of the 55. Trailing 0s are handled by using a 1 to stand for the decimal point, reversing as a string, converting to an int, and back again, and re-reversing.


Mathematica

This is easy in Mathematica. (1) Generate the subsets of your input list, using the Subsets[] command (I had originally used Permutations[], which works but produces redundant results), (2) sum the numbers in each subset by mapping the Total[] command across the list of subsets, then (3) check to see if the target sum S is represented among those sums with MemberQ[]. To be concise, I've shown this below implemented as a single nested command.

Put your inputs in the first line and execute this:

list = {0, 4, 3, 8, 1}; target = 6;
MemberQ[Total /@ Subsets[list], target]

Assuming one-character variable names, that's 28 bytes of code.


Bash, 2 bytes
$0

Moves itself to a new memory address when it is assigned a new process.
To move to a different spot on the harddrive it takes a few more:
cat $0>x


Mathematica, 119 108 bytes

Thanks to Martin Ender for saving 11 bytes!

±n_:=If[n<4,1,±(n-2)+±(n-3)];Graphics@Line@ReIm@Accumulate@Flatten@{0,z=I^(2/3),±# z^(#+{2,4,1})&~Array~#}&@

Unnamed function taking a positive integer argument (1-indexed) and returning graphics output. Example output for the input 16:

Developed simulataneously with flawr's Matlab answer but with many similarities in design—even including the definition I^(2/3) for the sixth root of unity! Easier-to-read version:

1  (±n_:=If[n<4,1,±(n-2)+±(n-3)];
2   Graphics@Line@ReIm@
3   Accumulate@Flatten@
4   {0,z=I^(2/3),±# z^(#+{2,4,1})&~Array~#}
5  ])&

Line 1 defines the Padovan sequence ±n = P(n). Line 4 creates a nested array of complex numbers, defining z along the way; the last part ±# z^(#+{2,4,1})&~Array~# generates many triples, each of which corresponds to the vectors we need to draw to complete the corresponding triangle (the ±# controls the length while the z^(#+{2,4,1}) controls the directions). Line 3 gets rid of the list nesting and then calculates running totals of the complex numbers, to convert from vectors to pure coordinates; line 2 then converts complex numbers to ordered pairs of real numbers, and outputs the corresponding polygonal line.


JavaScript (ES6) 167 177 chars encoded in UTF8 as 167 177 bytes

... so I hope everyone is happy.

Edit In fact, no need for a special case for last block too short. If the last 2 (or 1) chars are not mapped, the result string does not end with '*' and that gives error anyway.

F=s=>/^M[^*]*\*$/.test(s=s.replace(/.../g,x=>
"KNKNTTTTRSRSIIMIQHQHPPPPRRRRLLLLEDEDAAAAGGGGVVVV*Y*YSSSS*CWCLFLF"
[[for(c of(r=0,x))r=r*4+"ACGU".search(c)]|r]))?s:'Error'

Explained

Each char in a triplet can have 4 values, so there are exactly 4^3 == 64 triplets. The C function map each triplet to a number between 0 and 63. No error check needed as input chars are only ACGU.

C=s=>[for(c of(r=0,s))r=r*4+"ACGU".search(c)]|r

Each triplet maps to an aminoacid identified by a single char. We can encode this in a 64 character string. To obtain the string, start with the Codon Map:

zz=["* UAA UAG UGA","A GCU GCC GCA GCG","C UGU UGC","D GAU GAC","E GAA GAG"
,"F UUU UUC","G GGU GGC GGA GGG","H CAU CAC","I AUU AUC AUA","K AAA AAG"
,"L UUA UUG CUU CUC CUA CUG","M AUG","N AAU AAC","P CCU CCC CCA CCG","Q CAA CAG"
,"R CGU CGC CGA CGG AGA AGG","S UCU UCC UCA UCG AGU AGC","T ACU ACC ACA ACG"
,"V GUU GUC GUA GUG","W UGG","Y UAU UAC"]
a=[],zz.map(v=>v.slice(2).split(' ').map(x=>a[C(x)]=v[0])),a.join('')

...obtaining "KNKNTTTTRSRSIIMIQHQHPPPPRRRRLLLLEDEDAAAAGGGGVVVV*Y*YSSSS*CWCLFLF"

So we can scan the input string and use the same logic of the C function to obtain the code 0..63, and from the code the aminoacid char. The replace function wil split the input string in 3 chars blocks, eventually leaving 1 or 2 chars not managed (that will give an  invalid result string, not ending in '*').

At last, check if the encoded string is valid using a regexp: it must start with 'M', must not contain '*' and must end with '*'

Test In FireBug/FireFox console

;['AUGCUAG','GGGCACUAG','AUGAACGGA','AUGUAGUGA','AAAAAAA',
'AUGUUUGUUCCGUCGAAAUACCUAUGAACACGCUAA',
'AUGAGGUGUAGCUGA','AUGCCAGUCGCACGAUUAGUUCACACGCUCUUGUAA',
'AUGCUGCGGUCCUCGCAUCUAGCGUUGUGGUUAGGGUGUGUAACUUCGAGAACAGUGAGUCCCGUACCAGGUAGCAUAAUGCGAGCAAUGUCGUACGAUUCAUAG']
.forEach(c=>console.log(c,'->',F(c)))

Output

AUGCUAG -> Error
GGGCACUAG -> Error
AUGAACGGA -> Error
AUGUAGUGA -> Error
AAAAAAA -> Error
AUGUUUGUUCCGUCGAAAUACCUAUGAACACGCUAA -> Error
AUGAGGUGUAGCUGA -> MRCS*
AUGCCAGUCGCACGAUUAGUUCACACGCUCUUGUAA -> MPVARLVHTLL*
AUGCUGCGGUCCUCGCAUCUAGCGUUGUGGUUAGGGUGUGUAACUUCGAGAACAGUGAGUCCCGUACCAGGUAGCAUAAUGCGAGCAAUGUCGUACGAUUCAUAG -> MLRSSHLALWLGCVTSRTVSPVPGSIMRAMSYDS*


String Bit Manipulation- There and Back Again

Ruby, 230 191 181 178 175 173 171 159 bytes

i,n=$*
s=i.gsub(/./){|c|"%08b"%c.ord}
n.scan(/(.)(.)/){s.size.times{|i|s[j=i+(s[i]==?0?$1:$2).to_i]&&s[j]=s[j]==?0??1:?0}}
$><<s.gsub(/.{8}/){|c|c.to_i(2).chr}

It's just a very naive implementation of the spec. Input via command-line arguments, output to STDOUT.

# Read ARGV into i and n
i,n = $*
# Turn each character into a string of eight 0s and 1s using a format string.
s = i.gsub(/./){|c|"%08b"%c.ord}
# For each pair of characters in n
n.scan(/(.)(.)/){
    # For each index into s
    s.size.times{|i|
        # Determine the index that is to be toggled. $1 and $2 refer to the captures
        # of /(.)(.)/.
        j=i+(s[i]==?0?$1:$2).to_i
        # Using short-circuiting, toggle s[j] if it isn't nil.
        s[j]&&s[j]=s[j]==?0??1:?0
    }
}
# Convert each group of 8 characters back to a single character and print
$><<s.gsub(/.{8}/){|c|c.to_i(2).chr}


Mathematica 120 21 20

Explicit recursion (thanks alephalpha for saving one char):
f=f/@__~FileNames~#&

f["~/StackExchange/dir1"]

{{{}, {}}, {{}, {}, {}}, {}, {}, {}}

TreeForm[%]

Previous overcomplicated solution:
d="~/StackExchange/dir1"

f@{x___,Longest@s:{y_,___}..,z___}:=f@{x,f@Drop[{s},1,1],z}
f[FileNameSplit/@FileNames[__,SetDirectory@d;"",∞]]/.f->(#&)


C, 50 bytes

i;f(m){for(i=m;++i<m*m-m;)i%m>1&&printf("%d ",i);}

Try it online!


R, 57 bytes

function(v,`!`=sum,N=!1^v)c(A<-!v/N,P<-!v/2^c(N:1,N),P-A)

Try it online!

A clever collaboration with digEmAll and RobinRyder; uses the observation by Grimmy and Kevin's explanation from the comments, which I replicate below:

  For anyone else wondering why the example [a,b,c,d] -> [a,b,c,c,d,d,d,d] doesn't match the explanation of the code, it actually transforms [a,b,c,d] to [a,b,b,c,c,c,c,d,d,d,d,d,d,d,d,a] (so two of each value in comparison to the example). The example confused me for a moment. But nice answer, +1 from me! I also like that it has all these different types of the letter 'A' in the code: āÅÅAÂÆª. xD

This uses R's recycling rules to use two copies of l[1]/2^N in the sumby just sticking an extra N at the end of the decay rate.

R, 62 bytes

function(l)c(p<-Reduce(function(x,y)(x+y)/2,l),a<-mean(l),p-a)

Try it online!

Straightforward implementation.


I'm not sure exactly what you're looking for, but perhaps something like this?

[x1,y1,dx,dy]=prompt("Please enter the positions separated by commas").split`,`
dx-=x1
dy-=y1
console.log(dx,dy)

Reusing x2 and y2 as dx and dy, respectively, lets you use the -= operator to shorten it a bit.


APL (Dyalog Unicode), 5 3 bytes

∧.≤

Try it online!


Shortest Solution in Python 3 for Caught Speeding - CodingBat

Python 3, 32 bytes

lambda a,b:(a-b*5>60)+(a-b*5>80)

Try it online!

Python 3, 50 bytes

If io must be done with stdin and stdout

s=int(input())-5*int(input());print((s>60)+(s>80))

Try it online!


39240 points (190 chars)

<script>P='<svg><path stroke=red d=M'+X[n]+','+Y[n]
for(t=N=99;t--;P+='L'+x+','+y)for(x=y=i=0,z=Math.pow(1-t/N,n);i<=n;z*=t/(N-t)*(n-i)/++i)x+=z*X[i],y+=z*Y[i]
document.write(P+'>')</script>

Input is supplied in three variables: X and Y hold the coordinates, and n holds the degree of the polynomial. If more coordinates are supplied than are needed, the surplus ones are ignored. The line is stroked in red and filled in black.

This example draws substantially from the existing ones, but with an improvement of 40% in character count over the current best character count I think it's worth a separate answer.

Demo: http://jsfiddle.net/MBCGJ/7/

This is stretching the flexibility of the rules too far IMO, but three characters can be saved by making N a "fineness" parameter which must be initialised along with the input coordinates and degree.

Also, Chrome at least doesn't care about closing the path element at all, which allows saving the 4 chars +'>', so if that works cross-platform and the fineness parameter abuse is allowed this can go down to 183 chars.

The preferred way of rendering Bézier curves is, of course, adaptive subdivision using the de Casteljau algorithm. Unfortunately this uses more characters because it's necessary to do a test to decide whether to subdivide and then to do a moderate amount of work for the subdivision itself. Currently I'm at 371 chars, although I think this could be reduced with an explicit stack.

<script>P='<svg><path stroke=red d=M'+X[0]+','+Y[0]
function Z(A,B,E,F){function d(p,q){return(t=A[p]-A[q])*t+(t=B[p]-B[q])*t}for(e=i=0;++i<n;e|=b+c-d(n,0)+Math.sqrt(3.9*b*c)>0)b=d(i,0),c=d(n,i)
for(E=[],F=[i=-1];e?i++<n||Z(E,F)|Z(A,B):0;)for(E[i]=A[0],F[i]=B[j=0];j<n-i;B[j]=(B[j]+B[++j])/2)A[j]=(A[j]+A[j+1])/2
P+='L'+A[n]+','+B[n]}Z(X,Y)
document.write(P+'>')</script>

The figure 3.9 in the middle there is the quality parameter, which must be less than 4 to avoid infinite recursion. The closer it gets to 4, the better the quality.

http://jsfiddle.net/FrJLn/2/


Haskell - 78 characters

q[h,i,m,n]=abs$((600*h+60*i-110*m-11*n-312)`mod`720)-360
c s=q$map fromEnum s

Note: My "unit of choice" is the "half-degree", of which there are 720 to the circle. With these units, the answer to the problem is always integral! :-)

Ex.:

> map c $ words "0000 0001 0010 0630 0633 2325 2345 2355 2359"
[0,11,110,30,3,335,165,55,11]
> map c $ words "0930 1845 0315 1742 2359"
[210,135,15,162,11]


Print a conversion table for (un)signed bytes

Bash + coreutils, 30

(seq 0 127;seq -128 -1)|nl -v0

Try it online!


R, 91 86 bytes

Look up the index of the sum of bytes in a brute-forced UTF8 lookup table and use the magic Fibonacci generating function to give the answer.

function(x)round(1.618^match(sum(!x)%%93,!'%(-1!5+3JOSCW6')*.2765)
"!"=utf8ToInt

Try it online!

Edit: -2 bytes by improved numeric rounding

Edit: -3 bytes with a change to the lookup (thanks for the hint, @Giuseppe!)


PowerShell, 59 62 61 60 bytes

$z=ls($d=$args)-di;('"+-+
| |
+-+"','mv b.ps1 "$d"')[$?]|iex

Try it online!

Explanation

PowerShell's Move-Item cmdlet (mv) renames a file as well, so giving it a directory that doesn't exist as the destination just renames the file to that last component instead (as long as the parent exists), so that was no good.

I could use Test-Path to determine that the destination exists and is a directory, but it's too long Test-Path $d -PathT C.

So instead I'm using Get-ChildItem (ls) with the (shortened) -Directory parameter, and checking $? to see if it was successful. The output if there is any is assigned to $z so that it isn't seen.

That's done in the form of an array with 2 elements, then indexing into the array with the boolean value of $?, which will get coalesced to 0 or 1, so the first array element is chosen if the destination directory doesn't exist, and second if it does.

The first array element is a string containing the box (quoted); newlines are allowed in strings, even when they're not heredocs. The second element is a string containing the move command.

The result of that array selection gets piped into Invoke-Expression (iex) to be executed. This is necessary because of I just leave the actual move command in the array, it gets executed no matter what (to populate the array), which defeats the purpose.


Python 2, 68 67 61 bytes

lambda a:`{0:j for j in zip(*a)if len(set(j))==len(j)}`[6::5]

Try it online!

Improvements

From 68 bytes to 67 bytes by Jo King
From 66 to 65 bytes by Lynn

If output would not have to be a string:

Python 3, 49 bytes

lambda a:[j for j in zip(*a)if len({*j})==len(j)]

Try it online!


Sort a list of unknown values with the least amount of comparisons

Python, score 23069

This uses the Ford–Johnson merge insertion sorting algorithm.

from __future__ import print_function
import sys

def less(x, y):
    print(x, '<', y)
    sys.stdout.flush()
    return bool(int(input()))

def insert(x, a, key=lambda z: z):
    if not a:
        return [x]
    m = len(a)//2
    if less(key(x), key(a[m])):
        return insert(x, a[:m], key) + a[m:]
    else:
        return a[:m + 1] + insert(x, a[m + 1:], key)

def sort(a, key=lambda z: z):
    if len(a) <= 1:
        return a
    m = len(a)//2
    key1 = lambda z: key(z[-1])
    b = sort([insert(x, [y], key) for x, y in zip(a[:m], a[m:2*m])], key=key1)
    if len(a) % 2:
        b += [[a[-1], None]]
    for k in range(m, len(a)):
        l, i, (x, y) = max((-i.bit_length(), i, t) for i, t in enumerate(b) if len(t) == 2)
        b[:i + 1] = insert([x], b[:i], key=key1) + [[y]]
    if len(a) % 2:
        b.pop()
    return [x for x, in b]

print('a', ' '.join(map(str, sort(range(int(input()))))))


Python 2: 58 chars

n=input()
s=""
while n:s="0+-"[n%3]+s;n=-~n/3
print s or 0

Generates the balanced ternary digit-by-digit from the end. The last digit is given by the residue n%3 being -1,0, or +1. We then remove the last digit and divide by 3 using Python's floor-divide n=(n+1)/3. Then, we proceed recursively with the new last digit until the number is 0.

A special case is needed for the input 0 to give 0 rather than the empty string.

The specs don't allow this, but if one could write a function instead of a program and output the empty string for 0, a 40 char solution would be possible.

g=lambda n:n and g(-~n/3)+"0+-"[n%3]or""


MATL, 4 bytes

10:*

Breakdown:

        % Implicit input
10:     % Create a list from 1 2 ... 10
   *    % Multiply list by input
        % Implicit output

Try it online


JavaScript (ES7), 104 bytes

f=(s,o,c=s.match(/[A-Z]/))=>c?[...2**29+'4'].some(i=>o&1<<i?0:f(r=s.split(c).join(i),o|1<<i))&&r:eval(s)

Demo

f=(s,o,c=s.match(/[A-Z]/))=>c?[...2**29+'4'].some(i=>o&1<<i?0:f(r=s.split(c).join(i),o|1<<i))&&r:eval(s)

console.log(f('I + LOVE + YOU == DORA'))

Formatted and commented

f = (                               // f = recursive function taking:
  s,                                //   s = input string
  o,                                //   o = bitmask of used digits
  c = s.match(/[A-Z]/)              //   c = next alphabetical character in s
) =>                                //       (either null or a single-element array)
  c ?                               // if c is not null:
    [...2**29 + '4'].some(i =>      //   for each character i of '5368709124'
      o & 1 << i ?                  //     if this digit was already used:
        0                           //       ignore this iteration
      :                             //     else:
        f(                          //       do a recursive call to f() with:
          r = s.split(c).join(i),   //         all characters c replaced with i
          o | 1 << i                //         the updated bitmask
        )                           //       end of recursive call
    ) && r                          //   end of some(): if successful, return r
  :                                 // else:
    eval(s)                         //   evaluate this fully numerical expression


GolfScript, 128 characters
~](:k/.{{1,%{,}%.!,+}%}:^~{' ':s*}%.{,}%$-1=:9{s*\+9~)>'|'n}+%\zip^.{,~}%$0=){.~[s]*@+>{s\+-2>}%}+%zip{9)s*\n}%\[9s*'+''--'k*n]\

The input has to be provided on STDIN as space separated numbers.
You can test the example here.
Commented code:
# Parse the input into an 2D array of digits. The width is saved to variable k
~](:k/

# Apply the code block ^ to a copy of this array
.
{                # begin on code block
  {              # for each line
   1,%           #   split at 0s (1, => [0]) (leading, trailing, multiple 0s are
                 #   removed because of operator % instead of /)
   {,}%          #   calculate the length of each run of 1s
   .!,+          #   special case: only zeros, i.e. []
                 #   in this case the ! operator yiels 1, thus [0], else []
  }%             # end for
}:^              # end of code block
~                # apply

# Format row headers
{' ':s*}%        # join numbers with spaces
.{,}%$-1=:9      # calulate the length of the longest row header
                 # and save it to variable <9>
{                # for each row
  s*\+           #   prepend padding spaces
  9~)>           #   and cut at length <9> from the right
  '|'n           #   append '|' and newline
}+%              # end for

# Format column headers
\zip^            # transpose input array and apply the code block ^
                 # i.e. calculate length of runs
.{,~}%$0=)       # determine (negative) length of the longest column header
{                # for each column
  .~[s]*@+       #   prepend enough spaces
  >              #   and cut at common length (from right)
  {s\+-2>}%      #   format each number/empty to 2 chars width
}+%              # end for
zip              # transpose column header into output lines
{9)s*\n}%        # prepend spaces to each line and append newline

# Inject separator line
\[
9s*              # spaces
'+'              # a plus sign
'--'k*           # k (width) number of '--'
n                # newline
]\


Python 2, 53 bytes

lambda n,l:sum((b-a+n/2)%n-n/2for a,b in zip(l,l[1:]))

Super straight forward answer. I wonder if there is a shorter way.


Python 2, 28 bytes

lambda n:'6'*len(`-~n*3/11`)


On a linux system there's no need for special handling of devices. Just use the device file interface.
Python 3 (byte strings) - 141 bytes
d=input()
f=open(d,'r+b')
z=f.seek
z(0,2)
s=f.tell()
i=0
while i<2:
 z(0);f.write([b'\0',b'\xff'][i]*s);f.flush();z(0)
 if f.read()==x:i+=1

It's fairly straightforward, and not really optimised heavily, but it works. Here's a basic rundown.

Get input (device file path)
Open device file
Seek to the end, get filesize (block devices are always their real size)
enter write-and-check loop
construct 0-bit and 1-bit strings (x)
write bitstring
flush output (I could have set buffering=0 but this is shorter)
test file against x, and increment step of loop if it passes

exit loop when the increment is high enough
As a bonus, you could modify this for any set and number of byte-modification patterns, like 0x55/0xaa for stronger overwriting effects.
I did actually test this on a device file, using loopback. However, I'm not 100% sure the checking actually works. It might be necessary to close and reopen the file each pass, due to buffering behaviors. I would hope flush prevents this.
*edited to incorporate some suggestions in the comments


Jelly, 41 bytes

l2Ḟ©.*×+®µ23 .*×“9®ġ’_Hµ‘_Ḟ×Ḟ2*$$µ²×³3_×H

Try it online!

I know this challenge was designed in the hope that golfing languages would have a hard time. In a way, they do; Jelly doesn't have any primitives for looking at the representation of a floating point number in memory. However, it's still possible to solve the challenge via working out "manually" what the representation would look like using the basic definitions of floating point arithmetic, and in fact there's some amount of mathematical interest in doing things "the hard way". Jelly's so much terser than (say) C, that the fact it has to do more work doesn't prevent the program being considerably shorter.

Explanation

The input is a floating-point number, as a number.
In order to run the fast inverse square root algorithm, we need to find how it would be represented in memory.
Jelly doesn't have a way to do that by looking at the bit pattern, but we can do it arithmetically.

First, note that the input must be positive (or its inverse square root would be undefined). As such, it's laid out in memory as follows, from most to least significant:

A zero bit (the sign bit, zero means nonnegative so this will always be zero);
The exponent (dividing the number by 2 to the power of the exponent scales it into the range 1 to 2), represented in 8 bits as its value minus 127;
The mantissa (the result of the above division), represented in 23 bits via subtracting 1, then multiplying by 223.

The results of each of these calculations can be represented directly in Jelly. As such, we could generate the same output as C's convert-float-to-int memory hack does like this:

Calculate the exponent
Calculate the mantissa
Take ((exponent + 127) × 223) + (mantissa × 223 - 1)

However, the last expression shown here simplifies to the following rather simpler form:

223 × (exponent + mantissa + 126)
alternatively, 8388608 × (exponent + mantissa) + 1056964608 (the result of multiplying the above out)

Let's call the exponent + mantissa of the input floating point number em for short.
(The exponent + mantissa of a floating point number uniquely defines it.)
In other words, after the // evil floating point bit level hacking comment, the C program is currently working with i = 8388608 × em + 1056964608.

The next steps in the C program are to halve i, and subtract it from 0x5f3759df (which, in decimal, is 1597463007).
i is (8388608 × em + 1056964608); halving it gives (4194304 × em + 528482304); the subtraction gives (1068980703 - 4194304 × em).

Then, C convert this number back to a floating point number y. Let's call the exponent + mantissa of y em'.
What the C program is therefore effectively doing in the floating point representational hacking is solving the following equation:

(1068980703 - 4194304 × em) = (8388608 × em' + 1056964608), which simplifies to:
12016095 = 4194304 × em + 8388608 × em'
em' = (12016095 - 4194304 × em) ÷ 8388608 = (12016095 × 2-23) - em / 2

Now, to convert this into Jelly. We have a nice arithmetic definition of em and of em', so we can translate it directly. First, here's how to calculate em:

l2Ḟ©.*×+®
l2                 Logarithm of the input, base 2
  Ḟ                Round down to the integer below (produces the exponent)
   ©               Store the exponent in a variable
    .*             Take (½ to the power of the exponent)
      ×            Multiply by {the original value, by default}
       +®          Add the value of the variable (i.e. the exponent)

The original value multiplied by ½ to the power of the exponent is equal to the original value divided by 2 to the power of the exponent, i.e. the mantissa, so this is em.

Getting em' is very straightforward from here, if we want it. However, we're going to need to convert the exponent+mantissa format back into a floating point number.
This can be done unambiguously (the exponent's always an integer, the mantissa runs from 1 inclusive to 2 exclusive).
However, to extract the exponent, we're going to want to floor and subtract 1. As such, it's actually shorter to generate em' -1.

em' = (12016095 × 2-23) - em / 2, so
em'-1 = (3627487 × 2-23) - em / 2

We can encode this formula in Jelly directly:

µ23 .*×“9®ġ’_H
µ                  set this point as the new default for missing arguments
 23                restart with 23
    .*             ½ to the power of that (i.e. 2 to the power -23)
      ×            times
       “9®ġ’       3627487 (compressed representation)
            _H     minus half {the value as of the last µ command}

Incidentally, we need the space because 23. is a single token in Jelly (which evaluates to 23½).

The next step is to convert from em'-1 to an actual floating point number y. We can extract the exponent using Ḟ; then the mantissa is em'-1 + 1 - the exponent.
To produce the floating point number, we want to calculate mantissa × 2exponent:

µ‘_Ḟ×Ḟ2*$$
µ                  set this point as the new default for missing arguments
 ‘                 increment (producing em'-1 + 1)
  _Ḟ               subtract the exponent (producing the mantissa)
    ×              multiply by
     Ḟ2*           2 to the power of the exponent
        $$         parse the previous three links as a group

Finally, we just need to handle the line marked // 1st iteration.
This is just regular arithmetic, so encodes into Jelly really easily.
The formula is:

y × (1.5 - (x2 × y²)), where x2 is half the original input; this is shorter to express as
y ÷ 2 × (3 - (x × y²)), where x is the original input.

And here's how it looks in Jelly:

µ²×³3_×H
µ                  set this point as the new default for missing arguments
 ²                 square
  ×³               multiply (×) by the original input (³)
    3_             subtract (_) from 3
      ×H           multiply by half {the value as of the last µ command}

Verification

Running this program on the input 2 produces the output 0.7069300386983334. This is the same value (allowing for differences in the float-to-string conversion) as produced by this VBA answer, and not equal to the mathematically correct value for 2-0.5.


05AB1E, 29 26 bytes

æIg<ùˆ\æIg<ùˆ\æIg<ùˆ¯¯{Å`s

Try it online!, or try all irradiated versions.

The shortest irradiator I could find is 5 bytes:

æ        # powerset of the input
 Ig      # length of the input
   <     # - 1
    ù    # elements of a with length b

The idea is to repeat that 3 times, then do majority voting:

æIg<ù         # irradiate
     ˆ        # add the result to the global array
      \       # pop (in case the above instruction gets irradiated)
æIg<ùˆ\       # idem
æIg<ùˆ        # no pop, it's okay to dirty the stack at this point
¯             # push global array
 ¯            # and again, so at least one goes through
  {           # sort
   Å          # conveniently ignored by the parser
    `         # dump
     s        # swap
              # and implicitly output

Å is a prefix for 2-byte commands, but there's no Å` command, which is why the Å gets ignored. We'll need it later, though.

Sorting makes sure the majority vote is in the middle of the array. Dumping then swapping gets that value to the top of the stack.

Any irradiation in the initial part only results in an error in the global array, which gets solved by the majority vote. Irradiations in the final {Å`s bit are much trickier to reason about:

Å is ignored anyway, so it's okay to irradiate it
If the backtick is irradiated, Å`s becomes Ås, which is the "get middle of the array" extended command.
If { or s are irradiated, that means nothing else is, so the global array is the same value three times. In that case we don't need sorting/swapping, any value will work.


Sometimes I need a Lossless Screenshot Resizer

Python
the function delrows deletes all but one duplicate rows and returns the transposed image, applying it twice also deletes the columns and transposes it back. Additionally threshold controls how many pixels can differ for two lines to be still considered the same
from scipy import misc
from pylab import *

im7 = misc.imread('win7.png')
im8 = misc.imread('win8.png')

def delrows(im, threshold=0):
    d = diff(im, axis=0)
    mask = where(sum((d!=0), axis=(1,2))>threshold)
    return transpose(im[mask], (1,0,2))

imsave('crop7.png', delrows(delrows(im7)))
imsave('crop8.png', delrows(delrows(im8)))

Flipping the comparator in mask from > to <= will instead output the removed areas which are mostly blank space.

golfed (because why not)
Instead of comparing each pixel it only looks at the sum, as a side effect this also converts the screenshot to greyscale and has trouble with sum-preserving permutations, like the down-arrow in the address bar of the Win8 screenshot
from scipy import misc
from pylab import*
f=lambda M:M[where(diff(sum(M,1)))].T
imsave('out.png', f(f(misc.imread('in.png',1))),cmap='gray')


Jelly, 35 33 34 bytes

Ỵe€€⁾ .¬ZḄṣ0§ḟ0%29“h½sØ?X’ḃ26¤iⱮ’Ḍ

Try it online!

When I started writing this, The question didn’t specify that the width of digits was fixed, so my answer doesn’t make that assumption.

Input is now a string (which costs a byte over having a list of strings). Output is an integer.

Explanation:

Ỵ                         | split at new lines
e€€⁾ .                    | For each character check whether it is a
                          | full stop/space or something else
      ¬                   | invert this
       Z                  | transpose
        Ḅ                 | convert from binary to decimal (one number per column of input)
         ṣ0               | split at zeroes (blank columns)
§                         | take the sum of each digit
 ḟ0                       | filter out remaining blank columns
   %29                    | take this number mod 29
      “h½sØ?X’ḃ26¤iⱮ      | look each digit up in a compressed list
                          | [18, 23, 6, 5, 1, 19, 13, 21, 8, 25]
                    ’     | subtract one
                     Ḍ    | convert to decimal


Java, n=87 on my machine
The result for n=87 is
62688341832480765224168252369740581641682638216282495398959252035334029997073369148728772291668336432168

import java.math.BigInteger;

public class NonattackingPawns {

    static BigInteger count(int n) {
        BigInteger[][] a0 = new BigInteger[n+1][n*n+1], a1 = new BigInteger[n+1][n*n+1], tm;

        for(int h = 0; h <= n; h++) a0[h][0] = h%2==0? BigInteger.ONE: BigInteger.ZERO;

        for(int c = 1; c <= 2*n; c++) {
            int minp = 0;
            for(int h = 0; h <= n; h++) {
                java.util.Arrays.fill(a1[h], BigInteger.ZERO);
                if(h>0) minp += c >= 2*h-c%2 ? 2*h - c%2 : c;

                int maxp = Math.min(n*(c-1)+h, n*n);
                for(int p = minp; p <= maxp; p++) {
                    BigInteger sum = a0[h][p-h];

                    if(c%2==1 && h>0)
                        sum = sum.add(a0[h-1][p-h]);
                    else if(c%2==0 && h<n)
                        sum = sum.add(a0[h+1][p-h]);

                    a1[h][p] = sum;
                }
            }
            tm=a0; a0=a1; a1=tm;
        }
        BigInteger[] s = new BigInteger[n*n+1];
        for(int p = 0; p <= n*n; p++) {
            BigInteger sum = BigInteger.ZERO;
            for(int h = 0; h <= n; h++) sum = sum.add(a0[h][p]);
            s[p] = sum;

        }

        BigInteger ans = BigInteger.ZERO;
        for(int p = 0; p < n*n; p++) ans = ans.add(s[p].multiply(s[p]));
        return ans.shiftLeft(1).add(s[n*n].multiply(s[n*n]));
    }

    public static void main(String[] args) {
        for(int n = 0;; n++) {
            System.out.println(n + " " + count(n));
        }
    }

}

This currently uses a dynamic programming scheme taking O(n^4) operations to calculate the ways to place p pawns on the squares of one color for 0 <= p <= n^2. I think it should be possible to do this much more efficiently.
Check out the results here.
Explanation
In a valid solution, the lowermost white pawns in each column must form a zigzagging line like this:

That is, the height of the line in column c must be +/- 1 from its position in column c - 1. The line can also go onto two imaginary rows above the top of the board.
We can use dynamic programming to find the number of ways to draw a line on the first c columns that includes p pawns on those columns, is at height h on the cth column, using the results for column c - 1, heights h +/- 1, and number of pawns p - h.


Retina 0.8.2, 32 31 bytes
^(\s*\()+(?<-1>\s*\))+(?(1)$.)

Try it online! Link includes test cases. Returns the original string on error. Considers the given control characters as white space, plus any Unicode characters (such as space) in the Separator group, plus U+0085. If only the minimal white space is desired, this can be achieved by prefixing e`. Explanation:
^(\s*\()+

Match some open parentheses at the start of the string.
(?<-1>\s*\))+

Match some close parentheses.
(?(1)$.)

Check that the same number of open and close parentheses were matched.

Delete the matched parentheses.
Alternative solution, also 31 bytes:
r`^(?<-1>\s*\()+(\s*\))+(.*)
$2

Try it online! Link includes test cases. If only the minimal white space is desired, this can be achieved by prefixing e. Explanation:
r`

Start matching at the end of the string and work backwards (like a lookbehind would).
(.*)

Match as much result as possible.
(\s*\))+

Match some close parentheses.
^(?<-1>\s*\()+

Match the open parentheses at the start of the string. The number of close parentheses must be at least as many as the number of open parentheses for the balancing group to succeed, but it can't be more because the (.*) ensures that as few close parentheses are matched as possible.
$2

Keep everything except the matched parentheses.
Previous 32-byte solution that returns the empty string on error:
1!`(?<=^(?<-1>\s*\()+(\s*\))+).*

Try it online! Link includes test cases. If only the minimal white space is desired, this can be achieved by prefixing e. Explanation:
1!`

Output the matched part of the first match.
(?<=^(?<-1>\s*\()+(\s*\))+)

Ensure that the match starts after balanced parentheses. Note that this is a lookbehind, so the match is processed right-to-left - the )s are matched first, then a ( can be matched for each ). There can't be too many )s because the lookbehind would have matched earlier, meaning that this is no longer the first match.
.*

Match the rest of the string. This actually counts as part of the match, and therefore becomes the resulting output.


JavaScript (ES6), 98 97 bytes

Saved 1 byte thanks to Neil

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a space-separated list of names such as Lisa Bob.

l=>h=>l.replace(/(.* )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

Formatted and commented

l => h =>                         // given a list of guests l and a party time h
  l.replace(                      // for each guest in l:
    /(.* )(.*)\n/g,               //   extract the name a and arrival time b
    (_, a, b) =>                  //   subtract the arrival time from the time counter
      (t -= T(b)) < 0 ?           //   if the result is negative:
        a                         //     the guest is late: keep the name
      :                           //   else:
        '',                       //     the guest is on time: remove this entry
    t = (                         //   initialize the time counter t
      T = h =>                    //   define T():
        eval(                     //     a function that takes either a time
          h.replace(/:/, '*60+')  //     in hh:mm format or an amount of minutes
        )                         //     and returns an amount of minutes
    )(h)                          //   call it with the party time
  )                               // end of replace()

Demo

let f =

l=>h=>l.replace(/(.* )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))


Java 10, 189 159 bytes

s->c->{var r="";int p=0,i;for(var a:s.split("\\|")){for(i=p;i-->0;r+=" ");r+=a;for(p+=a.length();i++<s.replace("|","").length()-p;r+=" ");r+=c+"\n";}return r;}

-30 bytes converting Java 7 to Java 10 and optimizing the loops.
Try it online.
Explanation:
s->c->{                     // Method with String & char parameters and String return-type
  var r="";                 //  Result-String, starting empty
  int p=0,                  //  Position-integer, starting at 0
      i;                    //  Index integer
  for(var a:s.split("\\|")){//  Loop over the parts split by "|"
    for(i=p;i-->0;r+=" ");  //   Add `p` amount of spaces to the result-String
    r+=a;                   //   Add the current part to the result-String
    for(p+=a.length();      //   Add the length of the current part to the position-integer
        i++<s.replace("|","").length()-p;r+=" ");
                            //   Add the row's trailing spaces to the result-String
    r+=c+"\n";}             //   Add the character and a new-line to the result-String
  return r;}                //  Return the result-String


Even a clock that isn't working gets the time right two or three times a day

JavaScript (ES6), 13 bytes
Takes input as (h)(m). Returns true for 01:00, 02:00 and 13:00, or false for anything else.

h=>m=>26%h<!m

Try it online!
How?
Testing \$26\bmod h<\delta_m\$ is equivalent to test that we have \$m=0\$ and \$26\equiv 0\pmod h\$.
For \$0<h\le23\$, we have \$26\equiv 0\pmod h\$ iff \$h\$ divides \$26\$, i.e. \$h\in\{1,2,13\}\$.
For the edge case \$h=0\$, 26%h results in NaN which is neither greater nor lower than any other value, so the test returns false as expected, no matter the value of \$m\$.
Other possible values
This program generates all possible values \$n<1000\$ for the expression \$n\bmod h\$.

for(n = 1; n < 1000; n++) {
  A = [...Array(24)].map((_, x) => x).filter(x => n % x == 0);
  if(A.length == 3 && A.some(x => A.includes(x + 12))) {
    console.log(n, A);
  }
}

Try it online!


Jelly, 8 7 bytes
ẆĠẈEƊƇṪ

Try it online!
How it works
ẆĠẈEƊƇṪ - Main link. Takes L on the left
Ẇ       - All non-empty contiguous sublists of L, longest last
    ƊƇ  - Keep those sublists S for which the following is true:
 Ġ      -   Group the indices of S by the elements
  Ẉ     -   Length of each
   E    -   All equal?
      Ṫ - Get the last (i.e. the longest) element


perl -M5.010 -n, 47 bytes

"Perl\nfizz\nbuzz\n'ave a banana"=~/\b$_/;say$'

Try it online!

Prints whatever is following the input, or nothing if there is no match. Assumes input is newline terminated.


Mathematica, 68 bytes

Print/@(10^RandomSample@RandomChoice[IntegerPartitions[+##,{#}]-1])&

An unnamed function that takes two integer arguments, the number of boxes, followed by the number of items.

It first computes all possible partitions of N+M into exactly M positive parts, and subtracts 1 from each partition afterwards. This gives us all possible partitions of N into M non-negative parts (which IntegerPartitions wouldn't generate otherwise). Then pick a random partition and shuffle it. This guarantees all possible ordered partitions with zeros are allowed. Finally, convert each bin of the partition to an output line by raising 10 to the corresponding power (such that each line becomes 1000... with k zeros). An example output might look like:

100
10000
1
10
10


05AB1E, 28 27 24 bytes

láÇ¥R`XIlvyaiAyk+Aèëy}u?

Try it online!

Explanation

l                          # convert input to lower case
 á                         # keep only letters
  Ç¥                       # compute deltas of character codes
    R`                     # reverse and push separated to stack
      X                    # push 1
       Ilv                 # for each char y in lower case input
          yai              # if y is a letter
             Ayk           # get the index of y in the alphabet
                +          # add the next delta
                 Aè        # index into the alphabet with this
            ëy             # else push y
              }            # end if
            u?             # print as upper case


Unholy Grail Layout (Reverse Holy Grail Layout)

Simple

L

R

C

Who said that it needs to be valid html?
Who said that I need a doctype?


Husk, 11 bytes

ΣÖom_↔Oġλ¬√

Try it online!

Explanation

ΣÖom_↔Oġλ¬√  Implicit input, say "kH::r:R:Hk:"
       ġ     Split between characters for which this gives a falsy result:
        λ      Take two arguments, ignore the first.
          √    Is the second argument a letter?
         ¬     Negate.
             Now we have the options: ["k","H::","r:","R:","H","k:"]
      O      Sort: ["H","H::","R:","k","k:","r:"]
 Ö           Sort by
     ↔       reversing and
  om_        converting everything to lowercase: ["H::","k:","R:","r:","H","k"]
Σ            Concatenate: H::k:R:r:Hk


PCRE flavor, 261 289 210 184 127 109 71 53 51 44 40 bytes

Yes, it is possible!

<^<()(?R){2}>\z|\1\Q^<()(?R){2}>\z|\1\Q>

Try it here. (But / is shown to be the delimiter on Regex101.)

Please refrain from making unnecessary edits (updates) on the Regex101 page. If your edit doesn't actually involve improving, trying or testing this regex, you could fork it or create new ones from their homepage.

The version works more correctly on Regex101 (44 bytes):

/^\/()(?R){2}\/\z|\1\Q^\/()(?R){2}\/\z|\1\Q/

Try it here.

This is much simpler than the original version and works more like a traditional quine. It tries to define a string without using it, and use it in a different place. So it can be placed very close to one end of the regex, to reduce the number of characters needing more characters to define the matching pattern and repeated more times.

Explanations:

\Q^\/()(?R){2}\/\z|\1\Q matches the string ^\/()(?R){2}\/\z|\1\Q. This uses a quirk that \Q...\E doesn't have to be closed, and unescaped delimiters work in \Q. This made some previous versions work only on Regex101 and not locally. But fortunately the latest version worked, and I golfed off some more bytes using this.
\1 before the \Q matches the captured group 1. Because group 1 doesn't exist in this option, it can only match in recursive calls. In recursive calls it matches empty strings.
(?R){2} calls the whole regex recursively twice, which matches ^\/()(?R){2}\/\z|\1\Q for each time.
() does nothing but capture an empty string into group 1, which enables the other option in recursive calls.
^\/()(?R){2}\/\z matches (?R){2} with delimiters added, from the beginning to the end. The \/ before the recursive calls also made sure this option itself doesn't match in recursive calls, because it won't be at the beginning of the string.

51 bytes with closed \Q...\E:

/\QE\1|^\/(\\)Q(?R){2}z\/\E\1|^\/(\\)Q(?R){2}z\/\z/

Try it here.

Original version, 188 bytes

Thanks to Martin Büttner for golfing off about 100 bytes!

/^(?=.{173}\Q\2\)){2}.{11}$\E\/\z)((?=(.2.|))\2\/\2\^\2\(\2\?=\2\.\2\{173}\2\\Q\2\\2\2\\\2\)\2\)\2\{2}\2\.\2\{11}\2\$\2\\E\2\\\2\/\2\\z\2\)\2\(\2\(\2\?=\2\(\2\.2\2\.\2\|\2\)\2\)){2}.{11}$/

Try it here.

Or 210 bytes without \Q...\E:

/^(?=.{194}\\2\\.\)\{2}\.\{12}\$\/D$)((?=(.2.|))\2\/\2\^\2\(\2\?=\2\.\2\{194}\2\\\2\\2\2\\\2\\\2\.\2\\\2\)\2\\\2\{2}\2\\\2\.\2\\\2\{12}\2\\\2\$\2\\\2\/D\2\$\2\)\2\(\2\(\2\?=\2\(\2\.2\2\.\2\|\2\)\2\)){2}.{12}$/D

Try it here.

Expanded version:

/^(?=.{173}\Q\2\)){2}.{11}$\E\/\z)        # Match things near the end.
((?=(.2.|))                               # Capture an empty string or \2\ into group 2.
   \2\/\2\^\2\(\2\?=\2\.\2\{173}\2\\Q\2\\2\2\\\2\)\2\)\2\{2}\2\.
   \2\{11}\2\$\2\\E\2\\\2\/\2\\z\2\)      # 1st line escaped.
   \2\(\2\(\2\?=\2\(\2\.2\2\.\2\|\2\)\2\) # 2nd line escaped.
){2}
.{11}$/x

Extensions like (?= and \1 have made the so-called "regular" expressions no longer regular, which also makes quines possible. Backreference is not regular, but lookahead is.

Explanation:

I use \2\ in place of \ to escape special characters. If \2 matches the empty string, \2\x (where x is a special character) matches the x itself. If \2 matches \2\, \2\x matches the escaped one. \2 in the two matches of group 1 can be different in regex. In the first time \2 should match the empty string, and the second time \2\.
\Q\2\)){2}.{11}$\E\/\z (line 1) matches 15 characters from the end. And .{11}$ (line 7) matches 11 characters from the end (or before a trailing newline). So the pattern just before the second pattern must match the first 4 or 3 characters in the first pattern, so \2\.\2\|\2\)\2\) must match ...\2\) or ...\2\. There cannot be a trailing newline because the last character should be ). And the matched text doesn't contain another ) before the rightmost one, so all other characters must be in the \2. \2 is defined as (.2.|), so it can only be \2\.
The first line makes the whole expression matches exactly 188 characters since everything has a fixed length. The two times of group 1 matches 45*2 characters plus 29 times \2. And things after group 1 matches 11 characters. So the total length of the two times \2 must be exactly 3 characters. Knowing \2 for the second time is 3 characters long, it must be empty for the first time.
Everything except the lookahead and \2 are literals in group 1. With the two times \2 known, and the last few characters known from the first line, this regex matches exactly one string.
Martin Büttner comes up with the idea of using lookahead to capture group 2 and make it overlap with the quine part. This removed the characters not escaped in the normal way between the two times of group 1, and help avoided the pattern to match them in my original version, and simplified the regex a lot.

Regex without recursions or backreferences, 85 bytes

Someone may argue that expressions with recursions or backreferences are not real "regular" expressions. But expressions with only lookahead can still only match regular languages, although they may be much longer if expressed by traditional regular expressions.

/(?=.*(\QE\\){2}z\/\z)^\/\(\?\=\.\*\(\\Q.{76}\E\\){2}z\/\z)^\/\(\?\=\.\*\(\\Q.{76}\z/

Try it here.

610 bytes without \Q...\E (to be golfed):

/^(?=.{610}$)(?=.{71}(\(\.\{8\}\)\?\\.[^(]*){57}\)\{2\}\.\{12\}\$\/D$)((.{8})?\/(.{8})?\^(.{8})?\((.{8})?\?=(.{8})?\.(.{8})?\{610(.{8})?\}(.{8})?\$(.{8})?\)(.{8})?\((.{8})?\?=(.{8})?\.(.{8})?\{71(.{8})?\}(.{8})?\((.{8})?\\(.{8})?\((.{8})?\\(.{8})?\.(.{8})?\\(.{8})?\{8(.{8})?\\(.{8})?\}(.{8})?\\(.{8})?\)(.{8})?\\(.{8})?\?(.{8})?\\(.{8})?\\(.{8})?\.(.{8})?\[(.{8})?\^(.{8})?\((.{8})?\](.{8})?\*(.{8})?\)(.{8})?\{57(.{8})?\}(.{8})?\\(.{8})?\)(.{8})?\\(.{8})?\{2(.{8})?\\(.{8})?\}(.{8})?\\(.{8})?\.(.{8})?\\(.{8})?\{12(.{8})?\\(.{8})?\}(.{8})?\\(.{8})?\$(.{8})?\\(.{8})?\/D(.{8})?\$(.{8})?\)(.{8})?\(){2}.{12}$/D

Try it here.

The idea is similar.

/^(?=.{610}$)(?=.{71}(\(\.\{8\}\)\?\\.[^(]*){57}\)\{2\}\.\{12\}\$\/D$)
((.{8})?\/(.{8})?\^(.{8})?\((.{8})?\?=(.{8})?\.(.{8})?\{610(.{8})?\}(.{8})?\$(.{8})?\)
(.{8})?\((.{8})?\?=(.{8})?\.(.{8})?\{71(.{8})?\}
  (.{8})?\((.{8})?\\(.{8})?\((.{8})?\\(.{8})?\.(.{8})?\\(.{8})?\{8(.{8})?\\(.{8})?\}
    (.{8})?\\(.{8})?\)(.{8})?\\(.{8})?\?(.{8})?\\(.{8})?\\
    (.{8})?\.(.{8})?\[(.{8})?\^(.{8})?\((.{8})?\](.{8})?\*(.{8})?\)(.{8})?\{57(.{8})?\}
  (.{8})?\\(.{8})?\)(.{8})?\\(.{8})?\{2(.{8})?\\(.{8})?\}
  (.{8})?\\(.{8})?\.(.{8})?\\(.{8})?\{12(.{8})?\\(.{8})?\}
  (.{8})?\\(.{8})?\$(.{8})?\\(.{8})?\/D(.{8})?\$(.{8})?\)(.{8})?\(){2}.{12}$/D

The basic regular expression

If lookahead is not allowed, the best I can do now is:

/\\(\\\(\\\\){2}/

which matches

\\(\\\(\\

If {m,n} quantifier is not allowed, it is impossible because nothing which can only match one string, can match a string longer than itself. Of course one can still invent something like \q which only matches /\q/, and still say expressions with that regular. But apparently nothing like this is supported by major implementations.


APL, 25 chars/bytes*

{⍉⍣⍵⊃{a,⍺⍴⍨⍴a←⍉⍪⍵}/⌽⍵↑⎕A}

Exploded view

{                   ⍵↑⎕A}   ⍝ take the first ⍵ letters
    ⊃{           }/⌽        ⍝ fold over them, using the first one as initial accum. value
            a←⍉⍪⍵           ⍝    ensure the accum. is a table, transpose it and call it 'a'
        ⍺⍴⍨⍴                ⍝    make a table as large as 'a' filled with the next letter
      a,                    ⍝    append it to the right of 'a' and loop as new accumulator
 ⍉⍣⍵                        ⍝ transpose the result as many times as the original ⍵ number

Examples

      {⍉⍣⍵⊃{a,⍺⍴⍨⍴a←⍉⍪⍵}/⌽⍵↑⎕A}¨⍳8
A AB  AB  ABDD  ABDD  ABDDFFFF  ABDDFFFF  ABDDFFFFHHHHHHHH
      CC  CCDD  CCDD  CCDDFFFF  CCDDFFFF  CCDDFFFFHHHHHHHH
                EEEE  EEEEFFFF  EEEEFFFF  EEEEFFFFHHHHHHHH
                EEEE  EEEEFFFF  EEEEFFFF  EEEEFFFFHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH
                                GGGGGGGG  GGGGGGGGHHHHHHHH

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
*: APL can be written in its own (legacy) single-byte charset that maps APL symbols to the upper 128 byte values. Therefore, for the purpose of scoring, a program of N chars that only uses ASCII characters and APL symbols can be considered to be N bytes long.