text:
Output the given English pronoun table
Output the provided table of English pronouns exactly, in as few bytes as possible.
Code rules

The code will take no input
The table is tab-delimited
Each line begins with a single tab \t if there is no row heading
Each line ends in a single newline \n (not \r\n), including the last line
There are four tabs between "Plural" and the newline (Plural\t\t\t\t\n) because it refers to the next four columns as well, but no other line has trailing tabs or spaces

Spelling rules

There is no Possessive Pronoun for "it", so the data is "-"
The only pronoun to use an apostrophe is "one's". "It's" means "it is" or "is has" and is a contraction, not a pronoun
Some people use "themself" for the singular, gender non-specific, third person, but in this table it is "themselves"
This table is not complete; other non-standard, alternate and rare forms are not included

Output
Use this link to check your output.
Pretty-printed (do not output this!)
                Singular                                                  Plural
                                   Possessive   Possessive                                   Possessive   Possessive
                Subject   Object   Determiner   Pronoun      Reflexive    Subject   Object   Determiner   Pronoun      Reflexive
First Person    I         me       my           mine         myself       we        us       our          ours         ourselves
Second Person   you       you      your         yours        yourself     you       you      your         yours        yourselves
Third Person    he        him      his          his          himself      they      them     their        theirs       themselves
                she       her      her          hers         herself
                it        it       its          -            itself
                one       one      one's        one's        oneself
                they      them     their        theirs       themselves

You misspelled "possessive" the third time.

SE breaks tabs. Here's a jsfiddle with the requested output; I think you should have something like this to ensure answers are correct.

@Pietu1998 Thanks for that suggestion. Done.

@lirtosiast Good pick-up. I forgot to change the second group of headings to match the first. Done now.

Why is the third person neutral possessive pronoun not its?

@Neil "This is my keyboard" "This is its keyboard" "This keyboard is mine" *"This keyboard is its". Although it follows the same pattern, most people would say "This keyboard belongs to it".

Bubblegum, 191 bytes
Hexdump (reversible with xxd -r), as source code contains unprintables:
00000000: a58f 3d0e c230 0c85 67e7 146c 4cdc 0221  ..=..0..g..lL..!
00000010: 3151 512e 508a 4b83 f223 d949 a1b7 274e  1QQ.P.K..#.I..'N
00000020: 5260 410c 4479 9fa3 67f9 4586 56bb 6b34  R`A.Dy..g.E.V.k4
00000030: 1d81 9cc6 44ea 8cbc 14b4 f17c c33e c0a1  ....D......|.>..
00000040: 94c6 3323 b39e 70b5 c580 64b5 43fa 741b  ..3#..p...d.C.t.
00000050: f2ce 4707 471c 0c3e 92f3 7f82 da69 e2b0  ..G.G..>.....i..
00000060: 6a90 d83b d883 45b0 33c8 5caa 8c66 803b  j..;..E.3.\..f.;
00000070: 4264 f091 44f9 91ec 0959 b5d8 7b77 5946  Bd..D....Y..{wYF
00000080: 671f 1751 0617 4ac4 f79e e49c 464d af98  g..Q..J.....FM..
00000090: 1161 d436 89ab 6c4e 0823 ce02 2bd0 54c8  .a.6..lN.#..+.T.
000000a0: d9a9 29c0 329a b6ad e28c 34ab 4087 7219  ..).2.....4.@.r.
000000b0: 36c2 ecf9 b460 d59a df2c cddf bf3d 01    6....`...,...=.

Look, someone had to do it...

Is it just my imagination or are your two example non-constant output programs on Esolang exactly the same?

@CJDennis They are the same. When given one integer as input, the program does primality testing; with 2 input integers, it adds them. (I didn't make Bubblegum, by the way; Dennis did.)

Sorry! I saw D and my brain skipped the rest! "Fails" is an interesting choice of words...

I think this wins; all this repetition makes general-purpose compression too good. Jelly's compression gets about 250.

Sorry, I broke your answer by fixing a mistake in the data. It should make your answer smaller though!


text:
Output MSB-set aligned, delimited ASCII
Write some code that takes a single string as input and outputs MSB-set aligned ASCII.
Only ASCII characters less than 128 (0x80) will be in the input. The output format is generated as follows:

For each character convert it to its binary representation, remove the MSB (always 0 in the input) and then add a delimiter-bit (X) to both ends. The value will now be 9 bits long and both begin and end in X
Output each character in order, MSB to LSB, making sure that the MSB of each output byte is either 1 or X
If the MSB of the next byte would normally be 0, output the fewest .s needed between two consecutive Xs to align the MSB with a 1 or X
Output the data as binary digits, with X for each delimiter and . for each padding bit
At the end of the data, write a . after the last X, then as many .s as necessary to complete the last byte
Separate each byte (group of 8 digits) with a single whitespace character (space, tab, newline, etc.)
A whitespace character at the end of the last output line is optional
Empty input must produce ........ as the output
Your code must work on any length strings that your language can handle and at least 255 characters

Input: Hello, World!
Bytes    -> Delimited -> * Output    Start and End of each character
01001000    X1001000X    X1001000    'H'
01100101    X1100101X    XX110010    'e'       'H'
01101100    X1101100X    1X.X1101    'l'       'e'
01101100    X1101100X    100XX110    'l'       'l'
01101111    X1101111X    1100X.X1    'o'       'l'
00101100    X0101100X    101111X.              'o'
00100000    X0100000X    X0101100    ','
01010111    X1010111X    X.....X0    ' '       ','
01101111    X1101111X    100000XX    'W'       ' '
01110010    X1110010X    1010111X              'W'
01101100    X1101100X    X1101111    'o'
01100100    X1100100X    X.X11100    'r'       'o'
00100001    X0100001X    10XX1101    'l'       'r'
                         100X..X1    'd'       'l'
                         100100X.              'd'
                         X0100001    '!'
                         X.......              '!'

The * marks the Most Significant Bit in the output. Each bit in this column is either 1 or X. Removing any number of .s would cause either a 0 or . in the MSB column. If the input was Hello, W the last byte output would be .........
As usual, lowest score wins!

Sorry, I'm not following these steps. You say the MSB is always 0, but then later you say it's either 1 or X. Also I don't see how your output suddenly grew 4 entries.

@Neil Added "in the input" to answer your first question. Each byte grows from 8 bits to 9 bits and there are padding bits in the output as well. It is aligned by the MSB (8-bit) to show how that's supposed to work.

Oh, I see now, you have to wrap the delimited bytes to 8 columns but without outputting a 0 in the left column.

@Neil Yes, neither 0 or . is allowed in the leftmost column (MSB).

Python 3, 144 140 131 130 137 bytes
Damn bugs :(
O=""
for Q in input():
 C="X%07dX"%int(bin(ord(Q))[2:])
 while"1">C[8-len(O)%8]:C="."+C
 O+=C
O+="."
while O:print((O+"."*8)[:8]);O=O[8:]

This is really straight forward.
Ungolfed with explanation
# initialize output buffer
output = ""
# loop through input
for char in input():
    # get charcode, binary, remove 0b, parse as int, format
    code = "X%07dX" % int(bin(ord(char))[2:])
    # pad code while the line starting character would be 0
    while "1" > code[8 - len(output) % 8]:
        code = "." + code
    # append result to output buffer
    output += code
# add dot to ensure padding in end
output += "."
# loop while any output is left
while output:
    # print line of output, with padding
    print((output + "." * 8)[:8])
    # remove printed output
    output = output[8:]

I'm having fun playing with your answer! I take it there's no golfier way to say import sys and then use sys.argv which is why you're using input()? Oh, never mind! I just found out I can scroll through my previous input after calling the code!

JavaScript (ES6), 187 bytes
f=(s,t=[...s].map(c=>(c.charCodeAt()*2+257).toString(2).replace(/^1|1$/g,'X')).join``)=>t.match(r=/^(.{8})*?0/)?f(s,t.replace(r,s=>s.replace(/X[01]*?$/,".$&"))):t+'.'.repeat(8-t.length%8)

Works by recursively finding 0s at illegal positions and inserting a . before the preceding X. Ungolfed:
function f(s) {
    t = '';
    for (i = 0; i < s.length; i++) {
        c = s.charCodeAt(i);
        c = c.toString(2);
        c = '000000' + c;
        c = 'X' + c.slice(-7) + 'X';
        t += c;
    }
    while (m = t.match(/^(.{8})*?0/)) {
        p = t.lastIndexOf('X', m[0].length);
        t = t.slice(0, p) + '.' + t.slice(p);
        // if one dot isn't enough, next loop will just add another
    }
    return t + '.'.repeat(8 - t.length % 8); // pad up to 8 characters
}

source: Stack Exchange

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

sort: votes


text:
When does Santa enter the basement? (AOC Day 1)
I'm reproducing the second part of the first day of Advent of Code, with permission from the creator.
Santa is trying to deliver presents in a large apartment building, but he can't find the right floor - the directions he got are a little confusing. He starts on the ground floor (floor 0) and then follows the instructions one character at a time.
An opening parenthesis, (, means he should go up one floor, and a closing parenthesis, ), means he should go down one floor.
The apartment building is very tall, and the basement is very deep; he will never find the top or bottom floors.
Given a set of instructions, find the position of the first character that causes him to enter the basement (floor -1).
As examples:
input ) causes him to enter the basement at character position 1.
input ()()) causes him to enter the basement at character position 5.
A long input is given here that should yield the solution 1797.
This is code golf, so the shortest solution wins!

Do we have to use those exact chars?

@muddyfish In the original challenges inputs were given in a specific form and so often a key part of the challenge was parsing the inputs; while I don't want this to become a "chameleon problem" I think the spirit of the original is that the input should be a string of brackets. I realise this does privilege some languages over others but I would call upon voters to take this into account when awarding upvotes to solutions.

Very closely related to Parenthifiable binary numbers ... I don't feel quite strongly enough that it's a dupe, so I'll just leave a comment instead.

@TimmyD I see what you mean but I feel like this question is different enough that competitive answers won't be able to draw too much from that question!

Can we assume that he will always reach the basement at some point?

Yes; on strings that cause him to never enter the basement, your program can output anything or nothing.

even if it's an error ?

@Erwan yes, in the original challenge I'm reproducing, there were no malformed outputs and so you don't need to consider that case in keeping with the spirit of the puzzle.

I'm trying to solve this in SMBF (basically BF), and this language SUCKS to debug... ugh.

Jelly, 8 7 bytes
O-*+\i-

Thanks to @Sp3000 for golfing off 1 byte!
Try it online!
How it works
O-*+\i-    Main link. Input: s (string)

O          Ordinal; replace each character with its code point.
           This maps "()" to [48, 49].
 -*        Apply x -> (-1) ** x.
           This maps [48, 49] to [1, -1].
   +\      Compute the cumulative sum, i.e., the list of partial sums.
     i-    Find the first index of -1.

Python 2, 44 bytes
try:input()
except Exception,e:print e[1][2]

This clever solution was found by hallvabo, xsot, mitchs, and whatisgolf on this problem on Anarchy golf. If any of you want to post it instead, I'll remove this.
The trick is to let Python's parser do the work. The function input() tries to evaluate an input string, and throws an error on the first unmatched paren. This error, when caught, has form
SyntaxError('unexpected EOF while parsing', ('<string>', 1, 1, ')'))

which includes the character number where the error took place.

Python, 79 77 Bytes
lambda m:[sum([2*(z<')')-1for z in m][:g])for g in range(len(m)+1)].index(-1)

There is probably a better way to do this, but I'm out of ideas.
Also this is my first post on codegolf.
Thanks to @Erwan. for golfing off 2 bytes.

Welcome to the site! This is a very nice first post. :)

you can replace [0:g] by [:g]

