text:
Longest Increasing Substring
Given a list of positive integers, write code that finds the length of longest contiguous sub-list that is increasing (not strictly).  That is the longest sublist such that each element is greater than or equal to the last.
For example if the input was:
\$[1,1,2,1,1,4,5,3,2,1,1]\$
The longest increasing sub-list would be \$[1,1,4,5]\$, so you would output \$4\$.
Your answer will be scored by taking its source as a list of bytes and then finding the length of the longest increasing sub-list of that list.  A lower score is the goal. Ties are broken in favor of programs with fewer overall bytes.

Is it okay to return true instead of 1? And do we have to handle an empty list?

For your first one, whatever meta consensus is on numeral output you may do, I don't recall True being a substitute for 1 but it may be.  You should be able to handle the empty list (Output is of course 0).

Suggested test cases: [] => 0, [0] => 1, [3,2,1] => 1, [1,2,1,2] => 2

Would you mind elaborating on the 'score' a bit more?

@ouflak I'm not sure what more there is to say on the score. Convert your submission to a list of bytes and pass it through your own program and that's your score. If scores are equal, the tie-breaker is the bytecount

You really should add those test cases. It seems like a majority of these answers don't handle the empty list case correctly.

Pyth, score 2 (8 bytes)
lefSIT.:

Try it here!
Code points [108, 101, 102, 83, 73, 84, 46, 58]. Another shorter solution, leSI#.: scores 3, but its code points are [108, 101, 83, 73, 35, 46, 58], which are very close to a score of 1, actually. Rearranging a bit may help Nevermind, the substrings built-in is .: which cannot be rearranged, so the lowest score must be 2 if the program makes use of it.
How?
lefSIT.:     Full program. Accepts either a list or a string from STDIN.
      .:     Substrings.
  f  T       Only keep those that are...
   SI        Sorting-Invariant.
le           Length of the last item.

JavaScript (Node.js), score 3, 53 46 bytes score 2, 51 50 bytes
-7 bytes thanks @Arnauld
+5 +4 spaces in exchange of -1 score
a=> a.map($= p=n=>$=(p<=(p=n)?++ x:x=1)<$?$: x)&&$

Try it online!
Assumes non-empty input. 61 bytes if empty list must be handled. Score 2 still.
a=> a.map($= p=n=>$=(p<=(p=n)?++ x:x=1)<$?$: x)&& a.length&&$

Try it online!
...or 58 if returning false is allowed. Score 2 still.
a=> a.map($= p=n=>$=(p<=(p=n)?++ x:x=1)<$?$: x)&& a>[ ]&&$

This should work for 46 bytes and the same score.

@Arnauld added 5 spaces to your suggestion so that it's now a score 2

Haskell, score 2, 66 64 61 60 65 bytes

-2 bytes thanks to Max Yekhlakov
-1 byte thanks to nimi
+5 bytes to handle the empty list

foldr1 max.g
g[]=[0]
g(x:y:z)|x>y=1: g(y:z)
g(_:y)|a:b<-g y=1+a:b

Try it online! (verifies itself).
I never thought I could get a score of 2 with Haskell, and yet here I am!
Function g computes the lengths of all the increasing substrings recursively.
foldr1 max.g takes the maximum of those lengths (foldr1 max is equivalent to maximum, but with a lower score).

Looks like the whitespace in 1+a : b is not necessary, so this is 62 bytes.

@MaxYekhlakov You're right, I don't know how I missed that.

Your code returns 1 for the empty list, where it should return 0

@Jo King Indeed, I had missed the discussion in the comments. Fixing that right now.

Husk, 5 bytes, score = 2
00000000: bc6d 4cdc 14                   ▲mLġ≥

Try it online!
It's unlikely to get a score lower than 2 with Husk because ġ1 has a really high codepoint and there needs to be something before it to get the maximum and length. An attempt could be made with trying to use multiple functions but \n would be before any helper functions which has a really low codepoint so anything after it would create an increasing byte-sequence of at least length 2.
1: This seems like the best way to use for the comparison operators would need to follow the various split functions like ↕ (span).
Explanation
▲mLġ≥  -- example input: [1,1,2,1,1,4,5,3,2,1,1]
   ġ≥  -- group elements by geq: [[1,1,2],[1,1,4,5],[3],[2],[1,1]]
 mL    -- map length: [3,4,1,1,2]
▲      -- maximum: 4

MATL, score 2, 13 bytes
d0< ~Y'w)X>sQ

Input can be:

An array of numbers.
A string enclosed with single quotes. Single quotes within the string are escaped by duplicating.

MATL uses ASCII encoding. The codepoints of the above code are
100, 48, 60, 32, 126, 89, 39, 119, 41, 88, 62, 115, 81

Try it online!
Explanation
d     % Implicit input. Consecutive differences (of code points)
0<    % Less than 0? Element-wise. Gives true or false
      % Space. This does nothing; but it breaks an increasing substring
~     % Negate
Y'    % Run-length encoding. Gives array of true/false and array of lengths
w     % Swap
)     % Index. This keeps only lenghts of runs of true values
X>    % Maximum. Gives empty array if input is empty
s     % Sum. This turns empty array into 0
Q     % Add 1. Implicit display

Retina 0.8.2, 40 bytes, score 3
\d+
$*
(?<=(1+)),(?!\1)
¶
T`1`_
^O`
\G,?

Try it online! Link includes itself as byte codes as input. Explanation:
\d+
$*

Convert to unary.
(?<=(1+)),(?!\1)
¶

Split on decreasing pairs.
T`1`_

Delete the digits.
^O`

Sort the commas in reverse order. (I would normally write this as O^ but can't do that here for obvious reasons.)
\G,?

Count the longest comma run, and add one to include the final number.

Japt -h, 6 bytes, score 2
Don't think a score of 1 is possible. Should work with strings & character arrays too.
ò>¹mÊn

Try it - included test case is the charcodes of the solution.

Explanation
ò          :Partition after each integer
 >         :  That's greater than the integer that follows it
  ¹        :End partition
   m       :Map
    Ê      :  Length
     n     :Sort
           :Implicitly output last element

Pascal (FPC), score 2
111 bytes
var a,b,c,t:bYte;bEgIn repeat read(a); iNc(c); if a<b then c:=1; if c>t then t:= c;b:= a;until eOf;write(t)eNd.

Try it online!
Assumes non-empty input. Numbers are taken from standard input separated by spaces.

Perl 6, score 2, 46 bytes
{my&g=1+*×*;+max 0,|[\[&g]] [ |@_] Z>=0,|@_ }

Try it online!
Handles the empty list. The original code was:
{my&g=1+*×*;+max 0,|[\[&g]] @_ Z>=0,|@_}

So only 5 extra bytes to reduce the score to 2.
Edit: Ah, I figured out how to remove the assignment, but then I can't get that score below 3 because of the )]]...
Explanation:
{                                  }  # Anonymous code block
 my&g=     ;  # Assign to &g an anonymous Whatever lambda
      1+*×*   # That multiplies the two inputs together and adds 1
                            @_ Z  0,|@_   # Zip the list with itself off-set by one
                                >=        # And check if each is equal or larger than the previous
                                         # e.g. [5,7,7,1] => [1,1,1,0]
                    [\[&g]]  # Triangular reduce it by the function declared earlier
                          # This results in a list of the longest substring at each index
                          # e.g. [5,7,7,1] => [1,2,3,1]
            +max 0,|      # And return the max value from this list, returning 0 if empty

So [[&(*+*)]] works like [+]? Amazing...

@nwellnhof Yeah, there's a few caveats like you can't have any whitespace (at all), but you can even use it with Z and X. Try it online!

I was going to try something like: {max 0,|.[[X..] ^$_ xx 2].map({+$_ if [<=] $_})}

Jelly, 8 bytes, score 2
There is probably a score 1 solution somehow...
IṠµṣ-ZL‘

Try it online!
Source code as a list of byte values:
[73, 205, 9, 223, 45, 90, 76, 252]

How?
IṠµṣ-ZL‘ - Link: list of integers  e.g. [ 1, 1, 2, 1, 1, 4, 5, 3, 2, 1, 1]
I        - increments                    [ 0, 1,-1, 0, 3, 1,-2,-1,-1, 0]
 Ṡ       - sign                          [ 0, 1,-1, 0, 1, 1,-1,-1,-1, 0]
  µ      - start a new monadic chain (a low byte to stop score being 3)
    -    - literal minus one             -1
   ṣ     - split at                      [[0, 1], [0, 1, 1], [], [], [0]]
     Z   - transpose                     [[0, 0, 0], [1, 1], 1]
      L  - length                        3
       ‘ - increment                     4

05AB1E, score 3 (9 bytes)
Œʒ¥dP}éθg

Can most likely be a score of 2 somehow.
Code points of the program-bytes: [140,1,90,100,80,125,233,9,103] (two sublists of length 3: [1,90,100] and [80,125,233])
Try it online.
Explanation:
Œ            # Sublists
 ʒ   }       # Filter by:
  ¥          #  Take the deltas
   d         #  Check for each whether the number is >= 0
    P        #  And check if it was truthy for all deltas
      é      # Then sort by length
       θ     # Take the last element
        g    # And take its length as result

Powershell, score 3, 44 bytes
($args|%{$i*=$_-ge$p;$p=$_;(++$i)}|sort)[-1]

Test script:
$f = {

(
    $args|%{        # for each integer from argument list
        $i*=$_-ge$p # -ge means >=.
                    # This statement multiplies the $i by the comparison result.
                    # A result of a logical operator is 0 or 1.
                    # So, we continue to count a current sequence or start to count a new sequence
        $p=$_       # let $p stores a 'previous integer'
        (++$i)      # increment and return incremented as length of a current sequence
    }|sort          # sort lengthes
)[-1]               # take last one (maximum)

}

@(
    ,(4, 1,1,2,1,1,4,5,3,2,1,1)
) | % {
    $e,$a = $_
    $r = &$f @a
    "$($r-eq$e): $r"
}

Output:
True: 4

Explanation:

The script takes integers as argument list (spaltting).
Each integer maps by a function to legnth of contiguous sub-list that is increasing (not strictly). Then the script sorts lengthes and take a last (maximum) (...|sort)[-1].

Powershell 6, score 3, 43 bytes
$args|%{$i*=$_-ge$p;$p=$_;(++$i)}|sort -b 1

Same as above. One difference: sort -b 1 is shortcut for sort -Bottom 1 and means 1 element from the end of sorted array. So we need not an index [-1].

Java (JDK), score 3, 94 bytes
a->{int m=0,p=0,x=0,i=0,n;while(i<a.length){n=a[i++];m=(p<=(p=n)?++x:(x=1)) <m?m:x;}return m;}

Try it online!
Port of my (with suggestions from Arnauld) JS answer. etu in return and hil in while make it impossible to golf to score 2.
for cannot be used here because:

;for is ascending
for cannot be used at the beginning of the lambda body (scope restrictions). It is possible to wrap it with {} but apparently using while saves bytes.

I was going to suggest possibly using \u in some places, but then you have to have 00 followed by a digit which is 3 anyway...

Stax, score 3 (15 bytes)
Z|[F|]F:^!C_%|M

Run and debug it

Python 2, score 5, 87 bytes score 2, 101 93 92 101 bytes
lambda a,m=1,o=[1]:max(reduce(lambda B,c:[B[:-m]+[B[-m]+m],B+o][c[0]>c[m]],zip(a,a[m:]), o)) *(a>[ ])

Try it online!
Ooops! Thought this was code-golf first time through...

Score of 5. Try it online!

Indent with tabs to get a score of 4.

@mypetition: D'oh! Thought this was code golf... editing my answer now.

Funny that removing the m=1,o=[1] part doesn't end up saving any bytes once we reduce the score

@Jo King: Chuckle! I kept hoping that by squirming in that way, I could chip off another byte; but no such luck!

