text:
Fibonacci-style matrix expansion
For each row and then column of a matrix, we can add an extra entry with the sum of the last two entries in that row or column.  For example with the following input matrix:
[ 1 1 1 ]
[ 2 3 4 ]

The resulting matrix would be:
[ 1 1 1 2 ]
[ 2 3 4 7 ]
[ 3 4 5 9 ]

Given an input of an integer N and an [X,Y] matrix of size at least 2x2, perform the above expansion N times and output the result.  The resulting matrix will always be of size [X+N,Y+N].
Examples:
Input:                     Output:

2, [ 0 0 ]                 [ 0 0 0 0 ]
   [ 0 0 ]                 [ 0 0 0 0 ]
                           [ 0 0 0 0 ]
                           [ 0 0 0 0 ]

3, [ 1 1 1 ]               [ 1  1  1  2  3  5 ]
   [ 2 3 4 ]               [ 2  3  4  7 11 18 ]
                           [ 3  4  5  9 14 23 ]
                           [ 5  7  9 16 25 41 ]
                           [ 8 11 14 25 39 64 ]

MATL, 13 14 15 16 20 21 bytes
2*:"!tP2:Y)sv

Thanks @Zgarb for removing 1 byte!
Try it online!
2*         % implicitly input number N and multiply by 2
:          % create vector [1,2,...,2*N]
"          % for loop: do this 2*N times
  !        %   transpose. Implicitly input matrix in the first iteration
  tP       %   duplicate and flip vertically
  2:       %   vector [1,2]
  Y)       %   pick submatrix formed by the first two rows
  s        %   sum of each column
  v        %   append as a new row
           % end for
           % implicit display

I don't know MATL, but wouldn't it be shorter to loop 2N times than to loop twice N times?

@Zgarb Of course! How did I miss that? Thanks!!

Does MATL have a built-in for doubling a number?

@Zgarb No. You need 2* (postfix notation). Maybe it should have a one-character built-in, it's used often. Also 2^ (square). But I'm running out of code space :-)

