text:
Should we be friends?
Note this is a question primarily focusing on data-structures
Introduction
Bacefook wants people to be friendlier! As such, they are implementing a new system to suggest friends! Your task is to help Bacefook to implement their new suggesting system.
Specifications:
Your program must be a REPL (read-eval-print loop) supporting 3 types of command: FRIEND, SUGGEST and KNOW.
FRIEND X Y - Specifies that X and Y are friends in the social network.

If X is friends with Y, then Y is friends with X

Can, but doesn't have to have output

X is always friends with X

KNOW X Y - Output a truthy value if X and Y are friends, falsy otherwise

KNOW X X will always output a truthy value

SUGGEST X Y - Output a truthy value if X and Y should be friends, falsy otherwise. X and Y should be friends if:

X and Y are not friends

X and Y have at least 1 friend in common

You are allowed to replace FRIEND, SUGGEST and KNOW with your own strings, but you must mention what string you have replaced each command with.
Your program can take in input/produce output in any way desirable, as long as it is reasonably easy to recognize how it works.
The number of people in the social network N is between 1 and 100,000, but there may be any number of "friend links" (edges).

 If you haven't noticed yet, this is a graph searching problem. The (likely) easiest (and possibly fastest) data structure to implement this in would be an adjacency matrix.

Test cases
FRIEND A B
FRIEND A C
FRIEND B D
SUGGEST A B -> Falsy, as they are friends
SUGGEST A D -> Truthy, as they share B as a common friend
SUGGEST C D -> Falsy, they do not share a common friend
KNOW D B -> Truthy, they are friends
KNOW B C -> Falsy, not friends
=============
FRIEND Tom Tim
KNOW Tom Tim -> Truthy
KNOW Tim Tom -> Truthy
KNOW Tom Kit -> Falsy
=============
KNOW Tim Kit -> Falsy
FRIEND Tim Tom
KNOW Tim Kit -> Falsy
FRIEND Tom Kit
SUGGEST Tim Kit -> Truthy
=============
FRIEND X Y
SUGGEST X Y -> Falsy since X is friends with X

Here's some more test cases in image form
Win condition
This is code-golf, shortest code wins!

So for example, can we start by inputting a list of all people in the network, like {A, B, C, D}?

@GregMartin Nope. That's the fun part of the challenge :)

Having the test cases in text form would be way more helpful.

@GregMartin Would you rather I put them such that all of the input statements are in 1 block and all of the output statements are in another for easy comparison? Or the arrows are fine?

Thanks! While my personal preference is to separate the input statements from the output statements, I feel I'm in the PPCG minority and more people prefer the arrow versions that you've made.

This challenge screams Prolog.

When you say "your program must be a REPL" does that mean it could use the REPL of the language's interpreter, as is done in the Prolog answer? or does the program have to implement the reading, evaluating, and printing itself? the wording does not make it perfectly clear.

Can we have output after the FRIEND command?

@ovs I'll... go with yes

@quintopia It can use the language's interpreter. Useful in languages like Haskell or in this case Prolog, but an extra problem for C-type languages.

SUGGEST UK EU.

@Thunda in Python, using the built-in REPL requires two extra characters in the command. Should languages like this add those extra bytes to the total length of the program?

@quintopia Yes.

@thedarkwanderer FRIEND X Y SUGGEST X X should return falsy because X is friends with X, it's inferred from KNOW X X is truthy. I'll add in a clarification.

@Thunda ah, I figured know X X being truthy was merely special behaviour.  Makes more sense.

@WBT ==>  null

SWI-Prolog, 62 47 41 bytes
X*Y:-X+Y;Y+X;X==Y.
X?Y:-not(X*Y),X*Z,Y*Z.

Prolog isn't too often useful, but when it is it's just beautiful. We'll use a+b to notate that a is friends with b, a*b that a knows b and a?b that b should be suggested to a or not. The first line simply says that X*Y is true if either X+Y, Y+X or X == Y is true. This implements the symmetry of knowing eachother. Asking if there should be a suggestion is incredibly simple. We just ask if there is a Z such that X*Y is false and X*Z and Y*Z is true. Exactly as described in the challenge.
If you save this as a file (e.g. friends.pl) and open SWI-Prolog with this file (prolog -l friends.pl) you get dropped into a REPL.
You can assert friendships like this:
assert('a' + 'b').
assert('a' + 'c').
assert('b' + 'd').

You can check if people know eachother or suggestion should be made:
'a'*'b'.
'a'?'d'.

You should be able to save a bunch of bytes replacing k(X,Y) with X*Y and the same with f and s using different operands. 21 bytes if I've counted correctly.

Not sure how they work with asserts though, so I'm unsure about f.

Completely farts through the data structure designing part of the question. Amazing.

@Emigna I've implemented it, but it didn't save as much as you counted.

I tested it like this at 41 bytes. I don't have a REPL to try it in though so I don't know if it works different there.

@Emigna Ah, I'm not too familiar with Prolog so I didn't know you could define an infix predicate like that.

I didn't know it either before I started golfing on this site (prolog was the language I first golfed in). It is a pretty cool feature.

PHP, 138 133 129 bytes
PHP beats Mathematica - a rare occurence.
for(;$s=fgets(STDIN);$s>G?print$$a[$b]?$s<L:$s>L&&@array_intersect_key($$a,$$b):$$a[$b]=$$b[$a]=1)[,$a,$b]=explode(" ",trim($s));

prints 1 for truthy, empty string for falsy. Run with -nr or test it online.
needs PHP 7.1 for the list assignment; user names are case sensitive and should exclude a, b, s.
breakdown
for(;$s=fgets(STDIN);                       # loop through input
    $s>G                                        # 2. evaluate command
        ?print$$a[$b]
            # command KNOW: true if $$a[$b]
            ?$s<L
            # command SUGGEST: true if !$$a[$b] and array_intersect_key returns truthy
            :$s>L&&@array_intersect_key($$a,$$b)
        # command FRIEND: set keys in $$a and $$b
        :$$a[$b]=$$b[$a]=1
)
    [,$a,$b]=explode(" ",trim($s));             # 1. parse user names to $a and $b

$s has to be trimmed because it includes the newline character.
array_intersect_key has to be muted or it would yield warnings for empty $$a or $$b.
+18 +15 bytes for all user names: Replace $$a with $f[$a] and $$b with $f[$b].

CMD (Batch), 50 + 20 + 135 = 205 bytes

FRIEND.CMD
@for %%f in (%1.%1 %1.%2 %2.%2 %2.%1)do @set %%f=1