and this replacement save 1 bytes i think -2*ord(z)+81 by 2*(z<')')-1

CJam, 10 bytes
0l'_*:~1#)

or
0l'_*~]1#)

or (credits to Dennis)
Wl+'_*:~1#

Test it here.
Explanation
As A Simmons already noted, () is a lucky choice for CJam since those are the decrement/increment operators, respectively. That means if we're starting from zero we're looking for the step at which Santa reaches floor 1.
0   e# Push 0, the initial floor.
l   e# Read input.
'_* e# Riffle the input string with underscores, which duplicate the top of the stack.
:~  e# Evaluate each character, using a map which wraps the result in an array.
1#  e# Find the position of the first 1.
)   e# Increment because we're looking for a one-based index.

C, 55 bytes
g;main(f){for(;f;g++)f+=81-getchar()*2;printf("%d",g);}

Try it here.
Edit: Not sure why I left an unused variable in there...

MATL, 12 11 bytes
1 byte saved using Dennis' idea of computing -1 raised to the input string
1_j^Ys0<f1)

Try it online!
1_         % number -1
j          % take string input
^          % element-wise power. This transforms '('  to 1 and ')' to -1
Ys         % cumulative sum
0<         % true for negative values
f          % find all such values
1)         % pick first. Implicit display

Python 3, 59
Saved 3 bytes thanks to grc.
I really dislike doing manual string indexing in Python. It feels so wrong.
def f(x):
 c=q=0
 while-~c:c+=1-(x[q]>'(')*2;q+=1
 return q

Labyrinth, 18 bytes
+(+"#(!@
:  :
%2_,

Try it online! This answer was the result of collaborating with @MartinBüttner.
Explanation
The usual Labyrinth primer (I say "usual", but I actually rewrite this every time):

Labyrinth is a stack-based 2D language, with execution starting from the first valid char (here the top left). At each junction, where there are two or more possible paths for the instruction pointer to take, the top of the stack is checked to determine where to go next. Negative is turn left, zero is go forward and positive is turn right.
The stack is bottomless and filled with zeroes, so popping from an empty stack is not an error.
Digits in the source code don't push the corresponding number – instead, they pop the top of the stack and push n*10 + <digit>. This allows the easy building up of large numbers. To start a new number, use _, which pushes zero.

This code is a bit weird since, for golfing purposes, the main loop combines two tasks into one. For the first half of the first pass, here's what happens:
+(+             Add two zeroes, decrement, add with zero
                This leaves -1 on the stack
"               NOP at a junction. -1 is negative so we try to turn left, fail, and
                turn right instead.
:               Duplicate -1

Now that the stack has been initialised with a -1 on top, the actual processing can start. Here's what the main loop does.
,               Read a byte of input
_2%             Take modulo 2.
:+              Duplicate and add, i.e. double
(               Decrement
                This maps "(" -> -1, ")" -> 1
+               Add to running total
"               NOP at a junction. Go forward if zero, otherwise turn right.
:               Duplicate the top of the stack

The last duplicate adds an element to the stack for every iteration we perform. This is important because, when we hit zero and go forward at the NOP, we do:
#               Push stack depth
(               Decrement
!               Output as num
@               Terminate

Pyth, 13 bytes
f!hsm^_1Cd<zT

Explanation
              - autoassign z = input()
f             - First where V returns Truthy.
          <zT -     z[:T]
    m         -    [V for d in ^]
        Cd    -     ord(d)
     ^_1      -      -1**^
   s          -   sum(^)
 !h           -  not (^+1)

Try it here
Old algorithm, 15 bytes
f!h-/J<zT\(/J\)

Explanation:
                - autoassign z = input()
f               - First where V returns Truthy.
      <zT       -      z[:T]
     J          -     autoassign J = ^
    /    \(     -    ^.count("(")
           /J\) -    J.count(")")
   -            -   ^-^
 !h             -  not (^+1)

Try it here
Or if allowed to use chars other than ( and ), 9 bytes (moving pre-processing to input)
f!.v+<zT1

Explanation
          - autoassign z = input()
f         - First where V returns Truthy.
     <zT  -     z[:T]
    +   1 -    ^+"1"
  .v      -   eval(^)
 !        -  not ^

Try it here

JavaScript (ES6), 58 bytes
f=(s,t=s)=>s<')'?f(s.replace('()',''),t):t.length-s.length+1

Works by recursively removing a pair of matching ()s until the first character is a ). Warning: Don't try this on strings that don't have enough )s. Example:
((()())()))
((())()))
(()()))
(()))
())
)

At this point it sees that 12 characters were deleted in total so that the answer is 13.

You could put that comment into your answer instead.

Grep+AWK, 51 Bytes
grep -o .|awk '/\(/{s++}/)/{s--}s<0{print NR;exit}'

The grep command places each character on a new line.

Oracle SQL 11.2, 160 159 bytes
SELECT MIN(l)FROM(SELECT l,SUM(m)OVER(ORDER BY l)p FROM(SELECT LEVEL l,DECODE(SUBSTR(:1,LEVEL,1),'(',1,-1)m FROM DUAL CONNECT BY LEVEL<=LENGTH(:1)))WHERE p=-1;

Un-golfed
SELECT MIN(l) -- Keep the min level
FROM(
  SELECT l,SUM(m)OVER(ORDER BY l)p -- Sum the () up to the current row
  FROM(
    SELECT LEVEL l,DECODE(SUBSTR(:1,LEVEL,1),'(',1,-1)m -- ( equal 1 and ) equal -1
    FROM DUAL
    CONNECT BY LEVEL<= LENGTH(:1)
  )
)
WHERE p=-1 -- Keep the rows where the () sum is equal to -1

Retina, 22 21

!M`^((\()|(?<-2>.))+

Try it online or try the big test case. (The URL is large for the big test case, let me know if it breaks for you, seems OK in chrome.)
1 byte saved thanks to Martin!
We match the first set of balanced parentheses and extract it, then we count the number of times the empty string will match that result. I'm not sure if this is the nicest way to do this in Retina, particularly if PCRE mode makes it shorter, but using the $#_ replacement seemed to be longer because of off by one errors and the problem of having more than one match.
This algorithm causes odd behaviour for invalid input, it essentially assumes that if Santa doesn't make it to the basement, he mysteriously teleports there after the other movements.

Santa used his portal gun.

Mathematica, 62 55 bytes
Position[Accumulate[(-1)^ToCharacterCode@#],-1][[1,1]]&

All of the long function names! Works similarly to Simmons' CJam answer.

Python, 44 bytes
f=lambda s,i=1:i and-~f(s[1:],i-1+2*(s<')'))

The floor i starts at 1 so that we terminate on i being the falsey value 0. If not terminated, recursively add one to result with the first character removed and the floor number updated based on that character.

Ruby, 47 bytes
Anonymous function.
->s{i,l=-1,0;l+=s[i+=1]>?(?-1:1 while l>-1;i+1}

APL, 18 chars
{1⍳⍨¯1=+\¯1*')'=⍵}

In English:

¯1*')'=⍵: -1 where input =")", 1 otherwise;
+\: running sum;
1⍳⍨¯1=: find the index of the first -1.

Husk, 11 10 bytes
neat backwards solution with 1/2 literal from @Dominic van Essen
€.∫mȯ-.%2c

            -- implicit last parameter (⁰ variable)
         c  -- get char code
       %2c  -- get the remainder of int div 2 `( => 0, ) => 1`
     -.%2c  -- subtract 1/2 from either that 1 or 0
    ȯ-.%2c  -- compose the 3 functions [-. %2 c] together (map only takes one function)
  ∫mȯ-.%2c  -- map over all the chars and get cumulative sum
€.∫mȯ-.%2c  -- find the first index where the element is equal to 1/2

old solution: https://pastebin.com/Ut8Wne6w
Try it online!

A different 10 byte approach...

where did you find that . is 1/2? pretty strange ngl

See 'literals' section of https://github.com/barbuz/Husk/wiki/Syntax

CJam, 12 10 Bytes
0q{~_}%1#)

Try it here.
Two bytes saved thanks to Martin.
Explanation:
0              Load 0 onto the stack
 q             Load input onto the stack without evaluating
  {  }       Code block
   ~_          Evaluate the next command and duplicate the top stack element. The format of the question is good for CJam and Golfscript since ) and ( are increment and decrement operators (though the wrong way round).
        %      Map this code block over the string. This yields an array of Santa's floor positions
         1#   Find the first instance of a 1, since decrement and increment are swapped
           )  Fix the off-by-1 error caused by zero-indexing

Lua, 92 89 87 Bytes
It takes in a command-line argument.
Edit: Saved 3 Bytes
Edit: Saved 2 bytes, and corrected a bug that could happen on edge cases, it now outputs via its exit code
r=0i=0(...):gsub(".",function(c)i=i+1r=r+(c==")"and-1or 1)if r<0then os.exit(i)end end)

Ungolfed
r,i=0,0                     -- set r (the actual floor), and i(the character count)
(...):gsub(".",function(c) -- apply an anonymous functions on each character of the input
  i,r=i+1,                  -- increment i
      r+(c==")"and -1 or 1) -- decrement r if c==")", increment it otherwise
  if r<0 then os.exit(i)end -- if r==-1, exit and output the current index
end)

Perl, 34 + 1 = 35 bytes
$.+=s+.+++s+\)++while")"gt$_;$_=$.

Thanks to Dennis for some tips.
Run with the -p flag. It works in Perl 5.10, but later versions need a space here: ++ while
Older, ungolfed version:
$_ = <>;                # get a line of input
while ($_ lt ')') {     # while it begins with a (
    s/.//;              # remove the first (
    s/\)//;             # remove the first )
    $i += 2;            # increase index by 2
}
print $i + 1;           # print the position

Javascript, 117 bytes

o=f=0;i=prompt().split('');for(c in i){switch (i[c]){case '(':f++;break;case ')':f--;if(f<0){alert(o+1);i=[];}}o++;}

Ignores other characters. Uses prompt and alert.

Befunge 25 bytes
Outputs in unary. This starts you on floor one, and will go until 0.
1<\1_v#:+-*2%2~
:#._@>$1>

Javascript, 57 bytes
p=>{c=0;for(i in p){c+=p[i]==')'?-1:1;if(c<0)return+i+1}}

Pretty simple, just iterates over input, incs if '(' decs if ')'. Returns on first negative.

Racket (102)
(λ(s)(let l((c 0)(b 0)(s(string->list s)))(if(> 0 b)c(l(+ 1 c)((if(eqv?(car s)#\()+ -)b 1)(cdr s)))))

Ungolfed
(λ (input)
  (let loop ((count 0) (balance 0) (chars (string->list input)))
    (if (> 0 balance)
        count
        (loop (+ 1 count)
              ((if (eqv? (car chars) #\() + -) balance 1)
              (cdr chars)))))

k/kona, 23 21 bytes
2 bytes saved by removing unnecessary parentheses.
{1+(+\1 -1"()"?x)?-1}

Usage:
k){1+(+\1 -1"()"?x)?-1} "())"
3

BQN, 14 bytes
1+0⊐˜1+`¯1⋆-⟜@

Anonymous tacit function that takes a string and returns an integer wrapped in a unit array. Prepend ⊑ to get a plain integer instead.
Run it online!
Explanation
1+0⊐˜1+`¯1⋆-⟜@
           -⟜@  Subtract null character from each character (yields list of charcodes)
        ¯1⋆      Take -1 to the power of each
     1+`         Scan with addition (cumulative sum), starting at 1
  0⊐˜            Find the index of the first 0
1+               Add 1 because BQN uses 0-based indexing

PowerShell, 75 65 62 bytes
[char[]]$args[0]|%{$c+=(1,-1)[$_%40];$d++;if($c-lt0){$d;exit}}