J, 19 bytes
(v"1@v=.,[+&{:}:)^:

This defines an adverb, which takes the number on its left, and produces a verb taking the matrix on its right.
For the second example, it gives
  3 ((v"1@v=.,[+&{:}:)^:) 2 3 $ 1 1 1 2 3 4
1  1  1  2  3  5
2  3  4  7 11 18
3  4  5  9 14 23
5  7  9 16 25 41
8 11 14 25 39 64

Explanation
(v"1@v=.,[+&{:}:)^:  Left argument x, right argument y
(               )^:  Repeat x times:
     v=.               Bind the following verb to v, and apply to y:
         [    }:         y and y-without-last-item
          +&{:           Sum of their last items
        ,                Append that to y
                       (v automatically threads to rows)
 v"1@                  then apply v to columns

K, 23 bytes
{x(2({x,+/-2#x}'+)/)/y}

In action:
  {x(2({x,+/-2#x}'+)/)/y}[3;(1 1 1;2 3 4)]
(1 1 1 2 3 5
 2 3 4 7 11 18
 3 4 5 9 14 23
 5 7 9 16 25 41
 8 11 14 25 39 64)

Try it here.

it still works if you remove the leading {x and trailing y}

Jelly, 15 13 12 bytes
-1 byte by @Dennis
ṫ-S;@"Z
ÇḤ}¡

Like @LuisMendo's MATL answer, this transposes the array before doing the transformation along one axis. Therefore, we need to call the function 2*n times.
ṫ-S;@"Z       Helper link. Input: x (2D array)
 -              Numeric literal: -1
ṫ               Get x[-1:], i.e. last two rows in x
  S             Sum
   ;@"          Append each to x. " is 'zipWith'; @ switches argument order.
      Z         Transpose the array.
ÇḤ}¡          Main link. Input: a, n
Ç               Call the last link on a
 Ḥ}             2n
   ¡            times.

Try it here.

ES6, 134 bytes
(n,a)=>[...a.map(b=>[...b,...Array(n)].map(c=>(c<1/0?0:c=a+d,d=a,a=c))),...Array(n)].map(b=>(b?0:b=[...a].map((c,j)=>c+d[j]),d=a,a=b))

Explanation:
(n,a)=> // arguments n is number to expand, a is original array
    [...
        a.map(b=> // for each row in a
            [...b,...Array(n)] // append n elements to the row
            .map(c=>(c<1/0?0:c=a+d,d=a,a=c))) // scan the elements and fill the new ones by summing the previous two
        ,...Array(n)] // append n rows
    .map(b=>(b?0:b=[...a].map((c,j)=>c+d[j]),d=a,a=b)) // scan the rows and fill the new rows by summing the previous two rows

CJam, 17 16 bytes
q~2*{~_2$.+]z}*p

Input format is the matrix first (as a CJam-style 2D array) and the number of iterations afterwards.
Test it here.
Explanation
Turns out this is the same solution as everyone else's:
q~      e# Read and evaluate input.
2*      e# Double the iteration count.
{       e# Run this block that many times...
  ~     e#   Dump all rows on the stack.
  _     e#   Copy the last row.
  2$    e#   Copy the penultimate row.
  .+    e#   Vectorised addition.
  ]     e#   Wrap all rows in a new array.
  z     e#   Transpose such that the next iteration processes the other dimension.
}*
p       e#   Pretty-print.

Haskell, 67 bytes
o%m=m++[o(+)(last m)$last$init m]
(!!).iterate(map(id%).(zipWith%))

Usage example:
*Main> ( (!!).iterate(map(id%).(zipWith%)) ) [[1,1,1],[2,3,4]] 3
[[1,1,1,2,3,5],[2,3,4,7,11,18],[3,4,5,9,14,23],[5,7,9,16,25,41],[8,11,14,25,39,64]]

How it works:
(!!).iterate(    ...         )  -- repeatedly apply ... to the first agrument and
                                -- pick the iteration defined by the second arg
                   (zipWith%)   -- for one iteration add a new row and
          map(id%)              -- then a new element at the end of each each row

o%m                             -- add row or element at the end of a row resp.
                                -- argument o is a "modify function"
                                --          m the whole matrix or a row
 m++[    (last m)(last$init m)] -- take m and append the result of combining the
                                -- last and 2nd last element of m
     o(+)                       -- with a modified version of (+)
                                -- modification is none (aka. id) when adding an
                                -- element to the end of a row and
                                -- zipping elementwise (zipWith) when adding a row

I'm a haskell novice.  I've got as far as sudo apt-get install haskell-platform and am running the ghci REPL which gives me a Prelude>  prompt.  When I paste in o%m=m++[o(+)(last m)$last$init m] I get <interactive>:2:4: parse error on input '='.  Can you give me a little primer either running this from a source file or in the REPL?

@DigitalTrauma: either put the o%m=... line (and only this line) in a file called, let's say fib-matrix.hs. Then you can use the :l fib-matrix.hs command in ghci to load the definitions and call the main function just as described in my usage example. -- Or use let o%m=...  in ( (!!). ... ) [[1,1,1]...] 3.

@DigitalTrauma: oh, there's a 3rd way: give the main function a name, e.g. add a f= in front of the second line: f=(!!).iterate..., save both lines in a file and load it via l: <filename.hs>. Then you can call f [[1,1,1],[2,3,4]] 3, etc.

I'm not sure I would accept this as valid haskell, the top line is a function definition and needs modification for use in the REPL, but the 2nd line can be can only be used in the REPL.

@DanielHill: there's a topic on meta which allows unnamed functions that depend on global helper functions.

Java, 2179 bytes
Just Worked it out:-
This code is on Java Language.
import java.util.Scanner;

public class FebonnaciMatrix {
        static Scanner scan=new Scanner(System.in);

        public static void main(String[] args) {

        int x,y;
        System.out.println("For the Array to Work Upon:- ");

        System.out.println("Enter the Row:- ");
        int row=scan.nextInt();
        System.out.println("Enter the Column:- ");
        int col=scan.nextInt();

        int inpArr[][]=new int[row][col];

        System.out.println("Enter the values");
        inpArr=inpValues(row,col);

        System.out.println("The Input Array is:- ");
        display(inpArr,row,col);

        System.out.println("Input the Array size of Febonacci Array ");

        System.out.println("Enter the Row");
        int frow=scan.nextInt();
        System.out.println("Enter the Column");
        int fcol=scan.nextInt();

        int febArr[][]=new int[frow][fcol];
        febArr=copyValue(inpArr,febArr,row,col);

        for(x=0;x<row;x++)
        {
            for(y=col;y<fcol;y++)
                febArr[x][y]=febArr[x][y-2]+febArr[x][y-1];
        }

        for(x=row;x<frow;x++)
        {
            for(y=0;y<fcol;y++)
                febArr[x][y]=febArr[x-2][y]+febArr[x-1][y];
        }

        System.out.println();
        System.out.println("The Febonacci Array:-");
        display(febArr,frow,fcol);
    }

    static void display(int[][] arr,int row,int col)
    {
        int x,y;
        for(x=0;x<row;x++)
        {
            for(y=0;y<col;y++)
                System.out.print(arr[x][y]+"\t");
            System.out.println();
        }
    }

    static int[][] inpValues(int row,int col)
    {
        int arr[][]=new int[row][col];
        int x,y;
        for(x=0;x<row;x++)
        {
            for(y=0;y<col;y++)
            {
                System.out.print("Enter the value:- ");
                arr[x][y]=scan.nextInt();
            }
        }
        return arr;
    }

    static int[][] copyValue(int[][] old, int[][] ne, int row,int col)
    {
        int x,y;
        for(x=0;x<row;x++)
        {
            for(y=0;y<col;y++)
                ne[x][y]=old[x][y];

        }
        return ne;
    }

}

Welcome to Programming Puzzles and Code Golf! The question is tagged [tag:code-golf] which means that answers are competing to be written in the shortest amount of code possible (in bytes).  Your answer may well solve the problem, but I see little attempt to "golf" the code (i.e. make it as short as possible).  There are plenty of trivial opportunities to do this with your code, e.g. variables with 1-char names, and removal of unnecessary whitespace.  Beyond that you can read these tips, specifically for java

... Have a look at the tag-wiki for code-golf, especially the How should I answer a code golf? Any hints? section.  Also note that java is notoriously hard to golf down to short code, in comparison with many other languages.  This shouldn't dissuade you though - if you have a well-golfed java answer, it is likely to be quite popular, even if it is longer than all the other answers.  Don't be put off by all the mind-bendingly short esolang answers - this community tends to be good at taking language handicaps into account.

@DigitalTrauma- Thanks... for helping me out as a newbee to this... I'll surely go through the links and come up with a new code...

Since you're a new user, I took the liberty of editing your answer for better formatting.  In particular a) a clear title stating language and number of bytes, b) code formatting of your code.  On all stackexchange sites, code formatting is easy - simply prefix all your code lines with 4 spaces.  In fact even easier - in the edit box, select your code, then click the {} at the top of the edit box - this will automatically do this prefixing.

Okay... I will just check it out...

Python, 103 105 bytes
f=lambda n,L:f(n-1,[l+[sum(l[-2:])]for l in L])if n else L
lambda n,L:zip(*f(n,map(list,zip(*f(n,L)))))

Anonymous function takes list of list and passes to recursive function f.  Output is transposed and then passed to f again, then the output of the second go is re-transposed.  Output is a list of tuples
Saved two bytes thanks to bakuriu

n>0 could simply be n, since you start with a positive n and when you reach 0 its value is false.

Seriously, 20 bytes
,,τ"┬`;d@d@X+@q`M"£n

Takes input the matrix (as a 2D list), then N. Outputs a 2D list.
This version doesn't work on the online interpreter for some reason, but does work with this pre-challenge commit.
A version that works online, for 23 bytes:
,τ",┬`;d@d@X+@q`M"nkΣ£ƒ

Takes input in the opposite order (N, then matrix).
Try it online!
I will add an explanation after I sleep for a little while. Working around interpreter bugs is never fun.

Pyth, 13 12 bytes
u+Rs>2dCGyEQ

Try it online. Test suite.
Uses the same algorithm to most answers. Takes as input the matrix as a 2D array on the first line and n on the second line.
Explanation
u        yEQ     do 2*N times, starting with input matrix:
       CG          transpose
 +R                append to each row:
   s                 sum of
    >2d              last 2 elements of row

Matlab, 60 bytes
I was first messing about with Matlab's fancy indexing methods (i.e., A(end+1,:)=sum...) before I figured that in this rare case, simple concatenation is actually cheaper in Matlab. Too bad I had to convert this into an actual function.
Should work with Octave as well.
function A=f(A,n)
for i=1:2*n
A=[A;sum(A(end-1:end,:))]';end

I suppose this is a prime example of how not to make algorithms. For A=2x2, n=1000 this algorithm already takes 5 seconds on my laptop, n=2000 it's almost 50 seconds! (or approximately 30s if A is a gpuArray thanks to my trusty Quadro 1000M)

I don't have a copy of Matlab.  Can I run this under GNU octave?  If so can you give instructions?

Yes I called it Matlab because it doesn't use any Octave specific functions. Simply put it in a file called f.m and run as e.g. f([0,1;2,3],1000)

I see. 1) save as f.m. 2) Start octave.  3) Paste load f.m; f([1,1,1;2,3,4],3) into the REPL prompt - works for me.

If you say so! I only use the octave online website so no idea how it should work otherwise. I'll see if I can permalink from there

APL (Dyalog Classic), 17 bytes
{⍉⍵,⊢/2+/⍵}⍣2⍣⎕⊢⎕

Try it online!

Perl 6,  87 73  71 bytes
->\c,\m{for ^c {.[+*]=[+] .[*X-1,2]for m;m.push: [map {[+] m[*X-1,2;$_]},m[0].keys]};m}
->\c,\m{for ^c {.[+*]=[+] .[*X-1,2]for m;m[+*]=[m[*-2;*] »+«m[*-1]]};m}
->\c,\m{for ^c {.[+*]=[+] .[*X-1,2]for m;m[+*]=[m[*-2;*]Z+m[*-1;*]]};m}

-> \c, \m {
  for ^c { # 0 ..^ c

    # each row
    .[+*]                            # new column at the end of row ($_)
          = [+] .[ * X- 1,2 ]        # add up the last two entries in row ($_)
                              for m; # for every row

    # too bad this was longer than the above code
    # m[*;+*]=map *+*,m[*;*-2,*-1]

    # each column
    m[ +* ]                 # add new row
            = [             # make it an Array rather than a List
                m[ *-2; * ] # the second to last row
                »+«         # added columnwise with
                m[ *-1 ]    # the last row
              ]
  };

  m # return the result
}

Usage:
use v6.c;
# give it a lexical name
my &code = ->\c,\m{ … }

my @return = code 3,[[1,1,1],[2,3,4]];

put '[ ', $_».fmt('%2d'), ' ]' for @return;

put '';

put @return.perl ~~ {S:g/' '//};

[  1  1  1  2  3  5 ]
[  2  3  4  7 11 18 ]
[  3  4  5  9 14 23 ]
[  5  7  9 16 25 41 ]
[  8 11 14 25 39 64 ]

[[1,1,1,2,3,5],[2,3,4,7,11,18],[3,4,5,9,14,23],[5,7,9,16,25,41],[8,11,14,25,39,64]]

Pasting this into perl6 gives me some errors.  I'm a perl novice - what am I doing wrong?

@DigitalTrauma I'm sorry I should have written the usage as my &code = ->\c,\m{ … } to make it clear that the  ->\c,\m{ … } needs to be replaced with the code above. I usually use an implicit $_ or @_ or explicit placeholder parameters $^a because they tend to be shorter. I just didn't think about it. Also make sure that you are using a new enough version ( $*PERL.compiler.version !before 2015.12 )

@DigitalTrauma You can also go on the #perl6 channel on freenode.net and use camelia (like this) to run the code (precede lines with m:  and a space) You can also msg camelia directly


text:
Magnetic pull in an array
Background
I have a row of powerful magnets and a bunch of metal objects between them.
Where will the magnets pull them?
Input
Your input is an array of non-negative integers, which will contain at least one 1.
You can use any reasonable format.
The 0s of the array represent empty space, and the 1s represent fixed magnets.
All other numbers are metal objects, which are pulled by the magnets.
Every object gets pulled towards the nearest magnet (if there's a tie, the object is pulled to the right), and it travels in that direction until it hits the magnet or another object.
In the end, all the objects have clustered around the magnets.
The order of the objects is preserved.
Output
Your output is the array where every object has been pulled as close to the nearest magnet as possible.
It should have the same format as the input.
Example
Consider the array
[0,0,2,0,1,1,0,2,0,3,0,5,0,1,0]

The leftmost 2 gets pulled towards the first pair of magnets, as does the second 2.
The 3 has a magnet four steps away in both directions, so it gets pulled to the right.
The 5 also gets pulled to the right, and it goes between the 3 and the magnet.
The correct output is
[0,0,0,2,1,1,2,0,0,0,0,3,5,1,0]

Rules and scoring
You can write a full program or a function.
The lowest byte count wins, and standard loopholes are disallowed.
Test cases
[0,1,0] -> [0,1,0]
[1,0,2,0,0,1,0] -> [1,2,0,0,0,1,0]
[7,0,5,0,0,1,0] -> [0,0,0,7,5,1,0]
[1,0,3,0,1,0,3,0,1] -> [1,0,0,3,1,0,0,3,1]
[1,0,0,0,0,0,0,7,3] -> [1,7,3,0,0,0,0,0,0]
[1,2,3,4,5,6,7,8,9,10,11,0,0,0,1] -> [1,2,3,4,5,6,7,0,0,0,8,9,10,11,1]
[12,3,0,0,1,0,1,3,0,0,6,12,0,0,0,1] -> [0,0,12,3,1,0,1,3,6,0,0,0,0,0,12,1]

Pyth, 28 20
o@.e?bhaDk_x1QkQ~hZQ

Thanks @ThomasKwa for golfing 6 bytes!
This abuses stable sorting by assigning to all the values 1 or greater in the list the index of the nearest 1 (ties broken to the rightmost 1) and then sorting the list by these values. Zeroes are given their own index as their sort value.
Test Suite
Verification Suite
Explanation:
o@.e?bhaDk_x1QkQ~hZQ  ##  implicit: Q = eval(input())
o                  Q  ##  Sort Q using the values of the lambda below
 @              ~hZ   ##  select the value from the matching index of the enumerate
  .e           Q      ##  enumerate with b = value, k = index
    ?b                ##  ternary on b
      haDk_x1Q        ##  if true, this thing
              k       ##  otherwise use the index as the sort weight
          _x1Q        ##  the indices of 1 in Q, given in reverse order
                      ##  (the reverse makes it sort to the right because of stable sorts)
       aDk            ##  sort those indices by |index - k|
      h               ##  take the first value

Example:
Take the test case [1,0,3,0,1,0,3,0,1], for example. When we apply the enumeration, the zeros will all get their own index as a sort value, so I'll skip those, and do a one and a three.
For the first one, we get the indices of ones: [0, 4, 8]. Then reverse it, and sort by the absolute value of the indices minus the index of the one, which happens to be zero here. So we get [0, 4, 8] back again. The first value is 0 so we use that.
For the three, we get the reversed indices and do the same sorting but using two as the index of the three, so both the 0 and the 4 give the same value for the absolute difference, so we get: [4, 0, 8] and we take the 4.
Then the final "sorting values" array will be [0, 1, 4, 3, 4, 5, 8, 7, 8]. Thanks to the stable sort, the ties are broken by the order that the values originally appeared, so we get the final array we want.

Sorting by the index of nearest 1 is a nice idea!

Retina, 97 72 bytes
+`(?<=\b1(,1*)*?)(\B,(11+)|,(11+))\b(?!(?<-1>,1*)*,1\b)|(11+),\B
$3,$4$5

Input is expected to be a comma-separated list of unary integers (leading and trailing delimiters like [...] work just fine).
Run all test cases here. (For convenience, this takes care of the conversion from and to decimal automatically.)
Here is a completely different idea that avoids the expensive balancing groups by using multiple stage. It's currently 6 bytes longer, but might be more golfable:
,1\b
>1
\b1,
1<
(T`,`<`<1*,
)T`,`>`,1*>
+`(1+>)>
>$1
+`<(<1+\b)(?!>)
$1<
<|>
,

As soon as I saw this challenge I thought Retina would be a good fit (+1)

@MichaelKlein Thanks, but I don't really think it is. I'm surprised it's even beating JavaScript, but I'm pretty sure it won't stand a chance against any of the golfing languages.

Good fit as in I immediately started thinking how to solve in Retina

JavaScript (ES6), 108 bytes
a=>a.map(_=>a.map((x,i)=>x>1?a[j=(n=a.indexOf(1,i))<0|n-i>i-p?i-1:i+1]?0:a[a[i]=0,j]=x:x<1?0:p=i,p=-1/0))&&a

Explanation
Iterates over each cell and if it contains metal, checks if the next cell in the direction of the closest magnet is empty, and if it is, moves it there. This process is repeated many times until all metal has moved as far as it can go.

var solution =

a=>
  a.map(_=>                  // loop a.length times to ensure completeness
    a.map((x,i)=>            // for each cell item x at index i
      x>1?                   // if the cell contains metal
        a[j=                 // j = index of cell to move to
          (n=a.indexOf(1,i)) // n = index of next magnet
          <0|n-i>i-p?i-1:i+1 // set j to previous or next cell based on closest magnet
        ]?0:                 // if cell j is empty
          a[a[i]=0,j]=x      // set it to x and set cell i to 0
      :x<1?0:                // else if the cell contains a magnet
        p=i,                 // set p to the index of this magnet
      p=-1/0                 // p = index of previous magnet, initialise to -Infinity
    )
  )
  &&a                        // return a
<input type="text" id="input" value="1,2,3,4,5,6,7,8,9,10,11,0,0,0,1" />
<button onclick="result.textContent=solution(input.value.split(',').map(n=>+n))">Go</button>

PHP, 337 chars
<?$i=explode(",",$argv[1]);$m=$n=[];foreach($i as$k=>$v)if($v>0)eval("array_push(\$".($v<2?"m":"n").",$k);");for($p=0;$p<count($i);$p++)foreach($i as$k=>$v)if($v>1){$i[$k]=0;$r=-1;foreach($m as$_)if($r<0||abs($k-$r)>abs($_-$k))$r=$_;while($i[$r]>0)$r+=($r<$k?1:-1);$i[$r]=$v;}$s="";foreach($i as$v)$s.=$v.",";echo substr($s,0,-1)."\n";?>

Yes this is very long, because PHP is not really a language for golfing, but it works and I had FUN making it so it's fine to me. Of course I'm open to possible shortings.
Also there is a little bug feature which thinks, so for example here:
root@raspberrypi:~/stack# php magnet.php 12,3,0,0,1,0,1,3,0,0,6,12,0,0,0,1
0,0,3,12,1,0,1,3,6,0,0,0,0,0,12,1

it looks like the 12 magicly got in front of the 3, but that's not true!
The 3 respects the bigger number and lets it go closer to the maget!

Haskell, 127 bytes
(a:b)!(c:d)=c/=1&&a==1||b!d
_!_=1<0
infix 4#
x@(a:b)#0:i@(c:d)|i!x=a:0:b#i|x!i=c:x#0:d
x#a:b=a:x#b
x#[]=x
l=([]#)
l.l.l.reverse

Try it online!
Instead of moving the objects towards the magnets we move the empty space away from the magnets.
A big frustration for me was that the default was to the right.  Defaulting to the left could have saved me 10 bytes.  To default to the left we do l.l to default to the right we need l.l.l.reverse.
When we run l it naturally reverses the list, however this is actually pretty convenient since we need to run it on the list going both ways, so the output is ready to go for the second run.  Unfortunately though since to default to the right this means we need to reverse it manually first, then run it twice, we end up needing an additional l to get it back to the correct order.

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:
All the numbers that fit in a string
Write a program or function that takes in a positive integer N. Output a list of all the distinct decimal numbers that can be written in exactly N characters using digits (0123456789), decimal points (.), and negative signs (-).
For example, some numbers that would be in the N = 4 output list are 1337, 3.14, .999, -789, -2.7, and -.09.
The numbers are to be written in the normal way, but in as short a form as possible. This means:

The decimal point should only be included if the number is not an integer.

e.g. 45.0 and 45. should be written as plain 45
-45.00 should be written as -45

There should be no leading zeroes to the left of the decimal point.

03 and 003 should be written as 3, but 30 and 300 are fine as they are
0.3 and 00.3 should be written as just .3
-03 should be written as -3
-0.3 should be written as -.3

There should be no trailing zeroes to the right of the decimal point

.50 and .500 should be written as .5
900.090 should be written as 900.09

The exception to the two last rules is zero itself, which should always be written as plain 0.
Positive signs (+) should not be used since they unnecessarily lengthen the number.

Also note that the negative sign (-) should not be used as a subtraction sign. It should only appear as the first character of numbers less than zero.
Formatting
The order of the output list of numbers does not matter. It could be ascending, descending, or completely mixed up. It only matters that all of the distinct numbers that can be written in N characters are present.
The list can be formatted in a reasonable way, using spaces, newlines, commas, or perhaps something else between the numbers, as long as things are consistent. Leading and trailing brackets (or similar) are alright but things like quotes around numbers are not. (i.e. don't visibly mix up strings and ints/floats in the output.)
For example, when N = 1, some valid outputs would be:
0 1 2 3 4 5 6 7 8 9
[1, 2, 3, 4, 5, 6, 7, 9, 0]
ans = { 5 8 9 1 3 2 0 3 4 7 6 }
But this would be invalid:
[0, 1, 2, 3, 4, "5", "6", "7", "8", "9"]
Examples
N = 1 -> 0 1 2 3 4 5 6 7 8 9

N = 2 -> -9 -8 -7 -6 -5 -4 -3 -2 -1 .1 .2 .3 .4 .5 .6 .7 .8 .9 10 11 12 ... 97 98 99

N = 3 -> -99 -98 ... -11 -10 -.9 -.8 ... -.2 -.1 .01 .02 ... .98 .99 1.1 1.2 ... 1.9 2.1 2.2 ... 2.9 3.1 ...... 9.9 100 101 ... 998 999

Lists are in ascending order, ellipsized in some places for reading convenience.
Scoring
The shortest code in bytes wins. In case of ties, the higher voted answer wins

Should -0 be valid output?

@Doorknob Also note that the negative sign (-) should not be used as a subtraction sign. It should only appear as the first character of numbers less than zero.

@Mego Yes. Is negative zero distinct from zero?

@Doorknob Is zero less than zero?

@Doorknob No. What Mego said, and also "[zero] should always be written as plain 0".

Pyth, 47 45 bytes
Thanks to FryAmTheEggman for noting that the order does not matter.
jf!sm:Td)c".- \..*\. ^-?0. [.-]0*$"d^{`c_T17Q

Try it online.
The runtime is horrible, basically O(12n), but I tested it for n = 6 on my computer (which took 2 minutes). Running n ≥ 5 will time out online.
Due to the way I generate the characters 0123456789.- the output is in a really weird order.
One could technically remove the { near the end, but it would result in a complexity of O(19n). (It would also produce lots of duplicates, but that's allowed.)
Explanation
                  _T       -10
                 c  17     -10 / 17 = -0.5882352941176471
                `          representation: "-0.5882352941176471"
               {           uniquify: "-0.582394176"
              ^       Q    input'th Cartesian power
 f                         filter on:
         c"…"d               split this string by spaces
    m:Td)                    check if the parts match the current string
  !s                         true if none of the parts matched
j                            join by newlines

The main part of the code is ".- \..*\. ^-?0. [.-]0*$", which contains the regexes any output must not match.
.-         minus must be first character
\..*\.     there may only be one decimal point
^-?0.      no extra leading zeroes
[.-]0*$    number must not end with decimal/minus and 0+ zeroes

Pyth, 57 bytes
j-f:T"^0$|^-?([1-9]\d*)?(\.\d*[1-9])?$"0{.P*Q+jkUT".-"Q\-

Try it on the online interpreter.
Way too long, and with horrific runtime (takes several seconds for N=4, running with N=5 is not recommended).
            .P           Q    all permutations of length (input) of
                 jkUT         ... the string "0123456789"
                +    ".-"     ... plus the chars "." and "-"
              *Q              ... whole thing times the input -- pyth has
                              no repeated_permutation, so this is necessary
           {                  uniquify
  f                           filter by
   :T"..."0                   does it match the really long regex?
 -                        \-  get rid of "-"
j                             join on newline

Regex explanation:
^0$|            "0", or...
^
 -?             optional negative sign
 ([1-9]\d*)?    optional part-before-decimal
 (\.\d*[1-9])?  optional part-after-decimal
$

Not a golf, but I think you can put the *Q in your permutation making thing before the + so it only affects the digits, this should improve performance quite a bit. It might even help save some bytes in the regex?

Julia, 126 117 bytes
n->filter(i->ismatch(r"^0$|^-?([1-9]\d*)?(\.\d*[1-9])?$",i)&&i!="-",∪(map(join,combinations((".-"join(0:9))^n,n))))

This is a lambda function that accepts an integer and returns an array of strings. To call it, assign it to a variable. The approach here is the same as Doorknob's Pyth answer.
Ungolfed:
function g(n::Int)
    # Get all n-character combinations of .-0123456789
    c = combinations((".-"join(0:9))^n, n)

    # Join each group of n characters into a string and take unique
    u = ∪(map(join, c))

    # Filter to only appropriately formatted strings
    filter(i -> ismatch(r"^0$|^-?([1-9]\d*)?(\.\d*[1-9])?$", i) && i != "-", u)
end

MATL, 60 bytes
45:57iZ^!"@!'^(-?(([1-9]\d*)|([1-9]\d*)?(\.\d*[1-9]))|0)$'XX

Try it online!
This uses super-brute force (via Cartesian power) followed by filtering (via a regular expression). I'll add an explanation later.
The results are displayed at the end of the program. This may take a while. If you want to see results as they are generated, add D at the end:
45:57iZ^!"@!'^(-?(([1-9]\d*)|([1-9]\d*)?(\.\d*[1-9]))|0)$'XXD

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


text:
Find the largest and the smallest number in an array
The Task
The task is very simple. Given an array containing only integers and strings, output the largest number and the smallest number.
Test Cases
Input: [1, 2, 3, 4, 5, 6, 7, 8]
Output: 1, 8

Input: [5, 4, 2, 9, 1, 10, 5]
Output: 1, 10

Input: [7, 8, 10, "Hello", 5, 5]
Output: 5, 10

Numbers in strings are not considered integers:
Input: [1, 2, 3, 4, "5"]
Output: 1, 4

If there is only one integer, it is both the largest and smallest integer:
Input: [1]
Output: 1, 1

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

Rules

You can assume that an array will always contains at least one integer.
All integers are positive (greater than 0)
The order of the output doesn't matter.
This is code-golf, so the submission with the least amount of bytes wins!
Strings can contain all printable ASCII characters (32 - 126) and are non-empty.

How are strings that contain quote marks represented in the input?

@feersum Wouldn't that depend on your language?

@feersum With escape characters probably, but if the language doesn't handle that, that's okay.

@MartinBüttner If input is taken from stdin, it should not depend on what language is used.

@feersum That's new to me. Even from STDIN [1, 2, 3] 1 2 3 and {1; 2; 3} are all valid input formats, so I don't see why it should be any different for string literals received from STDIN.

The rules of this challenge are not entirely clear to me. So strings are just ignored entirely? They're only there as padding/filler to make the challenge more difficult with respect to taking input?

@CodyGray Keep in mind this is an older challenge, and so what we currently consider to be “good” challenges may not apply. Ultimately, this is “filter out strings, then take the min and max”, but in 2016, such a challenge was considered good. Nowadays, we may not agree, but it’s problematic to apply the standards held in 2021 to challenges posted in 2016

@caird I'm not complaining about the nature of the challenge. I'm just trying to understand it. I thought perhaps that I was missing something about the rules.

Seriously, 9 6 bytes
,ì;M@m

Try It Online
How it works
,                              Read list input
 ì                             Remove everything but numbers from it
  ;                            Make a copy
   m                           Extract its min value
    @M                         Extract the other one's max value
                               Implicit output (max then min)

Ah, yes, I was looking for such a command. But the docs are not easy to search.

I agree. The docs are my next big goal.

JavaScript (ES6), 54 56
Edit 2 bytes saved thx @Neil
Note: x===+x is true if and only if x is a number
a=>[Math.max(...a=a.filter(x=>x===+x)),Math.min(...a)]

Why the outer ()s?

@Neil what outer ()? Why on earth should I have outer ()s?

This returns a function, you still need to call it. (or just remove a=>)

Yes it's an anonymous function. It's quite a common way to post an answer in JavaScript @MichaelTheriot

@MichaelTheriot By default, we allow submissions to be standalone functions rather than always requiring full programs.

Yeah, I've missed that case... :(

You can save 1 byte if will check !x[0] instead of x===+x https://tio.run/##fY7LDoIwEEX3fsXYFSRDeSvGlLUbv4CwKFgUU6kBYvh7bMEEg4mbSZp7Tu@98xfvyrZ@9k7BCyGdRl3EWLGRszQ78/5GH3VjUUo547SqZS9aa2Dpdsi83LZxJvgwEXY@lqrplBRUqqtVWZmPECCECBFCjLBD2CMkWjyC6@ow2ayEeEK1c0DQue9p74Ob1xo3v80UOQkpFZlq/hnfi0hMlinRD7lk/jojvm4igTmhORFZWs2A8Q0

Jelly, 8 bytes
|f¹Ṣ0,1ị

Try it online!
Background
In a perfect world, it would suffice to intersect the list with a flattened version of itself. Strings are simply lists of characters in Jelly, so while the original list would contain integers and strings, the flattened version would contain integers and characters, leaving only the integers in the intersection.
In the real world, both the parsers of both input and string literals yield characters instead of strings of length 1. The only way to pass a singleton string to a function would be to encode it "manually" as, e.g., [”a], which is a character wrapped in an array.
This would save a byte, for a total of 7 bytes (Try it online!).
fFṢ0,1ị

Since that's probably not acceptable, we also need a way to differentiate characters from integers.
Jelly's bitwise atoms desperately try to convert their arguments to integers. They start by vectorizing until they encounter types of depth 0 (numbers or characters), then attempt to convert them to integers. For a character that represents an integer, this will be successful. For others, a dyadic, bitwise atom will simply give up and return 0.
For example, bitwise ORing the list [1, "2", "34", "-5", "a", "bc"] with itself will yield
[1, 2, [3, 4], [0, 5], 0, [0, 0]]

By intersecting the result with the original list, we get rid of the arrays and the integers that weren't present in the original list.
How it works
|f¹Ṣ0,1ị  Main link. Input: A (list)

|         Bitwise OR the list A with itself.
 f¹       Filter the result by presence in A.
   Ṣ      Sort the resulting list of integers.
    0,1ị  Retrieve the elements at those indexes.
          Indices are 1-based and modular in Jelly, so 0 is the last (maximum),
          and 1 is the first (minimum).

Pyth, 14 11 10 bytes
hM_BS^I#1Q

Try it online. Test suite.
Explanation

Q: evaluated input
#: filter that on:

I: the value being the same after:

^…1 raising it to power 1

S: sort that
_B: create array [previous, reversed(previous)]
hM: take first item of each item of that

The hardest part is to golf the removal of strings, which currently takes 4 bytes. The current approach works due to ^<str>1 taking the first Cartesian power of the sequence (basically, the list of the string's characters), but ^<int>1 is just the identity function.

Hrm, you could also use *#_1Q to remove the strings, which would be shorter if a variable was initialized to negative one...

Python 2, 42 bytes
In Python 2, integers are always less than strings during comparisons, so a simple min(s) will find the smallest integer. When finding the maximum though, we must filter out strings first. The anonymous function accepts a sequence and returns a tuple with the minimum and maximum.
lambda s:(min(s),max(x for x in s if''>x))

Example:
[1,'77', 6, '', 4] -> (1, 6)

You need a lambda a: stuck before that.

if x>0 or if''>x save one byte.

@Doorknob, now lambda as suggested.

@grc, thanks for the tip. Saved a byte.

@Dennis, I did not know this.  I have edited the solution to make clear the comparison only works in Python 2.

Building up: lambda s:(min(s),-min(-1*_ for _ in s)) (39 bytes)

Wow. That is some very nice work with the -min() trick. It took me a few minutes to figure out how it works. You should post that answer yourself. You will certainly have a +1 from me.

Ruby, 57 36 29 bytes
Newbie here, so I don't know if there is any standard or universally accepted place/way to calculate bytes used, any help would be very appreciated!
Edited as per manatwork & Doorknob's comment!
->n{(n.map(&:to_i)&n).minmax}

Test
2.3.0 :076 > f=->n{[(n.map(&:to_i) & n).min, (n.map(&:to_i) & n).max]}
 => #<Proc:0x007ff7650ee868@(irb):76 (lambda)>
2.3.0 :077 > f[[7, 8, 10, "Hello", 5, 5]]
 => [5, 10]

36 characters: ->n{[(x=n.map(&:to_i)&n).min,x.max]}

29 bytes, using minmax: ->a{(a.map(&:to_i)&a).minmax}

Mathematica, 20 bytes
MinMax@*Select[#>0&]

Test cases
MinMax@*Select[#>0&]@{1,2,3,4,"5"}
(* {1,4} *)

Why is there the * there? It seems like you can get to 19 just by cutting it.

@ASimmons It is necessary. MinMax@Select[#>0&] is not a valid pure function.

@ASimmons @* is function composition, whereas @ is function application.

MinMax@Select[# > 0 &][{1, 2, 3, 4, "Hello", 5}] yields a correct response

@ASimmons Try assign MinMax@Select[# > 0 &] to a symbol, or just evaluate it.

@njpipeorgan I appreciate that it isn't a valid pure function, but I don't see why it needs to be one in order to be a valid solution to the challenge?

@ASimmons That one works because precendence in your case is MinMax@(Select[# > 0 &][{1, 2, 3, 4, "Hello", 5}])

@ASimmons It needs to be a valid function expression because that's our consensus. Otherwise, the submission would be classified as a "snippet" instead which is not valid by default.

@MartinBüttner I see, I'll try to conform to that.

CJam, 15 13 bytes
{_:z&$2*_,(%}

An unnamed block (function) which expects the input array on the stack and leaves the output array in its place.
Run all test cases.
Explanation
_     e# Duplicate.
:z    e# Map over list: a) take abs() of integer elements (a no-op) or b) wrap strings
      e# in an array.
&     e# Set intersection: only the integers will appear in both arrays.
$     e# Sort.
2*    e# Repeat array twice (to make the code work with single-integer input).
_,    e# Duplicate, get length N.
(%    e# Decrement, get every (N-1)th element, i.e. the first and the last.

I sugeested e) and e( to aditsu. He hasn't accepted that

@username.ak I don't think those are really useful. Adding a two-char operator that only saves a single byte over the current solution isn't something aditsu is likely to implement, and I also think there must be more useful features to use those for.

it will save 3 bytes: q~_e(ae)a+

@username.ak Well that's assuming that e( and e) would ignore strings or something, which seems inconsistent. And if it did involve comparison with strings it would probably fail the same way that $ and e> can't compare integers with strings.

jq, 21 characters
[.[]|numbers]|min,max

Sample run:
bash-4.3$ bin/jq '[.[]|numbers]|min,max' <<< '[7, 8, 10, "Hello", 5, 5]'
5
10

On-line test:

[7, 8, 10, "Hello", 5, 5]
["1", "2", "3", "4", 5]

Haskell, 41 39 bytes
f x=[minimum,maximum]<*>[[i|Left i<-x]]

In Haskell all elements of a list have to be of the same type, so I cannot mix Integer and String. However, there's the Either type for combining two types into a single one. The input list is therefore of type Either Integer String1. f filters the Integers, removes the Either wrapper, puts the list as the single element in a new list (e.g. [[1,2,3]]), so that <*> can apply the functions given in the first argument to it.
Usage example: f [Left 1, Left 3, Right "Hello", Left 2] -> [1,3].
Edit: @xnor brought <*> into play and saved 2 bytes. Thanks!

1 actually it's fully polymorphic in the second type as the String property is never used.

Nice idea with the pattern match. You can save two chars with a reversed map: f x=[minimum,maximum]<*>[[i|Left i<-x]]

@xnor: very nice. Thanks a lot!

Retina, 71
Thanks (as always) to @MartinBüttner for the golfing help.
Not competitive golf-wise, but its interesting to implement integer bubble sorting in Retina.
Assumes all strings in the input are " double-quoted and don't contain any escaped double quotes \".
A`"
¶

\d+
$&$*a $&$*a
+`\b(a+) +\1(a+)\b
$1$2 $1
 +[a ]+ +

(a)+
$#1

Input is newline-separated.
Try it online.

I think you can use <space>.*<space> in the second to last stage because of greed.

Mathematica, 14
#&@@@MinMax@#&

Example:
tests = {
   {1, 2, 3, 4, 5, 6, 7, 8},
   {5, 4, 2, 9, 1, 10, 5},
   {7, 8, 10, "Hello", 5, 5},
   {1, 2, 3, 4, "5"},
   {1},
   {"1", "2", "3", "4", 5}
 };

# & @@@ MinMax@# & /@ tests

{{1, 8}, {1, 10}, {5, 10}, {1, 4}, {1, 1}, {5, 5}}

Explanation:
When MinMax gets non-numeric input it reduces the problem as far as it can, then leaves terms wrapped in Min and Max:
MinMax @ {7, 8, 10, "Hello", 5, 5}

{Min[5, "Hello"], Max[10, "Hello"]}

Due to the automatic ordering that takes place strings follow integers.
Apply at levelspec {1}, shorthand @@@, is then used to pull the first argument of non-atomic elements.   Note that 5 is untouched here:
foo @@@ {5, Max[10, "Hello"]}

{5, foo[10, "Hello"]}

Mathematica, 28 bytes
MinMax[#/._String->Nothing]&

I still don't understand your obsession with Nothing... It doesn't mean anything special... Also, for 23 bytes: MinMax@*Select[NumberQ]

@LegionMammal978 Make use of "all integers are positive"! See my answer.

Nice solutions guys, I should have thought of doing it that way!
@LegionMammal978, Nothing does have a special meaning. Since Mathematica 10.2, it gets automatically removed from Lists.

@LegionMammal978 Nothing is a documented function in the latest versions.

PHP, 50 48 bytes
<?=min($a=array_filter($a,is_int)).', '.max($a);

Beat me by 2 minutes :).

It's generally forbidden to suppose that the input is already in a variable. By the way, you can save two bytes by removing the ' around is_int.

@Blackhole Thanks. Didn't realise. I've utilised your quote removal :)

Perl 44 39 + 3 = 41 bytes
@a=sort{$a-$b}grep!/"/,@F;$_="@a[0,-1]"

Requires -pa flags:
$ perl -pae'@a=sort{$a-$b}grep!/"/,@F;$_="@a[0,-1]"' <<< '1 2 3 5 4'
1 5
$ perl -pae'@a=sort{$a-$b}grep!/"/,@F;$_="@a[0,-1]"' <<< '1 2 3 4 "5"'
1 4

Thanks to @manatwork for shaving off a few bytes

Which Perl version? For your second example I get different result: http://pastebin.com/judJys5g

@manatwork You are correct, Figure I cannot remove sort{$a-$b}grep...

The requirement doesn't state that the output has to be formatted exactly as in the examples and in this task clearly not the formatting is the point. So many of us just used what is handier in our language of choice. In Perl I would do it like this: $_="@a[0,-1]".

One character shorter filtering: grep!/"/.

It says the array will be numbers and strings. All the examples in the question are with double-quoted strings, but I don't see anything saying they can't be single-quoted. I think !/\D/ is necessary instead of !/"/, for one more byte.

Julia, 35 bytes
x->extrema(filter(i->isa(i,Int),x))

This is a lambda function that accepts an array and returns a tuple of integers. To call it, assign it to a variable.
Julia has a built-in function extrema for getting the minimum and maximum elements of an array as a tuple. However, since the array can also have strings in it, we first have to filter those out. We can do that by testing whether each element is an integer using isa.

Japt, 23 bytes
[V=Uf_bZÃn@X-Y})g Vw g]

Test it online!
How it works
[V=Uf_  bZÃ n@  X-Y})g Vw g]
[V=UfZ{ZbZ} nXY{X-Y})g Vw g]

UfZ{ZbZ}   // Filter out the items Z in U where Z.b(Z) is falsy.
           // For numbers, this the original number, which is always non-0 (non-falsy).
           // For strings, this returns Z.indexOf(Z), which is always 0 (falsy).
nXY{X-Y}   // Sort by subtraction. Small items move to the front, large to the back.
V=         // Set variable V to the resulting array.
)g Vw g    // Take the first item in V, and the first in V.reverse().
[       ]  // Wrap them in an array so both are sent to output.

Python 3, 56 bytes
lambda x:[m(t for t in x if str(t)!=t)for m in(min,max)]

Try it online on Ideone.

MATL, 23 bytes
"@Y:tX%1)2\?x]N$htX<wX>

Try it online!
"       % implicitly input cell array. For loop that iterates on each cell
  @     %   push each cell
  Y:    %   cell's contents (either a number or a string)
  tX%   %   duplicate and push class. This will produce 'char'  or 'double'
  1)    %   get first letter: either 'c' or 'd'
  2\    %   is its ASCII code odd?
  ?     %   if so...
    x   %     delete (it's a string)
  ]     %   end if
  N$h   %   concatenate all stack into an array. This array will contain up to
        %   three numbers: minimum up to now, maximum up to now, new value (if any)
  tX<   %   duplicate. Push minimum
  wX>   %   swap. Push maximum.
        % implicitly end for
        % implicitly display stack contents

Oh, my bad :p. Nice answer though :)

@Adnan Thanks! A little too long :-)

Oracle SQL 11.2, 189 bytes
SELECT MIN(TO_NUMBER(i)),MAX(TO_NUMBER(i))FROM(SELECT REGEXP_SUBSTR(:1,'[^,]+',1,LEVEL)i FROM DUAL CONNECT BY LEVEL<REGEXP_COUNT(:1,',')+2)WHERE TRIM(TRANSLATE(i,' 0123456789',' '))IS NULL;

Un-golfed
SELECT MIN(TO_NUMBER(i)),MAX(TO_NUMBER(i))
FROM  (
        SELECT REGEXP_SUBSTR(:1,'[^,]+',1,LEVEL)i
        FROM   DUAL
        CONNECT BY LEVEL<REGEXP_COUNT(:1,',')+2
      )
WHERE TRIM(TRANSLATE(i,' 0123456789',' '))IS NULL;

The sub-query parse the array and split it to populate a view with one element per row.
Then the non numeric elements are filtered out.
I wish I could have found a way to do it with LEAST and GREATEST, but no luck with how to handle the array as a parameter.

You're leaving the [] in the array so you're not selecting the max or min if they're the first or last elements of the array. You also don't need your WHERE clause, you're already selecting aggregates so you don't need to filter. Search for numeric characters in your regexes and push the number conversion down to the sub-query (very little danger of pushed predicates) and it becomes 126 bytes: select min(i),max(i)from(select to_number(regexp_substr(&1,'\d+',1,level))i from dual connect by level<=regexp_count(&1,'\d'))

There's no need for a + in the second regex here as it doesn't matter if you generate a few extra rows (saves a byte). It's also worth noting though that if you have a string made up solely of numbers you won't ignore it here; that needs overloaded functions in the same package, so is not at all pretty.

vimscript, 25 bytes
g/"/d
sort n
t.
t.
2,$-1d

Yep, that's right, vimscript.
Expects input in the form
1
2
3
4
"5"

And outputs in the form
1
4

Explanation:
g/"/d    delete all lines that contain quotes
sort n   sort numerically
t.       duplicate the first line
t.       duplicate it again
2,$-1d   delete from line 2 to line (END-1)

The first line needs to be duplicated twice to handle the edge case of an input of a single number. This is because the last command will complain if there are only two lines when it is reached, since it ends up being 2,1d which is a backwards range.

Bash, 40 31 30 bytes
sort -n|sed /\"/d|sed '1p;$p;d'

Requires a line separated list:
$ echo $'5\n4\n2\n9\n1\n"10"\n5' | sort -n|sed /\"/d|sed '1p;$p;d'
1
9

Thanks to @manatwork to shave off a few bytes

sed '1p;$p;d' saves a byte.

PowerShell, 53 36 bytes
@($args[0]|?{$_-is[int]}|sort)[0,-1]

Saved 17 bytes thanks to @goric
OOOF ... PowerShell usually plays pretty fast and loose with casting, which is normally a good thing for golfing, but hurts it here.
Takes our input $args[0] and pipes it into a Where-Object statement (the ?) that will only select integers and passes them along the pipeline, discarding anything else. Since dynamic re-casting happens on-the-fly in the background for you (e.g., 1+"5" returning 6 is perfectly valid PowerShell), we need to use the -is operator in order to differentiate between the data types.
From there, we pipe that collection into Sort-Object, which will sort the integers from smallest to largest. The outer () is necessary so we can reference the first and last elements with [0,-1] (i.e., the smallest and the largest), but note we also need the outer @ to force casting the output of sort as an array if there's only one object (as the result of the ?, or only one object was input).

Take a look at the -is type operator here. I think you could replace .GetType().Name-eq"Int32" with -is[int] to save 17 bytes

@goric Super awesome! Thanks for the massive golf!

Pyth, 11 bytes
hJSf!>TkQeJ

Explanation:
   f    Q   - filter([V for T in >], Q)
    !>Tk    - not(T>"")
  S         - sorted(^)
hJ       eJ - print first and last element

Try it here!

Perl 6, 25 bytes
The obvious answer would be this WhateverCode lambda
*.grep(Int).minmax.bounds

If it has to be a full program
put get.words».&val.grep(Int).minmax.bounds

The input to this full program is a space separated list of values

Usage
# give it a lexical name
my &code = *.grep(Int).minmax.bounds;

say code [1, 2, 3, 4, 5, 6, 7, 8];  # (1 8)
say code [5, 4, 2, 9, 1, 10, 5];    # (1 10)
say code [7, 8, 10, "Hello", 5, 5]; # (5 10)
say code [1, 2, 3, 4, "5"];         # (1 4)
say code [1];                       # (1 1)
say code ["1", "2", "3", "4", 5];   # (5 5)

say code []; # (Inf -Inf)

, 16 chars / 20 bytes
[МƲ(ï⇔⒡≔=+$⸩,МƵï

Try it here (Firefox only).
Not bad, not bad...
Explanation
This outputs an array containing both the maximum and minimum. (ï⇔⒡≔=+$⸩, basically filters out all strings in the input, МƲ gets the maximum in the input, and МƵ gets the minimum.
Just a note: this is the first challenge where I get to use ⇔, which basically turns ï⇔ into ï=ï.

JavaScript (ES5), 105 bytes
function a(b){m=Math;b=b.filter(function(c){return c===+c});alert(m.min.apply(m,b)+','+m.max.apply(m,b))}

Usage: a([1,2,3,'4'])
Just trying :)
"Ungolfed":
function a(b){
  m=Math;
  b=b.filter(function(c){
    return c===+c
  });
  alert(m.min.apply(m,b) + ',' + m.max.apply(m,b))
}

PARI/GP, 52 bytes
This is terrible -- there has to be a better way to check if something is a number than type. polcoeff(eval(x),0) is even worse, despite (ab)using the requirement that numbers are positive. iferr(O(x);1,E,0) is clever but a byte longer: E is required for some reason, and p-adic numbers like O(3) are falsy (i.e., O(3)==0) so the ;1 is needed.
v->v=[x|x<-v,type(x)=="t_INT"];[vecmin(v),vecmax(v)]

An alternate approach is just as long:
v->[f([x|x<-v,type(x)=="t_INT"])|f<-[vecmin,vecmax]]

Java (OpenJDK 8), 124 bytes
a->{int s[]={0,0},t;for(Object i:a)try{t=(int)i;s[0]=s[0]<1|t<s[0]?t:s[0];s[1]=s[1]<t?t:s[1];}catch(Exception e){}return s;}

Try it online!
Java 8 lambda function, takes array as input and gives out array {min, max}. Non competing, because the input has to be an integer array.
Fixed and -1 byte thanks to Kevin Cruijssen

You could make this competing by taking a list of Objects and checking if an item is an integer or String.

@KevinCruijssen done, thanks

<i now gives an error without integer-cast. Also, your initial code (and this one as well) doesn't work for min, since it will always output 0 for min. Here is a possible fix. EDIT: Try-catch seems to be 1 byte shorter than the if(i instanceof Integer).

@KevinCruijssen oh didn't notice that, thanks!

114 bytes

APL (Dyalog), 13 bytes
(⌊/,⌈/)⎕AV~⍨∊

Try it online!
∊ enlist (flatten – this makes all the strings into characters in the big list)
⎕AV~⍨ remove all characters in the Atomic Vector (the character set – leaves numbers)
(…) apply the following tacit function:
 ⌊/ the minimum across
 , appended to
 ⌈/ the maximus across

Jolf, 20 bytes
I can probably golf this... I need to implement type-checking shorter solutions.
γ fxd='nF~tH0ͺZkγZKγ
 _fx                 filter the input
    d='nF~tH0        checking for number type
γ                    call that "γ"
             ͺ       pair
              ZkγZKγ  the min and max of the array

Python 3, 65 bytes
Here's the obligatory example of how Python 3 is worse (for golfing) than Python 2, because it got rid of weird behaviours, like "you can compare ints and strings, and all ints are less than all strings".
def m(a):b=sorted(n for n in a if type(n)==int);return b[0],b[-1]

C#, 71 bytes
(object[]z)=>{var a=z.OfType<int>();return new int[]{a.Max(),a.Min()};};

Simple lambda which returns the min and max as an int array.

Hoon, 90 84 bytes
|*
*
=+
(sort (skip ((list @) +<) (curr test 0)) lte)
[(snag 0 -) (snag 0 (flop -))]

This uses a couple fun features of Hoon:

I'm returning a wet gate instead of a dry one to prevent having to specify the type. This makes the caller typecheck the function instead of definition, which is perfectly fine.

The function argument for |= is an unnamed arm, which is placed in the subject at +<. Specifying a/* and using a as the input is longer than just leaving it unnamed and using +< directly

The same thing applies for =+ - it places the variable at the top of the subject at -, so I save the sorted list as an intermediate and can reference it the three times needed cheaply

The input specifies "All integers are positive (greater than 0)", which along with the fact the string will never be empty helps immensely. I can then slam the input through the type verifier gate (list @), which converts all entries in the list that aren't a number into 0 and then get rid of all zeros.

Example of use:
> %.  (limo ~[1 2 "hello" 9 17])
      |*
      *
      =+
      (sort (skip ((list @) +<) (curr test 0)) lte)
      [(snag 0 -) (snag 0 (flop -))]
[1 17]

Ruby, 27 bytes
->a{a.grep(Integer).minmax}

Try it online!
Slightly different from the previous Ruby answer! The user seems to be inactive for a while, so I thought of posting it.

C++20 (gcc) std::variant array, 139 129 127 126 125 124 bytes
#import<variant>
int f(auto a,int n,int&m,int&M){for(m=~0u/2,M=0;n--;)if(int*p=std::get_if<int>(a++))*p>m?:m=*p,*p<M?:M=*p;}

Try it online!
Explanation
This uses C++20's abbreviated function templates (cppref) which allow me to just put auto as a parameter instead of using the full name or a template<class T> declaration. It is wonderful.
The effective ungolfed signature is this if it wasn't a template:
void f(std::variant<int, char *> *array, int n_elements, int &min, int &max);

Note that the second type can be literally anything. In the test, I did const char * because C++ string literals are const char *.
The input is an array of std::variant<int, char *> (cppref) of n_elements elements, and the output is stored into min and max which are int references.
It then uses std::get_if<int> (cppref) to select only the ints in the array, and calculates the min and max as normal.
It also uses the x?:y extension from GCC which allows me to omit the middle of the ternary to calculate the min/max, as well as cheating a byte because GCC reluctantly allows #import in C++ as a deprecated extension from Objective-C, and trading a warning for a byte by using int as the return type without returning int
An equivalent C++17-compatible version would be this at 158 153 143 141 140 139 138
bytes:
#import<variant>
template<class T>int f(T a,int n,int&m,int&M){for(m=~0u/2,M=0;n--;)if(int*p=std::get_if<int>(a++))*p>m?:m=*p,*p<M?:M=*p;}

Ungolfed version:
#include <variant>

void f(std::variant<int, const char *> *array, int n_elements, int &min, int &max)
{
    // Set min to INT_MAX and max to 0
    // C++20 guarantees 2's complement, so this is guaranteed to work
    min = ~0u/2;
    max = 0;
    // Loop through each element
    while (n_elements--) {
        // std::get_if returns a pointer to the element if it is an int, or nullptr.
        if (int *p = std::get_if<int>(array++)) {
             // if (*p > min) {} else { min = *p; }
             *p > min ?: min = *p;
             // if (*p < max) {} else { max = *p; }
             *p < max ?: max = *p;
        }
    }
}

K (ngn/k), 19 bytes
(&/;|/)@\:(`i=@:')#

Try it online!

(`i=@:')# filter input to only integers
(&/;|/)@\: apply min (&/) and max (|/), returning a list

Vyxal, 6 bytes
0+∩₍gG  # main program

0+      # add 0 to each element of input if number, else append 0
  ∩     # take the set intersection
   ₍    # apply the following two operations on top of stack and wrap
    gG  # min and max
        # implicit output

It may be possible to take this down a byte if there is a command that only affects strings but not numbers. I couldn't find one after some basic searching, but its possible a single command exists that does that.
Try it Online!

Factor, 27 bytes
[ [ real? ] filter minmax ]

Try it online!
Integers are objects, reals, and integers in Factor, so we can save a few bytes by using the shortest class predicate word to filter out the strings.

Zsh (builtins only), 35 bytes
A=(${(n)@//[A-z]});<<<$A[1]\ $A[-1]

Try it online!

NB, Zsh takes all inputs as strings and can't distinguish between "1" and 1

Japt, 11 bytes
'm¬iÔm!rUfâ

Try it

Thunno D E, \$3 \log_{256}(96) \approx\$ 2.47 bytes
zni

Attempt This Online! Output as [max, min]
Verify some more test cases: 1 2 3 4 5
Explanation:
     # Example input: 1, 2, 3, 4, "5"
     # The E flag tells the interpreter not to evaluate the input strings,
     # so they end up as "1", "2", "3", "4", '"5"'
     # The D flag duplicates the input. The zn command will automatically pop the top item.
     # We want to keep all the items on the stack, so we need the D flag
zn   # Push [max, min]. As the top item is not a list, it applies it to the stack,
     # converting each to a float. It can't convert '"5"', so it just ignores it.
  i  # Convert each to an integer (as the zn command converted to float)

Jelly, 6 bytes
OƑƇṢ.ị

Try it online!
Yields [max, min]
How it works
OƑƇṢ.ị - Main link. Takes  a list L on the left
  Ƈ    - Filter keep:
 Ƒ     -   Invariant under:
O      -     Converting to ordinals
         This filters non-integers from the list, as O has no effect on integers
   Ṣ   - Sort
    .ị - First and last elements

Python 3, 54 bytes
Another Python solution: the mandatory solution using lambda was missing :)
lambda y:[f(e for e in y if e*0==0)for f in (min,max)]

Try it online!
-10 bytes thanks to aeh5040

replace isinstance(e,int) with e*0==0 to save 11

R, 45 bytes
function(l)range(unlist(Filter(is.double,l)))

Try it online!
Takes input as a list, as R vectors (c()) will coerce everything to the same type, in this case, character if they are there.
Filters out non-numeric values, then uses range to find the max and min values.

Brachylog, 7 bytes
ℕˢ⟨⌋≡⌉⟩

Try it online!
Explanation
 ˢ      Select the elements of the input list which...
ℕ       ...are integers >= 0
  ⟨   ⟩  Make a list containing...
   ⌋     ...the minimum element...
     ⌉   ...and the maximum element...
    ≡   ...and return it unchanged

Japt, 11 bytes
kÈ¶sÃÍg[TJ]

Try it
kÈ¶sÃÍg[TJ]     :Implicit input of array
k               :Remove elements that return true
 È              :When passed through the following function as X
  ¶             :  Is strictly equal to
   s            :  X converted to a string
    Ã           :End remove
     Í          :Sort
      g         :Get elements at 0-based indices
       [TJ]     :  0 and -1 (last)

Arturo, 38 37 bytes
$[a][filter'a=>string?@[min a max a]]

Try it

JavaScript, 53 bytes
Based on edc65's this answer. We can save 1 byte if check !x[0] instead of x===+x
a=>[Math.max(...a=a.filter(x=>!x[0])),Math.min(...a)]

f=a=>[Math.max(...a=a.filter(x=>!x[0])),Math.min(...a)]

;[
    [1, 2, 3, 4, 5, 6, 7, 8],    // [8, 1]
    [5, 4, 2, 9, 1, 10, 5],      // [10, 1]
    [7, 8, 10, "Hello", 5, 5],   // [10, 5]
    [1, 2, 3, 4, "5"],           // [4, 1]
    [1],                         // [1, 1]
    ["1", "2", "3", "4", 5],     // [5, 5]
].map(a => console.log(JSON.stringify(f(a))))

Uiua, 17 bytes
∩⊔⊃/↥/↧▽¬∵'type⊔.

Try it!
∩⊔⊃/↥/↧▽¬∵'type⊔.
                .  # duplicate
         ∵'type⊔   # mask of types (0 for int, 1 for string)
        ¬          # not
       ▽           # keep
  ⊃/↥/↧            # min and max
∩⊔                 # unbox both (need this for one-int arrays)


text:
Convert the Time to a String
Problem
One day, you boss walks up to you and tells you he needs to know the time. He still insists after you pointing at the clock directly above your head, and confesses he has a severe case of dyscalculia, which causes him to not even be able to see numbers on a clock. While you're still left wondering how someone unable to see numbers can run a company, he tells you to "do something about it", whatever that is.
Your task is now to create a program or function that, given an input time with hours and minutes (seconds are optional)(hours are 24-based), outputs a readable english sentence, that doesn't contain numbers.
It is not necessary to ouput the seconds.
For example, 08:45:15 should output quarter to nine o'clock AM
Test cases
00:00:00 > twelve night
12:00:00 > twelve noon
06:00:00 > six o'clock AM
18:00:00 > six o'clock PM
06:15:00 > quarter past six o'clock AM
18:45:00 > quarter to seven o'clock PM
11:30:00 > half past eleven o'clock AM
13:22:00 > twentytwo minutes past one o'clock PM
17:43:00 > seventeen minutes to six o'clock PM
00:09:00 > nine minutes past twelve o'clock AM

Rules
Outputting numbers can be both in the form of fortytwo or forty-two, whichever you like best. Standard loopholes are not allowed. Trailing newlines are allowed, but the sentence should be on 1 line.
Input can be in any format you want, for example HH:MM:SS, HH,MM,SS, HHMMSS, HH/MM/SS, or any variant without seconds, but you should make the input format clear in your answer. It's not needed to output one minute instead of one minutes
for minutes ranging from 0 trough 30 (0 and 30 included) you should use past, and for the others you should use to
Because time is relative, shortest code in bytes wins.

This looks like a nice challenge, bit I strongly suggest removing the bonuses. Unless you know exactly what you are doing, those are one thing to avoid when writing challenges.

Two more (minor) points: why does it matter how you write forty-five when the test cases clearly state quarter to as the appropriate input format? (just change it to forty-two ;) ) Also, [tag:kolmogorov-complexity] is not an appropriate tag.

@sanchises edited. I misunderstood the kolmogorov tag, and thought it had to do with problems in outputting any string, instead of a given string only.

@TimmyD The -70% one was a joke, I didn't imagine anyone would try to translate french in code-golf. However, I feel that having negative size is a decent reward for a perfect french-english translator

That looks much better, but a few more formatting clarifications are needed. Specifically regarding choosing between "past" and "to" -- from the examples, it sounds like you're wanting to only utilize the numbers one to twenty-nine, with quarter replacing fifteen and half representing thirty, but that's not clear. Also, for future questions, I heartily recommend the Sandbox to work out the kinks before posting.

@TimmyD edited again. I'd also like to apologize, I didn't know about the sandbox.

No worries! Again, welcome to PPCG! :)

All of the inputs lie exactly on 5 minute boundaries.  Does this imply all inputs will be like this, or that inputs should all be rounded to the nearest 5 minutes, or should single minutes be handled?

@DigitalTrauma updated the question, single minutes should be handled, and twelve midnight is indeed more consistent, considering that 1 o'clock AM also has no at

twelve midnight or twelve night?

Just to be sure: twentytwo and not twenty-two or twenty two?

@DigitalTrauma I specified both twentytwo and twenty-two are permitted

Javascript, 384 381 bytes
(h,m)=>(o='one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,,fif,,,eigh,'.split`,`,o=o.map((x,i)=>i>11?(x||o[i-10])+'teen':x),(a=m>30,t=12,m?(m-30?m%15?((m=a?59-m:m)>=(b=a?19:20)?'twenty'+((m%=b)?o[a?m:m-1]:''):o[a?m:m-1])+' minutes':'quarter':'half')+(a?' to ':' past '):'')+(h%t|m?o[(a?h:(h?h-1:11))%t]+` o'clock ${h>t?'P':'A'}M`:o[11]+(h-t?' night':' noon')))

f=
(h,m)=>(
    o='one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thir,,fif,,,eigh,'.split`,`,
    o=o.map((x,i)=>i>11?(x||o[i-10])+'teen':x),
    (a=m>30,t=12,
    m?
        (m-30?
            m%15?
                ((m=a?59-m:m)>=(b=a?19:20)?
                    'twenty'+((m%=b)?o[a?m:m-1]:'')
                :o[a?m:m-1])+' minutes'
            :'quarter'
        :'half')+(a?' to ':' past ')
    :'')
    +(h%t|m?
        o[(a?h:(h?h-1:11))%t]+` o'clock ${h>t?'P':'A'}M`
    :o[11]+(h-t?' night':' noon'))
)

document.body.innerHTML = '<pre>' +
'f(00,00) = ' + f(00,00) + '\n' +
'f(12,00) = ' + f(12,00) + '\n' +
'f(06,00) = ' + f(06,00) + '\n' +
'f(18,00) = ' + f(18,00) + '\n' +
'f(06,15) = ' + f(06,15) + '\n' +
'f(18,45) = ' + f(18,45) + '\n' +
'f(11,30) = ' + f(11,30) + '\n' +
'f(13,22) = ' + f(13,22) + '\n' +
'f(17,43) = ' + f(17,43) + '\n' +
'f(00,09) = ' + f(00,09) + '\n' +
'f(23,59) = ' + f(23,59) + '\n' +
'</pre>'

Works fine, and even has the Perl one beat by 4 bytes! Nice trick with fif, eigh etc btw.

You have wrong output for the last one. Should be one minutes to twelve o'clock AM (not PM)

LaTeX, 466 bytes
\usepackage{fmtcount,etoolbox}\def\x{\the\numexpr}\def\n[#1]{\numberstringnum{#1}}\def\h[#1]{\ifnumequal{#1}{0}{twelve night}{\ifnumequal{#1}{12}{twelve noon}{\ifnumless{#1}{13}{\n[#1] o'clock AM}{\n[\x#1-12\relax] o'clock PM}}}}\def\m[#1]{\ifnumequal{#1}{15}{quarter}{\ifnumequal{#1}{30}{half}{\n[#1] minutes}}}\newcounter{c}\def\f[#1]#2{\ifnumequal{#2}{0}{\h[#1]}{\ifnumless{#2}{31}{\m[#2] past \h[#1]}{\setcounter{c}{\x60-#2\relax}\m[\thec] to \h[\x#1+1\relax]}}}

Just call the macro \f as \f[hour]{minutes}, here some tests:
\begin{document}

\noindent
\textbf{Test cases:} \\ \\
00:00 = \f[00]{00} \\
12:00 = \f[12]{00} \\
06:00 = \f[6]{00} \\
18:00 = \f[18]{00} \\
06:15 = \f[6]{15} \\
18:45 = \f[18]{45} \\
11:30 = \f[11]{30} \\
13:22 = \f[13]{22} \\
17:43 = \f[17]{43} \\

\noindent
\textbf{More test cases:} \\ \\
00:13 = \f[00]{13} \\
12:12 = \f[12]{12} \\
12:15 = \f[12]{15} \\
11:45 = \f[11]{45} \\
11:41 = \f[11]{41} \\

\end{document}

Do you know how and where I can try this? I tried arachnoid and papeeria but they didn't work.

@DennisvanGils I tried this http://pastebin.com/kdpSQHSb in papeeria and it worked.

Tried it with the pastebin code and that worked, guessing it didn't work because I didn't have \documentclass[a4paper,12pt]{article}

Python 2, 498 bytes
Input comes as function argument. First hour and then minute, both as integer. Result gets printed to the screen.
def g(h,m):
 a=lambda x:"twelve one two three four five six seven eigth nine ten eleven".split()[x%12];b=lambda x:a(x)+" o'clock "+["AM","PM"][x>=12]
 if m:
    z=m if m<30else 60-m;print(a(z)if z<13else("twenty"+(a(z-20)if z-20else"")if z>19else"thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split()[z-13])if m%15else"quarter"if m-30else"half")+(" minutes"if m-30and m%15else"")+[" past "+b(h)," to "+b(h+1)][m>30]
 else:print"twelve "+("noon"if h else "night")if h in[0,12]else b(h)

Try it online! (with slightly extended testcases)
That was a pretty fun golf. Although all those nested ternaries drove me a little bit crazy ^^
I was planning on doing this in Pyth after this, but I don't think that I am mentally able to do this at the moment (or ever).
Ungolfed:
def ungolfed(h,m):
    toStr=lambda x:"twelve one two three four five six seven eigth nine ten eleven".split()[x%12]
    hour=lambda x:toStr(x)+" o'clock "+["AM","PM"][x>=12]
    minute=lambda x:"twenty"+(toStr(x-20)if x-20else"")if x>19else"thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split()[x-13]

    if m:
        s=""
        if m==30:
            s+="half"
        else:
            if m%15==0:
                s+="quarter"
            else:
                z=m if m<30 else 60-m
                if z<13:
                    s+=toStr(z)
                else:
                    s+=minute(z)
        print s+(" minutes"if m-30and m%15else "")+[" past "+hour(h)," to "+hour(h+1)][m>30]
    else:
        if h in[0,12]:
            print"twelve "+("noon"if h else "night")
        else:
            print hour(h)

Your [x>12] should be [x>=12], 12:01 is PM, not AM

@DennisvanGils Good catch, thank you! Fixed it. :) We Germans aren't that comfortable with this whole AM/PM-thing I guess :P

I'm dutch, so I had to look it up myself to be sure too.

Python 3.8 (pre-release), 376 bytes
lambda h,m,N='one two three four five six seven eight nine ten eleven twelve thir four _ six seven eigh nine'.split()+['']:m+h%12and((m%15<1and['half','quarter'][m%2]or(lambda T:T<20and N[T-1]+T//13*'teen'or'twenty'+N[T%10-1])([m,60-m][m//31])+' minutes')+[' past ',' to '][m//31])*(m>0)+N[(h-1+m//31)%12]+" o'clock "+'APA'[(h+m//31)//12]+'M'or'twelve n'+['ight','oon'][h//12]

Try it online!
Stumbled on this challenge by accident and decided to give it a go.
Explanation
Handles the edge cases of midnight and noon by using a standard ... and ... or ... that has become ubiquitous for any Python code-golfer. For these edge cases return twelve , followed by night or noon depending on the hour.
In the general case, we build a string representing the minutes. If the minutes is 15 or 45, we start with quarter; if it is 30, we start with half; otherwise, we determine whether to use itself or 60 minus itself (think of it this way: 5:21 is 21 past 5, but 6:37 is 23 to 7, not 37 to 7). Let M denote this number. We build the appropriate number:

if M is less than 20, start with the conversion of itself to letters, minus teen.
if M is 20 or more, start with twenty.

Then:

if M is less than 20 but more than 12, add teen.
if M is 20 or more, add the conversion to letters of its units digit, with nothing being added if its units digit is zero.

If the minutes count was not divisible by 15, we also have to add  minutes.
Next, we have to deal with past and to. This is determined by indexing a list.
If the minutes count is zero, the above string goes to waste. Because zero or something similar does not appear in N, one might assume that building the string for zero would cause the program to error with an IndexError. But because Python allows negative indices, it doesn't error. When the minutes count is zero, we just don't use the above string.
Next we have to deal with o' clock, which is simply done using % and our list of text numbers again.
Finally we append AM or PM depending on the hour.

Vyxal, 155 bytes
1→m?\:/⌊:£t¬[¥h12ḋ:→d÷¬[0→m12←d h¬[‛⟇Ẏ|‛₄⟨]|¥h12%]|¥t15ḋ:→d÷¬[←d h∷[‛ɽ¢|‛»⌈]|¥t:30>[60ε]‛«¦]¥t30≤[‛×Ṡ¥h12Ḋ[12|¥h12%]|‛to¥h12%›]]←m[`o'∵₅`¥h12<‛PAi\M+]WḢ∆ċṄ

Takes input as HH:MM.
Try it Online!

Batch, 779 774 752 749 bytes
@echo off
set t=%1
set/ah=%t:~0,2%,m=%t:~3,2%
set p=past
if %m% gtr 30 set p=to&set/am=60-m,h+=1
for %%a in ("one minute.1" quarter.15 half.30)do if %%~xa==.%m% set o=%%~na&goto g
set o=
if %m% gtr 20 set o=twenty-&set/am-=20
for %%a in (one.1 two.2 three.3 four.4 five.5 six.6 seven.7 eight.8 nine.9 ten.10 eleven.11 twelve.12 thirten.13 fourteen.14 sixteen.16 seventeen.17 eighteen.18 nineteen.19 twenty.20)do if %%~xa==.%m% set o=%o%%%~na minutes
:g
if not %m%==0 set o=%o% %p%
set a= AM
if %h% gtr 12 set a= PM&set/ah%%=12
if %h%==0 (echo %o%twelve night)else if %h%==12 (echo %o%twelve noon)else for %%a in (one.1 two.2 three.3 four.4 five.5 six.6 seven.7 eight.8 nine.9 ten.10 eleven.11)do if %%~xa==.%h% echo %o%%%~na o'clock%a%

Change the second line to set t=%1%time% to default to saying the current time if no time is provided.
Edit: Saved 22 bytes by optimising my set/a statements. Saved 3 bytes thanks to @EʀɪᴋᴛʜᴇGᴏʟғᴇʀ.
When I wrote my original version I made the mistake of saying the time as I would actually say it, i.e. o'clock only on exact hours, and midnight and midday instead of twelve night and twelve noon:
@echo off
set t=%1
set/a h=%t:~0,2%
set/a m=%t:~3,2%
set p=past
if %m% gtr 30 set p=to&set/a m=60-m&set/a h=h+1
for %%a in ("one minute.1" quarter.15 half.30) do if %%~xa==.%m% set o=%%~na&goto g
set o=
if %m% gtr 20 set o=twenty-&set/a m=%m%-20
for %%a in (one.1 two.2 three.3 four.4 five.5 six.6 seven.7 eight.8 nine.9 ten.10 eleven.11 twelve.12 thirten.13 fourteen.14 sixteen.16 seventeen.17 eighteen.18 nineteen.19 twenty.20) do if %%~xa==.%m% set o=%o%%%~na minutes
:g
set o=%o% %p%
set a= AM
if %h% gtr 12 set a= PM&set/a h=h%%12
if %m%==0 set a= o'clock%a%&set o=
if %h%==0 (echo %o%midnight)else if %h%==12 (echo %o%midday)else for %%a in (one.1 two.2 three.3 four.4 five.5 six.6 seven.7 eight.8 nine.9 ten.10 eleven.11) do if %%~xa==.%h% echo %o%%%~na%a%

Your 12:00 and 00:00 tests don't work, they only echo midnight and midday instead of twelve night and twelve noon. I really like how you use fake extensions and names in your for loop btw.

@DennisvanGils There are probably other tests it fails; I'll fix it up later.

@DennisvanGils I think it's working now, and conveniently it's also shorter!

Perl 5, 367 361 385 Bytes
Garbled

use integer;$_=<>;~/(\d+):(\d+)/;@b=(one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve); @x=(@b,thirteen,(map{/fi/?quarter:$_.teen}@b[3..8]),(map{twenty.$_}'',@b[0..8]),half);@y=map{/^q|h/?$_:$_.' minutes'}@x;$s=1-$2/31;$y=abs((-29,0)[$s]+$2%31)-1;$h=$1-$s;print((+-$2?@y[$y].' '.(to,past)[$s].' ':'').@b[$h++%12]." o' clock ".($h%12?(AM,PM)[$h/12]:(night,noon)[$h/12%2]))

Formatted and test cases:
use integer;
map{
    # capture (implicit $_)
    ~/(\d+):(\d+)/;
    # bare words
    @b=(one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve);
    # construct up to 30
    @x=(@b,thirteen,
       (map{/fi/?quarter:$_.teen}@b[3..8]),
       (map{twenty.$_}'',@b[0..8]),half);
    # quarter/half business
    @y=map{/^q|h/?$_:$_.' minutes'}@x;
    # whether we are to/past
    $s=1-$2/31;
    # num minutes wrapped around
    $y=abs((-29,0)[$s]+$2%31)-1;
    # num hours
    $h=$1-$s;
    #print('$s='.$s."\th=".$h."\th%12=".($h%12)."\n");
    print($_.' > ');
    #minute component
    print((+-$2
          ?@y[$y].' '.(to,past)[$s].' '
          :'')
        # hours
        .@b[$h++%12]
        ." o' clock "
        # Night/Noon
        .($h%12
          ?(AM,PM)[$h/12]
          :(night,noon)[$h/12%2]));
    print "\n"
}
('00:00:00',
 '00:01:00',
 '11:59:00',
 '12:00:00',
 '12:01:00',
 '06:00:00',
 '18:00:00',
 '06:15:00',
 '18:45:00',
 '11:30:00',
 '13:22:00',
 '17:43:00',
 '23:59:59')

This seems to give one minutes to one o' clock night as output for 00:01, instead of one minutes past twelve o'clock AM or one minutes past twelve night

You're right. I've added test cases around the 12 times.

C, 478 bytes
*w(i){char*p,*n[]={"","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"};return i>19?asprintf(&p,"twenty%s",n[i%20]),p:n[i];}main(m,h){scanf("%d%d",&h,&m);m>30?h++:0;printf("%s%s%s%s%s %s\n",m%15?m>30?w(60-m):w(m):m^30?m?"quarter":"":"half",m%15?" minutes":"",m?m>30?" to ":" past ":"",w((h+11)%12+1),h%12||m?" o'clock":"",h%12||m?h>11?"PM":"AM":h?"noon":"night");}

Test Cases
$ echo "0 0" | ./a.out
twelve night
$ echo "12 0" | ./a.out
twelve noon
$ echo "6 0" | ./a.out
six o'clock AM
$ echo "18 0" | ./a.out
six o'clock PM
$ echo "6 15" | ./a.out
quarter past six o'clock AM
$ echo "18 45" | ./a.out
quarter to seven o'clock PM
$ echo "11 30" | ./a.out
half past eleven o'clock AM
$ echo "13 22" | ./a.out
twentytwo minutes past one o'clock PM
$ echo "17 43" | ./a.out
seventeen minutes to six o'clock PM
$ echo "0 9" | ./a.out
nine minutes past twelve o'clock AM

Try it here.

Looks fine. Also interesting how 00 00 gives the correct output, while 00:00 gives one minutes past twelve o'clock AM, although I'm sure that has something to do with how you parse input.

Yes, it expects two integers (hours and minutes). scanf probably doesn't parse '00:00' as one might hope :)

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


text:
Fibonacci’s sexagesimals
Leonardo da Pisano a.k.a Fibonacci was instrumental in bringing the Hindu-Arabic numeral system into Europe. Before that, mathematicians there worked in base sixty with Roman numerals.
For example, the square root of two might be approximated as: one and twenty-four parts of sixty and fifty-one parts of three-thousand-six-hundred, and written as: i xxiv li, with the scaling determined by context. At the time, “nothingness” was known (i.e. zero), but had no standard representation in this number system.
Had Fibonacci ignored these new-fangled decimal digits he encountered during his travels, he surely would have addressed the deficiencies in the current system. This improved system we'll call Fibonacci’s sexagesimals.
Your task is to write a program, function or code snippet which takes a floating point number in ASCII or binary format and outputs in base sixty Roman numerals. The input can be file, console, command line or function argument and output can be file or console, whichever is easiest.
The output can be upper or lower case, and must include these improvements:

use n or N to indicate null meaning a place has no value, i.e. “zero” (a problem with the system)
use e or E to indicate et corresponding to the sexagesimal point (another problem with the system)
use a middle dot · or an asterisk * to separate groups of Roman numerals (yet another problem with the system)

Assume the input will be floating point with mantissa not greater than lix·lix·lix·lix·lix. Fractions less than n·e·n·n·n·n·i can be ignored. So, provided the input has these restrictions, at most ten groups of Roman numerals with one e can be outputted.
Numbers less than i must have a leading n·e to ensure the context is clear.
Some examples: input → output

0 → n
1 → i
60 → i·n
0.1 → n·e·vi
3600 → i·n·n
10.5 → x·e·xxx
16777215 → i·xvii·xl·xx·xv
3.1415926536 → iii·e·viii·xxix·xliv·n·xlvii

The output must avoid unnecessary leading n· in the mantissa part, isolated e, or trailing ·n in the fractional part of the output. So for example, n·n·n·n·i, i·e, and i·e·n·n·n·n·n are incorrect outputs for an input of 1.
Differences of plus or minus n·e·n·n·n·n·i in the output are within tolerances and acceptable.
The input is any legal floating point in the language of your choice, so can include positive or negative exponents as long as the input doesn't fall outside the range specified above.
And finally, Roman numeral built-ins are allowed!

As much as I love the history, [tag:fibonacci] is reserved specifically for the fibonacci sequence, unless you'd like to change the tag wiki...

Tag is for "Leonardo Fibonacci is mostly known for the fibonacci sequence (0, 1, 1, 2, 3, 5, 8, 13, ...).", so would say it's meant for the person.

I think this challenge should have a bit of info on how roman numerals work and the process involved, just to be self-contained.

That's not the intended use. I have edited the tag wiki excerpt to reflect this.

Python 3, 323 319 320 bytes
This answer implements Fibonacci's sexagesimals with the delimiter * and without regard for Kolmogorov complexity in the lists of Roman numerals (for now, at least). Attempts were made to join the while and for loop under which the Roman numerals are generated under one loop, but those attempts have not yet met with success. Any golfing tips and suggestions are welcome and appreciated.
Edit: Bug fixing and golfing.
Edit: More bug fixing.
def f(x):
 v=divmod;f=x%1;n=int(x);d=",I,II,III,IV,V,VI,VII,VIII,IX".split(",");t=",X,XX,XXX,XL,L".split(",");z=["N"];a=f>0;s=z*0**n+["E"]*a
 while n:n,m=v(n,60);j,k=v(m,10);s=[z,[t[j]+d[k]]][m>0]+s
 for i in range(5*a):m,f=v(f*60,1);j,k=v(int(m),10);s+=[z,[t[j]+d[k]]][m>0]
 while s[-1:]==z*a:s.pop()
 return"*".join(s)

Ungolfed:
def f(x):
    integ = int(x)
    frac = x % 1
    units=",I,II,III,IV,V,VI,VII,VIII,IX".split(",")
    tens=",X,XX,XXX,XL,L".split(",")
    zero = ["N"]
    output = []
    a = frac != 0
    if integ == 0:
        output += z
    if a:
        output += ["E"]
    while integ > 0:
        integ, digit = divmod(integ, 60)
        j, k = divmod(int(digit), 10)
        if digit:
            output += [tens[j], units[k]]
        else:
            output += zero
    for i in range(5*a):
        digit, frac = divmod(frac*60, 1)
        j, k = divmod(int(digit), 10)
        if digit:
            output += [tens[j], units[k]]
        else:
            output += zero
    while output[-1:] == zero * a:
        output.pop()
    return "*".join(output)

C – 584 bytes
Non-competing (obviously), but to serve as inspiration:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
char*f(int z){static char r[8];char*l[]={"","I","II","III","IV","V","VI","VII","VIII","IX"},*h[]={"","X","XX","XXX","XL","L"};if(!z)return"N";sprintf(r,"%s%s",h[z/10],l[z%10]);return r;}int main(int c,char**v){char*s="";int i,j,z[10],k=60;long x;double d,y;y=modf(atof(v[1]),&d);x=d;for(i=4;i>=0;i--){z[i]=x%k;x/=k;}for(i=5;i<=9;i++){z[i]=(y*=k);y-=z[i];}for(i=0;!z[i]&&i<4;i++);for(;i<5;i++){printf("%s%s",s,f(z[i]));s="*";}for(j=9;!z[j]&&j>=i;j--);if(i<=j)printf("*E");for(;i<=j;i++)printf("*%s",f(z[i]));printf("\n");return 0;}

Save as fs.c, build with gcc -o fs fs.c -lm, and run as ./fs <arg>.
Test cases:
$ ./fs 0
N
$ ./fs 1
I
$ ./fs 60
I*N
$ ./fs 0.1
N*E*VI
$ ./fs 3600
I*N*N
$ ./fs 10.5
X*E*XXX
$ ./fs 16777215
I*XVII*XL*XX*XV
$ ./fs 3.1415926536
III*E*VIII*XXIX*XLIV*N*XLVII

Largest mantissa and fraction:
$ ./fs 777599999
LIX*LIX*LIX*LIX*LIX
$ ./fs 0.999999998713992
N*E*LIX*LIX*LIX*LIX*LIX

I'm using double as the working type, so the largest mantissa and fraction combined exceeds the native accuracy of that type. If I used long double instead it could handle it.

int main doesn't have to return 0.

APL (Dyalog Unicode), 90 bytes (using classic ⎕AV)
⎕CY'dfns'
'(·E)?(·N)*·$'⎕R''∊'·',⍨¨¯5(↓,'E',↑)'N'@(0=≢¨)⊢roman'I'⍴⍨¨d↑⍨-6⌈≢d←60⊥⍣¯1⌊⎕×60*5

Try it online!
A full program that takes a number (actually any expression that evaluates to a single number is fine) from stdin and prints the result to stdout. Uses uppercase letters and middle dot as digit separator. The middle dot allows to shorten the regex at the end (since it doesn't need to be escaped, unlike *), and the middle dot is in the classic character set.
How it works
⎕CY'dfns'  ⍝ Load the dfns library to access `roman`

⌊⎕×60*5  ⍝ Multiply input by 60^5 and floor (to do things over integers)
60⊥⍣¯1   ⍝ Convert to base 60 using as many base-60 digits as needed
d←       ⍝ Assign to d
d↑⍨-6⌈≢  ⍝ Pad with zeros to get 6 digits if there were fewer
'I'⍴⍨¨   ⍝ Convert each number to that many copies of 'I'
⊢roman   ⍝ Normalize the Roman numeral

'N'@(0=≢¨)   ⍝ Insert 'N' at zero digits (normalized result is empty)
¯5(↓,'E',↑)  ⍝ Insert 'E' at 5 places from the end
∊'·',⍨¨      ⍝ Append a center dot to each numeral and flatten

'(·E)?(·N)*·$'⎕R''  ⍝ Regex replace to remove trailing E/Ns

I'm curious why this syserrors in Classic.

@Adám syserror is raised at enableSALT. Works fine without that line, except that the middle dot is mangled.

JavaScript (Node.js), 537 531 430 bytes
-101 bytes (big) thanks to Bubbler!
Usage of some math (logarythms in this case, to calculate starting value for the "for" loop) and a code converting decimal numbers to roman numerals from here (w3resource). Actually, the task took me more time than I expected it to take and gave a lot of additional intuition while working with numeral systems other than the decimal one. Great one :)
Function itself is an anonymous one declared with arrow function declaration.
n=>{if(n==0||n==1)return"NI"[n];k="",j=-`${n-(n|0)}.`.split`.`[1].length||0;j<-5?j=-5:"";with(Math){l=m=ceil(log(n)/log(60))}for(;l>j;l--){x=n%60**l/60**(l-1)|0;x==0&&l==m?(k+="I*"):"";l==0&&j<0?(k+="E*"):"";d=`${+x}`.split``,o=" X XX XXX XL L LX LXX LXXX XC  I II III IV V VI VII VIII IX".split` `,h="",i=2;while(i--)h=(o[+d.pop()+(i*10)]||"")+h;k+=x==0?"N*":`${Array(+d.join("")+1).join("M")+h}*`;}return k.substr(0,k.length-1)}

Try it online!

You can use header and footer like this to make the byte count clear. Also some quick tips: if(n==0){return"N"}else if(n==1){return"I"} -> if(n==0||n==1)return"NI"[n], split(".") -> split\.`, ((n%(60l))/60(l-1))|0->n%60l/60(l-1)|0`.

o=["","a","b","..."] -> o=" a b ...".split\ ``. Also you can remove any Roman numeral fragments that are higher than 60.

Haskell (333 322 315 bytes)
I'm not clear whether the last sexagesimal digit is supposed to be rounded when I do or whether truncation is allowed; this truncates, I think the Python3 one might too?
d n f 0=n;d n f x=f x
x!n=60*(x-fromInteger n)
f 0=[];f x=(\n->n:f(x!n))$floor x
l 0=[];l x=(\(d,m)->l d++[m])$divMod x 60
v=[50,40,10,9,5,4,1]
n&i|n==0=""|n>=v!!i=words"l xl x ix v iv i"!!i++(n-v!!i)&i|True=n&(i+1)
q=foldl1(\a x->a++'.':x).map(d"n"(&0))
p x=(\n->d"n"(q.l)n++d""((".e."++).q.take 5.f)(x!n))$floor x

(-9 bytes, thanks H.PWiz! -2 bytes by eliminating where for (\->)$, -5 more by inventing this d function and golfing a++"."++x to a++'.':x.)
Ungolfed:

-- this function gets called `d` for default
onZero :: (Eq n, Num n) => z -> (n -> z) -> n -> z
onZero def f x
 | x == 0    = def
 | otherwise = f x

-- this function gets called `f`
fracPart :: RealFrac a => a -> [Integer]
fracPart x
  | x == 0    = []
  | otherwise = n : fracPart (60 * (x - fromInteger n))
    where n = floor x

-- this function gets called `l`
leadPart :: Integral n => n -> [Integer]
leadPart x
  | x == 0    = []
  | otherwise = leadPart div ++ [ mod ]
    where (div, mod) = x `divMod` 60

-- these get called `v`
romanValues :: [Integer]
romanValues = [50, 40, 10, 9, 5, 4, 1]

-- these get inlined with `words`, and correspond to the values above
romanLetters :: [String]
romanLetters = ["l", "xl", "x", "ix", "v", "iv", "i"]

-- this becomes (&)
romanNumeralLoop :: Integer -> Int -> String
romanNumeralLoop n i
 | n == 0                  = ""
 | n >= (romanValues !! i) = (romanLetters !! i) ++ romanNumeralLoop (n - (romanValues !! i)) i
 | otherwise               = romanNumeralLoop n (i + 1)

-- this becomes `q`
concatRomanWithDots :: [Integer] -> String
concatRomanWithDots numbers = concatWithDots (map toRoman numbers)
  where
    toRoman = onZero "n" (\x -> romanNumeralLoop x 0)
    concatWithDots = foldl1 concatDot
    concatDot acc item = acc ++ "." ++ item

-- this becomes `p`
solve x = onZero "n" elseRomanizeLeadPart n ++ onZero "" elseRomanizeFracPart f
  where
    n = floor x
    f = 60 * (x - fromInteger n)
    elseRomanizeLeadPart l = concatRomanWithDots (leadPart l)
    elseRomanizeFracPart f = ".e." ++ concatRomanWithDots (take 5 (fracPart f))

The method of converting integers to roman numerals was stolen shamelessly from Thomas Ahle on StackOverflow and just golfed a little.

["l","xl","x","ix","v","iv","i"] can be words"l xl x ix v iv i"

@H.PWiz thanks, incorporated!


text:
Find the coastline
Your task is to find the length of the coastline of a map of islands provided in
an ASCII map. The input map will consist of 1 or more # characters that
indicate land, and spaces which indicate water. The coastline is considered to
be any edge between land and water, including inland lakes and islands.
Your solution should be a complete program that reads in a file, a string or an array of
strings, and outputs a single integer to the screen or stdout. Each input line
may have leading or trailing space, and zero or more hash characters. The borders of the map are assumed to be space (water).
Lines may be of different lengths.
Examples:
Input:
##
##
Output: 8

Input:
    ###    ###
  #####     #
   ##
Output: 26

Input:
  #####
  #   #
  # # #
  #   #
  #####
Output: 36

This is code golf, so the smallest byte count wins.

Can we assume that the input is padded to a rectangle with spaces?

Why a complete program? Usually functions are also allowed, and I don't see a good reason for this challenge to be restrictive.

@MartinBüttner, yes. I was hoping that the "The borders of the map are assumed to be space (water)" covered that. Let me know if I should make that clearer.

@nimi, I understand your concern, but as the challenge is 12 hours old, there are 4 answers, and other people may be working on it right now, I am reluctant to change it.

@CarpetPython no I mean whether we can assume that all lines of the input have the same length.

@MartinBüttner, I see. I have edited the question to make this explicit. Lines may be of different lengths.

Snails, 8 bytes
A
\#o!\#

The A option means to count all matching paths rather which starting points a match succeeds from. \# consumes a #, o turns in a cardinal direction, and !\# is a negative assertion which succeeds if there is not a # in front of us.

Pyth - 25 23 bytes
First it pads the input to a rect. Then counts the occurrences of " #" over the 4 permutations of transpositions and reversals of the input+space.
/ssm_B++;j;d;CB.t.zd" #

Try it online here.

How can that detect coastlines on the edge of the input?

I pad it first, I forgot to say that.

ES6, 123 115 114 bytes
a=>a.map((s,i)=>s.replace(/#/g,(h,j)=>r+=(s[j-1]!=h)+(s[j+1]!=h)+((a[i-1]||'')[j]!=h)+((a[i+1]||'')[j]!=h)),r=0)|r

Edit: Saved 9 bytes thanks to @edc65.

I'm uncertain about this beeing a complete program that writes to stdout or on screen. Apart from this: you should use param of the replace function. a=>['',...a,''].map((s,i,a)=>s.replace(/#/g,(_,j)=>r+=(s[j-1]!=_)+(s[j+1]!=_)+(a[i-1][j]!=_)+(a[i+1][j]!=_)),r=0)|r

And better a=>a.map((s,i)=>s.replace(/#/g,(_,j)=>r+=(s[j-1]!=_)+(s[j+1]!=_)+((a[i-1]||'')[j]!=_)+((a[i+1]||'')[j]!=_)),r=0)|r

@edc65 Ah, of course, I lose two bytes by having to capture the inner array value. Also, nice catch on that replace parameter.

MATL, 42 bytes
c2\FTFt!*Y+2*qFTFtl-4lhhbvv_2X53$Y+t0>)s2/

This accepts the input as a cell array of strings, of the form
{'#####', '#   #', '# # #', '#   #', '#####'}

It first converts the input to a 2D char array, padding with spaces, and then to a matrix of zeros and ones. 2D-convolution is then applied twice, with two different masks: first for expanding the matrix, second for detecting edges.
Try it online!

Japt, 22 19 bytes
4o £UzX è"#%s|#$} x

Assumes the input is padded with spaces to form a rectangle. Test it online!
How it works
          // Implicit: U = input string, S = a space
4o £    } // Create the array [0,1,2,3], and map each item X to:
UzX       //  Rotate U by 90 degrees X times.
è"#%s|#$  //  Count the number of "#"s followed by a space, newline, or end-of-string.
x         // Sum the resulting array.