Dyalog APL, score 2, 20 bytes
{⍵≡⍬:0⋄⌈/≢¨⍵⊂⍨1,2>/⍵}

Try it online!

Wolfram Language (Mathematica), score 3, 45 bytes
Max[Length/@SequenceCases[#,x_/;OrderedQ@x]]&

Try it online!
SequenceCases and OrderedQ by themselves give a score of 3, so the score can't be improved without changing the approach significantly.

The correct way to use patterns would have us do Max[Length/@SequenceCases[#,_?OrderedQ]]&, but _?Or is an increasing subsequence of length 4. (As is _?AnyCamelCaseCommand.)

Kotlin, Score 6,  119 bytes
 fun x(a : IntArray){var m=1;var k=0;var d=1;while(k<a.size-1){if(a[k]<=a[k+1])m++;else{if(d<m)d=m;m=1};k++};println(d)}

Try Online
Explanation

Step 1: Check for previous value to next value
Step 2: If previous value is less or equal then add plus 1 keep doing while condition
is true
Step 3: check previous count with next count, keep highest count in variable d.

Ok, i got it, i will edit it shortly.

Please check, i have made a function in which input can be given.
As per my sample string answer would be [2,4,5,6,7,7,7] Score is 7.

I have updated score and link please check.

Ok, I gave updated.

Let us continue this discussion in chat.

Java (JDK), 126 bytes, Score 6
Golfed
private static int l(byte[] o){int m=0;int c=1;int p=0;for(byte i:o){if(m<c){m=c;}if(i>=p){p= i;c++;}else{c=1;p=0;}}return m;}

Ungolfed
private static int longest(byte[] input) {
    int maxc = 0;
    int consec = 1;
    int prev = 0;
    for (byte i : input) {
        if (maxc < consec) {
            maxc = consec;
        }
        if (i >= prev) {
            prev = i;
            consec++;
        }
        else {
            consec = 1;
            prev = 0;
        }
    }
    return maxc;
}

Input
[112, 114, 105, 118, 97, 116, 101, 32, 115, 116, 97, 116, 105, 99, 32, 105, 110, 116, 32, 108, 40, 98, 121, 116, 101, 91, 93, 32, 111, 41, 123, 105, 110, 116, 32, 109, 61, 48, 59, 105, 110, 116, 32, 99, 61, 49, 59, 105, 110, 116, 32, 112, 61, 48, 59, 102, 111, 114, 40, 98, 121, 116, 101, 32, 105, 58, 111, 41, 123, 105, 102, 40, 109, 60, 99, 41, 123, 109, 61, 99, 59, 125, 105, 102, 40, 105, 62, 61, 112, 41, 123, 112, 61, 32, 105, 59, 99, 43, 43, 59, 125, 101, 108, 115, 101, 123, 99, 61, 49, 59, 112, 61, 48, 59, 125, 125, 114, 101, 116, 117, 114, 110, 32, 109, 59, 125]

Shouldn't byte be int, since byte would be restricted to 8 bits?

@JoKing I am not exactly sure what you mean. Do you mean that I should change the byte class to int class?

Yes, since the input is a list of integers

Kotlin, Score 4, 67 bytes
{a:IntArray->var i=0;var p=0;a.map{if(it<p){i=0};p=it;(++i)}.max()}

Main idea is: Transform each integer to length of contiguous sub-sequences that is increasing (not strictly). Return maximum.

a.map{...} - for each integer in the array do
if(it<p){i=0} - if current integer is less then a previous integer, then reset counter
p=it - store current integer in the previous
(++i) - increment counter and return value of the expression
.max() - get maximun of all length

Ruby, 64 bytes
->e{e.size.downto(1).find{|l|e.each_cons(l).find{|c|c==c.sort}}}

Try it online!

Note that this is not [tag:code-golf]. Your current score is 6. Also, your code does not handle the empty list (where the output should be 0)

Brachylog, score: 2 (8 bytes)
⊇L≤₁&sLl

Try it online!
This code, according to Brachylog’s code page, is the following string of char codes / integers:
[08, 4C, 03, 80, 26, 73, 4C, 6C]
[8, 76, 3, 128, 38, 115, 76, 108]

Which results in a score of 2.
Explanation
⊇L         L is a sublist of the input (trying from longest to shortest)
  L≤₁       L is increasing
     &sL    L is also a contiguous sublist of the input
        l   Output the length of L

We need to use ⊇ to get the longest sublists first and then check that it is contiguous with s, because s does not try them longest first (see this Brachylog tip).

Go, score 4, 172 bytes
type y=int
type x=[]y
func f(q x)y{l,o:=*new(x),*new(x)
for _,e:=range q{n:=len(o)
if n>0&&o[n-1]>e{if len(l)<n{l=o}
o=append(*new(x),e)}else{o=append(o,e)}}
return len(l)}

Attempt This Online!
I'm pretty sure this is the absolute minimum this bit of code can achieve, because =int is ascending in terms of value.
If you change y to be rune, and x=[] y you then get hung up on \nfor. Unless someone finds a way to make case-insensitive keywords in Go, then 4 is the minimum score.


text:
Converting a number from Zeckendorf Representation to Decimal
About Zeckendorf Representations/Base Fibonacci Numbers
This is a number system which uses Fibonacci numbers as its base. The numbers consist of 0 and 1's and each 1 means that the number contains the corresponding Fibonacci number, and 0 means it does not.
For example, let's convert all natural numbers <=10 to base Fibonacci.

1 will become 1, because it is the sum of 1, which is a Fibonacci number,
2 will become 10, because it is the sum of 2, which is a Fibonacci number, and it does not need 1, because we already achieved the desired sum.
3 will become 100, because it is the sum of 3, which is a Fibonacci number and it does not need 2 or 1 because we already achieved the desired sum.
4 will become 101, because it is the sum of [3,1], both of which are Fibonacci numbers.
5 will become 1000, because it is the sum of 5, which is a Fibonacci number, and we do not need any of the other numbers.
6 will become 1001, because it is the sum of the Fibonacci numbers 5 and 1.
7 will become 1010, because it is the sum of the Fibonacci numbers 5 and 2.
8 will become 10000, because it is a Fibonacci number.
9 will become 10001, because it is the sum of the Fibonacci numbers 8 and 1.
10 will become 10010, because it is the sum of the Fibonacci numbers 8 and 2.

Let's convert a random Base Fibonacci number, 10101001010 to decimal:
First we write the corresponding Fibonacci numbers.
Then we compute the sum of the numbers under 1's.
 1   0   1   0   1   0   0   1   0   1   0
 144 89  55  34  21  13  8   5   3   2   1  -> 144+55+21+5+2 = 227.

Read more about Base Fibonacci numbers: link, it also has a tool which converts regular integers to base Fibonacci. You can experiment with it.
Now the Question:
Your task is to take a number in the Zeckendorf Representation, and output its decimal value.
Input is a string which contains only 0 and 1's (although you can take the input in any way you want).
Output one number in decimal.
Test cases: (in the format input->output)
 1001 -> 6
 100101000 -> 73
 1000000000 -> 89
 1001000000100100010 -> 8432
 1010000010001000100001010000 -> 723452

This is code-golf, so the shortest answer in bytes wins.
Note: The input will not contain any leading 0's or consecutive 1's.

Can we take input as a list of bits?

Like, take the input ascii encoded then convert it to binary or something like that?

I mean like taking [1,0,0] instead of "100".

Yes, you can. For example the Jelly answer takes the input as a list

Can we take input in LSB-first order?

Subset of https://codegolf.stackexchange.com/questions/54287/summation-under-zeckendorf-representation?rq=1, inverse of https://codegolf.stackexchange.com/questions/2677/the-minimum-fibonacci-challenge?rq=1 .

@Mego Yes, you can

Taxi, 1987 1927 bytes
-60 bytes due to the realization that linebreaks are optional.
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to Chop Suey.Go to Chop Suey:n 1 r 1 l 4 r 1 l.[B]Switch to plan C if no one is waiting.Pickup a passenger going to Cyclone.Go to Cyclone:n 1 l 3 l.Pickup a passenger going to Narrow Path Park.Pickup a passenger going to Sunny Skies Park.Go to Zoom Zoom:n.Go to Sunny Skies Park:w 2 l.Go to Narrow Path Park:n 1 r 1 r 1 l 1 r.Go to Chop Suey:e 1 r 1 l 1 r.Switch to plan B.[C]1 is waiting at Starchild Numerology.1 is waiting at Starchild Numerology.Go to Starchild Numerology:n 1 l 3 l 3 l 2 r.Pickup a passenger going to Addition Alley.Pickup a passenger going to Cyclone.Go to Cyclone:w 1 r 4 l.[D]Pickup a passenger going to Addition Alley.Pickup a passenger going to Cyclone.Go to Addition Alley:n 2 r 1 r.Go to Cyclone:n 1 l 1 l.Pickup a passenger going to Multiplication Station.Go to Zoom Zoom:n.Go to Narrow Path Park:w 1 l 1 l 1 r.Switch to plan E if no one is waiting.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:e 1 r.Pickup a passenger going to Multiplication Station.Go to Multiplication Station:n 1 r 2 l.Pickup a passenger going to Joyless Park.Go to Joyless Park:n 2 l 1 r 1 r.Go to Addition Alley:w 1 r 2 l 1 l.Pickup a passenger going to Cyclone.Go to Cyclone:n 1 l 1 l.Pickup a passenger going to Addition Alley.Switch to plan D.[E]Go to Addition Alley:w 1 l 1 r 1 l.Pickup a passenger going to Riverview Bridge.Go to Riverview Bridge:n 1 r.Go to Joyless Park:e 1 r 2 l.Pickup a passenger going to Addition Alley.[F]Switch to plan G if no one is waiting.Pickup a passenger going to Addition Alley.Go to Fueler Up:w 1 l.Go to Addition Alley:n 3 l 1 l.Pickup a passenger going to Addition Alley.Go to Joyless Park:n 1 r 1 r 2 l.Switch to plan F.[G]Go to Addition Alley:w 1 r 2 l 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:n 1 r 1 r.Pickup a passenger going to Post Office.Go to Post Office:n 1 l 1 r.

Try it online!
Because I don't return to the Taxi Garage at the end, my boss fires me, so it exits with an error.

Joyless Park seems a nice place to visit

Well, it IS fewer characters than Sunny Skies Park.

Perl 6, 28 23 bytes
{[+] (1,2,*+*...*)Z*$_}

Try it online!
Anonymous codeblock that takes a list of 1s and 0s in LSB ordering and returns a number.
Explanation:
{                     }   # Anonymous codeblock
 [+]                      # The sum of
     (1,2,*+*...*)        # The infinite Fibonacci sequence starting from 1,2
                  Z*      # Zip multiplied by
                    $_    # The input list in LSB form

Jelly, 5 bytes
T‘ÆḞS

A monadic link accepting a list in Little-endian form (i.e. from the LSB at the left to MSB at the right).
Try it online!

Nice, I had an alternative 6-byter: J‘ÆḞḋṚ.

Wolfram Language (Mathematica), 35 32 29 28 bytes
Fibonacci[Range@Tr[#!]+1].#&

Try it online!

Python 2, 43 bytes
a=b=0
for x in input():b+=a+x;a=b-a
print b

Try it online!
Takes input as a list. The update is a shorter version of a,b=b+x,a+b+x, which is like the Fibonacci update a,b=b,a+b if you ignore x.

Python 2, 45 bytes
f=lambda n,a=1,b=1:n and n%10*b+f(n/10,b,a+b)

Try it online!
Takes input as decimal numbers.

Haskell, 38 bytes
f=1:scanl(+)2f
sum.zipWith(*)f.reverse

Try it online!
Takes input as a list of 1s and 0s.
Explanation

f=1:scanl(+)2f

Makes a list of the Fibonacci numbers sans the first one, in variable f.
sum.zipWith(*)f.reverse

Takes the input list reverses it the multiplies each entry by the corresponding entry in f, then sums the results.
Haskell, 30 bytes
f=1:scanl(+)2f
sum.zipWith(*)f

Try it online!
If we take input in with the least significant bit first we don't need reverse so we can save 8 bytes.

Brain-Flak, 110, 102, 96, 94, 78, 74 bytes
([[]]<>((()))){({}()<([({})]({}({})))>)}{}{}({<>{<{}><>({})(<>)}{}<><{}>})

Try it online!

Pyth, 13 bytes
Most of this (8 bytes) is just generating the Fibonacci numbers.
s*V_m=+Z|~YZ1

Try it out with this test suite!
Explanation:
s*V_m=+Z|~YZ1QQ     Autofill variables
    m=+Z|~YZ1Q      Generate the first length(input) Fibonacci numbers as follows:
       Z             Start with Z=0
         ~YZ         And Y=[] (update it to Y=Z, return old Y)
        |   1        if Y is [], then replace with 1
      +              Sum Z and Y
     =               Replace Z with sum
    m                Repeat process
             Q       once for each element of the input
   _                Reverse the order of the Fibonacci numbers
 *V                 Vectorize multiplication
s                   Sum

J, 24 14 bytes
#.~2+&%&1~#-#\

Try it online!
Golfed down the 24-byte version that uses the mixed base for Fibonacci.
How it works
#.~2+&%&1~#-#\  Example input: y=1 0 0 1 0
          #-#\  Length minus 1-based indices; 4 3 2 1 0
   2     ~      Starting from 2, run the following (4,3,2,1,0) times:
    +&%&1         Given y, compute 1 + 1 / y
                The result is 13/8 8/5 5/3 3/2 2
#.~             Mixed base conversion of y into base above; 2+8=10

J, 21 bytes
1#.|.*[:+/@(!~#-])\#\

Try it online!
Refined version of Galen Ivanov's 25-byte solution.
Uses the diagonal sum of Pascal's triangle, which is equivalent to the sum of binomial coefficients:
\$ F_n = \sum\limits_{i=0}^{n} {}_{n-i}C_{i} \$
How it works
1#.|.*[:+/@(!~#-])\#\
                       Example input: 1 0 0 1 0
                   #\  Generate 1-based index; 1 2 3 4 5
      [:          \    For each prefix of above... (ex. 1 2 3)
              #-]        Subtract each element from the length (ex. 2 1 0)
           (!~   )       Compute binomial coefficient (ex. 3C0 + 2C1 + 1C2)
        +/@              Sum
                       The result is Fibonacci numbers; 1 2 3 5 8
   |.*                 Multiply with mirrored self; 0 2 0 0 8
1#.                    Sum; 10

J, 24 bytes
3 :'y#.~|.(1+%)^:(<#y)2'

Try it online!
Monadic explicit verb. Generates the mixed base that represents the Fibonacci base, and then feeds into base conversion #..
How it works
y#.~|.(1+%)^:(<#y)2  Explicit verb, input: y = Fibonacci digit array, n = length of y
      (1+%)          x -> 1 + 1/x
           ^:(<#y)2  Apply the above 0..n-1 times to 2
                     The result looks like 2/1, 3/2, 5/3, 8/5, 13/8, ...
    |.               Reverse
                     Now, if it is fed into #. on the left, the digit values become
                     ...(8/5 * 5/3 * 3/2 * 2/1), (5/3 * 3/2 * 2/1), (3/2 * 2/1), 2/1, 1
                     which is ... 8 5 3 2 1 (Yes, it's Fibonacci.)
y#.~                 Convert y to a number using Fibonacci base

Alternatives
J, 27 bytes
}.@(+#{.3#{.)^:(<:@#)@(,&0)

Try it online!
The idea:
 1  0  0  1  0  1
-1 +1 +1
------------------
    1  1  1  0  1
   -1 +1 +1
------------------
       2  2  0  1
      -2 +2 +2
------------------
          4  2  1
         -4 +4 +4
------------------
             6  5
            -6 +6 +6 <- Add an imaginary digit that has value 1
---------------------
               11  6
              -11+11
---------------------
                  17 <- the answer

J, 30 bytes
0.5<.@+(%:5)%~(-:>:%:5)#.,&0 0

Try it online!
This one took the most effort to build. Uses the closed-form expression with rounding trick. In the expression, 0th and 1st values are 0 and 1 respectively, so the actual digit power must start with 2.
0.5<.@+(%:5)%~(-:>:%:5)#.,&0 0  Tacit verb.
                         ,&0 0  Add two zeroes at the end
              (-:>:%:5)#.       Convert to a number using base phi (golden ratio)
       (%:5)%~                  Divide by sqrt(5)
0.5<.@+                         Round to nearest integer

While the error (((1-sqrt(5))/2)^n terms) may build up, it never exceeds 0.5, so the rounding trick works up to infinity. Mathematically:
\$ \max(|error|) = \frac{1}{\sqrt{5}} \sum\limits_{1}^{\infty} (\frac{1-\sqrt{5}}{2})^{2n} = \frac{1}{\sqrt{5}} \sum\limits_{0}^{\infty} (\frac{1-\sqrt{5}}{2})^{n} = \frac{\sqrt{5}-1}{2\sqrt{5}} < \frac{1}{2} \$

Nice solution! I'm glad to see an explicit verb beating the tacit solution.

I'm trying to find a shorter tacit solution, but without success. 25 bytes for now. I use Pascal's triange.

@GalenIvanov Revisiting the challenge after a year, I got a new, super short tacit solution :)

That's great! I'll look at it in more details soon.

05AB1E, 11 9 8 bytes
vyiNÌÅfO

Try it online!
Explanation:
v             : For each character in input string (implicit) in LSB order
  yi          : If the current character is truthy (1)
    NÌ        : Add 2 to the current index
       ÅfO    : Add the fibonacci of this number to the stack

-2 bytes: Thanks to @KevinCruijssen for pointing out small ways to shorten this code!
-1 byte: Thanks to @JonathanAllan for pointing out LSB order for input!

You can remove the Θ. 1 is truthy in 05AB1E already. :) Also, 2+ can be Ì.

We can take the input in Little-endian form (i.e. reversed), which should save a byte (or two?).

MathGolf, 8 6 bytes
{î)f*+

Try it online!
Explanation
{        Start block (foreach in this case)
 î)      Push loop index (1-based) and increment by 1
   f     Get fibonacci number of that index
    *    Multiply with the array value (0 or 1)
     +   Add top two elements of stack. This implicitly pops the loop index the first iteration, which makes the addition become 0+a, where a is the top of the stack.

Saved 1 byte thanks to JoKing, and another byte thanks to LSB ordering.

LSB order is indeed allowed. also, -1 byte

@JoKing Of course, I even implemented the implicit addition just last week... Nice touch, now MathGolf is at a tied first place!

Red, 142, 126 106 bytes
func[a][b: copy[1 1]reverse a s: 0 n: 1
until[s: b/1 * a/:n + s insert b b/1 + b/2(n: n + 1)> length? a]s]

Try it online!

Retina 0.8.2, 23 bytes
0?
;
+`1;(1*);
;1$1;1
1

Try it online! Link includes the faster test cases. Explanation:
0?
;

Insert separators everywhere and delete any zeros. For example, 1001 becomes ;1;;;1;.
+`1;(1*);
;1$1;1

Repeatedly replace each 1 with a 1 in each of the next two places, as the sum of their values equals the value of the original 1. 1s therefore migrate and accumulate until they reach the last two places, which (due to the newly added separator) now both have value 1.
1

Count the 1s.

Python 3, 63 bytes
a=b=n=1
for i in input()[::-1]:n+=b*int(i);a,b=b,a+b
print(n-1)

Try it online!
Takes input through STDIN as a string.

Ruby, 39 bytes
->n{a,b=0,1;n.digits.sum{|x|x*b=a+a=b}}

Try it online!

Stax, 6 bytes
çéC◘0â

Run and debug it
:1F^|5+           #Full program, unpacked, implicit input as array
:1                #Get indicies of truthy
  F               #Use rest of program to loop through elements
   ^              #Increment current element
    |5+           #Get n-th fib and Add

Pretty straight forward. LSB Ordering.

Brain-Flak, 40 bytes
([]){{}([({}<>{})]({}{}))<>([])}<>({}{})

Try it online!

C (gcc), 63 bytes
Takes input as an array of 1's and 0's, along with the length of the array. This solution is a rather straight-forward backwards loop.
f(_,l,a,b,t)int*_;{a=b=1;for(t=0;l--;b=(a+=b)-b)t+=a*_[l];_=t;}

Try it online!

Prolog (SWI), 74 bytes
\D-->[X,Y],{D is 2*X+Y};[D];a,\D.
a,[A],[B]-->[X,Y,Z],{A is X+Y,B is X+Z}.

Try it online!
Takes input as a list of integers 1 and 0 with the most significant bit first.

JavaScript (Node.js), 41 bytes
A port of xnor's answer. Takes input as a BigInt literal.
f=(n,a=1n,b=a)=>n&&n%10n*b+f(n/10n,b,a+b)

Try it online!

JavaScript (ES6), 44 bytes
Takes input as an array of characters, in LSB-first order.
s=>s.map(k=>t+=k*(z=x,x=y,y+=z),x=t=0,y=1)|t

Try it online!

Japt -x, 9 bytes
Ë*MgUÊa´E

Try it

Actually, 8 bytes
;r⌐@░♂FΣ

Try it online!
Input is taken as a list of bits in LSB-first order.
Explanation:
;r⌐@░♂FΣ
;r        range(0, len(input))
  ⌐       add 2 to every element in range (range(2, len(input)+2))
   @░     filter: take values in range that correspond to 1s in input
     ♂F   Fibonacci number at index of each element in list (Actually uses the F(0)=F(1)=1 definition, which is why we needed to add 2 earlier)
       Σ  sum

Powershell, 68 bytes
param($s)$b=1
$s[$s.Length..0]|%{$a,$b=$b,($a+$b)
$x+=($_-48)*$b}
$x

Test script:
$f = {
param($s)$b=1
$s[$s.Length..0]|%{$a,$b=$b,($a+$b)
$x+=($_-48)*$b}
$x
}

@(
    ,("1001", 6)
    ,("100101000", 73)
    ,("1000000000", 89)
    ,("1001000000100100010", 8432)
    ,("1010000010001000100001010000", 723452)
) | % {
    $s,$e = $_
    $r = &$f $s
    "$($r-eq$e): $r"
}

Output:
True: 6
True: 73
True: 89
True: 8432
True: 723452

Java (OpenJDK 8), 65 bytes
Pretty small for a Java answer to I'm happy with that. Takes input as a LSB-first ordered array of ints.
d->{int s=0,f=1,h=1;for(int i:d){s+=i>0?f:0;f=h+(h=f);}return s;}

Try it online!
Ungolfed
d->{                        // Lambda function that takes array of ints
    int s=0,f=1,h=1;        // Initialise sum and fibonacci vars
    for(int i:d){           // Loop through each input integer
        s+=i>0?f:0;         // If it's 1 add current fibonacci number to sum
        f=h+(h=f);          // Increase fibonacci number
    }return s;              // return sum
}

Z80Golf, 34 bytes
00000000: dde1 f1b7 2819 fe30 2812 4504 aff5 3cf5  ....(..0(.E...<.
00000010: d1f1 82d5 f510 f9c1 f17c 8067 2c18 e3dd  .........|.g,...
00000020: e5c9                                     ..

Example with input 1001-Try it online!
Example with input 100101000-Try it online!
Assembly:
zeck:		; input=push on stack in MSB order (eg top is LSB) output=reg h
pop ix		; save return addr in ix
f:
pop af		; get next digit
or a
jr z, return	; if current digit==0, return
cp 0x30
jr z, skip	; if current digit=='0' (e.g. not '1'), skip loop
ld b, l		; find fib of counter
fib:
	inc b	; 1-indexing for func to work
	xor a	; set a to 0 (1st fibo num)
	push af
	inc a	; set a to 1 (2nd fibo num)
	push af
	fib_loop:
		pop de
		pop af
		add d
		push de
		push af
		djnz fib_loop
pop bc		; get the fibo num just calculated
pop af		; pop just to reset stack frame
ld a, h
add b		; add current fibo number to sum
ld h, a
skip:
inc l		; increment counter reg
jr f		; repeat loop
return:
push ix		; push the return addr to ret to it
ret

source: Stack Exchange

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

sort: votes


text:
Optimizing edge selection from a list of numbers
You are given a list, L, with the length N. L contains N random positive integer values. You are only able to select from the outer edges of the list (left/right), and after each selection every value in the remaining list increase by a factor of the current selection. The goal is to maximize the total sum of the selection you make until the list is empty.
An example of L where N = 3, [1,10,2].
Starting list [1,10,2], factor = 1.

Chosen path left

New list [10 * factor, 2 * factor] => [20, 4], where factor = 2

Chosen path right

New list [10 * factor] => [30], where factor = 3
Total value = 1 + 4 + 30 => 35.
Output: should be the total sum of all selections, and the list of all the directions taken to get there. 35 (left, right, left). Keep in mind that the the most important part is the total sum. There may exist more than one path that leads to the same total sum, for example 35 (left, right, right).
Test case 1
[3,1,3,1,1,1,1,1,9,9,9,9,2,1] => 527
(right left left left left left left left left right left left left left)
Test case 2
[1,1,4,1,10,3,1,2,10,10,4,10,1,1] => 587
(right left left right left left left left left left right right left right)
Rules
This is code-golf, shortest codes in bytes win.
Standard loopholes are forbidden.

I will update the question to make it more clear. The values of the remaining list increase by a factor of the current selection. In the first list [1,10,2] the factor is 1 since it is the first selection. Then the list becomes [10 * factor, 2 * factor], the factor is 2 since it is the second selection. The last list is [10 * factor], which is 3 since it is the third selection. I hope that makes it more clear.

Both, I will update the question.

You've tagged this with code-golf, could you make it explicit what is required to be valid and how answers are scored in the question?  Also btw, if you visit our meta we have a sandbox where you can get feedback before posting.

@JonathanAllan. I hope I understood you correctly, I added the two other possible paths for each test case.

@WW Sorry and thank you for the suggestion. I am going to check it out now to ensure it is properly formatted for next post. I have now removed the 'code-golf' tag from this post.

I must point out that all challenges here need some scoring criteria.  That is a method of objectively ranking valid answers.  [tag:code-golf] is one.  When you say the goal is to maximize the sum of the selections, do you mean that a valid answer must output the maximum?

@JonathanAllan fixed!

@WW Yes I do, the answer must output the absolute maximum sum. How would you approach adding criteria to a question like this where there always exists a maximum path?

Since maximum path is already a fine validity criteria I think [tag:code-golf] would probably be the best fit.  It is the most popular and usually considered the default.

You misunderstood W W: there must be one accepted best answer which is what we mean by scoring criteria.

@WW I think you are right. I have now added rules header!

@Quintec I absolutely did. The question is now updated, I have chosen code-golf.

@Quintec There doesn't necessarily have to be one accepted best answer for [tag:code-golf]. It's in fact discouraged to accept an answer for [tag:code-golf], since it is a competition for shortest in each language

I'm a bit confused about the directions, and your example. Do the left and right indicate the leading and trailing numbers that will be removed and used for the sum? So with the example [1,10,2] and (left,right,right), it means we first take the left nr (1) and multiply it with the factor (1): 1*1=1, then we remove this left number leaving [10,2], then we take the factor 2 with the right nr 2: 2*2=4, then remove this right number leaving [10], then we take the factor 3 with the right (or left) nr 10: 3*10=30. And the result is the sum of those 1+4+30=35.

In your example, what do you mean by new list. You calculate [10 * factor, 2 * factor] => [20, 4], but you're not using it later on.. This is the main part that confuses me in your example, if what I understand the challenge correctly by what I describe in my comment above. Also, if what I describe above is correctly, wouldn't [3,1,3,1,1,1,1,1,9,9,9,9,2,1] start with right right to maximize the sum. Maybe there is something wrong with my reasoning, but wouldn't we always want to have the smallest leading/trailing nr with the current factor to maximize the sum.

@KevinCruijssen As best as I can tell, you understand the algorithm correctly. And yet, if you start with (right, right, ...), then the maximum you can get seems to be 523. The reason as to why becomes a bit clearer (to me, at least) when you think of this backwards. Start by multiplying the 9s by large numbers that keep getting smaller. Then you have the option of multiplying a relatively large number by 1 on the left, or 2 on the right. You probably want to multiply by 2, which is why you don't take it immediately, and why the first moves are (right, left, ...).

@KevinCruijssen I'm not certain how addition works for you, but adding together everything in the left column of your pastebin sums to 523 for me: +/(1+!14)*1 2 3 1 3 1 1 1 1 1 9 9 9 9 in k.

@zgrep Woops.. You're indeed right.. Not sure how that happened.. I'll delete my comment and will take a look at the path of the current solution.

k, 48 43 38 bytes
-5 bytes thanks to ngn.
{a@*>*+a:x{(+/x*1+<y*|!#x;y)}/:+!2|-x}

Try it online! It simply tries all possibilities, and chooses the first one with the maximum value. Left/right encoded as 0/1.
{                                    } /functions accepts x
                               +!2|-x  /all possible selections
          { +/x*1+<y*|!#x   }          /calculate the total sum
           (             ;y)           /also record the selection with each sum
         x                   /:        /map over all selections
 a@*>*+a:                              /choose the one with max total sum

This can probably be golfed further.

golfed a little further: {a@*&*+a=*|/a:x{(+/x*1+<y*|!#x;y)}/:+!2|-x}

Haskell, 91 90 89 bytes
Encoding the left/right decision as 0/1:
(1%)
f%l@(h:t)|x<-f+1,(a,b)<-x%t,(c,d)<-x%init l=max(a+f*h,0:b)(c+f*last l,1:d)
_%l=(0,l)

Try it online!

Ruby, 120 bytes
->l{[*(w=[0,1]).product(*[w]*~-s=l.size).map{|x|a,b=l.clone,0;[x,x.sum{|c|(b+=1)*(c>0?a.pop: a.shift)}]}].max_by &:last}

Try it online!

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


text:
Be there, for the square
Sometimes when you're lying in bed and reading a message, your phone screen will pop into landscape mode right in the middle of a sentence. Only being able to read left to right, you find yourself incapacitated, unable to process the text in front of you.
To ensure that this won't happen again, you decide to make every message readable from any angle, whether your phone screen is rotated or mirrored. To make this happen, each message is printed as a square, with each side of the square containing the message, either in the original order or in reverse.

For backwards compatibility, the top side of the square should be the original message.
To make each message square as compact as possible, the first and last character of the message should be a part of two sides of the square. This means that the top side reads normally, the bottom side is in reverse, the left side reads top-bottom, and the right side reads bottom-top.

Input
A single string, with 2 or more characters. You should not assume that the string only contains alphanumerical characters or similar.
Output
The Squarification™ of the string. It is permissible to leave some whitespace at the end of each line, and a single newline at the end of the output.
Examples
Input: 'ab'
ab
ba

Input: 'abc'

abc
b b
cba

Input: 'Hello, world!'
Hello, world!
e           d
l           l
l           r
o           o
,           w

w           ,
o           o
r           l
l           l
d           e
!dlrow ,olleH

This challenge looks like A cube of text, but I'm hoping that it's different enough that there will be some clever answers.
As this is code-golf, get ready to trim some bytes!

Can the horizontal lines contain spaces between letters, as long as they align with margins? Example: the first line of output for abc would be a b c. Alternatively, can we output a list of lines? Nice challenge, btw

@Mr.Xcoder You may not have spaces in the middle of a line, so abc is always abc. EDIT: outputting a list of lines is allowed, just make sure that you have the joining in the footer so that answers can be verified easily.

Can we return a list of lines?

@JoKing Yes, a list of lines is allowed.

Related

"To ensure that this won't happen again, you decide to make every message readable from any angle, whether your phone screen is rotated or mirrored." - Or you could just, you know, enable the orientation lock for your phone...

@ArnavBorborah That sounds very hard, what if you forget to enable it in a moment where your immediate response is required?

"To ensure that this won't happen again,". You do it once, and then keep it on for as long as you choose. ;)

@maxb Is it ok if I take the input as an array of chars?

@LuisfelipeDejesusMunoz I'm not sure what the consensus is on that. I've looked into some meta posts, and from what I've seen it seems like char[] should be treated as a string. That would imply that taking input as a list of chars is allowed. However, please correct me if I'm mistaken.

Or you just add "rotate off" to your shortcuts that appear when you slide your finger from the top. ;-)

@EriktheOutgolfer but in a state of great confusion, how will I know which side of the phone is the top? I'd much rather use a few bytes of my phone's memory to save myself from the embarrassment of a late reply.

@maxb You are allowed to decide on your own question whether an array of chars is okay or not, along with any other input formats (base64 encoded string, sum of the squares of the factors of the Unicode values modulo 42, etc)

@Quintec I'll only allow modulo 43, get out of here with that non-prime modulo! Seriously though, thanks for the info, it'll help me with future challenges.

I suddenly have an urge to write an answer that takes input in that format

Charcoal, 4 bytes
Ｓ‖Ｏ^

Try it online! Link is to verbose version of code. Explanation:
Ｓ       Input the string and implicitly print it
 ‖      Reflect...
  Ｏ     ... overlapping the first and last character...
   ^    ... in the ↙↘ directions (^ is shorthand for ↙↘).

I'm beyond impressed, nicely done!

This challenge is a perfect fit for charcoal :)

05AB1E, 12 11 bytes
Saved 1 byte thanks to Kevin Cruijssen
g4иsûûŽ9¦SΛ

Try it online!
Explanation
g            # length of input
 4и          # quadruplicate in a list
             # these are the string lengths we'll print
   s         # push input
    ûû       # palendromize twice
             # this is the string we'll print
      Ž9¦S   # push [2,4,6,0]
             # these are the directions we'll print
          Λ  # paint on the canvas

This is just bizarre, very impressive!

@maxb: Will be interesting to see if Charcoal can do even shorter :)

Wouldn't Canvas also be suitable for something like this? I haven't coded anything in it myself, but from the other answers I've seen in Canvas it seems to be perfect for printing stuff

@maxb: It should be yes. I think this kind of challenge is pretty much what it was made for.

It is. In fact, I'm surprised that this question isn't a duplicate...

gÐD) can be g4и

@KevinCruijssen: Thanks! I didn't know that и had become a 1-byte command now :)

... in fact it is a duplicate, see https://codegolf.stackexchange.com/a/133677/17602 where I only scored 5 with Charcoal yet still got the accepted answer!

@Neil: I knew I recognized it. I just couldn't find it.

Python 2, 80 76 71 70 69 bytes
lambda s:[s]+map((' '*len(s[2:])).join,zip(s,s[:0:-1]))[1:]+[s[::-1]]

Try it online!
Python 3, 70 bytes
lambda s:[s,*map((' '*len(s[2:])).join,zip(s[1:],s[-2:0:-1])),s[::-1]]

Try it online!

Canvas, 6 bytes
⤢ｎ：±⇵ｎ

Try it here!
Explanation:
⤢       transpose the input
 n      and overlap that over the input
  :     duplicate that
   ±⇵   reverse it vertically & horizontally
     n  and overlap over the old version

Python 3, 78 76 Bytes
-2 bytes thanks to maxb!
lambda x:[x]+[x[i]+" "*(len(x)-2)+x[~i]for i in range(1,len(x)-1)]+[x[::-1]]

Try it Online!

Outputting a list of lines is allowed! Also, -i-1 can be written as ~i to save two bytes.

05AB1E, 14 bytes
¦¨s¨š.BsRøJIRª

Try it online!
Outputs as a list of lines, but the TIO link uses the old version which printed instead – Try an alternative online!. Thought I'd be nice to show how awesome the canvas is by comparing that approach to others that don't use it. See Emigna's answer for a canvas version, then compare it to mine :)
How?
¦¨s¨š.BsRøJ»,R=    Full program. Accepts a string from STDIN. | Example: "abcd"
¦¨                 Tail and pop.                              | STACK: ["bc"]
  s¨               Swap and pop.                              | STACK: ["bc", "abc"]
    š              Prepend a to b as a list.                  | STACK: [["abc", "b", "c"]]
     .B            Squarify.                                  | STACK: [["abc", "b  ", "c  "]]
       sRøJ        Interleave with the reversed input.        | STACK: [["abcd", "b  c", "c  d"]].
           »,      Join by newlines, pop and print.           | STACK: [] (the above is removed after being printed)
             R=    Print the reversed input (taken implicitly due to the empty stack).

The only thing which is different in the 14-byter is that the reversed input is appended to the list rather than printed.

Not too far off Canvas. Nice!

What's the difference between = and ,? I always (falsely) assumed = prints the last item of a list or something like that, but apparently it just prints the top of the stack with trailing newline, just like , does.. Is there a difference, or is it a duplicated 1-byte command we could use for something else?

@Kevin , pops, = doesn't. I have used them both while golfing, to be honest, so I guess each has its own purpose. :-)

@Mr.Xcoder Ah ok. Personally I haven't used = yet, but I now understand the difference, thanks. :)

MATL, 8 bytes
YTO6Lt&(

Try it online!
Explanation
Consider input 'abcd' as an example. Stack is shown bottom to top.
YT     % Implicit input: string. Create Toeplitz matrix of chars
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
O      % Push 0
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
                 0
6L     % Push [2, -1+1j]. Used as an index, this means 2:end
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
                 0,
                [2, -1+1j]
t      % Duplicate
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
                 0,
                [2, -1+1j],
                [2, -1+1j]
&(     % Write 0 into the internal entries of the char matrix.
       % STACK: ['abcd';
                 'b  c';
                 'c  b';
                 'dcba']
       % Implicitly display. Char 0 is shown as a space

Japt -R, 22 15 bytes
U+ÕÅ+UÔÅ Õ·hJUw

Try it online!

Perl 6, 55 51 bytes
{$_,|.comb[1..*-2].&{(@_ X~' 'x@_)Z~[R,] @_},.flip}

Try it online!
Returns a list of lines.
Explanation:
{                                                 }  # Anonymous code block
 $_,    # The given string as the first line
     .comb[1..*-2]   # The string as a list of chars without the first or last char
                  .&{                      }  # Passed to a function
                     (@_ X~' 'x@_)  # Each character padded with space
                                  Z~[R,] @_   # And zipped with the reverse
    |   # Flattened
                                            ,.flip  # And the reverse of the string

Pyth, 16 15 bytes
LXXb0Qt0_Qy.tym

Try it online here, or verify all the test cases at once here (test suite joins output on newlines for easier verification, as per OP request).
LXXb0Qt0_Qy.tymdQ   Implicit: Q=eval(input())
                    Trailing d,Q inferred
L                   Define a function, y(b), as:
  Xb                  Replace in b...
    0                 ... at position 0...
     Q                ... the input string
 X                    Replace in the above...
      t0              ... at position -1 (decrement 0)
        _Q            ... the reversed input string
              mdQ   Split the input string into array of characters
                      (The exact contents of the array don't matter, as long as the array
                       has the same length as the input string and the elements are
                       of length < 2)
             y      Apply the function y (defined above) to the array
                      (For Q="abc", yields ["abc", "b", "cba"]
           .t       Transpose, padding with spaces
                      (For Q="abc", yields ["abc", "b b", "c a"]
          y         Apply y to the above

Edit: OP clarified that a list of lines is acceptable as output, so removed j to join on newlines - previous version LXXb0Qt0_Qjy.tym

JavaScript (Node.js), 93 91 87 80 78 77 76 74 bytes
x=>[...x].map(c=>(w+=z=x[--j])[1]?j?c.padEnd(l-1)+z:w:x,w="",l=j=x.length)

Try it online!
Returns list of lines.
Explanation
x =>                     // Main function
 [...x].map(c =>         // For each character in the input:
  (w += z = x[--j])[1]   //  Check whether this is not the first row (by producing w, the
                         //  reverse of x, character by character, and check if len(w) > 1)
  ?                      //  If so:
   j                     //   Check if this is not the last row
   ? c.padEnd(l - 1) + z //   If so: return the needed row
   : w                   //   If not (i.e. last row): return w, the reverse of x
  : x,                   //  If not (i.e. first row): return x
  w = "",                // Stores the reverse of w
  l = j = x.length       // A variable that stores the length of the string, and a counter
 )                       // Golfing from 78 onwards is tough work.

Haskell, 80 76 72 71 bytes

Saved four eight nine bytes thanks to Laikoni.

f s=s:m[c:m(' '<$s)++[d]|(c,d)<-zip s$r s]++[r s];m=init.tail;r=reverse

Try it online!

Welcome to golfing in Haskell :) zip(m s)$m$r s can be zip<*>r$m s, though it's still 73 bytes..

(' '<$m s) can be m(' '<$s).

71 byte alternative: Try it online!

Also regarding your footer: sequence.map is mapM and intercalate"\n" is unlines.

Red, 145 127 bytes
func[s][print a: s b: tail s repeat n l:(length? s)- 2[print rejoin[pad first a:
next a l + 1 first b: back b]]print reverse s]

Try it online!

MathGolf, 20 19 15 bytes
p╡╞▒x_xh *+m+nx

Try it online!
Edited to an improved version of maxb's original 22 byte solution. Zip operator is sadly lacking though the map operator has a partial implementation.
Explanation:
p                 Print the original string ["abcd"]
 ╡╞               Remove from the start and end of the string  ["bc"]
   ▒              Convert to a list of chars  [["b","c"]]
    x_x           Reverse, dupe and reverse back again [["c","b"],["b","c"]]
       h          Get length of array without popping  [["c","b"],["b","c"],2]
         *        Create a string with that many spaces [["c","b"],["b","c"],"  "]
          +       Map adding it to every character [["c","b"],["b  ","c  "]]
           m+     Zip add each character of the reversed string [["b  c","c  b"]]
             n    Join with newlines and print
              x   Reverse the original string and implicitly output

You actually beat my MathGolf script that gave inspiration to this challenge! You're right, the zip operator is needed, and mapping for lists is quite rudimental. I'll see how I want that to work.

Java 11, 143 142 141 140 bytes
s->{for(int l=s.length(),i=l;i>0;)System.out.println(i--<l?i<1?new StringBuffer(s).reverse():s.charAt(l+~i)+" ".repeat(l-2)+s.charAt(i):s);}

-1 byte thanks to @OlivierGrégoire.
Try it online.
Explanation:
s->{                                // Method with String parameter and no return-type
  for(int l=s.length(),             //  Length of the input-String
      i=l;i>0;)                     //  Loop `i` in the range (length,0]
    System.out.println(             //   Print with trailing newline:
     i--<l?                         //    If it's NOT the first iteration:
                                    //    (and decrease `i` by 1 at the same time)
      i<1?                           //    If it's the last iteration:
       new StringBuffer(s).reverse() //     Print the input reversed
      :                              //    Else:
       s.charAt(l+~i)                //     Print the `l-i-1`'th character,
       +" ".repeat(l-2)              //     appended with length-2 amount of spaces,
       +s.charAt(i):                 //     appended with the `i`'th character
     :                               //   Else (it is the first iteration):
      s);}                           //    Print the input as is

141 bytes while moving everything to get that l+~i which saves the byte.

@OlivierGrégoire Thanks. Hadn't thought about reversing the loop. And 1 more byte could be saved with your approach by changing the if-else order a bit (by using i--<l instead of i--==l).

Ruby, 78 bytes
->s{[s.b,*s.chars.zip(s.reverse!.chars).map{|a|"%s%#{s.size-1}s"%a}[1..-2],s]}

Try it online!

Nice solution.
-1 byte: *s.chars.zip ->s.chars.zip

I want my function to return a flattened list, so I'm keeping the splat.

Do you mind explaining why you would want that? It doesn't seem to affect the output

The output of the test is the same because puts flattens the list, but the result of the function is a nested array, which is not what I want to return.

Ok, I see. Thanks for the explination.

Z80Golf, 48 bytes
00000000: 1525 13cd 0380 3806 ff4d 2377 18f5 3e0a  .%....8..M#w..>.
00000010: ff7b b928 1113 1aff 4105 2805 3e20 ff18  .{.(....A.(.> ..
00000020: f82b 7eff 18e8 131a b720 0176 ff1b 18f7  .+~...... .v....

Try it online!
  dec d
  dec h
  inc de
get:
  call $8003
  jr c, got
  rst 38h
  ld c, l
  inc hl
  ld (hl), a
  jr get

got:
  ld a, '\n'
  rst 38h
  ld a, e
  cp c
  jr z, final
  inc de
  ld a, (de)
  rst 38h
  ld b, c
spaces:
  dec b
  jr z, doneb
  ld a, ' '
  rst 38h
  jr spaces
doneb:
  dec hl
  ld a, (hl)
  rst 38h
  jr got

final:
  inc de
reverse:
  ld a, (de)
  or a
  jr nz, cont
  halt
cont:
  rst 38h
  dec de
  jr reverse

Powershell, 93 bytes
param($s)$s
if(($m=$s.Length-2)-gt0){1..$m|%{$s[$_]+' '*$m+$s[$m-$_+1]}}
-join($s[($m+2)..0])

Test script:
$f = {

param($s)$s
if(($m=$s.Length-2)-gt0){1..$m|%{$s[$_]+' '*$m+$s[$m-$_+1]}}
-join($s[($m+2)..0])

}

&$f ab
&$f abc
&$f Hello...
&$f 'Hello, world!'

Output:
ab
ba
abc
b b
cba
Hello...
e      .
l      .
l      o
o      l
.      l
.      e
...olleH
Hello, world!
e           d
l           l
l           r
o           o
,           w

w           ,
o           o
r           l
l           l
d           e
!dlrow ,olleH

APL(NARS), 59 chars, 118 bytes
{y←⊖⍵⋄0=z←¯2+⍴⍵:⊃,¨⍵ y⋄⊃(⊂⍵),({(∊1(z⍴0)1)\⍵}¨¯1↓1↓⍵,¨y),⊂y}

test
  f←{y←⊖⍵⋄0=z←¯2+⍴⍵:⊃,¨⍵ y⋄⊃(⊂⍵),({(∊1(z⍴0)1)\⍵}¨¯1↓1↓⍵,¨y),⊂y}
  f '12'
12
21
  f '123'
123
2 2
321
  f '1234'
1234
2  3
3  2
4321
  f 'Hello World!'
Hello World!
e          d
l          l
l          r
o          o
           W
W
o          o
r          l
l          l
d          e
!dlroW olleH
  f 'Hello, World!'
Hello, World!
e           d
l           l
l           r
o           o
,           W

W           ,
o           o
r           l
l           l
d           e
!dlroW ,olleH

JavaScript (Node.js), 87 bytes
s=>[...s].map((e,i,a,n=s.length)=>i<1?s:i>n-2?a.reverse().join``:e.padEnd(n-1)+a[n+~i])

Question Title is Be there, for the Square but all answers print a Rectangle
So here's the one printing square:s=>[...s].map((e,i,a,n=s.length)=>i<1?a.join` `:i>n-2?a.reverse().join` `:e.padEnd(2*n-2)+a[n+~i])
Try it online!

s[n+~i] saves 1 byte over n-i-1.

JavaScript, 92 85 bytes
Early morning golf on the bus. Not happy with it; there's definitely a shorter way :\
s=>s+`
`+(g=r=>--x?s[l-x].padEnd(l)+s[--y]+`
`+g(r+s[y]):r+s[0])(s[l=x=y=s.length-1])

Try it online

Japt, 28 bytes
Takes the input as an array of characters
íUz2)£Y©Y<UÊÉ?XqSpUÊ-2:UqÃow

íUz2)£Y©Y<UÊÉ?XqSpUÊ-2:UqÃow    Full program. Implicity input U
                                ["a", "b", "c"]
 Uz2)                           Duplicate and rotate 180°
                                ["a", "b", "c"], ["c", "b", "a"]
í                               Pair each item at the same index
                                [["a","c"],["b","b"], ["c","a"]]
     £                          Map
      Y©Y<                      If index is positive and less than
          UÊÉ?                  Length - 1
              Xq                Join with...
                SpUÊ-2          Space repeated (U length - 2) times
                                [["a","c"],"b b", ["c","a"]]
                      :Uq       Else return joined input
                                ["abc","b b", "abc"]
                         Ãow    Map last item and reverse
                                ["abc","b b", "cba"]
                                Implicity output array joined with new lines
                                "abc
                                 b b
                                 cba"

Try it online!

Jelly, 20 bytes
W;ḊW€$O‘z0ṚUoƊo33’ỌY

Try it online!
Assuming that unprintables can also be in the input.

Stax, 10 bytes
▄▀τƒ○≡ë'▲.

Run and debug it
Unpacked, ungolfed, and commented, it looks like this.
{       start a block to repeat
  Mr    rotate matrix counter-clockwise
  0     actually just a literal 0
  x     retrieve "string" from x register, initially the input string
  rX    reverse, and write it back to register
  &     assign reversed "string" to 0 index of matrix (first row)
}4*     exectue block 4 times
m       output matrix as line-separated rows

Run this one

Would í,ñl♠τ¢∞█ be fine for 9, outputting as a list of lines?

@Mr.Xcoder:  I'm not sure, but if it is, this 8 byte solution would also work.  Ç¢å╒Γ8Q#  Personally, I don't really like it.  For languages that don't have real functions I think the output should be formatted correctly on standard output, so there's nothing left to interpretation about what the internal state of different languages mean.  But on the other hand, I'm in favor of smaller programs!

C (gcc), 100 103 102 bytes

Saved a byte thanks to ceilingcat; golfing an alternative solution.

o,O;v(char*_){for(O=puts(_,o=0)-2;O-++o;)printf("%c%*c\n",_[o],O,_[O-o]);for(o=O;~o;putchar(_[o--]));}

Try it online!

Jelly,  19  18 bytes
-1 thanks to Erik the Outgolfer (managing to use another repeat, ⁺, to inline my helper Link)
WẋL¬o1¦³ṚUƊ⁺ZƊ⁺o⁶Y

A full program.
Try it online!
How?
WẋL¬o1¦³ṚUƊ⁺ZƊ⁺o⁶Y - Main Link: list of characters s
W                  - wrap s in a list
  L                - length of s
 ẋ                 - repeat (yielding a length(s) list of copies of s)
   ¬               - logical NOT (makes every element a zero - giving us a square of zeros)
             Ɗ     - last three links as a monad (say F(x)):
          Ɗ        -   last three links as a monad (say G(x)):
      ¦            -     sparse application...
     1             -       ...to indices: [1]
    o  ³           -       ...do: logical OR with the input (s)
                   -              (replaces the first list with the input)
        Ṛ          -     reverse               }
         U         -     upend (reverse each)  } (turn whole thing 180 degrees)
           ⁺       -   repeat previous link (i.e. G(that result))
            Z      -   transpose
              ⁺    - repeat previous link (i.e. F(that result))
               o⁶  - logical OR with a space character (replace all remaining zeros with spaces)
                 Y - join with newlines
                   - implicitly print

My 19 byters...
;⁶ɓJ»þ`n\«\aƊUṚ»ƊịY

Try this one, which works by building a table of indices filled with zeros and then indexing into the input with an extra space (in order to relace the 0s with spaces)
...and the one Erik improved to 18 for me:
o1¦³ṚU
WẋL¬ÇÇZƊ⁺o⁶Y

Try this one.

"Another 19"?

Oh, thanks Erik - I can't remember quite what I tried for that  double repeat, but whatever it was it was wrong!

R, 113 102 bytes
function(s,N=nchar(s),m=matrix(" ",N,N)){m[1,]=m[,1]=el(strsplit(s,""))
write(pmax(m,rev(m)),1,N,,"")}

Try it online!
Thanks to JayCe for saving 6 bytes!
Writes the string to the first row and column of the array. So long as the string contains only characters with ASCII codepoints greater or equal than 32 (space), which seems allowable by "alphanumeric characters", then the parallel maximum of the matrix and its reverse yields the appropriate matrix, which is then printed out by write.

111 bytes using intToUtf8 and cat

actually your solution can be made 107 bytes easily :)

@JayCe oh duh! I mostly just played with the indices until they were right and didn't even think to golf them! I even managed to find a few more :-)

pmax is a really good trick. I've been trying to use a vector like this but I am not managing to save bytes.

Java (JDK), 109 bytes
s->{int l=s.length,i=0;var r=new char[l][l--];for(char c:s)r[i][0]=r[0][i]=r[l-i][l]=r[l][l-i++]=c;return r;}

Try it online!
Returning a 2D array containing the characters to print. The inner of the array is filled with \0 instead of spaces because no rules said spaces have to be used.

C++, 232  231 bytes
Edit: included the include statements in byte count, removed all white spaces, and removed include string.h, Thanks Dennis
Try it online!
#include <iostream>
#include <algorithm>
using namespace std;main(int c,char **a){string s=a[1];int x=s.length()-1,i(1);cout<<s<<endl;for(;i<x;++i)cout<<s[i]<<string(x-1,' ')<<s[x-i]<<endl;reverse(s.begin(),s.end());cout<<s<<endl;}

Welcome to the site.  Indentation and most newlines are not necessary for C++, you can remove them to save bytes.

Welcome to PPCG! You can save a lot of bytes by eliminating whitespace. You should be able to save more byte by submitting a function instead of a full program. However, you do have to add #include<iostream> and #include<algorithm> to your byte count. #include<string.h> doesn't seem to be required.

Just a few more (and correct TIO link): Try it online!

222 bytes

You can most likely drop the last <<endl.

PHP, 207 Bytes
$k=str_pad('',($L=mb_strlen($s=$argv[1]))-2,' ');$p=[];for($i=1;$i<=$L;$i++){$p[]=($j=mb_substr($s,$L-$i,1));if($i==1)$b=$s;elseif($i==$L)$b=implode('',$p);else$b=mb_substr($s,$i-1,1).$k.$j;echo$b.PHP_EOL;}

Not quite a creative entry, but it supports UTF-8 at least...

J, 34, 31 30 bytes
,(1|:@|.(2+#){.|.,:])@}.@}:,|.

Try it online!
 Explanation:
 ,(1|:@|.(2+#){.|.,:])@}.@}:,|.
                            ,   - append
                             |. - the reversed input to
  (                  )@}.@}:    - the input with the first and the last chars dropped and
                |.              - its reverse
                  ,.            - laminated to
                    ]           - the trimmed input (results in a matrix 2 x length )
              {.                - take as many rows (pad with empty lines)
         (2+#)                  - as is length of the input (2+length of the trimmed input)
       |.                       - rotate
   1                            - one position to the top
    |:@                         - and transpose
 '                              - prepend with the input

(1j1&#"1,(1|."1(3++:@#){."1|.,.])@}.@}:,1j1&#"1@|.) prints in squared format

Retina 0.8.2, 78 bytes
(.+).
$1¶$&
O$^r`.\G

+`^(.*)(.)(¶(.*).)
$1¶$2$4$3
^¶

T`p` `(?<=.¶.).*(?=.¶.)

Try it online! Handliy beating my previous attempt. Explanation:
(.+).
$1¶$&

Duplicate all but one character.
O$^r`.\G

Reverse the original.
+`^(.*)(.)(¶(.*).)
$1¶$2$4$3

Move characters from the duplicate to the original one at a time, creating a filled square.
^¶

Delete the blank line now that the duplicate has been processed.
T`p` `(?<=.¶.).*(?=.¶.)

Change all inner characters to spaces.

APL (Dyalog Classic), 29 bytes
⊢⍪⌽⍪⍨1⌽⊢∘≢↑⍤1(↑⌽⍪¨⊢)∘(1↓¯1↓⊢)

Try it online!
Uses the same algorithm as my J solution.

T-SQL, 179 bytes
DECLARE @ varchar(99),@n INT=2SELECT @=v FROM i PRINT @
a:PRINT SUBSTRING(@,@n,1)+SPACE(LEN(@)-2)+SUBSTRING(REVERSE(@),@n,1)SET @n+=1IF @n<len(@)GOTO a
IF LEN(@)>2PRINT REVERSE(@)

Input is taken via pre-existing table i with varchar field v, per our IO standards.

Japt, 19 18 bytes
Returns an array of lines.
¬íU¬w)mq¢ç)hJUw)hU

Try it
Saved a byte thanks to Oliver.

You can replace U¤ with ¢

Oh, yeah. Thanks, @Oliver; I'd forgotten about ¢, can't remember the last time I used it.

VBA (Excel), 86 bytes
Using Immediate Window and Cell [a1] as input.
a=[a1]:b=StrReverse(a):c=Len(a):?a:For i=2To c-1:?Mid(a,i,1)Spc(c-2)Mid(b,i,1):Next:?b

V, 51 bytes
Ù:se ri
y$2o"mm2kÓ./&ò
dk2GddG:&&
dd'mdk$ëp'mdG

Try it online!
00000000: d93a 7365 2072 690a 7924 326f 1222 1b6d  .:se ri.y$2o.".m
00000010: 6d32 6bd3 2e2f 26f2 0a64 6b32 4764 6447  m2k../&..dk2GddG
00000020: 3a26 260a 6464 1627 6d64 6b24 16eb 7027  :&&.dd.'mdk$..p'
00000030: 6d64 47                                  mdG

Ù                                Duplicate line
 :se ri                          Enable reverse input.
y$                               Copy one line without line-break
  2o<C-r>"<Esc>                  With reverse input enabled, insert copied string in a new line twice
               mm                Set a mark in the last line
                 2kÓ./&ò         Go to second line, add a line break between each character
                                 This created the left edge of the square
dk2Gdd                           Delete first and last character of left edge
      G:&&                       Go to last line, repeat last substitution; this creates the right edge
dd                               Delete the final empty line that was just created
  <C-v>'md                       The right edge is currently below the square; delete it there
          k$<C-v>ëp              And put it in the right place
                   'mdG          Finally, remove excess new lines


text:
The Binary Fences
Input:

An integer n in the range 2 <= n <= 10
A list of positive integers

Output:
Convert the integers to their binary representation (without any leading zeroes), and join them all together.
Then determine all binary substrings that form a 'binary fence' using n amount of fence posts. The spaces (zeros) between each fence post are irrelevant (at least 1), but the fence posts themselves should all be of equal width.
Here the regexes the binary substrings should match for each n:
n   Regex to match to be a 'binary fence'   Some examples

2   ^(1+)0+\1$                              101; 1100011; 1110111;
3   ^(1+)0+\10+\1$                          10101; 1000101; 110011011;
4   ^(1+)0+\10+\10+\1$                      1010101; 110110011011; 11110111100001111001111;
etc. etc. You get the point

Looking at the n=4 examples:
1010101
^ ^ ^ ^    All fence posts have a width of one 1
 ^ ^ ^     with one or more 0s in between them

110110011011
^^ ^^  ^^ ^^    All fence posts have a width of two 1s
  ^  ^^  ^      with one or more 0s in between them

11110111100001111001111
^^^^ ^^^^    ^^^^  ^^^^    All fence posts have a width of four 1s
    ^    ^^^^    ^^        with one or more 0s in between them

We then output the numbers that use binary digits of the matches 'binary fences'.
Example:
Input: n=4, L=[85,77,71]
The binary representation of these integer joined together is:
1010101 1001101 1000111 (NOTE: The spaces are only added as clarification for the example).
Since n=4, we look for substrings matching the regex (1+)0+\10+\10+\1, in which case we can find two:
1010101 (at position (1010101) 1001101 1000111); and 11001101100011 (at position 101010(1 1001101 100011)1)
The first binary fence only uses binary digits from 85, and the second binary fence uses binary digits from all three integers. So the output in this case would be:
[[85],[85,77,71]]
Challenge rules:

Although it's also mentioned in the example above, the last sentence is an important one: We output the numbers for which binary digits are used in the 'binary fence' substring.
I/O is flexible. Input can be a list/array/stream of integers, space/comma/newline delimited string, etc. Output can be a 2D integer-list, a single delimited string, a string-list, new-line printed to STDOUT, etc. All up to you, but please state what you've used in your answer.
Output order of the list itself is irrelevant, but the output of each inner list is of course in the same order as the input-list. So with the example above, [[85,77,71],[85]] is a valid output as well, but [[85],[77,85,71]] is not.
As you may have already noticed from the example (the 85), binary-digits can be used multiple times.
The regexes should match the substring entirely. So 110101 or 010101 aren't ever a valid 'binary fences' (10101 is however, iff n=3).
Items in the output-list aren't unique, only the binary-positions of the 'binary fences' are unique. If multiple 'binary fences' can be created with the same integer(s), we add them multiple times to the output-list.
For example: n=2, L=[109, 45] (binary 1101101 101101) can form these 'binary fence' substrings: 11011 (at position (11011)01 101101); 101 (at position 1(101)101 101101); 11011 (at position 110(1101 1)01101); 101 (at position 1101(101) 101101); 11011 (at position 110110(1 1011)01); 101 (at position 1101101 (101)101); 101 (at position 1101101 101(101)), so the output would be [[109],[109],[109,45],[109],[109,45],[45],[45]].
Another example: n=2, L=[8127] (binary 1111110111111) can form these 'binary fence' substrings: 1111110111111 (at position (1111110111111)); 11111011111 (at position 1(11111011111)1); 111101111 (at position 11(111101111)11); 1110111 (at position 111(1110111)111); 11011 (at position 1111(11011)1111); 101 (at position 11111(101)11111), so the output would be [[8127],[8127],[8127],[8127],[8127],[8127]].
If no valid output is possible, you can return an empty list or some other kind of falsey output (null, false, throws an error, etc. Again, your call).

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.

Test cases:
Input:                       Output
                             (the binary below the output are added as clarification,
                             where the parenthesis indicate the substring matching the regex):

4, [85,77,71]                [[85],[85,77,71]]
                             (1010101) 1001101 1000111; 101010(1 1001101 100011)1

2, [109,45]                  [[109],[109],[109,45],[109],[109,45],[45],[45]]
                             (11011)01 101101; 1(101)101 101101; 110(1101 1)01101; 1101(101) 101101; 110110(1 1011)01; 1101101 (101)101; 1101101 101(101)

3, [990,1,3,3023,15,21]      [[990,1,3,3023],[990,1,3,3023],[1,3,3023],[21]]
                             (1111011110 1 11 1)01111001111 1111 10101; 11110(11110 1 11 101111)001111 1111 10101; 1111011110 (1 11 101111001111) 1111 10101; 1111011110 1 11 101111001111 1111 (10101)

2, [1,2,3,4,5,6,7,8,9,10]    [[1,2,3],[2,3],[4,5],[5],[5,6,7],[6,7],[6,7],[8,9],[9],[10]]
                             (1 10 11) 100 101 110 111 1000 1001 1010; 1 (10 1)1 100 101 110 111 1000 1001 1010; 1 10 11 (100 1)01 110 111 1000 1001 1010; 1 10 11 100 (101) 110 111 1000 1001 1010; 1 10 11 100 10(1 110 111) 1000 1001 1010; 1 10 11 100 101 (110 11)1 1000 1001 1010; 1 10 11 100 101 1(10 1)11 1000 1001 1010; 1 10 11 100 101 110 111 (1000 1)001 1010; 1 10 11 100 101 110 111 1000 (1001) 1010; 1 10 11 100 101 110 111 1000 1001 (101)0

3, [1,2,3,4,5,6,7,8,9,10]    [[4,5],[8,9]]
                             1 10 11 (100 101 )110 111 1000 1001 1010; 1 10 11 100 101 110 111 (1000 1001) 1010

10, [1,2,3,4,5,6,7,8,9,10]   []
                             No binary fences are possible for this input

6, [445873,2075]             [[445873,2075],[445873,2075],[445873,2075]]
                             (1101100110110110001 1)00000011011; 110(1100110110110001 100000011)011; 1101100(110110110001 100000011011)

2, [8127]                    [[8127],[8127],[8127],[8127],[8127],[8127]]
                             (1111110111111); 1(11111011111)1; 11(111101111)11; 111(1110111)111; 1111(11011)1111; 11111(101)11111

2, [10,10]                   [[10],[10,10],[10]]
                             (101)0 1010; 10(10 1)010; 1010 (101)0

4, [10,10,10]                [[10,10],[10,10,10],[10,10]]
                             (1010 101)0 1010; 10(10 1010 1)010; 1010 (1010 101)0

Ah, shucks, you posted this just as class started!

Isn't [1,2,3] valid for testcase 4? I see the fence (1 10 11)

@TFeld You're completely right! I'll edit it.

Ok, I think I got it right this time. I didn't read the last sentence of the example carefully enough. (Since it is a very important one, maybe it should not be mentioned within the example.)

@Arnauld Here a pastebin with step-by-step explanation.

@Arnauld I've added the last sentence of the example as first rule now. I hope that makes it more apparent.

I'd suggest to add a test case where the same integer appears multiple times in the list, for example 2, [10, 10] which should result in [[10],[10,10],[10]] if I understand the challenge correctl.y

@ETHproductions I think it should be ^(1+)(?:0+\1){n}$, because we need n fence pieces

@nwellnhof Added the suggested test case, and you're indeed right it should result in [[10],[10,10],[10]].

Husk, 33 bytes
ṠṘmȯF-mȯ#öΛΛ=⁰Fzż+C2gQṁḋmëhohttIQ

Try it online!
Passes all test cases.
This was a difficult challenge and my solution feels somewhat convoluted.
Explanation
The program loops through the slices of the input, and repeats each as many times as it contains a match of the regex.
We want to count only those matches that overlap the binary expansion of every number in the slice.
This seems difficult, but it's easier to count those matches that do not use the first number: just remove that number and count all matches.
To get the good matches, we thus count all matches, then subtract the number of matches that don't use the first number, and those that don't use last number.
The matches that use neither are counted twice, so we must add them back to get the correct result.
Counting the number of matches in a slice is a matter of concatenating the binary expansions and looping over the slices of the result.
Since Husk has no support for regexes, we use list manipulation to recognize a match.
The function g splits a slice to groups of equal adjacent elements.
Then we must verify the following:

The first group is a 1-group.
The number of groups is odd.
The number of 1-groups is equal to the first input n.
The 1-groups have equal lengths.

First we cut the groups into pairs.
If 1 and 2 hold, then the first group of each pair is a 1-group and the last pair is a singleton.
Then we reduce this list of pairs by zipping them with componentwise addition.
This means that the 1-groups and 0-groups are added separately.
The addition preserves overflowing elements, so adding [1,1,1] and [1,1] gives [2,2,1].
Zipping does not, so if the last pair is a singleton, the componentwise sum of the 0-groups vanishes from the result.
Finally, we check that all numbers in the result are equal to n.
ṠṘm(...)Q  First input is explicit, say 3, second is implicit.
        Q  List of slices.
  m(...)   Map this function (which counts good matches) over the slices
ṠṘ         and replicate each by the corresponding number.

F-m(...)mëhohttI  Count good matches. Argument is a slice, say [6,2,5].
         ë        Define a list of 4 functions:
          h        remove first element,
           oht     remove first and last element,
              t    remove last element,
               I   identity.
        m         Apply each: [[2,5],[2],[6,2],[6,2,5]]
  m(...)          Map function (which counts all matches): [0,0,1,2]
F-                Reduce by subtraction: 1
                  In Husk, - has reversed arguments, so this computes
                  M(x) - (M(tx) - (M(htx) - M(hx)))
                  where M means number of matches.

#(...)Qṁḋ  Count all matches. Argument is a slice.
       ṁ   Map and concatenate
        ḋ  binary expansions.
      Q    List of slices.
#(...)     Count number of truthy results of function (which recognizes a match).

ΛΛ=⁰Fzż+C2g  Recognize a match. Argument is list of bits, say [1,1,0,1,1,0,0,0,1,1].
          g  Group elements: [[1,1],[0],[1,1],[0,0,0],[1,1]]
        C2   Cut into pairs: [[[1,1],[0]],[[1,1],[0,0,0]],[[1,1]]]
    F        Reduce by
     z       zip (discarding extraneous elements) with
      ż      zip (preserving extraneous elements) with
       +     addition: [[3,3]]
Λ            For all lists
 Λ           all elements
  =⁰         are equal to first input.

Perl 6, 114 112 110 107 106 104 bytes
->\n,\L{L[map {[...] flat(^L Zxx(L>>.msb X+1))[.from,.to-1]},L.fmt('%b','')~~m:ov/(1+)<{"0+$0"x n-1}>/]}

Try it online!
Explanation
->\n,\L{  # Anonymous block taking arguments n and L
 L[       # Return elements of L
   map {  # Map matches to ranges
    [...] # Create range from start/end pair
          # Map indices into binary string to indices into L
          flat(     # Flatten
               ^L   # indices into L
               Zxx  # repeated times
               (L>>.msb X+1)  # length of each binary representation
          )
          # Lookup start/end pair in map above
          [.from,.to-1]
   },
   L.fmt('%b','')  # Join binary representations
   ~~              # Regex match
   m:ov/(1+)<{"0+$0"x n-1}>/  # Find overlapping matches
 ]
}

JavaScript (ES6), 187 184 177 173 bytes
Takes input as (n)(list). Returns an array of arrays.
n=>a=>(g=p=>(m=s.slice(p).match(`(1+)(0+\\1){${n-1}}`))?[a.filter((_,i)=>-~b[i-1]<p+m[0].length&b[i]>=p,p-=~m.index),...g(p)]:[])(s=[],b=a.map(n=>(s+=n.toString(2)).length))

Try it online!
How?
We first compute the binary string \$s\$ and a list \$b\$ that describes the bounds of each number in \$s\$.
s = [], b = a.map(n => (s += n.toString(2)).length)

Example:
                      (0)     7     13
                       v      v     v
a = [109, 45] --> s = "1101101101101" --> b = [7, 13]
                       \_____/\____/
                         109    45

We use the following template to generate a regular expression matching binary fences:
`(1+)(0+\\1){${n-1}}`

This regular expression is applied to \$s\$, starting from a position \$p\$.
m = s.slice(p).match(`(1+)(0+\\1){${n-1}}`)

We start with \$p=0\$ and update it at each iteration according to the position of the previous match.
Whenever a match \$m\$ is found in \$s\$: for each \$i\$-th number in the input array, we test whether the interval made of its bounds (stored in \$b\$) overlaps the interval made of the starting and ending positions of \$m\$ in \$s\$.
a.filter((_, i) => -~b[i - 1] < p + m[0].length & b[i] >= p, p -= ~m.index)

Python 2, 271 246 223 214 208 202 200 195 bytes
lambda n,l,R=range,L=len:sum([next(([l[i:j+1]]for j in R(i,L(l))if re.match('(1+)'+r'(0+\1)'*~-n,('{:b}'*(1+j-i)).format(*l[i:])[o:])),[])for i in R(L(l))for o in R(L(bin(l[i]))-2)],[])
import re

Try it online!

Python 2, 182 bytes
lambda n,L,b='{:b}'.format:[zip(*set([t
for t in enumerate(L)for _ in b(t[1])][slice(*m.span(1))]))[1]for
m in re.finditer('(?=((1+)'+r'[0]+\2'*~-n+'))',''.join(map(b,L)))]
import re

Try it online!

This seems to give an error for any n input larger than 2. Also, even with n=2 it gives an incorrect result for the test case n=2, L=[10,10]. The other test cases with n=2 work, though.

Oh, I see why it fails for [10,10]; let me see how costly it is to fix that…

@KevinCruijssen I fixed both issues (at the cost of 22 bytes, oh well!)

05AB1E, 38 36 35 bytes
Œεy¨D¦y¦)bJεŒεγ0KDËsgIQyнyθP}}OÆFy,

Inspired by @Zgarb's Husk answer.
Output the lists newline-delimited.
Try it online or verify all test cases.
Explanation:
Œ            # Get the sublists of the (implicit) input-list
 ε           # Loop `y` over each sublist:
             #  (implicitly push `y`)
  y¨         #  Push `y` with the last item removed
  D¦         #  Push `y` with the first and last items removed
  y¦         #  Push `y` with the first item removed
  )          #  Wrap all four into a list
   b         #  Get the binary-string of each integer
    J        #  Join each inner list together
     ε       #  Map each converted binary-string to:
      Œ      #   Get all substrings of the binary-string
      ε      #   Map each binary substring to:
       γ     #    Split it into chunks of equal adjacent digits
       0K    #    Remove all chunks consisting of 0s
       DË    #    Check if all chunks consisting of 1s are the same
       sgIQ  #    Check if the amount of chunks of 1s is equal to the second input-integer
       yн    #    Check if the substring starts with a 1
       yθ    #    Check if the substring end with a 1
       P     #    Check if all four checks above are truthy for this substring
             #    (1 if truthy; 0 if falsey)
     }}      #  Close both maps
       O     #  Take the sum of each inner list
        Æ    #  Reduce the list of sums by subtraction
         F   #  Loop that many times:
          y, #   And print the current sublist `y` with a trailing newline


text:
Ternary-if Converter

In Java/.NET/C/JavaScript/etc. you can use ternary-ifs to shorten if-statements.
For example (in Java):
// there is a String `s` and an int `i`
if(i<0)s="Neg";else if(i>0)s="Pos";else s="Neut";

Can be shortened with a ternary-if to:
s=i<0?"Neg":i>0?"Pos":"Neut";

Challenge:
Input: A regular if-else (possible with nesting) that sets a single variable.
Output: The converted ternary-if.
Challenge rules:

You can assume all if-else cases are possible without brackets (so each if/else-if/else block has a single body).
You can assume there won't be any spaces, tabs, or new-lines, except for a single space after each else (including at else if).
You can assume the variable names used are always a single lowercase letter ([a-z]).
The values given to the variables can be one of:

Strings (without spaces/tabs/new-lines), which will be surrounded by double-quotes (i.e. "Test", "SomeString", "Example_string", etc.). You can assume the strings will never contain the substrings if or else, nor will it contain spaces, tabs, newlines, (escaped) double-quotes, or the character =. It can contain the characters ><(){}[];?:!&|, but will be in the printable ASCII range only (['!' (33), '~' (126)]).
Integers (i.e. 0, 123, -55, etc.)
Decimals (i.e. 0.0, 0.123, -55.55, etc.)

The values won't ever be mixed. So all variables assigned are integers, and not some are integers and some are strings.
The conditions within parenthesis can contain the following characters =<>!+-/*%&|[], a-z, 0-9. You can assume there won't be any inner parenthesis, and you can also assume there won't be any (confusing) fields of more than one character used (like if(if<0)).
You can assume there won't be any short-cuts like i*=10 instead of i=i*10.
You won't have to handle dangling else cases, so all if can be paired up with an else. I.e. if(a)if(b)r=0;else r=1; isn't a possible input-case. if(a)if(b)r=0;else r=1;else r=2; or if(a&&b)r=0;else if(a&&!b)r=1;else r=-1; are however.
I/O is flexible. Input and Output can be a string, list of characters, read from STDIN, output to STDOUT, etc. Your call.
All ternaries will have a right associativity, as is the standard in most languages (but not in for example PHP).

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if possible.

Test cases:
Input:   if(i<0)s="Neg";else if(i>0)s="Pos";else s="Neut";
Output:  s=i<0?"Neg":i>0?"Pos":"Neut";

Input:   if(i%2<1)r=10;else r=20;
Output:  r=i%2<1?10:20;

Input:   if(n<10)if(m<0)i=0;else i=10;else if(m<0)i=-1;else i=1;
Output:  i=n<10?m<0?0:10:m<0?-1:1;

Input:   if(i==1)i=0.0;else i=0.25;
Output:  i=i==1?0.0:0.25;

Input:   if(!a)if(b)r=0;else r=1;else r=2;
Output:  r=!a?b?0:1:2;

Input:   if(a)if(b)r=0;else r=1;else if(c)r=2;else r=3;
Output:  r=a?b?0:1:c?2:3;

Input:   if(a&&b)r=0;else if(a&&!b)r=1;else r=-1;
Output:  r=a&&b?0:a&&!b?1:-1;

Input:   if(i[0]>0)if(j>0)if(q>0)r="q";else r="j";else r="i";else r="other";
Output:  r=i[0]>0?j>0?q>0?"q":"j":"i":"other";

Input:   if(i>0)r="i";else if(j>0)r="j";else if(q>0)r="q";else r="other";
Output:  r=i>0?"i":j>0?"j":q>0?"q":"other";

Input:   if(a>0)if(a<2)x="one";else if(a<3)x="two";else if(a<4)x="three";else x="other";else x="other";
Output:  x=a>0?a<2?"one":a<3?"two":a<4?"three":"other":"other";

Input:   if(b[0]<=b[1])q=5;else if(b[0]==null)q=0;else q=-10;
Output:  q=b[0]<=b[1]?5:b[0]==null?0:-10;

Technically, in F# if ... then ... else is the ternary operator. So if you write let result = if 10 > 100 then 99 else -99 then the value of result would be -99.

@Ciaran_McCarthy I would expect that to be the case for most, if not all functional leaning languages that have conditional expressions as the default. Clojure, Scala, and Haskell are the same.

@tsh Oops.. I shouldn't add test cases late in the evening after a day of work.. Fixed.

JavaScript Compressor Closure Compiler works great on all these testcases. Which when taking the given inputs would just generate the expected outputs. But it seems that I cannot claim it as an answer. So I would like to comment here.

Retina 0.8.2, 32 bytes
+r`if.(.*?)\)(.=)
$2$1?
;.{6}=
:

Try it online! Explanation:
r`if.(.*?)\)(.=)
$2$1?

Handle an if immediately before an assignment by moving the assignment before the condition and appending a ?. The stage is matched right-to-left to ensure we get the if closest to the assignment, while the \) ensures that we don't match else by mistake.
+

Repeat the stage to take care of nested ifs.
;.{6}=
:

Any remaining assignments are elses so replace the ;else ?= with a :.

@nwellnhof Thanks for pointing that out; I thought I was golfing a byte off there because it worked on the test cases.

Python 2, 126 121 120 114 100 bytes
lambda s:findall(' (.=)',s)[0]+sub('if.(.*?)\)(.=)?',r'\1?',sub('.{5} (.=)?',':',s))
from re import*

Try it online!

Saved:

-1 byte, thanks to Kevin Cruijssen

@KevinCruijssen Thanks :)

Why is the function definition before the import?

@Skyler It doesn't actually matter, but it's easier to put the assignment in the header this way

Perl 5 -p, 50 49 48 bytes
s/if.(.*?)\)(.=)/\2\1?/g;s/.if./?/g;s/;.{6}=/:/g

Try it online!
The 48 byte version is inspired by Neil's Retina answer.
Explanation
# Replace "if(e1)if(e2)x=" with "x=e1)if(e2?"
s/if.(.*?)\)(.=)/\2\1?/g;
# Replace ")if(" with "?"
s/.if./?/g;
# Replace ";else x=" with ":"
s/;.{6}=/:/g

Old 49 byte solution
s/.{5} (.=)?/:/g;s/if.(.*?)\)(.=)?/\1?/g;$_=$2.$_

Ruby, 72 71 bytes
->s{$a=$2while s.gsub!(/if.(.*?)\)(.=)?(.*?);\w* (.=)?/,'\1?\3:');$a+s}

Try it online!

Either ;else or else  can be .{5} to save a byte.

Thanks, I found something different with the same effect.

Kakoune v2018.09.04, 43 38 37 bytes
xs\w=(?!=)<ret>d<a-h>Psif.<ret>df);r?xs;else<space><ret>c:<esc>

Explanation:
Kakoune is a multiple selection based, modal editor, inspired by Vim.

x select the whole line
s ... <ret> filter the selection with the regular expression \w=(?!=), which matches all variable assignments, and doesn't match == comparisons
d delete each selection and put its contents in the default register
<a-h> extend all selections to the beginning of their line
P paste the content of the default register before each selection
s ... <ret> filter the selection with the regular expression if.
d delete each selection
f extend each selection forward to the next )
; reduce each selection to its cursor
r replace each character of each selection with ?
x select the whole line
s ... <ret> filter the selection with ;else<space>
c ... <esc> clear each selection and replace it with :

animation of the code on a test case:

Hmm, I've never heard of Kakoune before. I guess there isn't any online compiler for it? If not, could you perhaps add some screenshots of some of the test cases so I can verify it works as intended? Also, if this is your language, you could contact Dennis in the talk.tryitonline.net chat to ask if he could add it to TIO.

@KevinCruijssen I added a gif of one of the test cases. It works on all of them, but making the gifs isn't trivial.

Thanks for the explanation and gif, +1 from me. :) Always nice to learn about a new language.

Java (JDK), 119 116 bytes
Almost entirely pure regex solution, chopped and changed a bit from a couple of the other answers.
-3 bytes thanks to some more regex trickery from Kevin
s->s.replaceAll(".*(.=).*","$1$0").replaceAll("if.(.*?)\\)","$1?").replaceAll("([ ?]).=","$1").replace(";else ",":")

Try it online!
Explanation
s->                                         // Lambda function taking a String
   s.replaceAll(".*(.=).*","$1$0")          // Find assigned variable and append to start of String
    .replaceAll("if.(.*?)\\)","$1?")        // Replace any 'if' statements with their condition
                                            // followed by '?'
    .replaceAll("([? ]).=","$1")            // Remove all assignments after a '?' or space
    .replace(";else ",":");                 // Simple replace (no regex) to remove 'else' statements

I like the ".*(.=).*","$1$0" you've used, it's 1 byte shorter than the "^(.*)(.=)","$2$1" I had in mind. :) Anyway, you can save 2 bytes changing if\\( to if. and an additional byte changing (\\?| ) to ([? ]). Try it online 116 bytes.

@KevinCruijssen Cheers! I spent so long trying to whittle the regex down, I can't believe I missed that!

Clean, 386 375 216 196 189 bytes
Look ma, no regex!
import StdEnv,Data.List
?[_,'=':b]= $b
?b= $b
$['if(':s]#(h,[_:t])=span((<>)')')s
=h++['?': ?t]
$[';else ':s]=[':': ?s]
$[a:b]|b>[]=[a: $b]=b
@s=hd[[v,e: $s]\\['else ',v,e=:'=':_]<-tails s]

Try it online!

JavaScript (Node.js), 80 bytes
s=>(p=s.replace(/(?:if.(.*?)\)|;.*? )(.=)?/g,(_,t,v)=>(V=v||V,t)?t+'?':':'),V+p)

Try it online!
Thanks to Kevin Cruijssen, 2 bytes saved.

if\( can be if. and ;else  can be ;.{5} to save 2 bytes