Uses a similar technique as on Parenthifiable binary numbers to loop through all the input characters, keeping a running $counter of +1 for each ( and -1 for each ), then testing whether we've hit negative (i.e., we're in the basement).
Edit - saved 10 bytes by iterating over the actual characters rather than their indices
Edit 2 - saved 3 additional bytes by swapping equality check for modulo so casting is implicit

C, 73 bytes
main(f,c){f=c=0;for(;f!=-1;c++){f+=1-((getchar()&1)<<1);}printf("%d",c);}

Expects input on STDIN; no characters other than ( and ) may appear in the input (at least until we've reached the answer). Input must be ASCII.
Emits the answer on STDOUT.
Uses the 1-bit difference between the ASCII for ( and ).
/* old-style arguments, implicitly int */
main(x, f)
{
    /* c is our character counter, f is the floor*/
    c = f = 0;
    /* increase c while f is not -1 */
    for (;f != -1; c++) {
        /* use difference in LSB to add one for (, subtract one for ) */
        f += 1-((getchar()&1)<<1);
    }
    /* answer */
    printf("%d", c);
}

Nicely-formatted version:

Can you move the f=c=0 into the initialization of the loop as for(f=c=0;f!=... to save a byte?

@TimmyD better to make them global so they're auto initialized.

Python (3.5), 78 71 62 bytes
a recursive solution
f=lambda s,p=0,v=0:p if v<0else f(s[1:],p+1,v+2*(s[0]<')')-1)

it's similar to this solution for mini golf
we can assume santa always reach the basement

Javascript (ES6), 68 67 bytes
(s,r,f=0)=>s.split``.map((l,i)=>(f+=l=='('?1:-1,f<0?r=r||++i:0))&&r

Takes input as first argument
Explanation
(s, r, f=0)                                  //Gets string, declares r and f to equal undefined and 0
         =>
            s.split``                        //Splits string into character array
            .map(                            //Loops over array
                 (l, i)=>(
                         f +=                //Increment f
                         l=='(' ? 1 : -1,    //By either 1 or -1 depending on character
                         f<0 ?               //If the floor is less than 0
                         r=r||++i            //And is first time below, r equals index (+1 to make it '1 indexed not 0')
                         : 0)
                         &&r                   //Return index

Thunno 2 B, 6 bytes
u@ṡuȮ⁺

Try it online!
Explanation
u@ṡuȮ⁺  # Implicit input
        # Cast to ordinals
u@      # (-1) ** each
  ṡ     # Cumulative sums
   uȮ   # Index of -1
     ⁺  # Increment
        # Implicit output

Perl, 40 + 1 = 41 bytes
$y++,($i+=/\(/*2-1)<0&&last for/./g;$_=$y

Requires the -p flag:
$ perl -pe'$y++,($i+=/\(/*2-1)<0&&last for/./g;$_=$y' <<< '()())'
5
$ perl -pe'$y++,($i+=/\(/*2-1)<0&&last for/./g;$_=$y' 1797.txt
1797

Assumes valid input.
How it works:
                                           # -p read line by line into $_ and auto prints at the end
        $y++,                              # Counter for steps taken
             ($i+=/\(/*2-1) < 0            # The match /\(/ will give 1 or 0 in a numeric context 1 for `(` and 0 for anything else
                                           # times it by 2 and subtracting -1 will yield 1 or -1
                               && last     # End the iteration if $i < 0
for/./g;                                   # Iterate over each items in the input
                                      $_=$y# Print the output

Pip, 16 bytes
T0>Yy+vE APOaUoo

Attempt This Online! Or, here's a 17-byte equivalent in Pip Classic: Try it online!
Explanation
T0>Yy+vE APOaUoo
                  y is "" (equal to 0 in numeric contexts); o is 1; a is cmdline arg
T                 Till the following condition is truthy...
          POa      Pop the first character from the argument
         A         Get its ASCII code
      vE           -1 to that power
    y+             Plus y
   Y               Yank back into y
 0>                Test if the new value of y is negative
                  ...loop:
             Uo    Increment o
               o  After the loop, autoprint the final value of o

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

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


text:
What character is that HTML entity?
The goal is really simple. Receiving a string as input, parse all the HTML entities that correspond to the following characters (including their uppercase variants):
áàãâäéèêëíìîïóòõôöúùûüýÿ

Parsing rules:

Each entity starts with & and ends with ;
The first character after the & will be the modified character (letter case is important!)
The remaining characters refer to the name of the accent to use (acute, grave, circ, tilde and uml). The accent name MUST be in lowercase! *
Any HTML entity that produces a character that isn't on that list, or that is invalid, should be left untouched (E.g.: &, &etilde;, &a;)
Numeric entities should be ignored, since they don't fit in the rules above

This change was introduced as of 18-02-2016. All the existing answers that accept HTML entities with uppercase accent names are valid. Any future answer must follow this rule.
Examples:
á //á
Téhèh //Téhèh
an & //an &

Output:
The output can be in ISO-8859-X (1-15), windows-1252 or UTF-8/16/32.
You can pick one and only one of the valid encodings and use it for any output. You can safely assume that the input will be in ASCII.
Any of the following is a valid output for á:

á (ISO-8859-1/15 or windows-1252, equivalent to \xE1)
Ã¡ (UTF-8, equivalent to \xC3\xA1 or \u00E1)
aÌ (UTF-8, equivalent to a\xCC\x81 or a\u0301)
Any combination of diacritics, without using HTML entities.

The output has to be visually similar, when rendered/displayed, to the characters on the list.

Remember, all the standard loopholes and built-ins * are disallowed. Since this is code-golf, the shortest answer wins.
* This change was made due to the great disapproval of bonuses and penalities, and at the time of writting, doesn't invalidate any answer

I didn't vote, but I assume the downvotes are because people don't really like bonuses/penalties - They end up making one challenge into several mini-challenges.

+1 I like this challenge. But about the sandbox ... I never visit it and probably never will. Surely many other users do the same

@KevinW. As I explained in the sandbox, I only left those penalities because I want to see what cool built-in stuff people can come up with. But obviously, I don't want to spoil everybody's fun. If I didn't put the penality, an answer like the Javascript example I gave, would be enough. And that required no work at all.

@edc65 Thank you a lot for the vote. If you see something wrong, you can comment here. I will try my hardest to fix every tiny little thingy. I've made it thinking that more people would find it fun. I guess I was wrong. But 4 persons is better than 0, right?

IMHO, the bonuses seem arbitrary - either allow or don't allow, don't go in between.

@VoteToClose Which bonus would you use? I'm still open to suggestions, since no one went for them.

@IsmaelMiguel I suggest no bonuses/penalties - allow whatever programming methods they wish to use (outside of the Standard Loopholes, of course) and remove the bonuses/penalties.

@VoteToClose Done. Any more changes?

@IsmaelMiguel Nah - that was all of my cents. c:

If we choose the third option for encoding the accents, all of them will show up as Ì (although each with a different trailing unprintable). I'm guessing we must output the unprintable as well?

@ETHproductions Yes, it is part of the sequence. The important is that, whatever you pick, produces the right character on the allowed encodings.

Japt, 81 75 bytes
Ur`&([%vYy](ac©e|uml)|%v(g?ve|circ)|[AaOo]Èìe);`@Yg +'Ì+"?????"g"gutca"bYgJ

The six ?s represent unprintable chars. Test it online!
Note: This outputs the third encoding option; that is, the letter followed by the raw UTF-8 encoding of the corresponding combining diacritical mark.
How it works
Ur"&(    );"       // Replace each ampersand and semicolon that have one of these between them:
([%vYy](acute|uml) //  A vowel or Yy followed by "acute" or "uml",
|%v(grave|circ)    //  or a vowel followed by "grave" or "circ",
|[AaOo]tilde       //  or "a" or "o" followed by "tilde";
@                  // replace each match X and its middle Y with this function:
""g"gutca"bYgJ     //  Take the unprintable at index (index of the second char in Y in "gutca") in this string.
Yg +'Ì+            //  Concatenate the first char in Y and "Ì" to the beginning.
                   // Implicit output

Hexdump of the code:
00000000: 55 72 60 26 28 5b 25 76 59 79 5d 28 61 63 a9 65  Ur`&([%vYy](ac©e
00000010: 7c 75 6d 6c 29 7c 25 76 28 67 9f 76 65 7c 63 69  |uml)|%v(g.ve|ci
00000020: 72 63 29 7c 5b 41 61 4f 6f 5d c8 ec 65 29 3b 60  rc)|[AaOo]Èìe);`
00000030: 40 59 67 20 2b 27 cc 2b 22 80 81 82 83 88 22 67  @Yg +'Ì+"....."g
00000040: 22 67 75 74 63 61 22 62 59 67 4a                 "gutca"bYgJ

It seems to work nicely. Can you please provide a hexdump? You seem to have there some "weird" characters that may not work in every encoding.

@IsmaelMiguel I've just realized that the accents are not part of the ISO-8859-1 encoding; thus, I've uncompressed the string and switched to UTF-8 bytes. Would you still like a hexdump?

Up to you, but your previous solution was perfectly fine.

I think you might have a tiny bug there, your code seems to leave Ý alone, but it should be changed to Ý...

@daavko Whoops, you're right! Fixed now.

JavaScript (ES6), 141 122 134 bytes
a=>a.replace(/&([aeiouyAEIOUY](acute|uml)|[aeiouAEIOU](grave|circ)|[aoAO]tilde);/g,b=>b[1]+{g:"̀",a:"́",c:"̂",t:"̃",u:"̈"}[b[2]])

Followed daavko's example using diacritical marks, and I feel like an idiot for not thinking of using it sooner. Actually gets surprisingly short for JavaScript.
EDIT: Neil caught some bad cases of undefined, which are now fixed.

See? I told you that you could cut some fat! This is a really surprising answer! I trully hope you get more +1's

This is just clever. +1

I love it..! String.prototype.replace is so ridiculously golfable for string traversal.

I'm not convinced that this does the right thing for &EACUTE; (whatever that right thing is).

Sadly, @Neil is right. Uppercase HTML entities are considered invalid by browsers. But, I didn't specify that the accent name should be all in lowercase. That is entirelly my fault. I will consider this answer valid and all the ones that were already posted. But any new answer must have the accent names in lowercase.

@IsmaelMiguel Given that it returns Eundefined in the above case, you might want to reconsider whether the answer is valid...

@IsmaelMiguel Indeed, I don't want to be an exception; I just didn't catch that situation. I'll fix it up.

@Neil In that case, it was invalid. But the answer is not fixed.

@Mwr247 You aren't the exception. daavko's answer is working the same way, accepting &AACUTE; as a valid input.

@IsmaelMiguel I can fix that, if needed.

I don't know Retina but I don't see @daavko's answer having the same problem as this one.

@Neil it does have the same problem. It matches &AACUTE; and other uppercase entites. I've added a new version, which complies with the rule.

@daavko No, that's a different problem. Mine would return Eundefined for &EACUTE;, while yours would do the special character as though it was lowercase. Yours would be valid per the exception, mine would not, as mine was an error.

@daavko No, it isn't needed. Your answer is valid. I would have accepted the old version of this answer if it didn't returned Eundefined instead of É. Other than that, there's nothing wrong with this answer or yours.

Retina, 115 bytes
I'm new to code-golf, but I think this might work.
This version was made before the rule, which doesn't allow replacing uppercase html entities (for example &AACUTE;) was introduced.
i`&([aeiouy])acute;
$1́
i`&([aeiou])grave;
$1̀
i`&([ao])tilde;
$1̃
i`&([aeiou])circ;
$1̂
i`&([aeiouy])uml;
$1̈

Quite simple search and replace. Uses UTF-8.
Uses [letter]\xCC\x[diacritical mark hex code] approach. Diacritical mark is added after every relevant letter.
For some reason, the default Droid Sans Mono font in the interpreter can't render the "circ" and "uml" letters properly. If you change it through developer tools to something like DejaVu Sans, it shows just fine. I think this is a limitation of the font, not the program. But if it's program's fault, I'll try to fix it.
Here is a 129 byte version, which doesn't replace uppercase HTML entites (for example &AACUTE;)
&([aeiouyAEIOUY])acute;
$1́
&([aeiouAEIOU])grave;
$1̀
&([aoAO])tilde;
$1̃
&([aeiouAEIOU])circ;
$1̂
&([aeiouyAEIOUY])uml;
$1̈

Try it online!
Try it online! 129-byte version

Great use of the marks there. Can't believe I didn't think of that being shorter at first >_<

@Mwr247 Thanks! I was searching for a way to do this, since I wanted to try to do it and the marks just showed up somewhere...I'm honestly surprised it's so short.

Nice fair-play and use of the rules! I never liked this language, but I really am loving this answer. Instant +1

I counted 115 bytes (110 characters + 5 extra bytes for the marks).

@Mwr247 Oh, you're right. I just pasted it into a text document and ran ls -l and it showed 116...seems the editor added an extra newline at the end. I'll fix it.

Notice that your answer accepts HTML entities that are invalid, for example &EACUTE;. The rule was changed today, but your answer is still valid. I just wanted to point this out, in case you write a new answer that works that way. The new answer would be invalid, but this one I consider valid.

@IsmaelMiguel I've added a new version, which complies with the new rule.

@daavko It wasn't needed. But since you added the new version, just state that the "main" version was made before the rule.

JavaScript (ES6), 288 bytes
a=>(z=(b,c=1,d=2,e=3,f=0,g=4)=>({b:b+191,grave:c,acute:d,circ:e,tilde:f,uml:g}),y={a:z(0,1,2,3,4,5),e:z(8),i:z(12),o:z(18,1,2,3,4,5),u:z(25),y:z(28,0,2,0)},a.replace(/&\w+;/gi,b=>(x=y[b[1].toLowerCase()])&&(w=x[b.slice(2,-1)])?String.fromCharCode(x.b+w+32*(b[1]>'_')+153*/Yu/.test(b)):b))

Creates a character map object (with the base numeric code for each character), and uses offsets (or 0 if non-existent) to determine if an entity should be converted and what it's character code is. Symmetry in the cases means adding 32 if lowercase, except for Ÿ, where it uses a different offset for UTF8.

Nice! I really like your aproach, but 286 bytes is a bit long. Maybe there are a few things that can be cut off? Trimming some fat would be great

@IsmaelMiguel 288 actually; I just realized that there is in fact a Ÿ in UTF8: it's just in a weird place. All the same, I thought I condensed and optimized it rather well, considering a literal replace list would be over twice as long. Are you seeing something I'm not?

Not really... There must be a better way to make lowercase letters than using .toLowerCase(). That name is HUGE!!! Also, String.fromCharCode can accept multiple parameters, or be called as String.fromCharCode.call([...])

@IsmaelMiguel JavaScript's verboseness FTL as usual haha... I've tried removing the toLowerCase and related stuffs, but it requires me to map every uppercase value as well, which even when optimized still comes out over 300 characters. String.fromCharCode with multiple parameters doesn't really help either, since I only need to convert to a single character at a time, and the regex replace handles any repetition, so it's only written out once as is. If this can be made significantly shorter, it'll have to be a total rewrite, and probably done by someone better than me ;)

Well, you already did an amazing job at it. I know that, on PHP, you can do A^' ' to convert to lowercase. In Javascript, don't know any shorter way :/

@IsmaelMiguel Seems I was right about it needing a rewrite, but wrong about it needing to be someone else. I feel this answer is more interesting, but the other one is technically more concise, so I've included them both separately.

Not life-changing but your regexp contains no literal letters so it doesn't need the i flag.

@Neil I wasn't expecting that to work! Running /\w/.test`A`; confirms that you are right. Holy cow! I've learned something today.


text:
Extend the line
Task
Given an image with a line on it, produce or display an image with the line extended till the edge of image. The line is black and the background is white. The image size is 100x100 The image comes in any reasonable format (e.g. jpg, png, ppm, bmp).
Line format
I'm using a simplified version of Bresenham's line algorithm for drawing lines. Lines will only have an integer slope so that the line will never partially cover a pixel but not color it:

(Wikipedia image)
At a minimum the line will be 3x3 unless the line is straight, in which case you will only see 3x1 or 1x3 in the image. Lines will also have one side on the edge of the image, so you only have to extend it in one direction.
Example (.png, red line added so you can see it):

Real examples (.png)

====================

====================

====================

====================

Would the program have to take the image input as the filename or would it be allowed to take input in other forms? (e.g. hexdump, link, upload, copy/paste) I only ask because some programming languages would require the use of other forms of input.

I don't know of any languages that can't read a image file. Do you know a common format that I can include in the I/O section as valid?

@JAtkin can we take input as a URL?

I guess... Why would you want to?

APL (dzaima/APL), 93 bytes
{w←⍵⋄m←÷/(⊢/-⊃)p←⍸¯1≠⍵.mat⋄y x←⊃p⋄P5.size←⍵.sz⋄P5.setup←{P5.G.bg¯1⋄P5.G.ln∊{⍵,y+m×⍵-x}¨⍳101}}

Try it online!
A dfn which takes the image as an APLImg object. Taking the image as a URL is 102: Try it online!
Uses ⎕IO←0 (0-indexing).
The function effectively takes the line, calculates its equation and redraws it.
Explanation
Slope calculation:
m←÷/(⊢/-⊃)p←⍸¯1≠⍵.mat
⍵.mat get the image as an integer matrix
¯1≠ check which pixels aren't white
⍸ get all the required coordinates
p← store in p
(⊢/-⊃) subtract the last point from the first
÷/ reduce by division

y x←⊃p store the first point in y and x
P5.size←⍵.sz set canvas size to image size

Draw the image:
P5.setup←{P5.G.bg¯1⋄P5.G.ln∊{⍵,y+m×⍵-x}¨0,w.width}
P5.setup←{...} draw the following once:
P5.G.bg¯1 set the background to white
P5.G.ln∊{⍵,y+m×⍵-x}¨⍳101 draw lines between the following points:
{...}¨0,w.width get the points for each x in 0-100:
y+m×⍵-x \$y = y_1+m(x-x_{1})\$
⍵, pair the x value with that
∊ enlist so it can be drawn

Mathematica, 125 bytes
ImageRotate@Image@SparseArray[Array[Floor,101,#&@@ImageLines[ColorNegate@#,Method->"RANSAC"]]+1->0,{101,101},1][[;;-2,;;-2]]&

Explanation
ImageLines detect lines in the image with method RANSAC. We take the first detected line and convert it back to an image. The whole function takes an image as the argument and returns an image.

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


text:
Count Mills in Nine Men's Morris
Introduction
Nine Mens's Morris (also called Mills) is a board game for two players which is played on the following board (image taken from the linked Wikipedia-page):

Each player has 9 men, colored black and white. The concrete rules are not important for this challenge, but check out the Wikipedia-page if you are interested.
The Challenge
Given a grid as input, which represents a certain boardstate, output the total mill count m with 0<=m<=8.
Three men of the same color form a mill when they are in a straight row of connected points.  b2 to f2 is not a mill since the men are of different color. Also d2 to d5 would not form a mill since the three points have to be connected.
The board in the image above contains two mills for example. One from f2 to f6 and one from e3 to e5.
Input
The board is represented as a 2D grid with 24 points which are connected as shown in the example image above. The example  uses letters from a-g for the columns and numbers from 1-7 for the rows, but you may choose any reasonable input format as long as it maps 24 unique coordinates to one of the following states:

Empty
Taken by black
Taken by white

The concrete repersentation is up to  you you are not restricted to "b" or "w" for the colors.
Besides this, your input may not contain any additional information.
Additional notes

You don't have to map the points by any kind of values. If you want to take the input as a 2D array, that's fine as well. But keep in mind that not all points in there are used and that you have to consider the connections between them.
The input might be empty, in which case you have to output zero (empty board -> no mills).
Since each player has 9 men, the input will never contain more than 18 taken points.
You may leave out emtpy points in the input and therefore only input points which are taken.
The input may be ordered in any way. You can't rely on a specific order.
You may assume that the input will always be valid. This means that there won't be more than 9 men of each color and that each point will be unique.

Rules

Make clear which input format you use in your solution. Providing an example run of your program is hightly encouraged.
Function or full program allowed.
Default rules for input/output.
Standard loopholes apply.
This is code-golf, so lowest byte-count wins. Tiebreaker is earlier submission.

Test cases
The input format here is a list of tuples with the coordinates as in the example above as first element and the state of the point second element. A point taken by white is marked as "w" and a point taken by black as "b". All other points are left out and are empty.

[("a4","w"),("b2","b"),("b4","b"),("c4","b"),("d1","w"),("d2","w"),("e3","w"),("e4","w"),("e5","w"),("f2","b"),("f4","b"),("f6","b"),("g4","w")] -> 2
[("a1","b"),("a4","b"),("a7","b"),("b4","b"),("c4","b"),("d3","w"),("d2","w"),("d1","w")] -> 3
[] -> 0
[("b4", "b"),("a4",b"),("c4",w")] -> 0
[("b4", "b"),("a4",b"),("c4",b")] -> 1
[("a1", "b"),("a4", "b"),("a7", "b"),("b2", "b"),("b4", "b"),("b6", "b"),("c3", "b"),("c4", "b"),("c5", "b"),("e3", "w"),("e4", "w"),("e5", "w"),("f2", "w"),("f4", "w"),("f6", "w"),("g1", "w"),("g4", "w"),("g7", "w")] -> 8

Happy Coding!

Related - a little.

I assume the colors must be contiguous as well as aligned, but it is a bit unclear. E.g. would d2, d3, d5 of the same color form a mill?

@RobertBenson No it would not because d3 and d5 are not connected. Rules say:  Three men of the same color form a mill when they are in a straight row of connected points.. I added some examples in this section tho to make it clear, thanks for the comment!

APL (Dyalog Classic), 26 25 bytes
-1 thanks to FrownyFrog
≢{|∊(+/⍵⍪↓⍵),⊢/4 2⍴+⌿⍵}∩≢

Try it online!
The argument is a 3x3x3 array of 1(black), ¯1(white), and 0(empty).
The first dimension is along the concentric squares' nesting depth.
The other two dimensions are along the vertical and horizontal axis.
000---------001---------002
 |           |           |
 |  100-----101-----102  |
 |   |       |       |   |
 |   |  200-201-202  |   |
 |   |   |       |   |   |
010-110-210     212-112-012
 |   |   |       |   |   |
 |   |  220-221-222  |   |
 |   |       |       |   |
 |  120-----121-----122  |
 |           |           |
020---------021---------022

We have a mill whenever summation along any axis yields a 3 or ¯3, except we must discard the four corners when summing along the first axis.
{} is a function with implicit argument ⍵
↓⍵ is split - in our case it turns a 3x3x3 cube into a 3x3 matrix of nested length-3 vectors
⍵⍪↓⍵ takes the original cube and glues the 3x3 matrix of 3-vectors below it, so we get a 4x3x3 mixed array of scalars and vectors
+/ sums along the last axis; this has the combined effect of summing the original cube along the last axis (+/⍵) and summing it along the middle axis due to the split we did (+/↓⍵)
Now we must take care of the special case for the first axis.
+⌿⍵ sums along the first axis, returning a 3x3 matrix
4 2⍴ but we must not count the corners, so we reshape it to a 4x2 matrix like this:
ABC      AB
DEF  ->  CD
GHI      EF
         GH  ("I" disappears)

now we are only interested in the last column (BDFH), so we use the idiom ⊢/
, concatenates BDFH to the matrix we obtained before for the 2nd&3rd axis (BDFH and the matrix both happen to have a leading dimension of 4)
∊ flattens everything we obtained so far into a single vector
| takes the absolute values
{ }∩≢ filters only the threes - the length (≢) of the input is always 3
≢ counts them

Heh, I was just about to suggest that.

Can you join https://chat.stackexchange.com/rooms/52405/apl for a moment?

≢{|∊(+/⍵⍪↓⍵),⊢/4 2⍴+⌿⍵}∩≢ is one shorter :)

@FrownyFrog thanks! edited in

JavaScript (ES6), 276 228 125 117 105 bytes
a=>btoa`i·yø!9%z)ª»-ºü1j;ÝÈ%¥·¡ªÜ"·ç¹Ê1`.replace(/.../g,b=>(a[b[0]]+a[b[1]]+a[b[2]])/3&1||'').length

(the above contains some unprintable ascii characters that won't show up here, so here's a version without the btoa that can be copied and run)
a=>'abcdefghijklmnopqrstuvwxajvdksglpbehqtwimrfnucox'.replace(/.../g,b=>(a[b[0]]+a[b[1]]+a[b[2]])/3&1||'').length

Breaks a reference string into letter triplets that match up with mill group keys. Input is in the form of an object, where keys are the letters a-x, starting from the bottom left and ending in the top right, moving left-to-right first. Values are 1 for white, -1 for black, and 0 for blank.
Example
{b:1,d:-1,e:1,f:-1,i:1,k:-1,l:-1,m:1,n:-1,r:1,u:-1} => 2
{j:1,d:-1,k:-1,l:-1,b:1,e:1,i:1,m:1,r:1,f:-1,n:-1,u:-1,o:1} => 2
{a:-1,j:-1,v:-1,k:-1,l:-1,h:1,e:1,b:1} => 3
{} => 0
{k:-1,j:-1,l:1} => 0
{k:-1,j:-1,l:1} => 1
{a:-1,j:-1,v:-1,d:-1,k:-1,s:-1,g:-1,l:-1,p:-1,i:1,m:1,r:1,f:1,n:1,u:1,c:1,o:1,x:1} => 8

These examples are taken from OP's examples, converted to the letter-key and number-value object. The first is from the example image, while the others are from the example set.

Nice job! You could compress the big string with atob.

@ETHproductions Thanks! It seems to be using unprintable ascii characters though, so I'll include one without the btoa as well. Also found some other improvements that bring it down even more.

Mathematica, 217 131 Bytes
While I'm sure this is not particularly competitive, here's an entry for you.
Count[Total/@{{a1,d1,g1},{b2,d2,f2},{c3,d3,e3},{a4,b4,c4},{e4,f4,g4},{c5,d5,e5},{b6,d6,f6},{a7,d7,g7},{a1,a4,a7},{b2,b4,b6},{c3,c4,c5},{d1,d2,d3},{d5,d6,d7},{e3,e4,e5},{f2,f4,f6},{g1,g4,g7}}/.#/.{"w"->1,"b"->2},3|6]&

Input example:
{a4 -> "w", b2 -> "b", b4 -> "b", c4 -> "b", d1 -> "w", d2 -> "w", e3 -> "w", e4 -> "w", e5 -> "w", f2 -> "b", f4 -> "b", f6 -> "b", g4 -> "w"}

Allowing single-character coordinate names trivially golfs off 51 characters, making this a 166 byte solution. Naming the players 1 and 2 rather than "w" and "b" golfs off 17 further characters.
So we get
Count[Total/@{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,a,j,v,d,k,s,g,l,p,b,e,h,q,t,w,r,i,m,f,u,n,c,o,x}~Partition~3,3|6]/.#&

If I understand the input formatting rules correctly, you should be able to take them in as 1 and 2. the example used w and b, but I'm fairly certain we're not restricted to that.

@Mwr247 You are right. You can use any format you want, as long as it does not add additional information. I will clarify this when I'm home.

APL (Dyalog Unicode), 50 bytes
"The Objects' Solution"

While longer (29 chars) than @ngn's solution, it uses an entirely different approach: The input has the same overall structure as that solution, but all slots are represented as objects. Empty slots (including the non-existing center column) must be empty objects. while all black men must be references to the "black man" object, and all white men must be references to the "white man" object. All the objects may optionally have nice Display Forms for readability, and so the center column can optionally be made invisible.
+/1=(≢¨(,∪/,∪⌿⍤2),(⊢/4 2⍴∪⌿))

Try it online!
+/ the sum of
1=(…) ones in
 ≢¨(…) the tallys of
  , the raveled (flattened)
  ∪/ unique sets across
  , concatenated to
  ∪⌿⍤2 unique sets down
 ,(…) concatenated to
  ⊢/ the rightmost column of
  4 2⍴ the, reshaped into four rows and two columns,
  ∪⌿ unique columnar sets
An atop operator, as supplied with AGL (ä), would bring the length down to 27 characters.


text:
Sliding Capitals
The Background
Imagine the English alphabet written out in a row in capital letters -- ABCDEFGHIJKLMNOPQRSTUVWXYZ. Suppose we have a special variable-width lens such that, when placed over the row, it shows a certain "window" of the alphabet, with letters outside the lens hidden from view. Additionally, this lens has a warping characteristic, so that the first letter inside the lens, and every second letter thereafter, is lower-cased, but the remaining letters still show capitalized.
For example, we could have a lens of length 5 placed somewhere in the middle of the alphabet and we would only see .         jKlMn (leading period here to ensure whitespace shows) -- note the K and M are still capitalized, while the j, l, and n are all lower-cased. As we slide this lens from left-to-right along the alphabet, different letters would be shown and different letters capitalized. The task here is to output the resultant letters as the lens slides along the alphabet.
The Challenge
Write a program or function that takes an input integer 0 < n < 27 and outputs or returns the string(s) that are visible as the lens described above slides across the alphabet.
For values of n larger than 1, the lens begins by "hanging" off the left side of the alphabet, so only the A is shown in the right-most slot of the lens. The first line of any output will thus be a single A, either capital or lowercase depending upon the length of the lens.
Similarly, the lens finishes sliding when the Z is in the left-most slot of the lens (meaning that the very last line in any output will always be 25 spaces followed by a lowercase z).
The Examples
Input: 1
Output:
a
 b
  c
   d
    e
     f
      g
       h
        i
         j
          k
           l
            m
             n
              o
               p
                q
                 r
                  s
                   t
                    u
                     v
                      w
                       x
                        y
                         z

Input: 4
Output:
A
aB
AbC
aBcD
 bCdE
  cDeF
   dEfG
    eFgH
     fGhI
      gHiJ
       hIjK
        iJkL
         jKlM
          kLmN
           lMnO
            mNoP
             nOpQ
              oPqR
               pQrS
                qRsT
                 rStU
                  sTuV
                   tUvW
                    uVwX
                     vWxY
                      wXyZ
                       xYz
                        yZ
                         z

Input: 26
Output:
A
aB
AbC
aBcD
AbCdE
aBcDeF
AbCdEfG
aBcDeFgH
AbCdEfGhI
aBcDeFgHiJ
AbCdEfGhIjK
aBcDeFgHiJkL
AbCdEfGhIjKlM
aBcDeFgHiJkLmN
AbCdEfGhIjKlMnO
aBcDeFgHiJkLmNoP
AbCdEfGhIjKlMnOpQ
aBcDeFgHiJkLmNoPqR
AbCdEfGhIjKlMnOpQrS
aBcDeFgHiJkLmNoPqRsT
AbCdEfGhIjKlMnOpQrStU
aBcDeFgHiJkLmNoPqRsTuV
AbCdEfGhIjKlMnOpQrStUvW
aBcDeFgHiJkLmNoPqRsTuVwX
AbCdEfGhIjKlMnOpQrStUvWxY
aBcDeFgHiJkLmNoPqRsTuVwXyZ
 bCdEfGhIjKlMnOpQrStUvWxYz
  cDeFgHiJkLmNoPqRsTuVwXyZ
   dEfGhIjKlMnOpQrStUvWxYz
    eFgHiJkLmNoPqRsTuVwXyZ
     fGhIjKlMnOpQrStUvWxYz
      gHiJkLmNoPqRsTuVwXyZ
       hIjKlMnOpQrStUvWxYz
        iJkLmNoPqRsTuVwXyZ
         jKlMnOpQrStUvWxYz
          kLmNoPqRsTuVwXyZ
           lMnOpQrStUvWxYz
            mNoPqRsTuVwXyZ
             nOpQrStUvWxYz
              oPqRsTuVwXyZ
               pQrStUvWxYz
                qRsTuVwXyZ
                 rStUvWxYz
                  sTuVwXyZ
                   tUvWxYz
                    uVwXyZ
                     vWxYz
                      wXyZ
                       xYz
                        yZ
                         z

The Rules

Standard input/output rules apply
Standard loopholes disallowed
Standard code-golf rules apply
The leading whitespace as shown is required, so that we know where we're at in the alphabet.
Each line cannot have trailing whitespace (as shown - the output is not a rectangle).
A single trailing newline is optional.

Related

Pyth, 31 bytes
Vr_tQ26s.erb%+Nk2+*Nd:GeS,0N+NQ

Try it online. Test suite.
Quick and dirty.

AWK, 160 141 bytes
{d=-$1
for(m=25;i++<m+$1;print""){f="%"(++d<0?0:d<m?d:m)"s"
c=u=65
printf f,""
for(j=++E-$1;j<E&&j<26;printf(j<0?"":"%c",c+j++))c=c==u?97:u}}

Try it online!
Thanks to @ceilingcat, code rearranging helped to remove a continue statement and a total of 19 bytes

@ceilingcat I found a redundant ; in your suggestion :)

JavaScript (ES6), 130 bytes
n=>[...Array(n+25)].map(_=>[...Array(26)].map(_=>String.fromCharCode(j++<i|i+n<j?32:j+(j-i)%2*32),++i,j=64).join``,i=64-n).join`\n`

Where \n represents the literal newline character. Works by looping over the output rectangle and outputting spaces outside the diagonal while adding 32 to the character code to lower case it in alternate squares. Using replace appears to be 1 byte longer:
n=>[...Array(n+25)].map(_=>' '.repeat(26).replace(/./g,s=>j++<i|i+n<j?s:String.fromCharCode(j+(j-i)%2*32),++i,j=64),i=64-n).join`\n`

Jelly, 21 bytes
ØAżØaU¡ṁ€µJR;"z⁶Ḋḣ"JY

Try it online!
How it works
ØAżØaU¡ṁ€µJR;"z⁶Ḋḣ"JY - Main link. Takes an integer n on the left
ØA                    - Uppercase alphabet
   Øa                 - Lowercase alphabet
  ż                   - Zip; [['A', 'a'], ['B', 'b'], ...]
      ¡               - Do n times:
     U                -   Reverse each pair
                        This means we have a leading capital for even n,
                        or a trailing capital for odd n
        €             - Over each pair:
       ṁ              -   Mold it to length n
         µ            - Begin a new link with this list of characters C
          J           - Yield [1, 2, ..., 26]
           R          - Yield [[1], [1, 2], ..., [1, 2, ..., 26]]
            ;"        - Concatenate each of these ranges with the lists in C
              z⁶      - Transpose, filling with spaces
                Ḋ     - Remove the first line
                 ḣ"J  - Remove the trailing integers from each line
                    Y - Join with newlines

Python 3, 105 bytes
lambda n:[(i-n)*' '+''.join(chr(97+j-(j^i^n)%2*32)[:-1<j<26]for j in range(i-n,i))for i in range(1,26+n)]

Try it online!

Unfortunately, the question specifies "Each line cannot have trailing whitespace (as shown - the output is not a rectangle)", so I think you'll need to add some way of striping trailing spaces

@cairdcoinheringaahing thanks, fixed

Japt -R, 21 20 bytes
;B¬£îXpv éU)iYçÃÕmx1

Try it or run all test cases
;B¬£îXpv éU)iYçÃÕmx1     :Implicit input of integer U
;B                       :Uppercase alphabet
  ¬                      :Split
   £                     :Map each X at 0-based index Y
    î                    :  Repeat and slice to length U
     Xp                  :    Append to X
       v                 :      Its lowercase
         éU              :    Rotate right U times
           )             :  End repeat
            i            :  Prepend
             Yç          :    Y spaces
               Ã         :End map
                Õ        :Transpose
                 m       :Map
                  x1     :  Trim right
                         :Implicit output joined with newlines