KNOW.CMD
@call echo(%%%1.%2%%

Prints 1 for friends, a blank line for strangers.
SUGGEST.CMD
@call set k=0%%%1.%2%%
@set k=1&if %k%==0 for /f "tokens=2 delims=.=" %%f in ('set %1.')do @call set k=%%k%%%%%%f.%2%%
@echo(%k:~1,1%

Prints 1 or a blank line. I think six consecutive %s might be a new personal best.

That's crazy awesome. Nice solution.

Python 3, 163 149 143+2=145 bytes
-6 bytes thanks to @FelipeNardiBatista
l=[]
def f(a,b):l.extend([(a,b),(b,a)])
k=lambda a,b:a==b or(a,b)in l
s=lambda a,b:k(a,b)-1and{c for c,d in l if d==a}&{c for c,d in l if d==b}

Save it to a file and run it as python3 -i file.py
Use
 - f("a", "b") instead of FRIENDS a b
 - k("a", "b") instead of KNOW a b
 - s("a", "b") instead of SUGGEST a b
Falsey output : 0, set(), False
Truthy output : non-empty set, True
Try it online

164 bytes when not using python interpreter as REPL:
f=[]
while 1:c,a,b=input().split();i=(a,b)in f;f+=c=="f"and[(a,b),(b,a)]or[(i+(a==b),-i+1and{c for c,d in f if d==a}&{c for c,d in f if d==b})];print(f[-1][c=="s"])

Uses
 - f for FRIEND
 - s for SUGGEST
 - anything else for KNOW
Try it online

Suggest function is broken for the second link

@Thunda fixed it

Correct me if I'm missing something, but instead of l.extend([(a,b),(b,a)]), can't you just do l+=[(a,b),(b,a)]? (I haven't tested this yet)

Oh sorry, I realized my mistake, that causes an UnboundLocalError. Nice answer by the way!

if you remove bool() from the s function, and use 0, {} and False as Falsey and True and a not empty set as Truthy, you could save 6 bytes

You can save around 20 bytes with s=lambda a,b:k(a,b)-1and{c for c,d in l if d==a&d==b} Try it online!!

What does the -i do?

Python 3, 122 118+2=120 bytes
l={}
def f(*r):l[r]=l[r[::-1]]=1
k=lambda a,b:a==b or(a,b)in l
s=lambda a,b:1-k(a,b)and any(k(a,z)&k(b,z)for z,_ in l)

Usage is exactly the same as ovs's answer.

It's pretty obvious to me, but the requirements say you need to specify how to use your REPL and with what commands. May be useful to those who don't know python. (Incidentally, this is exactly the method I would have used.)

Mathematica, 164 bytes
f={}
p:=Union@@f
i=Position[p,#][[1,1]]&
m:=Outer[Boole@MemberQ[f,{##}]&,p,p]
a=(#[[i@#2,i@#3]]/._@__->0)>0&
F=(f=#~Tuples~2~Join~f;)&
K=m~a~##&
S=a[m.m,##]&&!K@##&

Defines three main functions F, S, and K with the desired behavior. For example, the sequence of commands
F@{David, Bob}
F@{Bob, Alex}
F@{Alex, Kitty}
F@{Daniel, David}
F@{David, Kit}
S[David, Alex]
S[Bob, Kitty]
S[David, Kitty]
S[David, Bob]
K[David, Bob]
F@{Kit, Kitty}
S[David, Kitty]

is the last test case from the image linked in the OP; the F commands yield no output (the single semicolon seems a small price to pay for this), while the six S and K commands yield
True
True
False
False
True
True

as desired.
At any moment, f is the list of ordered pairs of the form {A, B} where A knows B, while p is the list of people appearing in some element of f. Calling F@{A, B} adds the four ordered pairs {A, B}, {B, A}, {A, A}, and {B, B} to f.
Also, at any moment, m is the adjacency matrix of the underlying graph (a person is adjacent to themselves and to all their Friends); the rows and columns are indexed by p, and i converts a person to the corresponding row/column number. The helper function a takes a matrix and two people as inputs and looks up the entry of the matrix whose "coordinates" are the two people, returning True if the number is positive and False if it's zero. (It's also possible to call a when one of the input people isn't yet recognized—for example, making a KNOW or SUGGEST query before any FRIEND declarations, or asking about some poor person who has no friends; this throws errors, but the rule /._@__->0 forces the output to be False anyway.)
Calling K[A, B] therefore looks up whether m[A, B] is positive, which implements the Know verb. The matrix product m.m is the length-2-path matrix, containing the number of ways to go from one person to another along a path of length 2; this allows S[A, B] to implement the Suggest verb, as long as we additionally check by hand (&&!K@##) that the input people don't already know each other.
Fun fact: for free, this implementation allows us to declare cliques of friends—the command F@{A, B, C, D} is equivalent to all of F@{A, B}, F@{A, C}, F@{A, D}, F@{B, C}, F@{B, D}, and F@{C, D} combined.

Python 2, 118 bytes
F=[]
def s(f,c):c=set(c);r=c in F;return F.append(c)if f%2 else not r^(4 in[len(x|c)for x in F])if f else 2>len(c)or r

Try it online!
Since I couldnt find repl online tool for python 2, I've added the TIO Nexus(in REPL format).
Query for option and its possible output
0 for Known - None
1 for Friends - True or False
2 for Suggest - True or False
Example of usage and sample output in an repl python interpreter.
>>> F=[]
>>> def s(f,c):c=set(c);r=c in F;return F.append(c)if f%2 else not r^(4 in[len(x|c)for x in F])if f else 2>len(c)or r
...
>>> s(1,['A','B'])
>>> s(1,['A','C'])
>>> s(1,['B','D'])
>>> s(2,['A','B'])
False
>>> s(2,['A','D'])
True
>>> s(2,['C','D'])
False
>>> s(0,['D','B'])
True
>>> s(0,['D','C'])
False

GNU sed, 158 + 2(rn flags) = 160 bytes
Since sed is a regex based language, there are no primitive types, not to mention abstract data structures. The network data is stored as free format text, in this case as redundant friend links like A-B;B-A;etc., which is then matched against various regex patterns.
G
/^F/{s:. (.+) (.+)\n:\1-\1;\1-\2;\2-\1;\2-\2;:;h}
/^K |^S /{s:(.) (.+) (.+)\n.*\2-\3.*:\1:;/^K$/p}
/^S /s:(.) (.+) (.+)\n.*(.+)-(\2.*\4-\3|\3.*\4-\2).*:\1:p

Try it online!
By design, sed runs the whole script for each input line. I recommend testing in interactive mode, to see the output of a command immediately after typing.
Usage: there are no truthy / falsy values in sed, so the output convention I use is borrowed from bash, whereby a non-empty string is considered as truthy, and an empty string as falsy.

F X Y for FRIEND X Y. It has no output.
K X Y for KNOW X Y. Outputs 'K' as truthy, and nothing as falsy.
S X Y for SUGGEST X Y. Outputs 'S' as truthy, and nothing as falsy.

Explanation:
G
# append stored network data, if any, to the current input line
/^F/{
# if command is 'F' (FRIEND), for ex. 'F X Y'
   s:. (.+) (.+)\n:\1-\1;\1-\2;\2-\1;\2-\2;:
   # generate friend links, for ex. 'X-X;X-Y;Y-X;Y-Y'
   h
   # store updated network data
}
/^K |^S /{
# if command is either 'K' (KNOW) or 'S' (SUGGEST), for ex. 'K X Y'
   s:(.) (.+) (.+)\n.*\2-\3.*:\1:
   # search friend link 'X-Y'. If found, delete pattern except the command letter.
   /^K$/p
   # if only letter K left, print it (command is 'K', 'X' and 'Y' are friends)
}
/^S /
# if command is 'S', for ex. 'S X Y', but 'X' and 'Y' aren't friends
   s:(.) (.+) (.+)\n.*(.+)-(\2.*\4-\3|\3.*\4-\2).*:\1:p
   # search if 'X' and 'Y' have a friend in common (for ex. 'C'), and if so print
   #letter S. The search is for ex. 'C-X.*C-Y' and 'C-Y.*C-X'.


text:
Convert Binary to Text
Your task is to write a program, which takes a binary input and converts it to plain text. For Example:
01100001 01100010 01100011 = "abc"

Rules

Input can come from STDIN, function arguments, command line argument, file, whatever suits you.
The program can be a function, full program,  whatever works, really, as long as no external uncounted code/arguments are needed to run it.
You can assume that the input is valid.
The length of the input is not limited
You can assume that all blocks are seperated with whitespaces

Test Cases
01010100 01100101 01110011 01110100 = "Test"
01001000 01100101 01101100 01101100 01101111 = "Hello"
01010111 01101111 01110010 01101100 01100100 00001101 00001010 = "World"
01000101 01111000 01100001 01101101 01110000 01101100 01100101 00001101 00001010 = "Example"
01100010 01101001 01101110 00001101 00001010 = "bin"

This is code-golf, so the shortest solution wins.

Do mean we can or we must assume that all blocks are separated with whitespaces?

@Dada you can

Why does this look related to the binary heart challenge? Most answer there is just a text to binary converter.

What input formats are allowed? For example, an 8-column matrix of zeros and ones? A 2D array of chars?

Can I take the binary blocks with no separator (no space)?

@seshoumara Yes, you can.

You should really wait a few days to weeks before picking an accepted answer. What if someone manages shorter than 4 bytes in a few hours or days?

Why is the dc answer accepted at all? The 05AB1E answer was first.

05AB1E, 4 bytes
#CçJ

Uses the CP-1252 encoding. Try it online!

dc, 4 bytes
Needs as input the binary blocks with no separator. This is allowed by the OP.
2i?P

Try it online!
Explanation: using the "abc" example as test case

2i? sets 2 as input radix, then reads the line (output radix is 10 by default). This converts the binary input to decimal: 011000010110001001100011 -> 6382179.
P is a special printing mode that assumes a base 256 number, using its "digits" as ASCII codes: 6382179 = (97 * 256 2) + (98 * 256 1) + (99 * 256 0) -> abc

Perl 5, 15 bytes
14 bytes of code + -p flag.
The input must be supplied without final newline (with echo -n for instance).
$_=pack"B*",$_

Try it online!

JavaScript (ES6), 52 bytes
s=>String.fromCharCode(...s.split` `.map(s=>`0b`+s))

sed and dc, 23, 19 bytes
sed 's/.*/2i&P/'|dc

Why not just 's/.*/2i&P/'?

@Neil: good point

Pyth, 7 Bytes
smCid2c

Takes input as string.
Try it!

Python 2, 49 bytes
Try it online
lambda S:''.join(chr(int(c,2))for c in S.split())

Do you need the '0b'+ as well as the ,2?

@Neil Yes, chr() accepts only [0-255] integers and binary in python represented like 0bxxxxxx. So first I need to add 0b to binary blocks and then convert them into basic int to get chars. While converting, I need to specify base of input - 2.

@ovs Oh, thats true! Unintuitive :)

You can save 3 bytes by  using list comprehension! Try it online!

@KeerthanaPrabhakaran Good one! I've saved even more. Thanks

RProgN 2, 10 bytes
û{$-2Bo}r.

Explained
û          # Split the implicit input by Spaces.
 {     }r  # Replace each element in a list based on a function.
  $-2B     # Convert from Base 2
      o    # Get the ordinal of the character.
         . # Concatenate the list.

Try it online!

CJam, 10 bytes
l:~8/2fb:c

Try it online!
Explanation
l    e# Read input.
:~   e# Evaluate each character, resulting in a flat list of bits.
8/   e# Split into chunks of 8 bits.
2fb  e# Convert each from binary to an integer.
:c   e# Convert each integer to a character.

Mathematica, 50 bytes
FromCharacterCode[#~FromDigits~2&/@StringSplit@#]&

Röda, 36 35 bytes
{split|chr parseInteger(_,radix=2)}

Try it online!
This is an anonymous function that reads the input from the stream and prints the result.
It uses three builtins:

split splits the input at whitespaces
parseInteger converts a binary string to an integer value
chr converts an integer to a Unicode character

Gema, 33 characters
<D><s>=@int-char{@radix{2;10;$1}}

Sample run:
bash-4.3$ gema '<D><s>=@int-char{@radix{2;10;$1}}' <<< '01010000 01010000 01000011 01000111'
PPCG

Gema, 31 characters
Using no delimiter in the input.
<D8>=@int-char{@radix{2;10;$1}}

Sample run:
bash-4.3$ gema '<D8>=@int-char{@radix{2;10;$1}}' <<< '01010000010100000100001101000111'
PPCG

Ruby, 36 characters
->b{b.gsub(/\d+ ?/){$&.to_i(2).chr}}

Sample run:
irb(main):001:0> ->b{b.gsub(/\d+ ?/){$&.to_i(2).chr}}['01010000 01010000 01000011 01000111']
=> "PPCG"

PHP <5.3, 53 Bytes
Idea by @manatwork
foreach(split(" ",$argv[1])as$v)echo chr(bindec($v));

PHP, 55 Bytes
I prefer cause it can work without spaces
foreach(str_split($argv[1],9)as$v)echo chr(bindec($v));

without spaces change 9 to 8 for 7 bits 7
foreach(explode(" ",$argv[1])as$v)echo chr(bindec($v));

PHP >=7, 62 Bytes
<?=join(($a=array_map)(chr,$a(bindec,explode(" ",$argv[1]))));

Is this PHP 7? Can't make it work due to a syntax error.

Yes, but before you were able to use the deprecated split() function, so the length would be the same.

Uhm, I also tried str_split(), but is the same length as explode(). And both are 2 characters longer than split(). [insert confused smiley here]

@manatwork I think I was the only confused one. I like it not make post with deprecated functions. I mean str_split in combine with the foreach loop is the best solution cause it can handle other inputs with little changes

C (clang), 43 bytes
f(**v){*v&&f(v+!!putchar(strtol(*v,0,2)));}

Try it online!

@ceilingcat, nice but we could have simply used strtol.

Jelly, unfinished
I still haven't figure out how to repeat for every line in STDIN, or get amount of lines in STDIN in Jelly. So far though, I came up for a solution for a single line/character.
ɠO_48ḄỌ

Any help is appreciated!

source: Stack Exchange

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

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

sort: votes


text:
Two roads diverged in a yellow wood (part 2)
This is the second in a series, the third is Two roads diverged in a yellow wood (part 3)
This is based on Two roads diverged in a yellow wood (part 1), a previous challenge of mine. It was fairly well received, but it was also fairly trivial (a Java answer in 52 bytes!) So I made something more complex...
The inspiration
This challenge is inspired by Robert Frost's famous poem, "The Road Not Taken":

Two roads diverged in a yellow wood,
  And sorry I could not travel both
  And be one traveler, long I stood
  And looked down one as far as I could
  To where it bent in the undergrowth;
...2 paragraphs trimmed...
I shall be telling this with a sigh
  Somewhere ages and ages hence:
  Two roads diverged in a wood, and I —
  I took the one less traveled by,
  And that has made all the difference.

Notice the second to last line, I took the one less traveled by,. Your goal is to find the road least travelled by in your string input. You must output one of 2 values that are distinct from each other that signal which way you should turn to take the road less traveled by. Once the road forks (the trail of hexagons changes to numbers) you are at the intersection. From there, there will be 2 paths made up of digits. The path whose digits has the lowest sum will be the road not taken. Note that the road not taken may have a larger path but a lower path sum. Here are some examples / test cases from a program that prints "left" or "right" for the path not taken:
 1     2
  1   2
   1 2
    #
    #
    #
left (3 < 6)

 1     2
  2   2
   1 1
    #
    #
    #
left (4 < 5)

 12    2
  11  2
   1 1
    #
    #
    #
right (6 > 5)

 99   989
  99  89
  99 99
  99 99
    #
    #
    #
   #
left (72 < 79)

1111 1110
 001 111
  11 11
  11 11
    #
   ##
  ##
 ##
left (9 < 10) (Note: 1111 is interpreted as 1+1+1+1=4, not 1111=1111)

1       1
 0     1
  1   1
  1   1
  1   1
  1   1
   1 1
    #
    #
    #
     #
      #
left (6 < 7)

1   1
 0   1
  1   1
  1   1
  1   1
  1   1
   1 1
    #
    #
    #
     #
      #
left (6 < 7)

Things to assume & remember

There will always be 2 paths. No more, no less.
You can take input from STDIN one line at a time, a string containing LF characters, or a string containing a literal backslash and a n. If you need input in any other way, ask for approval in the comments.
You don't have to worry about invalid input or tied paths. Those will never be inputted to your program / function.
The input can be of any length in width or height, less than the string limit of your language.
There will never be a # and a number in the same line.
All digits in the path are positive integers 0 to 9.
Input or output with a trailing newline is allowed.
See my JS ES6 answer below for an example.
There will always be at least 1 space between the 2 paths.
The 2 paths will always have the same height for each map, but may be different on other maps.
If you are confused about a specific test case, please tell me.
1111 is interpreted as 1+1+1+1=4, not 1111=1111. The map is a series of one-digit numbers, not numbers of arbitrary length.
This is code-golf, so the shortest answer in bytes wins!
Standard loopholes forbidden

If you have any questions about this challenge, ask me in the comments, and good luck!

Hey, you can see all the answers and their byte count by pasting $("div > h1").map(function(){return $(this).text()}).get().join("\n"); into your console!

Here's a alternative version with removed whitespace and ignored strikedthrough answers let answers = $('div > h1').map(function(){return $(this).clone().children(':not(a)').remove().end().text().replace(/\s+/g,' ').trim()}).get();answers.splice(0, 1);answers.join('\n');

A # is not a hexagon...

Closevotes again? What the hell is wrong with you?

05AB1E, 21 15 bytes
Outputs 0 for left and 1 for right.
|vy#õK€SO})øO`›

Try it online!
Explanation
|v                # for each line in input
  y#              # split on spaces
    õK            # remove empty strings
      €S          # split each string into a list of chars
        O         # sum each sublist
         }        # end loop
          )ø      # wrap stack in a list and zip
            O     # sum each sublist (side of the tree)
             `›   # compare left to right

13 bytes.

Retina, 28 bytes
\d
$*
%r`1\G
-
Os`.
+`-1

1+

Try it online!
Prints 0 for left and 1 for right. Assumes that there are not trailing spaces on any lines.
Explanation
\d
$*

Convert each digit N to a run  of N ones.
%r`1\G
-

One each line (%), match consecutive (\G)  ones from the end (r) and replace each of them with - (i.e. turn the right branch into -s).
Os`.

Sort all characters, so that all -s are directly in front of all 1s.
+`-1

Repeatedly cancel a pair of - and 1.
1+

Try to match at least one 1 (if so, there were more weights in the left path).

Chip, 216 bytes
 EZ,Z~.
E~]x-.|
F].>vm'
Ax]}#----------------.
Bx]}#---------------.|z.
Cx]}#------------.,Z|##' E
Dx]}#---------.,Z|`@@('A~^~t
 E.>#------.,Z|`@@-('
A~S`#v--.,Z|`@@-('
*f,--<,Z|`@@-('
e |,Z|`@@-('
,Z|`@@-('
>@@-('
a

Try it online!
A little bigger than the answer for part 1...
Overview
Chip is a 2D language inspired by actual circuitry, and it deals with the component bits of each byte in a byte stream.
This solution keeps a running sum of the digits it sees, flipping the sign of the input each time it encounters a stretch of whitespace, then terminating upon the first #. So, for input
 11   12
  2   2
   1 1
    #
    #
    #

We get 1 + 1 - 1 - 2 + 2 - 2 + 1 - 1 = -1. The sign of the result is given as the output, a negative number produces the result 1, and positive is 0.
Therefore, output of 1 means that the left path is less taken, and 0 means right.
Explanation
At a high level, this is how it works:
The main diagonal with the @ elements is the accumulator, output is decided by the a at the bottom. (Eight pairs of @ means eight bits, but the highest bit is the sign, so this solution can handle a maximum difference of +127 or -128. Overflowing partway through is okay, as long as we come back before terminating.)
The four lines that start like Ax]}#--... are reading the input, and in the case of a digit, negating it (if necessary) and passing the value into the adders.
The first three lines decide if we are looking at a digit, or a sequence of whitespace, and keep track of whether the digits need to be negated.
The remaining elements wedged in under the inputs and the elements at far right handle the termination condition, and map the output to ASCII (so that we get characters '0' or '1' instead of values 0x0 or 0x1. This ASCII mapping required no extra bytes, otherwise I wouldn't have included it.)

I like that the code kinda looks like two diverging roads.

@Laikoni I hadn't even noticed, that is kinda cool :)

Python 2, 95 89 88 87 bytes
Here is my first go at this in python.  Definitely not optimal but a decent start.
f=lambda x,i:sum(sum(map(int,y))for y in x.split()[i::2]if"#"<y)
lambda x:f(x,1)>f(x,0)

Try it online!

I think you can replace "#"!=y with "#"<y

JavaScript (ES6), 55 bytes
x=>x.replace(/\d(?=.*( )|)/g,(d,s)=>t-=s?d:-d,t=0)&&t<0

Assumes there are no trailing spaces on each line, and outputs true for right, false for left. The trick is to match each digit in the input, and if there is a space after it on the same line, subtract it from the total; otherwise, add it to the total. If the final total is less than 0, the right road is the one less traveled by, and vice versa.
Try it out:

f=x=>x.replace(/\d(?=.*( )|)/g,(d,s)=>t-=s?d:-d,t=0)&&t<0
<textarea placeholder = "paste in a map here..." oninput = "document.querySelector('div').innerText = f(this.value)"></textarea>

You need to put a x= at the beginning, because expressions are not allowed, only functions stored as a variable and whole programs.

@programmer5000 Why?  It seems a little bit strange to override the defaults and it doesn't seem to indicate that this is the case in the question.

@programmer5000 Actually, unnamed functions are allowed by default. (Thanks for the snippet, btw)

Python 3, 85 94 bytes
import re
g=lambda s,i:sum(map(int,''.join(re.findall('\d+',s)[i::2])))
lambda s:g(s,0)>g(s,1)

Try it online!
Curses! Didn't read the problem close enough. Added a the fix (''.join()), but at the cost of 9 bytes.

So close! Good catch, thanks!

Python 2, 78 bytes
-1 byte thanks to @math_junkie
Try it online
def F(S,r=0):
 for c in S.split():
    if'#'<c:r+=sum(map(int,c));r=-r
 print r>0

Prints False for left path and True for right

r=-r instead of r*=-1 should save a byte

JavaScript (ES6), 106 104 bytes
s=b=>(b=b.split`\n`,c=0,d=0,b.forEach(a=>{a=a.match(/\d+/g)||[],c+=+(a[0]?a[0]:0),d+=+(a[1]?a[1]:0)}),c<d)

s=b=>(b=b.split("\n"),c=0,d=0,b.forEach(a=>{a=a.match(/\d+/g)||[],c+=+(a[0]?a[0]:0),d+=+(a[1]?a[1]:0)}),c<d)

s is a function that returns true if the road not taken is on the left. Ungolfed:
var proc = function(str){
    str = str.split("\n");
    var left = 0;
    var right = 0;
    str.forEach(item=>{
        var match = item.match(/\d+/g) || [];
        console.log(match);
        left += +(match[0] ? match[0] : 0);
        right += +(match[1] ? match[1] : 0);
    });
    return left < right;
};

s=b=>(b=b.split`\n`,c=0,d=0,b.forEach(a=>{a=a.match(/\d+/g)||[],c+=+(a[0]?a[0]:0),d+=+(a[1]?a[1]:0)}),c<d)
<textarea placeholder = "paste in a map here..." oninput = "document.querySelector('div').innerText = s(this.value)"></textarea>

I hope someone can get a better score than this...

Challenge accepted @programmer5000

@DavidArchibald someone already did, but I would appreciate a new answer. Are you interested in the third in the series?

sure. Didn't realize there were 3

Retina, 180 bytes
Byte count assumes ISO 8859-1 encoding.
^(?=( *(0|(1|(?<3>2|(?<3>3|(?<3>4|(?<3>5|(?<3>6|(?<3>7|(?<3>8|(?<3>9))))))))))+.+¶)+)(.+ (0|(?<-3>1|(?<-3>2|(?<-3>3|(?<-3>4|(?<-3>5|(?<-3>6|(?<-3>7|(?<-3>8|(?<-3>9))))))))))+¶)+ *#

Try it online!
I thought I'd also try a regex-only solution (the above is a plain .NET regex which matches only inputs where the right path should be taken, except for using ¶ as a shorthand for \n).
It's annoyingly repetitive, but that's what happens when you have to treat each possible digit individually.
The solution is a fairly straight-forward application of balancing groups: first we sum the digits in the left branch by pushing N captures onto stack 3 for each digit N. Then we try to reach the #, while popping from stack 3 N times for each digit N in the right branch. This is only possible if the sum of digits in the left branch is greater than that in the right branch (since you can't pop from an empty stack).

I am not familiar with .NET regexes, but can't you do a character set: [0-9] to match all digits or \d?

@programmer5000 Of course, but then I can't distinguish between them to determine how many captures I should push in order to sum them.

CJam, 19 18 bytes
qN/Sf%z{'1*:~:+}/>

Try it online!
Prints 0 for left and 1 for right.
Explanation
q      e# Read all input.
N/     e# Split into lines.
Sf%    e# Split each line around runs of spaces.
z      e# Transpose to group each branch.
       e# Note that each branch will have the same number of digit segments
       e# now but the first branch will also have all the #s at the end in
       e# separate segments.
{      e# For each branch...
  '1*  e#   Join the segments into a single string with 1s as separators.
       e#   This will add the same number of 1s between digit segments in
       e#   both branches (which won't affect their relative sum) and it
       e#   will also insert a 1 before each # in the first branch.
  :~   e#   Evaluate each character. The digit characters are simply turned
       e#   into their values, but # is the exponentiation operator in CJam.
       e#   This is why we inserted those additional 1s, because 1# is a no-op.
  :+   e#   Sum the digits in the branch.
}/
>      e# Check whether the left branch's sum is greater than the right one's.

PowerShell, 80 bytes
$args-split'\s|#'-ne''|%{$a+=(($i=[char[]]$_-join'+'|iex),-$i)[($x=!$x)]};$a-gt0

Try it online!
(Just squeaking under the Python answers. :D)
Outputs True for the left path and False for the right path.
Takes input as a string delineated with `n, which is the PowerShell equivalent of "a string containing a literal backslash and a n", or as a literal multiline string. We then -split that input on \s (whitespace including newlines) or # and filter out all the empty results -ne'', so we're left with just an array of the digits. Those are fed into a loop |%{...}.
Each iteration, we first take the current element $_, cast it as a char array, -join it together with a plus sign +, and pipe it to iex (short for Invoke-Expression and similar to eval). That's stored into $i so we properly sum up the digits on this particular chunk of the path. We then use that and its negative as the two elements of an array ($i, -$i), indexed into by flipping a Boolean value back and forth. Meaning, the first iteration through this loop, the first left path chunk, we'll index into -$i; the next time, we'll take $i; and so on. Those are accumulated into $a with +=.
Finally, we evaluate whether $a is -greaterthan 0. If it is, then the right path had a larger sum, otherwise the left path had a larger sum. That Boolean result is left on the pipeline, and output is implicit.

Mathematica, 80 77 bytes
Thanks to Martin Ender for saving 3 bytes!
#<#2&@@Total@Partition[Tr/@ToExpression[Characters@StringSplit@#/."#"->0],2]&

Pure function taking a newline-delimited string as input, and returning True to take the left path, False to take the right path. Damn those long Mathematica command names; this is like 10 tokens.

Python 3, 84 bytes
Since all the current Python submissions are functions, I thought I'd contribute a full program.
x=0
try:
 while 1:
  for n in input().split():x=-x+sum(map(int,n))
except:print(x>0)

Prints True if the left path is less traveled, False otherwise. Try it online!
For each line of input, this splits on whitespace, sums the digits of each resulting element, and adds it to a tally while flipping the sign of the tally at each step. It continues reading lines of input until it hits one with a #, at which point map(int,n) raises an exception and we exit the loop, printing True if the tally is positive and False otherwise.

Java 10, 219 216 208 162 146 bytes
s->{int l=0,i;for(var x:s.split("\n"))for(i=2;!x.contains("#")&i-->0;)for(int c:x.trim().split("\\s+")[i].getBytes())l+=i>0?48-c:c-48;return l>0;}

Bit longer than 52 21 bytes this time. ;)
Returns false for right and true for left.
-24 bytes thanks to @ceilingcat.
Try it online.
Explanation:
s->{                              // Method with String parameter & boolean return-type
  int l=0,                        //  Counter, starting at 0
      i;                          //  Temp integer `i`
  for(var x:s.split("\n"))        //  Loop over the lines:
      for(i=2;!x.contains("#")&   //   Skip lines that doesn't contain "#":
              i-->0;)             //    Inner loop `i` in the range (2,0]:
        for(int c:x.trim()        //     Remove the leading/trailing whitespaces from
                                  //     the current line
                   .split("\\s+") //     Then split it on whitespaces
                     [i]          //     Get the `i`'th part
                   .getBytes())   //     And inner loop over the bytes of this part:
          l+=i>0?                 //      If `i` is 1:
              48-c                //       Decrease the counter by this digit
             :                    //      Else (`i` is 0):
              c-48;               //       Increase the counter by this digit
  return l>0;}                    //  Return whether the counter is positive

Pip, 19 18 bytes
LR+XDax:-x+$+$0SGx

Takes input as a single string on the command line (which will need quoting and escaping of newlines if run on an actual command line). Outputs -1 for left, 1 for right. Try it online!
Explanation
Loops over runs of digits, adding the digit sums to a tally. The sign of the tally is swapped each time, with the end result that the left-hand values are negative and the right-hand values are positive. Then we print the sign of the final tally (-1 or 1).
                    a is 1st cmdline arg; XD is regex `\d`; x is "" (implicit)
                    Note that "" in a math context is treated as 0
  +XD               Apply regex + to XD (resulting in `\d+`)
LR   a              Loop over matches of that regex in a:
             $0      Regex match variable containing the full match
           $+        Sum digits by folding on +
      x:-x+          Swap the sign of the tally and add this sum
               SGx  After the loop, print the sign of the tally

Haskell, 64 bytes
g=sum.map fromEnum
f(a:b:r)|a>"#"=g a-g b+f r|1<3=0
(>0).f.words

Try it online! Usage: The anonymous function (>0).f.words takes a newline separated string as argument and returns False for left and True for right.
Explanation:
Given an input
 99   989
  99  89
  99 99
    #
    #
   #

that is the string " 99   989\n  99  89\n  99 99\n    #\n    #\n   #", then words strips all newlines and spaces and returns a list of the remaining strings: ["99","989","99","89","99","99","#","#","#"]. The function f takes the first two elements a and b from this list and checks whether a is a string of digits by comparing it to the string "#". (Because the char '#' is smaller than all the digit chars '0', '1', ... every string starting with a digit will be lexicographically larger than "#".) The function g maps each char in a string to its ascii character code and returns their sum. In f we apply g to a and b and compute g a - g b, that is the value of the left path minus the value of the right one, and add it to a recursive call to f to handle the following lines. If the left path is more travelled the result from f will be negative and otherwise positive for the right path, so (>0) checks if the result is larger than zero.

Batch, 169 bytes
@echo off
set/as=0
:l
set/pr=
if not %r: =%==# call:c - %r%&goto l
cmd/cset/a"s>>9
exit/b
:c
call:r + %3
:r
set/as%1=%2%%10,d=%2/10
if %d% gtr 0 call:r %1 %d%

Prints 0 for left, -1 for right. Note: Reads lines until it finds one with a #, then stops reading. The difference in path sums is limited to 511 (add 1 byte to support larger differences). No more than 9 digits in each row of each path (supports any number of rows). Explanation: The d subroutine takes two parameters: whether to add or subtract and the digit(s). It extracts the last digit by modulo by 10 and the remaining digits by dividing by 10 and calls itself recursively while there are still digits remaining. The c subroutine takes three parameters: whether to add or subtract, the digits to add or subtract, and further digits to add. It calls the d subroutine to handle the digits to add and then falls through to handle the first two parameters. This means that calling the c subroutine with the parameters of - and the left and right digits will add the right digits and subtract the left digits. Finally the result is shifted to extract the sign.

Octave, 46 bytes
@(a)diff((a(:)-48)'*(bwlabel(a>35)(:)==1:2))<0

Try it online!
A function that takes a 2D character array a as input.
Explanation:
a=

    1   1
     0   1
      1   1
      1   1
      1   1
      1   1
       1 1
        #
        #
        #
         #
          #

a > 35                   %convert the matrix to a binary matrix
                         %where there is a number corresponing
                         %element of the binary matrix is 1.

*   *
 *   *
  *   *
  *   *
  *   *
  *   *
   * *

bwlabel(a>35)            %label each connected component.

1   2
 1   2
  1   2
  1   2
  1   2
  1   2
   1 2

B=bwlabel(a>35)(:)==1:2  % a binary `[n ,2]` matrix created
                         % each column related to one of labels

A=(a(:)-48)'             % convert array of characters to array of numbers

A * B                    % matrix multiplication that computes
                         % the sum of numbers under each label

diff(A*B)<0              % check if the left is grater than the right

Batch 104 223 bytes

missed the fact that numbers must be counted on a per charcater basis. Answer updated

@Echo off&Set/aa=0&For /f "tokens=1,2" %%1 in (%1)Do (Set c=%%1&Set d=%%2
For %%n in (c d)Do For /l %%i in (0 1 9)Do Call Set %%n=%%%%n:%%i=%%i+%%%%
2>nul Call Set/Aa+=%%c%%0,a-=%%d%%0)
IF %A% GTR 0 (Echo(R)Else echo(L

Input is from file passed as argument - %1

splits each line into two tokens

inserts a + character between each number [building a sum]

Increments a with sum of left token, decrements with sum of right token

Outputs L or R

Sidenote: the test cases in this question dont fail if taking the path of just summing the 1st and 2nd column of each line.
I made use of the follwing test case:
 034  060
  1  1
  2 0
   0 2
    #
    #
    #
   #

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


text:
Moles with SOCKS?
Many applications that depend on network resources (such as games connecting to game servers) do not allow the user to set a proxy. There are a lot of ways to force the usage of a proxy regardless, I personally have always been a fan of a local SOCKS tunnel.
What's that?
Instead of connecting directly, an application on your local machine listens on a locally bound address and relays any connection to a fixed endpoint using a remote SOCKS proxy.
Example: Let our target be 11.22.33.44:5555, and our remote socks proxy be 99.88.77.66:5555. Our application listens on 127.0.0.1:5555. Our route now looks like this:
connect to 127.0.0.1:5555 - relays via SOCKS proxy > 99.88.77.66:5555 - to > 11.22.33.44:5555
Your goal is to implement the local application relaying connections to the target.
Input
Three address/port pairs representing the bind, proxy and target address.

You may deviate from the order (but specify if you do).
Address parsing is up to your language/tools of choice, but should at the very minimum support IPv4 (11.22.33.44).
You may use builtin types of your language. (like InetSocketAddress in Java, struct in_addr in C, etc.)

Output
No rules for output due to networking.
Additional

This is code-golf, shortest answer in bytes wins.
Standard rules apply, default loopholes are forbidden.
You do not have to support more than 1 connection. The program may terminate after the first connection finishes.
Program behaviour under network failures is undefined; you may crash the entire program, reject the incoming connection, do whatever you want.
You may assume the remote SOCKS proxy's version (4/4a/5).
Using libraries/inbuilts/etc. is encouraged, but not required.
Stay in input scope (f.e. don't proxy all connections on the machine).

So the task is to create a local SOCKS server that accepts local connections (e.g. from a suitably configured browser) and connects to a remote SOCKS proxy that forwards the connection to the far end (e.g. web server)? - its not entirely clear to me.

@DigitalTrauma Not a local SOCKS server, but more a local tunnel server using a fixed SOCKS proxy to forward connections to a fixed end.

So just a simple local TCP port forward then?  - that itself knows nothing of the SOCKS protocol?  This is not really clear to me

I'm not sure what else there is to explain? From the point of the connecting application it is effectively a port forward. The impementing application obviously has to know about the SOCKS protocol. I've even given a sample answer in Kotlin.

Kotlin, 240 bytes
This was fun and taught me some things I didn't know about Kotlin.
import java.net.*fun a(vararg p:InetSocketAddress){ServerSocket().run{bind(p[0])
accept().let{Socket(Proxy(Proxy.Type.SOCKS,p[1])).run{connect(p[2])
Thread{it.inputStream.copyTo(outputStream)}.start()
inputStream.copyTo(it.outputStream)}}}}

Tested locally with:
fun main(args: Array<String>) {
    thread { a(InetSocketAddress(2000), InetSocketAddress(3000), InetSocketAddress(4000)) }
    thread { Socket().connect(InetSocketAddress(2000)) }
    ServerSocket(3000).accept().getInputStream().run { generateSequence { read() } }
            .forEach { print("$it,") }
}

Prints 5,2,0,2, which confirms an attempted SOCKS5 connection.


text:
Extract an RGB channel of an image
Given an image, either as input (possibly in RGB triplets) or with the filename as input (you may assume the image has a specific filename, possibly without an extension), output an image representing a single color channel of the image.
You will also take another input, representing which channel to output. The input can be one of any 3 distinct symbols.  However, the symbols must be either a string or a number. You cannot take a matrice to apply to the array as input however. (such as {1, 0, 0}, or {0, 1, 0}).
You will output the <input> channel of the input image.  You may either save it to a file or output a set of RGB pairs.
Your program should have no limits on the size of the image (in px), and must support either .png, .jpg/.jpeg/.JPG, or RGB triplets as image formats. (it can support as many as you want however)
Test case:

Red channel:

Green channel:

Blue channel:

And another test case, entirely of red.  Original photo, red, green, and blue.  (warning: the plain and red channel hurt to look at for too long)
2 more test cases:
Original, red, green, blue.
Original, red, green, blue.
The latter two test cases are from Images with all colors.

This is good inspiration for a golfing language that transpiles/compiles to OpenCV operations.

APL (Dyalog), 7 bytes
I/O: array of RGB triplets
⎕×⊂⎕=⍳3

Try it online!
⍳3 first three integers
⎕= compare numeric input (the chosen channel) to that
⊂ enclose (so each image triplet pairs up this entire triplet)
⎕× multiply numeric input (the array of triplets) with that

JavaScript (ES6), 29 bytes
a=>n=>a.map(b=>b.map(c=>c&n))

Input is a 2D array of 24-bit integers (e.g. [[0x0000ff,0x00ff00],[0xff0000,0xffffff]]) and 16711680 for red, 65280 for green, 255 for blue. If this isn't valid, try this instead:
JavaScript (ES6), 48 bytes
a=>n=>a.map(b=>b.map(c=>c.map((d,i)=>i==n?d:0)))

Input is a 3D array of color values and 0 for red, 1 for green, 2 for blue.

Cheeky input format haha

Mathematica, 13 bytes
ImageMultiply

This should be the legitimate version of JungHwan Min's answer. This function takes the image and one of Red, Green, Blue as input. For example:

As a fun-fact, there's also ColorSeparate which gives you individual channels, but it returns them as single-channel/greyscale images, so you'd need to multiply them by the colour afterwards anyway.

Is there anything Mathematica doesn't have a built-in for?

Bash + ImageMagick, 35 32 27 bytes
mogrify -channel $1 -fx 0 i

Assumes the image is in the file i and the script takes one of RG, BG, BR for blue, red, and green respectively; outputs to the file i.

beat me to it. I posted a different bash+IM answer below, with an optimization you can steal

@Sparr I made a different golfing

you could still save two bytes with mogrify and no ' o'?

Spectrum, noncompeting, 1 byte
(Non-competing because this challenge inspired this language.) In reality, Spectrum is an npm library with a language interface for the commands.
I

Takes input as:
<filename>
channel

Call the program as:
cat input.txt | node spectrum.js "I"

Alternatively, you may supply information to the prompts:
λ node spectrum.js "I"
input> Ov3Gm.png
input> r
[ Image { 512x512 } ]

This leaves the image on the stack. To view it, add O at the end, like so:
λ node spectrum.js "IO"
input> Ov3Gm.png
input> r
[]

For some extra fun, try echo filename | node spectrum.js "wO". It performs all three channel isolations at once:

@ThisGuy Yes, it can do primality checking: n[d1=\[d1-P*][],.g!]#Pdd1-P~%-1=p`

@ConorO'Brien did you see my primality tester for ImageMagick's fx operator?

@Sparr no, I haven't . Link?

@ConorO'Brien https://codegolf.meta.stackexchange.com/questions/8828/is-imagemagick-a-programming-language

JavaScript (ES6), 29 bytes
a=>b=>a.map((v,i)=>i%3^b?0:v)

A lot like ETHproductions' answer but with more flexible input than the first method and smaller than the second one.
This defines a function which accepts the image as a 1-dimensional array of numerical colour intensities. This function then returns another function which accepts an integer value representing the desired colour channel.
Colours can be represented by any numerical range as long as 0 indicates a complete absence of colour. E.g. 0.0 - 1.0 or 0 - 255
Examples:
If image data is in the format RGB then calling the function with arguments (imageData)(0) will return the image with only the red channel.
If image data is in the format BGR then calling the function with arguments (imageData)(2) will also return the image with only the red channel.

I guess i%3==b&&v also works.

Python 2, 69 bytes
from cv2 import*
def f(s,i):k=imread(s);k[:,:,[i,i-1]]=0;imwrite(s,k)

Still golfing.
Takes input as filename, n (where n is 0, 1, or 2). Saves the new image over the old one. 0 is green, 1 is red, and 2 is blue. Thanks to @ovs, @Mikhail and @Rod for bytes off.

Save some bytes by dropping x and replacing k[:,:,x[i][0]]=k[:,:,x[i][1]]=0 with k[:,:,[1,2,0][i]]=k[:,:,i]=0

@ovs thanks!... I had actually just come up with the second suggestion myself, after messing with yours. You ninja'ed me to it though.

You can use from cv2 import* to save few bytes

Seems that you can replace k[:,:,i-1]=k[:,:,i]=0 with k[:,:,[i,i-1]]=0

CJam, 12 bytes
{3,f=f{f.*}}

An anonymous block that expects a 3D array of RGB triplets and a number between 0 and 2 inclusive on the stack. Leaves the extracted array on the stack afterward.
Red   -> 0
Green -> 1
Blue  -> 2

Could possibly be golfed by using a bizarre input format, but I feel like that's cheating a bit.
Try it online!
The test case is made up just to demonstrate, using the triplets from an actual image would be way too big.
Explanation
3,          e# The range [0 1 2]
  f=        e# Check each for equality with the RGB indicator, gives the indicator array:
            e#  [1 0 0] for 0, [0 1 0] for 1, [0 0 1] for 2
    f{      e# Map on each row of the array using the indicator array as an extra parameter
      f.*   e#  Perform vectorized multiplication of the indicator array with each triplet.
            e#   For red, multiplies red by 1, and green and blue by 0. Does similarly
            e#   for green and blue.
         }  e# (end of block)

PowerShell, 282 bytes
$x,$y=$args;1..($a=New-Object System.Drawing.Bitmap $x).Height|%{$h=--$_;1..$a.Width|%{$i=("$($a.GetPixel(--$_,$h)|select R,G,B)"|iex)[$y];$r,$g,$b=(((0,0,$i),(0,$i,0))[$y-eq'G'],($i,0,0))[$y-eq'R'];$a.SetPixel($_,$h,[system.drawing.color]::fromargb($r,$g,$b))}};$a.save("$x$y.png")

None of this fancy "golfing the input" or "using built-ins." Phooey on that. ;-)
This here takes the full path of an input PNG (though, strictly speaking, it doesn't need to be a PNG, since JPG, BMP, etc. are supported by .NET, but I've only tried it on PNGs), and one of (R, G, B) for the color channel, then stores those into $x and $y. We then create a New-Object of type System.Drawing.Bitmap of $x and store that into $a.
Then we do a double loop over all pixels. First from 1 up to $a's .Height, setting $h each iteration (it's zero-indexed, so that's why we --$_, which saves bytes over ( .height-1). Inside, we loop from 1 up to $a's .Width.
Each iteration, we're performing a .GetPixel on the particular w,h coordinates, which returns a System.Drawing.Color object. We select out the R G B values thereof. The iex here is a neat trick that turns this into a hashtable (e.g., something like @{R=34; G=177; B=76}) so we can index into that directly with the desired color channel [$y]. That value is stored into $i.
Next, we set three values $r, $g, $b to be the result of some pseudo-ternary operators based on the letter value of $y. So, for example, if $y is R, then the result here is $r=$i, $g=0, $b=0.
Then, we do a .SetPixel back onto that particular w,h coordinate, constructing a new System.Drawing.Color using the static FromARGB (which assumes the alpha to be fully opaque). Once we've finished looping, we then simply .Save the PNG to a new file.
Note: This does take a long while, since it's completely independently looping through every pixel and performing a bunch of calculations and calls each iteration.
Tests:

Bash + ImageMagick, 41 bytes
C="RGB"
mogrify -channel ${C//$1} -fx 0 x

Input is a file named x, command line parameter one of R or G or B
Output overwrites the input file
Differs from betseg's answer in taking more natural single-letter channel parameter. Also overwriting instead of outputting a new file which betseg is free to steal :)

the $1 needs quotation marks, file names can have spaces

@betseg not really, I said you can assume it has a specific filename. If he wants, he can even change it to read from a file name x for 1 byte off.

@Riker oh, I didnt notice that, that helps me too :D

Chip, 78 bytes
 ~Z~vS
f/F,^-.
e/E|,-Z.
d/D|>zz^.
a/AMx-x-].
b/BMx-]v-'
c/CM]v-'
 >--v'
G/gh/H

Try it online!
Chip is a 2D language that operates on the component bits of each byte in a byte stream.
Overview
This particular solution expects the first byte of input to be the control character--to define which channel(s) to keep--and following is the bytes of image data. The image data must be RGB triplets, one byte per channel, 24 bits per pixel:
|  1  |  2  |  3  |  4  |  5  |  6  |  7  | ... | 3n-2 |  3n  | 3n+1 |
|     |   First Pixel   |   Second Pixel  | ... |      nth Pixel     |
| Ctl | Red | Grn | Blu | Red | Grn | Blu | ... |  Red |  Grn |  Blu |

The control character is interpreted as a bit field, though only the three lowest bits have meaning:
0x1  keep Red channel
0x2  keep Green channel
0x4  keep Blue channel

This means we can use ASCII characters to select which channel we want:
1 means red
2 means blue
4 means green
Or do something fancier:
5 keep red and blue, but not green
7 keep all channels (image is unchanged)
0 drop all channels (image is black)
How it works
This solution is rather jumbled up due to golfing, but here goes:

Read the three low bits of the first byte with C, B, and A, and store those bits in their corresponding Memory cells. Also, Suppress output for the first cycle.
Loop over those three bits repeatedly. If the current bit it is on, close the / switches to output the current input byte, if it is off, open the switches so that we output a zero byte.
Continue until input is exhausted.

Viewing the results
Sure, you could use hexdump or something boring, but it turns out this is (almost) an actual valid image format: binary Portable PixMap.
Just plop the image data from above (minus the control byte, of course) into the file below, adjust the width/height to be valid, and you can view the image in a proper viewer like IrfanView, though simpler ones (like most browser built-ins) can't handle it.
P6
{width as ASCII} {height as ASCII}
255
{binary image data here}

For example (using escapes for the raw data):
P6
3 1
255
\xff\x00\x00\x00\xff\x00\x00\x00\xff

MATL, 21 13 bytes
Yi3:iml&!*3YG

The color channel should be specified using the following mapping: 1:red, 2:green, 3:blue
The Online interpreters are unable to use imread to read images so here is a slightly modified version where I have hard-coded a random image into the source.
Explanation
        % Implicitly grab first input as a string (filename)
Yi      % Read the image in from a filename or URL
3:      % Push the string literal 'rgb' to the stack
i       % Grab the second input as a number
m       % Check for membership. So for example 2 will yield [false, true, false]
l&!     % Permute the dimensions to turn this 1 x 3 array into a 1 x 1 x 3 array
*       % Multiply this with the input RGB image. It will maintain the channel which
        % corresponds with the TRUE values and zero-out the channels that corresponded to
        % the FALSE values
3YG     % Display the image

05AB1E, 16 bytes
vyvy2ô²è}})¹0ègô

Try it online!
Uses hex colors in a 2D array format and [0,1,2] for each channel.

Clojure, 421 332 bytes
-89 bytes by aggressively inlining everything, changing from my ridiculous old method of stripping the channels, and getting rid of an unnecessary accidental import.
(import '(java.awt.image BufferedImage)'(clojure.lang Keyword)'(javax.imageio ImageIO)'(java.io File)'(java.awt Color))(fn[p i](doseq[y(range(.getHeight p))x(range(.getWidth p))](.setRGB p x y(.getRGB(apply #(Color. % %2 %3)(#(let[c(Color. %)](assoc [0 0 0]i(([(.getRed c)(.getGreen c)(.getBlue c)]%)i)))(.getRGB p x y))))))(ImageIO/write p"jpg"(File."./o.jpg")))

Smacked this out half an hour before my shift started with no idea what I was doing. I have little experience with BufferedImage, so there may be a better way of going about this. I'm also abusing Color to convert back-and-forth between integer and individual channel representations of colors.
This is comically huge compared to the other answers for a couple reasons (besides the obvious that Clojure isn't a golfing language):

Instead of just manipulating a byte array, this actually takes as input a picture, alters it, and outputs it.

I'm using Java-interop, which while handy can be quite verbose at times. The imports alone are larger than many answers.

See the code below for a break down.
(ns bits.restrict-channel
  (:import (java.awt.image BufferedImage)
           (clojure.lang Keyword)
           (javax.imageio ImageIO)
           (java.io File)
           (java.awt Color)))

(defn restrict-channel
  "Accepts a BufferedImage and a index between 0 and 2 (inclusive).
  Removes color from all channels EXCEPT the channel indicated by color-i.
  color-i of 0 = keep red
  color-i of 1 = keep green
  color-i of 2 = keep blue"
  [^BufferedImage image ^long color-i]
  (let [; Turn a number representing RGB into a triplet representing [R G B]
        channels #(let [c (Color. %)]
                    [(.getRed c) (.getGreen c) (.getBlue c)])

        ; Create a new triplet that only contains color in the color-i channel
        zero-channels #(assoc [0 0 0] color-i ((channels %) color-i))]

    ; Loop over each pixel
    (doseq [y (range (.getHeight image))
            x (range (.getWidth image))]

      ; Grab the current color...
      (let [cur-color (.getRGB image x y)]

        ; ... setting it to stripped color triplet returned by zero-channels
        (.setRGB image x y

                          ; This "apply" part is just applying the stripped triplet to the Color constructor
                         ;  This is needed to convert the separate channels into the integer representation that `BufferedImage` uses.

                 (.getRGB (apply #(Color. % %2 %3) (zero-channels cur-color))))))

    ; Save the result to file
    (ImageIO/write image "jpg" (File. "./o.jpg"))))

This is either the most glorious or horrific thing I've ever seen. I'm going with the former.

@Riker Definitely the former. I started writing this half an hour before my shift started with no idea how I was going to do it. But it works!

I actually meant the latter, but glorious messes are a thing too.

Lua (love2d Framework),  498 bytes
I did this more as a exercise for myself, so it's not as short as it could be (though I did try to golf), but I wanted to add it to here cause I think I did good. Even if I'm too late.
Here the golfed code, under it is the explained and untangled version.
l=love g,p,rm,bm,gm,s=l.graphics,0,1,1,1,[[uniform float m[4];vec4 effect(vec4 co,Image t,vec2 c,vec2 s){vec4 p=Texel(t,c);p.r=p.r*m[0];p.b=p.b*m[1];p.g=p.g*m[2];return p;}]]t=g.setShader h=g.newShader(s)function l.draw()h:send("m",rm,gm,bm)if p~=0 then t(h)g.draw(p)t()end end function l.filedropped(f)a=f:getFilename()p=g.newImage(f)end function l.keypressed(k)if k=="0"then rm,gm,bm=1,1,1 end if k=="1"then rm,gm,bm=1,0,0 end if k=="2"then rm,gm,bm=0,1,0 end if k=="3"then rm,gm,bm=0,0,1 end end

Here is the code which has to get a *.jpg file dropped into it. After the image was inserted you can press the number buttons for red(1) green(2) or blue(3) channels. Also to see the default picture again press 0. Actually it just shows the picture in the window.
l=love
g=l.graphics
p=0
rm,bm,gm=1,1,1
s = [[uniform float m[4];
vec4 effect(vec4 co,Image t,vec2 c,vec2 s){vec4 p=Texel(t,c);p.r = p.r * m[0];p.b = p.b * m[1]; p.g = p.g * m[2]; return p;}
]]
sh=g.newShader(s)

function l.draw()
  sh:send("m",rm,gm,bm)
  if p~=0 then
    g.setShader(sh)
    g.draw(p)
    g.setShader()
  end
end

function l.filedropped(f)
  a=f:getFilename()
  p=g.newImage(f)
end

function l.keypressed(k)
  if k=="0"then rm,gm,bm=1,1,1 end
  if k=="1"then rm,gm,bm=1,0,0 end
  if k=="2"then rm,gm,bm=0,1,0 end
  if k=="3"then rm,gm,bm=0,0,1 end
end

The important part which does all the work is the shader which is the small string declaration at the beginning or untangled:
uniform float m[4];
vec4 effect(vec4 co,Image t,vec2 c,vec2 s)
{
    vec4 p=Texel(t,c);
    p.r = p.r * m[0];
    p.b = p.b * m[1];
    p.g = p.g * m[2];
    return p;
}

which gets the actual pixel of the image and just shows the channels as needed.
My test image and the different outputs for the channels (also for sure the other ones)

Thank you for your hint, I fixed it, next time I know :)

No problem! Welcome to ppcg, hope you stick around!

Also, you can still golf this. You don't need to include the buttons and such.

C, 60 58 bytes
main(a,b)char**b;{while(scanf(b[1],&a)>0)printf("%d ",a);}

Image input is a list of numbers (in decimal) between 0 and 255 on stdin, e.g.
255 0 0  192 192 192  31 41 59 ...

The channel is specified as the first argument to the program, and is one of
red   -> "%d%*d%*d"
green -> "%*d%d%*d"
blue  -> "%*d%*d%d"

Example:
$ echo "255 0 0" | ./extract "%d%*d%*d"
255


text:
Two roads diverged in a yellow wood (part 3)

Note: This is based on Two roads diverged in a yellow wood (part 2), a previous challenge of mine. Because of the popularity of that question and Two roads diverged in a yellow wood (part 1), I wanted to make a third. But the first 2 were too easy (a 2-byte answer on the first, a 15-byte answer on the second.) So I made something more complex...

The inspiration
This challenge is inspired by Robert Frost's famous poem, The Road Not Taken:

Two roads diverged in a yellow wood,
  And sorry I could not travel both
  And be one traveler, long I stood
  And looked down one as far as I could
  To where it bent in the undergrowth;
...2 paragraphs trimmed...
I shall be telling this with a sigh
  Somewhere ages and ages hence:
  Two roads diverged in a wood, and I —
  I took the one less traveled by,
  And that has made all the difference.

Notice the second to last line, I took the one less traveled by,.
The backstory
You were assigned to help a blind adventurer who is walking on a road and was inspired by The Road Not Taken. The adventurer is approaching a fork in the road and would like to take the path less traveled by. You must find where the adventurer actually is and tell the adventurer where to turn.
The challenge
Your goal is to find the road least traveled by on your map where the road forks. Your map is a string containing newlines (or \n, if you prefer) and has an unknown width and height. In the map, roads are made up of digits 0 to 9, the intersection are made of #s. You must find the road you are currently on, and out of the other roads the road most traveled by, and the road less traveled by for your blind adventurer. Woods in you map is represented by a space. Here is a simple map:
2   2
 1 0
  #
  2
  2

This map is 5 wide and 5 tall. Notice how the road forks in a Y shape. The Y may be oriented any way, so you must be able to understand a "rotated" map.
What the # means
Where the map forks there will be a #. This does not impact the score of any path.
What the numbers actually mean
Each path (a line of numbers, may have a bend in it) has a score. A path's score is determined by adding up its digits, so for the first example, the first path (from upper-left, clockwise) has a score of 2+1=3, the second has 2+0=2, and the third has 2+2=4. Roads may contain numbers connected diagonally.
Finding where you are
You are on the path with the highest score. The other 2 paths are the road more traveled by, and the road less traveled by. You need to find the road with the lowest score.
Telling your traveler where to go
You must tell your traveler to go "left" or "right". Keep in mind that directions are from your traveler's point of view (he is facing the fork.)
Example maps
  14
9#
  04

Output: "right" (traveler is at the 9 road, 0+4 < 1+4
  9
  9
  9
  9
  9
  #
 8 8
 8 8
88 88
8   7

Output: "left" (traveler is at the 99999 road, 8+8+8+8+8 > 8+8+8+8+7
02468
     #98765
13579

Output: "right" (traveler is at the 98765 road, 0+2+4+6+8 < 1+3+5+7+9)
4 2
4 2
 #
 4
 4
 2
 2

Output: "right" (traveler is at the 4422 road, 4+4 > 2+2)
 9
 9
 9
 #
8 7
8  7
8   7

Output "left" (traveler is at the 999 road, 8+8+8 > 7+7+7
Stuff to know:

Maps will be padded with spaces to make each line the same length.
You must output to STDOUT / console / file the string left or right, optionally followed by a trailing newline.
You must take input as either a string containing newlines, \ns, or an array/list of lines (each line is a string). Where that input is put must be a function, command-line argument, file, or STDIN one line at a time or similar. A variable is not a acceptable input device (unless it is a function parameter.) Likewise, function expressions in JS and other languages must be assigned to a variable.
This is code-golf, so the shortest answer in bytes wins!
Standard loopholes forbidden

Things you can assume

Your input will be valid. Nothing like this will be tested for:

0 0 0
 0 0
  #
 0 0

Paths' scores will never be tied.
The input can be of any length in width or height, less than the string limit of your language.
There will always be at least 1 space between the 2 paths.
Paths may have bends, turns, etc. These are roads, not highways.

Have any questions? Ask me below in the comments and happy golfing!

Will the # always be in the center horizontally?

@David no, I added a example map to show that.

I don't think I'm gonna make a javascript one under 100 bytes. The rotation just kills it all.

@David This question is different from the others, even a 1000 byte answer would be winning (so far)

I think it's time for you to use the Sandbox. And maybe find some new inspiration. At this rate, it feels more like you're promoting a poem than creating an interesting challenge series. Especially since you post the poem except in every one. We've already seen it from the first one, that's enough.

Look. I've liked your challenges, but simply adding some difficulty then posting 3 without even accepting one in the pt 2 is just too fast. An edit to 2 would be good enough for the slight change of rotation, absolute output and so on.

Could you add a test case where the paths have "bends, turns, etc."?

It is a very different challenge from the previous ones and I like it... We can take the Y shape as granted (one path always ends on one edge and the other two on the oposing edge), right?

Possibly new tag for series like these: [tag:neverending-series]?

@dnep Yes you are right.

@SIGSEV I promise this is the last one.

Shouldn't the traveler turn right in the fourth example? If they're on the 2244 road, heading towards the fork, then the 22 path is on their right.

@Ray Yes, you are correct. I fixed that.

There´s a mistake in the second example too: Traveller should be on the 88888 road (score: 40). However,  "left" is the correct reslut (84+7=39, 94=36). Or do "most traveled by" imply the average value? Then, you should mention averages in your explanations, not sums.

@Titus Fixed that.

... and the third example should be 44 -> left. ;)

@Titus what do you mean? The example with 44, 22, and 4422?

D, 348 321 312 302 bytes
import std.stdio,std.algorithm,std.regex,std.range;void h(R,U)(R s,U r){U[2]c;foreach(L;s.map!(a=>a.array.split)){U l=L.length-1;r>1?r=l^r-2:0;l?c[]+=l*L.map!sum.array[]:c;}write(c[r]>c[!r]?"right":"left");}void main(){auto s=stdin.byLineCopy.array;!s.join.match(`\d \d`)?h(s.transposed,2UL):h(s,3UL);}

Ungolfed
import std.stdio,std.algorithm,std.regex,std.range;

void h(R,U)(R s, U reverse) {
    U[2] counts;
    /* Now that all paths are up/down, every line we need to count up has
       precisely two space-delimited parts to sum up. */
    foreach (line; s.map!(a=>a.array.split)) {
        U len = line.length - 1;
        reverse > 1 ? reverse = len ^ reverse - 2 : 0;
        len ? counts[] += len * line.map!sum.array[] : counts;
    }

    /* Switch left/right as needed based on our orientation */
    write(counts[reverse] > counts[!reverse] ? "right" : "left");
}

void main() {
    /* Treat the input as a matrix of integers */
    auto s = stdin.byLineCopy.array;

    /* If moving left/right intead of up/down, transpose */
    !s.join.match(`\d \d`)?h(s.transposed,2UL):h(s,3UL);
}

Try it online!

Congratulations on being the first answerer! You might win this one... Can you link to D?

Python 2, 304 bytes
Try it online
A=input()
S=str(A)[2:-2].replace("', '",'')
i=S.index('#')
r=len(A[0])
w=1
a=i/r
if' '<S[i-r]:w=-w;A=A[::w];a=len(A)+~a
if' '<S[i+1]:A=zip(*A[::-1]);a=i%r
if' '<S[i-1]:A=zip(*A)[::-1];a=len(A)-i%r-1
s=0
for c in' '.join(map(''.join,A[0:a])).split():s+=sum(map(int,c));s=-s
print['left','right'][::w][s>0]

This program deduces direction of roads and rotates it facing up to use my solution from part 2 of this challenge.

Beaten by 2 bytes! Talk about frustrating!

@user00001 that's why I cry alot


text:
Grade My Scan-tron!
Standardized testing usually comes with a scan-tron or some type of answer document that records your answer. A computer or human(s) would then check your answers and determine your grade. So here, given a scan-tron and the answer key, determine the score and questions missed if any. A scan-tron is just a document with multiple lines with answers in which the user fills in (in this case, circled). Example:
   ---
1. |a| b c d
   ---

As you can see, this is question 1 with answer choice a selected since it has a box around it. For the challenge, you will be given a scan-tron with n questions ( 1 <= n <= 10) with only four answers denoted as a, b, c, or d. The answer key will be given as a string with no spaces and with all lowercase. Example scan-tron with answer key:
Scan-tron
   ---
1. |a| b c d
   ---
     ---
2. a |b| c d
     ---
       ---
3. a b |c| d
       ---

Answer Key
abb

You can take in the answer key and scan-tron as separate inputs or in a chosen order as long they can be identified (i.e the answer key is separated from the scan-tron). Scores will be rounded to the nearest tenth of a point. Example output for the above:
Score: 66.7
Missed #: 3

Other acceptable answer would be:
66.7
3

or if multiple questions are missed
66.7
3 4 5

as long the question numbers for those missed are separated from the by spaces and not on the same line as the score.
Rules and Specs

The scan-tron can be inputted as a multi-line string or one question at a time (as a string with newlines is acceptable)
Given a scan-tron and answer key, you must output the score on one line and the question(s) missed on another, with the numbers separated by spaces. If no questions are missed, no question numbers should be outputted
Scores are rounded to the nearest tenth
Selected answers are surrounded by this box:
---
| |
---

On the scan-tron, every question takes three spaces (the top and bottom of the box takes two extra lines)
Must work for the above example
Assume that there will always be only one answer boxed

Winning Criteria
Shortest code wins!

the scan-tron can be a list of questions ? And each question be a single string with newlines?

@Rod Yes and I will clarify that

The language of "missed" is confusing to me, since a "missed" question could mean a question that the student failed to answer (as opposed to your apparent meaning, answered incorrectly).

@DLosc There will always be only one circled answer

Is a score like 50 acceptable, or does it have to be 50.0?

@DLosc As long they're equivalent

I'm definitely adding a rounding operator to my golfing language after this. :P

05AB1E, 43 bytes
U|3ôø`\vyy'|k>èXNèQˆ}¯OXg/3°*2z+ïT/XgL¯_Ï‚»

Try it online!
Explanation
U                                            # store the answer key in X
 |3ô                                         # split the question-rows in chunks of 3
    ø`                                       # zip and flatten
      \                                      # discard top of stack, leaving the list of
                                             # answer rows on top
       v                                     # for each answer row
         y'|k                                # get the index of the first "|"
        y    >è                              # get the character after that from the row
               XNèQ                          # compare it to the corresponding entry in
                                             # the answer key
                   ˆ                         # add it to the global list
                    }                        # end loop
                     ¯O                      # calculate the number of correct answers
                       Xg/                   # divide by the length of the answer key
                          3°*                # multiply by 1000
                             2z+             # add 0.5
                                ï            # convert to integer
                                 T/          # divide by 10
                                   XgL       # push range [1 ... len(answer key)]
                                      ¯_Ï    # keep only numbers corresponding to
                                             # wrong answers
                                          ‚» # format output

Stacked, 68 + 1 = 69 bytes
'|'split[#'1-]NO neq::size:@z~>*[]YES' '#`out is0 sum z/100*1 nround

Try it online! +1 for -p flag (this script can be executed as stacked -pe "...")
Takes two inputs from the top of the stack.
Some interesting features:
[#'1-]NO
[    ]NO   do not keep members where
 #'          its length
   1-          -1
             is truthy (in this case, not equal to zero).

This yields all letters surrounded by pipes.
:size:@z~>*[]YES
:                 duplicate indices of incorrect answers
 size             length of incorrect answers
     :@z          (stored into z)
        ~>        range from 1 to this length
          *       and multiply by this range
           []YES  keep truthy elements

This gives us all incorrect question numbers.

Python 2, 94 93 bytes
-1 byte thanks to L3viathan

s,a=input()
l=len(s)
w=[i+1for i in range(l)if"|%s|"%a[i]not in s[i]]
print(l-len(w))*1e2/l,w

Try it online!

Nice, much better than mine. You can replace 100. with 1e2

I don't believe this meets the requirement to round the score to "the nearest tenth of a point," does it?

Pip, 49 46 44 48 45 bytes
Ugh, that rounding takes so many bytes... 44 bytes of code, +1 for -s flag.
(/2+m-m/#b*#P_FI{++nbNa?un}MZa@`\|..`b)//1/t

Takes input as command-line arguments (the scan-tron page will need quoting and escaping of newlines if you run it from an actual command line). Outputs the missed questions first, then the score. Try it online!
Explanation
I'm gonna do this in two parts: the incorrect questions list and the score.
P_FI{++nbNa?un}MZa@`\|..`b
                            a,b are cmdline args, u is nil, n is newline (implicit)
                            Note that a string like n, in math contexts, is equivalent to 0
                 a@`\|..`   Find all occurrences in a of | followed by 2 chars
                            Because regex matches don't overlap, this does what we need
    {         }MZ        b  Zip with b and map this function to each pair of items:
     ++n                     Increment n (so the first time through, it's 1)
        bNa                  Is 2nd arg a substring of 1st?
           ?un               If so, return nil; if not, return n
                            Now we have a list containing nil for correct questions
                            and the question number for incorrect questions
 _FI                        Filter on identity function (keep only truthy values)
P                           Print, joining on spaces (-s flag)

(/2+m-m/#b*#...)//1/t
                       a,b are cmdline args, m is 1000 (implicit)
            ...        The code from the first part
           #           Length of that list (i.e. number of incorrect questions)
      m/#b*            Times 1000/(number of questions)
    m-                 Subtracted from 1000
 /2+                   Plus 1/2 (= 0.5)
                       We now have a number like 667.1666666666667
(              )//1    Int-divide by 1 to truncate
                   /t  and divide that by 10
                       Print (implicit)

JavaScript (ES6), 88 bytes
x=>y=>x.replace(/\w(?=\|)/g,c=>c==y[i++]?t++:a+=i+" ",a=i=t="")&&(t/i*1e3+.5|0)/10+`
`+a

I could save 5 bytes by using commas and returning everything one one line:
x=>y=>x.replace(/\w(?=\|)/g,c=>c==y[i++]?t++:a+=[,i],a=i=t="")&&(t/i*1e3+.5|0)/10+a

Batch, 242 bytes
@echo off
set/as=c=0
set m=
set/pk=
:l
set/ac+=1
set/pt=
set/pl=
set/pt=
set "l=%l:*|=%
if %l:~,1%==%k:~,1% (set/as+=1)else set m=%m% %c%
set k=%k:~1%
if not "%k%"=="" goto l
set/as=(s*2000/c+1)/2
echo(%s:~,-1%.%s:~-1%
echo(%m%

Reads in the answer key on STDIN first, then n*3 question rows. Note: Score is printed without a leading zero if it is less than 1.0. Missed answers are printed with a leading space.

CJam, 47 45 bytes
lqN/(;3%_'|f#:).=.=__:+\,d/e2XmOn:!_,,:).*0-p

Try it online!
Explanation
The program is in three main parts:
Right/wrong list

l                    e# Read the first line of input (answer key)
 qN/                 e# Read the rest of the input and split it on newlines
    (;3%             e# Delete the first line, then select every 3rd line
        _            e# Duplicate the array
         '|f#        e# Find the index of the first | in each answer
             :)      e# Increment each, gives the index of the selected letter for each answer
               .=    e# Vectorized get-element-at with the answer strings
                 .=  e# Vectorized equality check with the answer key

After this section, we have an array of 0s and 1s, where 0 indicates a wrong answer and 1 a right answer.
Score

__              e# Duplicate the right/wrong list twice
  :+            e# Take the sum of it (number of right answers)
    \,          e# Swap top elements and take the length (total number of questions)
      d/        e# Divide (casting to double so it's not integer division)
        e2      e# Multiply by 10^2
          XmO   e# Round to 1 decimal place
             n  e# Pop and print with a newline

After this section, the stack contains only the right/wrong list, and the percentage score has been output.
Wrong answers

:!            e# Logically negate each element of the right/wrong list
  _,,:)       e# Generate the inclusive range 1...length(list)
       .*     e# Vectorized multiplication of the two lists
         0-   e# Remove any 0s from the result
           p  e# Print it

Jolf, 46 bytes
I can't seem to break 46 bytes. I have two solutions of this length. Try one here!
ΆRγψ~mΖ mi«\|..»d?=€H.xSEhSdHήSmX*~1/-lζlγlζ_1

(Replace □ with 0x7f in the next one)
ΆRγψΜΖψGi'|d=1lHd?□=H.xShSEdHήSmX*~1/-lζlγlζ_1

In either case, 15 bytes for rounding: mX*~1/-lζlγlζ_1. They are, for the most part, the same, except one uses a regex match to get the results, and the other splits on pipes.


text:
Make Some Snow!
Your task: generate a Koch snowflake to the nth depth. You do not need to make a complete Koch snowflake, just one side of the starting triangle. Wikipedia on Koch flakes: https://en.wikipedia.org/wiki/Koch_snowflake.
Rules:

The program must generate one side of the Koch snowflake to the nth depth.
Output must be ASCII.
You may generate the whole snowflake; this is not required.
Standard rules for input/output and loopholes and stuff apply.
Whitespace does not matter, as long as it all characters are in the right place relative to each other.
Shortest code wins!

Test cases:
n=0:
__

n=1:
__/\__

n=2:
      __/\__
      \    /
__/\__/    \__/\__

n=3:
                        __/\__
                        \    /
                  __/\__/    \__/\__
                  \                /
                  /_              _\
                    \            /
      __/\__      __/            \__      __/\__
      \    /      \                /      \    /
__/\__/    \__/\__/                \__/\__/    \__/\__

I hope this makes sense. Notice that in each test case, the fractal can be divided into three parts equal in length. Also notice that the width of each snowflake is three times the width of the previous generation of the snowflake.

FYI, it was agreed that this is not a dupe of this.

I don't think you have appropriately defined what the proper ASCII representation of the nth Koch curve is.

I'm not sure the proportions make sense. The non-dupe used __/\__ with two underlines, which made each iteration consistently 3 times as large as the previous one. Using only one underline seems to give contradictions that start getting really awkward in n=3. E.g. the outer parts have width 12 while the middle part has only width 10, as a consequence of the /_ and _\  that are too cramped. And even before that you have _ expanding to twice the width of / and \ .

I think the /_ and _\  are the only really fatal part - the underscores need to go, because they need to be in the same position as the / and \ . Once that's done, things can expand by 3 times from n=1 onwards (but n=0 doesn't fit.)

Alas, no, the middle part still has width not matching the outer parts, as evidenced by n=3 having width 52 rather than 54 = 2*3^3. Try one of these. I included upside down versions with parts only showing up from n=4 or n=5 - they differ from the upwards ones in where the underscores are dropped.

Most of the subtleties past n=2 in both styles can be summed up as "Whenever an underscore clashes in position with another non-space character, the other character wins".

Looks good to me.

Why did my answer get unaccepted? It's still the only one. :(

@ØrjanJohansen Sorry.

Haskell, 308 300 299 bytes
Edits:

-4 bytes: Changing zipWith(+) to zipWith(-) and adjusting encodings and offsets got rid of every negation sign.
-1 byte: Further tweaking the encoding allowed several variable names in # to be dropped by using r=reverse instead of direct pattern matching.
-2 bytes: Using an operator instead of alphanum for zipWith(-).
-1 byte: Defining o=[0,0] to shorten list constants.
-1 byte: Merging two branches of ?.

import Data.List
k n=0?sort(o#(f=<<scanl1(+)(iterate(>>=(:[1,4,1]))[6]!!n)))
x?l@(([_,w],c):r)|x>w='\n':0?l|0<1=([2..w-x]>>" ")++[c|w>x]++w?r
_?_=""
w#((c,l):m)=(l&w,c):r l&(l&w)#m
_#_=[]
f x=zip"_/\\_/\\"([id,r]<*>[0:1:o,[0,1,0,1],o++[1,1]])!!mod x 6<$[1,3..gcd 3x]
(&)=zipWith(-)
r=reverse
o=[0,0]

Try it online! (Sadly, anything bigger than n=3 gets horribly wrapped and unreadable, but you can copy it to another program to see it.)
Variations

If you change [6] into [6,4,4], you get a whole snowflake. Try it online!
If you remove ,3..gcd 3x, you get a curve in the style that this question was originally given with. Try it online!
Or both at once: Try it online!

How it works

k is the main function, it takes an Int n and returns a String.
iterate(>>=(:[1,4,1]))[6] generates an infinite list containing, for each n, the turns between consecutive lines in that curve iteration, turtle graphics style, as numbers nominally between 0 and 5. Each iteration is just the previous one with the turns 1,4,1 interleaved. The only reason the sublists start out with 6 instead of 0 is to make the gcd trick in f work by avoiding f 0.
scanl1(+) converts the turns into "absolute" directions, up to modulo 6. A 0 means rightwards, then each higher number is 60 degrees counterclockwise from the previous. (Well, it would be 60 degrees if this was a proper drawing rather than ASCII.)
f converts an absolute direction into a list of (character, offset encoding) pairs that encodes which characters to add to the curve (for horizontal directions it generates two pairs, otherwise one), and how the relative position changes.
The # operator iterates through the previous list of (character, offset encoding) pairs, generating actual (coordinate,character) pairs.
Encoding principles:

A character from _/\ nominally represents a line drawn from a starting corner through a rectangular cell to a different ending corner.
Cell coordinates are of the form [y,x], top to bottom, left to right, so that they sort in the order we want to print them. Columns are 1-based. Lists are used instead of tuples for shorter vector arithmetic with (&)=zipWith(-).
A corner is denoted with the same coordinates [y,x] as the cell to its upper left. This ensures that all offsets from a corner to its neighboring cells are nonnegative, avoiding negative constants.
However, corner coordinates are passed around negated to allow all vector operations to be subtractions instead of additions, which avoids all other explicit signs.
An offset encoding list is [y1,x1,x2,y2] where [y1,x1] is the coordinate offset from the starting corner to the character cell and [y2,x2] is the offset from the end corner to the character cell. This means:

The encoding lists for the directions 3..5 are just the reverse of the lists for 0..2, allowing them to be generated with [id,r]<*>.
All necessary vector arithmetic can be done by using (&)=zipWith(-) with either an encoding list or its reverse.

After sorting the list of (coordinate, character) pairs, they are passed to ?, which generates the final String from them.

In x?l@(([_,w],c):r) x is the x-coordinate of the previous character shown on this line, or 0 if at the start of a line; l is the whole current list, w is the x-coordinate of the next character to be added, c is the character, and r is the remaining list.
At this stage the y-coordinates are no longer needed. Because every line contains characters, and every line's first character is well to the left of the end of the previous one, the start of new lines is detected by checking if the x-coordinate has decreased.
Underscore has a larger ASCII value than \ and /, so it gets sorted last if it overlaps with another character in the same position. Thus a redundant underscore is detected by checking that an x-coordinate has been repeated.

Nice! I'll accept this if there is no more activity on this question today.


text:
Count # of Cookie Chocolate Chips
Note: this is my first post here.
The Challenge
The challenge is to count the number of chocolate chips in a cookie. A cookie in this case is a circle with dots (the chips) in it. Given any square cartoon image of this cookie, you are to write a bot that counts and outputs the number of chocolate chips.
Rules

Has to take in an image type of png.
It has to be able to take in any file size, as long as it is square.
It has to be able to handle both color and B&W images.
Output can be in any  human-understandable form.
The circle will be filled with color and will have an outline.
Chips will all be the same size and color.
There is only one cookie in the image
Chocolate chips may be irregularly spaced, but are perfect circles.
You can use a library.
There is nothing in the image except the cookie and the chocolate chips.
-All other cookies will look like the example images.

This is code-golf; the shortest code gets accepted.
Examples
Cookie 1 => 8 or 1000 (binary)
Cookie 2 => 8 or 1000 (binary)
Cookie 3 => 10 or 1010 (binary)
Cookie 4 => 7 or 0111 (binary)

Hello and welcome to PPCG! Please provide some sample cases and consider simplifying the input so it may be more objectively scored (it may be a bit complex to take any kind of hairbrush image - consider creating a criteria).

Please add example images

Hello and welcome to PPCG! Currently this question is lacking quite a few details; image-processing challenges need specifications to be objectively scored. Additionally, you are missing a few details; can the bristles be different sizes? How small can they get? Will there be things other than bristles? I would recommend looking at Wheat Wizard's advice and posting in the Sandbox first to get feedback without the risk of losing reputation or getting the answer closed. So sorry, but I voted this to be closed, which means that it's now on hold. Better luck next time, and check out the Sandbox!

@DigitalTrauma I am working on them right now. I understand your flag and agree with it. Please take it off when I have posted the images, though...

@HyperNeutrino I fixed these things.

I still see references to bristles. Your cleanup is not complete.

This question has been reopened.

Are the chocolate chips always the same size?

@AnthonyPham yes

Anyone going to try something else?

Mathematica 134 Bytes
Max@ComponentMeasurements[ArrayComponents[ImageData@ColorQuantize[RemoveAlphaChannel[#,White],4,Dithering->False],2],"Holes"][[All,2]]&

Usage (applied to .png images)
%/@cookies

Output:
{8,8,10,7}

Here's the code to bring in the cookie examples:
cookieURLs={"https://i.stack.imgur.com/UCV1A.png","https://i.stack.imgur.com/5n7AY.png","https://i.stack.imgur.com/ZbZx6.png","https://i.stack.imgur.com/M8jTo.png"};
cookies=Import/@cookieURLs;

I'm sure this can be shortened, but I think it's fairly bullet-proof as is. The original images have many more colors than the eye can see.
Here are the original cookies:

Here are the cookies after cleanup to get them into a 4 component array:
ArrayPlot[ArrayComponents[ImageData@ColorQuantize[RemoveAlphaChannel[#,White],4,Dithering->False],2]]&/@cookies//Row

After that, all is needed is to use ComponentMeasurements to count holes.
This will always report at least 1.  You could have one really big chocolate chip filling the cookie border, so the 0 or 1 case will always be ambiguous.

Awesome! Can you provide a link so anyone can run it online?


text:
Find the polynomial
We know that f is a polynomial with non-negative integer coefficients.
Given f(1) and f(1+f(1)) return f. You may output f as a list of coefficients, an ASCII formatted polynomial, or similar.
Examples:
f(1)  f(1+f(1))  f
0     0          0
1     1          1
5     75         2x^2 + 3
30    3904800    4x^4 + 7x^3 + 2x^2 + 8x + 9
1     1073741824 x^30

Random question: I'm too tired to try to prove/disprove this right now, but is it guaranteed that we will always be able to get an answer from f(1) and f(1+f(1))?

@HyperNeutrino I wouldn't have made this challenge otherwise.

Right, that is a good point. Hm. Interesting, I will look into proving that tomorrow because that's very interesting. Thanks for the interesting challenge!

The [tag:base-conversion] tag is supposed to be a hint?

As much as this is a cute puzzle, I think the code is basically base conversion. Possibly dupe?

Jelly, 3 bytes
‘b@

Try it online!
Returns the polynomial as a list of coefficients.
Since we know the polynomial has non-negative integer coefficients, f(b) can be interpreted as "the coefficients of the polynomial, taken as base b digits," by the definition of a base. This is subject to the condition that none of the coefficients exceeds or is equal to b, but we know that, because b is one greater than the sum of the coefficients (which is f(1)).
The program simply increments the first argument (‘) to get 1+f(1), then calls the base convertion atom (b) with the first argument as the base and the second argument as the number (using @ to swap the order of the arguments, since b usually takes the number first and base second).
This was quite the clever challenge; thanks orlp!

How in the world is this possible

I need to learn jelly...

Dennis has to see this one for sure.

Mathematica, 29 28 bytes
Thanks to JungHwan Min for saving 1 byte! (ironically, with a Max)
#2~IntegerDigits~Max[#+1,2]&

Pure function taking two nonnegative integers and returning a list of (nonnegative integer) coefficients. #2~IntegerDigits~(#+1) would be the same algorithm as in Doorknob's Jelly answer; unfortunately, Mathematica's IntegerDigits chokes when the base equals 1, hence the need for extra bytes Max[...,2].

Haha, nice one.

Python 2, 38 bytes
a,b=input()
while b:print b%-~a;b/=a+1

Try it online!

outputs newline separated coefficients
Example output for 30, 3904800:
9
8
2
7
4

=> 9*x^0 + 8*x^1 + 2*x^2 + 7*x^3 + 4*x^4

VBA, 75 bytes
Sub f(b,n)
b=b+1
Do While n>0
s=n Mod b &" " &s
n=n\b
Loop
Debug.?s
End Sub

When it automatically formats, it looks like this:
Sub f(b, n)
    b = b + 1
    Do While n > 0
        s = n Mod b & " " & s
        n = n \ b
    Loop
    Debug.Print s
End Sub

The \ operator is a floor divide

Common Lisp, 87 bytes
(defun p(x y)(multiple-value-bind(q m)(floor y (1+ x))(if(= 0 q)`(,m)`(,m ,@(p x q)))))

Ungolfed:
(defun find-polynomial (f<1> f<1+f<1>>)
  (multiple-value-bind (q m)
      (floor f<1+f<1>> (1+ f<1>))
    (if (zerop q) `(,m)
      (cons m (find-polynomial f<1> q)))))

AHK, 63 bytes
a=%1%
b=%2%
a+=1
While b>0
{s:=Mod(b,a) " "s
b:=b//a
}
Send,%s%

AutoHotkey assigns numbers 1-n as variable names for the incoming parameters. It causes some problems when you try to use those in functions because it thinks you mean the literal number 1 instead of the variable named 1. The best workaround I can find is to assign them to different variables.

Java, 53 bytes
a->b->{while(b>0){System.out.println(b%-~a);b/=a+1;}}

Outputs a list of coefficients. Thanks to ovs for the maths.
The expression must be assigned to a Function<Integer, IntConsumer> and called by first applying the function, then accepting the int. No imports are needed with Java 9's jshell:
C:\Users\daico>jshell
|  Welcome to JShell -- Version 9-ea
|  For an introduction type: /help intro

jshell> Function<Integer, IntConsumer> golf =
        a->b->{while(b>0){System.out.println(b%-~a);b/=a+1;}}
golf ==> $Lambda$14/13326370@4b9e13df

jshell> golf.apply(30).accept(3904800)
9
8
2
7
4

C#, 62 bytes
(a,b)=>{var r="";a++;while(b>0){r+=(b%a)+" ";b/=a;}return r;};