[Question]
  [
Given a 2D string as input, either as a string with newlines or a list of lines, output the coordinates `(x, y)` of all the hashes (`#`) in the list. The input will only contain hashes and spaces. (and newlines, if you choose to take input as a 2D string) 
If there are no hashes, you can output anything.
Output should be unambiguous as to which numbers are paired with which.
Example:
```
##
```
Should output:
```
(0,0), (1,0)
```
That assumes 0-based indexing, starting from the top left. You may start from any corner, use 0 or 1-based indexing, and/or output `y` first. (e.g. in the form `y,x`).
More test cases (again, all using 0-based top-left `(x, y)` indexing):
```
    #
#####
#
(4, 0), (0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (0, 2)
# ###
### #
(0, 0), (2, 0), (3, 0), (4, 0), (0, 1), (1, 1), (2, 1), (4, 1)
```
Note that these test cases all list by rows, not by following the path.
You may assume the hashes will form a continuous trail, i.e. `# #` will never be the input. (probably won't matter, but in case somebody wants to regex this)
You also can output the coordinates in any order you want, i.e. vertical columns, horizontal rows, or just an unsorted list.
  
[Answer]
# [Slip](https://github.com/Sp3000/Slip), 2 + 1 = 3 bytes
+1 byte for the `p` flag. Code:
```
`#
```
Explanation:
The `p`-flag returns the position of each occurence of the following:
```
`#      // The character '#'
```
[Try it here!](https://slip-online.herokuapp.com/?code=%60%23&input=%23%20%23%23%23%0A%23%23%23%20%23&config=p)
[Answer]
## [Grime](https://github.com/iatorm/grime), 5 bytes
```
pa`\#
```
[Try it online!](https://tio.run/nexus/grime#@1@QmBCj/P@/srICl4KyMgA "Grime – TIO Nexus")
The output format is a bit funky, but OP has stated that it's valid.
## Explanation
Grime is my 2D pattern matching language.
The part after ``` is the *pattern*, in this case a 1×1 square containing a `#`-character.
Grime will search the input grid for a match, and prints the first one it finds by default.
The part before ``` contains options, in this case signifying that all matches (`a`) should be printed, along with their positions and sizes (`p`).
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~7 6~~ 5 bytes
This is using 1-based indexing with `(1,1)` in the top left corner.
```
oo&fh
```
Explanation:
```
o        % convert char to double 
 o       % remainder mod 2 ('#' == 35, ' '==32) makes spaces falsy
  &f     % apply `find` with 2d-output 
    h   % concatenate outputs to display x- and y-coordinates side by side
```
Thanks @DJMcMayhem and @LuisMendo for each -1 byte!
[Try it online!](https://tio.run/nexus/matl#@5@fr5aW8f9/tLoCECirW6srgwCIBgmoxwIA "MATL – TIO Nexus")
[Answer]
# [Python](https://docs.python.org/3/), 67 bytes
This is actually just a golf of my [Stack Overflow answer](https://stackoverflow.com/a/41430965/7089349) on a similar topic.
```
lambda a,e=enumerate:[[(i,j)for j,B in e(A)if'!'<B]for i,A in e(a)]
```
[**Try it online!**](https://tio.run/nexus/python3#JczBCsIwEATQu18xpofuQr5A7KH9jZDDihvY0sYSUn8/Rp3LwBuYljBhk/3xFIjXSfO5a5GqtxDI/MrpVbD6BZahNLOl8Trel/hl8/OfhWOT/qNv2cjycVZivhzFcqXUV27BARichxt6ft3BxQ8)
The loops through the 2D list, recording the hash characters, and returns the result. We save a byte by using `char > '!'` rather than `char == '#'`, because the input will only consist of hashes and spaces, and so hashes (`0x23`) will be the only characters larger than exclamation marks (`0x21`).
[Answer]
## JavaScript (ES6), ~~70~~ 67 bytes
```
s=>s.replace(/./g,(c,i)=>c>' '?[i%l,i/-l|0]+' ':'',l=~s.indexOf`
`)
```
Outputs a newline-and-space-separated list of coordinates, e.g.
```
4,0
0,1 1,1 2,1 3,1 4,1
0,2
```
You can get much shorter with a weird output format:
```
s=>s.replace(/#/g,(c,i)=>[i%l,i/-l|0]+c,l=~s.indexOf`
`)
```
This outputs
```
    4,0#
0,1#1,1#2,1#3,1#4,1#
0,2#
```
for the second test case. It's still clear which numbers are paired with which...
[Answer]
## [J](http://jsoftware.com/), 12 bytes
```
$#:'#'I.@:=,
```
[Try it online!](https://tio.run/nexus/j#@5@mYGuloKJspa6s7qnnYGWr878EJGKsYKKgoqCurKwARApApKCszpWanJGvoO6ZV1BaAuWUQMX8S0sQgmkKJf8B "J – TIO Nexus")
## Explanation
```
$#:'#'I.@:=,  Input is y.
           ,  Flatten y
   '#'    =   and form bit vector of equality with #.
      I.@:    Compute positions of 1s
 #:           and convert each to base
$             shape of y.
```
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM) 16.0, 5 chars = 9 [bytes](http://meta.codegolf.stackexchange.com/a/9429/43319) or 6 chars = 8 [bytes](http://meta.codegolf.stackexchange.com/a/9429/43319)
Gives list of (y,x) pairs from top left.
```
⍸⎕='#'
```
`⍸` where
`⎕` input
`=` equals
`'#'` this character\*
\* It is possible to save a character at the cost of one byte by replacing `'#'` with `⍕#` (format the root namespace)
[TryAPL online!](http://tryapl.org/?a=i%u2190%7B%28%2C%u2375%29/%2C%u2373%u2374%u2375%7D%20%u22C4%20%u22A2%u2206%u21903%205%u2374%27%20%20%20%20%23%23%23%23%23%23%23%27%20%u22C4%20i%20%u2206%3D%27%23%27%20%u22C4%20%u22A2%u2206%u21902%205%u2374%27%23%20%23%23%23%23%23%27%20%u22C4%20i%20%u2206%3D%27%23%27&run) Note that `⍸` has been emulated with `i` because TryAPL runs version 14.0.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
n⁶T€,€"J
```
[Try it online!](https://tio.run/nexus/jelly#@5/3qHFbyKOmNTpArOT1////aCUFIFBW0lFSBgEQDRJQigUA "Jelly – TIO Nexus")
Given a 2D array of characters (= a list of strings):
```
            Implicit input (example):
               [[' ', ' ', ' ', ' ', '#']
               ,['#', '#', '#', '#', '#']
               ,['#', ' ', ' ', ' ', ' ']]
n⁶          Not-equal to space (⁶).
               [[0, 0, 0, 0, 1]
               ,[1, 1, 1, 1, 1]
               ,[1, 0, 0, 0, 0]]
  T€        Indices of 1s in each row
               [[5], [1,2,3,4,5], [1]]
    ,€"J    Pair each, vectorizing, with y-indices
               [[[5,1]], [[1,2],[2,2],[3,2],[4,2],[5,2]], [[1,3]]]
```
[Answer]
## JavaScript (Firefox 30-57), 61 bytes
```
s=>[for(c of(x=0,y=1,s))if(c<' '?(y++,x=0):(x++,c>' '))[y,x]]
```
Returns 1-based coordinates. Easily switchable between `[y, x]` and `[x, y]` ordering. Ungolfed:
```
function coords(s) {
    var x = 0;
    var y = 1;
    for (Var c of s) {
        if (c == "\n") {
            y++;
            x=0;
        } else {
            x++;
        }
        if (c == "#") {
            console.log(y, x);
        }
    }
}
```
[Answer]
# Vim, 37 bytes
```
:%s/#/\=line('.').','.col('.').' '/g<cr>
```
Since V is mostly backwards compatible, you can [Try it online!](https://tio.run/nexus/v#@2@lWqyvrB9jm5OZl6qhrqeuqaeuo66XnJ8D5Sio66dz/f@vrKCsrMwFxArKAA)
A straightforward regex solution, where it replaces each '#' with the location it was found in (one-based indexing). I was a little bit worried while writing this that the location would change after substituting the first one on a line, but that doesn't seem to be an issue. TBH I'm pleasantly shocked by how simple this solution ended up being.
Unfortunately, vimscript is very verbose, so most of the bytes come from separating the results so that is still legible. Otherwise, we could do
```
:%s/#/\=line('.').col('.')/g
```
But this creates output that's pretty hard to interpret. Additionally, it will only work it the grid is always 9x9 or smaller.
This is a really fun solution because it shows each pair of coordinates *at the location* of the hash it represents. For example, the input
```
# ###
### #
```
outputs
```
1,1  1,3 1,4 1,5 
2,1 2,2 2,3  2,5 
```
Of course, if we were using V, we could remove the trailing newline, and compress the regex. Then it could simply be
```
Í#/½line('.').','.col('.').' '/g
```
(32 bytes)
But since this is the exact same approach and still painfully verbose, it doesn't seem worth it to use a golfing language.
[Answer]
## Haskell, 53 bytes
```
concat.zipWith(\y l->[(x,y)|(x,'#')<-zip[0..]l])[0..]
```
Input is taken as a list of strings. The output is a list of `(x,y)` pairs (0 indexed), e.g. 
```
*Main> concat.zipWith(\y l->[(x,y)|(x,'#')<-zip[0..]l])[0..] $ ["# ###","### #"]
[(0,0),(2,0),(3,0),(4,0),(0,1),(1,1),(2,1),(4,1)]
```
[Answer]
## Lua, 141 bytes
```
w=io.read()x=w:sub(1,w:find("\n")-1):len()_,c=w:gsub("\n","")for i=0,x do for j=0,c+1 do if w:sub(c*x+i,c*x+i)=="#"then print(i,j)end end end
```
It's 2:30 AM, I'm in bed, on my phone. Why am I doing this?
[Answer]
## Mathematica, 12 bytes
```
Position@"#"
```
Operator form of [`Position`](http://reference.wolfram.com/language/ref/Position.html). Assumes a 2D array of characters. 1-indexed starting at the top left entry. Outputs a list of coordinates in the form `{row,column}`.
[Answer]
# PHP, 69 bytes
```
for(;$a=$argv[++$i];)for($j=0;""<$c=$a[$j++];)echo$c>" "?"$j $i,":"";
```
Uses 1-based indexing starting from the top left.  
Use like:
```
php -r 'for(;$a=$argv[++$i];)for($j=0;""<$c=$a[$j++];)if($c>" ")echo"$j $i,";' '    #' '#####' '#    '
```
Will output:
```
5 1,1 2,2 2,3 2,4 2,5 2,1 3,
```
[Answer]
# C, 113 bytes
```
i,j,k,l;f(char**p){i=strlen(*p);l=strlen(p);for(j=0;j<l;j++)for(k=0;k<i;k++)if(p[j][k]==35)printf("%d,%d ",k,j);}
```
Outputs from test cases:
```
0,0 2,0 3,0 4,0 0,1 1,1 2,1 4,1 
4,0 0,1 1,1 2,1 3,1 4,1 0,2 
```
[Try it online!](https://tio.run/nexus/c-gcc#NY07DoMwEET7nALZQvKCi0CUavFJEAUKseJPwDKkQpydrEPYat7OSG830konPWrxePWxKAKsRs1L9M9REKA/gbKeorDqirbxaMsSEjti1xh0xEaL0NqudZ1StzuEaMZFC5YPMh8yRhoLuO3v3owC1p8uVG2n1gvjGeecSQqcItvwaOujzejO9j9LL5qRsAIMn2UWjEHCOim@ "C (gcc) – TIO Nexus")
[Answer]
## RBX.Lua, 131 bytes
Has to assume input is valid (Z is the flat axis, whitespaces are `White` tiles, hashes can be any other color, top-left part is located at `0, 0, 0`) and all parts are part of the same model `M`, and the model is otherwise empty.
```
for k,v in pairs(workspace.M:GetChildren())do if v.BrickColor~=BrickColor.new("White")then print(v.Position.X,-v.Position.Y)end end
```
Sample input/output:
[![Example](https://i.stack.imgur.com/l5Yih.png)](https://i.stack.imgur.com/l5Yih.png) 
[Answer]
# [Perl 6](http://perl6.org/), 25 bytes (22 characters)
```
{^∞ZX@_».indices("#")}
```
Takes input as a list of lines.  
Outputs one list per line, each containing (y, x) tuples for the coordinates.  
[Try it online!](https://tio.run/nexus/perl6#Ky1OVSgz00u25uLKrVRQS1Ow/V8d96hjXlSEQ/yh3XqZeSmZyanFGkrKSpq1/4sTKxXSFFTiFdLyixRUbNMy8zKLM/SSM/JzC/SKC3IySzSUYvJi8pQ0gaZBZbmUlbm4FIBAGcgCAi4gl0tZAcxSBtL/AQ "Perl 6 – TIO Nexus")
### How it works
```
{                    }  # A lambda.
{    @_»             }  # For each input line:
        .indices("#")   #    get x-coordinates.  (4) (0 1 2 3 4) (0)
 ^∞                     # Range from 0 to Inf.    0   1           2 ...
   Z                    # Zip with:              (0 (4)) (1 (0 1 2 3 4)) (2 (0))
    X                   #    Cartesian product.  ((0 4)) ((1 0) (1 1) (1 2) (1 3) (1 4)) ((2 0))
```
[Answer]
# Groovy, ~~80~~ 68 bytes
```
{y=0;it.each{it.eachWithIndex{x,i->print(x=='#'?"($i,$y)":"")};y++}}
```
Example input:
```
[#   #,#   #,#####]
```
Example Output:
```
(0,0)(4,0)(0,1)(4,1)(0,2)(1,2)(2,2)(3,2)(4,2)
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 24 + 1 = 25 bytes
+1 byte for `-n` flag. Coordinates are 1-based, one number per line.
```
gsub(/#/){p$`.size+1,$.}
```
[Try it online!](https://tio.run/##KypNqvz/P724NElDX1lfs7pAJUGvOLMqVdtQR0Wv9v9/ZQVlZWUuIFZQ/pdfUJKZn1f8XzcPAA "Ruby – Try It Online")
[Answer]
# C, 80 bytes
```
x,y;f(char*s){for(x=y=0;*s;printf(*s-35?"":"%d,%d ",x,y),*s++==10?++y,x=0:++x);}
```
Requires input as newline-delimited char array, prints output to screen.
Ungolfed & usage:
```
x,y;
f(char*s){
 for(
  x = y = 0;             //init coordinates
  *s;                //iterate until end
  printf(*s-35 ? "" : "%d,%d ", x, y),     //print coordinates or empty string
  *s++==10 ? ++y, x=0 : ++x              //advance to the right or the next line
 );
}
main(){
 f("    #\n#####\n#    ");
 puts("");
 f("# ###\n### #");
}
```
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 2 bytes
```
⍸<
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn//1HvDpv/aY/aJjzq7XvU1XxovfGjtomP@qYGBzkDyRAPz@D/QNo5Uj0lLa9YnSsls7hAIU0BKATUYqhg9Kh3i7oymrCxgilIWAEIlCEAxERTZARRpAxVoqCsDgA "APL (Dyalog Extended) – Try It Online")
I win. (Though it's technically tie because we don't count flags in bytes anymore...)
Basically works like [the existing APL answer](https://codegolf.stackexchange.com/a/105664/78410), but it doesn't test for equality with `'#'`; it tests if each char is non-blank.
]