It looks like the question specifies "Each line cannot have trailing whitespace (as shown - the output is not a rectangle)", which I think from your interpreter link this does have trailing spaces?

Thanks, @cairdcoinheringaahing - fixed for now at a cost of 3 bytes.

Charcoal, 14 bytes
ＵＴＦＮ«Ｐ↘⎇﹪ι²αβ↑

Try it online (verbose) or try it online (pure).
Explanation:
Toggle trim so the output won't contain any trailing spaces to comply to the challenge rules. Charcoal will make the output a rectangle by default:
ToggleTrim();
ＵＴ

Loop the input amount of times:
For(InputNumber()){ ... }
ＦＮ«

Print in a down-right diagonal direction without moving the cursor:
Multiprint(:DownRight, ...);
Ｐ↘

Print the uppercase alphabet if the loop index is odd, or the lowercase alphabet if it's even (b/β is a variable that contains the lowercase alphabet by default and a/α is a variable that contains the uppercase alphabet by default):
Ternary(Modulo(i, 2), a, b)
⎇﹪ι²αβ

And then move the cursor one position up for the next iteration:
Move(:Up);
↑

05AB1E, 22 bytes
₂Iи2.ýžpA«RŽR‘S.Λ„
¶:

Try it online.
Or alternatively:
₂2‚Iи¨ARÂu«ŽR‘S.Λ„
¶:

Try it online.
Explanation:
This program uses the Canvas builtin Λ to draw the output. This builtin takes three arguments:

Length of the lines we'll draw: the list [26,2,26,2,...,26] in this case:

        #(alternative 1)
₂       # Push 26
 Iи     # Repeat it the input amount of times as list
   2.ý  # Intersperse it with 2
        #(alternative 2)
₂2‚     # Pair 26 with 2: [26,2]
   Iи   # Repeat this list the input amount of times
     ¨  # And remove the trailing 2

Character/string to draw: the string "zyxwvutsrqponmlkjihgfedcbaABCDEFGHIJKLMNOPQRSTUVWXYZ" in this case:

        #(alternative 1)
žp      # Push builtin string "ZYXWVUTSRQPONMLKJIHGFEDCBA"
  A«    # Append builtin string "abcdefghijklmnopqrstuvwxyz"
    R   # Reverse this string to "zyxwvutsrqponmlkjihgfedcbaABCDEFGHIJKLMNOPQRSTUVWXYZ"
        #(alternative 2)
A       # Push builtin "abcdefghijklmnopqrstuvwxyz"
 R      # Reverse it: "zyxwvutsrqponmlkjihgfedcba"
  Â     # Bifurcate it (short for Duplicate & Reverse copy)
   u    # Uppercase the reversed copy "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    «   # Append it: "zyxwvutsrqponmlkjihgfedcbaABCDEFGHIJKLMNOPQRSTUVWXYZ"

The direction to draw in: [7,0,3,0]. The digits in the range [0,7] each represent a certain direction:

7   0   1
  ↖ ↑ ↗
6 ← X → 2
  ↙ ↓ ↘
5   4   3

So the [7,0,3,0] in this case translates to the directions \$[↖,↑,↘,↑]\$:
ŽR‘     # Push compressed integer 7030
   S    # Convert it to a list of digits: [7,0,3,0]

     Λ  # Use the Canvas builtin with the three pushed arguments,
        # after which the result is implicitly output immediately afterwards

Unfortunately, the Canvas builtin adds trailing spaces to make it a rectangle by default, so we'll have to remove those to comply to the challenge rules:
   .Λ   # Use the modifiable Canvas builtin instead
„ \n    # Push the string " \n"
    ¶   # Push the builtin string "\n"
     :  # And keep repeating " \n" with "\n" until there are no longer any left
        # (after which the result is output implicitly)

Here a step-by-step explanation of the output for input \$n=3\$:
Step 1: Draw 26 characters ("zyxwvutsrqponmlkjihgfedcba") in direction 7↖:
a
 b
  c
   d
    e
     f
      g
       h
        i
         j
          k
           l
            m
             n
              o
               p
                q
                 r
                  s
                   t
                    u
                     v
                      w
                       x
                        y
                         z

Step 2: Draw 2-1 characters (A) in direction 0↑:
A
a
 b
  c
   d
    e
     f
      g
       h
        i
         j
          k
           l
            m
             n
              o
               p
                q
                 r
                  s
                   t
                    u
                     v
                      w
                       x
                        y
                         z

Step 3: Draw 26-1 characters ("BCDEFGHIJKLMNOPQRSTUVWXYZ") in direction 3↘:
A
aB
 bC
  cD
   dE
    eF
     fG
      gH
       hI
        iJ
         jK
          kL
           lM
            mN
             nO
              oP
               pQ
                qR
                 rS
                  sT
                   tU
                    uV
                     vW
                      wX
                       xY
                        yZ
                         z

Step 4: Draw 2-1 characters ("z") in direction 0↑:
A
aB
 bC
  cD
   dE
    eF
     fG
      gH
       hI
        iJ
         jK
          kL
           lM
            mN
             nO
              oP
               pQ
                qR
                 rS
                  sT
                   tU
                    uV
                     vW
                      wX
                       xYz
                        yZ
                         z

Step 5: Draw 26-1 characters ("yxwvutsrqponmlkjihgfedcba") in direction 7↖:
a
Ab
aBc
 bCd
  cDe
   dEf
    eFg
     fGh
      gHi
       hIj
        iJk
         jKl
          kLm
           lMn
            mNo
             nOp
              oPq
               pQr
                qRs
                 rSt
                  sTu
                   tUv
                    uVw
                     vWx
                      wXy
                       xYz
                        yZ
                         z

See this 05AB1E tip of mine (section How to compress large integers?) to understand why ŽR‘ is 7030.
See this 05AB1E tip of mine for an in-depth explanation of the Canvas builtin.

Doesn't the Canvas builtin pad lines to a rectangle? Unfortunately, the question says "Each line cannot have trailing whitespace (as shown - the output is not a rectangle)" (Edit: I think this also applies to your Charcoal answer as well)

@cairdcoinheringaahing Ugh.. Should be fixed now, thanks for noticing.

@cairdcoinheringaahing My Charcoal answer should be fixed now as well.

Scala, 137 bytes
Golfed version. Try it online!
n=>(1 to 25+n).map{i=>(" "*(i-n))+((i-n to i-1).map{j=>val c=97+j-((j^i^n)%2)*32;if(j>=0&&j<26)c.toChar.toString else""}.mkString)}.toSeq

Ungolfed version. Try it online!
object Main {
  def main(args: Array[String]): Unit = {
    for(n <- List(1, 4, 26)) {
      f(n).foreach(println)
      println()
    }
  }

  def f(n: Int): List[String] = {
    (1 until 26 + n).map { i =>
      (" " * (i - n)) + ((i - n until i).map { j =>
        val c = 97 + j - ((j ^ i ^ n) % 2) * 32
        if (j >= 0 && j < 26) (c).toChar.toString else ""
      }.mkString)
    }.toList
  }
}


text:
"Finish work" as early as possible
Background
Imagine for a moment that you have a mind-numbingly boring job.
Every morning, you are given a collection of tasks that you should work on that day.
Each task has a certain duration, and once started, it must be completed in one go.
Your boss will not tolerate idling, so if there are tasks that you could still complete before going home, you must work on one of them (you can choose which one).
Conversely, if all remaining tasks would require you to work overtime, you get to go home early!
Thus your goal is to minimize the length of your workday by clever scheduling.
Fun fact: this is one variant of the lazy bureaucrat scheduling problem, and it is NP-hard (source).
Input
You have two inputs: the number of "time units" in your workday (a positive integer L), and the collection of tasks (a non-empty array of positive integers T, representing task durations).
They can be taken in any order, and in any reasonable format.
The array T may contain tasks with duration more than L, but it is guaranteed to contain at least one task with duration at most L.
Output
A valid schedule is a subset of tasks S ⊆ T such that sum(S) ≤ L, and every task not in S (counting multiplicities) has duration strictly more than L - sum(S).
Your output shall be the smallest possible sum of a valid schedule.
In other words, you shall output the minimal number of time units you must work today.
Example
Consider the inputs
L = 9
T = [3,4,4,4,2,5]

One way of scheduling your day is [4,4]: you finish two tasks in 8 time units, and have 1 unit left.
Since no 1-unit tasks are available, you can go home.
However, the schedule [2,5] is even better: you work for 7 time units, and then all remaining tasks would take 3 or more time units.
The schedule [2,4] is not valid, since after working for 6 time units, you'd still have enough time to finish the 3-unit task.
7 units turns out to be optimal, so the correct output is 7.
Rules and scoring
You can write either a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.
There is no time bound, so brute forcing is perfectly acceptable.
Test cases
These are given in the format L T -> output.
 1 [1,2] -> 1
 6 [4,1] -> 5
 7 [7,7,9] -> 7
 9 [3,4,4,4,2,5] -> 7
20 [6,2,3,12,7,31] -> 17
42 [7,7,7,7,8,8,8] -> 36
42 [7,7,7,7,7,8,8,8] -> 35
42 [7,7,7,7,7,7,8,8,8] -> 36
16 [1,2,3,4,5,6,7,8,9,10] -> 13
37 [15,27,4,1,19,16,20,26,29,18] -> 23
22 [24,20,8,8,29,16,5,5,16,18,4,9] -> 18
80 [10,22,11,2,28,20,27,6,24,9,10,6,27,2,15,29,27] -> 71
59 [26,28,5,4,7,23,5,1,9,3,7,15,4,23,7,19,16,25,26] -> 52

Jelly, 20 bytes
³œ-;⁴Ṃ;¹S>⁴
ŒPÇÐfS€Ṃ

Try it online!
TIO is fast enough to finish the last test cases within its 60 second time limit, even if just barely.
Background
The algorithm is both simple and inefficient:

We generate all subsets of T, counting multiplicities.
We filter the the subsets, keeping only those those subsets S that satisfy one of the following criteria:

S is different from T, and the sum of the elements of S and the minimal element not in S is larger than L.
S and T are identical.

The filtered T (let's call it T') now contains all lists of task that do just enough work (or even some overtime).
Of all S in T', pick the one with the lowest sum.

How it works
ŒPÇÐfS€Ṃ     Main link. Left input: T (list). Right input: L (integer).

ŒP           Powerset; generate all subsets of T.
   Ðf        Filter them...
  Ç            applying the helper link.
     S€      Compute the sum of each kept subset.
       Ṃ     Take the minimum.

³œ-;⁴Ṃ;¹S>⁴  Helper link. Input: A (subset of T)

³œ-          Multiset subtraction; remove the elements of A from T, counting
             multiplicities.
   ;⁴        Append L to the resulting list.
     Ṃ       Take the minimum.
             If S == T, the difference was empty and the minimum is L.
      ;¹     Prepend the minimum to A.
        S    Compute the sum.
         >⁴  Compare it with L.
             If S == T, the comparison will return 1.

Pyth, 26 25 bytes
JEhSsMf&gJsT>hS.-QT-JsTyQ

Try it online. Test suite.
I haven't been able to run the last two test cases (they time out online, I assume), but all the others work. This is just a basic brute force solution.

Ruby, 124 bytes
->(m,s){
f=proc{|l,t|t.reject!{|x|x>l}
(0...(t.size)).map{|x|
f.call(l-t[x],t[0,x]+t[(x+1)..-1])
}.max||l
}
m-f.call(m,s)
}

This is a brute-force solution.

MATL, 36 bytes
iTFinZ^!"2G@2#)sXKt1G>~wb+lG>A*?KhX<

Try it online!
i           % input number L
TF          % array [true, false]
in          % input array T. Get its length
Z^!         % Cartesian power and transpose. Each column is a selection from T
"           % for each selection
  2G@2#)    %   take non-selected and then selected tasks
  sXK       %   sum of selected tasks. Copy to clipboard K
  t1G>~     %   duplicate. Is sum of selected tasks <= L?
  wb        %   swap, rotate
  +         %   sum of selected tasks plus each non-selected task
  lG>A      %   are all of those numbers greater than L?
  *         %   are both conditions met?
  ?         %   if so
    Kh      %     paste current minimum (or initially L), append new value
    X<      %     compute new minimum
            %   end if implicitly
            % end for each implicitly
            % display stack implicitly


text:
The Holy Numbers
In many fonts (specifically in the Consolas font), 5 out of the 10 decimal digits have "holes" in them. We will call these holy digits:
46890

The 5 unholy digits are thus:
12357

An integer may thus be classified as "holy" if it only contains holy digits, and "unholy" otherwise. Because - is unholy, no negative integers can be holy.
Holy integers may be further classified based on how many holes they have. For example, the following digits have a holiness of 1:
469

And these digits have a holiness of 2:
80

We say that the overall holiness of an integer is the sum of the holiness of its digits. Therefore, 80 would have a holiness of 4, and 99 would have a holiness of 2.
The Challenge
Given two integers n > 0 and h > 0, output the nth holy integer whose holiness is at least h. You may assume that the inputs and outputs will be no greater than the maximum representable integer in your language or 2^64 - 1, whichever is less.
Here is a list of the first 25 holy integers with holiness h >= 1, for reference:
0, 4, 6, 8, 9, 40, 44, 46, 48, 49, 60, 64, 66, 68, 69, 80, 84, 86, 88, 89, 90, 94, 96, 98, 99

The first 25 holy integers with holiness h >= 2 are:
0, 8, 40, 44, 46, 48, 49, 60, 64, 66, 68, 69, 80, 84, 86, 88, 89, 90, 94, 96, 98, 99, 400, 404, 406

Related - 1 2

i was sitting here for like thirty seconds thinking "how the heck does 0 have a holiness of two" before i finally clicked on the wikipedia link to Consolas

Is the fifth 1-Holy number 9 or 40?

@CᴏɴᴏʀO'Bʀɪᴇɴ 9. It's the fifth number in the list, at index 4 (starting from 0, of course).

Ah, okay. Wasn't sure if "n"th referred to index or ordinal. Thanks!

Related 3 http://codegolf.stackexchange.com/q/51877/31716

Is it just coincidence that the 8th 8+-holy number is 8888? (yes, it probably is, but it amused me anyway...)

In fact, since you can have any number of leading 0's before a number, one could make the case that 0 is infinitely holy.  Although ∞ is apparently just as holy.  But strangely, 666 is even holier...

Hey - don't exclude 2 - some people write it with a hole.

Pyth, 32 bytes
e.fg*g.{`46890J`Z++lJ/J`8/J`0QE0

Explanation
                                 - autoassign Q = eval(input())
 .f                           E0 -  first eval(input()) terms of func V starting Z=0

     g.{`46890J`Z                -    Are all the digits in Z in "46890"?
               `Z                -      str(Z)
              J                  -     autoassign J = ^
     g                           -    is_subset(V,^)
      .{`46890                   -     set("46890")

    *                            -   ^*V (Only return non-zero if only contains holy numbers)

                 ++lJ/J`8/J`0    -    Get the holiness of the number
                   lJ            -      len(J)
                  +              -     ^+V
                     /J`8        -      J.count("8")
                 +               -    ^+V
                         /J`0    -     J.count("0")
   g                         Q   -  ^>=Q (Is the holiness great enough)
e                                - ^[-1]

Try it here
Takes input in the form h \n n

Ruby, 109 105 95 82 bytes
->n,h{(?0..?9*99).select{|x|x.count('469')+2*x.count('80')>=h&&/[12357]/!~x}[n-1]}

This is the terrible "calculate from 0 to 99999999999..." approach that happens to be 13 bytes shorter than its lazy counterpart. However, this version is unlikely to finish before the heat death of the universe. Worth 13 bytes, anyway ¯\_(ツ)_/¯
You can test it for smaller values by changing ?9*99 to, say, '99999'.
Here's the old version (95 bytes, with lazy evaluation, which runs near-instantly rather than near-never):
->n,h{(?0..?9*99).lazy.select{|x|x.count('469')+2*x.count('80')>=h&&/[12357]/!~x}.first(n)[-1]}

->n,h{
(?0..?9*99)  # range '0' (string) to '9' repeated 99 times, way more than 2**64
.lazy        # make the range lazy, so we can call `select' on it
.select{|x|  # choose only elements such that...
 x.count('469')+2*x.count('80')  # naive holiness calculation
 >=h         # is at least h
 &&/[12357]/!~x                  # naive "is holy" calculation
}
.first(n)    # take the first n elements that satisfy the condition
[-1]         # choose the last one from this array
}

Gotta love lazy evaluation :)

Why not take instead of first?

@NotthatCharles take returns Lazy, which can't be indexed into.

Python 3, 103
lambda n,h,l='4698080':[y for y in range(2**64-1)if(sum(l.count(x)-(x not in l)for x in str(y))>=h)][n]

Here's a solution that uses a more memory efficient approach, but otherwise uses the same algorithm if you want to test it.
l='4689080'
def f(n,h):
 c=i=0
 while i<n:
  if sum(l.count(x)-(x not in l)for x in str(c))>=h:u=c;i+=1
  c+=1
 return u

Test cases:
assert f(3, 1) == 6
assert f(4, 2) == 44

@Mego Cool. It seems to use a static amount of memory, so it's not in danger of running out of memory. I just wasn't sure since it's been running on my machine for half an hour already.

It actually takes a decent chunk of time just to calculate 2**64-1; see http://stackoverflow.com/questions/34113609/why-does-python-preemptively-hang-when-trying-to-calculate-a-very-large-number

@Mego Oh, I didn't even think about that. Yeah, when I put the precomputed constant into the code, it starts chewing through a bit of RAM.

PowerShell, 163 150 141 101 98 96 bytes
param($n,$h)for(--$i;$n){if(++$i-notmatch"[12357]"-and($i-replace"8|0",11).Length-ge$h){$n--}}$i

Takes input, then loops until $n is zero. We initially setting $i=-1 by using a pre-processing trick, which works because $i, having not previously been declared, is $null. Then we -- it, which causes PowerShell to evaluate it as $i = $null - 1, which is $i=-1.
Each loop we increment $i and then execute a lengthy if statement. The first part of the conditional verifies that $i doesn't have any of 12357 in it by using the -notmatch operator, to filter out the unholy numbers.
The second part of the conditional checks the quantity of holes in $i. It uses the -replace operator to replace each 8 or 0 with 11, and then compares whether the length is >= $h. We don't need to worry about stripping out the unholy numbers, since that's in the first part of the conditional, and the single-holed numbers are the same length as 1 anyway, so we don't need to replace them, either.
If that is still truthy, we decrement $n (as that means we've found another number that satisfies input requirements). Thus when the for condition is recalculated to check if $n is zero, that means we've found the nth one, so we exit the for loop, output $i and terminate.
Edit -- saved 13 bytes by using an array instead of string for $l and changing how $n is decremented/checked
Edit 2 -- saved an additional 9 bytes by checking for $n in the for conditional and moving the output outside the loop
Edit 3 -- saved a whopping 40 more bytes by radically changing how we calculate the holes
Edit 4 -- saved an additional 3 bytes by moving the ++ to be a pre-increment on the first part of the conditional
Edit 5 -- saved another 2 bytes thanks to TessellatingHeckler

Neat. Save another couple of bytes by changing to for(--$i;$n) and -replace"8|0" ?

@TessellatingHeckler Yes, thank-you. That $i=-1 was driving me absolutely bonkers. I'm still trying to work out a way so we don't have to initialize $i in the first place, but things I've tried so far are longer (and, now given this, will likely be longer yet).

CJam, 36 34 bytes
Thanks to aditsu for saving 2 bytes.
Wq~:X;{{)_Ab39643Zbf=_:*g*1bX<}g}*

Test it here.

R, 109 107 bytes
f=function(n,h){m=-1;while(n){m=m+1;if(!grepl("[12357]",m))if(nchar(gsub("([08])","\\1\\1",m))>=h)n=n-1};m}

With new lines and indentations:
f=function(n,h){
    m=-1
    while(n){
        m=m+1
        if(!grepl("[12357]",m))
            if(nchar(gsub("([08])","\\1\\1",m))>=h)
                n=n-1
    }
    m
}

Usage:
> f(4,3)
[1] 68
> f(4,2)
[1] 44
> f(6,2)
[1] 48
> f(10,2)
[1] 66

99 bytes...

Bash + GNU utilities, 67

20 bytes saved thanks to @TobySpeight!

seq 0 NaN|sed -r "h;/[12357]/d;s/8|0/&&/g;/^.{$1}/!d;x"|sed $2!d\;q

seq simply generates integers starting from 0 upwards
sed -r:

h copy the input line to the hold space
/12357/d delete unholy numbers
s/8|0/&&/g replace doubly holy digits with twice themselves. Thus singly holy digits are counted once and doubly holy digits are counted twice.
/^.{$1}/!d If not matching at least $1 holes, delete and continue to the next line
x bring original number back to the pattern space
implicit print

sed

$2!d on any lines before line $2, delete and continue to the next line
q must be at line $2 - quit (and implicit print)

Ideone.

Shave 9: sed -r "h;/[12357]/d;s/8|0/&&/g;/^.{$1}/!d;x".  And another 4: sed $2!d\;q.  And if you're happy with an upper bound of just 4611686018427387904, you could get away with seq 0 $[1<<62]

Ooh, my seq accepts NaN as a value: I now have seq 0 NaN|sed -r "h;/[12357]/d;s/8|0/&&/g;/^.{$1}/!d;x"|sed $2!d\;q, scoring 67.

@TobySpeight wow thats amazing!

@TobySpeight : missing a \ before the !, otherwise: -sh: !d\: event not found

@OlivierDulac \ before ! is not needed in a script.  It is only needed when running this directly on the command-line, which I don't think is a requirement.

MATL, 39 40 bytes
x~q`QtV4688900V!=stA*s2G<?T}N1G=?F1$}tT

Inputs are n and h in that order.
Try it online!
We need to keep track of two numbers: current candidate number (to check its holiness) and amount of numbers found that are holy enough. The first is the top od the stack, and the latter is kept as the number of elements in the stack. When the program finishes, only the top needs to displayed.
x~q          % implicitly take two inputs. Delete one and transform the other into -1
`            % do...while loop
  Q          %   add 1 to current candidate number
  tV         %   duplicate and convert to string
  4688900V!  %   column char array of '4', '6' etc. Note '8' and '0' are repeated
  =          %   compare all combinations. Gives 2D array
  s          %   sum of each column: holiness of each digit of candidate number
  tA*        %   are all digits holy? Multiply by that
  s          %   sum of holiness of all digits, provided they are all holy
  2G<        %   is that less than second input (h)?
  ?          %   if so: current candidate not valid. We'll try the next
    T        %     push true to be used as loop condition: next iteration
  }          %   else: current candidate valid
    N1G=     %     does stack size equal first input (n)?
    ?        %     if so: we're done
      F1$    %       push false to exit loop. Spec 1 input, to display only top
    }        %     else: make a copy of this number
      tT     %       duplicate number. Push true to continue with next iteration
             %     implicit end if
             %   implicit end if
             % implicit end do...while. If top of stack is truthy: next iteration
             % implicit display

JavaScript (ES6), 110 bytes
f=(n,h,r=[],i=0)=>r.length<n?f(n,h,/[12357]/.test(i)|[...''+i].reduce((t,c)=>t+1+!(c%8),0)<h?r:[...r,i],i+1):r

Tail recursive solution that accumulates holy numbers in an array.
Out of interest, not requiring the number to be wholly(!) holy makes the holiness count more awkward, but it still saves 10% overall:
f=(n,h,r=[],i=0)=>r.length<n?f(n,h,[...''+i].reduce((t,c)=>+"2000101021"[c]+t,0)<h?r:[...r,i],i+1):r

@edc65 Whoops, I swapped over the i and r parameters at one point, and failed to edit the change in correctly.

JavaScript ES6, 191 bytes
Sure, this isn't the most efficient way. But you know me, I love generators <3
H=(x,o=x+"")=>(F=/^[46890]+$/).test(o)&&[...o].map(y=>d+=(F.test(y)+/8|0/.test(y)),d=0)&&d;(n,h)=>(a=(function*(h){q=0;while(1){if(H(q)>=h)yield q;q++}})(h),eval("a.next().value;".repeat(n)))

Slightly ungolfed:
H = (x, o = x + "") => (F = /^[46890]+$/).test(o) && [...o].map(y => d += (F.test(y) + /8|0/.test(y)), d = 0) && d;
Q = (n, h) => (a = (function*(h) {
    q = 0;
    while (1) {
        if (H(q) >= h) yield q;
        q++
    }
})(h), eval("a.next().value;".repeat(n)))

Lua, 155 141 140 Bytes
Takes both inputs by command-line argument(first argument is n, then h)
Edit: Thanks to @DavisDude, who helped me shaving 14 bytes off and reminded me I didn't have to print all the holy numbers up to n, but only the nth.
a={}x=0while(#a<arg[1])do b,c=(x..""):gsub("[08]","")e,d=b:gsub("[469]","")a[#a+1],x=c*2+d>=arg[2]and #e<1 and x or nil,x+1 end print(a[#a])

Ungolfed and explanations
x,a=0,{}                      -- initialise a counter, and the array which
                              -- contains the holy numbers found
while(#a<arg[1])              -- iterate while we found less holy numbers than n
do
  b,c=(x..""):gsub("[08]","") -- replace [08] by "", b=the new string
                              -- c=the number of subsitution
  e,d=b:gsub("[469]","")      -- same thing for [469]
  a[#a+1]=c*2+d>=arg[2]       -- insert the number into a if:nb[08]*2+nb[469]>h
             and #e<1         -- and e is empty (no unholy numbers)
             and x or nil
      x=x+1                   -- increment x
end
print(a[#a])                  -- print the last element of a

You could take off some chars by doing print(a[arg[1]])

@DavisDude I was dumb, when I wrote this, I though I had to print out the entire list of unholy numbers up to n. Actually, print(a[#a]) saves even more bytes. Thanks for the comment !

You are write. For some reason that didn't even occur to me.

You can take off one char by writing x=0a={} instead of x,a=0,{}.

@KennyLau Actually, you can't because 0a would be interpreted as an hexadecimal number, but I can do a={}x=0while without a problem :)

C# 6, 168 bytes
(n,h)=>{for(int i=0;i<=int.MaxValue;i++){string d=$"{i}";if(d.Any(y=>"12357".Contains(y)))continue;n-=d.Sum(y=>y=='0'||y=='8'?2:1)>=h?1:0;if(n==0)return i;}return -1;}

This is a Lambda Expression of type Func< int, int, int>.
This code is otimized for min size (not performatic).
Below, the beautified code in method declaration (with more performance):
    int GetHolyNumber(int n, int h)
    {
        for (int i = 0; i <= int.MaxValue; i++)
        {
            string d = $"{i}";
            char[] cs = "12357".ToArray();
            if (d.Any(y => cs.Contains(y))) continue;

            n -= d.Sum(y => y == '0' || y == '8' ? 2 : 1) >= h ? 1 : 0;

            if (n == 0)
                return i;
        }
        return -1;
    }

Hi Bobson, sorry if I misunderstood, but do not detect faults that you pointed out in my code? It returns the nth element required, and only he, and zero if it is valid, assuming that the inputs are n = 1 and h <= 2.
If I understand the challenge, must return only this one element and not all up to him. But I have misunderstood me and lost in English :D thanks

No, you're entirely right.  I was mislead by the lists-for-reference, and missed the fact that it was just asking for the nth digit.  Carry on!

JavaScript (ES6), 87
(n,h)=>eval("for(i=0;[...i+''].map(d=>r-=~!(d%8),r=0),/[12357]/.test(i)|r<h||--n;)++i")

Less golfed
f=(n,h)=>{
  for (i=0;
    // this is the loop condition
    /[12357]/.test(i) // go on if not holy
    ||([...i+''].map(d=>r-=~!(d%8),r=0),r<h) // go on if not holy enough
    ||--n; // ok, found one! go on if we need to find more
  )
    ++i; // loop body - using eval this is the returned value
  return i; // not using eval, an explicit return is needed
}

Test

f=(n,h)=>eval("for(i=0;[...i+''].map(d=>r-=~!(d%8),r=0),/[12357]/.test(i)|r<h||--n;)++i")

function test() {
  var a,b
  [a,b]=I.value.match(/\d+/g)
  R.textContent = f(a,b)
}

test()
N, H: <input id=I value="25 2" oninput="test()"> >>

Jelly, 23 22 bytes
“J,1’D=þD§S×ẠƊ
0Ç<Cɗ#Ṫ

Try it online!
How it works
0Ç<Cɗ#Ṫ - Main link. Takes h on the left and n on the right
    ɗ   - Group the previous 3 links into a dyad f(k, h):
 Ç      -   Call the helper link on k
  <     -   Less than h?
   C    -   Complement; 0 -> 1, 1 -> 0
0    #  - Count up k = 0, 1, 2, ... until n k's return true under f(k, h)
      Ṫ - Take the last k

“J,1’D=þD§S×ẠƊ - Helper link. Takes an integer k on the left
        D      - Digits of k
“J,1’          - Compressed integer 4698800
     D         - Converted to digits
       þ       - Outer product with:
      =        -   Equality
         §     - Sum of each row
             Ɗ - Group the previous 3 links into a monad g(s) over the sums:
          S    -   Sum
            Ạ  -   All are non-zero?
           ×   -   Product
                 This calculates the holiness of k, which is 0 if k isn't holy

Oracle SQL 11.2, 229 bytes
WITH v(c,p,i,j,n)AS(SELECT 0,-1,0,0,0 FROM DUAL UNION ALL SELECT c+1,c,REGEXP_COUNT(c||'','[4,6,9]'),REGEXP_COUNT(c,'[8,0]'),n+DECODE(LENGTH(p),i+j,DECODE(SIGN(i+j*2-:h),-1,0,1),0)FROM v WHERE p<c AND n<:n)SELECT MAX(p)-1 FROM v;

Un-golfed
:h -> required min holy value
:n -> nth number

curv   -> current number
precv  -> previous number
prech1 -> number of holy 1 letters in previous number
prech2 -> number of holy 2 letters in previous number
n      -> how many numbers with at least the required holy value

WITH v(curv,precv,prech1,prech2,n)AS
(
  SELECT 0 curv, -1 precv, 0 prech1, 0 prech2, 0 n FROM DUAL     -- Start with 0
  UNION ALL
  SELECT curv+1,   -- Next number
         curv,     -- Current Number
         REGEXP_COUNT(curv||'','[4,6,9]'),  -- number of holy 1 letters
         REGEXP_COUNT(curv,'[8,0]'),        -- number of holy 2 letters
         n+DECODE(LENGTH(precv),prech1+prech2,DECODE(SIGN(prech1+prech2*2-:h),-1,0,1),0) -- Is the previous number holy enough ?
  FROM   v
  WHERE  precv<curv   -- Needed to trick oracle cycle detection
         AND n<:n     -- Until clause
)
SELECT MAX(precv)-1 FROM v

Haskell, 94 bytes
c is the holiness of a digit, v the holiness of a number, n!h does the rest.
c=([2,0,0,0,1,0,1,0,2,1]!!)
v n|n>9=c(mod n 10)+v(div n 10)|1<2=c n
n!h=[i|i<-[0..],v i<=h]!!n

Note: I think this is the only answer without the characters 4,6,8.

Python 2, 96 bytes
f=lambda n,h,k=0,s="0046889":-0**n or-~f(n-(sum(map(s.count,`k`))>=h<set(str(k))<=set(s)),h,k+1)

The holyness condition on k is checked by

sum(map(s.count,`k`))>=h, which counts the number of holes by summing the counts for each character in s="0046889", where 0 and 8 appear twice.
set(str(k))<=set(s)), which checks that the numbers are all holy. str is used rather than backticks to avoid the suffix L for longs.

These are chained into a single equality using the Python 2 fact that numbers are smaller than sets.
The function is defined recursively to count up numbers k, decreasing the counter n each time a holy number of hit unless it hits 0. It could then return the k that triggered this, but it's shorter to keep the count recursively by adding 1 each time, though an off-by-one requires a base count of -1 to fix.

Lua, 169 bytes
function a(n,h)H=0N=0I=-1while N<n do I=I+'1'H=0 if not I:find('[12357]') then _,b=I:gsub('[469]',1)_,c=I:gsub('[08]',1)H=b+2*c end N=H>=h and N+1 or N end print(I) end

Ungolfed:
function a(n,h) -- nth term, holiness
    H=0N=0I=-1 -- Really ugly, but hey, it works. Set up 3 vars
    while N<n do -- While nth term is lower than desired term
        I=''..I+1 -- Convert number to string (can't coerce since it will become a float)
        if not I:find('[12357]') then -- If the number doesn't have those numbers
            _,b=I:gsub('[469]',1) -- _ is the new string, b is the number of changes
            _,c=I:gsub('[08]',1) -- Same as above. Use 1 to replace to save chars
            H=b+2*c -- Increase holiness appropriately
        end
        N=H>=h and N+1 or N -- If current holiness >= desired holiness, increment N
    end
    print(I) -- Once the loop ends, print the current term
end

Swift
func f(n: Int, h: Int) {
    var m = 0
    let a = [1,2,3,5,7]
    for j in 0..<Int.max {
        var c = 0
        for i in (j.description.characters.map{(String($0) as NSString).integerValue}) {
            c += (a.contains(i)) ? 0 : (i == 8 || i == 0) ? 2 :1
        }
        if c >= h { m += 1; if m >= n {print(j); break}}
    }
}

Perl 5 -ap, 58 bytes
$_=0;$n=<>;$_++while/[12357]/||y/64980//+y/80//<"@F"||--$n

Try it online!
Input is on two lines with h on the first and n on the second.